@agg-market/ui 0.0.1
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/badge.d.mts +26 -0
- package/dist/badge.d.ts +26 -0
- package/dist/badge.js +70 -0
- package/dist/badge.mjs +9 -0
- package/dist/button.d.mts +20 -0
- package/dist/button.d.ts +20 -0
- package/dist/button.js +197 -0
- package/dist/button.mjs +8 -0
- package/dist/card.d.mts +8 -0
- package/dist/card.d.ts +8 -0
- package/dist/card.js +84 -0
- package/dist/card.mjs +7 -0
- package/dist/chart.d.mts +40 -0
- package/dist/chart.d.ts +40 -0
- package/dist/chart.js +418 -0
- package/dist/chart.mjs +8 -0
- package/dist/chunk-2PGUPOXY.mjs +285 -0
- package/dist/chunk-3DV3D2LH.mjs +155 -0
- package/dist/chunk-44UEI6KD.mjs +280 -0
- package/dist/chunk-4ADCXJE6.mjs +297 -0
- package/dist/chunk-4GSXVVSA.mjs +64 -0
- package/dist/chunk-4NK2FNAG.mjs +581 -0
- package/dist/chunk-4XWCYUV3.mjs +355 -0
- package/dist/chunk-5MN6ZNFA.mjs +355 -0
- package/dist/chunk-6RRBINER.mjs +50 -0
- package/dist/chunk-765JPQDG.mjs +280 -0
- package/dist/chunk-7CD7GIZC.mjs +850 -0
- package/dist/chunk-7XRKA6XF.mjs +462 -0
- package/dist/chunk-AOFP74IB.mjs +850 -0
- package/dist/chunk-BNDFQPHF.mjs +9 -0
- package/dist/chunk-C4OI72SM.mjs +14 -0
- package/dist/chunk-CB2MLGCJ.mjs +279 -0
- package/dist/chunk-CKTAVEW2.mjs +212 -0
- package/dist/chunk-DA6KZWSK.mjs +807 -0
- package/dist/chunk-DBD5GHHD.mjs +147 -0
- package/dist/chunk-DQ6XFBYJ.mjs +37 -0
- package/dist/chunk-FACIYUNK.mjs +217 -0
- package/dist/chunk-FUJQIYOF.mjs +37 -0
- package/dist/chunk-FZTAHWOS.mjs +82 -0
- package/dist/chunk-GC3QIIH7.mjs +112 -0
- package/dist/chunk-GPBLZGJ2.mjs +136 -0
- package/dist/chunk-H4LELROL.mjs +262 -0
- package/dist/chunk-H7P6DIX4.mjs +262 -0
- package/dist/chunk-H7YEBGYY.mjs +42 -0
- package/dist/chunk-HJOBAMDU.mjs +142 -0
- package/dist/chunk-IJG5I642.mjs +462 -0
- package/dist/chunk-IY2AA3OL.mjs +50 -0
- package/dist/chunk-J6L5BLKX.mjs +136 -0
- package/dist/chunk-J7OETCZ7.mjs +147 -0
- package/dist/chunk-JLLMIPIX.mjs +42 -0
- package/dist/chunk-KBRLFTJT.mjs +741 -0
- package/dist/chunk-KDBYDMYV.mjs +64 -0
- package/dist/chunk-L6E6Q4C4.mjs +217 -0
- package/dist/chunk-LY6474C4.mjs +297 -0
- package/dist/chunk-M23S2DVV.mjs +581 -0
- package/dist/chunk-MG243DSX.mjs +44 -0
- package/dist/chunk-MRHSN2B7.mjs +279 -0
- package/dist/chunk-MXWRCVRJ.mjs +285 -0
- package/dist/chunk-NFYS557L.mjs +481 -0
- package/dist/chunk-NNSY462N.mjs +212 -0
- package/dist/chunk-OUOIDPGX.mjs +25 -0
- package/dist/chunk-P5PFQX75.mjs +31 -0
- package/dist/chunk-P674XRDY.mjs +481 -0
- package/dist/chunk-PAQ542ER.mjs +170 -0
- package/dist/chunk-QE46DVJG.mjs +323 -0
- package/dist/chunk-QXFDXXDB.mjs +792 -0
- package/dist/chunk-R3DRVI4J.mjs +741 -0
- package/dist/chunk-TTOR7JCT.mjs +155 -0
- package/dist/chunk-V5WIYMKS.mjs +25 -0
- package/dist/chunk-VAZE267Q.mjs +82 -0
- package/dist/chunk-VLIJ7PQK.mjs +792 -0
- package/dist/chunk-VYNVBJK6.mjs +44 -0
- package/dist/chunk-WIWJ6DIE.mjs +323 -0
- package/dist/chunk-XDAEEJYR.mjs +142 -0
- package/dist/chunk-YUIZZ6XE.mjs +31 -0
- package/dist/connect-button.d.mts +40 -0
- package/dist/connect-button.d.ts +40 -0
- package/dist/connect-button.js +1815 -0
- package/dist/connect-button.mjs +14 -0
- package/dist/event-list-item-details.d.mts +11 -0
- package/dist/event-list-item-details.d.ts +11 -0
- package/dist/event-list-item-details.js +2140 -0
- package/dist/event-list-item-details.mjs +19 -0
- package/dist/event-list-item-details.types-CMbXOrT-.d.ts +53 -0
- package/dist/event-list-item-details.types-CxWr4Qn1.d.ts +53 -0
- package/dist/event-list-item-details.types-DRi99PZq.d.mts +53 -0
- package/dist/event-list-item-details.types-DekJKeMD.d.mts +53 -0
- package/dist/event-list-item.d.mts +10 -0
- package/dist/event-list-item.d.ts +10 -0
- package/dist/event-list-item.js +2097 -0
- package/dist/event-list-item.mjs +17 -0
- package/dist/event-list-item.types-B1490EQm.d.mts +46 -0
- package/dist/event-list-item.types-B1490EQm.d.ts +46 -0
- package/dist/event-list-item.types-Y6IeJ4e4.d.mts +46 -0
- package/dist/event-list-item.types-Y6IeJ4e4.d.ts +46 -0
- package/dist/event-list.d.mts +9 -0
- package/dist/event-list.d.ts +9 -0
- package/dist/event-list.js +3151 -0
- package/dist/event-list.mjs +20 -0
- package/dist/event-list.types-Bpp6Vn-t.d.mts +13 -0
- package/dist/event-list.types-Bpp6Vn-t.d.ts +13 -0
- package/dist/event-list.types-CkAAUqwW.d.mts +13 -0
- package/dist/event-list.types-CkAAUqwW.d.ts +13 -0
- package/dist/event-market-page.d.mts +52 -0
- package/dist/event-market-page.d.ts +52 -0
- package/dist/event-market-page.js +5369 -0
- package/dist/event-market-page.mjs +29 -0
- package/dist/hello-world.d.mts +8 -0
- package/dist/hello-world.d.ts +8 -0
- package/dist/hello-world.js +80 -0
- package/dist/hello-world.mjs +8 -0
- package/dist/home-page.d.mts +51 -0
- package/dist/home-page.d.ts +51 -0
- package/dist/home-page.js +3415 -0
- package/dist/home-page.mjs +21 -0
- package/dist/icon.d.mts +123 -0
- package/dist/icon.d.ts +123 -0
- package/dist/icon.js +922 -0
- package/dist/icon.mjs +57 -0
- package/dist/index.d.mts +70 -0
- package/dist/index.d.ts +70 -0
- package/dist/index.js +8184 -0
- package/dist/index.mjs +307 -0
- package/dist/loading-icon.d.mts +14 -0
- package/dist/loading-icon.d.ts +14 -0
- package/dist/loading-icon.js +115 -0
- package/dist/loading-icon.mjs +8 -0
- package/dist/market-details.d.mts +73 -0
- package/dist/market-details.d.ts +73 -0
- package/dist/market-details.js +3923 -0
- package/dist/market-details.mjs +22 -0
- package/dist/modal.d.mts +66 -0
- package/dist/modal.d.ts +66 -0
- package/dist/modal.js +317 -0
- package/dist/modal.mjs +9 -0
- package/dist/number-value.d.mts +14 -0
- package/dist/number-value.d.ts +14 -0
- package/dist/number-value.js +67 -0
- package/dist/number-value.mjs +7 -0
- package/dist/onboarding-modal.d.mts +88 -0
- package/dist/onboarding-modal.d.ts +88 -0
- package/dist/onboarding-modal.js +2242 -0
- package/dist/onboarding-modal.mjs +24 -0
- package/dist/place-order.d.mts +20 -0
- package/dist/place-order.d.ts +20 -0
- package/dist/place-order.js +2916 -0
- package/dist/place-order.mjs +18 -0
- package/dist/registry-CVn79H3I.d.mts +106 -0
- package/dist/registry-CVn79H3I.d.ts +106 -0
- package/dist/search.d.mts +69 -0
- package/dist/search.d.ts +69 -0
- package/dist/search.js +1465 -0
- package/dist/search.mjs +12 -0
- package/dist/select.d.mts +19 -0
- package/dist/select.d.ts +19 -0
- package/dist/select.js +920 -0
- package/dist/select.mjs +11 -0
- package/dist/settlement.d.mts +16 -0
- package/dist/settlement.d.ts +16 -0
- package/dist/settlement.js +1769 -0
- package/dist/settlement.mjs +15 -0
- package/dist/skeleton.d.mts +22 -0
- package/dist/skeleton.d.ts +22 -0
- package/dist/skeleton.js +523 -0
- package/dist/skeleton.mjs +10 -0
- package/dist/styles.css +2 -0
- package/dist/switch-button.d.mts +21 -0
- package/dist/switch-button.d.ts +21 -0
- package/dist/switch-button.js +184 -0
- package/dist/switch-button.mjs +7 -0
- package/dist/tabs.d.mts +27 -0
- package/dist/tabs.d.ts +27 -0
- package/dist/tabs.js +1708 -0
- package/dist/tabs.mjs +12 -0
- package/dist/tailwind.css +2 -0
- package/dist/types-8VUuQVZq.d.mts +387 -0
- package/dist/types-8VUuQVZq.d.ts +387 -0
- package/dist/types-CayJ8tWA.d.mts +3 -0
- package/dist/types-CayJ8tWA.d.ts +3 -0
- package/dist/typography.d.mts +16 -0
- package/dist/typography.d.ts +16 -0
- package/dist/typography.js +62 -0
- package/dist/typography.mjs +7 -0
- package/dist/venue-logo.d.mts +12 -0
- package/dist/venue-logo.d.ts +12 -0
- package/dist/venue-logo.js +350 -0
- package/dist/venue-logo.mjs +10 -0
- package/dist/venue-logo.types-4hmCg3D3.d.ts +17 -0
- package/dist/venue-logo.types-B1iPJgiD.d.mts +17 -0
- package/dist/venue-logo.types-Bg8eXtGp.d.ts +17 -0
- package/dist/venue-logo.types-QNDwiQ77.d.mts +17 -0
- package/package.json +195 -0
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Card
|
|
3
|
+
} from "./chunk-P5PFQX75.mjs";
|
|
4
|
+
import {
|
|
5
|
+
cn,
|
|
6
|
+
getMotionClassName
|
|
7
|
+
} from "./chunk-GC3QIIH7.mjs";
|
|
8
|
+
|
|
9
|
+
// src/primitives/skeleton/views/event-list-skeleton-view.tsx
|
|
10
|
+
import { useLabels as useLabels2 } from "@agg/hooks";
|
|
11
|
+
|
|
12
|
+
// src/primitives/skeleton/skeleton-block.tsx
|
|
13
|
+
import { useSdkUiConfig } from "@agg/hooks";
|
|
14
|
+
import { jsx } from "react/jsx-runtime";
|
|
15
|
+
var SkeletonBlock = ({ className }) => {
|
|
16
|
+
const { enableAnimations } = useSdkUiConfig();
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
"aria-hidden": true,
|
|
21
|
+
className: cn(
|
|
22
|
+
"bg-agg-separator",
|
|
23
|
+
getMotionClassName(enableAnimations, "animate-pulse"),
|
|
24
|
+
className
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
SkeletonBlock.displayName = "SkeletonBlock";
|
|
30
|
+
|
|
31
|
+
// src/primitives/skeleton/views/event-list-item-skeleton-view.tsx
|
|
32
|
+
import { useLabels } from "@agg/hooks";
|
|
33
|
+
|
|
34
|
+
// src/events/item/event-list-item.constants.ts
|
|
35
|
+
var baseCardClassName = "gap-3 overflow-hidden p-5 w-full";
|
|
36
|
+
|
|
37
|
+
// src/primitives/skeleton/views/event-list-item-skeleton-view.tsx
|
|
38
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
39
|
+
var EventListItemSkeletonView = ({
|
|
40
|
+
className,
|
|
41
|
+
ariaLabel,
|
|
42
|
+
isStandalone = false
|
|
43
|
+
}) => {
|
|
44
|
+
const labels = useLabels();
|
|
45
|
+
return /* @__PURE__ */ jsxs(
|
|
46
|
+
Card,
|
|
47
|
+
{
|
|
48
|
+
className: cn(baseCardClassName, className),
|
|
49
|
+
role: isStandalone ? "status" : void 0,
|
|
50
|
+
"aria-label": isStandalone ? ariaLabel != null ? ariaLabel : labels.eventItem.loading : void 0,
|
|
51
|
+
"aria-busy": isStandalone || void 0,
|
|
52
|
+
"aria-hidden": isStandalone ? void 0 : true,
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ jsxs("div", { className: "flex w-full items-start gap-3", children: [
|
|
55
|
+
/* @__PURE__ */ jsx2(SkeletonBlock, { className: "h-10 w-10 rounded-agg-lg" }),
|
|
56
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-2", children: [
|
|
57
|
+
/* @__PURE__ */ jsx2(SkeletonBlock, { className: "h-5 w-[82%] rounded-agg-sm" }),
|
|
58
|
+
/* @__PURE__ */ jsx2(SkeletonBlock, { className: "h-5 w-[68%] rounded-agg-sm" })
|
|
59
|
+
] })
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ jsx2("div", { className: "flex flex-col gap-3", children: [0, 1].map((index) => /* @__PURE__ */ jsxs(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
className: "grid w-full grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-3",
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsx2(SkeletonBlock, { className: "h-4 rounded-agg-sm" }),
|
|
67
|
+
/* @__PURE__ */ jsx2(SkeletonBlock, { className: "h-4 w-10 rounded-agg-sm" }),
|
|
68
|
+
/* @__PURE__ */ jsx2(SkeletonBlock, { className: "h-9 w-[101px] rounded-agg-full" })
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
index
|
|
72
|
+
)) }),
|
|
73
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 text-agg-muted-foreground", children: [
|
|
74
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
75
|
+
/* @__PURE__ */ jsx2(SkeletonBlock, { className: "h-4 w-36 rounded-agg-sm" }),
|
|
76
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
77
|
+
/* @__PURE__ */ jsx2(SkeletonBlock, { className: "size-3 rounded-agg-full" }),
|
|
78
|
+
/* @__PURE__ */ jsx2(SkeletonBlock, { className: "size-3 rounded-agg-full" }),
|
|
79
|
+
/* @__PURE__ */ jsx2(SkeletonBlock, { className: "size-3 rounded-agg-full" })
|
|
80
|
+
] })
|
|
81
|
+
] }),
|
|
82
|
+
/* @__PURE__ */ jsx2(SkeletonBlock, { className: "h-4 w-20 rounded-agg-sm" })
|
|
83
|
+
] })
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
EventListItemSkeletonView.displayName = "EventListItemSkeletonView";
|
|
89
|
+
|
|
90
|
+
// src/primitives/skeleton/views/event-list-skeleton-view.tsx
|
|
91
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
92
|
+
var EventListSkeletonView = ({ className, ariaLabel }) => {
|
|
93
|
+
const labels = useLabels2();
|
|
94
|
+
return /* @__PURE__ */ jsxs2(
|
|
95
|
+
"section",
|
|
96
|
+
{
|
|
97
|
+
className: cn("flex w-full flex-col gap-5", className),
|
|
98
|
+
role: "status",
|
|
99
|
+
"aria-label": ariaLabel != null ? ariaLabel : labels.eventList.loading("events"),
|
|
100
|
+
"aria-busy": true,
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ jsxs2("header", { className: "flex w-full flex-col items-start justify-between gap-2 md:flex-row md:flex-nowrap md:items-center md:gap-4", children: [
|
|
103
|
+
/* @__PURE__ */ jsx3(SkeletonBlock, { className: "h-7 w-40 rounded-agg-sm" }),
|
|
104
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex max-w-full gap-2", children: [
|
|
105
|
+
/* @__PURE__ */ jsx3(SkeletonBlock, { className: "h-10 w-20 rounded-agg-full" }),
|
|
106
|
+
/* @__PURE__ */ jsx3(SkeletonBlock, { className: "h-10 w-20 rounded-agg-full" }),
|
|
107
|
+
/* @__PURE__ */ jsx3(SkeletonBlock, { className: "h-10 w-24 rounded-agg-full" })
|
|
108
|
+
] })
|
|
109
|
+
] }),
|
|
110
|
+
/* @__PURE__ */ jsx3("div", { className: "grid grid-cols-1 gap-5 md:grid-cols-3", children: Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ jsx3(
|
|
111
|
+
EventListItemSkeletonView,
|
|
112
|
+
{
|
|
113
|
+
isStandalone: false,
|
|
114
|
+
className: "w-full min-w-0 max-w-none"
|
|
115
|
+
},
|
|
116
|
+
index
|
|
117
|
+
)) })
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
EventListSkeletonView.displayName = "EventListSkeletonView";
|
|
123
|
+
|
|
124
|
+
// src/primitives/skeleton/views/event-list-item-details-skeleton-view.tsx
|
|
125
|
+
import { useLabels as useLabels3 } from "@agg/hooks";
|
|
126
|
+
|
|
127
|
+
// src/events/item-details/event-list-item-details.constants.ts
|
|
128
|
+
var detailsBaseCardClassName = "w-full overflow-hidden gap-6 p-5 md:gap-8 md:p-10";
|
|
129
|
+
var eventListItemDetailsTimeRanges = [
|
|
130
|
+
"1H",
|
|
131
|
+
"6H",
|
|
132
|
+
"1D",
|
|
133
|
+
"1W",
|
|
134
|
+
"1M",
|
|
135
|
+
"ALL"
|
|
136
|
+
];
|
|
137
|
+
var lineColorByVenue = {
|
|
138
|
+
polymarket: "#2e5cff",
|
|
139
|
+
kalshi: "#00d295",
|
|
140
|
+
probable: "#f05923",
|
|
141
|
+
opinion: "#020205"
|
|
142
|
+
};
|
|
143
|
+
var fallbackLineColors = ["#2e5cff", "#00d295", "#f05923", "#020205"];
|
|
144
|
+
|
|
145
|
+
// src/primitives/skeleton/views/event-list-item-details-skeleton-view.tsx
|
|
146
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
147
|
+
var EventListItemDetailsSkeletonView = ({
|
|
148
|
+
className,
|
|
149
|
+
ariaLabel
|
|
150
|
+
}) => {
|
|
151
|
+
const labels = useLabels3();
|
|
152
|
+
return /* @__PURE__ */ jsxs3(
|
|
153
|
+
Card,
|
|
154
|
+
{
|
|
155
|
+
className: cn(detailsBaseCardClassName, className),
|
|
156
|
+
role: "status",
|
|
157
|
+
"aria-label": ariaLabel != null ? ariaLabel : labels.eventItemDetails.loading,
|
|
158
|
+
"aria-busy": true,
|
|
159
|
+
children: [
|
|
160
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex w-full items-start gap-3 md:gap-4", children: [
|
|
161
|
+
/* @__PURE__ */ jsx4(SkeletonBlock, { className: "size-10 rounded-agg-lg md:size-[60px]" }),
|
|
162
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-1 flex-col gap-2", children: [
|
|
163
|
+
/* @__PURE__ */ jsx4(SkeletonBlock, { className: "h-5 w-[82%] rounded-agg-sm md:h-7 md:w-[55%]" }),
|
|
164
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex gap-2 overflow-hidden", children: [
|
|
165
|
+
/* @__PURE__ */ jsx4(SkeletonBlock, { className: "h-8 w-28 rounded-agg-full" }),
|
|
166
|
+
/* @__PURE__ */ jsx4(SkeletonBlock, { className: "h-8 w-28 rounded-agg-full" }),
|
|
167
|
+
/* @__PURE__ */ jsx4(SkeletonBlock, { className: "h-8 w-28 rounded-agg-full" })
|
|
168
|
+
] })
|
|
169
|
+
] })
|
|
170
|
+
] }),
|
|
171
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-4", children: [
|
|
172
|
+
/* @__PURE__ */ jsx4(SkeletonBlock, { className: "h-10 w-full rounded-agg-full md:w-[220px]" }),
|
|
173
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex gap-2 overflow-hidden", children: [
|
|
174
|
+
/* @__PURE__ */ jsx4(SkeletonBlock, { className: "h-9 w-20 rounded-agg-full" }),
|
|
175
|
+
/* @__PURE__ */ jsx4(SkeletonBlock, { className: "h-9 w-20 rounded-agg-full" }),
|
|
176
|
+
/* @__PURE__ */ jsx4(SkeletonBlock, { className: "h-9 w-20 rounded-agg-full" }),
|
|
177
|
+
/* @__PURE__ */ jsx4(SkeletonBlock, { className: "h-9 w-20 rounded-agg-full" })
|
|
178
|
+
] })
|
|
179
|
+
] }),
|
|
180
|
+
/* @__PURE__ */ jsx4("div", { className: "h-[300px] w-full rounded-agg-xl", children: /* @__PURE__ */ jsx4(SkeletonBlock, { className: "h-full w-full rounded-agg-xl" }) }),
|
|
181
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between", children: [
|
|
182
|
+
/* @__PURE__ */ jsx4(SkeletonBlock, { className: "h-5 w-24 rounded-agg-sm" }),
|
|
183
|
+
/* @__PURE__ */ jsx4(SkeletonBlock, { className: "h-5 w-40 rounded-agg-sm" })
|
|
184
|
+
] })
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
};
|
|
189
|
+
EventListItemDetailsSkeletonView.displayName = "EventListItemDetailsSkeletonView";
|
|
190
|
+
|
|
191
|
+
// src/primitives/skeleton/views/market-details-skeleton-view.tsx
|
|
192
|
+
import { useLabels as useLabels4 } from "@agg/hooks";
|
|
193
|
+
|
|
194
|
+
// src/events/market-details/market-details.constants.ts
|
|
195
|
+
var marketDetailsBaseCardClassName = "w-full overflow-hidden rounded-agg-lg border border-agg-separator bg-agg-secondary text-agg-foreground shadow-none hover:shadow-none";
|
|
196
|
+
var getMarketDetailsTabs = (labels) => {
|
|
197
|
+
return [
|
|
198
|
+
{ value: "order-book", label: labels.marketDetails.tabs.orderBook },
|
|
199
|
+
{ value: "graph", label: labels.marketDetails.tabs.graph }
|
|
200
|
+
];
|
|
201
|
+
};
|
|
202
|
+
var marketDetailsDefaultIsOpened = false;
|
|
203
|
+
var orderBookRowLimitDefault = 4;
|
|
204
|
+
|
|
205
|
+
// src/primitives/skeleton/views/market-details-skeleton-view.tsx
|
|
206
|
+
import { Fragment, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
207
|
+
var MarketDetailsSkeletonView = ({
|
|
208
|
+
className,
|
|
209
|
+
ariaLabel,
|
|
210
|
+
isDetailed
|
|
211
|
+
}) => {
|
|
212
|
+
const labels = useLabels4();
|
|
213
|
+
return /* @__PURE__ */ jsxs4(
|
|
214
|
+
Card,
|
|
215
|
+
{
|
|
216
|
+
className: cn(marketDetailsBaseCardClassName, className),
|
|
217
|
+
role: "status",
|
|
218
|
+
"aria-label": ariaLabel != null ? ariaLabel : labels.marketDetails.loading,
|
|
219
|
+
"aria-busy": true,
|
|
220
|
+
children: [
|
|
221
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-3 p-4 md:px-5 md:py-4", children: [
|
|
222
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between gap-4", children: [
|
|
223
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 items-center gap-3 md:gap-4", children: [
|
|
224
|
+
/* @__PURE__ */ jsx5(SkeletonBlock, { className: "size-12 rounded-agg-lg md:size-[60px]" }),
|
|
225
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-col gap-2", children: [
|
|
226
|
+
/* @__PURE__ */ jsx5(SkeletonBlock, { className: "h-6 w-40 rounded-agg-sm" }),
|
|
227
|
+
/* @__PURE__ */ jsx5(SkeletonBlock, { className: "h-4 w-28 rounded-agg-sm" })
|
|
228
|
+
] })
|
|
229
|
+
] }),
|
|
230
|
+
/* @__PURE__ */ jsx5(SkeletonBlock, { className: "h-8 w-16 rounded-agg-sm" })
|
|
231
|
+
] }),
|
|
232
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex gap-2", children: [
|
|
233
|
+
/* @__PURE__ */ jsx5(SkeletonBlock, { className: "h-10 flex-1 rounded-agg-full" }),
|
|
234
|
+
/* @__PURE__ */ jsx5(SkeletonBlock, { className: "h-10 flex-1 rounded-agg-full" })
|
|
235
|
+
] })
|
|
236
|
+
] }),
|
|
237
|
+
isDetailed ? /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
238
|
+
/* @__PURE__ */ jsx5("div", { className: "h-px w-full bg-agg-separator" }),
|
|
239
|
+
/* @__PURE__ */ jsx5("div", { className: "flex h-14 items-end", children: /* @__PURE__ */ jsx5(SkeletonBlock, { className: "h-full w-full rounded-none" }) }),
|
|
240
|
+
/* @__PURE__ */ jsx5("div", { className: "h-px w-full bg-agg-separator" }),
|
|
241
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-4 p-5", children: [
|
|
242
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-3", children: [
|
|
243
|
+
/* @__PURE__ */ jsx5(SkeletonBlock, { className: "h-4 w-12 rounded-agg-sm" }),
|
|
244
|
+
[0, 1, 2, 3].map((index) => /* @__PURE__ */ jsxs4(
|
|
245
|
+
"div",
|
|
246
|
+
{
|
|
247
|
+
className: "grid grid-cols-[52px_1fr_1fr_52px] items-center gap-2",
|
|
248
|
+
children: [
|
|
249
|
+
/* @__PURE__ */ jsx5(SkeletonBlock, { className: "h-4 rounded-agg-sm" }),
|
|
250
|
+
/* @__PURE__ */ jsx5(SkeletonBlock, { className: "h-4 rounded-agg-sm" }),
|
|
251
|
+
/* @__PURE__ */ jsx5(SkeletonBlock, { className: "h-4 rounded-agg-sm" }),
|
|
252
|
+
/* @__PURE__ */ jsx5(SkeletonBlock, { className: "h-2 rounded-agg-full" })
|
|
253
|
+
]
|
|
254
|
+
},
|
|
255
|
+
`ask-${index}`
|
|
256
|
+
))
|
|
257
|
+
] }),
|
|
258
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-3", children: [
|
|
259
|
+
/* @__PURE__ */ jsx5(SkeletonBlock, { className: "h-4 w-12 rounded-agg-sm" }),
|
|
260
|
+
[0, 1, 2, 3].map((index) => /* @__PURE__ */ jsxs4(
|
|
261
|
+
"div",
|
|
262
|
+
{
|
|
263
|
+
className: "grid grid-cols-[52px_1fr_1fr_52px] items-center gap-2",
|
|
264
|
+
children: [
|
|
265
|
+
/* @__PURE__ */ jsx5(SkeletonBlock, { className: "h-4 rounded-agg-sm" }),
|
|
266
|
+
/* @__PURE__ */ jsx5(SkeletonBlock, { className: "h-4 rounded-agg-sm" }),
|
|
267
|
+
/* @__PURE__ */ jsx5(SkeletonBlock, { className: "h-4 rounded-agg-sm" }),
|
|
268
|
+
/* @__PURE__ */ jsx5(SkeletonBlock, { className: "h-2 rounded-agg-full" })
|
|
269
|
+
]
|
|
270
|
+
},
|
|
271
|
+
`bid-${index}`
|
|
272
|
+
))
|
|
273
|
+
] })
|
|
274
|
+
] })
|
|
275
|
+
] }) : null
|
|
276
|
+
]
|
|
277
|
+
}
|
|
278
|
+
);
|
|
279
|
+
};
|
|
280
|
+
MarketDetailsSkeletonView.displayName = "MarketDetailsSkeletonView";
|
|
281
|
+
|
|
282
|
+
// src/primitives/skeleton/views/place-order-skeleton-view.tsx
|
|
283
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
284
|
+
var placeOrderCardClassName = "overflow-hidden rounded-agg-xl border border-agg-border bg-agg-secondary shadow-none hover:shadow-none";
|
|
285
|
+
var ContentBody = () => {
|
|
286
|
+
return /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-6 p-5", children: [
|
|
287
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-2", children: [
|
|
288
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-start justify-between gap-5", children: [
|
|
289
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
|
|
290
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-12 w-12 shrink-0 rounded-agg-lg" }),
|
|
291
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
292
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-5 w-[92%] rounded-agg-sm" }),
|
|
293
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-5 w-[80%] rounded-agg-sm" })
|
|
294
|
+
] })
|
|
295
|
+
] }),
|
|
296
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-6 w-6 rounded-agg-sm" })
|
|
297
|
+
] }),
|
|
298
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-5 w-28 rounded-agg-sm" })
|
|
299
|
+
] }),
|
|
300
|
+
/* @__PURE__ */ jsx6("div", { className: "flex h-11 items-end border-b border-agg-separator", children: /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-8", children: [
|
|
301
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-2", children: [
|
|
302
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-5 w-10 rounded-agg-sm" }),
|
|
303
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-[3px] w-12 rounded-t-agg-sm" })
|
|
304
|
+
] }),
|
|
305
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-5 w-10 rounded-agg-sm" })
|
|
306
|
+
] }) }),
|
|
307
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-4", children: [
|
|
308
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex gap-2", children: [
|
|
309
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-11 flex-1 rounded-agg-full" }),
|
|
310
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-11 flex-1 rounded-agg-full" })
|
|
311
|
+
] }),
|
|
312
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between gap-4", children: [
|
|
313
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-2", children: [
|
|
314
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-6 w-20 rounded-agg-sm" }),
|
|
315
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-4 w-28 rounded-agg-sm" })
|
|
316
|
+
] }),
|
|
317
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-9 w-28 rounded-agg-sm" })
|
|
318
|
+
] })
|
|
319
|
+
] }),
|
|
320
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-2", children: [
|
|
321
|
+
/* @__PURE__ */ jsx6("div", { className: "rounded-agg-lg border border-agg-trade-highlight-border bg-agg-trade-highlight-surface p-3", children: /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-3", children: [
|
|
322
|
+
[0, 1].map((index) => /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-3", children: [
|
|
323
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between gap-4", children: [
|
|
324
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2", children: [
|
|
325
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "size-4 rounded-agg-full" }),
|
|
326
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-5 w-24 rounded-agg-sm" })
|
|
327
|
+
] }),
|
|
328
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-5 w-10 rounded-agg-sm" })
|
|
329
|
+
] }),
|
|
330
|
+
index === 0 ? /* @__PURE__ */ jsx6("div", { className: "h-px w-full bg-agg-trade-highlight-border" }) : null
|
|
331
|
+
] }, `place-order-route-${index}`)),
|
|
332
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "mx-auto h-5 w-40 rounded-agg-sm" })
|
|
333
|
+
] }) }),
|
|
334
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-4 w-36 rounded-agg-sm" })
|
|
335
|
+
] }),
|
|
336
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between gap-4", children: [
|
|
337
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-2", children: [
|
|
338
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-6 w-20 rounded-agg-sm" }),
|
|
339
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-4 w-24 rounded-agg-sm" })
|
|
340
|
+
] }),
|
|
341
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-9 w-36 rounded-agg-sm" })
|
|
342
|
+
] }),
|
|
343
|
+
/* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-4 w-[88%] self-center rounded-agg-sm" })
|
|
344
|
+
] });
|
|
345
|
+
};
|
|
346
|
+
var PlaceOrderSkeletonView = ({
|
|
347
|
+
className,
|
|
348
|
+
ariaLabel
|
|
349
|
+
}) => {
|
|
350
|
+
return /* @__PURE__ */ jsx6(
|
|
351
|
+
"div",
|
|
352
|
+
{
|
|
353
|
+
className: cn("w-full", className),
|
|
354
|
+
role: "status",
|
|
355
|
+
"aria-label": ariaLabel != null ? ariaLabel : "Loading place order",
|
|
356
|
+
"aria-busy": true,
|
|
357
|
+
children: /* @__PURE__ */ jsx6("div", { className: "flex w-full items-end justify-center", children: /* @__PURE__ */ jsxs5(
|
|
358
|
+
Card,
|
|
359
|
+
{
|
|
360
|
+
className: cn(
|
|
361
|
+
placeOrderCardClassName,
|
|
362
|
+
"w-full max-w-[400px] rounded-t-agg-xl rounded-b-none border-b-0"
|
|
363
|
+
),
|
|
364
|
+
children: [
|
|
365
|
+
/* @__PURE__ */ jsx6(ContentBody, {}),
|
|
366
|
+
/* @__PURE__ */ jsx6("div", { className: "border-t border-agg-separator bg-agg-secondary p-4", children: /* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-12 w-full rounded-agg-full" }) })
|
|
367
|
+
]
|
|
368
|
+
}
|
|
369
|
+
) })
|
|
370
|
+
}
|
|
371
|
+
);
|
|
372
|
+
};
|
|
373
|
+
PlaceOrderSkeletonView.displayName = "PlaceOrderSkeletonView";
|
|
374
|
+
|
|
375
|
+
// src/primitives/skeleton/views/settlement-skeleton-view.tsx
|
|
376
|
+
import { useLabels as useLabels5 } from "@agg/hooks";
|
|
377
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
378
|
+
var SettlementSkeletonView = ({
|
|
379
|
+
className,
|
|
380
|
+
ariaLabel
|
|
381
|
+
}) => {
|
|
382
|
+
const labels = useLabels5();
|
|
383
|
+
return /* @__PURE__ */ jsxs6(
|
|
384
|
+
Card,
|
|
385
|
+
{
|
|
386
|
+
className: cn(
|
|
387
|
+
"gap-5 rounded-agg-xl border border-agg-separator bg-agg-secondary p-5 shadow-none hover:shadow-none",
|
|
388
|
+
className
|
|
389
|
+
),
|
|
390
|
+
role: "status",
|
|
391
|
+
"aria-label": ariaLabel != null ? ariaLabel : labels.trading.settlementLoading,
|
|
392
|
+
"aria-busy": true,
|
|
393
|
+
children: [
|
|
394
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-1 md:flex-row md:items-center md:justify-between md:gap-4", children: [
|
|
395
|
+
/* @__PURE__ */ jsx7(SkeletonBlock, { className: "h-4 w-20 rounded-agg-sm" }),
|
|
396
|
+
/* @__PURE__ */ jsx7(SkeletonBlock, { className: "h-5 w-full max-w-80 rounded-agg-sm" })
|
|
397
|
+
] }),
|
|
398
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-2", children: [
|
|
399
|
+
/* @__PURE__ */ jsx7(SkeletonBlock, { className: "h-5 w-52 rounded-agg-sm" }),
|
|
400
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-2", children: [
|
|
401
|
+
/* @__PURE__ */ jsx7(SkeletonBlock, { className: "h-4 w-[88%] rounded-agg-sm" }),
|
|
402
|
+
/* @__PURE__ */ jsx7(SkeletonBlock, { className: "h-4 w-[84%] rounded-agg-sm" }),
|
|
403
|
+
/* @__PURE__ */ jsx7(SkeletonBlock, { className: "h-4 w-[80%] rounded-agg-sm" }),
|
|
404
|
+
/* @__PURE__ */ jsx7(SkeletonBlock, { className: "h-4 w-[74%] rounded-agg-sm" })
|
|
405
|
+
] })
|
|
406
|
+
] }),
|
|
407
|
+
/* @__PURE__ */ jsx7("div", { className: "h-px w-full bg-agg-separator" }),
|
|
408
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-3", children: [
|
|
409
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-2", children: [
|
|
410
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2", children: [
|
|
411
|
+
/* @__PURE__ */ jsx7(SkeletonBlock, { className: "size-4 rounded-agg-full" }),
|
|
412
|
+
/* @__PURE__ */ jsx7(SkeletonBlock, { className: "h-5 w-24 rounded-agg-sm" }),
|
|
413
|
+
/* @__PURE__ */ jsx7(SkeletonBlock, { className: "h-4 w-4 rounded-agg-sm" })
|
|
414
|
+
] }),
|
|
415
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-2 pl-6", children: [
|
|
416
|
+
/* @__PURE__ */ jsx7(SkeletonBlock, { className: "h-4 w-full rounded-agg-sm" }),
|
|
417
|
+
/* @__PURE__ */ jsx7(SkeletonBlock, { className: "h-4 w-[92%] rounded-agg-sm" }),
|
|
418
|
+
/* @__PURE__ */ jsx7(SkeletonBlock, { className: "h-4 w-[34%] rounded-agg-sm" })
|
|
419
|
+
] })
|
|
420
|
+
] }),
|
|
421
|
+
[0, 1, 2].map((index) => /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2", children: [
|
|
422
|
+
/* @__PURE__ */ jsx7(SkeletonBlock, { className: "size-4 rounded-agg-full" }),
|
|
423
|
+
/* @__PURE__ */ jsx7(SkeletonBlock, { className: "h-5 w-20 rounded-agg-sm" }),
|
|
424
|
+
/* @__PURE__ */ jsx7(SkeletonBlock, { className: "h-4 w-4 rounded-agg-sm" })
|
|
425
|
+
] }, `settlement-venue-${index}`))
|
|
426
|
+
] })
|
|
427
|
+
]
|
|
428
|
+
}
|
|
429
|
+
);
|
|
430
|
+
};
|
|
431
|
+
SettlementSkeletonView.displayName = "SettlementSkeletonView";
|
|
432
|
+
|
|
433
|
+
// src/primitives/skeleton/skeleton.types.ts
|
|
434
|
+
var skeletonViews = {
|
|
435
|
+
eventListItem: "event-list-item",
|
|
436
|
+
eventListItemDetails: "event-list-item-details",
|
|
437
|
+
marketDetailsMinified: "market-details-minified",
|
|
438
|
+
marketDetailsDetailed: "market-details-detailed",
|
|
439
|
+
eventList: "event-list",
|
|
440
|
+
settlement: "settlement",
|
|
441
|
+
placeOrder: "place-order"
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
// src/primitives/skeleton/index.tsx
|
|
445
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
446
|
+
var Skeleton = ({ view, className, ariaLabel }) => {
|
|
447
|
+
if (view === skeletonViews.eventListItem) {
|
|
448
|
+
return /* @__PURE__ */ jsx8(EventListItemSkeletonView, { className, ariaLabel, isStandalone: true });
|
|
449
|
+
}
|
|
450
|
+
if (view === skeletonViews.eventListItemDetails) {
|
|
451
|
+
return /* @__PURE__ */ jsx8(EventListItemDetailsSkeletonView, { className, ariaLabel });
|
|
452
|
+
}
|
|
453
|
+
if (view === skeletonViews.marketDetailsMinified) {
|
|
454
|
+
return /* @__PURE__ */ jsx8(MarketDetailsSkeletonView, { className, ariaLabel, isDetailed: false });
|
|
455
|
+
}
|
|
456
|
+
if (view === skeletonViews.marketDetailsDetailed) {
|
|
457
|
+
return /* @__PURE__ */ jsx8(MarketDetailsSkeletonView, { className, ariaLabel, isDetailed: true });
|
|
458
|
+
}
|
|
459
|
+
if (view === skeletonViews.settlement) {
|
|
460
|
+
return /* @__PURE__ */ jsx8(SettlementSkeletonView, { className, ariaLabel });
|
|
461
|
+
}
|
|
462
|
+
if (view === skeletonViews.placeOrder) {
|
|
463
|
+
return /* @__PURE__ */ jsx8(PlaceOrderSkeletonView, { className, ariaLabel });
|
|
464
|
+
}
|
|
465
|
+
return /* @__PURE__ */ jsx8(EventListSkeletonView, { className, ariaLabel });
|
|
466
|
+
};
|
|
467
|
+
Skeleton.displayName = "Skeleton";
|
|
468
|
+
|
|
469
|
+
export {
|
|
470
|
+
baseCardClassName,
|
|
471
|
+
detailsBaseCardClassName,
|
|
472
|
+
eventListItemDetailsTimeRanges,
|
|
473
|
+
lineColorByVenue,
|
|
474
|
+
fallbackLineColors,
|
|
475
|
+
marketDetailsBaseCardClassName,
|
|
476
|
+
getMarketDetailsTabs,
|
|
477
|
+
marketDetailsDefaultIsOpened,
|
|
478
|
+
orderBookRowLimitDefault,
|
|
479
|
+
skeletonViews,
|
|
480
|
+
Skeleton
|
|
481
|
+
};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues,
|
|
4
|
+
toDate
|
|
5
|
+
} from "./chunk-GC3QIIH7.mjs";
|
|
6
|
+
|
|
7
|
+
// src/events/item/event-list-item.utils.ts
|
|
8
|
+
var resolveEventListItemEvent = (fetchedEvent) => {
|
|
9
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
10
|
+
if (!fetchedEvent)
|
|
11
|
+
return void 0;
|
|
12
|
+
const fallbackVenueEvent = fetchedEvent.venueEvents[0];
|
|
13
|
+
if (!fallbackVenueEvent)
|
|
14
|
+
return void 0;
|
|
15
|
+
const mergedVenueMarkets = fetchedEvent.markets.flatMap((venueEvent) => venueEvent.venueMarkets);
|
|
16
|
+
const venueMarkets = mergedVenueMarkets.length > 0 ? mergedVenueMarkets : [];
|
|
17
|
+
if ((venueMarkets == null ? void 0 : venueMarkets.length) === 0)
|
|
18
|
+
return void 0;
|
|
19
|
+
return __spreadProps(__spreadValues({}, fetchedEvent), {
|
|
20
|
+
id: fetchedEvent.id,
|
|
21
|
+
title: fetchedEvent.title || fallbackVenueEvent.title,
|
|
22
|
+
description: (_b = (_a = fetchedEvent.description) != null ? _a : fallbackVenueEvent.description) != null ? _b : null,
|
|
23
|
+
volume: (_d = (_c = fetchedEvent.volume) != null ? _c : fallbackVenueEvent.volume) != null ? _d : null,
|
|
24
|
+
startDate: (_f = (_e = fetchedEvent.startDate) != null ? _e : fallbackVenueEvent.startDate) != null ? _f : null,
|
|
25
|
+
endDate: (_h = (_g = fetchedEvent.endDate) != null ? _g : fallbackVenueEvent.endDate) != null ? _h : null,
|
|
26
|
+
creationDate: (_j = (_i = fetchedEvent.creationDate) != null ? _i : fallbackVenueEvent.creationDate) != null ? _j : null
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
var normalizeProbability = (value) => {
|
|
30
|
+
if (typeof value !== "number" || !Number.isFinite(value))
|
|
31
|
+
return void 0;
|
|
32
|
+
if (value < 0)
|
|
33
|
+
return 0;
|
|
34
|
+
if (value > 1)
|
|
35
|
+
return 1;
|
|
36
|
+
return value;
|
|
37
|
+
};
|
|
38
|
+
var hasDateLabel = (outcome) => {
|
|
39
|
+
return !!toDate(outcome.label);
|
|
40
|
+
};
|
|
41
|
+
var sortOutcomes = (outcomes) => {
|
|
42
|
+
if (outcomes.length <= 1)
|
|
43
|
+
return outcomes;
|
|
44
|
+
const now = Date.now();
|
|
45
|
+
if (outcomes.some(hasDateLabel)) {
|
|
46
|
+
return [...outcomes].sort((a, b) => {
|
|
47
|
+
var _a, _b, _c, _d;
|
|
48
|
+
const aDate = (_b = (_a = toDate(a.label)) == null ? void 0 : _a.getTime()) != null ? _b : 0;
|
|
49
|
+
const bDate = (_d = (_c = toDate(b.label)) == null ? void 0 : _c.getTime()) != null ? _d : 0;
|
|
50
|
+
return Math.abs(aDate - now) - Math.abs(bDate - now);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return [...outcomes].sort((a, b) => {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
const aPrice = (_a = normalizeProbability(a.price)) != null ? _a : 0;
|
|
56
|
+
const bPrice = (_b = normalizeProbability(b.price)) != null ? _b : 0;
|
|
57
|
+
return bPrice - aPrice;
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
var compareVisibleOutcomeRows = (left, right) => {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
const leftDate = toDate(resolveOutcomeTitle(left.outcome));
|
|
63
|
+
const rightDate = toDate(resolveOutcomeTitle(right.outcome));
|
|
64
|
+
if (leftDate && rightDate) {
|
|
65
|
+
return leftDate.getTime() - rightDate.getTime();
|
|
66
|
+
}
|
|
67
|
+
const leftProbability = (_a = normalizeProbability(left.outcome.price)) != null ? _a : -1;
|
|
68
|
+
const rightProbability = (_b = normalizeProbability(right.outcome.price)) != null ? _b : -1;
|
|
69
|
+
return rightProbability - leftProbability;
|
|
70
|
+
};
|
|
71
|
+
var shouldReplaceVisibleOutcome = (current, next) => {
|
|
72
|
+
var _a, _b;
|
|
73
|
+
const currentVolume = typeof current.market.volume === "number" ? current.market.volume : -1;
|
|
74
|
+
const nextVolume = typeof next.market.volume === "number" ? next.market.volume : -1;
|
|
75
|
+
if (currentVolume !== nextVolume) {
|
|
76
|
+
return nextVolume > currentVolume;
|
|
77
|
+
}
|
|
78
|
+
const currentProbability = (_a = normalizeProbability(current.outcome.price)) != null ? _a : -1;
|
|
79
|
+
const nextProbability = (_b = normalizeProbability(next.outcome.price)) != null ? _b : -1;
|
|
80
|
+
return nextProbability > currentProbability;
|
|
81
|
+
};
|
|
82
|
+
var resolveVisibleOutcomes = (venueMarkets, maxOutcomes) => {
|
|
83
|
+
const visibleOutcomesByLabel = /* @__PURE__ */ new Map();
|
|
84
|
+
venueMarkets.forEach((market) => {
|
|
85
|
+
sortOutcomes(market.venueMarketOutcomes).forEach((outcome) => {
|
|
86
|
+
const title = resolveOutcomeTitle(outcome);
|
|
87
|
+
const normalizedTitle = title.trim().toLowerCase();
|
|
88
|
+
const nextVisibleOutcome = {
|
|
89
|
+
venue: market.venue,
|
|
90
|
+
market,
|
|
91
|
+
outcome,
|
|
92
|
+
title
|
|
93
|
+
};
|
|
94
|
+
const currentVisibleOutcome = visibleOutcomesByLabel.get(normalizedTitle);
|
|
95
|
+
if (!currentVisibleOutcome || shouldReplaceVisibleOutcome(currentVisibleOutcome, nextVisibleOutcome)) {
|
|
96
|
+
visibleOutcomesByLabel.set(normalizedTitle, nextVisibleOutcome);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
return [...visibleOutcomesByLabel.values()].sort(compareVisibleOutcomeRows).slice(0, Math.max(1, maxOutcomes));
|
|
101
|
+
};
|
|
102
|
+
var resolveOutcomeTitle = (outcome) => {
|
|
103
|
+
if (outcome.title && outcome.title.trim())
|
|
104
|
+
return outcome.title;
|
|
105
|
+
return outcome.label;
|
|
106
|
+
};
|
|
107
|
+
var selectPrimaryVenueMarket = (venueMarkets) => {
|
|
108
|
+
if (venueMarkets.length === 0)
|
|
109
|
+
return void 0;
|
|
110
|
+
if (venueMarkets.length === 1)
|
|
111
|
+
return venueMarkets[0];
|
|
112
|
+
return [...venueMarkets].sort((a, b) => {
|
|
113
|
+
const aVolume = typeof a.volume === "number" ? a.volume : -1;
|
|
114
|
+
const bVolume = typeof b.volume === "number" ? b.volume : -1;
|
|
115
|
+
return bVolume - aVolume;
|
|
116
|
+
})[0];
|
|
117
|
+
};
|
|
118
|
+
var resolveTileTitle = (event, primaryVenueMarket, titleOverride) => {
|
|
119
|
+
if (typeof titleOverride === "string" && titleOverride.trim()) {
|
|
120
|
+
return titleOverride;
|
|
121
|
+
}
|
|
122
|
+
if (typeof (primaryVenueMarket == null ? void 0 : primaryVenueMarket.question) === "string" && primaryVenueMarket.question.trim()) {
|
|
123
|
+
return primaryVenueMarket.question;
|
|
124
|
+
}
|
|
125
|
+
return event.title;
|
|
126
|
+
};
|
|
127
|
+
var resolveTileImage = (event, primaryVenueMarket, imageOverride) => {
|
|
128
|
+
var _a, _b, _c, _d, _e, _f;
|
|
129
|
+
if (typeof imageOverride === "string" && imageOverride.trim()) {
|
|
130
|
+
return imageOverride;
|
|
131
|
+
}
|
|
132
|
+
if (typeof (primaryVenueMarket == null ? void 0 : primaryVenueMarket.image) === "string" && primaryVenueMarket.image.trim()) {
|
|
133
|
+
return primaryVenueMarket.image;
|
|
134
|
+
}
|
|
135
|
+
if (typeof ((_b = (_a = event.venueEvents) == null ? void 0 : _a[0]) == null ? void 0 : _b.image) === "string" && ((_d = (_c = event.venueEvents) == null ? void 0 : _c[0]) == null ? void 0 : _d.image.trim())) {
|
|
136
|
+
return (_f = (_e = event.venueEvents) == null ? void 0 : _e[0]) == null ? void 0 : _f.image;
|
|
137
|
+
}
|
|
138
|
+
return void 0;
|
|
139
|
+
};
|
|
140
|
+
var formatCountLabel = (count, singular, plural) => {
|
|
141
|
+
return `${count} ${count === 1 ? singular : plural}`;
|
|
142
|
+
};
|
|
143
|
+
var getVenueSummary = (venueMarkets) => {
|
|
144
|
+
const uniqueVenues = Array.from(new Set(venueMarkets.map((market) => market.venue)));
|
|
145
|
+
return {
|
|
146
|
+
marketCount: venueMarkets.length,
|
|
147
|
+
venueCount: uniqueVenues.length,
|
|
148
|
+
singleVenue: uniqueVenues.length === 1 ? uniqueVenues[0] : void 0
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
var resolveVenueLabel = (venue, venueInfo, labels) => {
|
|
152
|
+
var _a, _b;
|
|
153
|
+
if (!venue)
|
|
154
|
+
return labels.eventItem.venueSingular;
|
|
155
|
+
return (_b = (_a = venueInfo == null ? void 0 : venueInfo[venue]) == null ? void 0 : _a.label) != null ? _b : labels.venues[venue];
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export {
|
|
159
|
+
resolveEventListItemEvent,
|
|
160
|
+
normalizeProbability,
|
|
161
|
+
sortOutcomes,
|
|
162
|
+
resolveVisibleOutcomes,
|
|
163
|
+
resolveOutcomeTitle,
|
|
164
|
+
selectPrimaryVenueMarket,
|
|
165
|
+
resolveTileTitle,
|
|
166
|
+
resolveTileImage,
|
|
167
|
+
formatCountLabel,
|
|
168
|
+
getVenueSummary,
|
|
169
|
+
resolveVenueLabel
|
|
170
|
+
};
|