@agg-build/ui 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/{chunk-TERG43WW.mjs → chunk-5RBHMMY3.mjs} +1 -1
  2. package/dist/{chunk-RPXRTXCY.mjs → chunk-75AMJAWR.mjs} +1 -1
  3. package/dist/{chunk-IQT4I5B4.mjs → chunk-7ZR5JYB3.mjs} +39 -241
  4. package/dist/{chunk-NK57KMYN.mjs → chunk-JJDYOBVG.mjs} +117 -48
  5. package/dist/{chunk-WU2C3C6K.mjs → chunk-NRNBJPYK.mjs} +1 -1
  6. package/dist/{chunk-YJO6LMRT.mjs → chunk-TBD3N4T4.mjs} +69 -7
  7. package/dist/{chunk-XHDGSRG7.mjs → chunk-ZOECARZW.mjs} +359 -14
  8. package/dist/events.js +175 -59
  9. package/dist/events.mjs +3 -3
  10. package/dist/index.js +1080 -820
  11. package/dist/index.mjs +12 -8
  12. package/dist/modals.js +1 -1
  13. package/dist/modals.mjs +3 -3
  14. package/dist/pages.js +845 -589
  15. package/dist/pages.mjs +6 -6
  16. package/dist/primitives.js +68 -7
  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 +679 -339
  21. package/dist/trading.mjs +10 -6
  22. package/dist/types/events/shared/format-event-title.d.mts +25 -0
  23. package/dist/types/events/shared/format-event-title.d.ts +25 -0
  24. package/dist/types/events/shared/select-best-outcome.d.mts +88 -0
  25. package/dist/types/events/shared/select-best-outcome.d.ts +88 -0
  26. package/dist/types/pages/event-market/event-market.types.d.mts +7 -0
  27. package/dist/types/pages/event-market/event-market.types.d.ts +7 -0
  28. package/dist/types/primitives/search/search.utils.d.mts +3 -1
  29. package/dist/types/primitives/search/search.utils.d.ts +3 -1
  30. package/dist/types/trading/index.d.mts +2 -0
  31. package/dist/types/trading/index.d.ts +2 -0
  32. package/dist/types/trading/place-order/index.d.mts +1 -1
  33. package/dist/types/trading/place-order/index.d.ts +1 -1
  34. package/dist/types/trading/place-order/index.place-order.types.d.mts +23 -1
  35. package/dist/types/trading/place-order/index.place-order.types.d.ts +23 -1
  36. package/dist/types/trading/use-claim-winnings.d.mts +84 -0
  37. package/dist/types/trading/use-claim-winnings.d.ts +84 -0
  38. package/dist/types/trading/use-resolved-market-claim.d.mts +26 -0
  39. package/dist/types/trading/use-resolved-market-claim.d.ts +26 -0
  40. package/package.json +3 -3
@@ -22,7 +22,7 @@ import {
22
22
  resolveUnifiedOrderBookEntries,
23
23
  sortOutcomeSelectorOutcomes,
24
24
  useEventTradingContext
25
- } from "./chunk-TERG43WW.mjs";
25
+ } from "./chunk-5RBHMMY3.mjs";
26
26
  import {
27
27
  AutocompleteSelect,
28
28
  Badge,
@@ -52,6 +52,7 @@ import {
52
52
  dedupeVenueMarketsById,
53
53
  detailsBaseCardClassName,
54
54
  filterEventsByTabValue,
55
+ formatEventTitleWithDateSuffix,
55
56
  formatMarketProbabilityPercent,
56
57
  formatPriceGapPercent,
57
58
  getMarketDetailsTabs,
@@ -72,7 +73,7 @@ import {
72
73
  sortCategoriesForNavigation,
73
74
  sortOutcomes,
74
75
  splitEventsByLifecycle
75
- } from "./chunk-YJO6LMRT.mjs";
76
+ } from "./chunk-TBD3N4T4.mjs";
76
77
 
77
78
  // src/events/item/index.tsx
78
79
  import {
@@ -353,7 +354,14 @@ var EventListItemContent = ({
353
354
  const config = useSdkUiConfig();
354
355
  const labels = useLabels();
355
356
  const allVenueMarkets = useMemo(() => event.venueMarkets, [event.venueMarkets]);
356
- const resolvedTitle = event.title;
357
+ const resolvedTitle = formatEventTitleWithDateSuffix({
358
+ title: event.title,
359
+ categories: event.categories,
360
+ structureType: event.structureType,
361
+ gameStartTime: event.gameStartTime,
362
+ endDate: event.endDate,
363
+ locale: config.general.locale
364
+ });
357
365
  const resolvedImage = event.image;
358
366
  const visibleVenueLogos = useMemo(() => {
359
367
  var _a2;
@@ -2495,11 +2503,28 @@ var EventListItemDetailsContent = ({
2495
2503
  if (typeof resolvedVolume !== "number") return "";
2496
2504
  return `${config.formatting.formatCompactCurrency(resolvedVolume)} ${labels.eventItemDetails.volumeSuffix}`;
2497
2505
  }, [config, event.volume, labels.eventItemDetails.volumeSuffix, venueMarkets]);
2506
+ const resolvedTitle = useMemo5(() => {
2507
+ return formatEventTitleWithDateSuffix({
2508
+ title: event.title,
2509
+ categories: event.categories,
2510
+ structureType: event.structureType,
2511
+ gameStartTime: event.gameStartTime,
2512
+ endDate: event.endDate,
2513
+ locale: config.general.locale
2514
+ });
2515
+ }, [
2516
+ config.general.locale,
2517
+ event.categories,
2518
+ event.gameStartTime,
2519
+ event.endDate,
2520
+ event.structureType,
2521
+ event.title
2522
+ ]);
2498
2523
  return /* @__PURE__ */ jsxs4(
2499
2524
  Card,
2500
2525
  {
2501
2526
  className: cn("group/agg-event-details", detailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
2502
- "aria-label": ariaLabel != null ? ariaLabel : event.title,
2527
+ "aria-label": ariaLabel != null ? ariaLabel : resolvedTitle,
2503
2528
  onClick: () => {
2504
2529
  onClick == null ? void 0 : onClick(event);
2505
2530
  },
@@ -2534,7 +2559,7 @@ var EventListItemDetailsContent = ({
2534
2559
  "truncate text-wrap wrap-break-word line-clamp-2",
2535
2560
  classNames == null ? void 0 : classNames.title
2536
2561
  ),
2537
- children: event.title
2562
+ children: resolvedTitle
2538
2563
  }
2539
2564
  ),
2540
2565
  venueMarkets.length > 1 ? /* @__PURE__ */ jsx5(
@@ -3235,8 +3260,10 @@ import {
3235
3260
  optimizedImageUrl as optimizedImageUrl3,
3236
3261
  resolveMarketTradingState,
3237
3262
  useEventTradingContext as useEventTradingContext2,
3263
+ useEventOrderbookData as useEventOrderbookData2,
3238
3264
  useLabels as useLabels6,
3239
3265
  useLiveBestPrices as useLiveBestPrices2,
3266
+ useLiveBestPriceCandidates,
3240
3267
  useLiveOutcomePrices as useLiveOutcomePrices2,
3241
3268
  useMarketChart as useMarketChart2,
3242
3269
  useMarketOrderbook,
@@ -3247,30 +3274,64 @@ import {
3247
3274
  } from "@agg-build/hooks";
3248
3275
  import { useEffect as useEffect4, useId, useMemo as useMemo6, useRef as useRef5, useState as useState4 } from "react";
3249
3276
 
3250
- // src/events/shared/display-outcome-venue.ts
3277
+ // src/events/shared/select-best-outcome.ts
3251
3278
  var normalizeOutcomeLabel2 = (label) => {
3252
3279
  return typeof label === "string" ? label.trim().toLowerCase() : "";
3253
3280
  };
3254
- var getDisplayOutcomeVenue = ({
3255
- outcomeId,
3256
- outcomeLabel,
3257
- selection,
3258
- bestMidpointVenue,
3259
- bestVenueByOutcomeId,
3260
- bestPriceVenuesByOutcomeId,
3261
- fallbackVenue
3262
- }) => {
3263
- var _a;
3264
- if (selection && outcomeId) {
3265
- const sideVenues = bestPriceVenuesByOutcomeId == null ? void 0 : bestPriceVenuesByOutcomeId.get(outcomeId);
3266
- if (selection === "buy" && (sideVenues == null ? void 0 : sideVenues.bestAskVenue)) return sideVenues.bestAskVenue;
3267
- if (selection === "sell" && (sideVenues == null ? void 0 : sideVenues.bestBidVenue)) return sideVenues.bestBidVenue;
3281
+ var selectBestOutcomeCandidate = (args) => {
3282
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
3283
+ const { outcomeId, selection } = args;
3284
+ if (!outcomeId) return void 0;
3285
+ const resolveVenueMarketId = (venue) => {
3286
+ var _a2, _b2;
3287
+ return venue ? (_b2 = (_a2 = args.venueMarketIdByVenue) == null ? void 0 : _a2.get(venue)) != null ? _b2 : void 0 : void 0;
3288
+ };
3289
+ const make = (price, venue, source, updatedAt) => ({
3290
+ price,
3291
+ venue: venue != null ? venue : void 0,
3292
+ venueMarketId: resolveVenueMarketId(venue != null ? venue : void 0),
3293
+ outcomeId,
3294
+ source,
3295
+ updatedAt: updatedAt != null ? updatedAt : void 0
3296
+ });
3297
+ if (selection === "buy" || selection === "sell") {
3298
+ const wsSidePrice = selection === "buy" ? (_a = args.live) == null ? void 0 : _a.bestAsk : (_b = args.live) == null ? void 0 : _b.bestBid;
3299
+ const wsSideVenue = selection === "buy" ? (_c = args.live) == null ? void 0 : _c.bestAskVenue : (_d = args.live) == null ? void 0 : _d.bestBidVenue;
3300
+ if (wsSidePrice != null) {
3301
+ return make(wsSidePrice, wsSideVenue, "ws", (_e = args.live) == null ? void 0 : _e.updatedAt);
3302
+ }
3303
+ const restSidePrice = selection === "buy" ? (_f = args.restBest) == null ? void 0 : _f.bestAsk : (_g = args.restBest) == null ? void 0 : _g.bestBid;
3304
+ const restSideVenue = selection === "buy" ? (_h = args.restBestVenues) == null ? void 0 : _h.bestAskVenue : (_i = args.restBestVenues) == null ? void 0 : _i.bestBidVenue;
3305
+ if (restSidePrice != null) {
3306
+ return make(restSidePrice, restSideVenue, "rest-best", void 0);
3307
+ }
3308
+ }
3309
+ if (((_j = args.live) == null ? void 0 : _j.midpoint) != null) {
3310
+ return make(args.live.midpoint, args.live.midpointVenue, "ws", args.live.updatedAt);
3268
3311
  }
3269
- if (normalizeOutcomeLabel2(outcomeLabel) === "yes" && bestMidpointVenue) {
3270
- return bestMidpointVenue;
3312
+ if (normalizeOutcomeLabel2(args.outcomeLabel) === "yes" && args.bestMidpoint != null && args.bestMidpointVenue) {
3313
+ return make(args.bestMidpoint, args.bestMidpointVenue, "rest-midpoint", void 0);
3271
3314
  }
3272
- const bestVenue = outcomeId ? bestVenueByOutcomeId == null ? void 0 : bestVenueByOutcomeId.get(outcomeId) : void 0;
3273
- return (_a = bestVenue != null ? bestVenue : fallbackVenue) != null ? _a : void 0;
3315
+ if (args.restMidpoint != null) {
3316
+ return make(args.restMidpoint, args.restMidpointVenue, "rest-midpoint", void 0);
3317
+ }
3318
+ if (args.staticPrice != null) {
3319
+ return make(args.staticPrice, args.staticVenue, "static", void 0);
3320
+ }
3321
+ return void 0;
3322
+ };
3323
+ var buildVenueMarketIdByVenue = (venueMarkets) => {
3324
+ var _a;
3325
+ const map = /* @__PURE__ */ new Map();
3326
+ if (!(venueMarkets == null ? void 0 : venueMarkets.length)) return map;
3327
+ const visit = (vm) => {
3328
+ if (vm.venue && vm.id && !map.has(vm.venue)) map.set(vm.venue, vm.id);
3329
+ };
3330
+ for (const vm of venueMarkets) {
3331
+ visit(vm);
3332
+ for (const sibling of (_a = vm.matchedVenueMarkets) != null ? _a : []) visit(sibling);
3333
+ }
3334
+ return map;
3274
3335
  };
3275
3336
 
3276
3337
  // src/events/market-details/market-details-outcome-button.tsx
@@ -3427,7 +3488,7 @@ var MarketDetailsContent = ({
3427
3488
  suppressOutcomeFallbackSelection,
3428
3489
  midpointsResult
3429
3490
  }) => {
3430
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
3491
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
3431
3492
  const config = useSdkUiConfig3();
3432
3493
  const {
3433
3494
  features: { enableAnimations },
@@ -3441,6 +3502,7 @@ var MarketDetailsContent = ({
3441
3502
  const tradeSide = (_a = tradingContext == null ? void 0 : tradingContext.tradeSide) != null ? _a : "buy";
3442
3503
  const wsLivePrices = useLiveOutcomePrices2(venueMarkets);
3443
3504
  const wsBestPrices = useLiveBestPrices2(venueMarkets);
3505
+ const wsBestCandidates = useLiveBestPriceCandidates(venueMarkets);
3444
3506
  const resolvedMarket = useMemo6(() => {
3445
3507
  return resolveMarketFromVenueMarkets(venueMarkets, marketId);
3446
3508
  }, [venueMarkets, marketId]);
@@ -3450,6 +3512,10 @@ var MarketDetailsContent = ({
3450
3512
  return (_b2 = (_a2 = resolvedMarket.venueMarkets.find((venueMarket) => venueMarket.id === resolvedMarket.id)) != null ? _a2 : resolvedMarket.venueMarkets[0]) != null ? _b2 : null;
3451
3513
  }, [resolvedMarket]);
3452
3514
  const isResolvedMarket = resolveMarketTradingState(scopedResolvedMarket).kind === "resolved";
3515
+ useEventOrderbookData2(
3516
+ isResolvedMarket ? [] : resolvedMarket == null ? void 0 : resolvedMarket.venueMarkets,
3517
+ (_b = scopedResolvedMarket == null ? void 0 : scopedResolvedMarket.id) != null ? _b : null
3518
+ );
3453
3519
  const clusterMidpointResult = midpointsResult != null ? midpointsResult : {
3454
3520
  prices: /* @__PURE__ */ new Map(),
3455
3521
  bestMidpointsByOutcomeId: /* @__PURE__ */ new Map(),
@@ -3460,7 +3526,7 @@ var MarketDetailsContent = ({
3460
3526
  bestMidpoint: void 0,
3461
3527
  bestMidpointVenue: void 0
3462
3528
  };
3463
- const clusterMidpoints = (_b = clusterMidpointResult.bestMidpointsByOutcomeId) != null ? _b : clusterMidpointResult.prices;
3529
+ const clusterMidpoints = (_c = clusterMidpointResult.bestMidpointsByOutcomeId) != null ? _c : clusterMidpointResult.prices;
3464
3530
  const clusterBestMidpointsByOutcomeId = clusterMidpoints;
3465
3531
  const clusterVenueByOutcomeId = clusterMidpointResult.venueByOutcomeId;
3466
3532
  const clusterBestMidpoint = clusterMidpointResult.bestMidpoint;
@@ -3575,7 +3641,7 @@ var MarketDetailsContent = ({
3575
3641
  tradingContext == null ? void 0 : tradingContext.selectedOutcomeId
3576
3642
  ]);
3577
3643
  const selectedOutcomeId = scopedSelectedOutcomeState.outcomeId;
3578
- const selectedOutcomeLabel = (_c = scopedSelectedOutcomeState.outcomeLabel) != null ? _c : null;
3644
+ const selectedOutcomeLabel = (_d = scopedSelectedOutcomeState.outcomeLabel) != null ? _d : null;
3579
3645
  const selectOutcome = tradingContext == null ? void 0 : tradingContext.selectOutcome;
3580
3646
  const [selectedGraphVenue, setSelectedGraphVenue] = useState4(null);
3581
3647
  const [chartOutcomeLabel, setChartOutcomeLabel] = useState4(selectedOutcomeLabel);
@@ -3609,31 +3675,33 @@ var MarketDetailsContent = ({
3609
3675
  tradingContext == null ? void 0 : tradingContext.selectedMarketId,
3610
3676
  selectOutcome
3611
3677
  ]);
3678
+ const venueMarketIdByVenue = useMemo6(
3679
+ () => buildVenueMarketIdByVenue(model == null ? void 0 : model.market.venueMarkets),
3680
+ [model]
3681
+ );
3612
3682
  const headerOutcomeItems = useMemo6(() => {
3613
3683
  if (!model) return [];
3614
3684
  const items = resolveHeaderOutcomeItems(model.market.venueMarkets, scopedMarketForCard);
3615
3685
  return items.map((item) => {
3616
3686
  var _a2;
3617
3687
  const fallbackPrice = midpointsFallback == null ? void 0 : midpointsFallback.get(item.id);
3618
- const bestVenue = getDisplayOutcomeVenue({
3688
+ const candidate = selectBestOutcomeCandidate({
3619
3689
  outcomeId: item.id,
3620
3690
  outcomeLabel: item.label,
3621
3691
  selection: tradeSide,
3622
- bestMidpointVenue: clusterBestMidpointVenue,
3623
- bestVenueByOutcomeId: clusterVenueByOutcomeId,
3624
- bestPriceVenuesByOutcomeId: clusterBestPriceVenuesByOutcomeId,
3625
- fallbackVenue: midpointsFallbackVenues == null ? void 0 : midpointsFallbackVenues.get(item.id)
3626
- });
3627
- const outcomeBestPrice = getDisplayOutcomePrice({
3628
- outcomeId: item.id,
3629
- outcomeLabel: item.label,
3630
- selection: tradeSide,
3631
- bestPrices: clusterBestPrices,
3692
+ live: wsBestCandidates.get(item.id),
3693
+ restBest: clusterBestPricesRest.get(item.id),
3694
+ restBestVenues: clusterBestPriceVenuesByOutcomeId.get(item.id),
3695
+ restMidpoint: clusterBestMidpointsByOutcomeId.get(item.id),
3696
+ restMidpointVenue: clusterVenueByOutcomeId.get(item.id),
3632
3697
  bestMidpoint: clusterBestMidpoint,
3633
- bestMidpointsByOutcomeId: clusterBestMidpointsByOutcomeId,
3634
- livePrices: wsLivePrices,
3635
- fallbackPrice
3698
+ bestMidpointVenue: clusterBestMidpointVenue,
3699
+ staticPrice: fallbackPrice,
3700
+ staticVenue: midpointsFallbackVenues == null ? void 0 : midpointsFallbackVenues.get(item.id),
3701
+ venueMarketIdByVenue
3636
3702
  });
3703
+ const bestVenue = candidate == null ? void 0 : candidate.venue;
3704
+ const outcomeBestPrice = candidate == null ? void 0 : candidate.price;
3637
3705
  if (isResolvedMarket) {
3638
3706
  const isWinningOutcome = item.id === ((_a2 = marketTradingState.winningOutcome) == null ? void 0 : _a2.id);
3639
3707
  return __spreadValues(__spreadProps(__spreadValues({}, item), {
@@ -3651,17 +3719,18 @@ var MarketDetailsContent = ({
3651
3719
  clusterBestMidpoint,
3652
3720
  clusterBestMidpointVenue,
3653
3721
  clusterBestMidpointsByOutcomeId,
3654
- clusterBestPrices,
3722
+ clusterBestPricesRest,
3655
3723
  clusterBestPriceVenuesByOutcomeId,
3656
3724
  model,
3657
3725
  scopedMarketForCard,
3658
3726
  clusterVenueByOutcomeId,
3659
3727
  isResolvedMarket,
3660
- (_d = marketTradingState.winningOutcome) == null ? void 0 : _d.id,
3728
+ (_e = marketTradingState.winningOutcome) == null ? void 0 : _e.id,
3661
3729
  midpointsFallback,
3662
3730
  midpointsFallbackVenues,
3663
3731
  tradeSide,
3664
- wsLivePrices
3732
+ venueMarketIdByVenue,
3733
+ wsBestCandidates
3665
3734
  ]);
3666
3735
  const headlineProbability = useMemo6(() => {
3667
3736
  var _a2, _b2, _c2, _d2;
@@ -3727,9 +3796,9 @@ var MarketDetailsContent = ({
3727
3796
  const chartEnabled = isOpened && effectiveSelectedTab === "graph";
3728
3797
  const orderBookEnabled = isOpened && effectiveSelectedTab === "order-book" && !marketTradingState.isTradingDisabled;
3729
3798
  const rollingWindow = useRollingChartWindow2({ range: effectiveChartTimeRange });
3730
- const primaryVenueMarketId = (_f = (_e = selectedOutcomesByVenue[0]) == null ? void 0 : _e.market.id) != null ? _f : null;
3731
- const primaryOutcomeId = (_h = (_g = selectedOutcomesByVenue[0]) == null ? void 0 : _g.outcome.id) != null ? _h : null;
3732
- const chartPrimaryOutcomeId = (_j = (_i = chartOutcomesByVenue[0]) == null ? void 0 : _i.outcome.id) != null ? _j : null;
3799
+ const primaryVenueMarketId = (_g = (_f = selectedOutcomesByVenue[0]) == null ? void 0 : _f.market.id) != null ? _g : null;
3800
+ const primaryOutcomeId = (_i = (_h = selectedOutcomesByVenue[0]) == null ? void 0 : _h.outcome.id) != null ? _i : null;
3801
+ const chartPrimaryOutcomeId = (_k = (_j = chartOutcomesByVenue[0]) == null ? void 0 : _j.outcome.id) != null ? _k : null;
3733
3802
  const chartVenueOutcomeIds = useMemo6(() => {
3734
3803
  return chartOutcomesByVenue.map((item) => item.outcome.id);
3735
3804
  }, [chartOutcomesByVenue]);
@@ -4232,7 +4301,7 @@ var MarketDetailsContent = ({
4232
4301
  height: 260,
4233
4302
  isLoading: isMarketChartLoading,
4234
4303
  chartType: selectedChartType,
4235
- liveCandle: selectedChartType === "candlestick" ? (_k = graphLiveState.liveCandle) != null ? _k : void 0 : void 0,
4304
+ liveCandle: selectedChartType === "candlestick" ? (_l = graphLiveState.liveCandle) != null ? _l : void 0 : void 0,
4236
4305
  lineValue: graphLiveState.lineValue,
4237
4306
  classNames: { root: "agg-chart-region w-full" },
4238
4307
  showSeriesControls: chartAvailableOutcomesByVenue.length > 0 || headerOutcomeItems.length > 0,
@@ -38,7 +38,7 @@ import {
38
38
  shortenAddress,
39
39
  useOptionalToast,
40
40
  venueLogoLabels
41
- } from "./chunk-YJO6LMRT.mjs";
41
+ } from "./chunk-TBD3N4T4.mjs";
42
42
 
43
43
  // src/deposit/index.tsx
44
44
  import { useAggAuthState, useAggUiConfig, useDepositAddresses, useLabels as useLabels11 } from "@agg-build/hooks";
@@ -6596,7 +6596,57 @@ var SEARCH_DEBOUNCE_MS = 300;
6596
6596
 
6597
6597
  // src/primitives/search/search.utils.ts
6598
6598
  import { VENUES as VENUES2 } from "@agg-build/sdk";
6599
+ import dayjs3 from "dayjs";
6600
+
6601
+ // src/events/shared/format-event-title.ts
6599
6602
  import dayjs2 from "dayjs";
6603
+ var SPORT_CATEGORY_TOKENS = /* @__PURE__ */ new Set(["sport", "sports"]);
6604
+ var normalizeCategoryToken = (value) => {
6605
+ if (typeof value !== "string") return null;
6606
+ const normalizedValue = value.trim().toLowerCase();
6607
+ if (!normalizedValue) return null;
6608
+ return normalizedValue;
6609
+ };
6610
+ var isSportCategoryToken = (value) => {
6611
+ const normalizedValue = normalizeCategoryToken(value);
6612
+ if (!normalizedValue) return false;
6613
+ return SPORT_CATEGORY_TOKENS.has(normalizedValue);
6614
+ };
6615
+ var isSportEvent = (categories, structureType) => {
6616
+ var _a;
6617
+ if (isSportCategoryToken(structureType)) return true;
6618
+ return (_a = categories == null ? void 0 : categories.some((categoryEntry) => {
6619
+ var _a2, _b, _c, _d;
6620
+ return isSportCategoryToken(categoryEntry.id) || isSportCategoryToken((_a2 = categoryEntry.category) == null ? void 0 : _a2.id) || isSportCategoryToken((_b = categoryEntry.category) == null ? void 0 : _b.name) || isSportCategoryToken((_c = categoryEntry.category) == null ? void 0 : _c.displayName) || isSportCategoryToken((_d = categoryEntry.category) == null ? void 0 : _d.parentId);
6621
+ })) != null ? _a : false;
6622
+ };
6623
+ var formatEventDateSuffix = (value, locale) => {
6624
+ if (!dayjs2(value).isValid()) return null;
6625
+ return new Intl.DateTimeFormat(locale, {
6626
+ month: "long",
6627
+ day: "numeric",
6628
+ timeZone: "UTC"
6629
+ }).format(new Date(value));
6630
+ };
6631
+ var formatEventTitleWithDateSuffix = ({
6632
+ title: title2,
6633
+ categories,
6634
+ structureType,
6635
+ gameStartTime,
6636
+ endDate,
6637
+ locale = "en-US"
6638
+ }) => {
6639
+ const resolvedTitle = title2.trim();
6640
+ if (!resolvedTitle) return resolvedTitle;
6641
+ if (!isSportEvent(categories, structureType)) return resolvedTitle;
6642
+ const dateSource = gameStartTime != null ? gameStartTime : endDate;
6643
+ if (!dateSource) return resolvedTitle;
6644
+ const formattedDate = formatEventDateSuffix(dateSource, locale);
6645
+ if (!formattedDate) return resolvedTitle;
6646
+ const suffix = ` - ${formattedDate}`;
6647
+ if (resolvedTitle.endsWith(suffix)) return resolvedTitle;
6648
+ return `${resolvedTitle}${suffix}`;
6649
+ };
6600
6650
 
6601
6651
  // src/events/item/event-list-item.utils.ts
6602
6652
  import { MAX_PRICE_GAP_PCT, MIN_PRICE_GAP_PCT } from "@agg-build/hooks";
@@ -6909,8 +6959,8 @@ var resolveDisplayVolume = (eventVolume, venueMarkets) => {
6909
6959
 
6910
6960
  // src/primitives/search/search.utils.ts
6911
6961
  var formatSearchContextLabel = (value) => {
6912
- if (!dayjs2(value).isValid()) return value;
6913
- return dayjs2(value).format("MMMM D, YYYY");
6962
+ if (!dayjs3(value).isValid()) return value;
6963
+ return dayjs3(value).format("MMMM D, YYYY");
6914
6964
  };
6915
6965
  var venueLogoNameSet = new Set(VENUES2);
6916
6966
  var toVenueLogoName = (value) => {
@@ -6918,7 +6968,7 @@ var toVenueLogoName = (value) => {
6918
6968
  if (!venueLogoNameSet.has(value)) return null;
6919
6969
  return value;
6920
6970
  };
6921
- var mapVenueEventToSearchResult = (event, labels, formatPercent, formatCompactCurrency) => {
6971
+ var mapVenueEventToSearchResult = (event, labels, formatPercent, formatCompactCurrency, options) => {
6922
6972
  var _a, _b;
6923
6973
  const primaryVenueMarket = selectPrimaryVenueMarket(event.venueMarkets);
6924
6974
  if (!primaryVenueMarket) return null;
@@ -6928,7 +6978,14 @@ var mapVenueEventToSearchResult = (event, labels, formatPercent, formatCompactCu
6928
6978
  if (!visibleOutcome) return null;
6929
6979
  const probability = normalizeProbability(visibleOutcome.outcome.price);
6930
6980
  if (probability == null) return null;
6931
- const resolvedTitle = (_a = event == null ? void 0 : event.title) == null ? void 0 : _a.trim();
6981
+ const resolvedTitle = formatEventTitleWithDateSuffix({
6982
+ title: (_a = event == null ? void 0 : event.title) != null ? _a : "",
6983
+ categories: event.categories,
6984
+ structureType: event.structureType,
6985
+ gameStartTime: event.gameStartTime,
6986
+ endDate: event.endDate,
6987
+ locale: options == null ? void 0 : options.locale
6988
+ });
6932
6989
  if (!resolvedTitle) return null;
6933
6990
  const { marketCount, venueCount } = getVenueSummary(event.venueMarkets);
6934
6991
  const marketSummaryLabel = [
@@ -7141,6 +7198,7 @@ var Search = ({
7141
7198
  const {
7142
7199
  search: searchConfig,
7143
7200
  features: { enableAnimations },
7201
+ general: { locale },
7144
7202
  formatting: { formatCompactCurrency, formatPercent }
7145
7203
  } = useSdkUiConfig10();
7146
7204
  const resolvedValue = searchConfig.value;
@@ -7181,7 +7239,10 @@ var Search = ({
7181
7239
  event,
7182
7240
  labels,
7183
7241
  formatPercent,
7184
- formatCompactCurrency
7242
+ formatCompactCurrency,
7243
+ {
7244
+ locale
7245
+ }
7185
7246
  );
7186
7247
  if (!item) return null;
7187
7248
  nextEventsByResultId.set(item.id, event);
@@ -7191,7 +7252,7 @@ var Search = ({
7191
7252
  validatedResults: nextResults,
7192
7253
  eventsByResultId: nextEventsByResultId
7193
7254
  };
7194
- }, [openEvents, formatCompactCurrency, formatPercent, labels]);
7255
+ }, [formatCompactCurrency, formatPercent, labels, locale, openEvents]);
7195
7256
  const hasSearchValue = trimmedValue.length > 0;
7196
7257
  const shouldRenderDropdown = isFocused && shouldSearchValue && !searchConfig.result && !searchConfig.isShowingAllResults;
7197
7258
  const resolvedIsActive = isFocused;
@@ -8287,7 +8348,7 @@ var Select = ({
8287
8348
  disabled: item.disabled,
8288
8349
  className: cn(
8289
8350
  "agg-select-item",
8290
- "relative flex w-full items-center gap-3 rounded-[6px] px-5 py-3 text-left text-agg-sm leading-agg-5 outline-none",
8351
+ "relative flex w-full items-center gap-3 rounded-[6px] pl-3 pr-5 py-3 text-left text-agg-sm leading-agg-5 outline-none",
8291
8352
  "hover:bg-agg-secondary-hover focus-visible:bg-agg-secondary-hover",
8292
8353
  isSelected ? "bg-agg-primary/10 font-agg-normal text-agg-primary" : "font-agg-normal text-agg-foreground",
8293
8354
  item.disabled && "cursor-not-allowed opacity-60",
@@ -9628,6 +9689,7 @@ export {
9628
9689
  DEFAULT_VENUE_COLOR,
9629
9690
  fallbackLineColors,
9630
9691
  VenueLogo,
9692
+ formatEventTitleWithDateSuffix,
9631
9693
  normalizeVenueMarketCluster,
9632
9694
  resolveEventListItemEvent,
9633
9695
  normalizeProbability,