@agg-build/ui 2.7.2 → 2.8.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-7R2SMMAG.mjs → chunk-2QCNDFNC.mjs} +193 -103
- package/dist/{chunk-EDQ64EKO.mjs → chunk-AKLGQ6AB.mjs} +254 -53
- package/dist/{chunk-FMYYPNZZ.mjs → chunk-KO6VTRV6.mjs} +101 -27
- package/dist/{chunk-AHQA3B7D.mjs → chunk-KX3TQ7WC.mjs} +1 -1
- package/dist/{chunk-EKUH3265.mjs → chunk-MKU5Q6PN.mjs} +51 -13
- package/dist/{chunk-O27JUYCF.mjs → chunk-R5S2QOYL.mjs} +495 -289
- package/dist/{chunk-JQKJDSTW.mjs → chunk-VR5ZRDQT.mjs} +3 -2
- package/dist/events.js +198 -91
- package/dist/events.mjs +3 -3
- package/dist/index.js +1350 -751
- package/dist/index.mjs +7 -7
- package/dist/modals.js +941 -418
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +1008 -609
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +94 -26
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +1403 -902
- package/dist/trading.mjs +4 -4
- package/dist/types/events/orderbook/orderbook.utils.d.mts +1 -1
- package/dist/types/events/orderbook/orderbook.utils.d.ts +1 -1
- package/dist/types/pages/user-profile/components/open-order-row.d.mts +1 -0
- package/dist/types/pages/user-profile/components/open-order-row.d.ts +1 -0
- package/dist/types/pages/user-profile/position-view-model.d.mts +15 -4
- package/dist/types/pages/user-profile/position-view-model.d.ts +15 -4
- package/dist/types/primitives/select/index.d.mts +1 -1
- package/dist/types/primitives/select/index.d.ts +1 -1
- package/dist/types/primitives/select/select.types.d.mts +8 -0
- package/dist/types/primitives/select/select.types.d.ts +8 -0
- package/dist/types/profile/profile-modal.constants.d.mts +2 -1
- package/dist/types/profile/profile-modal.constants.d.ts +2 -1
- package/dist/types/profile/tabs/balance-management-tab.d.mts +3 -0
- package/dist/types/profile/tabs/balance-management-tab.d.ts +3 -0
- package/dist/types/trading/place-order/index.place-order.constants.d.mts +2 -1
- package/dist/types/trading/place-order/index.place-order.constants.d.ts +2 -1
- package/dist/types/trading/place-order/index.place-order.types.d.mts +6 -0
- package/dist/types/trading/place-order/index.place-order.types.d.ts +6 -0
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +10 -2
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +10 -2
- package/package.json +2 -2
package/dist/events.js
CHANGED
|
@@ -6321,7 +6321,11 @@ var Select = ({
|
|
|
6321
6321
|
triggerClassName,
|
|
6322
6322
|
contentClassName,
|
|
6323
6323
|
itemClassName,
|
|
6324
|
-
disabled = SELECT_DEFAULT_IS_DISABLED
|
|
6324
|
+
disabled = SELECT_DEFAULT_IS_DISABLED,
|
|
6325
|
+
variant = "default",
|
|
6326
|
+
openOnHover = false,
|
|
6327
|
+
contentAlign = "start",
|
|
6328
|
+
contentSideOffset = 8
|
|
6325
6329
|
}) => {
|
|
6326
6330
|
var _a;
|
|
6327
6331
|
const labels = (0, import_hooks27.useLabels)();
|
|
@@ -6332,17 +6336,30 @@ var Select = ({
|
|
|
6332
6336
|
const isDisabled = resolveIsSelectDisabled({ disabled, items });
|
|
6333
6337
|
const selectedItem = resolveSelectedItem(items, value);
|
|
6334
6338
|
const [isOpen, setIsOpen] = (0, import_react5.useState)(false);
|
|
6335
|
-
const [menuRect, setMenuRect] = (0, import_react5.useState)(
|
|
6336
|
-
null
|
|
6337
|
-
);
|
|
6339
|
+
const [menuRect, setMenuRect] = (0, import_react5.useState)(null);
|
|
6338
6340
|
const containerRef = (0, import_react5.useRef)(null);
|
|
6339
6341
|
const portalRef = (0, import_react5.useRef)(null);
|
|
6340
|
-
const
|
|
6342
|
+
const closeTimerRef = (0, import_react5.useRef)(null);
|
|
6343
|
+
const openedByHoverRef = (0, import_react5.useRef)(false);
|
|
6344
|
+
const handleClose = (0, import_react5.useCallback)(() => {
|
|
6345
|
+
setIsOpen(false);
|
|
6346
|
+
openedByHoverRef.current = false;
|
|
6347
|
+
}, []);
|
|
6341
6348
|
const updateMenuRect = (0, import_react5.useCallback)(() => {
|
|
6342
6349
|
const el = containerRef.current;
|
|
6343
6350
|
if (!el) return;
|
|
6344
6351
|
const r = el.getBoundingClientRect();
|
|
6345
|
-
setMenuRect({
|
|
6352
|
+
setMenuRect({
|
|
6353
|
+
top: r.bottom + contentSideOffset,
|
|
6354
|
+
left: r.left,
|
|
6355
|
+
right: r.right,
|
|
6356
|
+
width: r.width
|
|
6357
|
+
});
|
|
6358
|
+
}, [contentSideOffset]);
|
|
6359
|
+
(0, import_react5.useEffect)(() => {
|
|
6360
|
+
return () => {
|
|
6361
|
+
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
6362
|
+
};
|
|
6346
6363
|
}, []);
|
|
6347
6364
|
(0, import_react5.useLayoutEffect)(() => {
|
|
6348
6365
|
if (!isOpen) {
|
|
@@ -6380,7 +6397,33 @@ var Select = ({
|
|
|
6380
6397
|
document.addEventListener("keydown", handleKeyDown);
|
|
6381
6398
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
6382
6399
|
}, [isOpen, handleClose]);
|
|
6383
|
-
const
|
|
6400
|
+
const handlePointerEnter = (event) => {
|
|
6401
|
+
if (!openOnHover || isDisabled || event.pointerType === "touch") return;
|
|
6402
|
+
if (closeTimerRef.current) {
|
|
6403
|
+
clearTimeout(closeTimerRef.current);
|
|
6404
|
+
closeTimerRef.current = null;
|
|
6405
|
+
}
|
|
6406
|
+
if (isOpen) return;
|
|
6407
|
+
openedByHoverRef.current = true;
|
|
6408
|
+
setIsOpen(true);
|
|
6409
|
+
};
|
|
6410
|
+
const handlePointerLeave = (event) => {
|
|
6411
|
+
if (!openOnHover || event.pointerType === "touch") return;
|
|
6412
|
+
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
6413
|
+
closeTimerRef.current = setTimeout(() => {
|
|
6414
|
+
handleClose();
|
|
6415
|
+
closeTimerRef.current = null;
|
|
6416
|
+
}, 120);
|
|
6417
|
+
};
|
|
6418
|
+
const handleTriggerClick = () => {
|
|
6419
|
+
if (openedByHoverRef.current && isOpen) {
|
|
6420
|
+
openedByHoverRef.current = false;
|
|
6421
|
+
return;
|
|
6422
|
+
}
|
|
6423
|
+
setIsOpen((previousValue) => !previousValue);
|
|
6424
|
+
};
|
|
6425
|
+
const isInline = variant === "inline";
|
|
6426
|
+
const triggerRadiusClass = triggerClassName != null ? triggerClassName : isInline ? "rounded-agg-sm" : "rounded-agg-md";
|
|
6384
6427
|
const listbox = menuRect ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6385
6428
|
"div",
|
|
6386
6429
|
{
|
|
@@ -6391,16 +6434,20 @@ var Select = ({
|
|
|
6391
6434
|
style: {
|
|
6392
6435
|
position: "fixed",
|
|
6393
6436
|
top: menuRect.top,
|
|
6394
|
-
left: menuRect.left,
|
|
6437
|
+
left: contentAlign === "start" ? menuRect.left : void 0,
|
|
6438
|
+
right: contentAlign === "end" ? window.innerWidth - menuRect.right : void 0,
|
|
6395
6439
|
width: menuRect.width,
|
|
6396
6440
|
zIndex: SELECT_DROPDOWN_Z
|
|
6397
6441
|
},
|
|
6398
6442
|
className: cn(
|
|
6399
6443
|
AGG_ROOT_CLASS_NAME,
|
|
6400
6444
|
rootClassName,
|
|
6401
|
-
"agg-select-content pointer-events-auto max-h-[min(20rem,calc(100vh-4rem))] overflow-y-auto
|
|
6445
|
+
"agg-select-content pointer-events-auto max-h-[min(20rem,calc(100vh-4rem))] overflow-y-auto border border-agg-separator bg-agg-secondary flex flex-col",
|
|
6446
|
+
isInline ? "min-w-[120px] gap-0 rounded-agg-lg py-1 shadow-[0_8px_16px_rgba(0,0,0,0.12)]" : "gap-1 rounded-[12px] p-2 shadow-[0_8px_16px_rgba(0,0,0,0.1)]",
|
|
6402
6447
|
contentClassName
|
|
6403
6448
|
),
|
|
6449
|
+
onPointerEnter: handlePointerEnter,
|
|
6450
|
+
onPointerLeave: handlePointerLeave,
|
|
6404
6451
|
children: items.map((item) => {
|
|
6405
6452
|
const isSelected = item.value === value;
|
|
6406
6453
|
const isHidden = item.hidden === true;
|
|
@@ -6414,9 +6461,10 @@ var Select = ({
|
|
|
6414
6461
|
disabled: item.disabled,
|
|
6415
6462
|
className: cn(
|
|
6416
6463
|
"agg-select-item",
|
|
6417
|
-
"relative flex w-full items-center
|
|
6464
|
+
"relative flex w-full items-center text-left text-agg-sm leading-agg-5 outline-none",
|
|
6465
|
+
isInline ? "gap-2 px-4 py-2" : "gap-3 rounded-[6px] py-3 pl-3 pr-5",
|
|
6418
6466
|
"hover:bg-agg-secondary-hover focus-visible:bg-agg-secondary-hover",
|
|
6419
|
-
isSelected ? "bg-agg-primary/10 font-agg-normal text-agg-primary" : "font-agg-normal text-agg-foreground",
|
|
6467
|
+
isSelected ? isInline ? "font-agg-bold text-agg-foreground" : "bg-agg-primary/10 font-agg-normal text-agg-primary" : "font-agg-normal text-agg-foreground",
|
|
6420
6468
|
item.disabled && "cursor-not-allowed opacity-60",
|
|
6421
6469
|
itemClassName
|
|
6422
6470
|
),
|
|
@@ -6428,6 +6476,13 @@ var Select = ({
|
|
|
6428
6476
|
handleClose();
|
|
6429
6477
|
},
|
|
6430
6478
|
children: [
|
|
6479
|
+
isInline && isSelected ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6480
|
+
"span",
|
|
6481
|
+
{
|
|
6482
|
+
className: "agg-select-item-indicator absolute bottom-2 left-0 top-2 w-1 bg-agg-primary",
|
|
6483
|
+
"aria-hidden": true
|
|
6484
|
+
}
|
|
6485
|
+
) : null,
|
|
6431
6486
|
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6432
6487
|
"span",
|
|
6433
6488
|
{
|
|
@@ -6457,7 +6512,11 @@ var Select = ({
|
|
|
6457
6512
|
"div",
|
|
6458
6513
|
{
|
|
6459
6514
|
ref: containerRef,
|
|
6460
|
-
className: cn(
|
|
6515
|
+
className: cn(
|
|
6516
|
+
"group/agg-select relative inline-flex",
|
|
6517
|
+
isInline ? "w-auto" : "w-full",
|
|
6518
|
+
className
|
|
6519
|
+
),
|
|
6461
6520
|
children: [
|
|
6462
6521
|
/* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(
|
|
6463
6522
|
"button",
|
|
@@ -6469,19 +6528,19 @@ var Select = ({
|
|
|
6469
6528
|
disabled: isDisabled,
|
|
6470
6529
|
className: cn(
|
|
6471
6530
|
"agg-select-trigger",
|
|
6472
|
-
"flex
|
|
6473
|
-
"
|
|
6531
|
+
"flex cursor-pointer items-center gap-2 font-agg-sans text-agg-foreground outline-none disabled:cursor-not-allowed disabled:opacity-60",
|
|
6532
|
+
isInline ? "h-auto w-auto bg-transparent px-2 py-1 pr-8 text-left text-agg-base leading-agg-6" : "h-10 w-full border border-agg-separator bg-agg-secondary px-3 py-[9px] pr-10 text-left text-agg-sm leading-agg-5",
|
|
6474
6533
|
triggerRadiusClass,
|
|
6475
|
-
getMotionClassName(
|
|
6534
|
+
!isInline && getMotionClassName(
|
|
6476
6535
|
enableAnimations,
|
|
6477
6536
|
"transition-[border-color,box-shadow] duration-200 ease-in-out"
|
|
6478
6537
|
),
|
|
6479
|
-
isOpen && "border-2 border-agg-primary px-[11px] py-2 ring-0",
|
|
6480
|
-
"hover:border-agg-primary"
|
|
6481
|
-
"focus:border-agg-primary focus:ring-0",
|
|
6482
|
-
"disabled:cursor-not-allowed disabled:opacity-60"
|
|
6538
|
+
!isInline && isOpen && "border-2 border-agg-primary px-[11px] py-2 ring-0",
|
|
6539
|
+
!isInline && "hover:border-agg-primary focus:border-agg-primary focus:ring-0"
|
|
6483
6540
|
),
|
|
6484
|
-
onClick:
|
|
6541
|
+
onClick: handleTriggerClick,
|
|
6542
|
+
onPointerEnter: handlePointerEnter,
|
|
6543
|
+
onPointerLeave: handlePointerLeave,
|
|
6485
6544
|
children: [
|
|
6486
6545
|
(selectedItem == null ? void 0 : selectedItem.icon) ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("span", { className: "h-4 w-4 shrink-0 [&_svg]:h-full [&_svg]:w-full", children: selectedItem.icon }) : (selectedItem == null ? void 0 : selectedItem.iconUrl) ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6487
6546
|
RemoteImage,
|
|
@@ -6495,14 +6554,23 @@ var Select = ({
|
|
|
6495
6554
|
]
|
|
6496
6555
|
}
|
|
6497
6556
|
),
|
|
6498
|
-
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6499
|
-
|
|
6557
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6558
|
+
"span",
|
|
6500
6559
|
{
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6560
|
+
className: cn(
|
|
6561
|
+
"agg-select-chevron pointer-events-none absolute inset-y-0 inline-flex items-center justify-center",
|
|
6562
|
+
isInline ? "right-2 text-agg-foreground" : "right-3 text-agg-muted-foreground"
|
|
6563
|
+
),
|
|
6564
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6565
|
+
Icon,
|
|
6566
|
+
{
|
|
6567
|
+
name: isOpen ? "chevron-up" : "chevron-down-thin",
|
|
6568
|
+
size: "small",
|
|
6569
|
+
color: "currentColor"
|
|
6570
|
+
}
|
|
6571
|
+
)
|
|
6504
6572
|
}
|
|
6505
|
-
)
|
|
6573
|
+
),
|
|
6506
6574
|
isOpen && typeof document !== "undefined" && listbox ? (0, import_react_dom.createPortal)(listbox, resolveSelectPortalContainer(containerRef.current)) : null
|
|
6507
6575
|
]
|
|
6508
6576
|
}
|
|
@@ -8815,8 +8883,9 @@ var isOrderBookRow = (v) => (0, import_sdk11.hasShape)(v, {
|
|
|
8815
8883
|
total: (t) => typeof t === "number" && t >= 0,
|
|
8816
8884
|
tone: (x) => x === "positive" || x === "negative"
|
|
8817
8885
|
});
|
|
8818
|
-
var formatProbabilityCents = (value) => {
|
|
8886
|
+
var formatProbabilityCents = (value, formatPrice) => {
|
|
8819
8887
|
if (value == null) return "-";
|
|
8888
|
+
if (formatPrice) return formatPrice(value);
|
|
8820
8889
|
const cents = (value * 100).toFixed(1).replace(/\.0$/, "");
|
|
8821
8890
|
return `${cents}\xA2`;
|
|
8822
8891
|
};
|
|
@@ -9251,6 +9320,17 @@ var matchesSelectedOutcomeLabel = (outcome, selectedOutcomeLabel) => {
|
|
|
9251
9320
|
return normalizedCandidate === normalizedSelectedLabel || toSemanticOutcomeLabel(candidate) === semanticSelectedLabel;
|
|
9252
9321
|
});
|
|
9253
9322
|
};
|
|
9323
|
+
var isTeamFramedMarket = (market) => {
|
|
9324
|
+
var _a;
|
|
9325
|
+
const outcomes = (_a = market.venueMarketOutcomes) != null ? _a : [];
|
|
9326
|
+
if (outcomes.length < 2) return false;
|
|
9327
|
+
return outcomes.every(
|
|
9328
|
+
(outcome) => getOutcomeLabelCandidates(outcome).some((candidate) => {
|
|
9329
|
+
const semanticCandidate = toSemanticOutcomeLabel(candidate);
|
|
9330
|
+
return semanticCandidate !== "" && semanticCandidate !== "yes" && semanticCandidate !== "no";
|
|
9331
|
+
})
|
|
9332
|
+
);
|
|
9333
|
+
};
|
|
9254
9334
|
var isValidLevel = (level) => {
|
|
9255
9335
|
return level != null && Number.isFinite(level.price) && Number.isFinite(level.size) && level.price >= 0 && level.price <= 1 && level.size > 0;
|
|
9256
9336
|
};
|
|
@@ -9395,6 +9475,7 @@ var collectEligibleVenueOutcomes = ({
|
|
|
9395
9475
|
const seenMarketIds = /* @__PURE__ */ new Set();
|
|
9396
9476
|
const seenOutcomeIds = /* @__PURE__ */ new Set();
|
|
9397
9477
|
const result = [];
|
|
9478
|
+
let selectedAnchorMarket = null;
|
|
9398
9479
|
if (selectedOutcomeId) {
|
|
9399
9480
|
for (const market of venueMarkets) {
|
|
9400
9481
|
const outcome = market.venueMarketOutcomes.find((o) => o.id === selectedOutcomeId);
|
|
@@ -9448,6 +9529,16 @@ var collectEligibleVenueOutcomes = ({
|
|
|
9448
9529
|
});
|
|
9449
9530
|
return result;
|
|
9450
9531
|
}
|
|
9532
|
+
selectedAnchorMarket = market;
|
|
9533
|
+
seenMarketIds.add(market.id);
|
|
9534
|
+
seenOutcomeIds.add(outcome.id);
|
|
9535
|
+
result.push({
|
|
9536
|
+
venue: market.venue,
|
|
9537
|
+
market,
|
|
9538
|
+
outcome,
|
|
9539
|
+
outcomeId: outcome.id,
|
|
9540
|
+
semanticLabel
|
|
9541
|
+
});
|
|
9451
9542
|
break;
|
|
9452
9543
|
}
|
|
9453
9544
|
}
|
|
@@ -9490,10 +9581,18 @@ var collectEligibleVenueOutcomes = ({
|
|
|
9490
9581
|
}
|
|
9491
9582
|
for (const market of venueMarkets) {
|
|
9492
9583
|
if (seenMarketIds.has(market.id)) continue;
|
|
9584
|
+
if (selectedAnchorMarket && result.some(
|
|
9585
|
+
(entry) => entry.venue === market.venue && entry.market.question.trim() !== market.question.trim()
|
|
9586
|
+
)) {
|
|
9587
|
+
continue;
|
|
9588
|
+
}
|
|
9493
9589
|
const matchedOutcome = sortOutcomes(market.venueMarketOutcomes).find(
|
|
9494
9590
|
(outcome) => matchesSelectedOutcomeLabel(outcome, selectedOutcomeLabel)
|
|
9495
9591
|
);
|
|
9496
9592
|
if (!matchedOutcome || seenOutcomeIds.has(matchedOutcome.id)) continue;
|
|
9593
|
+
if (selectedAnchorMarket && isTeamFramedMarket(market) !== isTeamFramedMarket(selectedAnchorMarket)) {
|
|
9594
|
+
continue;
|
|
9595
|
+
}
|
|
9497
9596
|
const candidateRefs = (_c = matchedOutcome.matchedVenueMarketOutcomes) != null ? _c : [];
|
|
9498
9597
|
if (candidateRefs.length > 0) {
|
|
9499
9598
|
const sharesAnchor = candidateRefs.some(
|
|
@@ -11047,7 +11146,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11047
11146
|
}, [chartOutcomeLabel, (_d = tradingContext == null ? void 0 : tradingContext.selectedOutcome) == null ? void 0 : _d.label]);
|
|
11048
11147
|
const {
|
|
11049
11148
|
chart: { selectedChartTimeRange },
|
|
11050
|
-
formatting: { formatPercent },
|
|
11149
|
+
formatting: { formatPercent, formatPrice },
|
|
11051
11150
|
general: { theme }
|
|
11052
11151
|
} = (0, import_hooks40.useSdkUiConfig)();
|
|
11053
11152
|
const isDarkTheme = theme === "dark";
|
|
@@ -11322,8 +11421,8 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11322
11421
|
});
|
|
11323
11422
|
return {
|
|
11324
11423
|
value: outcome.id,
|
|
11325
|
-
label: `${(_d3 = outcome.title) != null ? _d3 : outcome.label} ${formatProbabilityCents(price)}`,
|
|
11326
|
-
ariaLabel: `${(_e2 = outcome.title) != null ? _e2 : outcome.label} ${formatProbabilityCents(price)}`
|
|
11424
|
+
label: `${(_d3 = outcome.title) != null ? _d3 : outcome.label} ${formatProbabilityCents(price, formatPrice)}`,
|
|
11425
|
+
ariaLabel: `${(_e2 = outcome.title) != null ? _e2 : outcome.label} ${formatProbabilityCents(price, formatPrice)}`
|
|
11327
11426
|
};
|
|
11328
11427
|
})
|
|
11329
11428
|
}
|
|
@@ -11745,7 +11844,7 @@ var EventListItemDetails = (props) => {
|
|
|
11745
11844
|
EventListItemDetails.displayName = "EventListItemDetails";
|
|
11746
11845
|
|
|
11747
11846
|
// src/events/market-details/index.tsx
|
|
11748
|
-
var
|
|
11847
|
+
var import_hooks44 = require("@agg-build/hooks");
|
|
11749
11848
|
var import_react20 = require("react");
|
|
11750
11849
|
|
|
11751
11850
|
// src/events/orderbook/index.tsx
|
|
@@ -11993,6 +12092,7 @@ var OrderbookRow = ({
|
|
|
11993
12092
|
entry,
|
|
11994
12093
|
formatNumber,
|
|
11995
12094
|
formatCurrency,
|
|
12095
|
+
formatPrice,
|
|
11996
12096
|
enableAnimations,
|
|
11997
12097
|
showBadge,
|
|
11998
12098
|
badgeLabel
|
|
@@ -12061,7 +12161,7 @@ var OrderbookRow = ({
|
|
|
12061
12161
|
"w-9 min-w-9 md:min-w-10 md:w-10 text-agg-sm font-agg-bold leading-agg-5",
|
|
12062
12162
|
priceClassName
|
|
12063
12163
|
),
|
|
12064
|
-
children: formatProbabilityCents(entry.row.price)
|
|
12164
|
+
children: formatProbabilityCents(entry.row.price, formatPrice)
|
|
12065
12165
|
}
|
|
12066
12166
|
),
|
|
12067
12167
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(OrderbookVenueLogos, { venues })
|
|
@@ -12083,7 +12183,10 @@ var Orderbook = ({
|
|
|
12083
12183
|
className
|
|
12084
12184
|
}) => {
|
|
12085
12185
|
var _a, _b, _c, _d, _e;
|
|
12086
|
-
const {
|
|
12186
|
+
const {
|
|
12187
|
+
enableWebsocketsLogs,
|
|
12188
|
+
formatting: { formatPrice }
|
|
12189
|
+
} = (0, import_hooks41.useAggUiConfig)();
|
|
12087
12190
|
const labels = __spreadValues(__spreadValues({}, orderbookDefaultLabels), labelsProp);
|
|
12088
12191
|
const scrollContainerRef = (0, import_react18.useRef)(null);
|
|
12089
12192
|
const spreadRowRef = (0, import_react18.useRef)(null);
|
|
@@ -12148,6 +12251,7 @@ var Orderbook = ({
|
|
|
12148
12251
|
entry,
|
|
12149
12252
|
formatNumber,
|
|
12150
12253
|
formatCurrency,
|
|
12254
|
+
formatPrice,
|
|
12151
12255
|
enableAnimations,
|
|
12152
12256
|
showBadge: index === askEntries.length - 1,
|
|
12153
12257
|
badgeLabel: labels.asks
|
|
@@ -12160,7 +12264,7 @@ var Orderbook = ({
|
|
|
12160
12264
|
ref: spreadRowRef,
|
|
12161
12265
|
className: "agg-orderbook-spread flex items-center border-y border-agg-separator h-9 px-5 py-2 gap-3 md:gap-10",
|
|
12162
12266
|
role: "separator",
|
|
12163
|
-
"aria-label": `${labels.midPrice}: ${formatProbabilityCents((_b = spreadEntry == null ? void 0 : spreadEntry.midPrice) != null ? _b : null)}, ${labels.spread}: ${formatProbabilityCents((_c = spreadEntry == null ? void 0 : spreadEntry.spread) != null ? _c : null)}`,
|
|
12267
|
+
"aria-label": `${labels.midPrice}: ${formatProbabilityCents((_b = spreadEntry == null ? void 0 : spreadEntry.midPrice) != null ? _b : null, formatPrice)}, ${labels.spread}: ${formatProbabilityCents((_c = spreadEntry == null ? void 0 : spreadEntry.spread) != null ? _c : null)}`,
|
|
12164
12268
|
children: [
|
|
12165
12269
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
12166
12270
|
Typography,
|
|
@@ -12170,7 +12274,7 @@ var Orderbook = ({
|
|
|
12170
12274
|
children: [
|
|
12171
12275
|
"Last: ",
|
|
12172
12276
|
labels.lastOutcome ? `${labels.lastOutcome} ` : "",
|
|
12173
|
-
formatProbabilityCents((_d = spreadEntry == null ? void 0 : spreadEntry.midPrice) != null ? _d : null)
|
|
12277
|
+
formatProbabilityCents((_d = spreadEntry == null ? void 0 : spreadEntry.midPrice) != null ? _d : null, formatPrice)
|
|
12174
12278
|
]
|
|
12175
12279
|
}
|
|
12176
12280
|
),
|
|
@@ -12197,6 +12301,7 @@ var Orderbook = ({
|
|
|
12197
12301
|
entry,
|
|
12198
12302
|
formatNumber,
|
|
12199
12303
|
formatCurrency,
|
|
12304
|
+
formatPrice,
|
|
12200
12305
|
enableAnimations,
|
|
12201
12306
|
showBadge: index === 0,
|
|
12202
12307
|
badgeLabel: labels.bids
|
|
@@ -12373,6 +12478,7 @@ var resolveTradingStateBadgeClassName = (kind) => {
|
|
|
12373
12478
|
};
|
|
12374
12479
|
|
|
12375
12480
|
// src/events/market-details/market-details-outcome-button.tsx
|
|
12481
|
+
var import_hooks42 = require("@agg-build/hooks");
|
|
12376
12482
|
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
12377
12483
|
var marketDetailsOutcomeButtonToneClasses = {
|
|
12378
12484
|
positive: {
|
|
@@ -12423,6 +12529,7 @@ var OutcomePriceContent = ({
|
|
|
12423
12529
|
value,
|
|
12424
12530
|
textClassName
|
|
12425
12531
|
}) => {
|
|
12532
|
+
const { formatPrice } = (0, import_hooks42.useAggUiConfig)().formatting;
|
|
12426
12533
|
if (isLoading) {
|
|
12427
12534
|
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
12428
12535
|
"span",
|
|
@@ -12441,7 +12548,7 @@ var OutcomePriceContent = ({
|
|
|
12441
12548
|
as: "span",
|
|
12442
12549
|
variant: isSelected ? "body-strong" : "body",
|
|
12443
12550
|
className: cn("shrink-0 whitespace-nowrap", textClassName),
|
|
12444
|
-
children: formatProbabilityCents(value)
|
|
12551
|
+
children: formatProbabilityCents(value, formatPrice)
|
|
12445
12552
|
}
|
|
12446
12553
|
);
|
|
12447
12554
|
};
|
|
@@ -12535,7 +12642,7 @@ var MarketDetailsOutcomeButton = ({
|
|
|
12535
12642
|
MarketDetailsOutcomeButton.displayName = "MarketDetailsOutcomeButton";
|
|
12536
12643
|
|
|
12537
12644
|
// src/events/market-details/market-details-graph-panel.tsx
|
|
12538
|
-
var
|
|
12645
|
+
var import_hooks43 = require("@agg-build/hooks");
|
|
12539
12646
|
var import_react19 = require("react");
|
|
12540
12647
|
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
12541
12648
|
var MarketDetailsGraphPanel = ({
|
|
@@ -12552,13 +12659,13 @@ var MarketDetailsGraphPanel = ({
|
|
|
12552
12659
|
classNames
|
|
12553
12660
|
}) => {
|
|
12554
12661
|
var _a, _b, _c;
|
|
12555
|
-
const config = (0,
|
|
12662
|
+
const config = (0, import_hooks43.useSdkUiConfig)();
|
|
12556
12663
|
const {
|
|
12557
|
-
formatting: { formatPercent, formatCompactCurrency },
|
|
12664
|
+
formatting: { formatPercent, formatCompactCurrency, formatPrice },
|
|
12558
12665
|
general: { theme }
|
|
12559
12666
|
} = config;
|
|
12560
12667
|
const isDarkTheme = theme === "dark";
|
|
12561
|
-
const labels = (0,
|
|
12668
|
+
const labels = (0, import_hooks43.useLabels)();
|
|
12562
12669
|
const selectedTimeRange = config.chart.selectedChartTimeRange;
|
|
12563
12670
|
const setSelectedTimeRange = config.chart.setSelectedChartTimeRange;
|
|
12564
12671
|
const [chartRangeOverride, setChartRangeOverride] = (0, import_react19.useState)(null);
|
|
@@ -12578,7 +12685,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
12578
12685
|
livePrices
|
|
12579
12686
|
});
|
|
12580
12687
|
}, [livePrices, venueMarkets, resolvedChartOutcomeLabel, chartSelectedOutcomeId]);
|
|
12581
|
-
const rollingWindow = (0,
|
|
12688
|
+
const rollingWindow = (0, import_hooks43.useRollingChartWindow)({ range: effectiveChartTimeRange });
|
|
12582
12689
|
const chartPrimaryOutcomeId = (_b = (_a = chartOutcomesByVenue[0]) == null ? void 0 : _a.outcome.id) != null ? _b : null;
|
|
12583
12690
|
const chartVenueOutcomeIds = (0, import_react19.useMemo)(() => {
|
|
12584
12691
|
return chartOutcomesByVenue.map((item) => item.outcome.id);
|
|
@@ -12588,7 +12695,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
12588
12695
|
isLoading: isMarketChartLoading,
|
|
12589
12696
|
error: marketChartError,
|
|
12590
12697
|
refetch: refetchMarketChart
|
|
12591
|
-
} = (0,
|
|
12698
|
+
} = (0, import_hooks43.useMarketChart)({
|
|
12592
12699
|
marketId: chartPrimaryOutcomeId,
|
|
12593
12700
|
venueMarketIds: chartVenueOutcomeIds,
|
|
12594
12701
|
interval: rollingWindow.interval,
|
|
@@ -12768,8 +12875,8 @@ var MarketDetailsGraphPanel = ({
|
|
|
12768
12875
|
const price = outcome.probability;
|
|
12769
12876
|
return {
|
|
12770
12877
|
value: outcome.id,
|
|
12771
|
-
label: `${(_a3 = outcome == null ? void 0 : outcome.title) != null ? _a3 : outcome.label} ${formatProbabilityCents(price)}`,
|
|
12772
|
-
ariaLabel: `${(_b3 = outcome == null ? void 0 : outcome.title) != null ? _b3 : outcome.label} ${formatProbabilityCents(price)}`
|
|
12878
|
+
label: `${(_a3 = outcome == null ? void 0 : outcome.title) != null ? _a3 : outcome.label} ${formatProbabilityCents(price, formatPrice)}`,
|
|
12879
|
+
ariaLabel: `${(_b3 = outcome == null ? void 0 : outcome.title) != null ? _b3 : outcome.label} ${formatProbabilityCents(price, formatPrice)}`
|
|
12773
12880
|
};
|
|
12774
12881
|
})
|
|
12775
12882
|
}
|
|
@@ -12798,7 +12905,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
12798
12905
|
}
|
|
12799
12906
|
),
|
|
12800
12907
|
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { "aria-hidden": "true", className: "hidden h-4 w-px bg-agg-separator md:block" }),
|
|
12801
|
-
|
|
12908
|
+
import_hooks43.CHART_TIME_RANGES.map((timeRange) => {
|
|
12802
12909
|
const isActive = effectiveChartTimeRange === timeRange;
|
|
12803
12910
|
const isDisabled = isResolvedMarket && timeRange !== "ALL";
|
|
12804
12911
|
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
@@ -12841,7 +12948,7 @@ var MarketDetailsUnavailableState = ({
|
|
|
12841
12948
|
ariaLabel,
|
|
12842
12949
|
classNames
|
|
12843
12950
|
}) => {
|
|
12844
|
-
const labels = (0,
|
|
12951
|
+
const labels = (0, import_hooks44.useLabels)();
|
|
12845
12952
|
return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
12846
12953
|
Card,
|
|
12847
12954
|
{
|
|
@@ -12865,7 +12972,7 @@ var MarketDetailsNotFoundState = ({
|
|
|
12865
12972
|
ariaLabel: _ariaLabel,
|
|
12866
12973
|
classNames: _classNames
|
|
12867
12974
|
}) => {
|
|
12868
|
-
const labels = (0,
|
|
12975
|
+
const labels = (0, import_hooks44.useLabels)();
|
|
12869
12976
|
return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
12870
12977
|
StateMessage,
|
|
12871
12978
|
{
|
|
@@ -12903,33 +13010,33 @@ var MarketDetailsContent = ({
|
|
|
12903
13010
|
midpointsResult
|
|
12904
13011
|
}) => {
|
|
12905
13012
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
12906
|
-
const config = (0,
|
|
13013
|
+
const config = (0, import_hooks44.useSdkUiConfig)();
|
|
12907
13014
|
const {
|
|
12908
13015
|
features: { enableAnimations },
|
|
12909
13016
|
formatting: { formatPercent }
|
|
12910
13017
|
} = config;
|
|
12911
|
-
const labels = (0,
|
|
12912
|
-
const tradingContext = (0,
|
|
13018
|
+
const labels = (0, import_hooks44.useLabels)();
|
|
13019
|
+
const tradingContext = (0, import_hooks44.useEventTradingContext)();
|
|
12913
13020
|
const detailsContentId = (0, import_react20.useId)();
|
|
12914
13021
|
const tradeSide = (_a = tradingContext == null ? void 0 : tradingContext.tradeSide) != null ? _a : "buy";
|
|
12915
13022
|
const resolvedMarket = (0, import_react20.useMemo)(() => {
|
|
12916
13023
|
return resolveMarketFromVenueMarkets(venueMarkets, marketId);
|
|
12917
13024
|
}, [venueMarkets, marketId]);
|
|
12918
13025
|
const clusterVenueMarkets = resolvedMarket == null ? void 0 : resolvedMarket.venueMarkets;
|
|
12919
|
-
const wsLivePrices = (0,
|
|
12920
|
-
const wsBestPrices = (0,
|
|
12921
|
-
const wsBestCandidates = (0,
|
|
13026
|
+
const wsLivePrices = (0, import_hooks44.useLiveOutcomePrices)(clusterVenueMarkets);
|
|
13027
|
+
const wsBestPrices = (0, import_hooks44.useLiveBestPrices)(clusterVenueMarkets);
|
|
13028
|
+
const wsBestCandidates = (0, import_hooks44.useLiveBestPriceCandidates)(clusterVenueMarkets);
|
|
12922
13029
|
const scopedResolvedMarket = (0, import_react20.useMemo)(() => {
|
|
12923
13030
|
var _a2, _b2;
|
|
12924
13031
|
if (!resolvedMarket) return null;
|
|
12925
13032
|
return (_b2 = (_a2 = resolvedMarket.venueMarkets.find((venueMarket) => venueMarket.id === resolvedMarket.id)) != null ? _a2 : resolvedMarket.venueMarkets[0]) != null ? _b2 : null;
|
|
12926
13033
|
}, [resolvedMarket]);
|
|
12927
|
-
const isResolvedMarket = (0,
|
|
12928
|
-
(0,
|
|
13034
|
+
const isResolvedMarket = (0, import_hooks44.resolveMarketTradingState)(scopedResolvedMarket).kind === "resolved";
|
|
13035
|
+
(0, import_hooks44.useEventOrderbookData)(
|
|
12929
13036
|
isResolvedMarket ? [] : resolvedMarket == null ? void 0 : resolvedMarket.venueMarkets,
|
|
12930
13037
|
(_b = scopedResolvedMarket == null ? void 0 : scopedResolvedMarket.id) != null ? _b : null
|
|
12931
13038
|
);
|
|
12932
|
-
const fetchedClusterMidpointResult = (0,
|
|
13039
|
+
const fetchedClusterMidpointResult = (0, import_hooks44.useMidpoints)(midpointsResult ? [] : clusterVenueMarkets);
|
|
12933
13040
|
const clusterMidpointResult = midpointsResult != null ? midpointsResult : fetchedClusterMidpointResult;
|
|
12934
13041
|
const clusterMidpoints = (_c = clusterMidpointResult.bestMidpointsByOutcomeId) != null ? _c : clusterMidpointResult.prices;
|
|
12935
13042
|
const clusterBestMidpointsByOutcomeId = clusterMidpoints;
|
|
@@ -12938,7 +13045,7 @@ var MarketDetailsContent = ({
|
|
|
12938
13045
|
const clusterBestMidpointVenue = clusterMidpointResult.bestMidpointVenue;
|
|
12939
13046
|
const clusterBestPricesRest = clusterMidpointResult.bestPrices;
|
|
12940
13047
|
const clusterBestPrices = (0, import_react20.useMemo)(
|
|
12941
|
-
() => (0,
|
|
13048
|
+
() => (0, import_hooks44.mergeBestPricesPreferringLive)(clusterBestPricesRest, wsBestPrices),
|
|
12942
13049
|
[clusterBestPricesRest, wsBestPrices]
|
|
12943
13050
|
);
|
|
12944
13051
|
const clusterBestPriceVenuesByOutcomeId = clusterMidpointResult.bestPriceVenuesByOutcomeId;
|
|
@@ -12993,7 +13100,7 @@ var MarketDetailsContent = ({
|
|
|
12993
13100
|
return (_a2 = model.market.venueMarkets.find((venueMarket) => venueMarket.id === model.market.id)) != null ? _a2 : model.primaryVenueMarket;
|
|
12994
13101
|
}, [model]);
|
|
12995
13102
|
const marketTradingState = (0, import_react20.useMemo)(() => {
|
|
12996
|
-
return (0,
|
|
13103
|
+
return (0, import_hooks44.resolveMarketTradingState)(scopedMarketForCard);
|
|
12997
13104
|
}, [scopedMarketForCard]);
|
|
12998
13105
|
const isOutcomeSelectionLocked = marketTradingState.isTradingDisabled;
|
|
12999
13106
|
const isUpcomingMarket = marketTradingState.kind === "unopened";
|
|
@@ -13154,7 +13261,7 @@ var MarketDetailsContent = ({
|
|
|
13154
13261
|
fallbackPrice: midpointsFallback == null ? void 0 : midpointsFallback.get(displayOutcome.id)
|
|
13155
13262
|
});
|
|
13156
13263
|
if (referencePrice != null) return referencePrice;
|
|
13157
|
-
return (0,
|
|
13264
|
+
return (0, import_hooks44.findLivePriceById)(wsLivePrices, displayOutcome.id);
|
|
13158
13265
|
}, [
|
|
13159
13266
|
clusterBestMidpoint,
|
|
13160
13267
|
clusterBestMidpointsByOutcomeId,
|
|
@@ -13180,7 +13287,7 @@ var MarketDetailsContent = ({
|
|
|
13180
13287
|
const orderBookEnabled = isOpened && effectiveSelectedTab === "order-book" && !marketTradingState.isTradingDisabled;
|
|
13181
13288
|
const primaryVenueMarketId = (_g = (_f = selectedOutcomesByVenue[0]) == null ? void 0 : _f.market.id) != null ? _g : null;
|
|
13182
13289
|
const primaryOutcomeId = (_i = (_h = selectedOutcomesByVenue[0]) == null ? void 0 : _h.outcome.id) != null ? _i : null;
|
|
13183
|
-
const marketOrderbookResult = (0,
|
|
13290
|
+
const marketOrderbookResult = (0, import_hooks44.useMarketOrderbook)({
|
|
13184
13291
|
marketId: primaryVenueMarketId,
|
|
13185
13292
|
enabled: orderBookEnabled && !!primaryVenueMarketId,
|
|
13186
13293
|
venueOutcomes: selectedOutcomesByVenue.map((item) => ({
|
|
@@ -13361,7 +13468,7 @@ var MarketDetailsContent = ({
|
|
|
13361
13468
|
!compactHeader ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
13362
13469
|
RemoteImage,
|
|
13363
13470
|
{
|
|
13364
|
-
src: (0,
|
|
13471
|
+
src: (0, import_hooks44.optimizedImageUrl)(model.image, 60),
|
|
13365
13472
|
alt: "",
|
|
13366
13473
|
className: "agg-market-image size-12 rounded-agg-lg object-cover md:size-[60px]"
|
|
13367
13474
|
}
|
|
@@ -13612,7 +13719,7 @@ var MarketDetailsContent = ({
|
|
|
13612
13719
|
};
|
|
13613
13720
|
var MarketDetails = (_a) => {
|
|
13614
13721
|
var _b = _a, { isOpened } = _b, props = __objRest(_b, ["isOpened"]);
|
|
13615
|
-
const labels = (0,
|
|
13722
|
+
const labels = (0, import_hooks44.useLabels)();
|
|
13616
13723
|
if (props.isLoading) {
|
|
13617
13724
|
return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
13618
13725
|
Skeleton,
|
|
@@ -13667,13 +13774,13 @@ var resolveIsResolvedEvent = (sourceMarkets, eventTradingState) => {
|
|
|
13667
13774
|
return eventTradingState.kind === "resolved";
|
|
13668
13775
|
}
|
|
13669
13776
|
if (sourceMarkets.length === 0) return false;
|
|
13670
|
-
return sourceMarkets.every((market) => (0,
|
|
13777
|
+
return sourceMarkets.every((market) => (0, import_hooks44.resolveMarketTradingState)(market).kind === "resolved");
|
|
13671
13778
|
};
|
|
13672
13779
|
var resolveResolvedWinnerMarketId = (sourceMarkets, eventTradingState) => {
|
|
13673
13780
|
var _a, _b, _c, _d, _e;
|
|
13674
13781
|
const preferredMarket = (_a = eventTradingState == null ? void 0 : eventTradingState.primaryMarket) != null ? _a : null;
|
|
13675
13782
|
if (preferredMarket && sourceMarkets.some((market) => market.id === preferredMarket.id)) {
|
|
13676
|
-
if ((0,
|
|
13783
|
+
if ((0, import_hooks44.resolveMarketTradingState)(preferredMarket).kind === "resolved") {
|
|
13677
13784
|
return preferredMarket.id;
|
|
13678
13785
|
}
|
|
13679
13786
|
}
|
|
@@ -13693,8 +13800,8 @@ var MarketDetailsList = ({
|
|
|
13693
13800
|
midpointsResult
|
|
13694
13801
|
}) => {
|
|
13695
13802
|
var _a, _b;
|
|
13696
|
-
const labels = (0,
|
|
13697
|
-
const tradingContext = (0,
|
|
13803
|
+
const labels = (0, import_hooks44.useLabels)();
|
|
13804
|
+
const tradingContext = (0, import_hooks44.useEventTradingContext)();
|
|
13698
13805
|
const selectedMarketId = (_a = tradingContext == null ? void 0 : tradingContext.selectedMarketId) != null ? _a : null;
|
|
13699
13806
|
const [expandedMarketId, setExpandedMarketId] = (0, import_react20.useState)(null);
|
|
13700
13807
|
const [areResolvedMarketsVisible, setAreResolvedMarketsVisible] = (0, import_react20.useState)(false);
|
|
@@ -13703,10 +13810,10 @@ var MarketDetailsList = ({
|
|
|
13703
13810
|
markets: rawMarkets,
|
|
13704
13811
|
isLoading,
|
|
13705
13812
|
error
|
|
13706
|
-
} = (0,
|
|
13813
|
+
} = (0, import_hooks44.useVenueMarkets)({
|
|
13707
13814
|
venueEventId: resolvedEventId,
|
|
13708
13815
|
enabled: !providedMarkets && !!resolvedEventId,
|
|
13709
|
-
status:
|
|
13816
|
+
status: import_hooks44.MarketStatus.open,
|
|
13710
13817
|
// Keep in lockstep with useEnrichedVenueEvent: limit is part of the React
|
|
13711
13818
|
// Query key, so a mismatch would fork the shared cache into two requests.
|
|
13712
13819
|
// fetchAll drains every page — events can exceed any single-page limit
|
|
@@ -13750,7 +13857,7 @@ var MarketDetailsList = ({
|
|
|
13750
13857
|
const resolved = [];
|
|
13751
13858
|
const closed = [];
|
|
13752
13859
|
sourceMarkets.forEach((market) => {
|
|
13753
|
-
const marketStateKind = (0,
|
|
13860
|
+
const marketStateKind = (0, import_hooks44.resolveMarketTradingState)(market).kind;
|
|
13754
13861
|
if (marketStateKind === "resolved") {
|
|
13755
13862
|
resolved.push(market);
|
|
13756
13863
|
return;
|
|
@@ -13778,10 +13885,10 @@ var MarketDetailsList = ({
|
|
|
13778
13885
|
const hasPrefetchedMarkets = !!providedMarkets || !!((_b = eventTradingState == null ? void 0 : eventTradingState.marketStates) == null ? void 0 : _b.length);
|
|
13779
13886
|
const midpointEligibleMarkets = (0, import_react20.useMemo)(() => {
|
|
13780
13887
|
return displayedMarkets.filter(
|
|
13781
|
-
(market) => (0,
|
|
13888
|
+
(market) => (0, import_hooks44.resolveMarketTradingState)(market).kind !== "resolved"
|
|
13782
13889
|
);
|
|
13783
13890
|
}, [displayedMarkets]);
|
|
13784
|
-
const { prices: midpointsFallback, venueByOutcomeId: midpointsFallbackVenues } = (0,
|
|
13891
|
+
const { prices: midpointsFallback, venueByOutcomeId: midpointsFallbackVenues } = (0, import_hooks44.useViewportMidpoints)(midpointEligibleMarkets);
|
|
13785
13892
|
(0, import_react20.useEffect)(() => {
|
|
13786
13893
|
if (isResolvedEvent) {
|
|
13787
13894
|
setAreResolvedMarketsVisible(false);
|
|
@@ -13800,7 +13907,7 @@ var MarketDetailsList = ({
|
|
|
13800
13907
|
return;
|
|
13801
13908
|
}
|
|
13802
13909
|
const fallbackSelectableMarket = displayedMarkets.find(
|
|
13803
|
-
(market) => !(0,
|
|
13910
|
+
(market) => !(0, import_hooks44.resolveMarketTradingState)(market).isTradingDisabled
|
|
13804
13911
|
);
|
|
13805
13912
|
if (!fallbackSelectableMarket) {
|
|
13806
13913
|
return;
|
|
@@ -13822,7 +13929,7 @@ var MarketDetailsList = ({
|
|
|
13822
13929
|
setExpandedMarketId(marketId);
|
|
13823
13930
|
onExpandedMarketChange == null ? void 0 : onExpandedMarketChange(marketId);
|
|
13824
13931
|
if (marketId === selectedMarketId) return;
|
|
13825
|
-
if ((0,
|
|
13932
|
+
if ((0, import_hooks44.resolveMarketTradingState)(market).isTradingDisabled) return;
|
|
13826
13933
|
tradingContext == null ? void 0 : tradingContext.selectMarket(market.id, market);
|
|
13827
13934
|
};
|
|
13828
13935
|
if (!hasPrefetchedMarkets && isLoading) {
|
|
@@ -13915,7 +14022,7 @@ var MarketDetailsList = ({
|
|
|
13915
14022
|
MarketDetailsList.displayName = "MarketDetailsList";
|
|
13916
14023
|
|
|
13917
14024
|
// src/events/list/index.tsx
|
|
13918
|
-
var
|
|
14025
|
+
var import_hooks46 = require("@agg-build/hooks");
|
|
13919
14026
|
var import_sdk15 = require("@agg-build/sdk");
|
|
13920
14027
|
var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
|
|
13921
14028
|
var import_react23 = require("react");
|
|
@@ -14038,7 +14145,7 @@ var CategorySidebar = ({
|
|
|
14038
14145
|
CategorySidebar.displayName = "CategorySidebar";
|
|
14039
14146
|
|
|
14040
14147
|
// src/events/list/event-list-tabs.tsx
|
|
14041
|
-
var
|
|
14148
|
+
var import_hooks45 = require("@agg-build/hooks");
|
|
14042
14149
|
var import_sdk14 = require("@agg-build/sdk");
|
|
14043
14150
|
var import_react22 = require("react");
|
|
14044
14151
|
|
|
@@ -14126,14 +14233,14 @@ var renderTabIcon = (tab, isActive) => {
|
|
|
14126
14233
|
);
|
|
14127
14234
|
};
|
|
14128
14235
|
var useEventListTabs = (tabs) => {
|
|
14129
|
-
const labels = (0,
|
|
14130
|
-
const { disabledVenues, isLoading: isAppConfigLoading } = (0,
|
|
14131
|
-
const { isLocationBlocked } = (0,
|
|
14236
|
+
const labels = (0, import_hooks45.useLabels)();
|
|
14237
|
+
const { disabledVenues, isLoading: isAppConfigLoading } = (0, import_hooks45.useAppConfig)();
|
|
14238
|
+
const { isLocationBlocked } = (0, import_hooks45.useGeoBlock)();
|
|
14132
14239
|
return (0, import_react22.useMemo)(() => {
|
|
14133
14240
|
const baseTabs = tabs != null ? tabs : getDefaultEventListTabs(labels);
|
|
14134
14241
|
return baseTabs.flatMap((tab) => {
|
|
14135
14242
|
if (!tab.venueLogo) return [tab];
|
|
14136
|
-
const availabilityState = (0,
|
|
14243
|
+
const availabilityState = (0, import_hooks45.getVenueAvailabilityState)({
|
|
14137
14244
|
venueId: tab.venueLogo,
|
|
14138
14245
|
disabledVenues,
|
|
14139
14246
|
isConfigLoading: isAppConfigLoading && tab.venueLogo === import_sdk14.Venue.kalshi,
|
|
@@ -14247,15 +14354,15 @@ var EventList = ({
|
|
|
14247
14354
|
stateRef
|
|
14248
14355
|
}) => {
|
|
14249
14356
|
var _a, _b, _c, _d, _e;
|
|
14250
|
-
const labels = (0,
|
|
14251
|
-
const { disabledVenues } = (0,
|
|
14357
|
+
const labels = (0, import_hooks46.useLabels)();
|
|
14358
|
+
const { disabledVenues } = (0, import_hooks46.useAppConfig)();
|
|
14252
14359
|
const {
|
|
14253
14360
|
features: { enableVenueEventDiscoveryFilters, showSportsMarkets }
|
|
14254
|
-
} = (0,
|
|
14361
|
+
} = (0, import_hooks46.useSdkUiConfig)();
|
|
14255
14362
|
const isDiscoveryFiltersEnabled = enableVenueEventDiscoveryFilters && !search;
|
|
14256
14363
|
const resolvedTabs = useEventListTabs();
|
|
14257
14364
|
const visibleVenues = (0, import_react23.useMemo)(
|
|
14258
|
-
() => disabledVenues.length === 0 ? void 0 : (0,
|
|
14365
|
+
() => disabledVenues.length === 0 ? void 0 : (0, import_hooks46.getVisibleVenueIdsByConfig)(import_sdk15.VENUES, disabledVenues),
|
|
14259
14366
|
[disabledVenues]
|
|
14260
14367
|
);
|
|
14261
14368
|
const [activeTabValue, setActiveTabValue] = (0, import_react23.useState)(
|
|
@@ -14300,7 +14407,7 @@ var EventList = ({
|
|
|
14300
14407
|
setCategoryPath([]);
|
|
14301
14408
|
setCollapsedCategoryIds(/* @__PURE__ */ new Set());
|
|
14302
14409
|
}, [baseCategoryId, isDiscoveryFiltersEnabled]);
|
|
14303
|
-
const { categories: topLevelCategories } = (0,
|
|
14410
|
+
const { categories: topLevelCategories } = (0, import_hooks46.useCategories)({
|
|
14304
14411
|
queryKeyScope: "event-list-top-categories",
|
|
14305
14412
|
enabled: isDiscoveryFiltersEnabled,
|
|
14306
14413
|
limit: 100
|
|
@@ -14316,7 +14423,7 @@ var EventList = ({
|
|
|
14316
14423
|
])
|
|
14317
14424
|
);
|
|
14318
14425
|
}, [categoryPath, sortedTopLevelCategories]);
|
|
14319
|
-
const { childrenByParentId: baseChildrenByParentId } = (0,
|
|
14426
|
+
const { childrenByParentId: baseChildrenByParentId } = (0, import_hooks46.useCategoryChildren)({
|
|
14320
14427
|
queryKeyScope: "event-list-category-children",
|
|
14321
14428
|
enabled: isDiscoveryFiltersEnabled,
|
|
14322
14429
|
parentIds: baseCategoryChildPrefetchIds,
|
|
@@ -14337,7 +14444,7 @@ var EventList = ({
|
|
|
14337
14444
|
}
|
|
14338
14445
|
return Array.from(ids);
|
|
14339
14446
|
}, [baseCategoryId, baseChildrenByParentId, categoryPath]);
|
|
14340
|
-
const { childrenByParentId: visibleChildrenByParentId } = (0,
|
|
14447
|
+
const { childrenByParentId: visibleChildrenByParentId } = (0, import_hooks46.useCategoryChildren)({
|
|
14341
14448
|
queryKeyScope: "event-list-category-children",
|
|
14342
14449
|
enabled: isDiscoveryFiltersEnabled,
|
|
14343
14450
|
parentIds: visibleChildPrefetchIds,
|
|
@@ -14353,7 +14460,7 @@ var EventList = ({
|
|
|
14353
14460
|
}
|
|
14354
14461
|
return Array.from(ids);
|
|
14355
14462
|
}, [categoryPath, visibleChildrenByParentId]);
|
|
14356
|
-
const { childrenByParentId: visibleGrandchildrenByParentId } = (0,
|
|
14463
|
+
const { childrenByParentId: visibleGrandchildrenByParentId } = (0, import_hooks46.useCategoryChildren)({
|
|
14357
14464
|
queryKeyScope: "event-list-category-children",
|
|
14358
14465
|
enabled: isDiscoveryFiltersEnabled,
|
|
14359
14466
|
parentIds: visibleGrandchildPrefetchIds,
|
|
@@ -14409,14 +14516,14 @@ var EventList = ({
|
|
|
14409
14516
|
isFetchingNextPage,
|
|
14410
14517
|
isPlaceholderData,
|
|
14411
14518
|
loadedPageCount
|
|
14412
|
-
} = (0,
|
|
14519
|
+
} = (0, import_hooks46.useVenueEvents)({
|
|
14413
14520
|
queryKeyScope: "event-list",
|
|
14414
14521
|
venues,
|
|
14415
14522
|
search,
|
|
14416
14523
|
categoryIds: resolvedCategoryIds,
|
|
14417
14524
|
matchStatus,
|
|
14418
14525
|
limit: requestLimit,
|
|
14419
|
-
status: [
|
|
14526
|
+
status: [import_hooks46.MarketStatus.open],
|
|
14420
14527
|
sortBy: sortQueryParams.sortBy,
|
|
14421
14528
|
sortDir: sortQueryParams.sortDir,
|
|
14422
14529
|
endDateFrom,
|
|
@@ -14451,7 +14558,7 @@ var EventList = ({
|
|
|
14451
14558
|
const visibleMidpointVenueMarketIds = (0, import_react23.useMemo)(() => {
|
|
14452
14559
|
return collectMidpointVenueMarketIds(visibleVenueMarkets);
|
|
14453
14560
|
}, [visibleVenueMarkets]);
|
|
14454
|
-
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0,
|
|
14561
|
+
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0, import_hooks46.useVenueMarketMidpoints)({
|
|
14455
14562
|
venueMarketIds: visibleMidpointVenueMarketIds,
|
|
14456
14563
|
enabled: visibleMidpointVenueMarketIds.length > 0
|
|
14457
14564
|
});
|
|
@@ -14632,7 +14739,7 @@ var EventList = ({
|
|
|
14632
14739
|
onMarketClick,
|
|
14633
14740
|
getMarketHref,
|
|
14634
14741
|
href: getEventHref == null ? void 0 : getEventHref(event),
|
|
14635
|
-
marketStatus:
|
|
14742
|
+
marketStatus: import_hooks46.MarketStatus.open
|
|
14636
14743
|
},
|
|
14637
14744
|
event.id
|
|
14638
14745
|
)),
|