@agg-build/ui 1.3.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/{chunk-ONVP7YWS.mjs → chunk-3OI2ZLLT.mjs} +94 -39
  2. package/dist/{chunk-UFC7L74C.mjs → chunk-C5M2OOM3.mjs} +1 -1
  3. package/dist/{chunk-QUZWA34R.mjs → chunk-DXF2LMNN.mjs} +512 -503
  4. package/dist/{chunk-5ALBEKAT.mjs → chunk-R6FBYAY5.mjs} +246 -194
  5. package/dist/{chunk-6PQ6O6M5.mjs → chunk-Y6PVXAUQ.mjs} +34 -90
  6. package/dist/{chunk-YWJIYEJV.mjs → chunk-YAEA6EDG.mjs} +31 -18
  7. package/dist/{chunk-55ODXLOS.mjs → chunk-YMVD6Q2A.mjs} +1 -1
  8. package/dist/events.js +894 -903
  9. package/dist/events.mjs +3 -3
  10. package/dist/index.js +2609 -2530
  11. package/dist/index.mjs +9 -7
  12. package/dist/modals.js +278 -171
  13. package/dist/modals.mjs +5 -3
  14. package/dist/pages.js +2014 -1991
  15. package/dist/pages.mjs +6 -6
  16. package/dist/primitives.js +526 -475
  17. package/dist/primitives.mjs +1 -1
  18. package/dist/styles.css +1 -1
  19. package/dist/tailwind.css +1 -1
  20. package/dist/trading.js +28 -15
  21. package/dist/trading.mjs +4 -4
  22. package/dist/types/events/list/category-sidebar.d.mts +33 -0
  23. package/dist/types/events/list/category-sidebar.d.ts +33 -0
  24. package/dist/types/events/list/event-list-tabs.d.mts +2 -0
  25. package/dist/types/events/list/event-list-tabs.d.ts +2 -0
  26. package/dist/types/events/list/event-list.utils.d.mts +0 -4
  27. package/dist/types/events/list/event-list.utils.d.ts +0 -4
  28. package/dist/types/events/list/index.d.mts +1 -0
  29. package/dist/types/events/list/index.d.ts +1 -0
  30. package/dist/types/pages/event-market/event-market.types.d.mts +1 -0
  31. package/dist/types/pages/event-market/event-market.types.d.ts +1 -0
  32. package/dist/types/pages/user-profile/index.d.mts +1 -1
  33. package/dist/types/pages/user-profile/index.d.ts +1 -1
  34. package/dist/types/pages/user-profile/user-profile.types.d.mts +1 -0
  35. package/dist/types/pages/user-profile/user-profile.types.d.ts +1 -0
  36. package/dist/types/shared/use-horizontal-scroll-state.d.mts +15 -0
  37. package/dist/types/shared/use-horizontal-scroll-state.d.ts +15 -0
  38. package/dist/types/withdraw/index.d.mts +9 -1
  39. package/dist/types/withdraw/index.d.ts +9 -1
  40. package/dist/types/withdraw/steps/withdraw-amount.d.mts +10 -1
  41. package/dist/types/withdraw/steps/withdraw-amount.d.ts +10 -1
  42. package/dist/types/withdraw/withdraw-modal.types.d.mts +8 -0
  43. package/dist/types/withdraw/withdraw-modal.types.d.ts +8 -0
  44. package/package.json +3 -3
@@ -10,13 +10,13 @@ import {
10
10
  isErrorWithStatus,
11
11
  useEventListTabs,
12
12
  useEventListTabsHeaderOverflow
13
- } from "./chunk-5ALBEKAT.mjs";
13
+ } from "./chunk-R6FBYAY5.mjs";
14
14
  import {
15
15
  DEPOSIT_MODAL_OPEN_EVENT,
16
16
  PlaceOrder,
17
17
  SettlementDetails,
18
18
  WITHDRAW_MODAL_OPEN_EVENT
19
- } from "./chunk-YWJIYEJV.mjs";
19
+ } from "./chunk-YAEA6EDG.mjs";
20
20
  import {
21
21
  AggErrorBoundary,
22
22
  Button,
@@ -46,9 +46,8 @@ import {
46
46
  resolveTabVenus,
47
47
  shortenAddress,
48
48
  sortCategoriesForNavigation,
49
- sortMarketsByVolumeDesc,
50
49
  useOptionalToast
51
- } from "./chunk-QUZWA34R.mjs";
50
+ } from "./chunk-DXF2LMNN.mjs";
52
51
 
53
52
  // src/pages/home/index.tsx
54
53
  import {
@@ -186,6 +185,7 @@ var resolveMobileTradePlaceOrderClassNames = (classNames) => {
186
185
  var EventMarketPageMobileTrade = ({
187
186
  classNames,
188
187
  eventTradingState,
188
+ executionMode,
189
189
  showPlaceOrder = true,
190
190
  isOpen,
191
191
  onOpenChange,
@@ -227,6 +227,7 @@ var EventMarketPageMobileTrade = ({
227
227
  PlaceOrder,
228
228
  {
229
229
  eventTradingState,
230
+ executionMode,
230
231
  midpointsResult,
231
232
  className: cn(
232
233
  "agg-mobile-trade-panel w-full overflow-hidden rounded-t-agg-2xl sm:rounded-agg-xl",
@@ -282,7 +283,7 @@ var EventMarketPageLoadingState = ({
282
283
  {
283
284
  className: cn(
284
285
  "agg-event-market-page",
285
- "w-full mx-auto max-w-[1360px] px-6 lg:px-10 pb-10",
286
+ "w-full mx-auto max-w-[1440px] px-6 lg:px-10 pb-10",
286
287
  classNames == null ? void 0 : classNames.root
287
288
  ),
288
289
  children: /* @__PURE__ */ jsxs(
@@ -354,22 +355,18 @@ var EventMarketPageContent = ({
354
355
  classNames,
355
356
  ariaLabel,
356
357
  showPlaceOrder,
358
+ executionMode,
357
359
  stickyOrderPanel,
358
360
  resolvedClaim
359
361
  }) => {
360
- const sortedEvent = useMemo(() => {
361
- return __spreadProps(__spreadValues({}, event), {
362
- venueMarkets: sortMarketsByVolumeDesc(event.venueMarkets)
363
- });
364
- }, [event]);
365
- const eventTradingState = useMemo(() => resolveEventTradingState(sortedEvent), [sortedEvent]);
362
+ const eventTradingState = useMemo(() => resolveEventTradingState(event), [event]);
366
363
  const stickyOrderPanelState = resolveEventMarketPageStickyState({
367
364
  stickyOrderPanel
368
365
  });
369
366
  const [isMobileTradeOpen, setIsMobileTradeOpen] = useState(false);
370
367
  const isMobileViewport = useIsMobileEventMarketViewport();
371
368
  const tradingContext = useEventTradingContext();
372
- const midpointsResult = useMidpoints(sortedEvent.venueMarkets);
369
+ const midpointsResult = useMidpoints(event.venueMarkets);
373
370
  const setTradeSideRef = useRef(tradingContext == null ? void 0 : tradingContext.setTradeSide);
374
371
  setTradeSideRef.current = tradingContext == null ? void 0 : tradingContext.setTradeSide;
375
372
  useEffect(() => {
@@ -378,7 +375,7 @@ var EventMarketPageContent = ({
378
375
  (_a = setTradeSideRef.current) == null ? void 0 : _a.call(setTradeSideRef, TradeSide.Buy);
379
376
  };
380
377
  }, []);
381
- if (!sortedEvent.venueMarkets.length) {
378
+ if (!event.venueMarkets.length) {
382
379
  return /* @__PURE__ */ jsx(EventMarketPageUnavailableState, { ariaLabel });
383
380
  }
384
381
  return /* @__PURE__ */ jsxs(
@@ -386,10 +383,10 @@ var EventMarketPageContent = ({
386
383
  {
387
384
  className: cn(
388
385
  "agg-event-market-page",
389
- "w-full mx-auto max-w-[1360px] px-6 lg:px-10 pb-10",
386
+ "w-full mx-auto max-w-[1440px] px-6 lg:px-10 pb-10",
390
387
  classNames == null ? void 0 : classNames.root
391
388
  ),
392
- "aria-label": ariaLabel != null ? ariaLabel : sortedEvent.title,
389
+ "aria-label": ariaLabel != null ? ariaLabel : event.title,
393
390
  children: [
394
391
  /* @__PURE__ */ jsxs(
395
392
  "div",
@@ -414,7 +411,7 @@ var EventMarketPageContent = ({
414
411
  /* @__PURE__ */ jsx(
415
412
  EventListItemDetails,
416
413
  {
417
- event: sortedEvent,
414
+ event,
418
415
  defaultMarketId,
419
416
  defaultOutcomeId,
420
417
  eventTradingState,
@@ -427,7 +424,7 @@ var EventMarketPageContent = ({
427
424
  /* @__PURE__ */ jsx(
428
425
  MarketDetailsList,
429
426
  {
430
- eventId: sortedEvent.id,
427
+ eventId: event.id,
431
428
  markets: eventTradingState.displayMarkets,
432
429
  eventTradingState,
433
430
  live: true,
@@ -446,6 +443,7 @@ var EventMarketPageContent = ({
446
443
  PlaceOrder,
447
444
  {
448
445
  eventTradingState,
446
+ executionMode,
449
447
  resolvedClaim,
450
448
  midpointsResult,
451
449
  className: cn(
@@ -455,7 +453,7 @@ var EventMarketPageContent = ({
455
453
  classNames: resolveMobileTradePlaceOrderClassNames(classNames)
456
454
  }
457
455
  ) }) : null,
458
- /* @__PURE__ */ jsx(SettlementDetails, { eventId: sortedEvent.id, className: classNames == null ? void 0 : classNames.settlement })
456
+ /* @__PURE__ */ jsx(SettlementDetails, { eventId: event.id, className: classNames == null ? void 0 : classNames.settlement })
459
457
  ]
460
458
  }
461
459
  ),
@@ -471,6 +469,7 @@ var EventMarketPageContent = ({
471
469
  PlaceOrder,
472
470
  {
473
471
  eventTradingState,
472
+ executionMode,
474
473
  resolvedClaim,
475
474
  midpointsResult,
476
475
  className: cn(stickyOrderPanelState == null ? void 0 : stickyOrderPanelState.placeOrder, classNames == null ? void 0 : classNames.trade),
@@ -487,6 +486,7 @@ var EventMarketPageContent = ({
487
486
  {
488
487
  classNames,
489
488
  eventTradingState,
489
+ executionMode,
490
490
  showPlaceOrder,
491
491
  isOpen: isMobileTradeOpen,
492
492
  onOpenChange: setIsMobileTradeOpen,
@@ -1049,7 +1049,7 @@ var HomePage = ({
1049
1049
  "w-full bg-agg-secondary border-b border-agg-separator h-14! md:h-15!",
1050
1050
  classNames == null ? void 0 : classNames.header
1051
1051
  ),
1052
- children: /* @__PURE__ */ jsx2("div", { className: "mx-auto h-full w-full max-w-[1360px] px-6 lg:px-10", children: /* @__PURE__ */ jsx2(
1052
+ children: /* @__PURE__ */ jsx2("div", { className: "mx-auto h-full w-full max-w-[1440px] px-6 lg:px-10", children: /* @__PURE__ */ jsx2(
1053
1053
  Tabs,
1054
1054
  {
1055
1055
  ariaLabel: labels.home.categoryTabsAria,
@@ -1067,7 +1067,7 @@ var HomePage = ({
1067
1067
  "div",
1068
1068
  {
1069
1069
  className: cn(
1070
- "w-full mx-auto px-6 lg:px-10 max-w-[1360px]",
1070
+ "w-full mx-auto px-6 lg:px-10 max-w-[1440px]",
1071
1071
  "pt-4 sm:pt-6 md:pt-8 pb-10"
1072
1072
  ),
1073
1073
  children: [
@@ -1149,7 +1149,6 @@ import {
1149
1149
  useAggAuthState,
1150
1150
  useAggBalance,
1151
1151
  useAggClient,
1152
- useDepositAddresses,
1153
1152
  useExecutionOrders,
1154
1153
  useExecutionPositions,
1155
1154
  useGeoBlock,
@@ -3360,7 +3359,6 @@ var toSignedAmountLabel = (sign, executionPrice, filledAmountRaw) => {
3360
3359
  const amountLabel = toAmountLabel(executionPrice, filledAmountRaw);
3361
3360
  return amountLabel === "-" ? amountLabel : `${sign}${amountLabel}`;
3362
3361
  };
3363
- var SVM_CHAIN_IDS = /* @__PURE__ */ new Set(["792703809"]);
3364
3362
  var OPEN_ORDER_STATUSES = /* @__PURE__ */ new Set([
3365
3363
  "pending",
3366
3364
  "signing",
@@ -3471,44 +3469,6 @@ var shouldFetchFullUserProfile = (userProfile) => {
3471
3469
  if (!userProfile) return true;
3472
3470
  return !userProfile.username && !userProfile.avatarUrl && ((_b = (_a = userProfile.accounts) == null ? void 0 : _a.length) != null ? _b : 0) === 0 && ((_d = (_c = userProfile.wallets) == null ? void 0 : _c.length) != null ? _d : 0) === 0;
3473
3471
  };
3474
- var normalizeAddress = (address) => {
3475
- const trimmed = address == null ? void 0 : address.trim();
3476
- return trimmed ? trimmed.toLowerCase() : void 0;
3477
- };
3478
- var toNumericChainId = (chainId) => {
3479
- const parsed = Number(chainId);
3480
- return Number.isFinite(parsed) ? parsed : void 0;
3481
- };
3482
- var getConnectedWalletAccountAddresses = (userProfile) => {
3483
- var _a;
3484
- const accounts = (_a = userProfile == null ? void 0 : userProfile.accounts) != null ? _a : [];
3485
- const walletAccounts = accounts.filter((account) => {
3486
- var _a2;
3487
- const provider = (_a2 = account.provider) == null ? void 0 : _a2.toLowerCase();
3488
- return provider === "wallet" || provider === "solana_wallet";
3489
- });
3490
- return new Set(
3491
- walletAccounts.map((account) => normalizeAddress(account.providerAccountId)).filter((address) => !!address)
3492
- );
3493
- };
3494
- var resolveDepositActivitySource = ({
3495
- fromAddress,
3496
- chainId,
3497
- connectedWalletAddresses,
3498
- depositAddress
3499
- }) => {
3500
- const normalizedFromAddress = normalizeAddress(fromAddress);
3501
- if (normalizedFromAddress && connectedWalletAddresses.has(normalizedFromAddress)) {
3502
- return "wallet";
3503
- }
3504
- if (normalizedFromAddress && normalizedFromAddress === normalizeAddress(depositAddress)) {
3505
- return "crypto";
3506
- }
3507
- if (SVM_CHAIN_IDS.has(chainId.trim())) {
3508
- return "wallet";
3509
- }
3510
- return "crypto";
3511
- };
3512
3472
  var toTradeThumbnailSrc = (item, orders) => {
3513
3473
  var _a, _b, _c;
3514
3474
  if ((_a = item.venueMarket) == null ? void 0 : _a.image) return item.venueMarket.image;
@@ -3577,6 +3537,7 @@ var UserProfilePage = ({
3577
3537
  activePositions,
3578
3538
  closedPositions,
3579
3539
  activities,
3540
+ executionMode = "live",
3580
3541
  onEditProfile,
3581
3542
  onDeposit,
3582
3543
  onWithdraw,
@@ -3658,15 +3619,18 @@ var UserProfilePage = ({
3658
3619
  return [...new Set(fromBalance)].sort((a, b) => a.localeCompare(b));
3659
3620
  }, [balanceState, shouldUseHookData]);
3660
3621
  const [positionFilter, setPositionFilter] = useState6(initialPositionFilter);
3622
+ const queryExecutionMode = executionMode === "paper" ? "paper" : void 0;
3661
3623
  const activePositionsQuery = useExecutionPositions({
3662
3624
  enabled: shouldUseHookData && isAuthenticated,
3663
3625
  status: "active",
3664
- limit: 25
3626
+ limit: 25,
3627
+ mode: queryExecutionMode
3665
3628
  });
3666
3629
  const closedPositionsQuery = useExecutionPositions({
3667
3630
  enabled: shouldUseHookData && isAuthenticated,
3668
3631
  status: "closed",
3669
- limit: 25
3632
+ limit: 25,
3633
+ mode: queryExecutionMode
3670
3634
  });
3671
3635
  const handlePositionFilterChange = useCallback3(
3672
3636
  (filter) => {
@@ -3680,16 +3644,13 @@ var UserProfilePage = ({
3680
3644
  }, [initialPositionFilter]);
3681
3645
  const ordersQuery = useExecutionOrders({
3682
3646
  enabled: shouldUseHookData && isAuthenticated,
3683
- limit: 25
3647
+ limit: 25,
3648
+ mode: queryExecutionMode
3684
3649
  });
3685
3650
  const activityQuery = useUserActivity({
3686
3651
  enabled: shouldUseHookData && isAuthenticated,
3687
3652
  limit: 25
3688
3653
  });
3689
- const depositAddressesQuery = useDepositAddresses({
3690
- enabled: shouldUseHookData && isAuthenticated,
3691
- poll: false
3692
- });
3693
3654
  const handleCancelOrder = useCallback3(
3694
3655
  (order) => __async(null, null, function* () {
3695
3656
  if (onCancelOrder) {
@@ -3989,8 +3950,6 @@ var UserProfilePage = ({
3989
3950
  const resolvedActivities = useMemo4(() => {
3990
3951
  if (activities) return activities.filter(isVisibleUserProfileActivity);
3991
3952
  const formatTime = isHydrated ? toRelativeTimeLabel : toAbsoluteTimeLabel;
3992
- const fullUser = profileUser != null ? profileUser : currentUser;
3993
- const connectedWalletAddresses = getConnectedWalletAccountAddresses(fullUser);
3994
3953
  return activityQuery.activities.filter(isVisibleActivityItem).map((item, index) => {
3995
3954
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C;
3996
3955
  const timeLabel = formatTime(getRuntimeActivityCreatedAt(item));
@@ -4066,16 +4025,10 @@ var UserProfilePage = ({
4066
4025
  const errorMessage = timedOut ? PENDING_TRANSFER_TIMEOUT_ERROR_MESSAGE : (_q = getActivityErrorMessage(depositItem)) != null ? _q : void 0;
4067
4026
  const isFailed = status === "failed";
4068
4027
  const hasError = timedOut || hasActivityError(depositItem);
4069
- const depositSource = resolveDepositActivitySource({
4070
- fromAddress: depositItem.fromAddress,
4071
- chainId: depositItem.chainId,
4072
- connectedWalletAddresses,
4073
- depositAddress: depositAddressesQuery.getAddress(toNumericChainId(depositItem.chainId))
4074
- });
4028
+ const depositSource = depositItem.source;
4075
4029
  const depositTitlesBySource = {
4076
- wallet: labels.userProfile.activity.depositStatusTitles.connectedWallet,
4077
- crypto: labels.userProfile.activity.depositStatusTitles.externalWallet,
4078
- card: labels.userProfile.activity.depositStatusTitles.card
4030
+ connected_wallet: labels.userProfile.activity.depositStatusTitles.connectedWallet,
4031
+ external_wallet: labels.userProfile.activity.depositStatusTitles.externalWallet
4079
4032
  };
4080
4033
  const amountLabel = status === "failed" || status === "canceled" ? ZERO_AMOUNT_LABEL : toTokenAmountLabel({
4081
4034
  amountRaw: depositItem.amountRaw,
@@ -4095,7 +4048,7 @@ var UserProfilePage = ({
4095
4048
  subtitleLabel: `from ${(_r = shortenAddress(depositItem.fromAddress)) != null ? _r : depositItem.fromAddress} \xB7 ${formatChainIdLabel(depositItem.chainId)}`,
4096
4049
  amountLabel,
4097
4050
  timeLabel,
4098
- depositSource,
4051
+ depositSource: depositSource === "connected_wallet" ? "wallet" : "crypto",
4099
4052
  chainId: depositItem.chainId
4100
4053
  };
4101
4054
  }
@@ -4137,16 +4090,7 @@ var UserProfilePage = ({
4137
4090
  timeLabel
4138
4091
  };
4139
4092
  });
4140
- }, [
4141
- activities,
4142
- activityQuery.activities,
4143
- currentUser,
4144
- depositAddressesQuery,
4145
- isHydrated,
4146
- labels,
4147
- ordersQuery.orders,
4148
- profileUser
4149
- ]);
4093
+ }, [activities, activityQuery.activities, isHydrated, labels, ordersQuery.orders]);
4150
4094
  const resolvedOpenOrders = useMemo4(() => {
4151
4095
  if (openOrders) return openOrders;
4152
4096
  return ordersQuery.orders.filter((order) => isOpenOrderStatus(order.status)).map((order) => {
@@ -4247,7 +4191,7 @@ var UserProfilePage = ({
4247
4191
  {
4248
4192
  className: cn(
4249
4193
  "agg-user-profile-page",
4250
- "w-full mx-auto px-6 lg:px-10 pb-10 max-w-[1360px]",
4194
+ "w-full mx-auto px-6 lg:px-10 pb-10 max-w-[1440px]",
4251
4195
  classNames == null ? void 0 : classNames.root
4252
4196
  ),
4253
4197
  children: /* @__PURE__ */ jsxs11(
@@ -8,10 +8,10 @@ import {
8
8
  getTradingValueLabel,
9
9
  getTradingVenueLabel,
10
10
  resolveOrderEligibilityMessage
11
- } from "./chunk-UFC7L74C.mjs";
11
+ } from "./chunk-C5M2OOM3.mjs";
12
12
  import {
13
13
  GeoBlockBanner
14
- } from "./chunk-55ODXLOS.mjs";
14
+ } from "./chunk-YMVD6Q2A.mjs";
15
15
  import {
16
16
  AGG_TERMS_OF_SERVICE_URL,
17
17
  Button,
@@ -38,7 +38,7 @@ import {
38
38
  formatUsd,
39
39
  getMotionClassName,
40
40
  skeletonViews
41
- } from "./chunk-QUZWA34R.mjs";
41
+ } from "./chunk-DXF2LMNN.mjs";
42
42
 
43
43
  // src/trading/types.ts
44
44
  import { Venue, enumGuard, isFiniteNonNeg, safeParse } from "@agg-build/sdk";
@@ -3396,6 +3396,7 @@ var PlaceOrder = ({
3396
3396
  const visibleRouteCards = orderedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT && !isRoutesExpanded ? orderedRouteCards.slice(0, PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT) : orderedRouteCards;
3397
3397
  const hasEnteredAmount = internalAmount > 0;
3398
3398
  const isQuoteLoading = hasEnteredAmount && (smartRoute.isFetching || smartRoute.isLoading);
3399
+ const routeLoadingMessage = isQuoteLoading ? smartRoute.loadingReason === "updating-route" ? tradingLabels.updatingRoute : smartRoute.loadingReason === "refreshing-quotes" ? tradingLabels.refreshingQuotes : tradingLabels.findingBestOdds : null;
3399
3400
  const isInsufficientBalance = !isSell && isAuthenticated && hasEnteredAmount && !isBalanceLoading && internalAmount > totalBalance;
3400
3401
  const isQuoteInsufficientBalance = (activeQuoteData == null ? void 0 : activeQuoteData.status) === "insufficient_balance";
3401
3402
  const shouldShowInsufficientBalanceAlert = isInsufficientBalance || isQuoteInsufficientBalance;
@@ -3545,7 +3546,7 @@ var PlaceOrder = ({
3545
3546
  const shouldShowGeoBlockBanner = isTradingBlocked || selectedRouteGeoBlocked || isPrimaryVenueGeoBlocked;
3546
3547
  const actionLabel = `${internalTab === "buy" ? tradingLabels.buy : tradingLabels.sell} ${selectedOutcomeLabel}`.trim();
3547
3548
  const isActionDisabled = isPrimaryActionDisabled || !orderEligibility.canPlaceOrder || isActionLoading || !hasEnteredAmount || !scopedSelectedMarket || isInsufficientBalance || isQuoteInsufficientBalance || isBelowMinimum || isQuoteLoading || !selectedRouteCard || !selectedRouteCard.quoteData.quoteId || selectedRouteGeoBlocked || !isAuthenticated || quoteStatus !== void 0;
3548
- const shouldShowSmartRouting = orderEligibility.canPlaceOrder && hasEnteredAmount && !isBelowMinimum && (orderedRouteCards.length > 0 || smartRoute.isFetching);
3549
+ const shouldShowSmartRouting = orderEligibility.canPlaceOrder && hasEnteredAmount && !isBelowMinimum && (orderedRouteCards.length > 0 || smartRoute.isFetching || smartRoute.isLoading);
3549
3550
  const shouldShowRouteToggle = !isQuoteLoading && orderedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT;
3550
3551
  const handleReturnToOrderForm = useCallback2(() => {
3551
3552
  const submittedSelection = submittedSelectionRef.current;
@@ -4176,19 +4177,10 @@ var PlaceOrder = ({
4176
4177
  }
4177
4178
  ) : null
4178
4179
  ] }),
4179
- /* @__PURE__ */ jsx4("div", { className: "agg-route-list flex flex-col gap-2", children: isQuoteLoading ? /* @__PURE__ */ jsxs3(
4180
- "div",
4181
- {
4182
- className: "agg-route-loading flex flex-col gap-2",
4183
- role: "status",
4184
- "aria-label": labels.common.loading,
4185
- "aria-live": "polite",
4186
- children: [
4187
- /* @__PURE__ */ jsx4(PlaceOrderRouteCardSkeleton, {}),
4188
- /* @__PURE__ */ jsx4(PlaceOrderRouteCardSkeleton, {})
4189
- ]
4190
- }
4191
- ) : visibleRouteCards.length > 0 ? visibleRouteCards.map((card) => {
4180
+ /* @__PURE__ */ jsx4("div", { className: "agg-route-list flex flex-col gap-2", children: isQuoteLoading ? /* @__PURE__ */ jsxs3("div", { className: "agg-route-loading flex flex-col gap-2", "aria-hidden": "true", children: [
4181
+ /* @__PURE__ */ jsx4(PlaceOrderRouteCardSkeleton, {}),
4182
+ /* @__PURE__ */ jsx4(PlaceOrderRouteCardSkeleton, {})
4183
+ ] }) : visibleRouteCards.length > 0 ? visibleRouteCards.map((card) => {
4192
4184
  return /* @__PURE__ */ jsx4(Fragment, { children: renderRouteCard({
4193
4185
  card,
4194
4186
  enableAnimations,
@@ -4279,7 +4271,28 @@ var PlaceOrder = ({
4279
4271
  onClick: handleDepositRequiredClick,
4280
4272
  children: tradingLabels.deposit
4281
4273
  }
4282
- ) : needsKycVerification && !submissionFeedback && !shouldShowGeoBlockBanner ? /* @__PURE__ */ jsx4(InitiateKycButton, { label: tradingLabels.kycRequired, onOpen: openVerifyModal }) : !isAuthenticated ? /* @__PURE__ */ jsx4(
4274
+ ) : needsKycVerification && !submissionFeedback && !shouldShowGeoBlockBanner ? /* @__PURE__ */ jsx4(InitiateKycButton, { label: tradingLabels.kycRequired, onOpen: openVerifyModal }) : isQuoteLoading && !isActionLoading ? /* @__PURE__ */ jsx4(
4275
+ Button,
4276
+ {
4277
+ size: "large",
4278
+ variant: "secondary",
4279
+ className: "agg-order-submit-loading h-12 w-full px-8 text-agg-base leading-agg-6 shadow-none",
4280
+ disabled: true,
4281
+ "aria-live": "polite",
4282
+ "aria-label": routeLoadingMessage != null ? routeLoadingMessage : labels.common.loading,
4283
+ prefix: /* @__PURE__ */ jsx4(
4284
+ "span",
4285
+ {
4286
+ className: cn(
4287
+ "inline-block h-4 w-4 shrink-0 rounded-agg-full border-2 border-current border-r-transparent",
4288
+ getMotionClassName(enableAnimations, "animate-spin")
4289
+ ),
4290
+ "aria-hidden": "true"
4291
+ }
4292
+ ),
4293
+ children: routeLoadingMessage
4294
+ }
4295
+ ) : !isAuthenticated ? /* @__PURE__ */ jsx4(
4283
4296
  Button,
4284
4297
  {
4285
4298
  size: "large",
@@ -3,7 +3,7 @@ import {
3
3
  AGG_TERMS_OF_SERVICE_URL,
4
4
  Icon,
5
5
  cn
6
- } from "./chunk-QUZWA34R.mjs";
6
+ } from "./chunk-DXF2LMNN.mjs";
7
7
 
8
8
  // src/geo-block-banner/index.tsx
9
9
  import { useLabels } from "@agg-build/hooks";