@embarkai/ui-kit 0.4.110 → 0.4.111

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.
package/dist/index.js CHANGED
@@ -6031,32 +6031,6 @@ var init_ChainSync2 = __esm({
6031
6031
  }
6032
6032
  });
6033
6033
 
6034
- // src/internal/hooks/useAllowExternalModalsScroll.ts
6035
- import { useEffect as useEffect4 } from "react";
6036
- function isFromExternalModal(event) {
6037
- return event.composedPath().some((node) => node instanceof Element && EXTERNAL_MODAL_TAGS.has(node.tagName));
6038
- }
6039
- function stopExternalModalScrollEvent(event) {
6040
- if (isFromExternalModal(event)) event.stopPropagation();
6041
- }
6042
- function useAllowExternalModalsScroll(enabled) {
6043
- useEffect4(() => {
6044
- if (!enabled || typeof document === "undefined") return;
6045
- const body = document.body;
6046
- SCROLL_EVENTS.forEach((type) => body.addEventListener(type, stopExternalModalScrollEvent, { passive: true }));
6047
- return () => {
6048
- SCROLL_EVENTS.forEach((type) => body.removeEventListener(type, stopExternalModalScrollEvent));
6049
- };
6050
- }, [enabled]);
6051
- }
6052
- var EXTERNAL_MODAL_TAGS, SCROLL_EVENTS;
6053
- var init_useAllowExternalModalsScroll = __esm({
6054
- "src/internal/hooks/useAllowExternalModalsScroll.ts"() {
6055
- EXTERNAL_MODAL_TAGS = /* @__PURE__ */ new Set(["W3M-MODAL", "APPKIT-MODAL", "WCM-MODAL"]);
6056
- SCROLL_EVENTS = ["wheel", "touchmove"];
6057
- }
6058
- });
6059
-
6060
6034
  // src/internal/clients/account/register-smart-account-address.ts
6061
6035
  async function registerSmartAccountAddress(chainId, smartAccountAddress, factoryAddress) {
6062
6036
  const accessToken = jwtTokenManager2.getAccessToken();
@@ -6985,7 +6959,7 @@ var init_clients = __esm({
6985
6959
  });
6986
6960
 
6987
6961
  // src/internal/hooks/useAutoConnect.ts
6988
- import { useCallback as useCallback3, useEffect as useEffect5, useRef as useRef2 } from "react";
6962
+ import { useCallback as useCallback3, useEffect as useEffect4, useRef as useRef2 } from "react";
6989
6963
  function useAutoConnect() {
6990
6964
  const {
6991
6965
  config: { current: config },
@@ -7047,7 +7021,7 @@ function useAutoConnect() {
7047
7021
  [usePaymaster, setStatus, activeChainId]
7048
7022
  );
7049
7023
  const autoConnectAttemptedRef = useRef2(false);
7050
- useEffect5(() => {
7024
+ useEffect4(() => {
7051
7025
  if (!hasHydrated) return;
7052
7026
  if (autoConnectAttemptedRef.current) return;
7053
7027
  setIsLoading(true);
@@ -7186,7 +7160,7 @@ var init_useAutoConnect = __esm({
7186
7160
  });
7187
7161
 
7188
7162
  // src/hooks/useOpenPage.ts
7189
- import { useCallback as useCallback4, useEffect as useEffect6, useRef as useRef3 } from "react";
7163
+ import { useCallback as useCallback4, useEffect as useEffect5, useRef as useRef3 } from "react";
7190
7164
  function useOpenPage() {
7191
7165
  const page = useLayoutDataStore((st) => st.page);
7192
7166
  const setPage = useLayoutDataStore((st) => st.setPage);
@@ -7216,7 +7190,7 @@ function useOpenPage() {
7216
7190
  }
7217
7191
  function usePageParams() {
7218
7192
  const currentParams = useRef3({});
7219
- useEffect6(() => {
7193
+ useEffect5(() => {
7220
7194
  const { pageParams, setPageParams } = useLayoutDataStore.getState();
7221
7195
  if (!pageParams) return;
7222
7196
  currentParams.current = pageParams;
@@ -7232,13 +7206,13 @@ var init_useOpenPage = __esm({
7232
7206
  });
7233
7207
 
7234
7208
  // src/internal/hooks/useBackupStatusChanges.ts
7235
- import { useEffect as useEffect7, useRef as useRef4 } from "react";
7209
+ import { useEffect as useEffect6, useRef as useRef4 } from "react";
7236
7210
  function useBackupStatusChanges() {
7237
7211
  const { open: openPage } = useOpenPage();
7238
7212
  const requestSeqRef = useRef4(0);
7239
7213
  const openPageRef = useRef4(openPage);
7240
7214
  openPageRef.current = openPage;
7241
- useEffect7(() => {
7215
+ useEffect6(() => {
7242
7216
  async function handleBackupStatusChanged(event) {
7243
7217
  const detail = event?.detail;
7244
7218
  console.log("[BACKUP STATUS] changed:", detail);
@@ -7280,7 +7254,7 @@ var init_useBackupStatusChanges = __esm({
7280
7254
 
7281
7255
  // src/internal/hooks/useDetectMaxScrollHeight.ts
7282
7256
  import { debounce } from "lodash-es";
7283
- import { useCallback as useCallback5, useEffect as useEffect8 } from "react";
7257
+ import { useCallback as useCallback5, useEffect as useEffect7 } from "react";
7284
7258
  function useDetectMaxScrollHeight() {
7285
7259
  const page = useLayoutDataStore((state) => state.page);
7286
7260
  const setIsMobileView = useLayoutStore((state) => state.setIsMobileView);
@@ -7294,7 +7268,7 @@ function useDetectMaxScrollHeight() {
7294
7268
  }, DEBOUNCE_DELAY),
7295
7269
  [page, setMaxScrollHeight, setIsMobileView]
7296
7270
  );
7297
- useEffect8(() => {
7271
+ useEffect7(() => {
7298
7272
  const obs = new ResizeObserver(([entry]) => onResize(entry.contentRect));
7299
7273
  const doc = window.document.getElementsByTagName("html")[0];
7300
7274
  if (doc) obs.observe(doc);
@@ -7312,7 +7286,7 @@ var init_useDetectMaxScrollHeight = __esm({
7312
7286
  });
7313
7287
 
7314
7288
  // src/internal/hooks/useListenIframeAuthEvents.ts
7315
- import { useCallback as useCallback6, useEffect as useEffect9 } from "react";
7289
+ import { useCallback as useCallback6, useEffect as useEffect8 } from "react";
7316
7290
  function useListenIframeAuthEvents() {
7317
7291
  const setPage = useLayoutDataStore((state) => state.setPage);
7318
7292
  const setIsIframeReady = useSession((state) => state.setIsIframeReady);
@@ -7332,7 +7306,7 @@ function useListenIframeAuthEvents() {
7332
7306
  },
7333
7307
  [setPage, setIsIframeReady]
7334
7308
  );
7335
- useEffect9(() => {
7309
+ useEffect8(() => {
7336
7310
  window.addEventListener("message", handleIframeMessage);
7337
7311
  return () => window.removeEventListener("message", handleIframeMessage);
7338
7312
  }, [handleIframeMessage]);
@@ -7345,7 +7319,7 @@ var init_useListenIframeAuthEvents = __esm({
7345
7319
  });
7346
7320
 
7347
7321
  // src/internal/components/Expandable/hooks/useExpandable.ts
7348
- import { useCallback as useCallback7, useEffect as useEffect10, useRef as useRef5 } from "react";
7322
+ import { useCallback as useCallback7, useEffect as useEffect9, useRef as useRef5 } from "react";
7349
7323
  var DEFERRED_DELAY, useExpandable;
7350
7324
  var init_useExpandable = __esm({
7351
7325
  "src/internal/components/Expandable/hooks/useExpandable.ts"() {
@@ -7354,7 +7328,7 @@ var init_useExpandable = __esm({
7354
7328
  const { isExpanded = false, initHeight = 0, minHeight = 0 } = props;
7355
7329
  const expandableRef = useRef5(null);
7356
7330
  const contentRef = useRef5(null);
7357
- useEffect10(() => {
7331
+ useEffect9(() => {
7358
7332
  if (!expandableRef.current) return;
7359
7333
  expandableRef.current.style.setProperty("--ui-kit-expandable-h", `${initHeight}px )`);
7360
7334
  }, []);
@@ -7370,7 +7344,7 @@ var init_useExpandable = __esm({
7370
7344
  expandableHeightTimerRef.current = null;
7371
7345
  }, DEFERRED_DELAY);
7372
7346
  }, []);
7373
- useEffect10(() => {
7347
+ useEffect9(() => {
7374
7348
  if (!contentRef.current || !expandableRef.current) return;
7375
7349
  const resizeObs = new ResizeObserver(() => setExpandableHeight(minHeight, isExpanded));
7376
7350
  const domMutationObs = new MutationObserver(() => setExpandableHeight(minHeight, isExpanded));
@@ -9636,9 +9610,9 @@ var init_useActivityLog = __esm({
9636
9610
 
9637
9611
  // src/internal/components/ActivityLogMenu/useActivityLogMenuParams.ts
9638
9612
  import { keys } from "lodash-es";
9639
- import { useEffect as useEffect11 } from "react";
9613
+ import { useEffect as useEffect10 } from "react";
9640
9614
  function useActivityLogMenuParams() {
9641
- useEffect11(() => {
9615
+ useEffect10(() => {
9642
9616
  const { pageParams, setPageParams } = useLayoutDataStore.getState();
9643
9617
  if (!pageParams || !keys(pageParams).length) return;
9644
9618
  setTimeout(() => useActivityLogFilters.setState(pageParams), 0);
@@ -10210,7 +10184,7 @@ var init_emailChallenge = __esm({
10210
10184
  // src/internal/components/AuthMenu/SignInStep/Email.tsx
10211
10185
  import { useMutation as useMutation2 } from "@tanstack/react-query";
10212
10186
  import { ChevronRight, Loader as Loader2, Mail as Mail2 } from "lucide-react";
10213
- import { useEffect as useEffect12, useRef as useRef7 } from "react";
10187
+ import { useEffect as useEffect11, useRef as useRef7 } from "react";
10214
10188
  import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
10215
10189
  function Email() {
10216
10190
  const { callbacksRef } = useProviderConfig();
@@ -10281,7 +10255,7 @@ function Email() {
10281
10255
  }
10282
10256
  onSendVerificationCode(email);
10283
10257
  };
10284
- useEffect12(() => {
10258
+ useEffect11(() => {
10285
10259
  if (!focusRef.current || !isMobileView) return;
10286
10260
  focusRef.current?.focus();
10287
10261
  setTimeout(() => {
@@ -11204,7 +11178,7 @@ var init_useAuthMenuHanders = __esm({
11204
11178
  });
11205
11179
 
11206
11180
  // src/internal/components/AuthMenu/VerifyStep/VerificationCodeInput.tsx
11207
- import { useEffect as useEffect13, useRef as useRef9, useState as useState4 } from "react";
11181
+ import { useEffect as useEffect12, useRef as useRef9, useState as useState4 } from "react";
11208
11182
  import { Fragment as Fragment8, jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
11209
11183
  var getRemainingSeconds, VerificationCodeInput;
11210
11184
  var init_VerificationCodeInput = __esm({
@@ -11219,7 +11193,7 @@ var init_VerificationCodeInput = __esm({
11219
11193
  const { t } = useT();
11220
11194
  const setAlert = useAuthStore((st) => st.setAlert);
11221
11195
  const [timeLeft, setTimeLeft] = useState4(() => getRemainingSeconds(expiresAt));
11222
- useEffect13(() => {
11196
+ useEffect12(() => {
11223
11197
  let intervalId;
11224
11198
  const syncTimeLeft = () => {
11225
11199
  const remaining = getRemainingSeconds(expiresAt);
@@ -11243,7 +11217,7 @@ var init_VerificationCodeInput = __esm({
11243
11217
  const lastSubmittedRef = useRef9(null);
11244
11218
  const inputsRef = useRef9([]);
11245
11219
  const [digits, setDigits] = useState4(["", "", "", "", "", ""]);
11246
- useEffect13(() => {
11220
+ useEffect12(() => {
11247
11221
  const code = digits.join("");
11248
11222
  if (code.length === 6 && digits.every((d) => d !== "") && !isLoading) {
11249
11223
  if (lastSubmittedRef.current !== code) {
@@ -11252,7 +11226,7 @@ var init_VerificationCodeInput = __esm({
11252
11226
  }
11253
11227
  }
11254
11228
  }, [digits, isLoading, onVerifyCode]);
11255
- useEffect13(() => {
11229
+ useEffect12(() => {
11256
11230
  const t2 = setTimeout(() => {
11257
11231
  inputsRef.current[0]?.focus();
11258
11232
  }, 0);
@@ -11557,7 +11531,7 @@ var init_VerifyStep2 = __esm({
11557
11531
 
11558
11532
  // src/internal/components/AuthMenu/AuthMenu.tsx
11559
11533
  import { Loader as Loader4 } from "lucide-react";
11560
- import { useEffect as useEffect14, useMemo as useMemo2 } from "react";
11534
+ import { useEffect as useEffect13, useMemo as useMemo2 } from "react";
11561
11535
  import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
11562
11536
  var AuthMenu;
11563
11537
  var init_AuthMenu = __esm({
@@ -11584,7 +11558,7 @@ var init_AuthMenu = __esm({
11584
11558
  const step = useAuthStore((st) => st.step);
11585
11559
  const alert2 = useAuthStore((st) => st.alert);
11586
11560
  const { pendingLoginResponseRef, onAuthSuccess, goBackToSignIn } = useAuthMenuHandlers();
11587
- useEffect14(() => {
11561
+ useEffect13(() => {
11588
11562
  if (!pendingWalletLogin) return;
11589
11563
  const loginResponse = pendingWalletLogin;
11590
11564
  useLayoutDataStore.getState().setPendingWalletLogin(null);
@@ -11594,7 +11568,7 @@ var init_AuthMenu = __esm({
11594
11568
  onAuthSuccess();
11595
11569
  });
11596
11570
  }, [pendingWalletLogin]);
11597
- useEffect14(() => {
11571
+ useEffect13(() => {
11598
11572
  useLayoutDataStore.getState().setTransitionPageHeight(DEFAULT_AUTH_MENU_HEIGHT);
11599
11573
  return () => {
11600
11574
  const { setStep, setPasskeyStatus, setEmail, setEmailChallenge, setAlert } = useAuthStore.getState();
@@ -11786,7 +11760,7 @@ var init_onboarder = __esm({
11786
11760
 
11787
11761
  // src/internal/components/Onboarding/OnboardingOverlay.tsx
11788
11762
  import { ChevronRightIcon, LoaderIcon as LoaderIcon2, XIcon } from "lucide-react";
11789
- import { useEffect as useEffect15, useMemo as useMemo3, useState as useState6 } from "react";
11763
+ import { useEffect as useEffect14, useMemo as useMemo3, useState as useState6 } from "react";
11790
11764
  import { createPortal as createPortal2 } from "react-dom";
11791
11765
  import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
11792
11766
  function getTooltipXPos(params) {
@@ -11812,7 +11786,7 @@ function getTooltipYPos(params) {
11812
11786
  function OnboardingOverlay() {
11813
11787
  const { t } = useT();
11814
11788
  const page = useLayoutDataStore((st) => st.page);
11815
- useEffect15(() => {
11789
+ useEffect14(() => {
11816
11790
  setTimeout(() => {
11817
11791
  if (!page) {
11818
11792
  useOnboardingStore.getState().setMountIntoNode(document.body);
@@ -11848,7 +11822,7 @@ function OnboardingOverlay() {
11848
11822
  };
11849
11823
  return { ...getTooltipXPos(posParams), ...getTooltipYPos(posParams) };
11850
11824
  }, [elRect, isMobileView]);
11851
- useEffect15(() => {
11825
+ useEffect14(() => {
11852
11826
  if (!waitSecs) return;
11853
11827
  setContinueCountdown(waitSecs);
11854
11828
  const countdownInterval = setInterval(() => {
@@ -12007,9 +11981,9 @@ var init_OnboardingOverlay = __esm({
12007
11981
  });
12008
11982
 
12009
11983
  // src/internal/components/Onboarding/useOnboardingTouirAvailable.ts
12010
- import { useEffect as useEffect16 } from "react";
11984
+ import { useEffect as useEffect15 } from "react";
12011
11985
  function useOnboardingTourAvailable(isAvailable) {
12012
- useEffect16(() => {
11986
+ useEffect15(() => {
12013
11987
  useOnboardingStore.getState().setIsTourAvailable(isAvailable);
12014
11988
  return () => useOnboardingStore.getState().setIsTourAvailable(false);
12015
11989
  }, [isAvailable]);
@@ -12579,11 +12553,11 @@ var init_priceFormatter = __esm({
12579
12553
 
12580
12554
  // src/internal/components/BuyMenu/useBuyMenuStore.ts
12581
12555
  import { keys as keys2, noop } from "lodash-es";
12582
- import { useEffect as useEffect17 } from "react";
12556
+ import { useEffect as useEffect16 } from "react";
12583
12557
  import { create as create7 } from "zustand";
12584
12558
  import { persist as persist2 } from "zustand/middleware";
12585
12559
  function useBuyMenuParams() {
12586
- useEffect17(() => {
12560
+ useEffect16(() => {
12587
12561
  const { pageParams, setPageParams } = useLayoutDataStore.getState();
12588
12562
  if (!pageParams || !keys2(pageParams).length) return;
12589
12563
  const { amount, crypto: crypto2, onRampWidgetRedirected } = pageParams || {};
@@ -13758,11 +13732,11 @@ var init_BinanceTxHistory = __esm({
13758
13732
 
13759
13733
  // src/internal/components/BuyMenu/binance/useBinanceSseTracing.ts
13760
13734
  import { useQueryClient as useQueryClient4 } from "@tanstack/react-query";
13761
- import { useEffect as useEffect19, useRef as useRef10 } from "react";
13735
+ import { useEffect as useEffect18, useRef as useRef10 } from "react";
13762
13736
  function useBinanceSseTxTracing(walletAddress) {
13763
13737
  const qc = useQueryClient4();
13764
13738
  const debounceRef = useRef10(null);
13765
- useEffect19(() => {
13739
+ useEffect18(() => {
13766
13740
  if (!walletAddress) return;
13767
13741
  const iframeManager = getIframeManager();
13768
13742
  if (!iframeManager) return;
@@ -13804,7 +13778,7 @@ var init_utils7 = __esm({
13804
13778
  // src/internal/components/BuyMenu/binance/Binance.tsx
13805
13779
  import { useMutation as useMutation5, useQuery as useQuery4, useQueryClient as useQueryClient5 } from "@tanstack/react-query";
13806
13780
  import { LoaderIcon as LoaderIcon5 } from "lucide-react";
13807
- import { useEffect as useEffect20 } from "react";
13781
+ import { useEffect as useEffect19 } from "react";
13808
13782
  import { Fragment as Fragment13, jsx as jsx47, jsxs as jsxs40 } from "react/jsx-runtime";
13809
13783
  function Binance() {
13810
13784
  const qc = useQueryClient5();
@@ -13857,7 +13831,7 @@ function Binance() {
13857
13831
  });
13858
13832
  const paymentModes = paymentModesData?.data?.paymentMethods || [];
13859
13833
  const selectedPaymentMode = paymentModes?.find((el) => getPayMethodID(el) === paymentMode) || null;
13860
- useEffect20(() => {
13834
+ useEffect19(() => {
13861
13835
  useBuyMenuStore.getState().setMinAmount(Number(selectedPaymentMode?.fiatMinLimit || "0"));
13862
13836
  }, [selectedPaymentMode]);
13863
13837
  const { mutate: estimateQuote, isPending: isQuoteEstimating } = useMutation5({
@@ -13885,22 +13859,22 @@ function Binance() {
13885
13859
  }
13886
13860
  });
13887
13861
  const availableFiats = (tradingPairsData?.data?.fiatCurrencies || []).map((ticker) => ({ ticker }));
13888
- useEffect20(() => {
13862
+ useEffect19(() => {
13889
13863
  if (!!selectedFiat || !availableFiats?.length) return;
13890
13864
  const targetFiat = availableFiats.find((item) => PREFERRED_FIATS.includes(item.ticker)) || availableFiats[0];
13891
13865
  useBuyMenuStore.getState().setSelectedFiat(targetFiat.ticker);
13892
13866
  }, [availableFiats, selectedFiat]);
13893
- useEffect20(() => {
13867
+ useEffect19(() => {
13894
13868
  if (!!selectedCrypto || !networkAvailableCryptoList?.length) return;
13895
13869
  const targetCrypto = networkAvailableCryptoList.find((item) => PREFERRED_CRYPTOS.includes(item.cryptoCurrency)) || networkAvailableCryptoList[0];
13896
13870
  useBuyMenuStore.getState().setSelectedCrypto(targetCrypto.cryptoCurrency);
13897
13871
  }, [networkAvailableCryptoList, selectedCrypto]);
13898
- useEffect20(() => {
13872
+ useEffect19(() => {
13899
13873
  if (!!paymentMode || !paymentModes.length) return;
13900
13874
  const targetPaymentMode = paymentModes.find((item) => item.payMethodCode === PREFERRED_PAYMENT_METHOD) || paymentModes[0];
13901
13875
  useBinanceStore.getState().setPaymentMode(getPayMethodID(targetPaymentMode));
13902
13876
  }, [paymentModes]);
13903
- useEffect20(() => {
13877
+ useEffect19(() => {
13904
13878
  return () => {
13905
13879
  useBinanceStore.getState().setPaymentMode(null);
13906
13880
  qc.resetQueries({ queryKey: [QUERY_KEYS2.binanceTradingPairs] });
@@ -14419,11 +14393,11 @@ var init_networks = __esm({
14419
14393
 
14420
14394
  // src/internal/components/BuyMenu/finchpay/useFinchpaySseTxTracing.ts
14421
14395
  import { useQueryClient as useQueryClient6 } from "@tanstack/react-query";
14422
- import { useEffect as useEffect21, useRef as useRef11 } from "react";
14396
+ import { useEffect as useEffect20, useRef as useRef11 } from "react";
14423
14397
  function useFinchpaySseTxTracing(walletAddress) {
14424
14398
  const qc = useQueryClient6();
14425
14399
  const debounceRef = useRef11(null);
14426
- useEffect21(() => {
14400
+ useEffect20(() => {
14427
14401
  if (!walletAddress) return;
14428
14402
  const iframeManager = getIframeManager();
14429
14403
  if (!iframeManager) return;
@@ -14472,7 +14446,7 @@ var init_utils8 = __esm({
14472
14446
  // src/internal/components/BuyMenu/finchpay/FinchPay.tsx
14473
14447
  import { useQuery as useQuery5, useQueryClient as useQueryClient7 } from "@tanstack/react-query";
14474
14448
  import { DollarSign, LoaderIcon as LoaderIcon7 } from "lucide-react";
14475
- import { useEffect as useEffect22 } from "react";
14449
+ import { useEffect as useEffect21 } from "react";
14476
14450
  import { Fragment as Fragment14, jsx as jsx50, jsxs as jsxs43 } from "react/jsx-runtime";
14477
14451
  function FinchPay() {
14478
14452
  const qc = useQueryClient7();
@@ -14548,7 +14522,7 @@ function FinchPay() {
14548
14522
  })
14549
14523
  });
14550
14524
  const minimum = Number(limitsData?.min_amount || "0");
14551
- useEffect22(() => {
14525
+ useEffect21(() => {
14552
14526
  if (minimum <= 0) return;
14553
14527
  useBuyMenuStore.getState().setMinAmount(minimum);
14554
14528
  }, [minimum]);
@@ -14576,23 +14550,23 @@ function FinchPay() {
14576
14550
  // defaults to CARD estimation, widgetUrl
14577
14551
  })
14578
14552
  });
14579
- useEffect22(() => {
14553
+ useEffect21(() => {
14580
14554
  const { error: errorTitle, message: errorMessage } = handleErrors([currenciesError, limitsError, estimateError]);
14581
14555
  if (!errorTitle && !errorMessage) return;
14582
14556
  console.error(`[BuyModal][Binance] ${errorTitle}: ${errorMessage}`);
14583
14557
  useBuyMenuStore.getState().setError(errorMessage);
14584
14558
  }, [currenciesError, limitsError, estimateError]);
14585
- useEffect22(() => {
14559
+ useEffect21(() => {
14586
14560
  if (!!selectedFiat || currenciesData.fiats.length === 0) return;
14587
14561
  const fallbackFiat = currenciesData.fiats[0];
14588
14562
  const targetFiat = currenciesData.fiats.find((f) => f.ticker.toUpperCase() === "USD") || fallbackFiat;
14589
14563
  useBuyMenuStore.getState().setSelectedFiat(targetFiat.ticker);
14590
14564
  }, [currenciesData, selectedFiat]);
14591
- useEffect22(() => {
14565
+ useEffect21(() => {
14592
14566
  if (!!selectedCrypto || currenciesData.currentNetworkCoins.length === 0) return;
14593
14567
  useBuyMenuStore.getState().setSelectedCrypto(currenciesData.currentNetworkCoins[0].ticker);
14594
14568
  }, [currenciesData, selectedCrypto]);
14595
- useEffect22(() => {
14569
+ useEffect21(() => {
14596
14570
  return () => {
14597
14571
  qc.resetQueries({ queryKey: [QUERY_KEYS2.finchPayCurrencies] });
14598
14572
  qc.resetQueries({ queryKey: [QUERY_KEYS2.finchPayLimits] });
@@ -14846,7 +14820,7 @@ var init_ProviderSelector = __esm({
14846
14820
  });
14847
14821
 
14848
14822
  // src/internal/components/BuyMenu/useHandleInputAmount.ts
14849
- import { useEffect as useEffect23, useRef as useRef12 } from "react";
14823
+ import { useEffect as useEffect22, useRef as useRef12 } from "react";
14850
14824
  var ON_INPUT_QUERY_DELAY, useHandleInputAmount;
14851
14825
  var init_useHandleInputAmount = __esm({
14852
14826
  "src/internal/components/BuyMenu/useHandleInputAmount.ts"() {
@@ -14859,7 +14833,7 @@ var init_useHandleInputAmount = __esm({
14859
14833
  const srcInputAmount = useBuyMenuStore((st) => st.srcInputAmount);
14860
14834
  const minAmount = useBuyMenuStore((st) => st.minAmount);
14861
14835
  const queryAmountTimer = useRef12(null);
14862
- useEffect23(() => {
14836
+ useEffect22(() => {
14863
14837
  if (queryAmountTimer.current) clearTimeout(queryAmountTimer.current);
14864
14838
  queryAmountTimer.current = setTimeout(() => {
14865
14839
  const checkedValue = Math.ceil(Math.max(Number(srcInputAmount), Number(minAmount)));
@@ -14867,7 +14841,7 @@ var init_useHandleInputAmount = __esm({
14867
14841
  useBuyMenuStore.getState().setSrcQueryAmount(checkedValue);
14868
14842
  }, ON_INPUT_QUERY_DELAY);
14869
14843
  }, [minAmount, srcInputAmount]);
14870
- useEffect23(() => {
14844
+ useEffect22(() => {
14871
14845
  if (lastRampProviderRef.current === rampProvider) return;
14872
14846
  const {
14873
14847
  setIsProviderSummary,
@@ -16552,7 +16526,7 @@ var init_EmailNotConnectedWarning = __esm({
16552
16526
 
16553
16527
  // src/internal/components/ManageWalletMenu/hooks/useLinkSocial.ts
16554
16528
  import { useQueryClient as useQueryClient11 } from "@tanstack/react-query";
16555
- import React29, { useEffect as useEffect24 } from "react";
16529
+ import React29, { useEffect as useEffect23 } from "react";
16556
16530
  function normalizeSocialLinkError(message) {
16557
16531
  if (message === "X_ALREADY_LINKED") {
16558
16532
  return "This X account is already linked to another account";
@@ -16627,7 +16601,7 @@ function useLinkSocial() {
16627
16601
  [config.social?.providers]
16628
16602
  );
16629
16603
  const [socialLinkStarted, setSocialLinkStarted] = React29.useState(false);
16630
- useEffect24(() => {
16604
+ useEffect23(() => {
16631
16605
  const key = providerType?.toLowerCase();
16632
16606
  console.log("[useLinkSocial] Effect triggered:", { key, linkIsLoading, socialLinkStarted });
16633
16607
  if (key && key !== "telegram" && key !== "email" && key !== "passkey" && key !== "wallet") {
@@ -16706,7 +16680,7 @@ var init_telegram2 = __esm({
16706
16680
 
16707
16681
  // src/internal/components/ManageWalletMenu/hooks/useLinkTelegram.ts
16708
16682
  import { useQueryClient as useQueryClient12 } from "@tanstack/react-query";
16709
- import { useCallback as useCallback16, useEffect as useEffect25, useState as useState12 } from "react";
16683
+ import { useCallback as useCallback16, useEffect as useEffect24, useState as useState12 } from "react";
16710
16684
  function useLinkTelegram() {
16711
16685
  const {
16712
16686
  config: { current: config },
@@ -16764,7 +16738,7 @@ function useLinkTelegram() {
16764
16738
  }
16765
16739
  }, [config.social?.providers]);
16766
16740
  const [telegramLinkStarted, setTelegramLinkStarted] = useState12(false);
16767
- useEffect25(() => {
16741
+ useEffect24(() => {
16768
16742
  console.log("[useLinkTelegram] Effect triggered:", { providerType, linkIsLoading, telegramLinkStarted });
16769
16743
  if (providerType === "telegram" && !linkIsLoading && !telegramLinkStarted) {
16770
16744
  console.log("[useLinkTelegram] Starting Telegram link flow");
@@ -16772,7 +16746,7 @@ function useLinkTelegram() {
16772
16746
  handleLinkTelegram();
16773
16747
  }
16774
16748
  }, [providerType, handleLinkTelegram, linkIsLoading, telegramLinkStarted]);
16775
- useEffect25(() => {
16749
+ useEffect24(() => {
16776
16750
  if (providerType !== "telegram") {
16777
16751
  setTelegramLinkStarted(false);
16778
16752
  }
@@ -17285,10 +17259,10 @@ var init_ManageWalletMenu = __esm({
17285
17259
 
17286
17260
  // src/internal/components/ConnectExternalWalletMenu/useConnectExternalWalletMenuParams.ts
17287
17261
  import { keys as keys3 } from "lodash-es";
17288
- import { useEffect as useEffect26, useRef as useRef13 } from "react";
17262
+ import { useEffect as useEffect25, useRef as useRef13 } from "react";
17289
17263
  function useConnectExternalWalletMenuParams() {
17290
17264
  const paramsRef = useRef13(null);
17291
- useEffect26(() => {
17265
+ useEffect25(() => {
17292
17266
  const { pageParams, setPageParams } = useLayoutDataStore.getState();
17293
17267
  if (!pageParams || !keys3(pageParams).length) return;
17294
17268
  paramsRef.current = pageParams;
@@ -17624,14 +17598,7 @@ function ConnectExternalWalletMenu() {
17624
17598
  } finally {
17625
17599
  setIsPreparingConnect(false);
17626
17600
  }
17627
- switch (true) {
17628
- case (connector.id === "metaMaskSDK" && !hasInjectedWallet2):
17629
- closeEmbarkAI();
17630
- break;
17631
- default:
17632
- useLayoutStore.getState().setIsDialogForced(true);
17633
- break;
17634
- }
17601
+ useLayoutStore.getState().setIsDialogForced(true);
17635
17602
  try {
17636
17603
  await connect({ connector });
17637
17604
  } catch {
@@ -17701,68 +17668,81 @@ var init_ConnectExternalWalletMenu = __esm({
17701
17668
  });
17702
17669
 
17703
17670
  // src/internal/components/ConnectExternalWalletMenu/useExternalWalletConnect.ts
17671
+ import { omit as omit2 } from "lodash-es";
17704
17672
  import { useCallback as useCallback18 } from "react";
17705
- import { useConfig as useConfig2, useConnect as useConnect2, useConnectors as useConnectors2, useDisconnect as useDisconnect3 } from "wagmi";
17673
+ import {
17674
+ useConfig as useConfig2,
17675
+ useConnect as useConnect2,
17676
+ useConnections as useConnections3,
17677
+ useConnectors as useConnectors2,
17678
+ useDisconnect as useDisconnect3
17679
+ } from "wagmi";
17706
17680
  function useExternalWalletConnnect(options) {
17707
17681
  const { onSuccess, onError } = options || {};
17708
17682
  const { config } = useProviderConfig();
17709
17683
  const walletMode = config.current?.wallet?.mode;
17710
17684
  const wagmiConfig3 = useConfig2();
17711
17685
  const connectors = useConnectors2();
17712
- const { mutate: disconnect } = useDisconnect3();
17713
- const { mutate: connect, ...restUseConnect } = useConnect2({
17714
- mutation: {
17715
- onSuccess: (connectionData, { connector }) => {
17716
- const { chainId, accounts } = connectionData;
17717
- const signingWalletAddress = accounts[0];
17718
- useExternalWalletStore.getState().setExternalWallet({
17719
- address: signingWalletAddress,
17720
- chainId,
17721
- connectorName: connector.name || "Unknown Wallet"
17722
- });
17723
- onSuccess?.({ connected: true, address: signingWalletAddress });
17724
- useLayoutStore.getState().setIsDialogForced(false);
17725
- },
17726
- onError: async (error, { connector }) => {
17727
- await dropFailedConnectorSession(error, connector, wagmiConfig3);
17728
- onError?.({
17729
- connected: false,
17730
- connector: connector?.name || "Unknown Wallet",
17731
- error
17732
- });
17733
- useLayoutStore.getState().setIsDialogForced(false);
17734
- }
17735
- }
17736
- });
17737
- const disconnectExternalWallet = useCallback18(() => {
17738
- try {
17739
- disconnect();
17740
- } catch {
17741
- return;
17742
- }
17743
- useExternalWalletStore.getState().clearExternalWallet();
17744
- }, [disconnect]);
17686
+ const connections = useConnections3();
17687
+ const { mutate: connect, mutateAsync: connectAsync, ...restUseConnect } = useConnect2();
17688
+ const { mutateAsync: disconnectAsync } = useDisconnect3();
17689
+ const disconnectExternalWallet = useCallback18(async () => {
17690
+ await disconnectAsync();
17691
+ const { externalAddress, clearExternalWallet } = useExternalWalletStore.getState();
17692
+ if (!!externalAddress) clearExternalWallet();
17693
+ }, [disconnectAsync]);
17745
17694
  const connectExternalWallet = useCallback18(
17746
17695
  async (walletConnectorType) => {
17747
- disconnectExternalWallet();
17748
17696
  const connector = connectors.find((c) => c.id === walletConnectorType);
17749
17697
  if (!connector) {
17750
- console.error("[ExternalWalletConnnect] Connector not found for:", walletConnectorType);
17698
+ console.warn("[useExternalWalletConnect] Connector not found for:", walletConnectorType);
17751
17699
  return;
17752
17700
  }
17701
+ const existingConnection = connections.find((c) => c.connector.uid === connector.uid);
17702
+ if (!!existingConnection?.connector) {
17703
+ console.warn("[useExternalWalletConnect] Disconnecting existing connection");
17704
+ await disconnectExternalWallet();
17705
+ }
17753
17706
  useLayoutStore.getState().setIsDialogForced(true);
17754
17707
  try {
17755
- await connect({ connector });
17756
- } catch {
17708
+ connect(
17709
+ { connector },
17710
+ {
17711
+ onSuccess: (connectionData, { connector: connector2 }) => {
17712
+ const { chainId, accounts } = connectionData;
17713
+ const signingWalletAddress = accounts[0];
17714
+ useExternalWalletStore.getState().setExternalWallet({
17715
+ address: signingWalletAddress,
17716
+ chainId,
17717
+ connectorName: connector2.name || "Unknown Wallet"
17718
+ });
17719
+ onSuccess?.({ connected: true, address: signingWalletAddress });
17720
+ setTimeout(() => useLayoutStore.getState().setIsDialogForced(false), 100);
17721
+ },
17722
+ onError: async (error, { connector: connector2 }) => {
17723
+ await dropFailedConnectorSession(error, connector2, wagmiConfig3);
17724
+ onError?.({
17725
+ connected: false,
17726
+ connector: connector2?.name || "Unknown Wallet",
17727
+ error
17728
+ });
17729
+ setTimeout(() => useLayoutStore.getState().setIsDialogForced(false), 100);
17730
+ }
17731
+ }
17732
+ );
17733
+ } catch (connectionError) {
17734
+ console.warn("[useExternalWalletConnect] Error:", connectionError);
17735
+ return;
17757
17736
  }
17758
17737
  },
17759
- [connectors]
17738
+ [connections, connectors, onSuccess, onError]
17760
17739
  );
17761
17740
  return {
17762
17741
  isAvailable: walletMode === "direct" || walletMode === "both",
17763
17742
  mutate: connectExternalWallet,
17743
+ mutateAsync: connectExternalWallet,
17764
17744
  disconnect: disconnectExternalWallet,
17765
- ...restUseConnect
17745
+ ...omit2(restUseConnect, ["mutate", "mutateAsync"])
17766
17746
  };
17767
17747
  }
17768
17748
  var init_useExternalWalletConnect = __esm({
@@ -18435,7 +18415,7 @@ var init_guardian_backup = __esm({
18435
18415
 
18436
18416
  // src/internal/components/DevicesMenu/DeviceManageScreen.tsx
18437
18417
  import { ArrowLeft as ArrowLeft10, Cpu, Download, HardDrive, Loader2 as Loader23, Trash2, Upload } from "lucide-react";
18438
- import { useCallback as useCallback19, useEffect as useEffect27, useRef as useRef14, useState as useState16 } from "react";
18418
+ import { useCallback as useCallback19, useEffect as useEffect26, useRef as useRef14, useState as useState16 } from "react";
18439
18419
  import { Fragment as Fragment20, jsx as jsx76, jsxs as jsxs67 } from "react/jsx-runtime";
18440
18420
  function formatSize(bytes) {
18441
18421
  if (bytes < 1024) return `${bytes} B`;
@@ -18455,12 +18435,12 @@ function DeviceManageScreen() {
18455
18435
  const [statusMessage, setStatusMessage] = useState16(null);
18456
18436
  const [errorMessage, setErrorMessage] = useState16(null);
18457
18437
  const [waitingConfirm, setWaitingConfirm] = useState16(false);
18458
- useEffect27(() => {
18438
+ useEffect26(() => {
18459
18439
  if (!statusMessage) return;
18460
18440
  const t = setTimeout(() => setStatusMessage(null), 3e3);
18461
18441
  return () => clearTimeout(t);
18462
18442
  }, [statusMessage]);
18463
- useEffect27(() => {
18443
+ useEffect26(() => {
18464
18444
  if (!deviceId || !isWebSerialAvailable()) {
18465
18445
  setScreen({ step: "error", message: "WebSerial not available" });
18466
18446
  return;
@@ -19392,7 +19372,7 @@ var init_cloudStorage = __esm({
19392
19372
 
19393
19373
  // src/internal/components/KeyshareRestoreMenu/hooks/useCreateBackup.ts
19394
19374
  import { useMutation as useMutation12, useQueryClient as useQueryClient16 } from "@tanstack/react-query";
19395
- import { useCallback as useCallback22, useEffect as useEffect28 } from "react";
19375
+ import { useCallback as useCallback22, useEffect as useEffect27 } from "react";
19396
19376
  function useCreateBackup() {
19397
19377
  const qc = useQueryClient16();
19398
19378
  const session = useSession((st) => st.session);
@@ -19401,7 +19381,7 @@ function useCreateBackup() {
19401
19381
  const usePasskey = useRestoreStore((st) => st.usePasskey);
19402
19382
  const restorePassword = useRestoreStore((st) => st.restorePassword);
19403
19383
  const selectedCloudProvider = useRestoreStore((st) => st.selectedCloudProvider);
19404
- useEffect28(() => {
19384
+ useEffect27(() => {
19405
19385
  if (!hasServerVault) {
19406
19386
  useRestoreStore.getState().setMethod("server");
19407
19387
  useLayoutStore.getState().setIsDialogForced(true);
@@ -19711,7 +19691,7 @@ var init_useRestoreAccount = __esm({
19711
19691
  });
19712
19692
 
19713
19693
  // src/internal/components/KeyshareRestoreMenu/hooks/useValidateFileBackup.ts
19714
- import { useEffect as useEffect29 } from "react";
19694
+ import { useEffect as useEffect28 } from "react";
19715
19695
  function validateRestoreFileFormat(parsedData) {
19716
19696
  if (typeof parsedData !== "object" || parsedData === null) return false;
19717
19697
  const data = parsedData;
@@ -19721,7 +19701,7 @@ function useValidateFileBackup() {
19721
19701
  const restoreFile = useRestoreStore((st) => st.restoreFile);
19722
19702
  const setError = useRestoreStore((st) => st.setError);
19723
19703
  const setUsePasskey = useRestoreStore((st) => st.setUsePasskey);
19724
- useEffect29(() => {
19704
+ useEffect28(() => {
19725
19705
  if (!restoreFile) {
19726
19706
  return;
19727
19707
  }
@@ -19949,7 +19929,7 @@ var init_onboarding_setup4 = __esm({
19949
19929
 
19950
19930
  // src/internal/components/KeyshareRestoreMenu/components/PasswordPasskey.tsx
19951
19931
  import { ChevronRight as ChevronRight3, Eye, EyeOff, Info as Info3, Key as Key5, Loader as Loader12, Plus } from "lucide-react";
19952
- import { useEffect as useEffect30, useRef as useRef15 } from "react";
19932
+ import { useEffect as useEffect29, useRef as useRef15 } from "react";
19953
19933
  import { Fragment as Fragment23, jsx as jsx80, jsxs as jsxs71 } from "react/jsx-runtime";
19954
19934
  function PasswordPasskey(props) {
19955
19935
  const { t } = useT();
@@ -19978,7 +19958,7 @@ function PasswordPasskey(props) {
19978
19958
  } = useRestoreStore();
19979
19959
  const { config } = useProviderConfig();
19980
19960
  const isPasskeyEnabled = config.current.passkey.enabled;
19981
- useEffect30(() => {
19961
+ useEffect29(() => {
19982
19962
  if (!isPasskeyEnabled && usePasskey) setUsePasskey(false);
19983
19963
  }, [isPasskeyEnabled, usePasskey]);
19984
19964
  return /* @__PURE__ */ jsxs71(Fragment23, { children: [
@@ -20316,7 +20296,7 @@ var init_File = __esm({
20316
20296
  import { useQueryClient as useQueryClient17 } from "@tanstack/react-query";
20317
20297
  import dayjs4 from "dayjs";
20318
20298
  import { Download as Download3, Key as Key6, Upload as Upload3 } from "lucide-react";
20319
- import { useEffect as useEffect31 } from "react";
20299
+ import { useEffect as useEffect30 } from "react";
20320
20300
  import { Fragment as Fragment26, jsx as jsx83, jsxs as jsxs74 } from "react/jsx-runtime";
20321
20301
  function Server(props) {
20322
20302
  const { isLoading, mode = "restore", serverHandler, createPasskeyHandler } = props;
@@ -20326,7 +20306,7 @@ function Server(props) {
20326
20306
  const usePasskey = useRestoreStore((st) => st.usePasskey);
20327
20307
  const setUsePasskey = useRestoreStore((st) => st.setUsePasskey);
20328
20308
  const serverRecoveryStatus = qc.getQueryData([CHECK_BACKUP_QUERY_KEY, address]);
20329
- useEffect31(() => {
20309
+ useEffect30(() => {
20330
20310
  if (mode === "backup" || !serverRecoveryStatus?.created?.encryptionMethod) return;
20331
20311
  setUsePasskey(serverRecoveryStatus.created.encryptionMethod === "passkey");
20332
20312
  }, [mode, serverRecoveryStatus, setUsePasskey]);
@@ -20518,7 +20498,7 @@ var init_select = __esm({
20518
20498
  // src/internal/components/KeyshareRestoreMenu/methods/Cloud.tsx
20519
20499
  import { useQuery as useQuery11 } from "@tanstack/react-query";
20520
20500
  import { ArrowLeft as ArrowLeft13, CloudDownload, CloudUpload, Loader as Loader13 } from "lucide-react";
20521
- import { useEffect as useEffect32 } from "react";
20501
+ import { useEffect as useEffect31 } from "react";
20522
20502
  import { Fragment as Fragment27, jsx as jsx85, jsxs as jsxs76 } from "react/jsx-runtime";
20523
20503
  function Cloud2(props) {
20524
20504
  const { isLoading, mode = "restore", cloudHandler } = props;
@@ -20539,7 +20519,7 @@ function Cloud2(props) {
20539
20519
  return availableProviders.map((p) => ({ id: p.id, name: p.name, available: p.isAvailable() }));
20540
20520
  }
20541
20521
  });
20542
- useEffect32(() => {
20522
+ useEffect31(() => {
20543
20523
  if (isCloudProvidersLoading) return;
20544
20524
  if (!!cloudProvidersError) {
20545
20525
  console.error("[KeyshareBackup] Failed to load cloud providers:", cloudProvidersError);
@@ -20779,7 +20759,7 @@ var init_methods = __esm({
20779
20759
  // src/internal/components/KeyshareRestoreMenu/KeyshareRestoreMenu.tsx
20780
20760
  import { useMutation as useMutation14, useQuery as useQuery12, useQueryClient as useQueryClient18 } from "@tanstack/react-query";
20781
20761
  import { AlertCircle as AlertCircle2, CheckCircle2 as CheckCircle22, CloudDownload as CloudDownload2, Loader as Loader14, UserCircle as UserCircle2 } from "lucide-react";
20782
- import { useEffect as useEffect33 } from "react";
20762
+ import { useEffect as useEffect32 } from "react";
20783
20763
  import { useDisconnect as useDisconnect4 } from "wagmi";
20784
20764
  import { Fragment as Fragment29, jsx as jsx87, jsxs as jsxs78 } from "react/jsx-runtime";
20785
20765
  var RESTORE_COMPONENTS, KeyshareRestoreMenu;
@@ -20815,7 +20795,7 @@ var init_KeyshareRestoreMenu = __esm({
20815
20795
  const error = useRestoreStore((st) => st.error);
20816
20796
  const success = useRestoreStore((st) => st.success);
20817
20797
  const currentRestoreMethod = useRestoreStore((st) => st.method);
20818
- useEffect33(() => {
20798
+ useEffect32(() => {
20819
20799
  const { setIsDialogForced } = useLayoutStore.getState();
20820
20800
  const { setRestorePassword, setRestoreFile, setShowPassword, setUsePasskey, setMethod } = useRestoreStore.getState();
20821
20801
  setIsDialogForced(true);
@@ -20854,7 +20834,7 @@ var init_KeyshareRestoreMenu = __esm({
20854
20834
  queryFn: async () => await getShareRecoveryStats()
20855
20835
  });
20856
20836
  const hasServerBackup = serverRecoveryStatus?.created || serverRecoveryStatus?.devices?.length > 0;
20857
- useEffect33(() => {
20837
+ useEffect32(() => {
20858
20838
  if (!!hasServerBackup) useRestoreStore.getState().setMethod("server");
20859
20839
  }, [hasServerBackup]);
20860
20840
  const { mutate: disconnect, isPending: isDisconnecting } = useMutation14({
@@ -20994,7 +20974,7 @@ var init_KeyshareRestoreMenu = __esm({
20994
20974
  // src/internal/components/KeyshareRestoreMenu/KeyshareBackupMenu.tsx
20995
20975
  import { useQuery as useQuery13 } from "@tanstack/react-query";
20996
20976
  import { AlertCircle as AlertCircle3, ArrowLeft as ArrowLeft14, CheckCircle2 as CheckCircle23, Loader as Loader15, LockIcon } from "lucide-react";
20997
- import { useEffect as useEffect34 } from "react";
20977
+ import { useEffect as useEffect33 } from "react";
20998
20978
  import { Fragment as Fragment30, jsx as jsx88, jsxs as jsxs79 } from "react/jsx-runtime";
20999
20979
  function KeyshareBackupMenu() {
21000
20980
  const address = useSession((st) => st.address);
@@ -21005,7 +20985,7 @@ function KeyshareBackupMenu() {
21005
20985
  const usePasskey = useRestoreStore((st) => st.usePasskey);
21006
20986
  const error = useRestoreStore((st) => st.error);
21007
20987
  const success = useRestoreStore((st) => st.success);
21008
- useEffect34(() => {
20988
+ useEffect33(() => {
21009
20989
  const { setSuccess, setError, setRestorePassword, setRestoreFile, setShowPassword, setUsePasskey, setMethod } = useRestoreStore.getState();
21010
20990
  return () => {
21011
20991
  setSuccess(null);
@@ -21025,7 +21005,7 @@ function KeyshareBackupMenu() {
21025
21005
  });
21026
21006
  useOnboardingTourAvailable(!isRecoveryLoading && currentBackupMethod === "server" && !usePasskey);
21027
21007
  const hasRecoveryData2 = serverRecoveryStatus?.created || serverRecoveryStatus?.devices?.length > 0;
21028
- useEffect34(() => {
21008
+ useEffect33(() => {
21029
21009
  if (!!hasRecoveryData2) useRestoreStore.getState().setMethod("server");
21030
21010
  }, [hasRecoveryData2]);
21031
21011
  const {
@@ -21272,7 +21252,7 @@ var init_SumsubIframeManager = __esm({
21272
21252
  });
21273
21253
 
21274
21254
  // src/internal/components/KYC/useSumsubIframe.ts
21275
- import { useEffect as useEffect35, useRef as useRef16, useState as useState21 } from "react";
21255
+ import { useEffect as useEffect34, useRef as useRef16, useState as useState21 } from "react";
21276
21256
  function useSumsubIframe({ iframeUrl }) {
21277
21257
  const config = useProviderConfig().config;
21278
21258
  const { colorMode } = useColorMode();
@@ -21282,7 +21262,7 @@ function useSumsubIframe({ iframeUrl }) {
21282
21262
  const [height, setHeight] = useState21(0);
21283
21263
  const [status, setStatus] = useState21("");
21284
21264
  const levelName = config.current?.kyc?.options?.levelName;
21285
- useEffect35(() => {
21265
+ useEffect34(() => {
21286
21266
  setError(null);
21287
21267
  setIsLoading(true);
21288
21268
  setStatus("Preparing verification...");
@@ -22784,11 +22764,11 @@ var init_useNicknameStore = __esm({
22784
22764
  // src/internal/components/NicknameMenu/useNicknameAvailability.ts
22785
22765
  import { useMutation as useMutation15 } from "@tanstack/react-query";
22786
22766
  import { debounce as debounce4 } from "lodash-es";
22787
- import { useCallback as useCallback25, useEffect as useEffect36 } from "react";
22767
+ import { useCallback as useCallback25, useEffect as useEffect35 } from "react";
22788
22768
  function useNicknameAvailability(currentNickname) {
22789
22769
  const { t } = useT();
22790
22770
  const nicknameValue = useNicknameStore((st) => st.nicknameValue);
22791
- useEffect36(() => {
22771
+ useEffect35(() => {
22792
22772
  if (!currentNickname) return;
22793
22773
  useNicknameStore.getState().setNicknameValue(currentNickname);
22794
22774
  }, [currentNickname]);
@@ -22810,7 +22790,7 @@ function useNicknameAvailability(currentNickname) {
22810
22790
  }
22811
22791
  });
22812
22792
  const debouncedCheckAvailability = useCallback25(debounce4(checkAvailability, DEBOUNCE_MS), [checkAvailability]);
22813
- useEffect36(() => {
22793
+ useEffect35(() => {
22814
22794
  if (!currentNickname) return;
22815
22795
  const normalizedInputValue = normalizeNickname(nicknameValue);
22816
22796
  const { valid: isNicknameValid } = validateNickname(nicknameValue);
@@ -22839,7 +22819,7 @@ var init_useNicknameAvailability = __esm({
22839
22819
  // src/internal/components/NicknameMenu/NicknameEditForm.tsx
22840
22820
  import { useMutation as useMutation16, useQueryClient as useQueryClient21 } from "@tanstack/react-query";
22841
22821
  import { AtSignIcon, CopyIcon as CopyIcon2, LoaderIcon as LoaderIcon12, SaveIcon } from "lucide-react";
22842
- import { useCallback as useCallback26, useEffect as useEffect37, useRef as useRef18, useState as useState23 } from "react";
22822
+ import { useCallback as useCallback26, useEffect as useEffect36, useRef as useRef18, useState as useState23 } from "react";
22843
22823
  import { Fragment as Fragment34, jsx as jsx98, jsxs as jsxs89 } from "react/jsx-runtime";
22844
22824
  function NicknameEditForm(props) {
22845
22825
  const { isInitialUser, nicknameInfo } = props;
@@ -22854,7 +22834,7 @@ function NicknameEditForm(props) {
22854
22834
  const { isCheckingAvailability } = useNicknameAvailability(nicknameInfo ? nicknameInfo.handle : "");
22855
22835
  const [isNicknameCopied, setIsNicknameCopied] = useState23(false);
22856
22836
  const exitTimerRef = useRef18(null);
22857
- useEffect37(() => () => {
22837
+ useEffect36(() => () => {
22858
22838
  if (exitTimerRef.current) clearTimeout(exitTimerRef.current);
22859
22839
  }, []);
22860
22840
  const { mutate: changeNickname2, isPending: isNicknameChanging } = useMutation16({
@@ -23018,7 +22998,7 @@ var init_NicknameEditForm = __esm({
23018
22998
  import { useQuery as useQuery19 } from "@tanstack/react-query";
23019
22999
  import dayjs5 from "dayjs";
23020
23000
  import { ArrowLeft as ArrowLeft18, Loader as Loader18 } from "lucide-react";
23021
- import { useEffect as useEffect38 } from "react";
23001
+ import { useEffect as useEffect37 } from "react";
23022
23002
  import { jsx as jsx99, jsxs as jsxs90 } from "react/jsx-runtime";
23023
23003
  function NicknameMenu() {
23024
23004
  const { isInitialUser } = usePageParams().current;
@@ -23038,7 +23018,7 @@ function NicknameMenu() {
23038
23018
  queryFn: async () => await getNicknameInfo()
23039
23019
  });
23040
23020
  const resolvedError = nicknameError || nicknameInfoError?.message || null;
23041
- useEffect38(() => () => useNicknameStore.getState().reset(), []);
23021
+ useEffect37(() => () => useNicknameStore.getState().reset(), []);
23042
23022
  return /* @__PURE__ */ jsxs90(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
23043
23023
  /* @__PURE__ */ jsxs90("div", { className: "flex items-center gap-[var(--ui-kit-gap)] ", children: [
23044
23024
  /* @__PURE__ */ jsx99(
@@ -23230,7 +23210,7 @@ var init_nickname_fingerprint = __esm({
23230
23210
  import { useQuery as useQuery20 } from "@tanstack/react-query";
23231
23211
  import { ArrowLeft as ArrowLeft19, AtSignIcon as AtSignIcon2, CheckCircle2 as CheckCircle24, Copy as Copy2, FingerprintIcon, LoaderIcon as LoaderIcon13, Wallet2Icon as Wallet2Icon4 } from "lucide-react";
23232
23212
  import QRCode from "qrcode";
23233
- import { useEffect as useEffect39, useMemo as useMemo15, useState as useState24 } from "react";
23213
+ import { useEffect as useEffect38, useMemo as useMemo15, useState as useState24 } from "react";
23234
23214
  import { Fragment as Fragment35, jsx as jsx100, jsxs as jsxs91 } from "react/jsx-runtime";
23235
23215
  function ReceiveMenu() {
23236
23216
  const { t } = useT();
@@ -23256,7 +23236,7 @@ function ReceiveMenu() {
23256
23236
  return null;
23257
23237
  }
23258
23238
  }, [session?.ownerAddress]);
23259
- useEffect39(() => {
23239
+ useEffect38(() => {
23260
23240
  if (!address) return;
23261
23241
  QRCode.toDataURL(address, {
23262
23242
  width: 200,
@@ -24058,7 +24038,7 @@ var init_utils10 = __esm({
24058
24038
  });
24059
24039
 
24060
24040
  // src/internal/components/SecurityMenu/UserPolicies/usePolicyForm.ts
24061
- import { useEffect as useEffect40, useState as useState25 } from "react";
24041
+ import { useEffect as useEffect39, useState as useState25 } from "react";
24062
24042
  import { create as create14 } from "zustand";
24063
24043
  function updateDestinations(patch) {
24064
24044
  usePolicyForm.setState((st) => ({ ...st, destinations: { ...st?.destinations, ...patch } }));
@@ -24070,7 +24050,7 @@ function useWatchFormData() {
24070
24050
  const [showFormErrors, setShowFormErrors] = useState25(false);
24071
24051
  const formData = usePolicyForm();
24072
24052
  const formState = usePolicyFormValidation();
24073
- useEffect40(() => {
24053
+ useEffect39(() => {
24074
24054
  if (!formData) return;
24075
24055
  setShowFormErrors(false);
24076
24056
  const errors = {};
@@ -24097,7 +24077,7 @@ function useWatchFormData() {
24097
24077
  }
24098
24078
  usePolicyFormValidation.setState(errors, true);
24099
24079
  }, [formData]);
24100
- useEffect40(() => () => usePolicyFormValidation.setState({}, true), []);
24080
+ useEffect39(() => () => usePolicyFormValidation.setState({}, true), []);
24101
24081
  const formErrorItem = Object.entries(formState).find(([_, value]) => value?.error);
24102
24082
  const formErrorMessage = formErrorItem ? `${formErrorItem[0].toUpperCase()}: ${formErrorItem[1]?.error}` : "";
24103
24083
  return {
@@ -24604,9 +24584,9 @@ var init_UserPolicies2 = __esm({
24604
24584
 
24605
24585
  // src/internal/components/SecurityMenu/useSecurityMenuParams.ts
24606
24586
  import { keys as keys4 } from "lodash-es";
24607
- import { useEffect as useEffect41 } from "react";
24587
+ import { useEffect as useEffect40 } from "react";
24608
24588
  function useSecurityMenuParams() {
24609
- useEffect41(() => {
24589
+ useEffect40(() => {
24610
24590
  const { pageParams, setPageParams } = useLayoutDataStore.getState();
24611
24591
  if (!pageParams || !keys4(pageParams).length) return;
24612
24592
  const { submenu } = pageParams;
@@ -24640,7 +24620,7 @@ var init_useSecurityMenuParams = __esm({
24640
24620
 
24641
24621
  // src/internal/components/SecurityMenu/SecurityMenu.tsx
24642
24622
  import { ArrowLeft as ArrowLeft20, LayoutGridIcon, ShieldCogIcon } from "lucide-react";
24643
- import { useEffect as useEffect42 } from "react";
24623
+ import { useEffect as useEffect41 } from "react";
24644
24624
  import { Fragment as Fragment38, jsx as jsx108, jsxs as jsxs99 } from "react/jsx-runtime";
24645
24625
  function SecurityMenuContent() {
24646
24626
  const { t } = useT();
@@ -24649,7 +24629,7 @@ function SecurityMenuContent() {
24649
24629
  const { appToUntrust, showConnectedApps, showAssetsPolicies } = useSecurityStore();
24650
24630
  const policyForm = usePolicyForm();
24651
24631
  useOnboardingTourAvailable(!showConnectedApps && !showAssetsPolicies);
24652
- useEffect42(() => {
24632
+ useEffect41(() => {
24653
24633
  let securityTitle = "";
24654
24634
  switch (true) {
24655
24635
  case showConnectedApps:
@@ -24670,7 +24650,7 @@ function SecurityMenuContent() {
24670
24650
  return () => {
24671
24651
  };
24672
24652
  }, [t, showConnectedApps, showAssetsPolicies, policyForm]);
24673
- useEffect42(
24653
+ useEffect41(
24674
24654
  () => () => {
24675
24655
  usePolicyForm.setState(null, true);
24676
24656
  useSecurityStore.setState(
@@ -24966,12 +24946,12 @@ var init_SenderSelector = __esm({
24966
24946
  });
24967
24947
 
24968
24948
  // src/internal/components/SendMenu/hyperbridge/hooks/useAvailableSenders.ts
24969
- import { useEffect as useEffect43, useRef as useRef19 } from "react";
24949
+ import { useEffect as useEffect42, useRef as useRef19 } from "react";
24970
24950
  function useAvailableSenders() {
24971
24951
  const address = useSession((st) => st.address);
24972
24952
  const { profiles } = useLinkedProfiles();
24973
24953
  const lastCalcedSenders = useRef19([]);
24974
- useEffect43(() => {
24954
+ useEffect42(() => {
24975
24955
  const sendersAccumulator = [
24976
24956
  {
24977
24957
  type: "embarkai-wallet",
@@ -25674,7 +25654,7 @@ var init_useBridge = __esm({
25674
25654
 
25675
25655
  // src/internal/components/SendMenu/hyperbridge/hooks/useHyperlaneRoutes.ts
25676
25656
  import { useQuery as useQuery24 } from "@tanstack/react-query";
25677
- import { useEffect as useEffect44 } from "react";
25657
+ import { useEffect as useEffect43 } from "react";
25678
25658
  function useHyperlaneRoutes() {
25679
25659
  const address = useSession((st) => st.address);
25680
25660
  const page = useLayoutDataStore((st) => st.page);
@@ -25690,7 +25670,7 @@ function useHyperlaneRoutes() {
25690
25670
  queryKey: [HYPERLANE_WARP_ROUTES_QUERY_KEY, address],
25691
25671
  queryFn: async () => await getHyperlaneWarpRoutes()
25692
25672
  });
25693
- useEffect44(() => {
25673
+ useEffect43(() => {
25694
25674
  if (!errorWarpRoutes) return;
25695
25675
  useFlowSelectorStore.getState().setError(errorWarpRoutes.message);
25696
25676
  const { resetSelections, setRecipient, setOriginChain, setDestinationChain } = useBridgeStore.getState();
@@ -25699,7 +25679,7 @@ function useHyperlaneRoutes() {
25699
25679
  setOriginChain(null);
25700
25680
  setDestinationChain(null);
25701
25681
  }, [errorWarpRoutes]);
25702
- useEffect44(() => {
25682
+ useEffect43(() => {
25703
25683
  if (!!hyperRoute || !hyperlaneWarpRoutes.length) return;
25704
25684
  let targetHyperRouteToSelect = hyperlaneWarpRoutes.find((route) => route.routeId === hyperRoute);
25705
25685
  if (!targetHyperRouteToSelect) {
@@ -25738,13 +25718,13 @@ var init_useHyperlaneRoutes = __esm({
25738
25718
  });
25739
25719
 
25740
25720
  // src/internal/components/SendMenu/hyperbridge/hooks/useMenuTitle.ts
25741
- import { useEffect as useEffect45 } from "react";
25721
+ import { useEffect as useEffect44 } from "react";
25742
25722
  function useMenuTitle(warpRoutes) {
25743
25723
  const { t } = useT();
25744
25724
  const bridgeStep = useBridgeStore((st) => st.bridgeStep);
25745
25725
  const hyperRoute = useBridgeStore((st) => st.hyperRoute);
25746
25726
  const hyperRouteMeta = warpRoutes?.length ? warpRoutes.find((route) => route.routeId === hyperRoute) : null;
25747
- useEffect45(() => {
25727
+ useEffect44(() => {
25748
25728
  const updateMenuTitle = useFlowSelectorStore.getState().setMenuTitle;
25749
25729
  switch (true) {
25750
25730
  case bridgeStep === "sender-selector":
@@ -25938,7 +25918,7 @@ var init_ResolveChainIcon = __esm({
25938
25918
  // src/internal/components/SendMenu/hyperbridge/hooks/useBridgeBalance.ts
25939
25919
  import { CHAINS_BROWSERS_TRANSPORTS as CHAINS_BROWSERS_TRANSPORTS2 } from "@embarkai/core";
25940
25920
  import { useQuery as useQuery25, useQueryClient as useQueryClient26 } from "@tanstack/react-query";
25941
- import { useCallback as useCallback29, useEffect as useEffect46 } from "react";
25921
+ import { useCallback as useCallback29, useEffect as useEffect45 } from "react";
25942
25922
  import { createPublicClient as createPublicClient2, erc20Abi as erc20Abi3, formatUnits as formatUnits9, http as http3 } from "viem";
25943
25923
  import { useSwitchChain as useSwitchChain3 } from "wagmi";
25944
25924
  function useBridgeBalance(isLoadingWarpRoutes, hyperlaneWarpRoutes) {
@@ -26044,7 +26024,7 @@ function useBridgeBalance(isLoadingWarpRoutes, hyperlaneWarpRoutes) {
26044
26024
  },
26045
26025
  [refreshBalances, qc]
26046
26026
  );
26047
- useEffect46(() => {
26027
+ useEffect45(() => {
26048
26028
  if (!!isLoadingWarpRoutes || !bridgeSender || !originChain) return;
26049
26029
  switch (bridgeSender) {
26050
26030
  case "embarkai-wallet":
@@ -27007,7 +26987,7 @@ var init_steps = __esm({
27007
26987
  });
27008
26988
 
27009
26989
  // src/internal/components/SendMenu/hyperbridge/HyperlaneBridge.tsx
27010
- import { useEffect as useEffect47 } from "react";
26990
+ import { useEffect as useEffect46 } from "react";
27011
26991
  import { jsx as jsx117, jsxs as jsxs106 } from "react/jsx-runtime";
27012
26992
  function HyperlaneBridge() {
27013
26993
  const bridgeStep = useBridgeStore((st) => st.bridgeStep);
@@ -27015,7 +26995,7 @@ function HyperlaneBridge() {
27015
26995
  const { hyperlaneWarpRoutes, isLoadingWarpRoutes } = useHyperlaneRoutes();
27016
26996
  const { directWalletProfiles } = useAvailableSenders();
27017
26997
  useMenuTitle(hyperlaneWarpRoutes);
27018
- useEffect47(() => {
26998
+ useEffect46(() => {
27019
26999
  return () => {
27020
27000
  useBridgeStore.getState().resetSelections();
27021
27001
  };
@@ -27170,7 +27150,7 @@ var init_useErc3643Compliance = __esm({
27170
27150
 
27171
27151
  // src/hooks/useNicknameResolve.ts
27172
27152
  import { useQuery as useQuery26 } from "@tanstack/react-query";
27173
- import { useEffect as useEffect48, useMemo as useMemo18, useState as useState29 } from "react";
27153
+ import { useEffect as useEffect47, useMemo as useMemo18, useState as useState29 } from "react";
27174
27154
  function looksLikeNickname(input) {
27175
27155
  if (!input) return false;
27176
27156
  if (input.startsWith("0x")) return false;
@@ -27184,7 +27164,7 @@ function useNicknameResolve(input, options) {
27184
27164
  const [isDebouncing, setIsDebouncing] = useState29(false);
27185
27165
  const normalized = normalizeNickname(input);
27186
27166
  const isNicknameInput = looksLikeNickname(input) && normalized.length >= 3;
27187
- useEffect48(() => {
27167
+ useEffect47(() => {
27188
27168
  if (!isNicknameInput || !enabled) {
27189
27169
  setDebouncedInput("");
27190
27170
  setIsDebouncing(false);
@@ -27652,7 +27632,7 @@ var init_AssetList = __esm({
27652
27632
 
27653
27633
  // src/internal/components/SendMenu/send/components/NicknameData.tsx
27654
27634
  import { AtSign, CheckCircle2 as CheckCircle25, ShieldAlert, ShieldCheck as ShieldCheck2 } from "lucide-react";
27655
- import { useEffect as useEffect49 } from "react";
27635
+ import { useEffect as useEffect48 } from "react";
27656
27636
  import { jsx as jsx122, jsxs as jsxs110 } from "react/jsx-runtime";
27657
27637
  function NicknameData(props) {
27658
27638
  const { resolvedNicknameData, isNicknameInput } = props;
@@ -27665,7 +27645,7 @@ function NicknameData(props) {
27665
27645
  isWalletNotSetup,
27666
27646
  isFrozen
27667
27647
  } = resolvedNicknameData;
27668
- useEffect49(() => {
27648
+ useEffect48(() => {
27669
27649
  if (isResolving) return;
27670
27650
  let errMessage = null;
27671
27651
  switch (true) {
@@ -28234,7 +28214,7 @@ var init_sendSteps = __esm({
28234
28214
 
28235
28215
  // src/internal/components/SendMenu/send/SendMenu.tsx
28236
28216
  import { CheckCircle2 as CheckCircle27, Loader as Loader28 } from "lucide-react";
28237
- import { useEffect as useEffect50, useMemo as useMemo19 } from "react";
28217
+ import { useEffect as useEffect49, useMemo as useMemo19 } from "react";
28238
28218
  import { parseUnits as parseUnits2 } from "viem";
28239
28219
  import { Fragment as Fragment44, jsx as jsx125, jsxs as jsxs113 } from "react/jsx-runtime";
28240
28220
  function SendMenu() {
@@ -28255,16 +28235,16 @@ function SendMenu() {
28255
28235
  userOpHash,
28256
28236
  reset
28257
28237
  } = useSendTransaction();
28258
- useEffect50(() => {
28238
+ useEffect49(() => {
28259
28239
  useFlowSelectorStore.getState().setIsUiLocked(isAssetsLoading || isTransactionPending);
28260
28240
  }, [isAssetsLoading, isTransactionPending]);
28261
- useEffect50(() => {
28241
+ useEffect49(() => {
28262
28242
  useFlowSelectorStore.getState().setError(sendTransactionError || null);
28263
28243
  }, [sendTransactionError]);
28264
28244
  const { txStep, recipient, amount, selectedAsset, setSelectedAsset } = useSendStore();
28265
28245
  const isNft = isNftAsset3(selectedAsset);
28266
28246
  const isSecurity = isSecurityToken2(selectedAsset);
28267
- useEffect50(() => {
28247
+ useEffect49(() => {
28268
28248
  const shouldDefaultAsset = assets.length > 0 && !selectedAsset;
28269
28249
  if (!shouldDefaultAsset) return;
28270
28250
  const chainNativeCurrency = useSession.getState().chainConfig?.nativeCurrency;
@@ -28274,7 +28254,7 @@ function SendMenu() {
28274
28254
  if (isBalance(erc20)) return setSelectedAsset(erc20);
28275
28255
  setSelectedAsset(assets[0]);
28276
28256
  }, [assets, selectedAsset]);
28277
- useEffect50(
28257
+ useEffect49(
28278
28258
  () => () => {
28279
28259
  useSendStore.getState().reset();
28280
28260
  reset();
@@ -28299,7 +28279,7 @@ function SendMenu() {
28299
28279
  enabled: isSecurity && !!effectiveAddress && !!complianceAmount,
28300
28280
  chainId: activeChainId
28301
28281
  });
28302
- useEffect50(() => {
28282
+ useEffect49(() => {
28303
28283
  const updateMenuTitle = useFlowSelectorStore.getState().setMenuTitle;
28304
28284
  switch (true) {
28305
28285
  case txStep === "select-asset":
@@ -28398,10 +28378,10 @@ var init_send = __esm({
28398
28378
 
28399
28379
  // src/internal/components/SendMenu/useSendMenuParams.ts
28400
28380
  import { keys as keys5 } from "lodash-es";
28401
- import { useEffect as useEffect51 } from "react";
28381
+ import { useEffect as useEffect50 } from "react";
28402
28382
  function useSendMenuParams() {
28403
28383
  const { config } = useProviderConfig();
28404
- useEffect51(() => {
28384
+ useEffect50(() => {
28405
28385
  const { pageParams, setPageParams } = useLayoutDataStore.getState();
28406
28386
  if (!pageParams || !keys5(pageParams).length) return;
28407
28387
  const { sendFlow, send, bridge } = pageParams || {};
@@ -28466,7 +28446,7 @@ var init_useSendMenuParams = __esm({
28466
28446
 
28467
28447
  // src/internal/components/SendMenu/SendFlowSelector.tsx
28468
28448
  import { ArrowLeft as ArrowLeft21, ArrowRightIcon as ArrowRightIcon2, ArrowRightLeftIcon as ArrowRightLeftIcon3 } from "lucide-react";
28469
- import { useEffect as useEffect52, useMemo as useMemo20 } from "react";
28449
+ import { useEffect as useEffect51, useMemo as useMemo20 } from "react";
28470
28450
  import { jsx as jsx126, jsxs as jsxs114 } from "react/jsx-runtime";
28471
28451
  function SelectorFlowButtons() {
28472
28452
  const { t } = useT();
@@ -28527,13 +28507,13 @@ function SendFlowSelector() {
28527
28507
  const sendStep = useSendStore((st) => st.txStep);
28528
28508
  const bridgeStep = useBridgeStore((st) => st.bridgeStep);
28529
28509
  useOnboardingTourAvailable(sendStep === "input" && bridgeStep === "select");
28530
- useEffect52(
28510
+ useEffect51(
28531
28511
  () => () => {
28532
28512
  useFlowSelectorStore.getState().setError(null);
28533
28513
  },
28534
28514
  []
28535
28515
  );
28536
- useEffect52(() => {
28516
+ useEffect51(() => {
28537
28517
  if (!!config?.current?.features?.showAssetBridge) return;
28538
28518
  if (selectorFlow === "bridge") useFlowSelectorStore.getState().setFlow("send");
28539
28519
  }, [selectorFlow]);
@@ -29878,7 +29858,7 @@ var init_PageMap = __esm({
29878
29858
  });
29879
29859
 
29880
29860
  // src/internal/hooks/usePageMapper.tsx
29881
- import { useCallback as useCallback32, useEffect as useEffect53 } from "react";
29861
+ import { useCallback as useCallback32, useEffect as useEffect52 } from "react";
29882
29862
  import { jsx as jsx130 } from "react/jsx-runtime";
29883
29863
  function usePageMapper() {
29884
29864
  const page = useLayoutDataStore((st) => st.page);
@@ -29901,7 +29881,7 @@ function usePageMapper() {
29901
29881
  // isDialogAnimating: true
29902
29882
  });
29903
29883
  }, []);
29904
- useEffect53(() => {
29884
+ useEffect52(() => {
29905
29885
  if (page === null) return closeDialog();
29906
29886
  const pageItem = PAGE_MAP[page];
29907
29887
  if (!pageItem) {
@@ -29924,20 +29904,20 @@ var init_usePageMapper = __esm({
29924
29904
  });
29925
29905
 
29926
29906
  // src/internal/hooks/useSettingsNotifications.ts
29927
- import { useEffect as useEffect54 } from "react";
29907
+ import { useEffect as useEffect53 } from "react";
29928
29908
  function useSettingsNotifications() {
29929
29909
  const setSettingsNotifications = useLayoutDataStore((st) => st.setSettingsNotifications);
29930
29910
  const providers = jwtTokenManager2.getProviders();
29931
29911
  const hasEmail = providers.includes("email");
29932
29912
  const { data: userProfile = null } = useUserProfile();
29933
- useEffect54(() => {
29913
+ useEffect53(() => {
29934
29914
  const isKYCVerified = userProfile?.kycDetails?.kycStatus === "verified";
29935
29915
  setSettingsNotifications({
29936
29916
  ...COMPLETE_KYC_PROGRESS,
29937
29917
  status: isKYCVerified ? "resolved" : "active"
29938
29918
  });
29939
29919
  }, [userProfile, setSettingsNotifications]);
29940
- useEffect54(() => {
29920
+ useEffect53(() => {
29941
29921
  setSettingsNotifications({
29942
29922
  ...EMAIL_NOT_CONNECTED_NOTIFICATION,
29943
29923
  status: hasEmail ? "resolved" : "active"
@@ -29969,7 +29949,7 @@ var init_package = __esm({
29969
29949
  "package.json"() {
29970
29950
  package_default = {
29971
29951
  name: "@embarkai/ui-kit",
29972
- version: "0.4.110",
29952
+ version: "0.4.111",
29973
29953
  description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
29974
29954
  type: "module",
29975
29955
  main: "./dist/index.cjs",
@@ -30472,23 +30452,21 @@ var init_dialog = __esm({
30472
30452
  init_button();
30473
30453
  Dialog = DialogPrimitive.Root;
30474
30454
  DialogPortal = DialogPrimitive.Portal;
30475
- DialogOverlay = forwardRef6(
30476
- ({ className, closing, ...props }, ref) => /* @__PURE__ */ jsx133(
30477
- DialogPrimitive.Overlay,
30478
- {
30479
- ref,
30480
- style: { backdropFilter: "blur(var(--ui-kit-backdrop-blur))" },
30481
- className: cn2(
30482
- "w-[100dvw] h-[100dvh]",
30483
- "fixed inset-0 z-[9998] bg-[var(--ui-kit-overlay)]",
30484
- closing ? "animate-dialog-out" : "animate-dialog-in",
30485
- className
30486
- ),
30487
- ...props
30488
- }
30489
- )
30490
- );
30491
- DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
30455
+ DialogOverlay = forwardRef6(({ className, closing, ...props }, ref) => /* @__PURE__ */ jsx133(
30456
+ "div",
30457
+ {
30458
+ ref,
30459
+ style: { backdropFilter: "blur(var(--ui-kit-backdrop-blur))" },
30460
+ className: cn2(
30461
+ "w-[100dvw] h-[100dvh]",
30462
+ "fixed inset-0 z-[9998] bg-[var(--ui-kit-overlay)]",
30463
+ closing ? "animate-dialog-out" : "animate-dialog-in",
30464
+ className
30465
+ ),
30466
+ ...props
30467
+ }
30468
+ ));
30469
+ DialogOverlay.displayName = "DialogOverlay";
30492
30470
  CONTENT_BG_SETUP = {
30493
30471
  backgroundColor: "var(--ui-kit-bg)",
30494
30472
  border: "1px solid var(--ui-kit-bd)",
@@ -30630,7 +30608,7 @@ var init_visually_hidden = __esm({
30630
30608
 
30631
30609
  // src/internal/components/Dialog/Dialog.tsx
30632
30610
  import { AnimatePresence, motion } from "motion/react";
30633
- import { useEffect as useEffect55 } from "react";
30611
+ import { useEffect as useEffect54 } from "react";
30634
30612
  import { jsx as jsx135, jsxs as jsxs121 } from "react/jsx-runtime";
30635
30613
  function Dialog2() {
30636
30614
  const config = useProviderConfig().config;
@@ -30640,19 +30618,19 @@ function Dialog2() {
30640
30618
  const { colorMode, maxScrollHeight, isDialogOpen, dialogContent, isDialogForced } = useLayoutStore();
30641
30619
  const page = useLayoutDataStore((st) => st.page);
30642
30620
  const transitionPageHeight = useLayoutDataStore((st) => st.transitionPageHeight);
30643
- useEffect55(() => useLayoutStore.setState({ isSettings: !!session }), [session]);
30621
+ useEffect54(() => useLayoutStore.setState({ isSettings: !!session }), [session]);
30644
30622
  usePageMapper();
30645
30623
  useAutoConnect();
30646
30624
  useBackupStatusChanges();
30647
30625
  useDetectMaxScrollHeight();
30648
30626
  useSettingsNotifications();
30649
30627
  useListenIframeAuthEvents();
30650
- useAllowExternalModalsScroll(isDialogOpen);
30651
30628
  const isHeaderHidden = !session || page === "keysare-backup" /* KEYSARE_BACKUP */ && !hasServerVault;
30652
30629
  return /* @__PURE__ */ jsx135(
30653
30630
  Dialog,
30654
30631
  {
30655
30632
  open: isDialogOpen,
30633
+ modal: false,
30656
30634
  onOpenChange: (open) => {
30657
30635
  if (isDialogForced) return;
30658
30636
  if (!open) {
@@ -30706,7 +30684,6 @@ var init_Dialog = __esm({
30706
30684
  init_ProviderContext();
30707
30685
  init_SessionContext();
30708
30686
  init_constants();
30709
- init_useAllowExternalModalsScroll();
30710
30687
  init_useAutoConnect();
30711
30688
  init_useBackupStatusChanges();
30712
30689
  init_useDetectMaxScrollHeight();
@@ -30731,19 +30708,19 @@ var init_Dialog2 = __esm({
30731
30708
  });
30732
30709
 
30733
30710
  // src/internal/components/DirectWalletHandler.tsx
30734
- import { useEffect as useEffect56 } from "react";
30711
+ import { useEffect as useEffect55 } from "react";
30735
30712
  import { useConnection } from "wagmi";
30736
30713
  function DirectWalletHandler() {
30737
30714
  const walletMode = useProviderConfig().config.current?.wallet?.mode || "both";
30738
30715
  const externalAddress = useExternalWalletStore((st) => st.externalAddress);
30739
30716
  const isExternalConnected = useExternalWalletStore((st) => st.isExternalConnected);
30740
30717
  const { address, isConnected, chain, connector } = useConnection();
30741
- useEffect56(() => {
30718
+ useEffect55(() => {
30742
30719
  const { setConfigMode, setActiveMode } = useExternalWalletStore.getState();
30743
30720
  setConfigMode(walletMode);
30744
30721
  if (walletMode !== "both") setActiveMode(walletMode);
30745
30722
  }, [walletMode]);
30746
- useEffect56(() => {
30723
+ useEffect55(() => {
30747
30724
  if ((!!externalAddress || isExternalConnected) && !isConnected) {
30748
30725
  useExternalWalletStore.getState().clearExternalWallet();
30749
30726
  return;
@@ -33327,7 +33304,7 @@ import {
33327
33304
  createContext,
33328
33305
  useCallback as useCallback35,
33329
33306
  useContext,
33330
- useEffect as useEffect57,
33307
+ useEffect as useEffect56,
33331
33308
  useMemo as useMemo21,
33332
33309
  useRef as useRef22
33333
33310
  } from "react";
@@ -33351,7 +33328,7 @@ function clearLegacyWagmiStorage() {
33351
33328
  function Provider(props) {
33352
33329
  const { children, projectId, initialConfig = {}, callbacks } = props;
33353
33330
  const callbacksRef = useRef22(callbacks);
33354
- useEffect57(() => notifyNoProjetctId(projectId), [projectId]);
33331
+ useEffect56(() => notifyNoProjetctId(projectId), [projectId]);
33355
33332
  const config = useRef22(merge3({}, DEFAULT_PROVIDER_CONFIG, { projectId }, initialConfig));
33356
33333
  const wagmiConfig3 = useRef22(getWagmiConfig(config.current?.wallet?.walletConnectId || null));
33357
33334
  const updateConfig = useCallback35((updates) => {
@@ -33393,7 +33370,7 @@ function Provider(props) {
33393
33370
  const next = updates ? { ...prev, ...updates } : void 0;
33394
33371
  callbacksRef.current = next;
33395
33372
  }, []);
33396
- useEffect57(() => {
33373
+ useEffect56(() => {
33397
33374
  if (typeof window === "undefined" || !projectId) return;
33398
33375
  const mergedConfig = merge3(DEFAULT_PROVIDER_CONFIG, initialConfig);
33399
33376
  updateConfig(mergedConfig);
@@ -33413,7 +33390,7 @@ function Provider(props) {
33413
33390
  useSession.getState().setActiveChainId(mergedConfig.network.chainId);
33414
33391
  }
33415
33392
  }, [projectId, initialConfig]);
33416
- useEffect57(() => {
33393
+ useEffect56(() => {
33417
33394
  if (typeof window === "undefined" || !projectId) return;
33418
33395
  try {
33419
33396
  initSdkErrorTracking();
@@ -33493,7 +33470,7 @@ init_useUserProfile();
33493
33470
  init_pro_mode();
33494
33471
  init_utils();
33495
33472
  import { Cloud as Cloud4, Laptop as Laptop2, Loader as Loader32, Shield as Shield2 } from "lucide-react";
33496
- import { useEffect as useEffect58, useMemo as useMemo22 } from "react";
33473
+ import { useEffect as useEffect57, useMemo as useMemo22 } from "react";
33497
33474
  import { Fragment as Fragment48, jsx as jsx138, jsxs as jsxs123 } from "react/jsx-runtime";
33498
33475
  function getFormattedStatus(label, status, showStatus) {
33499
33476
  const isStatus = showStatus && status && status !== "idle" && status !== "ready";
@@ -33513,7 +33490,7 @@ function ConnectWalletButton(props) {
33513
33490
  const colorMode = useLayoutStore((st) => st.colorMode);
33514
33491
  const { session, address, hasServerVault, isLoading, isIframeReady, status, setUsePaymaster } = useSession();
33515
33492
  const connectButtonLabel = getFormattedStatus(label || "Connect", status, isIframeReady);
33516
- useEffect58(() => setUsePaymaster(usePaymaster), [setUsePaymaster, usePaymaster]);
33493
+ useEffect57(() => setUsePaymaster(usePaymaster), [setUsePaymaster, usePaymaster]);
33517
33494
  const { data: profile, isLoading: isProfileLoading } = useUserProfile();
33518
33495
  const displayName = profile?.nicknameDisplay || profile?.displayName || jwtTokenManager2.getDisplayName();
33519
33496
  const indicators = useMemo22(() => {
@@ -34159,13 +34136,13 @@ var Hash = ({
34159
34136
 
34160
34137
  // src/internal/components/TransactionsMenu/TransactionsList.tsx
34161
34138
  init_base3();
34162
- import { useEffect as useEffect60, useState as useState37 } from "react";
34139
+ import { useEffect as useEffect59, useState as useState37 } from "react";
34163
34140
  import { jsx as jsx144, jsxs as jsxs127 } from "react/jsx-runtime";
34164
34141
  var TransactionsList = ({ address, itemsCount = 10 }) => {
34165
34142
  const [transactions, setTransactions] = useState37([]);
34166
34143
  const [loading, setLoading] = useState37(true);
34167
34144
  const [error, setError] = useState37(null);
34168
- useEffect60(() => {
34145
+ useEffect59(() => {
34169
34146
  const fetchTransactions2 = async () => {
34170
34147
  try {
34171
34148
  setLoading(true);