@agg-build/ui 2.2.3 → 2.3.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.
- package/dist/{chunk-QM3WWPCV.mjs → chunk-3R2CQTNM.mjs} +71 -37
- package/dist/{chunk-ZRYHWHTD.mjs → chunk-44GSDH2Y.mjs} +2 -2
- package/dist/{chunk-UTXQUOU3.mjs → chunk-6Z5GQ3KL.mjs} +60 -14
- package/dist/{chunk-4QGZ3FWI.mjs → chunk-7OVSGWI7.mjs} +1 -1
- package/dist/{chunk-TDLI6F55.mjs → chunk-ELLV56FR.mjs} +156 -19
- package/dist/{chunk-JOZPXDNZ.mjs → chunk-MXM5PM4A.mjs} +3 -3
- package/dist/{chunk-LPIAEKSZ.mjs → chunk-SG573ODC.mjs} +1 -1
- package/dist/events.js +125 -45
- package/dist/events.mjs +3 -3
- package/dist/index.js +279 -62
- package/dist/index.mjs +7 -7
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +279 -62
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +59 -13
- package/dist/primitives.mjs +1 -1
- package/dist/trading.mjs +4 -4
- package/dist/types/events/shared/format-event-title.d.mts +21 -6
- package/dist/types/events/shared/format-event-title.d.ts +21 -6
- package/dist/types/pages/event-market/sports-event-market.utils.d.mts +19 -1
- package/dist/types/pages/event-market/sports-event-market.utils.d.ts +19 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -6935,23 +6935,69 @@ var isSportEvent = (categories, structureType) => {
|
|
|
6935
6935
|
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);
|
|
6936
6936
|
})) != null ? _a : false;
|
|
6937
6937
|
};
|
|
6938
|
-
var
|
|
6939
|
-
|
|
6938
|
+
var hasFixtureMarketMetadata = (venueMarkets) => {
|
|
6939
|
+
var _a;
|
|
6940
|
+
return (_a = venueMarkets == null ? void 0 : venueMarkets.some((venueMarket) => {
|
|
6941
|
+
var _a2, _b, _c, _d;
|
|
6942
|
+
return Boolean(
|
|
6943
|
+
((_a2 = venueMarket.sportsMarketType) == null ? void 0 : _a2.trim()) || ((_b = venueMarket.marketCategory) == null ? void 0 : _b.trim()) || ((_c = venueMarket.marketSubtype) == null ? void 0 : _c.trim()) || ((_d = venueMarket.period) == null ? void 0 : _d.trim()) || venueMarket.lineValue != null
|
|
6944
|
+
);
|
|
6945
|
+
})) != null ? _a : false;
|
|
6946
|
+
};
|
|
6947
|
+
var shouldDisplaySportsEventTimestamp = ({
|
|
6940
6948
|
categories,
|
|
6941
6949
|
structureType,
|
|
6950
|
+
venueMarkets
|
|
6951
|
+
}) => {
|
|
6952
|
+
if (!isSportEvent(categories, structureType)) return false;
|
|
6953
|
+
if (structureType === "sport") {
|
|
6954
|
+
return true;
|
|
6955
|
+
}
|
|
6956
|
+
if (typeof structureType === "string" && structureType.trim()) {
|
|
6957
|
+
return false;
|
|
6958
|
+
}
|
|
6959
|
+
return hasFixtureMarketMetadata(venueMarkets);
|
|
6960
|
+
};
|
|
6961
|
+
var resolveSportsEventTimestamp = ({
|
|
6942
6962
|
gameStartTime,
|
|
6943
6963
|
endDate
|
|
6964
|
+
}) => {
|
|
6965
|
+
return (gameStartTime == null ? void 0 : gameStartTime.trim()) || (endDate == null ? void 0 : endDate.trim()) || null;
|
|
6966
|
+
};
|
|
6967
|
+
var resolveEventTimestampLabel = ({
|
|
6968
|
+
categories,
|
|
6969
|
+
structureType,
|
|
6970
|
+
gameStartTime,
|
|
6971
|
+
endDate,
|
|
6972
|
+
venueMarkets
|
|
6973
|
+
}) => {
|
|
6974
|
+
if (!shouldDisplaySportsEventTimestamp({ categories, structureType, venueMarkets })) {
|
|
6975
|
+
return null;
|
|
6976
|
+
}
|
|
6977
|
+
const timestamp = resolveSportsEventTimestamp({ gameStartTime, endDate });
|
|
6978
|
+
if (!timestamp) return null;
|
|
6979
|
+
return formatSportsEventTimeEt(timestamp);
|
|
6980
|
+
};
|
|
6981
|
+
var resolveEventHeading = ({
|
|
6982
|
+
title: title2,
|
|
6983
|
+
categories,
|
|
6984
|
+
structureType,
|
|
6985
|
+
gameStartTime,
|
|
6986
|
+
endDate,
|
|
6987
|
+
venueMarkets
|
|
6944
6988
|
}) => {
|
|
6945
6989
|
const resolvedTitle = title2.trim();
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
|
|
6990
|
+
return {
|
|
6991
|
+
title: resolvedTitle,
|
|
6992
|
+
timestampLabel: resolveEventTimestampLabel({
|
|
6993
|
+
title: resolvedTitle,
|
|
6994
|
+
categories,
|
|
6995
|
+
structureType,
|
|
6996
|
+
gameStartTime,
|
|
6997
|
+
endDate,
|
|
6998
|
+
venueMarkets
|
|
6999
|
+
})
|
|
7000
|
+
};
|
|
6955
7001
|
};
|
|
6956
7002
|
|
|
6957
7003
|
// src/events/item/event-list-item.utils.ts
|
|
@@ -7292,13 +7338,13 @@ var mapVenueEventToSearchResult = (event, labels, formatPercent, formatCompactCu
|
|
|
7292
7338
|
const probability = normalizeProbability(
|
|
7293
7339
|
(_a = options == null ? void 0 : options.priceByOutcomeId) == null ? void 0 : _a.get(visibleOutcome.outcome.id)
|
|
7294
7340
|
);
|
|
7295
|
-
const resolvedTitle =
|
|
7341
|
+
const resolvedTitle = resolveEventHeading({
|
|
7296
7342
|
title: (_b = event == null ? void 0 : event.title) != null ? _b : "",
|
|
7297
7343
|
categories: event.categories,
|
|
7298
7344
|
structureType: event.structureType,
|
|
7299
7345
|
gameStartTime: event.gameStartTime,
|
|
7300
7346
|
endDate: event.endDate
|
|
7301
|
-
});
|
|
7347
|
+
}).title;
|
|
7302
7348
|
if (!resolvedTitle) return null;
|
|
7303
7349
|
const { marketCount, venueCount } = getVenueSummary(event.venueMarkets);
|
|
7304
7350
|
const marketSummaryLabel = [
|
|
@@ -11348,13 +11394,16 @@ var EventListItemContent = ({
|
|
|
11348
11394
|
const config = (0, import_hooks39.useSdkUiConfig)();
|
|
11349
11395
|
const labels = (0, import_hooks39.useLabels)();
|
|
11350
11396
|
const allVenueMarkets = (0, import_react18.useMemo)(() => event.venueMarkets, [event.venueMarkets]);
|
|
11351
|
-
const
|
|
11397
|
+
const eventHeading = resolveEventHeading({
|
|
11352
11398
|
title: event.title,
|
|
11353
11399
|
categories: event.categories,
|
|
11354
11400
|
structureType: event.structureType,
|
|
11355
11401
|
gameStartTime: event.gameStartTime,
|
|
11356
|
-
endDate: event.endDate
|
|
11402
|
+
endDate: event.endDate,
|
|
11403
|
+
venueMarkets: event.venueMarkets
|
|
11357
11404
|
});
|
|
11405
|
+
const resolvedTitle = eventHeading.title;
|
|
11406
|
+
const resolvedTimestamp = eventHeading.timestampLabel;
|
|
11358
11407
|
const resolvedImage = event.image;
|
|
11359
11408
|
const visibleVenueLogos = (0, import_react18.useMemo)(() => {
|
|
11360
11409
|
var _a2;
|
|
@@ -11660,10 +11709,10 @@ var EventListItemContent = ({
|
|
|
11660
11709
|
href,
|
|
11661
11710
|
onClick: handleClick,
|
|
11662
11711
|
onKeyDown: handleKeyDown,
|
|
11663
|
-
"aria-label": ariaLabel != null ? ariaLabel : resolvedTitle,
|
|
11712
|
+
"aria-label": ariaLabel != null ? ariaLabel : [resolvedTitle, resolvedTimestamp].filter(Boolean).join(" "),
|
|
11664
11713
|
withGradient: true,
|
|
11665
11714
|
children: [
|
|
11666
|
-
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: cn("agg-event-card-header flex
|
|
11715
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: cn("agg-event-card-header flex items-center gap-4", classNames == null ? void 0 : classNames.header), children: [
|
|
11667
11716
|
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
11668
11717
|
RemoteImage,
|
|
11669
11718
|
{
|
|
@@ -11675,19 +11724,32 @@ var EventListItemContent = ({
|
|
|
11675
11724
|
}
|
|
11676
11725
|
}
|
|
11677
11726
|
),
|
|
11678
|
-
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
11679
|
-
|
|
11680
|
-
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
|
|
11689
|
-
|
|
11690
|
-
|
|
11727
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "min-w-0 flex-1 self-stretch", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: "flex h-12 min-w-0 flex-col justify-center", children: [
|
|
11728
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
11729
|
+
Typography,
|
|
11730
|
+
{
|
|
11731
|
+
variant: "body-strong",
|
|
11732
|
+
className: cn(
|
|
11733
|
+
"agg-event-title",
|
|
11734
|
+
"min-w-0 text-agg-base font-agg-bold leading-agg-6",
|
|
11735
|
+
resolvedTimestamp ? "truncate whitespace-nowrap" : "text-wrap wrap-break-word line-clamp-2",
|
|
11736
|
+
classNames == null ? void 0 : classNames.title
|
|
11737
|
+
),
|
|
11738
|
+
children: resolvedTitle
|
|
11739
|
+
}
|
|
11740
|
+
),
|
|
11741
|
+
resolvedTimestamp ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "agg-event-timestamp-row mt-0.5 h-5 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
11742
|
+
Typography,
|
|
11743
|
+
{
|
|
11744
|
+
variant: "body",
|
|
11745
|
+
className: cn(
|
|
11746
|
+
"agg-event-timestamp min-w-0 truncate",
|
|
11747
|
+
"text-agg-sm leading-agg-5 text-agg-muted-foreground"
|
|
11748
|
+
),
|
|
11749
|
+
children: resolvedTimestamp
|
|
11750
|
+
}
|
|
11751
|
+
) }) : null
|
|
11752
|
+
] }) })
|
|
11691
11753
|
] }),
|
|
11692
11754
|
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
11693
11755
|
"div",
|
|
@@ -14678,19 +14740,27 @@ var EventListItemDetailsContent = ({
|
|
|
14678
14740
|
return `${config.formatting.formatCompactCurrency(resolvedVolume)} ${labels.eventItemDetails.volumeSuffix}`;
|
|
14679
14741
|
}, [config, event.volume, labels.eventItemDetails.volumeSuffix, venueMarkets]);
|
|
14680
14742
|
const resolvedTitle = (0, import_react24.useMemo)(() => {
|
|
14681
|
-
return
|
|
14743
|
+
return resolveEventHeading({
|
|
14682
14744
|
title: event.title,
|
|
14683
14745
|
categories: event.categories,
|
|
14684
14746
|
structureType: event.structureType,
|
|
14685
14747
|
gameStartTime: event.gameStartTime,
|
|
14686
|
-
endDate: event.endDate
|
|
14748
|
+
endDate: event.endDate,
|
|
14749
|
+
venueMarkets: event.venueMarkets
|
|
14687
14750
|
});
|
|
14688
|
-
}, [
|
|
14751
|
+
}, [
|
|
14752
|
+
event.categories,
|
|
14753
|
+
event.endDate,
|
|
14754
|
+
event.gameStartTime,
|
|
14755
|
+
event.structureType,
|
|
14756
|
+
event.title,
|
|
14757
|
+
event.venueMarkets
|
|
14758
|
+
]);
|
|
14689
14759
|
return /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
|
|
14690
14760
|
Card,
|
|
14691
14761
|
{
|
|
14692
14762
|
className: cn("group/agg-event-details", detailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
|
|
14693
|
-
"aria-label": ariaLabel != null ? ariaLabel : resolvedTitle,
|
|
14763
|
+
"aria-label": ariaLabel != null ? ariaLabel : [resolvedTitle.title, resolvedTitle.timestampLabel].filter(Boolean).join(" "),
|
|
14694
14764
|
onClick: () => {
|
|
14695
14765
|
onClick == null ? void 0 : onClick(event);
|
|
14696
14766
|
},
|
|
@@ -14715,19 +14785,29 @@ var EventListItemDetailsContent = ({
|
|
|
14715
14785
|
}
|
|
14716
14786
|
),
|
|
14717
14787
|
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
14718
|
-
/* @__PURE__ */ (0, import_jsx_runtime142.
|
|
14719
|
-
|
|
14720
|
-
|
|
14721
|
-
|
|
14722
|
-
|
|
14723
|
-
|
|
14724
|
-
|
|
14725
|
-
|
|
14726
|
-
|
|
14727
|
-
|
|
14728
|
-
|
|
14729
|
-
|
|
14730
|
-
|
|
14788
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "min-w-0", children: [
|
|
14789
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
14790
|
+
Typography,
|
|
14791
|
+
{
|
|
14792
|
+
variant: "body-strong",
|
|
14793
|
+
className: cn(
|
|
14794
|
+
"agg-event-title",
|
|
14795
|
+
"min-w-0 text-agg-base font-agg-bold! leading-agg-6 md:text-agg-2xl md:leading-agg-8",
|
|
14796
|
+
resolvedTitle.timestampLabel ? "truncate whitespace-nowrap" : "truncate text-wrap wrap-break-word line-clamp-2",
|
|
14797
|
+
classNames == null ? void 0 : classNames.title
|
|
14798
|
+
),
|
|
14799
|
+
children: resolvedTitle.title
|
|
14800
|
+
}
|
|
14801
|
+
),
|
|
14802
|
+
resolvedTitle.timestampLabel ? /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
14803
|
+
Typography,
|
|
14804
|
+
{
|
|
14805
|
+
variant: "body",
|
|
14806
|
+
className: "agg-event-timestamp mt-0.5 min-w-0 truncate text-agg-sm leading-agg-5 text-agg-muted-foreground",
|
|
14807
|
+
children: resolvedTitle.timestampLabel
|
|
14808
|
+
}
|
|
14809
|
+
) : null
|
|
14810
|
+
] }),
|
|
14731
14811
|
venueMarkets.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
14732
14812
|
EventListItemDetailsMarketSelector,
|
|
14733
14813
|
{
|
|
@@ -23215,7 +23295,12 @@ var SPORTS_SECTION_TAB_DEFINITIONS = [
|
|
|
23215
23295
|
{ key: "shots", marketCategory: "shots" },
|
|
23216
23296
|
{
|
|
23217
23297
|
key: "other",
|
|
23218
|
-
|
|
23298
|
+
// `player_props` is deliberately NOT fetched here: goals/assists/shots/corners
|
|
23299
|
+
// props already have dedicated tabs (resolveMarketSectionTabKey routes them
|
|
23300
|
+
// there by category), so including the group would re-fetch hundreds of props
|
|
23301
|
+
// already shown elsewhere. The handful with no stat category (e.g. "saves")
|
|
23302
|
+
// are back-filled from the game-wide set in resolveSportsSectionMarkets.
|
|
23303
|
+
marketGroup: ["other", "team_props", "specials", "completion"]
|
|
23219
23304
|
}
|
|
23220
23305
|
];
|
|
23221
23306
|
var SPORTS_NON_STANDARD_VISIBLE_TAB_KEYS = ["game_lines", "other"];
|
|
@@ -23384,6 +23469,13 @@ var resolveSportsSectionMarkets = ({
|
|
|
23384
23469
|
const filteredSectionMarkets = effectiveSectionMarkets.filter(
|
|
23385
23470
|
(market) => resolveMarketSectionTabKey(market) === tabKey
|
|
23386
23471
|
);
|
|
23472
|
+
if (tabKey === "other") {
|
|
23473
|
+
const seenIds = new Set(filteredSectionMarkets.map((market) => market.id));
|
|
23474
|
+
const strayOtherMarkets = eventMarkets.filter(
|
|
23475
|
+
(market) => !seenIds.has(market.id) && resolveMarketSectionTabKey(market) === "other"
|
|
23476
|
+
);
|
|
23477
|
+
return [...filteredSectionMarkets, ...strayOtherMarkets];
|
|
23478
|
+
}
|
|
23387
23479
|
if (tabKey !== "game_lines") return filteredSectionMarkets;
|
|
23388
23480
|
const eventMoneylineMarkets = (() => {
|
|
23389
23481
|
const dedupedMarkets = [];
|
|
@@ -23439,6 +23531,48 @@ var resolveSportsLineFamilyKey = (market) => {
|
|
|
23439
23531
|
const aggKey = resolveSportsMarketAggKey(market);
|
|
23440
23532
|
return aggKey ? aggKey.replace(AGGKEY_LINE_TOKEN_PATTERN, "") : "";
|
|
23441
23533
|
};
|
|
23534
|
+
var resolveSpreadFamilyKey = (market) => {
|
|
23535
|
+
const aggKey = resolveSportsMarketAggKey(market);
|
|
23536
|
+
return aggKey ? aggKey.replace(/_sp_.+$/i, "_sp") : "";
|
|
23537
|
+
};
|
|
23538
|
+
var resolveSpreadFavoredToken = (market) => {
|
|
23539
|
+
var _a, _b, _c;
|
|
23540
|
+
const aggKey = resolveSportsMarketAggKey(market);
|
|
23541
|
+
return (_c = (_b = (_a = aggKey.match(/_sp_([a-z0-9]+?)_\d+p\d+/i)) == null ? void 0 : _a[1]) == null ? void 0 : _b.toLowerCase()) != null ? _c : null;
|
|
23542
|
+
};
|
|
23543
|
+
var resolveSpreadHomeToken = (markets) => {
|
|
23544
|
+
var _a;
|
|
23545
|
+
const tokens = /* @__PURE__ */ new Set();
|
|
23546
|
+
let prefix = "";
|
|
23547
|
+
for (const market of markets) {
|
|
23548
|
+
const token = resolveSpreadFavoredToken(market);
|
|
23549
|
+
if (token) tokens.add(token);
|
|
23550
|
+
if (!prefix) prefix = (_a = resolveSportsMarketAggKey(market).split("_sp_")[0]) != null ? _a : "";
|
|
23551
|
+
}
|
|
23552
|
+
if (tokens.size === 0 || !prefix) return null;
|
|
23553
|
+
return Array.from(tokens).sort((left, right) => prefix.indexOf(left) - prefix.indexOf(right))[0];
|
|
23554
|
+
};
|
|
23555
|
+
var SPREAD_NON_TEAM_TITLE_PATTERN = /\b(?:yes|no|over|under|wins?\s+by|reg\.?\s*time|goal\s*diff|more\s+than|less\s+than|halftime|1st\s+half|2nd\s+half|goals?)\b/i;
|
|
23556
|
+
var isSpreadTeamTitle = (title2) => {
|
|
23557
|
+
const trimmed = toTrimmedString(title2);
|
|
23558
|
+
if (!trimmed || trimmed.length > 24) return false;
|
|
23559
|
+
const normalized = trimmed.toLowerCase();
|
|
23560
|
+
if (normalized === "yes" || normalized === "no") return false;
|
|
23561
|
+
return !SPREAD_NON_TEAM_TITLE_PATTERN.test(trimmed);
|
|
23562
|
+
};
|
|
23563
|
+
var resolveSpreadOutcomeTeamNames = (activeMarket, groupMarkets) => {
|
|
23564
|
+
const aggKey = resolveSportsMarketAggKey(activeMarket);
|
|
23565
|
+
const twins = aggKey ? groupMarkets.filter((market) => resolveSportsMarketAggKey(market) === aggKey) : [activeMarket];
|
|
23566
|
+
const pickName = (index) => {
|
|
23567
|
+
const cleanTitles = twins.map((market) => {
|
|
23568
|
+
var _a, _b;
|
|
23569
|
+
return toTrimmedString((_b = (_a = market.venueMarketOutcomes) == null ? void 0 : _a[index]) == null ? void 0 : _b.title);
|
|
23570
|
+
}).filter((title2) => isSpreadTeamTitle(title2));
|
|
23571
|
+
if (cleanTitles.length === 0) return null;
|
|
23572
|
+
return cleanTitles.reduce((longest, title2) => title2.length > longest.length ? title2 : longest);
|
|
23573
|
+
};
|
|
23574
|
+
return { favored: pickName(0), dog: pickName(1) };
|
|
23575
|
+
};
|
|
23442
23576
|
var resolveDisplayGroupFamilyKey = (market) => {
|
|
23443
23577
|
var _a, _b, _c;
|
|
23444
23578
|
const normalizedQuestion = sanitizeFamilyValue(toTrimmedString(market.question));
|
|
@@ -23453,14 +23587,36 @@ var resolveDisplayGroupFamilyKey = (market) => {
|
|
|
23453
23587
|
}
|
|
23454
23588
|
const lineFamily = resolveSportsLineFamilyKey(market);
|
|
23455
23589
|
if (sportsMarketType === "spread") {
|
|
23456
|
-
|
|
23590
|
+
const spreadFamily = resolveSpreadFamilyKey(market);
|
|
23591
|
+
return spreadFamily ? `${period}|spread|${spreadFamily}` : `${period}|spread|${marketCategory}`;
|
|
23457
23592
|
}
|
|
23458
23593
|
if (market.lineValue != null || LINE_MARKET_TYPES.has(sportsMarketType)) {
|
|
23459
23594
|
return lineFamily ? `${period}|${sportsMarketType}|${lineFamily}` : `${period}|${sportsMarketType}|${marketCategory}|${normalizedQuestion}|${outcomeKey}`;
|
|
23460
23595
|
}
|
|
23461
23596
|
return `${period}|${sportsMarketType}|${marketCategory}|${toTrimmedString(market.question)}|${outcomeKey}|${market.id}`;
|
|
23462
23597
|
};
|
|
23463
|
-
var
|
|
23598
|
+
var TOTAL_STAT_UNITS = [
|
|
23599
|
+
[/\bcorners?\b/i, "Corners"],
|
|
23600
|
+
[/\bcards?\b|\bbookings?\b/i, "Cards"],
|
|
23601
|
+
[/\bgoals?\b/i, "Goals"],
|
|
23602
|
+
[/\bpoints?\b/i, "Points"],
|
|
23603
|
+
[/\bruns?\b/i, "Runs"],
|
|
23604
|
+
[/\brounds?\b/i, "Rounds"],
|
|
23605
|
+
[/\bgames?\b/i, "Games"],
|
|
23606
|
+
[/\bsets?\b/i, "Sets"],
|
|
23607
|
+
[/\bmaps?\b/i, "Maps"]
|
|
23608
|
+
];
|
|
23609
|
+
var resolveTotalStatUnit = (markets, marketCategory) => {
|
|
23610
|
+
if (marketCategory === "corners") return "Corners";
|
|
23611
|
+
for (const market of markets) {
|
|
23612
|
+
const question = toTrimmedString(market.question);
|
|
23613
|
+
for (const [pattern, unit] of TOTAL_STAT_UNITS) {
|
|
23614
|
+
if (pattern.test(question)) return unit;
|
|
23615
|
+
}
|
|
23616
|
+
}
|
|
23617
|
+
return null;
|
|
23618
|
+
};
|
|
23619
|
+
var resolveDisplayGroupTitle = (market, groupMarkets = [market]) => {
|
|
23464
23620
|
const sportsMarketType = normalizeSportsMarketType(market.sportsMarketType);
|
|
23465
23621
|
const question = toTrimmedString(market.question);
|
|
23466
23622
|
if (isBinarySportsMoneylineMarket(market)) return "Moneyline";
|
|
@@ -23469,6 +23625,12 @@ var resolveDisplayGroupTitle = (market) => {
|
|
|
23469
23625
|
return sportsMarketType != null ? sportsMarketType : market.id;
|
|
23470
23626
|
}
|
|
23471
23627
|
if (sportsMarketType === "total") {
|
|
23628
|
+
const lineFamily = resolveSportsLineFamilyKey(market);
|
|
23629
|
+
const marketCategory = normalizeSportsMarketCategory(market.marketCategory);
|
|
23630
|
+
if (/_tot(_corners)?(_\dh)?$/i.test(lineFamily)) {
|
|
23631
|
+
const unit = resolveTotalStatUnit(groupMarkets, marketCategory);
|
|
23632
|
+
return unit ? `Total ${unit}` : "Totals";
|
|
23633
|
+
}
|
|
23472
23634
|
const base = stripLineValueFromQuestion(question).replace(/o\s*\/\s*u/gi, " ").replace(/\btotals?\b/gi, " ").replace(/\s+/g, " ").trim();
|
|
23473
23635
|
return base ? `${base} Totals` : "Totals";
|
|
23474
23636
|
}
|
|
@@ -23508,7 +23670,7 @@ var buildSportsMarketDisplayGroups = (markets) => {
|
|
|
23508
23670
|
const sectionRank = (_a2 = firstMarket == null ? void 0 : firstMarket.sectionRank) != null ? _a2 : Number.MAX_SAFE_INTEGER;
|
|
23509
23671
|
return {
|
|
23510
23672
|
id,
|
|
23511
|
-
title: resolveDisplayGroupTitle(firstMarket),
|
|
23673
|
+
title: resolveDisplayGroupTitle(firstMarket, orderedMarkets),
|
|
23512
23674
|
questionKey: sanitizeFamilyValue(toTrimmedString(firstMarket == null ? void 0 : firstMarket.question)),
|
|
23513
23675
|
sportsMarketType,
|
|
23514
23676
|
marketCategory,
|
|
@@ -23613,17 +23775,33 @@ var resolveSlideKind = (group) => {
|
|
|
23613
23775
|
if (group.sportsMarketType === "total") return "total";
|
|
23614
23776
|
return "other";
|
|
23615
23777
|
};
|
|
23616
|
-
var aggregateSportsLineStops = (markets) => {
|
|
23778
|
+
var aggregateSportsLineStops = (markets, isSpread = false) => {
|
|
23617
23779
|
var _a;
|
|
23618
|
-
const
|
|
23780
|
+
const homeToken = isSpread ? resolveSpreadHomeToken(markets) : null;
|
|
23781
|
+
const axisOf = (market) => {
|
|
23782
|
+
var _a2, _b;
|
|
23783
|
+
if (homeToken) {
|
|
23784
|
+
const favored = resolveSpreadFavoredToken(market);
|
|
23785
|
+
if (favored) {
|
|
23786
|
+
const magnitude = Math.abs((_a2 = market.lineValue) != null ? _a2 : 0);
|
|
23787
|
+
return favored === homeToken ? -magnitude : magnitude;
|
|
23788
|
+
}
|
|
23789
|
+
}
|
|
23790
|
+
return (_b = market.lineValue) != null ? _b : Number.NEGATIVE_INFINITY;
|
|
23791
|
+
};
|
|
23792
|
+
const displayOf = (market) => {
|
|
23793
|
+
var _a2;
|
|
23794
|
+
return homeToken ? resolveSelectedSportsLineValue(Math.abs((_a2 = market.lineValue) != null ? _a2 : 0)) : resolveSelectedSportsLineValue(market.lineValue);
|
|
23795
|
+
};
|
|
23796
|
+
const marketsByAxis = /* @__PURE__ */ new Map();
|
|
23619
23797
|
for (const market of markets) {
|
|
23620
|
-
const
|
|
23621
|
-
const lineMarkets = (_a =
|
|
23798
|
+
const axis = axisOf(market);
|
|
23799
|
+
const lineMarkets = (_a = marketsByAxis.get(axis)) != null ? _a : [];
|
|
23622
23800
|
lineMarkets.push(market);
|
|
23623
|
-
|
|
23801
|
+
marketsByAxis.set(axis, lineMarkets);
|
|
23624
23802
|
}
|
|
23625
|
-
return Array.from(
|
|
23626
|
-
var _a2
|
|
23803
|
+
return Array.from(marketsByAxis.entries()).map(([axis, lineMarkets]) => {
|
|
23804
|
+
var _a2;
|
|
23627
23805
|
const representative = (_a2 = lineMarkets[resolveHighestVolumeIndex(lineMarkets)]) != null ? _a2 : lineMarkets[0];
|
|
23628
23806
|
const venues = /* @__PURE__ */ new Set();
|
|
23629
23807
|
for (const lineMarket of lineMarkets) {
|
|
@@ -23632,18 +23810,18 @@ var aggregateSportsLineStops = (markets) => {
|
|
|
23632
23810
|
}
|
|
23633
23811
|
}
|
|
23634
23812
|
return {
|
|
23635
|
-
value,
|
|
23813
|
+
value: displayOf(representative),
|
|
23636
23814
|
representative,
|
|
23637
23815
|
venues: Array.from(venues),
|
|
23638
23816
|
volume: resolveTotalGroupVolume(lineMarkets),
|
|
23639
|
-
lineValue:
|
|
23817
|
+
lineValue: axis
|
|
23640
23818
|
};
|
|
23641
23819
|
}).sort(
|
|
23642
23820
|
(left, right) => left.lineValue !== right.lineValue ? left.lineValue - right.lineValue : left.value.localeCompare(right.value)
|
|
23643
23821
|
);
|
|
23644
23822
|
};
|
|
23645
23823
|
var buildSportsSlideFromGroup = (group) => {
|
|
23646
|
-
const lineStops = group.hasLineVariants ? aggregateSportsLineStops(group.markets) : [];
|
|
23824
|
+
const lineStops = group.hasLineVariants ? aggregateSportsLineStops(group.markets, group.sportsMarketType === "spread") : [];
|
|
23647
23825
|
const hasLadder = lineStops.length > 1;
|
|
23648
23826
|
const stops = hasLadder ? lineStops.map((lineStop) => ({
|
|
23649
23827
|
value: lineStop.value,
|
|
@@ -24082,6 +24260,45 @@ var SportsMarketCard = ({
|
|
|
24082
24260
|
];
|
|
24083
24261
|
});
|
|
24084
24262
|
}, [combinedMoneylineMarkets, isCombinedMoneylineGroup, midpointsResult]);
|
|
24263
|
+
const spreadHeaderOutcomeItems = (0, import_react39.useMemo)(() => {
|
|
24264
|
+
var _a2;
|
|
24265
|
+
if (slide.kind !== "spread" || !activeMarket) return void 0;
|
|
24266
|
+
const outcomes = (_a2 = activeMarket.venueMarketOutcomes) != null ? _a2 : [];
|
|
24267
|
+
const lineValue = activeMarket.lineValue;
|
|
24268
|
+
if (outcomes.length < 2 || lineValue == null) return void 0;
|
|
24269
|
+
const { favored, dog } = resolveSpreadOutcomeTeamNames(activeMarket, group.markets);
|
|
24270
|
+
if (!favored && !dog) return void 0;
|
|
24271
|
+
const magnitude = Math.abs(lineValue);
|
|
24272
|
+
const formatLine = (value) => `${value > 0 ? "+" : "\u2212"}${Number.isInteger(magnitude) ? String(magnitude) : magnitude.toFixed(1)}`;
|
|
24273
|
+
return [
|
|
24274
|
+
{ index: 0, name: favored, signedLine: -magnitude },
|
|
24275
|
+
{ index: 1, name: dog, signedLine: magnitude }
|
|
24276
|
+
].flatMap(({ index, name, signedLine }) => {
|
|
24277
|
+
var _a3;
|
|
24278
|
+
const outcome = outcomes[index];
|
|
24279
|
+
if (!outcome) return [];
|
|
24280
|
+
const label2 = name != null ? name : outcome.label.trim();
|
|
24281
|
+
const probability = midpointsResult == null ? void 0 : getDisplayOutcomePrice({
|
|
24282
|
+
outcomeId: outcome.id,
|
|
24283
|
+
outcomeLabel: outcome.label,
|
|
24284
|
+
bestMidpointsByOutcomeId: (_a3 = midpointsResult.bestMidpointsByOutcomeId) != null ? _a3 : midpointsResult.prices
|
|
24285
|
+
});
|
|
24286
|
+
return [
|
|
24287
|
+
{
|
|
24288
|
+
id: outcome.id,
|
|
24289
|
+
label: label2,
|
|
24290
|
+
title: label2,
|
|
24291
|
+
lineLabel: formatLine(signedLine),
|
|
24292
|
+
probability,
|
|
24293
|
+
isPriceLoading: (midpointsResult == null ? void 0 : midpointsResult.isLoading) === true && probability == null,
|
|
24294
|
+
tone: index === 0 ? "positive" : "negative",
|
|
24295
|
+
variant: "line",
|
|
24296
|
+
venue: activeMarket.venue
|
|
24297
|
+
}
|
|
24298
|
+
];
|
|
24299
|
+
});
|
|
24300
|
+
}, [slide.kind, activeMarket, group.markets, midpointsResult]);
|
|
24301
|
+
const headerOutcomeItemsOverride = combinedMoneylineHeaderOutcomeItems != null ? combinedMoneylineHeaderOutcomeItems : spreadHeaderOutcomeItems;
|
|
24085
24302
|
const headerOutcomeVariant = isCombinedMoneylineGroup ? "outcome" : resolveSportsMarketCardVariant(activeMarket);
|
|
24086
24303
|
const handleLineSelect = (index) => {
|
|
24087
24304
|
var _a2, _b2;
|
|
@@ -24112,7 +24329,7 @@ var SportsMarketCard = ({
|
|
|
24112
24329
|
compactHeader: true,
|
|
24113
24330
|
subtitleOverride: compactSubtitle,
|
|
24114
24331
|
headerOutcomeVariant,
|
|
24115
|
-
headerOutcomeItemsOverride
|
|
24332
|
+
headerOutcomeItemsOverride,
|
|
24116
24333
|
isOpened: isExpanded,
|
|
24117
24334
|
suppressOutcomeFallbackSelection: activeMarket.id !== (tradingContext == null ? void 0 : tradingContext.selectedMarketId),
|
|
24118
24335
|
onOpenChange: () => onToggle(group.id, activeMarket),
|
package/dist/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
UserProfilePage,
|
|
12
12
|
buildAggTxExplorerHref,
|
|
13
13
|
useHomePageModals
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ELLV56FR.mjs";
|
|
15
15
|
import {
|
|
16
16
|
EventList,
|
|
17
17
|
EventListItem,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
orderbookRowLimitDefault,
|
|
29
29
|
resolveEventDetailsSyncKey,
|
|
30
30
|
useCenterOrderbookSpread
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-3R2CQTNM.mjs";
|
|
32
32
|
import {
|
|
33
33
|
CARD_NETWORK_OPTIONS,
|
|
34
34
|
ConnectAccountsStep,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
buildTerminalSummary,
|
|
45
45
|
clearPendingCardSession,
|
|
46
46
|
getPendingCardSession
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-44GSDH2Y.mjs";
|
|
48
48
|
import {
|
|
49
49
|
AggNotificationEventsProvider,
|
|
50
50
|
DEPOSIT_MODAL_OPEN_EVENT,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
requestAggWithdrawModalOpen,
|
|
60
60
|
useClaimWinnings,
|
|
61
61
|
useResolvedMarketClaim
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-MXM5PM4A.mjs";
|
|
63
63
|
import {
|
|
64
64
|
SETTLEMENT_SECTION_ID,
|
|
65
65
|
Settlement,
|
|
@@ -77,10 +77,10 @@ import {
|
|
|
77
77
|
resolveOrderBookRows,
|
|
78
78
|
resolveUnifiedOrderBookEntries,
|
|
79
79
|
useEventTradingContext
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-SG573ODC.mjs";
|
|
81
81
|
import {
|
|
82
82
|
GeoBlockBanner
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-7OVSGWI7.mjs";
|
|
84
84
|
import {
|
|
85
85
|
AGG_DEFAULT_URL,
|
|
86
86
|
AGG_DOCS_URL,
|
|
@@ -201,7 +201,7 @@ import {
|
|
|
201
201
|
useOptionalToast,
|
|
202
202
|
useToast,
|
|
203
203
|
venueLogoNames
|
|
204
|
-
} from "./chunk-
|
|
204
|
+
} from "./chunk-6Z5GQ3KL.mjs";
|
|
205
205
|
|
|
206
206
|
// src/notifications/agg-toast-provider.tsx
|
|
207
207
|
import { jsx } from "react/jsx-runtime";
|
package/dist/modals.mjs
CHANGED
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
buildTerminalSummary,
|
|
15
15
|
clearPendingCardSession,
|
|
16
16
|
getPendingCardSession
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-44GSDH2Y.mjs";
|
|
18
18
|
import {
|
|
19
19
|
GeoBlockBanner
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-7OVSGWI7.mjs";
|
|
21
|
+
import "./chunk-6Z5GQ3KL.mjs";
|
|
22
22
|
export {
|
|
23
23
|
CARD_NETWORK_OPTIONS,
|
|
24
24
|
ConnectAccountsStep,
|