@aurora-is-near/intents-swap-widget 3.18.0 → 3.18.2

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