@imtbl/checkout-widgets 2.24.7 → 2.24.9-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/dist/browser/{AddTokensWidget-aAZMavtt.js → AddTokensWidget-CIR8BF_I.js} +24 -297
  2. package/dist/browser/{BridgeWidget-CWWCr015.js → BridgeWidget-C5Uljhhx.js} +13 -294
  3. package/dist/browser/{CommerceWidget-B36D9SAt.js → CommerceWidget-CeBBYCbK.js} +17 -47
  4. package/dist/browser/{FeesBreakdown-WeqZxAT6.js → FeesBreakdown-BU4haotD.js} +1 -1
  5. package/dist/browser/{OnRampWidget-DpxysET8.js → OnRampWidget-Ccvb3QkT.js} +5 -80
  6. package/dist/browser/{SaleWidget-CMkn5eAJ.js → SaleWidget-CPARFlzv.js} +61 -219
  7. package/dist/browser/{SpendingCapHero-BuWrv_Rb.js → SpendingCapHero-B-0YYZho.js} +1 -1
  8. package/dist/browser/{SwapWidget-CEnCMtGs.js → SwapWidget-ujE6uX-N.js} +12 -206
  9. package/dist/browser/{TokenImage-EqfdG328.js → TokenImage-BeUf_Ulv.js} +1 -1
  10. package/dist/browser/{TopUpView-D3BxE8R3.js → TopUpView-GMv3360Q.js} +3 -54
  11. package/dist/browser/{WalletApproveHero-C_8es7r9.js → WalletApproveHero-BJi7ufqM.js} +4 -12
  12. package/dist/browser/{WalletWidget-Czye7zS5.js → WalletWidget-BABrqsfd.js} +4 -96
  13. package/dist/browser/{index-WfurfROg.js → index-CcxHW36j.js} +1275 -9717
  14. package/dist/browser/{index-CcLq9am4.js → index-Cp1w6map.js} +1 -1
  15. package/dist/browser/index.js +1 -1
  16. package/dist/browser/{useInterval-CrmneADn.js → useInterval-DbCsm_gG.js} +1 -1
  17. package/dist/types/components/FormComponents/SelectForm/SelectForm.d.ts +1 -5
  18. package/dist/types/components/FormComponents/SelectInput/SelectInput.d.ts +1 -5
  19. package/dist/types/components/Transak/TransakIframe.d.ts +0 -1
  20. package/dist/types/components/Transak/useTransakEvents.d.ts +0 -4
  21. package/dist/types/components/WalletDrawer/ConnectWalletDrawer.d.ts +1 -2
  22. package/dist/types/lib/squid/hooks/useExecute.d.ts +1 -2
  23. package/dist/types/views/top-up/TopUpView.d.ts +1 -5
  24. package/dist/types/widgets/add-tokens/hooks/useError.d.ts +1 -1
  25. package/dist/types/widgets/purchase/components/PurchaseConnectWalletDrawer.d.ts +1 -3
  26. package/dist/types/widgets/sale/hooks/useSaleEvents.d.ts +5 -31
  27. package/dist/types/widgets/swap/components/Fees.d.ts +1 -1
  28. package/package.json +7 -9
  29. package/src/components/ConnectLoader/ConnectLoader.tsx +0 -16
  30. package/src/components/FormComponents/SelectForm/SelectForm.tsx +2 -18
  31. package/src/components/FormComponents/SelectInput/SelectInput.tsx +1 -12
  32. package/src/components/RouteOptionsDrawer/RouteOptionsDrawer.tsx +2 -26
  33. package/src/components/Transactions/ChangeWallet.tsx +1 -12
  34. package/src/components/Transactions/ClaimWithdrawalInProgress.tsx +0 -11
  35. package/src/components/Transactions/NoTransactions.tsx +0 -10
  36. package/src/components/Transactions/TransactionItemWithdrawPending.tsx +1 -13
  37. package/src/components/Transactions/Transactions.tsx +2 -28
  38. package/src/components/Transak/TransakIframe.tsx +0 -6
  39. package/src/components/Transak/useTransakEvents.ts +1 -70
  40. package/src/components/WalletDrawer/ConnectWalletDrawer.tsx +2 -35
  41. package/src/components/WalletDrawer/PayWithWalletDrawer.tsx +0 -1
  42. package/src/context/view-context/test-components/ViewContextTestComponent.tsx +14 -15
  43. package/src/lib/squid/hooks/useExecute.ts +5 -18
  44. package/src/views/top-up/TopUpView.tsx +5 -56
  45. package/src/widgets/add-tokens/AddTokensRoot.tsx +28 -29
  46. package/src/widgets/add-tokens/AddTokensWidget.tsx +2 -17
  47. package/src/widgets/add-tokens/components/TokenDrawerMenu.tsx +2 -18
  48. package/src/widgets/add-tokens/hooks/useError.tsx +1 -18
  49. package/src/widgets/add-tokens/hooks/useErrorHandler.ts +2 -12
  50. package/src/widgets/add-tokens/views/AddTokens.tsx +8 -154
  51. package/src/widgets/add-tokens/views/Review.tsx +6 -94
  52. package/src/widgets/bridge/BridgeWidget.tsx +0 -35
  53. package/src/widgets/bridge/BridgeWidgetRoot.tsx +17 -18
  54. package/src/widgets/bridge/components/BridgeForm.tsx +0 -20
  55. package/src/widgets/bridge/components/BridgeReviewSummary.tsx +1 -49
  56. package/src/widgets/bridge/components/WalletAndNetworkSelector.tsx +3 -122
  57. package/src/widgets/bridge/views/ApproveTransaction.tsx +1 -15
  58. package/src/widgets/bridge/views/Bridge.tsx +1 -16
  59. package/src/widgets/bridge/views/BridgeReview.tsx +1 -12
  60. package/src/widgets/bridge/views/ClaimWithdrawal.tsx +0 -11
  61. package/src/widgets/bridge/views/MoveInProgress.tsx +0 -24
  62. package/src/widgets/bridge/views/WalletNetworkSelectionView.tsx +1 -12
  63. package/src/widgets/connect/ConnectWidget.tsx +2 -18
  64. package/src/widgets/connect/ConnectWidgetRoot.tsx +15 -16
  65. package/src/widgets/connect/components/WalletList.tsx +6 -55
  66. package/src/widgets/connect/views/ConnectWallet.tsx +1 -12
  67. package/src/widgets/connect/views/ReadyToConnect.tsx +2 -29
  68. package/src/widgets/connect/views/SwitchNetworkEth.tsx +3 -22
  69. package/src/widgets/connect/views/SwitchNetworkZkEVM.tsx +0 -18
  70. package/src/widgets/immutable-commerce/CommerceWidgetRoot.tsx +17 -19
  71. package/src/widgets/on-ramp/OnRampWidget.tsx +0 -2
  72. package/src/widgets/on-ramp/OnRampWidgetRoot.tsx +23 -24
  73. package/src/widgets/on-ramp/views/OnRampMain.tsx +1 -91
  74. package/src/widgets/purchase/PurchaseWidgetRoot.tsx +22 -23
  75. package/src/widgets/purchase/components/PurchaseConnectWalletDrawer.tsx +2 -34
  76. package/src/widgets/purchase/components/PurchaseDeliverToWalletDrawer.tsx +0 -1
  77. package/src/widgets/purchase/components/PurchasePayWithWalletDrawer.tsx +0 -2
  78. package/src/widgets/purchase/components/PurchaseRouteOptionsDrawer/RouteOptionsDrawer.tsx +1 -30
  79. package/src/widgets/purchase/components/WithCard.tsx +0 -4
  80. package/src/widgets/purchase/views/Purchase.tsx +1 -2
  81. package/src/widgets/sale/SaleWidget.tsx +0 -2
  82. package/src/widgets/sale/SaleWidgetRoot.tsx +32 -33
  83. package/src/widgets/sale/components/OrderReview.tsx +2 -29
  84. package/src/widgets/sale/components/WithCard.tsx +0 -2
  85. package/src/widgets/sale/hooks/useSaleEvents.ts +3 -185
  86. package/src/widgets/sale/views/OrderSummary.tsx +2 -15
  87. package/src/widgets/sale/views/PayWithCard.tsx +4 -46
  88. package/src/widgets/sale/views/PayWithCoins.tsx +4 -9
  89. package/src/widgets/sale/views/PaymentMethods.tsx +3 -6
  90. package/src/widgets/sale/views/SaleErrorView.tsx +1 -1
  91. package/src/widgets/swap/SwapWidget.tsx +0 -24
  92. package/src/widgets/swap/SwapWidgetRoot.tsx +29 -30
  93. package/src/widgets/swap/components/Fees.tsx +1 -1
  94. package/src/widgets/swap/components/SwapForm.tsx +2 -140
  95. package/src/widgets/swap/views/ApproveERC20Onboarding.tsx +1 -36
  96. package/src/widgets/swap/views/SwapCoins.tsx +0 -17
  97. package/src/widgets/swap/views/SwapInProgress.tsx +0 -14
  98. package/src/widgets/transfer/TransferForm.tsx +3 -25
  99. package/src/widgets/transfer/TransferWidget.tsx +1 -23
  100. package/src/widgets/wallet/WalletWidgetRoot.tsx +24 -25
  101. package/src/widgets/wallet/components/BalanceItem/BalanceItem.tsx +1 -50
  102. package/src/widgets/wallet/components/NetworkMenu/NetworkMenu.tsx +0 -13
  103. package/src/widgets/wallet/components/WalletAddress/WalletAddress.tsx +0 -13
  104. package/src/widgets/wallet/views/CoinInfo.tsx +1 -12
  105. package/src/widgets/wallet/views/Settings.tsx +1 -15
  106. package/src/widgets/wallet/views/WalletBalances.tsx +0 -24
  107. package/tsconfig.json +0 -1
  108. package/dist/browser/auto-track-BcwQjFJ1.js +0 -105
  109. package/dist/browser/index-BSnE_6oQ.js +0 -27
  110. package/dist/browser/index-CKGatDzP.js +0 -60
  111. package/dist/browser/index-Cnt0i-EY.js +0 -65
  112. package/dist/browser/index-DLXeqRzN.js +0 -65
  113. package/dist/browser/index-MANbU_qG.js +0 -5634
  114. package/dist/browser/index-lHICKwNF.js +0 -446
  115. package/dist/browser/index.umd-Cn1Q502t.js +0 -32
  116. package/dist/browser/is-plan-event-enabled-mXX0dwl-.js +0 -17
  117. package/dist/types/context/analytics-provider/CustomAnalyticsProvider.d.ts +0 -7
  118. package/dist/types/context/analytics-provider/SegmentAnalyticsProvider.d.ts +0 -42
  119. package/dist/types/context/analytics-provider/SetupAnalytics.d.ts +0 -7
  120. package/dist/types/lib/analytics/identifyUser.d.ts +0 -8
  121. package/dist/types/lib/analytics/identifyUser.test.d.ts +0 -1
  122. package/src/context/analytics-provider/CustomAnalyticsProvider.tsx +0 -22
  123. package/src/context/analytics-provider/SegmentAnalyticsProvider.ts +0 -41
  124. package/src/context/analytics-provider/SetupAnalytics.tsx +0 -35
  125. package/src/lib/analytics/identifyUser.test.ts +0 -44
  126. package/src/lib/analytics/identifyUser.ts +0 -26
@@ -1,9 +1,9 @@
1
- import { u as useTranslation, s as jsxs, df as quickswapFooterStyles, t as Box, dg as quickswapFooterLogoStyles, q as jsx, y as Body, dh as quickswapFooterDisclaimerTextStyles, di as WidgetTheme, X as getRemoteImage, r as reactExports, v as Button, aA as Drawer, R as CloudImage, H as Heading, cE as Logo, dj as getImxTokenImage, cb as formatUnits, j as calculateCryptoToFiat, F as tokenValueFormat, ci as isGasFree, p as parseUnits, i as formatZeroAmount, cz as ShimmerBox, bF as PriceDisplay, aF as Fragment, dk as getCryptoToUSDConversion, Z as ConnectLoaderContext, a$ as isNativeToken, cR as NATIVE, aU as ViewContext, z as useAnalytics, dl as calculateFeesFiat, U as UserJourney, cU as DEFAULT_QUOTE_REFRESH_INTERVAL, aK as isPassportProvider, dm as parseEther, N as amountInputValidation, b3 as ButtCon, bj as motion, b8 as Tooltip, bd as Icon, bM as r, V as ViewActions, a5 as SharedViews, G as getDefaultTokenImage, dn as ESTIMATE_DEBOUNCE, dp as DEFAULT_TOKEN_VALIDATION_DECIMALS, c_ as parseChainId, cZ as DEFAULT_TOKEN_DECIMALS, E as EventTargetContext, a0 as LoadingView, x as SimpleLayout, dq as sendSwapWidgetCloseEvent, M as orchestrationEvents, I as IMTBLWidgetEvents, J as HeaderNavigation, cY as IMX_TOKEN_SYMBOL, cy as CheckoutErrorType, d2 as SimpleTextBody, d3 as FooterButton, dr as CheckoutError, d0 as heroBackGroundStyles, d1 as heroImageStyles, bz as Trans, L as Link, aV as useHandover, bH as viewReducer, bI as initialViewState, ds as DEFAULT_BALANCE_RETRY_POLICY, dt as SwapDirection$1, d8 as StatusView, du as sendSwapSuccessEvent, c6 as StatusType, dv as sendSwapFailedEvent, dw as sendSwapRejectedEvent, a6 as ErrorView, bQ as ServiceUnavailableErrorView, l as TokenFilterTypes, cP as WalletProviderName } from './index-WfurfROg.js';
2
- import { S as SelectForm, T as TextInputForm, A as Accordion, b as gasAmountAccordionStyles, a as TransactionRejected, N as NetworkSwitchDrawer, W as WalletApproveHero, g as getAllowedBalances } from './WalletApproveHero-C_8es7r9.js';
3
- import { u as useInterval } from './useInterval-CrmneADn.js';
4
- import { S as SwapWidgetViews, T as TopUpView } from './TopUpView-D3BxE8R3.js';
5
- import { F as FeesBreakdown, f as fetchRiskAssessmentV2, i as isSingleAddressSanctioned } from './FeesBreakdown-WeqZxAT6.js';
6
- import { S as SpendingCapHero } from './SpendingCapHero-BuWrv_Rb.js';
1
+ import { u as useTranslation, s as jsxs, d6 as quickswapFooterStyles, t as Box, d7 as quickswapFooterLogoStyles, q as jsx, y as Body, d8 as quickswapFooterDisclaimerTextStyles, d9 as WidgetTheme, R as getRemoteImage, r as reactExports, v as Button, ay as Drawer, Q as CloudImage, H as Heading, cw as Logo, da as getImxTokenImage, c3 as formatUnits, j as calculateCryptoToFiat, D as tokenValueFormat, ca as isGasFree, p as parseUnits, i as formatZeroAmount, cr as ShimmerBox, bz as PriceDisplay, aD as Fragment, db as getCryptoToUSDConversion, X as ConnectLoaderContext, aW as isNativeToken, cI as NATIVE, aP as ViewContext, dc as calculateFeesFiat, cL as DEFAULT_QUOTE_REFRESH_INTERVAL, aG as isPassportProvider, dd as parseEther, M as amountInputValidation, a_ as ButtCon, be as motion, b3 as Tooltip, b8 as Icon, bG as r, V as ViewActions, a3 as SharedViews, F as getDefaultTokenImage, de as ESTIMATE_DEBOUNCE, df as DEFAULT_TOKEN_VALIDATION_DECIMALS, cR as parseChainId, cQ as DEFAULT_TOKEN_DECIMALS, E as EventTargetContext, _ as LoadingView, x as SimpleLayout, dg as sendSwapWidgetCloseEvent, K as orchestrationEvents, I as IMTBLWidgetEvents, G as HeaderNavigation, cP as IMX_TOKEN_SYMBOL, cq as CheckoutErrorType, cV as SimpleTextBody, cW as FooterButton, dh as CheckoutError, cT as heroBackGroundStyles, cU as heroImageStyles, bu as Trans, L as Link, aQ as useHandover, bC as viewReducer, bD as initialViewState, di as DEFAULT_BALANCE_RETRY_POLICY, dj as SwapDirection$1, c$ as StatusView, dk as sendSwapSuccessEvent, b_ as StatusType, dl as sendSwapFailedEvent, dm as sendSwapRejectedEvent, a4 as ErrorView, bK as ServiceUnavailableErrorView, l as TokenFilterTypes, cG as WalletProviderName } from './index-CcxHW36j.js';
2
+ import { S as SelectForm, T as TextInputForm, A as Accordion, b as gasAmountAccordionStyles, a as TransactionRejected, N as NetworkSwitchDrawer, W as WalletApproveHero, g as getAllowedBalances } from './WalletApproveHero-BJi7ufqM.js';
3
+ import { u as useInterval } from './useInterval-DbCsm_gG.js';
4
+ import { S as SwapWidgetViews, T as TopUpView } from './TopUpView-GMv3360Q.js';
5
+ import { F as FeesBreakdown, f as fetchRiskAssessmentV2, i as isSingleAddressSanctioned } from './FeesBreakdown-BU4haotD.js';
6
+ import { S as SpendingCapHero } from './SpendingCapHero-B-0YYZho.js';
7
7
 
8
8
  function QuickswapFooter({ theme, environment }) {
9
9
  const { t } = useTranslation();
@@ -98,8 +98,8 @@ const inputStyle = {
98
98
  flex: 2,
99
99
  };
100
100
 
101
- function SelectInput({ testId, options, textInputValue, textInputPlaceholder, textInputValidator, textInputType, onTextInputChange, onTextInputBlur, onTextInputFocus, textInputTextAlign, textInputSubtext, textInputErrorMessage, testInputMode, selectTextAlign, selectSubtext, selectErrorMessage, textInputMaxButtonClick, onSelectChange, textInputDisabled, selectInputDisabled, selectedOption, coinSelectorHeading, defaultTokenImage, userJourney, screen, control, environment, theme, themeOverrides, }) {
102
- return (jsxs(Box, { sx: selectInputBoxStyle, children: [jsx(Box, { sx: selectStyle, children: jsx(SelectForm, { testId: `${testId}-select-form`, options: options, subtext: selectSubtext, textAlign: selectTextAlign, errorMessage: selectErrorMessage, onSelectChange: onSelectChange, disabled: selectInputDisabled, selectedOption: selectedOption, coinSelectorHeading: coinSelectorHeading, defaultTokenImage: defaultTokenImage, control: control, userJourney: userJourney, screen: screen, environment: environment, theme: theme, themeOverrides: themeOverrides }) }), jsx(Box, { sx: inputStyle, children: jsx(TextInputForm, { type: textInputType, testId: `${testId}-text-form`, value: textInputValue, placeholder: textInputPlaceholder, subtext: textInputSubtext, textAlign: textInputTextAlign, errorMessage: textInputErrorMessage, validator: textInputValidator, onTextInputChange: onTextInputChange, onTextInputBlur: onTextInputBlur, onTextInputFocus: onTextInputFocus, maxButtonClick: textInputMaxButtonClick, disabled: textInputDisabled, inputMode: testInputMode }) })] }));
101
+ function SelectInput({ testId, options, textInputValue, textInputPlaceholder, textInputValidator, textInputType, onTextInputChange, onTextInputBlur, onTextInputFocus, textInputTextAlign, textInputSubtext, textInputErrorMessage, testInputMode, selectTextAlign, selectSubtext, selectErrorMessage, textInputMaxButtonClick, onSelectChange, textInputDisabled, selectInputDisabled, selectedOption, coinSelectorHeading, defaultTokenImage, environment, theme, themeOverrides, }) {
102
+ return (jsxs(Box, { sx: selectInputBoxStyle, children: [jsx(Box, { sx: selectStyle, children: jsx(SelectForm, { testId: `${testId}-select-form`, options: options, subtext: selectSubtext, textAlign: selectTextAlign, errorMessage: selectErrorMessage, onSelectChange: onSelectChange, disabled: selectInputDisabled, selectedOption: selectedOption, coinSelectorHeading: coinSelectorHeading, defaultTokenImage: defaultTokenImage, environment: environment, theme: theme, themeOverrides: themeOverrides }) }), jsx(Box, { sx: inputStyle, children: jsx(TextInputForm, { type: textInputType, testId: `${testId}-text-form`, value: textInputValue, placeholder: textInputPlaceholder, subtext: textInputSubtext, textAlign: textInputTextAlign, errorMessage: textInputErrorMessage, validator: textInputValidator, onTextInputChange: onTextInputChange, onTextInputBlur: onTextInputBlur, onTextInputFocus: onTextInputFocus, maxButtonClick: textInputMaxButtonClick, disabled: textInputDisabled, inputMode: testInputMode }) })] }));
103
103
  }
104
104
 
105
105
  function validateFromToken(fromToken) {
@@ -526,7 +526,6 @@ function SwapForm({ data, theme, themeOverrides, cancelAutoProceed, subTitle, })
526
526
  const { viewDispatch } = reactExports.useContext(ViewContext);
527
527
  const [direction, setDirection] = reactExports.useState(SwapDirection.FROM);
528
528
  const [loading, setLoading] = reactExports.useState(false);
529
- const { track } = useAnalytics();
530
529
  // Form State
531
530
  const [fromAmount, setFromAmount] = reactExports.useState(data?.fromAmount || '');
532
531
  const [fromAmountError, setFromAmountError] = reactExports.useState('');
@@ -614,20 +613,7 @@ function SwapForm({ data, theme, themeOverrides, cancelAutoProceed, subTitle, })
614
613
  ]);
615
614
  const onQuoteError = reactExports.useCallback((error) => {
616
615
  setQuoteError(error);
617
- track({
618
- userJourney: UserJourney.SWAP,
619
- screen: 'SwapCoins',
620
- control: 'UnableToSwapDrawer',
621
- controlType: 'Button',
622
- extras: {
623
- fromToken,
624
- toToken,
625
- fromAmount,
626
- toAmount,
627
- error: 'message' in error ? error.message : error,
628
- },
629
- });
630
- }, [track, fromToken, toToken, fromAmount, toAmount]);
616
+ }, [fromToken, toToken, fromAmount, toAmount]);
631
617
  const tokensOptionsTo = reactExports.useMemo(() => allowedTokens
632
618
  .map((token) => ({
633
619
  id: formatTokenOptionsId(token.symbol, token.address),
@@ -894,17 +880,6 @@ function SwapForm({ data, theme, themeOverrides, cancelAutoProceed, subTitle, })
894
880
  setFromToken(selected.token);
895
881
  setFromBalance(selected.formattedBalance);
896
882
  setFromTokenError('');
897
- track({
898
- userJourney: UserJourney.SWAP,
899
- screen: 'SwapCoins',
900
- control: 'SelectFrom',
901
- controlType: 'Select',
902
- extras: {
903
- fromBalance: selected.formattedBalance,
904
- fromToken: selected.token,
905
- fromAmount,
906
- },
907
- });
908
883
  }, [toToken]);
909
884
  const onFromTextInputFocus = () => {
910
885
  setDirection(SwapDirection.FROM);
@@ -920,17 +895,6 @@ function SwapForm({ data, theme, themeOverrides, cancelAutoProceed, subTitle, })
920
895
  setLoading(true);
921
896
  }
922
897
  setFromAmount(value);
923
- track({
924
- userJourney: UserJourney.SWAP,
925
- screen: 'SwapCoins',
926
- control: 'InputFrom',
927
- controlType: 'TextInput',
928
- extras: {
929
- fromBalance,
930
- fromToken,
931
- fromAmount: value,
932
- },
933
- });
934
898
  };
935
899
  const textInputMaxButtonClick = () => {
936
900
  if (!fromBalance)
@@ -949,16 +913,6 @@ function SwapForm({ data, theme, themeOverrides, cancelAutoProceed, subTitle, })
949
913
  else {
950
914
  setFromAmount(fromBalanceTruncated);
951
915
  }
952
- track({
953
- userJourney: UserJourney.SWAP,
954
- screen: 'SwapCoins',
955
- control: 'MaxFrom',
956
- controlType: 'Button',
957
- extras: {
958
- fromBalance,
959
- fromBalanceTruncated,
960
- },
961
- });
962
916
  };
963
917
  // ------------//
964
918
  // TO //
@@ -972,16 +926,6 @@ function SwapForm({ data, theme, themeOverrides, cancelAutoProceed, subTitle, })
972
926
  }
973
927
  setToToken(selected);
974
928
  setToTokenError('');
975
- track({
976
- userJourney: UserJourney.SWAP,
977
- screen: 'SwapCoins',
978
- control: 'SelectTo',
979
- controlType: 'Select',
980
- extras: {
981
- toToken: selected,
982
- toAmount,
983
- },
984
- });
985
929
  }, [fromToken]);
986
930
  const onToTextInputFocus = () => {
987
931
  setDirection(SwapDirection.TO);
@@ -998,21 +942,10 @@ function SwapForm({ data, theme, themeOverrides, cancelAutoProceed, subTitle, })
998
942
  setLoading(true);
999
943
  }
1000
944
  setToAmount(value);
1001
- track({
1002
- userJourney: UserJourney.SWAP,
1003
- screen: 'SwapCoins',
1004
- control: 'InputTo',
1005
- controlType: 'TextInput',
1006
- extras: {
1007
- toToken,
1008
- toAmount: value,
1009
- },
1010
- });
1011
945
  };
1012
946
  const reverseTokens = () => {
1013
947
  const currentFromToken = fromToken;
1014
948
  const currentToToken = toToken;
1015
- const currentFromAmount = fromAmount;
1016
949
  const currentToAmount = toAmount;
1017
950
  setReverseRotation((prev) => (prev === 0 ? 180 : 0));
1018
951
  resetFormErrors();
@@ -1039,19 +972,6 @@ function SwapForm({ data, theme, themeOverrides, cancelAutoProceed, subTitle, })
1039
972
  setToToken(currentFromToken);
1040
973
  setToAmount(fromAmount);
1041
974
  }
1042
- track({
1043
- userJourney: UserJourney.SWAP,
1044
- screen: 'SwapCoins',
1045
- control: 'Flip',
1046
- controlType: 'Button',
1047
- extras: {
1048
- fromToken: currentFromToken,
1049
- fromAmount: currentFromAmount,
1050
- toToken: currentToToken,
1051
- toAmount: currentToAmount,
1052
- isCurrentToTokenInSellList,
1053
- },
1054
- });
1055
975
  };
1056
976
  const openNotEnoughImxDrawer = () => {
1057
977
  setShowNotEnoughImxDrawer(true);
@@ -1084,22 +1004,6 @@ function SwapForm({ data, theme, themeOverrides, cancelAutoProceed, subTitle, })
1084
1004
  || (validateFromAmountError && direction === SwapDirection.FROM)
1085
1005
  || (validateToAmountError && direction === SwapDirection.TO))
1086
1006
  isSwapFormValid = false;
1087
- track({
1088
- userJourney: UserJourney.SWAP,
1089
- screen: 'SwapCoins',
1090
- control: 'FormValid',
1091
- controlType: 'Button',
1092
- extras: {
1093
- isSwapFormValid,
1094
- swapFromAddress: fromToken?.address,
1095
- swapFromAmount: fromAmount,
1096
- swapFromTokenSymbol: fromToken?.symbol,
1097
- swapToAddress: toToken?.address,
1098
- swapToAmount: toAmount,
1099
- swapToTokenSymbol: toToken?.symbol,
1100
- autoProceed,
1101
- },
1102
- });
1103
1007
  return isSwapFormValid;
1104
1008
  };
1105
1009
  const isFormValidForAutoProceed = reactExports.useMemo(() => {
@@ -1126,24 +1030,6 @@ function SwapForm({ data, theme, themeOverrides, cancelAutoProceed, subTitle, })
1126
1030
  return;
1127
1031
  const transaction = quote;
1128
1032
  const isValid = SwapFormValidator();
1129
- // Tracking swap from data here and is valid or not to understand behaviour
1130
- track({
1131
- userJourney: UserJourney.SWAP,
1132
- screen: 'SwapCoins',
1133
- control: 'Swap',
1134
- controlType: 'Button',
1135
- extras: {
1136
- swapFromAddress: fromToken?.address,
1137
- swapFromAmount: fromAmount,
1138
- swapFromTokenSymbol: fromToken?.symbol,
1139
- swapToAddress: toToken?.address,
1140
- swapToAmount: toAmount,
1141
- swapToTokenSymbol: toToken?.symbol,
1142
- isSwapFormValid: isValid,
1143
- hasFundsForGas: !insufficientFundsForGas,
1144
- autoProceed,
1145
- },
1146
- });
1147
1033
  if (!isValid)
1148
1034
  return;
1149
1035
  if (!checkout || !provider || !transaction)
@@ -1245,7 +1131,7 @@ function SwapForm({ data, theme, themeOverrides, cancelAutoProceed, subTitle, })
1245
1131
  : '', selectTextAlign: "left", textInputType: "number", testInputMode: "decimal", textInputValue: fromAmount, textInputPlaceholder: t('views.SWAP.swapForm.from.inputPlaceholder'), textInputSubtext: `${t('views.SWAP.content.fiatPricePrefix')}
1246
1132
  $${formatZeroAmount(fromFiatValue, true)}`, textInputTextAlign: "right", textInputValidator: amountInputValidation, onTextInputChange: (v) => onFromTextInputChange(v), onTextInputFocus: onFromTextInputFocus, textInputMaxButtonClick: textInputMaxButtonClick, onSelectChange: onFromSelectChange, textInputErrorMessage: t(fromAmountError), selectErrorMessage: t(fromTokenError), selectedOption: fromToken
1247
1133
  ? formatTokenOptionsId(fromToken.symbol, fromToken.address)
1248
- : undefined, coinSelectorHeading: t('views.SWAP.swapForm.from.selectorTitle'), defaultTokenImage: defaultTokenImage, control: "FromToken", userJourney: UserJourney.SWAP, screen: "SwapCoins", environment: checkout?.config.environment, theme: theme, themeOverrides: themeOverrides })] }), jsx(Box, { sx: {
1134
+ : undefined, coinSelectorHeading: t('views.SWAP.swapForm.from.selectorTitle'), defaultTokenImage: defaultTokenImage, environment: checkout?.config.environment, theme: theme, themeOverrides: themeOverrides })] }), jsx(Box, { sx: {
1249
1135
  display: 'flex',
1250
1136
  justifyContent: 'center',
1251
1137
  alignItems: 'center',
@@ -1262,14 +1148,7 @@ function SwapForm({ data, theme, themeOverrides, cancelAutoProceed, subTitle, })
1262
1148
  w: 'base.icon.size.300',
1263
1149
  } }) }), jsx(Tooltip.Content, { children: swapConversionRateTooltip })] }))] }), jsx(SelectInput, { testId: "toTokenInputs", options: tokensOptionsTo, selectTextAlign: "left", textInputType: "number", testInputMode: "decimal", textInputValue: toAmount, textInputPlaceholder: t('views.SWAP.swapForm.to.inputPlaceholder'), textInputTextAlign: "right", textInputValidator: amountInputValidation, onTextInputChange: (v) => onToTextInputChange(v), onTextInputFocus: onToTextInputFocus, onSelectChange: onToSelectChange, textInputErrorMessage: t(toAmountError), selectErrorMessage: t(toTokenError), selectedOption: toToken
1264
1150
  ? formatTokenOptionsId(toToken.symbol, toToken.address)
1265
- : undefined, coinSelectorHeading: t('views.SWAP.swapForm.to.selectorTitle'), defaultTokenImage: defaultTokenImage, control: "ToToken", userJourney: UserJourney.SWAP, screen: "SwapCoins", environment: checkout?.config.environment, theme: theme, themeOverrides: themeOverrides })] })] }), jsx(Fees, { feeFiatValue: feeFiatValue, gasFeeToken: gasFeeToken, fees: formattedFees, onFeesClick: () => {
1266
- track({
1267
- userJourney: UserJourney.SWAP,
1268
- screen: 'SwapCoins',
1269
- control: 'ViewFees',
1270
- controlType: 'Button',
1271
- });
1272
- }, sx: {
1151
+ : undefined, coinSelectorHeading: t('views.SWAP.swapForm.to.selectorTitle'), defaultTokenImage: defaultTokenImage, environment: checkout?.config.environment, theme: theme, themeOverrides: themeOverrides })] })] }), jsx(Fees, { feeFiatValue: feeFiatValue, gasFeeToken: gasFeeToken, fees: formattedFees, sx: {
1273
1152
  paddingBottom: '0',
1274
1153
  }, loading: loading })] }), quoteError && (jsxs(Box, { sx: {
1275
1154
  paddingX: 'base.spacing.x4',
@@ -1319,19 +1198,6 @@ function SwapCoins({ theme, themeOverrides, cancelAutoProceed, fromAmount, toAmo
1319
1198
  const { swapState: { tokenBalances, autoProceed, }, } = reactExports.useContext(SwapContext);
1320
1199
  const { connectLoaderState: { checkout, provider, }, } = reactExports.useContext(ConnectLoaderContext);
1321
1200
  const [showNotEnoughImxDrawer, setShowNotEnoughImxDrawer] = reactExports.useState(false);
1322
- const { page } = useAnalytics();
1323
- reactExports.useEffect(() => {
1324
- page({
1325
- userJourney: UserJourney.SWAP,
1326
- screen: 'SwapCoins',
1327
- extras: {
1328
- fromAmount,
1329
- toAmount,
1330
- fromTokenAddress,
1331
- toTokenAddress,
1332
- },
1333
- });
1334
- }, []);
1335
1201
  reactExports.useEffect(() => {
1336
1202
  if (hasZeroBalance(tokenBalances, IMX_TOKEN_SYMBOL) && !isPassportProvider(provider)) {
1337
1203
  setShowNotEnoughImxDrawer(true);
@@ -1366,16 +1232,6 @@ function SwapCoins({ theme, themeOverrides, cancelAutoProceed, fromAmount, toAmo
1366
1232
  function SwapInProgress({ transactionResponse, swapForm, }) {
1367
1233
  const { t } = useTranslation();
1368
1234
  const { viewDispatch } = reactExports.useContext(ViewContext);
1369
- const { page } = useAnalytics();
1370
- reactExports.useEffect(() => {
1371
- page({
1372
- userJourney: UserJourney.SWAP,
1373
- screen: 'SwapInProgress',
1374
- extras: {
1375
- swapFormInfo: swapForm,
1376
- },
1377
- });
1378
- }, []);
1379
1235
  reactExports.useEffect(() => {
1380
1236
  (async () => {
1381
1237
  try {
@@ -1426,8 +1282,6 @@ function SwapInProgress({ transactionResponse, swapForm, }) {
1426
1282
  return (jsx(LoadingView, { loadingText: t('views.SWAP.IN_PROGRESS.loading.text') }));
1427
1283
  }
1428
1284
 
1429
- const APPROVE_SPENDING = 'ApproveSpending';
1430
- const APPROVE_SWAP = 'ApproveSwap';
1431
1285
  function ApproveERC20Onboarding({ data }) {
1432
1286
  const { t } = useTranslation();
1433
1287
  const { swapState: { allowedTokens } } = reactExports.useContext(SwapContext);
@@ -1445,16 +1299,6 @@ function ApproveERC20Onboarding({ data }) {
1445
1299
  // reject transaction flags
1446
1300
  const [rejectedSpending, setRejectedSpending] = reactExports.useState(false);
1447
1301
  const [rejectedSwap, setRejectedSwap] = reactExports.useState(false);
1448
- const { page, track } = useAnalytics();
1449
- reactExports.useEffect(() => {
1450
- page({
1451
- userJourney: UserJourney.SWAP,
1452
- screen: noApprovalTransaction ? APPROVE_SWAP : APPROVE_SPENDING,
1453
- extras: {
1454
- swapFormInfo: data.swapFormInfo,
1455
- },
1456
- });
1457
- }, []);
1458
1302
  // Get symbol from swap info for approve amount text
1459
1303
  const fromToken = reactExports.useMemo(() => allowedTokens.find((token) => token.address === data.swapFormInfo.fromTokenAddress), [allowedTokens, data.swapFormInfo.fromTokenAddress]);
1460
1304
  // Common error view function
@@ -1532,15 +1376,6 @@ function ApproveERC20Onboarding({ data }) {
1532
1376
  const handleApproveSpendingClick = reactExports.useCallback(async () => {
1533
1377
  if (loading)
1534
1378
  return;
1535
- track({
1536
- userJourney: UserJourney.SWAP,
1537
- screen: APPROVE_SPENDING,
1538
- control: APPROVE_SPENDING,
1539
- controlType: 'Button',
1540
- extras: {
1541
- autoProceed: data.autoProceed,
1542
- },
1543
- });
1544
1379
  setLoading(true);
1545
1380
  if (!checkout || !provider) {
1546
1381
  showErrorView();
@@ -1608,15 +1443,6 @@ function ApproveERC20Onboarding({ data }) {
1608
1443
  const handleApproveSwapClick = reactExports.useCallback(async () => {
1609
1444
  if (loading)
1610
1445
  return;
1611
- track({
1612
- userJourney: UserJourney.SWAP,
1613
- screen: APPROVE_SWAP,
1614
- control: APPROVE_SWAP,
1615
- controlType: 'Button',
1616
- extras: {
1617
- autoProceed: data.autoProceed,
1618
- },
1619
- });
1620
1446
  setLoading(true);
1621
1447
  if (!checkout || !provider) {
1622
1448
  showErrorView();
@@ -1773,7 +1599,6 @@ function SwapWidget({ amount, fromTokenAddress, toTokenAddress, config, autoProc
1773
1599
  history: [],
1774
1600
  });
1775
1601
  const [swapState, swapDispatch] = reactExports.useReducer(swapReducer, initialSwapState);
1776
- const { page } = useAnalytics();
1777
1602
  const [errorViewLoading, setErrorViewLoading] = reactExports.useState(false);
1778
1603
  const swapReducerValues = reactExports.useMemo(() => ({ swapState, swapDispatch }), [swapState, swapDispatch]);
1779
1604
  const viewReducerValues = reactExports.useMemo(() => ({ viewState, viewDispatch }), [viewState, viewDispatch]);
@@ -1891,22 +1716,8 @@ function SwapWidget({ amount, fromTokenAddress, toTokenAddress, config, autoProc
1891
1716
  return optionsArray;
1892
1717
  }, []);
1893
1718
  return (jsx(GeoblockLoader, { checkout: checkout, widget: (jsx(ViewContext.Provider, { value: viewReducerValues, children: jsxs(SwapContext.Provider, { value: swapReducerValues, children: [viewState.view.type === SharedViews.LOADING_VIEW && (jsx(LoadingView, { loadingText: t('views.LOADING_VIEW.text') })), viewState.view.type === SwapWidgetViews.SWAP && (jsx(SwapCoins, { theme: theme, themeOverrides: themeOverrides, cancelAutoProceed: cancelAutoProceed, fromAmount: viewState.view.data?.fromAmount ?? fromAmount, toAmount: viewState.view.data?.toAmount ?? toAmount, fromTokenAddress: viewState.view.data?.fromTokenAddress ?? fromTokenAddress, toTokenAddress: viewState.view.data?.toTokenAddress ?? toTokenAddress, showBackButton: showBackButton, showHeader: showHeader ?? true, title: customTitle ?? t('views.SWAP.header.title'), subTitle: customSubTitle ?? t('views.SWAP.content.title') })), viewState.view.type === SwapWidgetViews.IN_PROGRESS && (jsx(SwapInProgress, { transactionResponse: viewState.view.data.transactionResponse, swapForm: viewState.view.data.swapForm })), viewState.view.type === SwapWidgetViews.APPROVE_ERC20 && (jsx(ApproveERC20Onboarding, { data: viewState.view.data })), viewState.view.type === SwapWidgetViews.SUCCESS && (jsx(StatusView, { statusText: t('views.SWAP.success.text'), actionText: t('views.SWAP.success.actionText'), onRenderEvent: () => {
1894
- page({
1895
- userJourney: UserJourney.SWAP,
1896
- screen: 'SwapSuccess',
1897
- extras: {
1898
- fromTokenAddress: viewState.view.data?.fromTokenAddress,
1899
- fromAmount: viewState.view.data?.fromAmount,
1900
- toTokenAddress: viewState.view.data?.toTokenAddress,
1901
- toAmount: viewState.view.data?.toAmount,
1902
- },
1903
- });
1904
1719
  sendSwapSuccessEvent(eventTarget, viewState.view.data.transactionHash);
1905
1720
  }, onActionClick: () => sendSwapWidgetCloseEvent(eventTarget), statusType: StatusType.SUCCESS, testId: "success-view" })), viewState.view.type === SwapWidgetViews.FAIL && (jsx(StatusView, { statusText: t('views.SWAP.failed.text'), actionText: t('views.SWAP.failed.actionText'), onRenderEvent: () => {
1906
- page({
1907
- userJourney: UserJourney.SWAP,
1908
- screen: 'SwapFailed',
1909
- });
1910
1721
  sendSwapFailedEvent(eventTarget, 'Transaction failed');
1911
1722
  }, onActionClick: () => {
1912
1723
  if (viewState.view.type === SwapWidgetViews.FAIL) {
@@ -1921,11 +1732,6 @@ function SwapWidget({ amount, fromTokenAddress, toTokenAddress, config, autoProc
1921
1732
  });
1922
1733
  }
1923
1734
  }, statusType: StatusType.FAILURE, onCloseClick: () => sendSwapWidgetCloseEvent(eventTarget), testId: "fail-view" })), viewState.view.type === SwapWidgetViews.PRICE_SURGE && (jsx(StatusView, { statusText: t('views.SWAP.rejected.text'), actionText: t('views.SWAP.rejected.actionText'), onRenderEvent: () => {
1924
- page({
1925
- userJourney: UserJourney.SWAP,
1926
- screen: 'PriceSurge',
1927
- extras: viewState.view.data,
1928
- });
1929
1735
  sendSwapRejectedEvent(eventTarget, 'Price surge');
1930
1736
  }, onActionClick: () => {
1931
1737
  if (viewState.view.type === SwapWidgetViews.PRICE_SURGE) {
@@ -1954,7 +1760,7 @@ function SwapWidget({ amount, fromTokenAddress, toTokenAddress, config, autoProc
1954
1760
  viewDispatch({
1955
1761
  payload: { type: ViewActions.UPDATE_VIEW, view: { type: SwapWidgetViews.SWAP } },
1956
1762
  });
1957
- } })), viewState.view.type === SharedViews.TOP_UP_VIEW && (jsx(TopUpView, { analytics: { userJourney: UserJourney.SWAP }, checkout: checkout, provider: provider, widgetEvent: IMTBLWidgetEvents.IMTBL_SWAP_WIDGET_EVENT, showOnrampOption: isOnRampEnabled, showSwapOption: isSwapEnabled, showBridgeOption: isBridgeEnabled, onCloseButtonClick: () => sendSwapWidgetCloseEvent(eventTarget) }))] }) })), serviceUnavailableView: (jsx(ServiceUnavailableToRegionErrorView, { service: ServiceType.SWAP, onCloseClick: () => sendSwapWidgetCloseEvent(window), showHeader: showHeader, primaryActionText: topUpOptions && topUpOptions?.length > 0
1763
+ } })), viewState.view.type === SharedViews.TOP_UP_VIEW && (jsx(TopUpView, { checkout: checkout, provider: provider, widgetEvent: IMTBLWidgetEvents.IMTBL_SWAP_WIDGET_EVENT, showOnrampOption: isOnRampEnabled, showSwapOption: isSwapEnabled, showBridgeOption: isBridgeEnabled, onCloseButtonClick: () => sendSwapWidgetCloseEvent(eventTarget) }))] }) })), serviceUnavailableView: (jsx(ServiceUnavailableToRegionErrorView, { service: ServiceType.SWAP, onCloseClick: () => sendSwapWidgetCloseEvent(window), showHeader: showHeader, primaryActionText: topUpOptions && topUpOptions?.length > 0
1958
1764
  ? t(topUpOptions[0].textKey)
1959
1765
  : undefined, onPrimaryButtonClick: topUpOptions && topUpOptions?.length > 0
1960
1766
  ? topUpOptions[0].action
@@ -1,4 +1,4 @@
1
- import { r as reactExports, G as getDefaultTokenImage, q as jsx } from './index-WfurfROg.js';
1
+ import { r as reactExports, F as getDefaultTokenImage, q as jsx } from './index-CcxHW36j.js';
2
2
 
3
3
  function TokenImage({ src, name, environment, theme, defaultImage, ...forwardedProps }) {
4
4
  const [error, setError] = reactExports.useState(false);
@@ -1,4 +1,4 @@
1
- import { r as reactExports, cb as formatUnits, q as jsx, s as jsxs, dI as isDualVariantIcon, aP as MenuItem, t as Box, u as useTranslation, aU as ViewContext, D as CryptoFiatContext, E as EventTargetContext, z as useAnalytics, a1 as CryptoFiatActions, dJ as DEFAULT_TOKEN_SYMBOLS, cT as GasEstimateType, J as HeaderNavigation, H as Heading, y as Body, x as SimpleLayout, I as IMTBLWidgetEvents, V as ViewActions, M as orchestrationEvents, bM as r } from './index-WfurfROg.js';
1
+ import { c3 as formatUnits, q as jsx, s as jsxs, dA as isDualVariantIcon, aK as MenuItem, t as Box, r as reactExports, u as useTranslation, aP as ViewContext, z as CryptoFiatContext, E as EventTargetContext, $ as CryptoFiatActions, dB as DEFAULT_TOKEN_SYMBOLS, cK as GasEstimateType, G as HeaderNavigation, H as Heading, y as Body, x as SimpleLayout, I as IMTBLWidgetEvents, V as ViewActions, K as orchestrationEvents, bG as r } from './index-CcxHW36j.js';
2
2
 
3
3
  var BridgeWidgetViews;
4
4
  (function (BridgeWidgetViews) {
@@ -16,32 +16,6 @@ var BridgeWidgetViews;
16
16
  BridgeWidgetViews["SERVICE_UNAVAILABLE"] = "SERVICE_UNAVAILABLE";
17
17
  })(BridgeWidgetViews || (BridgeWidgetViews = {}));
18
18
 
19
- /**
20
- * useMount hook to runs only once when the component mounts
21
- * after mounting condition is met
22
- *
23
- * @param fn function to run
24
- * @param shouldMount function to check mount condition
25
- * @param deps dependencies to watch for changes
26
- */
27
- const useMount = (fn, shouldMount, deps) => {
28
- const isMounted = reactExports.useRef(false);
29
- const shouldMountCheck = () => {
30
- if (typeof shouldMount === 'function') {
31
- return shouldMount();
32
- }
33
- return true;
34
- };
35
- reactExports.useEffect(() => {
36
- if (isMounted.current)
37
- return;
38
- if (!shouldMountCheck())
39
- return;
40
- fn();
41
- isMounted.current = true;
42
- }, deps || []);
43
- };
44
-
45
19
  var SwapWidgetViews;
46
20
  (function (SwapWidgetViews) {
47
21
  SwapWidgetViews["SWAP"] = "SWAP";
@@ -147,9 +121,8 @@ const TOOLKIT_BASE_URL = {
147
121
  function TopUpView({ widgetEvent, checkout,
148
122
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
149
123
  provider, // Keep this for future use
150
- showOnrampOption, showSwapOption, showBridgeOption, tokenAddress, amount, analytics, onCloseButtonClick, onBackButtonClick, heading, subheading, }) {
124
+ showOnrampOption, showSwapOption, showBridgeOption, tokenAddress, amount, onCloseButtonClick, onBackButtonClick, heading, subheading, }) {
151
125
  const { t } = useTranslation();
152
- const { userJourney } = analytics;
153
126
  const { viewDispatch } = reactExports.useContext(ViewContext);
154
127
  const { cryptoFiatState, cryptoFiatDispatch } = reactExports.useContext(CryptoFiatContext);
155
128
  const { conversions, fiatSymbol } = cryptoFiatState;
@@ -160,7 +133,6 @@ showOnrampOption, showSwapOption, showBridgeOption, tokenAddress, amount, analyt
160
133
  const [, setBridgeFeesInFiat] = reactExports.useState('-.--');
161
134
  const title = heading ? t(...heading) : t('views.TOP_UP_VIEW.header.title');
162
135
  const description = subheading ? t(...subheading) : null;
163
- const { page, track } = useAnalytics();
164
136
  const isSwapAvailable = useAsyncMemo(async () => {
165
137
  if (!checkout)
166
138
  return undefined;
@@ -171,9 +143,6 @@ showOnrampOption, showSwapOption, showBridgeOption, tokenAddress, amount, analyt
171
143
  return false;
172
144
  }
173
145
  }, [checkout]);
174
- useMount(() => {
175
- page({ userJourney, screen: 'TopUp' });
176
- });
177
146
  reactExports.useEffect(() => {
178
147
  if (!cryptoFiatDispatch)
179
148
  return;
@@ -206,15 +175,6 @@ showOnrampOption, showSwapOption, showBridgeOption, tokenAddress, amount, analyt
206
175
  setOnRampFeesPercentage(onRampFees);
207
176
  })();
208
177
  }, [checkout !== undefined]);
209
- const localTrack = (control, extras, controlType = 'Button') => {
210
- track({
211
- userJourney,
212
- screen: 'TopUp',
213
- control,
214
- controlType,
215
- extras,
216
- });
217
- };
218
178
  const onClickSwap = () => {
219
179
  if (widgetEvent === IMTBLWidgetEvents.IMTBL_SWAP_WIDGET_EVENT) {
220
180
  const data = {
@@ -231,7 +191,6 @@ showOnrampOption, showSwapOption, showBridgeOption, tokenAddress, amount, analyt
231
191
  },
232
192
  },
233
193
  });
234
- localTrack('Swap', { ...data, widgetEvent });
235
194
  return;
236
195
  }
237
196
  const data = {
@@ -240,7 +199,6 @@ showOnrampOption, showSwapOption, showBridgeOption, tokenAddress, amount, analyt
240
199
  amount: '',
241
200
  };
242
201
  orchestrationEvents.sendRequestSwapEvent(eventTarget, widgetEvent, data);
243
- localTrack('Swap', { ...data, widgetEvent });
244
202
  };
245
203
  const onClickBridge = () => {
246
204
  if (widgetEvent === IMTBLWidgetEvents.IMTBL_BRIDGE_WIDGET_EVENT) {
@@ -257,7 +215,6 @@ showOnrampOption, showSwapOption, showBridgeOption, tokenAddress, amount, analyt
257
215
  },
258
216
  },
259
217
  });
260
- localTrack('Bridge', { ...data, widgetEvent });
261
218
  return;
262
219
  }
263
220
  const data = {
@@ -265,7 +222,6 @@ showOnrampOption, showSwapOption, showBridgeOption, tokenAddress, amount, analyt
265
222
  amount: '',
266
223
  };
267
224
  orchestrationEvents.sendRequestBridgeEvent(eventTarget, widgetEvent, data);
268
- localTrack('Bridge', { ...data, widgetEvent });
269
225
  };
270
226
  const onClickOnRamp = () => {
271
227
  if (widgetEvent === IMTBLWidgetEvents.IMTBL_ONRAMP_WIDGET_EVENT) {
@@ -282,7 +238,6 @@ showOnrampOption, showSwapOption, showBridgeOption, tokenAddress, amount, analyt
282
238
  },
283
239
  },
284
240
  });
285
- localTrack('OnRamp', { ...data, widgetEvent });
286
241
  return;
287
242
  }
288
243
  const data = {
@@ -290,15 +245,9 @@ showOnrampOption, showSwapOption, showBridgeOption, tokenAddress, amount, analyt
290
245
  amount: amount ?? '',
291
246
  };
292
247
  orchestrationEvents.sendRequestOnrampEvent(eventTarget, widgetEvent, data);
293
- localTrack('OnRamp', { ...data, widgetEvent });
294
248
  };
295
249
  const onClickAdvancedOptions = () => {
296
250
  const toolkitBaseUrl = TOOLKIT_BASE_URL[environment];
297
- const data = {
298
- tokenAddress: tokenAddress ?? '',
299
- amount: amount ?? '',
300
- };
301
- localTrack('AdvancedOptions', { ...data, widgetEvent });
302
251
  window.open(`${toolkitBaseUrl}/squid-bridge/`, '_blank');
303
252
  };
304
253
  const renderFees = (txt) => (jsx(Box, { sx: {
@@ -362,4 +311,4 @@ showOnrampOption, showSwapOption, showBridgeOption, tokenAddress, amount, analyt
362
311
  : t(`${element.textConfigKey}.caption`), onClick: element.onClickEvent, renderFeeFunction: element.fee, isDisabled: !element.isAvailable }, t(`${element.textConfigKey}.heading`).toLowerCase()))) })] }) }));
363
312
  }
364
313
 
365
- export { BridgeWidgetViews as B, OnRampWidgetViews as O, SwapWidgetViews as S, TopUpView as T, useMount as u };
314
+ export { BridgeWidgetViews as B, OnRampWidgetViews as O, SwapWidgetViews as S, TopUpView as T };
@@ -1,5 +1,5 @@
1
- import { ac as hFlex, q as jsx, dx as motion, ae as _objectWithoutProperties, Q as useTheme, r as reactExports, ag as _slicedToArray, aq as useGetSubcomponentChild, al as merge, s as jsxs, dy as BaseClickable, b3 as ButtCon, au as SmartClone, dz as AnimatePresence, t as Box, w as Stack, dA as ClassNames, ad as _defineProperty, dB as getTertiaryButtonStyles, ar as flattenChildren, dC as isChildSubcomponent, aB as Divider, b4 as TextInput, dD as FormControlWrapper, u as useTranslation, aP as MenuItem, aA as Drawer, y as Body, aF as Fragment, z as useAnalytics, dE as Select, bM as r, dF as DuoCon, H as Heading, v as Button, cJ as retry, cR as NATIVE, b0 as getTokenImageByAddress, a$ as isNativeToken, ds as DEFAULT_BALANCE_RETRY_POLICY, aK as isPassportProvider, cO as isMetaMaskProvider, R as CloudImage, c5 as FooterLogo, X as getRemoteImage, cM as getChainNameById, cG as isWalletConnectProvider, d0 as heroBackGroundStyles, d1 as heroImageStyles, dG as heroImageBottomAlign } from './index-WfurfROg.js';
2
- import { T as TokenImage } from './TokenImage-EqfdG328.js';
1
+ import { aa as hFlex, q as jsx, dn as motion, ac as _objectWithoutProperties, N as useTheme, r as reactExports, ae as _slicedToArray, ao as useGetSubcomponentChild, aj as merge, s as jsxs, dp as BaseClickable, a_ as ButtCon, as as SmartClone, dq as AnimatePresence, t as Box, w as Stack, dr as ClassNames, ab as _defineProperty, ds as getTertiaryButtonStyles, ap as flattenChildren, dt as isChildSubcomponent, az as Divider, a$ as TextInput, du as FormControlWrapper, u as useTranslation, aK as MenuItem, ay as Drawer, y as Body, aD as Fragment, dv as Select, bG as r, dw as DuoCon, H as Heading, v as Button, cB as retry, cI as NATIVE, aX as getTokenImageByAddress, aW as isNativeToken, di as DEFAULT_BALANCE_RETRY_POLICY, aG as isPassportProvider, dx as isMetaMaskProvider, Q as CloudImage, bZ as FooterLogo, R as getRemoteImage, cE as getChainNameById, cy as isWalletConnectProvider, cT as heroBackGroundStyles, cU as heroImageStyles, dy as heroImageBottomAlign } from './index-CcxHW36j.js';
2
+ import { T as TokenImage } from './TokenImage-BeUf_Ulv.js';
3
3
 
4
4
  function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -371,8 +371,7 @@ function CoinSelector({ heading, options, defaultTokenImage, optionsLoading, chi
371
371
  return (jsxs(Drawer, { headerBarTitle: heading, size: "full", onCloseDrawer: handleCloseDrawer, visible: visible, bgOverlaySx: drawerBackground ? { background: drawerBackground } : undefined, children: [jsx(Drawer.Target, { children: children }), jsx(Drawer.Content, { children: jsxs(Box, { sx: selectOptionsContainerStyles, children: [optionsLoading && options.length === 0 && (jsxs(Box, { sx: selectOptionsLoadingIconStyles, children: [jsx(MenuItem, { shimmer: true, emphasized: true, testId: "balance-item-shimmer--1" }), jsx(MenuItem, { shimmer: true, emphasized: true, testId: "balance-item-shimmer--2" }), jsx(MenuItem, { shimmer: true, emphasized: true, testId: "balance-item-shimmer--3" })] })), !optionsLoading && options.length === 0 && (jsx(Body, { sx: { padding: 'base.spacing.x4' }, children: t('drawers.coinSelector.noCoins') })), !optionsLoading ? (jsxs(Fragment, { children: [jsx(TextInput, { sx: { marginBottom: 'base.spacing.x4', minWidth: '100%' }, testId: "search-text", onChange: (event) => handleOnChange(event), sizeVariant: "large", value: searchValue, inputMode: "search", placeholder: "name/symbol/contract address", onClearValue: () => setSearchValue(''), hideClearValueButton: false, autoFocus: true, children: jsx(TextInput.Icon, { icon: "Search" }) }), filteredOptions.map(({ onClick, icon, name, symbol, balance, id, testId, }) => (jsx(CoinSelectorOption, { id: id, testId: testId, onClick: onClick, icon: icon, name: name, symbol: symbol, balance: balance, defaultTokenImage: defaultTokenImage }, `${symbol}-${name}`)))] })) : null] }) })] }));
372
372
  }
373
373
 
374
- function SelectForm({ testId, options, optionsLoading, subtext, onSelectChange, textAlign, errorMessage, disabled, selectedOption, coinSelectorHeading, defaultTokenImage, userJourney, screen, control, environment = r.PRODUCTION, theme, themeOverrides, }) {
375
- const { track } = useAnalytics();
374
+ function SelectForm({ testId, options, optionsLoading, subtext, onSelectChange, textAlign, errorMessage, disabled, selectedOption, coinSelectorHeading, defaultTokenImage, environment = r.PRODUCTION, theme, themeOverrides, }) {
376
375
  const [coinSelectorOpen, setCoinSelectorOpen] = reactExports.useState(false);
377
376
  const coinSelectorOptions = reactExports.useMemo(() => options.map((option) => ({
378
377
  ...option,
@@ -394,14 +393,7 @@ function SelectForm({ testId, options, optionsLoading, subtext, onSelectChange,
394
393
  const filteredOption = options.find((o) => o.id === selectedOption) ?? selectedOption;
395
394
  const openCoinSelector = reactExports.useCallback(() => {
396
395
  setCoinSelectorOpen(true);
397
- track({
398
- userJourney,
399
- screen,
400
- control,
401
- controlType: 'Select',
402
- action: 'Opened',
403
- });
404
- }, [setCoinSelectorOpen, track]);
396
+ }, [setCoinSelectorOpen]);
405
397
  return (jsxs(Box, { children: [jsx(CoinSelector, { heading: coinSelectorHeading, options: coinSelectorOptions, defaultTokenImage: defaultTokenImage, optionsLoading: optionsLoading ?? false, visible: coinSelectorOpen, onCloseDrawer: () => setCoinSelectorOpen(false), drawerBackground: themeOverrides.drawerBackground }), jsx(FormControlWrapper, { testId: `${testId}-select-control`, textAlign: textAlign ?? 'left', subtext: errorMessage ? undefined : subtext, isErrored: !!errorMessage, errorMessage: errorMessage, children: jsx(Select, { testId: `${testId}-select`, size: "large", defaultLabel: "Select token", targetClickOveride: openCoinSelector, selectedOption: getSelectedOption(), sx: { minw: '170px' }, children: filteredOption && (jsxs(Select.Option, { optionKey: filteredOption.id, testId: filteredOption.testId,
406
398
  // select cannot currently be disabled so disabling at the option level for now
407
399
  disabled: disabled, children: [!filteredOption.icon && (jsx(Select.Option.Icon, { icon: "Coins", variant: "bold" })), filteredOption.icon && (jsx(Select.Option.FramedImage, { use: (jsx(TokenImage, { environment: environment, theme: theme, src: filteredOption.icon, name: filteredOption.name })), circularFrame: true, sx: { background: 'base.color.translucent.standard.100' } })), jsx(Select.Option.Label, { children: filteredOption.symbol })] }, filteredOption.id)) }) })] }));