@funkit/connect 0.1.3 → 0.1.4

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 (32) hide show
  1. package/dist/{chunk-WSQKOMBH.js → chunk-AHK324EF.js} +933 -772
  2. package/dist/{chunk-YPT63F4L.js → chunk-P6ZB76ND.js} +933 -772
  3. package/dist/components/FunButton/FunLinkButton.d.ts +2 -1
  4. package/dist/components/FunCheckoutModal/FunCheckoutSelectAssetStep.d.ts +2 -1
  5. package/dist/components/FunPayments/FunPaymentMoonpayType.d.ts +3 -2
  6. package/dist/components/FunPayments/FunPaymentSetup.d.ts +2 -1
  7. package/dist/components/FunProgressBar/FunVerticalProgressBar.d.ts +2 -0
  8. package/dist/components/FunToast/FunToast.d.ts +3 -2
  9. package/dist/components/FunkitProvider/FunkitCheckoutContext.d.ts +4 -2
  10. package/dist/components/ProfileDetails/FunWalletProfileViews/FWHome/FWHome.css.d.ts +1 -0
  11. package/dist/components/index.css +5 -3
  12. package/dist/components/index.js +1 -1
  13. package/dist/hooks/useCheckoutAccountBalanceTransfer.d.ts +11 -0
  14. package/dist/index.css +5 -3
  15. package/dist/index.js +1 -1
  16. package/dist/utils/checkout.d.ts +1 -6
  17. package/dist/wallets/walletConnectors/argentWallet/argentWallet.js +2 -2
  18. package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
  19. package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
  20. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  21. package/dist/wallets/walletConnectors/index.js +54 -54
  22. package/dist/wallets/walletConnectors/ledgerWallet/ledgerWallet.js +2 -2
  23. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  24. package/dist/wallets/walletConnectors/oktoWallet/oktoWallet.js +2 -2
  25. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  26. package/dist/wallets/walletConnectors/omniWallet/omniWallet.js +2 -2
  27. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  28. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  29. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  30. package/dist/wallets/walletConnectors/walletConnectWallet/walletConnectWallet.js +2 -2
  31. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  32. package/package.json +3 -3
@@ -13103,6 +13103,7 @@ var zkSyncIcon = {
13103
13103
  var chainMetadataByName = {
13104
13104
  arbitrum: { chainId: 42161, name: "Arbitrum", ...arbitrumIcon },
13105
13105
  arbitrumGoerli: { chainId: 421613, ...arbitrumIcon },
13106
+ arbitrumSepolia: { chainId: 421614, ...arbitrumIcon },
13106
13107
  avalanche: { chainId: 43114, ...avalancheIcon },
13107
13108
  avalancheFuji: { chainId: 43113, ...avalancheIcon },
13108
13109
  base: { chainId: 8453, name: "Base", ...baseIcon },
@@ -13718,7 +13719,7 @@ var DropdownIcon = () => /* @__PURE__ */ React12.createElement("svg", {
13718
13719
 
13719
13720
  // src/components/ConnectButton/ConnectButtonRenderer.tsx
13720
13721
  import React128, { useContext as useContext21 } from "react";
13721
- import { useAccount as useAccount14, useBalance as useBalance2, useNetwork as useNetwork12 } from "wagmi";
13722
+ import { useAccount as useAccount14, useBalance as useBalance2, useNetwork as useNetwork11 } from "wagmi";
13722
13723
 
13723
13724
  // src/hooks/useIsMounted.ts
13724
13725
  import { useEffect as useEffect6, useReducer as useReducer3 } from "react";
@@ -13962,20 +13963,20 @@ function useRecentTransactions() {
13962
13963
  // src/components/FunkitProvider/ModalContext.tsx
13963
13964
  import React127, {
13964
13965
  createContext as createContext16,
13965
- useCallback as useCallback23,
13966
+ useCallback as useCallback24,
13966
13967
  useContext as useContext20,
13967
13968
  useMemo as useMemo27,
13968
13969
  useState as useState35
13969
13970
  } from "react";
13970
- import { useAccount as useAccount13, useDisconnect as useDisconnect5, useNetwork as useNetwork11 } from "wagmi";
13971
+ import { useAccount as useAccount13, useDisconnect as useDisconnect5, useNetwork as useNetwork10 } from "wagmi";
13971
13972
 
13972
13973
  // src/components/AccountModal/AccountModal.tsx
13973
13974
  import React104, { useState as useState28 } from "react";
13974
13975
  import { useAccount as useAccount12, useBalance, useDisconnect as useDisconnect2 } from "wagmi";
13975
13976
 
13976
13977
  // src/components/Dialog/Dialog.tsx
13977
- import React83, {
13978
- useCallback as useCallback17,
13978
+ import React85, {
13979
+ useCallback as useCallback18,
13979
13980
  useEffect as useEffect25,
13980
13981
  useState as useState21
13981
13982
  } from "react";
@@ -13984,7 +13985,7 @@ import { RemoveScroll } from "react-remove-scroll";
13984
13985
 
13985
13986
  // src/components/FunkitProvider/FunkitProvider.tsx
13986
13987
  import { FUNKIT_CONNECT_SUPPORTED_CHAINS_ID_LIST } from "@funkit/core";
13987
- import React81, {
13988
+ import React83, {
13988
13989
  createContext as createContext15,
13989
13990
  useContext as useContext12,
13990
13991
  useEffect as useEffect23
@@ -14203,17 +14204,17 @@ import {
14203
14204
  isAddress as isAddress2
14204
14205
  } from "@funkit/core";
14205
14206
  import { prepareWriteContract, writeContract } from "@wagmi/core";
14206
- import React75, {
14207
- createContext as createContext11,
14208
- useCallback as useCallback11,
14209
- useContext as useContext9,
14207
+ import React78, {
14208
+ createContext as createContext12,
14209
+ useCallback as useCallback13,
14210
+ useContext as useContext10,
14210
14211
  useEffect as useEffect20,
14211
- useMemo as useMemo16,
14212
+ useMemo as useMemo17,
14212
14213
  useRef as useRef7,
14213
- useState as useState19
14214
+ useState as useState20
14214
14215
  } from "react";
14215
14216
  import { v4 as uuid } from "uuid";
14216
- import { useAccount as useAccount8, useNetwork as useNetwork6 } from "wagmi";
14217
+ import { useAccount as useAccount8, useNetwork as useNetwork5 } from "wagmi";
14217
14218
 
14218
14219
  // src/utils/checkout.ts
14219
14220
  import {
@@ -14224,6 +14225,7 @@ import {
14224
14225
  FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS,
14225
14226
  FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO,
14226
14227
  getAssetPriceInfoForCheckout,
14228
+ getEnvOptions,
14227
14229
  Token
14228
14230
  } from "@funkit/core";
14229
14231
  import { fetchBalance } from "@wagmi/core";
@@ -14260,6 +14262,12 @@ function validateCheckoutConfig(config) {
14260
14262
  message: `Invalid targetChain configuration: Unsupported chain id ${config.targetChain} for checkout.`
14261
14263
  };
14262
14264
  }
14265
+ if (!FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO[config.targetChain].isCheckoutSupported) {
14266
+ return {
14267
+ isValid: false,
14268
+ message: `Invalid targetChain configuration: Unsupported testnet chain id ${config.targetChain} for checkout.`
14269
+ };
14270
+ }
14263
14271
  return { isValid: true, message: "" };
14264
14272
  }
14265
14273
  async function getPureCheckoutTokenAddress(tokenAddress, chainId) {
@@ -14307,7 +14315,8 @@ function getFunkitEnvForCheckoutEstimation({
14307
14315
  }
14308
14316
  const checkoutPaymasterAddresses = CONTRACT_ADDRESSES.checkoutPaymasterAddress;
14309
14317
  const sponsorAddress = checkoutPaymasterAddresses[chainId];
14310
- const originalEnvOptions = window.globalEnvOptions || { gasSponsor: {} };
14318
+ const existingGlobalEnvOptions = getEnvOptions();
14319
+ const originalEnvOptions = existingGlobalEnvOptions || { gasSponsor: {} };
14311
14320
  const newConfig = {
14312
14321
  ...originalEnvOptions,
14313
14322
  chain: chainId,
@@ -14383,7 +14392,7 @@ function getCheckoutStateStepNumber(state) {
14383
14392
  }
14384
14393
 
14385
14394
  // src/components/FunPayments/FunPaymentMethods.tsx
14386
- import React74, { useCallback as useCallback10, useMemo as useMemo15, useState as useState18 } from "react";
14395
+ import React77, { useCallback as useCallback12, useMemo as useMemo16, useState as useState19 } from "react";
14387
14396
 
14388
14397
  // src/hooks/useFunListeners.ts
14389
14398
  import { useEffect as useEffect10 } from "react";
@@ -14835,8 +14844,8 @@ var WalletDecoratedIcon = () => {
14835
14844
 
14836
14845
  // src/components/ProfileDetails/FunWalletProfileViews/FWDeposit.tsx
14837
14846
  import { meshPreviewTransfer as meshPreviewTransfer2 } from "@funkit/core";
14838
- import React73, { useCallback as useCallback9, useMemo as useMemo14, useState as useState17 } from "react";
14839
- import { useAccount as useAccount7, useNetwork as useNetwork5 } from "wagmi";
14847
+ import React76, { useCallback as useCallback11, useMemo as useMemo15, useState as useState18 } from "react";
14848
+ import { useAccount as useAccount7, useNetwork as useNetwork4 } from "wagmi";
14840
14849
 
14841
14850
  // src/hooks/useMesh.tsx
14842
14851
  import React35, { useCallback as useCallback3, useMemo as useMemo5, useRef as useRef3, useState as useState8 } from "react";
@@ -15478,8 +15487,63 @@ var useMeshActiveNetworkInfo = (exchange) => {
15478
15487
  };
15479
15488
 
15480
15489
  // src/components/FunCheckoutModal/FunCheckoutConfirmationStep.tsx
15481
- import { isAddress } from "@funkit/core";
15482
- import React43, { useCallback as useCallback4, useMemo as useMemo7, useState as useState10 } from "react";
15490
+ import {
15491
+ getPaymasterDataForCheckoutSponsoredTransfer,
15492
+ isAddress
15493
+ } from "@funkit/core";
15494
+ import React43, { useCallback as useCallback5, useMemo as useMemo7, useState as useState10 } from "react";
15495
+
15496
+ // src/hooks/useCheckoutAccountBalanceTransfer.ts
15497
+ import { useCallback as useCallback4 } from "react";
15498
+ function useCheckoutAccountBalanceTransfer(checkoutId) {
15499
+ const { checkoutItem } = useFunkitPreCheckoutInternal(checkoutId);
15500
+ const { funWallet, auth: funWalletAuth } = useFunkitWallet();
15501
+ const generateCheckoutTransferOpItems = useCallback4(
15502
+ async (toAddress, tokenAmount) => {
15503
+ if (checkoutItem?.selectedSourceAssetInfo?.chainId) {
15504
+ const newConfig = getFunkitEnvForCheckoutEstimation({
15505
+ chainId: checkoutItem.selectedSourceAssetInfo.chainId,
15506
+ bypassWalletInit: false
15507
+ });
15508
+ const userId = await funWalletAuth?.getUserId();
15509
+ if (funWallet && funWalletAuth && userId && checkoutItem?.selectedSourceAssetInfo?.symbol && tokenAmount) {
15510
+ const transferParams = {
15511
+ to: toAddress,
15512
+ token: checkoutItem?.selectedSourceAssetInfo?.symbol,
15513
+ amount: tokenAmount
15514
+ };
15515
+ console.log("funWallet", funWallet);
15516
+ console.log("funWalletAuth", funWalletAuth);
15517
+ console.log("newConfig", newConfig);
15518
+ console.log("userId", userId);
15519
+ console.log("transferParams", transferParams);
15520
+ const transferOp = await funWallet.transfer(
15521
+ funWalletAuth,
15522
+ userId,
15523
+ transferParams,
15524
+ newConfig
15525
+ );
15526
+ console.log("transferOp", transferOp);
15527
+ return {
15528
+ rFunWallet: funWallet,
15529
+ rFunWalletAuth: funWalletAuth,
15530
+ transferOp
15531
+ };
15532
+ }
15533
+ }
15534
+ return { rFunWallet: null, rFunWalletAuth: null, transferOp: null };
15535
+ },
15536
+ [
15537
+ checkoutItem?.selectedSourceAssetInfo.chainId,
15538
+ checkoutItem?.selectedSourceAssetInfo?.symbol,
15539
+ funWallet,
15540
+ funWalletAuth
15541
+ ]
15542
+ );
15543
+ return {
15544
+ generateCheckoutTransferOpItems
15545
+ };
15546
+ }
15483
15547
 
15484
15548
  // src/utils/formatNumber.ts
15485
15549
  var FORMAT_NUMBER_DEFAULT = {
@@ -15640,12 +15704,14 @@ var funLinkButtonStyle = "FunButton_funLinkButtonStyle__1tyx5nu0";
15640
15704
  function FunLinkButton({
15641
15705
  onClick,
15642
15706
  text,
15643
- textProps
15707
+ textProps,
15708
+ hasPadding = true
15644
15709
  }) {
15645
15710
  return /* @__PURE__ */ React36.createElement(Box, {
15646
15711
  as: "button",
15647
15712
  onClick,
15648
- className: funLinkButtonStyle
15713
+ className: funLinkButtonStyle,
15714
+ paddingLeft: hasPadding ? "4" : "0"
15649
15715
  }, /* @__PURE__ */ React36.createElement(Text, {
15650
15716
  color: "modalText",
15651
15717
  size: "12",
@@ -15897,11 +15963,15 @@ var animateContentOutClass = "FunCheckoutConfirmation_animateContentOutClass__1c
15897
15963
 
15898
15964
  // src/components/FunCheckoutModal/FunCheckoutPrimaryInfo.tsx
15899
15965
  import React42, { useEffect as useEffect11, useState as useState9 } from "react";
15966
+ var FALLBACK_CHECKOUT_ITEM_DESCRIPTION = "";
15967
+ var FALLBACK_CHECKOUT_ITEM_AMOUNT = "";
15900
15968
  function CheckoutPrimaryInfoSnapshot({
15901
15969
  checkoutItem,
15902
15970
  isLoading
15903
15971
  }) {
15904
15972
  const checkoutConfig = checkoutItem.initSettings.config;
15973
+ const showCheckoutItemDescription = !!checkoutConfig?.checkoutItemDescription;
15974
+ const showCheckoutItemAmount = isNotNullish(checkoutConfig?.checkoutItemAmount) && checkoutConfig.checkoutItemAmount > 0;
15905
15975
  return /* @__PURE__ */ React42.createElement(Box, {
15906
15976
  display: "flex",
15907
15977
  gap: "12",
@@ -15938,20 +16008,20 @@ function CheckoutPrimaryInfoSnapshot({
15938
16008
  hasBorder: false,
15939
16009
  paddingY: "0",
15940
16010
  paddingX: "0"
15941
- }), /* @__PURE__ */ React42.createElement(FunKeyValue, {
15942
- keyText: checkoutConfig?.checkoutItemDescription || "Amount",
15943
- keyTextSize: "18",
16011
+ }), showCheckoutItemDescription || showCheckoutItemAmount ? /* @__PURE__ */ React42.createElement(FunKeyValue, {
16012
+ keyText: checkoutConfig?.checkoutItemDescription || FALLBACK_CHECKOUT_ITEM_DESCRIPTION,
16013
+ keyTextSize: "14",
15944
16014
  keyTextColor: "modalTextDim",
15945
- valueText: formatCryptoAndStringify(
15946
- checkoutConfig?.targetAssetAmount
15947
- ),
15948
- valueTextSize: "18",
16015
+ keyTextWeight: "medium",
16016
+ valueText: showCheckoutItemAmount ? formatCryptoAndStringify(checkoutConfig?.checkoutItemAmount) : FALLBACK_CHECKOUT_ITEM_AMOUNT,
16017
+ valueTextSize: "14",
15949
16018
  valueTextColor: "modalTextDim",
16019
+ valueTextWeight: "medium",
15950
16020
  backgroundBaseColor: void 0,
15951
16021
  hasBorder: false,
15952
16022
  paddingY: "0",
15953
16023
  paddingX: "0"
15954
- })));
16024
+ }) : null));
15955
16025
  }
15956
16026
  function CheckoutPrimaryInfo({
15957
16027
  checkoutId
@@ -15991,6 +16061,7 @@ function FunCheckoutConfirmationStep({
15991
16061
  () => checkoutItem?.quoteErrorMessage !== "",
15992
16062
  [checkoutItem?.quoteErrorMessage]
15993
16063
  );
16064
+ const { generateCheckoutTransferOpItems } = useCheckoutAccountBalanceTransfer(checkoutId);
15994
16065
  const [isConfirming, setIsConfirming] = useState10(false);
15995
16066
  const [confirmationError, setConfirmationError] = useState10("");
15996
16067
  const hasCheckoutConfirmationError = useMemo7(
@@ -16003,7 +16074,7 @@ function FunCheckoutConfirmationStep({
16003
16074
  () => postCheckoutError !== "",
16004
16075
  [postCheckoutError]
16005
16076
  );
16006
- const handleMeshPostCheckout = useCallback4(
16077
+ const handleMeshPostCheckout = useCallback5(
16007
16078
  async (depositAddress) => {
16008
16079
  if (!funkitConfig?.apiKey) {
16009
16080
  throw new Error("Invalid funkit apiKey");
@@ -16037,34 +16108,41 @@ function FunCheckoutConfirmationStep({
16037
16108
  selectedPaymentMethodInfo?.meta?.accessToken?.brokerName
16038
16109
  ]
16039
16110
  );
16040
- const handleAccountBalancePostCheckout = useCallback4(
16111
+ const handleAccountBalancePostCheckout = useCallback5(
16041
16112
  async (depositAddress) => {
16042
- const userId = await funWalletAuth?.getUserId();
16043
- if (funWallet && funWalletAuth && userId && checkoutItem?.selectedSourceAssetInfo?.symbol && checkoutItem?.latestQuote?.estTotalFromAmount) {
16044
- const transferParams = {
16045
- to: depositAddress,
16046
- token: checkoutItem?.selectedSourceAssetInfo?.symbol,
16047
- amount: checkoutItem?.latestQuote?.estTotalFromAmount
16048
- };
16049
- const transferOp = await funWallet.transfer(
16050
- funWalletAuth,
16051
- userId,
16052
- transferParams
16113
+ const { rFunWallet, rFunWalletAuth, transferOp } = await generateCheckoutTransferOpItems(
16114
+ depositAddress,
16115
+ checkoutItem?.latestQuote?.estTotalFromAmount || 0
16116
+ );
16117
+ if (transferOp && rFunWallet && rFunWalletAuth && funkitConfig?.apiKey) {
16118
+ const res = await getPaymasterDataForCheckoutSponsoredTransfer({
16119
+ depositAddress,
16120
+ transferUserOp: transferOp.userOp,
16121
+ apiKey: funkitConfig.apiKey
16122
+ });
16123
+ console.log(">res", res);
16124
+ transferOp.userOp.paymasterAndData = res.paymasterAndData;
16125
+ console.log(">transferOp.userOp", transferOp.userOp);
16126
+ const signedOp = await rFunWallet.signOperation(
16127
+ rFunWalletAuth,
16128
+ transferOp
16053
16129
  );
16054
- if (transferOp) {
16055
- await funWallet.executeOperation(funWalletAuth, transferOp);
16056
- } else {
16057
- }
16130
+ const executionRes = await rFunWallet.executeOperation(
16131
+ rFunWalletAuth,
16132
+ signedOp
16133
+ );
16134
+ console.log("Execution result", executionRes);
16135
+ } else {
16136
+ throw new Error("Did not initiate transfer due to missing fields");
16058
16137
  }
16059
16138
  },
16060
16139
  [
16061
16140
  checkoutItem?.latestQuote?.estTotalFromAmount,
16062
- checkoutItem?.selectedSourceAssetInfo?.symbol,
16063
- funWallet,
16064
- funWalletAuth
16141
+ funkitConfig?.apiKey,
16142
+ generateCheckoutTransferOpItems
16065
16143
  ]
16066
16144
  );
16067
- const handlePostCheckout = useCallback4(
16145
+ const handlePostCheckout = useCallback5(
16068
16146
  async (depositAddress, confirmedPaymentMethod) => {
16069
16147
  try {
16070
16148
  setIsPostCheckoutLoading(true);
@@ -16074,7 +16152,7 @@ function FunCheckoutConfirmationStep({
16074
16152
  case "brokerage" /* BROKERAGE */: {
16075
16153
  const { previewId, previewExpiresIn } = await handleMeshPostCheckout(depositAddress);
16076
16154
  meshPreviewId = previewId;
16077
- meshPreviewExpirationTimestamp = previewExpiresIn + Date.now() / 1e3;
16155
+ meshPreviewExpirationTimestamp = previewExpiresIn + Math.floor(Date.now() / 1e3);
16078
16156
  break;
16079
16157
  }
16080
16158
  case "balance" /* ACCOUNT_BALANCE */:
@@ -16101,7 +16179,7 @@ function FunCheckoutConfirmationStep({
16101
16179
  },
16102
16180
  [handleAccountBalancePostCheckout, handleMeshPostCheckout, onFinish]
16103
16181
  );
16104
- const onClickConfirm = useCallback4(async () => {
16182
+ const onClickConfirm = useCallback5(async () => {
16105
16183
  if (!selectedPaymentMethodInfo) {
16106
16184
  return;
16107
16185
  }
@@ -16182,19 +16260,56 @@ function roundUpTo5DecimalPlaces(inputNumber) {
16182
16260
  return roundedNumber.toString();
16183
16261
  }
16184
16262
 
16263
+ // src/components/FunkitProvider/FunToastContext.tsx
16264
+ import React44, { createContext as createContext11, useCallback as useCallback6, useContext as useContext9, useState as useState11 } from "react";
16265
+ var FunToastContext = createContext11({
16266
+ toastContent: null,
16267
+ showToast: () => void 0,
16268
+ hideToast: () => void 0,
16269
+ closing: false
16270
+ });
16271
+ function useFunToast() {
16272
+ return useContext9(FunToastContext);
16273
+ }
16274
+ function FunToastProvider({ children }) {
16275
+ const [toastContent, setToastContent] = useState11(null);
16276
+ const [closing, setClosing] = useState11(false);
16277
+ const showToast = useCallback6(
16278
+ (newToastContent, displayTimeMs = 0) => {
16279
+ setClosing(false);
16280
+ setToastContent({ ...newToastContent });
16281
+ if (displayTimeMs) {
16282
+ setTimeout(() => {
16283
+ setClosing(true);
16284
+ setTimeout(() => {
16285
+ setToastContent(null);
16286
+ }, 150);
16287
+ }, displayTimeMs);
16288
+ }
16289
+ },
16290
+ []
16291
+ );
16292
+ const hideToast = useCallback6(() => {
16293
+ setToastContent(null);
16294
+ }, []);
16295
+ return /* @__PURE__ */ React44.createElement(FunToastContext.Provider, {
16296
+ value: { toastContent, showToast, hideToast, closing }
16297
+ }, children);
16298
+ }
16299
+
16185
16300
  // src/components/FunMeshTwoFactorStep/FunMeshTwoFactorStep.tsx
16186
- import React46, { useCallback as useCallback6, useEffect as useEffect13, useState as useState11 } from "react";
16301
+ import React47, { useCallback as useCallback8, useEffect as useEffect13, useState as useState12 } from "react";
16187
16302
 
16188
16303
  // src/components/TwoFaInputField/FunTwoFaInput.tsx
16189
- import React45, {
16304
+ import React46, {
16190
16305
  Fragment as Fragment2,
16191
- useCallback as useCallback5,
16306
+ useCallback as useCallback7,
16192
16307
  useEffect as useEffect12,
16193
16308
  useRef as useRef4
16194
16309
  } from "react";
16195
16310
 
16196
16311
  // src/components/FunInput/FunInput.tsx
16197
- import React44, { forwardRef as forwardRef2 } from "react";
16312
+ import React45, { forwardRef as forwardRef2 } from "react";
16198
16313
  function FunInputDefault({
16199
16314
  prefix,
16200
16315
  placeholder,
@@ -16215,16 +16330,16 @@ function FunInputDefault({
16215
16330
  focused,
16216
16331
  inputClass = "inputClass"
16217
16332
  }) {
16218
- return /* @__PURE__ */ React44.createElement(Box, {
16333
+ return /* @__PURE__ */ React45.createElement(Box, {
16219
16334
  color: "modalText",
16220
16335
  display: "flex",
16221
16336
  flexDirection: "column",
16222
16337
  gap: "8"
16223
- }, label && /* @__PURE__ */ React44.createElement(Text, {
16338
+ }, label && /* @__PURE__ */ React45.createElement(Text, {
16224
16339
  color: textColor,
16225
16340
  size: "14",
16226
16341
  weight: "medium"
16227
- }, label), /* @__PURE__ */ React44.createElement(Box, {
16342
+ }, label), /* @__PURE__ */ React45.createElement(Box, {
16228
16343
  background: hasBackground ? "actionButtonSecondaryBackground" : void 0,
16229
16344
  borderRadius: "menuButton",
16230
16345
  fontFamily: "body",
@@ -16235,10 +16350,10 @@ function FunInputDefault({
16235
16350
  borderColor: error ? "error" : focused ? "accentColor" : void 0,
16236
16351
  borderWidth: error && focused ? "2" : error ? "1" : focused ? "1" : "0",
16237
16352
  borderStyle: "solid"
16238
- }, prefix ? /* @__PURE__ */ React44.createElement(Box, {
16353
+ }, prefix ? /* @__PURE__ */ React45.createElement(Box, {
16239
16354
  paddingLeft: "10",
16240
16355
  height: "max"
16241
- }, prefix) : null, /* @__PURE__ */ React44.createElement("input", {
16356
+ }, prefix) : null, /* @__PURE__ */ React45.createElement("input", {
16242
16357
  type: inputProps?.type || "text",
16243
16358
  value,
16244
16359
  placeholder,
@@ -16286,16 +16401,16 @@ var FunInputWithRef = forwardRef2(
16286
16401
  focused,
16287
16402
  inputClass = "inputClass"
16288
16403
  }, ref) {
16289
- return /* @__PURE__ */ React44.createElement(Box, {
16404
+ return /* @__PURE__ */ React45.createElement(Box, {
16290
16405
  color: "modalText",
16291
16406
  display: "flex",
16292
16407
  flexDirection: "column",
16293
16408
  gap: "8"
16294
- }, label && /* @__PURE__ */ React44.createElement(Text, {
16409
+ }, label && /* @__PURE__ */ React45.createElement(Text, {
16295
16410
  color: textColor,
16296
16411
  size: "14",
16297
16412
  weight: "medium"
16298
- }, label), /* @__PURE__ */ React44.createElement(Box, {
16413
+ }, label), /* @__PURE__ */ React45.createElement(Box, {
16299
16414
  background: hasBackground ? "actionButtonSecondaryBackground" : void 0,
16300
16415
  borderRadius: "menuButton",
16301
16416
  fontFamily: "body",
@@ -16305,10 +16420,10 @@ var FunInputWithRef = forwardRef2(
16305
16420
  borderColor: error ? "error" : focused ? "accentColor" : void 0,
16306
16421
  borderWidth: error && focused ? "2" : error ? "1" : focused ? "1" : "0",
16307
16422
  borderStyle: "solid"
16308
- }, prefix ? /* @__PURE__ */ React44.createElement(Box, {
16423
+ }, prefix ? /* @__PURE__ */ React45.createElement(Box, {
16309
16424
  paddingLeft: "10",
16310
16425
  height: "max"
16311
- }, prefix) : null, /* @__PURE__ */ React44.createElement("input", {
16426
+ }, prefix) : null, /* @__PURE__ */ React45.createElement("input", {
16312
16427
  ref,
16313
16428
  type: inputProps?.type || "text",
16314
16429
  value,
@@ -16338,9 +16453,9 @@ var FunInputWithRef = forwardRef2(
16338
16453
  }
16339
16454
  );
16340
16455
  function FunInput(props) {
16341
- return props.ref ? /* @__PURE__ */ React44.createElement(FunInputWithRef, {
16456
+ return props.ref ? /* @__PURE__ */ React45.createElement(FunInputWithRef, {
16342
16457
  ...props
16343
- }) : /* @__PURE__ */ React44.createElement(FunInputDefault, {
16458
+ }) : /* @__PURE__ */ React45.createElement(FunInputDefault, {
16344
16459
  ...props
16345
16460
  });
16346
16461
  }
@@ -16356,8 +16471,8 @@ var FunTwoFaInput = ({
16356
16471
  const inputLength = 6;
16357
16472
  const inputRefs = useRef4([]);
16358
16473
  inputRefs.current = Array(inputLength).fill(null);
16359
- const [focusIndex, setFocusIndex] = React45.useState(0);
16360
- const handleBackspace = useCallback5(
16474
+ const [focusIndex, setFocusIndex] = React46.useState(0);
16475
+ const handleBackspace = useCallback7(
16361
16476
  (index) => {
16362
16477
  const newValue = value.slice(0, index) + value.slice(index + 1);
16363
16478
  if (index > 0 && inputRefs.current[index - 1]) {
@@ -16370,7 +16485,7 @@ var FunTwoFaInput = ({
16370
16485
  },
16371
16486
  [onChange, value]
16372
16487
  );
16373
- const handleChange = useCallback5(
16488
+ const handleChange = useCallback7(
16374
16489
  (changeEvent, index) => {
16375
16490
  const trimmedInput = changeEvent.nativeEvent.data;
16376
16491
  if (!/^\d*$/.test(trimmedInput) && trimmedInput !== "")
@@ -16412,21 +16527,21 @@ var FunTwoFaInput = ({
16412
16527
  useEffect12(() => {
16413
16528
  inputRefs.current[0]?.focus();
16414
16529
  }, []);
16415
- return /* @__PURE__ */ React45.createElement(Fragment2, null, /* @__PURE__ */ React45.createElement(Box, null, /* @__PURE__ */ React45.createElement(Box, {
16530
+ return /* @__PURE__ */ React46.createElement(Fragment2, null, /* @__PURE__ */ React46.createElement(Box, null, /* @__PURE__ */ React46.createElement(Box, {
16416
16531
  marginBottom: "10"
16417
- }, /* @__PURE__ */ React45.createElement(Text, {
16532
+ }, /* @__PURE__ */ React46.createElement(Text, {
16418
16533
  size: "14",
16419
16534
  color: "modalText"
16420
- }, "Code")), /* @__PURE__ */ React45.createElement(Box, {
16535
+ }, "Code")), /* @__PURE__ */ React46.createElement(Box, {
16421
16536
  display: "flex",
16422
16537
  wrap: "nowrap",
16423
16538
  width: "full",
16424
16539
  gap: "8"
16425
16540
  }, Array.from({ length: inputLength }).map((_, i) => {
16426
- return /* @__PURE__ */ React45.createElement(Box, {
16541
+ return /* @__PURE__ */ React46.createElement(Box, {
16427
16542
  key: i,
16428
16543
  style: { display: "flex", flex: 1 }
16429
- }, /* @__PURE__ */ React45.createElement(FunInputWithRef, {
16544
+ }, /* @__PURE__ */ React46.createElement(FunInputWithRef, {
16430
16545
  ref: (el) => inputRefs.current[i] = el,
16431
16546
  inputStyle: {
16432
16547
  textAlign: "center"
@@ -16451,10 +16566,10 @@ var FunTwoFaInput = ({
16451
16566
  error: hasError,
16452
16567
  focused: i === focusIndex
16453
16568
  }));
16454
- })), /* @__PURE__ */ React45.createElement(Box, {
16569
+ })), /* @__PURE__ */ React46.createElement(Box, {
16455
16570
  marginTop: "6",
16456
16571
  height: "20"
16457
- }, hasError && /* @__PURE__ */ React45.createElement(Text, {
16572
+ }, hasError && /* @__PURE__ */ React46.createElement(Text, {
16458
16573
  size: "14",
16459
16574
  color: "error",
16460
16575
  weight: "medium"
@@ -16468,13 +16583,13 @@ function FunMeshTwoFactorStep({
16468
16583
  onSuccess,
16469
16584
  paymentMethodInfo
16470
16585
  }) {
16471
- const [twoFactorCode, setTwoFactorCode] = useState11("");
16472
- const [twoFactorError, setTwoFactorError] = useState11("");
16473
- const [isVerifying, setIsVerifying] = useState11(false);
16586
+ const [twoFactorCode, setTwoFactorCode] = useState12("");
16587
+ const [twoFactorError, setTwoFactorError] = useState12("");
16588
+ const [isVerifying, setIsVerifying] = useState12(false);
16474
16589
  const funkitConfig = useFunkitConfig();
16475
16590
  const exchange = paymentMethodInfo?.meta?.accessToken?.brokerName;
16476
16591
  const accessToken = paymentMethodInfo?.meta?.accessToken?.accountTokens?.[0].accessToken;
16477
- const handleCompletion = useCallback6(async () => {
16592
+ const handleCompletion = useCallback8(async () => {
16478
16593
  try {
16479
16594
  setIsVerifying(true);
16480
16595
  if (twoFactorError)
@@ -16529,19 +16644,19 @@ function FunMeshTwoFactorStep({
16529
16644
  handleCompletion();
16530
16645
  }
16531
16646
  }, [twoFactorCode, twoFactorError, handleCompletion]);
16532
- return /* @__PURE__ */ React46.createElement(Box, null, /* @__PURE__ */ React46.createElement(Box, {
16647
+ return /* @__PURE__ */ React47.createElement(Box, null, /* @__PURE__ */ React47.createElement(Box, {
16533
16648
  marginY: "24"
16534
- }, /* @__PURE__ */ React46.createElement(Box, {
16649
+ }, /* @__PURE__ */ React47.createElement(Box, {
16535
16650
  marginBottom: "10"
16536
- }, /* @__PURE__ */ React46.createElement(Text, {
16651
+ }, /* @__PURE__ */ React47.createElement(Text, {
16537
16652
  size: "16",
16538
16653
  color: "modalText",
16539
16654
  weight: "heavy"
16540
- }, "Two factor required")), /* @__PURE__ */ React46.createElement(Text, {
16655
+ }, "Two factor required")), /* @__PURE__ */ React47.createElement(Text, {
16541
16656
  size: "14",
16542
16657
  color: "modalText",
16543
16658
  font: "body"
16544
- }, "You should have received a two factor code from your ", exchange, " app. Please enter the code to confirm your transaction.")), /* @__PURE__ */ React46.createElement(FunTwoFaInput, {
16659
+ }, "You should have received a two factor code from your ", exchange, " app. Please enter the code to confirm your transaction.")), /* @__PURE__ */ React47.createElement(FunTwoFaInput, {
16545
16660
  value: twoFactorCode,
16546
16661
  onChange: (value) => {
16547
16662
  setTwoFactorError("");
@@ -16550,16 +16665,16 @@ function FunMeshTwoFactorStep({
16550
16665
  onCompleted: handleCompletion,
16551
16666
  hasError: !!twoFactorError,
16552
16667
  errorMessage: twoFactorError
16553
- }), /* @__PURE__ */ React46.createElement(Box, {
16668
+ }), /* @__PURE__ */ React47.createElement(Box, {
16554
16669
  width: "full",
16555
16670
  paddingY: "24"
16556
- }, /* @__PURE__ */ React46.createElement(FunButton, {
16671
+ }, /* @__PURE__ */ React47.createElement(FunButton, {
16557
16672
  isDisabled: isVerifying || !!twoFactorError || twoFactorCode.length < 6,
16558
- titleSuffix: isVerifying ? /* @__PURE__ */ React46.createElement(Box, {
16673
+ titleSuffix: isVerifying ? /* @__PURE__ */ React47.createElement(Box, {
16559
16674
  display: "flex",
16560
16675
  alignItems: "center",
16561
16676
  color: "modalText"
16562
- }, /* @__PURE__ */ React46.createElement(SpinnerIcon, {
16677
+ }, /* @__PURE__ */ React47.createElement(SpinnerIcon, {
16563
16678
  height: 16,
16564
16679
  width: 16
16565
16680
  })) : null,
@@ -16569,21 +16684,21 @@ function FunMeshTwoFactorStep({
16569
16684
  }
16570
16685
 
16571
16686
  // src/components/FunModalTitleSection/FunModalTitleSection.tsx
16572
- import React51, { useMemo as useMemo8 } from "react";
16687
+ import React52, { useMemo as useMemo8 } from "react";
16573
16688
 
16574
16689
  // src/components/CloseButton/CloseButton.tsx
16575
- import React48 from "react";
16690
+ import React49 from "react";
16576
16691
 
16577
16692
  // src/components/Icons/Close.tsx
16578
- import React47 from "react";
16693
+ import React48 from "react";
16579
16694
  var CloseIcon = () => {
16580
- return /* @__PURE__ */ React47.createElement("svg", {
16695
+ return /* @__PURE__ */ React48.createElement("svg", {
16581
16696
  width: "16",
16582
16697
  height: "15",
16583
16698
  viewBox: "0 0 16 15",
16584
16699
  fill: "none",
16585
16700
  xmlns: "http://www.w3.org/2000/svg"
16586
- }, /* @__PURE__ */ React47.createElement("path", {
16701
+ }, /* @__PURE__ */ React48.createElement("path", {
16587
16702
  d: "M3.30542 12.1036C3.72144 12.5137 4.44214 12.4962 4.823 12.1153L7.95777 8.98053L11.0808 12.1094C11.4851 12.5137 12.1824 12.5137 12.5925 12.0977C13.0085 11.6817 13.0144 10.9844 12.6101 10.5801L9.48706 7.45123L12.6101 4.32819C13.0144 3.92389 13.0085 3.22663 12.5925 2.81647C12.1765 2.40045 11.4851 2.39459 11.0808 2.79889L7.95777 5.92194L4.823 2.79303C4.44214 2.41217 3.72144 2.39459 3.30542 2.81061C2.89527 3.22663 2.90699 3.94147 3.29371 4.32233L6.42847 7.45123L3.29371 10.586C2.90699 10.9669 2.88941 11.6876 3.30542 12.1036Z",
16588
16703
  fill: "currentColor"
16589
16704
  }));
@@ -16595,7 +16710,7 @@ var CloseButton = ({
16595
16710
  onClose
16596
16711
  }) => {
16597
16712
  const mobile = isMobile();
16598
- return /* @__PURE__ */ React48.createElement(Box, {
16713
+ return /* @__PURE__ */ React49.createElement(Box, {
16599
16714
  alignItems: "center",
16600
16715
  "aria-label": ariaLabel,
16601
16716
  as: "button",
@@ -16617,29 +16732,29 @@ var CloseButton = ({
16617
16732
  style: { willChange: "transform" },
16618
16733
  transition: "default",
16619
16734
  type: "button"
16620
- }, /* @__PURE__ */ React48.createElement(CloseIcon, null));
16735
+ }, /* @__PURE__ */ React49.createElement(CloseIcon, null));
16621
16736
  };
16622
16737
 
16623
16738
  // src/components/FunButton/FunBackButton.tsx
16624
- import React50 from "react";
16739
+ import React51 from "react";
16625
16740
 
16626
16741
  // src/components/Icons/FunBackIcon.tsx
16627
- import React49 from "react";
16742
+ import React50 from "react";
16628
16743
  var FunBackIcon = () => {
16629
- return /* @__PURE__ */ React49.createElement("svg", {
16744
+ return /* @__PURE__ */ React50.createElement("svg", {
16630
16745
  width: "11",
16631
16746
  height: "11",
16632
16747
  viewBox: "0 0 11 11",
16633
16748
  fill: "none",
16634
16749
  xmlns: "http://www.w3.org/2000/svg"
16635
- }, /* @__PURE__ */ React49.createElement("g", {
16750
+ }, /* @__PURE__ */ React50.createElement("g", {
16636
16751
  clipPath: "url(#clip0_1147_6600)"
16637
- }, /* @__PURE__ */ React49.createElement("path", {
16752
+ }, /* @__PURE__ */ React50.createElement("path", {
16638
16753
  d: "M2.97379 6.16578L5.91982 9.37734C6.1579 9.65799 6.1234 10.0785 5.84275 10.3166C5.56211 10.5547 5.14158 10.5202 4.9035 10.2395L0.985839 5.96877C0.929505 5.91217 0.883855 5.84586 0.851087 5.77304C0.810339 5.68251 0.790374 5.58401 0.792656 5.48476L0.792666 5.48415C0.794934 5.38512 0.819194 5.28783 0.863688 5.19933C0.868015 5.19076 0.872526 5.18229 0.877218 5.17391C0.904371 5.12533 0.937553 5.08037 0.975975 5.04011L4.9978 0.700942C5.24798 0.431015 5.66961 0.415021 5.93953 0.6652C6.20944 0.91538 6.22544 1.33702 5.97527 1.60694L2.98514 4.833H10.1261C10.4941 4.833 10.7925 5.13136 10.7925 5.4994C10.7925 5.86744 10.4941 6.16579 10.1261 6.16579H2.97379V6.16578Z",
16639
16754
  fill: "currentColor"
16640
- })), /* @__PURE__ */ React49.createElement("defs", null, /* @__PURE__ */ React49.createElement("clipPath", {
16755
+ })), /* @__PURE__ */ React50.createElement("defs", null, /* @__PURE__ */ React50.createElement("clipPath", {
16641
16756
  id: "clip0_1147_6600"
16642
- }, /* @__PURE__ */ React49.createElement("rect", {
16757
+ }, /* @__PURE__ */ React50.createElement("rect", {
16643
16758
  width: "10",
16644
16759
  height: "10",
16645
16760
  fill: "currentColor",
@@ -16650,7 +16765,7 @@ var FunBackIcon = () => {
16650
16765
  // src/components/FunButton/FunBackButton.tsx
16651
16766
  var FunBackButton = ({ onBack }) => {
16652
16767
  const mobile = isMobile();
16653
- return /* @__PURE__ */ React50.createElement(Box, {
16768
+ return /* @__PURE__ */ React51.createElement(Box, {
16654
16769
  alignItems: "center",
16655
16770
  as: "button",
16656
16771
  background: "modalBackground",
@@ -16671,7 +16786,7 @@ var FunBackButton = ({ onBack }) => {
16671
16786
  style: { willChange: "transform" },
16672
16787
  transition: "default",
16673
16788
  type: "button"
16674
- }, /* @__PURE__ */ React50.createElement(FunBackIcon, null));
16789
+ }, /* @__PURE__ */ React51.createElement(FunBackIcon, null));
16675
16790
  };
16676
16791
 
16677
16792
  // src/components/FunModalTitleSection/FunModalTitleSection.css.ts
@@ -16689,7 +16804,7 @@ function FunModalTitleSection({
16689
16804
  skipBackDelay = false,
16690
16805
  customJustifyContentStyle = void 0
16691
16806
  }) {
16692
- const [animateOut, setAnimateOut] = React51.useState(false);
16807
+ const [animateOut, setAnimateOut] = React52.useState(false);
16693
16808
  const justifyContentStyle = useMemo8(() => {
16694
16809
  let contentStyle = "space-between";
16695
16810
  let addFakeBackButtonSpacer = false;
@@ -16710,12 +16825,12 @@ function FunModalTitleSection({
16710
16825
  return { contentStyle, addFakeBackButtonSpacer };
16711
16826
  }
16712
16827
  }, [customJustifyContentStyle, title, hasCloseButton, hasBackButton]);
16713
- return /* @__PURE__ */ React51.createElement(Box, {
16828
+ return /* @__PURE__ */ React52.createElement(Box, {
16714
16829
  display: "flex",
16715
16830
  alignItems: "center",
16716
16831
  justifyContent: justifyContentStyle?.contentStyle,
16717
16832
  width: "full"
16718
- }, hasBackButton ? /* @__PURE__ */ React51.createElement(Box, null, /* @__PURE__ */ React51.createElement(FunBackButton, {
16833
+ }, hasBackButton ? /* @__PURE__ */ React52.createElement(Box, null, /* @__PURE__ */ React52.createElement(FunBackButton, {
16719
16834
  onBack: () => {
16720
16835
  if (backAnimation) {
16721
16836
  setAnimateOut(true);
@@ -16730,75 +16845,75 @@ function FunModalTitleSection({
16730
16845
  onBack();
16731
16846
  setAnimateOut(false);
16732
16847
  }
16733
- })) : null, justifyContentStyle?.addFakeBackButtonSpacer && /* @__PURE__ */ React51.createElement(Box, {
16848
+ })) : null, justifyContentStyle?.addFakeBackButtonSpacer && /* @__PURE__ */ React52.createElement(Box, {
16734
16849
  width: "20",
16735
16850
  height: "20"
16736
- }), /* @__PURE__ */ React51.createElement(Text, {
16851
+ }), /* @__PURE__ */ React52.createElement(Text, {
16737
16852
  as: "h1",
16738
16853
  color: "modalText",
16739
16854
  size: "18",
16740
16855
  weight: "bold",
16741
16856
  testId: "fun-modal-title-section",
16742
16857
  className: animateOut ? animateTitleOutClass : animateTitleInClass
16743
- }, title), hasCloseButton ? /* @__PURE__ */ React51.createElement(Box, null, /* @__PURE__ */ React51.createElement(CloseButton, {
16858
+ }, title), hasCloseButton ? /* @__PURE__ */ React52.createElement(Box, null, /* @__PURE__ */ React52.createElement(CloseButton, {
16744
16859
  onClose
16745
16860
  })) : null);
16746
16861
  }
16747
16862
 
16748
16863
  // src/components/FunOnramp/FunOnrampConfirmationStep.tsx
16749
- import React54, { useEffect as useEffect14, useMemo as useMemo9 } from "react";
16864
+ import React55, { useEffect as useEffect14, useMemo as useMemo9 } from "react";
16750
16865
 
16751
16866
  // src/components/FunOnramp/FunOnrampPrimaryItem.tsx
16752
- import React53 from "react";
16867
+ import React54 from "react";
16753
16868
 
16754
16869
  // src/components/Icons/EthereumIcon.tsx
16755
- import React52 from "react";
16870
+ import React53 from "react";
16756
16871
  var EthereumIcon = () => {
16757
- return /* @__PURE__ */ React52.createElement("svg", {
16872
+ return /* @__PURE__ */ React53.createElement("svg", {
16758
16873
  xmlns: "http://www.w3.org/2000/svg",
16759
16874
  width: "28",
16760
16875
  height: "28",
16761
16876
  fill: "none"
16762
- }, /* @__PURE__ */ React52.createElement("path", {
16877
+ }, /* @__PURE__ */ React53.createElement("path", {
16763
16878
  fill: "#25292E",
16764
16879
  fillRule: "evenodd",
16765
16880
  d: "M14 28a14 14 0 1 0 0-28 14 14 0 0 0 0 28Z",
16766
16881
  clipRule: "evenodd"
16767
- }), /* @__PURE__ */ React52.createElement("path", {
16882
+ }), /* @__PURE__ */ React53.createElement("path", {
16768
16883
  fill: "url(#a)",
16769
16884
  fillOpacity: ".3",
16770
16885
  fillRule: "evenodd",
16771
16886
  d: "M14 28a14 14 0 1 0 0-28 14 14 0 0 0 0 28Z",
16772
16887
  clipRule: "evenodd"
16773
- }), /* @__PURE__ */ React52.createElement("path", {
16888
+ }), /* @__PURE__ */ React53.createElement("path", {
16774
16889
  fill: "url(#b)",
16775
16890
  d: "M8.19 14.77 14 18.21l5.8-3.44-5.8 8.19-5.81-8.19Z"
16776
- }), /* @__PURE__ */ React52.createElement("path", {
16891
+ }), /* @__PURE__ */ React53.createElement("path", {
16777
16892
  fill: "#fff",
16778
16893
  d: "m14 16.93-5.81-3.44L14 4.34l5.81 9.15L14 16.93Z"
16779
- }), /* @__PURE__ */ React52.createElement("defs", null, /* @__PURE__ */ React52.createElement("linearGradient", {
16894
+ }), /* @__PURE__ */ React53.createElement("defs", null, /* @__PURE__ */ React53.createElement("linearGradient", {
16780
16895
  id: "a",
16781
16896
  x1: "0",
16782
16897
  x2: "14",
16783
16898
  y1: "0",
16784
16899
  y2: "28",
16785
16900
  gradientUnits: "userSpaceOnUse"
16786
- }, /* @__PURE__ */ React52.createElement("stop", {
16901
+ }, /* @__PURE__ */ React53.createElement("stop", {
16787
16902
  stopColor: "#fff"
16788
- }), /* @__PURE__ */ React52.createElement("stop", {
16903
+ }), /* @__PURE__ */ React53.createElement("stop", {
16789
16904
  offset: "1",
16790
16905
  stopColor: "#fff",
16791
16906
  stopOpacity: "0"
16792
- })), /* @__PURE__ */ React52.createElement("linearGradient", {
16907
+ })), /* @__PURE__ */ React53.createElement("linearGradient", {
16793
16908
  id: "b",
16794
16909
  x1: "14",
16795
16910
  x2: "14",
16796
16911
  y1: "14.77",
16797
16912
  y2: "22.96",
16798
16913
  gradientUnits: "userSpaceOnUse"
16799
- }, /* @__PURE__ */ React52.createElement("stop", {
16914
+ }, /* @__PURE__ */ React53.createElement("stop", {
16800
16915
  stopColor: "#fff"
16801
- }), /* @__PURE__ */ React52.createElement("stop", {
16916
+ }), /* @__PURE__ */ React53.createElement("stop", {
16802
16917
  offset: "1",
16803
16918
  stopColor: "#fff",
16804
16919
  stopOpacity: ".9"
@@ -16808,11 +16923,11 @@ var EthereumIcon = () => {
16808
16923
  // src/components/FunOnramp/FunOnrampPrimaryItem.tsx
16809
16924
  var TOKEN_MAP = {
16810
16925
  usdc: {
16811
- icon: /* @__PURE__ */ React53.createElement(USDCIcon, null),
16926
+ icon: /* @__PURE__ */ React54.createElement(USDCIcon, null),
16812
16927
  name: "USDC"
16813
16928
  },
16814
16929
  eth: {
16815
- icon: /* @__PURE__ */ React53.createElement(EthereumIcon, null),
16930
+ icon: /* @__PURE__ */ React54.createElement(EthereumIcon, null),
16816
16931
  name: "ETH"
16817
16932
  }
16818
16933
  };
@@ -16820,11 +16935,11 @@ function FunOnrampPrimaryItem({
16820
16935
  token,
16821
16936
  tokenAmountUsd
16822
16937
  }) {
16823
- return /* @__PURE__ */ React53.createElement(Box, {
16938
+ return /* @__PURE__ */ React54.createElement(Box, {
16824
16939
  display: "flex",
16825
16940
  flexDirection: "column",
16826
16941
  alignItems: "center"
16827
- }, /* @__PURE__ */ React53.createElement(Box, {
16942
+ }, /* @__PURE__ */ React54.createElement(Box, {
16828
16943
  display: "flex",
16829
16944
  justifyContent: "center",
16830
16945
  alignItems: "center",
@@ -16832,22 +16947,22 @@ function FunOnrampPrimaryItem({
16832
16947
  borderRadius: "16",
16833
16948
  paddingX: "12",
16834
16949
  paddingY: "10"
16835
- }, /* @__PURE__ */ React53.createElement(Box, {
16950
+ }, /* @__PURE__ */ React54.createElement(Box, {
16836
16951
  display: "flex",
16837
16952
  justifyContent: "center",
16838
16953
  alignItems: "center",
16839
16954
  gap: "10"
16840
- }, /* @__PURE__ */ React53.createElement(Box, {
16955
+ }, /* @__PURE__ */ React54.createElement(Box, {
16841
16956
  display: "flex",
16842
16957
  alignItems: "center"
16843
- }, TOKEN_MAP[token.toLowerCase()]?.icon), /* @__PURE__ */ React53.createElement(Box, null, /* @__PURE__ */ React53.createElement(Text, {
16958
+ }, TOKEN_MAP[token.toLowerCase()]?.icon), /* @__PURE__ */ React54.createElement(Box, null, /* @__PURE__ */ React54.createElement(Text, {
16844
16959
  color: "modalText",
16845
16960
  size: "14",
16846
16961
  weight: "medium"
16847
- }, TOKEN_MAP[token.toLowerCase()]?.name)))), /* @__PURE__ */ React53.createElement(Box, {
16962
+ }, TOKEN_MAP[token.toLowerCase()]?.name)))), /* @__PURE__ */ React54.createElement(Box, {
16848
16963
  display: "flex",
16849
16964
  paddingY: "8"
16850
- }, /* @__PURE__ */ React53.createElement(Text, {
16965
+ }, /* @__PURE__ */ React54.createElement(Text, {
16851
16966
  as: "h1",
16852
16967
  weight: "heavy",
16853
16968
  color: "modalText",
@@ -16874,48 +16989,48 @@ function FunOnrampConfirmationStep({
16874
16989
  onInitialization();
16875
16990
  }, []);
16876
16991
  const hasError = useMemo9(() => estimationError !== "", [estimationError]);
16877
- return /* @__PURE__ */ React54.createElement(Box, null, /* @__PURE__ */ React54.createElement(Box, {
16992
+ return /* @__PURE__ */ React55.createElement(Box, null, /* @__PURE__ */ React55.createElement(Box, {
16878
16993
  paddingBottom: "30"
16879
- }, /* @__PURE__ */ React54.createElement(FunOnrampPrimaryItem, {
16994
+ }, /* @__PURE__ */ React55.createElement(FunOnrampPrimaryItem, {
16880
16995
  token,
16881
16996
  tokenAmountUsd
16882
- })), /* @__PURE__ */ React54.createElement(Box, {
16997
+ })), /* @__PURE__ */ React55.createElement(Box, {
16883
16998
  paddingBottom: "24"
16884
- }, /* @__PURE__ */ React54.createElement(ExistingPaymentMethodItem, {
16999
+ }, /* @__PURE__ */ React55.createElement(ExistingPaymentMethodItem, {
16885
17000
  isClickable: false,
16886
17001
  paymentMethodInfo
16887
- })), /* @__PURE__ */ React54.createElement(Box, {
17002
+ })), /* @__PURE__ */ React55.createElement(Box, {
16888
17003
  paddingBottom: "24"
16889
- }, /* @__PURE__ */ React54.createElement(FunTransactionSummary, {
17004
+ }, /* @__PURE__ */ React55.createElement(FunTransactionSummary, {
16890
17005
  estFees: estimatedFees,
16891
17006
  estTime: estimatedProcessingTime,
16892
17007
  hasTotal: true,
16893
17008
  total: totalAmountUsd,
16894
17009
  isLoading: isFetchingEstimatedFees,
16895
17010
  errorMessage: estimationError
16896
- })), /* @__PURE__ */ React54.createElement(Box, {
17011
+ })), /* @__PURE__ */ React55.createElement(Box, {
16897
17012
  display: "flex",
16898
17013
  flexDirection: "column",
16899
17014
  gap: "4"
16900
- }, /* @__PURE__ */ React54.createElement(FunButton, {
17015
+ }, /* @__PURE__ */ React55.createElement(FunButton, {
16901
17016
  title: "Confirm Order",
16902
17017
  type: "primary",
16903
17018
  titleWeight: "semibold",
16904
17019
  onClick: onConfirm,
16905
17020
  isDisabled: isFetchingEstimatedFees || isConfirming || hasError,
16906
- titleSuffix: isConfirming ? /* @__PURE__ */ React54.createElement(Box, {
17021
+ titleSuffix: isConfirming ? /* @__PURE__ */ React55.createElement(Box, {
16907
17022
  display: "flex",
16908
17023
  alignItems: "center",
16909
17024
  color: "modalText"
16910
- }, /* @__PURE__ */ React54.createElement(SpinnerIcon, {
17025
+ }, /* @__PURE__ */ React55.createElement(SpinnerIcon, {
16911
17026
  height: 16,
16912
17027
  width: 16
16913
17028
  })) : null
16914
- }), /* @__PURE__ */ React54.createElement(FunTermsAndConditionsTextButton, null)));
17029
+ }), /* @__PURE__ */ React55.createElement(FunTermsAndConditionsTextButton, null)));
16915
17030
  }
16916
17031
 
16917
17032
  // src/components/FunOnramp/FunOnrampInputStep.tsx
16918
- import React55 from "react";
17033
+ import React56 from "react";
16919
17034
 
16920
17035
  // src/components/FunOnramp/FunOnramp.css.ts
16921
17036
  var animateContentInClass2 = "FunOnramp_animateContentInClass__ryaofh2";
@@ -16931,18 +17046,18 @@ function FunOnrampInputStep({
16931
17046
  backAnimation = false
16932
17047
  }) {
16933
17048
  const theme = funTheme();
16934
- return /* @__PURE__ */ React55.createElement(Box, {
17049
+ return /* @__PURE__ */ React56.createElement(Box, {
16935
17050
  display: "flex",
16936
17051
  flexDirection: "column",
16937
17052
  alignItems: "center",
16938
17053
  justifyContent: "space-between",
16939
17054
  className: backAnimation ? animateContentOutClass2 : animateContentInClass2
16940
- }, /* @__PURE__ */ React55.createElement(Box, {
17055
+ }, /* @__PURE__ */ React56.createElement(Box, {
16941
17056
  display: "flex",
16942
17057
  flexDirection: "column",
16943
17058
  alignItems: "center",
16944
17059
  gap: "8"
16945
- }, /* @__PURE__ */ React55.createElement(Box, {
17060
+ }, /* @__PURE__ */ React56.createElement(Box, {
16946
17061
  display: "flex",
16947
17062
  alignItems: "center",
16948
17063
  gap: "8",
@@ -16950,24 +17065,24 @@ function FunOnrampInputStep({
16950
17065
  paddingX: "12",
16951
17066
  paddingY: "8",
16952
17067
  borderRadius: "16"
16953
- }, /* @__PURE__ */ React55.createElement(USDCIcon, null), /* @__PURE__ */ React55.createElement(Text, {
17068
+ }, /* @__PURE__ */ React56.createElement(USDCIcon, null), /* @__PURE__ */ React56.createElement(Text, {
16954
17069
  size: "14",
16955
17070
  color: "modalText"
16956
- }, tokenTicker)), /* @__PURE__ */ React55.createElement(Box, {
17071
+ }, tokenTicker)), /* @__PURE__ */ React56.createElement(Box, {
16957
17072
  display: "flex",
16958
17073
  justifyContent: "center",
16959
17074
  alignItems: "center",
16960
17075
  gap: "8",
16961
17076
  width: "full"
16962
- }, /* @__PURE__ */ React55.createElement(FunInput, {
17077
+ }, /* @__PURE__ */ React56.createElement(FunInput, {
16963
17078
  value: amount,
16964
17079
  placeholder: "0.00",
16965
17080
  onChange: (newAmount) => onChangeAmount(newAmount.target.value),
16966
- prefix: /* @__PURE__ */ React55.createElement(Box, {
17081
+ prefix: /* @__PURE__ */ React56.createElement(Box, {
16967
17082
  display: "flex",
16968
17083
  alignItems: "center",
16969
17084
  paddingLeft: "32"
16970
- }, /* @__PURE__ */ React55.createElement(Text, {
17085
+ }, /* @__PURE__ */ React56.createElement(Text, {
16971
17086
  color: "modalText",
16972
17087
  style: {
16973
17088
  paddingBottom: 2,
@@ -16989,7 +17104,7 @@ function FunOnrampInputStep({
16989
17104
  hasBackground: false,
16990
17105
  textColor: "modalText",
16991
17106
  inputClass: "inputClassWhite"
16992
- }))), /* @__PURE__ */ React55.createElement(FunButton, {
17107
+ }))), /* @__PURE__ */ React56.createElement(FunButton, {
16993
17108
  title: "Continue",
16994
17109
  isDisabled: (parseFloat(amount) || 0) <= 0,
16995
17110
  onClick: onClickContinue
@@ -16997,7 +17112,7 @@ function FunOnrampInputStep({
16997
17112
  }
16998
17113
 
16999
17114
  // src/components/FunOnramp/FunOnrampProcessingStep.tsx
17000
- import React58, { useEffect as useEffect15, useState as useState12 } from "react";
17115
+ import React59, { useEffect as useEffect15, useState as useState13 } from "react";
17001
17116
 
17002
17117
  // src/utils/formatTimestamp.ts
17003
17118
  var fullMonthNames = [
@@ -17059,18 +17174,18 @@ function formatTimestamp(date, shortened = false) {
17059
17174
  }
17060
17175
 
17061
17176
  // src/components/FunProgressBar/FunVerticalProgressBar.tsx
17062
- import React57 from "react";
17177
+ import React58, { Fragment as Fragment3 } from "react";
17063
17178
 
17064
17179
  // src/components/Icons/WhiteDotIcon.tsx
17065
- import React56 from "react";
17180
+ import React57 from "react";
17066
17181
  var WhiteDotIcon = () => {
17067
- return /* @__PURE__ */ React56.createElement("svg", {
17182
+ return /* @__PURE__ */ React57.createElement("svg", {
17068
17183
  width: "15",
17069
17184
  height: "15",
17070
17185
  viewBox: "0 0 15 15",
17071
17186
  fill: "none",
17072
17187
  xmlns: "http://www.w3.org/2000/svg"
17073
- }, /* @__PURE__ */ React56.createElement("rect", {
17188
+ }, /* @__PURE__ */ React57.createElement("rect", {
17074
17189
  width: "15",
17075
17190
  height: "15",
17076
17191
  rx: "4",
@@ -17079,7 +17194,7 @@ var WhiteDotIcon = () => {
17079
17194
  };
17080
17195
 
17081
17196
  // src/components/FunProgressBar/FunVerticalProgressBar.tsx
17082
- var ColoredLine = () => /* @__PURE__ */ React57.createElement(Box, {
17197
+ var ColoredLine = () => /* @__PURE__ */ React58.createElement(Box, {
17083
17198
  borderStyle: "dotted",
17084
17199
  borderColor: "solidLine",
17085
17200
  borderWidth: "2",
@@ -17088,6 +17203,22 @@ var ColoredLine = () => /* @__PURE__ */ React57.createElement(Box, {
17088
17203
  style: { borderLeft: "none" },
17089
17204
  flexDirection: "column"
17090
17205
  });
17206
+ var LabelContent = ({ labelItem }) => /* @__PURE__ */ React58.createElement(Fragment3, null, /* @__PURE__ */ React58.createElement(Box, null, /* @__PURE__ */ React58.createElement(Text, {
17207
+ as: "h1",
17208
+ weight: "semibold",
17209
+ color: "modalText",
17210
+ size: "12"
17211
+ }, labelItem.text)), /* @__PURE__ */ React58.createElement(Box, null, /* @__PURE__ */ React58.createElement(Text, {
17212
+ as: "h1",
17213
+ color: "modalText",
17214
+ weight: "regular",
17215
+ size: "10"
17216
+ }, labelItem.description)), labelItem.linkText && labelItem.linkUrl ? /* @__PURE__ */ React58.createElement(Box, null, /* @__PURE__ */ React58.createElement(FunLinkButton, {
17217
+ text: labelItem.linkText,
17218
+ onClick: () => window.open(labelItem.linkUrl, "_blank"),
17219
+ hasPadding: false,
17220
+ textProps: { size: "10", weight: "regular" }
17221
+ })) : null);
17091
17222
  function FunVerticalProgressBar({
17092
17223
  step,
17093
17224
  totalSteps,
@@ -17100,73 +17231,53 @@ function FunVerticalProgressBar({
17100
17231
  throw new Error("There must be a label for each step");
17101
17232
  }
17102
17233
  const steps = Array.from({ length: totalSteps - 1 }, (_, index) => index + 1);
17103
- const firstBlock = /* @__PURE__ */ React57.createElement(Box, {
17234
+ const firstBlock = /* @__PURE__ */ React58.createElement(Box, {
17104
17235
  display: "flex",
17105
17236
  justifyContent: "flex-start",
17106
17237
  gap: "10"
17107
- }, /* @__PURE__ */ React57.createElement(Box, {
17238
+ }, /* @__PURE__ */ React58.createElement(Box, {
17108
17239
  display: "flex",
17109
17240
  alignItems: "center",
17110
17241
  color: "modalText",
17111
17242
  flexDirection: "column"
17112
- }, /* @__PURE__ */ React57.createElement(Box, null, /* @__PURE__ */ React57.createElement(WhiteDotIcon, null)), /* @__PURE__ */ React57.createElement(Box, {
17243
+ }, /* @__PURE__ */ React58.createElement(Box, null, /* @__PURE__ */ React58.createElement(WhiteDotIcon, null)), /* @__PURE__ */ React58.createElement(Box, {
17113
17244
  height: "full"
17114
- }, /* @__PURE__ */ React57.createElement(ColoredLine, null))), labels && labels[0] ? /* @__PURE__ */ React57.createElement(Box, {
17245
+ }, /* @__PURE__ */ React58.createElement(ColoredLine, null))), labels && labels[0] ? /* @__PURE__ */ React58.createElement(Box, {
17115
17246
  display: "flex",
17116
17247
  flexDirection: "column",
17117
17248
  justifyContent: "flex-start",
17118
17249
  marginBottom: "18"
17119
- }, /* @__PURE__ */ React57.createElement(Box, {
17120
- gap: "5"
17121
- }, /* @__PURE__ */ React57.createElement(Text, {
17122
- as: "h1",
17123
- weight: "semibold",
17124
- color: "modalText",
17125
- size: "12"
17126
- }, labels[0].text)), /* @__PURE__ */ React57.createElement(Box, null, /* @__PURE__ */ React57.createElement(Text, {
17127
- as: "h1",
17128
- color: "modalText",
17129
- weight: "regular",
17130
- size: "10"
17131
- }, labels[0].description))) : null);
17132
- const lastBlock = /* @__PURE__ */ React57.createElement(Box, {
17250
+ }, /* @__PURE__ */ React58.createElement(LabelContent, {
17251
+ labelItem: labels[0]
17252
+ })) : null);
17253
+ const lastBlock = /* @__PURE__ */ React58.createElement(Box, {
17133
17254
  display: "flex",
17134
17255
  justifyContent: "flex-start",
17135
17256
  gap: "10",
17136
17257
  style: {
17137
17258
  opacity: step === totalSteps ? "100%" : "50%"
17138
17259
  }
17139
- }, /* @__PURE__ */ React57.createElement(Box, {
17260
+ }, /* @__PURE__ */ React58.createElement(Box, {
17140
17261
  display: "flex",
17141
17262
  alignItems: "center",
17142
17263
  color: "modalText",
17143
17264
  flexDirection: "column"
17144
- }, /* @__PURE__ */ React57.createElement(Box, {
17265
+ }, /* @__PURE__ */ React58.createElement(Box, {
17145
17266
  height: "full"
17146
- }, /* @__PURE__ */ React57.createElement(ColoredLine, null)), /* @__PURE__ */ React57.createElement(Box, null, /* @__PURE__ */ React57.createElement(WhiteDotIcon, null))), labels && labels.slice(-1)[0] ? /* @__PURE__ */ React57.createElement(Box, {
17267
+ }, /* @__PURE__ */ React58.createElement(ColoredLine, null)), /* @__PURE__ */ React58.createElement(Box, null, /* @__PURE__ */ React58.createElement(WhiteDotIcon, null))), labels && labels.slice(-1)[0] ? /* @__PURE__ */ React58.createElement(Box, {
17147
17268
  display: "flex",
17148
17269
  flexDirection: "column",
17149
17270
  justifyContent: "flex-end",
17150
17271
  marginTop: "18"
17151
- }, /* @__PURE__ */ React57.createElement(Box, {
17152
- gap: "5"
17153
- }, /* @__PURE__ */ React57.createElement(Text, {
17154
- as: "h1",
17155
- weight: "semibold",
17156
- color: "modalText",
17157
- size: "12"
17158
- }, labels.slice(-1)[0].text)), /* @__PURE__ */ React57.createElement(Box, null, /* @__PURE__ */ React57.createElement(Text, {
17159
- as: "h1",
17160
- color: "modalText",
17161
- weight: "regular",
17162
- size: "10"
17163
- }, labels.slice(-1)[0].description))) : null);
17164
- return /* @__PURE__ */ React57.createElement(Box, {
17272
+ }, /* @__PURE__ */ React58.createElement(LabelContent, {
17273
+ labelItem: labels.slice(-1)[0]
17274
+ })) : null);
17275
+ return /* @__PURE__ */ React58.createElement(Box, {
17165
17276
  display: "flex",
17166
17277
  height: "full",
17167
17278
  alignItems: "flex-start",
17168
17279
  flexDirection: "column"
17169
- }, firstBlock, steps.slice(1, steps.length).map((_, index) => /* @__PURE__ */ React57.createElement(Box, {
17280
+ }, firstBlock, steps.slice(1, steps.length).map((_, index) => /* @__PURE__ */ React58.createElement(Box, {
17170
17281
  id: "step-right",
17171
17282
  display: "flex",
17172
17283
  height: "full",
@@ -17175,39 +17286,27 @@ function FunVerticalProgressBar({
17175
17286
  gap: "10",
17176
17287
  style: { opacity: index + 1 <= step - 1 ? "100%" : "50%", flex: 1 },
17177
17288
  key: index
17178
- }, /* @__PURE__ */ React57.createElement(Box, {
17289
+ }, /* @__PURE__ */ React58.createElement(Box, {
17179
17290
  display: "flex",
17180
17291
  flexDirection: "column",
17181
17292
  alignItems: "center",
17182
17293
  justifyContent: "space-between",
17183
17294
  color: "modalText",
17184
- style: { height: 68 }
17185
- }, /* @__PURE__ */ React57.createElement(Box, {
17295
+ style: { height: 90 }
17296
+ }, /* @__PURE__ */ React58.createElement(Box, {
17186
17297
  display: "flex",
17187
17298
  style: { flex: 1 }
17188
- }, /* @__PURE__ */ React57.createElement(ColoredLine, null)), /* @__PURE__ */ React57.createElement(Box, null, /* @__PURE__ */ React57.createElement(WhiteDotIcon, null)), /* @__PURE__ */ React57.createElement(Box, {
17299
+ }, /* @__PURE__ */ React58.createElement(ColoredLine, null)), /* @__PURE__ */ React58.createElement(Box, null, /* @__PURE__ */ React58.createElement(WhiteDotIcon, null)), /* @__PURE__ */ React58.createElement(Box, {
17189
17300
  display: "flex",
17190
17301
  style: { flex: 1 }
17191
- }, /* @__PURE__ */ React57.createElement(ColoredLine, null))), labels && labels[index + 1] ? /* @__PURE__ */ React57.createElement(Box, {
17302
+ }, /* @__PURE__ */ React58.createElement(ColoredLine, null))), labels && labels[index + 1] ? /* @__PURE__ */ React58.createElement(Box, {
17192
17303
  display: "flex",
17193
17304
  flexDirection: "column",
17194
17305
  justifyContent: "center",
17195
17306
  paddingY: "18"
17196
- }, /* @__PURE__ */ React57.createElement(Box, {
17197
- color: "modalText"
17198
- }, /* @__PURE__ */ React57.createElement(Text, {
17199
- as: "h1",
17200
- weight: "semibold",
17201
- color: "modalText",
17202
- size: "12"
17203
- }, labels[index + 1].text)), /* @__PURE__ */ React57.createElement(Box, {
17204
- color: "modalText"
17205
- }, /* @__PURE__ */ React57.createElement(Text, {
17206
- as: "h1",
17207
- color: "modalText",
17208
- weight: "regular",
17209
- size: "10"
17210
- }, labels[index + 1].description))) : null)), lastBlock);
17307
+ }, /* @__PURE__ */ React58.createElement(LabelContent, {
17308
+ labelItem: labels[index + 1]
17309
+ })) : null)), lastBlock);
17211
17310
  }
17212
17311
 
17213
17312
  // src/components/FunOnramp/FunOnrampProcessingStep.tsx
@@ -17216,7 +17315,7 @@ function FunOnrampProcessingStep({
17216
17315
  tokenAmountUsd,
17217
17316
  isDepositing
17218
17317
  }) {
17219
- const [labels, setLabels] = useState12([
17318
+ const [labels, setLabels] = useState13([
17220
17319
  {
17221
17320
  text: "Order Submitted",
17222
17321
  description: formatTimestamp(new Date())
@@ -17237,64 +17336,64 @@ function FunOnrampProcessingStep({
17237
17336
  setLabels(newLabels);
17238
17337
  }
17239
17338
  }, [isDepositing]);
17240
- return /* @__PURE__ */ React58.createElement(Box, {
17339
+ return /* @__PURE__ */ React59.createElement(Box, {
17241
17340
  display: "flex",
17242
17341
  flexDirection: "column"
17243
- }, /* @__PURE__ */ React58.createElement(Box, {
17342
+ }, /* @__PURE__ */ React59.createElement(Box, {
17244
17343
  paddingBottom: "30"
17245
- }, /* @__PURE__ */ React58.createElement(FunOnrampPrimaryItem, {
17344
+ }, /* @__PURE__ */ React59.createElement(FunOnrampPrimaryItem, {
17246
17345
  token,
17247
17346
  tokenAmountUsd
17248
- })), /* @__PURE__ */ React58.createElement(Box, {
17347
+ })), /* @__PURE__ */ React59.createElement(Box, {
17249
17348
  paddingBottom: "24"
17250
- }, /* @__PURE__ */ React58.createElement(FunNotification, {
17349
+ }, /* @__PURE__ */ React59.createElement(FunNotification, {
17251
17350
  description: "We are currently processing your order."
17252
- })), /* @__PURE__ */ React58.createElement(Box, {
17351
+ })), /* @__PURE__ */ React59.createElement(Box, {
17253
17352
  paddingBottom: "24"
17254
- }, /* @__PURE__ */ React58.createElement(Box, {
17353
+ }, /* @__PURE__ */ React59.createElement(Box, {
17255
17354
  borderRadius: "menuButton",
17256
17355
  background: "menuItemBackground",
17257
17356
  display: "flex",
17258
17357
  alignItems: "center",
17259
17358
  padding: "14"
17260
- }, /* @__PURE__ */ React58.createElement(FunVerticalProgressBar, {
17359
+ }, /* @__PURE__ */ React59.createElement(FunVerticalProgressBar, {
17261
17360
  step: isDepositing ? 2 : 3,
17262
17361
  totalSteps: 3,
17263
17362
  labels
17264
- }))), isDepositing ? /* @__PURE__ */ React58.createElement(Box, {
17363
+ }))), isDepositing ? /* @__PURE__ */ React59.createElement(Box, {
17265
17364
  display: "flex",
17266
17365
  flexDirection: "column",
17267
17366
  alignItems: "center",
17268
17367
  justifyContent: "center"
17269
- }, /* @__PURE__ */ React58.createElement(Text, {
17368
+ }, /* @__PURE__ */ React59.createElement(Text, {
17270
17369
  size: "12",
17271
17370
  color: "modalTextDim"
17272
- }, "You will receive a notification when your order has finished.")) : /* @__PURE__ */ React58.createElement(React58.Fragment, null));
17371
+ }, "You will receive a notification when your order has finished.")) : /* @__PURE__ */ React59.createElement(React59.Fragment, null));
17273
17372
  }
17274
17373
 
17275
17374
  // src/components/FunPayments/FunPaymentSetup.tsx
17276
- import React72 from "react";
17375
+ import React73 from "react";
17277
17376
 
17278
17377
  // src/components/FunPayments/FunPaymentMeshType.tsx
17279
17378
  import {
17280
17379
  createFrontConnection
17281
17380
  } from "@front-finance/link";
17282
- import React63, { useCallback as useCallback7, useEffect as useEffect17, useMemo as useMemo11, useState as useState14 } from "react";
17381
+ import React64, { useCallback as useCallback9, useEffect as useEffect17, useMemo as useMemo11, useState as useState15 } from "react";
17283
17382
 
17284
17383
  // src/components/FunSelect/FunSelect.tsx
17285
- import React61, { useMemo as useMemo10, useRef as useRef6 } from "react";
17286
- import { useState as useState13 } from "react";
17384
+ import React62, { useMemo as useMemo10, useRef as useRef6 } from "react";
17385
+ import { useState as useState14 } from "react";
17287
17386
 
17288
17387
  // src/components/Icons/FunArrows.tsx
17289
- import React59 from "react";
17388
+ import React60 from "react";
17290
17389
  var FunDownArrow = () => {
17291
- return /* @__PURE__ */ React59.createElement("svg", {
17390
+ return /* @__PURE__ */ React60.createElement("svg", {
17292
17391
  width: "24",
17293
17392
  height: "25",
17294
17393
  viewBox: "0 0 24 25",
17295
17394
  fill: "none",
17296
17395
  xmlns: "http://www.w3.org/2000/svg"
17297
- }, /* @__PURE__ */ React59.createElement("path", {
17396
+ }, /* @__PURE__ */ React60.createElement("path", {
17298
17397
  fillRule: "evenodd",
17299
17398
  clipRule: "evenodd",
17300
17399
  d: "M14.3787 9.5C15.715 9.5 16.3843 11.1157 15.4393 12.0607L13.0607 14.4393C12.4749 15.0251 11.5251 15.0251 10.9393 14.4393L8.56066 12.0607C7.61571 11.1157 8.28496 9.5 9.62132 9.5H14.3787Z",
@@ -17302,13 +17401,13 @@ var FunDownArrow = () => {
17302
17401
  }));
17303
17402
  };
17304
17403
  var FunUpArrow = () => {
17305
- return /* @__PURE__ */ React59.createElement("svg", {
17404
+ return /* @__PURE__ */ React60.createElement("svg", {
17306
17405
  width: "24",
17307
17406
  height: "25",
17308
17407
  viewBox: "0 0 24 25",
17309
17408
  fill: "none",
17310
17409
  xmlns: "http://www.w3.org/2000/svg"
17311
- }, /* @__PURE__ */ React59.createElement("path", {
17410
+ }, /* @__PURE__ */ React60.createElement("path", {
17312
17411
  fillRule: "evenodd",
17313
17412
  clipRule: "evenodd",
17314
17413
  d: "M9.62132 15C8.28496 15 7.61571 13.3843 8.56066 12.4393L10.9393 10.0607C11.5251 9.47487 12.4749 9.47487 13.0607 10.0607L15.4393 12.4393C16.3843 13.3843 15.715 15 14.3787 15L9.62132 15Z",
@@ -17316,13 +17415,13 @@ var FunUpArrow = () => {
17316
17415
  }));
17317
17416
  };
17318
17417
  var FunNarrowRightArrow = () => {
17319
- return /* @__PURE__ */ React59.createElement("svg", {
17418
+ return /* @__PURE__ */ React60.createElement("svg", {
17320
17419
  width: "19",
17321
17420
  height: "19",
17322
17421
  viewBox: "0 0 19 19",
17323
17422
  fill: "none",
17324
17423
  xmlns: "http://www.w3.org/2000/svg"
17325
- }, /* @__PURE__ */ React59.createElement("path", {
17424
+ }, /* @__PURE__ */ React60.createElement("path", {
17326
17425
  d: "M15.5 9.5L3.5 9.5M15.5 9.5L12.5 6.5M15.5 9.5L12.5 12.5",
17327
17426
  stroke: "currentColor",
17328
17427
  strokeWidth: "1.5",
@@ -17331,13 +17430,13 @@ var FunNarrowRightArrow = () => {
17331
17430
  }));
17332
17431
  };
17333
17432
  var FunNarrowDownArrow = () => {
17334
- return /* @__PURE__ */ React59.createElement("svg", {
17433
+ return /* @__PURE__ */ React60.createElement("svg", {
17335
17434
  width: "19",
17336
17435
  height: "19",
17337
17436
  viewBox: "0 0 19 19",
17338
17437
  fill: "none",
17339
17438
  xmlns: "http://www.w3.org/2000/svg"
17340
- }, /* @__PURE__ */ React59.createElement("path", {
17439
+ }, /* @__PURE__ */ React60.createElement("path", {
17341
17440
  d: "M9.5 15.5L9.5 3.5M9.5 15.5L12.5 12.5M9.5 15.5L6.5 12.5",
17342
17441
  stroke: "currentColor",
17343
17442
  strokeWidth: "1.5",
@@ -17347,7 +17446,7 @@ var FunNarrowDownArrow = () => {
17347
17446
  };
17348
17447
 
17349
17448
  // src/components/FunSelect/FunClickOutside.tsx
17350
- import React60 from "react";
17449
+ import React61 from "react";
17351
17450
  import { useEffect as useEffect16, useRef as useRef5 } from "react";
17352
17451
  function FunClickOutside({
17353
17452
  children,
@@ -17374,7 +17473,7 @@ function FunClickOutside({
17374
17473
  onClick();
17375
17474
  }
17376
17475
  };
17377
- return /* @__PURE__ */ React60.createElement("div", {
17476
+ return /* @__PURE__ */ React61.createElement("div", {
17378
17477
  ref: wrapperRef
17379
17478
  }, children);
17380
17479
  }
@@ -17392,7 +17491,7 @@ function FunSelectOptionItem({
17392
17491
  onClick,
17393
17492
  padding
17394
17493
  }) {
17395
- return /* @__PURE__ */ React61.createElement(Box, {
17494
+ return /* @__PURE__ */ React62.createElement(Box, {
17396
17495
  onClick,
17397
17496
  borderRadius: "menuButton",
17398
17497
  background: {
@@ -17411,7 +17510,7 @@ function FunSelectDropdown({
17411
17510
  selectedValue,
17412
17511
  optionItemPadding = "8"
17413
17512
  }) {
17414
- return isDropdownOpen ? options?.length ? /* @__PURE__ */ React61.createElement(Box, {
17513
+ return isDropdownOpen ? options?.length ? /* @__PURE__ */ React62.createElement(Box, {
17415
17514
  width: "full",
17416
17515
  borderRadius: "menuButton",
17417
17516
  boxShadow: "dialog",
@@ -17423,13 +17522,13 @@ function FunSelectDropdown({
17423
17522
  borderStyle: "solid",
17424
17523
  borderWidth: "1",
17425
17524
  style: { maxHeight: 200, overflowY: "auto", overflowX: "hidden" }
17426
- }, options.map((optionItem) => /* @__PURE__ */ React61.createElement(FunSelectOptionItem, {
17525
+ }, options.map((optionItem) => /* @__PURE__ */ React62.createElement(FunSelectOptionItem, {
17427
17526
  label: optionItem.label,
17428
17527
  key: optionItem.value,
17429
17528
  isActive: selectedValue === optionItem.value,
17430
17529
  onClick: () => handleSelect(optionItem.value),
17431
17530
  padding: optionItemPadding
17432
- }))) : /* @__PURE__ */ React61.createElement(Text, {
17531
+ }))) : /* @__PURE__ */ React62.createElement(Text, {
17433
17532
  size: "14",
17434
17533
  color: "modalTextSecondary",
17435
17534
  weight: "medium"
@@ -17443,7 +17542,7 @@ function FunSelectEntry({
17443
17542
  showBorder = true,
17444
17543
  isDisabled = false
17445
17544
  }) {
17446
- return /* @__PURE__ */ React61.createElement(Box, {
17545
+ return /* @__PURE__ */ React62.createElement(Box, {
17447
17546
  display: "flex",
17448
17547
  flexDirection: "row",
17449
17548
  justifyContent: "space-between",
@@ -17462,16 +17561,16 @@ function FunSelectEntry({
17462
17561
  paddingY: "6",
17463
17562
  paddingLeft: "8",
17464
17563
  onClick
17465
- }, /* @__PURE__ */ React61.createElement(Box, {
17564
+ }, /* @__PURE__ */ React62.createElement(Box, {
17466
17565
  color: "accentColor"
17467
- }, activeLabel ? activeLabel : /* @__PURE__ */ React61.createElement(Text, {
17566
+ }, activeLabel ? activeLabel : /* @__PURE__ */ React62.createElement(Text, {
17468
17567
  size: "14",
17469
17568
  color: "modalTextSecondary"
17470
- }, placeholder)), /* @__PURE__ */ React61.createElement(Box, {
17569
+ }, placeholder)), /* @__PURE__ */ React62.createElement(Box, {
17471
17570
  color: "accentColor",
17472
17571
  display: "flex",
17473
17572
  alignItems: "center"
17474
- }, isDropdownOpen ? /* @__PURE__ */ React61.createElement(FunUpArrow, null) : /* @__PURE__ */ React61.createElement(FunDownArrow, null)));
17573
+ }, isDropdownOpen ? /* @__PURE__ */ React62.createElement(FunUpArrow, null) : /* @__PURE__ */ React62.createElement(FunDownArrow, null)));
17475
17574
  }
17476
17575
  function FunSelect({
17477
17576
  initValue = "",
@@ -17485,11 +17584,11 @@ function FunSelect({
17485
17584
  throw new Error("Duplicate values detected in FunSelect options.");
17486
17585
  }
17487
17586
  const selectRef = useRef6(null);
17488
- const [isDropdownOpen, setIsDropdownOpen] = useState13(false);
17587
+ const [isDropdownOpen, setIsDropdownOpen] = useState14(false);
17489
17588
  const optionsMap = useMemo10(() => {
17490
17589
  return indexBy(options, (option) => option.value);
17491
17590
  }, [options]);
17492
- const [selectedValue, setSelectedValue] = useState13(initValue);
17591
+ const [selectedValue, setSelectedValue] = useState14(initValue);
17493
17592
  const selectedLabel = useMemo10(() => {
17494
17593
  return optionsMap?.[selectedValue]?.label || null;
17495
17594
  }, [optionsMap, selectedValue]);
@@ -17503,13 +17602,13 @@ function FunSelect({
17503
17602
  const computedWidth = useMemo10(() => {
17504
17603
  return selectRef?.current?.clientWidth;
17505
17604
  }, [selectRef?.current]);
17506
- return /* @__PURE__ */ React61.createElement(Box, {
17605
+ return /* @__PURE__ */ React62.createElement(Box, {
17507
17606
  fontFamily: "body",
17508
17607
  width: "full",
17509
17608
  ref: selectRef
17510
- }, /* @__PURE__ */ React61.createElement(FunClickOutside, {
17609
+ }, /* @__PURE__ */ React62.createElement(FunClickOutside, {
17511
17610
  onClick: () => setIsDropdownOpen(false)
17512
- }, /* @__PURE__ */ React61.createElement(FunSelectEntry, {
17611
+ }, /* @__PURE__ */ React62.createElement(FunSelectEntry, {
17513
17612
  placeholder,
17514
17613
  activeLabel: selectedLabel,
17515
17614
  isDropdownOpen,
@@ -17518,10 +17617,10 @@ function FunSelect({
17518
17617
  onClick: () => {
17519
17618
  setIsDropdownOpen(!isDropdownOpen);
17520
17619
  }
17521
- }), /* @__PURE__ */ React61.createElement(Box, {
17620
+ }), /* @__PURE__ */ React62.createElement(Box, {
17522
17621
  position: "fixed",
17523
17622
  style: { width: computedWidth, zIndex: 5 }
17524
- }, /* @__PURE__ */ React61.createElement(FunSelectDropdown, {
17623
+ }, /* @__PURE__ */ React62.createElement(FunSelectDropdown, {
17525
17624
  handleSelect,
17526
17625
  isDropdownOpen,
17527
17626
  options,
@@ -17530,18 +17629,18 @@ function FunSelect({
17530
17629
  }
17531
17630
 
17532
17631
  // src/components/Icons/SearchIcon.tsx
17533
- import React62 from "react";
17632
+ import React63 from "react";
17534
17633
  var SearchIcon = () => {
17535
- return /* @__PURE__ */ React62.createElement("svg", {
17634
+ return /* @__PURE__ */ React63.createElement("svg", {
17536
17635
  width: "24",
17537
17636
  height: "24",
17538
17637
  viewBox: "0 0 24 24",
17539
17638
  fill: "none",
17540
17639
  xmlns: "http://www.w3.org/2000/svg"
17541
- }, /* @__PURE__ */ React62.createElement("path", {
17640
+ }, /* @__PURE__ */ React63.createElement("path", {
17542
17641
  d: "M10.7702 18.3002C9.28095 18.3002 7.8251 17.8586 6.5868 17.0312C5.3485 16.2038 4.38336 15.0277 3.81343 13.6518C3.2435 12.2759 3.09438 10.7618 3.38493 9.30121C3.67548 7.84054 4.39264 6.49882 5.44573 5.44573C6.49882 4.39264 7.84054 3.67548 9.30121 3.38493C10.7618 3.09438 12.2759 3.2435 13.6518 3.81343C15.0277 4.38336 16.2038 5.3485 17.0312 6.5868C17.8586 7.8251 18.3002 9.28095 18.3002 10.7702C18.3002 11.759 18.1054 12.7382 17.727 13.6518C17.3486 14.5654 16.7939 15.3955 16.0947 16.0947C15.3955 16.7939 14.5654 17.3486 13.6518 17.727C12.7382 18.1054 11.759 18.3002 10.7702 18.3002ZM10.7702 4.75024C9.58356 4.75024 8.42352 5.10214 7.43682 5.76143C6.45013 6.42071 5.68109 7.35779 5.22697 8.45414C4.77284 9.5505 4.65402 10.7568 4.88553 11.9207C5.11704 13.0846 5.68849 14.1537 6.5276 14.9928C7.36672 15.8319 8.43581 16.4034 9.5997 16.6349C10.7635 16.8664 11.9699 16.7476 13.0663 16.2935C14.1626 15.8393 15.0997 15.0703 15.759 14.0836C16.4183 13.0969 16.7702 11.9369 16.7702 10.7502C16.7702 9.15894 16.1381 7.63282 15.0128 6.5076C13.8876 5.38238 12.3615 4.75024 10.7702 4.75024Z",
17543
17642
  fill: "#9CA4AB"
17544
- }), /* @__PURE__ */ React62.createElement("path", {
17643
+ }), /* @__PURE__ */ React63.createElement("path", {
17545
17644
  d: "M20 20.75C19.9015 20.7504 19.8038 20.7312 19.7128 20.6934C19.6218 20.6557 19.5392 20.6001 19.47 20.53L15.34 16.4C15.2075 16.2578 15.1354 16.0697 15.1388 15.8754C15.1422 15.6811 15.221 15.4958 15.3584 15.3583C15.4958 15.2209 15.6812 15.1422 15.8755 15.1388C16.0698 15.1354 16.2578 15.2075 16.4 15.34L20.53 19.47C20.6704 19.6106 20.7493 19.8012 20.7493 20C20.7493 20.1987 20.6704 20.3893 20.53 20.53C20.4608 20.6001 20.3782 20.6557 20.2872 20.6934C20.1962 20.7312 20.0985 20.7504 20 20.75Z",
17546
17645
  fill: "#9CA4AB"
17547
17646
  }));
@@ -17557,13 +17656,13 @@ function FunPaymentMeshType({
17557
17656
  onSoftHide,
17558
17657
  backAnimation = false
17559
17658
  }) {
17560
- const [searchInput, setSearchInput] = useState14("");
17561
- const [exchange, setExchange] = useState14();
17562
- const [isLoadingMeshModal, setIsLoadingMeshModal] = useState14(false);
17563
- const [meshPreError, setMeshPreError] = useState14("");
17659
+ const [searchInput, setSearchInput] = useState15("");
17660
+ const [exchange, setExchange] = useState15();
17661
+ const [isLoadingMeshModal, setIsLoadingMeshModal] = useState15(false);
17662
+ const [meshPreError, setMeshPreError] = useState15("");
17564
17663
  const funkitConfig = useFunkitConfig();
17565
17664
  const { options } = useMeshExchanges({ fullInfo: true });
17566
- const [frontConnection, setFrontConnection] = useState14(null);
17665
+ const [frontConnection, setFrontConnection] = useState15(null);
17567
17666
  useEffect17(() => {
17568
17667
  const frontConnect = createFrontConnection({
17569
17668
  clientId: "e1880c6d-5af8-4634-3182-08dba58a99a5",
@@ -17588,7 +17687,7 @@ function FunPaymentMeshType({
17588
17687
  });
17589
17688
  setFrontConnection({ ...frontConnect });
17590
17689
  }, [onFinish, onSoftHide]);
17591
- const onClickContinue = useCallback7(async () => {
17690
+ const onClickContinue = useCallback9(async () => {
17592
17691
  try {
17593
17692
  setMeshPreError("");
17594
17693
  setIsLoadingMeshModal(true);
@@ -17616,23 +17715,23 @@ function FunPaymentMeshType({
17616
17715
  }, [exchange, frontConnection, funkitConfig?.apiKey, onSoftHide]);
17617
17716
  const canContinue = useMemo11(() => isNotNullish(exchange), [exchange]);
17618
17717
  const hasMeshPreError = useMemo11(() => meshPreError !== "", [meshPreError]);
17619
- return /* @__PURE__ */ React63.createElement(Box, {
17718
+ return /* @__PURE__ */ React64.createElement(Box, {
17620
17719
  className: backAnimation ? animateContentOutClass3 : animateContentInClass3
17621
- }, /* @__PURE__ */ React63.createElement(Box, null, /* @__PURE__ */ React63.createElement(Text, {
17720
+ }, /* @__PURE__ */ React64.createElement(Box, null, /* @__PURE__ */ React64.createElement(Text, {
17622
17721
  color: "modalTextSecondary",
17623
17722
  weight: "semibold"
17624
- }, "Select Account")), /* @__PURE__ */ React63.createElement(Box, {
17723
+ }, "Select Account")), /* @__PURE__ */ React64.createElement(Box, {
17625
17724
  paddingY: "24"
17626
- }, /* @__PURE__ */ React63.createElement(FunInput, {
17725
+ }, /* @__PURE__ */ React64.createElement(FunInput, {
17627
17726
  placeholder: "Search",
17628
17727
  value: searchInput,
17629
17728
  onChange: (e) => setSearchInput(e.target.value),
17630
- prefix: /* @__PURE__ */ React63.createElement(Box, {
17729
+ prefix: /* @__PURE__ */ React64.createElement(Box, {
17631
17730
  display: "flex",
17632
17731
  alignItems: "center",
17633
17732
  height: "max"
17634
- }, /* @__PURE__ */ React63.createElement(SearchIcon, null))
17635
- })), /* @__PURE__ */ React63.createElement(Box, null, /* @__PURE__ */ React63.createElement(FunSelectDropdown, {
17733
+ }, /* @__PURE__ */ React64.createElement(SearchIcon, null))
17734
+ })), /* @__PURE__ */ React64.createElement(Box, null, /* @__PURE__ */ React64.createElement(FunSelectDropdown, {
17636
17735
  handleSelect: (selectedExchange) => {
17637
17736
  setMeshPreError("");
17638
17737
  setExchange(selectedExchange);
@@ -17642,23 +17741,23 @@ function FunPaymentMeshType({
17642
17741
  (optionItem) => optionItem?.value?.toLowerCase().includes(searchInput?.toLowerCase())
17643
17742
  ),
17644
17743
  selectedValue: exchange?.toString() || ""
17645
- })), /* @__PURE__ */ React63.createElement(Box, {
17744
+ })), /* @__PURE__ */ React64.createElement(Box, {
17646
17745
  paddingTop: "24",
17647
17746
  display: "flex",
17648
17747
  flexDirection: "column",
17649
17748
  gap: "24"
17650
- }, /* @__PURE__ */ React63.createElement(FunNotification, {
17749
+ }, /* @__PURE__ */ React64.createElement(FunNotification, {
17651
17750
  type: hasMeshPreError ? "error" : "default",
17652
17751
  description: hasMeshPreError ? meshPreError : "You will be redirected to Mesh to securely link your account."
17653
- }), /* @__PURE__ */ React63.createElement(FunButton, {
17752
+ }), /* @__PURE__ */ React64.createElement(FunButton, {
17654
17753
  title: "Continue",
17655
17754
  onClick: onClickContinue,
17656
17755
  isDisabled: !canContinue || isLoadingMeshModal || hasMeshPreError,
17657
- titleSuffix: isLoadingMeshModal ? /* @__PURE__ */ React63.createElement(Box, {
17756
+ titleSuffix: isLoadingMeshModal ? /* @__PURE__ */ React64.createElement(Box, {
17658
17757
  display: "flex",
17659
17758
  alignItems: "center",
17660
17759
  color: "modalText"
17661
- }, /* @__PURE__ */ React63.createElement(SpinnerIcon, {
17760
+ }, /* @__PURE__ */ React64.createElement(SpinnerIcon, {
17662
17761
  height: 16,
17663
17762
  width: 16
17664
17763
  })) : null
@@ -17667,8 +17766,7 @@ function FunPaymentMeshType({
17667
17766
 
17668
17767
  // src/components/FunPayments/FunPaymentMoonpayType.tsx
17669
17768
  import { getMoonpayUrlSignature } from "@funkit/core";
17670
- import React64, { useEffect as useEffect18, useMemo as useMemo12, useState as useState15 } from "react";
17671
- import { useNetwork as useNetwork4 } from "wagmi";
17769
+ import React65, { useEffect as useEffect18, useMemo as useMemo12, useState as useState16 } from "react";
17672
17770
 
17673
17771
  // src/utils/moonpay.ts
17674
17772
  import { getMoonPayCheckout } from "@funkit/core";
@@ -17694,7 +17792,7 @@ var animateContentOutClassShorter = "FunPaymentMoonpayType_animateContentOutClas
17694
17792
 
17695
17793
  // src/components/FunPayments/FunPaymentMoonpayType.tsx
17696
17794
  var MoonPayBuyWidget = (props) => {
17697
- const [MoonPayBuyWidgetInner, setMoonPayBuyWidgetInner] = React64.useState(null);
17795
+ const [MoonPayBuyWidgetInner, setMoonPayBuyWidgetInner] = React65.useState(null);
17698
17796
  useEffect18(() => {
17699
17797
  const loadMoonPayBuyWidgetInner = async () => {
17700
17798
  try {
@@ -17707,8 +17805,8 @@ var MoonPayBuyWidget = (props) => {
17707
17805
  loadMoonPayBuyWidgetInner();
17708
17806
  }, []);
17709
17807
  if (!MoonPayBuyWidgetInner)
17710
- return /* @__PURE__ */ React64.createElement(React64.Fragment, null, props.children);
17711
- return /* @__PURE__ */ React64.createElement(MoonPayBuyWidgetInner, {
17808
+ return /* @__PURE__ */ React65.createElement(React65.Fragment, null, props.children);
17809
+ return /* @__PURE__ */ React65.createElement(MoonPayBuyWidgetInner, {
17712
17810
  ...props
17713
17811
  }, props.children);
17714
17812
  };
@@ -17716,35 +17814,32 @@ function FunPaymentMoonpayType({
17716
17814
  paymentFlow,
17717
17815
  paymentAddress,
17718
17816
  depositToken,
17719
- depositUsdAmount,
17817
+ depositTokenChainId,
17818
+ depositTokenAmount,
17720
17819
  onBackToHome,
17721
17820
  backAnimation = false,
17722
17821
  redirectToCheckoutHistory
17723
17822
  }) {
17724
- const [isVisible, setIsVisible] = useState15(true);
17725
- const [isBackToHomeDisabled, setIsBackToHomeDisabled] = useState15(true);
17726
- const [currencyCode, setCurrencyCode] = useState15("");
17727
- const [walletAddress, setWalletAddress] = useState15("");
17728
- const { chain: activeChain } = useNetwork4();
17823
+ const [isSupportedRegion, setIsSupportedRegion] = useState16(true);
17824
+ const [isBackToHomeDisabled, setIsBackToHomeDisabled] = useState16(true);
17825
+ const [currencyCode, setCurrencyCode] = useState16("");
17826
+ const [walletAddress, setWalletAddress] = useState16("");
17729
17827
  const { appName } = useAppInfoInternal();
17730
17828
  const funkitConfig = useFunkitConfig();
17731
17829
  const fetchMoonpayUrl = async () => {
17732
- if (activeChain) {
17733
- const url = await handleGetMoonpayUrl(
17734
- depositToken,
17735
- activeChain.id,
17736
- paymentAddress,
17737
- depositUsdAmount.toString()
17738
- );
17739
- const queryParams = new URLSearchParams(url.split("?")[1]);
17740
- const _currencyCode = queryParams.get("currencyCode");
17741
- const _walletAddress = queryParams.get("walletAddress");
17742
- if (_currencyCode)
17743
- setCurrencyCode(_currencyCode);
17744
- if (_walletAddress)
17745
- setWalletAddress(_walletAddress);
17746
- } else {
17747
- }
17830
+ const url = await handleGetMoonpayUrl(
17831
+ depositToken,
17832
+ parseInt(depositTokenChainId),
17833
+ paymentAddress,
17834
+ depositTokenAmount.toString()
17835
+ );
17836
+ const queryParams = new URLSearchParams(url.split("?")[1]);
17837
+ const _currencyCode = queryParams.get("currencyCode");
17838
+ const _walletAddress = queryParams.get("walletAddress");
17839
+ if (_currencyCode)
17840
+ setCurrencyCode(_currencyCode);
17841
+ if (_walletAddress)
17842
+ setWalletAddress(_walletAddress);
17748
17843
  };
17749
17844
  useEffect18(() => {
17750
17845
  fetchMoonpayUrl();
@@ -17758,32 +17853,32 @@ function FunPaymentMoonpayType({
17758
17853
  const description = useMemo12(() => {
17759
17854
  return `${appName} uses Moonpay to on-ramp ${depositToken} via credit & debit cards.`;
17760
17855
  }, [appName, depositToken]);
17761
- return /* @__PURE__ */ React64.createElement(Box, {
17856
+ return /* @__PURE__ */ React65.createElement(Box, {
17762
17857
  className: backAnimation ? paymentFlow === 0 /* DEPOSIT */ ? animateContentOutClass4 : animateContentOutClassShorter : paymentFlow === 0 /* DEPOSIT */ ? animateContentInClass4 : animateContentInClassShorter
17763
- }, /* @__PURE__ */ React64.createElement(Box, {
17858
+ }, /* @__PURE__ */ React65.createElement(Box, {
17764
17859
  gap: "10"
17765
- }, /* @__PURE__ */ React64.createElement(Text, {
17860
+ }, /* @__PURE__ */ React65.createElement(Text, {
17766
17861
  color: "modalText",
17767
17862
  size: "18",
17768
17863
  weight: "heavy"
17769
- }, "Enter Payment Information")), /* @__PURE__ */ React64.createElement(Box, {
17864
+ }, "Enter Payment Information")), /* @__PURE__ */ React65.createElement(Box, {
17770
17865
  paddingY: "10"
17771
- }, /* @__PURE__ */ React64.createElement(Text, {
17866
+ }, /* @__PURE__ */ React65.createElement(Text, {
17772
17867
  color: "modalTextSecondary",
17773
17868
  size: "14",
17774
17869
  weight: "medium"
17775
- }, description)), !isVisible ? /* @__PURE__ */ React64.createElement(Box, {
17870
+ }, description)), !isSupportedRegion ? /* @__PURE__ */ React65.createElement(Box, {
17776
17871
  paddingY: "10"
17777
- }, /* @__PURE__ */ React64.createElement(FunNotification, {
17872
+ }, /* @__PURE__ */ React65.createElement(FunNotification, {
17778
17873
  type: "error",
17779
17874
  description: "You are using moonpay from an unsupported region. Please use a different payment method."
17780
- })) : null, /* @__PURE__ */ React64.createElement(Box, {
17875
+ })) : null, /* @__PURE__ */ React65.createElement(Box, {
17781
17876
  display: "flex",
17782
17877
  justifyContent: "center",
17783
17878
  paddingBottom: "24"
17784
- }, /* @__PURE__ */ React64.createElement(MoonPayBuyWidget, {
17879
+ }, /* @__PURE__ */ React65.createElement(MoonPayBuyWidget, {
17785
17880
  variant: "embedded",
17786
- quoteCurrencyAmount: depositUsdAmount.toString(),
17881
+ quoteCurrencyAmount: depositTokenAmount.toString(),
17787
17882
  currencyCode,
17788
17883
  walletAddress,
17789
17884
  onUrlSignatureRequested: handleGetSignature,
@@ -17794,40 +17889,36 @@ function FunPaymentMoonpayType({
17794
17889
  redirectToCheckoutHistory?.(paymentAddress);
17795
17890
  }
17796
17891
  },
17797
- onUnsupportedRegion: async () => {
17798
- if (paymentFlow === 0 /* DEPOSIT */) {
17799
- setIsVisible(false);
17800
- }
17801
- },
17802
- visible: isVisible,
17892
+ onUnsupportedRegion: () => setIsSupportedRegion(false),
17893
+ visible: isSupportedRegion,
17803
17894
  style: { margin: 0 }
17804
- })), paymentFlow === 0 /* DEPOSIT */ ? /* @__PURE__ */ React64.createElement(Box, {
17895
+ })), paymentFlow === 0 /* DEPOSIT */ ? /* @__PURE__ */ React65.createElement(Box, {
17805
17896
  position: "absolute",
17806
17897
  width: "full",
17807
17898
  style: { bottom: 0 }
17808
- }, /* @__PURE__ */ React64.createElement(FunButton, {
17899
+ }, /* @__PURE__ */ React65.createElement(FunButton, {
17809
17900
  title: "Back to Home",
17810
17901
  onClick: onBackToHome,
17811
- isDisabled: isBackToHomeDisabled && isVisible
17902
+ isDisabled: isBackToHomeDisabled && isSupportedRegion
17812
17903
  })) : null);
17813
17904
  }
17814
17905
 
17815
17906
  // src/components/FunPayments/FunPaymentTransferType.tsx
17816
- import React71 from "react";
17907
+ import React72 from "react";
17817
17908
 
17818
17909
  // src/components/ProfileDetails/FunWalletProfileViews/FWSettings/FWSettings.tsx
17819
- import React69, { useCallback as useCallback8, useEffect as useEffect19, useState as useState16 } from "react";
17910
+ import React70, { useCallback as useCallback10, useEffect as useEffect19, useState as useState17 } from "react";
17820
17911
  import { useAccount as useAccount6 } from "wagmi";
17821
17912
 
17822
17913
  // src/components/FunButton/FunIconButton.tsx
17823
- import React65 from "react";
17914
+ import React66 from "react";
17824
17915
  var FunIconButton = ({
17825
17916
  onClick,
17826
17917
  icon,
17827
17918
  size = "20",
17828
17919
  showBorder = true
17829
17920
  }) => {
17830
- return /* @__PURE__ */ React65.createElement(Box, {
17921
+ return /* @__PURE__ */ React66.createElement(Box, {
17831
17922
  display: "flex",
17832
17923
  alignItems: "center",
17833
17924
  as: "button",
@@ -17852,41 +17943,41 @@ var FunIconButton = ({
17852
17943
  };
17853
17944
 
17854
17945
  // src/components/Icons/Copied.tsx
17855
- import React66 from "react";
17856
- var CopiedIcon = () => /* @__PURE__ */ React66.createElement("svg", {
17946
+ import React67 from "react";
17947
+ var CopiedIcon = () => /* @__PURE__ */ React67.createElement("svg", {
17857
17948
  fill: "none",
17858
17949
  height: "13",
17859
17950
  viewBox: "0 0 13 13",
17860
17951
  width: "13",
17861
17952
  xmlns: "http://www.w3.org/2000/svg"
17862
- }, /* @__PURE__ */ React66.createElement("path", {
17953
+ }, /* @__PURE__ */ React67.createElement("path", {
17863
17954
  d: "M4.94568 12.2646C5.41052 12.2646 5.77283 12.0869 6.01892 11.7109L12.39 1.96973C12.5677 1.69629 12.6429 1.44336 12.6429 1.2041C12.6429 0.561523 12.1644 0.0966797 11.5082 0.0966797C11.057 0.0966797 10.7767 0.260742 10.5033 0.691406L4.9115 9.50977L2.07458 5.98926C1.82166 5.68848 1.54822 5.55176 1.16541 5.55176C0.502319 5.55176 0.0238037 6.02344 0.0238037 6.66602C0.0238037 6.95312 0.112671 7.20605 0.358765 7.48633L3.88611 11.7588C4.18005 12.1074 4.50818 12.2646 4.94568 12.2646Z",
17864
17955
  fill: "currentColor"
17865
17956
  }));
17866
17957
 
17867
17958
  // src/components/Icons/Copy.tsx
17868
- import React67 from "react";
17869
- var CopyIcon = () => /* @__PURE__ */ React67.createElement("svg", {
17959
+ import React68 from "react";
17960
+ var CopyIcon = () => /* @__PURE__ */ React68.createElement("svg", {
17870
17961
  fill: "none",
17871
17962
  height: "16",
17872
17963
  viewBox: "0 0 17 16",
17873
17964
  width: "17",
17874
17965
  xmlns: "http://www.w3.org/2000/svg"
17875
- }, /* @__PURE__ */ React67.createElement("path", {
17966
+ }, /* @__PURE__ */ React68.createElement("path", {
17876
17967
  d: "M3.04236 12.3027H4.18396V13.3008C4.18396 14.8525 5.03845 15.7002 6.59705 15.7002H13.6244C15.183 15.7002 16.0375 14.8525 16.0375 13.3008V6.24609C16.0375 4.69434 15.183 3.84668 13.6244 3.84668H12.4828V2.8418C12.4828 1.29688 11.6283 0.442383 10.0697 0.442383H3.04236C1.48376 0.442383 0.629272 1.29004 0.629272 2.8418V9.90332C0.629272 11.4551 1.48376 12.3027 3.04236 12.3027ZM3.23376 10.5391C2.68689 10.5391 2.39294 10.2656 2.39294 9.68457V3.06055C2.39294 2.47949 2.68689 2.21289 3.23376 2.21289H9.8783C10.4252 2.21289 10.7191 2.47949 10.7191 3.06055V3.84668H6.59705C5.03845 3.84668 4.18396 4.69434 4.18396 6.24609V10.5391H3.23376ZM6.78845 13.9365C6.24158 13.9365 5.94763 13.6699 5.94763 13.0889V6.45801C5.94763 5.87695 6.24158 5.61035 6.78845 5.61035H13.433C13.9799 5.61035 14.2738 5.87695 14.2738 6.45801V13.0889C14.2738 13.6699 13.9799 13.9365 13.433 13.9365H6.78845Z",
17877
17968
  fill: "currentColor"
17878
17969
  }));
17879
17970
 
17880
17971
  // src/components/Icons/LogoutIcon.tsx
17881
- import React68 from "react";
17972
+ import React69 from "react";
17882
17973
  var LogoutIcon = () => {
17883
- return /* @__PURE__ */ React68.createElement("svg", {
17974
+ return /* @__PURE__ */ React69.createElement("svg", {
17884
17975
  width: "16",
17885
17976
  height: "16",
17886
17977
  viewBox: "0 0 16 16",
17887
17978
  fill: "none",
17888
17979
  xmlns: "http://www.w3.org/2000/svg"
17889
- }, /* @__PURE__ */ React68.createElement("path", {
17980
+ }, /* @__PURE__ */ React69.createElement("path", {
17890
17981
  d: "M9.33463 13.3337H4.0013C3.26492 13.3337 2.66797 12.7367 2.66797 12.0003V4.00033C2.66797 3.26395 3.26492 2.66699 4.0013 2.66699H9.33463M6.66797 8.00033H14.0013M14.0013 8.00033L12.0013 10.0003M14.0013 8.00033L12.0013 6.00033",
17891
17982
  stroke: "currentColor",
17892
17983
  strokeWidth: "1.33333",
@@ -17906,22 +17997,22 @@ function LineItem({
17906
17997
  value,
17907
17998
  valueSuffix = null
17908
17999
  }) {
17909
- return /* @__PURE__ */ React69.createElement(Box, {
18000
+ return /* @__PURE__ */ React70.createElement(Box, {
17910
18001
  display: "flex",
17911
18002
  flexDirection: "column",
17912
18003
  gap: "8"
17913
- }, /* @__PURE__ */ React69.createElement(Text, {
18004
+ }, /* @__PURE__ */ React70.createElement(Text, {
17914
18005
  color: "modalTextSecondary",
17915
18006
  size: "14",
17916
18007
  weight: "medium"
17917
- }, label), /* @__PURE__ */ React69.createElement(Box, {
18008
+ }, label), /* @__PURE__ */ React70.createElement(Box, {
17918
18009
  display: "flex",
17919
18010
  flexDirection: "row",
17920
18011
  gap: "8"
17921
- }, /* @__PURE__ */ React69.createElement(Text, {
18012
+ }, /* @__PURE__ */ React70.createElement(Text, {
17922
18013
  color: "modalText",
17923
18014
  size: "16"
17924
- }, value), valueSuffix ? /* @__PURE__ */ React69.createElement(Box, {
18015
+ }, value), valueSuffix ? /* @__PURE__ */ React70.createElement(Box, {
17925
18016
  display: "flex",
17926
18017
  alignItems: "center"
17927
18018
  }, valueSuffix) : null));
@@ -17930,8 +18021,8 @@ function CopyAddress({
17930
18021
  address,
17931
18022
  type
17932
18023
  }) {
17933
- const [copiedAddress, setCopiedAddress] = useState16(false);
17934
- const copyAddressAction = useCallback8(() => {
18024
+ const [copiedAddress, setCopiedAddress] = useState17(false);
18025
+ const copyAddressAction = useCallback10(() => {
17935
18026
  if (address) {
17936
18027
  navigator.clipboard.writeText(address);
17937
18028
  setCopiedAddress(true);
@@ -17945,19 +18036,19 @@ function CopyAddress({
17945
18036
  return () => clearTimeout(timer);
17946
18037
  }
17947
18038
  }, [copiedAddress]);
17948
- return type === "button" ? /* @__PURE__ */ React69.createElement(FunIconButton, {
17949
- icon: /* @__PURE__ */ React69.createElement(Box, {
18039
+ return type === "button" ? /* @__PURE__ */ React70.createElement(FunIconButton, {
18040
+ icon: /* @__PURE__ */ React70.createElement(Box, {
17950
18041
  display: "flex",
17951
18042
  alignItems: "center",
17952
18043
  color: "modalTextSecondary"
17953
- }, copiedAddress ? /* @__PURE__ */ React69.createElement(CopiedIcon, null) : /* @__PURE__ */ React69.createElement(CopyIcon, null)),
18044
+ }, copiedAddress ? /* @__PURE__ */ React70.createElement(CopiedIcon, null) : /* @__PURE__ */ React70.createElement(CopyIcon, null)),
17954
18045
  onClick: copyAddressAction,
17955
18046
  showBorder: false
17956
- }) : type === "kv" ? /* @__PURE__ */ React69.createElement(FunKeyValue, {
18047
+ }) : type === "kv" ? /* @__PURE__ */ React70.createElement(FunKeyValue, {
17957
18048
  paddingY: "14",
17958
18049
  paddingX: "14",
17959
18050
  keyText: copiedAddress ? "Address Copied" : "Copy Address",
17960
- valueIcon: copiedAddress ? /* @__PURE__ */ React69.createElement(CopiedIcon, null) : /* @__PURE__ */ React69.createElement(CopyIcon, null),
18051
+ valueIcon: copiedAddress ? /* @__PURE__ */ React70.createElement(CopiedIcon, null) : /* @__PURE__ */ React70.createElement(CopyIcon, null),
17961
18052
  valueText: "",
17962
18053
  backgroundBaseColor: "modalBackground",
17963
18054
  onClick: copyAddressAction
@@ -17970,9 +18061,9 @@ function FWSettings({
17970
18061
  }) {
17971
18062
  const { address } = useAccount6();
17972
18063
  const { userEmail } = useFunkitWeb2Login();
17973
- const [animateOut, setAnimateOut] = useState16(false);
17974
- const [logoutConfirmationOpen, setLogoutConfirmationOpen] = useState16(false);
17975
- const handleBack = useCallback8(() => {
18064
+ const [animateOut, setAnimateOut] = useState17(false);
18065
+ const [logoutConfirmationOpen, setLogoutConfirmationOpen] = useState17(false);
18066
+ const handleBack = useCallback10(() => {
17976
18067
  setAnimateOut(true);
17977
18068
  if (logoutConfirmationOpen) {
17978
18069
  setTimeout(() => {
@@ -17983,36 +18074,36 @@ function FWSettings({
17983
18074
  setTimeout(onBack, 150);
17984
18075
  }
17985
18076
  }, [logoutConfirmationOpen, onBack]);
17986
- return /* @__PURE__ */ React69.createElement(Box, null, /* @__PURE__ */ React69.createElement(FunModalTitleSection, {
18077
+ return /* @__PURE__ */ React70.createElement(Box, null, /* @__PURE__ */ React70.createElement(FunModalTitleSection, {
17987
18078
  hasBackButton: true,
17988
18079
  onBack: handleBack,
17989
18080
  backAnimation: true,
17990
18081
  title: logoutConfirmationOpen ? "Logout" : "Settings",
17991
18082
  hasCloseButton: true,
17992
18083
  onClose
17993
- }), logoutConfirmationOpen ? /* @__PURE__ */ React69.createElement(Box, {
18084
+ }), logoutConfirmationOpen ? /* @__PURE__ */ React70.createElement(Box, {
17994
18085
  paddingTop: "16",
17995
18086
  paddingBottom: "28",
17996
18087
  className: animateOut ? animateContentOutClass5 : animateContentInClass5
17997
- }, /* @__PURE__ */ React69.createElement(Box, {
18088
+ }, /* @__PURE__ */ React70.createElement(Box, {
17998
18089
  paddingTop: "10",
17999
18090
  paddingBottom: "24"
18000
- }, /* @__PURE__ */ React69.createElement(Text, {
18091
+ }, /* @__PURE__ */ React70.createElement(Text, {
18001
18092
  color: "modalTextSecondary",
18002
18093
  size: "14",
18003
18094
  weight: "medium"
18004
- }, "Are you sure you want to logout?")), /* @__PURE__ */ React69.createElement(Box, {
18095
+ }, "Are you sure you want to logout?")), /* @__PURE__ */ React70.createElement(Box, {
18005
18096
  display: "flex",
18006
18097
  flexDirection: "column",
18007
18098
  gap: "5"
18008
- }, /* @__PURE__ */ React69.createElement(FunButton, {
18099
+ }, /* @__PURE__ */ React70.createElement(FunButton, {
18009
18100
  type: "warning",
18010
18101
  onClick: () => {
18011
18102
  onDisconnect();
18012
18103
  onClose();
18013
18104
  },
18014
18105
  title: "Logout"
18015
- }), /* @__PURE__ */ React69.createElement(FunButton, {
18106
+ }), /* @__PURE__ */ React70.createElement(FunButton, {
18016
18107
  type: "secondary",
18017
18108
  onClick: () => {
18018
18109
  setAnimateOut(true);
@@ -18022,25 +18113,25 @@ function FWSettings({
18022
18113
  }, 150);
18023
18114
  },
18024
18115
  title: "Cancel"
18025
- }))) : /* @__PURE__ */ React69.createElement(Box, {
18116
+ }))) : /* @__PURE__ */ React70.createElement(Box, {
18026
18117
  display: "flex",
18027
18118
  flexDirection: "column",
18028
18119
  gap: "24",
18029
18120
  paddingTop: "16",
18030
18121
  paddingBottom: "28",
18031
18122
  className: animateOut ? animateContentOutClass5 : animateContentInClass5
18032
- }, /* @__PURE__ */ React69.createElement(LineItem, {
18123
+ }, /* @__PURE__ */ React70.createElement(LineItem, {
18033
18124
  label: "Email",
18034
18125
  value: userEmail
18035
- }), /* @__PURE__ */ React69.createElement(LineItem, {
18126
+ }), /* @__PURE__ */ React70.createElement(LineItem, {
18036
18127
  label: "Address",
18037
18128
  value: formatAddress(address),
18038
- valueSuffix: /* @__PURE__ */ React69.createElement(CopyAddress, {
18129
+ valueSuffix: /* @__PURE__ */ React70.createElement(CopyAddress, {
18039
18130
  address,
18040
18131
  type: "button"
18041
18132
  })
18042
- }), /* @__PURE__ */ React69.createElement(FunButton, {
18043
- titlePrefix: /* @__PURE__ */ React69.createElement(LogoutIcon, null),
18133
+ }), /* @__PURE__ */ React70.createElement(FunButton, {
18134
+ titlePrefix: /* @__PURE__ */ React70.createElement(LogoutIcon, null),
18044
18135
  title: "Logout",
18045
18136
  onClick: () => {
18046
18137
  setAnimateOut(true);
@@ -18055,7 +18146,7 @@ function FWSettings({
18055
18146
 
18056
18147
  // src/components/QRCode/QRCode.tsx
18057
18148
  import QRCodeUtil from "qrcode";
18058
- import React70, { useMemo as useMemo13 } from "react";
18149
+ import React71, { useMemo as useMemo13 } from "react";
18059
18150
 
18060
18151
  // src/components/ConnectOptions/DesktopOptions.css.ts
18061
18152
  var QRCodeBackgroundClassName = "DesktopOptions_QRCodeBackgroundClassName__mu4zht0";
@@ -18099,7 +18190,7 @@ function QRCode({
18099
18190
  const y1 = (matrix.length - 7) * cellSize * y;
18100
18191
  for (let i = 0; i < 3; i++) {
18101
18192
  dots2.push(
18102
- /* @__PURE__ */ React70.createElement("rect", {
18193
+ /* @__PURE__ */ React71.createElement("rect", {
18103
18194
  fill: i % 2 !== 0 ? "white" : "black",
18104
18195
  height: cellSize * (7 - i * 2),
18105
18196
  key: `${i}-${x}-${y}`,
@@ -18121,7 +18212,7 @@ function QRCode({
18121
18212
  if (!(i < 7 && j < 7 || i > matrix.length - 8 && j < 7 || i < 7 && j > matrix.length - 8)) {
18122
18213
  if (!(i > matrixMiddleStart && i < matrixMiddleEnd && j > matrixMiddleStart && j < matrixMiddleEnd)) {
18123
18214
  dots2.push(
18124
- /* @__PURE__ */ React70.createElement("circle", {
18215
+ /* @__PURE__ */ React71.createElement("circle", {
18125
18216
  cx: i * cellSize + cellSize / 2,
18126
18217
  cy: j * cellSize + cellSize / 2,
18127
18218
  fill: "black",
@@ -18138,7 +18229,7 @@ function QRCode({
18138
18229
  }, [ecl, logoSize, size, uri]);
18139
18230
  const logoPosition = size / 2 - logoSize / 2;
18140
18231
  const logoWrapperSize = logoSize + logoMargin * 2;
18141
- return /* @__PURE__ */ React70.createElement(Box, {
18232
+ return /* @__PURE__ */ React71.createElement(Box, {
18142
18233
  borderColor: "generalBorder",
18143
18234
  borderRadius: "menuButton",
18144
18235
  borderStyle: "solid",
@@ -18146,14 +18237,14 @@ function QRCode({
18146
18237
  className: QRCodeBackgroundClassName,
18147
18238
  padding,
18148
18239
  width: "max"
18149
- }, /* @__PURE__ */ React70.createElement(Box, {
18240
+ }, /* @__PURE__ */ React71.createElement(Box, {
18150
18241
  style: {
18151
18242
  height: size,
18152
18243
  userSelect: "none",
18153
18244
  width: size
18154
18245
  },
18155
18246
  userSelect: "none"
18156
- }, /* @__PURE__ */ React70.createElement(Box, {
18247
+ }, /* @__PURE__ */ React71.createElement(Box, {
18157
18248
  display: "flex",
18158
18249
  justifyContent: "center",
18159
18250
  position: "relative",
@@ -18163,28 +18254,28 @@ function QRCode({
18163
18254
  width: size
18164
18255
  },
18165
18256
  width: "full"
18166
- }, /* @__PURE__ */ React70.createElement(AsyncImage, {
18257
+ }, /* @__PURE__ */ React71.createElement(AsyncImage, {
18167
18258
  background: logoBackground,
18168
18259
  borderColor: { custom: "rgba(0, 0, 0, 0.06)" },
18169
18260
  borderRadius: "13",
18170
18261
  height: logoSize,
18171
18262
  src: logoUrl,
18172
18263
  width: logoSize
18173
- })), /* @__PURE__ */ React70.createElement("svg", {
18264
+ })), /* @__PURE__ */ React71.createElement("svg", {
18174
18265
  height: size,
18175
18266
  style: { all: "revert" },
18176
18267
  width: size
18177
- }, /* @__PURE__ */ React70.createElement("defs", null, /* @__PURE__ */ React70.createElement("clipPath", {
18268
+ }, /* @__PURE__ */ React71.createElement("defs", null, /* @__PURE__ */ React71.createElement("clipPath", {
18178
18269
  id: "clip-wrapper"
18179
- }, /* @__PURE__ */ React70.createElement("rect", {
18270
+ }, /* @__PURE__ */ React71.createElement("rect", {
18180
18271
  height: logoWrapperSize,
18181
18272
  width: logoWrapperSize
18182
- })), /* @__PURE__ */ React70.createElement("clipPath", {
18273
+ })), /* @__PURE__ */ React71.createElement("clipPath", {
18183
18274
  id: "clip-logo"
18184
- }, /* @__PURE__ */ React70.createElement("rect", {
18275
+ }, /* @__PURE__ */ React71.createElement("rect", {
18185
18276
  height: logoSize,
18186
18277
  width: logoSize
18187
- }))), /* @__PURE__ */ React70.createElement("rect", {
18278
+ }))), /* @__PURE__ */ React71.createElement("rect", {
18188
18279
  fill: "transparent",
18189
18280
  height: size,
18190
18281
  width: size
@@ -18201,16 +18292,16 @@ function FunPaymentTransferType({
18201
18292
  onBackToHome,
18202
18293
  backAnimation = false
18203
18294
  }) {
18204
- return /* @__PURE__ */ React71.createElement(Box, {
18295
+ return /* @__PURE__ */ React72.createElement(Box, {
18205
18296
  className: backAnimation ? animateContentOutClass6 : animateContentInClass6
18206
- }, /* @__PURE__ */ React71.createElement(Box, {
18297
+ }, /* @__PURE__ */ React72.createElement(Box, {
18207
18298
  display: "flex",
18208
18299
  flexDirection: "column",
18209
18300
  gap: "5"
18210
- }, /* @__PURE__ */ React71.createElement(CopyAddress, {
18301
+ }, /* @__PURE__ */ React72.createElement(CopyAddress, {
18211
18302
  type: "kv",
18212
18303
  address
18213
- }), /* @__PURE__ */ React71.createElement(Box, {
18304
+ }), /* @__PURE__ */ React72.createElement(Box, {
18214
18305
  display: "flex",
18215
18306
  alignItems: "center",
18216
18307
  justifyContent: "center",
@@ -18219,19 +18310,19 @@ function FunPaymentTransferType({
18219
18310
  borderStyle: "solid",
18220
18311
  borderWidth: "1",
18221
18312
  borderRadius: "16"
18222
- }, /* @__PURE__ */ React71.createElement(QRCode, {
18313
+ }, /* @__PURE__ */ React72.createElement(QRCode, {
18223
18314
  uri: address,
18224
18315
  logoSize: 0,
18225
18316
  logoMargin: 0,
18226
18317
  size: 360
18227
- })), /* @__PURE__ */ React71.createElement(Text, {
18318
+ })), /* @__PURE__ */ React72.createElement(Text, {
18228
18319
  textAlign: "center",
18229
18320
  color: "modalTextDim",
18230
18321
  size: "12",
18231
18322
  weight: "medium"
18232
- }, "Scan the QR or copy and paste the payment details into your wallet.")), /* @__PURE__ */ React71.createElement(Box, {
18323
+ }, "Scan the QR or copy and paste the payment details into your wallet.")), /* @__PURE__ */ React72.createElement(Box, {
18233
18324
  paddingTop: "24"
18234
- }, /* @__PURE__ */ React71.createElement(FunButton, {
18325
+ }, /* @__PURE__ */ React72.createElement(FunButton, {
18235
18326
  title: "Back to Home",
18236
18327
  type: "primary",
18237
18328
  onClick: onBackToHome
@@ -18247,12 +18338,13 @@ function FunPaymentSetup({
18247
18338
  onSoftHide,
18248
18339
  onBackToHome,
18249
18340
  token,
18341
+ tokenChainId,
18250
18342
  tokenAmountUsd,
18251
18343
  backAnimation = false,
18252
18344
  redirectToCheckoutHistory
18253
18345
  }) {
18254
18346
  const { optionsMap } = useMeshExchanges({ fullInfo: false });
18255
- return paymentMethod === "brokerage" /* BROKERAGE */ ? /* @__PURE__ */ React72.createElement(FunPaymentMeshType, {
18347
+ return paymentMethod === "brokerage" /* BROKERAGE */ ? /* @__PURE__ */ React73.createElement(FunPaymentMeshType, {
18256
18348
  onFinish: (meshMeta) => {
18257
18349
  if (meshMeta) {
18258
18350
  const brokerName = meshMeta?.accessToken?.brokerName;
@@ -18267,23 +18359,120 @@ function FunPaymentSetup({
18267
18359
  },
18268
18360
  onSoftHide,
18269
18361
  backAnimation
18270
- }) : paymentMethod === "transfer" /* TRANSFER */ ? /* @__PURE__ */ React72.createElement(FunPaymentTransferType, {
18362
+ }) : paymentMethod === "transfer" /* TRANSFER */ ? /* @__PURE__ */ React73.createElement(FunPaymentTransferType, {
18271
18363
  address: paymentAddress,
18272
18364
  onBackToHome,
18273
18365
  backAnimation
18274
- }) : paymentMethod === "card" /* CARD */ ? /* @__PURE__ */ React72.createElement(FunPaymentMoonpayType, {
18366
+ }) : paymentMethod === "card" /* CARD */ ? /* @__PURE__ */ React73.createElement(FunPaymentMoonpayType, {
18275
18367
  paymentFlow,
18276
18368
  paymentAddress,
18277
18369
  depositToken: token,
18278
- depositUsdAmount: tokenAmountUsd,
18370
+ depositTokenChainId: tokenChainId,
18371
+ depositTokenAmount: tokenAmountUsd,
18279
18372
  onBackToHome,
18280
18373
  backAnimation,
18281
18374
  redirectToCheckoutHistory
18282
- }) : /* @__PURE__ */ React72.createElement(Text, {
18375
+ }) : /* @__PURE__ */ React73.createElement(Text, {
18283
18376
  color: "modalTextSecondary"
18284
18377
  }, "Unsupported payment method");
18285
18378
  }
18286
18379
 
18380
+ // src/components/FunToast/FunToast.tsx
18381
+ import React75, { useMemo as useMemo14 } from "react";
18382
+
18383
+ // src/components/Icons/SuccessNoBorder.tsx
18384
+ import React74 from "react";
18385
+ var SuccessNoBorderIcon = () => /* @__PURE__ */ React74.createElement("svg", {
18386
+ width: "21",
18387
+ height: "21",
18388
+ viewBox: "0 0 21 21",
18389
+ fill: "none",
18390
+ xmlns: "http://www.w3.org/2000/svg"
18391
+ }, /* @__PURE__ */ React74.createElement("path", {
18392
+ d: "M5.25 10.5004L8.96228 14.2127L16.3861 6.78809",
18393
+ stroke: "currentColor",
18394
+ strokeWidth: "2.5",
18395
+ strokeLinecap: "round",
18396
+ strokeLinejoin: "round"
18397
+ }));
18398
+
18399
+ // src/components/FunToast/FunToast.tsx
18400
+ var FUN_TOAST_TYPE_DEFAULT_CONFIG = {
18401
+ [1 /* ERROR */]: {
18402
+ borderColor: "connectButtonBackgroundError",
18403
+ borderWidth: "2",
18404
+ titleSuffix: /* @__PURE__ */ React75.createElement(CloseIcon, null)
18405
+ },
18406
+ [3 /* SUCCESS */]: {
18407
+ borderColor: "connectionIndicator",
18408
+ borderWidth: "2",
18409
+ titleSuffix: /* @__PURE__ */ React75.createElement(SuccessNoBorderIcon, null)
18410
+ },
18411
+ [2 /* PENDING */]: {
18412
+ borderColor: "standby",
18413
+ borderWidth: "2",
18414
+ titleSuffix: /* @__PURE__ */ React75.createElement(SpinnerIcon, null)
18415
+ },
18416
+ [0 /* INFO */]: {
18417
+ borderColor: void 0,
18418
+ borderWidth: void 0,
18419
+ titleSuffix: void 0
18420
+ }
18421
+ };
18422
+ function FunToast({
18423
+ type = 3 /* SUCCESS */,
18424
+ title,
18425
+ titleSuffix,
18426
+ hideTitleSuffix = false,
18427
+ description,
18428
+ isDescriptionText = true,
18429
+ icon
18430
+ }) {
18431
+ const styleConfigs = FUN_TOAST_TYPE_DEFAULT_CONFIG?.[type];
18432
+ const finalTitleSuffix = useMemo14(() => {
18433
+ if (titleSuffix) {
18434
+ return titleSuffix;
18435
+ }
18436
+ return styleConfigs.titleSuffix;
18437
+ }, [styleConfigs.titleSuffix, titleSuffix]);
18438
+ return /* @__PURE__ */ React75.createElement(Box, {
18439
+ marginBottom: "5",
18440
+ padding: "20",
18441
+ borderRadius: "16",
18442
+ borderColor: styleConfigs.borderColor,
18443
+ borderWidth: styleConfigs.borderWidth,
18444
+ borderStyle: "solid"
18445
+ }, /* @__PURE__ */ React75.createElement(Box, {
18446
+ display: "flex",
18447
+ flexDirection: "row",
18448
+ gap: "14"
18449
+ }, icon ? /* @__PURE__ */ React75.createElement(Box, {
18450
+ display: "flex",
18451
+ justifyContent: "center",
18452
+ alignItems: "center"
18453
+ }, icon) : null, /* @__PURE__ */ React75.createElement(Box, {
18454
+ display: "flex",
18455
+ flexDirection: "column",
18456
+ gap: "10",
18457
+ width: "full"
18458
+ }, /* @__PURE__ */ React75.createElement(Box, {
18459
+ display: "flex",
18460
+ flexDirection: "row",
18461
+ justifyContent: "space-between",
18462
+ width: "full"
18463
+ }, /* @__PURE__ */ React75.createElement(Text, {
18464
+ size: "18",
18465
+ weight: "bold",
18466
+ color: "modalText"
18467
+ }, title), hideTitleSuffix ? null : /* @__PURE__ */ React75.createElement(Box, {
18468
+ color: styleConfigs.borderColor
18469
+ }, finalTitleSuffix)), isDescriptionText ? /* @__PURE__ */ React75.createElement(Text, {
18470
+ size: "12",
18471
+ weight: "medium",
18472
+ color: "modalTextDim"
18473
+ }, description) : description)));
18474
+ }
18475
+
18287
18476
  // src/components/ProfileDetails/FunWalletProfileViews/FWDeposit.tsx
18288
18477
  var DEFAULT_DEPOSIT_TOKEN_TICKER = "USDC";
18289
18478
  var MINIMUM_MOONPAY_DEPOSIT_AMOUNT_USD = 30;
@@ -18293,20 +18482,21 @@ function FWDeposit({
18293
18482
  onSoftHide,
18294
18483
  onBack
18295
18484
  }) {
18296
- const [step, setStep] = useState17(0 /* INPUT_AMOUNT */);
18297
- const [depositAmount, setDepositAmount] = useState17("");
18298
- const [selectedPaymentMethodInfo, setSelectedPaymentMethodInfo] = useState17(null);
18299
- const [isDepositing, setIsDepositing] = useState17(false);
18300
- const [isFetchingEstimatedFees, setIsFetchingEstimatedFees] = useState17(false);
18301
- const [previewId, setPreviewId] = useState17("");
18302
- const [estimatedFees, setEstimatedFees] = useState17(0);
18303
- const [estimationError, setEstimationError] = useState17("");
18485
+ const [step, setStep] = useState18(0 /* INPUT_AMOUNT */);
18486
+ const [depositAmount, setDepositAmount] = useState18("");
18487
+ const [selectedPaymentMethodInfo, setSelectedPaymentMethodInfo] = useState18(null);
18488
+ const [isDepositing, setIsDepositing] = useState18(false);
18489
+ const [isFetchingEstimatedFees, setIsFetchingEstimatedFees] = useState18(false);
18490
+ const [previewId, setPreviewId] = useState18("");
18491
+ const [estimatedFees, setEstimatedFees] = useState18(0);
18492
+ const [estimationError, setEstimationError] = useState18("");
18304
18493
  const funkitConfig = useFunkitConfig();
18305
18494
  const { address: accountAddress } = useAccount7();
18306
- const { chain: activeChain } = useNetwork5();
18307
- const hasBack = useMemo14(() => step !== 5 /* PROCESSING */, [step]);
18308
- const [backAnimation, setBackAnimation] = useState17(false);
18309
- const handleBack = useCallback9(() => {
18495
+ const { chain: activeChain } = useNetwork4();
18496
+ const { showToast } = useFunToast();
18497
+ const hasBack = useMemo15(() => step !== 5 /* PROCESSING */, [step]);
18498
+ const [backAnimation, setBackAnimation] = useState18(false);
18499
+ const handleBack = useCallback11(() => {
18310
18500
  if (!hasBack) {
18311
18501
  return;
18312
18502
  }
@@ -18347,7 +18537,7 @@ function FWDeposit({
18347
18537
  return;
18348
18538
  }
18349
18539
  }, [hasBack, step, onBack]);
18350
- const onSelectPaymentMethodWithInfo = useCallback9(
18540
+ const onSelectPaymentMethodWithInfo = useCallback11(
18351
18541
  (selectedPaymentInfo) => {
18352
18542
  setSelectedPaymentMethodInfo(selectedPaymentInfo);
18353
18543
  if (selectedPaymentInfo?.meta) {
@@ -18361,7 +18551,7 @@ function FWDeposit({
18361
18551
  const { fetchInfo: manualFetchNetworkInfo } = useMeshActiveNetworkInfo(
18362
18552
  selectedPaymentMethodInfo?.meta?.accessToken?.brokerName
18363
18553
  );
18364
- const getMeshFees = useCallback9(async () => {
18554
+ const getMeshFees = useCallback11(async () => {
18365
18555
  if (!funkitConfig?.apiKey) {
18366
18556
  return;
18367
18557
  }
@@ -18415,37 +18605,60 @@ function FWDeposit({
18415
18605
  accountAddress,
18416
18606
  depositAmount
18417
18607
  ]);
18418
- const onConfirmDeposit = useCallback9(async () => {
18419
- const selectedMethod = selectedPaymentMethodInfo?.paymentMethod;
18420
- setIsDepositing(true);
18421
- switch (selectedMethod) {
18422
- case "brokerage" /* BROKERAGE */:
18423
- if (funkitConfig?.apiKey) {
18424
- const meshNetworkInfo = await manualFetchNetworkInfo();
18425
- const { previewId: previewId2, previewExpiresIn } = await previewBrokerageDeposit(
18426
- selectedPaymentMethodInfo?.meta?.accessToken?.accountTokens?.[0].accessToken,
18427
- selectedPaymentMethodInfo?.meta?.accessToken?.brokerName,
18428
- DEFAULT_DEPOSIT_TOKEN_TICKER,
18429
- (roundUpTo5DecimalPlaces(depositAmount) || 0).toString(),
18430
- accountAddress,
18431
- funkitConfig?.apiKey,
18432
- meshNetworkInfo.meshNetworkId
18433
- );
18434
- setPreviewId(previewId2);
18435
- setBackAnimation(true);
18436
- setTimeout(() => {
18437
- setStep(4 /* TWO_FACTOR */);
18438
- setBackAnimation(false);
18439
- }, ANIMATION_TIMEOUT);
18440
- } else {
18441
- throw new Error("Missing api key or mesh network id");
18442
- }
18443
- break;
18444
- case "transfer" /* TRANSFER */:
18445
- case "card" /* CARD */:
18446
- break;
18608
+ const onConfirmDeposit = useCallback11(async () => {
18609
+ try {
18610
+ const selectedMethod = selectedPaymentMethodInfo?.paymentMethod;
18611
+ setIsDepositing(true);
18612
+ switch (selectedMethod) {
18613
+ case "brokerage" /* BROKERAGE */:
18614
+ if (funkitConfig?.apiKey) {
18615
+ const meshNetworkInfo = await manualFetchNetworkInfo();
18616
+ const { previewId: previewId2, previewExpiresIn } = await previewBrokerageDeposit(
18617
+ selectedPaymentMethodInfo?.meta?.accessToken?.accountTokens?.[0].accessToken,
18618
+ selectedPaymentMethodInfo?.meta?.accessToken?.brokerName,
18619
+ DEFAULT_DEPOSIT_TOKEN_TICKER,
18620
+ (roundUpTo5DecimalPlaces(depositAmount) || 0).toString(),
18621
+ accountAddress,
18622
+ funkitConfig?.apiKey,
18623
+ meshNetworkInfo.meshNetworkId
18624
+ );
18625
+ const timeNowSeconds = Math.floor(Date.now() / 1e3);
18626
+ const previewExpiresAtSeconds = Number(previewExpiresIn) + timeNowSeconds;
18627
+ if (timeNowSeconds > previewExpiresAtSeconds) {
18628
+ showToast(
18629
+ {
18630
+ type: 1 /* ERROR */,
18631
+ title: "Error",
18632
+ description: `Your ${selectedPaymentMethodInfo?.meta?.accessToken?.brokerName} credentials have expired. Please reconnect.`
18633
+ },
18634
+ 5e3
18635
+ );
18636
+ setBackAnimation(true);
18637
+ setTimeout(() => {
18638
+ setStep(2 /* PAYMENT_SETUP */);
18639
+ setBackAnimation(false);
18640
+ }, ANIMATION_TIMEOUT);
18641
+ } else {
18642
+ setPreviewId(previewId2);
18643
+ setBackAnimation(true);
18644
+ setTimeout(() => {
18645
+ setStep(4 /* TWO_FACTOR */);
18646
+ setBackAnimation(false);
18647
+ }, ANIMATION_TIMEOUT);
18648
+ }
18649
+ } else {
18650
+ throw new Error("Missing api key or mesh network id");
18651
+ }
18652
+ break;
18653
+ case "transfer" /* TRANSFER */:
18654
+ case "card" /* CARD */:
18655
+ break;
18656
+ }
18657
+ } catch (err) {
18658
+ console.error(err);
18659
+ } finally {
18660
+ setIsDepositing(false);
18447
18661
  }
18448
- setIsDepositing(false);
18449
18662
  }, [
18450
18663
  accountAddress,
18451
18664
  depositAmount,
@@ -18453,9 +18666,10 @@ function FWDeposit({
18453
18666
  manualFetchNetworkInfo,
18454
18667
  selectedPaymentMethodInfo?.meta?.accessToken?.accountTokens,
18455
18668
  selectedPaymentMethodInfo?.meta?.accessToken?.brokerName,
18456
- selectedPaymentMethodInfo?.paymentMethod
18669
+ selectedPaymentMethodInfo?.paymentMethod,
18670
+ showToast
18457
18671
  ]);
18458
- return /* @__PURE__ */ React73.createElement(Box, null, /* @__PURE__ */ React73.createElement(FunModalTitleSection, {
18672
+ return /* @__PURE__ */ React76.createElement(Box, null, /* @__PURE__ */ React76.createElement(FunModalTitleSection, {
18459
18673
  hasBackButton: hasBack,
18460
18674
  onBack: handleBack,
18461
18675
  skipBackDelay: true,
@@ -18463,11 +18677,11 @@ function FWDeposit({
18463
18677
  title: "Deposit",
18464
18678
  hasCloseButton: true,
18465
18679
  onClose
18466
- }), /* @__PURE__ */ React73.createElement(Box, {
18680
+ }), /* @__PURE__ */ React76.createElement(Box, {
18467
18681
  paddingTop: "24",
18468
18682
  paddingBottom: "20",
18469
18683
  width: "full"
18470
- }, step === 0 /* INPUT_AMOUNT */ ? /* @__PURE__ */ React73.createElement(FunOnrampInputStep, {
18684
+ }, step === 0 /* INPUT_AMOUNT */ ? /* @__PURE__ */ React76.createElement(FunOnrampInputStep, {
18471
18685
  tokenTicker: DEFAULT_DEPOSIT_TOKEN_TICKER,
18472
18686
  amount: depositAmount,
18473
18687
  onChangeAmount: setDepositAmount,
@@ -18475,7 +18689,7 @@ function FWDeposit({
18475
18689
  onClickContinue: () => {
18476
18690
  setStep(1 /* SELECT_PAYMENT_METHOD */);
18477
18691
  }
18478
- }) : step === 1 /* SELECT_PAYMENT_METHOD */ ? /* @__PURE__ */ React73.createElement(FunPaymentMethods, {
18692
+ }) : step === 1 /* SELECT_PAYMENT_METHOD */ ? /* @__PURE__ */ React76.createElement(FunPaymentMethods, {
18479
18693
  paymentFlow: 0 /* DEPOSIT */,
18480
18694
  onSelect: onSelectPaymentMethodWithInfo,
18481
18695
  backAnimation,
@@ -18483,7 +18697,7 @@ function FWDeposit({
18483
18697
  amount: depositAmount,
18484
18698
  tokenTicker: DEFAULT_DEPOSIT_TOKEN_TICKER
18485
18699
  }
18486
- }) : step === 2 /* PAYMENT_SETUP */ ? /* @__PURE__ */ React73.createElement(FunPaymentSetup, {
18700
+ }) : step === 2 /* PAYMENT_SETUP */ ? /* @__PURE__ */ React76.createElement(FunPaymentSetup, {
18487
18701
  paymentFlow: 0 /* DEPOSIT */,
18488
18702
  paymentAddress: accountAddress,
18489
18703
  paymentMethod: selectedPaymentMethodInfo?.paymentMethod,
@@ -18495,8 +18709,9 @@ function FWDeposit({
18495
18709
  onSoftHide,
18496
18710
  onBackToHome: onBack,
18497
18711
  token: DEFAULT_DEPOSIT_TOKEN_TICKER,
18712
+ tokenChainId: activeChain?.id.toString() || "",
18498
18713
  tokenAmountUsd: parseFloat(depositAmount) || 0
18499
- }) : step === 3 /* CONFIRMATION */ ? /* @__PURE__ */ React73.createElement(FunOnrampConfirmationStep, {
18714
+ }) : step === 3 /* CONFIRMATION */ ? /* @__PURE__ */ React76.createElement(FunOnrampConfirmationStep, {
18500
18715
  paymentMethodInfo: selectedPaymentMethodInfo,
18501
18716
  token: DEFAULT_DEPOSIT_TOKEN_TICKER,
18502
18717
  tokenAmountUsd: parseFloat(depositAmount) || 0,
@@ -18509,13 +18724,13 @@ function FWDeposit({
18509
18724
  isFetchingEstimatedFees,
18510
18725
  isConfirming: isDepositing,
18511
18726
  backAnimation
18512
- }) : step === 4 /* TWO_FACTOR */ ? /* @__PURE__ */ React73.createElement(FunMeshTwoFactorStep, {
18727
+ }) : step === 4 /* TWO_FACTOR */ ? /* @__PURE__ */ React76.createElement(FunMeshTwoFactorStep, {
18513
18728
  previewId,
18514
18729
  onSuccess: () => {
18515
18730
  setStep(5 /* PROCESSING */);
18516
18731
  },
18517
18732
  paymentMethodInfo: selectedPaymentMethodInfo
18518
- }) : step === 5 /* PROCESSING */ ? /* @__PURE__ */ React73.createElement(FunOnrampProcessingStep, {
18733
+ }) : step === 5 /* PROCESSING */ ? /* @__PURE__ */ React76.createElement(FunOnrampProcessingStep, {
18519
18734
  tokenAmountUsd: parseFloat(depositAmount) || 0,
18520
18735
  token: DEFAULT_DEPOSIT_TOKEN_TICKER,
18521
18736
  isDepositing
@@ -18538,32 +18753,32 @@ var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
18538
18753
  var PAYMENT_METHOD_CONFIG = {
18539
18754
  ["balance" /* ACCOUNT_BALANCE */]: {
18540
18755
  label: "Account Balance",
18541
- icon: /* @__PURE__ */ React74.createElement(WalletDecoratedIcon, null),
18542
- timeIcon: /* @__PURE__ */ React74.createElement(LightningIcon, null),
18756
+ icon: /* @__PURE__ */ React77.createElement(WalletDecoratedIcon, null),
18757
+ timeIcon: /* @__PURE__ */ React77.createElement(LightningIcon, null),
18543
18758
  timeRange: "Instant",
18544
18759
  isEnabledForOnramp: false,
18545
18760
  isEnabledForCheckout: true
18546
18761
  },
18547
18762
  ["brokerage" /* BROKERAGE */]: {
18548
18763
  label: "Brokerage or Exchange",
18549
- icon: /* @__PURE__ */ React74.createElement(BrokerageIcon, null),
18550
- timeIcon: /* @__PURE__ */ React74.createElement(ClockIcon, null),
18764
+ icon: /* @__PURE__ */ React77.createElement(BrokerageIcon, null),
18765
+ timeIcon: /* @__PURE__ */ React77.createElement(ClockIcon, null),
18551
18766
  timeRange: "2 - 3 mins",
18552
18767
  isEnabledForOnramp: true,
18553
18768
  isEnabledForCheckout: true
18554
18769
  },
18555
18770
  ["card" /* CARD */]: {
18556
18771
  label: "Debit or Credit",
18557
- icon: /* @__PURE__ */ React74.createElement(CreditCardIcon, null),
18558
- timeIcon: /* @__PURE__ */ React74.createElement(ClockIcon, null),
18772
+ icon: /* @__PURE__ */ React77.createElement(CreditCardIcon, null),
18773
+ timeIcon: /* @__PURE__ */ React77.createElement(ClockIcon, null),
18559
18774
  timeRange: "1 - 2 mins",
18560
18775
  isEnabledForOnramp: true,
18561
18776
  isEnabledForCheckout: true
18562
18777
  },
18563
18778
  ["transfer" /* TRANSFER */]: {
18564
18779
  label: "Transfer Crypto",
18565
- icon: /* @__PURE__ */ React74.createElement(TransferCryptoIcon, null),
18566
- timeIcon: /* @__PURE__ */ React74.createElement(LightningIcon, null),
18780
+ icon: /* @__PURE__ */ React77.createElement(TransferCryptoIcon, null),
18781
+ timeIcon: /* @__PURE__ */ React77.createElement(LightningIcon, null),
18567
18782
  timeRange: "Instant",
18568
18783
  isEnabledForOnramp: true,
18569
18784
  isEnabledForCheckout: false
@@ -18578,7 +18793,7 @@ function AddPaymentMethodItem({
18578
18793
  disclaimerText
18579
18794
  }) {
18580
18795
  const config = PAYMENT_METHOD_CONFIG[paymentMethod];
18581
- const isEnabledForFlow = useMemo15(() => {
18796
+ const isEnabledForFlow = useMemo16(() => {
18582
18797
  if (paymentFlow === 1 /* CHECKOUT */) {
18583
18798
  return config.isEnabledForCheckout;
18584
18799
  } else if (paymentFlow === 0 /* DEPOSIT */) {
@@ -18588,9 +18803,9 @@ function AddPaymentMethodItem({
18588
18803
  }
18589
18804
  }, [paymentFlow, config]);
18590
18805
  if (!PAYMENT_METHOD_CONFIG?.[paymentMethod]) {
18591
- return /* @__PURE__ */ React74.createElement(React74.Fragment, null);
18806
+ return /* @__PURE__ */ React77.createElement(React77.Fragment, null);
18592
18807
  }
18593
- return /* @__PURE__ */ React74.createElement(FunKeyValue, {
18808
+ return /* @__PURE__ */ React77.createElement(FunKeyValue, {
18594
18809
  keyIcon: config.icon,
18595
18810
  keyText: config.label,
18596
18811
  valueIcon: config.timeIcon,
@@ -18611,9 +18826,9 @@ function ExistingPaymentMethodItem({
18611
18826
  isClickable = true
18612
18827
  }) {
18613
18828
  if (!PAYMENT_METHOD_CONFIG?.[paymentMethodInfo?.paymentMethod]) {
18614
- return /* @__PURE__ */ React74.createElement(React74.Fragment, null);
18829
+ return /* @__PURE__ */ React77.createElement(React77.Fragment, null);
18615
18830
  }
18616
- return /* @__PURE__ */ React74.createElement(FunKeyValue, {
18831
+ return /* @__PURE__ */ React77.createElement(FunKeyValue, {
18617
18832
  keyIcon: paymentMethodInfo?.titleIcon,
18618
18833
  keyText: paymentMethodInfo?.title,
18619
18834
  valueIcon: paymentMethodInfo?.descriptionIcon,
@@ -18633,12 +18848,13 @@ function FunPaymentMethods({
18633
18848
  backAnimation = false,
18634
18849
  depositInfo
18635
18850
  }) {
18636
- const [selectedOption, setSelectedOption] = useState18(
18851
+ const [selectedOption, setSelectedOption] = useState19(
18637
18852
  null
18638
18853
  );
18854
+ const [isContinuing, setIsContinuing] = useState19(false);
18639
18855
  useFunWalletAssetsListener();
18640
18856
  const { funWalletAssets } = useFunkitWallet();
18641
- const hasSufficientBalance = useMemo15(() => {
18857
+ const hasSufficientBalance = useMemo16(() => {
18642
18858
  if (!depositInfo?.amount)
18643
18859
  return true;
18644
18860
  const tokenKeys = Object.keys(funWalletAssets || {});
@@ -18651,11 +18867,12 @@ function FunPaymentMethods({
18651
18867
  });
18652
18868
  return isNotNullish(foundAsset);
18653
18869
  }, [depositInfo?.amount, funWalletAssets]);
18654
- const canContinue = useMemo15(() => {
18870
+ const canContinue = useMemo16(() => {
18655
18871
  return isNotNullish(selectedOption) && Object.values(PaymentMethod).includes(selectedOption);
18656
18872
  }, [selectedOption]);
18657
- const onClickContinue = useCallback10(() => {
18873
+ const onClickContinue = useCallback12(() => {
18658
18874
  if (canContinue) {
18875
+ setIsContinuing(true);
18659
18876
  onSelect({
18660
18877
  paymentMethod: selectedOption,
18661
18878
  title: "",
@@ -18666,8 +18883,8 @@ function FunPaymentMethods({
18666
18883
  });
18667
18884
  }
18668
18885
  }, [canContinue, onSelect, selectedOption]);
18669
- const PaymentMethodListWithStatus = Object.keys(PAYMENT_METHOD_CONFIG).map(
18670
- (paymentMethod) => {
18886
+ const PaymentMethodListWithStatus = useMemo16(() => {
18887
+ return Object.keys(PAYMENT_METHOD_CONFIG).map((paymentMethod) => {
18671
18888
  if (paymentFlow === 0 /* DEPOSIT */ && paymentMethod === "balance" /* ACCOUNT_BALANCE */ || paymentFlow === 1 /* CHECKOUT */ && paymentMethod === "transfer" /* TRANSFER */) {
18672
18889
  return {
18673
18890
  status: false,
@@ -18679,21 +18896,28 @@ function FunPaymentMethods({
18679
18896
  const isClickable = !isDisabled && !shouldDisableMoonpay && !shouldDisableAccBalance;
18680
18897
  return {
18681
18898
  status: isClickable,
18682
- component: /* @__PURE__ */ React74.createElement(AddPaymentMethodItem, {
18899
+ component: /* @__PURE__ */ React77.createElement(AddPaymentMethodItem, {
18683
18900
  key: paymentMethod,
18684
18901
  paymentFlow,
18685
18902
  paymentMethod,
18686
18903
  isActive: paymentMethod === selectedOption,
18687
- isClickable,
18904
+ isClickable: isClickable && !isContinuing,
18688
18905
  disclaimerText: shouldDisableMoonpay ? `Minimum ${PaymentFlow[paymentFlow].toLowerCase()} value of $${MINIMUM_MOONPAY_DEPOSIT_AMOUNT_USD} required.` : shouldDisableAccBalance ? `Insufficient account balance.` : "",
18689
18906
  onClick: () => {
18690
18907
  setSelectedOption(paymentMethod);
18691
18908
  }
18692
18909
  })
18693
18910
  };
18694
- }
18695
- );
18696
- return /* @__PURE__ */ React74.createElement(Box, {
18911
+ });
18912
+ }, [
18913
+ depositInfo?.amount,
18914
+ hasSufficientBalance,
18915
+ isContinuing,
18916
+ isDisabled,
18917
+ paymentFlow,
18918
+ selectedOption
18919
+ ]);
18920
+ return /* @__PURE__ */ React77.createElement(Box, {
18697
18921
  display: "flex",
18698
18922
  flexDirection: "column",
18699
18923
  gap: "24",
@@ -18701,12 +18925,12 @@ function FunPaymentMethods({
18701
18925
  opacity: isDisabled ? 0.5 : 1,
18702
18926
  cursor: isDisabled ? "not-allowed" : void 0
18703
18927
  }
18704
- }, depositInfo && paymentFlow === 0 /* DEPOSIT */ ? /* @__PURE__ */ React74.createElement(Box, {
18928
+ }, depositInfo && paymentFlow === 0 /* DEPOSIT */ ? /* @__PURE__ */ React77.createElement(Box, {
18705
18929
  display: "flex",
18706
18930
  flexDirection: "column",
18707
18931
  alignItems: "center",
18708
18932
  gap: "8"
18709
- }, /* @__PURE__ */ React74.createElement(Box, {
18933
+ }, /* @__PURE__ */ React77.createElement(Box, {
18710
18934
  display: "flex",
18711
18935
  alignItems: "center",
18712
18936
  gap: "8",
@@ -18714,13 +18938,13 @@ function FunPaymentMethods({
18714
18938
  paddingX: "12",
18715
18939
  paddingY: "8",
18716
18940
  borderRadius: "16"
18717
- }, /* @__PURE__ */ React74.createElement(USDCIcon, null), /* @__PURE__ */ React74.createElement(Text, {
18941
+ }, /* @__PURE__ */ React77.createElement(USDCIcon, null), /* @__PURE__ */ React77.createElement(Text, {
18718
18942
  size: "14",
18719
18943
  color: "modalText"
18720
- }, depositInfo.tokenTicker)), /* @__PURE__ */ React74.createElement(Box, {
18944
+ }, depositInfo.tokenTicker)), /* @__PURE__ */ React77.createElement(Box, {
18721
18945
  display: "flex",
18722
18946
  wrap: "nowrap"
18723
- }, /* @__PURE__ */ React74.createElement(Text, {
18947
+ }, /* @__PURE__ */ React77.createElement(Text, {
18724
18948
  size: "57",
18725
18949
  color: "modalText",
18726
18950
  style: {
@@ -18729,7 +18953,7 @@ function FunPaymentMethods({
18729
18953
  lineHeight: "68px",
18730
18954
  paddingRight: "4px"
18731
18955
  }
18732
- }, "$"), /* @__PURE__ */ React74.createElement(Text, {
18956
+ }, "$"), /* @__PURE__ */ React77.createElement(Text, {
18733
18957
  size: "57",
18734
18958
  color: "modalText",
18735
18959
  style: {
@@ -18737,32 +18961,40 @@ function FunPaymentMethods({
18737
18961
  fontSize: "57px",
18738
18962
  lineHeight: "68px"
18739
18963
  }
18740
- }, depositInfo.amount))) : null, /* @__PURE__ */ React74.createElement(Box, {
18964
+ }, depositInfo.amount))) : null, /* @__PURE__ */ React77.createElement(Box, {
18741
18965
  id: "add-methods",
18742
18966
  display: "flex",
18743
18967
  flexDirection: "column",
18744
18968
  gap: "24"
18745
- }, /* @__PURE__ */ React74.createElement(Text, {
18969
+ }, /* @__PURE__ */ React77.createElement(Text, {
18746
18970
  size: "18",
18747
18971
  weight: "semibold",
18748
18972
  color: "modalTextSecondary"
18749
- }, "Select Payment Method"), /* @__PURE__ */ React74.createElement(Box, {
18973
+ }, "Select Payment Method"), /* @__PURE__ */ React77.createElement(Box, {
18750
18974
  id: "method-list",
18751
18975
  display: "flex",
18752
18976
  flexDirection: "column",
18753
18977
  gap: "10"
18754
18978
  }, PaymentMethodListWithStatus.sort(
18755
18979
  (a, b) => Number(b.status) - Number(a.status)
18756
- ).map((i) => i?.component))), /* @__PURE__ */ React74.createElement(FunButton, {
18980
+ ).map((i) => i?.component))), /* @__PURE__ */ React77.createElement(FunButton, {
18757
18981
  title: "Continue",
18758
- isDisabled: !canContinue,
18982
+ isDisabled: !canContinue || isContinuing,
18759
18983
  type: "primary",
18760
- onClick: onClickContinue
18984
+ onClick: onClickContinue,
18985
+ titleSuffix: isContinuing ? /* @__PURE__ */ React77.createElement(Box, {
18986
+ display: "flex",
18987
+ alignItems: "center",
18988
+ color: "modalText"
18989
+ }, /* @__PURE__ */ React77.createElement(SpinnerIcon, {
18990
+ height: 16,
18991
+ width: 16
18992
+ })) : null
18761
18993
  }));
18762
18994
  }
18763
18995
 
18764
18996
  // src/components/FunkitProvider/FunkitCheckoutContext.tsx
18765
- var FunkitCheckoutContext = createContext11({
18997
+ var FunkitCheckoutContext = createContext12({
18766
18998
  activeCheckouts: {},
18767
18999
  checkoutHistoryList: [],
18768
19000
  checkoutHistoryStateMap: {},
@@ -18784,18 +19016,18 @@ function FunkitCheckoutProvider({ children }) {
18784
19016
  const funkitConfig = useFunkitConfig();
18785
19017
  const account = useAccount8();
18786
19018
  const { funWallet, auth: funWalletAuth } = useFunkitWallet();
18787
- const [checkoutHistoryList, setCheckoutHistoryList] = useState19([]);
19019
+ const [checkoutHistoryList, setCheckoutHistoryList] = useState20([]);
18788
19020
  const {
18789
19021
  stateMap: checkoutHistoryStateMap,
18790
19022
  depositAddrMap: checkoutHistoryDepositAddrMap
18791
- } = useMemo16(() => {
19023
+ } = useMemo17(() => {
18792
19024
  return categorizeCheckoutHistories(checkoutHistoryList);
18793
19025
  }, [checkoutHistoryList]);
18794
- const [activeCheckouts, setActiveCheckouts] = useState19({});
19026
+ const [activeCheckouts, setActiveCheckouts] = useState20({});
18795
19027
  const [refreshSymbol, triggerRefreshSymbol] = useSymbolRefresh_default();
18796
- const [isCheckoutHistoryInited, setIsCheckoutHistoryInited] = useState19(false);
18797
- const [isRefreshingCheckoutHistory, setIsRefreshingCheckoutHistory] = useState19(true);
18798
- const _refreshCheckoutHistory = useCallback11(async () => {
19028
+ const [isCheckoutHistoryInited, setIsCheckoutHistoryInited] = useState20(false);
19029
+ const [isRefreshingCheckoutHistory, setIsRefreshingCheckoutHistory] = useState20(true);
19030
+ const _refreshCheckoutHistory = useCallback13(async () => {
18799
19031
  if (funkitConfig?.apiKey && account.address) {
18800
19032
  try {
18801
19033
  setIsRefreshingCheckoutHistory(true);
@@ -18817,16 +19049,16 @@ function FunkitCheckoutProvider({ children }) {
18817
19049
  useEffect20(() => {
18818
19050
  _refreshCheckoutHistory().catch(console.error);
18819
19051
  }, [refreshSymbol]);
18820
- const _startCheckoutHistoryListener = useCallback11(() => {
19052
+ const _startCheckoutHistoryListener = useCallback13(() => {
18821
19053
  clearInterval(intervalRef.current);
18822
19054
  intervalRef.current = setInterval(() => {
18823
19055
  triggerRefreshSymbol();
18824
19056
  }, CHECKOUT_HISTORY_REFETCH_INTERVAL_MS);
18825
19057
  }, [triggerRefreshSymbol]);
18826
- const _stopCheckoutHistoryListener = useCallback11(() => {
19058
+ const _stopCheckoutHistoryListener = useCallback13(() => {
18827
19059
  clearInterval(intervalRef.current);
18828
19060
  }, []);
18829
- const _initNewCheckout = useCallback11(
19061
+ const _initNewCheckout = useCallback13(
18830
19062
  (initSettings) => {
18831
19063
  const newCheckoutId = uuid();
18832
19064
  const newActiveCheckoutItem = {
@@ -18848,7 +19080,7 @@ function FunkitCheckoutProvider({ children }) {
18848
19080
  },
18849
19081
  [activeCheckouts]
18850
19082
  );
18851
- const _updateSelectedSourceAsset = useCallback11(
19083
+ const _updateSelectedSourceAsset = useCallback13(
18852
19084
  (checkoutId, selectedSourceAssetAddress, selectedSourceAssetSymbol, selectedSourceAssetChainId) => {
18853
19085
  if (!activeCheckouts?.[checkoutId]) {
18854
19086
  throw new Error(
@@ -18872,7 +19104,7 @@ function FunkitCheckoutProvider({ children }) {
18872
19104
  },
18873
19105
  [activeCheckouts]
18874
19106
  );
18875
- const _getCheckoutDraftDollarValue = useCallback11(
19107
+ const _getCheckoutDraftDollarValue = useCallback13(
18876
19108
  async (checkoutId) => {
18877
19109
  if (!activeCheckouts?.[checkoutId]) {
18878
19110
  throw new Error(
@@ -18900,8 +19132,8 @@ function FunkitCheckoutProvider({ children }) {
18900
19132
  },
18901
19133
  [activeCheckouts]
18902
19134
  );
18903
- const _getCheckoutQuote = useCallback11(
18904
- async (checkoutId) => {
19135
+ const _getCheckoutQuote = useCallback13(
19136
+ async (checkoutId, sponsorInitialTransferGasLimit) => {
18905
19137
  if (!activeCheckouts?.[checkoutId]) {
18906
19138
  throw new Error(
18907
19139
  `Funkit Internal Error: Unable to find checkout with id: ${checkoutId}`
@@ -18936,6 +19168,7 @@ function FunkitCheckoutProvider({ children }) {
18936
19168
  expirationTimestampMs: parseInt(
18937
19169
  checkoutItem.initSettings.config.expirationTimestampMs.toString()
18938
19170
  ),
19171
+ sponsorInitialTransferGasLimit: sponsorInitialTransferGasLimit.toString(),
18939
19172
  apiKey: funkitConfig.apiKey || ""
18940
19173
  });
18941
19174
  checkoutItem?.initSettings?.onEstimation?.(newEstimation);
@@ -18963,7 +19196,7 @@ function FunkitCheckoutProvider({ children }) {
18963
19196
  },
18964
19197
  [account?.address, activeCheckouts, funkitConfig?.apiKey]
18965
19198
  );
18966
- const _generateSignedBatchOperation = useCallback11(
19199
+ const _generateSignedBatchOperation = useCallback13(
18967
19200
  async (actionsParams, assetChainId, bypassWalletInit) => {
18968
19201
  if (!funWallet || !funWalletAuth || !account.address) {
18969
19202
  throw new Error("Funwallet or auth not defined");
@@ -19001,7 +19234,7 @@ function FunkitCheckoutProvider({ children }) {
19001
19234
  },
19002
19235
  [funWallet, funWalletAuth, account]
19003
19236
  );
19004
- const _confirmCheckout = useCallback11(
19237
+ const _confirmCheckout = useCallback13(
19005
19238
  async (checkoutId, paymentMethod) => {
19006
19239
  if (!funkitConfig?.apiKey) {
19007
19240
  throw new Error(
@@ -19019,10 +19252,11 @@ function FunkitCheckoutProvider({ children }) {
19019
19252
  `Funkit Internal Error: Unable to find checkout with id: ${checkoutId}`
19020
19253
  );
19021
19254
  }
19255
+ const isAccountBalancePaymentMethod = paymentMethod === "balance" /* ACCOUNT_BALANCE */;
19022
19256
  const signedBatchOperation = await _generateSignedBatchOperation(
19023
19257
  checkoutItem.initSettings.config.actionsParams,
19024
19258
  checkoutItem.initSettings.config.targetChain,
19025
- paymentMethod === "balance" /* ACCOUNT_BALANCE */
19259
+ isAccountBalancePaymentMethod
19026
19260
  );
19027
19261
  const depositAddress = await postApiInitializeCheckout({
19028
19262
  userOp: signedBatchOperation.userOp,
@@ -19064,7 +19298,7 @@ function FunkitCheckoutProvider({ children }) {
19064
19298
  _confirmCheckout,
19065
19299
  _generateSignedBatchOperation
19066
19300
  };
19067
- return /* @__PURE__ */ React75.createElement(FunkitCheckoutContext.Provider, {
19301
+ return /* @__PURE__ */ React78.createElement(FunkitCheckoutContext.Provider, {
19068
19302
  value: contextValue
19069
19303
  }, children);
19070
19304
  }
@@ -19075,7 +19309,7 @@ var useFunkitPreCheckoutInternal = (checkoutId) => {
19075
19309
  _confirmCheckout,
19076
19310
  _getCheckoutQuote,
19077
19311
  _getCheckoutDraftDollarValue
19078
- } = useContext9(FunkitCheckoutContext);
19312
+ } = useContext10(FunkitCheckoutContext);
19079
19313
  if (!checkoutId) {
19080
19314
  return {
19081
19315
  checkoutItem: null,
@@ -19094,12 +19328,12 @@ var useFunkitPreCheckoutInternal = (checkoutId) => {
19094
19328
  newSourceAssetChainId
19095
19329
  ),
19096
19330
  confirmCheckout: async (paymentMethod) => await _confirmCheckout(checkoutId, paymentMethod),
19097
- getCheckoutQuote: async () => await _getCheckoutQuote(checkoutId),
19331
+ getCheckoutQuote: async (sponsorInitialTransferGasLimit) => await _getCheckoutQuote(checkoutId, sponsorInitialTransferGasLimit),
19098
19332
  getCheckoutDraftDollarValue: async () => await _getCheckoutDraftDollarValue(checkoutId)
19099
19333
  };
19100
19334
  };
19101
19335
  var useFunkitPostCheckoutInternal = (depositAddress) => {
19102
- const { checkoutHistoryDepositAddrMap } = useContext9(FunkitCheckoutContext);
19336
+ const { checkoutHistoryDepositAddrMap } = useContext10(FunkitCheckoutContext);
19103
19337
  if (!depositAddress || !isAddress2(depositAddress) || !checkoutHistoryDepositAddrMap?.[depositAddress]) {
19104
19338
  throw new Error("Invalid depositAddress");
19105
19339
  }
@@ -19113,7 +19347,7 @@ var useFunkitAllPostCheckoutsInternal = () => {
19113
19347
  isRefreshingCheckoutHistory,
19114
19348
  _startCheckoutHistoryListener,
19115
19349
  _stopCheckoutHistoryListener
19116
- } = useContext9(FunkitCheckoutContext);
19350
+ } = useContext10(FunkitCheckoutContext);
19117
19351
  return {
19118
19352
  checkoutHistoryList,
19119
19353
  checkoutHistoryStateMap,
@@ -19125,14 +19359,14 @@ var useFunkitAllPostCheckoutsInternal = () => {
19125
19359
  };
19126
19360
  var useFunkitCheckout = (props) => {
19127
19361
  const { config, onValidation, onDirectExecution } = props;
19128
- const { _initNewCheckout, _generateSignedBatchOperation } = useContext9(
19362
+ const { _initNewCheckout, _generateSignedBatchOperation } = useContext10(
19129
19363
  FunkitCheckoutContext
19130
19364
  );
19131
19365
  const { openFunCheckoutModal } = useFunCheckoutModal();
19132
19366
  const connectionStatus = useConnectionStatus();
19133
19367
  const { isLoggedIn: isWeb2Login, funWallet, auth } = useFunkitWallet();
19134
- const networks = useNetwork6();
19135
- const _handleWeb3DirectExecution = useCallback11(async () => {
19368
+ const networks = useNetwork5();
19369
+ const _handleWeb3DirectExecution = useCallback13(async () => {
19136
19370
  for (let i = 0; i < config.actionsParams.length; i++) {
19137
19371
  try {
19138
19372
  const { request } = await prepareWriteContract({
@@ -19155,7 +19389,7 @@ var useFunkitCheckout = (props) => {
19155
19389
  }
19156
19390
  }
19157
19391
  }, [config.actionsParams, onDirectExecution]);
19158
- const _handleWeb2DirectExecution = useCallback11(async () => {
19392
+ const _handleWeb2DirectExecution = useCallback13(async () => {
19159
19393
  if (funWallet && auth) {
19160
19394
  try {
19161
19395
  const batchOperation = await _generateSignedBatchOperation(
@@ -19192,7 +19426,7 @@ var useFunkitCheckout = (props) => {
19192
19426
  funWallet,
19193
19427
  onDirectExecution
19194
19428
  ]);
19195
- const beginCheckout = useCallback11(async () => {
19429
+ const beginCheckout = useCallback13(async () => {
19196
19430
  const validationResult = validateCheckoutConfig(config);
19197
19431
  onValidation?.(validationResult);
19198
19432
  if (validationResult.isValid) {
@@ -19253,43 +19487,6 @@ var useFunkitCheckout = (props) => {
19253
19487
  };
19254
19488
  };
19255
19489
 
19256
- // src/components/FunkitProvider/FunToastContext.tsx
19257
- import React76, { createContext as createContext12, useCallback as useCallback12, useContext as useContext10, useState as useState20 } from "react";
19258
- var FunToastContext = createContext12({
19259
- toastContent: null,
19260
- showToast: () => void 0,
19261
- hideToast: () => void 0,
19262
- closing: false
19263
- });
19264
- function useFunToast() {
19265
- return useContext10(FunToastContext);
19266
- }
19267
- function FunToastProvider({ children }) {
19268
- const [toastContent, setToastContent] = useState20(null);
19269
- const [closing, setClosing] = useState20(false);
19270
- const showToast = useCallback12(
19271
- (newToastContent, displayTimeMs = 0) => {
19272
- setClosing(false);
19273
- setToastContent({ ...newToastContent });
19274
- if (displayTimeMs) {
19275
- setTimeout(() => {
19276
- setClosing(true);
19277
- setTimeout(() => {
19278
- setToastContent(null);
19279
- }, 150);
19280
- }, displayTimeMs);
19281
- }
19282
- },
19283
- []
19284
- );
19285
- const hideToast = useCallback12(() => {
19286
- setToastContent(null);
19287
- }, []);
19288
- return /* @__PURE__ */ React76.createElement(FunToastContext.Provider, {
19289
- value: { toastContent, showToast, hideToast, closing }
19290
- }, children);
19291
- }
19292
-
19293
19490
  // src/components/FunkitProvider/ModalSizeContext.ts
19294
19491
  import { createContext as createContext13 } from "react";
19295
19492
  var ModalSizeOptions = {
@@ -19303,14 +19500,14 @@ import { createContext as createContext14 } from "react";
19303
19500
  var ShowRecentTransactionsContext = createContext14(false);
19304
19501
 
19305
19502
  // src/components/FunkitProvider/useFingerprint.ts
19306
- import { useCallback as useCallback13, useEffect as useEffect21 } from "react";
19503
+ import { useCallback as useCallback14, useEffect as useEffect21 } from "react";
19307
19504
  var storageKey3 = "rk-version";
19308
19505
  function setRainbowKitVersion({ version }) {
19309
19506
  localStorage.setItem(storageKey3, version);
19310
19507
  }
19311
19508
  function useFingerprint() {
19312
- const fingerprint = useCallback13(() => {
19313
- setRainbowKitVersion({ version: "0.1.3" });
19509
+ const fingerprint = useCallback14(() => {
19510
+ setRainbowKitVersion({ version: "0.1.4" });
19314
19511
  }, []);
19315
19512
  useEffect21(() => {
19316
19513
  fingerprint();
@@ -19318,25 +19515,25 @@ function useFingerprint() {
19318
19515
  }
19319
19516
 
19320
19517
  // src/components/FunkitProvider/usePreloadImages.ts
19321
- import { useCallback as useCallback15, useEffect as useEffect22 } from "react";
19518
+ import { useCallback as useCallback16, useEffect as useEffect22 } from "react";
19322
19519
 
19323
19520
  // src/components/Icons/Assets.tsx
19324
- import React77 from "react";
19521
+ import React79 from "react";
19325
19522
  var src = async () => (await import("./assets-26YY4GVD.js")).default;
19326
19523
  var preloadAssetsIcon = () => loadImages(src);
19327
19524
 
19328
19525
  // src/components/Icons/Login.tsx
19329
- import React78 from "react";
19526
+ import React80 from "react";
19330
19527
  var src2 = async () => (await import("./login-ZSMM5UYL.js")).default;
19331
19528
  var preloadLoginIcon = () => loadImages(src2);
19332
19529
 
19333
19530
  // src/components/SignIn/SignIn.tsx
19334
- import React80, { useCallback as useCallback14, useContext as useContext11, useRef as useRef8 } from "react";
19531
+ import React82, { useCallback as useCallback15, useContext as useContext11, useRef as useRef8 } from "react";
19335
19532
  import { UserRejectedRequestError } from "viem";
19336
- import { useAccount as useAccount9, useNetwork as useNetwork7, useSignMessage } from "wagmi";
19533
+ import { useAccount as useAccount9, useNetwork as useNetwork6, useSignMessage } from "wagmi";
19337
19534
 
19338
19535
  // src/components/Button/ActionButton.tsx
19339
- import React79 from "react";
19536
+ import React81 from "react";
19340
19537
  var sizeVariants = {
19341
19538
  large: {
19342
19539
  fontSize: "16",
@@ -19372,7 +19569,7 @@ function ActionButton({
19372
19569
  const background = !disabled ? isPrimary ? "accentColor" : isNotLarge ? "actionButtonSecondaryBackground" : null : "actionButtonSecondaryBackground";
19373
19570
  const { fontSize, height, paddingX, paddingY } = sizeVariants[size];
19374
19571
  const hasBorder = !mobile || !isNotLarge;
19375
- return /* @__PURE__ */ React79.createElement(Box, {
19572
+ return /* @__PURE__ */ React81.createElement(Box, {
19376
19573
  ...href ? !disabled ? { as: "a", href, rel, target } : {} : { as: "button", type: "button" },
19377
19574
  onClick: !disabled ? onClick : void 0,
19378
19575
  ...hasBorder ? {
@@ -19391,7 +19588,7 @@ function ActionButton({
19391
19588
  transition: "transform",
19392
19589
  ...background ? { background } : {},
19393
19590
  ...height ? { height } : {}
19394
- }, /* @__PURE__ */ React79.createElement(Text, {
19591
+ }, /* @__PURE__ */ React81.createElement(Text, {
19395
19592
  color: !disabled ? isPrimary ? "accentColorForeground" : "accentColor" : "modalTextSecondary",
19396
19593
  size: fontSize,
19397
19594
  weight: "bold"
@@ -19402,9 +19599,9 @@ function ActionButton({
19402
19599
  var signInIcon = async () => (await import("./sign-FZVB2CS6.js")).default;
19403
19600
  function SignIn({ onClose }) {
19404
19601
  const i18n2 = useContext11(I18nContext);
19405
- const [{ status, ...state }, setState] = React80.useState({ status: "idle" });
19602
+ const [{ status, ...state }, setState] = React82.useState({ status: "idle" });
19406
19603
  const authAdapter = useAuthenticationAdapter();
19407
- const getNonce = useCallback14(async () => {
19604
+ const getNonce = useCallback15(async () => {
19408
19605
  try {
19409
19606
  const nonce = await authAdapter.getNonce();
19410
19607
  setState((x) => ({ ...x, nonce }));
@@ -19417,7 +19614,7 @@ function SignIn({ onClose }) {
19417
19614
  }
19418
19615
  }, [authAdapter]);
19419
19616
  const onceRef = useRef8(false);
19420
- React80.useEffect(() => {
19617
+ React82.useEffect(() => {
19421
19618
  if (onceRef.current) {
19422
19619
  return;
19423
19620
  }
@@ -19426,7 +19623,7 @@ function SignIn({ onClose }) {
19426
19623
  }, [getNonce]);
19427
19624
  const mobile = isMobile();
19428
19625
  const { address } = useAccount9();
19429
- const { chain: activeChain } = useNetwork7();
19626
+ const { chain: activeChain } = useNetwork6();
19430
19627
  const { signMessageAsync } = useSignMessage();
19431
19628
  const signIn = async () => {
19432
19629
  try {
@@ -19481,17 +19678,17 @@ function SignIn({ onClose }) {
19481
19678
  });
19482
19679
  }
19483
19680
  };
19484
- return /* @__PURE__ */ React80.createElement(Box, {
19681
+ return /* @__PURE__ */ React82.createElement(Box, {
19485
19682
  position: "relative"
19486
- }, /* @__PURE__ */ React80.createElement(Box, {
19683
+ }, /* @__PURE__ */ React82.createElement(Box, {
19487
19684
  display: "flex",
19488
19685
  paddingRight: "16",
19489
19686
  paddingTop: "16",
19490
19687
  position: "absolute",
19491
19688
  right: "0"
19492
- }, /* @__PURE__ */ React80.createElement(CloseButton, {
19689
+ }, /* @__PURE__ */ React82.createElement(CloseButton, {
19493
19690
  onClose
19494
- })), /* @__PURE__ */ React80.createElement(Box, {
19691
+ })), /* @__PURE__ */ React82.createElement(Box, {
19495
19692
  alignItems: "center",
19496
19693
  display: "flex",
19497
19694
  flexDirection: "column",
@@ -19499,58 +19696,58 @@ function SignIn({ onClose }) {
19499
19696
  padding: "24",
19500
19697
  paddingX: "18",
19501
19698
  style: { paddingTop: mobile ? "60px" : "36px" }
19502
- }, /* @__PURE__ */ React80.createElement(Box, {
19699
+ }, /* @__PURE__ */ React82.createElement(Box, {
19503
19700
  alignItems: "center",
19504
19701
  display: "flex",
19505
19702
  flexDirection: "column",
19506
19703
  gap: mobile ? "6" : "4",
19507
19704
  style: { maxWidth: mobile ? 320 : 280 }
19508
- }, /* @__PURE__ */ React80.createElement(Box, {
19705
+ }, /* @__PURE__ */ React82.createElement(Box, {
19509
19706
  alignItems: "center",
19510
19707
  display: "flex",
19511
19708
  flexDirection: "column",
19512
19709
  gap: mobile ? "32" : "16"
19513
- }, /* @__PURE__ */ React80.createElement(AsyncImage, {
19710
+ }, /* @__PURE__ */ React82.createElement(AsyncImage, {
19514
19711
  height: 40,
19515
19712
  src: signInIcon,
19516
19713
  width: 40
19517
- }), /* @__PURE__ */ React80.createElement(Text, {
19714
+ }), /* @__PURE__ */ React82.createElement(Text, {
19518
19715
  color: "modalText",
19519
19716
  size: mobile ? "20" : "18",
19520
19717
  textAlign: "center",
19521
19718
  weight: "heavy"
19522
- }, i18n2.t("sign_in.label"))), /* @__PURE__ */ React80.createElement(Box, {
19719
+ }, i18n2.t("sign_in.label"))), /* @__PURE__ */ React82.createElement(Box, {
19523
19720
  alignItems: "center",
19524
19721
  display: "flex",
19525
19722
  flexDirection: "column",
19526
19723
  gap: mobile ? "16" : "12"
19527
- }, /* @__PURE__ */ React80.createElement(Text, {
19724
+ }, /* @__PURE__ */ React82.createElement(Text, {
19528
19725
  color: "modalTextSecondary",
19529
19726
  size: mobile ? "16" : "14",
19530
19727
  textAlign: "center"
19531
- }, i18n2.t("sign_in.description")), status === "idle" && state.errorMessage ? /* @__PURE__ */ React80.createElement(Text, {
19728
+ }, i18n2.t("sign_in.description")), status === "idle" && state.errorMessage ? /* @__PURE__ */ React82.createElement(Text, {
19532
19729
  color: "error",
19533
19730
  size: mobile ? "16" : "14",
19534
19731
  textAlign: "center",
19535
19732
  weight: "bold"
19536
- }, state.errorMessage) : null)), /* @__PURE__ */ React80.createElement(Box, {
19733
+ }, state.errorMessage) : null)), /* @__PURE__ */ React82.createElement(Box, {
19537
19734
  alignItems: !mobile ? "center" : void 0,
19538
19735
  display: "flex",
19539
19736
  flexDirection: "column",
19540
19737
  gap: "8",
19541
19738
  width: "full"
19542
- }, /* @__PURE__ */ React80.createElement(ActionButton, {
19739
+ }, /* @__PURE__ */ React82.createElement(ActionButton, {
19543
19740
  disabled: !state.nonce || status === "signing" || status === "verifying",
19544
19741
  label: !state.nonce ? i18n2.t("sign_in.message.preparing") : status === "signing" ? i18n2.t("sign_in.signature.waiting") : status === "verifying" ? i18n2.t("sign_in.signature.verifying") : i18n2.t("sign_in.message.send"),
19545
19742
  onClick: signIn,
19546
19743
  size: mobile ? "large" : "medium",
19547
19744
  testId: "auth-message-button"
19548
- }), mobile ? /* @__PURE__ */ React80.createElement(ActionButton, {
19745
+ }), mobile ? /* @__PURE__ */ React82.createElement(ActionButton, {
19549
19746
  label: "Cancel",
19550
19747
  onClick: onClose,
19551
19748
  size: "large",
19552
19749
  type: "secondary"
19553
- }) : /* @__PURE__ */ React80.createElement(Box, {
19750
+ }) : /* @__PURE__ */ React82.createElement(Box, {
19554
19751
  as: "button",
19555
19752
  borderRadius: "full",
19556
19753
  className: touchableStyles({ active: "shrink", hover: "grow" }),
@@ -19562,7 +19759,7 @@ function SignIn({ onClose }) {
19562
19759
  style: { willChange: "transform" },
19563
19760
  target: "_blank",
19564
19761
  transition: "default"
19565
- }, /* @__PURE__ */ React80.createElement(Text, {
19762
+ }, /* @__PURE__ */ React82.createElement(Text, {
19566
19763
  color: "closeButton",
19567
19764
  size: mobile ? "16" : "14",
19568
19765
  weight: "bold"
@@ -19574,7 +19771,7 @@ function usePreloadImages() {
19574
19771
  const rainbowKitChains = useRainbowKitChains();
19575
19772
  const walletConnectors = useWalletConnectors();
19576
19773
  const isUnauthenticated = useAuthenticationStatus() === "unauthenticated";
19577
- const preloadImages = useCallback15(() => {
19774
+ const preloadImages = useCallback16(() => {
19578
19775
  loadImages(
19579
19776
  ...walletConnectors.map((wallet) => wallet.iconUrl),
19580
19777
  ...rainbowKitChains.map((chain) => chain.iconUrl).filter(isNotNullish)
@@ -19613,7 +19810,7 @@ function clearWalletConnectDeepLink() {
19613
19810
  // src/components/FunkitProvider/FunkitProvider.tsx
19614
19811
  "use client";
19615
19812
  var MoonPayProvider = (props) => {
19616
- const [MoonPayProviderInner, setMoonPayProviderInner] = React81.useState(null);
19813
+ const [MoonPayProviderInner, setMoonPayProviderInner] = React83.useState(null);
19617
19814
  useEffect23(() => {
19618
19815
  const loadMoonPayProviderInner = async () => {
19619
19816
  try {
@@ -19626,8 +19823,8 @@ var MoonPayProvider = (props) => {
19626
19823
  loadMoonPayProviderInner();
19627
19824
  }, []);
19628
19825
  if (!MoonPayProviderInner)
19629
- return /* @__PURE__ */ React81.createElement(React81.Fragment, null, props.children);
19630
- return /* @__PURE__ */ React81.createElement(MoonPayProviderInner, {
19826
+ return /* @__PURE__ */ React83.createElement(React83.Fragment, null, props.children);
19827
+ return /* @__PURE__ */ React83.createElement(MoonPayProviderInner, {
19631
19828
  ...props
19632
19829
  }, props.children);
19633
19830
  };
@@ -19694,9 +19891,9 @@ function FunkitProvider(props) {
19694
19891
  appWagmiConfig.connectors = newConnectors;
19695
19892
  }
19696
19893
  const config = createConfig(appWagmiConfig);
19697
- return /* @__PURE__ */ React81.createElement(WagmiConfig, {
19894
+ return /* @__PURE__ */ React83.createElement(WagmiConfig, {
19698
19895
  config
19699
- }, /* @__PURE__ */ React81.createElement(FunkitProviderInner, {
19896
+ }, /* @__PURE__ */ React83.createElement(FunkitProviderInner, {
19700
19897
  ...props
19701
19898
  }));
19702
19899
  }
@@ -19730,31 +19927,31 @@ function FunkitProviderInner({
19730
19927
  const avatarContext = avatar ?? defaultAvatar;
19731
19928
  const { width } = useWindowSize();
19732
19929
  const isSmallScreen = width && width < largeScreenMinWidth;
19733
- return /* @__PURE__ */ React81.createElement(RainbowKitChainProvider, {
19930
+ return /* @__PURE__ */ React83.createElement(RainbowKitChainProvider, {
19734
19931
  chains,
19735
19932
  initialChain
19736
- }, /* @__PURE__ */ React81.createElement(FunkitConfigContext.Provider, {
19933
+ }, /* @__PURE__ */ React83.createElement(FunkitConfigContext.Provider, {
19737
19934
  value: funkitConfig
19738
- }, /* @__PURE__ */ React81.createElement(I18nProvider, {
19935
+ }, /* @__PURE__ */ React83.createElement(I18nProvider, {
19739
19936
  locale
19740
- }, /* @__PURE__ */ React81.createElement(CoolModeContext.Provider, {
19937
+ }, /* @__PURE__ */ React83.createElement(CoolModeContext.Provider, {
19741
19938
  value: coolMode
19742
- }, /* @__PURE__ */ React81.createElement(ModalSizeContext.Provider, {
19939
+ }, /* @__PURE__ */ React83.createElement(ModalSizeContext.Provider, {
19743
19940
  value: isSmallScreen ? ModalSizeOptions.COMPACT : modalSize
19744
- }, /* @__PURE__ */ React81.createElement(FunkitWeb2Provider, null, /* @__PURE__ */ React81.createElement(FunkitWalletProvider, null, /* @__PURE__ */ React81.createElement(FunkitCheckoutProvider, null, /* @__PURE__ */ React81.createElement(ShowRecentTransactionsContext.Provider, {
19941
+ }, /* @__PURE__ */ React83.createElement(FunkitWeb2Provider, null, /* @__PURE__ */ React83.createElement(FunkitWalletProvider, null, /* @__PURE__ */ React83.createElement(FunkitCheckoutProvider, null, /* @__PURE__ */ React83.createElement(ShowRecentTransactionsContext.Provider, {
19745
19942
  value: showRecentTransactions
19746
- }, /* @__PURE__ */ React81.createElement(TransactionStoreProvider, null, /* @__PURE__ */ React81.createElement(AvatarContext.Provider, {
19943
+ }, /* @__PURE__ */ React83.createElement(TransactionStoreProvider, null, /* @__PURE__ */ React83.createElement(AvatarContext.Provider, {
19747
19944
  value: avatarContext
19748
- }, /* @__PURE__ */ React81.createElement(AppContext.Provider, {
19945
+ }, /* @__PURE__ */ React83.createElement(AppContext.Provider, {
19749
19946
  value: appContext
19750
- }, /* @__PURE__ */ React81.createElement(ThemeIdContext.Provider, {
19947
+ }, /* @__PURE__ */ React83.createElement(ThemeIdContext.Provider, {
19751
19948
  value: id
19752
- }, /* @__PURE__ */ React81.createElement(FunToastProvider, null, /* @__PURE__ */ React81.createElement(MoonPayProvider, {
19949
+ }, /* @__PURE__ */ React83.createElement(FunToastProvider, null, /* @__PURE__ */ React83.createElement(MoonPayProvider, {
19753
19950
  apiKey: "pk_live_IxayBRQuBC3RzpPZkbGPrwUsRWAaeO",
19754
19951
  debug: true
19755
- }, /* @__PURE__ */ React81.createElement(ModalProvider, null, theme ? /* @__PURE__ */ React81.createElement("div", {
19952
+ }, /* @__PURE__ */ React83.createElement(ModalProvider, null, theme ? /* @__PURE__ */ React83.createElement("div", {
19756
19953
  ...createThemeRootProps(id)
19757
- }, /* @__PURE__ */ React81.createElement("style", {
19954
+ }, /* @__PURE__ */ React83.createElement("style", {
19758
19955
  dangerouslySetInnerHTML: {
19759
19956
  __html: [
19760
19957
  `${selector}{${cssStringFromTheme(
@@ -19779,7 +19976,7 @@ var overlay = "Dialog_overlay__1r8f575 sprinkles_backdropFilter_modalOverlay__1r
19779
19976
  var overlayOut = "Dialog_overlayOut__1r8f577 sprinkles_backdropFilter_modalOverlay__1rsrm2fd5 sprinkles_background_modalBackdrop_base__1rsrm2feu sprinkles_display_flex_smallScreen__1rsrm2fa sprinkles_justifyContent_center__1rsrm2f35 sprinkles_position_fixed__1rsrm2fc1";
19780
19977
 
19781
19978
  // src/components/Dialog/FocusTrap.tsx
19782
- import React82, { useCallback as useCallback16, useEffect as useEffect24, useRef as useRef9 } from "react";
19979
+ import React84, { useCallback as useCallback17, useEffect as useEffect24, useRef as useRef9 } from "react";
19783
19980
  var moveFocusWithin = (element2, position) => {
19784
19981
  const focusableElements = element2.querySelectorAll(
19785
19982
  "button:not(:disabled), a[href]"
@@ -19809,19 +20006,19 @@ function FocusTrap(props) {
19809
20006
  }
19810
20007
  }
19811
20008
  }, [contentRef]);
19812
- return /* @__PURE__ */ React82.createElement(React82.Fragment, null, /* @__PURE__ */ React82.createElement("div", {
19813
- onFocus: useCallback16(
20009
+ return /* @__PURE__ */ React84.createElement(React84.Fragment, null, /* @__PURE__ */ React84.createElement("div", {
20010
+ onFocus: useCallback17(
19814
20011
  () => contentRef.current && moveFocusWithin(contentRef.current, "end"),
19815
20012
  []
19816
20013
  ),
19817
20014
  tabIndex: 0
19818
- }), /* @__PURE__ */ React82.createElement("div", {
20015
+ }), /* @__PURE__ */ React84.createElement("div", {
19819
20016
  ref: contentRef,
19820
20017
  style: { outline: "none" },
19821
20018
  tabIndex: -1,
19822
20019
  ...props
19823
- }), /* @__PURE__ */ React82.createElement("div", {
19824
- onFocus: useCallback16(
20020
+ }), /* @__PURE__ */ React84.createElement("div", {
20021
+ onFocus: useCallback17(
19825
20022
  () => contentRef.current && moveFocusWithin(contentRef.current, "start"),
19826
20023
  []
19827
20024
  ),
@@ -19849,7 +20046,7 @@ function Dialog({
19849
20046
  getComputedStyle(window.document.body).overflow !== "hidden"
19850
20047
  );
19851
20048
  }, []);
19852
- const handleBackdropClick = useCallback17(() => onClose(), [onClose]);
20049
+ const handleBackdropClick = useCallback18(() => onClose(), [onClose]);
19853
20050
  const themeRootProps = useThemeRootProps();
19854
20051
  const mobile = isMobile();
19855
20052
  const [isOpen, setIsOpen] = useState21(open);
@@ -19862,13 +20059,13 @@ function Dialog({
19862
20059
  }, DialogAnimationTime);
19863
20060
  }
19864
20061
  }, [open]);
19865
- return /* @__PURE__ */ React83.createElement(React83.Fragment, null, isOpen ? createPortal(
19866
- /* @__PURE__ */ React83.createElement(RemoveScroll, {
20062
+ return /* @__PURE__ */ React85.createElement(React85.Fragment, null, isOpen ? createPortal(
20063
+ /* @__PURE__ */ React85.createElement(RemoveScroll, {
19867
20064
  enabled: bodyScrollable
19868
- }, /* @__PURE__ */ React83.createElement(Box, {
20065
+ }, /* @__PURE__ */ React85.createElement(Box, {
19869
20066
  ...themeRootProps,
19870
20067
  style: { display: isHidden ? "none" : void 0 }
19871
- }, /* @__PURE__ */ React83.createElement(Box, {
20068
+ }, /* @__PURE__ */ React85.createElement(Box, {
19872
20069
  ...themeRootProps,
19873
20070
  alignItems: mobile ? "flex-end" : "center",
19874
20071
  "aria-labelledby": titleId,
@@ -19877,7 +20074,7 @@ function Dialog({
19877
20074
  onClick: handleBackdropClick,
19878
20075
  position: "fixed",
19879
20076
  role: "dialog"
19880
- }, /* @__PURE__ */ React83.createElement(FocusTrap, {
20077
+ }, /* @__PURE__ */ React85.createElement(FocusTrap, {
19881
20078
  className: open ? content : contentSlideOut,
19882
20079
  onClick: stopPropagation,
19883
20080
  role: "document"
@@ -19899,101 +20096,6 @@ var shortToastContainer = "FunShortToast_shortToastContainer__1btry8h2";
19899
20096
  var shortToastExit = "FunShortToast_shortToastExit__1btry8h4";
19900
20097
  var typeDisplay = "FunShortToast_typeDisplay__1btry8h5";
19901
20098
 
19902
- // src/components/FunToast/FunToast.tsx
19903
- import React85, { useMemo as useMemo17 } from "react";
19904
-
19905
- // src/components/Icons/SuccessNoBorder.tsx
19906
- import React84 from "react";
19907
- var SuccessNoBorderIcon = () => /* @__PURE__ */ React84.createElement("svg", {
19908
- width: "21",
19909
- height: "21",
19910
- viewBox: "0 0 21 21",
19911
- fill: "none",
19912
- xmlns: "http://www.w3.org/2000/svg"
19913
- }, /* @__PURE__ */ React84.createElement("path", {
19914
- d: "M5.25 10.5004L8.96228 14.2127L16.3861 6.78809",
19915
- stroke: "currentColor",
19916
- strokeWidth: "2.5",
19917
- strokeLinecap: "round",
19918
- strokeLinejoin: "round"
19919
- }));
19920
-
19921
- // src/components/FunToast/FunToast.tsx
19922
- var FUN_TOAST_TYPE_DEFAULT_CONFIG = {
19923
- [1 /* ERROR */]: {
19924
- borderColor: "connectButtonBackgroundError",
19925
- borderWidth: "2",
19926
- titleSuffix: /* @__PURE__ */ React85.createElement(CloseIcon, null)
19927
- },
19928
- [3 /* SUCCESS */]: {
19929
- borderColor: "connectionIndicator",
19930
- borderWidth: "2",
19931
- titleSuffix: /* @__PURE__ */ React85.createElement(SuccessNoBorderIcon, null)
19932
- },
19933
- [2 /* PENDING */]: {
19934
- borderColor: "standby",
19935
- borderWidth: "2",
19936
- titleSuffix: /* @__PURE__ */ React85.createElement(SpinnerIcon, null)
19937
- },
19938
- [0 /* INFO */]: {
19939
- borderColor: void 0,
19940
- borderWidth: void 0,
19941
- titleSuffix: void 0
19942
- }
19943
- };
19944
- function FunToast({
19945
- type = 3 /* SUCCESS */,
19946
- title,
19947
- titleSuffix,
19948
- hideTitleSuffix = false,
19949
- description,
19950
- icon
19951
- }) {
19952
- const styleConfigs = FUN_TOAST_TYPE_DEFAULT_CONFIG?.[type];
19953
- const finalTitleSuffix = useMemo17(() => {
19954
- if (titleSuffix) {
19955
- return titleSuffix;
19956
- }
19957
- return styleConfigs.titleSuffix;
19958
- }, [styleConfigs.titleSuffix, titleSuffix]);
19959
- return /* @__PURE__ */ React85.createElement(Box, {
19960
- marginBottom: "5",
19961
- padding: "20",
19962
- borderRadius: "16",
19963
- borderColor: styleConfigs.borderColor,
19964
- borderWidth: styleConfigs.borderWidth,
19965
- borderStyle: "solid"
19966
- }, /* @__PURE__ */ React85.createElement(Box, {
19967
- display: "flex",
19968
- flexDirection: "row",
19969
- gap: "14"
19970
- }, icon ? /* @__PURE__ */ React85.createElement(Box, {
19971
- display: "flex",
19972
- justifyContent: "center",
19973
- alignItems: "center"
19974
- }, icon) : null, /* @__PURE__ */ React85.createElement(Box, {
19975
- display: "flex",
19976
- flexDirection: "column",
19977
- gap: "10",
19978
- width: "full"
19979
- }, /* @__PURE__ */ React85.createElement(Box, {
19980
- display: "flex",
19981
- flexDirection: "row",
19982
- justifyContent: "space-between",
19983
- width: "full"
19984
- }, /* @__PURE__ */ React85.createElement(Text, {
19985
- size: "18",
19986
- weight: "bold",
19987
- color: "modalText"
19988
- }, title), hideTitleSuffix ? null : /* @__PURE__ */ React85.createElement(Box, {
19989
- color: styleConfigs.borderColor
19990
- }, finalTitleSuffix)), /* @__PURE__ */ React85.createElement(Text, {
19991
- size: "12",
19992
- weight: "medium",
19993
- color: "modalTextDim"
19994
- }, description))));
19995
- }
19996
-
19997
20099
  // src/components/FunToast/FunShortToast.tsx
19998
20100
  var ShortFunToast = ({
19999
20101
  type = 1 /* ERROR */,
@@ -20069,7 +20171,7 @@ function DialogContent({
20069
20171
  }
20070
20172
 
20071
20173
  // src/components/ProfileDetails/EoaProfileDetails.tsx
20072
- import React88, { useCallback as useCallback18, useContext as useContext14, useEffect as useEffect26, useState as useState22 } from "react";
20174
+ import React88, { useCallback as useCallback19, useContext as useContext14, useEffect as useEffect26, useState as useState22 } from "react";
20073
20175
 
20074
20176
  // src/components/ConnectButton/abbreviateETHBalance.ts
20075
20177
  var units = ["k", "m", "b", "t"];
@@ -20121,7 +20223,7 @@ function EoaProfileDetails({
20121
20223
  const showRecentTransactions = useContext14(ShowRecentTransactionsContext);
20122
20224
  const [copiedAddress, setCopiedAddress] = useState22(false);
20123
20225
  const i18n2 = useContext14(I18nContext);
20124
- const copyAddressAction = useCallback18(() => {
20226
+ const copyAddressAction = useCallback19(() => {
20125
20227
  if (address) {
20126
20228
  navigator.clipboard.writeText(address);
20127
20229
  setCopiedAddress(true);
@@ -20795,9 +20897,10 @@ var animateContentInClass8 = "FWHome_animateContentInClass__v9wve1a";
20795
20897
  var animateContentOutClass8 = "FWHome_animateContentOutClass__v9wve1b";
20796
20898
  var animateTitleInClass2 = "FWHome_animateTitleInClass__v9wve16";
20797
20899
  var animateTitleOutClass2 = "FWHome_animateTitleOutClass__v9wve17";
20900
+ var scroll = "FWHome_scroll__v9wve1c";
20798
20901
 
20799
20902
  // src/components/ProfileDetails/FunWalletProfileViews/FWHome/FWHomeCheckoutSection.tsx
20800
- import React99, { Fragment as Fragment3, useMemo as useMemo21 } from "react";
20903
+ import React99, { Fragment as Fragment4, useMemo as useMemo21 } from "react";
20801
20904
  var MAX_LATEST_CHECKOUTS = 1;
20802
20905
  function FWHomeCheckoutSection({ onClose }) {
20803
20906
  const { checkoutHistoryStateMap } = useFunkitAllPostCheckoutsInternal();
@@ -20813,7 +20916,7 @@ function FWHomeCheckoutSection({ onClose }) {
20813
20916
  remainingCount: remaining
20814
20917
  };
20815
20918
  }, [checkoutHistoryStateMap]);
20816
- return latestCheckoutHistories.length > 0 ? /* @__PURE__ */ React99.createElement(Fragment3, null, /* @__PURE__ */ React99.createElement(FunDivider, {
20919
+ return latestCheckoutHistories.length > 0 ? /* @__PURE__ */ React99.createElement(Fragment4, null, /* @__PURE__ */ React99.createElement(FunDivider, {
20817
20920
  marginY: "16"
20818
20921
  }), /* @__PURE__ */ React99.createElement(Box, {
20819
20922
  display: "flex",
@@ -20859,7 +20962,8 @@ var FWHomeTokenBalanceDisplayRow = ({ asset }) => {
20859
20962
  height: "full"
20860
20963
  }, /* @__PURE__ */ React100.createElement(Box, {
20861
20964
  width: "32",
20862
- height: "32"
20965
+ height: "32",
20966
+ alignSelf: "center"
20863
20967
  }, /* @__PURE__ */ React100.createElement("img", {
20864
20968
  src: isMatic ? polygonIcon2 : isArb ? arbIcon : isNotNullish(asset.logo) ? asset.logo : fallbackIconSrc,
20865
20969
  width: 28,
@@ -21038,6 +21142,7 @@ function FWHome({
21038
21142
  display: "flex",
21039
21143
  flexDirection: "column",
21040
21144
  gap: "10",
21145
+ className: scroll,
21041
21146
  style: { maxHeight: 170, overflow: "auto" }
21042
21147
  }, AssetsList.map((component) => component)), /* @__PURE__ */ React101.createElement(FWHomeCheckoutSection, {
21043
21148
  onClose
@@ -21220,8 +21325,8 @@ function AccountModal({ onClose, open }) {
21220
21325
  }
21221
21326
 
21222
21327
  // src/components/ChainModal/ChainModal.tsx
21223
- import React107, { Fragment as Fragment4, useContext as useContext15 } from "react";
21224
- import { useDisconnect as useDisconnect3, useNetwork as useNetwork8, useSwitchNetwork } from "wagmi";
21328
+ import React107, { Fragment as Fragment5, useContext as useContext15 } from "react";
21329
+ import { useDisconnect as useDisconnect3, useNetwork as useNetwork7, useSwitchNetwork } from "wagmi";
21225
21330
 
21226
21331
  // src/components/Icons/DisconnectSq.tsx
21227
21332
  import React105 from "react";
@@ -21294,7 +21399,7 @@ var MobileScrollClassName = "ChainModal_MobileScrollClassName__1107ixc1";
21294
21399
 
21295
21400
  // src/components/ChainModal/ChainModal.tsx
21296
21401
  function ChainModal({ onClose, open }) {
21297
- const { chain: activeChain } = useNetwork8();
21402
+ const { chain: activeChain } = useNetwork7();
21298
21403
  const { chains, pendingChainId, reset, switchNetwork } = useSwitchNetwork({
21299
21404
  onSettled: () => {
21300
21405
  reset();
@@ -21363,7 +21468,7 @@ function ChainModal({ onClose, open }) {
21363
21468
  }
21364
21469
  const isCurrentChain = chain.id === activeChain?.id;
21365
21470
  const switching = !isCurrentChain && chain.id === pendingChainId;
21366
- return /* @__PURE__ */ React107.createElement(Fragment4, {
21471
+ return /* @__PURE__ */ React107.createElement(Fragment5, {
21367
21472
  key: chain.id
21368
21473
  }, /* @__PURE__ */ React107.createElement(MenuButton, {
21369
21474
  currentlySelected: isCurrentChain,
@@ -21483,6 +21588,7 @@ function ChainModal({ onClose, open }) {
21483
21588
  import React109 from "react";
21484
21589
 
21485
21590
  // src/components/FunCheckoutHistoryModal/FunCheckoutHistoryDetail.tsx
21591
+ import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO2 } from "@funkit/core";
21486
21592
  import React108, { useMemo as useMemo24 } from "react";
21487
21593
  var FAKE_DELAY_MS = 4107;
21488
21594
  function FunCheckoutHistoryDetail({
@@ -21500,6 +21606,7 @@ function FunCheckoutHistoryDetail({
21500
21606
  } = useCheckoutStateBooleans(checkoutHistoryInfo.state);
21501
21607
  useCheckoutHistoryListener(isProcessing);
21502
21608
  const timelineLabels = useMemo24(() => {
21609
+ const explorerInfo = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO2[checkoutHistoryInfo.fromChainId].explorerInfo;
21503
21610
  return [
21504
21611
  {
21505
21612
  text: "Order Submitted",
@@ -21511,7 +21618,9 @@ function FunCheckoutHistoryDetail({
21511
21618
  text: "Order Processing",
21512
21619
  description: formatTimestamp(
21513
21620
  new Date(checkoutHistoryInfo.createdTimeMs + FAKE_DELAY_MS)
21514
- )
21621
+ ),
21622
+ linkText: `View on ${explorerInfo.name}`,
21623
+ linkUrl: `${explorerInfo.url}/address/${checkoutHistoryInfo.depositAddr}`
21515
21624
  },
21516
21625
  {
21517
21626
  text: `Order ${isError ? "Failed" : isExpired ? "Expired" : "Delivered"}`,
@@ -21522,8 +21631,10 @@ function FunCheckoutHistoryDetail({
21522
21631
  ];
21523
21632
  }, [
21524
21633
  checkoutHistoryInfo.createdTimeMs,
21634
+ checkoutHistoryInfo.depositAddr,
21525
21635
  checkoutHistoryInfo.expirationTimestampSeconds,
21526
21636
  checkoutHistoryInfo.lastUpdatedTimeMs,
21637
+ checkoutHistoryInfo.toChainId,
21527
21638
  isError,
21528
21639
  isExpired,
21529
21640
  isTerminal
@@ -21558,7 +21669,23 @@ function FunCheckoutHistoryDetail({
21558
21669
  }, "You will receive a notification when your order has finished."))), isFailed ? /* @__PURE__ */ React108.createElement(FunToast, {
21559
21670
  type: 1 /* ERROR */,
21560
21671
  title: "Order Failed",
21561
- description: "A problem occurred processing your order. Please contact support for more information.",
21672
+ isDescriptionText: false,
21673
+ description: /* @__PURE__ */ React108.createElement(Text, {
21674
+ size: "12",
21675
+ weight: "medium",
21676
+ color: "modalTextDim"
21677
+ }, "A problem occurred processing your order. Please", /* @__PURE__ */ React108.createElement(FunLinkButton, {
21678
+ hasPadding: false,
21679
+ text: "contact support",
21680
+ textProps: {
21681
+ size: "12",
21682
+ weight: "medium",
21683
+ color: "modalTextSecondary"
21684
+ },
21685
+ onClick: () => {
21686
+ window.location = "mailto:support@fun.xyz";
21687
+ }
21688
+ }), " ", "for more information."),
21562
21689
  hideTitleSuffix: true
21563
21690
  }) : null);
21564
21691
  }
@@ -21595,16 +21722,16 @@ function FunCheckoutHistoryModal({
21595
21722
  }
21596
21723
 
21597
21724
  // src/components/FunCheckoutModal/FunCheckoutModal.tsx
21598
- import React112, { useCallback as useCallback20, useEffect as useEffect31, useMemo as useMemo26, useState as useState30 } from "react";
21599
- import { useNetwork as useNetwork10 } from "wagmi";
21725
+ import React112, { useCallback as useCallback21, useEffect as useEffect31, useMemo as useMemo26, useState as useState30 } from "react";
21726
+ import { useNetwork as useNetwork9 } from "wagmi";
21600
21727
 
21601
21728
  // src/components/FunCheckoutModal/FunCheckoutSelectAssetStep.tsx
21602
21729
  import {
21603
21730
  FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS as FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS2,
21604
- FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO2
21731
+ FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO3
21605
21732
  } from "@funkit/core";
21606
- import React110, { useCallback as useCallback19, useEffect as useEffect30, useMemo as useMemo25, useState as useState29 } from "react";
21607
- import { useNetwork as useNetwork9 } from "wagmi";
21733
+ import React110, { useCallback as useCallback20, useEffect as useEffect30, useMemo as useMemo25, useState as useState29 } from "react";
21734
+ import { useNetwork as useNetwork8 } from "wagmi";
21608
21735
 
21609
21736
  // src/components/FunCheckoutModal/FunCheckoutSelectAssetStep.css.ts
21610
21737
  var animateContentInClass9 = "FunCheckoutSelectAssetStep_animateContentInClass__1g86dx12";
@@ -21614,15 +21741,16 @@ var animateContentOutClass9 = "FunCheckoutSelectAssetStep_animateContentOutClass
21614
21741
  function MeshOrAccountSelectAsset({
21615
21742
  paymentMethodInfo,
21616
21743
  checkoutId,
21617
- onFinish
21744
+ onFinish,
21745
+ isOnFinishLoading
21618
21746
  }) {
21619
21747
  const [accountHoldingsMap, setAccountHoldingsMap] = useState29({});
21620
- const [isLoading, setIsLoading] = useState29(true);
21748
+ const [isLoadingAssets, setIsLoadingAssets] = useState29(true);
21621
21749
  const [selectedTokenSymbol, setSelectedTokenSymbol] = useState29();
21622
21750
  const { checkoutItem, updateSourceAsset } = useFunkitPreCheckoutInternal(checkoutId);
21623
21751
  const draftDollarValueNormalized = checkoutItem?.draftDollarValue || 0;
21624
21752
  const funkitConfig = useFunkitConfig();
21625
- const { chain: activeChain } = useNetwork9();
21753
+ const { chain: activeChain } = useNetwork8();
21626
21754
  const { fetchInfo: manualFetchNetworkInfo } = useMeshActiveNetworkInfo(
21627
21755
  paymentMethodInfo?.meta?.accessToken?.brokerName
21628
21756
  );
@@ -21630,7 +21758,7 @@ function MeshOrAccountSelectAsset({
21630
21758
  paymentMethodInfo.paymentMethod === "balance" /* ACCOUNT_BALANCE */
21631
21759
  );
21632
21760
  const { funWalletAssets } = useFunkitWallet();
21633
- const generateAccountHoldingsMapForMesh = useCallback19(async () => {
21761
+ const generateAccountHoldingsMapForMesh = useCallback20(async () => {
21634
21762
  if (funkitConfig?.apiKey && !!activeChain) {
21635
21763
  const [cryptoHoldings, meshNetworkInfo] = await Promise.all([
21636
21764
  fetchMeshAccountCryptoHoldings({
@@ -21670,13 +21798,13 @@ function MeshOrAccountSelectAsset({
21670
21798
  paymentMethodInfo?.meta?.accessToken?.accountTokens,
21671
21799
  paymentMethodInfo?.meta?.accessToken?.brokerName
21672
21800
  ]);
21673
- const generateAccountHoldingsMapForBalance = useCallback19(async () => {
21801
+ const generateAccountHoldingsMapForBalance = useCallback20(async () => {
21674
21802
  if (activeChain) {
21675
21803
  const itemMap = {};
21676
21804
  Object.values(funWalletAssets || {}).map((fwAsset) => {
21677
21805
  if (fwAsset.symbol && fwAsset.contractAddress && fwAsset.contractAddress !== checkoutItem?.initSettings.config.targetAsset) {
21678
21806
  let normalizedTokenAddress = fwAsset.contractAddress;
21679
- if (FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO2?.[activeChain.id]?.nativeCurrency?.symbol?.toUpperCase() === fwAsset.symbol.toUpperCase()) {
21807
+ if (FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO3?.[activeChain.id]?.nativeCurrency?.symbol?.toUpperCase() === fwAsset.symbol.toUpperCase()) {
21680
21808
  normalizedTokenAddress = FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS2;
21681
21809
  }
21682
21810
  itemMap[fwAsset.symbol] = {
@@ -21700,7 +21828,7 @@ function MeshOrAccountSelectAsset({
21700
21828
  ]);
21701
21829
  useEffect30(() => {
21702
21830
  async function fetchAccountHoldings() {
21703
- setIsLoading(true);
21831
+ setIsLoadingAssets(true);
21704
21832
  const paymentMethod = paymentMethodInfo.paymentMethod;
21705
21833
  let itemMap = {};
21706
21834
  if (paymentMethod === "brokerage" /* BROKERAGE */) {
@@ -21709,7 +21837,7 @@ function MeshOrAccountSelectAsset({
21709
21837
  itemMap = await generateAccountHoldingsMapForBalance();
21710
21838
  }
21711
21839
  setAccountHoldingsMap(itemMap);
21712
- setIsLoading(false);
21840
+ setIsLoadingAssets(false);
21713
21841
  }
21714
21842
  fetchAccountHoldings().catch(console.error);
21715
21843
  }, [
@@ -21734,7 +21862,7 @@ function MeshOrAccountSelectAsset({
21734
21862
  })
21735
21863
  );
21736
21864
  }, [accountHoldingsMap]);
21737
- const onClickContinue = useCallback19(() => {
21865
+ const onClickContinue = useCallback20(() => {
21738
21866
  if (selectedTokenSymbol && !!activeChain?.id) {
21739
21867
  const tokenAddress = accountHoldingsMap[selectedTokenSymbol].tokenAddress;
21740
21868
  updateSourceAsset(
@@ -21774,7 +21902,7 @@ function MeshOrAccountSelectAsset({
21774
21902
  }, "Select Asset to Pay")), /* @__PURE__ */ React110.createElement(Box, {
21775
21903
  paddingBottom: "24",
21776
21904
  paddingTop: "18"
21777
- }, isLoading ? /* @__PURE__ */ React110.createElement(Text, {
21905
+ }, isLoadingAssets ? /* @__PURE__ */ React110.createElement(Text, {
21778
21906
  color: "modalText"
21779
21907
  }, "Loading assets...") : /* @__PURE__ */ React110.createElement(FunSelectDropdown, {
21780
21908
  handleSelect: (newValue) => {
@@ -21796,7 +21924,15 @@ function MeshOrAccountSelectAsset({
21796
21924
  })) : null, /* @__PURE__ */ React110.createElement(FunButton, {
21797
21925
  type: "primary",
21798
21926
  title: "Continue",
21799
- isDisabled: !selectedTokenSymbol || showErrorNotification,
21927
+ isDisabled: !selectedTokenSymbol || showErrorNotification || isOnFinishLoading,
21928
+ titleSuffix: isOnFinishLoading ? /* @__PURE__ */ React110.createElement(Box, {
21929
+ display: "flex",
21930
+ alignItems: "center",
21931
+ color: "modalText"
21932
+ }, /* @__PURE__ */ React110.createElement(SpinnerIcon, {
21933
+ height: 16,
21934
+ width: 16
21935
+ })) : null,
21800
21936
  onClick: onClickContinue
21801
21937
  }));
21802
21938
  }
@@ -21804,6 +21940,7 @@ function FunCheckoutSelectAssetStep({
21804
21940
  checkoutId,
21805
21941
  selectedPaymentMethodInfo,
21806
21942
  onFinish,
21943
+ isOnFinishLoading,
21807
21944
  animateOut = false
21808
21945
  }) {
21809
21946
  if (!selectedPaymentMethodInfo) {
@@ -21818,6 +21955,7 @@ function FunCheckoutSelectAssetStep({
21818
21955
  }, ["brokerage" /* BROKERAGE */, "balance" /* ACCOUNT_BALANCE */].includes(
21819
21956
  selectedPaymentMethodInfo.paymentMethod
21820
21957
  ) ? /* @__PURE__ */ React110.createElement(MeshOrAccountSelectAsset, {
21958
+ isOnFinishLoading,
21821
21959
  onFinish,
21822
21960
  paymentMethodInfo: selectedPaymentMethodInfo,
21823
21961
  checkoutId
@@ -21855,6 +21993,10 @@ function FunCheckoutVerifyDetailsStep({
21855
21993
 
21856
21994
  // src/components/FunCheckoutModal/FunCheckoutModal.tsx
21857
21995
  var ANIMATION_DELAY = 150;
21996
+ var DUMMY_TRANSFER_PARAMS = {
21997
+ toAddress: "0x000000000000000000000000000000000000dEaD",
21998
+ tokenAmount: 20
21999
+ };
21858
22000
  function FunCheckoutModal({
21859
22001
  onClose,
21860
22002
  open,
@@ -21863,7 +22005,7 @@ function FunCheckoutModal({
21863
22005
  if (open && !checkoutId) {
21864
22006
  throw new Error("Unable to open checkout modal without a checkoutId");
21865
22007
  }
21866
- const { chain: activeChain } = useNetwork10();
22008
+ const { chain: activeChain } = useNetwork9();
21867
22009
  const { isLoggedIn: isWeb2Login, funWallet } = useFunkitWallet();
21868
22010
  const { updateSourceAsset } = useFunkitPreCheckoutInternal(checkoutId);
21869
22011
  const { openConnectModal } = useConnectModal();
@@ -21882,6 +22024,7 @@ function FunCheckoutModal({
21882
22024
  const { checkoutItem, getCheckoutQuote } = useFunkitPreCheckoutInternal(
21883
22025
  checkoutId || ""
21884
22026
  );
22027
+ const { generateCheckoutTransferOpItems } = useCheckoutAccountBalanceTransfer(checkoutId);
21885
22028
  const [selectedPaymentMethodInfo, setSelectedPaymentMethodInfo] = useState30(null);
21886
22029
  const titleConfig = useMemo26(() => {
21887
22030
  const baseTitle = checkoutItem?.initSettings?.config?.modalTitle || "Checkout";
@@ -21954,7 +22097,7 @@ function FunCheckoutModal({
21954
22097
  checkoutStep,
21955
22098
  selectedPaymentMethodInfo?.paymentMethod
21956
22099
  ]);
21957
- const redirectToCheckoutHistory = useCallback20(
22100
+ const redirectToCheckoutHistory = useCallback21(
21958
22101
  (depositAddress) => {
21959
22102
  if (depositAddress) {
21960
22103
  onClose?.();
@@ -21965,33 +22108,48 @@ function FunCheckoutModal({
21965
22108
  },
21966
22109
  [onClose, openFunCheckoutHistoryModal]
21967
22110
  );
21968
- const onSourceAssetConfirmed = useCallback20(async () => {
21969
- if (checkoutItem?.selectedSourceAssetInfo?.address && checkoutItem?.selectedSourceAssetInfo?.symbol) {
21970
- const selectedPaymentMethod = selectedPaymentMethodInfo?.paymentMethod;
21971
- if (selectedPaymentMethod === "balance" /* ACCOUNT_BALANCE */) {
21972
- setSelectedPaymentMethodInfo({
21973
- paymentMethod: "balance" /* ACCOUNT_BALANCE */,
21974
- title: "Your Wallet",
21975
- titleIcon: /* @__PURE__ */ React112.createElement(WalletDecoratedIcon, null),
21976
- description: formatAddress(await funWallet?.getAddress()),
21977
- meta: {}
21978
- });
21979
- } else if (selectedPaymentMethod === "card" /* CARD */) {
21980
- setSelectedPaymentMethodInfo({
21981
- paymentMethod: "card" /* CARD */,
21982
- title: "Debit or Credit",
21983
- titleIcon: /* @__PURE__ */ React112.createElement(CreditCardIcon, null),
21984
- description: "",
21985
- meta: {}
21986
- });
22111
+ const [isSourceAssetConfirming, setIsSourceAssetConfirming] = useState30(false);
22112
+ const onSourceAssetConfirmed = useCallback21(async () => {
22113
+ try {
22114
+ if (checkoutItem?.selectedSourceAssetInfo?.address && checkoutItem?.selectedSourceAssetInfo?.symbol) {
22115
+ setIsSourceAssetConfirming(true);
22116
+ let sponsorInitialTransferGasLimit = 0;
22117
+ const selectedPaymentMethod = selectedPaymentMethodInfo?.paymentMethod;
22118
+ if (selectedPaymentMethod === "balance" /* ACCOUNT_BALANCE */) {
22119
+ setSelectedPaymentMethodInfo({
22120
+ paymentMethod: "balance" /* ACCOUNT_BALANCE */,
22121
+ title: "Your Wallet",
22122
+ titleIcon: /* @__PURE__ */ React112.createElement(WalletDecoratedIcon, null),
22123
+ description: formatAddress(await funWallet?.getAddress()),
22124
+ meta: {}
22125
+ });
22126
+ const { transferOp } = await generateCheckoutTransferOpItems(
22127
+ DUMMY_TRANSFER_PARAMS.toAddress,
22128
+ DUMMY_TRANSFER_PARAMS.tokenAmount
22129
+ );
22130
+ sponsorInitialTransferGasLimit = Number(transferOp?.userOp.preVerificationGas || 0) + Number(transferOp?.userOp.callGasLimit || 0) + Number(transferOp?.userOp.verificationGasLimit || 0);
22131
+ } else if (selectedPaymentMethod === "card" /* CARD */) {
22132
+ setSelectedPaymentMethodInfo({
22133
+ paymentMethod: "card" /* CARD */,
22134
+ title: "Debit or Credit",
22135
+ titleIcon: /* @__PURE__ */ React112.createElement(CreditCardIcon, null),
22136
+ description: "",
22137
+ meta: {}
22138
+ });
22139
+ }
22140
+ setCheckoutStep("confirmation" /* CONFIRMATION */);
22141
+ await getCheckoutQuote(sponsorInitialTransferGasLimit);
21987
22142
  }
21988
- setCheckoutStep("confirmation" /* CONFIRMATION */);
21989
- await getCheckoutQuote();
22143
+ } catch (err) {
22144
+ console.error("Error confirming source asset", err);
22145
+ } finally {
22146
+ setIsSourceAssetConfirming(false);
21990
22147
  }
21991
22148
  }, [
21992
22149
  checkoutItem?.selectedSourceAssetInfo?.address,
21993
22150
  checkoutItem?.selectedSourceAssetInfo?.symbol,
21994
22151
  funWallet,
22152
+ generateCheckoutTransferOpItems,
21995
22153
  getCheckoutQuote,
21996
22154
  selectedPaymentMethodInfo?.paymentMethod
21997
22155
  ]);
@@ -21999,7 +22157,7 @@ function FunCheckoutModal({
21999
22157
  useEffect31(() => {
22000
22158
  onSourceAssetConfirmed();
22001
22159
  }, [triggerSymbol]);
22002
- const onSelectPaymentMethod = useCallback20(
22160
+ const onSelectPaymentMethod = useCallback21(
22003
22161
  async (partialPaymentMethodInfo) => {
22004
22162
  if (!isWeb2Login) {
22005
22163
  onClose?.();
@@ -22010,16 +22168,17 @@ function FunCheckoutModal({
22010
22168
  if (partialPaymentMethodInfo.paymentMethod === "balance" /* ACCOUNT_BALANCE */) {
22011
22169
  setCheckoutStep("select_asset" /* SELECT_ASSET */);
22012
22170
  } else if (partialPaymentMethodInfo.paymentMethod === "card" /* CARD */) {
22013
- if (!activeChain)
22171
+ if (!checkoutItem?.initSettings.config.targetChain)
22014
22172
  return;
22173
+ const targetChainId = checkoutItem?.initSettings.config.targetChain.toString();
22015
22174
  const tokenAddress = await getTokenAddress(
22016
22175
  DEFAULT_DEPOSIT_TOKEN_TICKER,
22017
- activeChain.id.toString()
22176
+ targetChainId
22018
22177
  );
22019
22178
  updateSourceAsset(
22020
22179
  tokenAddress,
22021
22180
  DEFAULT_DEPOSIT_TOKEN_TICKER,
22022
- activeChain.id.toString()
22181
+ targetChainId
22023
22182
  );
22024
22183
  triggerSourceAssetConfirmedFn();
22025
22184
  } else {
@@ -22027,7 +22186,7 @@ function FunCheckoutModal({
22027
22186
  }
22028
22187
  },
22029
22188
  [
22030
- activeChain,
22189
+ checkoutItem?.initSettings.config.targetChain,
22031
22190
  isWeb2Login,
22032
22191
  onClose,
22033
22192
  openConnectModal,
@@ -22070,11 +22229,13 @@ function FunCheckoutModal({
22070
22229
  onSoftHide: (isHidden) => setIsSoftHidden(isHidden),
22071
22230
  onBackToHome: () => void 0,
22072
22231
  token: checkoutItem?.selectedSourceAssetInfo.symbol || DEFAULT_DEPOSIT_TOKEN_TICKER,
22073
- tokenAmountUsd: checkoutItem?.latestQuote?.estTotalUsd || 0,
22232
+ tokenChainId: checkoutItem?.selectedSourceAssetInfo.chainId || "",
22233
+ tokenAmountUsd: Number(checkoutItem?.latestQuote?.estTotalFromAmount) || 0,
22074
22234
  redirectToCheckoutHistory
22075
22235
  })) : checkoutStep === "select_asset" /* SELECT_ASSET */ ? /* @__PURE__ */ React112.createElement(FunCheckoutSelectAssetStep, {
22076
22236
  checkoutId,
22077
22237
  selectedPaymentMethodInfo,
22238
+ isOnFinishLoading: isSourceAssetConfirming,
22078
22239
  onFinish: triggerSourceAssetConfirmedFn,
22079
22240
  animateOut
22080
22241
  }) : checkoutStep === "confirmation" /* CONFIRMATION */ ? /* @__PURE__ */ React112.createElement(FunCheckoutConfirmationStep, {
@@ -22171,10 +22332,10 @@ import React125 from "react";
22171
22332
  import { useDisconnect as useDisconnect4 } from "wagmi";
22172
22333
 
22173
22334
  // src/components/ConnectOptions/FunConnectOptions.tsx
22174
- import React124, { useCallback as useCallback22, useState as useState34 } from "react";
22335
+ import React124, { useCallback as useCallback23, useState as useState34 } from "react";
22175
22336
 
22176
22337
  // src/components/FunSignInFlow/FunSignInStep.tsx
22177
- import React117, { useCallback as useCallback21, useState as useState32 } from "react";
22338
+ import React117, { useCallback as useCallback22, useState as useState32 } from "react";
22178
22339
 
22179
22340
  // src/utils/groupBy.ts
22180
22341
  function groupBy(items, getKey) {
@@ -22568,7 +22729,7 @@ function FunSignInStep({
22568
22729
  changeStep(3 /* PENDING_WALLET */);
22569
22730
  }
22570
22731
  };
22571
- const handleEmailSubmit = useCallback21(async () => {
22732
+ const handleEmailSubmit = useCallback22(async () => {
22572
22733
  const sendResult = await sendOTPCode?.();
22573
22734
  if (sendResult) {
22574
22735
  setSelectedOptionId(funkitConnectWallet2.id);
@@ -23079,7 +23240,7 @@ function FunConnectOptions({
23079
23240
  setSelectedWallet(void 0);
23080
23241
  }
23081
23242
  };
23082
- const connectToWallet = useCallback22(async (wallet) => {
23243
+ const connectToWallet = useCallback23(async (wallet) => {
23083
23244
  if (wallet.ready) {
23084
23245
  wallet?.connect?.()?.catch(() => {
23085
23246
  changeStep(4 /* ERROR */);
@@ -23191,22 +23352,22 @@ function FunDevTestModal({ onClose, open }) {
23191
23352
  function useModalStateValue() {
23192
23353
  const [isModalOpen, setModalOpen] = useState35(false);
23193
23354
  return {
23194
- closeModal: useCallback23(() => setModalOpen(false), []),
23355
+ closeModal: useCallback24(() => setModalOpen(false), []),
23195
23356
  isModalOpen,
23196
- openModal: useCallback23(() => setModalOpen(true), [])
23357
+ openModal: useCallback24(() => setModalOpen(true), [])
23197
23358
  };
23198
23359
  }
23199
23360
  function useModalStateValueWithId() {
23200
23361
  const [isModalOpen, setModalOpen] = useState35(false);
23201
23362
  const [modalId, setModalId] = useState35(null);
23202
23363
  return {
23203
- closeModal: useCallback23(() => {
23364
+ closeModal: useCallback24(() => {
23204
23365
  setModalId(null);
23205
23366
  setModalOpen(false);
23206
23367
  }, []),
23207
23368
  isModalOpen,
23208
23369
  modalId,
23209
- openModal: useCallback23((id) => {
23370
+ openModal: useCallback24((id) => {
23210
23371
  setModalId(id);
23211
23372
  setModalOpen(true);
23212
23373
  }, [])
@@ -23277,7 +23438,7 @@ function ModalProvider({ children }) {
23277
23438
  openModal: openFunDevTestModal
23278
23439
  } = useModalStateValue();
23279
23440
  const connectionStatus = useConnectionStatus();
23280
- const { chain } = useNetwork11();
23441
+ const { chain } = useNetwork10();
23281
23442
  const chainSupported = !chain?.unsupported;
23282
23443
  function closeModals({
23283
23444
  keepConnectModalOpen = false
@@ -23421,7 +23582,7 @@ function ConnectButtonRenderer({
23421
23582
  watch: true,
23422
23583
  cacheTime: 3e4
23423
23584
  });
23424
- const { chain: activeChain } = useNetwork12();
23585
+ const { chain: activeChain } = useNetwork11();
23425
23586
  const rainbowkitChainsById = useRainbowKitChainsById();
23426
23587
  const authenticationStatus = useAuthenticationStatus() ?? void 0;
23427
23588
  const rainbowKitChain = activeChain ? rainbowkitChainsById[activeChain.id] : void 0;