@agg-build/ui 2.2.0 → 2.2.3
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-5MRFY5ZQ.mjs → chunk-4QGZ3FWI.mjs} +1 -1
- package/dist/{chunk-73MO7MYG.mjs → chunk-JOZPXDNZ.mjs} +30 -7
- package/dist/{chunk-TR7HUVY7.mjs → chunk-LPIAEKSZ.mjs} +82 -2
- package/dist/{chunk-BTRFSEPC.mjs → chunk-QM3WWPCV.mjs} +107 -29
- package/dist/{chunk-DTOI4V6P.mjs → chunk-TDLI6F55.mjs} +1155 -954
- package/dist/{chunk-MIAAL7BL.mjs → chunk-UTXQUOU3.mjs} +98 -4
- package/dist/{chunk-HNLA44SY.mjs → chunk-ZRYHWHTD.mjs} +2 -2
- package/dist/events.js +277 -31
- package/dist/events.mjs +3 -3
- package/dist/index.js +2003 -1534
- package/dist/index.mjs +9 -7
- package/dist/modals.js +2 -2
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +1375 -908
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +4 -3
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +114 -6
- package/dist/trading.mjs +4 -4
- package/dist/types/events/item/event-list-item.types.d.mts +4 -0
- package/dist/types/events/item/event-list-item.types.d.ts +4 -0
- package/dist/types/events/item/event-list-item.utils.d.mts +1 -1
- package/dist/types/events/item/event-list-item.utils.d.ts +1 -1
- package/dist/types/events/item-details/event-list-item-details.types.d.mts +0 -5
- package/dist/types/events/item-details/event-list-item-details.types.d.ts +0 -5
- package/dist/types/events/item-details/event-list-item-details.utils.d.mts +9 -0
- package/dist/types/events/item-details/event-list-item-details.utils.d.ts +9 -0
- package/dist/types/events/shared/event-trading-state.utils.d.mts +4 -2
- package/dist/types/events/shared/event-trading-state.utils.d.ts +4 -2
- package/dist/types/pages/event-market/sports-event-market.utils.d.mts +1 -1
- package/dist/types/pages/event-market/sports-event-market.utils.d.ts +1 -1
- package/dist/types/pages/user-profile/components/claim-activity-breakdown-modal.d.mts +8 -0
- package/dist/types/pages/user-profile/components/claim-activity-breakdown-modal.d.ts +8 -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 +14 -0
- package/dist/types/pages/user-profile/user-profile.types.d.ts +14 -0
- package/dist/types/shared/utils.d.mts +16 -0
- package/dist/types/shared/utils.d.ts +16 -0
- package/package.json +3 -3
package/dist/pages.js
CHANGED
|
@@ -156,6 +156,92 @@ var formatUsd = (value, options) => {
|
|
|
156
156
|
maximumFractionDigits
|
|
157
157
|
});
|
|
158
158
|
};
|
|
159
|
+
var GENERIC_BINARY_OUTCOME_LABELS = /* @__PURE__ */ new Set(["yes", "no"]);
|
|
160
|
+
var TOTAL_OUTCOME_LABELS = /* @__PURE__ */ new Set(["over", "under"]);
|
|
161
|
+
var DIRECTIONAL_OUTCOME_LABELS = /* @__PURE__ */ new Set(["up", "down"]);
|
|
162
|
+
var NUMERIC_TOKEN_RE = /[-+]?\d+(?:\.\d+)?/;
|
|
163
|
+
var UP_OR_DOWN_QUESTION_RE = /\bup or down\b/i;
|
|
164
|
+
var normalizeResolvedOutcomeLabel = (value) => {
|
|
165
|
+
const trimmedValue = value == null ? void 0 : value.trim();
|
|
166
|
+
return trimmedValue ? trimmedValue : null;
|
|
167
|
+
};
|
|
168
|
+
var readOutcomeMetadataLabel = (outcome) => {
|
|
169
|
+
const outcomeRecord = outcome;
|
|
170
|
+
for (const key of ["displayName", "name", "title"]) {
|
|
171
|
+
const value = outcomeRecord[key];
|
|
172
|
+
if (typeof value !== "string") continue;
|
|
173
|
+
const normalizedValue = normalizeResolvedOutcomeLabel(value);
|
|
174
|
+
if (normalizedValue) return normalizedValue;
|
|
175
|
+
}
|
|
176
|
+
return null;
|
|
177
|
+
};
|
|
178
|
+
var formatLineValue = (value) => {
|
|
179
|
+
return Number.isInteger(value) ? String(value) : String(value);
|
|
180
|
+
};
|
|
181
|
+
var readMarketLabel = (market) => {
|
|
182
|
+
var _a;
|
|
183
|
+
const rawLabel = (_a = normalizeResolvedOutcomeLabel(market == null ? void 0 : market.shortTitle)) != null ? _a : normalizeResolvedOutcomeLabel(market == null ? void 0 : market.question);
|
|
184
|
+
if (!rawLabel) return null;
|
|
185
|
+
if (/^draw\s*\(/i.test(rawLabel)) return "Draw";
|
|
186
|
+
return rawLabel;
|
|
187
|
+
};
|
|
188
|
+
var deriveTotalOutcomeLabel = (outcome, metadataLabel) => {
|
|
189
|
+
const normalizedMetadataLabel = metadataLabel == null ? void 0 : metadataLabel.trim().toLowerCase();
|
|
190
|
+
if (normalizedMetadataLabel && TOTAL_OUTCOME_LABELS.has(normalizedMetadataLabel)) {
|
|
191
|
+
return metadataLabel;
|
|
192
|
+
}
|
|
193
|
+
const normalizedRawLabel = outcome.label.trim().toLowerCase();
|
|
194
|
+
if (normalizedRawLabel === "yes") return "Over";
|
|
195
|
+
if (normalizedRawLabel === "no") return "Under";
|
|
196
|
+
return metadataLabel;
|
|
197
|
+
};
|
|
198
|
+
var resolveResolvedOutcomeLabel = ({
|
|
199
|
+
market,
|
|
200
|
+
outcome,
|
|
201
|
+
allowSportsMoneylineMarketFallback = true
|
|
202
|
+
}) => {
|
|
203
|
+
var _a;
|
|
204
|
+
if (!outcome) return null;
|
|
205
|
+
const rawLabel = normalizeResolvedOutcomeLabel(outcome.label);
|
|
206
|
+
const metadataLabel = readOutcomeMetadataLabel(outcome);
|
|
207
|
+
const normalizedRawLabel = (_a = rawLabel == null ? void 0 : rawLabel.toLowerCase()) != null ? _a : "";
|
|
208
|
+
const isGenericBinary = GENERIC_BINARY_OUTCOME_LABELS.has(normalizedRawLabel);
|
|
209
|
+
const isSportsMarket = Boolean(
|
|
210
|
+
(market == null ? void 0 : market.sportsMarketType) || (market == null ? void 0 : market.marketGroup) || (market == null ? void 0 : market.lineValue) != null
|
|
211
|
+
);
|
|
212
|
+
if (!isSportsMarket) {
|
|
213
|
+
const isDirectionalBinaryMarket = Boolean((market == null ? void 0 : market.question) && UP_OR_DOWN_QUESTION_RE.test(market.question)) && Boolean(metadataLabel && DIRECTIONAL_OUTCOME_LABELS.has(metadataLabel.trim().toLowerCase()));
|
|
214
|
+
if (isDirectionalBinaryMarket) return metadataLabel;
|
|
215
|
+
if (isGenericBinary) return rawLabel;
|
|
216
|
+
return metadataLabel != null ? metadataLabel : rawLabel;
|
|
217
|
+
}
|
|
218
|
+
const lineValue = typeof (market == null ? void 0 : market.lineValue) === "number" ? market.lineValue : null;
|
|
219
|
+
const isMoneylineMarket = (market == null ? void 0 : market.sportsMarketType) === "moneyline" || (market == null ? void 0 : market.marketGroup) === "game_lines";
|
|
220
|
+
const isTotalMarket = (market == null ? void 0 : market.sportsMarketType) === "total" || (market == null ? void 0 : market.marketGroup) === "totals";
|
|
221
|
+
if (isMoneylineMarket && metadataLabel) return metadataLabel;
|
|
222
|
+
if (allowSportsMoneylineMarketFallback && isMoneylineMarket && isGenericBinary) {
|
|
223
|
+
const marketLabel = readMarketLabel(market);
|
|
224
|
+
if (marketLabel) return marketLabel;
|
|
225
|
+
}
|
|
226
|
+
if (isTotalMarket) {
|
|
227
|
+
const totalLabel = deriveTotalOutcomeLabel(outcome, metadataLabel);
|
|
228
|
+
if (totalLabel && lineValue != null && !NUMERIC_TOKEN_RE.test(totalLabel)) {
|
|
229
|
+
return `${totalLabel} ${formatLineValue(Math.abs(lineValue))}`;
|
|
230
|
+
}
|
|
231
|
+
if (totalLabel) return totalLabel;
|
|
232
|
+
}
|
|
233
|
+
const isSpreadMarket = (market == null ? void 0 : market.sportsMarketType) === "spread" || (market == null ? void 0 : market.marketGroup) === "spreads";
|
|
234
|
+
if (isSpreadMarket && metadataLabel) {
|
|
235
|
+
if (lineValue != null && !NUMERIC_TOKEN_RE.test(metadataLabel)) {
|
|
236
|
+
const resolvedLineValue = normalizedRawLabel === "no" ? Math.abs(lineValue) : lineValue;
|
|
237
|
+
const formattedLineValue = resolvedLineValue > 0 ? `+${formatLineValue(resolvedLineValue)}` : formatLineValue(resolvedLineValue);
|
|
238
|
+
return `${metadataLabel} ${formattedLineValue}`;
|
|
239
|
+
}
|
|
240
|
+
return metadataLabel;
|
|
241
|
+
}
|
|
242
|
+
if (metadataLabel) return metadataLabel;
|
|
243
|
+
return rawLabel;
|
|
244
|
+
};
|
|
159
245
|
|
|
160
246
|
// src/primitives/error-boundary/index.tsx
|
|
161
247
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -3960,7 +4046,8 @@ var normalizeSeries = (series) => {
|
|
|
3960
4046
|
}).filter((seriesItem) => seriesItem.points.length > 0);
|
|
3961
4047
|
};
|
|
3962
4048
|
var formatDefaultChartValue = (value) => {
|
|
3963
|
-
|
|
4049
|
+
const roundedValue = Number(value.toFixed(1));
|
|
4050
|
+
return `${Number.isInteger(roundedValue) ? String(roundedValue) : roundedValue.toFixed(1)}%`;
|
|
3964
4051
|
};
|
|
3965
4052
|
var resolveChartTimeFormatter = (windowSeconds) => {
|
|
3966
4053
|
return (timestamp) => {
|
|
@@ -5923,7 +6010,7 @@ var sizeClasses2 = {
|
|
|
5923
6010
|
var lineColorByVenue = {
|
|
5924
6011
|
light: {
|
|
5925
6012
|
[import_sdk10.Venue.kalshi]: "#00D295",
|
|
5926
|
-
[import_sdk10.Venue.limitless]: "#
|
|
6013
|
+
[import_sdk10.Venue.limitless]: "#C4FF00",
|
|
5927
6014
|
[import_sdk10.Venue.opinion]: "#000000",
|
|
5928
6015
|
[import_sdk10.Venue.polymarket]: "#2E5CFF",
|
|
5929
6016
|
[import_sdk10.Venue.predict]: "#6D57F8",
|
|
@@ -5933,7 +6020,7 @@ var lineColorByVenue = {
|
|
|
5933
6020
|
},
|
|
5934
6021
|
dark: {
|
|
5935
6022
|
[import_sdk10.Venue.kalshi]: "#00D295",
|
|
5936
|
-
[import_sdk10.Venue.limitless]: "#
|
|
6023
|
+
[import_sdk10.Venue.limitless]: "#C4FF00",
|
|
5937
6024
|
[import_sdk10.Venue.opinion]: "#FFFFFF",
|
|
5938
6025
|
[import_sdk10.Venue.polymarket]: "#2E5CFF",
|
|
5939
6026
|
[import_sdk10.Venue.predict]: "#6D57F8",
|
|
@@ -6261,8 +6348,14 @@ var formatMarketProbabilityPercent = (value, formatPercent = formatWholePercent)
|
|
|
6261
6348
|
}
|
|
6262
6349
|
return formattedValue;
|
|
6263
6350
|
};
|
|
6264
|
-
var formatPriceGapPercent = (value) => {
|
|
6351
|
+
var formatPriceGapPercent = (value, mode = "percent") => {
|
|
6265
6352
|
if (typeof value !== "number" || !Number.isFinite(value)) return void 0;
|
|
6353
|
+
if (value <= 0) return void 0;
|
|
6354
|
+
if (mode === "fraction") {
|
|
6355
|
+
const percentageValue = value * 100;
|
|
6356
|
+
if (percentageValue < import_hooks26.MIN_PRICE_GAP_PCT) return void 0;
|
|
6357
|
+
return `${Math.round(percentageValue)}%`;
|
|
6358
|
+
}
|
|
6266
6359
|
if (value < import_hooks26.MIN_PRICE_GAP_PCT) return void 0;
|
|
6267
6360
|
if (value > import_hooks26.MAX_PRICE_GAP_PCT) return void 0;
|
|
6268
6361
|
return `${Math.round(value)}%`;
|
|
@@ -9004,6 +9097,24 @@ var buildOutcomeMidpointsByOutcomeId = (midpointRows) => {
|
|
|
9004
9097
|
}
|
|
9005
9098
|
return outcomeMidpointsByOutcomeId;
|
|
9006
9099
|
};
|
|
9100
|
+
var buildArbReturnByVenueMarketId = (midpointRows) => {
|
|
9101
|
+
const arbReturnByVenueMarketId = /* @__PURE__ */ new Map();
|
|
9102
|
+
const addArbReturn = (value) => {
|
|
9103
|
+
var _a, _b;
|
|
9104
|
+
if (!value || typeof value !== "object") return;
|
|
9105
|
+
const row = value;
|
|
9106
|
+
if (row.venueMarketId && !arbReturnByVenueMarketId.has(row.venueMarketId)) {
|
|
9107
|
+
arbReturnByVenueMarketId.set(row.venueMarketId, (_a = row.arbReturn) != null ? _a : null);
|
|
9108
|
+
}
|
|
9109
|
+
for (const matchedRow of (_b = row.matched) != null ? _b : []) {
|
|
9110
|
+
addArbReturn(matchedRow);
|
|
9111
|
+
}
|
|
9112
|
+
};
|
|
9113
|
+
for (const row of midpointRows) {
|
|
9114
|
+
addArbReturn(row);
|
|
9115
|
+
}
|
|
9116
|
+
return arbReturnByVenueMarketId;
|
|
9117
|
+
};
|
|
9007
9118
|
var resolveMarketHrefFromEventHref = (eventHref, marketId, outcomeId) => {
|
|
9008
9119
|
if (!eventHref) return void 0;
|
|
9009
9120
|
if (typeof window === "undefined") return void 0;
|
|
@@ -9020,6 +9131,9 @@ var EventListItemContent = ({
|
|
|
9020
9131
|
event,
|
|
9021
9132
|
classNames,
|
|
9022
9133
|
arbitrageByOutcomeId,
|
|
9134
|
+
midpointPrices,
|
|
9135
|
+
midpointRows: sharedMidpointRows,
|
|
9136
|
+
midpointsLoading,
|
|
9023
9137
|
onEventClick,
|
|
9024
9138
|
onMarketClick,
|
|
9025
9139
|
getMarketHref,
|
|
@@ -9073,6 +9187,8 @@ var EventListItemContent = ({
|
|
|
9073
9187
|
if (!isLazyMarketsQueryEnabled || lazyLoadedMarkets.length === 0) return allVenueMarkets;
|
|
9074
9188
|
return dedupeVenueMarketsById([...allVenueMarkets, ...lazyLoadedMarkets]);
|
|
9075
9189
|
}, [allVenueMarkets, isLazyMarketsQueryEnabled, lazyLoadedMarkets]);
|
|
9190
|
+
const hasExpandedMarkets = isLazyMarketsQueryEnabled && lazyLoadedMarkets.length > 0;
|
|
9191
|
+
const shouldUseSharedMidpoints = !hasExpandedMarkets && (midpointPrices !== void 0 || sharedMidpointRows !== void 0 || midpointsLoading !== void 0);
|
|
9076
9192
|
const midpointVenueMarketIds = (0, import_react14.useMemo)(() => {
|
|
9077
9193
|
var _a2;
|
|
9078
9194
|
const ids = [];
|
|
@@ -9084,19 +9200,21 @@ var EventListItemContent = ({
|
|
|
9084
9200
|
}
|
|
9085
9201
|
return [...new Set(ids)];
|
|
9086
9202
|
}, [resolvedOutcomeMarkets]);
|
|
9087
|
-
const { midpointRows, isLoading: isVenueMarketMidpointsLoading } = (0, import_hooks35.useVenueMarketMidpoints)({
|
|
9088
|
-
venueMarketIds: midpointVenueMarketIds,
|
|
9089
|
-
enabled: midpointVenueMarketIds.length > 0
|
|
9203
|
+
const { midpointRows: fetchedMidpointRows, isLoading: isVenueMarketMidpointsLoading } = (0, import_hooks35.useVenueMarketMidpoints)({
|
|
9204
|
+
venueMarketIds: shouldUseSharedMidpoints ? [] : midpointVenueMarketIds,
|
|
9205
|
+
enabled: !shouldUseSharedMidpoints && midpointVenueMarketIds.length > 0
|
|
9090
9206
|
});
|
|
9091
|
-
const { prices: displayMidpointsByOutcomeId, isLoading: isOutcomeMidpointsLoading } = (0, import_hooks35.useMidpoints)(resolvedOutcomeMarkets);
|
|
9092
|
-
const
|
|
9207
|
+
const { prices: displayMidpointsByOutcomeId, isLoading: isOutcomeMidpointsLoading } = (0, import_hooks35.useMidpoints)(shouldUseSharedMidpoints ? [] : resolvedOutcomeMarkets);
|
|
9208
|
+
const resolvedMidpointRows = shouldUseSharedMidpoints ? sharedMidpointRows != null ? sharedMidpointRows : [] : fetchedMidpointRows;
|
|
9209
|
+
const resolvedDisplayMidpointsByOutcomeId = shouldUseSharedMidpoints ? midpointPrices != null ? midpointPrices : /* @__PURE__ */ new Map() : displayMidpointsByOutcomeId;
|
|
9210
|
+
const isAwaitingMidpoints = midpointsLoading != null ? midpointsLoading : isOutcomeMidpointsLoading || midpointVenueMarketIds.length > 0 && isVenueMarketMidpointsLoading;
|
|
9093
9211
|
const displayPriceByOutcomeId = (0, import_react14.useMemo)(() => {
|
|
9094
|
-
const priceByOutcomeId = new Map(
|
|
9095
|
-
for (const [outcomeId, price] of buildOutcomeMidpointsByOutcomeId(
|
|
9212
|
+
const priceByOutcomeId = new Map(resolvedDisplayMidpointsByOutcomeId);
|
|
9213
|
+
for (const [outcomeId, price] of buildOutcomeMidpointsByOutcomeId(resolvedMidpointRows)) {
|
|
9096
9214
|
priceByOutcomeId.set(outcomeId, price);
|
|
9097
9215
|
}
|
|
9098
9216
|
return priceByOutcomeId;
|
|
9099
|
-
}, [
|
|
9217
|
+
}, [resolvedDisplayMidpointsByOutcomeId, resolvedMidpointRows]);
|
|
9100
9218
|
const comparison = (0, import_react14.useMemo)(() => {
|
|
9101
9219
|
return normalizeEventListItemV2Comparison({
|
|
9102
9220
|
venueMarkets: resolvedOutcomeMarkets,
|
|
@@ -9107,6 +9225,9 @@ var EventListItemContent = ({
|
|
|
9107
9225
|
const gapsByVenueMarketId = (0, import_react14.useMemo)(() => {
|
|
9108
9226
|
return computePriceGapsFromComparisonRows(comparison.rows);
|
|
9109
9227
|
}, [comparison.rows]);
|
|
9228
|
+
const arbReturnByVenueMarketId = (0, import_react14.useMemo)(() => {
|
|
9229
|
+
return buildArbReturnByVenueMarketId(resolvedMidpointRows);
|
|
9230
|
+
}, [resolvedMidpointRows]);
|
|
9110
9231
|
const shouldRenderLoadingOutcomeRow = shouldEnableLazyMarketLoading && (!isLazyMarketsQueryEnabled || isLoadingLazyMarkets || isFetchingNextLazyMarketsPage || hasNextLazyMarketsPage);
|
|
9111
9232
|
const resolvedVolume = (_a = resolveDisplayVolume(event.volume, allVenueMarkets)) != null ? _a : 0;
|
|
9112
9233
|
const volumeLabel = `${config.formatting.formatCompactCurrency(resolvedVolume)} ${labels.eventItem.volumeSuffix}`;
|
|
@@ -9238,10 +9359,10 @@ var EventListItemContent = ({
|
|
|
9238
9359
|
)
|
|
9239
9360
|
] });
|
|
9240
9361
|
};
|
|
9241
|
-
const renderPriceGapPill = (value) => {
|
|
9362
|
+
const renderPriceGapPill = (value, source = "percent") => {
|
|
9242
9363
|
if (!config.features.enablePriceGap) return null;
|
|
9243
9364
|
if (isAwaitingMidpoints) return null;
|
|
9244
|
-
const formattedPriceGap = formatPriceGapPercent(value);
|
|
9365
|
+
const formattedPriceGap = formatPriceGapPercent(value, source);
|
|
9245
9366
|
if (!formattedPriceGap) return null;
|
|
9246
9367
|
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
9247
9368
|
"span",
|
|
@@ -9377,7 +9498,9 @@ var EventListItemContent = ({
|
|
|
9377
9498
|
comparison.rows.map((row) => {
|
|
9378
9499
|
var _a2;
|
|
9379
9500
|
const arbitragePercent = (_a2 = arbitrageByOutcomeId == null ? void 0 : arbitrageByOutcomeId[row.outcome.id]) != null ? _a2 : arbitrageByOutcomeId == null ? void 0 : arbitrageByOutcomeId[row.market.id];
|
|
9380
|
-
const
|
|
9501
|
+
const arbReturn = arbReturnByVenueMarketId.get(row.market.id);
|
|
9502
|
+
const priceGapPercent = arbReturn == null ? gapsByVenueMarketId.get(row.market.id) : arbReturn;
|
|
9503
|
+
const priceGapSource = arbReturn == null ? "percent" : "fraction";
|
|
9381
9504
|
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
9382
9505
|
"div",
|
|
9383
9506
|
{
|
|
@@ -9397,7 +9520,7 @@ var EventListItemContent = ({
|
|
|
9397
9520
|
) }),
|
|
9398
9521
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "agg-outcome-meta flex shrink-0 flex-row items-center justify-end gap-2", children: [
|
|
9399
9522
|
renderArbitrage(arbitragePercent),
|
|
9400
|
-
renderPriceGapPill(priceGapPercent),
|
|
9523
|
+
renderPriceGapPill(priceGapPercent, priceGapSource),
|
|
9401
9524
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("div", { className: "agg-outcome-price-strip relative flex shrink-0 items-center justify-end", children: isAwaitingMidpoints ? renderPriceStripSkeleton(row.prices.length) : row.prices.map(
|
|
9402
9525
|
(price, priceIndex) => renderComparisonPriceBadge(row, price, priceIndex)
|
|
9403
9526
|
) })
|
|
@@ -9904,6 +10027,23 @@ var resolveSortQueryParams = (value) => {
|
|
|
9904
10027
|
}
|
|
9905
10028
|
return { sortBy: "volume24hr", sortDir: "desc" };
|
|
9906
10029
|
};
|
|
10030
|
+
var collectEventListVenueMarkets = (events) => {
|
|
10031
|
+
return events.flatMap((event) => {
|
|
10032
|
+
var _a;
|
|
10033
|
+
return (_a = event.venueMarkets) != null ? _a : [];
|
|
10034
|
+
});
|
|
10035
|
+
};
|
|
10036
|
+
var collectMidpointVenueMarketIds = (venueMarkets) => {
|
|
10037
|
+
var _a;
|
|
10038
|
+
const ids = [];
|
|
10039
|
+
for (const market of venueMarkets) {
|
|
10040
|
+
ids.push(market.id);
|
|
10041
|
+
for (const sibling of (_a = market.matchedVenueMarkets) != null ? _a : []) {
|
|
10042
|
+
ids.push(sibling.id);
|
|
10043
|
+
}
|
|
10044
|
+
}
|
|
10045
|
+
return [...new Set(ids)];
|
|
10046
|
+
};
|
|
9907
10047
|
var EventList = ({
|
|
9908
10048
|
title: title2,
|
|
9909
10049
|
limit = DEFAULT_EVENTS_LIMIT,
|
|
@@ -10118,6 +10258,16 @@ var EventList = ({
|
|
|
10118
10258
|
if (resolvedMaxVisibleItems == null) return normalizedEvents;
|
|
10119
10259
|
return normalizedEvents.slice(0, resolvedMaxVisibleItems);
|
|
10120
10260
|
}, [orderedEvents, resolvedMaxVisibleItems]);
|
|
10261
|
+
const visibleVenueMarkets = (0, import_react17.useMemo)(() => {
|
|
10262
|
+
return collectEventListVenueMarkets(tileEvents);
|
|
10263
|
+
}, [tileEvents]);
|
|
10264
|
+
const visibleMidpointVenueMarketIds = (0, import_react17.useMemo)(() => {
|
|
10265
|
+
return collectMidpointVenueMarketIds(visibleVenueMarkets);
|
|
10266
|
+
}, [visibleVenueMarkets]);
|
|
10267
|
+
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0, import_hooks37.useVenueMarketMidpoints)({
|
|
10268
|
+
venueMarketIds: visibleMidpointVenueMarketIds,
|
|
10269
|
+
enabled: visibleMidpointVenueMarketIds.length > 0
|
|
10270
|
+
});
|
|
10121
10271
|
const shouldRenderLoadingState = isLoading && !isPlaceholderData && tileEvents.length === 0;
|
|
10122
10272
|
const shouldRenderEmptyState = !isLoading && !isError && tileEvents.length === 0;
|
|
10123
10273
|
const shouldRenderPaginationLoadingItems = shouldPaginate && hasNextPage;
|
|
@@ -10286,6 +10436,8 @@ var EventList = ({
|
|
|
10286
10436
|
EventListItem,
|
|
10287
10437
|
{
|
|
10288
10438
|
event,
|
|
10439
|
+
midpointRows: sharedMidpointRows,
|
|
10440
|
+
midpointsLoading: isSharedMidpointsLoading,
|
|
10289
10441
|
classNames: {
|
|
10290
10442
|
root: "agg-event-list-item w-full min-w-0! max-w-none justify-between!"
|
|
10291
10443
|
},
|
|
@@ -10553,6 +10705,79 @@ var isDateLikeLabel = (value) => {
|
|
|
10553
10705
|
if (!value.trim()) return false;
|
|
10554
10706
|
return (0, import_dayjs4.default)(value).isValid();
|
|
10555
10707
|
};
|
|
10708
|
+
var CHART_RANGE_PRIORITY = ["1H", "6H", "1D", "1W", "1M", "ALL"];
|
|
10709
|
+
var RANGE_SECONDS_BY_TIME_RANGE = {
|
|
10710
|
+
"1H": 60 * 60,
|
|
10711
|
+
"6H": 6 * 60 * 60,
|
|
10712
|
+
"1D": 24 * 60 * 60,
|
|
10713
|
+
"1W": 7 * 24 * 60 * 60,
|
|
10714
|
+
"1M": 30 * 24 * 60 * 60,
|
|
10715
|
+
ALL: 6 * 30 * 24 * 60 * 60
|
|
10716
|
+
};
|
|
10717
|
+
var toUnixTimestamp = (value) => {
|
|
10718
|
+
if (!value) return null;
|
|
10719
|
+
const parsedValue = (0, import_dayjs4.default)(value);
|
|
10720
|
+
if (!parsedValue.isValid()) return null;
|
|
10721
|
+
return parsedValue.unix();
|
|
10722
|
+
};
|
|
10723
|
+
var isResolvedMarketStatus = (status) => {
|
|
10724
|
+
if (!status) return false;
|
|
10725
|
+
const normalizedStatus = status.trim().toLowerCase();
|
|
10726
|
+
return normalizedStatus.includes("resolved") || normalizedStatus.includes("closed") || normalizedStatus.includes("settled") || normalizedStatus.includes("final");
|
|
10727
|
+
};
|
|
10728
|
+
var resolveInitialEventDetailsChartRange = ({
|
|
10729
|
+
chartData,
|
|
10730
|
+
event,
|
|
10731
|
+
fallbackRange,
|
|
10732
|
+
nowSec = (0, import_dayjs4.default)().unix(),
|
|
10733
|
+
selectedMarket
|
|
10734
|
+
}) => {
|
|
10735
|
+
var _a, _b;
|
|
10736
|
+
const scopedMarkets = selectedMarket ? [selectedMarket] : event.venueMarkets;
|
|
10737
|
+
const preferredEventStart = (_a = toUnixTimestamp(event.startDate)) != null ? _a : toUnixTimestamp(event.creationDate);
|
|
10738
|
+
const marketStartCandidates = scopedMarkets.map((market) => {
|
|
10739
|
+
var _a2;
|
|
10740
|
+
return (_a2 = toUnixTimestamp(market.startDate)) != null ? _a2 : toUnixTimestamp(market.creationDate);
|
|
10741
|
+
}).filter((value) => value != null);
|
|
10742
|
+
const metadataStarts = [preferredEventStart, ...marketStartCandidates].filter(
|
|
10743
|
+
(value) => value != null
|
|
10744
|
+
);
|
|
10745
|
+
const metadataEnds = [
|
|
10746
|
+
toUnixTimestamp(event.endDate),
|
|
10747
|
+
...scopedMarkets.flatMap((market) => [
|
|
10748
|
+
toUnixTimestamp(market.endDate),
|
|
10749
|
+
toUnixTimestamp(market.resolutionDate)
|
|
10750
|
+
])
|
|
10751
|
+
].filter((value) => value != null);
|
|
10752
|
+
const historyTimestamps = chartData == null ? [] : Object.values(chartData.venues).flatMap((venueData) => [
|
|
10753
|
+
...venueData.candles.map((candle) => candle.time),
|
|
10754
|
+
...venueData.liveCandle ? [venueData.liveCandle.time] : []
|
|
10755
|
+
]);
|
|
10756
|
+
const startCandidates = [...metadataStarts, ...historyTimestamps];
|
|
10757
|
+
if (startCandidates.length === 0) {
|
|
10758
|
+
return fallbackRange != null ? fallbackRange : null;
|
|
10759
|
+
}
|
|
10760
|
+
const marketResolved = [event.status, ...scopedMarkets.map((market) => market.status)].some(
|
|
10761
|
+
isResolvedMarketStatus
|
|
10762
|
+
);
|
|
10763
|
+
const isUsingSharedOverlapStart = scopedMarkets.length > 1 && marketStartCandidates.length === scopedMarkets.length;
|
|
10764
|
+
const startTs = isUsingSharedOverlapStart ? Math.max(...marketStartCandidates) : Math.min(...startCandidates);
|
|
10765
|
+
const endTs = Math.max(
|
|
10766
|
+
...marketResolved && metadataEnds.length > 0 ? [nowSec, ...metadataEnds, ...historyTimestamps] : [nowSec, ...historyTimestamps]
|
|
10767
|
+
);
|
|
10768
|
+
const spanSeconds = Math.max(0, endTs - startTs);
|
|
10769
|
+
if (spanSeconds <= 0) {
|
|
10770
|
+
return fallbackRange != null ? fallbackRange : null;
|
|
10771
|
+
}
|
|
10772
|
+
if (!marketResolved && spanSeconds > RANGE_SECONDS_BY_TIME_RANGE["1M"]) {
|
|
10773
|
+
return "1M";
|
|
10774
|
+
}
|
|
10775
|
+
const requiredSeconds = spanSeconds * (isUsingSharedOverlapStart ? 1 : marketResolved ? 1.05 : 1.2);
|
|
10776
|
+
const matchingRange = CHART_RANGE_PRIORITY.find((range) => {
|
|
10777
|
+
return RANGE_SECONDS_BY_TIME_RANGE[range] >= requiredSeconds;
|
|
10778
|
+
});
|
|
10779
|
+
return (_b = matchingRange != null ? matchingRange : fallbackRange) != null ? _b : "ALL";
|
|
10780
|
+
};
|
|
10556
10781
|
var matchOutcomeByLabel = (outcome, selectedOutcomeLabel) => {
|
|
10557
10782
|
const normalizedSelectedLabel = normalizeLabel(selectedOutcomeLabel);
|
|
10558
10783
|
const semanticSelectedLabel = toSemanticLabel(selectedOutcomeLabel);
|
|
@@ -12612,7 +12837,6 @@ var EventListItemDetailsGraphSection = ({
|
|
|
12612
12837
|
venueMarkets,
|
|
12613
12838
|
selectedMarketId,
|
|
12614
12839
|
livePrices,
|
|
12615
|
-
wsLivePrices,
|
|
12616
12840
|
restMidpoints,
|
|
12617
12841
|
bestMidpoint,
|
|
12618
12842
|
bestPrices,
|
|
@@ -12806,7 +13030,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
12806
13030
|
{
|
|
12807
13031
|
classNames: { root: cn("agg-chart-region", classNames == null ? void 0 : classNames.chart) },
|
|
12808
13032
|
series: visibleChartSeries,
|
|
12809
|
-
height:
|
|
13033
|
+
height: 200,
|
|
12810
13034
|
isLoading: isScopedMarketChartLoading,
|
|
12811
13035
|
chartType: selectedChartType,
|
|
12812
13036
|
liveCandle: selectedChartType === "candlestick" ? (_m = chartLiveState.liveCandle) != null ? _m : void 0 : void 0,
|
|
@@ -12835,7 +13059,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
12835
13059
|
),
|
|
12836
13060
|
children: chartAvailableVenueOutcomes.map((item) => {
|
|
12837
13061
|
var _a3, _b3;
|
|
12838
|
-
const percentage = (_b3 = (_a3 = resolvedOutcomePriceByMarketId.get(item.market.id)) == null ? void 0 : _a3.get(item.outcome.id)) != null ? _b3 :
|
|
13062
|
+
const percentage = (_b3 = (_a3 = resolvedOutcomePriceByMarketId.get(item.market.id)) == null ? void 0 : _a3.get(item.outcome.id)) != null ? _b3 : livePrices.get(item.outcome.id);
|
|
12839
13063
|
const text = formatMarketProbabilityPercent(percentage, formatPercent);
|
|
12840
13064
|
const seriesId = `${item.venue}-chart`;
|
|
12841
13065
|
const isActiveVenue = activeGraphVenue === item.venue;
|
|
@@ -12843,6 +13067,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
12843
13067
|
"button",
|
|
12844
13068
|
{
|
|
12845
13069
|
type: "button",
|
|
13070
|
+
"data-id": item.outcome.id,
|
|
12846
13071
|
"aria-label": `${item.venue} ${text}`,
|
|
12847
13072
|
"aria-pressed": isActiveVenue,
|
|
12848
13073
|
className: cn(
|
|
@@ -12933,6 +13158,7 @@ var EventListItemDetailsContent = ({
|
|
|
12933
13158
|
detailsStats,
|
|
12934
13159
|
eventTradingState,
|
|
12935
13160
|
ariaLabel,
|
|
13161
|
+
defaultTimeRange,
|
|
12936
13162
|
onClick,
|
|
12937
13163
|
midpointsResult
|
|
12938
13164
|
}) => {
|
|
@@ -12941,9 +13167,6 @@ var EventListItemDetailsContent = ({
|
|
|
12941
13167
|
const lastAppliedEventSyncKeyRef = (0, import_react23.useRef)(null);
|
|
12942
13168
|
const lastAppliedDefaultRef = (0, import_react23.useRef)(null);
|
|
12943
13169
|
const [chartRangeOverride, setChartRangeOverride] = (0, import_react23.useState)(null);
|
|
12944
|
-
(0, import_react23.useEffect)(() => {
|
|
12945
|
-
setChartRangeOverride(null);
|
|
12946
|
-
}, [event.id]);
|
|
12947
13170
|
const config = (0, import_hooks46.useSdkUiConfig)();
|
|
12948
13171
|
const labels = (0, import_hooks46.useLabels)();
|
|
12949
13172
|
const tradingContext = (0, import_hooks39.useEventTradingContext)();
|
|
@@ -12952,13 +13175,20 @@ var EventListItemDetailsContent = ({
|
|
|
12952
13175
|
return eventTradingState != null ? eventTradingState : (0, import_hooks46.resolveEventTradingState)(event);
|
|
12953
13176
|
}, [event, eventTradingState]);
|
|
12954
13177
|
const scopedSelectedMarket = (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? (_a = tradingContext.selectedMarket) != null ? _a : resolvedEventTradingState.primaryMarket : resolvedEventTradingState.primaryMarket;
|
|
13178
|
+
const venueMarkets = (0, import_react23.useMemo)(
|
|
13179
|
+
() => resolvedEventTradingState.displayMarkets,
|
|
13180
|
+
[resolvedEventTradingState.displayMarkets]
|
|
13181
|
+
);
|
|
13182
|
+
const eventDetailVenueMarkets = (0, import_react23.useMemo)(() => {
|
|
13183
|
+
return normalizeVenueMarketCluster(venueMarkets);
|
|
13184
|
+
}, [venueMarkets]);
|
|
12955
13185
|
const scopedSelectedMarketId = (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? tradingContext.selectedMarketId : null;
|
|
12956
13186
|
(0, import_hooks46.useEventOrderbookData)(
|
|
12957
13187
|
resolvedEventTradingState.isTradingDisabled ? [] : resolvedEventTradingState.displayMarkets,
|
|
12958
13188
|
scopedSelectedMarketId
|
|
12959
13189
|
);
|
|
12960
|
-
const wsLivePrices = (0, import_hooks46.useLiveOutcomePrices)(
|
|
12961
|
-
const wsBestPrices = (0, import_hooks46.useLiveBestPrices)(
|
|
13190
|
+
const wsLivePrices = (0, import_hooks46.useLiveOutcomePrices)(eventDetailVenueMarkets);
|
|
13191
|
+
const wsBestPrices = (0, import_hooks46.useLiveBestPrices)(eventDetailVenueMarkets);
|
|
12962
13192
|
const resolvedMidpointsResult = midpointsResult != null ? midpointsResult : {
|
|
12963
13193
|
prices: /* @__PURE__ */ new Map(),
|
|
12964
13194
|
bestMidpointsByOutcomeId: /* @__PURE__ */ new Map(),
|
|
@@ -12983,6 +13213,16 @@ var EventListItemDetailsContent = ({
|
|
|
12983
13213
|
for (const [k, v] of wsLivePrices) merged.set(k, v);
|
|
12984
13214
|
return merged;
|
|
12985
13215
|
}, [restMidpoints, wsLivePrices]);
|
|
13216
|
+
const initialChartTimeRange = (0, import_react23.useMemo)(() => {
|
|
13217
|
+
return resolveInitialEventDetailsChartRange({
|
|
13218
|
+
event,
|
|
13219
|
+
selectedMarket: scopedSelectedMarket,
|
|
13220
|
+
fallbackRange: defaultTimeRange != null ? defaultTimeRange : config.chart.selectedChartTimeRange
|
|
13221
|
+
});
|
|
13222
|
+
}, [config.chart.selectedChartTimeRange, defaultTimeRange, event, scopedSelectedMarket]);
|
|
13223
|
+
(0, import_react23.useEffect)(() => {
|
|
13224
|
+
setChartRangeOverride(initialChartTimeRange);
|
|
13225
|
+
}, [event.id, initialChartTimeRange, scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.id]);
|
|
12986
13226
|
(0, import_react23.useEffect)(() => {
|
|
12987
13227
|
if (!tradingContext) return;
|
|
12988
13228
|
if (lastAppliedEventSyncKeyRef.current === eventSyncKey) return;
|
|
@@ -13020,10 +13260,6 @@ var EventListItemDetailsContent = ({
|
|
|
13020
13260
|
tradingContext,
|
|
13021
13261
|
tradingContext == null ? void 0 : tradingContext.selectedEventId
|
|
13022
13262
|
]);
|
|
13023
|
-
const venueMarkets = (0, import_react23.useMemo)(
|
|
13024
|
-
() => resolvedEventTradingState.displayMarkets,
|
|
13025
|
-
[resolvedEventTradingState.displayMarkets]
|
|
13026
|
-
);
|
|
13027
13263
|
const marketOptions = (0, import_react23.useMemo)(
|
|
13028
13264
|
() => venueMarkets.map((vm) => ({
|
|
13029
13265
|
value: vm.id,
|
|
@@ -13145,7 +13381,6 @@ var EventListItemDetailsContent = ({
|
|
|
13145
13381
|
venueMarkets,
|
|
13146
13382
|
selectedMarketId: (_d = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.id) != null ? _d : null,
|
|
13147
13383
|
livePrices,
|
|
13148
|
-
wsLivePrices,
|
|
13149
13384
|
restMidpoints,
|
|
13150
13385
|
bestMidpoint,
|
|
13151
13386
|
bestPrices,
|
|
@@ -13861,8 +14096,13 @@ var resolveTradingStateTimestampLabel = (labels, state) => {
|
|
|
13861
14096
|
return null;
|
|
13862
14097
|
};
|
|
13863
14098
|
var resolveTradingStatePresentation = (labels, state) => {
|
|
14099
|
+
var _a;
|
|
13864
14100
|
const timestampLabel = resolveTradingStateTimestampLabel(labels, state);
|
|
13865
|
-
const
|
|
14101
|
+
const resolvedOutcomeLabel = resolveResolvedOutcomeLabel({
|
|
14102
|
+
market: (_a = state.market) != null ? _a : null,
|
|
14103
|
+
outcome: state.winningOutcome
|
|
14104
|
+
});
|
|
14105
|
+
const winningOutcomeLabel = resolvedOutcomeLabel ? labels.eventMarketPage.winningOutcome(resolvedOutcomeLabel) : null;
|
|
13866
14106
|
if (state.kind === "resolved") {
|
|
13867
14107
|
return {
|
|
13868
14108
|
badgeLabel: labels.eventMarketPage.tradingResolvedBadge,
|
|
@@ -14573,6 +14813,10 @@ var MarketDetailsContent = ({
|
|
|
14573
14813
|
const isOutcomeSelectionLocked = marketTradingState.isTradingDisabled;
|
|
14574
14814
|
const isUpcomingMarket = marketTradingState.kind === "unopened";
|
|
14575
14815
|
const marketStatePresentation = resolveTradingStatePresentation(labels, marketTradingState);
|
|
14816
|
+
const resolvedWinningOutcomeLabel = resolveResolvedOutcomeLabel({
|
|
14817
|
+
market: scopedMarketForCard,
|
|
14818
|
+
outcome: marketTradingState.winningOutcome
|
|
14819
|
+
});
|
|
14576
14820
|
const marketDetailsTabs = (0, import_react27.useMemo)(() => {
|
|
14577
14821
|
return getMarketDetailsTabs(labels);
|
|
14578
14822
|
}, [labels]);
|
|
@@ -15009,7 +15253,9 @@ var MarketDetailsContent = ({
|
|
|
15009
15253
|
)
|
|
15010
15254
|
}
|
|
15011
15255
|
),
|
|
15012
|
-
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(Typography, { variant: "body", children: labels.eventMarketPage.resolvedOutcome(
|
|
15256
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(Typography, { variant: "body", children: labels.eventMarketPage.resolvedOutcome(
|
|
15257
|
+
resolvedWinningOutcomeLabel != null ? resolvedWinningOutcomeLabel : marketTradingState.winningOutcome.label
|
|
15258
|
+
) })
|
|
15013
15259
|
]
|
|
15014
15260
|
}
|
|
15015
15261
|
) }) : isUpcomingMarket ? /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "agg-outcomes flex w-full items-center justify-end md:w-auto md:shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)(
|
|
@@ -17955,7 +18201,7 @@ var PlaceOrderResolvedView = ({
|
|
|
17955
18201
|
className,
|
|
17956
18202
|
isSportsEvent = false
|
|
17957
18203
|
}) => {
|
|
17958
|
-
var _a;
|
|
18204
|
+
var _a, _b;
|
|
17959
18205
|
const labels = (0, import_hooks54.useLabels)();
|
|
17960
18206
|
const tradingLabels = labels.trading;
|
|
17961
18207
|
const resolvingTimestamp = (_a = resolutionTimestamp != null ? resolutionTimestamp : tradingState.resolvesAt) != null ? _a : tradingState.endsAt;
|
|
@@ -18033,7 +18279,16 @@ var PlaceOrderResolvedView = ({
|
|
|
18033
18279
|
),
|
|
18034
18280
|
children: [
|
|
18035
18281
|
tradingState.market ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Typography, { variant: "body", className: "text-center", children: tradingState.market.question }) : null,
|
|
18036
|
-
tradingState.winningOutcome ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Typography, { variant: "body-large-strong", children: tradingLabels.outcome(
|
|
18282
|
+
tradingState.winningOutcome ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Typography, { variant: "body-large-strong", children: tradingLabels.outcome(
|
|
18283
|
+
shouldUseRawResolvedPlaceOrderOutcomeLabel(
|
|
18284
|
+
tradingState.market,
|
|
18285
|
+
tradingState.winningOutcome
|
|
18286
|
+
) ? tradingState.winningOutcome.label : (_b = resolveResolvedOutcomeLabel({
|
|
18287
|
+
market: tradingState.market,
|
|
18288
|
+
outcome: tradingState.winningOutcome,
|
|
18289
|
+
allowSportsMoneylineMarketFallback: false
|
|
18290
|
+
})) != null ? _b : tradingState.winningOutcome.label
|
|
18291
|
+
) }) : null
|
|
18037
18292
|
]
|
|
18038
18293
|
}
|
|
18039
18294
|
)
|
|
@@ -18095,6 +18350,16 @@ var renderRouteBreakdownRow = (row) => {
|
|
|
18095
18350
|
rowKey
|
|
18096
18351
|
);
|
|
18097
18352
|
};
|
|
18353
|
+
var SIDE_NAMED_MONEYLINE_QUESTION_RE = /\s(?:vs\.?|@|at)\s/i;
|
|
18354
|
+
var shouldUseRawResolvedPlaceOrderOutcomeLabel = (market, outcome) => {
|
|
18355
|
+
var _a, _b;
|
|
18356
|
+
if (!market || !outcome) return false;
|
|
18357
|
+
const isSportsMoneylineMarket = (market.sportsMarketType === "moneyline" || market.marketGroup === "game_lines") && (outcome.label.trim().toLowerCase() === "yes" || outcome.label.trim().toLowerCase() === "no");
|
|
18358
|
+
if (!isSportsMoneylineMarket) return false;
|
|
18359
|
+
const marketLabel = ((_b = (_a = market.shortTitle) != null ? _a : market.question) != null ? _b : "").trim();
|
|
18360
|
+
if (!marketLabel) return false;
|
|
18361
|
+
return !SIDE_NAMED_MONEYLINE_QUESTION_RE.test(marketLabel);
|
|
18362
|
+
};
|
|
18098
18363
|
var renderRouteCard = ({
|
|
18099
18364
|
card,
|
|
18100
18365
|
enableAnimations,
|
|
@@ -20328,7 +20593,7 @@ function useResolvedMarketClaim(options = {}) {
|
|
|
20328
20593
|
}, executionMode === "paper" ? { mode: "paper" } : {}));
|
|
20329
20594
|
const claimWinnings = useClaimWinnings();
|
|
20330
20595
|
return (0, import_react34.useMemo)(() => {
|
|
20331
|
-
var _a2
|
|
20596
|
+
var _a2;
|
|
20332
20597
|
if (!shouldFetch || !marketId) return void 0;
|
|
20333
20598
|
const group = positions.find(
|
|
20334
20599
|
(candidate) => candidate.targetMarketId === marketId
|
|
@@ -20340,7 +20605,10 @@ function useResolvedMarketClaim(options = {}) {
|
|
|
20340
20605
|
if (winningOutcomes.length === 0) return void 0;
|
|
20341
20606
|
const totals = (0, import_hooks56.computeClosedPositionTotals)(group);
|
|
20342
20607
|
const winningShares = winningOutcomes.reduce((sum, outcome) => sum + outcome.totalSize, 0);
|
|
20343
|
-
const winningOutcomeLabel = (
|
|
20608
|
+
const winningOutcomeLabel = (_a2 = resolveResolvedOutcomeLabel({
|
|
20609
|
+
market: market != null ? market : group.venueMarket,
|
|
20610
|
+
outcome: winningOutcomes[0]
|
|
20611
|
+
})) != null ? _a2 : "";
|
|
20344
20612
|
const claimKey = group.targetMarketId;
|
|
20345
20613
|
const canClaim = group.redeemStatus === "eligible" && totals.winningOutcomeIds.length > 0;
|
|
20346
20614
|
return {
|
|
@@ -20656,252 +20924,6 @@ var import_react38 = require("react");
|
|
|
20656
20924
|
var import_hooks59 = require("@agg-build/hooks");
|
|
20657
20925
|
var import_react37 = require("react");
|
|
20658
20926
|
|
|
20659
|
-
// src/pages/event-market/sports-market-card.tsx
|
|
20660
|
-
var import_hooks58 = require("@agg-build/hooks");
|
|
20661
|
-
var import_react36 = require("react");
|
|
20662
|
-
|
|
20663
|
-
// src/pages/event-market/sports-line-rail.tsx
|
|
20664
|
-
var React = __toESM(require("react"));
|
|
20665
|
-
var import_jsx_runtime149 = require("react/jsx-runtime");
|
|
20666
|
-
function VenueRow({ venues, active }) {
|
|
20667
|
-
if (!venues || venues.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("span", { className: "h-4" });
|
|
20668
|
-
const shown = venues.length > 3 ? venues.slice(0, 2) : venues;
|
|
20669
|
-
const extra = venues.length - shown.length;
|
|
20670
|
-
return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
|
|
20671
|
-
"span",
|
|
20672
|
-
{
|
|
20673
|
-
className: cn(
|
|
20674
|
-
"flex h-4 items-center justify-center gap-1",
|
|
20675
|
-
!active && "text-agg-muted-foreground"
|
|
20676
|
-
),
|
|
20677
|
-
children: [
|
|
20678
|
-
shown.map((venue, index) => /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
20679
|
-
VenueLogo,
|
|
20680
|
-
{
|
|
20681
|
-
venue,
|
|
20682
|
-
isMonochromatic: !active,
|
|
20683
|
-
size: "small",
|
|
20684
|
-
className: "size-3! shrink-0"
|
|
20685
|
-
},
|
|
20686
|
-
`${venue}-${index}`
|
|
20687
|
-
)),
|
|
20688
|
-
extra > 0 && /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("span", { className: "text-[10px] font-agg-bold uppercase leading-[14px] text-agg-muted-foreground", children: [
|
|
20689
|
-
"+",
|
|
20690
|
-
extra
|
|
20691
|
-
] })
|
|
20692
|
-
]
|
|
20693
|
-
}
|
|
20694
|
-
);
|
|
20695
|
-
}
|
|
20696
|
-
function SportsLineRail({
|
|
20697
|
-
stops,
|
|
20698
|
-
selectedIndex,
|
|
20699
|
-
onSelect,
|
|
20700
|
-
ariaLabel,
|
|
20701
|
-
previousAriaLabel,
|
|
20702
|
-
nextAriaLabel,
|
|
20703
|
-
className
|
|
20704
|
-
}) {
|
|
20705
|
-
const scrollRef = React.useRef(null);
|
|
20706
|
-
const itemRefs = React.useRef([]);
|
|
20707
|
-
const didInit = React.useRef(false);
|
|
20708
|
-
const programmatic = React.useRef(false);
|
|
20709
|
-
const progTimer = React.useRef(void 0);
|
|
20710
|
-
const skipCenterOnPropSync = React.useRef(false);
|
|
20711
|
-
const pendingScrollIndex = React.useRef(null);
|
|
20712
|
-
const scrollSettleTimer = React.useRef(void 0);
|
|
20713
|
-
const stopCount = stops.length;
|
|
20714
|
-
const [pad, setPad] = React.useState({ left: 0, right: 0 });
|
|
20715
|
-
const [mask, setMask] = React.useState({ left: false, right: false });
|
|
20716
|
-
const updateMask = React.useCallback(() => {
|
|
20717
|
-
const c = scrollRef.current;
|
|
20718
|
-
if (!c || !c.clientWidth) return;
|
|
20719
|
-
setMask({
|
|
20720
|
-
left: c.scrollLeft > 1,
|
|
20721
|
-
right: c.scrollLeft + c.clientWidth < c.scrollWidth - 1
|
|
20722
|
-
});
|
|
20723
|
-
}, []);
|
|
20724
|
-
const resolveNearestIndexToViewportCenter = React.useCallback(() => {
|
|
20725
|
-
const container = scrollRef.current;
|
|
20726
|
-
if (!container || !container.clientWidth) return null;
|
|
20727
|
-
const viewportCenter = container.scrollLeft + container.clientWidth / 2;
|
|
20728
|
-
let nearestIndex = null;
|
|
20729
|
-
let nearestDistance = Number.POSITIVE_INFINITY;
|
|
20730
|
-
itemRefs.current.forEach((item, index) => {
|
|
20731
|
-
if (!item) return;
|
|
20732
|
-
const itemCenter = item.offsetLeft + item.offsetWidth / 2;
|
|
20733
|
-
const distance = Math.abs(itemCenter - viewportCenter);
|
|
20734
|
-
if (distance < nearestDistance) {
|
|
20735
|
-
nearestDistance = distance;
|
|
20736
|
-
nearestIndex = index;
|
|
20737
|
-
}
|
|
20738
|
-
});
|
|
20739
|
-
return nearestIndex;
|
|
20740
|
-
}, []);
|
|
20741
|
-
React.useLayoutEffect(() => {
|
|
20742
|
-
const c = scrollRef.current;
|
|
20743
|
-
if (!c) return;
|
|
20744
|
-
const measure = () => {
|
|
20745
|
-
var _a, _b, _c, _d;
|
|
20746
|
-
const w = c.clientWidth;
|
|
20747
|
-
if (!w) return;
|
|
20748
|
-
const firstW = (_b = (_a = itemRefs.current[0]) == null ? void 0 : _a.offsetWidth) != null ? _b : 0;
|
|
20749
|
-
const lastW = (_d = (_c = itemRefs.current[stopCount - 1]) == null ? void 0 : _c.offsetWidth) != null ? _d : 0;
|
|
20750
|
-
setPad({
|
|
20751
|
-
left: Math.max(0, w / 2 - firstW / 2),
|
|
20752
|
-
right: Math.max(0, w / 2 - lastW / 2)
|
|
20753
|
-
});
|
|
20754
|
-
updateMask();
|
|
20755
|
-
};
|
|
20756
|
-
const onScroll = () => {
|
|
20757
|
-
if (!programmatic.current) {
|
|
20758
|
-
const nearestIndex = resolveNearestIndexToViewportCenter();
|
|
20759
|
-
if (nearestIndex != null && nearestIndex !== selectedIndex) {
|
|
20760
|
-
pendingScrollIndex.current = nearestIndex;
|
|
20761
|
-
clearTimeout(scrollSettleTimer.current);
|
|
20762
|
-
scrollSettleTimer.current = setTimeout(() => {
|
|
20763
|
-
const nextIndex = pendingScrollIndex.current;
|
|
20764
|
-
if (nextIndex == null || nextIndex === selectedIndex) return;
|
|
20765
|
-
skipCenterOnPropSync.current = true;
|
|
20766
|
-
onSelect(nextIndex);
|
|
20767
|
-
}, 120);
|
|
20768
|
-
}
|
|
20769
|
-
}
|
|
20770
|
-
updateMask();
|
|
20771
|
-
};
|
|
20772
|
-
measure();
|
|
20773
|
-
const ro = new ResizeObserver(measure);
|
|
20774
|
-
ro.observe(c);
|
|
20775
|
-
c.addEventListener("scroll", onScroll, { passive: true });
|
|
20776
|
-
return () => {
|
|
20777
|
-
ro.disconnect();
|
|
20778
|
-
c.removeEventListener("scroll", onScroll);
|
|
20779
|
-
clearTimeout(scrollSettleTimer.current);
|
|
20780
|
-
};
|
|
20781
|
-
}, [onSelect, resolveNearestIndexToViewportCenter, selectedIndex, stopCount, updateMask]);
|
|
20782
|
-
React.useEffect(() => {
|
|
20783
|
-
pendingScrollIndex.current = selectedIndex;
|
|
20784
|
-
}, [selectedIndex]);
|
|
20785
|
-
React.useEffect(() => {
|
|
20786
|
-
const c = scrollRef.current;
|
|
20787
|
-
const el = itemRefs.current[selectedIndex];
|
|
20788
|
-
if (!c || !el || !c.clientWidth) return;
|
|
20789
|
-
if (skipCenterOnPropSync.current) {
|
|
20790
|
-
skipCenterOnPropSync.current = false;
|
|
20791
|
-
updateMask();
|
|
20792
|
-
return;
|
|
20793
|
-
}
|
|
20794
|
-
const max = c.scrollWidth - c.clientWidth;
|
|
20795
|
-
const target = el.offsetLeft - c.clientWidth / 2 + el.clientWidth / 2;
|
|
20796
|
-
programmatic.current = true;
|
|
20797
|
-
c.scrollTo({
|
|
20798
|
-
left: Math.max(0, Math.min(max, target)),
|
|
20799
|
-
behavior: didInit.current ? "smooth" : "auto"
|
|
20800
|
-
});
|
|
20801
|
-
if (pad.left > 0 || pad.right > 0) didInit.current = true;
|
|
20802
|
-
clearTimeout(progTimer.current);
|
|
20803
|
-
progTimer.current = setTimeout(() => {
|
|
20804
|
-
programmatic.current = false;
|
|
20805
|
-
}, 500);
|
|
20806
|
-
updateMask();
|
|
20807
|
-
}, [selectedIndex, stopCount, pad, updateMask]);
|
|
20808
|
-
const select = (index) => {
|
|
20809
|
-
const next = Math.min(stops.length - 1, Math.max(0, index));
|
|
20810
|
-
if (next !== selectedIndex) onSelect(next);
|
|
20811
|
-
};
|
|
20812
|
-
const step = (delta) => select(selectedIndex + delta);
|
|
20813
|
-
if (stopCount === 0) return null;
|
|
20814
|
-
return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
|
|
20815
|
-
"div",
|
|
20816
|
-
{
|
|
20817
|
-
className: cn("flex items-center justify-center gap-3 px-3 py-3 sm:gap-4 sm:px-5", className),
|
|
20818
|
-
"aria-label": ariaLabel,
|
|
20819
|
-
children: [
|
|
20820
|
-
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
20821
|
-
"button",
|
|
20822
|
-
{
|
|
20823
|
-
type: "button",
|
|
20824
|
-
onClick: () => step(-1),
|
|
20825
|
-
disabled: selectedIndex === 0,
|
|
20826
|
-
"aria-label": previousAriaLabel != null ? previousAriaLabel : "Previous line",
|
|
20827
|
-
className: "flex size-5! shrink-0 cursor-pointer items-center justify-center text-agg-muted-foreground transition-colors hover:text-agg-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary disabled:cursor-not-allowed disabled:opacity-30",
|
|
20828
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Icon, { name: "chevron-left", className: "size-4" })
|
|
20829
|
-
}
|
|
20830
|
-
),
|
|
20831
|
-
/* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "relative min-w-0 flex-1", children: [
|
|
20832
|
-
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
20833
|
-
"div",
|
|
20834
|
-
{
|
|
20835
|
-
ref: scrollRef,
|
|
20836
|
-
style: { paddingLeft: pad.left, paddingRight: pad.right },
|
|
20837
|
-
className: "flex items-end gap-1 overflow-x-hidden py-0.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
20838
|
-
children: stops.map((stop, index) => {
|
|
20839
|
-
const active = index === selectedIndex;
|
|
20840
|
-
return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
|
|
20841
|
-
"button",
|
|
20842
|
-
{
|
|
20843
|
-
type: "button",
|
|
20844
|
-
ref: (el) => {
|
|
20845
|
-
itemRefs.current[index] = el;
|
|
20846
|
-
},
|
|
20847
|
-
onClick: () => select(index),
|
|
20848
|
-
disabled: stop.disabled,
|
|
20849
|
-
"aria-pressed": active,
|
|
20850
|
-
className: "flex shrink-0 cursor-pointer flex-col items-center gap-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-40",
|
|
20851
|
-
children: [
|
|
20852
|
-
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
20853
|
-
"span",
|
|
20854
|
-
{
|
|
20855
|
-
className: cn(
|
|
20856
|
-
"flex h-8 min-w-[60px] items-center justify-center rounded-agg-full border px-3 text-agg-sm leading-agg-5 tabular-nums transition-colors",
|
|
20857
|
-
active ? "border-agg-primary bg-agg-secondary font-agg-bold text-agg-foreground" : "border-transparent bg-agg-secondary text-agg-muted-foreground hover:bg-agg-secondary-hover hover:text-agg-foreground"
|
|
20858
|
-
),
|
|
20859
|
-
children: stop.value
|
|
20860
|
-
}
|
|
20861
|
-
),
|
|
20862
|
-
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(VenueRow, { venues: stop.venues, active })
|
|
20863
|
-
]
|
|
20864
|
-
},
|
|
20865
|
-
index
|
|
20866
|
-
);
|
|
20867
|
-
})
|
|
20868
|
-
}
|
|
20869
|
-
),
|
|
20870
|
-
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
20871
|
-
"span",
|
|
20872
|
-
{
|
|
20873
|
-
className: cn(
|
|
20874
|
-
"pointer-events-none absolute inset-y-0 left-0 w-8 bg-gradient-to-r from-agg-secondary to-transparent transition-opacity duration-200",
|
|
20875
|
-
mask.left ? "opacity-100" : "opacity-0"
|
|
20876
|
-
)
|
|
20877
|
-
}
|
|
20878
|
-
),
|
|
20879
|
-
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
20880
|
-
"span",
|
|
20881
|
-
{
|
|
20882
|
-
className: cn(
|
|
20883
|
-
"pointer-events-none absolute inset-y-0 right-0 w-8 bg-gradient-to-l from-agg-secondary to-transparent transition-opacity duration-200",
|
|
20884
|
-
mask.right ? "opacity-100" : "opacity-0"
|
|
20885
|
-
)
|
|
20886
|
-
}
|
|
20887
|
-
)
|
|
20888
|
-
] }),
|
|
20889
|
-
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
20890
|
-
"button",
|
|
20891
|
-
{
|
|
20892
|
-
type: "button",
|
|
20893
|
-
onClick: () => step(1),
|
|
20894
|
-
disabled: selectedIndex === stopCount - 1,
|
|
20895
|
-
"aria-label": nextAriaLabel != null ? nextAriaLabel : "Next line",
|
|
20896
|
-
className: "flex size-5! shrink-0 cursor-pointer items-center justify-center text-agg-muted-foreground transition-colors hover:text-agg-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary disabled:cursor-not-allowed disabled:opacity-30",
|
|
20897
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Icon, { name: "chevron-right", className: "size-4" })
|
|
20898
|
-
}
|
|
20899
|
-
)
|
|
20900
|
-
]
|
|
20901
|
-
}
|
|
20902
|
-
);
|
|
20903
|
-
}
|
|
20904
|
-
|
|
20905
20927
|
// src/pages/event-market/sports-event-market.utils.ts
|
|
20906
20928
|
var SPORTS_MARKET_TYPE_KEYS = [
|
|
20907
20929
|
"moneyline",
|
|
@@ -20958,6 +20980,10 @@ var SPORTS_LEGACY_PROP_CATEGORY_KEY_SET = /* @__PURE__ */ new Set([
|
|
|
20958
20980
|
"assists",
|
|
20959
20981
|
"shots"
|
|
20960
20982
|
]);
|
|
20983
|
+
var SPORTS_CATEGORY_OVERRIDE_TAB_KEY_SET = /* @__PURE__ */ new Set([
|
|
20984
|
+
"exact_score",
|
|
20985
|
+
...SPORTS_LEGACY_PROP_CATEGORY_KEY_SET
|
|
20986
|
+
]);
|
|
20961
20987
|
var SPORTS_MARKET_GROUP_TO_TAB = {
|
|
20962
20988
|
game_lines: "game_lines",
|
|
20963
20989
|
spreads: "game_lines",
|
|
@@ -21045,9 +21071,15 @@ var SPORTS_MARKET_TYPE_ORDER = [
|
|
|
21045
21071
|
];
|
|
21046
21072
|
var YES_NO_LABELS = /* @__PURE__ */ new Set(["yes", "no"]);
|
|
21047
21073
|
var LINE_MARKET_TYPES = /* @__PURE__ */ new Set(["spread", "total"]);
|
|
21074
|
+
var PLAYER_PROP_COUNT_PATTERN = /\+\s|\bo\/u\b|\bover\/under\b/i;
|
|
21075
|
+
var REG_TIME_TITLE_PATTERN = /^reg(?:ular)?\s*time\s*:/i;
|
|
21048
21076
|
var toTrimmedString = (value) => {
|
|
21049
21077
|
return typeof value === "string" ? value.trim() : "";
|
|
21050
21078
|
};
|
|
21079
|
+
var resolveSportsMarketAggKey = (market) => {
|
|
21080
|
+
const typedMarket = market;
|
|
21081
|
+
return toTrimmedString(typedMarket.aggKey);
|
|
21082
|
+
};
|
|
21051
21083
|
var sanitizeFamilyValue = (value) => {
|
|
21052
21084
|
return value.toLowerCase().replace(/[-+]?\d+(?:\.\d+)?/g, "").replace(/[¢$]/g, "").replace(/\s+/g, " ").replace(/[|:()[\]{}]/g, "").trim();
|
|
21053
21085
|
};
|
|
@@ -21107,15 +21139,36 @@ var normalizeSportsMarketGroup = (value) => {
|
|
|
21107
21139
|
if (!resolvedValue) return null;
|
|
21108
21140
|
return SPORTS_MARKET_GROUP_KEY_SET.has(resolvedValue) ? resolvedValue : "other";
|
|
21109
21141
|
};
|
|
21142
|
+
var resolveFallbackSportsMarketCategory = (market) => {
|
|
21143
|
+
const marketSubtype = toTrimmedString(market.marketSubtype).toLowerCase();
|
|
21144
|
+
const question = toTrimmedString(market.question).toLowerCase();
|
|
21145
|
+
if (marketSubtype.includes("exact_score") || marketSubtype.includes("correct_score") || question.includes("exact score") || question.includes("correct score")) {
|
|
21146
|
+
return "exact_score";
|
|
21147
|
+
}
|
|
21148
|
+
if (marketSubtype.includes("corner") || question.includes("corner")) {
|
|
21149
|
+
return "corners";
|
|
21150
|
+
}
|
|
21151
|
+
if (marketSubtype.includes("shot")) return "shots";
|
|
21152
|
+
if (marketSubtype.includes("assist")) return "assists";
|
|
21153
|
+
if (marketSubtype.includes("goal")) return "goals";
|
|
21154
|
+
if (!PLAYER_PROP_COUNT_PATTERN.test(question) || !question.includes(":") || question.includes(" vs ") || question.includes(" vs. ")) {
|
|
21155
|
+
return null;
|
|
21156
|
+
}
|
|
21157
|
+
if (question.includes("shot")) return "shots";
|
|
21158
|
+
if (question.includes("assist")) return "assists";
|
|
21159
|
+
if (question.includes("goal")) return "goals";
|
|
21160
|
+
return null;
|
|
21161
|
+
};
|
|
21110
21162
|
var resolveMarketSectionTabKey = (market) => {
|
|
21111
|
-
const
|
|
21112
|
-
|
|
21163
|
+
const normalizedCategory = normalizeSportsMarketCategory(market.marketCategory);
|
|
21164
|
+
const fallbackCategory = !normalizedCategory || normalizedCategory === "other" ? resolveFallbackSportsMarketCategory(market) : null;
|
|
21165
|
+
const category = fallbackCategory != null ? fallbackCategory : normalizedCategory;
|
|
21166
|
+
if (category && SPORTS_CATEGORY_OVERRIDE_TAB_KEY_SET.has(category)) {
|
|
21113
21167
|
return category;
|
|
21114
21168
|
}
|
|
21115
21169
|
const group = normalizeSportsMarketGroup(market.marketGroup);
|
|
21116
21170
|
if (group) return SPORTS_MARKET_GROUP_TO_TAB[group];
|
|
21117
21171
|
if (category === "game_lines") return "game_lines";
|
|
21118
|
-
if (category === "exact_score") return "exact_score";
|
|
21119
21172
|
if (category === "other") return "other";
|
|
21120
21173
|
return null;
|
|
21121
21174
|
};
|
|
@@ -21139,13 +21192,27 @@ var resolveSportsSectionMarkets = ({
|
|
|
21139
21192
|
sectionMarkets
|
|
21140
21193
|
}) => {
|
|
21141
21194
|
const effectiveSectionMarkets = sectionMarkets.length > 0 ? sectionMarkets : eventMarkets.filter((market) => resolveMarketSectionTabKey(market) === tabKey);
|
|
21142
|
-
|
|
21143
|
-
|
|
21144
|
-
|
|
21145
|
-
);
|
|
21146
|
-
|
|
21147
|
-
|
|
21148
|
-
|
|
21195
|
+
const filteredSectionMarkets = effectiveSectionMarkets.filter(
|
|
21196
|
+
(market) => resolveMarketSectionTabKey(market) === tabKey
|
|
21197
|
+
);
|
|
21198
|
+
if (tabKey !== "game_lines") return filteredSectionMarkets;
|
|
21199
|
+
const eventMoneylineMarkets = (() => {
|
|
21200
|
+
const dedupedMarkets = [];
|
|
21201
|
+
const seenMoneylineKeys = /* @__PURE__ */ new Set();
|
|
21202
|
+
for (const market of eventMarkets) {
|
|
21203
|
+
if (normalizeSportsMarketType(market.sportsMarketType) !== "moneyline" || resolveMarketSectionTabKey(market) !== "game_lines") {
|
|
21204
|
+
continue;
|
|
21205
|
+
}
|
|
21206
|
+
const moneylineKey = resolveSportsMarketAggKey(market) || market.id;
|
|
21207
|
+
if (seenMoneylineKeys.has(moneylineKey)) continue;
|
|
21208
|
+
seenMoneylineKeys.add(moneylineKey);
|
|
21209
|
+
dedupedMarkets.push(market);
|
|
21210
|
+
}
|
|
21211
|
+
return dedupedMarkets;
|
|
21212
|
+
})();
|
|
21213
|
+
if (eventMoneylineMarkets.length === 0) return filteredSectionMarkets;
|
|
21214
|
+
const lineSectionMarkets = filteredSectionMarkets.filter(
|
|
21215
|
+
(market) => normalizeSportsMarketType(market.sportsMarketType) !== "moneyline" && resolveMarketSectionTabKey(market) === "game_lines"
|
|
21149
21216
|
);
|
|
21150
21217
|
return [...eventMoneylineMarkets, ...lineSectionMarkets];
|
|
21151
21218
|
};
|
|
@@ -21173,7 +21240,15 @@ var isBinarySportsMoneylineMarket = (market) => {
|
|
|
21173
21240
|
);
|
|
21174
21241
|
const marketSubtype = toTrimmedString(market.marketSubtype).toLowerCase();
|
|
21175
21242
|
const marketGroup = normalizeSportsMarketGroup(market.marketGroup);
|
|
21176
|
-
|
|
21243
|
+
const sportsMarketType = normalizeSportsMarketType(market.sportsMarketType);
|
|
21244
|
+
const question = toTrimmedString(market.question);
|
|
21245
|
+
const aggKey = resolveSportsMarketAggKey(market);
|
|
21246
|
+
return sportsMarketType === "moneyline" && marketGroup === "game_lines" && normalizeSportsPeriod(market.period) === "full" && normalizedOutcomeLabels.length === 2 && normalizedOutcomeLabels.every((label2) => YES_NO_LABELS.has(label2)) && (marketSubtype === "moneyline" || REG_TIME_TITLE_PATTERN.test(question) || aggKey.includes("_ml_"));
|
|
21247
|
+
};
|
|
21248
|
+
var AGGKEY_LINE_TOKEN_PATTERN = /_\d+p\d+/g;
|
|
21249
|
+
var resolveSportsLineFamilyKey = (market) => {
|
|
21250
|
+
const aggKey = resolveSportsMarketAggKey(market);
|
|
21251
|
+
return aggKey ? aggKey.replace(AGGKEY_LINE_TOKEN_PATTERN, "") : "";
|
|
21177
21252
|
};
|
|
21178
21253
|
var resolveDisplayGroupFamilyKey = (market) => {
|
|
21179
21254
|
var _a, _b, _c;
|
|
@@ -21187,11 +21262,12 @@ var resolveDisplayGroupFamilyKey = (market) => {
|
|
|
21187
21262
|
if (isBinarySportsMoneylineMarket(market)) {
|
|
21188
21263
|
return `${period}|moneyline|${marketCategory}`;
|
|
21189
21264
|
}
|
|
21265
|
+
const lineFamily = resolveSportsLineFamilyKey(market);
|
|
21190
21266
|
if (sportsMarketType === "spread") {
|
|
21191
|
-
return `${period}|spread|${marketCategory}`;
|
|
21267
|
+
return lineFamily ? `${period}|spread|${lineFamily}` : `${period}|spread|${marketCategory}`;
|
|
21192
21268
|
}
|
|
21193
21269
|
if (market.lineValue != null || LINE_MARKET_TYPES.has(sportsMarketType)) {
|
|
21194
|
-
return `${period}|${sportsMarketType}|${marketCategory}|${normalizedQuestion}|${outcomeKey}`;
|
|
21270
|
+
return lineFamily ? `${period}|${sportsMarketType}|${lineFamily}` : `${period}|${sportsMarketType}|${marketCategory}|${normalizedQuestion}|${outcomeKey}`;
|
|
21195
21271
|
}
|
|
21196
21272
|
return `${period}|${sportsMarketType}|${marketCategory}|${toTrimmedString(market.question)}|${outcomeKey}|${market.id}`;
|
|
21197
21273
|
};
|
|
@@ -21398,15 +21474,6 @@ var buildSportsSlideFromGroup = (group) => {
|
|
|
21398
21474
|
defaultStopIndex
|
|
21399
21475
|
};
|
|
21400
21476
|
};
|
|
21401
|
-
var formatSportsPeriodGrammarLabel = (period) => {
|
|
21402
|
-
const grammarMatch = SPORTS_PERIOD_GRAMMAR_PATTERN.exec(period);
|
|
21403
|
-
if (!grammarMatch) return null;
|
|
21404
|
-
if (grammarMatch[1]) {
|
|
21405
|
-
const family = grammarMatch[1].charAt(0).toUpperCase() + grammarMatch[1].slice(1);
|
|
21406
|
-
return `${family} ${Number(grammarMatch[2])}`;
|
|
21407
|
-
}
|
|
21408
|
-
return `First ${Number(grammarMatch[3])} Innings`;
|
|
21409
|
-
};
|
|
21410
21477
|
var resolveSportsCategoryTokens = (event) => {
|
|
21411
21478
|
return new Set(
|
|
21412
21479
|
event.categories.flatMap((entry) => {
|
|
@@ -21458,11 +21525,257 @@ var mergeSportsSectionMarketsIntoEvent = ({
|
|
|
21458
21525
|
seenMarketIds.add(market.id);
|
|
21459
21526
|
orderedVenueMarkets.push(market);
|
|
21460
21527
|
}
|
|
21461
|
-
}
|
|
21462
|
-
return __spreadProps(__spreadValues({}, event), {
|
|
21463
|
-
venueMarkets: orderedVenueMarkets
|
|
21464
|
-
});
|
|
21465
|
-
};
|
|
21528
|
+
}
|
|
21529
|
+
return __spreadProps(__spreadValues({}, event), {
|
|
21530
|
+
venueMarkets: orderedVenueMarkets
|
|
21531
|
+
});
|
|
21532
|
+
};
|
|
21533
|
+
|
|
21534
|
+
// src/pages/event-market/sports-market-card.tsx
|
|
21535
|
+
var import_hooks58 = require("@agg-build/hooks");
|
|
21536
|
+
var import_react36 = require("react");
|
|
21537
|
+
|
|
21538
|
+
// src/pages/event-market/sports-line-rail.tsx
|
|
21539
|
+
var React = __toESM(require("react"));
|
|
21540
|
+
var import_jsx_runtime149 = require("react/jsx-runtime");
|
|
21541
|
+
function VenueRow({ venues, active }) {
|
|
21542
|
+
if (!venues || venues.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("span", { className: "h-4" });
|
|
21543
|
+
const shown = venues.length > 3 ? venues.slice(0, 2) : venues;
|
|
21544
|
+
const extra = venues.length - shown.length;
|
|
21545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
|
|
21546
|
+
"span",
|
|
21547
|
+
{
|
|
21548
|
+
className: cn(
|
|
21549
|
+
"flex h-4 items-center justify-center gap-1",
|
|
21550
|
+
!active && "text-agg-muted-foreground"
|
|
21551
|
+
),
|
|
21552
|
+
children: [
|
|
21553
|
+
shown.map((venue, index) => /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
21554
|
+
VenueLogo,
|
|
21555
|
+
{
|
|
21556
|
+
venue,
|
|
21557
|
+
isMonochromatic: !active,
|
|
21558
|
+
size: "small",
|
|
21559
|
+
className: "size-3! shrink-0"
|
|
21560
|
+
},
|
|
21561
|
+
`${venue}-${index}`
|
|
21562
|
+
)),
|
|
21563
|
+
extra > 0 && /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("span", { className: "text-[10px] font-agg-bold uppercase leading-[14px] text-agg-muted-foreground", children: [
|
|
21564
|
+
"+",
|
|
21565
|
+
extra
|
|
21566
|
+
] })
|
|
21567
|
+
]
|
|
21568
|
+
}
|
|
21569
|
+
);
|
|
21570
|
+
}
|
|
21571
|
+
function SportsLineRail({
|
|
21572
|
+
stops,
|
|
21573
|
+
selectedIndex,
|
|
21574
|
+
onSelect,
|
|
21575
|
+
ariaLabel,
|
|
21576
|
+
previousAriaLabel,
|
|
21577
|
+
nextAriaLabel,
|
|
21578
|
+
className
|
|
21579
|
+
}) {
|
|
21580
|
+
const scrollRef = React.useRef(null);
|
|
21581
|
+
const itemRefs = React.useRef([]);
|
|
21582
|
+
const didInit = React.useRef(false);
|
|
21583
|
+
const programmatic = React.useRef(false);
|
|
21584
|
+
const progTimer = React.useRef(void 0);
|
|
21585
|
+
const skipCenterOnPropSync = React.useRef(false);
|
|
21586
|
+
const pendingScrollIndex = React.useRef(null);
|
|
21587
|
+
const scrollSettleTimer = React.useRef(void 0);
|
|
21588
|
+
const stopCount = stops.length;
|
|
21589
|
+
const [pad, setPad] = React.useState({ left: 0, right: 0 });
|
|
21590
|
+
const [mask, setMask] = React.useState({ left: false, right: false });
|
|
21591
|
+
const updateMask = React.useCallback(() => {
|
|
21592
|
+
const c = scrollRef.current;
|
|
21593
|
+
if (!c || !c.clientWidth) return;
|
|
21594
|
+
setMask({
|
|
21595
|
+
left: c.scrollLeft > 1,
|
|
21596
|
+
right: c.scrollLeft + c.clientWidth < c.scrollWidth - 1
|
|
21597
|
+
});
|
|
21598
|
+
}, []);
|
|
21599
|
+
const resolveNearestIndexToViewportCenter = React.useCallback(() => {
|
|
21600
|
+
const container = scrollRef.current;
|
|
21601
|
+
if (!container || !container.clientWidth) return null;
|
|
21602
|
+
const viewportCenter = container.scrollLeft + container.clientWidth / 2;
|
|
21603
|
+
let nearestIndex = null;
|
|
21604
|
+
let nearestDistance = Number.POSITIVE_INFINITY;
|
|
21605
|
+
itemRefs.current.forEach((item, index) => {
|
|
21606
|
+
if (!item) return;
|
|
21607
|
+
const itemCenter = item.offsetLeft + item.offsetWidth / 2;
|
|
21608
|
+
const distance = Math.abs(itemCenter - viewportCenter);
|
|
21609
|
+
if (distance < nearestDistance) {
|
|
21610
|
+
nearestDistance = distance;
|
|
21611
|
+
nearestIndex = index;
|
|
21612
|
+
}
|
|
21613
|
+
});
|
|
21614
|
+
return nearestIndex;
|
|
21615
|
+
}, []);
|
|
21616
|
+
React.useLayoutEffect(() => {
|
|
21617
|
+
const c = scrollRef.current;
|
|
21618
|
+
if (!c) return;
|
|
21619
|
+
const measure = () => {
|
|
21620
|
+
var _a, _b, _c, _d;
|
|
21621
|
+
const w = c.clientWidth;
|
|
21622
|
+
if (!w) return;
|
|
21623
|
+
const firstW = (_b = (_a = itemRefs.current[0]) == null ? void 0 : _a.offsetWidth) != null ? _b : 0;
|
|
21624
|
+
const lastW = (_d = (_c = itemRefs.current[stopCount - 1]) == null ? void 0 : _c.offsetWidth) != null ? _d : 0;
|
|
21625
|
+
setPad({
|
|
21626
|
+
left: Math.max(0, w / 2 - firstW / 2),
|
|
21627
|
+
right: Math.max(0, w / 2 - lastW / 2)
|
|
21628
|
+
});
|
|
21629
|
+
updateMask();
|
|
21630
|
+
};
|
|
21631
|
+
const onScroll = () => {
|
|
21632
|
+
if (!programmatic.current) {
|
|
21633
|
+
const nearestIndex = resolveNearestIndexToViewportCenter();
|
|
21634
|
+
if (nearestIndex != null && nearestIndex !== selectedIndex) {
|
|
21635
|
+
pendingScrollIndex.current = nearestIndex;
|
|
21636
|
+
clearTimeout(scrollSettleTimer.current);
|
|
21637
|
+
scrollSettleTimer.current = setTimeout(() => {
|
|
21638
|
+
const nextIndex = pendingScrollIndex.current;
|
|
21639
|
+
if (nextIndex == null || nextIndex === selectedIndex) return;
|
|
21640
|
+
skipCenterOnPropSync.current = true;
|
|
21641
|
+
onSelect(nextIndex);
|
|
21642
|
+
}, 120);
|
|
21643
|
+
}
|
|
21644
|
+
}
|
|
21645
|
+
updateMask();
|
|
21646
|
+
};
|
|
21647
|
+
measure();
|
|
21648
|
+
const ro = new ResizeObserver(measure);
|
|
21649
|
+
ro.observe(c);
|
|
21650
|
+
c.addEventListener("scroll", onScroll, { passive: true });
|
|
21651
|
+
return () => {
|
|
21652
|
+
ro.disconnect();
|
|
21653
|
+
c.removeEventListener("scroll", onScroll);
|
|
21654
|
+
clearTimeout(scrollSettleTimer.current);
|
|
21655
|
+
};
|
|
21656
|
+
}, [onSelect, resolveNearestIndexToViewportCenter, selectedIndex, stopCount, updateMask]);
|
|
21657
|
+
React.useEffect(() => {
|
|
21658
|
+
pendingScrollIndex.current = selectedIndex;
|
|
21659
|
+
}, [selectedIndex]);
|
|
21660
|
+
React.useEffect(() => {
|
|
21661
|
+
const c = scrollRef.current;
|
|
21662
|
+
const el = itemRefs.current[selectedIndex];
|
|
21663
|
+
if (!c || !el || !c.clientWidth) return;
|
|
21664
|
+
if (skipCenterOnPropSync.current) {
|
|
21665
|
+
skipCenterOnPropSync.current = false;
|
|
21666
|
+
updateMask();
|
|
21667
|
+
return;
|
|
21668
|
+
}
|
|
21669
|
+
const max = c.scrollWidth - c.clientWidth;
|
|
21670
|
+
const target = el.offsetLeft - c.clientWidth / 2 + el.clientWidth / 2;
|
|
21671
|
+
programmatic.current = true;
|
|
21672
|
+
c.scrollTo({
|
|
21673
|
+
left: Math.max(0, Math.min(max, target)),
|
|
21674
|
+
behavior: didInit.current ? "smooth" : "auto"
|
|
21675
|
+
});
|
|
21676
|
+
if (pad.left > 0 || pad.right > 0) didInit.current = true;
|
|
21677
|
+
clearTimeout(progTimer.current);
|
|
21678
|
+
progTimer.current = setTimeout(() => {
|
|
21679
|
+
programmatic.current = false;
|
|
21680
|
+
}, 500);
|
|
21681
|
+
updateMask();
|
|
21682
|
+
}, [selectedIndex, stopCount, pad, updateMask]);
|
|
21683
|
+
const select = (index) => {
|
|
21684
|
+
const next = Math.min(stops.length - 1, Math.max(0, index));
|
|
21685
|
+
if (next !== selectedIndex) onSelect(next);
|
|
21686
|
+
};
|
|
21687
|
+
const step = (delta) => select(selectedIndex + delta);
|
|
21688
|
+
if (stopCount === 0) return null;
|
|
21689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
|
|
21690
|
+
"div",
|
|
21691
|
+
{
|
|
21692
|
+
className: cn("flex items-center justify-center gap-3 px-3 py-3 sm:gap-4 sm:px-5", className),
|
|
21693
|
+
"aria-label": ariaLabel,
|
|
21694
|
+
children: [
|
|
21695
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
21696
|
+
"button",
|
|
21697
|
+
{
|
|
21698
|
+
type: "button",
|
|
21699
|
+
onClick: () => step(-1),
|
|
21700
|
+
disabled: selectedIndex === 0,
|
|
21701
|
+
"aria-label": previousAriaLabel != null ? previousAriaLabel : "Previous line",
|
|
21702
|
+
className: "flex size-5! shrink-0 cursor-pointer items-center justify-center text-agg-muted-foreground transition-colors hover:text-agg-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary disabled:cursor-not-allowed disabled:opacity-30",
|
|
21703
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Icon, { name: "chevron-left", className: "size-4" })
|
|
21704
|
+
}
|
|
21705
|
+
),
|
|
21706
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "relative min-w-0 flex-1", children: [
|
|
21707
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
21708
|
+
"div",
|
|
21709
|
+
{
|
|
21710
|
+
ref: scrollRef,
|
|
21711
|
+
style: { paddingLeft: pad.left, paddingRight: pad.right },
|
|
21712
|
+
className: "flex items-end gap-1 overflow-x-hidden py-0.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
21713
|
+
children: stops.map((stop, index) => {
|
|
21714
|
+
const active = index === selectedIndex;
|
|
21715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
|
|
21716
|
+
"button",
|
|
21717
|
+
{
|
|
21718
|
+
type: "button",
|
|
21719
|
+
ref: (el) => {
|
|
21720
|
+
itemRefs.current[index] = el;
|
|
21721
|
+
},
|
|
21722
|
+
onClick: () => select(index),
|
|
21723
|
+
disabled: stop.disabled,
|
|
21724
|
+
"aria-pressed": active,
|
|
21725
|
+
className: "flex shrink-0 cursor-pointer flex-col items-center gap-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-40",
|
|
21726
|
+
children: [
|
|
21727
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
21728
|
+
"span",
|
|
21729
|
+
{
|
|
21730
|
+
className: cn(
|
|
21731
|
+
"flex h-8 min-w-[60px] items-center justify-center rounded-agg-full border px-3 text-agg-sm leading-agg-5 tabular-nums transition-colors",
|
|
21732
|
+
active ? "border-agg-primary bg-agg-secondary font-agg-bold text-agg-foreground" : "border-transparent bg-agg-secondary text-agg-muted-foreground hover:bg-agg-secondary-hover hover:text-agg-foreground"
|
|
21733
|
+
),
|
|
21734
|
+
children: stop.value
|
|
21735
|
+
}
|
|
21736
|
+
),
|
|
21737
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(VenueRow, { venues: stop.venues, active })
|
|
21738
|
+
]
|
|
21739
|
+
},
|
|
21740
|
+
index
|
|
21741
|
+
);
|
|
21742
|
+
})
|
|
21743
|
+
}
|
|
21744
|
+
),
|
|
21745
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
21746
|
+
"span",
|
|
21747
|
+
{
|
|
21748
|
+
className: cn(
|
|
21749
|
+
"pointer-events-none absolute inset-y-0 left-0 w-8 bg-gradient-to-r from-agg-secondary to-transparent transition-opacity duration-200",
|
|
21750
|
+
mask.left ? "opacity-100" : "opacity-0"
|
|
21751
|
+
)
|
|
21752
|
+
}
|
|
21753
|
+
),
|
|
21754
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
21755
|
+
"span",
|
|
21756
|
+
{
|
|
21757
|
+
className: cn(
|
|
21758
|
+
"pointer-events-none absolute inset-y-0 right-0 w-8 bg-gradient-to-l from-agg-secondary to-transparent transition-opacity duration-200",
|
|
21759
|
+
mask.right ? "opacity-100" : "opacity-0"
|
|
21760
|
+
)
|
|
21761
|
+
}
|
|
21762
|
+
)
|
|
21763
|
+
] }),
|
|
21764
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
21765
|
+
"button",
|
|
21766
|
+
{
|
|
21767
|
+
type: "button",
|
|
21768
|
+
onClick: () => step(1),
|
|
21769
|
+
disabled: selectedIndex === stopCount - 1,
|
|
21770
|
+
"aria-label": nextAriaLabel != null ? nextAriaLabel : "Next line",
|
|
21771
|
+
className: "flex size-5! shrink-0 cursor-pointer items-center justify-center text-agg-muted-foreground transition-colors hover:text-agg-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary disabled:cursor-not-allowed disabled:opacity-30",
|
|
21772
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Icon, { name: "chevron-right", className: "size-4" })
|
|
21773
|
+
}
|
|
21774
|
+
)
|
|
21775
|
+
]
|
|
21776
|
+
}
|
|
21777
|
+
);
|
|
21778
|
+
}
|
|
21466
21779
|
|
|
21467
21780
|
// src/pages/event-market/sports-market-card.tsx
|
|
21468
21781
|
var import_jsx_runtime150 = require("react/jsx-runtime");
|
|
@@ -21490,6 +21803,19 @@ var SportsMarketCard = ({
|
|
|
21490
21803
|
[group.markets]
|
|
21491
21804
|
);
|
|
21492
21805
|
const isCombinedMoneylineGroup = group.sportsMarketType === "moneyline" && combinedMoneylineMarkets.length > 1 && combinedMoneylineMarkets.length === group.markets.length;
|
|
21806
|
+
const preferredResolvedMoneylineMarket = (0, import_react36.useMemo)(() => {
|
|
21807
|
+
var _a2, _b2;
|
|
21808
|
+
if (!isCombinedMoneylineGroup) return null;
|
|
21809
|
+
const resolvedYesWinnerMarket = (_a2 = combinedMoneylineMarkets.find(
|
|
21810
|
+
(market) => market.venueMarketOutcomes.some(
|
|
21811
|
+
(outcome) => outcome.winner === true && outcome.label.trim().toLowerCase() === "yes"
|
|
21812
|
+
)
|
|
21813
|
+
)) != null ? _a2 : null;
|
|
21814
|
+
if (resolvedYesWinnerMarket) return resolvedYesWinnerMarket;
|
|
21815
|
+
return (_b2 = combinedMoneylineMarkets.find(
|
|
21816
|
+
(market) => market.venueMarketOutcomes.some((outcome) => outcome.winner === true)
|
|
21817
|
+
)) != null ? _b2 : null;
|
|
21818
|
+
}, [combinedMoneylineMarkets, isCombinedMoneylineGroup]);
|
|
21493
21819
|
(0, import_react36.useEffect)(() => {
|
|
21494
21820
|
if (!slide.hasLadder) return;
|
|
21495
21821
|
const tradingMarketId = tradingContext == null ? void 0 : tradingContext.selectedMarketId;
|
|
@@ -21497,7 +21823,7 @@ var SportsMarketCard = ({
|
|
|
21497
21823
|
const matchedIndex = slide.stops.findIndex((stop) => stop.market.id === tradingMarketId);
|
|
21498
21824
|
if (matchedIndex >= 0) setSelectedLineIndex(matchedIndex);
|
|
21499
21825
|
}, [slide.hasLadder, slide.stops, tradingContext == null ? void 0 : tradingContext.selectedMarketId]);
|
|
21500
|
-
const activeMoneylineMarket = isCombinedMoneylineGroup
|
|
21826
|
+
const activeMoneylineMarket = isCombinedMoneylineGroup ? preferredResolvedMoneylineMarket != null ? preferredResolvedMoneylineMarket : (tradingContext == null ? void 0 : tradingContext.selectedMarketId) ? (_a = group.markets.find((market) => market.id === tradingContext.selectedMarketId)) != null ? _a : null : null : null;
|
|
21501
21827
|
const activeMarket = slide.hasLadder ? (_d = (_c = (_b = slide.stops[selectedLineIndex]) == null ? void 0 : _b.market) != null ? _c : group.markets[0]) != null ? _d : null : (_e = activeMoneylineMarket != null ? activeMoneylineMarket : group.markets[0]) != null ? _e : null;
|
|
21502
21828
|
const activeDefaultOutcome = isCombinedMoneylineGroup && activeMarket ? (_f = activeMarket.venueMarketOutcomes.find(
|
|
21503
21829
|
(outcome) => outcome.label.trim().toLowerCase() === "yes"
|
|
@@ -21649,39 +21975,6 @@ var resolveSportsSectionLabel = (labels, key) => {
|
|
|
21649
21975
|
return labels.eventMarketPage.sports.otherTab;
|
|
21650
21976
|
}
|
|
21651
21977
|
};
|
|
21652
|
-
var resolveSportsPeriodLabel = (labels, period) => {
|
|
21653
|
-
var _a;
|
|
21654
|
-
switch (period) {
|
|
21655
|
-
case "full":
|
|
21656
|
-
return labels.eventMarketPage.sports.fullPeriod;
|
|
21657
|
-
case "1h":
|
|
21658
|
-
return labels.eventMarketPage.sports.firstHalfPeriod;
|
|
21659
|
-
case "2h":
|
|
21660
|
-
return labels.eventMarketPage.sports.secondHalfPeriod;
|
|
21661
|
-
case "q1":
|
|
21662
|
-
return labels.eventMarketPage.sports.quarterOnePeriod;
|
|
21663
|
-
case "q2":
|
|
21664
|
-
return labels.eventMarketPage.sports.quarterTwoPeriod;
|
|
21665
|
-
case "q3":
|
|
21666
|
-
return labels.eventMarketPage.sports.quarterThreePeriod;
|
|
21667
|
-
case "q4":
|
|
21668
|
-
return labels.eventMarketPage.sports.quarterFourPeriod;
|
|
21669
|
-
case "ot":
|
|
21670
|
-
return labels.eventMarketPage.sports.overtimePeriod;
|
|
21671
|
-
case "first_inning":
|
|
21672
|
-
return "1st Inning";
|
|
21673
|
-
case "second_inning":
|
|
21674
|
-
return "2nd Inning";
|
|
21675
|
-
case "third_inning":
|
|
21676
|
-
return "3rd Inning";
|
|
21677
|
-
case "first_5_innings":
|
|
21678
|
-
return "1st 5 Innings";
|
|
21679
|
-
case "other":
|
|
21680
|
-
return labels.eventMarketPage.sports.otherPeriod;
|
|
21681
|
-
default:
|
|
21682
|
-
return (_a = formatSportsPeriodGrammarLabel(period)) != null ? _a : labels.eventMarketPage.sports.otherPeriod;
|
|
21683
|
-
}
|
|
21684
|
-
};
|
|
21685
21978
|
var SportsTabButton = ({
|
|
21686
21979
|
isActive,
|
|
21687
21980
|
label: label2,
|
|
@@ -21785,7 +22078,10 @@ var SportsMarkets = ({
|
|
|
21785
22078
|
period: sectionFilters.period,
|
|
21786
22079
|
marketCategory: sectionFilters.marketCategory,
|
|
21787
22080
|
marketGroup: sectionFilters.marketGroup,
|
|
21788
|
-
|
|
22081
|
+
// The per-tab section fetch paginates; a large page (schema max) collapses a
|
|
22082
|
+
// heavy tab (e.g. "Other" spans other/team_props/player_props/specials/
|
|
22083
|
+
// completion — hundreds of markets on prop-rich events) from ~15 calls to 1-3.
|
|
22084
|
+
limit: 100,
|
|
21789
22085
|
status: import_hooks59.MarketStatus.open,
|
|
21790
22086
|
enabled: hasAggKey
|
|
21791
22087
|
});
|
|
@@ -21893,7 +22189,7 @@ var SportsMarkets = ({
|
|
|
21893
22189
|
);
|
|
21894
22190
|
}
|
|
21895
22191
|
const shouldShowLoadingState = stableSectionMarkets == null && !isSectionSettled;
|
|
21896
|
-
return /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex flex-col gap-
|
|
22192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex flex-col gap-3", "data-testid": "sports-markets", children: [
|
|
21897
22193
|
shouldRenderTabs ? /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
|
|
21898
22194
|
"div",
|
|
21899
22195
|
{
|
|
@@ -21922,28 +22218,24 @@ var SportsMarkets = ({
|
|
|
21922
22218
|
}
|
|
21923
22219
|
) : null,
|
|
21924
22220
|
displayedPeriodGroups.map((periodGroup) => {
|
|
21925
|
-
|
|
21926
|
-
return /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(
|
|
22221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
|
|
21927
22222
|
"section",
|
|
21928
22223
|
{
|
|
21929
22224
|
className: "flex flex-col gap-3",
|
|
21930
22225
|
"data-period-key": periodGroup.key,
|
|
21931
|
-
children:
|
|
21932
|
-
|
|
21933
|
-
|
|
21934
|
-
|
|
21935
|
-
|
|
21936
|
-
|
|
21937
|
-
|
|
21938
|
-
|
|
21939
|
-
|
|
21940
|
-
|
|
21941
|
-
|
|
21942
|
-
|
|
21943
|
-
|
|
21944
|
-
group.id
|
|
21945
|
-
))
|
|
21946
|
-
]
|
|
22226
|
+
children: periodGroup.groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
|
|
22227
|
+
SportsMarketCard,
|
|
22228
|
+
{
|
|
22229
|
+
group,
|
|
22230
|
+
venueMarkets: displayedSectionMarkets,
|
|
22231
|
+
isExpanded: expandedGroupId === group.id,
|
|
22232
|
+
onToggle: handleToggleGroup,
|
|
22233
|
+
onOutcomeSelect: (_groupId, _selection) => handleGroupOutcomeSelect(group.id),
|
|
22234
|
+
live,
|
|
22235
|
+
midpointsResult
|
|
22236
|
+
},
|
|
22237
|
+
group.id
|
|
22238
|
+
))
|
|
21947
22239
|
},
|
|
21948
22240
|
`${activeTabKey}-${periodGroup.key}`
|
|
21949
22241
|
);
|
|
@@ -22190,7 +22482,11 @@ var EventMarketPageContent = ({
|
|
|
22190
22482
|
const [isMobileTradeOpen, setIsMobileTradeOpen] = (0, import_react39.useState)(false);
|
|
22191
22483
|
const isMobileViewport = useIsMobileEventMarketViewport();
|
|
22192
22484
|
const tradingContext = (0, import_hooks61.useEventTradingContext)();
|
|
22193
|
-
const
|
|
22485
|
+
const eventDetailVenueMarkets = (0, import_react39.useMemo)(
|
|
22486
|
+
() => normalizeVenueMarketCluster(event.venueMarkets),
|
|
22487
|
+
[event.venueMarkets]
|
|
22488
|
+
);
|
|
22489
|
+
const midpointsResult = (0, import_hooks61.useMidpoints)(eventDetailVenueMarkets);
|
|
22194
22490
|
const internalResolvedClaim = useResolvedMarketClaim({
|
|
22195
22491
|
market: eventTradingState.primaryMarket,
|
|
22196
22492
|
enabled: eventTradingState.kind === "resolved",
|
|
@@ -22509,6 +22805,17 @@ var MIN_SEARCH_LENGTH2 = 3;
|
|
|
22509
22805
|
var SEARCH_DEBOUNCE_MS2 = 300;
|
|
22510
22806
|
var SEARCH_RESULTS_LIMIT = 20;
|
|
22511
22807
|
var MOBILE_HOME_SEARCH_MEDIA_QUERY = "(max-width: 767px)";
|
|
22808
|
+
var collectVisibleVenueMarketIds = (venueMarkets) => {
|
|
22809
|
+
var _a;
|
|
22810
|
+
const ids = [];
|
|
22811
|
+
for (const market of venueMarkets) {
|
|
22812
|
+
ids.push(market.id);
|
|
22813
|
+
for (const sibling of (_a = market.matchedVenueMarkets) != null ? _a : []) {
|
|
22814
|
+
ids.push(sibling.id);
|
|
22815
|
+
}
|
|
22816
|
+
}
|
|
22817
|
+
return [...new Set(ids)];
|
|
22818
|
+
};
|
|
22512
22819
|
var HomeSearchResults = ({
|
|
22513
22820
|
activeTabValue,
|
|
22514
22821
|
query,
|
|
@@ -22563,6 +22870,19 @@ var HomeSearchResults = ({
|
|
|
22563
22870
|
}
|
|
22564
22871
|
return filtered;
|
|
22565
22872
|
}, [searchResults, activeVenues]);
|
|
22873
|
+
const visibleVenueMarkets = (0, import_react42.useMemo)(() => {
|
|
22874
|
+
return openEvents.flatMap((event) => {
|
|
22875
|
+
var _a;
|
|
22876
|
+
return (_a = event.venueMarkets) != null ? _a : [];
|
|
22877
|
+
});
|
|
22878
|
+
}, [openEvents]);
|
|
22879
|
+
const visibleMidpointVenueMarketIds = (0, import_react42.useMemo)(() => {
|
|
22880
|
+
return collectVisibleVenueMarketIds(visibleVenueMarkets);
|
|
22881
|
+
}, [visibleVenueMarkets]);
|
|
22882
|
+
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0, import_hooks62.useVenueMarketMidpoints)({
|
|
22883
|
+
venueMarketIds: visibleMidpointVenueMarketIds,
|
|
22884
|
+
enabled: visibleMidpointVenueMarketIds.length > 0
|
|
22885
|
+
});
|
|
22566
22886
|
const loadMoreRef = (0, import_react42.useRef)(null);
|
|
22567
22887
|
(0, import_react42.useEffect)(() => {
|
|
22568
22888
|
if (!hasNextPage) return;
|
|
@@ -22653,6 +22973,8 @@ var HomeSearchResults = ({
|
|
|
22653
22973
|
EventListItem,
|
|
22654
22974
|
{
|
|
22655
22975
|
event,
|
|
22976
|
+
midpointRows: sharedMidpointRows,
|
|
22977
|
+
midpointsLoading: isSharedMidpointsLoading,
|
|
22656
22978
|
classNames: {
|
|
22657
22979
|
root: "agg-event-list-item w-full min-w-0! max-w-none justify-between!"
|
|
22658
22980
|
},
|
|
@@ -22997,8 +23319,8 @@ var HomePage = ({
|
|
|
22997
23319
|
HomePage.displayName = "HomePage";
|
|
22998
23320
|
|
|
22999
23321
|
// src/pages/user-profile/index.tsx
|
|
23000
|
-
var
|
|
23001
|
-
var
|
|
23322
|
+
var import_hooks68 = require("@agg-build/hooks");
|
|
23323
|
+
var import_sdk20 = require("@agg-build/sdk");
|
|
23002
23324
|
var import_react44 = require("react");
|
|
23003
23325
|
|
|
23004
23326
|
// src/pages/user-profile/chain-display.ts
|
|
@@ -23235,8 +23557,136 @@ var AvailableBalanceCard = ({
|
|
|
23235
23557
|
};
|
|
23236
23558
|
AvailableBalanceCard.displayName = "AvailableBalanceCard";
|
|
23237
23559
|
|
|
23560
|
+
// src/pages/user-profile/components/claim-activity-breakdown-modal.tsx
|
|
23561
|
+
var import_hooks64 = require("@agg-build/hooks");
|
|
23562
|
+
var import_sdk19 = require("@agg-build/sdk");
|
|
23563
|
+
var import_jsx_runtime156 = require("react/jsx-runtime");
|
|
23564
|
+
var CLAIM_VENUE_LABELS = {
|
|
23565
|
+
[import_sdk19.Venue.kalshi]: "Kalshi",
|
|
23566
|
+
[import_sdk19.Venue.polymarket]: "Polymarket",
|
|
23567
|
+
[import_sdk19.Venue.limitless]: "Limitless",
|
|
23568
|
+
[import_sdk19.Venue.opinion]: "Opinion",
|
|
23569
|
+
[import_sdk19.Venue.predict]: "Predict",
|
|
23570
|
+
[import_sdk19.Venue.probable]: "Probable",
|
|
23571
|
+
[import_sdk19.Venue.myriad]: "Myriad",
|
|
23572
|
+
[import_sdk19.Venue.hyperliquid]: "Hyperliquid"
|
|
23573
|
+
};
|
|
23574
|
+
var ClaimActivityBreakdownModal = ({
|
|
23575
|
+
activity,
|
|
23576
|
+
onOpenChange,
|
|
23577
|
+
onTransactionSelect
|
|
23578
|
+
}) => {
|
|
23579
|
+
var _a;
|
|
23580
|
+
const labels = (0, import_hooks64.useLabels)();
|
|
23581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23582
|
+
Modal,
|
|
23583
|
+
{
|
|
23584
|
+
open: activity !== null,
|
|
23585
|
+
onOpenChange,
|
|
23586
|
+
"aria-label": labels.userProfile.activity.claimBreakdownModalAriaLabel,
|
|
23587
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
|
|
23588
|
+
Modal.Container,
|
|
23589
|
+
{
|
|
23590
|
+
maxWidth: "600px",
|
|
23591
|
+
"aria-label": labels.userProfile.activity.claimBreakdownModalAriaLabel,
|
|
23592
|
+
children: [
|
|
23593
|
+
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23594
|
+
Modal.Header,
|
|
23595
|
+
{
|
|
23596
|
+
title: (_a = activity == null ? void 0 : activity.title) != null ? _a : "",
|
|
23597
|
+
classNames: {
|
|
23598
|
+
root: "border-b-0!",
|
|
23599
|
+
container: "px-4 py-4 sm:px-8 sm:pt-7 sm:pb-3",
|
|
23600
|
+
title: "text-2xl leading-8"
|
|
23601
|
+
}
|
|
23602
|
+
}
|
|
23603
|
+
),
|
|
23604
|
+
activity ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(Modal.Body, { classNames: { root: "px-4 pt-0 pb-4 sm:px-8 sm:pt-0 sm:pb-7" }, children: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex flex-col gap-6", children: [
|
|
23605
|
+
/* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
23606
|
+
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)("span", { className: "inline-flex items-center justify-center rounded-full bg-agg-secondary-hover px-4 py-1.5 text-agg-sm leading-5 text-agg-foreground", children: activity.outcomeLabel }),
|
|
23607
|
+
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "min-w-0 flex-1 text-agg-sm leading-5 text-agg-foreground", children: activity.marketTitle })
|
|
23608
|
+
] }),
|
|
23609
|
+
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "flex flex-col", children: activity.transactions.map((transaction, index) => {
|
|
23610
|
+
var _a2;
|
|
23611
|
+
const isInteractive = Boolean(transaction.txHash && transaction.chainId);
|
|
23612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { children: [
|
|
23613
|
+
/* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
|
|
23614
|
+
"button",
|
|
23615
|
+
{
|
|
23616
|
+
type: "button",
|
|
23617
|
+
className: [
|
|
23618
|
+
"flex w-full items-center justify-between gap-6 rounded-agg-lg px-3 py-2 text-left transition-colors",
|
|
23619
|
+
"bg-transparent hover:bg-agg-secondary-hover",
|
|
23620
|
+
isInteractive ? "cursor-pointer" : "cursor-default"
|
|
23621
|
+
].join(" "),
|
|
23622
|
+
"aria-label": labels.userProfile.activity.claimBreakdownTransactionLinkAria(
|
|
23623
|
+
transaction.venue
|
|
23624
|
+
),
|
|
23625
|
+
disabled: !isInteractive,
|
|
23626
|
+
onClick: () => {
|
|
23627
|
+
if (!isInteractive) return;
|
|
23628
|
+
onTransactionSelect(transaction);
|
|
23629
|
+
},
|
|
23630
|
+
children: [
|
|
23631
|
+
/* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "min-w-0 flex flex-1 flex-col gap-2", children: [
|
|
23632
|
+
/* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
23633
|
+
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23634
|
+
VenueLogo,
|
|
23635
|
+
{
|
|
23636
|
+
venue: transaction.venue,
|
|
23637
|
+
size: "small",
|
|
23638
|
+
className: "shrink-0"
|
|
23639
|
+
}
|
|
23640
|
+
),
|
|
23641
|
+
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "text-agg-sm leading-5 text-agg-foreground", children: (_a2 = CLAIM_VENUE_LABELS[transaction.venue]) != null ? _a2 : transaction.venue })
|
|
23642
|
+
] }),
|
|
23643
|
+
transaction.hasError && transaction.errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23644
|
+
Tooltip,
|
|
23645
|
+
{
|
|
23646
|
+
size: "medium",
|
|
23647
|
+
content: transaction.errorMessage,
|
|
23648
|
+
sideOffset: 4,
|
|
23649
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-2 text-agg-error!", children: [
|
|
23650
|
+
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23651
|
+
Icon,
|
|
23652
|
+
{
|
|
23653
|
+
name: "circle-xmark",
|
|
23654
|
+
size: "small",
|
|
23655
|
+
className: "size-3! text-agg-error!"
|
|
23656
|
+
}
|
|
23657
|
+
),
|
|
23658
|
+
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "truncate text-agg-sm leading-5 text-agg-error!", children: transaction.errorMessage })
|
|
23659
|
+
] })
|
|
23660
|
+
}
|
|
23661
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "text-agg-sm leading-5 text-agg-muted-foreground", children: transaction.transactionLabel })
|
|
23662
|
+
] }),
|
|
23663
|
+
/* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex shrink-0 items-center gap-3", children: [
|
|
23664
|
+
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "text-agg-sm font-agg-bold leading-5 text-agg-foreground", children: transaction.amountLabel }),
|
|
23665
|
+
isInteractive ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23666
|
+
Icon,
|
|
23667
|
+
{
|
|
23668
|
+
name: "external-link",
|
|
23669
|
+
size: "small",
|
|
23670
|
+
className: "text-agg-muted-foreground"
|
|
23671
|
+
}
|
|
23672
|
+
) : null
|
|
23673
|
+
] })
|
|
23674
|
+
]
|
|
23675
|
+
}
|
|
23676
|
+
),
|
|
23677
|
+
index < activity.transactions.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "my-1 h-px w-full bg-agg-separator", "aria-hidden": true }) : null
|
|
23678
|
+
] }, transaction.id);
|
|
23679
|
+
}) })
|
|
23680
|
+
] }) }) : null
|
|
23681
|
+
]
|
|
23682
|
+
}
|
|
23683
|
+
)
|
|
23684
|
+
}
|
|
23685
|
+
);
|
|
23686
|
+
};
|
|
23687
|
+
|
|
23238
23688
|
// src/pages/user-profile/components/positions-activity.tsx
|
|
23239
|
-
var
|
|
23689
|
+
var import_hooks66 = require("@agg-build/hooks");
|
|
23240
23690
|
var import_react43 = require("react");
|
|
23241
23691
|
|
|
23242
23692
|
// src/pages/user-profile/user-profile.constants.ts
|
|
@@ -23433,16 +23883,8 @@ var toPositionRowViewModel = (position, labels = defaultLabels2) => {
|
|
|
23433
23883
|
};
|
|
23434
23884
|
};
|
|
23435
23885
|
|
|
23436
|
-
// src/primitives/conditional-wrapper.tsx
|
|
23437
|
-
var ConditionalWrapper = ({
|
|
23438
|
-
condition,
|
|
23439
|
-
wrapper,
|
|
23440
|
-
children
|
|
23441
|
-
}) => condition ? wrapper(children) : children;
|
|
23442
|
-
ConditionalWrapper.displayName = "ConditionalWrapper";
|
|
23443
|
-
|
|
23444
23886
|
// src/pages/user-profile/components/activity-row.tsx
|
|
23445
|
-
var
|
|
23887
|
+
var import_jsx_runtime157 = require("react/jsx-runtime");
|
|
23446
23888
|
var shouldOpenInNewTab = (activity) => {
|
|
23447
23889
|
return activity.kind === "redeem" || activity.kind === "deposit" || activity.kind === "withdrawal";
|
|
23448
23890
|
};
|
|
@@ -23459,7 +23901,7 @@ var RowWrapper = ({
|
|
|
23459
23901
|
}) => {
|
|
23460
23902
|
if (href) {
|
|
23461
23903
|
const opensInNewTab = target === "_blank";
|
|
23462
|
-
return /* @__PURE__ */ (0,
|
|
23904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
23463
23905
|
"a",
|
|
23464
23906
|
{
|
|
23465
23907
|
href,
|
|
@@ -23475,7 +23917,7 @@ var RowWrapper = ({
|
|
|
23475
23917
|
}
|
|
23476
23918
|
);
|
|
23477
23919
|
}
|
|
23478
|
-
return /* @__PURE__ */ (0,
|
|
23920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("button", { type: "button", className, onClick, children });
|
|
23479
23921
|
};
|
|
23480
23922
|
var TRANSFER_ICON = {
|
|
23481
23923
|
withdrawal: "upload",
|
|
@@ -23510,7 +23952,7 @@ var AmountTimeStack = ({
|
|
|
23510
23952
|
timeLabel,
|
|
23511
23953
|
tone,
|
|
23512
23954
|
mobile
|
|
23513
|
-
}) => /* @__PURE__ */ (0,
|
|
23955
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(
|
|
23514
23956
|
"div",
|
|
23515
23957
|
{
|
|
23516
23958
|
className: cn(
|
|
@@ -23518,7 +23960,7 @@ var AmountTimeStack = ({
|
|
|
23518
23960
|
mobile ? "sm:hidden" : "hidden sm:flex sm:w-[120px] sm:shrink-0"
|
|
23519
23961
|
),
|
|
23520
23962
|
children: [
|
|
23521
|
-
/* @__PURE__ */ (0,
|
|
23963
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
23522
23964
|
"p",
|
|
23523
23965
|
{
|
|
23524
23966
|
className: cn(
|
|
@@ -23529,7 +23971,7 @@ var AmountTimeStack = ({
|
|
|
23529
23971
|
children: amountLabel
|
|
23530
23972
|
}
|
|
23531
23973
|
),
|
|
23532
|
-
/* @__PURE__ */ (0,
|
|
23974
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
23533
23975
|
"p",
|
|
23534
23976
|
{
|
|
23535
23977
|
className: cn(
|
|
@@ -23546,9 +23988,9 @@ var AmountTimeStack = ({
|
|
|
23546
23988
|
var TradeTypeCell = ({
|
|
23547
23989
|
activity,
|
|
23548
23990
|
tone
|
|
23549
|
-
}) => /* @__PURE__ */ (0,
|
|
23550
|
-
/* @__PURE__ */ (0,
|
|
23551
|
-
/* @__PURE__ */ (0,
|
|
23991
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
|
|
23992
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(VenueLogo, { venue: activity.venue, size: "small", className: "shrink-0" }),
|
|
23993
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
23552
23994
|
"p",
|
|
23553
23995
|
{
|
|
23554
23996
|
className: cn(
|
|
@@ -23563,8 +24005,8 @@ var TradeTypeCell = ({
|
|
|
23563
24005
|
var TransferTypeCell = ({
|
|
23564
24006
|
activity,
|
|
23565
24007
|
tone
|
|
23566
|
-
}) => /* @__PURE__ */ (0,
|
|
23567
|
-
/* @__PURE__ */ (0,
|
|
24008
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
|
|
24009
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
23568
24010
|
Icon,
|
|
23569
24011
|
{
|
|
23570
24012
|
name: TRANSFER_ICON[activity.kind],
|
|
@@ -23575,7 +24017,7 @@ var TransferTypeCell = ({
|
|
|
23575
24017
|
)
|
|
23576
24018
|
}
|
|
23577
24019
|
),
|
|
23578
|
-
/* @__PURE__ */ (0,
|
|
24020
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
23579
24021
|
"p",
|
|
23580
24022
|
{
|
|
23581
24023
|
className: cn(
|
|
@@ -23590,8 +24032,8 @@ var TransferTypeCell = ({
|
|
|
23590
24032
|
var RedeemTypeCell = ({
|
|
23591
24033
|
activity,
|
|
23592
24034
|
tone
|
|
23593
|
-
}) => /* @__PURE__ */ (0,
|
|
23594
|
-
/* @__PURE__ */ (0,
|
|
24035
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
|
|
24036
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
23595
24037
|
Icon,
|
|
23596
24038
|
{
|
|
23597
24039
|
name: "gift-bonus",
|
|
@@ -23602,7 +24044,7 @@ var RedeemTypeCell = ({
|
|
|
23602
24044
|
)
|
|
23603
24045
|
}
|
|
23604
24046
|
),
|
|
23605
|
-
/* @__PURE__ */ (0,
|
|
24047
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
23606
24048
|
"p",
|
|
23607
24049
|
{
|
|
23608
24050
|
className: cn(
|
|
@@ -23619,7 +24061,7 @@ var OutcomeBadge = ({
|
|
|
23619
24061
|
tone
|
|
23620
24062
|
}) => {
|
|
23621
24063
|
if (!label2) return null;
|
|
23622
|
-
return /* @__PURE__ */ (0,
|
|
24064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("span", { className: "agg-activity-outcome inline-flex items-center justify-center gap-1.5 rounded-full bg-agg-secondary-hover px-4 py-[6px]", children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
23623
24065
|
"span",
|
|
23624
24066
|
{
|
|
23625
24067
|
className: cn(
|
|
@@ -23633,9 +24075,9 @@ var OutcomeBadge = ({
|
|
|
23633
24075
|
var TradeOutcomeShares = ({
|
|
23634
24076
|
activity,
|
|
23635
24077
|
tone
|
|
23636
|
-
}) => /* @__PURE__ */ (0,
|
|
23637
|
-
/* @__PURE__ */ (0,
|
|
23638
|
-
/* @__PURE__ */ (0,
|
|
24078
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(import_jsx_runtime157.Fragment, { children: [
|
|
24079
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(OutcomeBadge, { label: activity.outcomeLabel, tone }),
|
|
24080
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
23639
24081
|
"span",
|
|
23640
24082
|
{
|
|
23641
24083
|
className: cn(
|
|
@@ -23655,8 +24097,8 @@ var RedeemRow = ({
|
|
|
23655
24097
|
const tone = resolveToneClasses(activity);
|
|
23656
24098
|
const statusVisual = getStatusVisual(activity);
|
|
23657
24099
|
const activityStatus = resolveActivityStatus(activity);
|
|
23658
|
-
const shouldShowInlineStatus = activityStatus
|
|
23659
|
-
return /* @__PURE__ */ (0,
|
|
24100
|
+
const shouldShowInlineStatus = activityStatus === "pending";
|
|
24101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
23660
24102
|
RowWrapper,
|
|
23661
24103
|
{
|
|
23662
24104
|
className,
|
|
@@ -23664,173 +24106,30 @@ var RedeemRow = ({
|
|
|
23664
24106
|
target: href ? "_blank" : void 0,
|
|
23665
24107
|
rel: href ? "noopener noreferrer" : void 0,
|
|
23666
24108
|
onClick,
|
|
23667
|
-
children: /* @__PURE__ */ (0,
|
|
23668
|
-
ConditionalWrapper,
|
|
23669
|
-
{
|
|
23670
|
-
condition: !!activity.errorMessage,
|
|
23671
|
-
wrapper: (children) => /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23672
|
-
Tooltip,
|
|
23673
|
-
{
|
|
23674
|
-
size: "medium",
|
|
23675
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
23676
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
|
|
23677
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
|
|
23678
|
-
] }),
|
|
23679
|
-
sideOffset: 4,
|
|
23680
|
-
children
|
|
23681
|
-
}
|
|
23682
|
-
),
|
|
23683
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
|
|
23684
|
-
"div",
|
|
23685
|
-
{
|
|
23686
|
-
className: cn(
|
|
23687
|
-
"flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
|
|
23688
|
-
"relative z-10"
|
|
23689
|
-
),
|
|
23690
|
-
"data-status": activityStatus,
|
|
23691
|
-
children: [
|
|
23692
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(RedeemTypeCell, { activity, tone }),
|
|
23693
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex w-full items-center justify-between sm:hidden", children: [
|
|
23694
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
23695
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23696
|
-
Icon,
|
|
23697
|
-
{
|
|
23698
|
-
name: "gift-bonus",
|
|
23699
|
-
size: "small",
|
|
23700
|
-
className: cn(
|
|
23701
|
-
"shrink-0 text-agg-foreground",
|
|
23702
|
-
activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
|
|
23703
|
-
)
|
|
23704
|
-
}
|
|
23705
|
-
),
|
|
23706
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23707
|
-
"p",
|
|
23708
|
-
{
|
|
23709
|
-
className: cn(
|
|
23710
|
-
"agg-activity-type font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
|
|
23711
|
-
tone.primary,
|
|
23712
|
-
activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
|
|
23713
|
-
),
|
|
23714
|
-
children: activity.type
|
|
23715
|
-
}
|
|
23716
|
-
)
|
|
23717
|
-
] }),
|
|
23718
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(OutcomeBadge, { label: activity.outcomeLabel, tone })
|
|
23719
|
-
] }),
|
|
23720
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex w-full items-center justify-between sm:contents", children: [
|
|
23721
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
|
|
23722
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "agg-activity-image flex h-10 w-10 shrink-0 items-center justify-center sm:h-15 sm:w-15", children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23723
|
-
RemoteImage,
|
|
23724
|
-
{
|
|
23725
|
-
src: activity.thumbnailSrc,
|
|
23726
|
-
alt: "",
|
|
23727
|
-
className: "h-full w-full rounded-agg-sm object-cover sm:rounded-agg-lg",
|
|
23728
|
-
classNames: { placeholder: "rounded-agg-sm sm:rounded-agg-lg" }
|
|
23729
|
-
}
|
|
23730
|
-
) }),
|
|
23731
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1 sm:gap-2", children: [
|
|
23732
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
23733
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23734
|
-
"p",
|
|
23735
|
-
{
|
|
23736
|
-
className: cn(
|
|
23737
|
-
"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-bold sm:text-agg-base sm:leading-agg-6",
|
|
23738
|
-
tone.primary
|
|
23739
|
-
),
|
|
23740
|
-
children: activity.title
|
|
23741
|
-
}
|
|
23742
|
-
),
|
|
23743
|
-
shouldShowInlineStatus ? statusVisual.spin ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23744
|
-
LoadingIcon,
|
|
23745
|
-
{
|
|
23746
|
-
size: "small",
|
|
23747
|
-
className: cn("shrink-0", statusVisual.iconClassName)
|
|
23748
|
-
}
|
|
23749
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23750
|
-
Icon,
|
|
23751
|
-
{
|
|
23752
|
-
name: statusVisual.icon,
|
|
23753
|
-
size: "small",
|
|
23754
|
-
className: cn("shrink-0", statusVisual.iconClassName)
|
|
23755
|
-
}
|
|
23756
|
-
) : null
|
|
23757
|
-
] }),
|
|
23758
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 items-center gap-2 sm:gap-3", children: [
|
|
23759
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "hidden sm:block", children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(OutcomeBadge, { label: activity.outcomeLabel, tone }) }),
|
|
23760
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23761
|
-
"p",
|
|
23762
|
-
{
|
|
23763
|
-
className: cn(
|
|
23764
|
-
"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
|
|
23765
|
-
tone.meta
|
|
23766
|
-
),
|
|
23767
|
-
children: activity.marketTitle
|
|
23768
|
-
}
|
|
23769
|
-
)
|
|
23770
|
-
] })
|
|
23771
|
-
] })
|
|
23772
|
-
] }),
|
|
23773
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23774
|
-
AmountTimeStack,
|
|
23775
|
-
{
|
|
23776
|
-
amountLabel: activity.amountLabel,
|
|
23777
|
-
timeLabel: activity.timeLabel,
|
|
23778
|
-
tone,
|
|
23779
|
-
mobile: true
|
|
23780
|
-
}
|
|
23781
|
-
)
|
|
23782
|
-
] }),
|
|
23783
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23784
|
-
AmountTimeStack,
|
|
23785
|
-
{
|
|
23786
|
-
amountLabel: activity.amountLabel,
|
|
23787
|
-
timeLabel: activity.timeLabel,
|
|
23788
|
-
tone
|
|
23789
|
-
}
|
|
23790
|
-
)
|
|
23791
|
-
]
|
|
23792
|
-
}
|
|
23793
|
-
)
|
|
23794
|
-
}
|
|
23795
|
-
)
|
|
23796
|
-
}
|
|
23797
|
-
);
|
|
23798
|
-
};
|
|
23799
|
-
var TradeRow = ({
|
|
23800
|
-
activity,
|
|
23801
|
-
className,
|
|
23802
|
-
href,
|
|
23803
|
-
onClick
|
|
23804
|
-
}) => {
|
|
23805
|
-
const tone = resolveToneClasses(activity);
|
|
23806
|
-
return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(RowWrapper, { className: cn(className), href, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23807
|
-
ConditionalWrapper,
|
|
23808
|
-
{
|
|
23809
|
-
condition: !!activity.errorMessage,
|
|
23810
|
-
wrapper: (children) => /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23811
|
-
Tooltip,
|
|
23812
|
-
{
|
|
23813
|
-
size: "medium",
|
|
23814
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
23815
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
|
|
23816
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
|
|
23817
|
-
] }),
|
|
23818
|
-
sideOffset: 4,
|
|
23819
|
-
children
|
|
23820
|
-
}
|
|
23821
|
-
),
|
|
23822
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
|
|
24109
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(
|
|
23823
24110
|
"div",
|
|
23824
24111
|
{
|
|
23825
24112
|
className: cn(
|
|
23826
24113
|
"flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
|
|
23827
24114
|
"relative z-10"
|
|
23828
24115
|
),
|
|
24116
|
+
"data-status": activityStatus,
|
|
23829
24117
|
children: [
|
|
23830
|
-
/* @__PURE__ */ (0,
|
|
23831
|
-
|
|
23832
|
-
|
|
23833
|
-
/* @__PURE__ */ (0,
|
|
24118
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(RedeemTypeCell, { activity, tone }),
|
|
24119
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex w-full items-center justify-between sm:hidden", children: [
|
|
24120
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
24121
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
24122
|
+
Icon,
|
|
24123
|
+
{
|
|
24124
|
+
name: "gift-bonus",
|
|
24125
|
+
size: "small",
|
|
24126
|
+
className: cn(
|
|
24127
|
+
"shrink-0 text-agg-foreground",
|
|
24128
|
+
activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
|
|
24129
|
+
)
|
|
24130
|
+
}
|
|
24131
|
+
),
|
|
24132
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
23834
24133
|
"p",
|
|
23835
24134
|
{
|
|
23836
24135
|
className: cn(
|
|
@@ -23842,12 +24141,11 @@ var TradeRow = ({
|
|
|
23842
24141
|
}
|
|
23843
24142
|
)
|
|
23844
24143
|
] }),
|
|
23845
|
-
/* @__PURE__ */ (0,
|
|
24144
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(OutcomeBadge, { label: activity.outcomeLabel, tone })
|
|
23846
24145
|
] }),
|
|
23847
|
-
/* @__PURE__ */ (0,
|
|
23848
|
-
|
|
23849
|
-
|
|
23850
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "agg-activity-image flex h-10 w-10 shrink-0 items-center justify-center sm:h-15 sm:w-15", children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
24146
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex w-full items-center justify-between sm:contents", children: [
|
|
24147
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
|
|
24148
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "agg-activity-image flex h-10 w-10 shrink-0 items-center justify-center sm:h-15 sm:w-15", children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
23851
24149
|
RemoteImage,
|
|
23852
24150
|
{
|
|
23853
24151
|
src: activity.thumbnailSrc,
|
|
@@ -23856,21 +24154,49 @@ var TradeRow = ({
|
|
|
23856
24154
|
classNames: { placeholder: "rounded-agg-sm sm:rounded-agg-lg" }
|
|
23857
24155
|
}
|
|
23858
24156
|
) }),
|
|
23859
|
-
/* @__PURE__ */ (0,
|
|
23860
|
-
/* @__PURE__ */ (0,
|
|
23861
|
-
|
|
23862
|
-
|
|
23863
|
-
|
|
23864
|
-
|
|
23865
|
-
|
|
23866
|
-
|
|
23867
|
-
|
|
23868
|
-
|
|
23869
|
-
|
|
23870
|
-
|
|
24157
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1 sm:gap-2", children: [
|
|
24158
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
24159
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
24160
|
+
"p",
|
|
24161
|
+
{
|
|
24162
|
+
className: cn(
|
|
24163
|
+
"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-bold sm:text-agg-base sm:leading-agg-6",
|
|
24164
|
+
tone.primary
|
|
24165
|
+
),
|
|
24166
|
+
children: activity.title
|
|
24167
|
+
}
|
|
24168
|
+
),
|
|
24169
|
+
shouldShowInlineStatus ? statusVisual.spin ? /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
24170
|
+
LoadingIcon,
|
|
24171
|
+
{
|
|
24172
|
+
size: "small",
|
|
24173
|
+
className: cn("shrink-0", statusVisual.iconClassName)
|
|
24174
|
+
}
|
|
24175
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
24176
|
+
Icon,
|
|
24177
|
+
{
|
|
24178
|
+
name: statusVisual.icon,
|
|
24179
|
+
size: "small",
|
|
24180
|
+
className: cn("shrink-0", statusVisual.iconClassName)
|
|
24181
|
+
}
|
|
24182
|
+
) : null
|
|
24183
|
+
] }),
|
|
24184
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex min-w-0 items-center gap-2 sm:gap-3", children: [
|
|
24185
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "hidden sm:block", children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(OutcomeBadge, { label: activity.outcomeLabel, tone }) }),
|
|
24186
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
24187
|
+
"p",
|
|
24188
|
+
{
|
|
24189
|
+
className: cn(
|
|
24190
|
+
"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
|
|
24191
|
+
tone.meta
|
|
24192
|
+
),
|
|
24193
|
+
children: activity.marketTitle
|
|
24194
|
+
}
|
|
24195
|
+
)
|
|
24196
|
+
] })
|
|
23871
24197
|
] })
|
|
23872
24198
|
] }),
|
|
23873
|
-
/* @__PURE__ */ (0,
|
|
24199
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
23874
24200
|
AmountTimeStack,
|
|
23875
24201
|
{
|
|
23876
24202
|
amountLabel: activity.amountLabel,
|
|
@@ -23880,7 +24206,7 @@ var TradeRow = ({
|
|
|
23880
24206
|
}
|
|
23881
24207
|
)
|
|
23882
24208
|
] }),
|
|
23883
|
-
/* @__PURE__ */ (0,
|
|
24209
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
23884
24210
|
AmountTimeStack,
|
|
23885
24211
|
{
|
|
23886
24212
|
amountLabel: activity.amountLabel,
|
|
@@ -23892,6 +24218,86 @@ var TradeRow = ({
|
|
|
23892
24218
|
}
|
|
23893
24219
|
)
|
|
23894
24220
|
}
|
|
24221
|
+
);
|
|
24222
|
+
};
|
|
24223
|
+
var TradeRow = ({
|
|
24224
|
+
activity,
|
|
24225
|
+
className,
|
|
24226
|
+
href,
|
|
24227
|
+
onClick
|
|
24228
|
+
}) => {
|
|
24229
|
+
const tone = resolveToneClasses(activity);
|
|
24230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(RowWrapper, { className: cn(className), href, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(
|
|
24231
|
+
"div",
|
|
24232
|
+
{
|
|
24233
|
+
className: cn(
|
|
24234
|
+
"flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
|
|
24235
|
+
"relative z-10"
|
|
24236
|
+
),
|
|
24237
|
+
children: [
|
|
24238
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex w-full items-center justify-between sm:hidden", children: [
|
|
24239
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
24240
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(VenueLogo, { venue: activity.venue, size: "small", className: "size-5 shrink-0" }),
|
|
24241
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
24242
|
+
"p",
|
|
24243
|
+
{
|
|
24244
|
+
className: cn(
|
|
24245
|
+
"agg-activity-type font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
|
|
24246
|
+
tone.primary,
|
|
24247
|
+
activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
|
|
24248
|
+
),
|
|
24249
|
+
children: activity.type
|
|
24250
|
+
}
|
|
24251
|
+
)
|
|
24252
|
+
] }),
|
|
24253
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(TradeOutcomeShares, { activity, tone }) })
|
|
24254
|
+
] }),
|
|
24255
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(TradeTypeCell, { activity, tone }),
|
|
24256
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex w-full items-center justify-between sm:contents", children: [
|
|
24257
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
|
|
24258
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "agg-activity-image flex h-10 w-10 shrink-0 items-center justify-center sm:h-15 sm:w-15", children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
24259
|
+
RemoteImage,
|
|
24260
|
+
{
|
|
24261
|
+
src: activity.thumbnailSrc,
|
|
24262
|
+
alt: "",
|
|
24263
|
+
className: "h-full w-full rounded-agg-sm object-cover sm:rounded-agg-lg",
|
|
24264
|
+
classNames: { placeholder: "rounded-agg-sm sm:rounded-agg-lg" }
|
|
24265
|
+
}
|
|
24266
|
+
) }),
|
|
24267
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-2", children: [
|
|
24268
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
24269
|
+
"p",
|
|
24270
|
+
{
|
|
24271
|
+
className: cn(
|
|
24272
|
+
"agg-activity-market min-w-0 overflow-hidden font-agg-sans text-agg-sm leading-agg-5 font-agg-bold [display:-webkit-box] [-webkit-line-clamp:2] [-webkit-box-orient:vertical] sm:text-agg-base sm:leading-agg-6 sm:whitespace-nowrap sm:text-ellipsis sm:[-webkit-line-clamp:1] sm:[display:block]",
|
|
24273
|
+
tone.primary
|
|
24274
|
+
),
|
|
24275
|
+
children: activity.title
|
|
24276
|
+
}
|
|
24277
|
+
),
|
|
24278
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "hidden flex-wrap items-center gap-2 sm:flex sm:gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(TradeOutcomeShares, { activity, tone }) })
|
|
24279
|
+
] })
|
|
24280
|
+
] }),
|
|
24281
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
24282
|
+
AmountTimeStack,
|
|
24283
|
+
{
|
|
24284
|
+
amountLabel: activity.amountLabel,
|
|
24285
|
+
timeLabel: activity.timeLabel,
|
|
24286
|
+
tone,
|
|
24287
|
+
mobile: true
|
|
24288
|
+
}
|
|
24289
|
+
)
|
|
24290
|
+
] }),
|
|
24291
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
24292
|
+
AmountTimeStack,
|
|
24293
|
+
{
|
|
24294
|
+
amountLabel: activity.amountLabel,
|
|
24295
|
+
timeLabel: activity.timeLabel,
|
|
24296
|
+
tone
|
|
24297
|
+
}
|
|
24298
|
+
)
|
|
24299
|
+
]
|
|
24300
|
+
}
|
|
23895
24301
|
) });
|
|
23896
24302
|
};
|
|
23897
24303
|
var TransferRow = ({
|
|
@@ -23904,7 +24310,7 @@ var TransferRow = ({
|
|
|
23904
24310
|
const transferStatus = resolveActivityStatus(activity);
|
|
23905
24311
|
const transferIconName = TRANSFER_ICON[activity.kind];
|
|
23906
24312
|
const statusVisual = getStatusVisual(activity);
|
|
23907
|
-
return /* @__PURE__ */ (0,
|
|
24313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
23908
24314
|
RowWrapper,
|
|
23909
24315
|
{
|
|
23910
24316
|
className,
|
|
@@ -23912,116 +24318,98 @@ var TransferRow = ({
|
|
|
23912
24318
|
target: href ? "_blank" : void 0,
|
|
23913
24319
|
rel: href ? "noopener noreferrer" : void 0,
|
|
23914
24320
|
onClick,
|
|
23915
|
-
children: /* @__PURE__ */ (0,
|
|
23916
|
-
|
|
24321
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(
|
|
24322
|
+
"div",
|
|
23917
24323
|
{
|
|
23918
|
-
|
|
23919
|
-
|
|
23920
|
-
|
|
23921
|
-
{
|
|
23922
|
-
size: "medium",
|
|
23923
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
23924
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
|
|
23925
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
|
|
23926
|
-
] }),
|
|
23927
|
-
sideOffset: 4,
|
|
23928
|
-
children
|
|
23929
|
-
}
|
|
24324
|
+
className: cn(
|
|
24325
|
+
"flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
|
|
24326
|
+
"relative z-10"
|
|
23930
24327
|
),
|
|
23931
|
-
children:
|
|
23932
|
-
|
|
23933
|
-
{
|
|
23934
|
-
|
|
23935
|
-
|
|
23936
|
-
|
|
24328
|
+
children: [
|
|
24329
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(TransferTypeCell, { activity, tone }),
|
|
24330
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "flex w-full items-center justify-between sm:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
24331
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
24332
|
+
Icon,
|
|
24333
|
+
{
|
|
24334
|
+
name: transferIconName,
|
|
24335
|
+
size: "small",
|
|
24336
|
+
className: cn(
|
|
24337
|
+
"shrink-0 text-agg-foreground",
|
|
24338
|
+
activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
|
|
24339
|
+
)
|
|
24340
|
+
}
|
|
23937
24341
|
),
|
|
23938
|
-
|
|
23939
|
-
|
|
23940
|
-
|
|
23941
|
-
|
|
23942
|
-
|
|
24342
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
24343
|
+
"p",
|
|
24344
|
+
{
|
|
24345
|
+
className: cn(
|
|
24346
|
+
"font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
|
|
24347
|
+
tone.primary,
|
|
24348
|
+
activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
|
|
24349
|
+
),
|
|
24350
|
+
children: activity.type
|
|
24351
|
+
}
|
|
24352
|
+
)
|
|
24353
|
+
] }) }),
|
|
24354
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex w-full items-center justify-between sm:contents", children: [
|
|
24355
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
|
|
24356
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
24357
|
+
"div",
|
|
24358
|
+
{
|
|
24359
|
+
className: "agg-activity-deposit-square hidden h-15 w-15 shrink-0 items-center justify-center rounded-agg-lg bg-agg-secondary-hover sm:flex",
|
|
24360
|
+
"data-status": transferStatus,
|
|
24361
|
+
children: statusVisual.spin ? /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(LoadingIcon, { size: "medium", className: cn(statusVisual.iconClassName) }) : /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
24362
|
+
Icon,
|
|
24363
|
+
{
|
|
24364
|
+
name: statusVisual.icon,
|
|
24365
|
+
size: "medium",
|
|
24366
|
+
className: cn(statusVisual.iconClassName)
|
|
24367
|
+
}
|
|
24368
|
+
)
|
|
24369
|
+
}
|
|
24370
|
+
),
|
|
24371
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1", children: [
|
|
24372
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
24373
|
+
"p",
|
|
23943
24374
|
{
|
|
23944
|
-
name: transferIconName,
|
|
23945
|
-
size: "small",
|
|
23946
24375
|
className: cn(
|
|
23947
|
-
"
|
|
23948
|
-
|
|
23949
|
-
)
|
|
24376
|
+
"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-bold sm:text-agg-base sm:leading-agg-6",
|
|
24377
|
+
tone.primary
|
|
24378
|
+
),
|
|
24379
|
+
children: activity.title
|
|
23950
24380
|
}
|
|
23951
24381
|
),
|
|
23952
|
-
/* @__PURE__ */ (0,
|
|
24382
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
23953
24383
|
"p",
|
|
23954
24384
|
{
|
|
23955
24385
|
className: cn(
|
|
23956
|
-
"font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
|
|
23957
|
-
tone.
|
|
23958
|
-
activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
|
|
23959
|
-
),
|
|
23960
|
-
children: activity.type
|
|
23961
|
-
}
|
|
23962
|
-
)
|
|
23963
|
-
] }) }),
|
|
23964
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex w-full items-center justify-between sm:contents", children: [
|
|
23965
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
|
|
23966
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23967
|
-
"div",
|
|
23968
|
-
{
|
|
23969
|
-
className: "agg-activity-deposit-square hidden h-15 w-15 shrink-0 items-center justify-center rounded-agg-lg bg-agg-secondary-hover sm:flex",
|
|
23970
|
-
"data-status": transferStatus,
|
|
23971
|
-
children: statusVisual.spin ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(LoadingIcon, { size: "medium", className: cn(statusVisual.iconClassName) }) : /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23972
|
-
Icon,
|
|
23973
|
-
{
|
|
23974
|
-
name: statusVisual.icon,
|
|
23975
|
-
size: "medium",
|
|
23976
|
-
className: cn(statusVisual.iconClassName)
|
|
23977
|
-
}
|
|
23978
|
-
)
|
|
23979
|
-
}
|
|
23980
|
-
),
|
|
23981
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1", children: [
|
|
23982
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
23983
|
-
"p",
|
|
23984
|
-
{
|
|
23985
|
-
className: cn(
|
|
23986
|
-
"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-bold sm:text-agg-base sm:leading-agg-6",
|
|
23987
|
-
tone.primary
|
|
23988
|
-
),
|
|
23989
|
-
children: activity.title
|
|
23990
|
-
}
|
|
24386
|
+
"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
|
|
24387
|
+
tone.meta
|
|
23991
24388
|
),
|
|
23992
|
-
|
|
23993
|
-
"p",
|
|
23994
|
-
{
|
|
23995
|
-
className: cn(
|
|
23996
|
-
"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
|
|
23997
|
-
tone.meta
|
|
23998
|
-
),
|
|
23999
|
-
children: activity.subtitleLabel
|
|
24000
|
-
}
|
|
24001
|
-
)
|
|
24002
|
-
] })
|
|
24003
|
-
] }),
|
|
24004
|
-
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
24005
|
-
AmountTimeStack,
|
|
24006
|
-
{
|
|
24007
|
-
amountLabel: activity.amountLabel,
|
|
24008
|
-
timeLabel: activity.timeLabel,
|
|
24009
|
-
tone,
|
|
24010
|
-
mobile: true
|
|
24389
|
+
children: activity.subtitleLabel
|
|
24011
24390
|
}
|
|
24012
24391
|
)
|
|
24013
|
-
] })
|
|
24014
|
-
|
|
24015
|
-
|
|
24016
|
-
|
|
24017
|
-
|
|
24018
|
-
|
|
24019
|
-
|
|
24020
|
-
|
|
24021
|
-
|
|
24022
|
-
|
|
24023
|
-
|
|
24024
|
-
|
|
24392
|
+
] })
|
|
24393
|
+
] }),
|
|
24394
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
24395
|
+
AmountTimeStack,
|
|
24396
|
+
{
|
|
24397
|
+
amountLabel: activity.amountLabel,
|
|
24398
|
+
timeLabel: activity.timeLabel,
|
|
24399
|
+
tone,
|
|
24400
|
+
mobile: true
|
|
24401
|
+
}
|
|
24402
|
+
)
|
|
24403
|
+
] }),
|
|
24404
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
24405
|
+
AmountTimeStack,
|
|
24406
|
+
{
|
|
24407
|
+
amountLabel: activity.amountLabel,
|
|
24408
|
+
timeLabel: activity.timeLabel,
|
|
24409
|
+
tone
|
|
24410
|
+
}
|
|
24411
|
+
)
|
|
24412
|
+
]
|
|
24025
24413
|
}
|
|
24026
24414
|
)
|
|
24027
24415
|
}
|
|
@@ -24039,10 +24427,10 @@ var ActivityRow = ({ activity, href, onClick }) => {
|
|
|
24039
24427
|
"before:bg-agg-secondary-hover before:rounded-agg-xl"
|
|
24040
24428
|
);
|
|
24041
24429
|
if (activity.kind === "trade") {
|
|
24042
|
-
return /* @__PURE__ */ (0,
|
|
24430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(TradeRow, { activity, className: sharedClassName, href, onClick: handleClick });
|
|
24043
24431
|
}
|
|
24044
24432
|
if (activity.kind === "redeem") {
|
|
24045
|
-
return /* @__PURE__ */ (0,
|
|
24433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
24046
24434
|
RedeemRow,
|
|
24047
24435
|
{
|
|
24048
24436
|
activity,
|
|
@@ -24052,7 +24440,7 @@ var ActivityRow = ({ activity, href, onClick }) => {
|
|
|
24052
24440
|
}
|
|
24053
24441
|
);
|
|
24054
24442
|
}
|
|
24055
|
-
return /* @__PURE__ */ (0,
|
|
24443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
24056
24444
|
TransferRow,
|
|
24057
24445
|
{
|
|
24058
24446
|
activity,
|
|
@@ -24065,19 +24453,19 @@ var ActivityRow = ({ activity, href, onClick }) => {
|
|
|
24065
24453
|
ActivityRow.displayName = "ActivityRow";
|
|
24066
24454
|
|
|
24067
24455
|
// src/pages/user-profile/components/empty-state.tsx
|
|
24068
|
-
var
|
|
24456
|
+
var import_jsx_runtime158 = require("react/jsx-runtime");
|
|
24069
24457
|
var EmptyState = ({ title: title2, description, className }) => {
|
|
24070
|
-
return /* @__PURE__ */ (0,
|
|
24458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
|
|
24071
24459
|
"div",
|
|
24072
24460
|
{
|
|
24073
24461
|
className: cn("flex flex-col items-center justify-center gap-8 p-10", className),
|
|
24074
24462
|
role: "status",
|
|
24075
24463
|
"aria-live": "polite",
|
|
24076
|
-
children: /* @__PURE__ */ (0,
|
|
24077
|
-
/* @__PURE__ */ (0,
|
|
24078
|
-
/* @__PURE__ */ (0,
|
|
24079
|
-
/* @__PURE__ */ (0,
|
|
24080
|
-
description ? /* @__PURE__ */ (0,
|
|
24464
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex flex-col items-center gap-5", children: [
|
|
24465
|
+
/* @__PURE__ */ (0, import_jsx_runtime158.jsx)(SearchEmptyIcon, { className: "h-10 w-10 text-agg-muted-foreground", "aria-hidden": true }),
|
|
24466
|
+
/* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex flex-col items-center gap-1 text-center text-agg-foreground", children: [
|
|
24467
|
+
/* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold", children: title2 }),
|
|
24468
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal", children: description }) : null
|
|
24081
24469
|
] })
|
|
24082
24470
|
] })
|
|
24083
24471
|
}
|
|
@@ -24086,8 +24474,8 @@ var EmptyState = ({ title: title2, description, className }) => {
|
|
|
24086
24474
|
EmptyState.displayName = "EmptyState";
|
|
24087
24475
|
|
|
24088
24476
|
// src/pages/user-profile/components/position-row.tsx
|
|
24089
|
-
var
|
|
24090
|
-
var
|
|
24477
|
+
var import_hooks65 = require("@agg-build/hooks");
|
|
24478
|
+
var import_jsx_runtime159 = require("react/jsx-runtime");
|
|
24091
24479
|
var floorToTwoDecimals = (value) => {
|
|
24092
24480
|
if (!Number.isFinite(value) || value <= 0) return 0;
|
|
24093
24481
|
return Math.trunc(value * 100) / 100;
|
|
@@ -24100,8 +24488,8 @@ var toneTextClassName = (tone) => {
|
|
|
24100
24488
|
if (tone === "negative") return "text-agg-error";
|
|
24101
24489
|
return "text-agg-muted-foreground";
|
|
24102
24490
|
};
|
|
24103
|
-
var OutcomePill = ({ label: label2 }) => /* @__PURE__ */ (0,
|
|
24104
|
-
var ResolutionPill = ({ label: label2 }) => /* @__PURE__ */ (0,
|
|
24491
|
+
var OutcomePill = ({ label: label2 }) => /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "agg-position-outcome max-w-[120px] inline-flex items-center justify-center rounded-full bg-agg-secondary-hover px-4 py-[6px]", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground truncate", children: label2 }) });
|
|
24492
|
+
var ResolutionPill = ({ label: label2 }) => /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "agg-position-resolution-pill inline-flex w-full items-center justify-center overflow-hidden rounded-full bg-agg-secondary-hover px-4 py-[6px] md:w-auto", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "truncate whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: label2 }) });
|
|
24105
24493
|
var VenueShares = ({
|
|
24106
24494
|
model,
|
|
24107
24495
|
totalSharesLabel,
|
|
@@ -24109,26 +24497,26 @@ var VenueShares = ({
|
|
|
24109
24497
|
keyPrefix
|
|
24110
24498
|
}) => {
|
|
24111
24499
|
if (!totalSharesLabel && model.venueShareBreakdown.length === 0) return null;
|
|
24112
|
-
return /* @__PURE__ */ (0,
|
|
24113
|
-
model.venueShareBreakdown.length > 0 ? /* @__PURE__ */ (0,
|
|
24500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: cn(className, "gap-2"), children: [
|
|
24501
|
+
model.venueShareBreakdown.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "flex items-center gap-1", children: model.venueShareBreakdown.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
24114
24502
|
Tooltip,
|
|
24115
24503
|
{
|
|
24116
|
-
content: /* @__PURE__ */ (0,
|
|
24504
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { children: row.sharesLabel }),
|
|
24117
24505
|
"aria-label": `${row.venue} shares`,
|
|
24118
24506
|
side: "top",
|
|
24119
|
-
children: /* @__PURE__ */ (0,
|
|
24507
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
24120
24508
|
"span",
|
|
24121
24509
|
{
|
|
24122
24510
|
tabIndex: 0,
|
|
24123
24511
|
className: "cursor-help rounded-agg-xs focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-0 focus-visible:ring-offset-agg-secondary",
|
|
24124
24512
|
"aria-label": `${row.venue} shares`,
|
|
24125
|
-
children: /* @__PURE__ */ (0,
|
|
24513
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(VenueLogo, { venue: row.venue, size: "small", className: "size-4 shrink-0" })
|
|
24126
24514
|
}
|
|
24127
24515
|
)
|
|
24128
24516
|
},
|
|
24129
24517
|
`${keyPrefix}-${row.venue}-${String(index)}`
|
|
24130
24518
|
)) }) : null,
|
|
24131
|
-
totalSharesLabel ? /* @__PURE__ */ (0,
|
|
24519
|
+
totalSharesLabel ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: totalSharesLabel }) : null
|
|
24132
24520
|
] });
|
|
24133
24521
|
};
|
|
24134
24522
|
var StatusBadge = ({
|
|
@@ -24137,7 +24525,7 @@ var StatusBadge = ({
|
|
|
24137
24525
|
}) => {
|
|
24138
24526
|
if (status === "lost" || status === "won_claimed") return null;
|
|
24139
24527
|
const isWon = status === "won_unclaimed";
|
|
24140
|
-
return /* @__PURE__ */ (0,
|
|
24528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
|
|
24141
24529
|
"span",
|
|
24142
24530
|
{
|
|
24143
24531
|
className: cn(
|
|
@@ -24146,7 +24534,7 @@ var StatusBadge = ({
|
|
|
24146
24534
|
isWon ? "border-agg-success/50 bg-agg-success/10 text-agg-success" : "border-agg-muted-foreground/30 bg-agg-secondary-hover text-agg-foreground"
|
|
24147
24535
|
),
|
|
24148
24536
|
children: [
|
|
24149
|
-
/* @__PURE__ */ (0,
|
|
24537
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Icon, { name: isWon ? "check-circle" : "hourglass-start", size: "small", className: "size-2.5!" }),
|
|
24150
24538
|
isWon ? labels.won : labels.open
|
|
24151
24539
|
]
|
|
24152
24540
|
}
|
|
@@ -24159,7 +24547,7 @@ var ResultBadge = ({
|
|
|
24159
24547
|
if (status !== "won_claimed" && status !== "lost" && status !== "sold") return null;
|
|
24160
24548
|
const isWon = status === "won_claimed";
|
|
24161
24549
|
const isSold = status === "sold";
|
|
24162
|
-
return /* @__PURE__ */ (0,
|
|
24550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
|
|
24163
24551
|
"span",
|
|
24164
24552
|
{
|
|
24165
24553
|
className: cn(
|
|
@@ -24168,7 +24556,7 @@ var ResultBadge = ({
|
|
|
24168
24556
|
isWon ? "border-agg-success/50 bg-agg-success/10 text-agg-success" : isSold ? "border-agg-muted-foreground/30 bg-agg-secondary-hover text-agg-muted-foreground" : "border-agg-error/50 bg-agg-error/10 text-agg-error"
|
|
24169
24557
|
),
|
|
24170
24558
|
children: [
|
|
24171
|
-
/* @__PURE__ */ (0,
|
|
24559
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
24172
24560
|
Icon,
|
|
24173
24561
|
{
|
|
24174
24562
|
name: isWon ? "check-circle" : isSold ? "hourglass-start" : "cross-circle",
|
|
@@ -24184,27 +24572,27 @@ var ResultBadge = ({
|
|
|
24184
24572
|
var TotalTradedCell = ({
|
|
24185
24573
|
model,
|
|
24186
24574
|
className
|
|
24187
|
-
}) => /* @__PURE__ */ (0,
|
|
24575
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
|
|
24188
24576
|
"div",
|
|
24189
24577
|
{
|
|
24190
24578
|
className: cn("agg-position-total-traded flex flex-col gap-[2px] whitespace-nowrap", className),
|
|
24191
24579
|
children: [
|
|
24192
|
-
/* @__PURE__ */ (0,
|
|
24193
|
-
/* @__PURE__ */ (0,
|
|
24580
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: model.totalTraded.primaryLabel }),
|
|
24581
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: model.totalTraded.averageLabel })
|
|
24194
24582
|
]
|
|
24195
24583
|
}
|
|
24196
24584
|
);
|
|
24197
24585
|
var PositionValueCell = ({
|
|
24198
24586
|
value,
|
|
24199
24587
|
className
|
|
24200
|
-
}) => /* @__PURE__ */ (0,
|
|
24588
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
|
|
24201
24589
|
"div",
|
|
24202
24590
|
{
|
|
24203
24591
|
className: cn("agg-position-value-cell flex flex-col gap-[2px] whitespace-nowrap", className),
|
|
24204
24592
|
children: [
|
|
24205
|
-
/* @__PURE__ */ (0,
|
|
24206
|
-
/* @__PURE__ */ (0,
|
|
24207
|
-
/* @__PURE__ */ (0,
|
|
24593
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex items-baseline gap-1.5", children: [
|
|
24594
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: value.primaryLabel }),
|
|
24595
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
24208
24596
|
"p",
|
|
24209
24597
|
{
|
|
24210
24598
|
className: cn(
|
|
@@ -24215,9 +24603,9 @@ var PositionValueCell = ({
|
|
|
24215
24603
|
}
|
|
24216
24604
|
)
|
|
24217
24605
|
] }),
|
|
24218
|
-
/* @__PURE__ */ (0,
|
|
24219
|
-
/* @__PURE__ */ (0,
|
|
24220
|
-
/* @__PURE__ */ (0,
|
|
24606
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex items-baseline gap-1.5", children: [
|
|
24607
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: value.priceLabel }),
|
|
24608
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
24221
24609
|
"p",
|
|
24222
24610
|
{
|
|
24223
24611
|
className: cn(
|
|
@@ -24239,7 +24627,7 @@ var PositionRow = ({
|
|
|
24239
24627
|
onClaim,
|
|
24240
24628
|
isClaiming = false
|
|
24241
24629
|
}) => {
|
|
24242
|
-
const labels = (0,
|
|
24630
|
+
const labels = (0, import_hooks65.useLabels)().userProfile.positions;
|
|
24243
24631
|
const model = toPositionRowViewModel(position, {
|
|
24244
24632
|
avgPrefix: labels.avgPrefix,
|
|
24245
24633
|
nowPrefix: labels.nowPrefix,
|
|
@@ -24281,7 +24669,7 @@ var PositionRow = ({
|
|
|
24281
24669
|
handleDivClick();
|
|
24282
24670
|
}
|
|
24283
24671
|
};
|
|
24284
|
-
return /* @__PURE__ */ (0,
|
|
24672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Wrapper, __spreadProps(__spreadValues({ className: sharedClassName }, wrapperProps), { children: /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
|
|
24285
24673
|
"div",
|
|
24286
24674
|
{
|
|
24287
24675
|
className: cn(
|
|
@@ -24289,21 +24677,21 @@ var PositionRow = ({
|
|
|
24289
24677
|
isClosed ? "md:gap-8" : "md:gap-6"
|
|
24290
24678
|
),
|
|
24291
24679
|
children: [
|
|
24292
|
-
/* @__PURE__ */ (0,
|
|
24293
|
-
/* @__PURE__ */ (0,
|
|
24294
|
-
/* @__PURE__ */ (0,
|
|
24680
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex w-full items-center justify-between gap-3 md:w-auto md:min-w-0 md:flex-1 md:justify-start md:gap-4", children: [
|
|
24681
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3 md:gap-4", children: [
|
|
24682
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "agg-position-image flex h-10 w-10 shrink-0 items-center justify-center md:h-15 md:w-15", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
24295
24683
|
RemoteImage,
|
|
24296
24684
|
{
|
|
24297
|
-
src: (0,
|
|
24685
|
+
src: (0, import_hooks65.optimizedImageUrl)(model.thumbnailSrc, 60),
|
|
24298
24686
|
alt: "",
|
|
24299
24687
|
className: "h-full w-full rounded-agg-sm object-cover"
|
|
24300
24688
|
}
|
|
24301
24689
|
) }),
|
|
24302
|
-
/* @__PURE__ */ (0,
|
|
24303
|
-
/* @__PURE__ */ (0,
|
|
24304
|
-
/* @__PURE__ */ (0,
|
|
24305
|
-
/* @__PURE__ */ (0,
|
|
24306
|
-
/* @__PURE__ */ (0,
|
|
24690
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
24691
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-position-market min-w-0 overflow-hidden font-agg-sans text-agg-sm leading-agg-5 font-agg-bold text-agg-foreground [display:-webkit-box] [-webkit-line-clamp:2] [-webkit-box-orient:vertical] md:block md:truncate md:text-agg-base md:leading-agg-6", children: model.title }),
|
|
24692
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "hidden min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-2 pt-1 md:flex", children: [
|
|
24693
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(OutcomePill, { label: model.selectedOutcomeLabel }),
|
|
24694
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
24307
24695
|
VenueShares,
|
|
24308
24696
|
{
|
|
24309
24697
|
model,
|
|
@@ -24315,10 +24703,10 @@ var PositionRow = ({
|
|
|
24315
24703
|
] })
|
|
24316
24704
|
] })
|
|
24317
24705
|
] }),
|
|
24318
|
-
/* @__PURE__ */ (0,
|
|
24706
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "flex shrink-0 items-center justify-end md:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(OutcomePill, { label: model.selectedOutcomeLabel }) })
|
|
24319
24707
|
] }),
|
|
24320
|
-
isClosed ? /* @__PURE__ */ (0,
|
|
24321
|
-
/* @__PURE__ */ (0,
|
|
24708
|
+
isClosed ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "md:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(ResolutionPill, { label: `${labels.resolutionHeader}: ${model.resolutionLabel}` }) }) : null,
|
|
24709
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
24322
24710
|
VenueShares,
|
|
24323
24711
|
{
|
|
24324
24712
|
model,
|
|
@@ -24327,14 +24715,14 @@ var PositionRow = ({
|
|
|
24327
24715
|
className: "agg-position-venues flex min-w-0 flex-1 flex-wrap content-center items-center gap-x-3 gap-y-2 md:hidden"
|
|
24328
24716
|
}
|
|
24329
24717
|
),
|
|
24330
|
-
/* @__PURE__ */ (0,
|
|
24331
|
-
/* @__PURE__ */ (0,
|
|
24332
|
-
/* @__PURE__ */ (0,
|
|
24333
|
-
/* @__PURE__ */ (0,
|
|
24718
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex w-full items-center justify-between gap-3 md:hidden", children: [
|
|
24719
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex min-w-0 items-center gap-5", children: [
|
|
24720
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(TotalTradedCell, { model }),
|
|
24721
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(PositionValueCell, { value: isClosed ? model.payout : model.currentValue })
|
|
24334
24722
|
] }),
|
|
24335
|
-
isClosed ? /* @__PURE__ */ (0,
|
|
24336
|
-
/* @__PURE__ */ (0,
|
|
24337
|
-
model.canClaim ? /* @__PURE__ */ (0,
|
|
24723
|
+
isClosed ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(ResultBadge, { status: model.positionStatus, labels }) : /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex shrink-0 flex-col items-start justify-center gap-2", children: [
|
|
24724
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(StatusBadge, { status: model.positionStatus, labels }),
|
|
24725
|
+
model.canClaim ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
|
|
24338
24726
|
"button",
|
|
24339
24727
|
{
|
|
24340
24728
|
type: "button",
|
|
@@ -24343,48 +24731,48 @@ var PositionRow = ({
|
|
|
24343
24731
|
disabled: isClaiming,
|
|
24344
24732
|
"aria-busy": isClaiming || void 0,
|
|
24345
24733
|
children: [
|
|
24346
|
-
isClaiming ? /* @__PURE__ */ (0,
|
|
24734
|
+
isClaiming ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(LoadingIcon, { size: "small", className: "text-agg-primary" }) : null,
|
|
24347
24735
|
labels.claim
|
|
24348
24736
|
]
|
|
24349
24737
|
}
|
|
24350
24738
|
) : null
|
|
24351
24739
|
] })
|
|
24352
24740
|
] }),
|
|
24353
|
-
isClosed ? /* @__PURE__ */ (0,
|
|
24354
|
-
/* @__PURE__ */ (0,
|
|
24355
|
-
/* @__PURE__ */ (0,
|
|
24741
|
+
isClosed ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_jsx_runtime159.Fragment, { children: [
|
|
24742
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "hidden w-[90px] shrink-0 md:block lg:w-[120px]", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(ResolutionPill, { label: model.resolutionLabel }) }),
|
|
24743
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
24356
24744
|
TotalTradedCell,
|
|
24357
24745
|
{
|
|
24358
24746
|
model,
|
|
24359
24747
|
className: "hidden w-[110px] shrink-0 md:flex lg:w-[130px]"
|
|
24360
24748
|
}
|
|
24361
24749
|
),
|
|
24362
|
-
/* @__PURE__ */ (0,
|
|
24750
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
24363
24751
|
PositionValueCell,
|
|
24364
24752
|
{
|
|
24365
24753
|
value: model.payout,
|
|
24366
24754
|
className: "hidden w-[130px] shrink-0 md:flex lg:w-[160px]"
|
|
24367
24755
|
}
|
|
24368
24756
|
),
|
|
24369
|
-
/* @__PURE__ */ (0,
|
|
24370
|
-
] }) : /* @__PURE__ */ (0,
|
|
24371
|
-
/* @__PURE__ */ (0,
|
|
24757
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "hidden w-[60px] shrink-0 items-center md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(ResultBadge, { status: model.positionStatus, labels }) })
|
|
24758
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_jsx_runtime159.Fragment, { children: [
|
|
24759
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
24372
24760
|
TotalTradedCell,
|
|
24373
24761
|
{
|
|
24374
24762
|
model,
|
|
24375
24763
|
className: "hidden w-[120px] shrink-0 md:flex lg:w-[140px]"
|
|
24376
24764
|
}
|
|
24377
24765
|
),
|
|
24378
|
-
/* @__PURE__ */ (0,
|
|
24766
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
24379
24767
|
PositionValueCell,
|
|
24380
24768
|
{
|
|
24381
24769
|
value: model.currentValue,
|
|
24382
24770
|
className: "hidden w-[130px] shrink-0 md:flex lg:w-[160px]"
|
|
24383
24771
|
}
|
|
24384
24772
|
),
|
|
24385
|
-
/* @__PURE__ */ (0,
|
|
24386
|
-
/* @__PURE__ */ (0,
|
|
24387
|
-
model.canClaim ? /* @__PURE__ */ (0,
|
|
24773
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "hidden w-[100px] shrink-0 items-center gap-3 md:flex", children: [
|
|
24774
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(StatusBadge, { status: model.positionStatus, labels }),
|
|
24775
|
+
model.canClaim ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
|
|
24388
24776
|
"button",
|
|
24389
24777
|
{
|
|
24390
24778
|
type: "button",
|
|
@@ -24393,14 +24781,14 @@ var PositionRow = ({
|
|
|
24393
24781
|
disabled: isClaiming,
|
|
24394
24782
|
"aria-busy": isClaiming || void 0,
|
|
24395
24783
|
children: [
|
|
24396
|
-
isClaiming ? /* @__PURE__ */ (0,
|
|
24784
|
+
isClaiming ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(LoadingIcon, { size: "small", className: "text-agg-primary" }) : null,
|
|
24397
24785
|
labels.claim
|
|
24398
24786
|
]
|
|
24399
24787
|
}
|
|
24400
24788
|
) : null
|
|
24401
24789
|
] })
|
|
24402
24790
|
] }),
|
|
24403
|
-
/* @__PURE__ */ (0,
|
|
24791
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "hidden w-5 shrink-0 items-center justify-end md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
24404
24792
|
Icon,
|
|
24405
24793
|
{
|
|
24406
24794
|
name: "chevron-right",
|
|
@@ -24415,16 +24803,16 @@ var PositionRow = ({
|
|
|
24415
24803
|
PositionRow.displayName = "PositionRow";
|
|
24416
24804
|
|
|
24417
24805
|
// src/pages/user-profile/components/positions-activity.tsx
|
|
24418
|
-
var
|
|
24806
|
+
var import_jsx_runtime160 = require("react/jsx-runtime");
|
|
24419
24807
|
var tabItems = [
|
|
24420
24808
|
{ value: USER_PROFILE_TAB_POSITIONS, label: "Positions" },
|
|
24421
24809
|
// Open orders is intentionally hidden from the user-profile tab group.
|
|
24422
24810
|
// Restore by re-adding USER_PROFILE_TAB_OPEN_ORDERS here and the renderer below.
|
|
24423
24811
|
{ value: USER_PROFILE_TAB_ACTIVITY, label: "Activity" }
|
|
24424
24812
|
];
|
|
24425
|
-
var TabRowsSkeleton = ({ ariaLabel }) => /* @__PURE__ */ (0,
|
|
24426
|
-
/* @__PURE__ */ (0,
|
|
24427
|
-
index < acc.length - 1 ? /* @__PURE__ */ (0,
|
|
24813
|
+
var TabRowsSkeleton = ({ ariaLabel }) => /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("div", { role: "status", "aria-label": ariaLabel, className: "flex flex-col gap-3 sm:gap-4", children: Array.from({ length: 3 }).map((_, index, acc) => /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(import_react43.Fragment, { children: [
|
|
24814
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("div", { className: "h-14 rounded-agg-sm bg-agg-secondary-hover/80 sm:h-16" }, index),
|
|
24815
|
+
index < acc.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("div", { className: "agg-position-divider h-px w-full shrink-0 bg-agg-separator", "aria-hidden": true }) : null
|
|
24428
24816
|
] }, index)) });
|
|
24429
24817
|
var PositionsActivity = ({
|
|
24430
24818
|
activePositions = [],
|
|
@@ -24455,7 +24843,7 @@ var PositionsActivity = ({
|
|
|
24455
24843
|
initialPositionFilter = "active",
|
|
24456
24844
|
className
|
|
24457
24845
|
}) => {
|
|
24458
|
-
const positionsLabels = (0,
|
|
24846
|
+
const positionsLabels = (0, import_hooks66.useLabels)().userProfile.positions;
|
|
24459
24847
|
const isTabControlled = tab !== void 0;
|
|
24460
24848
|
const [internalActiveTab, setInternalActiveTab] = (0, import_react43.useState)(
|
|
24461
24849
|
tab != null ? tab : USER_PROFILE_TAB_POSITIONS
|
|
@@ -24585,7 +24973,7 @@ var PositionsActivity = ({
|
|
|
24585
24973
|
isLoadingMoreActivities,
|
|
24586
24974
|
onLoadMoreActivities
|
|
24587
24975
|
]);
|
|
24588
|
-
return /* @__PURE__ */ (0,
|
|
24976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(
|
|
24589
24977
|
"div",
|
|
24590
24978
|
{
|
|
24591
24979
|
className: cn(
|
|
@@ -24594,7 +24982,7 @@ var PositionsActivity = ({
|
|
|
24594
24982
|
className
|
|
24595
24983
|
),
|
|
24596
24984
|
children: [
|
|
24597
|
-
/* @__PURE__ */ (0,
|
|
24985
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24598
24986
|
Tabs,
|
|
24599
24987
|
{
|
|
24600
24988
|
items: tabItems,
|
|
@@ -24608,7 +24996,7 @@ var PositionsActivity = ({
|
|
|
24608
24996
|
}
|
|
24609
24997
|
}
|
|
24610
24998
|
),
|
|
24611
|
-
/* @__PURE__ */ (0,
|
|
24999
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(
|
|
24612
25000
|
"div",
|
|
24613
25001
|
{
|
|
24614
25002
|
className: cn(
|
|
@@ -24616,12 +25004,12 @@ var PositionsActivity = ({
|
|
|
24616
25004
|
isPositionsTab ? "pt-4 md:pt-6" : "pt-0 md:pt-6"
|
|
24617
25005
|
),
|
|
24618
25006
|
children: [
|
|
24619
|
-
isPositionsTab ? /* @__PURE__ */ (0,
|
|
24620
|
-
/* @__PURE__ */ (0,
|
|
25007
|
+
isPositionsTab ? /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "agg-toolbar flex flex-row items-start gap-3 px-4 sm:gap-5 sm:px-6", children: [
|
|
25008
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("div", { className: "agg-position-filters flex h-10 w-[45%] max-w-[169px] shrink-0 items-stretch overflow-clip rounded-agg-sm border border-agg-separator sm:w-auto sm:min-w-[200px] sm:max-w-[270px]", children: USER_PROFILE_POSITION_FILTERS.map((filter, idx) => {
|
|
24621
25009
|
const isActive = filter.value === positionFilter;
|
|
24622
|
-
return /* @__PURE__ */ (0,
|
|
24623
|
-
idx > 0 ? /* @__PURE__ */ (0,
|
|
24624
|
-
/* @__PURE__ */ (0,
|
|
25010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "flex flex-1 items-stretch", children: [
|
|
25011
|
+
idx > 0 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("div", { className: "w-px bg-agg-separator", "aria-hidden": true }) : null,
|
|
25012
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24625
25013
|
"button",
|
|
24626
25014
|
{
|
|
24627
25015
|
type: "button",
|
|
@@ -24636,7 +25024,7 @@ var PositionsActivity = ({
|
|
|
24636
25024
|
)
|
|
24637
25025
|
] }, filter.value);
|
|
24638
25026
|
}) }),
|
|
24639
|
-
/* @__PURE__ */ (0,
|
|
25027
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(
|
|
24640
25028
|
"div",
|
|
24641
25029
|
{
|
|
24642
25030
|
className: "agg-position-search relative flex w-full min-w-0 flex-1",
|
|
@@ -24647,9 +25035,9 @@ var PositionsActivity = ({
|
|
|
24647
25035
|
setIsSearchFocused(false);
|
|
24648
25036
|
},
|
|
24649
25037
|
children: [
|
|
24650
|
-
/* @__PURE__ */ (0,
|
|
24651
|
-
/* @__PURE__ */ (0,
|
|
24652
|
-
/* @__PURE__ */ (0,
|
|
25038
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("label", { className: "flex w-full min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "flex h-11 w-full items-center gap-3 rounded-agg-sm border border-agg-separator bg-agg-secondary px-3 py-2.5 focus-within:border-2 focus-within:border-agg-primary sm:h-10", children: [
|
|
25039
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)(Icon, { name: "search", size: "small", className: "shrink-0 text-agg-muted-foreground" }),
|
|
25040
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24653
25041
|
"input",
|
|
24654
25042
|
{
|
|
24655
25043
|
value: searchValue,
|
|
@@ -24664,7 +25052,7 @@ var PositionsActivity = ({
|
|
|
24664
25052
|
}
|
|
24665
25053
|
)
|
|
24666
25054
|
] }) }),
|
|
24667
|
-
isSearchFocused && searchValue.trim() ? /* @__PURE__ */ (0,
|
|
25055
|
+
isSearchFocused && searchValue.trim() ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("div", { className: "agg-position-search-results absolute left-0 right-0 top-full z-50 mt-1 w-full overflow-hidden rounded-agg-xl border border-agg-separator bg-agg-secondary pt-2 shadow-[0px_8px_16px_0px_rgba(0,0,0,0.1)]", children: searchResults.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24668
25056
|
"ul",
|
|
24669
25057
|
{
|
|
24670
25058
|
className: "agg-position-search-results-list m-0 flex list-none flex-col p-0",
|
|
@@ -24677,26 +25065,26 @@ var PositionsActivity = ({
|
|
|
24677
25065
|
setIsSearchFocused(false);
|
|
24678
25066
|
onPositionClick == null ? void 0 : onPositionClick(item.raw);
|
|
24679
25067
|
};
|
|
24680
|
-
const innerContent = /* @__PURE__ */ (0,
|
|
24681
|
-
/* @__PURE__ */ (0,
|
|
24682
|
-
/* @__PURE__ */ (0,
|
|
25068
|
+
const innerContent = /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(import_jsx_runtime160.Fragment, { children: [
|
|
25069
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-4", children: [
|
|
25070
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24683
25071
|
"img",
|
|
24684
25072
|
{
|
|
24685
|
-
src: (0,
|
|
25073
|
+
src: (0, import_hooks66.optimizedImageUrl)(item.thumbnailSrc, 48),
|
|
24686
25074
|
alt: "",
|
|
24687
25075
|
className: "size-12 shrink-0 rounded-agg-lg object-cover"
|
|
24688
25076
|
}
|
|
24689
25077
|
),
|
|
24690
|
-
/* @__PURE__ */ (0,
|
|
24691
|
-
/* @__PURE__ */ (0,
|
|
24692
|
-
/* @__PURE__ */ (0,
|
|
24693
|
-
/* @__PURE__ */ (0,
|
|
24694
|
-
/* @__PURE__ */ (0,
|
|
24695
|
-
/* @__PURE__ */ (0,
|
|
25078
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
25079
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-base leading-agg-6 font-agg-normal text-agg-foreground", children: item.title }),
|
|
25080
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "flex min-w-0 items-center gap-2 text-agg-muted-foreground", children: [
|
|
25081
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "shrink-0 whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-muted-foreground", children: item.metaPrimary }),
|
|
25082
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("span", { className: "text-agg-muted-foreground", "aria-hidden": true, children: "\xB7" }),
|
|
25083
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-muted-foreground", children: item.metaSecondary })
|
|
24696
25084
|
] })
|
|
24697
25085
|
] })
|
|
24698
25086
|
] }),
|
|
24699
|
-
/* @__PURE__ */ (0,
|
|
25087
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24700
25088
|
Icon,
|
|
24701
25089
|
{
|
|
24702
25090
|
name: "chevron-right",
|
|
@@ -24705,7 +25093,7 @@ var PositionsActivity = ({
|
|
|
24705
25093
|
}
|
|
24706
25094
|
)
|
|
24707
25095
|
] });
|
|
24708
|
-
return /* @__PURE__ */ (0,
|
|
25096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24709
25097
|
"li",
|
|
24710
25098
|
{
|
|
24711
25099
|
role: "presentation",
|
|
@@ -24713,7 +25101,7 @@ var PositionsActivity = ({
|
|
|
24713
25101
|
"agg-position-search-result-item",
|
|
24714
25102
|
index > 0 && "border-t border-agg-separator"
|
|
24715
25103
|
),
|
|
24716
|
-
children: itemHref ? /* @__PURE__ */ (0,
|
|
25104
|
+
children: itemHref ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24717
25105
|
"a",
|
|
24718
25106
|
{
|
|
24719
25107
|
href: itemHref,
|
|
@@ -24728,7 +25116,7 @@ var PositionsActivity = ({
|
|
|
24728
25116
|
},
|
|
24729
25117
|
children: innerContent
|
|
24730
25118
|
}
|
|
24731
|
-
) : /* @__PURE__ */ (0,
|
|
25119
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24732
25120
|
"button",
|
|
24733
25121
|
{
|
|
24734
25122
|
type: "button",
|
|
@@ -24742,34 +25130,34 @@ var PositionsActivity = ({
|
|
|
24742
25130
|
);
|
|
24743
25131
|
})
|
|
24744
25132
|
}
|
|
24745
|
-
) : /* @__PURE__ */ (0,
|
|
25133
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("div", { className: "px-5 py-6 font-agg-sans text-agg-sm leading-agg-5 text-agg-muted-foreground", children: positionsLabels.noResults }) }) : null
|
|
24746
25134
|
]
|
|
24747
25135
|
}
|
|
24748
25136
|
)
|
|
24749
25137
|
] }) : null,
|
|
24750
|
-
/* @__PURE__ */ (0,
|
|
24751
|
-
/* @__PURE__ */ (0,
|
|
24752
|
-
isPositionsTab && filteredPositions.length > 0 ? isClosedPositionsFilter ? /* @__PURE__ */ (0,
|
|
24753
|
-
/* @__PURE__ */ (0,
|
|
24754
|
-
/* @__PURE__ */ (0,
|
|
24755
|
-
/* @__PURE__ */ (0,
|
|
24756
|
-
/* @__PURE__ */ (0,
|
|
24757
|
-
/* @__PURE__ */ (0,
|
|
24758
|
-
/* @__PURE__ */ (0,
|
|
24759
|
-
] }) : /* @__PURE__ */ (0,
|
|
24760
|
-
/* @__PURE__ */ (0,
|
|
24761
|
-
/* @__PURE__ */ (0,
|
|
24762
|
-
/* @__PURE__ */ (0,
|
|
24763
|
-
/* @__PURE__ */ (0,
|
|
24764
|
-
/* @__PURE__ */ (0,
|
|
25138
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "agg-positions-table-wrapper flex w-full gap-0 flex-col", children: [
|
|
25139
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "w-full px-4 sm:px-6", children: [
|
|
25140
|
+
isPositionsTab && filteredPositions.length > 0 ? isClosedPositionsFilter ? /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "hidden items-start gap-8 px-0 md:flex", children: [
|
|
25141
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: positionsLabels.marketHeader }),
|
|
25142
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header w-[90px] shrink-0 lg:w-[120px]", children: positionsLabels.resolutionHeader }),
|
|
25143
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header w-[110px] shrink-0 lg:w-[130px]", children: positionsLabels.totalTradedHeader }),
|
|
25144
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header w-[130px] shrink-0 lg:w-[160px]", children: positionsLabels.payoutHeader }),
|
|
25145
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header w-[60px] shrink-0", children: positionsLabels.resultHeader }),
|
|
25146
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("span", { className: "hidden w-5 shrink-0 sm:block", "aria-hidden": true })
|
|
25147
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "hidden items-start gap-6 px-0 md:flex", children: [
|
|
25148
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: positionsLabels.marketHeader }),
|
|
25149
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header w-[120px] shrink-0 lg:w-[140px]", children: positionsLabels.totalTradedHeader }),
|
|
25150
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header w-[130px] shrink-0 lg:w-[160px]", children: positionsLabels.currentValueHeader }),
|
|
25151
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header w-[100px] shrink-0", children: positionsLabels.statusHeader }),
|
|
25152
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("span", { className: "hidden w-5 shrink-0 sm:block", "aria-hidden": true })
|
|
24765
25153
|
] }) : null,
|
|
24766
|
-
isActivityTab && filteredActivities.length > 0 ? /* @__PURE__ */ (0,
|
|
24767
|
-
/* @__PURE__ */ (0,
|
|
24768
|
-
/* @__PURE__ */ (0,
|
|
24769
|
-
/* @__PURE__ */ (0,
|
|
25154
|
+
isActivityTab && filteredActivities.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "hidden items-start gap-6 px-0 md:flex", children: [
|
|
25155
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header w-22 shrink-0", children: "Type" }),
|
|
25156
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: "Market" }),
|
|
25157
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header w-[120px] shrink-0 text-right", children: "Amount" })
|
|
24770
25158
|
] }) : null
|
|
24771
25159
|
] }),
|
|
24772
|
-
/* @__PURE__ */ (0,
|
|
25160
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24773
25161
|
"div",
|
|
24774
25162
|
{
|
|
24775
25163
|
ref: rowsScrollRef,
|
|
@@ -24781,8 +25169,8 @@ var PositionsActivity = ({
|
|
|
24781
25169
|
"[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-agg-muted-foreground/50",
|
|
24782
25170
|
"[&::-webkit-scrollbar-thumb:hover]:bg-agg-muted-foreground/70"
|
|
24783
25171
|
),
|
|
24784
|
-
children: isPositionsTab ? /* @__PURE__ */ (0,
|
|
24785
|
-
isLoadingPositions && filteredPositions.length === 0 ? /* @__PURE__ */ (0,
|
|
25172
|
+
children: isPositionsTab ? /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "agg-portfolio-list flex flex-col gap-5", children: [
|
|
25173
|
+
isLoadingPositions && filteredPositions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(TabRowsSkeleton, { ariaLabel: "Loading positions" }) : positionsError && filteredPositions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24786
25174
|
EmptyState,
|
|
24787
25175
|
{
|
|
24788
25176
|
title: "Unable to load positions",
|
|
@@ -24790,15 +25178,15 @@ var PositionsActivity = ({
|
|
|
24790
25178
|
}
|
|
24791
25179
|
) : filteredPositions.length > 0 ? filteredPositions.map((position, index) => {
|
|
24792
25180
|
var _a;
|
|
24793
|
-
return /* @__PURE__ */ (0,
|
|
24794
|
-
index > 0 ? /* @__PURE__ */ (0,
|
|
25181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(import_react43.Fragment, { children: [
|
|
25182
|
+
index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24795
25183
|
"div",
|
|
24796
25184
|
{
|
|
24797
25185
|
className: "agg-position-divider h-px w-full shrink-0 bg-agg-separator",
|
|
24798
25186
|
"aria-hidden": true
|
|
24799
25187
|
}
|
|
24800
25188
|
) : null,
|
|
24801
|
-
/* @__PURE__ */ (0,
|
|
25189
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24802
25190
|
PositionRow,
|
|
24803
25191
|
{
|
|
24804
25192
|
position,
|
|
@@ -24812,15 +25200,15 @@ var PositionsActivity = ({
|
|
|
24812
25200
|
}
|
|
24813
25201
|
)
|
|
24814
25202
|
] }, position.id);
|
|
24815
|
-
}) : /* @__PURE__ */ (0,
|
|
25203
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24816
25204
|
EmptyState,
|
|
24817
25205
|
{
|
|
24818
25206
|
title: "No positions yet",
|
|
24819
25207
|
description: "Your open trades will appear here once you place an order."
|
|
24820
25208
|
}
|
|
24821
25209
|
),
|
|
24822
|
-
isLoadingMorePositions ? /* @__PURE__ */ (0,
|
|
24823
|
-
hasMorePositions ? /* @__PURE__ */ (0,
|
|
25210
|
+
isLoadingMorePositions ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(TabRowsSkeleton, { ariaLabel: "Loading more positions" }) : null,
|
|
25211
|
+
hasMorePositions ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24824
25212
|
"div",
|
|
24825
25213
|
{
|
|
24826
25214
|
ref: positionsLoadMoreRef,
|
|
@@ -24828,22 +25216,22 @@ var PositionsActivity = ({
|
|
|
24828
25216
|
"aria-hidden": true
|
|
24829
25217
|
}
|
|
24830
25218
|
) : null
|
|
24831
|
-
] }) : /* @__PURE__ */ (0,
|
|
24832
|
-
isLoadingActivities && filteredActivities.length === 0 ? /* @__PURE__ */ (0,
|
|
25219
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "agg-activity-list flex flex-col gap-5", children: [
|
|
25220
|
+
isLoadingActivities && filteredActivities.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(TabRowsSkeleton, { ariaLabel: "Loading activity" }) : activitiesError && filteredActivities.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24833
25221
|
EmptyState,
|
|
24834
25222
|
{
|
|
24835
25223
|
title: "Unable to load activity",
|
|
24836
25224
|
description: "Please try again in a moment."
|
|
24837
25225
|
}
|
|
24838
|
-
) : filteredActivities.length > 0 ? filteredActivities.map((activity, index) => /* @__PURE__ */ (0,
|
|
24839
|
-
index > 0 ? /* @__PURE__ */ (0,
|
|
25226
|
+
) : filteredActivities.length > 0 ? filteredActivities.map((activity, index) => /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(import_react43.Fragment, { children: [
|
|
25227
|
+
index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24840
25228
|
"div",
|
|
24841
25229
|
{
|
|
24842
25230
|
className: "agg-activity-divider h-px w-full shrink-0 bg-agg-separator",
|
|
24843
25231
|
"aria-hidden": true
|
|
24844
25232
|
}
|
|
24845
25233
|
) : null,
|
|
24846
|
-
/* @__PURE__ */ (0,
|
|
25234
|
+
/* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24847
25235
|
ActivityRow,
|
|
24848
25236
|
{
|
|
24849
25237
|
activity,
|
|
@@ -24851,15 +25239,15 @@ var PositionsActivity = ({
|
|
|
24851
25239
|
onClick: onActivityClick
|
|
24852
25240
|
}
|
|
24853
25241
|
)
|
|
24854
|
-
] }, activity.id)) : /* @__PURE__ */ (0,
|
|
25242
|
+
] }, activity.id)) : /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24855
25243
|
EmptyState,
|
|
24856
25244
|
{
|
|
24857
25245
|
title: "No activity yet",
|
|
24858
25246
|
description: "Your trading activity will appear here."
|
|
24859
25247
|
}
|
|
24860
25248
|
),
|
|
24861
|
-
isLoadingMoreActivities ? /* @__PURE__ */ (0,
|
|
24862
|
-
hasMoreActivities ? /* @__PURE__ */ (0,
|
|
25249
|
+
isLoadingMoreActivities ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(TabRowsSkeleton, { ariaLabel: "Loading more activity" }) : null,
|
|
25250
|
+
hasMoreActivities ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
|
|
24863
25251
|
"div",
|
|
24864
25252
|
{
|
|
24865
25253
|
ref: activitiesLoadMoreRef,
|
|
@@ -24881,14 +25269,14 @@ var PositionsActivity = ({
|
|
|
24881
25269
|
PositionsActivity.displayName = "PositionsActivity";
|
|
24882
25270
|
|
|
24883
25271
|
// src/pages/user-profile/components/positions-value-card.tsx
|
|
24884
|
-
var
|
|
25272
|
+
var import_jsx_runtime161 = require("react/jsx-runtime");
|
|
24885
25273
|
var PositionsValueCard = ({
|
|
24886
25274
|
label: label2 = "Positions Value",
|
|
24887
25275
|
valueLabel,
|
|
24888
25276
|
isLoading = false,
|
|
24889
25277
|
className
|
|
24890
25278
|
}) => {
|
|
24891
|
-
return /* @__PURE__ */ (0,
|
|
25279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime161.jsxs)(
|
|
24892
25280
|
"div",
|
|
24893
25281
|
{
|
|
24894
25282
|
className: cn(
|
|
@@ -24897,8 +25285,8 @@ var PositionsValueCard = ({
|
|
|
24897
25285
|
className
|
|
24898
25286
|
),
|
|
24899
25287
|
children: [
|
|
24900
|
-
/* @__PURE__ */ (0,
|
|
24901
|
-
/* @__PURE__ */ (0,
|
|
25288
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
25289
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
|
|
24902
25290
|
"svg",
|
|
24903
25291
|
{
|
|
24904
25292
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -24906,7 +25294,7 @@ var PositionsValueCard = ({
|
|
|
24906
25294
|
height: "16",
|
|
24907
25295
|
viewBox: "0 0 16 16",
|
|
24908
25296
|
fill: "none",
|
|
24909
|
-
children: /* @__PURE__ */ (0,
|
|
25297
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
|
|
24910
25298
|
"path",
|
|
24911
25299
|
{
|
|
24912
25300
|
d: "M16 7.99957C16 8.36757 15.702 8.66623 15.3333 8.66623H13.6893C13.388 8.66623 13.1233 8.86957 13.0453 9.15957L11.9273 13.3209C11.8 13.7376 11.444 13.9996 11.0333 13.9996H11.022C10.6067 13.9949 10.252 13.7229 10.1393 13.3236L7.95667 4.50623L5.838 11.9989C5.71067 12.3969 5.378 12.6496 4.98467 12.6649C4.57667 12.6869 4.23867 12.4549 4.088 12.0902L3.02133 9.10757C2.926 8.84357 2.674 8.66557 2.39333 8.66557H0.666667C0.298 8.66557 0 8.3669 0 7.9989C0 7.6309 0.298 7.33223 0.666667 7.33223H2.394C3.23667 7.33223 3.99267 7.8649 4.27733 8.65823L4.90267 10.4089L7.092 2.66557C7.226 2.2489 7.57667 1.9809 7.99933 1.9989C8.41133 2.00623 8.76333 2.27757 8.876 2.67357L11.0487 11.4509L11.7567 8.81357C11.9907 7.94157 12.7847 7.33223 13.688 7.33223H15.332C15.7007 7.33223 15.9987 7.6309 15.9987 7.9989L16 7.99957Z",
|
|
@@ -24915,22 +25303,51 @@ var PositionsValueCard = ({
|
|
|
24915
25303
|
)
|
|
24916
25304
|
}
|
|
24917
25305
|
),
|
|
24918
|
-
/* @__PURE__ */ (0,
|
|
25306
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)("span", { className: "font-agg-sans text-agg-base leading-6 font-agg-normal text-agg-foreground", children: label2 })
|
|
24919
25307
|
] }),
|
|
24920
|
-
/* @__PURE__ */ (0,
|
|
25308
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)("div", { className: "agg-portfolio-value font-agg-sans text-agg-2xl leading-8 font-agg-bold text-agg-foreground", children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("div", { role: "status", "aria-label": "Loading positions value", children: /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(SkeletonBlock, { className: "h-8 w-24 rounded-agg-sm" }) }) : valueLabel })
|
|
24921
25309
|
]
|
|
24922
25310
|
}
|
|
24923
25311
|
);
|
|
24924
25312
|
};
|
|
24925
25313
|
PositionsValueCard.displayName = "PositionsValueCard";
|
|
24926
25314
|
|
|
25315
|
+
// src/pages/user-profile/transaction-explorer.ts
|
|
25316
|
+
var AGG_TX_EXPLORER_URLS = {
|
|
25317
|
+
"1": "https://etherscan.io/tx/",
|
|
25318
|
+
"56": "https://bscscan.com/tx/",
|
|
25319
|
+
"137": "https://polygonscan.com/tx/",
|
|
25320
|
+
"1337": "https://app.hyperliquid.xyz/explorer/tx/",
|
|
25321
|
+
"8453": "https://basescan.org/tx/",
|
|
25322
|
+
"42161": "https://arbiscan.io/tx/",
|
|
25323
|
+
"792703809": "https://solscan.io/tx/"
|
|
25324
|
+
};
|
|
25325
|
+
var buildAggTxExplorerHref = (chainId, txHash) => {
|
|
25326
|
+
if (chainId === null || chainId === void 0) return void 0;
|
|
25327
|
+
if (!txHash) return void 0;
|
|
25328
|
+
const normalizedChainId = String(chainId).trim();
|
|
25329
|
+
const normalizedTxHash = txHash.trim();
|
|
25330
|
+
if (!normalizedChainId || !normalizedTxHash) return void 0;
|
|
25331
|
+
const baseUrl = AGG_TX_EXPLORER_URLS[normalizedChainId];
|
|
25332
|
+
if (!baseUrl) return void 0;
|
|
25333
|
+
return `${baseUrl}${normalizedTxHash}`;
|
|
25334
|
+
};
|
|
25335
|
+
|
|
24927
25336
|
// src/pages/user-profile/components/user-info-card.tsx
|
|
24928
|
-
var
|
|
25337
|
+
var import_hooks67 = require("@agg-build/hooks");
|
|
25338
|
+
|
|
25339
|
+
// src/primitives/conditional-wrapper.tsx
|
|
25340
|
+
var ConditionalWrapper = ({
|
|
25341
|
+
condition,
|
|
25342
|
+
wrapper,
|
|
25343
|
+
children
|
|
25344
|
+
}) => condition ? wrapper(children) : children;
|
|
25345
|
+
ConditionalWrapper.displayName = "ConditionalWrapper";
|
|
24929
25346
|
|
|
24930
25347
|
// src/pages/user-profile/components/default-avatar.tsx
|
|
24931
|
-
var
|
|
25348
|
+
var import_jsx_runtime162 = require("react/jsx-runtime");
|
|
24932
25349
|
var DefaultAvatar = ({ className }) => {
|
|
24933
|
-
return /* @__PURE__ */ (0,
|
|
25350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(
|
|
24934
25351
|
"svg",
|
|
24935
25352
|
{
|
|
24936
25353
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -24941,15 +25358,15 @@ var DefaultAvatar = ({ className }) => {
|
|
|
24941
25358
|
className: cn("shrink-0 text-agg-muted-foreground", className),
|
|
24942
25359
|
"aria-hidden": true,
|
|
24943
25360
|
children: [
|
|
24944
|
-
/* @__PURE__ */ (0,
|
|
24945
|
-
/* @__PURE__ */ (0,
|
|
25361
|
+
/* @__PURE__ */ (0, import_jsx_runtime162.jsxs)("g", { clipPath: "url(#clip0_default_avatar)", children: [
|
|
25362
|
+
/* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
|
|
24946
25363
|
"path",
|
|
24947
25364
|
{
|
|
24948
25365
|
d: "M60 120C93.1371 120 120 93.1371 120 60C120 26.8629 93.1371 0 60 0C26.8629 0 0 26.8629 0 60C0 93.1371 26.8629 120 60 120Z",
|
|
24949
25366
|
fill: "var(--agg-color-secondary-hover)"
|
|
24950
25367
|
}
|
|
24951
25368
|
),
|
|
24952
|
-
/* @__PURE__ */ (0,
|
|
25369
|
+
/* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
|
|
24953
25370
|
"path",
|
|
24954
25371
|
{
|
|
24955
25372
|
d: "M60 120C93.1371 120 120 93.1371 120 60C120 26.8629 93.1371 0 60 0C26.8629 0 0 26.8629 0 60C0 93.1371 26.8629 120 60 120Z",
|
|
@@ -24957,7 +25374,7 @@ var DefaultAvatar = ({ className }) => {
|
|
|
24957
25374
|
fillOpacity: "0.12"
|
|
24958
25375
|
}
|
|
24959
25376
|
),
|
|
24960
|
-
/* @__PURE__ */ (0,
|
|
25377
|
+
/* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
|
|
24961
25378
|
"path",
|
|
24962
25379
|
{
|
|
24963
25380
|
d: "M73.7338 64.1259C80.4187 59.6756 84.8276 52.0804 84.8276 43.4487C84.8276 29.7376 73.7111 18.6211 60 18.6211C46.2890 18.6211 35.1724 29.7376 35.1724 43.4487C35.1724 52.0804 39.5814 59.6756 46.2662 64.1259C46.2662 64.1259 46.2683 64.1280 46.2704 64.1280C46.2683 64.1280 46.2683 64.1259 46.2683 64.1259C30.2669 68.9487 17.8076 81.9356 13.7959 98.2742L13.7980 98.2763C14.4518 99.0645 15.1304 99.8342 15.8235 100.589C15.9911 100.774 16.1669 100.949 16.3387 101.129C16.8724 101.696 17.4124 102.255 17.9669 102.801C18.1966 103.027 18.4304 103.244 18.6642 103.465C19.1773 103.954 19.6966 104.436 20.2262 104.905C20.4890 105.137 20.7559 105.367 21.0207 105.594C21.5400 106.039 22.0656 106.476 22.6014 106.902C22.8828 107.127 23.1662 107.349 23.4497 107.570C23.9918 107.988 24.5421 108.394 25.0987 108.791C25.3862 108.996 25.6697 109.205 25.9614 109.405C26.5490 109.811 27.1469 110.200 27.7490 110.585C28.0200 110.756 28.2849 110.934 28.5580 111.104C29.2531 111.532 29.9607 111.942 30.6745 112.343C30.8628 112.449 31.0469 112.562 31.2373 112.666C32.1600 113.171 33.0973 113.655 34.0490 114.112C34.0718 114.122 34.0966 114.133 34.1193 114.143C35.0276 114.578 35.9504 114.989 36.8835 115.378C37.1731 115.500 37.4690 115.608 37.7607 115.724C38.4352 115.993 39.1097 116.258 39.7966 116.502C40.1607 116.632 40.5290 116.750 40.8952 116.874C41.5200 117.085 42.1490 117.290 42.7821 117.478C43.1835 117.598 43.5869 117.710 43.9924 117.822C44.6049 117.991 45.2214 118.153 45.8442 118.304C46.2642 118.405 46.6862 118.502 47.1104 118.596C47.7331 118.732 48.3580 118.856 48.9869 118.972C49.4131 119.051 49.8373 119.131 50.2676 119.200C50.9173 119.305 51.5711 119.394 52.2269 119.479C52.6407 119.533 53.0524 119.593 53.4683 119.636C54.1924 119.715 54.9228 119.771 55.6531 119.822C56.0069 119.847 56.3566 119.885 56.7104 119.903C57.8007 119.965 58.8952 120 60 120C61.1049 120 62.1993 119.965 63.2897 119.907C63.6435 119.889 63.9952 119.851 64.3469 119.827C65.0793 119.775 65.8097 119.719 66.5318 119.640C66.9476 119.595 67.3593 119.537 67.7731 119.483C68.4290 119.398 69.0828 119.309 69.7324 119.204C70.1607 119.134 70.5869 119.055 71.0131 118.976C71.6421 118.860 72.2690 118.736 72.8897 118.600C73.3138 118.507 73.7359 118.409 74.1559 118.308C74.7766 118.157 75.3931 117.996 76.0076 117.826C76.4111 117.714 76.8166 117.602 77.2180 117.482C77.8531 117.292 78.4800 117.087 79.1049 116.878C79.4711 116.754 79.8414 116.636 80.2035 116.506C80.8883 116.260 81.5649 115.997 82.2393 115.728C82.5311 115.612 82.8269 115.502 83.1166 115.382C84.0456 114.994 84.9642 114.586 85.8683 114.151C85.8952 114.139 85.9242 114.127 85.9511 114.114C86.9028 113.657 87.8400 113.173 88.7628 112.668C88.9531 112.565 89.1373 112.451 89.3256 112.345C90.0393 111.944 90.7469 111.534 91.4421 111.106C91.7152 110.938 91.9821 110.760 92.2511 110.587C92.8531 110.202 93.4511 109.811 94.0387 109.407C94.3283 109.207 94.6138 109.000 94.9014 108.793C95.4580 108.394 96.0083 107.988 96.5504 107.572C96.8359 107.353 97.1173 107.129 97.3987 106.904C97.9324 106.478 98.4600 106.041 98.9793 105.596C99.2462 105.369 99.5131 105.139 99.7738 104.907C100.303 104.438 100.823 103.956 101.336 103.467C101.568 103.246 101.803 103.027 102.033 102.803C102.588 102.257 103.130 101.698 103.661 101.131C103.831 100.949 104.007 100.774 104.177 100.591C104.870 99.8363 105.548 99.0666 106.202 98.2783L106.204 98.2763C102.195 81.9356 89.7352 68.9487 73.7338 64.1259Z",
|
|
@@ -24966,7 +25383,7 @@ var DefaultAvatar = ({ className }) => {
|
|
|
24966
25383
|
}
|
|
24967
25384
|
)
|
|
24968
25385
|
] }),
|
|
24969
|
-
/* @__PURE__ */ (0,
|
|
25386
|
+
/* @__PURE__ */ (0, import_jsx_runtime162.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("clipPath", { id: "clip0_default_avatar", children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("rect", { width: "120", height: "120", fill: "white" }) }) })
|
|
24970
25387
|
]
|
|
24971
25388
|
}
|
|
24972
25389
|
);
|
|
@@ -24974,7 +25391,7 @@ var DefaultAvatar = ({ className }) => {
|
|
|
24974
25391
|
DefaultAvatar.displayName = "DefaultAvatar";
|
|
24975
25392
|
|
|
24976
25393
|
// src/pages/user-profile/components/user-info-card.tsx
|
|
24977
|
-
var
|
|
25394
|
+
var import_jsx_runtime163 = require("react/jsx-runtime");
|
|
24978
25395
|
var UserInfoCard = ({
|
|
24979
25396
|
user,
|
|
24980
25397
|
onEditProfile,
|
|
@@ -24984,10 +25401,10 @@ var UserInfoCard = ({
|
|
|
24984
25401
|
className
|
|
24985
25402
|
}) => {
|
|
24986
25403
|
var _a;
|
|
24987
|
-
const labels = (0,
|
|
25404
|
+
const labels = (0, import_hooks67.useLabels)();
|
|
24988
25405
|
const wallets = (_a = user.connectedWallets) != null ? _a : [];
|
|
24989
25406
|
const hasWallets = wallets.length > 0;
|
|
24990
|
-
return /* @__PURE__ */ (0,
|
|
25407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)(
|
|
24991
25408
|
"div",
|
|
24992
25409
|
{
|
|
24993
25410
|
className: cn(
|
|
@@ -24996,26 +25413,26 @@ var UserInfoCard = ({
|
|
|
24996
25413
|
className
|
|
24997
25414
|
),
|
|
24998
25415
|
children: [
|
|
24999
|
-
/* @__PURE__ */ (0,
|
|
25000
|
-
/* @__PURE__ */ (0,
|
|
25416
|
+
/* @__PURE__ */ (0, import_jsx_runtime163.jsxs)("div", { className: "agg-profile-header flex w-full flex-row flex-wrap items-center gap-4 sm:gap-5 pt-5", children: [
|
|
25417
|
+
/* @__PURE__ */ (0, import_jsx_runtime163.jsx)("div", { className: "agg-profile-avatar shrink-0", children: user.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
|
|
25001
25418
|
RemoteImage,
|
|
25002
25419
|
{
|
|
25003
|
-
src: (0,
|
|
25420
|
+
src: (0, import_hooks67.optimizedImageUrl)(user.avatarUrl, 120),
|
|
25004
25421
|
alt: user.username,
|
|
25005
25422
|
className: "h-20 w-20 rounded-full object-cover sm:h-[120px] sm:w-[120px]"
|
|
25006
25423
|
}
|
|
25007
|
-
) : /* @__PURE__ */ (0,
|
|
25008
|
-
/* @__PURE__ */ (0,
|
|
25009
|
-
/* @__PURE__ */ (0,
|
|
25010
|
-
/* @__PURE__ */ (0,
|
|
25011
|
-
/* @__PURE__ */ (0,
|
|
25012
|
-
user.socialLinks && user.socialLinks.length > 0 ? /* @__PURE__ */ (0,
|
|
25424
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(DefaultAvatar, { className: "h-20 w-20 rounded-full sm:h-[120px] sm:w-[120px]" }) }),
|
|
25425
|
+
/* @__PURE__ */ (0, import_jsx_runtime163.jsxs)("div", { className: "agg-profile-details flex min-w-0 w-full flex-1 flex-col gap-3 sm:gap-4", children: [
|
|
25426
|
+
/* @__PURE__ */ (0, import_jsx_runtime163.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-3 sm:gap-4", children: [
|
|
25427
|
+
/* @__PURE__ */ (0, import_jsx_runtime163.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
25428
|
+
/* @__PURE__ */ (0, import_jsx_runtime163.jsx)("h2", { className: "truncate text-[22px] leading-7 font-agg-bold text-agg-foreground sm:agg-type-heading", children: user.username }),
|
|
25429
|
+
user.socialLinks && user.socialLinks.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("div", { className: "agg-profile-social-links flex items-center gap-2", children: user.socialLinks.map((social) => {
|
|
25013
25430
|
const iconName = social.platform === "twitter" ? "twitter" : social.platform === "discord" ? "discord" : "telegram";
|
|
25014
|
-
const iconNode = /* @__PURE__ */ (0,
|
|
25431
|
+
const iconNode = /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("span", { className: "flex size-7 shrink-0 items-center justify-center rounded-full border border-agg-separator bg-agg-secondary sm:size-8", children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(Icon, { name: iconName, size: "small", className: "text-agg-foreground" }) });
|
|
25015
25432
|
if (!social.handle) {
|
|
25016
|
-
return /* @__PURE__ */ (0,
|
|
25433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("span", { children: iconNode }, `${social.platform}-icon`);
|
|
25017
25434
|
}
|
|
25018
|
-
return /* @__PURE__ */ (0,
|
|
25435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
|
|
25019
25436
|
"a",
|
|
25020
25437
|
{
|
|
25021
25438
|
href: social.handle,
|
|
@@ -25028,55 +25445,55 @@ var UserInfoCard = ({
|
|
|
25028
25445
|
);
|
|
25029
25446
|
}) }) : null
|
|
25030
25447
|
] }),
|
|
25031
|
-
onEditProfile ? /* @__PURE__ */ (0,
|
|
25448
|
+
onEditProfile ? /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)(
|
|
25032
25449
|
"button",
|
|
25033
25450
|
{
|
|
25034
25451
|
type: "button",
|
|
25035
25452
|
onClick: onEditProfile,
|
|
25036
25453
|
className: "hidden sm:flex shrink-0 cursor-pointer items-center gap-1.5 bg-transparent text-agg-primary hover:opacity-80",
|
|
25037
25454
|
children: [
|
|
25038
|
-
/* @__PURE__ */ (0,
|
|
25039
|
-
/* @__PURE__ */ (0,
|
|
25455
|
+
/* @__PURE__ */ (0, import_jsx_runtime163.jsx)(Icon, { name: "pencil", size: "small", className: "text-agg-primary" }),
|
|
25456
|
+
/* @__PURE__ */ (0, import_jsx_runtime163.jsx)("span", { className: "text-agg-base font-agg-bold leading-6", children: "Edit" })
|
|
25040
25457
|
]
|
|
25041
25458
|
}
|
|
25042
25459
|
) : null
|
|
25043
25460
|
] }),
|
|
25044
|
-
hasWallets || !!user.socialHandle ? /* @__PURE__ */ (0,
|
|
25461
|
+
hasWallets || !!user.socialHandle ? /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)("div", { className: "agg-profile-accounts flex w-full flex-col gap-2.5 sm:gap-3", children: [
|
|
25045
25462
|
wallets.map((wallet, idx) => {
|
|
25046
25463
|
const chainLower = wallet.chain.toLowerCase();
|
|
25047
25464
|
const iconName = chainLower === "solana" || chainLower === "svm" ? "solana" : "ethereum";
|
|
25048
|
-
return /* @__PURE__ */ (0,
|
|
25465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)(
|
|
25049
25466
|
"div",
|
|
25050
25467
|
{
|
|
25051
25468
|
className: "flex min-w-0 flex-wrap items-center gap-2 sm:gap-3",
|
|
25052
25469
|
children: [
|
|
25053
|
-
/* @__PURE__ */ (0,
|
|
25054
|
-
/* @__PURE__ */ (0,
|
|
25470
|
+
/* @__PURE__ */ (0, import_jsx_runtime163.jsx)("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(Icon, { name: iconName, size: "small", className: "text-agg-foreground" }) }),
|
|
25471
|
+
/* @__PURE__ */ (0, import_jsx_runtime163.jsx)("span", { className: "min-w-0 truncate text-agg-sm font-agg-normal leading-5 text-agg-foreground sm:text-agg-base sm:leading-6", children: wallet.displayAddress })
|
|
25055
25472
|
]
|
|
25056
25473
|
},
|
|
25057
25474
|
`wallet-${idx}`
|
|
25058
25475
|
);
|
|
25059
25476
|
}),
|
|
25060
|
-
user.socialHandle ? /* @__PURE__ */ (0,
|
|
25477
|
+
user.socialHandle ? /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("div", { className: "flex min-w-0 items-center gap-2 sm:gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("span", { className: "min-w-0 truncate text-agg-sm font-agg-normal leading-5 text-agg-foreground sm:text-agg-base sm:leading-6", children: user.socialHandle }) }) : null
|
|
25061
25478
|
] }) : null
|
|
25062
25479
|
] })
|
|
25063
25480
|
] }),
|
|
25064
|
-
(onDeposit || onWithdraw) && /* @__PURE__ */ (0,
|
|
25065
|
-
onDeposit ? /* @__PURE__ */ (0,
|
|
25481
|
+
(onDeposit || onWithdraw) && /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)("div", { className: "agg-profile-actions flex w-full flex-1 items-center gap-3 py-5", children: [
|
|
25482
|
+
onDeposit ? /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
|
|
25066
25483
|
ConditionalWrapper,
|
|
25067
25484
|
{
|
|
25068
25485
|
condition: isDepositBlocked,
|
|
25069
|
-
wrapper: (children) => /* @__PURE__ */ (0,
|
|
25486
|
+
wrapper: (children) => /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
|
|
25070
25487
|
Tooltip,
|
|
25071
25488
|
{
|
|
25072
|
-
content: /* @__PURE__ */ (0,
|
|
25489
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("p", { className: "text-center", children: labels.auth.depositGeoBlocked }),
|
|
25073
25490
|
size: "small",
|
|
25074
25491
|
side: "bottom",
|
|
25075
25492
|
sideOffset: 4,
|
|
25076
25493
|
children
|
|
25077
25494
|
}
|
|
25078
25495
|
),
|
|
25079
|
-
children: /* @__PURE__ */ (0,
|
|
25496
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
|
|
25080
25497
|
Button,
|
|
25081
25498
|
__spreadProps(__spreadValues({
|
|
25082
25499
|
variant: "primary",
|
|
@@ -25088,7 +25505,7 @@ var UserInfoCard = ({
|
|
|
25088
25505
|
)
|
|
25089
25506
|
}
|
|
25090
25507
|
) : null,
|
|
25091
|
-
onWithdraw ? /* @__PURE__ */ (0,
|
|
25508
|
+
onWithdraw ? /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
|
|
25092
25509
|
Button,
|
|
25093
25510
|
{
|
|
25094
25511
|
variant: "secondary",
|
|
@@ -25098,15 +25515,15 @@ var UserInfoCard = ({
|
|
|
25098
25515
|
children: labels.auth.withdraw
|
|
25099
25516
|
}
|
|
25100
25517
|
) : null,
|
|
25101
|
-
onEditProfile ? /* @__PURE__ */ (0,
|
|
25518
|
+
onEditProfile ? /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)(
|
|
25102
25519
|
"button",
|
|
25103
25520
|
{
|
|
25104
25521
|
type: "button",
|
|
25105
25522
|
onClick: onEditProfile,
|
|
25106
25523
|
className: "flex sm:hidden shrink-0 cursor-pointer items-center gap-1.5 bg-transparent px-2 py-2 text-agg-primary hover:opacity-80",
|
|
25107
25524
|
children: [
|
|
25108
|
-
/* @__PURE__ */ (0,
|
|
25109
|
-
/* @__PURE__ */ (0,
|
|
25525
|
+
/* @__PURE__ */ (0, import_jsx_runtime163.jsx)(Icon, { name: "pencil", size: "small", className: "text-agg-primary" }),
|
|
25526
|
+
/* @__PURE__ */ (0, import_jsx_runtime163.jsx)("span", { className: "text-agg-sm font-agg-bold leading-5", children: "Edit" })
|
|
25110
25527
|
]
|
|
25111
25528
|
}
|
|
25112
25529
|
) : null
|
|
@@ -25117,29 +25534,8 @@ var UserInfoCard = ({
|
|
|
25117
25534
|
};
|
|
25118
25535
|
UserInfoCard.displayName = "UserInfoCard";
|
|
25119
25536
|
|
|
25120
|
-
// src/pages/user-profile/transaction-explorer.ts
|
|
25121
|
-
var AGG_TX_EXPLORER_URLS = {
|
|
25122
|
-
"1": "https://etherscan.io/tx/",
|
|
25123
|
-
"56": "https://bscscan.com/tx/",
|
|
25124
|
-
"137": "https://polygonscan.com/tx/",
|
|
25125
|
-
"1337": "https://app.hyperliquid.xyz/explorer/tx/",
|
|
25126
|
-
"8453": "https://basescan.org/tx/",
|
|
25127
|
-
"42161": "https://arbiscan.io/tx/",
|
|
25128
|
-
"792703809": "https://solscan.io/tx/"
|
|
25129
|
-
};
|
|
25130
|
-
var buildAggTxExplorerHref = (chainId, txHash) => {
|
|
25131
|
-
if (chainId === null || chainId === void 0) return void 0;
|
|
25132
|
-
if (!txHash) return void 0;
|
|
25133
|
-
const normalizedChainId = String(chainId).trim();
|
|
25134
|
-
const normalizedTxHash = txHash.trim();
|
|
25135
|
-
if (!normalizedChainId || !normalizedTxHash) return void 0;
|
|
25136
|
-
const baseUrl = AGG_TX_EXPLORER_URLS[normalizedChainId];
|
|
25137
|
-
if (!baseUrl) return void 0;
|
|
25138
|
-
return `${baseUrl}${normalizedTxHash}`;
|
|
25139
|
-
};
|
|
25140
|
-
|
|
25141
25537
|
// src/pages/user-profile/index.tsx
|
|
25142
|
-
var
|
|
25538
|
+
var import_jsx_runtime164 = require("react/jsx-runtime");
|
|
25143
25539
|
var currencyFormatter = new Intl.NumberFormat("en-US", {
|
|
25144
25540
|
style: "currency",
|
|
25145
25541
|
currency: "USD",
|
|
@@ -25470,11 +25866,49 @@ var toRedeemPayoutAmountLabel = (item) => {
|
|
|
25470
25866
|
sign: "+"
|
|
25471
25867
|
});
|
|
25472
25868
|
};
|
|
25869
|
+
var toRedeemTransactionAmountLabel = ({
|
|
25870
|
+
leg,
|
|
25871
|
+
totalPayoutRaw,
|
|
25872
|
+
legCount
|
|
25873
|
+
}) => {
|
|
25874
|
+
var _a;
|
|
25875
|
+
if (legCount === 1 && totalPayoutRaw != null) {
|
|
25876
|
+
return `+${formatScaledNumberTwoDecimals(totalPayoutRaw)} ${leg.payoutTokenSymbol || "USDC"}`;
|
|
25877
|
+
}
|
|
25878
|
+
return toTokenAmountLabel({
|
|
25879
|
+
amountRaw: (_a = leg.payoutAmountRaw) != null ? _a : "0",
|
|
25880
|
+
tokenSymbol: leg.payoutTokenSymbol || "USDC",
|
|
25881
|
+
chainId: leg.chainId,
|
|
25882
|
+
sign: "+"
|
|
25883
|
+
});
|
|
25884
|
+
};
|
|
25885
|
+
var toRedeemTransactions = (item) => {
|
|
25886
|
+
const legs = Array.isArray(item.legs) ? item.legs : [];
|
|
25887
|
+
return legs.map((leg) => {
|
|
25888
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
25889
|
+
return {
|
|
25890
|
+
id: leg.id,
|
|
25891
|
+
venue: leg.venue,
|
|
25892
|
+
chainId: (_a = leg.chainId) != null ? _a : void 0,
|
|
25893
|
+
txHash: (_b = leg.txHash) != null ? _b : void 0,
|
|
25894
|
+
marketTitle: (_d = (_c = leg.venueMarket) == null ? void 0 : _c.question) != null ? _d : "Market",
|
|
25895
|
+
outcomeLabel: (_h = (_g = (_e = leg.venueMarketOutcome) == null ? void 0 : _e.title) != null ? _g : (_f = leg.venueMarketOutcome) == null ? void 0 : _f.label) != null ? _h : "",
|
|
25896
|
+
amountLabel: toRedeemTransactionAmountLabel({
|
|
25897
|
+
leg,
|
|
25898
|
+
totalPayoutRaw: item.totalPayoutRaw,
|
|
25899
|
+
legCount: legs.length
|
|
25900
|
+
}),
|
|
25901
|
+
transactionLabel: (_j = (_i = shortenAddress(leg.txHash)) != null ? _i : leg.txHash) != null ? _j : "Transaction",
|
|
25902
|
+
errorMessage: (_k = leg.errorMessage) != null ? _k : void 0,
|
|
25903
|
+
hasError: TRANSFER_FAILED_STATUSES.has(leg.status.toLowerCase()) || Boolean((_l = leg.errorMessage) == null ? void 0 : _l.trim())
|
|
25904
|
+
};
|
|
25905
|
+
});
|
|
25906
|
+
};
|
|
25473
25907
|
var POSITION_ROW_VENUE_ORDER = [
|
|
25474
|
-
|
|
25475
|
-
|
|
25476
|
-
|
|
25477
|
-
|
|
25908
|
+
import_sdk20.Venue.polymarket,
|
|
25909
|
+
import_sdk20.Venue.kalshi,
|
|
25910
|
+
import_sdk20.Venue.opinion,
|
|
25911
|
+
import_sdk20.Venue.limitless
|
|
25478
25912
|
];
|
|
25479
25913
|
function venueBreakdownSortKey(venue) {
|
|
25480
25914
|
const idx = POSITION_ROW_VENUE_ORDER.indexOf(venue);
|
|
@@ -25549,15 +25983,15 @@ var UserProfilePage = ({
|
|
|
25549
25983
|
(0, import_react44.useEffect)(() => {
|
|
25550
25984
|
setIsHydrated(true);
|
|
25551
25985
|
}, []);
|
|
25552
|
-
const { user: currentUser, isAuthenticated } = (0,
|
|
25553
|
-
const { isDepositBlocked } = (0,
|
|
25554
|
-
const balanceState = (0,
|
|
25555
|
-
const client = (0,
|
|
25556
|
-
const labels = (0,
|
|
25986
|
+
const { user: currentUser, isAuthenticated } = (0, import_hooks68.useAggAuthState)();
|
|
25987
|
+
const { isDepositBlocked } = (0, import_hooks68.useGeoBlock)();
|
|
25988
|
+
const balanceState = (0, import_hooks68.useAggBalance)();
|
|
25989
|
+
const client = (0, import_hooks68.useAggClient)();
|
|
25990
|
+
const labels = (0, import_hooks68.useLabels)();
|
|
25557
25991
|
const {
|
|
25558
25992
|
trading: { executionMode: configuredExecutionMode }
|
|
25559
|
-
} = (0,
|
|
25560
|
-
const queryClient = (0,
|
|
25993
|
+
} = (0, import_hooks68.useSdkUiConfig)();
|
|
25994
|
+
const queryClient = (0, import_hooks68.useQueryClient)();
|
|
25561
25995
|
const [internalCancellingIds, setInternalCancellingIds] = (0, import_react44.useState)({});
|
|
25562
25996
|
const { claim: startClaim, claimingKeys } = useClaimWinnings({
|
|
25563
25997
|
onClaim,
|
|
@@ -25574,15 +26008,16 @@ var UserProfilePage = ({
|
|
|
25574
26008
|
return [...new Set(fromBalance)].sort((a, b) => a.localeCompare(b));
|
|
25575
26009
|
}, [balanceState, shouldUseHookData]);
|
|
25576
26010
|
const [positionFilter, setPositionFilter] = (0, import_react44.useState)(initialPositionFilter);
|
|
26011
|
+
const [selectedClaimActivity, setSelectedClaimActivity] = (0, import_react44.useState)(null);
|
|
25577
26012
|
const resolvedExecutionMode = executionMode != null ? executionMode : configuredExecutionMode;
|
|
25578
26013
|
const queryExecutionMode = resolvedExecutionMode === "paper" ? "paper" : void 0;
|
|
25579
|
-
const activePositionsQuery = (0,
|
|
26014
|
+
const activePositionsQuery = (0, import_hooks68.useExecutionPositions)({
|
|
25580
26015
|
enabled: shouldUseHookData && isAuthenticated,
|
|
25581
26016
|
status: "active",
|
|
25582
26017
|
limit: 25,
|
|
25583
26018
|
mode: queryExecutionMode
|
|
25584
26019
|
});
|
|
25585
|
-
const closedPositionsQuery = (0,
|
|
26020
|
+
const closedPositionsQuery = (0, import_hooks68.useExecutionPositions)({
|
|
25586
26021
|
enabled: shouldUseHookData && isAuthenticated,
|
|
25587
26022
|
status: "closed",
|
|
25588
26023
|
limit: 25,
|
|
@@ -25598,12 +26033,12 @@ var UserProfilePage = ({
|
|
|
25598
26033
|
(0, import_react44.useEffect)(() => {
|
|
25599
26034
|
setPositionFilter(initialPositionFilter);
|
|
25600
26035
|
}, [initialPositionFilter]);
|
|
25601
|
-
const ordersQuery = (0,
|
|
26036
|
+
const ordersQuery = (0, import_hooks68.useExecutionOrders)({
|
|
25602
26037
|
enabled: shouldUseHookData && isAuthenticated,
|
|
25603
26038
|
limit: 25,
|
|
25604
26039
|
mode: queryExecutionMode
|
|
25605
26040
|
});
|
|
25606
|
-
const activityQuery = (0,
|
|
26041
|
+
const activityQuery = (0, import_hooks68.useUserActivity)({
|
|
25607
26042
|
enabled: shouldUseHookData && isAuthenticated,
|
|
25608
26043
|
limit: 25
|
|
25609
26044
|
});
|
|
@@ -25638,6 +26073,22 @@ var UserProfilePage = ({
|
|
|
25638
26073
|
},
|
|
25639
26074
|
[startClaim]
|
|
25640
26075
|
);
|
|
26076
|
+
const handleActivityRowClick = (0, import_react44.useCallback)(
|
|
26077
|
+
(activity) => {
|
|
26078
|
+
if (activity.kind === "redeem") {
|
|
26079
|
+
setSelectedClaimActivity(activity);
|
|
26080
|
+
return;
|
|
26081
|
+
}
|
|
26082
|
+
onActivityClick == null ? void 0 : onActivityClick(activity);
|
|
26083
|
+
},
|
|
26084
|
+
[onActivityClick]
|
|
26085
|
+
);
|
|
26086
|
+
const handleClaimTransactionSelect = (0, import_react44.useCallback)((transaction) => {
|
|
26087
|
+
const href = buildAggTxExplorerHref(transaction.chainId, transaction.txHash);
|
|
26088
|
+
setSelectedClaimActivity(null);
|
|
26089
|
+
if (!href || typeof window === "undefined") return;
|
|
26090
|
+
window.open(href, "_blank", "noopener,noreferrer");
|
|
26091
|
+
}, []);
|
|
25641
26092
|
(0, import_react44.useEffect)(() => {
|
|
25642
26093
|
if (!shouldUseHookData || !isAuthenticated) {
|
|
25643
26094
|
setProfileUser(void 0);
|
|
@@ -25661,7 +26112,7 @@ var UserProfilePage = ({
|
|
|
25661
26112
|
var _a, _b, _c, _d, _e, _f;
|
|
25662
26113
|
if (user) return user;
|
|
25663
26114
|
const fullUser = profileUser != null ? profileUser : currentUser;
|
|
25664
|
-
const walletAddress = (0,
|
|
26115
|
+
const walletAddress = (0, import_hooks68.getWalletAddressFromUserProfile)(fullUser);
|
|
25665
26116
|
const fallbackUsername = walletAddress && shortenAddress(walletAddress) || "username";
|
|
25666
26117
|
const twitterAccount = (_a = fullUser == null ? void 0 : fullUser.accounts) == null ? void 0 : _a.find(
|
|
25667
26118
|
(account) => String(account.provider).toLowerCase() === "twitter"
|
|
@@ -25831,6 +26282,7 @@ var UserProfilePage = ({
|
|
|
25831
26282
|
const isFailed = status === "failed";
|
|
25832
26283
|
const hasError = isFailed || !!(errorMessage == null ? void 0 : errorMessage.trim());
|
|
25833
26284
|
const titleByStatus = labels.userProfile.activity.redeemStatusTitles;
|
|
26285
|
+
const transactions = toRedeemTransactions(redeemItem);
|
|
25834
26286
|
return {
|
|
25835
26287
|
kind: "redeem",
|
|
25836
26288
|
id: redeemItem.id,
|
|
@@ -25846,7 +26298,8 @@ var UserProfilePage = ({
|
|
|
25846
26298
|
marketTitle: (_C = (_B = firstLeg == null ? void 0 : firstLeg.venueMarket) == null ? void 0 : _B.question) != null ? _C : "Market",
|
|
25847
26299
|
outcomeLabel: (_G = (_F = (_D = firstLeg == null ? void 0 : firstLeg.venueMarketOutcome) == null ? void 0 : _D.title) != null ? _F : (_E = firstLeg == null ? void 0 : firstLeg.venueMarketOutcome) == null ? void 0 : _E.label) != null ? _G : "",
|
|
25848
26300
|
amountLabel: status === "failed" || status === "canceled" ? ZERO_AMOUNT_LABEL : toRedeemPayoutAmountLabel(redeemItem),
|
|
25849
|
-
timeLabel
|
|
26301
|
+
timeLabel,
|
|
26302
|
+
transactions
|
|
25850
26303
|
};
|
|
25851
26304
|
}
|
|
25852
26305
|
logUnknownActivityType(item);
|
|
@@ -25883,7 +26336,7 @@ var UserProfilePage = ({
|
|
|
25883
26336
|
(groups) => {
|
|
25884
26337
|
return groups.flatMap((group) => {
|
|
25885
26338
|
var _a, _b, _c, _d;
|
|
25886
|
-
const closedTotals = (0,
|
|
26339
|
+
const closedTotals = (0, import_hooks68.computeClosedPositionTotals)(group);
|
|
25887
26340
|
const winningOutcome = group.venueMarket.venueMarketOutcomes.find(
|
|
25888
26341
|
(outcome) => outcome.winner === true
|
|
25889
26342
|
);
|
|
@@ -25957,7 +26410,7 @@ var UserProfilePage = ({
|
|
|
25957
26410
|
const source = closedPositions != null ? closedPositions : adaptPositionGroups(closedPositionsQuery.positions);
|
|
25958
26411
|
return source.filter(shouldIncludeByShares);
|
|
25959
26412
|
}, [closedPositions, closedPositionsQuery.positions, adaptPositionGroups]);
|
|
25960
|
-
return /* @__PURE__ */ (0,
|
|
26413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(AggErrorBoundary, { onError, children: /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
|
|
25961
26414
|
"section",
|
|
25962
26415
|
{
|
|
25963
26416
|
className: cn(
|
|
@@ -25965,7 +26418,7 @@ var UserProfilePage = ({
|
|
|
25965
26418
|
"w-full mx-auto px-6 lg:px-10 pb-10 max-w-[1440px]",
|
|
25966
26419
|
classNames == null ? void 0 : classNames.root
|
|
25967
26420
|
),
|
|
25968
|
-
children: /* @__PURE__ */ (0,
|
|
26421
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime164.jsxs)(
|
|
25969
26422
|
"div",
|
|
25970
26423
|
{
|
|
25971
26424
|
className: cn(
|
|
@@ -25975,8 +26428,8 @@ var UserProfilePage = ({
|
|
|
25975
26428
|
classNames == null ? void 0 : classNames.topRow
|
|
25976
26429
|
),
|
|
25977
26430
|
children: [
|
|
25978
|
-
/* @__PURE__ */ (0,
|
|
25979
|
-
/* @__PURE__ */ (0,
|
|
26431
|
+
/* @__PURE__ */ (0, import_jsx_runtime164.jsxs)("div", { className: "agg-profile-summary grid grid-cols-1 gap-6 lg:grid-cols-[1fr_minmax(300px,420px)] lg:items-stretch lg:gap-8", children: [
|
|
26432
|
+
/* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
|
|
25980
26433
|
"div",
|
|
25981
26434
|
{
|
|
25982
26435
|
className: cn(
|
|
@@ -25984,7 +26437,7 @@ var UserProfilePage = ({
|
|
|
25984
26437
|
"flex min-w-0 flex-1 flex-col gap-4 sm:gap-6 h-full",
|
|
25985
26438
|
classNames == null ? void 0 : classNames.leftColumn
|
|
25986
26439
|
),
|
|
25987
|
-
children: /* @__PURE__ */ (0,
|
|
26440
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
|
|
25988
26441
|
UserInfoCard,
|
|
25989
26442
|
{
|
|
25990
26443
|
user: resolvedUser,
|
|
@@ -25997,7 +26450,7 @@ var UserProfilePage = ({
|
|
|
25997
26450
|
)
|
|
25998
26451
|
}
|
|
25999
26452
|
),
|
|
26000
|
-
/* @__PURE__ */ (0,
|
|
26453
|
+
/* @__PURE__ */ (0, import_jsx_runtime164.jsxs)(
|
|
26001
26454
|
"div",
|
|
26002
26455
|
{
|
|
26003
26456
|
className: cn(
|
|
@@ -26005,14 +26458,14 @@ var UserProfilePage = ({
|
|
|
26005
26458
|
classNames == null ? void 0 : classNames.rightColumn
|
|
26006
26459
|
),
|
|
26007
26460
|
children: [
|
|
26008
|
-
/* @__PURE__ */ (0,
|
|
26461
|
+
/* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
|
|
26009
26462
|
PositionsValueCard,
|
|
26010
26463
|
{
|
|
26011
26464
|
valueLabel: positionsValueLabel,
|
|
26012
26465
|
isLoading: isPositionsValueLoading
|
|
26013
26466
|
}
|
|
26014
26467
|
),
|
|
26015
|
-
/* @__PURE__ */ (0,
|
|
26468
|
+
/* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
|
|
26016
26469
|
AvailableBalanceCard,
|
|
26017
26470
|
{
|
|
26018
26471
|
valueLabel: availableBalanceLabel,
|
|
@@ -26030,7 +26483,7 @@ var UserProfilePage = ({
|
|
|
26030
26483
|
}
|
|
26031
26484
|
)
|
|
26032
26485
|
] }),
|
|
26033
|
-
/* @__PURE__ */ (0,
|
|
26486
|
+
/* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
|
|
26034
26487
|
PositionsActivity,
|
|
26035
26488
|
{
|
|
26036
26489
|
tab,
|
|
@@ -26043,8 +26496,11 @@ var UserProfilePage = ({
|
|
|
26043
26496
|
getPositionHref,
|
|
26044
26497
|
onClaim: handleClaimPosition,
|
|
26045
26498
|
claimingPositionKeys: claimingKeys,
|
|
26046
|
-
onActivityClick,
|
|
26047
|
-
getActivityHref
|
|
26499
|
+
onActivityClick: handleActivityRowClick,
|
|
26500
|
+
getActivityHref: (activity) => {
|
|
26501
|
+
if (activity.kind === "redeem") return void 0;
|
|
26502
|
+
return getActivityHref == null ? void 0 : getActivityHref(activity);
|
|
26503
|
+
},
|
|
26048
26504
|
onOpenOrderClick,
|
|
26049
26505
|
onCancelOrder: handleCancelOrder,
|
|
26050
26506
|
cancellingOrderIds: cancellingOrderIds != null ? cancellingOrderIds : internalCancellingIds,
|
|
@@ -26078,6 +26534,17 @@ var UserProfilePage = ({
|
|
|
26078
26534
|
} : void 0,
|
|
26079
26535
|
className: classNames == null ? void 0 : classNames.positionsActivity
|
|
26080
26536
|
}
|
|
26537
|
+
),
|
|
26538
|
+
/* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
|
|
26539
|
+
ClaimActivityBreakdownModal,
|
|
26540
|
+
{
|
|
26541
|
+
activity: selectedClaimActivity,
|
|
26542
|
+
onOpenChange: (open) => {
|
|
26543
|
+
if (open) return;
|
|
26544
|
+
setSelectedClaimActivity(null);
|
|
26545
|
+
},
|
|
26546
|
+
onTransactionSelect: handleClaimTransactionSelect
|
|
26547
|
+
}
|
|
26081
26548
|
)
|
|
26082
26549
|
]
|
|
26083
26550
|
}
|