@aurora-is-near/intents-swap-widget 3.14.0-redesign.2 → 3.14.0-redesign.7

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 (145) hide show
  1. package/dist/components/BlockingError.js +15 -9
  2. package/dist/components/BlockingError.js.map +1 -1
  3. package/dist/components/CloseButton.js +1 -1
  4. package/dist/components/CloseButton.js.map +1 -1
  5. package/dist/{config-Bmc4hOIl.js → config-Behl5hcc.js} +1179 -952
  6. package/dist/config-Behl5hcc.js.map +1 -0
  7. package/dist/config.d.ts +1 -0
  8. package/dist/config.js +4 -6
  9. package/dist/config.js.map +1 -1
  10. package/dist/errors.js +1 -1
  11. package/dist/ext/alchemy/index.js +1 -1
  12. package/dist/ext/index.js +1 -1
  13. package/dist/features/BalanceRpcLoader/TokenBalanceLoader.js +1 -1
  14. package/dist/features/BalanceRpcLoader/index.js +1 -1
  15. package/dist/features/BalanceRpcLoader/useTokenBalanceRpc.js +1 -1
  16. package/dist/features/ChainsDropdown/index.js +1 -1
  17. package/dist/features/DepositMethodSwitcher.js +26 -29
  18. package/dist/features/DepositMethodSwitcher.js.map +1 -1
  19. package/dist/features/ErrorBoundary.js +1 -1
  20. package/dist/features/ExternalDeposit.js +27 -28
  21. package/dist/features/ExternalDeposit.js.map +1 -1
  22. package/dist/features/SendAddress/index.js +1 -1
  23. package/dist/features/SendAddress/useNotification.js +1 -1
  24. package/dist/features/SubmitButton/index.js +1 -1
  25. package/dist/features/SuccessScreen/SummaryItem.js +2 -2
  26. package/dist/features/SuccessScreen/SummaryItem.js.map +1 -1
  27. package/dist/features/SuccessScreen/index.js +20 -20
  28. package/dist/features/SuccessScreen/index.js.map +1 -1
  29. package/dist/features/SwapDirectionSwitcher.js +1 -1
  30. package/dist/features/SwapQuote/SwapQuote.js +1 -1
  31. package/dist/features/SwapQuote/index.js +1 -1
  32. package/dist/features/TokenInput/TokenInput.js +1 -1
  33. package/dist/features/TokenInput/TokenInputEmpty.js +1 -1
  34. package/dist/features/TokenInput/TokenInputSource.js +1 -1
  35. package/dist/features/TokenInput/TokenInputTarget.js +1 -1
  36. package/dist/features/TokenInput/WalletBalance.js +1 -1
  37. package/dist/features/TokenInput/hooks/index.js +1 -1
  38. package/dist/features/TokenInput/hooks/useTokenInputBalance.js +1 -1
  39. package/dist/features/TokenInput/index.js +1 -1
  40. package/dist/features/TokensList/TokenItem.js +1 -1
  41. package/dist/features/TokensList/TokensList.js +1 -1
  42. package/dist/features/TokensList/index.js +1 -1
  43. package/dist/features/TokensModal.js +1 -1
  44. package/dist/features/WalletCompatibilityCheck/WalletCompatibilityModal.js +13 -191
  45. package/dist/features/WalletCompatibilityCheck/WalletCompatibilityModal.js.map +1 -1
  46. package/dist/features/WalletCompatibilityCheck/index.js +21 -26
  47. package/dist/features/WalletCompatibilityCheck/index.js.map +1 -1
  48. package/dist/features/index.js +1 -1
  49. package/dist/hooks/index.js +1 -1
  50. package/dist/hooks/useAllTokens.js +1 -1
  51. package/dist/hooks/useChains.js +1 -1
  52. package/dist/hooks/useCompatibilityCheck.js +1 -1
  53. package/dist/hooks/useDefaultToken.js +1 -1
  54. package/dist/hooks/useExternalDepositStatus/index.js +1 -1
  55. package/dist/hooks/useExternalDepositStatus/usePoaExternalDepositStatus.js +1 -1
  56. package/dist/hooks/useIntentsBalance.js +1 -1
  57. package/dist/hooks/useIsCompatibilityCheckRequired.d.ts +1 -1
  58. package/dist/hooks/useIsCompatibilityCheckRequired.js +2 -2
  59. package/dist/hooks/useIsCompatibilityCheckRequired.js.map +1 -1
  60. package/dist/hooks/useMakeDepositAddress.js +1 -1
  61. package/dist/hooks/useMakeIntentsTransfer.js +1 -1
  62. package/dist/hooks/useMakeNEARFtTransferCall.js +1 -1
  63. package/dist/hooks/useMakeQuote.js +1 -1
  64. package/dist/hooks/useMakeQuoteTransfer.js +1 -1
  65. package/dist/hooks/useMakeTransfer.js +1 -1
  66. package/dist/hooks/useMergedBalance.js +1 -1
  67. package/dist/hooks/useSwitchChain.js +1 -1
  68. package/dist/hooks/useTheme.js +1 -1
  69. package/dist/hooks/useToggleTheme.js +20 -17
  70. package/dist/hooks/useToggleTheme.js.map +1 -1
  71. package/dist/hooks/useTokenInputPair.js +1 -1
  72. package/dist/hooks/useTokens.js +1 -1
  73. package/dist/hooks/useTokensFiltered.js +1 -1
  74. package/dist/hooks/useTokensIntentsUnique.js +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/machine/computed/getIsDirectNearTokenWithdrawal.js +1 -1
  77. package/dist/machine/computed/getIsDirectNearTokenWithdrawal.js.map +1 -1
  78. package/dist/machine/computed/getIsDirectTokenOnNearDeposit.js +1 -1
  79. package/dist/machine/computed/getIsDirectTokenOnNearDeposit.js.map +1 -1
  80. package/dist/machine/computed/getIsDirectTokenOnNearTransfer.js +1 -1
  81. package/dist/machine/computed/getIsDirectTokenOnNearTransfer.js.map +1 -1
  82. package/dist/machine/effects/index.js +1 -1
  83. package/dist/machine/effects/useAlchemyBalanceEffect.js +1 -1
  84. package/dist/machine/effects/useBalancesUpdateEffect.js +1 -1
  85. package/dist/machine/effects/useMakeQuoteEffect.js +1 -1
  86. package/dist/machine/effects/useSelectedTokensEffect.js +1 -1
  87. package/dist/machine/effects/useSetTokenBalanceEffect.js +1 -1
  88. package/dist/machine/effects/useSetTokenIntentsTargetEffect.js +1 -1
  89. package/dist/machine/effects/useWalletConnEffect.js +1 -1
  90. package/dist/machine/events/index.js +1 -1
  91. package/dist/machine/events/tokenSelect.js +1 -1
  92. package/dist/machine/events/validateInputAndMoveTo.js +1 -1
  93. package/dist/machine/events/validateInputs.js +1 -1
  94. package/dist/machine/index.js +1 -1
  95. package/dist/machine/snap.js +1 -1
  96. package/dist/machine/subscriptions/checkers/isSendAddressAsConnected.js +1 -1
  97. package/dist/machine/subscriptions/index.js +1 -1
  98. package/dist/styles.css +1 -1
  99. package/dist/theme/ThemeProvider.js +7 -24
  100. package/dist/theme/ThemeProvider.js.map +1 -1
  101. package/dist/types/config.d.ts +1 -0
  102. package/dist/types/localisation.d.ts +1 -1
  103. package/dist/utils/intents/signers/near.js +1 -1
  104. package/dist/utils/intents/signers/privy.js +1 -1
  105. package/dist/utils/localstorage.js +41 -28
  106. package/dist/utils/localstorage.js.map +1 -1
  107. package/dist/utils/near/getNearNep141StorageBalance.js +1 -1
  108. package/dist/widgets/WidgetDeposit/WidgetDepositContent.js +11 -12
  109. package/dist/widgets/WidgetDeposit/WidgetDepositContent.js.map +1 -1
  110. package/dist/widgets/WidgetDeposit/WidgetDepositSkeleton.js +1 -1
  111. package/dist/widgets/WidgetSwap/WidgetSwapContent.js +27 -26
  112. package/dist/widgets/WidgetSwap/WidgetSwapContent.js.map +1 -1
  113. package/dist/widgets/WidgetSwap/WidgetSwapSkeleton.js +1 -1
  114. package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js +5 -6
  115. package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js.map +1 -1
  116. package/dist/widgets/WidgetWithdraw/WidgetWithdrawSkeleton.js +1 -1
  117. package/package.json +3 -2
  118. package/src/components/BlockingError.tsx +7 -4
  119. package/src/components/CloseButton.tsx +1 -1
  120. package/src/features/DepositMethodSwitcher.tsx +5 -17
  121. package/src/features/ExternalDeposit.tsx +8 -7
  122. package/src/features/SubmitButton/index.tsx +40 -0
  123. package/src/features/SuccessScreen/SummaryItem.tsx +2 -2
  124. package/src/features/SuccessScreen/index.tsx +5 -3
  125. package/src/features/SwapQuote/SwapQuote.tsx +1 -1
  126. package/src/features/WalletCompatibilityCheck/WalletCompatibilityModal.tsx +3 -0
  127. package/src/features/WalletCompatibilityCheck/index.tsx +4 -8
  128. package/src/hooks/useExternalDepositStatus/usePoaExternalDepositStatus.ts +2 -1
  129. package/src/hooks/useIsCompatibilityCheckRequired.ts +1 -1
  130. package/src/hooks/useToggleTheme.ts +11 -4
  131. package/src/machine/computed/getIsDirectNearTokenWithdrawal.ts +2 -1
  132. package/src/machine/computed/getIsDirectTokenOnNearDeposit.ts +2 -1
  133. package/src/machine/computed/getIsDirectTokenOnNearTransfer.ts +2 -1
  134. package/src/theme/ThemeProvider.tsx +33 -14
  135. package/src/types/config.ts +1 -0
  136. package/src/types/localisation.ts +4 -0
  137. package/src/utils/localstorage.ts +35 -10
  138. package/src/widgets/WidgetDeposit/WidgetDepositContent.tsx +3 -3
  139. package/src/widgets/WidgetSwap/WidgetSwapContent.tsx +5 -3
  140. package/src/widgets/WidgetWithdraw/WidgetWithdrawContent.tsx +3 -3
  141. package/dist/config-Bmc4hOIl.js.map +0 -1
  142. package/dist/features/SuccessScreen/CloseButton.d.ts +0 -5
  143. package/dist/features/SuccessScreen/CloseButton.js +0 -15
  144. package/dist/features/SuccessScreen/CloseButton.js.map +0 -1
  145. package/src/features/SuccessScreen/CloseButton.tsx +0 -14
@@ -1,152 +1,154 @@
1
- import { p as Xe } from "./index-xuotMAFm.js";
2
- import { jsx as c, jsxs as k, Fragment as Rt } from "react/jsx-runtime";
3
- import Dt from "i18next";
4
- import { deepClone as me } from "valtio/utils";
5
- import { snapshot as Se, useSnapshot as oe, proxy as et } from "valtio";
6
- import { HelmetProvider as Ct, Helmet as vt } from "react-helmet-async";
7
- import { memo as Ot, useEffect as R, useMemo as x, useRef as Y, useCallback as fe, useState as re, useId as xt, Fragment as Ft, useContext as Lt, createContext as Bt } from "react";
8
- import { useQuery as Ae, useInfiniteQuery as qt, useQueryClient as Ut, QueryClient as Pt, QueryClientProvider as Wt } from "@tanstack/react-query";
9
- import { Trans as Vt, I18nextProvider as Mt } from "react-i18next";
10
- import { useTypedTranslation as K, initLocalisation as Qt } from "./localisation.js";
1
+ import { p as st } from "./index-xuotMAFm.js";
2
+ import { jsx as o, jsxs as T, Fragment as Ft } from "react/jsx-runtime";
3
+ import Lt from "i18next";
4
+ import { deepClone as pe } from "valtio/utils";
5
+ import { snapshot as Ne, useSnapshot as oe, proxy as rt } from "valtio";
6
+ import { HelmetProvider as Bt, Helmet as qt } from "react-helmet-async";
7
+ import { memo as Ut, useEffect as C, useMemo as v, useRef as Y, useCallback as he, useState as re, useId as Pt, Fragment as Wt, createContext as at, useContext as Vt } from "react";
8
+ import { useQuery as _e, useInfiniteQuery as Mt, useQueryClient as Qt, QueryClient as $t, QueryClientProvider as Kt } from "@tanstack/react-query";
9
+ import { Trans as Ht, I18nextProvider as Gt } from "react-i18next";
10
+ import { useTypedTranslation as M, initLocalisation as jt } from "./localisation.js";
11
11
  import { logger as b } from "./logger.js";
12
- import { getTonTokenBalance as $t } from "./utils/ton/getTonTokenBalance.js";
13
- import { getSolanaTokenBalance as Kt } from "./utils/solana/getSolanaTokenBalance.js";
14
- import { useWalletAddressForToken as tt } from "./hooks/useWalletAddressForToken.js";
12
+ import { getTonTokenBalance as zt } from "./utils/ton/getTonTokenBalance.js";
13
+ import { getSolanaTokenBalance as Yt } from "./utils/solana/getSolanaTokenBalance.js";
14
+ import { useWalletAddressForToken as ot } from "./hooks/useWalletAddressForToken.js";
15
15
  import "@headlessui/react";
16
16
  import "framer-motion";
17
17
  import "lucide-react";
18
- import { cn as G } from "./utils/cn.js";
19
- import { OneClickService as Ht, QuoteRequest as U, GetExecutionStatusResponse as se } from "@defuse-protocol/one-click-sdk-typescript";
20
- import { CHAINS_LIST as _e, DEFAULT_CHAIN_ICON as Gt, DEFAULT_CHAINS_ORDER as nt, CHAIN_POA_MAP as st, POA_EVM_CHAIN_ID as rt, CHAIN_BASE_TOKENS as jt, EVM_CHAIN_IDS_MAP as pe, CHAIN_IDS_MAP as Yt, EVM_CHAINS as zt } from "./constants/chains.js";
18
+ import { cn as H } from "./utils/cn.js";
19
+ import { OneClickService as Zt, QuoteRequest as U, GetExecutionStatusResponse as ee } from "@defuse-protocol/one-click-sdk-typescript";
20
+ import { CHAINS_LIST as ye, DEFAULT_CHAIN_ICON as Xt, DEFAULT_CHAINS_ORDER as it, CHAIN_POA_MAP as ct, POA_EVM_CHAIN_ID as lt, CHAIN_BASE_TOKENS as Jt, EVM_CHAIN_IDS_MAP as Te, CHAIN_IDS_MAP as en, EVM_CHAINS as tn } from "./constants/chains.js";
21
21
  import "use-debounce";
22
- import { derive as Zt } from "derive-valtio";
23
- import { getIsNativeNearDeposit as Jt } from "./machine/computed/getIsNativeNearDeposit.js";
24
- import { getIsDirectTokenOnNearDeposit as Xt } from "./machine/computed/getIsDirectTokenOnNearDeposit.js";
22
+ import { derive as nn } from "derive-valtio";
23
+ import { getIsNativeNearDeposit as sn } from "./machine/computed/getIsNativeNearDeposit.js";
24
+ import { getIsDirectTokenOnNearDeposit as rn } from "./machine/computed/getIsDirectTokenOnNearDeposit.js";
25
25
  import "ethers";
26
- import { moveTo as O, machine as z } from "./machine/machine.js";
27
- import en from "lodash.once";
28
- import { guardStates as C } from "./machine/guards/index.js";
29
- import { parse as tn } from "./ext/alchemy/parse.js";
30
- import { createLoader as nn } from "./ext/alchemy/load.js";
31
- import { isAlchemySupportedChain as sn } from "./ext/alchemy/types.js";
26
+ import { moveTo as O, machine as Z } from "./machine/machine.js";
27
+ import an from "lodash.once";
28
+ import { guardStates as D } from "./machine/guards/index.js";
29
+ import { parse as on } from "./ext/alchemy/parse.js";
30
+ import { createLoader as cn } from "./ext/alchemy/load.js";
31
+ import { isAlchemySupportedChain as ln } from "./ext/alchemy/types.js";
32
32
  import { fireEvent as p } from "./machine/events/utils/fireEvent.js";
33
- import { NATIVE_NEAR_DUMB_ASSET_ID as Q, TOKENS_DATA as Ne, WNEAR_ASSET_ID as Te } from "./constants/tokens.js";
34
- import { isValidChain as rn } from "./utils/checkers/isValidChain.js";
33
+ import { NATIVE_NEAR_DUMB_ASSET_ID as $, TOKENS_DATA as be, WNEAR_ASSET_ID as ge } from "./constants/tokens.js";
34
+ import { isValidChain as dn } from "./utils/checkers/isValidChain.js";
35
35
  import { useWalletBalance as Ee } from "./hooks/useWalletBalance.js";
36
- import { getIntentsAccountId as ee } from "./utils/intents/getIntentsAccountId.js";
37
- import { getIntentsBalances as an } from "./utils/intents/getIntentsBalance.js";
38
- import { notReachable as be } from "./utils/notReachable.js";
39
- import { getTokenBalanceKey as $ } from "./utils/intents/getTokenBalanceKey.js";
40
- import { isDryQuote as ye } from "./machine/guards/checks/isDryQuote.js";
41
- import { snakeCase as at } from "change-case";
42
- import on, { CanceledError as ot, AxiosError as it } from "axios";
43
- import { oneClickApi as he, bridgeApi as ct } from "./network.js";
44
- import { formatBigToHuman as j } from "./utils/formatters/formatBigToHuman.js";
45
- import { getDryQuoteAddress as qe } from "./utils/getDryQuoteAddress.js";
46
- import { isEvmChain as M } from "./utils/evm/isEvmChain.js";
47
- import { checkNearAccountExists as cn } from "./utils/near/checkNearAccountExists.js";
48
- import { isNotEmptyAmount as te } from "./utils/checkers/isNotEmptyAmount.js";
49
- import { isValidBigint as lt } from "./utils/checkers/isValidBigint.js";
50
- import { isNearAddress as dt } from "./utils/near/isNearAddress.js";
51
- import { isBalanceSufficient as Re } from "./machine/guards/checks/isBalanceSufficient.js";
52
- import { isQuoteError as De, isTransferError as Ce, isAsyncSendAddressValidationError as ln } from "./machine/errors.js";
53
- import { isSolanaAddress as ut } from "./utils/solana/isSolanaAddress.js";
54
- import { isEvmAddress as mt } from "./utils/evm/isEvmAddress.js";
55
- import { getMainTokenByChain as dn } from "./utils/tokens/getMainTokenByChain.js";
56
- import { getDefaultIntentsToken as un } from "./utils/tokens/getDefaultIntentsToken.js";
57
- import { getTokenWithHighBalance as mn } from "./utils/tokens/getTokenWithHighBalance.js";
58
- import { isQuoteIdle as fn } from "./machine/subscriptions/checkers/isQuoteIdle.js";
59
- import { isInputChanged as pn } from "./machine/subscriptions/checkers/isInputChanged.js";
60
- import { isErrorChanged as Tn } from "./machine/subscriptions/checkers/isErrorChanged.js";
61
- import { isOnlyErrorChanged as hn } from "./machine/subscriptions/checkers/isOnlyErrorChanged.js";
62
- import { isValidInitialState as gn } from "./machine/subscriptions/checkers/isValidInitialState.js";
63
- import { isWalletDisconnected as In } from "./machine/subscriptions/checkers/isWalletDisconnected.js";
64
- import { isSendAddressForbidden as wn } from "./machine/subscriptions/checkers/isSendAddressForbidden.js";
65
- import { isAmountChangedFromQuote as kn } from "./machine/subscriptions/checkers/isAmountChangedFromQuote.js";
66
- import { reset as Sn } from "./machine/events/reset.js";
67
- import { tokenSelectRotate as ge } from "./machine/events/tokenSelectRotate.js";
68
- import { errorSet as An } from "./machine/events/errorSet.js";
69
- import { quoteSet as _n } from "./machine/events/quoteSet.js";
70
- import { addressSet as Nn } from "./machine/events/addressSet.js";
71
- import { tokenSetAmount as En } from "./machine/events/tokenSetAmount.js";
72
- import { quoteSetStatus as bn } from "./machine/events/quoteSetStatus.js";
73
- import { depositTypeSet as yn } from "./machine/events/depositTypeSet.js";
74
- import { externalDepositTxSet as Rn } from "./machine/events/externalDepositTxSet.js";
75
- import { setInputsValidating as Dn } from "./machine/events/setInputsValidating.js";
76
- import { walletAddressSet as Cn } from "./machine/events/walletAddressSet.js";
77
- import { tokenSetBalance as vn } from "./machine/events/tokenSetBalance.js";
78
- import { transferSetStatus as On } from "./machine/events/transferSetStatus.js";
79
- import { getUsdTradeDelta as xn } from "./machine/computed/getUsdTradeDelta.js";
80
- import { getIsDirectNonNearWithdrawal as Fn } from "./machine/computed/getIsDirectNonNearWithdrawal.js";
81
- import { getIsDirectTokenOnNearTransfer as Ln } from "./machine/computed/getIsDirectTokenOnNearTransfer.js";
82
- import { getIsDirectNearTokenWithdrawal as Bn } from "./machine/computed/getIsDirectNearTokenWithdrawal.js";
83
- import { getIsSameAssetDiffChainWithdrawal as qn } from "./machine/computed/getIsSameAssetDiffChainWithdrawal.js";
36
+ import { getIntentsAccountId as te } from "./utils/intents/getIntentsAccountId.js";
37
+ import { getIntentsBalances as un } from "./utils/intents/getIntentsBalance.js";
38
+ import { notReachable as Ce } from "./utils/notReachable.js";
39
+ import { getTokenBalanceKey as G } from "./utils/intents/getTokenBalanceKey.js";
40
+ import { isDryQuote as Re } from "./machine/guards/checks/isDryQuote.js";
41
+ import { snakeCase as dt } from "change-case";
42
+ import mn, { CanceledError as ut, AxiosError as mt } from "axios";
43
+ import { oneClickApi as Ie, bridgeApi as ft } from "./network.js";
44
+ import { formatBigToHuman as z } from "./utils/formatters/formatBigToHuman.js";
45
+ import { getDryQuoteAddress as Pe } from "./utils/getDryQuoteAddress.js";
46
+ import { isEvmChain as Q } from "./utils/evm/isEvmChain.js";
47
+ import { checkNearAccountExists as fn } from "./utils/near/checkNearAccountExists.js";
48
+ import { isNotEmptyAmount as ne } from "./utils/checkers/isNotEmptyAmount.js";
49
+ import { isValidBigint as pt } from "./utils/checkers/isValidBigint.js";
50
+ import { isNearAddress as ht } from "./utils/near/isNearAddress.js";
51
+ import { isBalanceSufficient as ve } from "./machine/guards/checks/isBalanceSufficient.js";
52
+ import { isQuoteError as De, isTransferError as xe, isAsyncSendAddressValidationError as pn } from "./machine/errors.js";
53
+ import { isSolanaAddress as Tt } from "./utils/solana/isSolanaAddress.js";
54
+ import { isEvmAddress as gt } from "./utils/evm/isEvmAddress.js";
55
+ import { getMainTokenByChain as hn } from "./utils/tokens/getMainTokenByChain.js";
56
+ import { getDefaultIntentsToken as Tn } from "./utils/tokens/getDefaultIntentsToken.js";
57
+ import { getTokenWithHighBalance as gn } from "./utils/tokens/getTokenWithHighBalance.js";
58
+ import { isQuoteIdle as In } from "./machine/subscriptions/checkers/isQuoteIdle.js";
59
+ import { isInputChanged as wn } from "./machine/subscriptions/checkers/isInputChanged.js";
60
+ import { isErrorChanged as kn } from "./machine/subscriptions/checkers/isErrorChanged.js";
61
+ import { isOnlyErrorChanged as An } from "./machine/subscriptions/checkers/isOnlyErrorChanged.js";
62
+ import { isValidInitialState as Sn } from "./machine/subscriptions/checkers/isValidInitialState.js";
63
+ import { isWalletDisconnected as Nn } from "./machine/subscriptions/checkers/isWalletDisconnected.js";
64
+ import { isSendAddressForbidden as _n } from "./machine/subscriptions/checkers/isSendAddressForbidden.js";
65
+ import { isAmountChangedFromQuote as yn } from "./machine/subscriptions/checkers/isAmountChangedFromQuote.js";
66
+ import { reset as bn } from "./machine/events/reset.js";
67
+ import { tokenSelectRotate as we } from "./machine/events/tokenSelectRotate.js";
68
+ import { errorSet as En } from "./machine/events/errorSet.js";
69
+ import { quoteSet as Cn } from "./machine/events/quoteSet.js";
70
+ import { addressSet as Rn } from "./machine/events/addressSet.js";
71
+ import { tokenSetAmount as vn } from "./machine/events/tokenSetAmount.js";
72
+ import { quoteSetStatus as Dn } from "./machine/events/quoteSetStatus.js";
73
+ import { depositTypeSet as xn } from "./machine/events/depositTypeSet.js";
74
+ import { externalDepositTxSet as On } from "./machine/events/externalDepositTxSet.js";
75
+ import { setInputsValidating as Fn } from "./machine/events/setInputsValidating.js";
76
+ import { walletAddressSet as Ln } from "./machine/events/walletAddressSet.js";
77
+ import { tokenSetBalance as Bn } from "./machine/events/tokenSetBalance.js";
78
+ import { transferSetStatus as qn } from "./machine/events/transferSetStatus.js";
79
+ import { getUsdTradeDelta as Un } from "./machine/computed/getUsdTradeDelta.js";
80
+ import { getIsDirectNonNearWithdrawal as Pn } from "./machine/computed/getIsDirectNonNearWithdrawal.js";
81
+ import { getIsDirectTokenOnNearTransfer as Wn } from "./machine/computed/getIsDirectTokenOnNearTransfer.js";
82
+ import { getIsDirectNearTokenWithdrawal as Vn } from "./machine/computed/getIsDirectNearTokenWithdrawal.js";
83
+ import { getIsSameAssetDiffChainWithdrawal as Mn } from "./machine/computed/getIsSameAssetDiffChainWithdrawal.js";
84
84
  import "viem";
85
- import { Button as _ } from "./components/Button.js";
86
- import { TinyNumber as ve } from "./components/TinyNumber.js";
87
- import { ErrorMessage as X } from "./components/ErrorMessage.js";
88
- import { FT_DEPOSIT_GAS as Ue, FT_TRANSFER_GAS as Pe } from "./utils/near/config.js";
89
- import { a as Oe } from "./index-DEq3oXQF.js";
90
- import { z as ne } from "zod";
91
- import { decodeQueryResult as Un } from "./utils/near/decodeQueryResult.js";
92
- import { nearRpcClient as Pn } from "./utils/near/rpc.js";
93
- import { getNearNep141MinStorageBalance as Wn } from "./utils/near/getNearNep141MinStorageBalance.js";
94
- import { INTENTS_CONTRACT as Ie } from "./constants/intents.js";
95
- import { isEth as Vn } from "./utils/evm/isEth.js";
96
- import { useMakeEvmTransfer as Mn } from "./hooks/useMakeEvmTransfer.js";
97
- import { useMakeSolanaTransfer as Qn } from "./hooks/useMakeSolanaTransfer.js";
98
- import { isUserDeniedSigning as we } from "./utils/checkers/isUserDeniedSigning.js";
99
- import { createIntentSignerNEP413 as $n, BridgeSDK as Kn, createNearWithdrawalRoute as Hn, createInternalTransferRoute as Gn } from "@defuse-protocol/bridge-sdk";
100
- import { generateRandomBytes as jn } from "./utils/near/getRandomBytes.js";
101
- import { IntentSignerSolana as Yn } from "./utils/intents/signers/solana.js";
102
- import { localStorageTyped as We } from "./utils/localstorage.js";
103
- import { queryContract as zn } from "./utils/near/queryContract.js";
104
- import { utils as Ve } from "@defuse-protocol/internal-utils";
105
- import { getTransactionLink as Zn } from "./utils/formatters/getTransactionLink.js";
106
- import { switchEthereumChain as Jn } from "./utils/evm/switchEthereumChain.js";
85
+ import { Button as A } from "./components/Button.js";
86
+ import { TinyNumber as Oe } from "./components/TinyNumber.js";
87
+ import { ErrorMessage as K } from "./components/ErrorMessage.js";
88
+ import { FT_DEPOSIT_GAS as We, FT_TRANSFER_GAS as Ve } from "./utils/near/config.js";
89
+ import { a as Fe } from "./index-DEq3oXQF.js";
90
+ import { z as se } from "zod";
91
+ import { decodeQueryResult as Qn } from "./utils/near/decodeQueryResult.js";
92
+ import { nearRpcClient as $n } from "./utils/near/rpc.js";
93
+ import { getNearNep141MinStorageBalance as Kn } from "./utils/near/getNearNep141MinStorageBalance.js";
94
+ import { INTENTS_CONTRACT as ke } from "./constants/intents.js";
95
+ import { isEth as Hn } from "./utils/evm/isEth.js";
96
+ import { useMakeEvmTransfer as Gn } from "./hooks/useMakeEvmTransfer.js";
97
+ import { useMakeSolanaTransfer as jn } from "./hooks/useMakeSolanaTransfer.js";
98
+ import { isUserDeniedSigning as Ae } from "./utils/checkers/isUserDeniedSigning.js";
99
+ import { createIntentSignerNEP413 as zn, BridgeSDK as Yn, createNearWithdrawalRoute as Zn, createInternalTransferRoute as Xn } from "@defuse-protocol/bridge-sdk";
100
+ import { generateRandomBytes as Jn } from "./utils/near/getRandomBytes.js";
101
+ import { IntentSignerSolana as es } from "./utils/intents/signers/solana.js";
102
+ import { localStorageTyped as Me } from "./utils/localstorage.js";
103
+ import { queryContract as ts } from "./utils/near/queryContract.js";
104
+ import { utils as Qe } from "@defuse-protocol/internal-utils";
105
+ import { getTransactionLink as ns } from "./utils/formatters/getTransactionLink.js";
106
+ import { switchEthereumChain as ss } from "./utils/evm/switchEthereumChain.js";
107
107
  import "copy-text-to-clipboard";
108
- import { SwapQuoteSkeleton as ft } from "./features/SwapQuote/SwapQuoteSkeleton.js";
109
- import { Notes as le } from "./components/Notes.js";
110
- import { Accordion as Xn } from "./components/Accordion.js";
111
- import { formatUsdAmount as Me } from "./utils/formatters/formatUsdAmount.js";
112
- import { formatTinyNumber as es } from "./utils/formatters/formatTinyNumber.js";
113
- import ts from "clsx";
114
- import { Skeleton as ns } from "./components/Skeleton.js";
115
- import { getBalancePortion as ss } from "./features/TokenInput/utils/getBalancePortion.js";
116
- import { getUsdDisplayAmount as rs } from "./features/TokenInput/utils/getUsdDisplayAmount.js";
117
- import { TokenInputHeading as pt } from "./features/TokenInput/TokenInputHeading.js";
118
- import { noop as as } from "./utils/noop.js";
119
- import { Card as Tt } from "./components/Card.js";
120
- import { Badge as Qe } from "./components/Badge.js";
121
- import { TokenIcon as ht } from "./components/TokenIcon.js";
122
- import { InputAmount as os } from "./components/InputAmount.js";
123
- import { TokenInputSkeleton as is } from "./features/TokenInput/TokenInputSkeleton.js";
124
- import { getUsdDisplayBalance as cs } from "./utils/formatters/getUsdDisplayBalance.js";
125
- import { VList as ls } from "virtua";
126
- import { TokensListPlaceholder as ke } from "./features/TokensList/TokensListPlaceholder.js";
127
- import { Hr as ds } from "./components/Hr.js";
128
- import { createTokenSorter as us } from "./utils/tokens/sort.js";
129
- import { createFilterByIntents as $e } from "./utils/tokens/filterByIntents.js";
130
- import { createFilterBySearch as ms } from "./utils/tokens/filterBySearchString.js";
131
- import { createFilterBySelectedChain as fs } from "./utils/tokens/filterBySelectedChain.js";
108
+ import { SwapQuoteSkeleton as It } from "./features/SwapQuote/SwapQuoteSkeleton.js";
109
+ import { Notes as de } from "./components/Notes.js";
110
+ import { Accordion as rs } from "./components/Accordion.js";
111
+ import { formatUsdAmount as $e } from "./utils/formatters/formatUsdAmount.js";
112
+ import { formatTinyNumber as as } from "./utils/formatters/formatTinyNumber.js";
113
+ import os from "clsx";
114
+ import { Skeleton as is } from "./components/Skeleton.js";
115
+ import { getBalancePortion as cs } from "./features/TokenInput/utils/getBalancePortion.js";
116
+ import { getUsdDisplayAmount as ls } from "./features/TokenInput/utils/getUsdDisplayAmount.js";
117
+ import { TokenInputHeading as wt } from "./features/TokenInput/TokenInputHeading.js";
118
+ import { noop as ds } from "./utils/noop.js";
119
+ import { Card as ie } from "./components/Card.js";
120
+ import { Badge as Ke } from "./components/Badge.js";
121
+ import { TokenIcon as kt } from "./components/TokenIcon.js";
122
+ import { InputAmount as us } from "./components/InputAmount.js";
123
+ import { TokenInputSkeleton as ms } from "./features/TokenInput/TokenInputSkeleton.js";
124
+ import { getUsdDisplayBalance as fs } from "./utils/formatters/getUsdDisplayBalance.js";
125
+ import { VList as ps } from "virtua";
126
+ import { TokensListPlaceholder as Se } from "./features/TokensList/TokensListPlaceholder.js";
127
+ import { Hr as hs } from "./components/Hr.js";
128
+ import { createTokenSorter as Ts } from "./utils/tokens/sort.js";
129
+ import { createFilterByIntents as He } from "./utils/tokens/filterByIntents.js";
130
+ import { createFilterBySearch as gs } from "./utils/tokens/filterBySearchString.js";
131
+ import { createFilterBySelectedChain as Is } from "./utils/tokens/filterBySelectedChain.js";
132
132
  import "bs58";
133
133
  import "viem/chains";
134
- import "browser-or-node";
134
+ import { isBrowser as At } from "browser-or-node";
135
135
  import "qrcode.react";
136
- import { ThemeProvider as ps } from "./theme/ThemeProvider.js";
137
- import "./features/WalletCompatibilityCheck/WalletCompatibilityModal.js";
138
- import { DEFAULT_RPCS as Ts } from "./rpcs.js";
139
- import { useAddClassToPortal as hs } from "./hooks/useAddClassToPortal.js";
140
- import { ErrorBoundary as gs } from "react-error-boundary";
141
- import { isEvmToken as Is } from "./utils/evm/isEvmToken.js";
142
- import { isEvmBaseToken as ws } from "./utils/evm/isEvmBaseToken.js";
143
- import { getEvmMainTokenBalance as ks } from "./utils/evm/getEvmMainTokenBalance.js";
144
- import { getNativeNearBalance as Ss } from "./utils/near/getNativeNearBalance.js";
145
- import { getNearTokenBalance as As } from "./utils/near/getNearTokenBalance.js";
146
- import { getEvmTokenBalance as _s } from "./utils/evm/getEvmTokenBalance.js";
147
- function Ns({ rpcs: e, token: t, connectedWallets: r }) {
148
- const { walletSupportedChains: s, tonCenterApiKey: n, alchemyApiKey: a } = E(), { walletAddress: l } = tt(r, t);
149
- return Ae({
136
+ import { createColorPalette as ws } from "./theme/createColorPalette.js";
137
+ import { ArmingCountdownFill as ks, BeenhereFill as As, EncryptedFill as Ss, AccountBalanceWalletFill as Ns, CheckCircleFill as _s, GppBadFill as ys } from "@material-symbols-svg/react-rounded";
138
+ import { useTimer as bs } from "use-timer";
139
+ import { CloseButton as St } from "./components/CloseButton.js";
140
+ import { DEFAULT_RPCS as Es } from "./rpcs.js";
141
+ import { useAddClassToPortal as Cs } from "./hooks/useAddClassToPortal.js";
142
+ import { ErrorBoundary as Rs } from "react-error-boundary";
143
+ import { isEvmToken as vs } from "./utils/evm/isEvmToken.js";
144
+ import { isEvmBaseToken as Ds } from "./utils/evm/isEvmBaseToken.js";
145
+ import { getEvmMainTokenBalance as xs } from "./utils/evm/getEvmMainTokenBalance.js";
146
+ import { getNativeNearBalance as Os } from "./utils/near/getNativeNearBalance.js";
147
+ import { getNearTokenBalance as Fs } from "./utils/near/getNearTokenBalance.js";
148
+ import { getEvmTokenBalance as Ls } from "./utils/evm/getEvmTokenBalance.js";
149
+ function Bs({ rpcs: e, token: t, connectedWallets: r }) {
150
+ const { walletSupportedChains: s, tonCenterApiKey: n, alchemyApiKey: a } = y(), { walletAddress: l } = ot(r, t);
151
+ return _e({
150
152
  retry: 2,
151
153
  enabled: !!l && Object.keys(e).includes(t.blockchain),
152
154
  queryKey: ["tokenBalance", t.assetId, r],
@@ -154,49 +156,49 @@ function Ns({ rpcs: e, token: t, connectedWallets: r }) {
154
156
  if (!l)
155
157
  return null;
156
158
  if (t.blockchain === "near" && s.includes(t.blockchain))
157
- return !e.near || e.near.length === 0 ? null : t.assetId === Q ? Ss(l, e.near) : As(t, l, e.near);
158
- if (!s.includes("eth") && M(t.blockchain))
159
+ return !e.near || e.near.length === 0 ? null : t.assetId === $ ? Os(l, e.near) : Fs(t, l, e.near);
160
+ if (!s.includes("eth") && Q(t.blockchain))
159
161
  return null;
160
- if (M(t.blockchain) && ws(t)) {
161
- const i = e[t.blockchain] ?? [];
162
- return i.length > 0 ? ks(l, i[0]) : null;
162
+ if (Q(t.blockchain) && Ds(t)) {
163
+ const c = e[t.blockchain] ?? [];
164
+ return c.length > 0 ? xs(l, c[0]) : null;
163
165
  }
164
- if (Is(t) || M(t.blockchain)) {
165
- const i = e[t.blockchain] ?? [];
166
- return i.length > 0 ? _s(t, l, i[0]) : null;
166
+ if (vs(t) || Q(t.blockchain)) {
167
+ const c = e[t.blockchain] ?? [];
168
+ return c.length > 0 ? Ls(t, l, c[0]) : null;
167
169
  }
168
- return t.blockchain === "ton" ? $t(t, l, n) : t.blockchain === "sol" && s.includes(t.blockchain) ? Kt(t, l, a) : (b.warn(
170
+ return t.blockchain === "ton" ? zt(t, l, n) : t.blockchain === "sol" && s.includes(t.blockchain) ? Yt(t, l, a) : (b.warn(
169
171
  `Failed to fetch token balance for ${t.symbol} on ${t.blockchain}`
170
172
  ), null);
171
173
  }
172
174
  });
173
175
  }
174
- const Es = ({
176
+ const qs = ({
175
177
  rpcs: e,
176
178
  token: t,
177
179
  onBalancesLoaded: r
178
- }) => (R(() => {
180
+ }) => (C(() => {
179
181
  t.isIntent || !Object.keys(e).includes(t.blockchain) || r({ [t.assetId]: "0" });
180
- }, [t.assetId]), null), gt = Ot(
182
+ }, [t.assetId]), null), Nt = Ut(
181
183
  ({ rpcs: e, token: t, connectedWallets: r, onBalancesLoaded: s }) => {
182
- const { data: n } = Ns({
184
+ const { data: n } = Bs({
183
185
  rpcs: e,
184
186
  token: t,
185
187
  connectedWallets: r
186
188
  });
187
- return R(() => {
189
+ return C(() => {
188
190
  !t.isIntent && n != null && s({ [t.assetId]: n });
189
191
  }, [t, n, s]), null;
190
192
  },
191
193
  (e, t) => e.token.assetId === t.token.assetId && e.connectedWallets === t.connectedWallets
192
194
  );
193
- gt.displayName = "TokenBalanceLoader";
194
- const Ke = Object.assign(gt, {
195
- Zero: Es
196
- }), bs = (e) => {
195
+ Nt.displayName = "TokenBalanceLoader";
196
+ const Ge = Object.assign(Nt, {
197
+ Zero: qs
198
+ }), Us = (e) => {
197
199
  const t = e.toLowerCase();
198
- return Ne[t]?.icon ?? "";
199
- }, He = (e) => _e[e].icon ?? Gt, ys = (e) => `${e?.charAt(0).toUpperCase()}${e?.slice(1)}`, Rs = (e) => Ne[e]?.name ?? e, P = (e) => {
200
+ return be[t]?.icon ?? "";
201
+ }, je = (e) => ye[e].icon ?? Xt, Ps = (e) => `${e?.charAt(0).toUpperCase()}${e?.slice(1)}`, Ws = (e) => be[e]?.name ?? e, P = (e) => {
200
202
  const {
201
203
  showIntentTokens: t,
202
204
  allowedTokensList: r,
@@ -204,58 +206,58 @@ const Ke = Object.assign(gt, {
204
206
  allowedTargetTokensList: n,
205
207
  filterTokens: a,
206
208
  fetchSourceTokens: l,
207
- fetchTargetTokens: i
208
- } = E(), { data: d, ...u } = Ae({
209
+ fetchTargetTokens: c
210
+ } = y(), { data: d, ...u } = _e({
209
211
  queryKey: ["tokens", e].filter(Boolean),
210
- queryFn: async () => e === "source" && l ? l() : e === "target" && i ? i() : Ht.getTokens()
211
- }), o = x(() => {
212
+ queryFn: async () => e === "source" && l ? l() : e === "target" && c ? c() : Zt.getTokens()
213
+ }), i = v(() => {
212
214
  if (!d)
213
215
  return [];
214
216
  const m = d.map((f) => {
215
- const I = f.blockchain.toLowerCase();
216
- return !rn(I) || r && !r.includes(f.assetId) || e === "source" && s && !s.includes(f.assetId) || e === "target" && n && !n.includes(f.assetId) ? null : {
217
+ const w = f.blockchain.toLowerCase();
218
+ return !dn(w) || r && !r.includes(f.assetId) || e === "source" && s && !s.includes(f.assetId) || e === "target" && n && !n.includes(f.assetId) ? null : {
217
219
  assetId: f.assetId,
218
220
  symbol: f.symbol,
219
221
  decimals: f.decimals,
220
222
  price: f.price,
221
- blockchain: I,
223
+ blockchain: w,
222
224
  isIntent: !1,
223
- icon: f.icon ?? bs(f.symbol),
224
- name: Rs(f.symbol),
225
- chainIcon: He(I),
226
- chainName: _e[f.blockchain]?.label ?? ys(f.blockchain),
225
+ icon: f.icon ?? Us(f.symbol),
226
+ name: Ws(f.symbol),
227
+ chainIcon: je(w),
228
+ chainName: ye[f.blockchain]?.label ?? Ps(f.blockchain),
227
229
  contractAddress: f.contractAddress
228
230
  };
229
- }).filter((f) => !!f).filter(a ?? (() => !0)), T = m.filter(
231
+ }).filter((f) => !!f).filter(a ?? (() => !0)), h = m.filter(
230
232
  (f) => f.symbol.toLowerCase() !== "wnear"
231
- ), h = m.find((f) => f.symbol.toLowerCase() === "wnear");
232
- return h && T.push({
233
+ ), g = m.find((f) => f.symbol.toLowerCase() === "wnear");
234
+ return g && h.push({
233
235
  name: "NEAR",
234
236
  symbol: "NEAR",
235
237
  chainName: "Near",
236
238
  blockchain: "near",
237
- assetId: Q,
238
- chainIcon: He("near"),
239
- icon: Ne.near?.icon ?? "",
240
- price: h?.price ?? 0,
241
- contractAddress: h?.contractAddress,
239
+ assetId: $,
240
+ chainIcon: je("near"),
241
+ icon: be.near?.icon ?? "",
242
+ price: g?.price ?? 0,
243
+ contractAddress: g?.contractAddress,
242
244
  isIntent: !1,
243
245
  decimals: 24
244
246
  }), t ? [
245
- ...T,
247
+ ...h,
246
248
  // add intents tokens to the full list
247
249
  ...m.map(
248
250
  (f) => f.symbol.toLowerCase() === "wnear" ? { ...f, symbol: "NEAR", name: "NEAR", isIntent: !0 } : { ...f, isIntent: !0 }
249
251
  )
250
- ] : T;
252
+ ] : h;
251
253
  }, [d, t, a]);
252
254
  return {
253
255
  ...u,
254
- tokens: o
256
+ tokens: i
255
257
  };
256
- }, Ds = () => {
258
+ }, Vs = () => {
257
259
  const { tokens: e } = P(), { tokens: t } = P("source"), { tokens: r } = P("target");
258
- return { tokens: x(() => {
260
+ return { tokens: v(() => {
259
261
  const n = {};
260
262
  return [
261
263
  ...e,
@@ -266,169 +268,169 @@ const Ke = Object.assign(gt, {
266
268
  n[l] = a;
267
269
  }), Object.values(n);
268
270
  }, [e, t, r]) };
269
- }, de = [
271
+ }, ue = [
270
272
  { eth: ["ETH", "USDT", "USDC", "AURORA"] },
271
273
  { near: ["USDT", "USDC", "AURORA"] },
272
274
  { arb: ["ARB", "ETH", "USDT", "USDC"] },
273
275
  { btc: ["BTC"] }
274
- ], Cs = (e) => [...e].sort((t, r) => {
275
- const s = de.findIndex(
276
+ ], Ms = (e) => [...e].sort((t, r) => {
277
+ const s = ue.findIndex(
276
278
  (d) => Object.keys(d)[0] === t.blockchain
277
- ), n = de.findIndex(
279
+ ), n = ue.findIndex(
278
280
  (d) => Object.keys(d)[0] === r.blockchain
279
281
  );
280
282
  if (s !== n)
281
283
  return s === -1 ? 1 : n === -1 ? -1 : s - n;
282
- const a = de[s]?.[t.blockchain] ?? [], l = a.indexOf(t.symbol), i = a.indexOf(r.symbol);
283
- return l === -1 && i === -1 ? 0 : l === -1 ? 1 : i === -1 ? -1 : l - i;
284
- }), vs = ({ rpcs: e, connectedWallets: t }) => {
285
- const { tokens: r } = Ds(), { walletSupportedChains: s } = E(), { setWalletBalance: n } = Ee(t);
286
- return x(() => Cs(r), [r]).map((l) => s.includes(l.blockchain) ? /* @__PURE__ */ c(
287
- Ke,
284
+ const a = ue[s]?.[t.blockchain] ?? [], l = a.indexOf(t.symbol), c = a.indexOf(r.symbol);
285
+ return l === -1 && c === -1 ? 0 : l === -1 ? 1 : c === -1 ? -1 : l - c;
286
+ }), Qs = ({ rpcs: e, connectedWallets: t }) => {
287
+ const { tokens: r } = Vs(), { walletSupportedChains: s } = y(), { setWalletBalance: n } = Ee(t);
288
+ return v(() => Ms(r), [r]).map((l) => s.includes(l.blockchain) ? /* @__PURE__ */ o(
289
+ Ge,
288
290
  {
289
291
  rpcs: e,
290
292
  token: l,
291
293
  connectedWallets: t,
292
- onBalancesLoaded: (i) => n(t, i)
294
+ onBalancesLoaded: (c) => n(t, c)
293
295
  },
294
- $(l)
295
- ) : /* @__PURE__ */ c(
296
- Ke.Zero,
296
+ G(l)
297
+ ) : /* @__PURE__ */ o(
298
+ Ge.Zero,
297
299
  {
298
300
  rpcs: e,
299
301
  token: l,
300
- onBalancesLoaded: (i) => n(t, i)
302
+ onBalancesLoaded: (c) => n(t, c)
301
303
  },
302
- $(l)
304
+ G(l)
303
305
  ));
304
306
  };
305
- function Os(e, t) {
307
+ function $s(e, t) {
306
308
  const r = Array.from(
307
- /* @__PURE__ */ new Set([...t ?? [], ...nt])
309
+ /* @__PURE__ */ new Set([...t ?? [], ...it])
308
310
  ), s = new Map(r.map((n, a) => [n, a]));
309
311
  return [...e].sort((n, a) => {
310
- const l = s.has(n.id) ? s.get(n.id) : 1 / 0, i = s.has(a.id) ? s.get(a.id) : 1 / 0;
311
- return l !== i ? l - i : n.id.localeCompare(a.id, void 0, { sensitivity: "base" });
312
+ const l = s.has(n.id) ? s.get(n.id) : 1 / 0, c = s.has(a.id) ? s.get(a.id) : 1 / 0;
313
+ return l !== c ? l - c : n.id.localeCompare(a.id, void 0, { sensitivity: "base" });
312
314
  });
313
315
  }
314
- const xs = (e) => {
316
+ const Ks = (e) => {
315
317
  const {
316
318
  chainsOrder: t,
317
319
  allowedChainsList: r,
318
320
  allowedSourceChainsList: s,
319
321
  allowedTargetChainsList: n
320
- } = E(), { tokens: a } = P();
321
- return x(() => {
322
+ } = y(), { tokens: a } = P();
323
+ return v(() => {
322
324
  const l = Array.from(
323
- new Set(a.map((i) => _e[i.blockchain]))
324
- ).filter((i) => !(r && !r.includes(i.id) || e === "source" && s && !s.includes(i.id) || e === "target" && n && !n.includes(i.id)));
325
- return Os(l, t);
325
+ new Set(a.map((c) => ye[c.blockchain]))
326
+ ).filter((c) => !(r && !r.includes(c.id) || e === "source" && s && !s.includes(c.id) || e === "target" && n && !n.includes(c.id)));
327
+ return $s(l, t);
326
328
  }, [a, t, r]);
327
- }, Ge = 3, It = ({
329
+ }, ze = 3, _t = ({
328
330
  connectedWallets: e,
329
331
  alchemyApiKey: t,
330
332
  ...r
331
333
  }) => {
332
- const { ctx: s } = A(), { tokens: n } = P(), { walletSupportedChains: a } = E(), { setWalletBalance: l } = Ee(e), i = r.isEnabled && !!Object.values(e).length && a.length > 0, d = qt({
334
+ const { ctx: s } = _(), { tokens: n } = P(), { walletSupportedChains: a } = y(), { setWalletBalance: l } = Ee(e), c = r.isEnabled && !!Object.values(e).length && a.length > 0, d = Mt({
333
335
  initialPageParam: null,
334
- enabled: !!i && !!t,
336
+ enabled: !!c && !!t,
335
337
  queryKey: ["walletTokensBalance", e],
336
- queryFn: async ({ pageParam: o }) => nn({ alchemyApiKey: t })({
337
- pageParam: o ? `${o}` : null,
338
+ queryFn: async ({ pageParam: i }) => cn({ alchemyApiKey: t })({
339
+ pageParam: i ? `${i}` : null,
338
340
  connectedWallets: e,
339
341
  walletSupportedChains: a
340
342
  }),
341
- getNextPageParam: (o, m) => {
342
- if (o.pageKey && !(m.length >= Ge))
343
- return o.pageKey;
343
+ getNextPageParam: (i, m) => {
344
+ if (i.pageKey && !(m.length >= ze))
345
+ return i.pageKey;
344
346
  }
345
347
  });
346
- R(() => {
347
- i && d.data && d.hasNextPage && d.data.pages.length < Ge && !d.isFetchingNextPage && d.fetchNextPage();
348
- }, [i, d]);
349
- const u = x(() => {
348
+ C(() => {
349
+ c && d.data && d.hasNextPage && d.data.pages.length < ze && !d.isFetchingNextPage && d.fetchNextPage();
350
+ }, [c, d]);
351
+ const u = v(() => {
350
352
  if (!d.data?.pages)
351
353
  return {};
352
- const o = tn(
354
+ const i = on(
353
355
  n,
354
356
  d.data.pages.flatMap((m) => m.data)
355
357
  );
356
358
  return n.forEach((m) => {
357
- sn(m.blockchain) && !(m.assetId in o) && (o[m.assetId] = "0");
358
- }), o;
359
+ ln(m.blockchain) && !(m.assetId in i) && (i[m.assetId] = "0");
360
+ }), i;
359
361
  }, [d.data, n]);
360
- return R(() => {
361
- C(s, ["initial_wallet"]) && (l(e, u), s.sourceToken && Object.keys(u).includes(s.sourceToken.assetId) && p("tokenSetBalance", u[s.sourceToken.assetId]));
362
+ return C(() => {
363
+ D(s, ["initial_wallet"]) && (l(e, u), s.sourceToken && Object.keys(u).includes(s.sourceToken.assetId) && p("tokenSetBalance", u[s.sourceToken.assetId]));
362
364
  }, [u]), {
363
365
  status: d.status,
364
366
  refetch: d.refetch,
365
367
  balances: u
366
368
  };
367
- }, ie = () => {
368
- const { intentsAccountType: e } = E(), {
369
+ }, ce = () => {
370
+ const { intentsAccountType: e } = y(), {
369
371
  ctx: { walletAddress: t }
370
- } = A(), { tokens: r } = P(), s = r.filter((i) => i.isIntent).map((i) => i.assetId), n = ee({
372
+ } = _(), { tokens: r } = P(), s = r.filter((c) => c.isIntent).map((c) => c.assetId), n = te({
371
373
  walletAddress: t,
372
374
  addressType: e
373
- }), a = Ae({
375
+ }), a = _e({
374
376
  enabled: !!t && !!n && r.length > 0,
375
377
  queryKey: ["intentsBalances", n],
376
- queryFn: async () => n ? await an(n, s) : {}
377
- }), l = x(() => {
378
+ queryFn: async () => n ? await un(n, s) : {}
379
+ }), l = v(() => {
378
380
  switch (a.status) {
379
381
  case "error":
380
382
  return b.error("Unable to load intents balances:", a.error), {};
381
383
  case "success":
382
384
  return Object.fromEntries(
383
- Object.entries(a.data).map(([i, d]) => [
384
- `intent-${i}`,
385
+ Object.entries(a.data).map(([c, d]) => [
386
+ `intent-${c}`,
385
387
  d
386
388
  ])
387
389
  );
388
390
  case "pending":
389
391
  return {};
390
392
  default:
391
- return be(a, { throwError: !1 }), {};
393
+ return Ce(a, { throwError: !1 }), {};
392
394
  }
393
395
  }, [a]) ?? {};
394
396
  return {
395
397
  ...a,
396
398
  intentBalances: l
397
399
  };
398
- }, Fs = ({
400
+ }, Hs = ({
399
401
  isEnabled: e,
400
402
  alchemyApiKey: t
401
403
  }) => {
402
- const { connectedWallets: r } = E(), { ctx: s } = A(), n = Ut(), { refetch: a } = ie(), { refetch: l } = It({
404
+ const { connectedWallets: r } = y(), { ctx: s } = _(), n = Qt(), { refetch: a } = ce(), { refetch: l } = _t({
403
405
  isEnabled: e,
404
406
  connectedWallets: r,
405
407
  alchemyApiKey: t ?? ""
406
408
  });
407
- R(() => {
408
- const i = C(s, ["transfer_success"]);
409
- !e || !i || (async () => (await a(), t && (await new Promise((d) => {
409
+ C(() => {
410
+ const c = D(s, ["transfer_success"]);
411
+ !e || !c || (async () => (await a(), t && (await new Promise((d) => {
410
412
  setTimeout(d, 1e4);
411
413
  }), await l()), await n.invalidateQueries({ queryKey: ["tokenBalance"] })))();
412
414
  }, [s.state, e, t]);
413
- }, ce = () => {
414
- const { connectedWallets: e } = E(), { intentBalances: t } = ie(), { walletBalance: r } = Ee(e);
415
- return { mergedBalance: x(
415
+ }, le = () => {
416
+ const { connectedWallets: e } = y(), { intentBalances: t } = ce(), { walletBalance: r } = Ee(e);
417
+ return { mergedBalance: v(
416
418
  () => ({ ...r, ...t }),
417
419
  [r, t]
418
420
  ) };
419
- }, Ls = ({ isEnabled: e }) => {
420
- const { ctx: t } = A(), { mergedBalance: r } = ce();
421
- R(() => {
421
+ }, Gs = ({ isEnabled: e }) => {
422
+ const { ctx: t } = _(), { mergedBalance: r } = le();
423
+ C(() => {
422
424
  if (!e)
423
425
  return;
424
426
  if (!t.sourceToken || !t.walletAddress) {
425
427
  p("tokenSetBalance", void 0);
426
428
  return;
427
429
  }
428
- const s = $(t.sourceToken);
430
+ const s = G(t.sourceToken);
429
431
  p("tokenSetBalance", r[s]);
430
432
  }, [r, t.sourceToken]);
431
- }, je = {
433
+ }, Ye = {
432
434
  // cbBTC (eth)
433
435
  "nep141:eth-0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf.omft.near": "nep141:nbtc.bridge.near",
434
436
  // cbBTC (base)
@@ -443,11 +445,11 @@ const xs = (e) => {
443
445
  "nep245:v2_1.omni.hot.tg:56_SZzgw3HSudhZcTwPWUTi2RJB19t": "nep141:wrap.near",
444
446
  // BTC (near)
445
447
  "nep141:btc.omft.near": "nep141:nbtc.bridge.near"
446
- }, Bs = ({
448
+ }, js = ({
447
449
  isEnabled: e
448
450
  }) => {
449
- const { ctx: t } = A(), { tokens: r } = P();
450
- R(() => {
451
+ const { ctx: t } = _(), { tokens: r } = P();
452
+ C(() => {
451
453
  if (!e)
452
454
  return;
453
455
  if (!t.sourceToken) {
@@ -455,121 +457,121 @@ const xs = (e) => {
455
457
  return;
456
458
  }
457
459
  const { sourceToken: s } = t;
458
- if (t.sourceToken.assetId in je) {
459
- const i = r.find(
460
- (d) => d.isIntent && d.assetId === je[s.assetId]
460
+ if (t.sourceToken.assetId in Ye) {
461
+ const c = r.find(
462
+ (d) => d.isIntent && d.assetId === Ye[s.assetId]
461
463
  );
462
464
  p("tokenSelect", {
463
465
  variant: "target",
464
- token: i
466
+ token: c
465
467
  });
466
468
  return;
467
469
  }
468
470
  const n = r.find(
469
- (i) => i.isIntent && i.symbol === s.symbol && i.blockchain === "near"
471
+ (c) => c.isIntent && c.symbol === s.symbol && c.blockchain === "near"
470
472
  );
471
473
  if (n) {
472
474
  p("tokenSelect", { variant: "target", token: n });
473
475
  return;
474
476
  }
475
477
  const a = r.find(
476
- (i) => i.isIntent && i.assetId === s.assetId
478
+ (c) => c.isIntent && c.assetId === s.assetId
477
479
  ), l = r.find(
478
- (i) => i.isIntent && i.symbol === "USDC" && i.blockchain === "near"
480
+ (c) => c.isIntent && c.symbol === "USDC" && c.blockchain === "near"
479
481
  );
480
482
  p("tokenSelect", {
481
483
  variant: "target",
482
484
  token: a ?? l
483
485
  });
484
486
  }, [r, t.sourceToken]);
485
- }, qs = ({ isEnabled: e }) => {
486
- const { connectedWallets: t } = E(), { ctx: r, state: s } = A(), { walletAddress: n } = tt(
487
+ }, zs = ({ isEnabled: e }) => {
488
+ const { connectedWallets: t } = y(), { ctx: r, state: s } = _(), { walletAddress: n } = ot(
487
489
  t,
488
490
  r.sourceToken
489
491
  );
490
- R(() => {
492
+ C(() => {
491
493
  if (!e)
492
494
  return;
493
- p("walletAddressSet", n), C(r, ["initial_dry", "initial_wallet"]) && (s === "initial_wallet" && !n ? O("initial_dry") : s === "initial_dry" && n && O("initial_wallet"));
495
+ p("walletAddressSet", n), D(r, ["initial_dry", "initial_wallet"]) && (s === "initial_wallet" && !n ? O("initial_dry") : s === "initial_dry" && n && O("initial_wallet"));
494
496
  }, [e, n, r, s]);
495
- }, Us = (e) => (["depositAddress"].forEach((t) => {
497
+ }, Ys = (e) => (["depositAddress"].forEach((t) => {
496
498
  if (!(t in e))
497
499
  return b.error(`Missing ${t} in quote response`), !1;
498
- }), !0), Ps = () => {
499
- const { ctx: e } = A(), {
500
+ }), !0), Zs = () => {
501
+ const { ctx: e } = _(), {
500
502
  walletSupportedChains: t,
501
503
  intentsAccountType: r,
502
504
  appName: s,
503
505
  appFees: n,
504
506
  fetchQuote: a,
505
507
  slippageTolerance: l
506
- } = E(), i = ye(e), d = Y(null), u = Y(new AbortController()), o = x(() => async (T, h) => {
508
+ } = y(), c = Re(e), d = Y(null), u = Y(new AbortController()), i = v(() => async (h, g) => {
507
509
  const { signal: f } = u.current;
508
- return a ? a(T, {
509
- ...h,
510
+ return a ? a(h, {
511
+ ...g,
510
512
  signal: f
511
- }) : (await he.post(
513
+ }) : (await Ie.post(
512
514
  "https://1click.chaindefuser.com/v0/quote",
513
- T,
515
+ h,
514
516
  { signal: f }
515
517
  )).data.quote;
516
- }, [he]);
518
+ }, [Ie]);
517
519
  return {
518
520
  make: async ({
519
- message: T,
520
- quoteType: h = "exact_in",
521
+ message: h,
522
+ quoteType: g = "exact_in",
521
523
  options: f = {}
522
524
  } = {}) => {
523
- if (!C(e, [
525
+ if (!D(e, [
524
526
  "input_valid_dry",
525
527
  "input_valid_external",
526
528
  "input_valid_internal",
527
529
  "quote_success_internal",
528
530
  "quote_success_external"
529
531
  ])) {
530
- const w = `Unable to run quote in current state ${e.state}`;
531
- throw b.error(`[WIDGET] ${w}`), new q({
532
+ const k = `Unable to run quote in current state ${e.state}`;
533
+ throw b.error(`[WIDGET] ${k}`), new q({
532
534
  code: "QUOTE_INVALID_INITIAL",
533
- meta: { isDry: i, message: w }
535
+ meta: { isDry: c, message: k }
534
536
  });
535
537
  }
536
- const S = ee({
538
+ const S = te({
537
539
  addressType: r,
538
- walletAddress: i ? (
540
+ walletAddress: c ? (
539
541
  // address on the target chain should be a dry quote recipient
540
- qe(e.targetToken.blockchain)
542
+ Pe(e.targetToken.blockchain)
541
543
  ) : e.walletAddress ?? ""
542
- }), y = S && (e.sourceToken.isIntent || !t.includes(e.sourceToken.blockchain)), B = () => i ? qe(
544
+ }), E = S && (e.sourceToken.isIntent || !t.includes(e.sourceToken.blockchain)), B = () => c ? Pe(
543
545
  e.sourceToken.blockchain,
544
546
  e.sourceToken.isIntent
545
- ) : y ? S : e.walletAddress ?? "";
547
+ ) : E ? S : e.walletAddress ?? "";
546
548
  if (!S) {
547
- const w = "No corresponding intents account to run a quote";
548
- throw b.error(`[WIDGET] ${w}`), new q({
549
+ const k = "No corresponding intents account to run a quote";
550
+ throw b.error(`[WIDGET] ${k}`), new q({
549
551
  code: "QUOTE_INVALID_INITIAL",
550
- meta: { isDry: i, message: w }
552
+ meta: { isDry: c, message: k }
551
553
  });
552
554
  }
553
555
  d.current && (u.current.abort("Abort previous quote (auto)"), u.current = new AbortController());
554
556
  let F;
555
557
  const L = {
556
558
  // Settings
557
- dry: i,
559
+ dry: c,
558
560
  slippageTolerance: l,
559
561
  deadline: new Date(Date.now() + 3600 * 1e3).toISOString(),
560
562
  // 1 hour
561
- swapType: h === "exact_out" ? U.swapType.EXACT_OUTPUT : U.swapType.EXACT_INPUT,
563
+ swapType: g === "exact_out" ? U.swapType.EXACT_OUTPUT : U.swapType.EXACT_INPUT,
562
564
  // Target
563
- destinationAsset: e.targetToken.assetId === Q ? Te : e.targetToken.assetId,
565
+ destinationAsset: e.targetToken.assetId === $ ? ge : e.targetToken.assetId,
564
566
  // Source
565
- originAsset: e.sourceToken.assetId === Q ? Te : e.sourceToken.assetId,
566
- amount: h === "exact_out" ? e.targetTokenAmount : e.sourceTokenAmount,
567
+ originAsset: e.sourceToken.assetId === $ ? ge : e.sourceToken.assetId,
568
+ amount: g === "exact_out" ? e.targetTokenAmount : e.sourceTokenAmount,
567
569
  // Experimental
568
570
  quoteWaitingTimeMs: 0
569
571
  };
570
- T && (L.customRecipientMsg = T), s && (L.referral = at(s)), n && (L.appFees = [...n]);
572
+ h && (L.customRecipientMsg = h), s && (L.referral = dt(s)), n && (L.appFees = [...n]);
571
573
  try {
572
- e.sourceToken.isIntent && e.targetToken.isIntent && (d.current = o(
574
+ e.sourceToken.isIntent && e.targetToken.isIntent && (d.current = i(
573
575
  {
574
576
  ...L,
575
577
  recipient: S,
@@ -580,7 +582,7 @@ const xs = (e) => {
580
582
  refundType: U.refundType.INTENTS
581
583
  },
582
584
  f
583
- ), F = await d.current), d.current = o(
585
+ ), F = await d.current), d.current = i(
584
586
  {
585
587
  ...L,
586
588
  recipient: !e.targetToken.isIntent && e.sendAddress ? e.sendAddress : S,
@@ -588,44 +590,44 @@ const xs = (e) => {
588
590
  depositType: e.sourceToken.isIntent ? U.depositType.INTENTS : U.depositType.ORIGIN_CHAIN,
589
591
  // Refund
590
592
  refundTo: B(),
591
- refundType: y ? U.refundType.INTENTS : U.refundType.ORIGIN_CHAIN
593
+ refundType: E ? U.refundType.INTENTS : U.refundType.ORIGIN_CHAIN
592
594
  },
593
595
  f
594
596
  ), F = await d.current;
595
- } catch (w) {
596
- if (w instanceof ot)
597
+ } catch (k) {
598
+ if (k instanceof ut)
597
599
  return;
598
- b.error("Quote error: ", w);
599
- let v = w instanceof Error ? w.message : "";
600
- if (w instanceof it) {
601
- if (v = w.response?.data.message || v, v.includes("Amount is too low")) {
602
- const Z = v.match(/\d+/), J = Z ? Z[0] : void 0;
600
+ b.error("Quote error: ", k);
601
+ let x = k instanceof Error ? k.message : "";
602
+ if (k instanceof mt) {
603
+ if (x = k.response?.data.message || x, x.includes("Amount is too low")) {
604
+ const X = x.match(/\d+/), J = X ? X[0] : void 0;
603
605
  throw new q({
604
606
  code: "QUOTE_AMOUNT_IS_TOO_LOW",
605
607
  meta: {
606
- minAmount: (J && j(J, e.sourceToken.decimals)) ?? "0"
608
+ minAmount: (J && z(J, e.sourceToken.decimals)) ?? "0"
607
609
  }
608
610
  });
609
611
  }
610
- throw v.includes("recipient is not valid") ? new q({
612
+ throw x.includes("recipient is not valid") ? new q({
611
613
  code: "TOKEN_IS_NOT_SUPPORTED"
612
- }) : v.includes("Failed to get a deposit address") ? new q({
614
+ }) : x.includes("Failed to get a deposit address") ? new q({
613
615
  code: "QUOTE_NO_ONE_TIME_ADDRESS"
614
- }) : w;
616
+ }) : k;
615
617
  }
616
618
  throw new q({
617
619
  code: "QUOTE_FAILED",
618
620
  meta: {
619
- message: v || "Failed to fetch quote. Please try again."
621
+ message: x || "Failed to fetch quote. Please try again."
620
622
  }
621
623
  });
622
624
  }
623
- return i ? {
625
+ return c ? {
624
626
  dry: !0,
625
627
  ...F,
626
628
  deadline: void 0,
627
629
  depositAddress: void 0
628
- } : (Us(F), {
630
+ } : (Ys(F), {
629
631
  dry: !1,
630
632
  ...F,
631
633
  deadline: F.deadline,
@@ -636,11 +638,11 @@ const xs = (e) => {
636
638
  u.current.abort("Abort quote manually"), u.current = new AbortController();
637
639
  }
638
640
  };
639
- }, Ws = () => {
640
- const { ctx: e } = A(), { intentsAccountType: t } = E(), { isNativeNearDeposit: r } = H(), s = ee({
641
+ }, Xs = () => {
642
+ const { ctx: e } = _(), { intentsAccountType: t } = y(), { isNativeNearDeposit: r } = j(), s = te({
641
643
  addressType: t,
642
644
  walletAddress: e.walletAddress ?? ""
643
- }), n = Y(null), a = Y(new AbortController()), l = x(() => async (d) => ct.post(
645
+ }), n = Y(null), a = Y(new AbortController()), l = v(() => async (d) => ft.post(
644
646
  "",
645
647
  {
646
648
  id: 1,
@@ -656,20 +658,20 @@ const xs = (e) => {
656
658
  {
657
659
  signal: a.current.signal
658
660
  }
659
- ), [he]);
661
+ ), [Ie]);
660
662
  return {
661
663
  make: async () => {
662
- if (!C(e, [
664
+ if (!D(e, [
663
665
  "input_valid_dry",
664
666
  "input_valid_external",
665
667
  "input_valid_internal",
666
668
  "quote_success_internal",
667
669
  "quote_success_external"
668
670
  ])) {
669
- const o = `Unable to run quote in current state ${e.state}`;
670
- throw b.error(`[WIDGET] ${o}`), new q({
671
+ const i = `Unable to run quote in current state ${e.state}`;
672
+ throw b.error(`[WIDGET] ${i}`), new q({
671
673
  code: "QUOTE_INVALID_INITIAL",
672
- meta: { isDry: !1, message: o }
674
+ meta: { isDry: !1, message: i }
673
675
  });
674
676
  }
675
677
  if (r && !e.isDepositFromExternalWallet || !r && e.sourceToken.assetId !== e.targetToken.assetId)
@@ -697,17 +699,17 @@ const xs = (e) => {
697
699
  }
698
700
  });
699
701
  if (!s) {
700
- const o = "No corresponding intents account to run a quote";
701
- throw b.error(`[WIDGET] ${o}`), new q({
702
+ const i = "No corresponding intents account to run a quote";
703
+ throw b.error(`[WIDGET] ${i}`), new q({
702
704
  code: "QUOTE_INVALID_INITIAL",
703
- meta: { isDry: !1, message: o }
705
+ meta: { isDry: !1, message: i }
704
706
  });
705
707
  }
706
708
  n.current && (a.current.abort("Abort previous quote (auto)"), a.current = new AbortController());
707
- let u = st[e.targetToken.blockchain];
709
+ let u = ct[e.targetToken.blockchain];
708
710
  if (!u)
709
- if (M(e.targetToken.blockchain))
710
- u = rt;
711
+ if (Q(e.targetToken.blockchain))
712
+ u = lt;
711
713
  else
712
714
  throw new q({
713
715
  code: "QUOTE_INVALID_INITIAL",
@@ -722,12 +724,12 @@ const xs = (e) => {
722
724
  amountIn: e.sourceTokenAmount,
723
725
  amountOut: e.targetTokenAmount,
724
726
  amountInUsd: `${parseFloat(
725
- j(e.sourceTokenAmount, e.sourceToken.decimals)
727
+ z(e.sourceTokenAmount, e.sourceToken.decimals)
726
728
  ) * e.sourceToken.price}`,
727
729
  amountOutUsd: `${parseFloat(
728
- j(e.targetTokenAmount, e.targetToken.decimals)
730
+ z(e.targetTokenAmount, e.targetToken.decimals)
729
731
  ) * e.targetToken.price}`,
730
- amountOutFormatted: j(
732
+ amountOutFormatted: z(
731
733
  e.targetTokenAmount,
732
734
  e.targetToken.decimals
733
735
  ),
@@ -736,11 +738,11 @@ const xs = (e) => {
736
738
  timeEstimate: 0,
737
739
  dry: !1
738
740
  };
739
- } catch (o) {
740
- if (o instanceof ot)
741
+ } catch (i) {
742
+ if (i instanceof ut)
741
743
  return;
742
- if (b.error(o), o instanceof it) {
743
- const m = o.response?.data.message || o.message;
744
+ if (b.error(i), i instanceof mt) {
745
+ const m = i.response?.data.message || i.message;
744
746
  throw new q({
745
747
  code: "QUOTE_FAILED",
746
748
  meta: {
@@ -754,153 +756,153 @@ const xs = (e) => {
754
756
  a.current.abort("Abort quote manually"), a.current = new AbortController();
755
757
  }
756
758
  };
757
- }, Ye = (e) => {
759
+ }, Ze = (e) => {
758
760
  p("errorSet", e), p("quoteSet", void 0), p("quoteSetStatus", "idle"), p("transferSetStatus", { status: "idle" });
759
- }, ze = async (e) => {
761
+ }, Xe = async (e) => {
760
762
  if (!e.sendAddress)
761
763
  return;
762
764
  let t = !1;
763
765
  try {
764
- p("setInputsValidating", !0), t = await cn(e.sendAddress);
766
+ p("setInputsValidating", !0), t = await fn(e.sendAddress);
765
767
  } catch {
766
- Ye({
768
+ Ze({
767
769
  code: "SEND_ADDRESS_IS_NOT_VERIFIED",
768
770
  meta: { address: e.sendAddress, chain: "near" }
769
771
  }), p("setInputsValidating", !1), O("initial_wallet");
770
772
  return;
771
773
  }
772
774
  if (p("setInputsValidating", !1), !t) {
773
- Ye({
775
+ Ze({
774
776
  code: "SEND_ADDRESS_IS_NOT_FOUND",
775
777
  meta: { address: e.sendAddress, chain: "near" }
776
778
  }), O("initial_wallet");
777
779
  return;
778
780
  }
779
- e.error ? ln(e.error) && (p("errorSet", null), O("input_valid_external")) : O("input_valid_external");
780
- }, wt = (e) => {
781
- const t = C(e, ["initial_dry"]), r = C(e, ["input_valid_dry"]);
781
+ e.error ? pn(e.error) && (p("errorSet", null), O("input_valid_external")) : O("input_valid_external");
782
+ }, yt = (e) => {
783
+ const t = D(e, ["initial_dry"]), r = D(e, ["input_valid_dry"]);
782
784
  if (!t && !r)
783
785
  return;
784
786
  let s;
785
- return t && (e.sourceToken ? e.targetToken ? te(e.sourceTokenAmount) ? e.walletAddress && !Re(e) && (s = { code: "SOURCE_BALANCE_INSUFFICIENT" }) : s = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : s = { code: "TARGET_TOKEN_IS_EMPTY" } : s = { code: "SOURCE_TOKEN_IS_EMPTY" }), !r && s ? p("errorSet", s) : e.error && !De(e.error) && !Ce(e.error) && p("errorSet", null), r && s?.code === "SOURCE_BALANCE_INSUFFICIENT" && p("errorSet", s), r;
786
- }, kt = (e) => {
787
- const t = C(e, ["initial_wallet"]), r = C(e, ["input_valid_external"]);
787
+ return t && (e.sourceToken ? e.targetToken ? ne(e.sourceTokenAmount) ? e.walletAddress && !ve(e) && (s = { code: "SOURCE_BALANCE_INSUFFICIENT" }) : s = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : s = { code: "TARGET_TOKEN_IS_EMPTY" } : s = { code: "SOURCE_TOKEN_IS_EMPTY" }), !r && s ? p("errorSet", s) : e.error && !De(e.error) && !xe(e.error) && p("errorSet", null), r && s?.code === "SOURCE_BALANCE_INSUFFICIENT" && p("errorSet", s), r;
788
+ }, bt = (e) => {
789
+ const t = D(e, ["initial_wallet"]), r = D(e, ["input_valid_external"]);
788
790
  if (!t && !r)
789
791
  return;
790
792
  const s = e.sourceTokenBalance;
791
793
  let n;
792
- return t && (e.sourceToken ? e.targetToken ? e.targetToken.isIntent ? n = { code: "SOURCE_TOKEN_IS_INTENT" } : te(e.sourceTokenAmount) ? e.sendAddress ? e.targetToken.blockchain === "near" ? dt(e.sendAddress) ? ze(e) : n = {
794
+ return t && (e.sourceToken ? e.targetToken ? e.targetToken.isIntent ? n = { code: "SOURCE_TOKEN_IS_INTENT" } : ne(e.sourceTokenAmount) ? e.sendAddress ? e.targetToken.blockchain === "near" ? ht(e.sendAddress) ? Xe(e) : n = {
793
795
  code: "SEND_ADDRESS_IS_INVALID",
794
796
  meta: { address: e.sendAddress, chain: "near" }
795
- } : e.isDepositFromExternalWallet || (!s || !lt(s) ? n = { code: "INVALID_SOURCE_BALANCE" } : Re(e) || (n = { code: "SOURCE_BALANCE_INSUFFICIENT" })) : n = { code: "SEND_ADDRESS_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : n = { code: "TARGET_TOKEN_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_IS_EMPTY" }), r && e.targetToken.blockchain === "near" && ze(e), !r && n ? p("errorSet", n) : e.error && !De(e.error) && !Ce(e.error) && p("errorSet", null), r;
796
- }, St = (e) => {
797
- const t = C(e, ["initial_wallet"]), r = C(e, ["input_valid_internal"]);
797
+ } : e.isDepositFromExternalWallet || (!s || !pt(s) ? n = { code: "INVALID_SOURCE_BALANCE" } : ve(e) || (n = { code: "SOURCE_BALANCE_INSUFFICIENT" })) : n = { code: "SEND_ADDRESS_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : n = { code: "TARGET_TOKEN_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_IS_EMPTY" }), r && e.targetToken.blockchain === "near" && Xe(e), !r && n ? p("errorSet", n) : e.error && !De(e.error) && !xe(e.error) && p("errorSet", null), r;
798
+ }, Et = (e) => {
799
+ const t = D(e, ["initial_wallet"]), r = D(e, ["input_valid_internal"]);
798
800
  if (!t && !r)
799
801
  return;
800
802
  const s = e.sourceTokenBalance;
801
803
  let n;
802
- return t && (e.sourceToken ? e.targetToken ? e.targetToken.isIntent ? te(e.sourceTokenAmount) ? e.isDepositFromExternalWallet || (!s || !lt(s) ? n = { code: "INVALID_SOURCE_BALANCE" } : Re(e) || (n = { code: "SOURCE_BALANCE_INSUFFICIENT" })) : n = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_NOT_INTENT" } : n = { code: "TARGET_TOKEN_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_IS_EMPTY" }), !r && n ? p("errorSet", n) : e.error && !De(e.error) && !Ce(e.error) && p("errorSet", null), r;
803
- }, At = (e) => {
804
- const t = ye(e), r = !t && e.targetToken?.isIntent === !0, s = !t && e.targetToken?.isIntent === !1;
804
+ return t && (e.sourceToken ? e.targetToken ? e.targetToken.isIntent ? ne(e.sourceTokenAmount) ? e.isDepositFromExternalWallet || (!s || !pt(s) ? n = { code: "INVALID_SOURCE_BALANCE" } : ve(e) || (n = { code: "SOURCE_BALANCE_INSUFFICIENT" })) : n = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_NOT_INTENT" } : n = { code: "TARGET_TOKEN_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_IS_EMPTY" }), !r && n ? p("errorSet", n) : e.error && !De(e.error) && !xe(e.error) && p("errorSet", null), r;
805
+ }, Ct = (e) => {
806
+ const t = Re(e), r = !t && e.targetToken?.isIntent === !0, s = !t && e.targetToken?.isIntent === !1;
805
807
  if (t) {
806
- const n = wt(e);
808
+ const n = yt(e);
807
809
  return O(n ? "input_valid_dry" : "initial_dry");
808
810
  }
809
- s && kt(e) ? O("input_valid_external") : r && St(e) ? O("input_valid_internal") : O("initial_wallet");
810
- }, Vs = ({
811
+ s && bt(e) ? O("input_valid_external") : r && Et(e) ? O("input_valid_internal") : O("initial_wallet");
812
+ }, Js = ({
811
813
  isEnabled: e,
812
814
  message: t,
813
815
  type: r = "exact_in",
814
816
  refetchQuoteInterval: s
815
817
  }) => {
816
- const { ctx: n } = A(), {
818
+ const { ctx: n } = _(), {
817
819
  isNativeNearDeposit: a,
818
820
  isDirectNonNearWithdrawal: l,
819
- isDirectTokenOnNearDeposit: i,
821
+ isDirectTokenOnNearDeposit: c,
820
822
  isDirectNearTokenWithdrawal: d,
821
823
  isDirectTokenOnNearTransfer: u,
822
- isSameAssetDiffChainWithdrawal: o
823
- } = H(), m = ye(n), T = e && !n.areInputsValidating && (o || (i || a) && n.isDepositFromExternalWallet || !d && !l && !i && !u), { make: h, cancel: f } = Ps(), { make: I, cancel: S } = Ws(), y = Y(null), B = () => {
824
+ isSameAssetDiffChainWithdrawal: i
825
+ } = j(), m = Re(n), h = e && !n.areInputsValidating && (i || (c || a) && n.isDepositFromExternalWallet || !d && !l && !c && !u), { make: g, cancel: f } = Zs(), { make: w, cancel: S } = Xs(), E = Y(null), B = () => {
824
826
  f(), S();
825
827
  };
826
- R(() => {
827
- const L = C(n, ["input_valid_dry"]), w = C(n, ["input_valid_external"]), v = C(n, ["input_valid_internal"]);
828
- (m && !L || !m && n.targetToken?.isIntent && !v || !m && !n.targetToken?.isIntent && !w || n.areInputsValidating) && B();
828
+ C(() => {
829
+ const L = D(n, ["input_valid_dry"]), k = D(n, ["input_valid_external"]), x = D(n, ["input_valid_internal"]);
830
+ (m && !L || !m && n.targetToken?.isIntent && !x || !m && !n.targetToken?.isIntent && !k || n.areInputsValidating) && B();
829
831
  }, [B, m, n]);
830
- const F = fe(
832
+ const F = he(
831
833
  async (L) => {
832
834
  try {
833
- let w;
835
+ let k;
834
836
  if (n.sourceToken?.assetId === n.targetToken?.assetId || a && n.isDepositFromExternalWallet) {
835
837
  if (m)
836
838
  return;
837
- p("quoteSetStatus", "pending"), w = await I();
839
+ p("quoteSetStatus", "pending"), k = await w();
838
840
  } else
839
- p("quoteSetStatus", "pending"), w = await h({ message: t, quoteType: r, options: L });
840
- if (!w)
841
+ p("quoteSetStatus", "pending"), k = await g({ message: t, quoteType: r, options: L });
842
+ if (!k)
841
843
  return;
842
- if (p("quoteSetStatus", "success"), p("quoteSet", w), !m && n.error?.code !== "SOURCE_BALANCE_INSUFFICIENT" && p("errorSet", null), p("tokenSetAmount", {
844
+ if (p("quoteSetStatus", "success"), p("quoteSet", k), !m && n.error?.code !== "SOURCE_BALANCE_INSUFFICIENT" && p("errorSet", null), p("tokenSetAmount", {
843
845
  variant: "target",
844
- amount: w.amountOut
846
+ amount: k.amountOut
845
847
  }), n.state === "input_valid_dry") {
846
848
  O("quote_success_dry");
847
849
  return;
848
850
  }
849
851
  n.targetToken?.isIntent ? O("quote_success_internal") : O("quote_success_external");
850
- } catch (w) {
851
- if (w instanceof q) {
852
- if (w.data.code === "QUOTE_INVALID_INITIAL") {
852
+ } catch (k) {
853
+ if (k instanceof q) {
854
+ if (k.data.code === "QUOTE_INVALID_INITIAL") {
853
855
  p("quoteSetStatus", "idle"), p("quoteSet", void 0), p("errorSet", null);
854
856
  return;
855
857
  }
856
- p("quoteSetStatus", "error"), p("quoteSet", void 0), p("errorSet", w.data), At(n);
858
+ p("quoteSetStatus", "error"), p("quoteSet", void 0), p("errorSet", k.data), Ct(n);
857
859
  return;
858
860
  }
859
- b.error("Unhandled error in useMakeQuoteEffect:", w), p("quoteSetStatus", "error"), p("quoteSet", void 0), p("errorSet", {
861
+ b.error("Unhandled error in useMakeQuoteEffect:", k), p("quoteSetStatus", "error"), p("quoteSet", void 0), p("errorSet", {
860
862
  code: "QUOTE_FAILED",
861
863
  meta: { message: "Unknown error" }
862
864
  });
863
865
  }
864
866
  },
865
- [n, m, I, h, t, r, T]
867
+ [n, m, w, g, t, r, h]
866
868
  );
867
- R(() => {
868
- !T || !(m ? n.state === "input_valid_dry" : n.state === "input_valid_external" && !n.targetToken?.isIntent || n.state === "input_valid_internal" && n.targetToken?.isIntent) || n.quoteStatus !== "error" && (a && !n.isDepositFromExternalWallet || F({ isRefetch: !1 }));
869
- }, [T, F, B, n.sourceToken, n.targetToken]), R(() => {
869
+ C(() => {
870
+ !h || !(m ? n.state === "input_valid_dry" : n.state === "input_valid_external" && !n.targetToken?.isIntent || n.state === "input_valid_internal" && n.targetToken?.isIntent) || n.quoteStatus !== "error" && (a && !n.isDepositFromExternalWallet || F({ isRefetch: !1 }));
871
+ }, [h, F, B, n.sourceToken, n.targetToken]), C(() => {
870
872
  const L = () => {
871
- y.current && (clearInterval(y.current), y.current = null);
873
+ E.current && (clearInterval(E.current), E.current = null);
872
874
  };
873
- return n.state !== "quote_success_internal" && n.state !== "quote_success_external" || !s || (y.current = setInterval(async () => {
875
+ return n.state !== "quote_success_internal" && n.state !== "quote_success_external" || !s || (E.current = setInterval(async () => {
874
876
  await F({ isRefetch: !0 });
875
877
  }, s)), L;
876
- }, [T, F, B, n.state]);
877
- }, ue = {
878
+ }, [h, F, B, n.state]);
879
+ }, me = {
878
880
  sol: "sol",
879
881
  evm: "eth",
880
882
  near: "near"
881
- }, Ms = ({
883
+ }, er = ({
882
884
  isEnabled: e,
883
885
  skipIntents: t = !1,
884
886
  target: r = "none"
885
887
  }) => {
886
- const { tokens: s } = P(), { ctx: n, state: a } = A(), { intentBalances: l } = ie(), { walletSupportedChains: i, chainsFilter: d, intentsAccountType: u } = E(), o = mn({
888
+ const { tokens: s } = P(), { ctx: n, state: a } = _(), { intentBalances: l } = ce(), { walletSupportedChains: c, chainsFilter: d, intentsAccountType: u } = y(), i = gn({
887
889
  tokens: s,
888
- walletSupportedChains: i,
890
+ walletSupportedChains: c,
889
891
  balances: l,
890
892
  across: "intents"
891
- }), [m, T] = x(() => !n.walletAddress && !t ? [
892
- { token: un({ tokens: s }), status: "loaded" },
893
+ }), [m, h] = v(() => !n.walletAddress && !t ? [
894
+ { token: Tn({ tokens: s }), status: "loaded" },
893
895
  { token: void 0, status: "loaded" }
894
- ] : d.source.intents !== "none" && !t ? o ? [
895
- { token: o, status: "loaded" },
896
+ ] : d.source.intents !== "none" && !t ? i ? [
897
+ { token: i, status: "loaded" },
896
898
  { token: void 0, status: "loaded" }
897
899
  ] : [
898
900
  { token: void 0, status: "loading" },
899
901
  { token: void 0, status: "loading" }
900
902
  ] : [
901
- { token: dn({
903
+ { token: hn({
902
904
  tokens: s,
903
- walletSupportedChains: i
905
+ walletSupportedChains: c
904
906
  }), status: "loaded" },
905
907
  { token: void 0, status: "loaded" }
906
908
  ], [
@@ -908,88 +910,88 @@ const xs = (e) => {
908
910
  t,
909
911
  d,
910
912
  n.walletAddress,
911
- o,
912
913
  i,
914
+ c,
913
915
  a
914
916
  ]);
915
- R(() => {
917
+ C(() => {
916
918
  if (!e)
917
919
  return;
918
- if (C(n, ["initial_dry", "initial_wallet"]) && (m.status === "loaded" && !n.sourceToken && p("tokenSelect", {
920
+ if (D(n, ["initial_dry", "initial_wallet"]) && (m.status === "loaded" && !n.sourceToken && p("tokenSelect", {
919
921
  variant: "source",
920
922
  token: m.token
921
- }), T.status === "loaded" && m.status === "loaded" && !n.targetToken)) {
922
- let I = T.token;
923
+ }), h.status === "loaded" && m.status === "loaded" && !n.targetToken)) {
924
+ let w = h.token;
923
925
  if (r === "same-asset")
924
926
  if (m.token?.isIntent) {
925
927
  if (!u)
926
928
  throw new Error(
927
929
  "Intents account type is required to select same-asset target token"
928
930
  );
929
- I = s.find(
930
- (S) => !S.isIntent && S.symbol === n.sourceToken?.symbol && S.blockchain === ue[u]
931
+ w = s.find(
932
+ (S) => !S.isIntent && S.symbol === n.sourceToken?.symbol && S.blockchain === me[u]
931
933
  );
932
934
  } else
933
- I = s.find(
935
+ w = s.find(
934
936
  (S) => S.isIntent && S.symbol === n.sourceToken?.symbol
935
937
  );
936
938
  p("tokenSelect", {
937
939
  variant: "target",
938
- token: I
940
+ token: w
939
941
  });
940
942
  }
941
- }, [n, m, T, e]);
942
- const h = (f, I) => {
943
+ }, [n, m, h, e]);
944
+ const g = (f, w) => {
943
945
  const S = s.find(
944
- (y) => !y.isIntent && y.blockchain === ue[f] && y.symbol.toLowerCase() === jt[ue[f]]?.toLowerCase()
945
- ) ?? I;
946
+ (E) => !E.isIntent && E.blockchain === me[f] && E.symbol.toLowerCase() === Jt[me[f]]?.toLowerCase()
947
+ ) ?? w;
946
948
  p("tokenSelect", {
947
949
  variant: "source",
948
950
  token: S
949
951
  });
950
952
  };
951
- return R(() => {
952
- const f = C(n, ["initial_dry", "initial_wallet"]);
953
+ return C(() => {
954
+ const f = D(n, ["initial_dry", "initial_wallet"]);
953
955
  if (!e || !f)
954
956
  return;
955
- const I = s.find(
956
- (y) => y.isIntent && y.symbol === "AURORA" && y.blockchain === "near"
957
+ const w = s.find(
958
+ (E) => E.isIntent && E.symbol === "AURORA" && E.blockchain === "near"
957
959
  ), S = setTimeout(() => {
958
- m.token || (!t && o ? p("tokenSelect", {
960
+ m.token || (!t && i ? p("tokenSelect", {
959
961
  variant: "source",
960
- token: o
961
- }) : i.length && u ? h(u, I) : n.walletAddress && ut(n.walletAddress) ? h("sol", I) : n.walletAddress && mt(n.walletAddress) ? h("evm", I) : n.walletAddress && dt(n.walletAddress) ? h("near", I) : p("tokenSelect", {
962
+ token: i
963
+ }) : c.length && u ? g(u, w) : n.walletAddress && Tt(n.walletAddress) ? g("sol", w) : n.walletAddress && gt(n.walletAddress) ? g("evm", w) : n.walletAddress && ht(n.walletAddress) ? g("near", w) : p("tokenSelect", {
962
964
  variant: "source",
963
- token: I
965
+ token: w
964
966
  }));
965
967
  }, 3e3);
966
968
  return () => clearTimeout(S);
967
969
  }, [s, m, t]), { source: n.sourceToken, target: n.targetToken };
968
- }, Qs = ({
970
+ }, tr = ({
969
971
  isEnabled: e,
970
972
  alchemyApiKey: t
971
973
  }) => {
972
- const { connectedWallets: r } = E();
973
- It({
974
+ const { connectedWallets: r } = y();
975
+ _t({
974
976
  isEnabled: e,
975
977
  connectedWallets: r,
976
978
  alchemyApiKey: t ?? ""
977
979
  });
978
- }, $s = (e, t) => {
979
- const { config: r } = Se(Be);
980
+ }, nr = (e, t) => {
981
+ const { config: r } = Ne(Ue);
980
982
  return e.targetToken && !e.sendAddress && !!e.walletAddress && !e.targetToken.isIntent && !t.find((s) => s?.key === "sendAddress") && r.walletSupportedChains.includes(e.targetToken.blockchain);
981
- }, Ks = ({ debug: e }) => {
982
- z.onContextChange((t, r) => {
983
+ }, sr = ({ debug: e }) => {
984
+ Z.onContextChange((t, r) => {
983
985
  const s = r;
984
- if (e && b.debug("[WIDGET] Context changed", s), e && t.error && Tn(s) && b.debug(`[WIDGET] Error set to ${t.error.code}`), hn(s) || kn(t, s, e))
986
+ if (e && b.debug("[WIDGET] Context changed", s), e && t.error && kn(s) && b.debug(`[WIDGET] Error set to ${t.error.code}`), An(s) || yn(t, s, e))
985
987
  return;
986
- if (In(t, s)) {
988
+ if (Nn(t, s)) {
987
989
  p("reset", { clearWalletAddress: !0 }), O("initial_dry");
988
990
  return;
989
991
  }
990
- const { isChanged: n, isDry: a } = pn(t, s);
992
+ const { isChanged: n, isDry: a } = wn(t, s);
991
993
  if (n) {
992
- if (gn(t)) {
994
+ if (Sn(t)) {
993
995
  const l = a ? "initial_dry" : "initial_wallet";
994
996
  O(l, {
995
997
  onMoved: () => {
@@ -999,21 +1001,21 @@ const xs = (e) => {
999
1001
  }
1000
1002
  });
1001
1003
  }
1002
- fn(t) || (t.quote = void 0, t.quoteStatus = "idle", t.transferStatus = { status: "idle" }), wn(t) && (t.sendAddress = void 0), $s(t, s) && (t.sendAddress = t.walletAddress), At(t);
1004
+ In(t) || (t.quote = void 0, t.quoteStatus = "idle", t.transferStatus = { status: "idle" }), _n(t) && (t.sendAddress = void 0), nr(t, s) && (t.sendAddress = t.walletAddress), Ct(t);
1003
1005
  }
1004
1006
  });
1005
- }, Hs = ({ debug: e }) => {
1006
- z.onTransition((t, r) => {
1007
+ }, rr = ({ debug: e }) => {
1008
+ Z.onTransition((t, r) => {
1007
1009
  e && b.debug(`===> [WIDGET] State moved from ${t} to ${r}`);
1008
1010
  });
1009
- }, Gs = (e, t) => {
1010
- const { variant: r, token: s } = t, { config: n } = Se(Be);
1011
+ }, ar = (e, t) => {
1012
+ const { variant: r, token: s } = t, { config: n } = Ne(Ue);
1011
1013
  switch (r) {
1012
1014
  case "source":
1013
1015
  if (s && s.assetId === e.targetToken?.assetId && s.isIntent === e.targetToken.isIntent && n.enableAutoTokensSwitching) {
1014
1016
  if (!e.sourceToken)
1015
1017
  return;
1016
- ge(e);
1018
+ we(e);
1017
1019
  return;
1018
1020
  }
1019
1021
  if (s && !e.sourceToken && s.assetId === e.targetToken?.assetId && s.isIntent === e.targetToken.isIntent && n.enableAutoTokensSwitching)
@@ -1024,26 +1026,26 @@ const xs = (e) => {
1024
1026
  if (s && s.assetId === e.sourceToken?.assetId && s.isIntent === e.sourceToken.isIntent && n.enableAutoTokensSwitching) {
1025
1027
  if (!e.targetToken)
1026
1028
  return;
1027
- ge(e);
1029
+ we(e);
1028
1030
  return;
1029
1031
  }
1030
1032
  e.targetToken = s;
1031
1033
  break;
1032
1034
  default:
1033
- be(r, { throwError: !1 });
1035
+ Ce(r, { throwError: !1 });
1034
1036
  }
1035
- }, D = (e, t) => z.on(
1037
+ }, R = (e, t) => Z.on(
1036
1038
  e,
1037
- (r, s) => t(r, s, z)
1038
- ), js = () => {
1039
- D("quoteSetStatus", bn), D("walletAddressSet", Cn), D("transferSetStatus", On), D("tokenSelectRotate", ge), D("tokenSetBalance", vn), D("tokenSetAmount", En), D("depositTypeSet", yn), D("setInputsValidating", Dn), D("externalDepositTxSet", Rn), D("tokenSelect", Gs), D("addressSet", Nn), D("errorSet", An), D("quoteSet", _n), D("reset", Sn), D("validateDryInputs", wt), D("validateExternalInputs", kt), D("validateInternalInputs", St);
1040
- }, Ys = en(({ debug: e }) => {
1039
+ (r, s) => t(r, s, Z)
1040
+ ), or = () => {
1041
+ R("quoteSetStatus", Dn), R("walletAddressSet", Ln), R("transferSetStatus", qn), R("tokenSelectRotate", we), R("tokenSetBalance", Bn), R("tokenSetAmount", vn), R("depositTypeSet", xn), R("setInputsValidating", Fn), R("externalDepositTxSet", On), R("tokenSelect", ar), R("addressSet", Rn), R("errorSet", En), R("quoteSet", Cn), R("reset", bn), R("validateDryInputs", yt), R("validateExternalInputs", bt), R("validateInternalInputs", Et);
1042
+ }, ir = an(({ debug: e }) => {
1041
1043
  e && b.debug(
1042
- "[WIDGET] Debug mode is enabled (package version: 3.14.0-redesign.2)"
1043
- ), js(), Hs({ debug: e }), Ks({ debug: e });
1044
- }), hi = ({ listenTo: e, debug: t = !1 }) => {
1045
- R(() => {
1046
- Ys({ debug: t });
1044
+ "[WIDGET] Debug mode is enabled (package version: 3.14.0-redesign.7)"
1045
+ ), or(), rr({ debug: e }), sr({ debug: e });
1046
+ }), Bi = ({ listenTo: e, debug: t = !1 }) => {
1047
+ C(() => {
1048
+ ir({ debug: t });
1047
1049
  }, [t]);
1048
1050
  const r = e.find(
1049
1051
  (a) => Array.isArray(a) && a[0] === "setBalancesUsingAlchemyExt"
@@ -1052,120 +1054,120 @@ const xs = (e) => {
1052
1054
  ), n = e.find(
1053
1055
  (a) => Array.isArray(a) && a[0] === "makeQuote"
1054
1056
  );
1055
- Qs({
1057
+ tr({
1056
1058
  isEnabled: !!r,
1057
1059
  alchemyApiKey: r?.[1].alchemyApiKey
1058
- }), Ms({
1060
+ }), er({
1059
1061
  isEnabled: !!s,
1060
1062
  skipIntents: s?.[1].skipIntents,
1061
1063
  target: s?.[1].target
1062
- }), Vs({
1064
+ }), Js({
1063
1065
  isEnabled: !!n,
1064
1066
  message: n?.[1].message,
1065
1067
  type: n?.[1].type,
1066
1068
  refetchQuoteInterval: n?.[1].refetchQuoteInterval
1067
- }), qs({
1069
+ }), zs({
1068
1070
  isEnabled: e.includes("checkWalletConnection")
1069
- }), Ls({
1071
+ }), Gs({
1070
1072
  isEnabled: e.includes("setSourceTokenBalance")
1071
- }), Bs({
1073
+ }), js({
1072
1074
  isEnabled: e.includes("setSourceTokenIntentsTarget")
1073
- }), Fs({
1075
+ }), Hs({
1074
1076
  isEnabled: e.includes("updateBalances"),
1075
1077
  alchemyApiKey: r?.[1].alchemyApiKey
1076
1078
  });
1077
- }, zs = z.getStore();
1079
+ }, cr = Z.getStore();
1078
1080
  class W extends Error {
1079
1081
  context;
1080
1082
  _is_widget_error = !0;
1081
1083
  constructor(t, r) {
1082
- super(t), this.name = "WidgetError", this.cause = r?.cause, this.context = Se(zs).context;
1084
+ super(t), this.name = "WidgetError", this.cause = r?.cause, this.context = Ne(cr).context;
1083
1085
  }
1084
1086
  }
1085
- class _t extends W {
1087
+ class Rt extends W {
1086
1088
  data;
1087
1089
  constructor(t) {
1088
1090
  super(t.code), this.data = t, this.name = "MachineError";
1089
1091
  }
1090
1092
  }
1091
- class q extends _t {
1093
+ class q extends Rt {
1092
1094
  constructor(t) {
1093
1095
  super(t), this.name = "QuoteError";
1094
1096
  }
1095
1097
  }
1096
- class g extends _t {
1098
+ class I extends Rt {
1097
1099
  constructor(t) {
1098
1100
  super(t), this.name = "TransferError";
1099
1101
  }
1100
1102
  }
1101
- const gi = (e) => typeof e == "object" && e !== null && "_is_widget_error" in e && !!e._is_widget_error, V = z.getStore(), Zs = Zt({
1102
- usdTradeDelta: (e) => xn(e(V.context)),
1103
- isDirectNearTokenWithdrawal: (e) => Bn(e(V.context)),
1104
- isDirectNonNearWithdrawal: (e) => Fn(e(V.context)),
1105
- isDirectTokenOnNearDeposit: (e) => Xt(e(V.context)),
1106
- isNativeNearDeposit: (e) => Jt(e(V.context)),
1107
- isSameAssetDiffChainWithdrawal: (e) => qn(e(V.context)),
1108
- isDirectTokenOnNearTransfer: (e) => Ln(e(V.context))
1109
- }), H = () => oe(Zs), A = () => {
1103
+ const qi = (e) => typeof e == "object" && e !== null && "_is_widget_error" in e && !!e._is_widget_error, V = Z.getStore(), lr = nn({
1104
+ usdTradeDelta: (e) => Un(e(V.context)),
1105
+ isDirectNearTokenWithdrawal: (e) => Vn(e(V.context)),
1106
+ isDirectNonNearWithdrawal: (e) => Pn(e(V.context)),
1107
+ isDirectTokenOnNearDeposit: (e) => rn(e(V.context)),
1108
+ isNativeNearDeposit: (e) => sn(e(V.context)),
1109
+ isSameAssetDiffChainWithdrawal: (e) => Mn(e(V.context)),
1110
+ isDirectTokenOnNearTransfer: (e) => Wn(e(V.context))
1111
+ }), j = () => oe(lr), _ = () => {
1110
1112
  const e = oe(V);
1111
1113
  return {
1112
1114
  state: e.state,
1113
1115
  ctx: e.context
1114
1116
  };
1115
- }, Ii = (e) => {
1117
+ }, Ui = (e) => {
1116
1118
  const t = oe(V);
1117
- if (!C(t.context, [e]))
1119
+ if (!D(t.context, [e]))
1118
1120
  throw new W(
1119
1121
  `[WIDGET] Attempt to access snapshot for ${e} state while context does not match`
1120
1122
  );
1121
1123
  return t.context;
1122
- }, Js = async ({
1124
+ }, dr = async ({
1123
1125
  contractId: e,
1124
1126
  accountId: t
1125
1127
  }) => {
1126
1128
  try {
1127
- const r = { account_id: t }, s = Oe.from(JSON.stringify(r)).toString("base64"), n = await Pn.query({
1129
+ const r = { account_id: t }, s = Fe.from(JSON.stringify(r)).toString("base64"), n = await $n.query({
1128
1130
  request_type: "call_function",
1129
1131
  method_name: "storage_balance_of",
1130
1132
  account_id: e,
1131
1133
  args_base64: s,
1132
1134
  finality: "optimistic"
1133
- }), a = Un(
1135
+ }), a = Qn(
1134
1136
  n,
1135
- ne.union([ne.null(), ne.object({ total: ne.string() })])
1137
+ se.union([se.null(), se.object({ total: se.string() })])
1136
1138
  );
1137
1139
  return BigInt(a?.total ?? "0");
1138
1140
  } catch (r) {
1139
1141
  throw new W("Error fetching balance", { cause: r });
1140
1142
  }
1141
1143
  };
1142
- function Xs(e) {
1143
- const { ctx: t } = A(), { isNativeNearDeposit: r } = H(), s = t.sourceToken?.contractAddress, n = t.quote?.amountIn ?? t.sourceTokenAmount;
1144
+ function ur(e) {
1145
+ const { ctx: t } = _(), { isNativeNearDeposit: r } = j(), s = t.sourceToken?.contractAddress, n = t.quote?.amountIn ?? t.sourceTokenAmount;
1144
1146
  return {
1145
- make: async (l, i) => {
1147
+ make: async (l, c) => {
1146
1148
  if (!e)
1147
- throw new g({
1149
+ throw new I({
1148
1150
  code: "TRANSFER_INVALID_INITIAL",
1149
1151
  meta: { message: "No connected wallet to sign a transfer." }
1150
1152
  });
1151
- if (!s && t.sourceToken?.assetId !== Q)
1152
- throw new g({
1153
+ if (!s && t.sourceToken?.assetId !== $)
1154
+ throw new I({
1153
1155
  code: "TRANSFER_INVALID_INITIAL",
1154
1156
  meta: { message: "No token selected to transfer." }
1155
1157
  });
1156
1158
  if (!l)
1157
- throw new g({
1159
+ throw new I({
1158
1160
  code: "TRANSFER_INVALID_INITIAL",
1159
1161
  meta: { message: "No recipient address to transfer." }
1160
1162
  });
1161
1163
  if (!n)
1162
- throw new g({
1164
+ throw new I({
1163
1165
  code: "TRANSFER_INVALID_INITIAL",
1164
1166
  meta: { message: "No amount to transfer." }
1165
1167
  });
1166
1168
  const d = e();
1167
- if (t.sourceToken.assetId === Q && t.targetToken?.assetId !== Te) {
1168
- const o = await d.signAndSendTransactions({
1169
+ if (t.sourceToken.assetId === $ && t.targetToken?.assetId !== ge) {
1170
+ const i = await d.signAndSendTransactions({
1169
1171
  transactions: [
1170
1172
  {
1171
1173
  signerId: t.walletAddress,
@@ -1182,9 +1184,9 @@ function Xs(e) {
1182
1184
  }
1183
1185
  ]
1184
1186
  });
1185
- return o && o.length > 0 ? {
1186
- hash: o[0]?.transaction?.hash ?? "",
1187
- transactionLink: `https://nearblocks.io/txns/${o[0]?.transaction?.hash}`,
1187
+ return i && i.length > 0 ? {
1188
+ hash: i[0]?.transaction?.hash ?? "",
1189
+ transactionLink: `https://nearblocks.io/txns/${i[0]?.transaction?.hash}`,
1188
1190
  intent: void 0
1189
1191
  } : {
1190
1192
  hash: "",
@@ -1199,7 +1201,7 @@ function Xs(e) {
1199
1201
  type: "FunctionCall",
1200
1202
  params: {
1201
1203
  methodName: "near_deposit",
1202
- gas: Ue,
1204
+ gas: We,
1203
1205
  deposit: n,
1204
1206
  args: {}
1205
1207
  }
@@ -1209,15 +1211,15 @@ function Xs(e) {
1209
1211
  methodName: "ft_transfer_call",
1210
1212
  deposit: "1",
1211
1213
  // 1 yocto required by NEP-141
1212
- gas: Pe,
1214
+ gas: Ve,
1213
1215
  args: {
1214
1216
  amount: n,
1215
1217
  receiver_id: l,
1216
- msg: i ?? ""
1218
+ msg: c ?? ""
1217
1219
  }
1218
1220
  }
1219
1221
  });
1220
- const o = await d.signAndSendTransactions({
1222
+ const i = await d.signAndSendTransactions({
1221
1223
  transactions: [
1222
1224
  {
1223
1225
  receiverId: "wrap.near",
@@ -1225,42 +1227,42 @@ function Xs(e) {
1225
1227
  }
1226
1228
  ]
1227
1229
  });
1228
- if (o?.[0]?.transaction?.hash)
1230
+ if (i?.[0]?.transaction?.hash)
1229
1231
  return {
1230
- hash: o[0].transaction?.hash ?? "",
1231
- transactionLink: `https://nearblocks.io/txns/${o[0].transaction?.hash}`,
1232
+ hash: i[0].transaction?.hash ?? "",
1233
+ transactionLink: `https://nearblocks.io/txns/${i[0].transaction?.hash}`,
1232
1234
  intent: void 0
1233
1235
  };
1234
- throw new g({
1236
+ throw new I({
1235
1237
  code: "NO_DEPOSIT_RESULT"
1236
1238
  });
1237
- } catch (o) {
1238
- throw b.error("[TRANSFER ERROR]", o), new g({
1239
+ } catch (i) {
1240
+ throw b.error("[TRANSFER ERROR]", i), new I({
1239
1241
  code: "DIRECT_TRANSFER_ERROR"
1240
1242
  });
1241
1243
  }
1242
1244
  if (!s)
1243
- throw new g({
1245
+ throw new I({
1244
1246
  code: "TRANSFER_INVALID_INITIAL",
1245
1247
  meta: { message: "No token selected to transfer." }
1246
1248
  });
1247
1249
  try {
1248
- const [o, m] = await Promise.all([
1249
- Wn({
1250
+ const [i, m] = await Promise.all([
1251
+ Kn({
1250
1252
  contractId: s
1251
1253
  }),
1252
- Js({
1254
+ dr({
1253
1255
  contractId: s,
1254
1256
  accountId: l
1255
1257
  })
1256
- ]), T = o - m;
1257
- T > 0n && u.push({
1258
+ ]), h = i - m;
1259
+ h > 0n && u.push({
1258
1260
  type: "FunctionCall",
1259
1261
  params: {
1260
1262
  methodName: "storage_deposit",
1261
1263
  args: { account_id: l },
1262
- gas: Ue,
1263
- deposit: T.toString()
1264
+ gas: We,
1265
+ deposit: h.toString()
1264
1266
  }
1265
1267
  }), u.push({
1266
1268
  type: "FunctionCall",
@@ -1269,13 +1271,13 @@ function Xs(e) {
1269
1271
  args: {
1270
1272
  receiver_id: l,
1271
1273
  amount: n,
1272
- msg: i ?? ""
1274
+ msg: c ?? ""
1273
1275
  },
1274
- gas: Pe,
1276
+ gas: Ve,
1275
1277
  deposit: "1"
1276
1278
  }
1277
1279
  });
1278
- const h = await d.signAndSendTransactions({
1280
+ const g = await d.signAndSendTransactions({
1279
1281
  transactions: [
1280
1282
  {
1281
1283
  receiverId: s,
@@ -1283,64 +1285,64 @@ function Xs(e) {
1283
1285
  }
1284
1286
  ]
1285
1287
  });
1286
- if (h?.[0]?.transaction?.hash)
1288
+ if (g?.[0]?.transaction?.hash)
1287
1289
  return {
1288
- hash: h[0].transaction?.hash ?? "",
1289
- transactionLink: `https://nearblocks.io/txns/${h[0].transaction?.hash}`,
1290
+ hash: g[0].transaction?.hash ?? "",
1291
+ transactionLink: `https://nearblocks.io/txns/${g[0].transaction?.hash}`,
1290
1292
  intent: void 0
1291
1293
  };
1292
- throw new g({
1294
+ throw new I({
1293
1295
  code: "NO_DEPOSIT_RESULT"
1294
1296
  });
1295
- } catch (o) {
1296
- throw b.error("[TRANSFER ERROR]", o), new g({
1297
+ } catch (i) {
1298
+ throw b.error("[TRANSFER ERROR]", i), new I({
1297
1299
  code: "DIRECT_TRANSFER_ERROR"
1298
1300
  });
1299
1301
  }
1300
1302
  }
1301
1303
  };
1302
1304
  }
1303
- const er = ({
1305
+ const mr = ({
1304
1306
  makeTransfer: e,
1305
1307
  providers: t
1306
1308
  }) => {
1307
- const { ctx: r } = A(), { alchemyApiKey: s } = E(), { make: n } = Mn({
1309
+ const { ctx: r } = _(), { alchemyApiKey: s } = y(), { make: n } = Gn({
1308
1310
  provider: t?.evm
1309
- }), { make: a } = Qn({
1311
+ }), { make: a } = jn({
1310
1312
  provider: t?.sol,
1311
1313
  alchemyApiKey: s
1312
1314
  }), l = (d) => {
1313
1315
  if (e)
1314
1316
  return e;
1315
- if (mt(d))
1317
+ if (gt(d))
1316
1318
  return n;
1317
- if (ut(d))
1319
+ if (Tt(d))
1318
1320
  return a;
1319
- throw new g({
1321
+ throw new I({
1320
1322
  code: "TRANSFER_INVALID_INITIAL",
1321
1323
  meta: { message: "No transfer function established." }
1322
1324
  });
1323
1325
  };
1324
1326
  return { make: async () => {
1325
1327
  if (!r.sourceToken) {
1326
- const o = "No token selected to transfer.";
1327
- throw new g({
1328
+ const i = "No token selected to transfer.";
1329
+ throw new I({
1328
1330
  code: "TRANSFER_INVALID_INITIAL",
1329
- meta: { message: o }
1331
+ meta: { message: i }
1330
1332
  });
1331
1333
  }
1332
1334
  if (!r.quote) {
1333
- const o = "Quote is required for a transfer.";
1334
- throw new g({
1335
+ const i = "Quote is required for a transfer.";
1336
+ throw new I({
1335
1337
  code: "TRANSFER_INVALID_INITIAL",
1336
- meta: { message: o }
1338
+ meta: { message: i }
1337
1339
  });
1338
1340
  }
1339
1341
  if (!r.quote.depositAddress) {
1340
- const o = "Quote has no deposit address. Make sure not dry.";
1341
- throw new g({
1342
+ const i = "Quote has no deposit address. Make sure not dry.";
1343
+ throw new I({
1342
1344
  code: "TRANSFER_INVALID_INITIAL",
1343
- meta: { message: o }
1345
+ meta: { message: i }
1344
1346
  });
1345
1347
  }
1346
1348
  const d = {
@@ -1348,48 +1350,48 @@ const er = ({
1348
1350
  decimals: r.sourceToken.decimals,
1349
1351
  address: r.quote.depositAddress,
1350
1352
  chain: r.sourceToken.blockchain,
1351
- evmChainId: M(r.sourceToken.blockchain) ? pe[r.sourceToken.blockchain] : null,
1352
- isNativeEthTransfer: !!r.sourceToken && Vn(r.sourceToken),
1353
- tokenAddress: r.sourceToken.assetId === Q ? Q : r.sourceToken.contractAddress,
1353
+ evmChainId: Q(r.sourceToken.blockchain) ? Te[r.sourceToken.blockchain] : null,
1354
+ isNativeEthTransfer: !!r.sourceToken && Hn(r.sourceToken),
1355
+ tokenAddress: r.sourceToken.assetId === $ ? $ : r.sourceToken.contractAddress,
1354
1356
  sourceAssetId: r.sourceToken.assetId,
1355
1357
  targetAssetId: r.targetToken.assetId
1356
1358
  }, u = l(d.address);
1357
1359
  try {
1358
- const o = await u(d);
1359
- if (!o) {
1360
+ const i = await u(d);
1361
+ if (!i) {
1360
1362
  if (e)
1361
1363
  return;
1362
- throw b.error("[TRANSFER ERROR]", "No deposit result"), new g({
1364
+ throw b.error("[TRANSFER ERROR]", "No deposit result"), new I({
1363
1365
  code: "NO_DEPOSIT_RESULT"
1364
1366
  });
1365
1367
  }
1366
1368
  return {
1367
- hash: o.hash,
1368
- transactionLink: o.transactionLink,
1369
+ hash: i.hash,
1370
+ transactionLink: i.transactionLink,
1369
1371
  intent: void 0
1370
1372
  };
1371
- } catch (o) {
1372
- b.error("[TRANSFER ERROR]", o, { error: o });
1373
+ } catch (i) {
1374
+ b.error("[TRANSFER ERROR]", i, { error: i });
1373
1375
  let m = "Failed to make a transfer. Please try again.";
1374
- const T = o instanceof Error && we(o.message);
1375
- if (T)
1376
+ const h = i instanceof Error && Ae(i.message);
1377
+ if (h)
1376
1378
  return;
1377
- throw on.isAxiosError(o) ? (m = o.response?.data?.detail ?? o.message ?? "Failed to make deposit. Please try again.", new g({
1379
+ throw mn.isAxiosError(i) ? (m = i.response?.data?.detail ?? i.message ?? "Failed to make deposit. Please try again.", new I({
1378
1380
  code: "QUOTE_ERROR",
1379
1381
  meta: { message: m }
1380
- })) : m === "No quotes found" ? new g({
1382
+ })) : m === "No quotes found" ? new I({
1381
1383
  code: "NO_QUOTE_FOUND"
1382
- }) : o instanceof Error && !T ? new g({
1384
+ }) : i instanceof Error && !h ? new I({
1383
1385
  code: "QUOTE_ERROR",
1384
- meta: { message: o.message }
1385
- }) : new g({
1386
+ meta: { message: i.message }
1387
+ }) : new I({
1386
1388
  code: "QUOTE_ERROR",
1387
1389
  meta: { message: "Unknown quote transfer error" }
1388
1390
  });
1389
1391
  }
1390
1392
  } };
1391
1393
  };
1392
- class tr {
1394
+ class fr {
1393
1395
  constructor(t, r) {
1394
1396
  this.account = t, this.provider = r;
1395
1397
  }
@@ -1399,7 +1401,7 @@ class tr {
1399
1401
  deadline: t.deadline,
1400
1402
  nonce: t.nonce,
1401
1403
  intents: t.intents,
1402
- signer_id: t.signer_id ?? Ve.authHandleToIntentsUserId({
1404
+ signer_id: t.signer_id ?? Qe.authHandleToIntentsUserId({
1403
1405
  identifier: this.account.walletAddress,
1404
1406
  method: "evm"
1405
1407
  })
@@ -1414,14 +1416,14 @@ class tr {
1414
1416
  return {
1415
1417
  payload: r,
1416
1418
  standard: "erc191",
1417
- signature: Ve.transformERC191Signature(a)
1419
+ signature: Qe.transformERC191Signature(a)
1418
1420
  };
1419
1421
  }
1420
1422
  }
1421
- const nr = ({
1423
+ const pr = ({
1422
1424
  walletAddress: e,
1423
1425
  getProvider: t
1424
- }) => $n({
1426
+ }) => zn({
1425
1427
  accountId: e,
1426
1428
  signMessage: async (r) => {
1427
1429
  const s = t();
@@ -1431,7 +1433,7 @@ const nr = ({
1431
1433
  try {
1432
1434
  n = await s.signMessage({
1433
1435
  ...r,
1434
- nonce: Oe.from(r.nonce)
1436
+ nonce: Fe.from(r.nonce)
1435
1437
  });
1436
1438
  } catch (a) {
1437
1439
  throw new W("Near wallet failed to sign a message", {
@@ -1445,25 +1447,25 @@ const nr = ({
1445
1447
  signature: n.signature
1446
1448
  };
1447
1449
  }
1448
- }), sr = (e, t) => {
1450
+ }), hr = (e, t) => {
1449
1451
  if (t) {
1450
1452
  if (e.sendAddress)
1451
1453
  return e.sendAddress;
1452
- throw new g({
1454
+ throw new I({
1453
1455
  code: "TRANSFER_INVALID_INITIAL",
1454
1456
  meta: { message: "Send to address is required for a direct transfer" }
1455
1457
  });
1456
1458
  }
1457
1459
  if (!e.quote || e.quote.dry)
1458
- throw new g({
1460
+ throw new I({
1459
1461
  code: "TRANSFER_INVALID_INITIAL",
1460
1462
  meta: { message: "Quote is required for intents non-direct transfer" }
1461
1463
  });
1462
1464
  return e.quote.depositAddress;
1463
- }, rr = async (e, t) => {
1464
- let r = We.getItem("nearWalletsPk")[t];
1465
+ }, Tr = async (e, t) => {
1466
+ let r = Me.getItem("nearWalletsPk")[t];
1465
1467
  if (!e.signMessage)
1466
- throw new g({
1468
+ throw new I({
1467
1469
  code: "DIRECT_TRANSFER_ERROR",
1468
1470
  meta: { message: "Your wallet doesn't support signing messages" }
1469
1471
  });
@@ -1472,28 +1474,28 @@ const nr = ({
1472
1474
  const a = await e.signMessage({
1473
1475
  message: "Authenticate",
1474
1476
  recipient: "intents.near",
1475
- nonce: Oe.from(jn(32))
1477
+ nonce: Fe.from(Jn(32))
1476
1478
  });
1477
1479
  if (!a)
1478
- throw new g({
1480
+ throw new I({
1479
1481
  code: "DIRECT_TRANSFER_ERROR",
1480
1482
  meta: { message: "Signing message failed" }
1481
1483
  });
1482
- r = a.publicKey, We.setItem("nearWalletsPk", {
1484
+ r = a.publicKey, Me.setItem("nearWalletsPk", {
1483
1485
  [t]: a.publicKey
1484
1486
  });
1485
1487
  } catch {
1486
- throw new g({
1488
+ throw new I({
1487
1489
  code: "DIRECT_TRANSFER_ERROR",
1488
1490
  meta: { message: "Your wallet doesn't support signing messages" }
1489
1491
  });
1490
1492
  }
1491
- const s = ee({
1493
+ const s = te({
1492
1494
  walletAddress: t,
1493
1495
  addressType: "near"
1494
1496
  });
1495
- if (!await zn({
1496
- contractId: Ie,
1497
+ if (!await ts({
1498
+ contractId: ke,
1497
1499
  methodName: "has_public_key",
1498
1500
  args: {
1499
1501
  account_id: s,
@@ -1504,7 +1506,7 @@ const nr = ({
1504
1506
  await e.signAndSendTransactions({
1505
1507
  transactions: [
1506
1508
  {
1507
- receiverId: Ie,
1509
+ receiverId: ke,
1508
1510
  signerId: t,
1509
1511
  actions: [
1510
1512
  {
@@ -1521,136 +1523,136 @@ const nr = ({
1521
1523
  ]
1522
1524
  });
1523
1525
  } catch {
1524
- throw new g({
1526
+ throw new I({
1525
1527
  code: "DIRECT_TRANSFER_ERROR",
1526
1528
  meta: { message: "Unable to add public key to intents account" }
1527
1529
  });
1528
1530
  }
1529
- }, ar = ({ providers: e }) => {
1530
- const { ctx: t } = A(), { appName: r, intentsAccountType: s } = E(), {
1531
+ }, gr = ({ providers: e }) => {
1532
+ const { ctx: t } = _(), { appName: r, intentsAccountType: s } = y(), {
1531
1533
  isNativeNearDeposit: n,
1532
1534
  isDirectNearTokenWithdrawal: a,
1533
1535
  isDirectNonNearWithdrawal: l
1534
- } = H();
1536
+ } = j();
1535
1537
  return { make: async ({
1536
1538
  message: d,
1537
1539
  onPending: u
1538
1540
  }) => {
1539
1541
  if (!t.walletAddress)
1540
- throw new g({
1542
+ throw new I({
1541
1543
  code: "TRANSFER_INVALID_INITIAL",
1542
1544
  meta: { message: "No connected wallet to sign a transfer." }
1543
1545
  });
1544
1546
  if (!t.sourceToken || !t.targetToken)
1545
- throw new g({
1547
+ throw new I({
1546
1548
  code: "TRANSFER_INVALID_INITIAL",
1547
1549
  meta: { message: "No token selected to transfer." }
1548
1550
  });
1549
1551
  if (!t.sourceToken.isIntent)
1550
- throw new g({
1552
+ throw new I({
1551
1553
  code: "TRANSFER_INVALID_INITIAL",
1552
1554
  meta: {
1553
1555
  message: "For not intents source token use useMakeQuoteTransfer instead"
1554
1556
  }
1555
1557
  });
1556
- let o;
1558
+ let i;
1557
1559
  if (!s)
1558
- throw new g({
1560
+ throw new I({
1559
1561
  code: "TRANSFER_INVALID_INITIAL",
1560
1562
  meta: { message: "Intents account type is not defined" }
1561
1563
  });
1562
1564
  switch (s) {
1563
1565
  case "evm":
1564
1566
  if (!e?.evm)
1565
- throw new g({
1567
+ throw new I({
1566
1568
  code: "TRANSFER_INVALID_INITIAL",
1567
1569
  meta: { message: "No EVM provider configured" }
1568
1570
  });
1569
- o = new tr(
1571
+ i = new fr(
1570
1572
  { walletAddress: t.walletAddress },
1571
1573
  e.evm
1572
1574
  );
1573
1575
  break;
1574
1576
  case "sol":
1575
1577
  if (!e?.sol)
1576
- throw new g({
1578
+ throw new I({
1577
1579
  code: "TRANSFER_INVALID_INITIAL",
1578
1580
  meta: { message: "No SOL provider configured" }
1579
1581
  });
1580
- o = new Yn(
1582
+ i = new es(
1581
1583
  { walletAddress: t.walletAddress },
1582
1584
  e.sol
1583
1585
  );
1584
1586
  break;
1585
1587
  case "near": {
1586
1588
  if (!e?.near)
1587
- throw new g({
1589
+ throw new I({
1588
1590
  code: "TRANSFER_INVALID_INITIAL",
1589
1591
  meta: { message: "No NEAR provider configured" }
1590
1592
  });
1591
- await rr(e.near(), t.walletAddress), o = nr({
1593
+ await Tr(e.near(), t.walletAddress), i = pr({
1592
1594
  walletAddress: t.walletAddress,
1593
1595
  getProvider: e.near
1594
1596
  });
1595
1597
  break;
1596
1598
  }
1597
1599
  default:
1598
- be(s);
1600
+ Ce(s);
1599
1601
  }
1600
- const m = new Kn({ referral: at(r) });
1601
- m.setIntentSigner(o);
1602
- let T;
1603
- n ? T = void 0 : a ? T = Hn(d ?? void 0) : l ? T = void 0 : T = Gn();
1604
- const h = m.createWithdrawal({
1602
+ const m = new Yn({ referral: dt(r) });
1603
+ m.setIntentSigner(i);
1604
+ let h;
1605
+ n ? h = void 0 : a ? h = Zn(d ?? void 0) : l ? h = void 0 : h = Xn();
1606
+ const g = m.createWithdrawal({
1605
1607
  withdrawalParams: {
1606
1608
  assetId: t.sourceToken.assetId,
1607
1609
  amount: BigInt(t.sourceTokenAmount),
1608
- destinationAddress: sr(
1610
+ destinationAddress: hr(
1609
1611
  t,
1610
1612
  a || l
1611
1613
  ),
1612
1614
  destinationMemo: void 0,
1613
1615
  feeInclusive: !1,
1614
- routeConfig: T
1616
+ routeConfig: h
1615
1617
  }
1616
1618
  });
1617
1619
  try {
1618
- await h.estimateFee(), u("WAITING_CONFIRMATION");
1619
- const f = await h.signAndSendIntent();
1620
+ await g.estimateFee(), u("WAITING_CONFIRMATION");
1621
+ const f = await g.signAndSendIntent();
1620
1622
  u("PROCESSING");
1621
- const I = await h.waitForIntentSettlement();
1622
- return await h.waitForWithdrawalCompletion(), {
1623
- hash: I.hash,
1624
- transactionLink: Zn(Yt.near, I.hash),
1623
+ const w = await g.waitForIntentSettlement();
1624
+ return await g.waitForWithdrawalCompletion(), {
1625
+ hash: w.hash,
1626
+ transactionLink: ns(en.near, w.hash),
1625
1627
  intent: f
1626
1628
  };
1627
1629
  } catch (f) {
1628
1630
  if (b.error("[TRANSFER ERROR]", f), f instanceof Error) {
1629
1631
  if (f.message.includes("Fee is not estimated"))
1630
- throw new g({
1632
+ throw new I({
1631
1633
  code: "FEES_NOT_ESTIMATED"
1632
1634
  });
1633
- if (we(f.message) || we(`${f.cause}`))
1635
+ if (Ae(f.message) || Ae(`${f.cause}`))
1634
1636
  return;
1635
1637
  }
1636
- throw new g({
1638
+ throw new I({
1637
1639
  code: "DIRECT_TRANSFER_ERROR"
1638
1640
  });
1639
1641
  }
1640
1642
  } };
1641
- }, or = ({
1643
+ }, Ir = ({
1642
1644
  message: e,
1643
1645
  providers: t,
1644
1646
  makeTransfer: r
1645
1647
  }) => {
1646
- const { ctx: s } = A(), {
1648
+ const { ctx: s } = _(), {
1647
1649
  isDirectTokenOnNearDeposit: n,
1648
1650
  isDirectTokenOnNearTransfer: a,
1649
1651
  isNativeNearDeposit: l
1650
- } = H(), { make: i } = ar({ providers: t }), { make: d } = er({
1652
+ } = j(), { make: c } = gr({ providers: t }), { make: d } = mr({
1651
1653
  makeTransfer: r,
1652
1654
  providers: t
1653
- }), { make: u } = Xs(
1655
+ }), { make: u } = ur(
1654
1656
  t?.near
1655
1657
  );
1656
1658
  return { make: async () => {
@@ -1662,23 +1664,23 @@ const nr = ({
1662
1664
  status: "pending",
1663
1665
  reason: "WAITING_CONFIRMATION"
1664
1666
  }), s.sourceToken?.isIntent)
1665
- m = await i({
1667
+ m = await c({
1666
1668
  message: e,
1667
- onPending: (T) => {
1669
+ onPending: (h) => {
1668
1670
  p("transferSetStatus", {
1669
1671
  status: "pending",
1670
- reason: T
1672
+ reason: h
1671
1673
  });
1672
1674
  }
1673
1675
  });
1674
1676
  else if ((l || n) && !s.isDepositFromExternalWallet)
1675
1677
  m = await u(
1676
- s.sendAddress ?? Ie,
1678
+ s.sendAddress ?? ke,
1677
1679
  e
1678
1680
  );
1679
1681
  else if (a) {
1680
1682
  if (!s.sendAddress)
1681
- throw new g({
1683
+ throw new I({
1682
1684
  code: "TRANSFER_INVALID_INITIAL",
1683
1685
  meta: { message: "No recipient address to transfer" }
1684
1686
  });
@@ -1688,8 +1690,8 @@ const nr = ({
1688
1690
  );
1689
1691
  } else
1690
1692
  m = await d();
1691
- } catch (T) {
1692
- T instanceof g && (b.error(T.data), p("transferSetStatus", { status: "error" }), p("errorSet", T.data));
1693
+ } catch (h) {
1694
+ h instanceof I && (b.error(h.data), p("transferSetStatus", { status: "error" }), p("errorSet", h.data));
1693
1695
  }
1694
1696
  if (!m) {
1695
1697
  p("transferSetStatus", { status: "idle" });
@@ -1697,73 +1699,73 @@ const nr = ({
1697
1699
  }
1698
1700
  return p("transferSetStatus", { status: "success" }), O("transfer_success"), m;
1699
1701
  } };
1700
- }, ir = async (e) => {
1702
+ }, wr = async (e) => {
1701
1703
  if (!e)
1702
1704
  return;
1703
1705
  const t = await e.request({
1704
1706
  method: "eth_chainId"
1705
1707
  });
1706
1708
  return parseInt(t, 16);
1707
- }, cr = ({ providers: e }) => {
1708
- const { ctx: t } = A(), [r, s] = re(!1), [n, a] = re(!1), l = fe(async () => {
1709
+ }, kr = ({ providers: e }) => {
1710
+ const { ctx: t } = _(), [r, s] = re(!1), [n, a] = re(!1), l = he(async () => {
1709
1711
  const d = typeof e?.evm == "function" ? await e.evm() : e?.evm;
1710
1712
  if (!t.sourceToken || !d)
1711
1713
  return !1;
1712
- const u = await ir(d);
1713
- if (!M(t.sourceToken.blockchain))
1714
+ const u = await wr(d);
1715
+ if (!Q(t.sourceToken.blockchain))
1714
1716
  return !1;
1715
- const o = pe[t.sourceToken.blockchain];
1716
- return !o || !u ? !1 : u !== o;
1717
- }, [t.sourceToken, e]), i = fe(async () => {
1717
+ const i = Te[t.sourceToken.blockchain];
1718
+ return !i || !u ? !1 : u !== i;
1719
+ }, [t.sourceToken, e]), c = he(async () => {
1718
1720
  const d = typeof e?.evm == "function" ? await e.evm() : e?.evm;
1719
- if (!t.sourceToken || !d || !M(t.sourceToken.blockchain))
1721
+ if (!t.sourceToken || !d || !Q(t.sourceToken.blockchain))
1720
1722
  return !1;
1721
- const u = pe[t.sourceToken.blockchain];
1723
+ const u = Te[t.sourceToken.blockchain];
1722
1724
  if (!u)
1723
1725
  return !1;
1724
1726
  try {
1725
- return s(!0), await Jn(u, d), !0;
1726
- } catch (o) {
1727
- return b.error("Failed to switch chain:", o), !1;
1727
+ return s(!0), await ss(u, d), !0;
1728
+ } catch (i) {
1729
+ return b.error("Failed to switch chain:", i), !1;
1728
1730
  } finally {
1729
1731
  s(!1);
1730
1732
  }
1731
1733
  }, [t.sourceToken, e]);
1732
- return R(() => {
1734
+ return C(() => {
1733
1735
  l().then(a);
1734
1736
  }, [l]), {
1735
1737
  isSwitchingChainRequired: n,
1736
- switchChain: i,
1738
+ switchChain: c,
1737
1739
  isSwitchingChain: r
1738
1740
  };
1739
1741
  }, N = {
1740
1742
  size: "lg",
1741
1743
  variant: "primary"
1742
- }, xe = (e) => {
1743
- const { t } = K();
1744
+ }, Le = (e) => {
1745
+ const { t } = M();
1744
1746
  if (e.error?.code === "TOKEN_IS_NOT_SUPPORTED")
1745
- return /* @__PURE__ */ c(_, { state: "error", ...N, children: t("submit.error.invalidAddress", "Invalid address") });
1747
+ return /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.invalidAddress", "Invalid address") });
1746
1748
  if (e.state === "initial_wallet" && e.error?.code === "SEND_ADDRESS_IS_EMPTY")
1747
- return /* @__PURE__ */ c(_, { state: "disabled", ...N, children: t("submit.disabled.enterRecipientAddress", "Enter recipient address") });
1749
+ return /* @__PURE__ */ o(A, { state: "disabled", ...N, children: t("submit.disabled.enterRecipientAddress", "Enter recipient address") });
1748
1750
  if (e.state === "initial_wallet" && e.error?.code === "SEND_ADDRESS_IS_NOT_FOUND")
1749
- return /* @__PURE__ */ c(_, { state: "error", ...N, children: t("submit.error.sendAddressNotFound", {
1751
+ return /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.sendAddressNotFound", {
1750
1752
  defaultValue: "Address not found on {{chain}}",
1751
1753
  chain: e.error.meta.chain.toUpperCase()
1752
1754
  }) });
1753
1755
  if (e.state === "initial_wallet" && e.error?.code === "SEND_ADDRESS_IS_INVALID")
1754
- return /* @__PURE__ */ c(_, { state: "error", ...N, children: t("submit.error.sendAddressInvalid", {
1756
+ return /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.sendAddressInvalid", {
1755
1757
  defaultValue: "Invalid {{chain}} address",
1756
1758
  chain: e.error.meta.chain.toUpperCase()
1757
1759
  }) });
1758
1760
  if (e.error?.code === "QUOTE_AMOUNT_IS_TOO_LOW")
1759
- return /* @__PURE__ */ k("div", { className: "gap-sw-md flex flex-col", children: [
1760
- /* @__PURE__ */ c(_, { state: "error", ...N, children: t("submit.error.amountTooLow.label", "Amount is too low") }),
1761
- /* @__PURE__ */ c(X, { children: /* @__PURE__ */ k(Vt, { i18nKey: "submit.error.amountTooLow.message", children: [
1761
+ return /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
1762
+ /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.amountTooLow.label", "Amount is too low") }),
1763
+ /* @__PURE__ */ o(K, { children: /* @__PURE__ */ T(Ht, { i18nKey: "submit.error.amountTooLow.message", children: [
1762
1764
  "Amount you entered is very low. Please try increasing it",
1763
1765
  " ",
1764
- /* @__PURE__ */ k("span", { className: "text-nowrap", children: [
1766
+ /* @__PURE__ */ T("span", { className: "text-nowrap", children: [
1765
1767
  "above ",
1766
- /* @__PURE__ */ c(ve, { value: e.error.meta.minAmount ?? "0" }),
1768
+ /* @__PURE__ */ o(Oe, { value: e.error.meta.minAmount ?? "0" }),
1767
1769
  " ",
1768
1770
  e.sourceToken?.symbol ?? "",
1769
1771
  "."
@@ -1771,64 +1773,82 @@ const nr = ({
1771
1773
  ] }) })
1772
1774
  ] });
1773
1775
  if (e.quoteStatus === "error")
1774
- return /* @__PURE__ */ k("div", { className: "gap-sw-md flex flex-col", children: [
1775
- /* @__PURE__ */ c(_, { state: "error", ...N, children: t("submit.error.quoteFailed.label", "Quote failed") }),
1776
- /* @__PURE__ */ c(X, { children: t(
1776
+ return /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
1777
+ /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.quoteFailed.label", "Quote failed") }),
1778
+ /* @__PURE__ */ o(K, { children: t(
1777
1779
  "submit.error.quoteFailed.message",
1778
1780
  "We couldn’t finalize your quote. Please try again or adjust your values."
1779
1781
  ) })
1780
1782
  ] });
1781
1783
  if (e.error?.code === "TRANSFER_INVALID_INITIAL")
1782
- return /* @__PURE__ */ k("div", { className: "gap-sw-md flex flex-col", children: [
1783
- /* @__PURE__ */ c(_, { state: "error", ...N, children: t("submit.error.invalidTransferData.label", "Invalid transfer data") }),
1784
- e.error.meta?.message ? /* @__PURE__ */ c(X, { children: e.error.meta.message }) : null
1784
+ return /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
1785
+ /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.invalidTransferData.label", "Invalid transfer data") }),
1786
+ e.error.meta?.message ? /* @__PURE__ */ o(K, { children: e.error.meta.message }) : null
1787
+ ] });
1788
+ if (e.error?.code === "EXTERNAL_TRANSFER_FAILED")
1789
+ return /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.externalTransferFailed.label", "Transfer failed") });
1790
+ if (e.error?.code === "EXTERNAL_TRANSFER_INCOMPLETE")
1791
+ return /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
1792
+ /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.externalTransferFailed.label", "Transfer failed") }),
1793
+ /* @__PURE__ */ o(K, { children: t(
1794
+ "submit.error.externalTransferFailed.incompleteMessage",
1795
+ "Incomplete transfer. Deposited amount will be refunded."
1796
+ ) })
1797
+ ] });
1798
+ if (e.error?.code === "EXTERNAL_TRANSFER_REFUNDED")
1799
+ return /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
1800
+ /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.externalTransferFailed.label", "Transfer failed") }),
1801
+ /* @__PURE__ */ o(K, { children: t(
1802
+ "submit.error.externalTransferFailed.refundedMessage",
1803
+ "Deposited amount will be refunded."
1804
+ ) })
1785
1805
  ] });
1786
1806
  if (e.error?.code === "DIRECT_TRANSFER_ERROR")
1787
- return /* @__PURE__ */ k("div", { className: "gap-sw-md flex flex-col", children: [
1788
- /* @__PURE__ */ c(_, { state: "error", ...N, children: t("submit.error.transferFailed.label", "Transfer failed") }),
1789
- e.error.meta?.message ? /* @__PURE__ */ c(X, { children: e.error.meta.message }) : null
1807
+ return /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
1808
+ /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.transferFailed.label", "Transfer failed") }),
1809
+ e.error.meta?.message ? /* @__PURE__ */ o(K, { children: e.error.meta.message }) : null
1790
1810
  ] });
1791
1811
  if (e.error?.code === "SOURCE_BALANCE_INSUFFICIENT")
1792
- return /* @__PURE__ */ c(_, { state: "error", ...N, children: t("submit.error.insufficientBalance", "Insufficient balance") });
1793
- }, lr = ({ onClick: e }) => {
1794
- const { t } = K();
1795
- return /* @__PURE__ */ c(_, { state: "disabled", ...N, onClick: e, children: t("submit.error.connectWallet", "Connect wallet") });
1796
- }, dr = () => {
1797
- const { ctx: e } = A();
1798
- return xe(e) ?? null;
1799
- }, ur = (e) => {
1800
- const { providers: t, makeTransfer: r, onSuccess: s } = e, { ctx: n } = A(), { t: a } = K(), {
1812
+ return /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.insufficientBalance", "Insufficient balance") });
1813
+ }, Ar = ({ onClick: e }) => {
1814
+ const { t } = M();
1815
+ return /* @__PURE__ */ o(A, { state: "disabled", ...N, onClick: e, children: t("submit.error.connectWallet", "Connect wallet") });
1816
+ }, Sr = () => {
1817
+ const { ctx: e } = _();
1818
+ return Le(e) ?? null;
1819
+ }, Nr = (e) => {
1820
+ const { providers: t, makeTransfer: r, onSuccess: s } = e, { ctx: n } = _(), { t: a } = M(), {
1801
1821
  isNativeNearDeposit: l,
1802
- isDirectNonNearWithdrawal: i,
1822
+ isDirectNonNearWithdrawal: c,
1803
1823
  isDirectTokenOnNearDeposit: d,
1804
1824
  isDirectNearTokenWithdrawal: u
1805
- } = H(), { make: o } = or({ providers: t, makeTransfer: r }), { isSwitchingChainRequired: m, switchChain: T, isSwitchingChain: h } = cr({ providers: t }), f = xe(n), I = async () => {
1806
- if (m && !await T())
1825
+ } = j(), { make: i } = Ir({ providers: t, makeTransfer: r }), { isSwitchingChainRequired: m, switchChain: h, isSwitchingChain: g } = kr({ providers: t }), f = Le(n), w = async () => {
1826
+ if (m && !await h())
1807
1827
  return;
1808
- const S = await o();
1828
+ const S = await i();
1809
1829
  S && s(S);
1810
1830
  };
1811
1831
  if (!n.targetToken)
1812
- return /* @__PURE__ */ c(_, { ...N, state: "disabled", children: a("submit.disabled.selectTokenToReceive", "Select token to receive") });
1813
- if (!te(n.sourceTokenAmount))
1814
- return /* @__PURE__ */ c(_, { ...N, state: "disabled", children: a("submit.disabled.enterAmount", "Enter amount") });
1832
+ return /* @__PURE__ */ o(A, { ...N, state: "disabled", children: a("submit.disabled.selectTokenToReceive", "Select token to receive") });
1833
+ if (!ne(n.sourceTokenAmount))
1834
+ return /* @__PURE__ */ o(A, { ...N, state: "disabled", children: a("submit.disabled.enterAmount", "Enter amount") });
1815
1835
  if (n.areInputsValidating)
1816
- return /* @__PURE__ */ c(_, { state: "loading", ...N, children: a("submit.pending.validating", "Validating...") });
1817
- if (h)
1818
- return /* @__PURE__ */ c(_, { state: "loading", ...N, children: a("submit.pending.switchingChain", "Switching network...") });
1836
+ return /* @__PURE__ */ o(A, { state: "loading", ...N, children: a("submit.pending.validating", "Validating...") });
1837
+ if (g)
1838
+ return /* @__PURE__ */ o(A, { state: "loading", ...N, children: a("submit.pending.switchingChain", "Switching network...") });
1819
1839
  if (!m && f)
1820
1840
  return f;
1821
1841
  if (n.transferStatus.status === "pending")
1822
1842
  switch (n.transferStatus.reason) {
1823
1843
  case "WAITING_CONFIRMATION":
1824
- return /* @__PURE__ */ c(_, { state: "loading", ...N, children: a("submit.pending.transfer.confirmInWallet", "Confirm in wallet") });
1844
+ return /* @__PURE__ */ o(A, { state: "loading", ...N, children: a("submit.pending.transfer.confirmInWallet", "Confirm in wallet") });
1825
1845
  case "PROCESSING":
1826
1846
  default:
1827
- return /* @__PURE__ */ c(_, { state: "loading", ...N, children: a("submit.pending.transfer.finalizing", "Finalizing transfer") });
1847
+ return /* @__PURE__ */ o(A, { state: "loading", ...N, children: a("submit.pending.transfer.finalizing", "Finalizing transfer") });
1828
1848
  }
1829
- return n.transferStatus.status === "error" ? /* @__PURE__ */ k("div", { className: "gap-sw-md flex flex-col", children: [
1830
- /* @__PURE__ */ c(_, { ...N, children: e.label }),
1831
- /* @__PURE__ */ c(X, { children: (() => {
1849
+ return n.transferStatus.status === "error" ? /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
1850
+ /* @__PURE__ */ o(A, { ...N, children: e.label }),
1851
+ /* @__PURE__ */ o(K, { children: (() => {
1832
1852
  switch (n.error?.code) {
1833
1853
  case "FEES_NOT_ESTIMATED":
1834
1854
  return a(
@@ -1842,48 +1862,48 @@ const nr = ({
1842
1862
  );
1843
1863
  }
1844
1864
  })() })
1845
- ] }) : n.quoteStatus === "pending" ? /* @__PURE__ */ c(_, { state: "loading", ...N, children: n.quote ? a("submit.pending.quote.refreshing", "Refreshing quote") : a("submit.pending.quote.finalizing", "Finalizing quote") }) : n.error ? /* @__PURE__ */ c(_, { state: "disabled", ...N, children: e.label }) : !n.quote && !i && !d && !u && !l ? /* @__PURE__ */ c(_, { state: "disabled", ...N, children: e.label }) : /* @__PURE__ */ c(_, { ...N, onClick: I, children: e.label });
1846
- }, mr = (e) => {
1847
- const { t } = K(), { ctx: r } = A(), s = xe(r);
1848
- return r.isDepositFromExternalWallet ? te(r.sourceTokenAmount) ? r.externalDepositTxReceived ? /* @__PURE__ */ c(_, { state: "loading", ...N, children: t("submit.pending.externalDeposit.processing", "Processing") }) : /* @__PURE__ */ c(_, { state: "loading", ...N, children: t("submit.pending.externalDeposit.waiting", "Waiting for transaction") }) : /* @__PURE__ */ c(_, { ...N, state: "disabled", children: t("submit.disabled.enterAmount", "Enter amount") }) : s || /* @__PURE__ */ c(ur, { ...e });
1849
- }, fr = (e) => {
1850
- const { ctx: t } = A(), r = E();
1851
- return t.walletAddress ? /* @__PURE__ */ c(mr, { ...e }) : /* @__PURE__ */ c(lr, { onClick: r.onWalletSignin });
1865
+ ] }) : n.quoteStatus === "pending" ? /* @__PURE__ */ o(A, { state: "loading", ...N, children: n.quote ? a("submit.pending.quote.refreshing", "Refreshing quote") : a("submit.pending.quote.finalizing", "Finalizing quote") }) : n.error ? /* @__PURE__ */ o(A, { state: "disabled", ...N, children: e.label }) : !n.quote && !c && !d && !u && !l ? /* @__PURE__ */ o(A, { state: "disabled", ...N, children: e.label }) : /* @__PURE__ */ o(A, { ...N, onClick: w, children: e.label });
1866
+ }, _r = (e) => {
1867
+ const { t } = M(), { ctx: r } = _(), s = Le(r);
1868
+ return r.isDepositFromExternalWallet ? ne(r.sourceTokenAmount) ? r.externalDepositTxReceived ? /* @__PURE__ */ o(A, { state: "loading", ...N, children: t("submit.pending.externalDeposit.processing", "Processing") }) : /* @__PURE__ */ o(A, { state: "loading", ...N, children: t("submit.pending.externalDeposit.waiting", "Waiting for transaction") }) : /* @__PURE__ */ o(A, { ...N, state: "disabled", children: t("submit.disabled.enterAmount", "Enter amount") }) : s || /* @__PURE__ */ o(Nr, { ...e });
1869
+ }, yr = (e) => {
1870
+ const { ctx: t } = _(), r = y();
1871
+ return t.walletAddress ? /* @__PURE__ */ o(_r, { ...e }) : /* @__PURE__ */ o(Ar, { onClick: r.onWalletSignin });
1852
1872
  };
1853
- fr.Error = dr;
1854
- const pr = ({ className: e }) => {
1855
- const { t } = K(), { slippageTolerance: r } = E(), { ctx: s } = A(), n = s.sourceToken && s.targetToken && s.sourceToken.price / s.targetToken.price;
1856
- return s.sourceToken ? /* @__PURE__ */ c(
1857
- Xn,
1873
+ yr.Error = Sr;
1874
+ const br = ({ className: e }) => {
1875
+ const { t } = M(), { slippageTolerance: r } = y(), { ctx: s } = _(), n = s.sourceToken && s.targetToken && s.sourceToken.price / s.targetToken.price;
1876
+ return s.sourceToken ? /* @__PURE__ */ o(
1877
+ rs,
1858
1878
  {
1859
1879
  expandedByDefault: !1,
1860
1880
  expandedHeightPx: s.walletAddress ? 80 : 50,
1861
1881
  isBadgeLoading: s.quoteStatus === "pending",
1862
1882
  badge: s.quote ? `~ ${s.quote.timeEstimate} sec` : void 0,
1863
1883
  className: e,
1864
- title: s.sourceToken && s.targetToken ? /* @__PURE__ */ k("span", { style: { borderBottomWidth: "2px", borderStyle: "dotted" }, children: [
1884
+ title: s.sourceToken && s.targetToken ? /* @__PURE__ */ T("span", { style: { borderBottomWidth: "2px", borderStyle: "dotted" }, children: [
1865
1885
  `1 ${s.sourceToken.symbol} ≈ `,
1866
1886
  " ",
1867
- es(n ?? 0),
1887
+ as(n ?? 0),
1868
1888
  " ",
1869
1889
  `${s.targetToken.symbol}`,
1870
- /* @__PURE__ */ c("span", { className: "text-sw-gray-50", children: `(${Me(s.sourceToken.price)})` })
1871
- ] }) : /* @__PURE__ */ k("span", { style: { borderBottomWidth: "2px", borderStyle: "dotted" }, children: [
1890
+ /* @__PURE__ */ o("span", { className: "text-sw-gray-50", children: ` (${$e(s.sourceToken.price)})` })
1891
+ ] }) : /* @__PURE__ */ T("span", { style: { borderBottomWidth: "2px", borderStyle: "dotted" }, children: [
1872
1892
  `1 ${s.sourceToken.symbol} ≈ `,
1873
1893
  " ",
1874
- Me(s.sourceToken.price),
1894
+ $e(s.sourceToken.price),
1875
1895
  " USD"
1876
1896
  ] }),
1877
- children: /* @__PURE__ */ k(le, { children: [
1878
- /* @__PURE__ */ c(
1879
- le.Item,
1897
+ children: /* @__PURE__ */ T(de, { children: [
1898
+ /* @__PURE__ */ o(
1899
+ de.Item,
1880
1900
  {
1881
1901
  label: t("quote.result.maxSlippage.label", "Max slippage"),
1882
1902
  value: `${(r / 100).toFixed(2)}%`
1883
1903
  }
1884
1904
  ),
1885
- !!s.walletAddress && /* @__PURE__ */ c(
1886
- le.Item,
1905
+ !!s.walletAddress && /* @__PURE__ */ o(
1906
+ de.Item,
1887
1907
  {
1888
1908
  isLoading: s.quoteStatus === "pending",
1889
1909
  label: t("quote.result.processingTime.label", "Processing time"),
@@ -1892,28 +1912,28 @@ const pr = ({ className: e }) => {
1892
1912
  )
1893
1913
  ] })
1894
1914
  }
1895
- ) : /* @__PURE__ */ c(ft, {});
1896
- }, wi = Object.assign(pr, {
1897
- Skeleton: ft
1898
- }), Tr = ({
1915
+ ) : /* @__PURE__ */ o(It, {});
1916
+ }, Pi = Object.assign(br, {
1917
+ Skeleton: It
1918
+ }), Er = ({
1899
1919
  token: e,
1900
1920
  balance: t,
1901
1921
  isNotSufficient: r = !1,
1902
1922
  onClick: s
1903
1923
  }) => {
1904
- const n = E();
1905
- return !e.isIntent && !n.walletSupportedChains.includes(e.blockchain) ? /* @__PURE__ */ c("span", {}) : t === void 0 ? /* @__PURE__ */ c(ns, { width: 100 }) : /* @__PURE__ */ c(
1924
+ const n = y();
1925
+ return !e.isIntent && !n.walletSupportedChains.includes(e.blockchain) ? /* @__PURE__ */ o("span", {}) : t === void 0 ? /* @__PURE__ */ o(is, { width: 100 }) : /* @__PURE__ */ o(
1906
1926
  "span",
1907
1927
  {
1908
1928
  onClick: t ? s : void 0,
1909
1929
  style: t ? { borderBottomWidth: "2px", borderStyle: "dotted" } : void 0,
1910
- className: ts("text-sw-label-sm", {
1930
+ className: os("text-sw-label-sm", {
1911
1931
  "text-sw-status-error": r,
1912
1932
  "text-sw-gray-100": !r,
1913
1933
  "cursor-pointer": !!t && !!s
1914
1934
  }),
1915
- children: /* @__PURE__ */ c(
1916
- ve,
1935
+ children: /* @__PURE__ */ o(
1936
+ Oe,
1917
1937
  {
1918
1938
  decimals: e.decimals,
1919
1939
  value: t === void 0 ? "0" : `${t}`
@@ -1921,7 +1941,7 @@ const pr = ({ className: e }) => {
1921
1941
  )
1922
1942
  }
1923
1943
  );
1924
- }, Fe = ({
1944
+ }, Be = ({
1925
1945
  token: e,
1926
1946
  balance: t,
1927
1947
  value: r = "",
@@ -1929,32 +1949,32 @@ const pr = ({ className: e }) => {
1929
1949
  quoteUsdValue: n,
1930
1950
  state: a = "default",
1931
1951
  showBalance: l = !0,
1932
- showQuickBalanceActions: i = !0,
1952
+ showQuickBalanceActions: c = !0,
1933
1953
  heading: d,
1934
1954
  onMsg: u
1935
1955
  }) => {
1936
- const o = xt(), { ctx: m } = A(), { t: T } = K(), { hideTokenInputHeadings: h } = E(), f = rs(e, r, n), I = (S) => {
1956
+ const i = Pt(), { ctx: m } = _(), { t: h } = M(), { hideTokenInputHeadings: g } = y(), f = ls(e, r, n), w = (S) => {
1937
1957
  u({
1938
1958
  type: "on_change_amount",
1939
- amount: ss(t, e.decimals, S)
1959
+ amount: cs(t, e.decimals, S)
1940
1960
  });
1941
1961
  };
1942
- return /* @__PURE__ */ k(Tt, { className: "flex flex-col", "aria-label": d, children: [
1943
- !h && /* @__PURE__ */ c(pt, { children: d }),
1944
- /* @__PURE__ */ k(
1962
+ return /* @__PURE__ */ T(ie, { className: "flex flex-col", "aria-label": d, children: [
1963
+ !g && /* @__PURE__ */ o(wt, { children: d }),
1964
+ /* @__PURE__ */ T(
1945
1965
  "div",
1946
1966
  {
1947
- className: G(
1967
+ className: H(
1948
1968
  "flex items-center justify-between",
1949
- !h && "mt-sw-2xl"
1969
+ !g && "mt-sw-2xl"
1950
1970
  ),
1951
1971
  children: [
1952
- /* @__PURE__ */ c(
1953
- os,
1972
+ /* @__PURE__ */ o(
1973
+ us,
1954
1974
  {
1955
1975
  value: r,
1956
- name: o,
1957
- setValue: as,
1976
+ name: i,
1977
+ setValue: ds,
1958
1978
  placeholder: "0",
1959
1979
  state: a === "default" || a === "disabled" ? a : "error",
1960
1980
  onChange: (S) => {
@@ -1962,12 +1982,12 @@ const pr = ({ className: e }) => {
1962
1982
  }
1963
1983
  }
1964
1984
  ),
1965
- /* @__PURE__ */ k(
1985
+ /* @__PURE__ */ T(
1966
1986
  "button",
1967
1987
  {
1968
1988
  type: "button",
1969
1989
  onClick: a === "disabled" ? void 0 : () => u({ type: "on_click_select_token" }),
1970
- className: G(
1990
+ className: H(
1971
1991
  "gap-sw-md pl-sw-sm pr-sw-md flex h-[36px] min-w-[80px] shrink-0 items-center rounded-sw-md transition-colors bg-sw-gray-800 hover:bg-sw-gray-700 group",
1972
1992
  {
1973
1993
  "cursor-pointer": a !== "disabled",
@@ -1975,28 +1995,28 @@ const pr = ({ className: e }) => {
1975
1995
  }
1976
1996
  ),
1977
1997
  children: [
1978
- /* @__PURE__ */ c(
1979
- ht,
1998
+ /* @__PURE__ */ o(
1999
+ kt,
1980
2000
  {
1981
2001
  chainShowIcon: !e.isIntent,
1982
2002
  className: "border-sw-gray-800 group-hover:border-sw-gray-700 transition-colors top-[14px]",
1983
2003
  ...e
1984
2004
  }
1985
2005
  ),
1986
- /* @__PURE__ */ c("span", { className: "text-sw-label-md text-sw-gray-50", children: e.symbol })
2006
+ /* @__PURE__ */ o("span", { className: "text-sw-label-md text-sw-gray-50", children: e.symbol })
1987
2007
  ]
1988
2008
  }
1989
2009
  )
1990
2010
  ]
1991
2011
  }
1992
2012
  ),
1993
- /* @__PURE__ */ k("div", { className: "gap-sw-sm min-h-sw-2xl flex items-center justify-between mt-sw-lg", children: [
1994
- /* @__PURE__ */ k("div", { className: "gap-sw-md flex items-center", children: [
1995
- /* @__PURE__ */ c("span", { className: "text-sw-label-sm text-sw-gray-100", children: f }),
1996
- s ? /* @__PURE__ */ c(
2013
+ /* @__PURE__ */ T("div", { className: "gap-sw-sm min-h-sw-2xl flex items-center justify-between mt-sw-lg", children: [
2014
+ /* @__PURE__ */ T("div", { className: "gap-sw-md flex items-center", children: [
2015
+ /* @__PURE__ */ o("span", { className: "text-sw-label-sm text-sw-gray-100", children: f }),
2016
+ s ? /* @__PURE__ */ o(
1997
2017
  "span",
1998
2018
  {
1999
- className: G("text-sw-label-sm text-nowrap", {
2019
+ className: H("text-sw-label-sm text-nowrap", {
2000
2020
  "text-sw-gray-400": s >= -2 && s <= 2,
2001
2021
  "text-sw-status-success": s > 2,
2002
2022
  "text-sw-status-error": s <= -5,
@@ -2006,57 +2026,57 @@ const pr = ({ className: e }) => {
2006
2026
  }
2007
2027
  ) : null
2008
2028
  ] }),
2009
- /* @__PURE__ */ k("div", { className: "gap-sw-sm flex items-center", children: [
2010
- e && !!m.walletAddress && l && /* @__PURE__ */ c(
2011
- Tr,
2029
+ /* @__PURE__ */ T("div", { className: "gap-sw-sm flex items-center", children: [
2030
+ e && !!m.walletAddress && l && /* @__PURE__ */ o(
2031
+ Er,
2012
2032
  {
2013
2033
  token: e,
2014
2034
  balance: t,
2015
2035
  isNotSufficient: a === "error-balance",
2016
- onClick: () => I(1)
2036
+ onClick: () => w(1)
2017
2037
  }
2018
2038
  ),
2019
- !!t && l && i && /* @__PURE__ */ k(Rt, { children: [
2020
- /* @__PURE__ */ c(
2021
- Qe,
2039
+ !!t && l && c && /* @__PURE__ */ T(Ft, { children: [
2040
+ /* @__PURE__ */ o(
2041
+ Ke,
2022
2042
  {
2023
2043
  isClickable: a !== "disabled",
2024
- onClick: () => I(2),
2025
- children: T("tokens.input.half.label", "50%")
2044
+ onClick: () => w(2),
2045
+ children: h("tokens.input.half.label", "50%")
2026
2046
  }
2027
2047
  ),
2028
- /* @__PURE__ */ c(
2029
- Qe,
2048
+ /* @__PURE__ */ o(
2049
+ Ke,
2030
2050
  {
2031
2051
  isClickable: a !== "disabled",
2032
- onClick: () => I(1),
2033
- children: T("tokens.input.max.label", "Max")
2052
+ onClick: () => w(1),
2053
+ children: h("tokens.input.max.label", "Max")
2034
2054
  }
2035
2055
  )
2036
2056
  ] }),
2037
- !l && /* @__PURE__ */ c("div", { className: "rounded-full bg-sw-gray-700 py-sw-xs px-sw-sm flex items-center justify-center", children: /* @__PURE__ */ c("span", { className: "text-sw-gray-100 text-sw-label-sm", children: T("tokens.input.externalBalance.label", "External balance") }) })
2057
+ !l && /* @__PURE__ */ o("div", { className: "rounded-full bg-sw-gray-700 py-sw-xs px-sw-sm flex items-center justify-center", children: /* @__PURE__ */ o("span", { className: "text-sw-gray-100 text-sw-label-sm", children: h("tokens.input.externalBalance.label", "External balance") }) })
2038
2058
  ] })
2039
2059
  ] })
2040
2060
  ] });
2041
- }, Le = ({ onMsg: e, heading: t }) => {
2042
- const { hideTokenInputHeadings: r } = E();
2043
- return /* @__PURE__ */ k(
2044
- Tt,
2061
+ }, qe = ({ onMsg: e, heading: t }) => {
2062
+ const { hideTokenInputHeadings: r } = y();
2063
+ return /* @__PURE__ */ T(
2064
+ ie,
2045
2065
  {
2046
2066
  isClickable: !0,
2047
2067
  className: "flex flex-col",
2048
2068
  onClick: () => e({ type: "on_click_select_token" }),
2049
2069
  children: [
2050
- !r && /* @__PURE__ */ c(pt, { children: t }),
2051
- /* @__PURE__ */ k(
2070
+ !r && /* @__PURE__ */ o(wt, { children: t }),
2071
+ /* @__PURE__ */ T(
2052
2072
  "div",
2053
2073
  {
2054
- className: G(
2074
+ className: H(
2055
2075
  "flex items-center justify-between",
2056
2076
  !r && "mt-sw-2xl"
2057
2077
  ),
2058
2078
  children: [
2059
- /* @__PURE__ */ c(
2079
+ /* @__PURE__ */ o(
2060
2080
  "span",
2061
2081
  {
2062
2082
  className: "h-[36px] font-medium text-sw-gray-200",
@@ -2064,35 +2084,35 @@ const pr = ({ className: e }) => {
2064
2084
  children: "0"
2065
2085
  }
2066
2086
  ),
2067
- /* @__PURE__ */ c(
2087
+ /* @__PURE__ */ o(
2068
2088
  "button",
2069
2089
  {
2070
2090
  type: "button",
2071
2091
  onClick: () => e({ type: "on_click_select_token" }),
2072
2092
  className: "gap-sw-md px-sw-md flex h-[36px] min-w-[100px] shrink-0 cursor-pointer items-center rounded-sw-md bg-sw-gray-800",
2073
- children: /* @__PURE__ */ c("span", { className: "text-sw-label-md text-sw-gray-50", children: "Select token" })
2093
+ children: /* @__PURE__ */ o("span", { className: "text-sw-label-md text-sw-gray-50", children: "Select token" })
2074
2094
  }
2075
2095
  )
2076
2096
  ]
2077
2097
  }
2078
2098
  ),
2079
- /* @__PURE__ */ c("div", { className: "h-sw-2xl w-full mt-sw-lg" })
2099
+ /* @__PURE__ */ o("div", { className: "h-sw-2xl w-full mt-sw-lg" })
2080
2100
  ]
2081
2101
  }
2082
2102
  );
2083
- }, Nt = (e) => {
2084
- const { mergedBalance: t } = ce(), [r, s] = re(
2085
- e ? t[$(e)] : void 0
2103
+ }, vt = (e) => {
2104
+ const { mergedBalance: t } = le(), [r, s] = re(
2105
+ e ? t[G(e)] : void 0
2086
2106
  );
2087
- return R(() => {
2107
+ return C(() => {
2088
2108
  let n;
2089
2109
  if (e) {
2090
- const a = t[$(e)];
2110
+ const a = t[G(e)];
2091
2111
  a ? n = setTimeout(() => {
2092
2112
  s(a);
2093
2113
  }, 0) : n = setTimeout(() => {
2094
2114
  s(
2095
- e ? t[$(e)] ?? 0 : 0
2115
+ e ? t[G(e)] ?? 0 : 0
2096
2116
  );
2097
2117
  }, 2e3);
2098
2118
  }
@@ -2100,23 +2120,23 @@ const pr = ({ className: e }) => {
2100
2120
  n && clearTimeout(n);
2101
2121
  };
2102
2122
  }, [e, t]), r;
2103
- }, Et = (e, t) => {
2123
+ }, Dt = (e, t) => {
2104
2124
  const { tokens: r } = P(e), s = Array.from(
2105
2125
  new Set(r.map((n) => n.assetId))
2106
2126
  );
2107
- R(() => {
2127
+ C(() => {
2108
2128
  const n = s.length === 1 ? r[0] : null;
2109
2129
  n && t({ type: "on_select_token", token: n });
2110
2130
  }, [r]);
2111
- }, hr = ({
2131
+ }, Cr = ({
2112
2132
  onMsg: e,
2113
2133
  isChanging: t = !0,
2114
2134
  showBalance: r = !0,
2115
2135
  heading: s
2116
2136
  }) => {
2117
- const { ctx: n } = A(), a = Nt(n.sourceToken);
2118
- Et("source", e);
2119
- const l = x(() => {
2137
+ const { ctx: n } = _(), a = vt(n.sourceToken);
2138
+ Dt("source", e);
2139
+ const l = v(() => {
2120
2140
  if (!t && n.quoteStatus === "pending")
2121
2141
  return "disabled";
2122
2142
  if (!n.error)
@@ -2126,8 +2146,8 @@ const pr = ({ className: e }) => {
2126
2146
  if (n.error.code === "SOURCE_BALANCE_INSUFFICIENT")
2127
2147
  return "error-balance";
2128
2148
  }, [t, n.error, n.quoteStatus]);
2129
- return n.sourceToken ? /* @__PURE__ */ c(
2130
- Fe,
2149
+ return n.sourceToken ? /* @__PURE__ */ o(
2150
+ Be,
2131
2151
  {
2132
2152
  heading: s,
2133
2153
  token: n.sourceToken,
@@ -2135,38 +2155,38 @@ const pr = ({ className: e }) => {
2135
2155
  balance: a,
2136
2156
  showBalance: r,
2137
2157
  showQuickBalanceActions: !0,
2138
- value: j(n.sourceTokenAmount, n.sourceToken?.decimals),
2158
+ value: z(n.sourceTokenAmount, n.sourceToken?.decimals),
2139
2159
  onMsg: e
2140
2160
  }
2141
- ) : /* @__PURE__ */ c(Le, { heading: s, onMsg: e });
2142
- }, gr = ({
2161
+ ) : /* @__PURE__ */ o(qe, { heading: s, onMsg: e });
2162
+ }, Rr = ({
2143
2163
  isChanging: e = !1,
2144
2164
  onMsg: t,
2145
2165
  heading: r
2146
2166
  }) => {
2147
- const { ctx: s } = A(), { usdTradeDelta: n } = H(), a = Nt(s.targetToken);
2148
- Et("target", t);
2149
- const l = x(() => !e && s.quoteStatus === "pending" ? "disabled" : "default", [e, s.quoteStatus]);
2150
- return s.targetToken ? /* @__PURE__ */ c(
2151
- Fe,
2167
+ const { ctx: s } = _(), { usdTradeDelta: n } = j(), a = vt(s.targetToken);
2168
+ Dt("target", t);
2169
+ const l = v(() => !e && s.quoteStatus === "pending" ? "disabled" : "default", [e, s.quoteStatus]);
2170
+ return s.targetToken ? /* @__PURE__ */ o(
2171
+ Be,
2152
2172
  {
2153
2173
  heading: r,
2154
2174
  token: s.targetToken,
2155
2175
  balance: a,
2156
2176
  quoteUsdDelta: n?.percentage,
2157
2177
  quoteUsdValue: s.quote && parseFloat(s.quote.amountOutUsd),
2158
- value: j(s.targetTokenAmount, s.targetToken?.decimals),
2178
+ value: z(s.targetTokenAmount, s.targetToken?.decimals),
2159
2179
  state: l,
2160
2180
  showQuickBalanceActions: !1,
2161
2181
  showBalance: !0,
2162
2182
  onMsg: t
2163
2183
  }
2164
- ) : /* @__PURE__ */ c(Le, { heading: r, onMsg: t });
2165
- }, Ir = ({ token: e, heading: t, ...r }) => e ? /* @__PURE__ */ c(Fe, { ...r, token: e, heading: t }) : /* @__PURE__ */ c(Le, { onMsg: r.onMsg, heading: t }), ki = Object.assign(Ir, {
2166
- Skeleton: is,
2167
- Source: hr,
2168
- Target: gr
2169
- }), Ze = 58, bt = ({
2184
+ ) : /* @__PURE__ */ o(qe, { heading: r, onMsg: t });
2185
+ }, vr = ({ token: e, heading: t, ...r }) => e ? /* @__PURE__ */ o(Be, { ...r, token: e, heading: t }) : /* @__PURE__ */ o(qe, { onMsg: r.onMsg, heading: t }), Wi = Object.assign(vr, {
2186
+ Skeleton: ms,
2187
+ Source: Cr,
2188
+ Target: Rr
2189
+ }), Je = 58, xt = ({
2170
2190
  token: e,
2171
2191
  balance: t,
2172
2192
  showBalance: r = !0,
@@ -2174,11 +2194,11 @@ const pr = ({ className: e }) => {
2174
2194
  className: n,
2175
2195
  onMsg: a
2176
2196
  }) => {
2177
- const { ctx: l } = A(), { walletSupportedChains: i, appName: d } = E(), u = cs(t, e), o = i.includes(e.blockchain) || e.isIntent, m = t !== "0" && t !== 0 && t !== void 0;
2178
- return /* @__PURE__ */ c("li", { className: "list-none group", children: /* @__PURE__ */ k(
2197
+ const { ctx: l } = _(), { walletSupportedChains: c, appName: d } = y(), u = fs(t, e), i = c.includes(e.blockchain) || e.isIntent, m = t !== "0" && t !== 0 && t !== void 0;
2198
+ return /* @__PURE__ */ o("li", { className: "list-none group", children: /* @__PURE__ */ T(
2179
2199
  "div",
2180
2200
  {
2181
- className: G(
2201
+ className: H(
2182
2202
  "gap-sw-lg p-sw-lg flex justify-between rounded-sw-md transition-colors",
2183
2203
  {
2184
2204
  "cursor-not-allowed": s,
@@ -2188,40 +2208,40 @@ const pr = ({ className: e }) => {
2188
2208
  ),
2189
2209
  onClick: () => !s && a({ type: "on_select_token", token: e }),
2190
2210
  children: [
2191
- /* @__PURE__ */ c(
2192
- ht,
2211
+ /* @__PURE__ */ o(
2212
+ kt,
2193
2213
  {
2194
2214
  chainShowIcon: !e.isIntent,
2195
2215
  className: "border-sw-gray-900 group-hover:border-sw-gray-800 transition-colors",
2196
2216
  ...e
2197
2217
  }
2198
2218
  ),
2199
- /* @__PURE__ */ k("div", { className: "gap-sw-xs mr-auto flex flex-col", children: [
2200
- /* @__PURE__ */ c("span", { className: "text-sw-label-md text-sw-gray-50", children: e.name }),
2201
- e.isIntent ? /* @__PURE__ */ k("div", { className: "flex items-center gap-sw-xs", children: [
2202
- /* @__PURE__ */ c("span", { className: "text-sw-label-md text-sw-gray-300", children: e.symbol }),
2219
+ /* @__PURE__ */ T("div", { className: "gap-sw-xs mr-auto flex flex-col", children: [
2220
+ /* @__PURE__ */ o("span", { className: "text-sw-label-md text-sw-gray-50", children: e.name }),
2221
+ e.isIntent ? /* @__PURE__ */ T("div", { className: "flex items-center gap-sw-xs", children: [
2222
+ /* @__PURE__ */ o("span", { className: "text-sw-label-md text-sw-gray-300", children: e.symbol }),
2203
2223
  " ",
2204
- /* @__PURE__ */ c("span", { className: "text-sw-label-sm text-sw-gray-300", children: `on ${d} ${e.chainName.toLowerCase() !== "near" && m ? `(${e.chainName})` : ""}` })
2205
- ] }) : /* @__PURE__ */ k("div", { className: "flex items-center gap-sw-xs", children: [
2206
- /* @__PURE__ */ c("span", { className: "text-sw-label-md text-sw-gray-300", children: e.symbol }),
2224
+ /* @__PURE__ */ o("span", { className: "text-sw-label-sm text-sw-gray-300", children: `on ${d} ${e.chainName.toLowerCase() !== "near" && m ? `(${e.chainName})` : ""}` })
2225
+ ] }) : /* @__PURE__ */ T("div", { className: "flex items-center gap-sw-xs", children: [
2226
+ /* @__PURE__ */ o("span", { className: "text-sw-label-md text-sw-gray-300", children: e.symbol }),
2207
2227
  " ",
2208
- /* @__PURE__ */ c("span", { className: "text-sw-label-sm text-sw-gray-300", children: `on ${e.chainName}` })
2228
+ /* @__PURE__ */ o("span", { className: "text-sw-label-sm text-sw-gray-300", children: `on ${e.chainName}` })
2209
2229
  ] })
2210
2230
  ] }),
2211
- o && !!l.walletAddress && r && /* @__PURE__ */ k("div", { className: "gap-sw-xs flex flex-col items-end", children: [
2212
- t === void 0 && !e.isIntent ? /* @__PURE__ */ c("span", { className: "h-[16px] w-[60px] animate-pulse rounded-full bg-sw-gray-700" }) : /* @__PURE__ */ c("span", { className: "h-[16px] text-sw-label-md text-sw-gray-50", children: m && /* @__PURE__ */ c(
2213
- ve,
2231
+ i && !!l.walletAddress && r && /* @__PURE__ */ T("div", { className: "gap-sw-xs flex flex-col items-end", children: [
2232
+ t === void 0 && !e.isIntent ? /* @__PURE__ */ o("span", { className: "h-[16px] w-[60px] animate-pulse rounded-full bg-sw-gray-700" }) : /* @__PURE__ */ o("span", { className: "h-[16px] text-sw-label-md text-sw-gray-50", children: m && /* @__PURE__ */ o(
2233
+ Oe,
2214
2234
  {
2215
2235
  decimals: e.decimals,
2216
2236
  value: t === void 0 ? "0" : `${t}`
2217
2237
  }
2218
2238
  ) }),
2219
- m && /* @__PURE__ */ c("span", { className: "text-sw-label-sm text-sw-gray-300", children: u })
2239
+ m && /* @__PURE__ */ o("span", { className: "text-sw-label-sm text-sw-gray-300", children: u })
2220
2240
  ] })
2221
2241
  ]
2222
2242
  }
2223
2243
  ) });
2224
- }, Je = [
2244
+ }, et = [
2225
2245
  "nep141:eth-0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf.omft.near",
2226
2246
  // cbBTC (eth)
2227
2247
  "nep141:base-0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf.omft.near",
@@ -2234,43 +2254,43 @@ const pr = ({ className: e }) => {
2234
2254
  // NEAR (bsc)
2235
2255
  "nep141:eth-0xe0f63a424a4439cbe457d80e4f4b51ad25b2c56c.omft.near"
2236
2256
  // SPX (eth)
2237
- ], wr = () => {
2257
+ ], Dr = () => {
2238
2258
  const { tokens: e } = P();
2239
2259
  return {
2240
- uniqueIntentsTokens: x(() => {
2260
+ uniqueIntentsTokens: v(() => {
2241
2261
  const t = e.filter(
2242
- (n) => n.isIntent && n.blockchain === "near" && !Je.includes(n.assetId)
2243
- ), r = t.map((n) => n.isIntent && n.symbol), s = e.filter((n) => n.isIntent && n.blockchain !== "near" && !r.includes(n.symbol) && !Je.includes(n.assetId));
2262
+ (n) => n.isIntent && n.blockchain === "near" && !et.includes(n.assetId)
2263
+ ), r = t.map((n) => n.isIntent && n.symbol), s = e.filter((n) => n.isIntent && n.blockchain !== "near" && !r.includes(n.symbol) && !et.includes(n.assetId));
2244
2264
  return [...t, ...s];
2245
2265
  }, [e])
2246
2266
  };
2247
- }, kr = ({
2267
+ }, xr = ({
2248
2268
  variant: e,
2249
2269
  search: t,
2250
2270
  selectedChain: r,
2251
2271
  chainsFilter: s,
2252
2272
  walletSupportedChains: n
2253
2273
  }) => {
2254
- xs(e);
2255
- const { tokens: a } = P(e), { mergedBalance: l } = ce(), { intentBalances: i } = ie(), { uniqueIntentsTokens: d } = wr(), u = us(
2274
+ Ks(e);
2275
+ const { tokens: a } = P(e), { mergedBalance: l } = le(), { intentBalances: c } = ce(), { uniqueIntentsTokens: d } = Dr(), u = Ts(
2256
2276
  l,
2257
2277
  n,
2258
2278
  t
2259
- ), o = a.filter(ms({ search: t })).filter(
2260
- fs({
2279
+ ), i = a.filter(gs({ search: t })).filter(
2280
+ Is({
2261
2281
  selectedChain: r,
2262
2282
  chainsFilter: s,
2263
2283
  walletSupportedChains: n,
2264
- intentBalances: i,
2284
+ intentBalances: c,
2265
2285
  uniqueIntentTokenIds: d.map((m) => m.assetId)
2266
2286
  })
2267
2287
  );
2268
2288
  return {
2269
- all: o.sort(u),
2270
- intents: o.filter($e({ isIntent: !0 })).sort(u),
2271
- wallet: o.filter($e({ isIntent: !1 })).sort(u)
2289
+ all: i.sort(u),
2290
+ intents: i.filter(He({ isIntent: !0 })).sort(u),
2291
+ wallet: i.filter(He({ isIntent: !1 })).sort(u)
2272
2292
  };
2273
- }, Sr = (e, t) => e.length === 0 && t ? "EMPTY_SEARCH" : e.length === 0 && !t ? "NO_TOKENS" : "HAS_TOKENS", Ar = ({
2293
+ }, Or = (e, t) => e.length === 0 && t ? "EMPTY_SEARCH" : e.length === 0 && !t ? "NO_TOKENS" : "HAS_TOKENS", Fr = ({
2274
2294
  variant: e,
2275
2295
  search: t,
2276
2296
  className: r,
@@ -2278,35 +2298,35 @@ const pr = ({ className: e }) => {
2278
2298
  showBalances: n,
2279
2299
  chainsFilter: a,
2280
2300
  selectedChain: l,
2281
- chainIsNotSupported: i,
2301
+ chainIsNotSupported: c,
2282
2302
  onMsg: d
2283
2303
  }) => {
2284
- const { t: u } = K(), { ctx: o } = A(), { walletSupportedChains: m, appName: T } = E(), { mergedBalance: h } = ce(), f = kr({
2304
+ const { t: u } = M(), { ctx: i } = _(), { walletSupportedChains: m, appName: h } = y(), { mergedBalance: g } = le(), f = xr({
2285
2305
  variant: e,
2286
2306
  search: t,
2287
2307
  chainsFilter: a,
2288
2308
  selectedChain: l,
2289
2309
  walletSupportedChains: m
2290
- }), I = o.walletAddress ? s : !1, S = Sr(f.all, t), y = x(
2310
+ }), w = i.walletAddress ? s : !1, S = Or(f.all, t), E = v(
2291
2311
  () => [{ label: null, tokens: f.all }],
2292
2312
  [f.all]
2293
- ), B = x(
2313
+ ), B = v(
2294
2314
  () => [
2295
- { label: `${T} account`, tokens: f.intents },
2315
+ { label: `${h} account`, tokens: f.intents },
2296
2316
  {
2297
- label: i ? null : "Connected wallet",
2317
+ label: c ? null : "Connected wallet",
2298
2318
  tokens: f.wallet
2299
2319
  }
2300
2320
  ],
2301
- [f.wallet, f.intents, i]
2302
- ), F = x(() => (I ? B : y).reduce(
2303
- (w, v) => w + v.tokens.length,
2321
+ [f.wallet, f.intents, c]
2322
+ ), F = v(() => (w ? B : E).reduce(
2323
+ (k, x) => k + x.tokens.length,
2304
2324
  0
2305
- ), [B, y, I]), L = "450px";
2325
+ ), [B, E, w]), L = "450px";
2306
2326
  switch (S) {
2307
2327
  case "EMPTY_SEARCH":
2308
- return /* @__PURE__ */ c(
2309
- ke,
2328
+ return /* @__PURE__ */ o(
2329
+ Se,
2310
2330
  {
2311
2331
  hasAction: !0,
2312
2332
  actionType: "outlined",
@@ -2321,44 +2341,44 @@ const pr = ({ className: e }) => {
2321
2341
  }
2322
2342
  );
2323
2343
  case "HAS_TOKENS":
2324
- return /* @__PURE__ */ c("div", { className: G("gap-sw-lg flex flex-col", r), children: /* @__PURE__ */ c(
2325
- ls,
2344
+ return /* @__PURE__ */ o("div", { className: H("gap-sw-lg flex flex-col", r), children: /* @__PURE__ */ o(
2345
+ ps,
2326
2346
  {
2327
2347
  className: "hide-scrollbar",
2328
2348
  style: {
2329
2349
  maxHeight: L,
2330
2350
  minHeight: 200,
2331
- height: F ? F * Ze + (I ? B.length * 62 : 0) : Ze * 2
2351
+ height: F ? F * Je + (w ? B.length * 62 : 0) : Je * 2
2332
2352
  },
2333
- children: (I ? B : y).map(
2334
- ({ label: w, tokens: v }) => /* @__PURE__ */ k(Ft, { children: [
2335
- v.length && w ? /* @__PURE__ */ k("header", { className: "pb-sw-lg flex flex-col", children: [
2336
- /* @__PURE__ */ c(ds, {}),
2337
- /* @__PURE__ */ c("span", { className: "text-sw-label-sm pt-sw-xl text-sw-gray-100", children: `${w} — ${v.length}` })
2353
+ children: (w ? B : E).map(
2354
+ ({ label: k, tokens: x }) => /* @__PURE__ */ T(Wt, { children: [
2355
+ x.length && k ? /* @__PURE__ */ T("header", { className: "pb-sw-lg flex flex-col", children: [
2356
+ /* @__PURE__ */ o(hs, {}),
2357
+ /* @__PURE__ */ o("span", { className: "text-sw-label-sm pt-sw-xl text-sw-gray-100", children: `${k} — ${x.length}` })
2338
2358
  ] }) : null,
2339
- v.map((Z) => {
2340
- const J = $(Z);
2341
- return /* @__PURE__ */ c(
2342
- bt,
2359
+ x.map((X) => {
2360
+ const J = G(X);
2361
+ return /* @__PURE__ */ o(
2362
+ xt,
2343
2363
  {
2344
- token: Z,
2364
+ token: X,
2345
2365
  showBalance: n,
2346
- balance: h[J],
2347
- isNotSelectable: i && !!o.walletAddress,
2366
+ balance: g[J],
2367
+ isNotSelectable: c && !!i.walletAddress,
2348
2368
  onMsg: d
2349
2369
  },
2350
2370
  J
2351
2371
  );
2352
2372
  }),
2353
- v.length ? /* @__PURE__ */ c("div", { className: "h-sw-2xl" }) : null
2354
- ] }, w ?? "ungrouped-tokens")
2373
+ x.length ? /* @__PURE__ */ o("div", { className: "h-sw-2xl" }) : null
2374
+ ] }, k ?? "ungrouped-tokens")
2355
2375
  )
2356
2376
  }
2357
2377
  ) });
2358
2378
  case "NO_TOKENS":
2359
2379
  default:
2360
- return /* @__PURE__ */ c(
2361
- ke,
2380
+ return /* @__PURE__ */ o(
2381
+ Se,
2362
2382
  {
2363
2383
  className: "pt-sw-5xl pb-sw-5xl",
2364
2384
  subHeading: u(
@@ -2367,86 +2387,288 @@ const pr = ({ className: e }) => {
2367
2387
  ),
2368
2388
  heading: u("tokens.list.noBalanceOnApp.label", {
2369
2389
  defaultValue: "You have no balances on {{appName}}",
2370
- appName: T
2390
+ appName: h
2371
2391
  })
2372
2392
  }
2373
2393
  );
2374
2394
  }
2375
- }, Si = Object.assign(Ar, {
2376
- Placeholder: ke,
2377
- Item: bt
2378
- }), _r = (e, t) => {
2395
+ }, Vi = Object.assign(Fr, {
2396
+ Placeholder: Se,
2397
+ Item: xt
2398
+ }), Lr = (e, t) => {
2379
2399
  const r = t.assetId.substring(t.assetId.indexOf(":") + 1), s = (a) => {
2380
- const l = (u) => u.replace(/(\.\d*?[1-9])0+$/, "$1").replace(/\.0+$/, ""), i = l(t.amount), d = l(
2400
+ const l = (u) => u.replace(/(\.\d*?[1-9])0+$/, "$1").replace(/\.0+$/, ""), c = l(t.amount), d = l(
2381
2401
  a.amount.toLocaleString("en-US", {
2382
2402
  useGrouping: !1,
2383
2403
  maximumFractionDigits: 20
2384
2404
  })
2385
2405
  );
2386
- return i.startsWith(d) || d.startsWith(i);
2406
+ return c.startsWith(d) || d.startsWith(c);
2387
2407
  }, n = (a) => new Date(a.created_at) >= new Date(t.initiatedAtDate);
2388
2408
  return (e.result.deposits || []).find(
2389
2409
  (a) => a.chain === t.chainId && a.account_id === t.intentsAccountId && a.address === t.depositAddress && a.near_token_id === r && n(a) && s(a)
2390
2410
  );
2391
- }, Nr = {
2392
- PENDING: se.status.PROCESSING,
2393
- COMPLETED: se.status.SUCCESS,
2394
- FAILED: se.status.FAILED
2395
- }, Ai = ({ depositAddress: e }) => {
2396
- const { ctx: t } = A(), { intentsAccountType: r } = E(), [s, n] = re(null), a = ee({
2411
+ }, Br = {
2412
+ CREDITED: ee.status.PROCESSING,
2413
+ PENDING: ee.status.PROCESSING,
2414
+ COMPLETED: ee.status.SUCCESS,
2415
+ FAILED: ee.status.FAILED
2416
+ }, Mi = ({ depositAddress: e }) => {
2417
+ const { ctx: t } = _(), { intentsAccountType: r } = y(), [s, n] = re(null), a = te({
2397
2418
  addressType: r,
2398
2419
  walletAddress: t.walletAddress
2399
2420
  });
2400
2421
  return { pollDepositStatus: async ({
2401
- blockchain: i,
2422
+ blockchain: c,
2402
2423
  amount: d,
2403
2424
  assetId: u
2404
2425
  }) => {
2405
2426
  if (!a)
2406
2427
  throw new W("Unknown intents account for POA deposit check");
2407
- let o = st[i];
2408
- if (!o)
2409
- if (M(i))
2410
- o = rt;
2428
+ let i = ct[c];
2429
+ if (!i)
2430
+ if (Q(c))
2431
+ i = lt;
2411
2432
  else
2412
2433
  throw new W(
2413
- `Unknown chain for POA deposit check ${i}`
2434
+ `Unknown chain for POA deposit check ${c}`
2414
2435
  );
2415
2436
  const m = s ?? (/* @__PURE__ */ new Date()).toUTCString();
2416
2437
  s || n(m);
2417
- const T = await ct.post("", {
2438
+ const h = await ft.post("", {
2418
2439
  id: 1,
2419
2440
  jsonrpc: "2.0",
2420
2441
  method: "recent_deposits",
2421
2442
  params: [
2422
2443
  {
2423
2444
  account_id: a,
2424
- chain: o
2445
+ chain: i
2425
2446
  }
2426
2447
  ]
2427
- }), h = _r(T.data, {
2448
+ }), g = Lr(h.data, {
2428
2449
  intentsAccountId: a,
2429
2450
  initiatedAtDate: m,
2430
2451
  depositAddress: e,
2431
- chainId: o,
2452
+ chainId: i,
2432
2453
  assetId: u,
2433
2454
  amount: d
2434
2455
  });
2435
- return h ? {
2436
- status: Nr[h.status],
2456
+ return g ? {
2457
+ status: Br[g.status],
2437
2458
  swapDetails: {
2438
2459
  intentHashes: [""],
2439
- destinationChainTxHashes: [{ hash: h.tx_hash ?? "" }]
2460
+ destinationChainTxHashes: [{ hash: g.tx_hash ?? "" }]
2440
2461
  }
2441
2462
  } : {
2442
- status: se.status.PENDING_DEPOSIT,
2463
+ status: ee.status.PENDING_DEPOSIT,
2443
2464
  swapDetails: {
2444
2465
  destinationChainTxHashes: [{ hash: "" }],
2445
2466
  intentHashes: [""]
2446
2467
  }
2447
2468
  };
2448
2469
  } };
2449
- }, Er = (e) => null, br = (e) => (t) => {
2470
+ }, qr = (e, t, r) => {
2471
+ if (At) {
2472
+ let s = document.body;
2473
+ r instanceof HTMLElement && (s = r), Object.entries(e).forEach(([n, a]) => {
2474
+ s.style.setProperty(`--c-sw-${t}-${n}`, a);
2475
+ });
2476
+ }
2477
+ }, tt = (e, t, r, s) => {
2478
+ const n = r ? ws(r, s ?? "dark") : null;
2479
+ n && qr(n, e, t);
2480
+ }, Ur = (e, t) => {
2481
+ const { primaryColor: r, surfaceColor: s, colorScheme: n } = t;
2482
+ tt("accent", e, r, n), tt("gray", e, s, n);
2483
+ }, Pr = at(void 0), Wr = ({ children: e, theme: t }) => {
2484
+ const { themeParentElementSelector: r } = y(), s = v(() => t, [t]);
2485
+ return C(() => {
2486
+ if (t && At) {
2487
+ const n = r ? document.querySelector(r) : null;
2488
+ Ur(n, t);
2489
+ }
2490
+ }, [t]), /* @__PURE__ */ o(Pr.Provider, { value: s, children: e });
2491
+ }, fe = ({
2492
+ text: e,
2493
+ icon: t
2494
+ }) => /* @__PURE__ */ T("li", { className: "flex items-center gap-sw-md", children: [
2495
+ t && /* @__PURE__ */ o(t, { size: 20, className: "text-sw-gray-300" }),
2496
+ /* @__PURE__ */ o("span", { className: "text-sw-label-md text-sw-gray-50", children: e })
2497
+ ] }), nt = ({
2498
+ label: e,
2499
+ icon: t,
2500
+ className: r
2501
+ }) => /* @__PURE__ */ T(
2502
+ "div",
2503
+ {
2504
+ className: H(
2505
+ "rounded-sw-lg flex align-center justify-center gap-sw-md w-full py-sw-2xl",
2506
+ r
2507
+ ),
2508
+ children: [
2509
+ t && /* @__PURE__ */ o(t, { size: 16 }),
2510
+ /* @__PURE__ */ o("span", { className: "text-sw-label-md", children: e })
2511
+ ]
2512
+ }
2513
+ ), Vr = ({ isSigned: e, isSigning: t, onMsg: r }) => {
2514
+ const { t: s } = M(), n = bs({
2515
+ endTime: 0,
2516
+ autostart: !1,
2517
+ timerType: "DECREMENTAL",
2518
+ initialTime: 7,
2519
+ onTimeOver: () => {
2520
+ r({ type: "on_close" });
2521
+ }
2522
+ });
2523
+ return C(() => {
2524
+ e ? n.start() : n.reset();
2525
+ }, [e]), /* @__PURE__ */ T(ie, { className: "relative w-full gap-sw-2xl flex flex-col", children: [
2526
+ /* @__PURE__ */ o(
2527
+ St,
2528
+ {
2529
+ onClick: () => r({ type: "on_close" }),
2530
+ className: "absolute top-sw-2xl right-sw-2xl"
2531
+ }
2532
+ ),
2533
+ /* @__PURE__ */ o(ks, { size: 48, className: "text-sw-status-warning" }),
2534
+ /* @__PURE__ */ T("header", { className: "flex flex-col gap-sw-lg", children: [
2535
+ /* @__PURE__ */ o("h1", { className: "text-sw-label-lg text-sw-gray-50", children: s(
2536
+ "walletCompatibility.modal.title.initial",
2537
+ "Verify your wallet to continue"
2538
+ ) }),
2539
+ /* @__PURE__ */ o("p", { className: "text-sw-body-md text-sw-gray-200", children: s(
2540
+ "walletCompatibility.modal.description.initial",
2541
+ "Please sign a message to verify your wallet. This confirms your wallet is compatible and lets us securely read your public key."
2542
+ ) })
2543
+ ] }),
2544
+ /* @__PURE__ */ T("ul", { className: "flex flex-col gap-sw-xl", children: [
2545
+ /* @__PURE__ */ o(
2546
+ fe,
2547
+ {
2548
+ text: s(
2549
+ "walletCompatibility.modal.feature.secureTransactions",
2550
+ "Read-only signature – no gas required."
2551
+ ),
2552
+ icon: As
2553
+ }
2554
+ ),
2555
+ /* @__PURE__ */ o(
2556
+ fe,
2557
+ {
2558
+ text: s(
2559
+ "walletCompatibility.modal.feature.fullAccess",
2560
+ "No access to your funds, no hidden permissions."
2561
+ ),
2562
+ icon: Ss
2563
+ }
2564
+ ),
2565
+ /* @__PURE__ */ o(
2566
+ fe,
2567
+ {
2568
+ text: s(
2569
+ "walletCompatibility.modal.feature.fundProtection",
2570
+ "Only checks whether your wallet is supported."
2571
+ ),
2572
+ icon: Ns
2573
+ }
2574
+ )
2575
+ ] }),
2576
+ e ? /* @__PURE__ */ T("div", { className: "flex flex-col gap-sw-xl mt-sw-lg w-full", children: [
2577
+ /* @__PURE__ */ o(
2578
+ nt,
2579
+ {
2580
+ label: s(
2581
+ "walletCompatibility.modal.button.verified",
2582
+ "Wallet verified"
2583
+ ),
2584
+ className: "bg-sw-status-success text-sw-gray-950",
2585
+ icon: _s
2586
+ }
2587
+ ),
2588
+ n.status === "RUNNING" && /* @__PURE__ */ o(
2589
+ nt,
2590
+ {
2591
+ className: "text-sw-gray-400",
2592
+ label: s("walletCompatibility.modal.button.closeTimer", {
2593
+ defaultValue: "Popup will close in {{count}} sec...",
2594
+ count: n.time
2595
+ })
2596
+ }
2597
+ )
2598
+ ] }) : /* @__PURE__ */ T("div", { className: "flex flex-col gap-sw-xl mt-sw-lg", children: [
2599
+ /* @__PURE__ */ o(
2600
+ A,
2601
+ {
2602
+ size: "lg",
2603
+ variant: "primary",
2604
+ onClick: () => r({ type: "on_check_compatibility" }),
2605
+ children: s("walletCompatibility.modal.button.verify", "Verify wallet")
2606
+ }
2607
+ ),
2608
+ /* @__PURE__ */ o(
2609
+ A,
2610
+ {
2611
+ size: "lg",
2612
+ variant: "outlined",
2613
+ state: t ? "loading" : "default",
2614
+ onClick: () => r({ type: "on_sign_out" }),
2615
+ children: t ? s(
2616
+ "walletCompatibility.modal.button.signing",
2617
+ "Sign with your wallet"
2618
+ ) : s("walletCompatibility.modal.button.signOut", "Sign out")
2619
+ }
2620
+ )
2621
+ ] })
2622
+ ] });
2623
+ }, Mr = ({ onMsg: e }) => {
2624
+ const { t } = M();
2625
+ return /* @__PURE__ */ T(ie, { className: "relative w-full gap-sw-2xl flex flex-col", children: [
2626
+ /* @__PURE__ */ o(
2627
+ St,
2628
+ {
2629
+ onClick: () => e({ type: "on_close" }),
2630
+ className: "absolute top-sw-2xl right-sw-2xl"
2631
+ }
2632
+ ),
2633
+ /* @__PURE__ */ o(ys, { size: 48, className: "text-sw-status-error" }),
2634
+ /* @__PURE__ */ T("header", { className: "flex flex-col gap-sw-lg", children: [
2635
+ /* @__PURE__ */ o("h1", { className: "text-sw-label-lg text-sw-gray-50", children: t(
2636
+ "walletCompatibility.modal.title.error",
2637
+ "Unable to verify wallet"
2638
+ ) }),
2639
+ /* @__PURE__ */ o("p", { className: "text-sw-body-md text-sw-gray-200", children: t(
2640
+ "walletCompatibility.modal.description.error",
2641
+ "We couldn’t complete the verification. It may have been interrupted or your wallet may not be compatible."
2642
+ ) }),
2643
+ /* @__PURE__ */ o("p", { className: "text-sw-body-md text-sw-gray-200", children: t(
2644
+ "walletCompatibility.modal.button.tryAgainDesc",
2645
+ "If the issue continues, please try another wallet."
2646
+ ) })
2647
+ ] }),
2648
+ /* @__PURE__ */ T("div", { className: "flex flex-col gap-sw-xl mt-sw-lg", children: [
2649
+ /* @__PURE__ */ o(
2650
+ A,
2651
+ {
2652
+ size: "lg",
2653
+ variant: "primary",
2654
+ onClick: () => e({ type: "on_try_again" }),
2655
+ children: t("walletCompatibility.modal.button.tryAgain", "Try again")
2656
+ }
2657
+ ),
2658
+ /* @__PURE__ */ o(
2659
+ A,
2660
+ {
2661
+ size: "lg",
2662
+ variant: "outlined",
2663
+ onClick: () => e({ type: "on_sign_out" }),
2664
+ children: t("walletCompatibility.modal.button.signOut", "Sign out")
2665
+ }
2666
+ )
2667
+ ] })
2668
+ ] });
2669
+ }, Qi = Object.assign(Vr, {
2670
+ Error: Mr
2671
+ }), Qr = (e) => null, $r = (e) => (t) => {
2450
2672
  if (t instanceof W)
2451
2673
  throw t;
2452
2674
  const r = new W(
@@ -2454,49 +2676,49 @@ const pr = ({ className: e }) => {
2454
2676
  { cause: t }
2455
2677
  );
2456
2678
  throw r.context = e, r;
2457
- }, yr = ({ children: e }) => {
2458
- const { ctx: t } = A();
2459
- return /* @__PURE__ */ c(
2460
- gs,
2679
+ }, Kr = ({ children: e }) => {
2680
+ const { ctx: t } = _();
2681
+ return /* @__PURE__ */ o(
2682
+ Rs,
2461
2683
  {
2462
- FallbackComponent: Er,
2463
- onError: br(t),
2684
+ FallbackComponent: Qr,
2685
+ onError: $r(t),
2464
2686
  children: e
2465
2687
  }
2466
2688
  );
2467
- }, Rr = new Pt({
2689
+ }, Hr = new $t({
2468
2690
  defaultOptions: {
2469
2691
  queries: {
2470
2692
  staleTime: 2e3 * 60,
2471
- retry: Xe.env.NODE_ENV === "test" ? !1 : 3
2693
+ retry: st.env.NODE_ENV === "test" ? !1 : 3
2472
2694
  }
2473
2695
  }
2474
- }), Dr = ["fms", "abg", "stjack", "noear", "testnebula"], ae = {
2696
+ }), Gr = ["fms", "abg", "stjack", "noear", "testnebula"], ae = {
2475
2697
  appName: "Unknown",
2476
2698
  appIcon: "https://wtmcxrwapthiogjpxwfr.supabase.co/storage/v1/object/public/swap-widget/unknown.svg",
2477
2699
  slippageTolerance: 100,
2478
2700
  // 1%
2479
2701
  intentsAccountType: "evm",
2480
- walletSupportedChains: zt,
2702
+ walletSupportedChains: tn,
2481
2703
  connectedWallets: {},
2482
2704
  enableAutoTokensSwitching: !0,
2483
2705
  showIntentTokens: !0,
2484
- chainsOrder: nt,
2485
- filterTokens: (e) => !Dr.includes(e.symbol.toLocaleLowerCase()),
2706
+ chainsOrder: it,
2707
+ filterTokens: (e) => !Gr.includes(e.symbol.toLocaleLowerCase()),
2486
2708
  chainsFilter: {
2487
2709
  source: { external: "wallet-supported", intents: "none" },
2488
2710
  target: { external: "all", intents: "none" }
2489
2711
  }
2490
- }, yt = Bt({
2712
+ }, Ot = at({
2491
2713
  config: ae
2492
- }), Be = et({
2714
+ }), Ue = rt({
2493
2715
  config: ae
2494
- }), E = () => {
2495
- const e = Lt(yt);
2716
+ }), y = () => {
2717
+ const e = Vt(Ot);
2496
2718
  return oe(e).config;
2497
- }, Cr = (e) => {
2498
- Be.config = me(e);
2499
- }, _i = ({
2719
+ }, jr = (e) => {
2720
+ Ue.config = pe(e);
2721
+ }, $i = ({
2500
2722
  children: e,
2501
2723
  config: t,
2502
2724
  balanceViaRpc: r = !0,
@@ -2506,104 +2728,109 @@ const pr = ({ className: e }) => {
2506
2728
  theme: a
2507
2729
  }) => {
2508
2730
  const l = Y(
2509
- et({
2510
- config: me({
2731
+ rt({
2732
+ config: pe({
2511
2733
  ...ae,
2512
2734
  ...t
2513
2735
  })
2514
2736
  })
2515
2737
  );
2516
- return R(() => {
2517
- const i = me({
2738
+ return C(() => {
2739
+ const c = pe({
2518
2740
  ...ae,
2519
2741
  ...t
2520
2742
  });
2521
- Object.assign(l.current.config, i), Cr(i);
2522
- }, [t]), Qt(s ?? {}), hs("headlessui-portal-root", "sw"), /* @__PURE__ */ c(Wt, { client: Rr, children: /* @__PURE__ */ c(Mt, { i18n: Dt, children: /* @__PURE__ */ k(yt.Provider, { value: l.current, children: [
2523
- /* @__PURE__ */ k(Ct, { children: [
2524
- /* @__PURE__ */ k(vt, { children: [
2525
- /* @__PURE__ */ c("link", { rel: "preconnect", href: "https://rsms.me/" }),
2526
- /* @__PURE__ */ c("link", { rel: "stylesheet", href: "https://rsms.me/inter/inter.css" })
2743
+ Object.assign(l.current.config, c), jr(c);
2744
+ }, [t]), jt(s ?? {}), Cs("headlessui-portal-root", "sw"), /* @__PURE__ */ o(Kt, { client: Hr, children: /* @__PURE__ */ o(Gt, { i18n: Lt, children: /* @__PURE__ */ T(Ot.Provider, { value: l.current, children: [
2745
+ /* @__PURE__ */ T(Bt, { children: [
2746
+ /* @__PURE__ */ T(qt, { children: [
2747
+ /* @__PURE__ */ o("link", { rel: "preconnect", href: "https://rsms.me/" }),
2748
+ /* @__PURE__ */ o("link", { rel: "stylesheet", href: "https://rsms.me/inter/inter.css" })
2527
2749
  ] }),
2528
- /* @__PURE__ */ c(ps, { theme: a, children: Xe.env.NODE_ENV === "test" ? e : /* @__PURE__ */ c(yr, { children: e }) })
2750
+ /* @__PURE__ */ o(Wr, { theme: a, children: st.env.NODE_ENV === "test" ? e : /* @__PURE__ */ o(Kr, { children: e }) })
2529
2751
  ] }),
2530
- r && /* @__PURE__ */ c(
2531
- vs,
2752
+ r && /* @__PURE__ */ o(
2753
+ Qs,
2532
2754
  {
2533
- rpcs: n ?? Ts,
2755
+ rpcs: n ?? Es,
2534
2756
  connectedWallets: t.connectedWallets ?? {}
2535
2757
  }
2536
2758
  )
2537
2759
  ] }) }) });
2538
2760
  };
2539
2761
  export {
2540
- tr as $,
2541
- Ns as A,
2542
- vs as B,
2543
- Ke as C,
2544
- Fs as D,
2545
- Ls as E,
2546
- Bs as F,
2547
- qs as G,
2548
- Ws as H,
2549
- wt as I,
2550
- kt as J,
2551
- St as K,
2552
- At as L,
2553
- _t as M,
2554
- Vs as N,
2555
- Ms as O,
2556
- Qs as P,
2762
+ dr as $,
2763
+ Mi as A,
2764
+ Qs as B,
2765
+ Pr as C,
2766
+ Bs as D,
2767
+ Ge as E,
2768
+ Hs as F,
2769
+ Gs as G,
2770
+ js as H,
2771
+ zs as I,
2772
+ Xs as J,
2773
+ yt as K,
2774
+ bt as L,
2775
+ Rt as M,
2776
+ Et as N,
2777
+ Ct as O,
2778
+ Js as P,
2557
2779
  q as Q,
2558
- $s as R,
2559
- fr as S,
2560
- Ir as T,
2561
- Ks as U,
2562
- Hs as V,
2563
- _i as W,
2564
- Gs as X,
2565
- js as Y,
2566
- Js as Z,
2567
- Xs as _,
2568
- Ii as a,
2569
- nr as a0,
2570
- pr as a1,
2571
- Tr as a2,
2572
- Fe as a3,
2573
- Le as a4,
2574
- Et as a5,
2575
- hr as a6,
2576
- gr as a7,
2577
- Ze as a8,
2578
- bt as a9,
2579
- wr as aa,
2580
- Ar as ab,
2581
- yr as ac,
2582
- Be as ad,
2583
- A as b,
2584
- hi as c,
2585
- xs as d,
2586
- Ds as e,
2587
- ie as f,
2588
- ar as g,
2589
- Ps as h,
2590
- or as i,
2591
- er as j,
2592
- ce as k,
2593
- cr as l,
2594
- kr as m,
2780
+ er as R,
2781
+ yr as S,
2782
+ vr as T,
2783
+ tr as U,
2784
+ nr as V,
2785
+ $i as W,
2786
+ sr as X,
2787
+ rr as Y,
2788
+ ar as Z,
2789
+ or as _,
2790
+ Ui as a,
2791
+ ur as a0,
2792
+ fr as a1,
2793
+ pr as a2,
2794
+ br as a3,
2795
+ Er as a4,
2796
+ Be as a5,
2797
+ qe as a6,
2798
+ Dt as a7,
2799
+ Cr as a8,
2800
+ Rr as a9,
2801
+ Je as aa,
2802
+ xt as ab,
2803
+ Dr as ac,
2804
+ Fr as ad,
2805
+ Wr as ae,
2806
+ Vr as af,
2807
+ Mr as ag,
2808
+ Kr as ah,
2809
+ Ue as ai,
2810
+ _ as b,
2811
+ Bi as c,
2812
+ Ks as d,
2813
+ Vs as e,
2814
+ ce as f,
2815
+ gr as g,
2816
+ Zs as h,
2817
+ Ir as i,
2818
+ mr as j,
2819
+ le as k,
2820
+ kr as l,
2821
+ xr as m,
2595
2822
  P as n,
2596
- wi as o,
2597
- ki as p,
2598
- Si as q,
2599
- Ys as r,
2600
- Nt as s,
2601
- It as t,
2602
- H as u,
2823
+ Pi as o,
2824
+ Wi as p,
2825
+ Vi as q,
2826
+ ir as r,
2827
+ vt as s,
2828
+ _t as t,
2829
+ j as u,
2603
2830
  W as v,
2604
- g as w,
2605
- gi as x,
2606
- E as y,
2607
- Ai as z
2831
+ I as w,
2832
+ qi as x,
2833
+ y,
2834
+ Qi as z
2608
2835
  };
2609
- //# sourceMappingURL=config-Bmc4hOIl.js.map
2836
+ //# sourceMappingURL=config-Behl5hcc.js.map