@agg-build/ui 1.3.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-ONVP7YWS.mjs → chunk-3OI2ZLLT.mjs} +94 -39
- package/dist/{chunk-UFC7L74C.mjs → chunk-C5M2OOM3.mjs} +1 -1
- package/dist/{chunk-QUZWA34R.mjs → chunk-DXF2LMNN.mjs} +512 -503
- package/dist/{chunk-5ALBEKAT.mjs → chunk-R6FBYAY5.mjs} +246 -194
- package/dist/{chunk-6PQ6O6M5.mjs → chunk-Y6PVXAUQ.mjs} +34 -90
- package/dist/{chunk-YWJIYEJV.mjs → chunk-YAEA6EDG.mjs} +31 -18
- package/dist/{chunk-55ODXLOS.mjs → chunk-YMVD6Q2A.mjs} +1 -1
- package/dist/events.js +894 -903
- package/dist/events.mjs +3 -3
- package/dist/index.js +2609 -2530
- package/dist/index.mjs +9 -7
- package/dist/modals.js +278 -171
- package/dist/modals.mjs +5 -3
- package/dist/pages.js +2014 -1991
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +526 -475
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +28 -15
- package/dist/trading.mjs +4 -4
- package/dist/types/events/list/category-sidebar.d.mts +33 -0
- package/dist/types/events/list/category-sidebar.d.ts +33 -0
- package/dist/types/events/list/event-list-tabs.d.mts +2 -0
- package/dist/types/events/list/event-list-tabs.d.ts +2 -0
- package/dist/types/events/list/event-list.utils.d.mts +0 -4
- package/dist/types/events/list/event-list.utils.d.ts +0 -4
- package/dist/types/events/list/index.d.mts +1 -0
- package/dist/types/events/list/index.d.ts +1 -0
- package/dist/types/pages/event-market/event-market.types.d.mts +1 -0
- package/dist/types/pages/event-market/event-market.types.d.ts +1 -0
- package/dist/types/pages/user-profile/index.d.mts +1 -1
- package/dist/types/pages/user-profile/index.d.ts +1 -1
- package/dist/types/pages/user-profile/user-profile.types.d.mts +1 -0
- package/dist/types/pages/user-profile/user-profile.types.d.ts +1 -0
- package/dist/types/shared/use-horizontal-scroll-state.d.mts +15 -0
- package/dist/types/shared/use-horizontal-scroll-state.d.ts +15 -0
- package/dist/types/withdraw/index.d.mts +9 -1
- package/dist/types/withdraw/index.d.ts +9 -1
- package/dist/types/withdraw/steps/withdraw-amount.d.mts +10 -1
- package/dist/types/withdraw/steps/withdraw-amount.d.ts +10 -1
- package/dist/types/withdraw/withdraw-modal.types.d.mts +8 -0
- package/dist/types/withdraw/withdraw-modal.types.d.ts +8 -0
- package/package.json +3 -3
package/dist/events.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports = __toCommonJS(events_exports);
|
|
|
82
82
|
|
|
83
83
|
// src/events/item/index.tsx
|
|
84
84
|
var import_hooks31 = require("@agg-build/hooks");
|
|
85
|
-
var
|
|
85
|
+
var import_react10 = require("react");
|
|
86
86
|
|
|
87
87
|
// src/constants.ts
|
|
88
88
|
var AGG_ROOT_CLASS_NAME = "agg-root";
|
|
@@ -4005,425 +4005,131 @@ var LineChart = ({
|
|
|
4005
4005
|
LineChart.displayName = "LineChart";
|
|
4006
4006
|
|
|
4007
4007
|
// src/events/list/event-list.utils.ts
|
|
4008
|
-
var import_hooks8 = require("@agg-build/hooks");
|
|
4009
|
-
var import_sdk = require("@agg-build/sdk");
|
|
4010
|
-
|
|
4011
|
-
// src/events/item/event-list-item.utils.ts
|
|
4012
4008
|
var import_hooks7 = require("@agg-build/hooks");
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
const trimmedValue = value.trim();
|
|
4018
|
-
return trimmedValue ? trimmedValue : void 0;
|
|
4019
|
-
};
|
|
4020
|
-
var addGraphEdge = (adjacencyById, fromMarketId, toMarketId) => {
|
|
4021
|
-
var _a, _b;
|
|
4022
|
-
if (fromMarketId === toMarketId) return;
|
|
4023
|
-
const fromNeighbors = (_a = adjacencyById.get(fromMarketId)) != null ? _a : /* @__PURE__ */ new Set();
|
|
4024
|
-
fromNeighbors.add(toMarketId);
|
|
4025
|
-
adjacencyById.set(fromMarketId, fromNeighbors);
|
|
4026
|
-
const toNeighbors = (_b = adjacencyById.get(toMarketId)) != null ? _b : /* @__PURE__ */ new Set();
|
|
4027
|
-
toNeighbors.add(fromMarketId);
|
|
4028
|
-
adjacencyById.set(toMarketId, toNeighbors);
|
|
4029
|
-
};
|
|
4030
|
-
var dedupeSourceMarketsById = (markets) => {
|
|
4031
|
-
const seenMarketIds = /* @__PURE__ */ new Set();
|
|
4032
|
-
return markets.filter((market) => {
|
|
4033
|
-
if (seenMarketIds.has(market.id)) {
|
|
4034
|
-
return false;
|
|
4035
|
-
}
|
|
4036
|
-
seenMarketIds.add(market.id);
|
|
4037
|
-
return true;
|
|
4038
|
-
});
|
|
4039
|
-
};
|
|
4040
|
-
var collectDirectRelationMarkets = (market) => {
|
|
4041
|
-
var _a, _b, _c;
|
|
4042
|
-
const relationMarkets = [];
|
|
4043
|
-
const seenRelationIds = /* @__PURE__ */ new Set();
|
|
4044
|
-
const addRelationMarket = (relationMarket) => {
|
|
4045
|
-
if (!relationMarket) return;
|
|
4046
|
-
if (seenRelationIds.has(relationMarket.id)) return;
|
|
4047
|
-
seenRelationIds.add(relationMarket.id);
|
|
4048
|
-
relationMarkets.push(relationMarket);
|
|
4049
|
-
};
|
|
4050
|
-
for (const matchedVenueMarket of (_a = market.matchedVenueMarkets) != null ? _a : []) {
|
|
4051
|
-
addRelationMarket(matchedVenueMarket);
|
|
4009
|
+
var import_sdk = require("@agg-build/sdk");
|
|
4010
|
+
var resolveEventVolume = (event) => {
|
|
4011
|
+
if (typeof event.volume === "number" && Number.isFinite(event.volume)) {
|
|
4012
|
+
return event.volume;
|
|
4052
4013
|
}
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4014
|
+
return event.venueMarkets.reduce((maxVolume, market) => {
|
|
4015
|
+
if (typeof market.volume !== "number" || !Number.isFinite(market.volume)) {
|
|
4016
|
+
return maxVolume;
|
|
4017
|
+
}
|
|
4018
|
+
return Math.max(maxVolume, market.volume);
|
|
4019
|
+
}, -1);
|
|
4057
4020
|
};
|
|
4058
|
-
var
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4021
|
+
var sortEventsByVolumeDesc = (events, sortEventsBy) => {
|
|
4022
|
+
return events.map((event, index) => ({
|
|
4023
|
+
event,
|
|
4024
|
+
index,
|
|
4025
|
+
volume: resolveEventVolume(event)
|
|
4026
|
+
})).sort((left, right) => {
|
|
4027
|
+
if (sortEventsBy === "volume") {
|
|
4028
|
+
if (left.volume !== right.volume) {
|
|
4029
|
+
return right.volume - left.volume;
|
|
4064
4030
|
}
|
|
4065
|
-
relatedMarketsById.set(relatedMarket.id, relatedMarket);
|
|
4066
4031
|
}
|
|
4067
|
-
|
|
4068
|
-
|
|
4032
|
+
return left.index - right.index;
|
|
4033
|
+
}).map(({ event }) => event);
|
|
4069
4034
|
};
|
|
4070
|
-
var
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
const orderedSourceMarkets = dedupeSourceMarketsById(markets);
|
|
4074
|
-
const sourceMarketsById = new Map(orderedSourceMarkets.map((market) => [market.id, market]));
|
|
4075
|
-
const orderedRelatedMarkets = collectUniqueRelatedMarkets(
|
|
4076
|
-
orderedSourceMarkets,
|
|
4077
|
-
sourceMarketsById
|
|
4035
|
+
var resolveEventLifecycle = (event) => {
|
|
4036
|
+
const hasOpenMarket = event.venueMarkets.some(
|
|
4037
|
+
(market) => !market.status || market.status === import_hooks7.MarketStatus.open
|
|
4078
4038
|
);
|
|
4079
|
-
|
|
4080
|
-
const
|
|
4081
|
-
|
|
4082
|
-
return [...orderedSourceMarkets, ...orderedRelatedMarkets];
|
|
4083
|
-
}
|
|
4084
|
-
const adjacencyById = /* @__PURE__ */ new Map();
|
|
4085
|
-
for (const market of orderedSourceMarkets) {
|
|
4086
|
-
for (const relatedMarket of collectDirectRelationMarkets(market)) {
|
|
4087
|
-
addGraphEdge(adjacencyById, market.id, relatedMarket.id);
|
|
4088
|
-
}
|
|
4089
|
-
const targetVenueMarketId = toNonEmptyString((_a = market.matchEntry) == null ? void 0 : _a.targetVenueMarketId);
|
|
4090
|
-
if (targetVenueMarketId) {
|
|
4091
|
-
addGraphEdge(adjacencyById, market.id, targetVenueMarketId);
|
|
4092
|
-
}
|
|
4093
|
-
}
|
|
4094
|
-
if (!sourceMarketsById.has(resolvedSelectedMarketId) && !relatedMarketsById.has(resolvedSelectedMarketId)) {
|
|
4095
|
-
return [];
|
|
4096
|
-
}
|
|
4097
|
-
const visitedMarketIds = /* @__PURE__ */ new Set();
|
|
4098
|
-
const queue = [resolvedSelectedMarketId];
|
|
4099
|
-
while (queue.length > 0) {
|
|
4100
|
-
const currentMarketId = queue.shift();
|
|
4101
|
-
if (!currentMarketId || visitedMarketIds.has(currentMarketId)) {
|
|
4102
|
-
continue;
|
|
4103
|
-
}
|
|
4104
|
-
visitedMarketIds.add(currentMarketId);
|
|
4105
|
-
const neighborMarketIds = adjacencyById.get(currentMarketId);
|
|
4106
|
-
for (const neighborMarketId of Array.from(neighborMarketIds != null ? neighborMarketIds : /* @__PURE__ */ new Set())) {
|
|
4107
|
-
if (!visitedMarketIds.has(neighborMarketId)) {
|
|
4108
|
-
queue.push(neighborMarketId);
|
|
4109
|
-
}
|
|
4110
|
-
}
|
|
4111
|
-
}
|
|
4112
|
-
const orderedClusterMarkets = [];
|
|
4113
|
-
const appendedMarketIds = /* @__PURE__ */ new Set();
|
|
4114
|
-
const appendMarket = (market) => {
|
|
4115
|
-
if (!market) return;
|
|
4116
|
-
if (!visitedMarketIds.has(market.id)) return;
|
|
4117
|
-
if (appendedMarketIds.has(market.id)) return;
|
|
4118
|
-
appendedMarketIds.add(market.id);
|
|
4119
|
-
orderedClusterMarkets.push(market);
|
|
4120
|
-
};
|
|
4121
|
-
appendMarket(
|
|
4122
|
-
(_b = sourceMarketsById.get(resolvedSelectedMarketId)) != null ? _b : relatedMarketsById.get(resolvedSelectedMarketId)
|
|
4039
|
+
if (hasOpenMarket) return "open";
|
|
4040
|
+
const hasUpcomingMarket = event.venueMarkets.some(
|
|
4041
|
+
(market) => market.status === import_hooks7.MarketStatus.unopened
|
|
4123
4042
|
);
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
return
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
// src/events/item/event-list-item.utils.ts
|
|
4134
|
-
var resolveEventListItemEvent = (fetchedEvent) => {
|
|
4135
|
-
if (!fetchedEvent) return void 0;
|
|
4136
|
-
if (!fetchedEvent.venueMarkets || fetchedEvent.venueMarkets.length === 0) return void 0;
|
|
4137
|
-
return fetchedEvent;
|
|
4138
|
-
};
|
|
4139
|
-
var normalizeProbability = (value) => {
|
|
4140
|
-
if (typeof value !== "number" || !Number.isFinite(value)) return void 0;
|
|
4141
|
-
if (value < 0) return 0;
|
|
4142
|
-
if (value > 1) return 1;
|
|
4143
|
-
return value;
|
|
4043
|
+
if (hasUpcomingMarket) return "upcoming";
|
|
4044
|
+
const hasResolvedMarket = event.venueMarkets.some(
|
|
4045
|
+
(market) => market.status === import_hooks7.MarketStatus.resolved
|
|
4046
|
+
);
|
|
4047
|
+
if (hasResolvedMarket) return "resolved";
|
|
4048
|
+
if (event.status === import_hooks7.MarketStatus.open) return "open";
|
|
4049
|
+
if (event.status === import_hooks7.MarketStatus.unopened) return "upcoming";
|
|
4050
|
+
if (event.status === import_hooks7.MarketStatus.resolved) return "resolved";
|
|
4051
|
+
return "ignore";
|
|
4144
4052
|
};
|
|
4145
|
-
var
|
|
4146
|
-
|
|
4053
|
+
var splitEventsByLifecycle = (events) => {
|
|
4054
|
+
const groupedEvents = events.reduce(
|
|
4055
|
+
(grouped, event) => {
|
|
4056
|
+
const lifecycle = resolveEventLifecycle(event);
|
|
4057
|
+
if (lifecycle === "ignore") return grouped;
|
|
4058
|
+
grouped[lifecycle].push(event);
|
|
4059
|
+
return grouped;
|
|
4060
|
+
},
|
|
4061
|
+
{
|
|
4062
|
+
open: [],
|
|
4063
|
+
upcoming: [],
|
|
4064
|
+
resolved: []
|
|
4065
|
+
}
|
|
4066
|
+
);
|
|
4067
|
+
return {
|
|
4068
|
+
open: sortEventsByVolumeDesc(groupedEvents.open),
|
|
4069
|
+
upcoming: sortEventsByVolumeDesc(groupedEvents.upcoming),
|
|
4070
|
+
resolved: sortEventsByVolumeDesc(groupedEvents.resolved)
|
|
4071
|
+
};
|
|
4147
4072
|
};
|
|
4148
|
-
var
|
|
4149
|
-
|
|
4073
|
+
var mapEventToEventListItemEvent = (event) => {
|
|
4074
|
+
if (!event.venueMarkets || event.venueMarkets.length === 0) return null;
|
|
4075
|
+
return event;
|
|
4150
4076
|
};
|
|
4151
|
-
var
|
|
4152
|
-
|
|
4153
|
-
var hasBinaryOutcomes = (outcomes) => {
|
|
4154
|
-
return outcomes.some((o) => isYesLabel(o.label)) && outcomes.some((o) => isNoLabel(o.label));
|
|
4077
|
+
var filterEventsByTabValue = (events, _tabValue) => {
|
|
4078
|
+
return events;
|
|
4155
4079
|
};
|
|
4156
|
-
var
|
|
4157
|
-
return [...
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
return 0;
|
|
4080
|
+
var sortCategoriesForNavigation = (categories) => {
|
|
4081
|
+
return [...categories].sort((left, right) => {
|
|
4082
|
+
const leftIsOther = left.name.trim().toLowerCase() === "other";
|
|
4083
|
+
const rightIsOther = right.name.trim().toLowerCase() === "other";
|
|
4084
|
+
if (leftIsOther === rightIsOther) return 0;
|
|
4085
|
+
return leftIsOther ? 1 : -1;
|
|
4161
4086
|
});
|
|
4162
4087
|
};
|
|
4163
|
-
var
|
|
4164
|
-
return market.venueMarketOutcomes.find((outcome) => isYesLabel(outcome.label));
|
|
4165
|
-
};
|
|
4166
|
-
var resolveYesOutcomeProbability = (market) => {
|
|
4088
|
+
var resolveCategoryIdsFromPath = (path, fallbackCategoryIds) => {
|
|
4167
4089
|
var _a;
|
|
4168
|
-
|
|
4090
|
+
const deepest = (_a = path[path.length - 1]) == null ? void 0 : _a.id;
|
|
4091
|
+
if (deepest) return [deepest];
|
|
4092
|
+
return fallbackCategoryIds;
|
|
4169
4093
|
};
|
|
4170
|
-
var
|
|
4171
|
-
const
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
return
|
|
4094
|
+
var resolveTabVenus = (tab, visibleVenues) => {
|
|
4095
|
+
const applyAllowList = (venues) => {
|
|
4096
|
+
if (!venues) {
|
|
4097
|
+
return visibleVenues && visibleVenues.length > 0 ? visibleVenues : void 0;
|
|
4098
|
+
}
|
|
4099
|
+
if (!visibleVenues) return venues;
|
|
4100
|
+
const filtered = venues.filter((v) => visibleVenues.includes(v));
|
|
4101
|
+
return filtered.length > 0 ? filtered : void 0;
|
|
4102
|
+
};
|
|
4103
|
+
if (!tab) return applyAllowList(void 0);
|
|
4104
|
+
if (tab.venues && tab.venues.length > 0) return applyAllowList(tab.venues);
|
|
4105
|
+
if (import_sdk.VENUES.includes(tab.value)) {
|
|
4106
|
+
return applyAllowList([tab.value]);
|
|
4176
4107
|
}
|
|
4177
|
-
return
|
|
4108
|
+
return applyAllowList(void 0);
|
|
4178
4109
|
};
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
var
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
const bPrice = (_b = normalizeProbability(b.price)) != null ? _b : 0;
|
|
4203
|
-
return bPrice - aPrice;
|
|
4204
|
-
});
|
|
4205
|
-
};
|
|
4206
|
-
var dedupeVenueMarketsById = (venueMarkets) => {
|
|
4207
|
-
const seenClusterIds = /* @__PURE__ */ new Set();
|
|
4208
|
-
return venueMarkets.filter((venueMarket) => {
|
|
4209
|
-
var _a;
|
|
4210
|
-
if (seenClusterIds.has(venueMarket.id)) {
|
|
4211
|
-
return false;
|
|
4212
|
-
}
|
|
4213
|
-
seenClusterIds.add(venueMarket.id);
|
|
4214
|
-
for (const sibling of (_a = venueMarket.matchedVenueMarkets) != null ? _a : []) {
|
|
4215
|
-
seenClusterIds.add(sibling.id);
|
|
4216
|
-
}
|
|
4217
|
-
return true;
|
|
4218
|
-
});
|
|
4219
|
-
};
|
|
4220
|
-
var resolveOutcomeTitle = (outcome) => {
|
|
4221
|
-
var _a, _b;
|
|
4222
|
-
return (_b = (_a = outcome == null ? void 0 : outcome.title) != null ? _a : outcome == null ? void 0 : outcome.label) == null ? void 0 : _b.trim();
|
|
4223
|
-
};
|
|
4224
|
-
var selectPrimaryVenueMarket = (venueMarkets) => {
|
|
4225
|
-
if (venueMarkets.length === 0) return void 0;
|
|
4226
|
-
if (venueMarkets.length === 1) return venueMarkets[0];
|
|
4227
|
-
return [...venueMarkets].sort((a, b) => {
|
|
4228
|
-
const aVolume = typeof a.volume === "number" ? a.volume : -1;
|
|
4229
|
-
const bVolume = typeof b.volume === "number" ? b.volume : -1;
|
|
4230
|
-
return bVolume - aVolume;
|
|
4231
|
-
})[0];
|
|
4232
|
-
};
|
|
4233
|
-
var getVenueSummary = (venueMarkets, options) => {
|
|
4234
|
-
const normalizedVenueMarkets = normalizeVenueMarketCluster(venueMarkets);
|
|
4235
|
-
const tradableVenues = options == null ? void 0 : options.tradableVenues;
|
|
4236
|
-
const isVenueTradable = (venue) => {
|
|
4237
|
-
if (tradableVenues == null) return true;
|
|
4238
|
-
return tradableVenues.has(venue);
|
|
4239
|
-
};
|
|
4240
|
-
const uniqueVenues = Array.from(
|
|
4241
|
-
new Set(
|
|
4242
|
-
normalizedVenueMarkets.filter((market) => isVenueTradable(market.venue)).map((market) => market.venue)
|
|
4243
|
-
)
|
|
4244
|
-
);
|
|
4245
|
-
return {
|
|
4246
|
-
marketCount: normalizedVenueMarkets.length,
|
|
4247
|
-
venueCount: uniqueVenues.length,
|
|
4248
|
-
singleVenue: uniqueVenues.length === 1 ? uniqueVenues[0] : void 0
|
|
4249
|
-
};
|
|
4250
|
-
};
|
|
4251
|
-
var resolveVenueLabel = (venue, venueInfo, labels) => {
|
|
4252
|
-
var _a, _b;
|
|
4253
|
-
if (!venue) return labels.eventItem.venueSingular;
|
|
4254
|
-
return (_b = (_a = venueInfo == null ? void 0 : venueInfo[venue]) == null ? void 0 : _a.label) != null ? _b : labels.venues[venue];
|
|
4255
|
-
};
|
|
4256
|
-
var resolveDisplayVolume = (eventVolume, venueMarkets) => {
|
|
4257
|
-
if (typeof eventVolume === "number" && eventVolume > 0) return eventVolume;
|
|
4258
|
-
const clusterMarkets = normalizeVenueMarketCluster(venueMarkets);
|
|
4259
|
-
const marketSum = clusterMarkets.reduce(
|
|
4260
|
-
(acc, m) => acc + (typeof m.volume === "number" ? m.volume : 0),
|
|
4261
|
-
0
|
|
4262
|
-
);
|
|
4263
|
-
if (marketSum > 0) return marketSum;
|
|
4264
|
-
return void 0;
|
|
4265
|
-
};
|
|
4266
|
-
|
|
4267
|
-
// src/events/list/event-list.utils.ts
|
|
4268
|
-
var resolveEventVolume = (event) => {
|
|
4269
|
-
if (typeof event.volume === "number" && Number.isFinite(event.volume)) {
|
|
4270
|
-
return event.volume;
|
|
4271
|
-
}
|
|
4272
|
-
return event.venueMarkets.reduce((maxVolume, market) => {
|
|
4273
|
-
if (typeof market.volume !== "number" || !Number.isFinite(market.volume)) {
|
|
4274
|
-
return maxVolume;
|
|
4275
|
-
}
|
|
4276
|
-
return Math.max(maxVolume, market.volume);
|
|
4277
|
-
}, -1);
|
|
4278
|
-
};
|
|
4279
|
-
var sortEventsByVolumeDesc = (events, sortEventsBy) => {
|
|
4280
|
-
return events.map((event, index) => ({
|
|
4281
|
-
event,
|
|
4282
|
-
index,
|
|
4283
|
-
volume: resolveEventVolume(event)
|
|
4284
|
-
})).sort((left, right) => {
|
|
4285
|
-
if (sortEventsBy === "volume") {
|
|
4286
|
-
if (left.volume !== right.volume) {
|
|
4287
|
-
return right.volume - left.volume;
|
|
4288
|
-
}
|
|
4289
|
-
}
|
|
4290
|
-
return left.index - right.index;
|
|
4291
|
-
}).map(({ event }) => event);
|
|
4292
|
-
};
|
|
4293
|
-
var resolveEventLifecycle = (event) => {
|
|
4294
|
-
const hasOpenMarket = event.venueMarkets.some(
|
|
4295
|
-
(market) => !market.status || market.status === import_hooks8.MarketStatus.open
|
|
4296
|
-
);
|
|
4297
|
-
if (hasOpenMarket) return "open";
|
|
4298
|
-
const hasUpcomingMarket = event.venueMarkets.some(
|
|
4299
|
-
(market) => market.status === import_hooks8.MarketStatus.unopened
|
|
4300
|
-
);
|
|
4301
|
-
if (hasUpcomingMarket) return "upcoming";
|
|
4302
|
-
const hasResolvedMarket = event.venueMarkets.some(
|
|
4303
|
-
(market) => market.status === import_hooks8.MarketStatus.resolved
|
|
4304
|
-
);
|
|
4305
|
-
if (hasResolvedMarket) return "resolved";
|
|
4306
|
-
if (event.status === import_hooks8.MarketStatus.open) return "open";
|
|
4307
|
-
if (event.status === import_hooks8.MarketStatus.unopened) return "upcoming";
|
|
4308
|
-
if (event.status === import_hooks8.MarketStatus.resolved) return "resolved";
|
|
4309
|
-
return "ignore";
|
|
4310
|
-
};
|
|
4311
|
-
var splitEventsByLifecycle = (events) => {
|
|
4312
|
-
const groupedEvents = events.reduce(
|
|
4313
|
-
(grouped, event) => {
|
|
4314
|
-
const lifecycle = resolveEventLifecycle(event);
|
|
4315
|
-
if (lifecycle === "ignore") return grouped;
|
|
4316
|
-
grouped[lifecycle].push(event);
|
|
4317
|
-
return grouped;
|
|
4318
|
-
},
|
|
4319
|
-
{
|
|
4320
|
-
open: [],
|
|
4321
|
-
upcoming: [],
|
|
4322
|
-
resolved: []
|
|
4323
|
-
}
|
|
4324
|
-
);
|
|
4325
|
-
return {
|
|
4326
|
-
open: sortEventsByVolumeDesc(groupedEvents.open),
|
|
4327
|
-
upcoming: sortEventsByVolumeDesc(groupedEvents.upcoming),
|
|
4328
|
-
resolved: sortEventsByVolumeDesc(groupedEvents.resolved)
|
|
4329
|
-
};
|
|
4330
|
-
};
|
|
4331
|
-
var mapEventToEventListItemEvent = (event) => {
|
|
4332
|
-
if (!event.venueMarkets || event.venueMarkets.length === 0) return null;
|
|
4333
|
-
return event;
|
|
4334
|
-
};
|
|
4335
|
-
var filterEventsByTabValue = (events, _tabValue) => {
|
|
4336
|
-
return events;
|
|
4337
|
-
};
|
|
4338
|
-
var sortMarketsByYesOddsDesc = (markets) => {
|
|
4339
|
-
return markets.map((market, index) => ({
|
|
4340
|
-
market,
|
|
4341
|
-
index,
|
|
4342
|
-
yesProbability: resolveYesOutcomeProbability(market)
|
|
4343
|
-
})).sort((left, right) => {
|
|
4344
|
-
const leftHasYesProbability = left.yesProbability != null;
|
|
4345
|
-
const rightHasYesProbability = right.yesProbability != null;
|
|
4346
|
-
if (leftHasYesProbability !== rightHasYesProbability) {
|
|
4347
|
-
return leftHasYesProbability ? -1 : 1;
|
|
4348
|
-
}
|
|
4349
|
-
if (left.yesProbability != null && right.yesProbability != null) {
|
|
4350
|
-
if (left.yesProbability !== right.yesProbability) {
|
|
4351
|
-
return right.yesProbability - left.yesProbability;
|
|
4352
|
-
}
|
|
4353
|
-
}
|
|
4354
|
-
return left.index - right.index;
|
|
4355
|
-
}).map(({ market }) => market);
|
|
4356
|
-
};
|
|
4357
|
-
var resolveMarketVolume = (market) => {
|
|
4358
|
-
if (typeof market.volume !== "number") return 0;
|
|
4359
|
-
if (!Number.isFinite(market.volume)) return 0;
|
|
4360
|
-
return market.volume;
|
|
4361
|
-
};
|
|
4362
|
-
var sortMarketsByVolumeDesc = (markets) => {
|
|
4363
|
-
return markets.map((market, index) => ({
|
|
4364
|
-
market,
|
|
4365
|
-
index,
|
|
4366
|
-
volume: resolveMarketVolume(market)
|
|
4367
|
-
})).sort((left, right) => {
|
|
4368
|
-
if (left.volume !== right.volume) {
|
|
4369
|
-
return right.volume - left.volume;
|
|
4370
|
-
}
|
|
4371
|
-
return left.index - right.index;
|
|
4372
|
-
}).map(({ market }) => market);
|
|
4373
|
-
};
|
|
4374
|
-
var sortCategoriesForNavigation = (categories) => {
|
|
4375
|
-
return [...categories].sort((left, right) => {
|
|
4376
|
-
const leftIsOther = left.name.trim().toLowerCase() === "other";
|
|
4377
|
-
const rightIsOther = right.name.trim().toLowerCase() === "other";
|
|
4378
|
-
if (leftIsOther === rightIsOther) return 0;
|
|
4379
|
-
return leftIsOther ? 1 : -1;
|
|
4380
|
-
});
|
|
4381
|
-
};
|
|
4382
|
-
var resolveCategoryIdsFromPath = (path, fallbackCategoryIds) => {
|
|
4383
|
-
var _a;
|
|
4384
|
-
const deepest = (_a = path[path.length - 1]) == null ? void 0 : _a.id;
|
|
4385
|
-
if (deepest) return [deepest];
|
|
4386
|
-
return fallbackCategoryIds;
|
|
4387
|
-
};
|
|
4388
|
-
var resolveTabVenus = (tab, visibleVenues) => {
|
|
4389
|
-
const applyAllowList = (venues) => {
|
|
4390
|
-
if (!venues) {
|
|
4391
|
-
return visibleVenues && visibleVenues.length > 0 ? visibleVenues : void 0;
|
|
4392
|
-
}
|
|
4393
|
-
if (!visibleVenues) return venues;
|
|
4394
|
-
const filtered = venues.filter((v) => visibleVenues.includes(v));
|
|
4395
|
-
return filtered.length > 0 ? filtered : void 0;
|
|
4396
|
-
};
|
|
4397
|
-
if (!tab) return applyAllowList(void 0);
|
|
4398
|
-
if (tab.venues && tab.venues.length > 0) return applyAllowList(tab.venues);
|
|
4399
|
-
if (import_sdk.VENUES.includes(tab.value)) {
|
|
4400
|
-
return applyAllowList([tab.value]);
|
|
4401
|
-
}
|
|
4402
|
-
return applyAllowList(void 0);
|
|
4403
|
-
};
|
|
4404
|
-
|
|
4405
|
-
// src/primitives/remote-image/index.tsx
|
|
4406
|
-
var import_hooks10 = require("@agg-build/hooks");
|
|
4407
|
-
var import_react4 = require("react");
|
|
4408
|
-
|
|
4409
|
-
// src/primitives/skeleton/skeleton-block.tsx
|
|
4410
|
-
var import_hooks9 = require("@agg-build/hooks");
|
|
4411
|
-
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
4412
|
-
var SkeletonBlock = ({ className }) => {
|
|
4413
|
-
const {
|
|
4414
|
-
features: { enableAnimations }
|
|
4415
|
-
} = (0, import_hooks9.useSdkUiConfig)();
|
|
4416
|
-
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4417
|
-
"div",
|
|
4418
|
-
{
|
|
4419
|
-
"aria-hidden": true,
|
|
4420
|
-
className: cn(
|
|
4421
|
-
"bg-agg-separator",
|
|
4422
|
-
getMotionClassName(enableAnimations, "animate-pulse"),
|
|
4423
|
-
className
|
|
4424
|
-
)
|
|
4425
|
-
}
|
|
4426
|
-
);
|
|
4110
|
+
|
|
4111
|
+
// src/primitives/remote-image/index.tsx
|
|
4112
|
+
var import_hooks9 = require("@agg-build/hooks");
|
|
4113
|
+
var import_react4 = require("react");
|
|
4114
|
+
|
|
4115
|
+
// src/primitives/skeleton/skeleton-block.tsx
|
|
4116
|
+
var import_hooks8 = require("@agg-build/hooks");
|
|
4117
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
4118
|
+
var SkeletonBlock = ({ className }) => {
|
|
4119
|
+
const {
|
|
4120
|
+
features: { enableAnimations }
|
|
4121
|
+
} = (0, import_hooks8.useSdkUiConfig)();
|
|
4122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4123
|
+
"div",
|
|
4124
|
+
{
|
|
4125
|
+
"aria-hidden": true,
|
|
4126
|
+
className: cn(
|
|
4127
|
+
"bg-agg-separator",
|
|
4128
|
+
getMotionClassName(enableAnimations, "animate-pulse"),
|
|
4129
|
+
className
|
|
4130
|
+
)
|
|
4131
|
+
}
|
|
4132
|
+
);
|
|
4427
4133
|
};
|
|
4428
4134
|
SkeletonBlock.displayName = "SkeletonBlock";
|
|
4429
4135
|
|
|
@@ -4456,7 +4162,7 @@ var RemoteImage = ({
|
|
|
4456
4162
|
}) => {
|
|
4457
4163
|
const {
|
|
4458
4164
|
general: { theme }
|
|
4459
|
-
} = (0,
|
|
4165
|
+
} = (0, import_hooks9.useSdkUiConfig)();
|
|
4460
4166
|
const isDarkTheme = theme === "dark";
|
|
4461
4167
|
const [status, setStatus] = (0, import_react4.useState)(
|
|
4462
4168
|
() => resolveRemoteImageStatusFromSrc(src)
|
|
@@ -4530,17 +4236,17 @@ var RemoteImage = ({
|
|
|
4530
4236
|
RemoteImage.displayName = "RemoteImage";
|
|
4531
4237
|
|
|
4532
4238
|
// src/primitives/skeleton/views/event-list-skeleton-view.tsx
|
|
4533
|
-
var
|
|
4239
|
+
var import_hooks11 = require("@agg-build/hooks");
|
|
4534
4240
|
|
|
4535
4241
|
// src/primitives/skeleton/views/event-list-item-skeleton-view.tsx
|
|
4536
|
-
var
|
|
4242
|
+
var import_hooks10 = require("@agg-build/hooks");
|
|
4537
4243
|
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
4538
4244
|
var EventListItemSkeletonView = ({
|
|
4539
4245
|
className,
|
|
4540
4246
|
ariaLabel,
|
|
4541
4247
|
isStandalone = false
|
|
4542
4248
|
}) => {
|
|
4543
|
-
const labels = (0,
|
|
4249
|
+
const labels = (0, import_hooks10.useLabels)();
|
|
4544
4250
|
const outcomeTitleWidths = ["max-w-40", "max-w-[200px]"];
|
|
4545
4251
|
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
|
|
4546
4252
|
Card,
|
|
@@ -4606,7 +4312,7 @@ var EventListSkeletonView = ({
|
|
|
4606
4312
|
ariaLabel,
|
|
4607
4313
|
withSidebar
|
|
4608
4314
|
}) => {
|
|
4609
|
-
const labels = (0,
|
|
4315
|
+
const labels = (0, import_hooks11.useLabels)();
|
|
4610
4316
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
|
|
4611
4317
|
"section",
|
|
4612
4318
|
{
|
|
@@ -4645,7 +4351,7 @@ var EventListSkeletonView = ({
|
|
|
4645
4351
|
EventListSkeletonView.displayName = "EventListSkeletonView";
|
|
4646
4352
|
|
|
4647
4353
|
// src/primitives/skeleton/views/event-list-item-details-skeleton-view.tsx
|
|
4648
|
-
var
|
|
4354
|
+
var import_hooks12 = require("@agg-build/hooks");
|
|
4649
4355
|
|
|
4650
4356
|
// src/events/item-details/event-list-item-details.constants.ts
|
|
4651
4357
|
var detailsBaseCardClassName = "w-full gap-6 p-5 md:gap-8";
|
|
@@ -4656,7 +4362,7 @@ var EventListItemDetailsSkeletonView = ({
|
|
|
4656
4362
|
className,
|
|
4657
4363
|
ariaLabel
|
|
4658
4364
|
}) => {
|
|
4659
|
-
const labels = (0,
|
|
4365
|
+
const labels = (0, import_hooks12.useLabels)();
|
|
4660
4366
|
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
|
|
4661
4367
|
Card,
|
|
4662
4368
|
{
|
|
@@ -4693,7 +4399,7 @@ var EventListItemDetailsSkeletonView = ({
|
|
|
4693
4399
|
EventListItemDetailsSkeletonView.displayName = "EventListItemDetailsSkeletonView";
|
|
4694
4400
|
|
|
4695
4401
|
// src/primitives/skeleton/views/market-details-skeleton-view.tsx
|
|
4696
|
-
var
|
|
4402
|
+
var import_hooks13 = require("@agg-build/hooks");
|
|
4697
4403
|
|
|
4698
4404
|
// src/events/market-details/market-details.constants.ts
|
|
4699
4405
|
var marketDetailsBaseCardClassName = "w-full overflow-hidden rounded-agg-lg border border-agg-separator bg-agg-secondary text-agg-foreground shadow-none hover:shadow-none";
|
|
@@ -4789,7 +4495,7 @@ var MarketDetailsSkeletonView = ({
|
|
|
4789
4495
|
ariaLabel,
|
|
4790
4496
|
isDetailed
|
|
4791
4497
|
}) => {
|
|
4792
|
-
const labels = (0,
|
|
4498
|
+
const labels = (0, import_hooks13.useLabels)();
|
|
4793
4499
|
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
|
|
4794
4500
|
Card,
|
|
4795
4501
|
{
|
|
@@ -4890,7 +4596,7 @@ var PlaceOrderSkeletonView = ({
|
|
|
4890
4596
|
PlaceOrderSkeletonView.displayName = "PlaceOrderSkeletonView";
|
|
4891
4597
|
|
|
4892
4598
|
// src/primitives/skeleton/views/search-skeleton-view.tsx
|
|
4893
|
-
var
|
|
4599
|
+
var import_hooks14 = require("@agg-build/hooks");
|
|
4894
4600
|
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
4895
4601
|
var SearchSkeletonRow = () => {
|
|
4896
4602
|
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "flex w-full items-center gap-6 px-5 py-4", children: [
|
|
@@ -4916,7 +4622,7 @@ var SearchSkeletonRow = () => {
|
|
|
4916
4622
|
] });
|
|
4917
4623
|
};
|
|
4918
4624
|
var SearchSkeletonView = ({ className, ariaLabel }) => {
|
|
4919
|
-
const labels = (0,
|
|
4625
|
+
const labels = (0, import_hooks14.useLabels)();
|
|
4920
4626
|
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
4921
4627
|
"div",
|
|
4922
4628
|
{
|
|
@@ -4938,13 +4644,13 @@ var SearchSkeletonView = ({ className, ariaLabel }) => {
|
|
|
4938
4644
|
SearchSkeletonView.displayName = "SearchSkeletonView";
|
|
4939
4645
|
|
|
4940
4646
|
// src/primitives/skeleton/views/settlement-skeleton-view.tsx
|
|
4941
|
-
var
|
|
4647
|
+
var import_hooks15 = require("@agg-build/hooks");
|
|
4942
4648
|
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
4943
4649
|
var SettlementSkeletonView = ({
|
|
4944
4650
|
className,
|
|
4945
4651
|
ariaLabel
|
|
4946
4652
|
}) => {
|
|
4947
|
-
const labels = (0,
|
|
4653
|
+
const labels = (0, import_hooks15.useLabels)();
|
|
4948
4654
|
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
4949
4655
|
Card,
|
|
4950
4656
|
{
|
|
@@ -5158,7 +4864,7 @@ var Skeleton = ({
|
|
|
5158
4864
|
Skeleton.displayName = "Skeleton";
|
|
5159
4865
|
|
|
5160
4866
|
// src/primitives/venue-logo/index.tsx
|
|
5161
|
-
var
|
|
4867
|
+
var import_hooks24 = require("@agg-build/hooks");
|
|
5162
4868
|
|
|
5163
4869
|
// src/primitives/venue-logo/venue-logo.constants.ts
|
|
5164
4870
|
var import_sdk10 = require("@agg-build/sdk");
|
|
@@ -5211,7 +4917,7 @@ var DefaultVenueIcon = (_a) => {
|
|
|
5211
4917
|
};
|
|
5212
4918
|
|
|
5213
4919
|
// src/primitives/venue-logo/svg/logo-hyperliquid.tsx
|
|
5214
|
-
var
|
|
4920
|
+
var import_hooks16 = require("@agg-build/hooks");
|
|
5215
4921
|
var import_sdk2 = require("@agg-build/sdk");
|
|
5216
4922
|
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
5217
4923
|
var LogoHyperliquidIcon = (_a) => {
|
|
@@ -5229,7 +4935,7 @@ var LogoHyperliquidIcon = (_a) => {
|
|
|
5229
4935
|
var _a2;
|
|
5230
4936
|
const {
|
|
5231
4937
|
general: { theme }
|
|
5232
|
-
} = (0,
|
|
4938
|
+
} = (0, import_hooks16.useAggUiConfig)();
|
|
5233
4939
|
const isDarkTheme = theme === "dark";
|
|
5234
4940
|
const primaryColor = resolveLogoPrimaryColor({
|
|
5235
4941
|
brandColor: (_a2 = resolveVenueLineColor(import_sdk2.Venue.hyperliquid, isDarkTheme)) != null ? _a2 : "#97FCE4",
|
|
@@ -5259,7 +4965,7 @@ var LogoHyperliquidIcon = (_a) => {
|
|
|
5259
4965
|
LogoHyperliquidIcon.displayName = "LogoHyperliquidIcon";
|
|
5260
4966
|
|
|
5261
4967
|
// src/primitives/venue-logo/svg/logo-kalshi.tsx
|
|
5262
|
-
var
|
|
4968
|
+
var import_hooks17 = require("@agg-build/hooks");
|
|
5263
4969
|
var import_sdk3 = require("@agg-build/sdk");
|
|
5264
4970
|
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
5265
4971
|
var LogoKalshiIcon = (_a) => {
|
|
@@ -5277,7 +4983,7 @@ var LogoKalshiIcon = (_a) => {
|
|
|
5277
4983
|
var _a2;
|
|
5278
4984
|
const {
|
|
5279
4985
|
general: { theme }
|
|
5280
|
-
} = (0,
|
|
4986
|
+
} = (0, import_hooks17.useAggUiConfig)();
|
|
5281
4987
|
const isDarkTheme = theme === "dark";
|
|
5282
4988
|
const primaryColor = resolveLogoPrimaryColor({
|
|
5283
4989
|
brandColor: (_a2 = resolveVenueLineColor(import_sdk3.Venue.kalshi, isDarkTheme)) != null ? _a2 : "#18C590",
|
|
@@ -5307,7 +5013,7 @@ var LogoKalshiIcon = (_a) => {
|
|
|
5307
5013
|
LogoKalshiIcon.displayName = "LogoKalshiIcon";
|
|
5308
5014
|
|
|
5309
5015
|
// src/primitives/venue-logo/svg/logo-limitless.tsx
|
|
5310
|
-
var
|
|
5016
|
+
var import_hooks18 = require("@agg-build/hooks");
|
|
5311
5017
|
var import_sdk4 = require("@agg-build/sdk");
|
|
5312
5018
|
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
5313
5019
|
var LogoLimitlessIcon = (_a) => {
|
|
@@ -5325,7 +5031,7 @@ var LogoLimitlessIcon = (_a) => {
|
|
|
5325
5031
|
var _a2;
|
|
5326
5032
|
const {
|
|
5327
5033
|
general: { theme }
|
|
5328
|
-
} = (0,
|
|
5034
|
+
} = (0, import_hooks18.useAggUiConfig)();
|
|
5329
5035
|
const isDarkTheme = theme === "dark";
|
|
5330
5036
|
const primaryColor = resolveLogoPrimaryColor({
|
|
5331
5037
|
brandColor: (_a2 = resolveVenueLineColor(import_sdk4.Venue.limitless, isDarkTheme)) != null ? _a2 : "#c4fe00",
|
|
@@ -5355,7 +5061,7 @@ var LogoLimitlessIcon = (_a) => {
|
|
|
5355
5061
|
LogoLimitlessIcon.displayName = "LogoLimitlessIcon";
|
|
5356
5062
|
|
|
5357
5063
|
// src/primitives/venue-logo/svg/logo-myriad.tsx
|
|
5358
|
-
var
|
|
5064
|
+
var import_hooks19 = require("@agg-build/hooks");
|
|
5359
5065
|
var import_sdk5 = require("@agg-build/sdk");
|
|
5360
5066
|
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
5361
5067
|
var LogoMyriadIcon = (_a) => {
|
|
@@ -5373,7 +5079,7 @@ var LogoMyriadIcon = (_a) => {
|
|
|
5373
5079
|
var _a2;
|
|
5374
5080
|
const {
|
|
5375
5081
|
general: { theme }
|
|
5376
|
-
} = (0,
|
|
5082
|
+
} = (0, import_hooks19.useAggUiConfig)();
|
|
5377
5083
|
const isDarkTheme = theme === "dark";
|
|
5378
5084
|
const primaryColor = resolveLogoPrimaryColor({
|
|
5379
5085
|
brandColor: (_a2 = resolveVenueLineColor(import_sdk5.Venue.myriad, isDarkTheme)) != null ? _a2 : "#2E5CFF",
|
|
@@ -5403,7 +5109,7 @@ var LogoMyriadIcon = (_a) => {
|
|
|
5403
5109
|
LogoMyriadIcon.displayName = "LogoMyriadIcon";
|
|
5404
5110
|
|
|
5405
5111
|
// src/primitives/venue-logo/svg/logo-opinion.tsx
|
|
5406
|
-
var
|
|
5112
|
+
var import_hooks20 = require("@agg-build/hooks");
|
|
5407
5113
|
var import_sdk6 = require("@agg-build/sdk");
|
|
5408
5114
|
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
5409
5115
|
var LogoOpinionIcon = (_a) => {
|
|
@@ -5421,7 +5127,7 @@ var LogoOpinionIcon = (_a) => {
|
|
|
5421
5127
|
var _a2;
|
|
5422
5128
|
const {
|
|
5423
5129
|
general: { theme }
|
|
5424
|
-
} = (0,
|
|
5130
|
+
} = (0, import_hooks20.useAggUiConfig)();
|
|
5425
5131
|
const isDarkTheme = theme === "dark";
|
|
5426
5132
|
const primaryColor = resolveLogoPrimaryColor({
|
|
5427
5133
|
brandColor: (_a2 = resolveVenueLineColor(import_sdk6.Venue.opinion, isDarkTheme)) != null ? _a2 : "#ec5e26",
|
|
@@ -5451,7 +5157,7 @@ var LogoOpinionIcon = (_a) => {
|
|
|
5451
5157
|
LogoOpinionIcon.displayName = "LogoOpinionIcon";
|
|
5452
5158
|
|
|
5453
5159
|
// src/primitives/venue-logo/svg/logo-polymarket.tsx
|
|
5454
|
-
var
|
|
5160
|
+
var import_hooks21 = require("@agg-build/hooks");
|
|
5455
5161
|
var import_sdk7 = require("@agg-build/sdk");
|
|
5456
5162
|
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
5457
5163
|
var LogoPolymarketIcon = (_a) => {
|
|
@@ -5469,7 +5175,7 @@ var LogoPolymarketIcon = (_a) => {
|
|
|
5469
5175
|
var _a2;
|
|
5470
5176
|
const {
|
|
5471
5177
|
general: { theme }
|
|
5472
|
-
} = (0,
|
|
5178
|
+
} = (0, import_hooks21.useAggUiConfig)();
|
|
5473
5179
|
const isDarkTheme = theme === "dark";
|
|
5474
5180
|
const primaryColor = resolveLogoPrimaryColor({
|
|
5475
5181
|
brandColor: (_a2 = resolveVenueLineColor(import_sdk7.Venue.polymarket, isDarkTheme)) != null ? _a2 : "#2E5CFF",
|
|
@@ -5499,7 +5205,7 @@ var LogoPolymarketIcon = (_a) => {
|
|
|
5499
5205
|
LogoPolymarketIcon.displayName = "LogoPolymarketIcon";
|
|
5500
5206
|
|
|
5501
5207
|
// src/primitives/venue-logo/svg/logo-predict.tsx
|
|
5502
|
-
var
|
|
5208
|
+
var import_hooks22 = require("@agg-build/hooks");
|
|
5503
5209
|
var import_sdk8 = require("@agg-build/sdk");
|
|
5504
5210
|
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
5505
5211
|
var LogoPredictIcon = (_a) => {
|
|
@@ -5517,7 +5223,7 @@ var LogoPredictIcon = (_a) => {
|
|
|
5517
5223
|
var _a2;
|
|
5518
5224
|
const {
|
|
5519
5225
|
general: { theme }
|
|
5520
|
-
} = (0,
|
|
5226
|
+
} = (0, import_hooks22.useAggUiConfig)();
|
|
5521
5227
|
const isDarkTheme = theme === "dark";
|
|
5522
5228
|
const primaryColor = resolveLogoPrimaryColor({
|
|
5523
5229
|
brandColor: (_a2 = resolveVenueLineColor(import_sdk8.Venue.predict, isDarkTheme)) != null ? _a2 : "#705bf6",
|
|
@@ -5549,7 +5255,7 @@ var LogoPredictIcon = (_a) => {
|
|
|
5549
5255
|
LogoPredictIcon.displayName = "LogoPredictIcon";
|
|
5550
5256
|
|
|
5551
5257
|
// src/primitives/venue-logo/svg/logo-probable.tsx
|
|
5552
|
-
var
|
|
5258
|
+
var import_hooks23 = require("@agg-build/hooks");
|
|
5553
5259
|
var import_sdk9 = require("@agg-build/sdk");
|
|
5554
5260
|
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
5555
5261
|
var LogoProbableIcon = (_a) => {
|
|
@@ -5567,7 +5273,7 @@ var LogoProbableIcon = (_a) => {
|
|
|
5567
5273
|
var _a2;
|
|
5568
5274
|
const {
|
|
5569
5275
|
general: { theme }
|
|
5570
|
-
} = (0,
|
|
5276
|
+
} = (0, import_hooks23.useAggUiConfig)();
|
|
5571
5277
|
const isDarkTheme = theme === "dark";
|
|
5572
5278
|
const primaryColor = resolveLogoPrimaryColor({
|
|
5573
5279
|
brandColor: (_a2 = resolveVenueLineColor(import_sdk9.Venue.probable, isDarkTheme)) != null ? _a2 : "#EC4899",
|
|
@@ -5715,7 +5421,7 @@ var VenueLogo = ({
|
|
|
5715
5421
|
title: title2
|
|
5716
5422
|
}) => {
|
|
5717
5423
|
var _a, _b;
|
|
5718
|
-
const labels = (0,
|
|
5424
|
+
const labels = (0, import_hooks24.useLabels)();
|
|
5719
5425
|
const sizeClass = sizeClasses2[size];
|
|
5720
5426
|
const resolvedLabel = resolveVenueLogoLabel({
|
|
5721
5427
|
ariaLabel,
|
|
@@ -5756,6 +5462,258 @@ var VenueLogo = ({
|
|
|
5756
5462
|
};
|
|
5757
5463
|
VenueLogo.displayName = "VenueLogo";
|
|
5758
5464
|
|
|
5465
|
+
// src/events/item/event-list-item.utils.ts
|
|
5466
|
+
var import_hooks25 = require("@agg-build/hooks");
|
|
5467
|
+
|
|
5468
|
+
// src/events/shared/venue-market-cluster.ts
|
|
5469
|
+
var toNonEmptyString = (value) => {
|
|
5470
|
+
if (typeof value !== "string") return void 0;
|
|
5471
|
+
const trimmedValue = value.trim();
|
|
5472
|
+
return trimmedValue ? trimmedValue : void 0;
|
|
5473
|
+
};
|
|
5474
|
+
var addGraphEdge = (adjacencyById, fromMarketId, toMarketId) => {
|
|
5475
|
+
var _a, _b;
|
|
5476
|
+
if (fromMarketId === toMarketId) return;
|
|
5477
|
+
const fromNeighbors = (_a = adjacencyById.get(fromMarketId)) != null ? _a : /* @__PURE__ */ new Set();
|
|
5478
|
+
fromNeighbors.add(toMarketId);
|
|
5479
|
+
adjacencyById.set(fromMarketId, fromNeighbors);
|
|
5480
|
+
const toNeighbors = (_b = adjacencyById.get(toMarketId)) != null ? _b : /* @__PURE__ */ new Set();
|
|
5481
|
+
toNeighbors.add(fromMarketId);
|
|
5482
|
+
adjacencyById.set(toMarketId, toNeighbors);
|
|
5483
|
+
};
|
|
5484
|
+
var dedupeSourceMarketsById = (markets) => {
|
|
5485
|
+
const seenMarketIds = /* @__PURE__ */ new Set();
|
|
5486
|
+
return markets.filter((market) => {
|
|
5487
|
+
if (seenMarketIds.has(market.id)) {
|
|
5488
|
+
return false;
|
|
5489
|
+
}
|
|
5490
|
+
seenMarketIds.add(market.id);
|
|
5491
|
+
return true;
|
|
5492
|
+
});
|
|
5493
|
+
};
|
|
5494
|
+
var collectDirectRelationMarkets = (market) => {
|
|
5495
|
+
var _a, _b, _c;
|
|
5496
|
+
const relationMarkets = [];
|
|
5497
|
+
const seenRelationIds = /* @__PURE__ */ new Set();
|
|
5498
|
+
const addRelationMarket = (relationMarket) => {
|
|
5499
|
+
if (!relationMarket) return;
|
|
5500
|
+
if (seenRelationIds.has(relationMarket.id)) return;
|
|
5501
|
+
seenRelationIds.add(relationMarket.id);
|
|
5502
|
+
relationMarkets.push(relationMarket);
|
|
5503
|
+
};
|
|
5504
|
+
for (const matchedVenueMarket of (_a = market.matchedVenueMarkets) != null ? _a : []) {
|
|
5505
|
+
addRelationMarket(matchedVenueMarket);
|
|
5506
|
+
}
|
|
5507
|
+
addRelationMarket(
|
|
5508
|
+
(_c = (_b = market.matchEntry) == null ? void 0 : _b.targetVenueMarket) != null ? _c : void 0
|
|
5509
|
+
);
|
|
5510
|
+
return relationMarkets;
|
|
5511
|
+
};
|
|
5512
|
+
var collectUniqueRelatedMarkets = (markets, sourceMarketsById) => {
|
|
5513
|
+
const relatedMarketsById = /* @__PURE__ */ new Map();
|
|
5514
|
+
for (const market of markets) {
|
|
5515
|
+
for (const relatedMarket of collectDirectRelationMarkets(market)) {
|
|
5516
|
+
if (sourceMarketsById.has(relatedMarket.id) || relatedMarketsById.has(relatedMarket.id)) {
|
|
5517
|
+
continue;
|
|
5518
|
+
}
|
|
5519
|
+
relatedMarketsById.set(relatedMarket.id, relatedMarket);
|
|
5520
|
+
}
|
|
5521
|
+
}
|
|
5522
|
+
return Array.from(relatedMarketsById.values());
|
|
5523
|
+
};
|
|
5524
|
+
var normalizeVenueMarketCluster = (markets, selectedMarketId) => {
|
|
5525
|
+
var _a, _b;
|
|
5526
|
+
if (markets.length === 0) return [];
|
|
5527
|
+
const orderedSourceMarkets = dedupeSourceMarketsById(markets);
|
|
5528
|
+
const sourceMarketsById = new Map(orderedSourceMarkets.map((market) => [market.id, market]));
|
|
5529
|
+
const orderedRelatedMarkets = collectUniqueRelatedMarkets(
|
|
5530
|
+
orderedSourceMarkets,
|
|
5531
|
+
sourceMarketsById
|
|
5532
|
+
);
|
|
5533
|
+
const relatedMarketsById = new Map(orderedRelatedMarkets.map((market) => [market.id, market]));
|
|
5534
|
+
const resolvedSelectedMarketId = toNonEmptyString(selectedMarketId);
|
|
5535
|
+
if (!resolvedSelectedMarketId) {
|
|
5536
|
+
return [...orderedSourceMarkets, ...orderedRelatedMarkets];
|
|
5537
|
+
}
|
|
5538
|
+
const adjacencyById = /* @__PURE__ */ new Map();
|
|
5539
|
+
for (const market of orderedSourceMarkets) {
|
|
5540
|
+
for (const relatedMarket of collectDirectRelationMarkets(market)) {
|
|
5541
|
+
addGraphEdge(adjacencyById, market.id, relatedMarket.id);
|
|
5542
|
+
}
|
|
5543
|
+
const targetVenueMarketId = toNonEmptyString((_a = market.matchEntry) == null ? void 0 : _a.targetVenueMarketId);
|
|
5544
|
+
if (targetVenueMarketId) {
|
|
5545
|
+
addGraphEdge(adjacencyById, market.id, targetVenueMarketId);
|
|
5546
|
+
}
|
|
5547
|
+
}
|
|
5548
|
+
if (!sourceMarketsById.has(resolvedSelectedMarketId) && !relatedMarketsById.has(resolvedSelectedMarketId)) {
|
|
5549
|
+
return [];
|
|
5550
|
+
}
|
|
5551
|
+
const visitedMarketIds = /* @__PURE__ */ new Set();
|
|
5552
|
+
const queue = [resolvedSelectedMarketId];
|
|
5553
|
+
while (queue.length > 0) {
|
|
5554
|
+
const currentMarketId = queue.shift();
|
|
5555
|
+
if (!currentMarketId || visitedMarketIds.has(currentMarketId)) {
|
|
5556
|
+
continue;
|
|
5557
|
+
}
|
|
5558
|
+
visitedMarketIds.add(currentMarketId);
|
|
5559
|
+
const neighborMarketIds = adjacencyById.get(currentMarketId);
|
|
5560
|
+
for (const neighborMarketId of Array.from(neighborMarketIds != null ? neighborMarketIds : /* @__PURE__ */ new Set())) {
|
|
5561
|
+
if (!visitedMarketIds.has(neighborMarketId)) {
|
|
5562
|
+
queue.push(neighborMarketId);
|
|
5563
|
+
}
|
|
5564
|
+
}
|
|
5565
|
+
}
|
|
5566
|
+
const orderedClusterMarkets = [];
|
|
5567
|
+
const appendedMarketIds = /* @__PURE__ */ new Set();
|
|
5568
|
+
const appendMarket = (market) => {
|
|
5569
|
+
if (!market) return;
|
|
5570
|
+
if (!visitedMarketIds.has(market.id)) return;
|
|
5571
|
+
if (appendedMarketIds.has(market.id)) return;
|
|
5572
|
+
appendedMarketIds.add(market.id);
|
|
5573
|
+
orderedClusterMarkets.push(market);
|
|
5574
|
+
};
|
|
5575
|
+
appendMarket(
|
|
5576
|
+
(_b = sourceMarketsById.get(resolvedSelectedMarketId)) != null ? _b : relatedMarketsById.get(resolvedSelectedMarketId)
|
|
5577
|
+
);
|
|
5578
|
+
for (const market of orderedSourceMarkets) {
|
|
5579
|
+
appendMarket(market);
|
|
5580
|
+
}
|
|
5581
|
+
for (const market of orderedRelatedMarkets) {
|
|
5582
|
+
appendMarket(market);
|
|
5583
|
+
}
|
|
5584
|
+
return orderedClusterMarkets;
|
|
5585
|
+
};
|
|
5586
|
+
|
|
5587
|
+
// src/events/item/event-list-item.utils.ts
|
|
5588
|
+
var resolveEventListItemEvent = (fetchedEvent) => {
|
|
5589
|
+
if (!fetchedEvent) return void 0;
|
|
5590
|
+
if (!fetchedEvent.venueMarkets || fetchedEvent.venueMarkets.length === 0) return void 0;
|
|
5591
|
+
return fetchedEvent;
|
|
5592
|
+
};
|
|
5593
|
+
var normalizeProbability = (value) => {
|
|
5594
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return void 0;
|
|
5595
|
+
if (value < 0) return 0;
|
|
5596
|
+
if (value > 1) return 1;
|
|
5597
|
+
return value;
|
|
5598
|
+
};
|
|
5599
|
+
var formatWholePercent = (value) => {
|
|
5600
|
+
return `${Math.round(value * 100)}%`;
|
|
5601
|
+
};
|
|
5602
|
+
var hasDateLabel = (outcome) => {
|
|
5603
|
+
return !!toDate(outcome.label);
|
|
5604
|
+
};
|
|
5605
|
+
var isYesLabel = (label2) => label2.trim().toLowerCase() === "yes";
|
|
5606
|
+
var isNoLabel = (label2) => label2.trim().toLowerCase() === "no";
|
|
5607
|
+
var hasBinaryOutcomes = (outcomes) => {
|
|
5608
|
+
return outcomes.some((o) => isYesLabel(o.label)) && outcomes.some((o) => isNoLabel(o.label));
|
|
5609
|
+
};
|
|
5610
|
+
var sortYesFirst = (outcomes) => {
|
|
5611
|
+
return [...outcomes].sort((a, b) => {
|
|
5612
|
+
if (isYesLabel(a.label) && !isYesLabel(b.label)) return -1;
|
|
5613
|
+
if (!isYesLabel(a.label) && isYesLabel(b.label)) return 1;
|
|
5614
|
+
return 0;
|
|
5615
|
+
});
|
|
5616
|
+
};
|
|
5617
|
+
var resolveYesOutcome = (market) => {
|
|
5618
|
+
return market.venueMarketOutcomes.find((outcome) => isYesLabel(outcome.label));
|
|
5619
|
+
};
|
|
5620
|
+
var formatMarketProbabilityPercent = (value, formatPercent = formatWholePercent) => {
|
|
5621
|
+
const probability = normalizeProbability(value);
|
|
5622
|
+
if (probability == null) return "-";
|
|
5623
|
+
const formattedValue = formatPercent(probability);
|
|
5624
|
+
if (probability > 0 && formattedValue === formatPercent(0)) {
|
|
5625
|
+
return "<1%";
|
|
5626
|
+
}
|
|
5627
|
+
return formattedValue;
|
|
5628
|
+
};
|
|
5629
|
+
var formatPriceGapPercent = (value) => {
|
|
5630
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return void 0;
|
|
5631
|
+
if (value < import_hooks25.MIN_PRICE_GAP_PCT) return void 0;
|
|
5632
|
+
if (value > import_hooks25.MAX_PRICE_GAP_PCT) return void 0;
|
|
5633
|
+
return `${Math.round(value)}%`;
|
|
5634
|
+
};
|
|
5635
|
+
var sortOutcomes = (outcomes) => {
|
|
5636
|
+
if (outcomes.length <= 1) return outcomes;
|
|
5637
|
+
if (hasBinaryOutcomes(outcomes)) {
|
|
5638
|
+
return sortYesFirst(outcomes);
|
|
5639
|
+
}
|
|
5640
|
+
const now = Date.now();
|
|
5641
|
+
if (outcomes.some(hasDateLabel)) {
|
|
5642
|
+
return [...outcomes].sort((a, b) => {
|
|
5643
|
+
var _a, _b, _c, _d;
|
|
5644
|
+
const aDate = (_b = (_a = toDate(a.label)) == null ? void 0 : _a.getTime()) != null ? _b : 0;
|
|
5645
|
+
const bDate = (_d = (_c = toDate(b.label)) == null ? void 0 : _c.getTime()) != null ? _d : 0;
|
|
5646
|
+
return Math.abs(aDate - now) - Math.abs(bDate - now);
|
|
5647
|
+
});
|
|
5648
|
+
}
|
|
5649
|
+
return [...outcomes].sort((a, b) => {
|
|
5650
|
+
var _a, _b;
|
|
5651
|
+
const aPrice = (_a = normalizeProbability(a.price)) != null ? _a : 0;
|
|
5652
|
+
const bPrice = (_b = normalizeProbability(b.price)) != null ? _b : 0;
|
|
5653
|
+
return bPrice - aPrice;
|
|
5654
|
+
});
|
|
5655
|
+
};
|
|
5656
|
+
var dedupeVenueMarketsById = (venueMarkets) => {
|
|
5657
|
+
const seenClusterIds = /* @__PURE__ */ new Set();
|
|
5658
|
+
return venueMarkets.filter((venueMarket) => {
|
|
5659
|
+
var _a;
|
|
5660
|
+
if (seenClusterIds.has(venueMarket.id)) {
|
|
5661
|
+
return false;
|
|
5662
|
+
}
|
|
5663
|
+
seenClusterIds.add(venueMarket.id);
|
|
5664
|
+
for (const sibling of (_a = venueMarket.matchedVenueMarkets) != null ? _a : []) {
|
|
5665
|
+
seenClusterIds.add(sibling.id);
|
|
5666
|
+
}
|
|
5667
|
+
return true;
|
|
5668
|
+
});
|
|
5669
|
+
};
|
|
5670
|
+
var resolveOutcomeTitle = (outcome) => {
|
|
5671
|
+
var _a, _b;
|
|
5672
|
+
return (_b = (_a = outcome == null ? void 0 : outcome.title) != null ? _a : outcome == null ? void 0 : outcome.label) == null ? void 0 : _b.trim();
|
|
5673
|
+
};
|
|
5674
|
+
var selectPrimaryVenueMarket = (venueMarkets) => {
|
|
5675
|
+
if (venueMarkets.length === 0) return void 0;
|
|
5676
|
+
if (venueMarkets.length === 1) return venueMarkets[0];
|
|
5677
|
+
return [...venueMarkets].sort((a, b) => {
|
|
5678
|
+
const aVolume = typeof a.volume === "number" ? a.volume : -1;
|
|
5679
|
+
const bVolume = typeof b.volume === "number" ? b.volume : -1;
|
|
5680
|
+
return bVolume - aVolume;
|
|
5681
|
+
})[0];
|
|
5682
|
+
};
|
|
5683
|
+
var getVenueSummary = (venueMarkets, options) => {
|
|
5684
|
+
const normalizedVenueMarkets = normalizeVenueMarketCluster(venueMarkets);
|
|
5685
|
+
const tradableVenues = options == null ? void 0 : options.tradableVenues;
|
|
5686
|
+
const isVenueTradable = (venue) => {
|
|
5687
|
+
if (tradableVenues == null) return true;
|
|
5688
|
+
return tradableVenues.has(venue);
|
|
5689
|
+
};
|
|
5690
|
+
const uniqueVenues = Array.from(
|
|
5691
|
+
new Set(
|
|
5692
|
+
normalizedVenueMarkets.filter((market) => isVenueTradable(market.venue)).map((market) => market.venue)
|
|
5693
|
+
)
|
|
5694
|
+
);
|
|
5695
|
+
return {
|
|
5696
|
+
marketCount: normalizedVenueMarkets.length,
|
|
5697
|
+
venueCount: uniqueVenues.length,
|
|
5698
|
+
singleVenue: uniqueVenues.length === 1 ? uniqueVenues[0] : void 0
|
|
5699
|
+
};
|
|
5700
|
+
};
|
|
5701
|
+
var resolveVenueLabel = (venue, venueInfo, labels) => {
|
|
5702
|
+
var _a, _b;
|
|
5703
|
+
if (!venue) return labels.eventItem.venueSingular;
|
|
5704
|
+
return (_b = (_a = venueInfo == null ? void 0 : venueInfo[venue]) == null ? void 0 : _a.label) != null ? _b : labels.venues[venue];
|
|
5705
|
+
};
|
|
5706
|
+
var resolveDisplayVolume = (eventVolume, venueMarkets) => {
|
|
5707
|
+
if (typeof eventVolume === "number" && eventVolume > 0) return eventVolume;
|
|
5708
|
+
const clusterMarkets = normalizeVenueMarketCluster(venueMarkets);
|
|
5709
|
+
const marketSum = clusterMarkets.reduce(
|
|
5710
|
+
(acc, m) => acc + (typeof m.volume === "number" ? m.volume : 0),
|
|
5711
|
+
0
|
|
5712
|
+
);
|
|
5713
|
+
if (marketSum > 0) return marketSum;
|
|
5714
|
+
return void 0;
|
|
5715
|
+
};
|
|
5716
|
+
|
|
5759
5717
|
// src/primitives/modal/index.tsx
|
|
5760
5718
|
var import_hooks26 = require("@agg-build/hooks");
|
|
5761
5719
|
var Dialog = __toESM(require("@radix-ui/react-dialog"));
|
|
@@ -6428,7 +6386,37 @@ StateMessage.displayName = "StateMessage";
|
|
|
6428
6386
|
|
|
6429
6387
|
// src/primitives/tabs/index.tsx
|
|
6430
6388
|
var import_hooks29 = require("@agg-build/hooks");
|
|
6389
|
+
var import_react8 = require("react");
|
|
6390
|
+
|
|
6391
|
+
// src/shared/use-horizontal-scroll-state.ts
|
|
6431
6392
|
var import_react7 = require("react");
|
|
6393
|
+
var useHorizontalScrollState = () => {
|
|
6394
|
+
const containerRef = (0, import_react7.useRef)(null);
|
|
6395
|
+
const [canScrollLeft, setCanScrollLeft] = (0, import_react7.useState)(false);
|
|
6396
|
+
const [canScrollRight, setCanScrollRight] = (0, import_react7.useState)(false);
|
|
6397
|
+
const update = (0, import_react7.useCallback)(() => {
|
|
6398
|
+
const el = containerRef.current;
|
|
6399
|
+
if (!el) return;
|
|
6400
|
+
const maxScroll = el.scrollWidth - el.clientWidth;
|
|
6401
|
+
setCanScrollLeft(el.scrollLeft > 4);
|
|
6402
|
+
setCanScrollRight(maxScroll - el.scrollLeft > 4);
|
|
6403
|
+
}, []);
|
|
6404
|
+
(0, import_react7.useEffect)(() => {
|
|
6405
|
+
const el = containerRef.current;
|
|
6406
|
+
if (!el) return;
|
|
6407
|
+
el.addEventListener("scroll", update, { passive: true });
|
|
6408
|
+
return () => el.removeEventListener("scroll", update);
|
|
6409
|
+
}, [update]);
|
|
6410
|
+
(0, import_react7.useEffect)(() => {
|
|
6411
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
6412
|
+
const el = containerRef.current;
|
|
6413
|
+
if (!el) return;
|
|
6414
|
+
const ro = new ResizeObserver(() => update());
|
|
6415
|
+
ro.observe(el);
|
|
6416
|
+
return () => ro.disconnect();
|
|
6417
|
+
}, [update]);
|
|
6418
|
+
return { containerRef, canScrollLeft, canScrollRight, update };
|
|
6419
|
+
};
|
|
6432
6420
|
|
|
6433
6421
|
// src/primitives/tabs/tabs.constants.ts
|
|
6434
6422
|
var MOBILE_TABS_MEDIA_QUERY = "(max-width: 736px)";
|
|
@@ -6502,8 +6490,8 @@ var Tabs = ({
|
|
|
6502
6490
|
const {
|
|
6503
6491
|
features: { enableAnimations }
|
|
6504
6492
|
} = (0, import_hooks29.useSdkUiConfig)();
|
|
6505
|
-
const buttonRefs = (0,
|
|
6506
|
-
const dragStateRef = (0,
|
|
6493
|
+
const buttonRefs = (0, import_react8.useRef)([]);
|
|
6494
|
+
const dragStateRef = (0, import_react8.useRef)({
|
|
6507
6495
|
isPointerDown: false,
|
|
6508
6496
|
isDragging: false,
|
|
6509
6497
|
pointerId: null,
|
|
@@ -6511,29 +6499,30 @@ var Tabs = ({
|
|
|
6511
6499
|
startClientY: 0,
|
|
6512
6500
|
startScrollLeft: 0
|
|
6513
6501
|
});
|
|
6514
|
-
const suppressClickRef = (0,
|
|
6502
|
+
const suppressClickRef = (0, import_react8.useRef)(false);
|
|
6515
6503
|
const resolvedAriaLabel = ariaLabel != null ? ariaLabel : labels.common.tabsAria;
|
|
6516
|
-
const [isMobileViewport, setIsMobileViewport] = (0,
|
|
6517
|
-
const [isDraggingTabs, setIsDraggingTabs] = (0,
|
|
6518
|
-
const [activeUnderlineStyle, setActiveUnderlineStyle] = (0,
|
|
6504
|
+
const [isMobileViewport, setIsMobileViewport] = (0, import_react8.useState)(false);
|
|
6505
|
+
const [isDraggingTabs, setIsDraggingTabs] = (0, import_react8.useState)(false);
|
|
6506
|
+
const [activeUnderlineStyle, setActiveUnderlineStyle] = (0, import_react8.useState)({
|
|
6519
6507
|
transform: "translateX(0px)",
|
|
6520
6508
|
width: 0,
|
|
6521
6509
|
opacity: 0
|
|
6522
6510
|
});
|
|
6523
|
-
const
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6511
|
+
const {
|
|
6512
|
+
containerRef: tabListRef,
|
|
6513
|
+
canScrollLeft,
|
|
6514
|
+
canScrollRight,
|
|
6515
|
+
update: updateScrollState
|
|
6516
|
+
} = useHorizontalScrollState();
|
|
6528
6517
|
const isBarVariant = variant === "bar";
|
|
6529
|
-
const resolvedOverflowBehavior = (0,
|
|
6518
|
+
const resolvedOverflowBehavior = (0, import_react8.useMemo)(() => {
|
|
6530
6519
|
if (overflowBehavior) return overflowBehavior;
|
|
6531
6520
|
if (!isBarVariant) return "scroll";
|
|
6532
6521
|
return isMobileViewport ? "select" : "scroll";
|
|
6533
6522
|
}, [isBarVariant, isMobileViewport, overflowBehavior]);
|
|
6534
6523
|
const shouldUseOverflowScroll = resolvedOverflowBehavior === "scroll";
|
|
6535
6524
|
const shouldUseOverflowSelect = resolvedOverflowBehavior === "select";
|
|
6536
|
-
(0,
|
|
6525
|
+
(0, import_react8.useEffect)(() => {
|
|
6537
6526
|
if (typeof window === "undefined") return;
|
|
6538
6527
|
const mediaQueryList = window.matchMedia(MOBILE_TABS_MEDIA_QUERY);
|
|
6539
6528
|
const handleMediaQueryChange = (event) => {
|
|
@@ -6551,28 +6540,12 @@ var Tabs = ({
|
|
|
6551
6540
|
mediaQueryList.removeListener(handleMediaQueryChange);
|
|
6552
6541
|
};
|
|
6553
6542
|
}, []);
|
|
6554
|
-
const
|
|
6555
|
-
if (!shouldUseOverflowScroll) {
|
|
6556
|
-
setScrollAffordanceState({
|
|
6557
|
-
showStart: false,
|
|
6558
|
-
showEnd: false
|
|
6559
|
-
});
|
|
6560
|
-
return;
|
|
6561
|
-
}
|
|
6562
|
-
const tabListElement = tabListRef.current;
|
|
6563
|
-
if (!tabListElement) return;
|
|
6564
|
-
const maxScrollLeft = tabListElement.scrollWidth - tabListElement.clientWidth;
|
|
6565
|
-
setScrollAffordanceState({
|
|
6566
|
-
showStart: tabListElement.scrollLeft > 4,
|
|
6567
|
-
showEnd: maxScrollLeft - tabListElement.scrollLeft > 4
|
|
6568
|
-
});
|
|
6569
|
-
}, [shouldUseOverflowScroll]);
|
|
6570
|
-
const renderedItems = (0, import_react7.useMemo)(() => {
|
|
6543
|
+
const renderedItems = (0, import_react8.useMemo)(() => {
|
|
6571
6544
|
return items.map((item) => __spreadProps(__spreadValues({}, item), {
|
|
6572
6545
|
disabled: item.disabled || item.isComingSoon
|
|
6573
6546
|
}));
|
|
6574
6547
|
}, [items]);
|
|
6575
|
-
const selectItems = (0,
|
|
6548
|
+
const selectItems = (0, import_react8.useMemo)(() => {
|
|
6576
6549
|
return renderedItems.map((item) => ({
|
|
6577
6550
|
value: item.value,
|
|
6578
6551
|
label: item.isComingSoon ? `${item.label} (soon)` : item.label,
|
|
@@ -6705,7 +6678,7 @@ var Tabs = ({
|
|
|
6705
6678
|
event == null ? void 0 : event.stopPropagation();
|
|
6706
6679
|
suppressClickRef.current = false;
|
|
6707
6680
|
};
|
|
6708
|
-
const updateActiveUnderline = (0,
|
|
6681
|
+
const updateActiveUnderline = (0, import_react8.useCallback)(() => {
|
|
6709
6682
|
if (isBarVariant) {
|
|
6710
6683
|
setActiveUnderlineStyle({
|
|
6711
6684
|
transform: "translateX(0px)",
|
|
@@ -6728,42 +6701,39 @@ var Tabs = ({
|
|
|
6728
6701
|
opacity: 1
|
|
6729
6702
|
});
|
|
6730
6703
|
}, [isBarVariant, renderedItems, value]);
|
|
6731
|
-
(0,
|
|
6704
|
+
(0, import_react8.useLayoutEffect)(() => {
|
|
6732
6705
|
updateActiveUnderline();
|
|
6733
6706
|
}, [updateActiveUnderline]);
|
|
6734
|
-
(0,
|
|
6707
|
+
(0, import_react8.useEffect)(() => {
|
|
6735
6708
|
if (isBarVariant || !shouldUseOverflowScroll) return;
|
|
6736
6709
|
const tabListElement = tabListRef.current;
|
|
6737
6710
|
if (!tabListElement) return;
|
|
6738
6711
|
const handleScroll = () => {
|
|
6739
6712
|
updateActiveUnderline();
|
|
6740
|
-
updateScrollAffordances();
|
|
6741
6713
|
};
|
|
6742
6714
|
tabListElement.addEventListener("scroll", handleScroll, { passive: true });
|
|
6743
|
-
updateScrollAffordances();
|
|
6744
6715
|
return () => {
|
|
6745
6716
|
tabListElement.removeEventListener("scroll", handleScroll);
|
|
6746
6717
|
};
|
|
6747
|
-
}, [isBarVariant, shouldUseOverflowScroll,
|
|
6748
|
-
(0,
|
|
6718
|
+
}, [isBarVariant, shouldUseOverflowScroll, tabListRef, updateActiveUnderline]);
|
|
6719
|
+
(0, import_react8.useEffect)(() => {
|
|
6749
6720
|
if (!shouldUseOverflowScroll) return;
|
|
6750
|
-
|
|
6751
|
-
}, [renderedItems, shouldUseOverflowScroll,
|
|
6752
|
-
(0,
|
|
6753
|
-
if (isBarVariant
|
|
6721
|
+
updateScrollState();
|
|
6722
|
+
}, [renderedItems, shouldUseOverflowScroll, updateScrollState, value]);
|
|
6723
|
+
(0, import_react8.useEffect)(() => {
|
|
6724
|
+
if (isBarVariant || !shouldUseOverflowScroll) return;
|
|
6754
6725
|
if (typeof ResizeObserver === "undefined") return;
|
|
6755
6726
|
const tabListElement = tabListRef.current;
|
|
6756
6727
|
if (!tabListElement) return;
|
|
6757
6728
|
const resizeObserver = new ResizeObserver(() => {
|
|
6758
6729
|
updateActiveUnderline();
|
|
6759
|
-
updateScrollAffordances();
|
|
6760
6730
|
});
|
|
6761
6731
|
resizeObserver.observe(tabListElement);
|
|
6762
6732
|
return () => {
|
|
6763
6733
|
resizeObserver.disconnect();
|
|
6764
6734
|
};
|
|
6765
|
-
}, [isBarVariant, shouldUseOverflowScroll,
|
|
6766
|
-
(0,
|
|
6735
|
+
}, [isBarVariant, shouldUseOverflowScroll, tabListRef, updateActiveUnderline]);
|
|
6736
|
+
(0, import_react8.useEffect)(() => {
|
|
6767
6737
|
if (!shouldUseOverflowScroll) return;
|
|
6768
6738
|
const tabListElement = tabListRef.current;
|
|
6769
6739
|
if (!tabListElement) return;
|
|
@@ -6910,7 +6880,7 @@ var Tabs = ({
|
|
|
6910
6880
|
"agg-tab-scroll-start",
|
|
6911
6881
|
"pointer-events-none absolute top-0 bottom-0 left-0 z-10 w-12 md:w-18 bg-linear-to-r from-agg-secondary via-agg-secondary to-transparent",
|
|
6912
6882
|
getMotionClassName(enableAnimations, "transition-opacity duration-200"),
|
|
6913
|
-
|
|
6883
|
+
canScrollLeft ? "opacity-100" : "opacity-0"
|
|
6914
6884
|
)
|
|
6915
6885
|
}
|
|
6916
6886
|
),
|
|
@@ -6922,24 +6892,63 @@ var Tabs = ({
|
|
|
6922
6892
|
"agg-tab-scroll-end",
|
|
6923
6893
|
"pointer-events-none absolute top-0 right-0 bottom-0 z-10 w-12 md:w-18 bg-linear-to-l from-agg-secondary via-agg-secondary to-transparent",
|
|
6924
6894
|
getMotionClassName(enableAnimations, "transition-opacity duration-200"),
|
|
6925
|
-
|
|
6895
|
+
canScrollRight ? "opacity-100" : "opacity-0"
|
|
6926
6896
|
)
|
|
6927
6897
|
}
|
|
6928
6898
|
)
|
|
6929
6899
|
] }) : null,
|
|
6930
|
-
shouldUseOverflowScroll && isBarVariant ? /* @__PURE__ */ (0, import_jsx_runtime116.
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
"
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
|
|
6900
|
+
shouldUseOverflowScroll && isBarVariant ? /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(import_jsx_runtime116.Fragment, { children: [
|
|
6901
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
6902
|
+
"button",
|
|
6903
|
+
{
|
|
6904
|
+
type: "button",
|
|
6905
|
+
"aria-label": labels.common.scrollTabsLeft,
|
|
6906
|
+
tabIndex: -1,
|
|
6907
|
+
className: cn(
|
|
6908
|
+
"agg-tab-scroll-start",
|
|
6909
|
+
"absolute top-0 bottom-0 left-0 z-10 w-20 rounded-l-agg-lg",
|
|
6910
|
+
"inline-flex items-center justify-start pl-2",
|
|
6911
|
+
"bg-linear-to-r from-agg-secondary from-[25%] via-agg-secondary/80 to-transparent",
|
|
6912
|
+
"cursor-pointer",
|
|
6913
|
+
getMotionClassName(enableAnimations, "transition-opacity duration-200"),
|
|
6914
|
+
canScrollLeft ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
6915
|
+
),
|
|
6916
|
+
onClick: () => {
|
|
6917
|
+
var _a;
|
|
6918
|
+
(_a = tabListRef.current) == null ? void 0 : _a.scrollBy({
|
|
6919
|
+
left: -200,
|
|
6920
|
+
behavior: getScrollBehavior(enableAnimations)
|
|
6921
|
+
});
|
|
6922
|
+
},
|
|
6923
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Icon, { name: "chevron-left", size: "small", color: "currentColor" })
|
|
6924
|
+
}
|
|
6925
|
+
),
|
|
6926
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
6927
|
+
"button",
|
|
6928
|
+
{
|
|
6929
|
+
type: "button",
|
|
6930
|
+
"aria-label": labels.common.scrollTabsRight,
|
|
6931
|
+
tabIndex: -1,
|
|
6932
|
+
className: cn(
|
|
6933
|
+
"agg-tab-scroll-end",
|
|
6934
|
+
"absolute top-0 right-0 bottom-0 z-10 w-20 rounded-r-agg-lg",
|
|
6935
|
+
"inline-flex items-center justify-end pr-2",
|
|
6936
|
+
"bg-linear-to-l from-agg-secondary from-[25%] via-agg-secondary/80 to-transparent",
|
|
6937
|
+
"cursor-pointer",
|
|
6938
|
+
getMotionClassName(enableAnimations, "transition-opacity duration-200"),
|
|
6939
|
+
canScrollRight ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
6940
|
+
),
|
|
6941
|
+
onClick: () => {
|
|
6942
|
+
var _a;
|
|
6943
|
+
(_a = tabListRef.current) == null ? void 0 : _a.scrollBy({
|
|
6944
|
+
left: 200,
|
|
6945
|
+
behavior: getScrollBehavior(enableAnimations)
|
|
6946
|
+
});
|
|
6947
|
+
},
|
|
6948
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Icon, { name: "chevron-right", size: "small", color: "currentColor" })
|
|
6949
|
+
}
|
|
6950
|
+
)
|
|
6951
|
+
] }) : null
|
|
6943
6952
|
]
|
|
6944
6953
|
}
|
|
6945
6954
|
);
|
|
@@ -6949,7 +6958,7 @@ Tabs.displayName = "Tabs";
|
|
|
6949
6958
|
// src/primitives/tooltip/index.tsx
|
|
6950
6959
|
var import_hooks30 = require("@agg-build/hooks");
|
|
6951
6960
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
6952
|
-
var
|
|
6961
|
+
var import_react9 = require("react");
|
|
6953
6962
|
|
|
6954
6963
|
// src/primitives/tooltip/tooltip.constants.ts
|
|
6955
6964
|
var tooltipSizeClasses = {
|
|
@@ -6997,7 +7006,7 @@ var Tooltip = ({
|
|
|
6997
7006
|
general: { rootClassName },
|
|
6998
7007
|
features: { enableAnimations }
|
|
6999
7008
|
} = (0, import_hooks30.useSdkUiConfig)();
|
|
7000
|
-
const trigger = (0,
|
|
7009
|
+
const trigger = (0, import_react9.useMemo)(() => {
|
|
7001
7010
|
if (children) return children;
|
|
7002
7011
|
return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
7003
7012
|
"button",
|
|
@@ -7108,7 +7117,7 @@ var resolveOutcomeRows = ({
|
|
|
7108
7117
|
outcome
|
|
7109
7118
|
}));
|
|
7110
7119
|
}
|
|
7111
|
-
return
|
|
7120
|
+
return venueMarkets.map((market) => {
|
|
7112
7121
|
const outcome = resolveDisplayOutcome(market);
|
|
7113
7122
|
if (!outcome) return void 0;
|
|
7114
7123
|
return {
|
|
@@ -7334,17 +7343,17 @@ var EventListItemContent = ({
|
|
|
7334
7343
|
var _a;
|
|
7335
7344
|
const config = (0, import_hooks31.useSdkUiConfig)();
|
|
7336
7345
|
const labels = (0, import_hooks31.useLabels)();
|
|
7337
|
-
const allVenueMarkets = (0,
|
|
7346
|
+
const allVenueMarkets = (0, import_react10.useMemo)(() => event.venueMarkets, [event.venueMarkets]);
|
|
7338
7347
|
const resolvedTitle = event.title;
|
|
7339
7348
|
const resolvedImage = event.image;
|
|
7340
|
-
const visibleVenueLogos = (0,
|
|
7349
|
+
const visibleVenueLogos = (0, import_react10.useMemo)(() => {
|
|
7341
7350
|
var _a2;
|
|
7342
7351
|
return (0, import_hooks31.sortVenues)(Array.from(new Set(((_a2 = event.venues) != null ? _a2 : []).map((venue) => venue))));
|
|
7343
7352
|
}, [event.venues]);
|
|
7344
7353
|
const resolvedMarketCount = typeof event.marketCount === "number" && Number.isFinite(event.marketCount) ? Math.max(0, Math.floor(event.marketCount)) : allVenueMarkets.length;
|
|
7345
7354
|
const resolvedVenueCount = typeof event.venueCount === "number" && Number.isFinite(event.venueCount) ? Math.max(0, Math.floor(event.venueCount)) : visibleVenueLogos.length;
|
|
7346
|
-
const [isLazyMarketsQueryEnabled, setIsLazyMarketsQueryEnabled] = (0,
|
|
7347
|
-
const shouldEnableLazyMarketLoading = (0,
|
|
7355
|
+
const [isLazyMarketsQueryEnabled, setIsLazyMarketsQueryEnabled] = (0, import_react10.useState)(false);
|
|
7356
|
+
const shouldEnableLazyMarketLoading = (0, import_react10.useMemo)(() => {
|
|
7348
7357
|
if (!event.id) return false;
|
|
7349
7358
|
const hasExplicitMarketCount = typeof event.marketCount === "number" && Number.isFinite(event.marketCount);
|
|
7350
7359
|
if (hasExplicitMarketCount) {
|
|
@@ -7365,11 +7374,11 @@ var EventListItemContent = ({
|
|
|
7365
7374
|
sortDir: "desc",
|
|
7366
7375
|
status: marketStatus
|
|
7367
7376
|
});
|
|
7368
|
-
const resolvedOutcomeMarkets = (0,
|
|
7377
|
+
const resolvedOutcomeMarkets = (0, import_react10.useMemo)(() => {
|
|
7369
7378
|
if (!isLazyMarketsQueryEnabled || lazyLoadedMarkets.length === 0) return allVenueMarkets;
|
|
7370
7379
|
return dedupeVenueMarketsById([...allVenueMarkets, ...lazyLoadedMarkets]);
|
|
7371
7380
|
}, [allVenueMarkets, isLazyMarketsQueryEnabled, lazyLoadedMarkets]);
|
|
7372
|
-
const midpointVenueMarketIds = (0,
|
|
7381
|
+
const midpointVenueMarketIds = (0, import_react10.useMemo)(() => {
|
|
7373
7382
|
var _a2;
|
|
7374
7383
|
const ids = [];
|
|
7375
7384
|
for (const market of resolvedOutcomeMarkets) {
|
|
@@ -7386,27 +7395,27 @@ var EventListItemContent = ({
|
|
|
7386
7395
|
});
|
|
7387
7396
|
const { prices: displayMidpointsByOutcomeId, isLoading: isOutcomeMidpointsLoading } = (0, import_hooks31.useMidpoints)(resolvedOutcomeMarkets);
|
|
7388
7397
|
const isAwaitingMidpoints = isOutcomeMidpointsLoading || midpointVenueMarketIds.length > 0 && isVenueMarketMidpointsLoading;
|
|
7389
|
-
const displayPriceByOutcomeId = (0,
|
|
7398
|
+
const displayPriceByOutcomeId = (0, import_react10.useMemo)(() => {
|
|
7390
7399
|
const priceByOutcomeId = new Map(displayMidpointsByOutcomeId);
|
|
7391
7400
|
for (const [outcomeId, price] of buildOutcomeMidpointsByOutcomeId(midpointRows)) {
|
|
7392
7401
|
priceByOutcomeId.set(outcomeId, price);
|
|
7393
7402
|
}
|
|
7394
7403
|
return priceByOutcomeId;
|
|
7395
7404
|
}, [displayMidpointsByOutcomeId, midpointRows]);
|
|
7396
|
-
const comparison = (0,
|
|
7405
|
+
const comparison = (0, import_react10.useMemo)(() => {
|
|
7397
7406
|
return normalizeEventListItemV2Comparison({
|
|
7398
7407
|
venueMarkets: resolvedOutcomeMarkets,
|
|
7399
7408
|
marketCount: resolvedMarketCount,
|
|
7400
7409
|
priceByOutcomeId: displayPriceByOutcomeId
|
|
7401
7410
|
});
|
|
7402
7411
|
}, [displayPriceByOutcomeId, resolvedMarketCount, resolvedOutcomeMarkets]);
|
|
7403
|
-
const gapsByVenueMarketId = (0,
|
|
7412
|
+
const gapsByVenueMarketId = (0, import_react10.useMemo)(() => {
|
|
7404
7413
|
return computePriceGapsFromComparisonRows(comparison.rows);
|
|
7405
7414
|
}, [comparison.rows]);
|
|
7406
7415
|
const shouldRenderLoadingOutcomeRow = shouldEnableLazyMarketLoading && (!isLazyMarketsQueryEnabled || isLoadingLazyMarkets || isFetchingNextLazyMarketsPage || hasNextLazyMarketsPage);
|
|
7407
7416
|
const resolvedVolume = (_a = resolveDisplayVolume(event.volume, allVenueMarkets)) != null ? _a : 0;
|
|
7408
7417
|
const volumeLabel = `${config.formatting.formatCompactCurrency(resolvedVolume)} ${labels.eventItem.volumeSuffix}`;
|
|
7409
|
-
const orderedFooterVenues = (0,
|
|
7418
|
+
const orderedFooterVenues = (0, import_react10.useMemo)(() => {
|
|
7410
7419
|
const venues = visibleVenueLogos.length > 0 ? visibleVenueLogos : comparison.matchedVenues.length > 0 ? comparison.matchedVenues : event.venue ? [event.venue] : [];
|
|
7411
7420
|
return Array.from(new Set(venues));
|
|
7412
7421
|
}, [comparison.matchedVenues, event.venue, visibleVenueLogos]);
|
|
@@ -7467,7 +7476,7 @@ var EventListItemContent = ({
|
|
|
7467
7476
|
onEventClick == null ? void 0 : onEventClick(event);
|
|
7468
7477
|
}
|
|
7469
7478
|
};
|
|
7470
|
-
const handleOutcomesScroll = (0,
|
|
7479
|
+
const handleOutcomesScroll = (0, import_react10.useCallback)(
|
|
7471
7480
|
(eventToHandle) => {
|
|
7472
7481
|
if (!shouldEnableLazyMarketLoading) return;
|
|
7473
7482
|
const element = eventToHandle.currentTarget;
|
|
@@ -7795,7 +7804,7 @@ var EventListItemByEventId = (_a) => {
|
|
|
7795
7804
|
eventId: eventId != null ? eventId : "",
|
|
7796
7805
|
enabled: !!eventId
|
|
7797
7806
|
});
|
|
7798
|
-
const resolvedEvent = (0,
|
|
7807
|
+
const resolvedEvent = (0, import_react10.useMemo)(() => {
|
|
7799
7808
|
return resolveEventListItemEvent(fetchedEvent);
|
|
7800
7809
|
}, [fetchedEvent]);
|
|
7801
7810
|
if (!eventId) {
|
|
@@ -7833,11 +7842,11 @@ EventListItemV2.displayName = "EventListItemV2";
|
|
|
7833
7842
|
|
|
7834
7843
|
// src/events/item-details/index.tsx
|
|
7835
7844
|
var import_hooks40 = require("@agg-build/hooks");
|
|
7836
|
-
var
|
|
7845
|
+
var import_react16 = require("react");
|
|
7837
7846
|
|
|
7838
7847
|
// src/primitives/chart/chart-type-switch.tsx
|
|
7839
7848
|
var import_hooks32 = require("@agg-build/hooks");
|
|
7840
|
-
var
|
|
7849
|
+
var import_react11 = require("react");
|
|
7841
7850
|
|
|
7842
7851
|
// src/primitives/chart/chart-type-switch.constants.ts
|
|
7843
7852
|
var CHART_TYPE_SWITCH_OPTION_KEYS = ["line", "candlestick"];
|
|
@@ -7869,7 +7878,7 @@ var ChartTypeSwitch = ({
|
|
|
7869
7878
|
className
|
|
7870
7879
|
}) => {
|
|
7871
7880
|
const labels = (0, import_hooks32.useLabels)();
|
|
7872
|
-
const options = (0,
|
|
7881
|
+
const options = (0, import_react11.useMemo)(
|
|
7873
7882
|
() => CHART_TYPE_SWITCH_OPTION_KEYS.map((chartType) => ({
|
|
7874
7883
|
value: chartType,
|
|
7875
7884
|
iconName: resolveChartTypeOptionIconName(chartType),
|
|
@@ -9086,7 +9095,7 @@ var getDisplayOutcomePrice = ({
|
|
|
9086
9095
|
|
|
9087
9096
|
// src/events/item-details/event-list-item-details-market-selector.tsx
|
|
9088
9097
|
var import_hooks36 = require("@agg-build/hooks");
|
|
9089
|
-
var
|
|
9098
|
+
var import_react12 = require("react");
|
|
9090
9099
|
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
9091
9100
|
var MARKET_PILL_MAX_ROWS = 2;
|
|
9092
9101
|
var MARKET_PILL_FALLBACK_CONTAINER_WIDTH = 640;
|
|
@@ -9183,38 +9192,38 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
9183
9192
|
}) => {
|
|
9184
9193
|
var _a;
|
|
9185
9194
|
const labels = (0, import_hooks36.useLabels)();
|
|
9186
|
-
const containerRef = (0,
|
|
9187
|
-
const measurementContainerRef = (0,
|
|
9188
|
-
const moreButtonRef = (0,
|
|
9189
|
-
const dropdownInputRef = (0,
|
|
9190
|
-
const moreButtonMeasureRef = (0,
|
|
9191
|
-
const optionMeasureRefs = (0,
|
|
9192
|
-
const [layout, setLayout] = (0,
|
|
9195
|
+
const containerRef = (0, import_react12.useRef)(null);
|
|
9196
|
+
const measurementContainerRef = (0, import_react12.useRef)(null);
|
|
9197
|
+
const moreButtonRef = (0, import_react12.useRef)(null);
|
|
9198
|
+
const dropdownInputRef = (0, import_react12.useRef)(null);
|
|
9199
|
+
const moreButtonMeasureRef = (0, import_react12.useRef)(null);
|
|
9200
|
+
const optionMeasureRefs = (0, import_react12.useRef)({});
|
|
9201
|
+
const [layout, setLayout] = (0, import_react12.useState)(() => ({
|
|
9193
9202
|
visibleItems: options,
|
|
9194
9203
|
hiddenItems: []
|
|
9195
9204
|
}));
|
|
9196
|
-
const [isDropdownOpen, setIsDropdownOpen] = (0,
|
|
9197
|
-
const [isMobileViewport, setIsMobileViewport] = (0,
|
|
9198
|
-
const [searchValue, setSearchValue] = (0,
|
|
9199
|
-
const [dropdownPosition, setDropdownPosition] = (0,
|
|
9205
|
+
const [isDropdownOpen, setIsDropdownOpen] = (0, import_react12.useState)(false);
|
|
9206
|
+
const [isMobileViewport, setIsMobileViewport] = (0, import_react12.useState)(false);
|
|
9207
|
+
const [searchValue, setSearchValue] = (0, import_react12.useState)("");
|
|
9208
|
+
const [dropdownPosition, setDropdownPosition] = (0, import_react12.useState)({
|
|
9200
9209
|
left: 0,
|
|
9201
9210
|
top: 0,
|
|
9202
9211
|
width: 0
|
|
9203
9212
|
});
|
|
9204
|
-
const selectedHiddenOption = (0,
|
|
9213
|
+
const selectedHiddenOption = (0, import_react12.useMemo)(() => {
|
|
9205
9214
|
var _a2;
|
|
9206
9215
|
return (_a2 = layout.hiddenItems.find((option) => option.value === selectedValue)) != null ? _a2 : null;
|
|
9207
9216
|
}, [layout.hiddenItems, selectedValue]);
|
|
9208
9217
|
const moreButtonLabel = (_a = selectedHiddenOption == null ? void 0 : selectedHiddenOption.label) != null ? _a : MARKET_PILL_MORE_LABEL;
|
|
9209
9218
|
const isMoreButtonSelected = selectedHiddenOption != null;
|
|
9210
|
-
const filteredOptions = (0,
|
|
9219
|
+
const filteredOptions = (0, import_react12.useMemo)(() => {
|
|
9211
9220
|
const normalizedSearchValue = searchValue.trim().toLowerCase();
|
|
9212
9221
|
if (!normalizedSearchValue) return options;
|
|
9213
9222
|
return options.filter((option) => option.label.toLowerCase().includes(normalizedSearchValue));
|
|
9214
9223
|
}, [options, searchValue]);
|
|
9215
|
-
const lastMeasuredKeyRef = (0,
|
|
9216
|
-
const measureFrameRef = (0,
|
|
9217
|
-
(0,
|
|
9224
|
+
const lastMeasuredKeyRef = (0, import_react12.useRef)(null);
|
|
9225
|
+
const measureFrameRef = (0, import_react12.useRef)(null);
|
|
9226
|
+
(0, import_react12.useLayoutEffect)(() => {
|
|
9218
9227
|
const measureLayout = () => {
|
|
9219
9228
|
var _a2, _b, _c, _d, _e;
|
|
9220
9229
|
const measurementContainer = measurementContainerRef.current;
|
|
@@ -9295,7 +9304,7 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
9295
9304
|
}
|
|
9296
9305
|
};
|
|
9297
9306
|
}, [moreButtonLabel, options]);
|
|
9298
|
-
(0,
|
|
9307
|
+
(0, import_react12.useEffect)(() => {
|
|
9299
9308
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
9300
9309
|
const mediaQueryList = window.matchMedia(MOBILE_TABS_MEDIA_QUERY);
|
|
9301
9310
|
const handleMediaQueryChange = (event) => {
|
|
@@ -9313,7 +9322,7 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
9313
9322
|
mediaQueryList.removeListener(handleMediaQueryChange);
|
|
9314
9323
|
};
|
|
9315
9324
|
}, []);
|
|
9316
|
-
(0,
|
|
9325
|
+
(0, import_react12.useEffect)(() => {
|
|
9317
9326
|
if (!isDropdownOpen) {
|
|
9318
9327
|
setSearchValue("");
|
|
9319
9328
|
return;
|
|
@@ -9326,7 +9335,7 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
9326
9335
|
window.cancelAnimationFrame(animationFrameId);
|
|
9327
9336
|
};
|
|
9328
9337
|
}, [isDropdownOpen]);
|
|
9329
|
-
(0,
|
|
9338
|
+
(0, import_react12.useLayoutEffect)(() => {
|
|
9330
9339
|
if (!isDropdownOpen || isMobileViewport) return;
|
|
9331
9340
|
const updateDropdownPosition = () => {
|
|
9332
9341
|
const containerElement = containerRef.current;
|
|
@@ -9362,7 +9371,7 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
9362
9371
|
resizeObserver.disconnect();
|
|
9363
9372
|
};
|
|
9364
9373
|
}, [isDropdownOpen, isMobileViewport, moreButtonLabel]);
|
|
9365
|
-
(0,
|
|
9374
|
+
(0, import_react12.useEffect)(() => {
|
|
9366
9375
|
if (!isDropdownOpen) return;
|
|
9367
9376
|
const handlePointerDown = (event) => {
|
|
9368
9377
|
var _a2;
|
|
@@ -9609,11 +9618,11 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
9609
9618
|
|
|
9610
9619
|
// src/events/item-details/settlement-summary.tsx
|
|
9611
9620
|
var import_hooks39 = require("@agg-build/hooks");
|
|
9612
|
-
var
|
|
9621
|
+
var import_react15 = require("react");
|
|
9613
9622
|
|
|
9614
9623
|
// src/trading/settlement/index.tsx
|
|
9615
9624
|
var import_hooks38 = require("@agg-build/hooks");
|
|
9616
|
-
var
|
|
9625
|
+
var import_react14 = require("react");
|
|
9617
9626
|
|
|
9618
9627
|
// src/trading/utils.ts
|
|
9619
9628
|
var import_hooks37 = require("@agg-build/hooks");
|
|
@@ -9623,7 +9632,7 @@ var defaultSettlementSectionLabel = defaultLabels.trading.settlementSection;
|
|
|
9623
9632
|
var defaultTradingDisclaimer = defaultLabels.trading.disclaimer;
|
|
9624
9633
|
|
|
9625
9634
|
// src/trading/settlement/settlement-text-renderer.tsx
|
|
9626
|
-
var
|
|
9635
|
+
var import_react13 = require("react");
|
|
9627
9636
|
|
|
9628
9637
|
// src/trading/settlement/settlement-text.utils.ts
|
|
9629
9638
|
var stripHtmlFragments = (text) => {
|
|
@@ -9715,7 +9724,7 @@ var renderInlineSegment = (text, baseKey) => {
|
|
|
9715
9724
|
}
|
|
9716
9725
|
if (match.index > lastIndex) {
|
|
9717
9726
|
nodes.push(
|
|
9718
|
-
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
9727
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_react13.Fragment, { children: text.slice(lastIndex, match.index) }, `${baseKey}-text-${segmentIndex++}`)
|
|
9719
9728
|
);
|
|
9720
9729
|
}
|
|
9721
9730
|
if (isLinkMatch(match)) {
|
|
@@ -9773,7 +9782,7 @@ var renderInlineSegment = (text, baseKey) => {
|
|
|
9773
9782
|
}
|
|
9774
9783
|
if (lastIndex < text.length) {
|
|
9775
9784
|
nodes.push(
|
|
9776
|
-
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
9785
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_react13.Fragment, { children: text.slice(lastIndex) }, `${baseKey}-text-${segmentIndex++}`)
|
|
9777
9786
|
);
|
|
9778
9787
|
}
|
|
9779
9788
|
return nodes;
|
|
@@ -9800,7 +9809,7 @@ var renderBlock = (block, blockIndex) => {
|
|
|
9800
9809
|
"p",
|
|
9801
9810
|
{
|
|
9802
9811
|
className: "agg-settlement-text-paragraph text-agg-sm leading-agg-5 text-agg-foreground break-words [overflow-wrap:anywhere]",
|
|
9803
|
-
children: block.lines.map((line, lineIndex) => /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
|
|
9812
|
+
children: block.lines.map((line, lineIndex) => /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(import_react13.Fragment, { children: [
|
|
9804
9813
|
lineIndex > 0 ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("br", {}) : null,
|
|
9805
9814
|
renderInlineSegment(line, `block-${blockIndex}-line-${lineIndex}`)
|
|
9806
9815
|
] }, `block-${blockIndex}-line-${lineIndex}`))
|
|
@@ -9836,7 +9845,7 @@ var Settlement = ({
|
|
|
9836
9845
|
}) => {
|
|
9837
9846
|
var _a, _b, _c;
|
|
9838
9847
|
const labels = (0, import_hooks38.useLabels)();
|
|
9839
|
-
const blocks = (0,
|
|
9848
|
+
const blocks = (0, import_react14.useMemo)(
|
|
9840
9849
|
() => dedupeSettlementSources({
|
|
9841
9850
|
eventDescription,
|
|
9842
9851
|
marketDescription,
|
|
@@ -9911,7 +9920,7 @@ var SettlementSummary = ({
|
|
|
9911
9920
|
className
|
|
9912
9921
|
}) => {
|
|
9913
9922
|
const labels = (0, import_hooks39.useLabels)();
|
|
9914
|
-
const firstParagraph = (0,
|
|
9923
|
+
const firstParagraph = (0, import_react15.useMemo)(() => getFirstSettlementParagraph(content), [content]);
|
|
9915
9924
|
if (!firstParagraph) return null;
|
|
9916
9925
|
const handleReadFullDetails = (event) => {
|
|
9917
9926
|
event.preventDefault();
|
|
@@ -10067,11 +10076,11 @@ var EventListItemDetailsGraphSection = ({
|
|
|
10067
10076
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
10068
10077
|
const labels = (0, import_hooks40.useLabels)();
|
|
10069
10078
|
const tradingContext = (0, import_hooks33.useEventTradingContext)();
|
|
10070
|
-
const [selectedGraphVenue, setSelectedGraphVenue] = (0,
|
|
10071
|
-
const [chartOutcomeLabel, setChartOutcomeLabel] = (0,
|
|
10079
|
+
const [selectedGraphVenue, setSelectedGraphVenue] = (0, import_react16.useState)(null);
|
|
10080
|
+
const [chartOutcomeLabel, setChartOutcomeLabel] = (0, import_react16.useState)(
|
|
10072
10081
|
(_c = (_b = (_a = tradingContext == null ? void 0 : tradingContext.selectedOutcome) == null ? void 0 : _a.label) == null ? void 0 : _b.trim()) != null ? _c : null
|
|
10073
10082
|
);
|
|
10074
|
-
(0,
|
|
10083
|
+
(0, import_react16.useEffect)(() => {
|
|
10075
10084
|
var _a2, _b2, _c2;
|
|
10076
10085
|
if (chartOutcomeLabel != null) return;
|
|
10077
10086
|
const label2 = (_c2 = (_b2 = (_a2 = tradingContext == null ? void 0 : tradingContext.selectedOutcome) == null ? void 0 : _a2.label) == null ? void 0 : _b2.trim()) != null ? _c2 : null;
|
|
@@ -10087,13 +10096,13 @@ var EventListItemDetailsGraphSection = ({
|
|
|
10087
10096
|
const isDarkTheme = theme === "dark";
|
|
10088
10097
|
const effectiveChartTimeRange = rangeOverride != null ? rangeOverride : selectedChartTimeRange;
|
|
10089
10098
|
const rollingWindow = (0, import_hooks40.useRollingChartWindow)({ range: effectiveChartTimeRange });
|
|
10090
|
-
const availableMarkets = (0,
|
|
10099
|
+
const availableMarkets = (0, import_react16.useMemo)(() => {
|
|
10091
10100
|
var _a2, _b2, _c2, _d2;
|
|
10092
10101
|
if (venueMarkets.length === 0) return [];
|
|
10093
10102
|
const resolvedSelectedMarketId = (_d2 = (_c2 = (_a2 = tradingContext == null ? void 0 : tradingContext.selectedMarketId) != null ? _a2 : selectedMarketId) != null ? _c2 : (_b2 = venueMarkets[0]) == null ? void 0 : _b2.id) != null ? _d2 : null;
|
|
10094
10103
|
return normalizeVenueMarketCluster(venueMarkets, resolvedSelectedMarketId);
|
|
10095
10104
|
}, [selectedMarketId, tradingContext == null ? void 0 : tradingContext.selectedMarketId, venueMarkets]);
|
|
10096
|
-
const fallbackOutcomeLabel = (0,
|
|
10105
|
+
const fallbackOutcomeLabel = (0, import_react16.useMemo)(() => {
|
|
10097
10106
|
var _a2, _b2, _c2, _d2, _e2;
|
|
10098
10107
|
const fallbackMarket = (_b2 = (_a2 = tradingContext == null ? void 0 : tradingContext.selectedMarket) != null ? _a2 : availableMarkets[0]) != null ? _b2 : null;
|
|
10099
10108
|
if (!fallbackMarket) return null;
|
|
@@ -10101,7 +10110,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
10101
10110
|
}, [availableMarkets, tradingContext == null ? void 0 : tradingContext.selectedMarket]);
|
|
10102
10111
|
const resolvedChartOutcomeLabel = (_h = (_g = chartOutcomeLabel != null ? chartOutcomeLabel : (_f = (_e = tradingContext == null ? void 0 : tradingContext.selectedOutcome) == null ? void 0 : _e.label) == null ? void 0 : _f.trim()) != null ? _g : fallbackOutcomeLabel) != null ? _h : null;
|
|
10103
10112
|
const chartScopedOutcomeId = ((_i = tradingContext == null ? void 0 : tradingContext.selectedOutcome) == null ? void 0 : _i.id) && ((_j = tradingContext.selectedOutcome.label) == null ? void 0 : _j.trim()) === resolvedChartOutcomeLabel ? tradingContext.selectedOutcome.id : null;
|
|
10104
|
-
const availableVenueOutcomes = (0,
|
|
10113
|
+
const availableVenueOutcomes = (0, import_react16.useMemo)(() => {
|
|
10105
10114
|
return resolveChartVenueOutcomes({
|
|
10106
10115
|
eligibleVenueOutcomes: collectEligibleVenueOutcomes({
|
|
10107
10116
|
venueMarkets: availableMarkets,
|
|
@@ -10130,11 +10139,11 @@ var EventListItemDetailsGraphSection = ({
|
|
|
10130
10139
|
// of refetching every time the bucket boundary advances.
|
|
10131
10140
|
rangeKey: rollingWindow.range
|
|
10132
10141
|
});
|
|
10133
|
-
const hasAutoFallenBackRangeRef = (0,
|
|
10134
|
-
(0,
|
|
10142
|
+
const hasAutoFallenBackRangeRef = (0, import_react16.useRef)(false);
|
|
10143
|
+
(0, import_react16.useEffect)(() => {
|
|
10135
10144
|
hasAutoFallenBackRangeRef.current = false;
|
|
10136
10145
|
}, [chartPrimaryOutcomeId]);
|
|
10137
|
-
(0,
|
|
10146
|
+
(0, import_react16.useEffect)(() => {
|
|
10138
10147
|
if (!shouldAutoFallbackToAllRange({
|
|
10139
10148
|
chartData: scopedMarketChartData,
|
|
10140
10149
|
isLoading: isScopedMarketChartLoading,
|
|
@@ -10159,7 +10168,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
10159
10168
|
onRangeOverrideChange,
|
|
10160
10169
|
rollingWindow.startTs
|
|
10161
10170
|
]);
|
|
10162
|
-
const selectedMarketOutcomes = (0,
|
|
10171
|
+
const selectedMarketOutcomes = (0, import_react16.useMemo)(() => {
|
|
10163
10172
|
var _a2, _b2;
|
|
10164
10173
|
const selectedMarket = (_b2 = (_a2 = tradingContext == null ? void 0 : tradingContext.selectedMarket) != null ? _a2 : availableMarkets[0]) != null ? _b2 : null;
|
|
10165
10174
|
if (!selectedMarket) return [];
|
|
@@ -10171,7 +10180,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
10171
10180
|
});
|
|
10172
10181
|
});
|
|
10173
10182
|
}, [availableMarkets, tradingContext == null ? void 0 : tradingContext.selectedMarket]);
|
|
10174
|
-
const resolvedVenueChartSeries = (0,
|
|
10183
|
+
const resolvedVenueChartSeries = (0, import_react16.useMemo)(() => {
|
|
10175
10184
|
return resolveMarketChartVenueSeries({
|
|
10176
10185
|
chartData: scopedMarketChartData,
|
|
10177
10186
|
transformProbability: (v) => v
|
|
@@ -10184,32 +10193,32 @@ var EventListItemDetailsGraphSection = ({
|
|
|
10184
10193
|
lineStyle: "solid"
|
|
10185
10194
|
}));
|
|
10186
10195
|
}, [isDarkTheme, scopedMarketChartData]);
|
|
10187
|
-
const chartAvailableVenueOutcomes = (0,
|
|
10196
|
+
const chartAvailableVenueOutcomes = (0, import_react16.useMemo)(() => {
|
|
10188
10197
|
return filterChartVenueOutcomesByRenderableVenues({
|
|
10189
10198
|
chartData: scopedMarketChartData,
|
|
10190
10199
|
venueOutcomes: availableVenueOutcomes
|
|
10191
10200
|
});
|
|
10192
10201
|
}, [availableVenueOutcomes, scopedMarketChartData]);
|
|
10193
|
-
const defaultCandlestickVenue = (0,
|
|
10202
|
+
const defaultCandlestickVenue = (0, import_react16.useMemo)(() => {
|
|
10194
10203
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
10195
10204
|
return (_f2 = (_e2 = (_c2 = (_a2 = chartAvailableVenueOutcomes.find((item) => item.venue === (tradingContext == null ? void 0 : tradingContext.selectedVenue))) == null ? void 0 : _a2.venue) != null ? _c2 : (_b2 = chartAvailableVenueOutcomes[0]) == null ? void 0 : _b2.venue) != null ? _e2 : (_d2 = availableVenueOutcomes[0]) == null ? void 0 : _d2.venue) != null ? _f2 : null;
|
|
10196
10205
|
}, [availableVenueOutcomes, chartAvailableVenueOutcomes, tradingContext == null ? void 0 : tradingContext.selectedVenue]);
|
|
10197
10206
|
const activeGraphVenue = selectedChartType === "candlestick" ? selectedGraphVenue != null ? selectedGraphVenue : defaultCandlestickVenue : selectedGraphVenue;
|
|
10198
|
-
const visibleChartSeries = (0,
|
|
10207
|
+
const visibleChartSeries = (0, import_react16.useMemo)(() => {
|
|
10199
10208
|
const venueFiltered = activeGraphVenue ? resolvedVenueChartSeries.filter((seriesItem) => seriesItem.venue === activeGraphVenue) : resolvedVenueChartSeries;
|
|
10200
10209
|
const domainStartTs = rollingWindow.startTs;
|
|
10201
10210
|
return venueFiltered.map((seriesItem) => __spreadProps(__spreadValues({}, seriesItem), {
|
|
10202
10211
|
points: seriesItem.points.filter((point) => point.time >= domainStartTs)
|
|
10203
10212
|
}));
|
|
10204
10213
|
}, [activeGraphVenue, resolvedVenueChartSeries, rollingWindow.startTs]);
|
|
10205
|
-
const chartLiveState = (0,
|
|
10214
|
+
const chartLiveState = (0, import_react16.useMemo)(() => {
|
|
10206
10215
|
return resolveMarketChartLiveState({
|
|
10207
10216
|
chartData: scopedMarketChartData,
|
|
10208
10217
|
selectedVenue: activeGraphVenue,
|
|
10209
10218
|
transformProbability: (v) => v
|
|
10210
10219
|
});
|
|
10211
10220
|
}, [activeGraphVenue, scopedMarketChartData]);
|
|
10212
|
-
(0,
|
|
10221
|
+
(0, import_react16.useEffect)(() => {
|
|
10213
10222
|
if (!selectedGraphVenue) return;
|
|
10214
10223
|
const hasSelectedGraphVenue = chartAvailableVenueOutcomes.some(
|
|
10215
10224
|
(item) => item.venue === selectedGraphVenue
|
|
@@ -10369,18 +10378,18 @@ var EventListItemDetailsContent = ({
|
|
|
10369
10378
|
midpointsResult
|
|
10370
10379
|
}) => {
|
|
10371
10380
|
var _a, _b, _c, _d;
|
|
10372
|
-
const [selectedChartType, setSelectedChartType] = (0,
|
|
10373
|
-
const lastAppliedEventSyncKeyRef = (0,
|
|
10374
|
-
const lastAppliedDefaultRef = (0,
|
|
10375
|
-
const [chartRangeOverride, setChartRangeOverride] = (0,
|
|
10376
|
-
(0,
|
|
10381
|
+
const [selectedChartType, setSelectedChartType] = (0, import_react16.useState)("line");
|
|
10382
|
+
const lastAppliedEventSyncKeyRef = (0, import_react16.useRef)(null);
|
|
10383
|
+
const lastAppliedDefaultRef = (0, import_react16.useRef)(null);
|
|
10384
|
+
const [chartRangeOverride, setChartRangeOverride] = (0, import_react16.useState)(null);
|
|
10385
|
+
(0, import_react16.useEffect)(() => {
|
|
10377
10386
|
setChartRangeOverride(null);
|
|
10378
10387
|
}, [event.id]);
|
|
10379
10388
|
const config = (0, import_hooks40.useSdkUiConfig)();
|
|
10380
10389
|
const labels = (0, import_hooks40.useLabels)();
|
|
10381
10390
|
const tradingContext = (0, import_hooks33.useEventTradingContext)();
|
|
10382
|
-
const eventSyncKey = (0,
|
|
10383
|
-
const resolvedEventTradingState = (0,
|
|
10391
|
+
const eventSyncKey = (0, import_react16.useMemo)(() => resolveEventDetailsSyncKey(event), [event]);
|
|
10392
|
+
const resolvedEventTradingState = (0, import_react16.useMemo)(() => {
|
|
10384
10393
|
return eventTradingState != null ? eventTradingState : (0, import_hooks40.resolveEventTradingState)(event);
|
|
10385
10394
|
}, [event, eventTradingState]);
|
|
10386
10395
|
const scopedSelectedMarket = (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? (_a = tradingContext.selectedMarket) != null ? _a : resolvedEventTradingState.primaryMarket : resolvedEventTradingState.primaryMarket;
|
|
@@ -10404,18 +10413,18 @@ var EventListItemDetailsContent = ({
|
|
|
10404
10413
|
const restMidpoints = (_b = resolvedMidpointsResult.bestMidpointsByOutcomeId) != null ? _b : resolvedMidpointsResult.prices;
|
|
10405
10414
|
const bestMidpoint = resolvedMidpointsResult.bestMidpoint;
|
|
10406
10415
|
const restBestPrices = resolvedMidpointsResult.bestPrices;
|
|
10407
|
-
const bestPrices = (0,
|
|
10416
|
+
const bestPrices = (0, import_react16.useMemo)(
|
|
10408
10417
|
() => (0, import_hooks40.mergeBestPricesPreferringLive)(restBestPrices, wsBestPrices),
|
|
10409
10418
|
[restBestPrices, wsBestPrices]
|
|
10410
10419
|
);
|
|
10411
|
-
const livePrices = (0,
|
|
10420
|
+
const livePrices = (0, import_react16.useMemo)(() => {
|
|
10412
10421
|
if (!restMidpoints.size) return wsLivePrices;
|
|
10413
10422
|
if (!wsLivePrices.size) return restMidpoints;
|
|
10414
10423
|
const merged = new Map(restMidpoints);
|
|
10415
10424
|
for (const [k, v] of wsLivePrices) merged.set(k, v);
|
|
10416
10425
|
return merged;
|
|
10417
10426
|
}, [restMidpoints, wsLivePrices]);
|
|
10418
|
-
(0,
|
|
10427
|
+
(0, import_react16.useEffect)(() => {
|
|
10419
10428
|
if (!tradingContext) return;
|
|
10420
10429
|
if (lastAppliedEventSyncKeyRef.current === eventSyncKey) return;
|
|
10421
10430
|
if ((tradingContext == null ? void 0 : tradingContext.selectedEventId) !== event.id) {
|
|
@@ -10425,7 +10434,7 @@ var EventListItemDetailsContent = ({
|
|
|
10425
10434
|
}
|
|
10426
10435
|
lastAppliedEventSyncKeyRef.current = eventSyncKey;
|
|
10427
10436
|
}, [event, eventSyncKey, tradingContext]);
|
|
10428
|
-
(0,
|
|
10437
|
+
(0, import_react16.useEffect)(() => {
|
|
10429
10438
|
if (!tradingContext) return;
|
|
10430
10439
|
if (!defaultMarketId) return;
|
|
10431
10440
|
if (tradingContext.selectedEventId !== event.id) return;
|
|
@@ -10452,19 +10461,18 @@ var EventListItemDetailsContent = ({
|
|
|
10452
10461
|
tradingContext,
|
|
10453
10462
|
tradingContext == null ? void 0 : tradingContext.selectedEventId
|
|
10454
10463
|
]);
|
|
10455
|
-
const venueMarkets = (0,
|
|
10464
|
+
const venueMarkets = (0, import_react16.useMemo)(
|
|
10456
10465
|
() => resolvedEventTradingState.displayMarkets,
|
|
10457
10466
|
[resolvedEventTradingState.displayMarkets]
|
|
10458
10467
|
);
|
|
10459
|
-
const
|
|
10460
|
-
|
|
10461
|
-
() => sortedVenueMarkets.map((vm) => ({
|
|
10468
|
+
const marketOptions = (0, import_react16.useMemo)(
|
|
10469
|
+
() => venueMarkets.map((vm) => ({
|
|
10462
10470
|
value: vm.id,
|
|
10463
10471
|
label: vm.question
|
|
10464
10472
|
})),
|
|
10465
|
-
[
|
|
10473
|
+
[venueMarkets]
|
|
10466
10474
|
);
|
|
10467
|
-
const volumeLabel = (0,
|
|
10475
|
+
const volumeLabel = (0, import_react16.useMemo)(() => {
|
|
10468
10476
|
const resolvedVolume = resolveDisplayVolume(event.volume, venueMarkets);
|
|
10469
10477
|
if (typeof resolvedVolume !== "number") return "";
|
|
10470
10478
|
return `${config.formatting.formatCompactCurrency(resolvedVolume)} ${labels.eventItemDetails.volumeSuffix}`;
|
|
@@ -10731,11 +10739,11 @@ EventListItemDetails.displayName = "EventListItemDetails";
|
|
|
10731
10739
|
|
|
10732
10740
|
// src/events/market-details/index.tsx
|
|
10733
10741
|
var import_hooks42 = require("@agg-build/hooks");
|
|
10734
|
-
var
|
|
10742
|
+
var import_react19 = require("react");
|
|
10735
10743
|
|
|
10736
10744
|
// src/events/orderbook/index.tsx
|
|
10737
10745
|
var import_hooks41 = require("@agg-build/hooks");
|
|
10738
|
-
var
|
|
10746
|
+
var import_react18 = require("react");
|
|
10739
10747
|
|
|
10740
10748
|
// src/events/orderbook/orderbook.constants.ts
|
|
10741
10749
|
var orderbookRowLimitDefault = 4;
|
|
@@ -10756,7 +10764,7 @@ var orderbookDefaultLabels = {
|
|
|
10756
10764
|
};
|
|
10757
10765
|
|
|
10758
10766
|
// src/events/orderbook/use-center-orderbook-spread.ts
|
|
10759
|
-
var
|
|
10767
|
+
var import_react17 = require("react");
|
|
10760
10768
|
var maxAutoCenterAttempts = 12;
|
|
10761
10769
|
var userScrollKeys = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp", "PageDown", "PageUp", "Home", "End", " "]);
|
|
10762
10770
|
var useCenterOrderbookSpread = ({
|
|
@@ -10767,21 +10775,21 @@ var useCenterOrderbookSpread = ({
|
|
|
10767
10775
|
rowCount,
|
|
10768
10776
|
enabled = true
|
|
10769
10777
|
}) => {
|
|
10770
|
-
const hasUserScrolledRef = (0,
|
|
10771
|
-
const animationFrameRef = (0,
|
|
10772
|
-
const retryCountRef = (0,
|
|
10778
|
+
const hasUserScrolledRef = (0, import_react17.useRef)(false);
|
|
10779
|
+
const animationFrameRef = (0, import_react17.useRef)(null);
|
|
10780
|
+
const retryCountRef = (0, import_react17.useRef)(0);
|
|
10773
10781
|
const resetKey = marketId != null ? marketId : "";
|
|
10774
|
-
const cancelPendingFrame = (0,
|
|
10782
|
+
const cancelPendingFrame = (0, import_react17.useCallback)(() => {
|
|
10775
10783
|
if (animationFrameRef.current === null) return;
|
|
10776
10784
|
window.cancelAnimationFrame(animationFrameRef.current);
|
|
10777
10785
|
animationFrameRef.current = null;
|
|
10778
10786
|
}, []);
|
|
10779
|
-
(0,
|
|
10787
|
+
(0, import_react17.useLayoutEffect)(() => {
|
|
10780
10788
|
hasUserScrolledRef.current = false;
|
|
10781
10789
|
retryCountRef.current = 0;
|
|
10782
10790
|
cancelPendingFrame();
|
|
10783
10791
|
}, [cancelPendingFrame, resetKey]);
|
|
10784
|
-
(0,
|
|
10792
|
+
(0, import_react17.useLayoutEffect)(() => {
|
|
10785
10793
|
const container = containerRef.current;
|
|
10786
10794
|
if (!container) return;
|
|
10787
10795
|
const handleUserScrollIntent = () => {
|
|
@@ -10804,7 +10812,7 @@ var useCenterOrderbookSpread = ({
|
|
|
10804
10812
|
cancelPendingFrame();
|
|
10805
10813
|
};
|
|
10806
10814
|
}, [cancelPendingFrame, containerRef]);
|
|
10807
|
-
(0,
|
|
10815
|
+
(0, import_react17.useLayoutEffect)(() => {
|
|
10808
10816
|
if (!enabled) return;
|
|
10809
10817
|
let isCancelled = false;
|
|
10810
10818
|
const measureAndCenter = () => {
|
|
@@ -10878,7 +10886,7 @@ var useCenterOrderbookSpread = ({
|
|
|
10878
10886
|
mutationObserver == null ? void 0 : mutationObserver.disconnect();
|
|
10879
10887
|
};
|
|
10880
10888
|
}, [cancelPendingFrame, containerRef, enabled, resetKey, rowCount, spreadRef]);
|
|
10881
|
-
const recenter = (0,
|
|
10889
|
+
const recenter = (0, import_react17.useCallback)(() => {
|
|
10882
10890
|
const container = containerRef.current;
|
|
10883
10891
|
const spread = spreadRef.current;
|
|
10884
10892
|
if (!container || !spread) return;
|
|
@@ -11070,8 +11078,8 @@ var Orderbook = ({
|
|
|
11070
11078
|
var _a, _b, _c, _d, _e;
|
|
11071
11079
|
const { enableWebsocketsLogs } = (0, import_hooks41.useAggUiConfig)();
|
|
11072
11080
|
const labels = __spreadValues(__spreadValues({}, orderbookDefaultLabels), labelsProp);
|
|
11073
|
-
const scrollContainerRef = (0,
|
|
11074
|
-
const spreadRowRef = (0,
|
|
11081
|
+
const scrollContainerRef = (0, import_react18.useRef)(null);
|
|
11082
|
+
const spreadRowRef = (0, import_react18.useRef)(null);
|
|
11075
11083
|
const autoCenterMarketId = (_a = marketId != null ? marketId : outcomeId) != null ? _a : null;
|
|
11076
11084
|
const maxVisibleRows = Math.max(1, visibleRows);
|
|
11077
11085
|
const totalVisibleRows = maxVisibleRows * 2 + 1;
|
|
@@ -11088,7 +11096,7 @@ var Orderbook = ({
|
|
|
11088
11096
|
const spreadEntry = entries.find(
|
|
11089
11097
|
(e) => e.kind === "spread"
|
|
11090
11098
|
);
|
|
11091
|
-
(0,
|
|
11099
|
+
(0, import_react18.useEffect)(() => {
|
|
11092
11100
|
var _a2, _b2;
|
|
11093
11101
|
if (!enableWebsocketsLogs) return;
|
|
11094
11102
|
console.debug("[AggUI][orderbook] component_rendered", {
|
|
@@ -11482,14 +11490,14 @@ var MarketDetailsContent = ({
|
|
|
11482
11490
|
const isDarkTheme = theme === "dark";
|
|
11483
11491
|
const labels = (0, import_hooks42.useLabels)();
|
|
11484
11492
|
const tradingContext = (0, import_hooks42.useEventTradingContext)();
|
|
11485
|
-
const detailsContentId = (0,
|
|
11493
|
+
const detailsContentId = (0, import_react19.useId)();
|
|
11486
11494
|
const tradeSide = (_a = tradingContext == null ? void 0 : tradingContext.tradeSide) != null ? _a : "buy";
|
|
11487
11495
|
const wsLivePrices = (0, import_hooks42.useLiveOutcomePrices)(venueMarkets);
|
|
11488
11496
|
const wsBestPrices = (0, import_hooks42.useLiveBestPrices)(venueMarkets);
|
|
11489
|
-
const resolvedMarket = (0,
|
|
11497
|
+
const resolvedMarket = (0, import_react19.useMemo)(() => {
|
|
11490
11498
|
return resolveMarketFromVenueMarkets(venueMarkets, marketId);
|
|
11491
11499
|
}, [venueMarkets, marketId]);
|
|
11492
|
-
const scopedResolvedMarket = (0,
|
|
11500
|
+
const scopedResolvedMarket = (0, import_react19.useMemo)(() => {
|
|
11493
11501
|
var _a2, _b2;
|
|
11494
11502
|
if (!resolvedMarket) return null;
|
|
11495
11503
|
return (_b2 = (_a2 = resolvedMarket.venueMarkets.find((venueMarket) => venueMarket.id === resolvedMarket.id)) != null ? _a2 : resolvedMarket.venueMarkets[0]) != null ? _b2 : null;
|
|
@@ -11511,17 +11519,17 @@ var MarketDetailsContent = ({
|
|
|
11511
11519
|
const clusterBestMidpoint = clusterMidpointResult.bestMidpoint;
|
|
11512
11520
|
const clusterBestMidpointVenue = clusterMidpointResult.bestMidpointVenue;
|
|
11513
11521
|
const clusterBestPricesRest = clusterMidpointResult.bestPrices;
|
|
11514
|
-
const clusterBestPrices = (0,
|
|
11522
|
+
const clusterBestPrices = (0, import_react19.useMemo)(
|
|
11515
11523
|
() => (0, import_hooks42.mergeBestPricesPreferringLive)(clusterBestPricesRest, wsBestPrices),
|
|
11516
11524
|
[clusterBestPricesRest, wsBestPrices]
|
|
11517
11525
|
);
|
|
11518
11526
|
const clusterBestPriceVenuesByOutcomeId = clusterMidpointResult.bestPriceVenuesByOutcomeId;
|
|
11519
|
-
const clusterMidpointMarkets = (0,
|
|
11527
|
+
const clusterMidpointMarkets = (0, import_react19.useMemo)(() => {
|
|
11520
11528
|
var _a2;
|
|
11521
11529
|
if (!resolvedMarket) return [];
|
|
11522
11530
|
return (_a2 = resolvedMarket.venueMarkets) != null ? _a2 : [];
|
|
11523
11531
|
}, [resolvedMarket]);
|
|
11524
|
-
const tradableVenues = (0,
|
|
11532
|
+
const tradableVenues = (0, import_react19.useMemo)(() => {
|
|
11525
11533
|
var _a2;
|
|
11526
11534
|
if (clusterMidpointMarkets.length === 0) return null;
|
|
11527
11535
|
if (clusterMidpoints.size === 0) return null;
|
|
@@ -11536,7 +11544,7 @@ var MarketDetailsContent = ({
|
|
|
11536
11544
|
}
|
|
11537
11545
|
return set;
|
|
11538
11546
|
}, [clusterMidpointMarkets, clusterMidpoints]);
|
|
11539
|
-
const model = (0,
|
|
11547
|
+
const model = (0, import_react19.useMemo)(() => {
|
|
11540
11548
|
return buildMarketDetailsModel({
|
|
11541
11549
|
venueMarkets,
|
|
11542
11550
|
marketId,
|
|
@@ -11555,7 +11563,7 @@ var MarketDetailsContent = ({
|
|
|
11555
11563
|
title2,
|
|
11556
11564
|
tradableVenues
|
|
11557
11565
|
]);
|
|
11558
|
-
const livePrices = (0,
|
|
11566
|
+
const livePrices = (0, import_react19.useMemo)(() => {
|
|
11559
11567
|
const merged = /* @__PURE__ */ new Map();
|
|
11560
11568
|
if (midpointsFallback == null ? void 0 : midpointsFallback.size) {
|
|
11561
11569
|
for (const [outcomeId, price] of midpointsFallback) {
|
|
@@ -11570,37 +11578,37 @@ var MarketDetailsContent = ({
|
|
|
11570
11578
|
for (const [k, v] of wsLivePrices) merged.set(k, v);
|
|
11571
11579
|
return merged;
|
|
11572
11580
|
}, [clusterMidpoints, midpointsFallback, wsLivePrices]);
|
|
11573
|
-
const scopedMarketForCard = (0,
|
|
11581
|
+
const scopedMarketForCard = (0, import_react19.useMemo)(() => {
|
|
11574
11582
|
var _a2;
|
|
11575
11583
|
if (!model) return null;
|
|
11576
11584
|
return (_a2 = model.market.venueMarkets.find((venueMarket) => venueMarket.id === model.market.id)) != null ? _a2 : model.primaryVenueMarket;
|
|
11577
11585
|
}, [model]);
|
|
11578
|
-
const marketTradingState = (0,
|
|
11586
|
+
const marketTradingState = (0, import_react19.useMemo)(() => {
|
|
11579
11587
|
return (0, import_hooks42.resolveMarketTradingState)(scopedMarketForCard);
|
|
11580
11588
|
}, [scopedMarketForCard]);
|
|
11581
11589
|
const isOutcomeSelectionLocked = marketTradingState.isTradingDisabled;
|
|
11582
11590
|
const isUpcomingMarket = marketTradingState.kind === "unopened";
|
|
11583
11591
|
const marketStatePresentation = resolveTradingStatePresentation(labels, marketTradingState);
|
|
11584
|
-
const marketDetailsTabs = (0,
|
|
11592
|
+
const marketDetailsTabs = (0, import_react19.useMemo)(() => {
|
|
11585
11593
|
return getMarketDetailsTabs(labels);
|
|
11586
11594
|
}, [labels]);
|
|
11587
|
-
const [selectedTab, setSelectedTab] = (0,
|
|
11595
|
+
const [selectedTab, setSelectedTab] = (0, import_react19.useState)(
|
|
11588
11596
|
() => resolveInitialTab(defaultTab)
|
|
11589
11597
|
);
|
|
11590
|
-
const [isOpened, setIsOpened] = (0,
|
|
11591
|
-
(0,
|
|
11598
|
+
const [isOpened, setIsOpened] = (0, import_react19.useState)(controlledIsOpened);
|
|
11599
|
+
(0, import_react19.useEffect)(() => {
|
|
11592
11600
|
setSelectedTab(resolveInitialTab(defaultTab));
|
|
11593
11601
|
}, [defaultTab]);
|
|
11594
|
-
(0,
|
|
11602
|
+
(0, import_react19.useEffect)(() => {
|
|
11595
11603
|
setIsOpened(controlledIsOpened);
|
|
11596
11604
|
}, [controlledIsOpened]);
|
|
11597
11605
|
const selectedTimeRange = config.chart.selectedChartTimeRange;
|
|
11598
11606
|
const setSelectedTimeRange = config.chart.setSelectedChartTimeRange;
|
|
11599
11607
|
const effectiveSelectedTab = isResolvedMarket ? "graph" : selectedTab;
|
|
11600
|
-
const [chartRangeOverride, setChartRangeOverride] = (0,
|
|
11608
|
+
const [chartRangeOverride, setChartRangeOverride] = (0, import_react19.useState)(null);
|
|
11601
11609
|
const effectiveChartTimeRange = isResolvedMarket ? "ALL" : chartRangeOverride != null ? chartRangeOverride : selectedTimeRange;
|
|
11602
|
-
const [selectedChartType, setSelectedChartType] = (0,
|
|
11603
|
-
const scopedSelectedOutcomeState = (0,
|
|
11610
|
+
const [selectedChartType, setSelectedChartType] = (0, import_react19.useState)("line");
|
|
11611
|
+
const scopedSelectedOutcomeState = (0, import_react19.useMemo)(() => {
|
|
11604
11612
|
if (!model) {
|
|
11605
11613
|
return {
|
|
11606
11614
|
outcomeId: null,
|
|
@@ -11622,15 +11630,15 @@ var MarketDetailsContent = ({
|
|
|
11622
11630
|
const selectedOutcomeId = scopedSelectedOutcomeState.outcomeId;
|
|
11623
11631
|
const selectedOutcomeLabel = (_c = scopedSelectedOutcomeState.outcomeLabel) != null ? _c : null;
|
|
11624
11632
|
const selectOutcome = tradingContext == null ? void 0 : tradingContext.selectOutcome;
|
|
11625
|
-
const [selectedGraphVenue, setSelectedGraphVenue] = (0,
|
|
11626
|
-
const [chartOutcomeLabel, setChartOutcomeLabel] = (0,
|
|
11627
|
-
(0,
|
|
11633
|
+
const [selectedGraphVenue, setSelectedGraphVenue] = (0, import_react19.useState)(null);
|
|
11634
|
+
const [chartOutcomeLabel, setChartOutcomeLabel] = (0, import_react19.useState)(selectedOutcomeLabel);
|
|
11635
|
+
(0, import_react19.useEffect)(() => {
|
|
11628
11636
|
if (!isOpened) return;
|
|
11629
11637
|
if (selectedOutcomeLabel) {
|
|
11630
11638
|
setChartOutcomeLabel(selectedOutcomeLabel);
|
|
11631
11639
|
}
|
|
11632
11640
|
}, [isOpened]);
|
|
11633
|
-
(0,
|
|
11641
|
+
(0, import_react19.useEffect)(() => {
|
|
11634
11642
|
var _a2;
|
|
11635
11643
|
if (!isOpened || !model) return;
|
|
11636
11644
|
if (isOutcomeSelectionLocked) return;
|
|
@@ -11654,7 +11662,7 @@ var MarketDetailsContent = ({
|
|
|
11654
11662
|
tradingContext == null ? void 0 : tradingContext.selectedMarketId,
|
|
11655
11663
|
selectOutcome
|
|
11656
11664
|
]);
|
|
11657
|
-
const headerOutcomeItems = (0,
|
|
11665
|
+
const headerOutcomeItems = (0, import_react19.useMemo)(() => {
|
|
11658
11666
|
if (!model) return [];
|
|
11659
11667
|
const items = resolveHeaderOutcomeItems(model.market.venueMarkets, scopedMarketForCard);
|
|
11660
11668
|
return items.map((item) => {
|
|
@@ -11708,7 +11716,7 @@ var MarketDetailsContent = ({
|
|
|
11708
11716
|
tradeSide,
|
|
11709
11717
|
wsLivePrices
|
|
11710
11718
|
]);
|
|
11711
|
-
const headlineProbability = (0,
|
|
11719
|
+
const headlineProbability = (0, import_react19.useMemo)(() => {
|
|
11712
11720
|
var _a2, _b2, _c2, _d2;
|
|
11713
11721
|
if (!model || !scopedMarketForCard) return void 0;
|
|
11714
11722
|
if (isResolvedMarket) {
|
|
@@ -11744,7 +11752,7 @@ var MarketDetailsContent = ({
|
|
|
11744
11752
|
midpointsFallback,
|
|
11745
11753
|
wsLivePrices
|
|
11746
11754
|
]);
|
|
11747
|
-
const selectedOutcomesByVenue = (0,
|
|
11755
|
+
const selectedOutcomesByVenue = (0, import_react19.useMemo)(() => {
|
|
11748
11756
|
if (!model) return [];
|
|
11749
11757
|
return collectEligibleVenueOutcomes({
|
|
11750
11758
|
venueMarkets: model.market.venueMarkets,
|
|
@@ -11758,7 +11766,7 @@ var MarketDetailsContent = ({
|
|
|
11758
11766
|
}, [model, selectedOutcomeLabel, selectedOutcomeId]);
|
|
11759
11767
|
const resolvedChartOutcomeLabel = chartOutcomeLabel != null ? chartOutcomeLabel : selectedOutcomeLabel;
|
|
11760
11768
|
const chartSelectedOutcomeId = selectedOutcomeId && resolvedChartOutcomeLabel === selectedOutcomeLabel ? selectedOutcomeId : null;
|
|
11761
|
-
const chartOutcomesByVenue = (0,
|
|
11769
|
+
const chartOutcomesByVenue = (0, import_react19.useMemo)(() => {
|
|
11762
11770
|
if (!model) return [];
|
|
11763
11771
|
return resolveChartVenueOutcomes({
|
|
11764
11772
|
eligibleVenueOutcomes: collectEligibleVenueOutcomes({
|
|
@@ -11775,7 +11783,7 @@ var MarketDetailsContent = ({
|
|
|
11775
11783
|
const primaryVenueMarketId = (_f = (_e = selectedOutcomesByVenue[0]) == null ? void 0 : _e.market.id) != null ? _f : null;
|
|
11776
11784
|
const primaryOutcomeId = (_h = (_g = selectedOutcomesByVenue[0]) == null ? void 0 : _g.outcome.id) != null ? _h : null;
|
|
11777
11785
|
const chartPrimaryOutcomeId = (_j = (_i = chartOutcomesByVenue[0]) == null ? void 0 : _i.outcome.id) != null ? _j : null;
|
|
11778
|
-
const chartVenueOutcomeIds = (0,
|
|
11786
|
+
const chartVenueOutcomeIds = (0, import_react19.useMemo)(() => {
|
|
11779
11787
|
return chartOutcomesByVenue.map((item) => item.outcome.id);
|
|
11780
11788
|
}, [chartOutcomesByVenue]);
|
|
11781
11789
|
const {
|
|
@@ -11796,12 +11804,12 @@ var MarketDetailsContent = ({
|
|
|
11796
11804
|
// instead of refetching on every bucket-boundary rollover.
|
|
11797
11805
|
rangeKey: rollingWindow.range
|
|
11798
11806
|
});
|
|
11799
|
-
const hasAutoFallenBackRangeRef = (0,
|
|
11800
|
-
(0,
|
|
11807
|
+
const hasAutoFallenBackRangeRef = (0, import_react19.useRef)(false);
|
|
11808
|
+
(0, import_react19.useEffect)(() => {
|
|
11801
11809
|
hasAutoFallenBackRangeRef.current = false;
|
|
11802
11810
|
setChartRangeOverride(null);
|
|
11803
11811
|
}, [chartPrimaryOutcomeId]);
|
|
11804
|
-
(0,
|
|
11812
|
+
(0, import_react19.useEffect)(() => {
|
|
11805
11813
|
if (!shouldAutoFallbackToAllRange({
|
|
11806
11814
|
chartData: marketChartData,
|
|
11807
11815
|
isLoading: isMarketChartLoading,
|
|
@@ -11832,14 +11840,14 @@ var MarketDetailsContent = ({
|
|
|
11832
11840
|
})),
|
|
11833
11841
|
live
|
|
11834
11842
|
});
|
|
11835
|
-
const marketOrderbookDataById = (0,
|
|
11843
|
+
const marketOrderbookDataById = (0, import_react19.useMemo)(() => {
|
|
11836
11844
|
var _a2;
|
|
11837
11845
|
return (_a2 = marketOrderbookResult.dataById) != null ? _a2 : {};
|
|
11838
11846
|
}, [marketOrderbookResult]);
|
|
11839
11847
|
const isOrderBookLoading = marketOrderbookResult.isLoading;
|
|
11840
11848
|
const orderBookError = marketOrderbookResult.error;
|
|
11841
11849
|
const refetchOrderBook = marketOrderbookResult.refetch;
|
|
11842
|
-
const aggregatedOrderbookRows = (0,
|
|
11850
|
+
const aggregatedOrderbookRows = (0, import_react19.useMemo)(() => {
|
|
11843
11851
|
return mergeVenueOutcomeOrderbooks({
|
|
11844
11852
|
eligibleOutcomes: selectedOutcomesByVenue,
|
|
11845
11853
|
orderbooksByOutcomeId: marketOrderbookDataById
|
|
@@ -11847,7 +11855,7 @@ var MarketDetailsContent = ({
|
|
|
11847
11855
|
}, [marketOrderbookDataById, selectedOutcomesByVenue]);
|
|
11848
11856
|
const askRows = aggregatedOrderbookRows.askRows;
|
|
11849
11857
|
const bidRows = aggregatedOrderbookRows.bidRows;
|
|
11850
|
-
const unifiedEntries = (0,
|
|
11858
|
+
const unifiedEntries = (0, import_react19.useMemo)(() => {
|
|
11851
11859
|
return resolveUnifiedOrderBookEntries({
|
|
11852
11860
|
askRows,
|
|
11853
11861
|
bidRows,
|
|
@@ -11855,7 +11863,7 @@ var MarketDetailsContent = ({
|
|
|
11855
11863
|
spread: aggregatedOrderbookRows.spread
|
|
11856
11864
|
});
|
|
11857
11865
|
}, [aggregatedOrderbookRows.midpoint, aggregatedOrderbookRows.spread, askRows, bidRows]);
|
|
11858
|
-
const orderbookSnapshotKey = (0,
|
|
11866
|
+
const orderbookSnapshotKey = (0, import_react19.useMemo)(() => {
|
|
11859
11867
|
if (selectedOutcomesByVenue.length === 0) return null;
|
|
11860
11868
|
return selectedOutcomesByVenue.map((item) => {
|
|
11861
11869
|
var _a2, _b2;
|
|
@@ -11863,13 +11871,13 @@ var MarketDetailsContent = ({
|
|
|
11863
11871
|
return `${item.outcomeId}:${snapshotVersion}`;
|
|
11864
11872
|
}).join("|");
|
|
11865
11873
|
}, [marketOrderbookDataById, selectedOutcomesByVenue]);
|
|
11866
|
-
const chartAvailableOutcomesByVenue = (0,
|
|
11874
|
+
const chartAvailableOutcomesByVenue = (0, import_react19.useMemo)(() => {
|
|
11867
11875
|
return filterChartVenueOutcomesByRenderableVenues({
|
|
11868
11876
|
chartData: marketChartData,
|
|
11869
11877
|
venueOutcomes: chartOutcomesByVenue
|
|
11870
11878
|
});
|
|
11871
11879
|
}, [chartOutcomesByVenue, marketChartData]);
|
|
11872
|
-
const graphSeries = (0,
|
|
11880
|
+
const graphSeries = (0, import_react19.useMemo)(() => {
|
|
11873
11881
|
var _a2, _b2, _c2, _d2;
|
|
11874
11882
|
const baseColor = resolveSeriesColor(
|
|
11875
11883
|
(_d2 = (_c2 = selectedGraphVenue != null ? selectedGraphVenue : (_a2 = chartAvailableOutcomesByVenue[0]) == null ? void 0 : _a2.venue) != null ? _c2 : (_b2 = chartOutcomesByVenue[0]) == null ? void 0 : _b2.venue) != null ? _d2 : "polymarket",
|
|
@@ -11901,14 +11909,14 @@ var MarketDetailsContent = ({
|
|
|
11901
11909
|
chartAvailableOutcomesByVenue,
|
|
11902
11910
|
chartOutcomesByVenue
|
|
11903
11911
|
]);
|
|
11904
|
-
const graphLiveState = (0,
|
|
11912
|
+
const graphLiveState = (0, import_react19.useMemo)(() => {
|
|
11905
11913
|
return resolveMarketChartLiveState({
|
|
11906
11914
|
chartData: marketChartData,
|
|
11907
11915
|
selectedVenue: selectedGraphVenue,
|
|
11908
11916
|
transformProbability: (value) => value
|
|
11909
11917
|
});
|
|
11910
11918
|
}, [marketChartData, selectedGraphVenue]);
|
|
11911
|
-
const otherRows = (0,
|
|
11919
|
+
const otherRows = (0, import_react19.useMemo)(() => {
|
|
11912
11920
|
if (!model) return [];
|
|
11913
11921
|
return resolveOtherTabRows(model.market, labels);
|
|
11914
11922
|
}, [labels, model]);
|
|
@@ -11999,7 +12007,7 @@ var MarketDetailsContent = ({
|
|
|
11999
12007
|
title: labels.marketDetails.orderBookEmptyTitle,
|
|
12000
12008
|
description: labels.marketDetails.orderBookEmptyDescription
|
|
12001
12009
|
} : { kind: "data" };
|
|
12002
|
-
(0,
|
|
12010
|
+
(0, import_react19.useEffect)(() => {
|
|
12003
12011
|
if (!selectedGraphVenue) {
|
|
12004
12012
|
return;
|
|
12005
12013
|
}
|
|
@@ -12514,8 +12522,8 @@ var MarketDetailsList = ({
|
|
|
12514
12522
|
const labels = (0, import_hooks42.useLabels)();
|
|
12515
12523
|
const tradingContext = (0, import_hooks42.useEventTradingContext)();
|
|
12516
12524
|
const selectedMarketId = (_a = tradingContext == null ? void 0 : tradingContext.selectedMarketId) != null ? _a : null;
|
|
12517
|
-
const [expandedMarketId, setExpandedMarketId] = (0,
|
|
12518
|
-
const [areResolvedMarketsVisible, setAreResolvedMarketsVisible] = (0,
|
|
12525
|
+
const [expandedMarketId, setExpandedMarketId] = (0, import_react19.useState)(null);
|
|
12526
|
+
const [areResolvedMarketsVisible, setAreResolvedMarketsVisible] = (0, import_react19.useState)(false);
|
|
12519
12527
|
const resolvedEventId = eventId || "";
|
|
12520
12528
|
const {
|
|
12521
12529
|
markets: rawMarkets,
|
|
@@ -12528,7 +12536,7 @@ var MarketDetailsList = ({
|
|
|
12528
12536
|
sortBy: "yesPrice",
|
|
12529
12537
|
sortDir: "desc"
|
|
12530
12538
|
});
|
|
12531
|
-
const sourceMarkets = (0,
|
|
12539
|
+
const sourceMarkets = (0, import_react19.useMemo)(() => {
|
|
12532
12540
|
var _a2;
|
|
12533
12541
|
if ((_a2 = eventTradingState == null ? void 0 : eventTradingState.marketStates) == null ? void 0 : _a2.length) {
|
|
12534
12542
|
return eventTradingState.marketStates.map((item) => item.market);
|
|
@@ -12536,12 +12544,11 @@ var MarketDetailsList = ({
|
|
|
12536
12544
|
if (providedMarkets) return providedMarkets;
|
|
12537
12545
|
return rawMarkets;
|
|
12538
12546
|
}, [eventTradingState == null ? void 0 : eventTradingState.marketStates, providedMarkets, rawMarkets]);
|
|
12539
|
-
const isResolvedEvent = (0,
|
|
12547
|
+
const isResolvedEvent = (0, import_react19.useMemo)(() => {
|
|
12540
12548
|
return resolveIsResolvedEvent(sourceMarkets, eventTradingState);
|
|
12541
12549
|
}, [eventTradingState, sourceMarkets]);
|
|
12542
|
-
const groupedMarkets = (0,
|
|
12543
|
-
|
|
12544
|
-
if (sortedMarkets.length === 0) {
|
|
12550
|
+
const groupedMarkets = (0, import_react19.useMemo)(() => {
|
|
12551
|
+
if (sourceMarkets.length === 0) {
|
|
12545
12552
|
return {
|
|
12546
12553
|
primary: [],
|
|
12547
12554
|
closed: [],
|
|
@@ -12550,9 +12557,9 @@ var MarketDetailsList = ({
|
|
|
12550
12557
|
};
|
|
12551
12558
|
}
|
|
12552
12559
|
if (isResolvedEvent) {
|
|
12553
|
-
const winnerMarketId = resolveResolvedWinnerMarketId(
|
|
12560
|
+
const winnerMarketId = resolveResolvedWinnerMarketId(sourceMarkets, eventTradingState);
|
|
12554
12561
|
return {
|
|
12555
|
-
primary: moveMarketToFront(
|
|
12562
|
+
primary: moveMarketToFront(sourceMarkets, winnerMarketId),
|
|
12556
12563
|
upcoming: [],
|
|
12557
12564
|
resolved: []
|
|
12558
12565
|
};
|
|
@@ -12561,7 +12568,7 @@ var MarketDetailsList = ({
|
|
|
12561
12568
|
const upcoming = [];
|
|
12562
12569
|
const resolved = [];
|
|
12563
12570
|
const closed = [];
|
|
12564
|
-
|
|
12571
|
+
sourceMarkets.forEach((market) => {
|
|
12565
12572
|
const marketStateKind = (0, import_hooks42.resolveMarketTradingState)(market).kind;
|
|
12566
12573
|
if (marketStateKind === "resolved") {
|
|
12567
12574
|
resolved.push(market);
|
|
@@ -12580,21 +12587,21 @@ var MarketDetailsList = ({
|
|
|
12580
12587
|
return { primary, upcoming, resolved, closed };
|
|
12581
12588
|
}, [eventTradingState, isResolvedEvent, sourceMarkets]);
|
|
12582
12589
|
const shouldShowResolvedToggle = !isResolvedEvent && groupedMarkets.resolved.length > 0;
|
|
12583
|
-
const visibleResolvedMarkets = (0,
|
|
12590
|
+
const visibleResolvedMarkets = (0, import_react19.useMemo)(() => {
|
|
12584
12591
|
if (isResolvedEvent || areResolvedMarketsVisible) return groupedMarkets.resolved;
|
|
12585
12592
|
return [];
|
|
12586
12593
|
}, [areResolvedMarketsVisible, groupedMarkets.resolved, isResolvedEvent]);
|
|
12587
|
-
const displayedMarkets = (0,
|
|
12594
|
+
const displayedMarkets = (0, import_react19.useMemo)(() => {
|
|
12588
12595
|
return [...groupedMarkets.primary, ...visibleResolvedMarkets];
|
|
12589
12596
|
}, [groupedMarkets.primary, visibleResolvedMarkets]);
|
|
12590
12597
|
const hasPrefetchedMarkets = !!providedMarkets || !!((_b = eventTradingState == null ? void 0 : eventTradingState.marketStates) == null ? void 0 : _b.length);
|
|
12591
|
-
const midpointEligibleMarkets = (0,
|
|
12598
|
+
const midpointEligibleMarkets = (0, import_react19.useMemo)(() => {
|
|
12592
12599
|
return displayedMarkets.filter(
|
|
12593
12600
|
(market) => (0, import_hooks42.resolveMarketTradingState)(market).kind !== "resolved"
|
|
12594
12601
|
);
|
|
12595
12602
|
}, [displayedMarkets]);
|
|
12596
12603
|
const { prices: midpointsFallback, venueByOutcomeId: midpointsFallbackVenues } = (0, import_hooks42.useViewportMidpoints)(midpointEligibleMarkets);
|
|
12597
|
-
(0,
|
|
12604
|
+
(0, import_react19.useEffect)(() => {
|
|
12598
12605
|
if (isResolvedEvent) {
|
|
12599
12606
|
setAreResolvedMarketsVisible(false);
|
|
12600
12607
|
return;
|
|
@@ -12603,7 +12610,7 @@ var MarketDetailsList = ({
|
|
|
12603
12610
|
setAreResolvedMarketsVisible(false);
|
|
12604
12611
|
}
|
|
12605
12612
|
}, [groupedMarkets.resolved.length, isResolvedEvent]);
|
|
12606
|
-
(0,
|
|
12613
|
+
(0, import_react19.useEffect)(() => {
|
|
12607
12614
|
if (displayedMarkets.length === 0) return;
|
|
12608
12615
|
if (selectedMarketId && displayedMarkets.some((market) => market.id === selectedMarketId)) {
|
|
12609
12616
|
return;
|
|
@@ -12620,7 +12627,7 @@ var MarketDetailsList = ({
|
|
|
12620
12627
|
if (!autoSelectFallbackMarket) return;
|
|
12621
12628
|
tradingContext == null ? void 0 : tradingContext.selectMarket(fallbackSelectableMarket.id, fallbackSelectableMarket);
|
|
12622
12629
|
}, [autoSelectFallbackMarket, displayedMarkets, selectedMarketId, sourceMarkets, tradingContext]);
|
|
12623
|
-
(0,
|
|
12630
|
+
(0, import_react19.useEffect)(() => {
|
|
12624
12631
|
if (!expandedMarketId) return;
|
|
12625
12632
|
if (displayedMarkets.some((market) => market.id === expandedMarketId)) return;
|
|
12626
12633
|
setExpandedMarketId(null);
|
|
@@ -12730,11 +12737,128 @@ MarketDetailsList.displayName = "MarketDetailsList";
|
|
|
12730
12737
|
var import_hooks44 = require("@agg-build/hooks");
|
|
12731
12738
|
var import_sdk14 = require("@agg-build/sdk");
|
|
12732
12739
|
var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
|
|
12740
|
+
var import_react22 = require("react");
|
|
12741
|
+
|
|
12742
|
+
// src/events/list/category-sidebar.tsx
|
|
12733
12743
|
var import_react20 = require("react");
|
|
12744
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
12745
|
+
var rowBase = cn(
|
|
12746
|
+
"flex min-h-11 w-full items-center gap-3 rounded-[6px] px-3 py-3",
|
|
12747
|
+
"text-left text-agg-sm font-agg-normal leading-agg-5",
|
|
12748
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-1 focus-visible:ring-offset-agg-secondary"
|
|
12749
|
+
);
|
|
12750
|
+
var idleRowClassName = cn(
|
|
12751
|
+
rowBase,
|
|
12752
|
+
"cursor-pointer text-agg-foreground hover:bg-agg-secondary-hover"
|
|
12753
|
+
);
|
|
12754
|
+
var selectedRowClassName = cn(rowBase, "cursor-pointer bg-agg-primary/10 text-agg-primary");
|
|
12755
|
+
var CategorySidebar = ({
|
|
12756
|
+
baseCategoryId,
|
|
12757
|
+
childrenByParentId,
|
|
12758
|
+
categoryPath,
|
|
12759
|
+
collapsedCategoryIds,
|
|
12760
|
+
totalEventCount,
|
|
12761
|
+
labels,
|
|
12762
|
+
onSelectAll,
|
|
12763
|
+
onToggleCategory
|
|
12764
|
+
}) => {
|
|
12765
|
+
const isDrilledIn = categoryPath.length > 0;
|
|
12766
|
+
const sortedBaseChildren = (0, import_react20.useMemo)(() => {
|
|
12767
|
+
var _a;
|
|
12768
|
+
if (!baseCategoryId) return [];
|
|
12769
|
+
const children = [...(_a = childrenByParentId.get(baseCategoryId)) != null ? _a : []];
|
|
12770
|
+
return children.sort((a, b) => {
|
|
12771
|
+
var _a2, _b, _c, _d;
|
|
12772
|
+
const aHasChildren = ((_b = (_a2 = childrenByParentId.get(a.id)) == null ? void 0 : _a2.length) != null ? _b : 0) > 0;
|
|
12773
|
+
const bHasChildren = ((_d = (_c = childrenByParentId.get(b.id)) == null ? void 0 : _c.length) != null ? _d : 0) > 0;
|
|
12774
|
+
if (aHasChildren === bHasChildren) return 0;
|
|
12775
|
+
return aHasChildren ? -1 : 1;
|
|
12776
|
+
});
|
|
12777
|
+
}, [baseCategoryId, childrenByParentId]);
|
|
12778
|
+
const renderRow = ({
|
|
12779
|
+
entry,
|
|
12780
|
+
isExpanded,
|
|
12781
|
+
isSelected,
|
|
12782
|
+
onClick
|
|
12783
|
+
}) => {
|
|
12784
|
+
var _a, _b;
|
|
12785
|
+
const hasKnownChildren = ((_b = (_a = childrenByParentId.get(entry.id)) == null ? void 0 : _a.length) != null ? _b : 0) > 0;
|
|
12786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
12787
|
+
"button",
|
|
12788
|
+
{
|
|
12789
|
+
type: "button",
|
|
12790
|
+
"aria-current": isSelected ? "true" : void 0,
|
|
12791
|
+
className: isSelected ? selectedRowClassName : idleRowClassName,
|
|
12792
|
+
onClick,
|
|
12793
|
+
children: [
|
|
12794
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "min-w-0 flex-1 truncate first-letter:uppercase", children: entry.label }),
|
|
12795
|
+
hasKnownChildren ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
12796
|
+
Icon,
|
|
12797
|
+
{
|
|
12798
|
+
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
12799
|
+
size: "small",
|
|
12800
|
+
color: "currentColor",
|
|
12801
|
+
className: "shrink-0 text-agg-muted-foreground"
|
|
12802
|
+
}
|
|
12803
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "shrink-0 text-agg-muted-foreground", children: entry.eventCount })
|
|
12804
|
+
]
|
|
12805
|
+
},
|
|
12806
|
+
entry.id
|
|
12807
|
+
);
|
|
12808
|
+
};
|
|
12809
|
+
const renderBranch = (category, depth) => {
|
|
12810
|
+
var _a, _b, _c, _d, _e;
|
|
12811
|
+
const label2 = (_a = category.displayName) != null ? _a : category.name;
|
|
12812
|
+
const entry = {
|
|
12813
|
+
id: category.id,
|
|
12814
|
+
label: label2,
|
|
12815
|
+
eventCount: (_b = category.eventCount) != null ? _b : 0
|
|
12816
|
+
};
|
|
12817
|
+
const childCategories = (_c = childrenByParentId.get(category.id)) != null ? _c : [];
|
|
12818
|
+
const hasKnownChildren = childCategories.length > 0;
|
|
12819
|
+
const isExpanded = ((_d = categoryPath[depth]) == null ? void 0 : _d.id) === category.id && !collapsedCategoryIds.has(category.id);
|
|
12820
|
+
const isSelected = ((_e = categoryPath[depth]) == null ? void 0 : _e.id) === category.id && categoryPath.length === depth + 1;
|
|
12821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex w-full flex-col", children: [
|
|
12822
|
+
renderRow({
|
|
12823
|
+
entry,
|
|
12824
|
+
isExpanded,
|
|
12825
|
+
isSelected,
|
|
12826
|
+
onClick: () => onToggleCategory({ entry, depth, hasKnownChildren, isExpanded, isSelected })
|
|
12827
|
+
}),
|
|
12828
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
12829
|
+
"div",
|
|
12830
|
+
{
|
|
12831
|
+
className: cn(
|
|
12832
|
+
"grid transition-[grid-template-rows] duration-150 ease-in-out motion-reduce:transition-none",
|
|
12833
|
+
isExpanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
12834
|
+
),
|
|
12835
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "flex w-full flex-col gap-1 pl-4 pt-1", children: childCategories.map((child) => renderBranch(child, depth + 1)) }) })
|
|
12836
|
+
}
|
|
12837
|
+
)
|
|
12838
|
+
] }, category.id);
|
|
12839
|
+
};
|
|
12840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex w-full flex-col gap-1", children: [
|
|
12841
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
12842
|
+
"button",
|
|
12843
|
+
{
|
|
12844
|
+
type: "button",
|
|
12845
|
+
"aria-current": !isDrilledIn ? "true" : void 0,
|
|
12846
|
+
className: !isDrilledIn ? selectedRowClassName : idleRowClassName,
|
|
12847
|
+
onClick: onSelectAll,
|
|
12848
|
+
children: [
|
|
12849
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "min-w-0 flex-1 truncate", children: labels.subcategoriesAll }),
|
|
12850
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "shrink-0 text-agg-muted-foreground", children: totalEventCount })
|
|
12851
|
+
]
|
|
12852
|
+
}
|
|
12853
|
+
),
|
|
12854
|
+
sortedBaseChildren.map((category) => renderBranch(category, 0))
|
|
12855
|
+
] });
|
|
12856
|
+
};
|
|
12857
|
+
CategorySidebar.displayName = "CategorySidebar";
|
|
12734
12858
|
|
|
12735
12859
|
// src/events/list/event-list-tabs.tsx
|
|
12736
12860
|
var import_hooks43 = require("@agg-build/hooks");
|
|
12737
|
-
var
|
|
12861
|
+
var import_react21 = require("react");
|
|
12738
12862
|
|
|
12739
12863
|
// src/events/list/event-list.constants.ts
|
|
12740
12864
|
var import_sdk13 = require("@agg-build/sdk");
|
|
@@ -12801,16 +12925,16 @@ var getDefaultEventListTabs = (labels) => {
|
|
|
12801
12925
|
};
|
|
12802
12926
|
|
|
12803
12927
|
// src/events/list/event-list-tabs.tsx
|
|
12804
|
-
var
|
|
12928
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
12805
12929
|
var renderTabIcon = (tab, isActive) => {
|
|
12806
12930
|
if (tab.iconName === "warning-filled") {
|
|
12807
|
-
return /* @__PURE__ */ (0,
|
|
12931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Icon, { name: "warning-filled", size: "small", color: "currentColor" });
|
|
12808
12932
|
}
|
|
12809
12933
|
if (tab.venueLogo) {
|
|
12810
|
-
return /* @__PURE__ */ (0,
|
|
12934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(VenueLogo, { venue: tab.venueLogo, size: "small" });
|
|
12811
12935
|
}
|
|
12812
12936
|
if (!tab.iconName) return null;
|
|
12813
|
-
return /* @__PURE__ */ (0,
|
|
12937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
12814
12938
|
Icon,
|
|
12815
12939
|
{
|
|
12816
12940
|
name: tab.iconName,
|
|
@@ -12823,7 +12947,7 @@ var useEventListTabs = (tabs) => {
|
|
|
12823
12947
|
const labels = (0, import_hooks43.useLabels)();
|
|
12824
12948
|
const { disabledVenues } = (0, import_hooks43.useAppConfig)();
|
|
12825
12949
|
const { isLocationBlocked } = (0, import_hooks43.useGeoBlock)();
|
|
12826
|
-
return (0,
|
|
12950
|
+
return (0, import_react21.useMemo)(() => {
|
|
12827
12951
|
const baseTabs = tabs != null ? tabs : getDefaultEventListTabs(labels);
|
|
12828
12952
|
return baseTabs.flatMap((tab) => {
|
|
12829
12953
|
if (!tab.venueLogo) return [tab];
|
|
@@ -12852,13 +12976,13 @@ var EventListTabs = ({
|
|
|
12852
12976
|
overflowBehavior
|
|
12853
12977
|
}) => {
|
|
12854
12978
|
const resolvedTabs = useEventListTabs(tabs);
|
|
12855
|
-
(0,
|
|
12979
|
+
(0, import_react21.useEffect)(() => {
|
|
12856
12980
|
const fallbackTab = resolvedTabs.find((tab) => !tab.disabled);
|
|
12857
12981
|
if (!fallbackTab) return;
|
|
12858
12982
|
if (resolvedTabs.some((tab) => tab.value === activeTab && !tab.disabled)) return;
|
|
12859
12983
|
onTabChange(fallbackTab.value);
|
|
12860
12984
|
}, [activeTab, onTabChange, resolvedTabs]);
|
|
12861
|
-
const items = (0,
|
|
12985
|
+
const items = (0, import_react21.useMemo)(() => {
|
|
12862
12986
|
return resolvedTabs.map((tab) => {
|
|
12863
12987
|
const isActive = tab.value === activeTab;
|
|
12864
12988
|
return {
|
|
@@ -12870,7 +12994,7 @@ var EventListTabs = ({
|
|
|
12870
12994
|
};
|
|
12871
12995
|
});
|
|
12872
12996
|
}, [activeTab, resolvedTabs]);
|
|
12873
|
-
return /* @__PURE__ */ (0,
|
|
12997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
12874
12998
|
Tabs,
|
|
12875
12999
|
{
|
|
12876
13000
|
ariaLabel,
|
|
@@ -12883,93 +13007,9 @@ var EventListTabs = ({
|
|
|
12883
13007
|
);
|
|
12884
13008
|
};
|
|
12885
13009
|
EventListTabs.displayName = "EventListTabs";
|
|
12886
|
-
var useEventListTabsHeaderOverflow = (recomputeOn, options) => {
|
|
12887
|
-
const headerRef = (0, import_react19.useRef)(null);
|
|
12888
|
-
const titleRef = (0, import_react19.useRef)(null);
|
|
12889
|
-
const requiredTabsWidthRef = (0, import_react19.useRef)(0);
|
|
12890
|
-
const [shouldUseSelectOverflow, setShouldUseSelectOverflow] = (0, import_react19.useState)(false);
|
|
12891
|
-
const updateTabsOverflowBehavior = (0, import_react19.useCallback)(() => {
|
|
12892
|
-
var _a;
|
|
12893
|
-
if (typeof window === "undefined") return;
|
|
12894
|
-
const headerElement = headerRef.current;
|
|
12895
|
-
const titleElement = titleRef.current;
|
|
12896
|
-
if (!headerElement || !titleElement) return;
|
|
12897
|
-
const headerStyles = window.getComputedStyle(headerElement);
|
|
12898
|
-
const rawGap = headerStyles.columnGap || headerStyles.gap || "0";
|
|
12899
|
-
const horizontalGap = Number.parseFloat(rawGap) || 0;
|
|
12900
|
-
const availableTabsWidth = headerElement.clientWidth - titleElement.getBoundingClientRect().width - horizontalGap;
|
|
12901
|
-
if (availableTabsWidth <= 0) {
|
|
12902
|
-
setShouldUseSelectOverflow(true);
|
|
12903
|
-
return;
|
|
12904
|
-
}
|
|
12905
|
-
const minTabsInlineWidthForSelect = options == null ? void 0 : options.minTabsInlineWidthForSelect;
|
|
12906
|
-
if (typeof minTabsInlineWidthForSelect === "number" && availableTabsWidth < minTabsInlineWidthForSelect) {
|
|
12907
|
-
setShouldUseSelectOverflow(true);
|
|
12908
|
-
return;
|
|
12909
|
-
}
|
|
12910
|
-
const preferSelectOnOverflow = (_a = options == null ? void 0 : options.preferSelectOnOverflow) != null ? _a : true;
|
|
12911
|
-
if (!preferSelectOnOverflow) {
|
|
12912
|
-
setShouldUseSelectOverflow(false);
|
|
12913
|
-
return;
|
|
12914
|
-
}
|
|
12915
|
-
const tabListElement = headerElement.querySelector(".agg-tab-list");
|
|
12916
|
-
if (tabListElement) {
|
|
12917
|
-
const currentRequiredWidth = tabListElement.scrollWidth;
|
|
12918
|
-
if (currentRequiredWidth > 0) {
|
|
12919
|
-
requiredTabsWidthRef.current = currentRequiredWidth;
|
|
12920
|
-
}
|
|
12921
|
-
const hasRealOverflow = tabListElement.scrollWidth - tabListElement.clientWidth > 1;
|
|
12922
|
-
setShouldUseSelectOverflow(hasRealOverflow);
|
|
12923
|
-
return;
|
|
12924
|
-
}
|
|
12925
|
-
if (requiredTabsWidthRef.current <= 0) return;
|
|
12926
|
-
setShouldUseSelectOverflow(requiredTabsWidthRef.current > availableTabsWidth);
|
|
12927
|
-
}, [options == null ? void 0 : options.minTabsInlineWidthForSelect, options == null ? void 0 : options.preferSelectOnOverflow]);
|
|
12928
|
-
(0, import_react19.useEffect)(() => {
|
|
12929
|
-
updateTabsOverflowBehavior();
|
|
12930
|
-
}, [recomputeOn, updateTabsOverflowBehavior]);
|
|
12931
|
-
(0, import_react19.useEffect)(() => {
|
|
12932
|
-
if (typeof window === "undefined") return;
|
|
12933
|
-
const handleResize = () => {
|
|
12934
|
-
updateTabsOverflowBehavior();
|
|
12935
|
-
};
|
|
12936
|
-
window.addEventListener("resize", handleResize);
|
|
12937
|
-
return () => {
|
|
12938
|
-
window.removeEventListener("resize", handleResize);
|
|
12939
|
-
};
|
|
12940
|
-
}, [updateTabsOverflowBehavior]);
|
|
12941
|
-
(0, import_react19.useEffect)(() => {
|
|
12942
|
-
if (typeof ResizeObserver === "undefined") return;
|
|
12943
|
-
const headerElement = headerRef.current;
|
|
12944
|
-
const titleElement = titleRef.current;
|
|
12945
|
-
if (!headerElement || !titleElement) return;
|
|
12946
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
12947
|
-
updateTabsOverflowBehavior();
|
|
12948
|
-
});
|
|
12949
|
-
resizeObserver.observe(headerElement);
|
|
12950
|
-
resizeObserver.observe(titleElement);
|
|
12951
|
-
return () => {
|
|
12952
|
-
resizeObserver.disconnect();
|
|
12953
|
-
};
|
|
12954
|
-
}, [updateTabsOverflowBehavior]);
|
|
12955
|
-
return { headerRef, titleRef, shouldUseSelectOverflow };
|
|
12956
|
-
};
|
|
12957
13010
|
|
|
12958
13011
|
// src/events/list/index.tsx
|
|
12959
|
-
var
|
|
12960
|
-
var subcategoryMenuRowClassName = cn(
|
|
12961
|
-
"flex min-h-11 w-full items-center justify-between rounded-[6px] px-3 py-3",
|
|
12962
|
-
"text-left text-agg-sm font-agg-normal leading-agg-5",
|
|
12963
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-1 focus-visible:ring-offset-agg-secondary"
|
|
12964
|
-
);
|
|
12965
|
-
var subcategoryMenuIdleRowClassName = cn(
|
|
12966
|
-
subcategoryMenuRowClassName,
|
|
12967
|
-
"cursor-pointer text-agg-foreground hover:bg-agg-secondary-hover"
|
|
12968
|
-
);
|
|
12969
|
-
var subcategoryMenuSelectedRowClassName = cn(
|
|
12970
|
-
subcategoryMenuRowClassName,
|
|
12971
|
-
"cursor-pointer bg-agg-primary/10 text-agg-primary"
|
|
12972
|
-
);
|
|
13012
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
12973
13013
|
var SORT_ICON_BY_VALUE = {
|
|
12974
13014
|
volume24hr: "sort-volume-24hr",
|
|
12975
13015
|
topArbitrage: "sort-top-arbitrage",
|
|
@@ -13006,7 +13046,7 @@ var EventList = ({
|
|
|
13006
13046
|
initialLoadedPageCount,
|
|
13007
13047
|
stateRef
|
|
13008
13048
|
}) => {
|
|
13009
|
-
var _a, _b, _c;
|
|
13049
|
+
var _a, _b, _c, _d, _e;
|
|
13010
13050
|
const labels = (0, import_hooks44.useLabels)();
|
|
13011
13051
|
const { disabledVenues } = (0, import_hooks44.useAppConfig)();
|
|
13012
13052
|
const {
|
|
@@ -13014,39 +13054,38 @@ var EventList = ({
|
|
|
13014
13054
|
} = (0, import_hooks44.useSdkUiConfig)();
|
|
13015
13055
|
const isDiscoveryFiltersEnabled = enableVenueEventDiscoveryFilters && !search;
|
|
13016
13056
|
const resolvedTabs = useEventListTabs();
|
|
13017
|
-
const visibleVenues = (0,
|
|
13057
|
+
const visibleVenues = (0, import_react22.useMemo)(
|
|
13018
13058
|
() => disabledVenues.length === 0 ? void 0 : (0, import_hooks44.getVisibleVenueIdsByConfig)(import_sdk14.VENUES, disabledVenues),
|
|
13019
13059
|
[disabledVenues]
|
|
13020
13060
|
);
|
|
13021
|
-
const [activeTabValue, setActiveTabValue] = (0,
|
|
13061
|
+
const [activeTabValue, setActiveTabValue] = (0, import_react22.useState)(
|
|
13022
13062
|
(_b = initialVenueTab != null ? initialVenueTab : (_a = resolvedTabs[0]) == null ? void 0 : _a.value) != null ? _b : "matched"
|
|
13023
13063
|
);
|
|
13024
|
-
const [selectedSort, setSelectedSort] = (0,
|
|
13025
|
-
const [isSubcategoriesModalOpen, setIsSubcategoriesModalOpen] = (0,
|
|
13026
|
-
const [categoryPath, setCategoryPath] = (0,
|
|
13027
|
-
const [collapsedCategoryIds, setCollapsedCategoryIds] = (0,
|
|
13028
|
-
const
|
|
13029
|
-
const sortItems = (0, import_react20.useMemo)(() => {
|
|
13064
|
+
const [selectedSort, setSelectedSort] = (0, import_react22.useState)("volume24hr");
|
|
13065
|
+
const [isSubcategoriesModalOpen, setIsSubcategoriesModalOpen] = (0, import_react22.useState)(false);
|
|
13066
|
+
const [categoryPath, setCategoryPath] = (0, import_react22.useState)([]);
|
|
13067
|
+
const [collapsedCategoryIds, setCollapsedCategoryIds] = (0, import_react22.useState)(() => /* @__PURE__ */ new Set());
|
|
13068
|
+
const sortItems = (0, import_react22.useMemo)(() => {
|
|
13030
13069
|
return [
|
|
13031
13070
|
{
|
|
13032
13071
|
value: "volume24hr",
|
|
13033
13072
|
label: labels.eventList.sortBy24hVolume,
|
|
13034
|
-
icon: /* @__PURE__ */ (0,
|
|
13073
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Icon, { name: SORT_ICON_BY_VALUE.volume24hr, size: "small", color: "currentColor" })
|
|
13035
13074
|
},
|
|
13036
13075
|
{
|
|
13037
13076
|
value: "topArbitrage",
|
|
13038
13077
|
label: labels.eventList.sortByTopArbitrage,
|
|
13039
|
-
icon: /* @__PURE__ */ (0,
|
|
13078
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Icon, { name: SORT_ICON_BY_VALUE.topArbitrage, size: "small", color: "currentColor" })
|
|
13040
13079
|
},
|
|
13041
13080
|
{
|
|
13042
13081
|
value: "volume",
|
|
13043
13082
|
label: labels.eventList.sortByTotalVolume,
|
|
13044
|
-
icon: /* @__PURE__ */ (0,
|
|
13083
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Icon, { name: SORT_ICON_BY_VALUE.volume, size: "small", color: "currentColor" })
|
|
13045
13084
|
},
|
|
13046
13085
|
{
|
|
13047
13086
|
value: "endDate",
|
|
13048
13087
|
label: labels.eventList.sortByEndingSoon,
|
|
13049
|
-
icon: /* @__PURE__ */ (0,
|
|
13088
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Icon, { name: SORT_ICON_BY_VALUE.endDate, size: "small", color: "currentColor" })
|
|
13050
13089
|
}
|
|
13051
13090
|
];
|
|
13052
13091
|
}, [
|
|
@@ -13056,14 +13095,9 @@ var EventList = ({
|
|
|
13056
13095
|
labels.eventList.sortByTotalVolume
|
|
13057
13096
|
]);
|
|
13058
13097
|
const baseCategoryId = (_c = categoryIds == null ? void 0 : categoryIds[0]) != null ? _c : null;
|
|
13059
|
-
(0,
|
|
13098
|
+
(0, import_react22.useEffect)(() => {
|
|
13060
13099
|
if (!isDiscoveryFiltersEnabled) return;
|
|
13061
|
-
|
|
13062
|
-
setCategoryPath([]);
|
|
13063
|
-
setCollapsedCategoryIds(/* @__PURE__ */ new Set());
|
|
13064
|
-
return;
|
|
13065
|
-
}
|
|
13066
|
-
setCategoryPath([{ id: baseCategoryId, label: baseCategoryId, eventCount: 0 }]);
|
|
13100
|
+
setCategoryPath([]);
|
|
13067
13101
|
setCollapsedCategoryIds(/* @__PURE__ */ new Set());
|
|
13068
13102
|
}, [baseCategoryId, isDiscoveryFiltersEnabled]);
|
|
13069
13103
|
const { categories: topLevelCategories } = (0, import_hooks44.useCategories)({
|
|
@@ -13071,10 +13105,10 @@ var EventList = ({
|
|
|
13071
13105
|
enabled: isDiscoveryFiltersEnabled,
|
|
13072
13106
|
limit: 100
|
|
13073
13107
|
});
|
|
13074
|
-
const sortedTopLevelCategories = (0,
|
|
13108
|
+
const sortedTopLevelCategories = (0, import_react22.useMemo)(() => {
|
|
13075
13109
|
return sortCategoriesForNavigation(topLevelCategories);
|
|
13076
13110
|
}, [topLevelCategories]);
|
|
13077
|
-
const baseCategoryChildPrefetchIds = (0,
|
|
13111
|
+
const baseCategoryChildPrefetchIds = (0, import_react22.useMemo)(() => {
|
|
13078
13112
|
return Array.from(
|
|
13079
13113
|
/* @__PURE__ */ new Set([
|
|
13080
13114
|
...sortedTopLevelCategories.map((category) => category.id),
|
|
@@ -13088,23 +13122,28 @@ var EventList = ({
|
|
|
13088
13122
|
parentIds: baseCategoryChildPrefetchIds,
|
|
13089
13123
|
limit: 100
|
|
13090
13124
|
});
|
|
13091
|
-
const visibleChildPrefetchIds = (0,
|
|
13092
|
-
var _a2;
|
|
13125
|
+
const visibleChildPrefetchIds = (0, import_react22.useMemo)(() => {
|
|
13126
|
+
var _a2, _b2;
|
|
13093
13127
|
const ids = /* @__PURE__ */ new Set();
|
|
13128
|
+
if (baseCategoryId) {
|
|
13129
|
+
for (const child of (_a2 = baseChildrenByParentId.get(baseCategoryId)) != null ? _a2 : []) {
|
|
13130
|
+
ids.add(child.id);
|
|
13131
|
+
}
|
|
13132
|
+
}
|
|
13094
13133
|
for (const expandedCategory of categoryPath) {
|
|
13095
|
-
for (const childCategory of (
|
|
13134
|
+
for (const childCategory of (_b2 = baseChildrenByParentId.get(expandedCategory.id)) != null ? _b2 : []) {
|
|
13096
13135
|
ids.add(childCategory.id);
|
|
13097
13136
|
}
|
|
13098
13137
|
}
|
|
13099
13138
|
return Array.from(ids);
|
|
13100
|
-
}, [baseChildrenByParentId, categoryPath]);
|
|
13139
|
+
}, [baseCategoryId, baseChildrenByParentId, categoryPath]);
|
|
13101
13140
|
const { childrenByParentId: visibleChildrenByParentId } = (0, import_hooks44.useCategoryChildren)({
|
|
13102
13141
|
queryKeyScope: "event-list-category-children",
|
|
13103
13142
|
enabled: isDiscoveryFiltersEnabled,
|
|
13104
13143
|
parentIds: visibleChildPrefetchIds,
|
|
13105
13144
|
limit: 100
|
|
13106
13145
|
});
|
|
13107
|
-
const visibleGrandchildPrefetchIds = (0,
|
|
13146
|
+
const visibleGrandchildPrefetchIds = (0, import_react22.useMemo)(() => {
|
|
13108
13147
|
var _a2;
|
|
13109
13148
|
const ids = /* @__PURE__ */ new Set();
|
|
13110
13149
|
for (const expandedCategory of categoryPath) {
|
|
@@ -13120,43 +13159,41 @@ var EventList = ({
|
|
|
13120
13159
|
parentIds: visibleGrandchildPrefetchIds,
|
|
13121
13160
|
limit: 100
|
|
13122
13161
|
});
|
|
13123
|
-
const childrenByParentId = (0,
|
|
13162
|
+
const childrenByParentId = (0, import_react22.useMemo)(() => {
|
|
13124
13163
|
return new Map([
|
|
13125
13164
|
...baseChildrenByParentId,
|
|
13126
13165
|
...visibleChildrenByParentId,
|
|
13127
13166
|
...visibleGrandchildrenByParentId
|
|
13128
13167
|
]);
|
|
13129
13168
|
}, [baseChildrenByParentId, visibleChildrenByParentId, visibleGrandchildrenByParentId]);
|
|
13130
|
-
const shouldRenderSubcategoryFilters = isDiscoveryFiltersEnabled && (
|
|
13131
|
-
const
|
|
13132
|
-
|
|
13133
|
-
|
|
13134
|
-
|
|
13135
|
-
|
|
13136
|
-
}, [sortedTopLevelCategories]);
|
|
13137
|
-
const resolvedCategoryIds = (0, import_react20.useMemo)(() => {
|
|
13169
|
+
const shouldRenderSubcategoryFilters = isDiscoveryFiltersEnabled && baseCategoryId !== null && (((_e = (_d = childrenByParentId.get(baseCategoryId)) == null ? void 0 : _d.length) != null ? _e : 0) > 0 || categoryPath.length > 0);
|
|
13170
|
+
const baseCategoryEventCount = (0, import_react22.useMemo)(() => {
|
|
13171
|
+
var _a2, _b2;
|
|
13172
|
+
return (_b2 = (_a2 = sortedTopLevelCategories.find((c) => c.id === baseCategoryId)) == null ? void 0 : _a2.eventCount) != null ? _b2 : 0;
|
|
13173
|
+
}, [baseCategoryId, sortedTopLevelCategories]);
|
|
13174
|
+
const resolvedCategoryIds = (0, import_react22.useMemo)(() => {
|
|
13138
13175
|
if (!isDiscoveryFiltersEnabled) return categoryIds;
|
|
13139
|
-
return resolveCategoryIdsFromPath(categoryPath, void 0);
|
|
13140
|
-
}, [categoryIds, categoryPath, isDiscoveryFiltersEnabled]);
|
|
13141
|
-
const sortQueryParams = (0,
|
|
13176
|
+
return resolveCategoryIdsFromPath(categoryPath, baseCategoryId ? [baseCategoryId] : void 0);
|
|
13177
|
+
}, [baseCategoryId, categoryIds, categoryPath, isDiscoveryFiltersEnabled]);
|
|
13178
|
+
const sortQueryParams = (0, import_react22.useMemo)(() => {
|
|
13142
13179
|
return resolveSortQueryParams(selectedSort);
|
|
13143
13180
|
}, [selectedSort]);
|
|
13144
|
-
const activeTab = (0,
|
|
13181
|
+
const activeTab = (0, import_react22.useMemo)(() => {
|
|
13145
13182
|
return resolvedTabs.find((tab) => tab.value === activeTabValue);
|
|
13146
13183
|
}, [activeTabValue, resolvedTabs]);
|
|
13147
|
-
const venues = (0,
|
|
13184
|
+
const venues = (0, import_react22.useMemo)(() => {
|
|
13148
13185
|
return resolveTabVenus(activeTab, visibleVenues);
|
|
13149
13186
|
}, [activeTab, visibleVenues]);
|
|
13150
|
-
const matchStatus = (0,
|
|
13187
|
+
const matchStatus = (0, import_react22.useMemo)(() => {
|
|
13151
13188
|
return activeTabValue === "matched" ? activeTab == null ? void 0 : activeTab.matchStatus : void 0;
|
|
13152
13189
|
}, [activeTabValue, activeTab]);
|
|
13153
|
-
const resolvedMaxVisibleItems = (0,
|
|
13190
|
+
const resolvedMaxVisibleItems = (0, import_react22.useMemo)(() => {
|
|
13154
13191
|
if (!Number.isFinite(maxVisibleItems)) return void 0;
|
|
13155
13192
|
return Math.max(1, Math.floor(maxVisibleItems));
|
|
13156
13193
|
}, [maxVisibleItems]);
|
|
13157
13194
|
const requestLimit = resolvedMaxVisibleItems != null ? resolvedMaxVisibleItems : limit;
|
|
13158
13195
|
const shouldPaginate = resolvedMaxVisibleItems == null;
|
|
13159
|
-
const endDateFrom = (0,
|
|
13196
|
+
const endDateFrom = (0, import_react22.useMemo)(() => {
|
|
13160
13197
|
if (search) return void 0;
|
|
13161
13198
|
const BUCKET_MINUTES = 5;
|
|
13162
13199
|
const bucket = /* @__PURE__ */ new Date();
|
|
@@ -13185,21 +13222,21 @@ var EventList = ({
|
|
|
13185
13222
|
endDateFrom,
|
|
13186
13223
|
initialPages: initialLoadedPageCount
|
|
13187
13224
|
});
|
|
13188
|
-
(0,
|
|
13225
|
+
(0, import_react22.useEffect)(() => {
|
|
13189
13226
|
if (stateRef) {
|
|
13190
13227
|
stateRef.current = { venueTab: activeTabValue, loadedPageCount };
|
|
13191
13228
|
}
|
|
13192
13229
|
}, [stateRef, activeTabValue, loadedPageCount]);
|
|
13193
|
-
const filteredEvents = (0,
|
|
13230
|
+
const filteredEvents = (0, import_react22.useMemo)(() => {
|
|
13194
13231
|
return filterEventsByTabValue(events, activeTabValue);
|
|
13195
13232
|
}, [events, activeTabValue]);
|
|
13196
|
-
const groupedEvents = (0,
|
|
13233
|
+
const groupedEvents = (0, import_react22.useMemo)(() => {
|
|
13197
13234
|
return splitEventsByLifecycle(filteredEvents);
|
|
13198
13235
|
}, [filteredEvents]);
|
|
13199
|
-
const orderedEvents = (0,
|
|
13236
|
+
const orderedEvents = (0, import_react22.useMemo)(() => {
|
|
13200
13237
|
return groupedEvents.open;
|
|
13201
13238
|
}, [groupedEvents.open]);
|
|
13202
|
-
const tileEvents = (0,
|
|
13239
|
+
const tileEvents = (0, import_react22.useMemo)(() => {
|
|
13203
13240
|
const normalizedEvents = orderedEvents.map((event) => mapEventToEventListItemEvent(event)).filter((event) => event != null);
|
|
13204
13241
|
if (resolvedMaxVisibleItems == null) return normalizedEvents;
|
|
13205
13242
|
return normalizedEvents.slice(0, resolvedMaxVisibleItems);
|
|
@@ -13207,8 +13244,8 @@ var EventList = ({
|
|
|
13207
13244
|
const shouldRenderLoadingState = isLoading && !isPlaceholderData && tileEvents.length === 0;
|
|
13208
13245
|
const shouldRenderEmptyState = !isLoading && !isError && tileEvents.length === 0;
|
|
13209
13246
|
const shouldRenderPaginationLoadingItems = shouldPaginate && hasNextPage;
|
|
13210
|
-
const loadMoreRef = (0,
|
|
13211
|
-
(0,
|
|
13247
|
+
const loadMoreRef = (0, import_react22.useRef)(null);
|
|
13248
|
+
(0, import_react22.useEffect)(() => {
|
|
13212
13249
|
if (!shouldPaginate) return;
|
|
13213
13250
|
if (!hasNextPage) return;
|
|
13214
13251
|
if (typeof IntersectionObserver === "undefined") return;
|
|
@@ -13233,11 +13270,10 @@ var EventList = ({
|
|
|
13233
13270
|
const gridClassName = cn(
|
|
13234
13271
|
"grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] md:grid-cols-[repeat(auto-fill,minmax(360px,1fr))] gap-4"
|
|
13235
13272
|
);
|
|
13236
|
-
const isDrilledIn = categoryPath.length > 0;
|
|
13237
13273
|
const handleSelectAllCategories = () => {
|
|
13238
13274
|
setCategoryPath([]);
|
|
13239
13275
|
setCollapsedCategoryIds(/* @__PURE__ */ new Set());
|
|
13240
|
-
onCategoryRootChange == null ? void 0 : onCategoryRootChange(void 0);
|
|
13276
|
+
onCategoryRootChange == null ? void 0 : onCategoryRootChange(baseCategoryId != null ? baseCategoryId : void 0);
|
|
13241
13277
|
setIsSubcategoriesModalOpen(false);
|
|
13242
13278
|
};
|
|
13243
13279
|
const handleToggleSubcategory = ({
|
|
@@ -13247,7 +13283,6 @@ var EventList = ({
|
|
|
13247
13283
|
isExpanded,
|
|
13248
13284
|
isSelected
|
|
13249
13285
|
}) => {
|
|
13250
|
-
var _a2;
|
|
13251
13286
|
setCategoryPath((prev) => [...prev.slice(0, depth), entry]);
|
|
13252
13287
|
setCollapsedCategoryIds((prev) => {
|
|
13253
13288
|
const next = new Set(prev);
|
|
@@ -13258,122 +13293,41 @@ var EventList = ({
|
|
|
13258
13293
|
next.delete(entry.id);
|
|
13259
13294
|
return next;
|
|
13260
13295
|
});
|
|
13261
|
-
onCategoryRootChange == null ? void 0 : onCategoryRootChange(
|
|
13262
|
-
};
|
|
13263
|
-
const renderSubcategoryTreeRow = ({
|
|
13264
|
-
entry,
|
|
13265
|
-
isExpanded,
|
|
13266
|
-
isSelected,
|
|
13267
|
-
onClick
|
|
13268
|
-
}) => {
|
|
13269
|
-
var _a2, _b2;
|
|
13270
|
-
const hasKnownChildren = ((_b2 = (_a2 = childrenByParentId.get(entry.id)) == null ? void 0 : _a2.length) != null ? _b2 : 0) > 0;
|
|
13271
|
-
return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
13272
|
-
"button",
|
|
13273
|
-
{
|
|
13274
|
-
type: "button",
|
|
13275
|
-
"aria-current": isSelected ? "true" : void 0,
|
|
13276
|
-
className: isSelected ? subcategoryMenuSelectedRowClassName : subcategoryMenuIdleRowClassName,
|
|
13277
|
-
onClick,
|
|
13278
|
-
children: [
|
|
13279
|
-
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "min-w-0 truncate first-letter:uppercase", children: entry.label }),
|
|
13280
|
-
hasKnownChildren ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
13281
|
-
Icon,
|
|
13282
|
-
{
|
|
13283
|
-
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
13284
|
-
size: "small",
|
|
13285
|
-
color: "currentColor",
|
|
13286
|
-
className: "shrink-0 text-agg-muted-foreground"
|
|
13287
|
-
}
|
|
13288
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "shrink-0 text-agg-muted-foreground", children: entry.eventCount })
|
|
13289
|
-
]
|
|
13290
|
-
},
|
|
13291
|
-
entry.id
|
|
13292
|
-
);
|
|
13293
|
-
};
|
|
13294
|
-
const renderSubcategoryBranch = (category, depth) => {
|
|
13295
|
-
var _a2, _b2, _c2, _d, _e;
|
|
13296
|
-
const label2 = (_a2 = category.displayName) != null ? _a2 : category.name;
|
|
13297
|
-
const entry = {
|
|
13298
|
-
id: category.id,
|
|
13299
|
-
label: label2,
|
|
13300
|
-
eventCount: (_b2 = category.eventCount) != null ? _b2 : 0
|
|
13301
|
-
};
|
|
13302
|
-
const childCategories = (_c2 = childrenByParentId.get(category.id)) != null ? _c2 : [];
|
|
13303
|
-
const hasKnownChildren = childCategories.length > 0;
|
|
13304
|
-
const isExpanded = ((_d = categoryPath[depth]) == null ? void 0 : _d.id) === category.id && !collapsedCategoryIds.has(category.id);
|
|
13305
|
-
const isSelected = ((_e = categoryPath[depth]) == null ? void 0 : _e.id) === category.id && categoryPath.length === depth + 1;
|
|
13306
|
-
return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex w-full flex-col gap-1", children: [
|
|
13307
|
-
renderSubcategoryTreeRow({
|
|
13308
|
-
entry,
|
|
13309
|
-
isExpanded,
|
|
13310
|
-
isSelected,
|
|
13311
|
-
onClick: () => handleToggleSubcategory({
|
|
13312
|
-
entry,
|
|
13313
|
-
depth,
|
|
13314
|
-
hasKnownChildren,
|
|
13315
|
-
isExpanded,
|
|
13316
|
-
isSelected
|
|
13317
|
-
})
|
|
13318
|
-
}),
|
|
13319
|
-
isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "flex w-full flex-col gap-1 pl-4", children: childCategories.map(
|
|
13320
|
-
(childCategory) => renderSubcategoryBranch(childCategory, depth + 1)
|
|
13321
|
-
) }) : null
|
|
13322
|
-
] }, category.id);
|
|
13296
|
+
onCategoryRootChange == null ? void 0 : onCategoryRootChange(baseCategoryId != null ? baseCategoryId : void 0);
|
|
13323
13297
|
};
|
|
13324
|
-
const subcategoriesListContent = /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [
|
|
13325
|
-
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
13326
|
-
"button",
|
|
13327
|
-
{
|
|
13328
|
-
type: "button",
|
|
13329
|
-
"aria-current": !isDrilledIn ? "true" : void 0,
|
|
13330
|
-
className: !isDrilledIn ? subcategoryMenuSelectedRowClassName : subcategoryMenuIdleRowClassName,
|
|
13331
|
-
onClick: handleSelectAllCategories,
|
|
13332
|
-
children: [
|
|
13333
|
-
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "min-w-0 truncate", children: labels.eventList.subcategoriesAll }),
|
|
13334
|
-
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "text-agg-muted-foreground", children: totalTopLevelEventCount })
|
|
13335
|
-
]
|
|
13336
|
-
}
|
|
13337
|
-
),
|
|
13338
|
-
sortedTopLevelCategories.map((category) => renderSubcategoryBranch(category, 0))
|
|
13339
|
-
] });
|
|
13340
13298
|
if (shouldRenderLoadingState) {
|
|
13341
|
-
return /* @__PURE__ */ (0,
|
|
13299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
13342
13300
|
Skeleton,
|
|
13343
13301
|
{
|
|
13344
13302
|
view: "event-list",
|
|
13345
13303
|
ariaLabel: labels.eventList.loading(title2),
|
|
13346
|
-
withSidebar:
|
|
13304
|
+
withSidebar: shouldRenderSubcategoryFilters
|
|
13347
13305
|
}
|
|
13348
13306
|
);
|
|
13349
13307
|
}
|
|
13350
|
-
return /* @__PURE__ */ (0,
|
|
13351
|
-
/* @__PURE__ */ (0,
|
|
13308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("section", { className: "agg-event-list flex w-full flex-col gap-2 md:gap-5 t", children: [
|
|
13309
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
13352
13310
|
"header",
|
|
13353
13311
|
{
|
|
13354
|
-
ref: headerRef,
|
|
13355
13312
|
className: cn(
|
|
13356
13313
|
"agg-event-list-header",
|
|
13357
13314
|
"flex flex-col w-full items-start justify-between",
|
|
13358
13315
|
"gap-2 sm:flex-row sm:items-center sm:gap-4"
|
|
13359
13316
|
),
|
|
13360
13317
|
children: [
|
|
13361
|
-
/* @__PURE__ */ (0,
|
|
13362
|
-
/* @__PURE__ */ (0,
|
|
13363
|
-
/* @__PURE__ */ (0,
|
|
13318
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "agg-event-list-title min-w-32", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Typography, { as: "h2", variant: "title", className: "truncate first-letter:uppercase", children: title2 }) }),
|
|
13319
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "hidden min-w-0 max-w-full items-center gap-3 md:flex", children: [
|
|
13320
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
13364
13321
|
EventListTabs,
|
|
13365
13322
|
{
|
|
13366
13323
|
ariaLabel: labels.eventList.tabsAria(title2),
|
|
13367
|
-
className:
|
|
13368
|
-
"agg-event-list-tabs w-fit max-w-full flex-1",
|
|
13369
|
-
shouldUseSelectOverflow ? "min-w-[220px]" : "min-w-[400px]"
|
|
13370
|
-
),
|
|
13324
|
+
className: "agg-event-list-tabs min-w-0 flex-1 max-w-[600px]!",
|
|
13371
13325
|
activeTab: activeTabValue,
|
|
13372
13326
|
onTabChange: setActiveTabValue,
|
|
13373
|
-
overflowBehavior:
|
|
13327
|
+
overflowBehavior: "scroll"
|
|
13374
13328
|
}
|
|
13375
13329
|
),
|
|
13376
|
-
/* @__PURE__ */ (0,
|
|
13330
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
13377
13331
|
Select,
|
|
13378
13332
|
{
|
|
13379
13333
|
ariaLabel: labels.eventList.sortByLabel,
|
|
@@ -13389,8 +13343,8 @@ var EventList = ({
|
|
|
13389
13343
|
]
|
|
13390
13344
|
}
|
|
13391
13345
|
),
|
|
13392
|
-
/* @__PURE__ */ (0,
|
|
13393
|
-
/* @__PURE__ */ (0,
|
|
13346
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "flex w-full gap-2 md:hidden mb-3", children: [
|
|
13347
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
13394
13348
|
EventListTabs,
|
|
13395
13349
|
{
|
|
13396
13350
|
ariaLabel: labels.eventList.tabsAria(title2),
|
|
@@ -13400,7 +13354,7 @@ var EventList = ({
|
|
|
13400
13354
|
overflowBehavior: "select"
|
|
13401
13355
|
}
|
|
13402
13356
|
),
|
|
13403
|
-
/* @__PURE__ */ (0,
|
|
13357
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
13404
13358
|
Select,
|
|
13405
13359
|
{
|
|
13406
13360
|
ariaLabel: labels.eventList.sortByLabel,
|
|
@@ -13411,24 +13365,36 @@ var EventList = ({
|
|
|
13411
13365
|
contentClassName: "rounded-[12px] py-2 shadow-[0_8px_16px_rgba(0,0,0,0.1)]"
|
|
13412
13366
|
}
|
|
13413
13367
|
),
|
|
13414
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0,
|
|
13368
|
+
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
13415
13369
|
"button",
|
|
13416
13370
|
{
|
|
13417
13371
|
type: "button",
|
|
13418
13372
|
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-[8px] border-2 border-agg-primary bg-agg-secondary text-agg-foreground cursor-pointer",
|
|
13419
13373
|
"aria-label": labels.eventList.subcategoriesOpenAria,
|
|
13420
13374
|
onClick: () => setIsSubcategoriesModalOpen(true),
|
|
13421
|
-
children: /* @__PURE__ */ (0,
|
|
13375
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Icon, { name: "apps", size: "small", color: "currentColor" })
|
|
13422
13376
|
}
|
|
13423
13377
|
) : null
|
|
13424
13378
|
] }),
|
|
13425
|
-
/* @__PURE__ */ (0,
|
|
13379
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
13426
13380
|
"div",
|
|
13427
13381
|
{
|
|
13428
13382
|
className: cn("flex w-full gap-6", shouldRenderSubcategoryFilters ? "md:items-start" : ""),
|
|
13429
13383
|
children: [
|
|
13430
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0,
|
|
13431
|
-
|
|
13384
|
+
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("aside", { className: "hidden w-[200px] shrink-0 md:block self-start sticky top-4", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "agg-sidebar max-h-[calc(100vh-19rem)] overflow-y-auto rounded-[8px] border border-agg-separator bg-agg-secondary p-2", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
13385
|
+
CategorySidebar,
|
|
13386
|
+
{
|
|
13387
|
+
baseCategoryId,
|
|
13388
|
+
childrenByParentId,
|
|
13389
|
+
categoryPath,
|
|
13390
|
+
collapsedCategoryIds,
|
|
13391
|
+
totalEventCount: baseCategoryEventCount,
|
|
13392
|
+
labels: { subcategoriesAll: labels.eventList.subcategoriesAll },
|
|
13393
|
+
onSelectAll: handleSelectAllCategories,
|
|
13394
|
+
onToggleCategory: handleToggleSubcategory
|
|
13395
|
+
}
|
|
13396
|
+
) }) }) : null,
|
|
13397
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
13432
13398
|
"div",
|
|
13433
13399
|
{
|
|
13434
13400
|
className: cn(
|
|
@@ -13439,7 +13405,7 @@ var EventList = ({
|
|
|
13439
13405
|
gridClassName
|
|
13440
13406
|
),
|
|
13441
13407
|
children: [
|
|
13442
|
-
tileEvents.map((event) => /* @__PURE__ */ (0,
|
|
13408
|
+
tileEvents.map((event) => /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
13443
13409
|
EventListItem,
|
|
13444
13410
|
{
|
|
13445
13411
|
event,
|
|
@@ -13454,7 +13420,7 @@ var EventList = ({
|
|
|
13454
13420
|
},
|
|
13455
13421
|
event.id
|
|
13456
13422
|
)),
|
|
13457
|
-
shouldRenderPaginationLoadingItems ? Array.from({ length: 6 }).map((_, index) => /* @__PURE__ */ (0,
|
|
13423
|
+
shouldRenderPaginationLoadingItems ? Array.from({ length: 6 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
13458
13424
|
EventListItem,
|
|
13459
13425
|
{
|
|
13460
13426
|
isLoading: true,
|
|
@@ -13464,20 +13430,20 @@ var EventList = ({
|
|
|
13464
13430
|
},
|
|
13465
13431
|
`loading-${index}`
|
|
13466
13432
|
)) : null,
|
|
13467
|
-
shouldRenderEmptyState ? /* @__PURE__ */ (0,
|
|
13433
|
+
shouldRenderEmptyState ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "col-span-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
13468
13434
|
StateMessage,
|
|
13469
13435
|
{
|
|
13470
13436
|
title: labels.eventList.emptyTitle,
|
|
13471
13437
|
description: labels.eventList.emptyDescription,
|
|
13472
|
-
icon: /* @__PURE__ */ (0,
|
|
13438
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Icon, { name: "search-empty" })
|
|
13473
13439
|
}
|
|
13474
13440
|
) }) : null,
|
|
13475
|
-
isError ? /* @__PURE__ */ (0,
|
|
13441
|
+
isError ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "col-span-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
13476
13442
|
StateMessage,
|
|
13477
13443
|
{
|
|
13478
13444
|
title: labels.eventList.errorTitle,
|
|
13479
13445
|
description: labels.eventList.errorDescription,
|
|
13480
|
-
icon: /* @__PURE__ */ (0,
|
|
13446
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Icon, { name: "warning" })
|
|
13481
13447
|
}
|
|
13482
13448
|
) }) : null
|
|
13483
13449
|
]
|
|
@@ -13486,20 +13452,45 @@ var EventList = ({
|
|
|
13486
13452
|
]
|
|
13487
13453
|
}
|
|
13488
13454
|
),
|
|
13489
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0,
|
|
13455
|
+
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Modal, { open: isSubcategoriesModalOpen, onOpenChange: setIsSubcategoriesModalOpen, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
13490
13456
|
Modal.Container,
|
|
13491
13457
|
{
|
|
13492
13458
|
classNames: {
|
|
13493
|
-
|
|
13459
|
+
// pointer-events-none lets clicks on the empty area above the panel pass through
|
|
13460
|
+
// to Dialog.Overlay, which triggers Radix's outside-click dismiss.
|
|
13461
|
+
content: "items-end p-0 pointer-events-none",
|
|
13494
13462
|
container: "w-full max-w-none border-0 bg-transparent shadow-none"
|
|
13495
13463
|
},
|
|
13496
|
-
children: [
|
|
13497
|
-
/* @__PURE__ */ (0,
|
|
13498
|
-
/* @__PURE__ */ (0,
|
|
13499
|
-
|
|
13464
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "pointer-events-auto w-full rounded-t-[12px] border border-agg-separator bg-agg-secondary", children: [
|
|
13465
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "flex justify-center pb-1 pt-3", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "h-1 w-10 rounded-full bg-agg-muted-foreground/30" }) }),
|
|
13466
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "flex items-center justify-between px-4 pb-2 pt-1", children: [
|
|
13467
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Dialog2.Title, { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.eventList.subcategoriesLabel }),
|
|
13468
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
13469
|
+
Dialog2.Close,
|
|
13470
|
+
{
|
|
13471
|
+
className: "flex cursor-pointer items-center justify-center rounded-full p-1 text-agg-muted-foreground hover:bg-agg-secondary-hover",
|
|
13472
|
+
"aria-label": labels.common.close,
|
|
13473
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(CloseIcon, { className: "h-5 w-5" })
|
|
13474
|
+
}
|
|
13475
|
+
)
|
|
13476
|
+
] }),
|
|
13477
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "flex flex-col gap-1 px-4 pb-4", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
13478
|
+
CategorySidebar,
|
|
13479
|
+
{
|
|
13480
|
+
baseCategoryId,
|
|
13481
|
+
childrenByParentId,
|
|
13482
|
+
categoryPath,
|
|
13483
|
+
collapsedCategoryIds,
|
|
13484
|
+
totalEventCount: baseCategoryEventCount,
|
|
13485
|
+
labels: { subcategoriesAll: labels.eventList.subcategoriesAll },
|
|
13486
|
+
onSelectAll: handleSelectAllCategories,
|
|
13487
|
+
onToggleCategory: handleToggleSubcategory
|
|
13488
|
+
}
|
|
13489
|
+
) })
|
|
13490
|
+
] })
|
|
13500
13491
|
}
|
|
13501
13492
|
) }) : null,
|
|
13502
|
-
shouldPaginate && hasNextPage ? /* @__PURE__ */ (0,
|
|
13493
|
+
shouldPaginate && hasNextPage ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { ref: loadMoreRef, className: "agg-event-list-sentinel h-px w-full", "aria-hidden": true }) : null
|
|
13503
13494
|
] });
|
|
13504
13495
|
};
|
|
13505
13496
|
EventList.displayName = "EventList";
|