@agg-build/ui 4.10.0 → 4.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-SMQRUNMZ.mjs → chunk-CHM6SCOY.mjs} +2 -2
- package/dist/{chunk-H5LCCV2J.mjs → chunk-EYJS45RP.mjs} +13 -1
- package/dist/{chunk-4HTE5IEZ.mjs → chunk-NCWBKC5C.mjs} +20 -1
- package/dist/events.js +31 -19
- package/dist/events.mjs +1 -1
- package/dist/index.js +283 -252
- package/dist/index.mjs +3 -3
- package/dist/pages.js +305 -274
- package/dist/pages.mjs +3 -3
- package/dist/trading.js +20 -1
- package/dist/trading.mjs +1 -1
- package/dist/types/events/list/event-list.constants.d.mts +1 -1
- package/dist/types/events/list/event-list.constants.d.ts +1 -1
- package/package.json +3 -3
package/dist/pages.js
CHANGED
|
@@ -101,7 +101,7 @@ __export(pages_exports, {
|
|
|
101
101
|
module.exports = __toCommonJS(pages_exports);
|
|
102
102
|
|
|
103
103
|
// src/pages/home/index.tsx
|
|
104
|
-
var
|
|
104
|
+
var import_hooks75 = require("@agg-build/hooks");
|
|
105
105
|
var import_sdk25 = require("@agg-build/sdk");
|
|
106
106
|
var import_react48 = require("react");
|
|
107
107
|
|
|
@@ -10548,7 +10548,7 @@ var EventListItemV2 = (props) => {
|
|
|
10548
10548
|
EventListItemV2.displayName = "EventListItemV2";
|
|
10549
10549
|
|
|
10550
10550
|
// src/events/list/index.tsx
|
|
10551
|
-
var
|
|
10551
|
+
var import_hooks41 = require("@agg-build/hooks");
|
|
10552
10552
|
var import_sdk16 = require("@agg-build/sdk");
|
|
10553
10553
|
var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
|
|
10554
10554
|
var import_react18 = require("react");
|
|
@@ -10671,11 +10671,12 @@ var CategorySidebar = ({
|
|
|
10671
10671
|
CategorySidebar.displayName = "CategorySidebar";
|
|
10672
10672
|
|
|
10673
10673
|
// src/events/list/event-list-tabs.tsx
|
|
10674
|
-
var
|
|
10674
|
+
var import_hooks40 = require("@agg-build/hooks");
|
|
10675
10675
|
var import_sdk15 = require("@agg-build/sdk");
|
|
10676
10676
|
var import_react17 = require("react");
|
|
10677
10677
|
|
|
10678
10678
|
// src/events/list/event-list.constants.ts
|
|
10679
|
+
var import_hooks39 = require("@agg-build/hooks");
|
|
10679
10680
|
var import_sdk14 = require("@agg-build/sdk");
|
|
10680
10681
|
var DEFAULT_EVENTS_LIMIT = 50;
|
|
10681
10682
|
var DEFAULT_EVENT_LIST_SORT = "volume24hr";
|
|
@@ -10686,7 +10687,7 @@ var EVENT_LIST_SORT_VALUES = [
|
|
|
10686
10687
|
"endDate"
|
|
10687
10688
|
];
|
|
10688
10689
|
var getDefaultEventListTabs = (labels) => {
|
|
10689
|
-
|
|
10690
|
+
const tabs = [
|
|
10690
10691
|
{
|
|
10691
10692
|
value: "matched",
|
|
10692
10693
|
label: labels.eventList.matchedTab,
|
|
@@ -10762,6 +10763,17 @@ var getDefaultEventListTabs = (labels) => {
|
|
|
10762
10763
|
isComingSoon: true
|
|
10763
10764
|
}
|
|
10764
10765
|
];
|
|
10766
|
+
const venueRank = new Map(
|
|
10767
|
+
(0, import_hooks39.sortVenues)(tabs.flatMap((tab) => tab.venueLogo ? [tab.venueLogo] : [])).map((venue, i) => [
|
|
10768
|
+
venue,
|
|
10769
|
+
i
|
|
10770
|
+
])
|
|
10771
|
+
);
|
|
10772
|
+
const rank = (tab) => {
|
|
10773
|
+
var _a;
|
|
10774
|
+
return tab.venueLogo ? 1 + ((_a = venueRank.get(tab.venueLogo)) != null ? _a : venueRank.size) : 0;
|
|
10775
|
+
};
|
|
10776
|
+
return [...tabs].sort((a, b) => rank(a) - rank(b));
|
|
10765
10777
|
};
|
|
10766
10778
|
|
|
10767
10779
|
// src/events/list/event-list-tabs.tsx
|
|
@@ -10785,14 +10797,14 @@ var renderTabIcon = (tab, isActive) => {
|
|
|
10785
10797
|
);
|
|
10786
10798
|
};
|
|
10787
10799
|
var useEventListTabs = (tabs) => {
|
|
10788
|
-
const labels = (0,
|
|
10789
|
-
const { disabledVenues, isLoading: isAppConfigLoading } = (0,
|
|
10790
|
-
const { isLocationBlocked } = (0,
|
|
10800
|
+
const labels = (0, import_hooks40.useLabels)();
|
|
10801
|
+
const { disabledVenues, isLoading: isAppConfigLoading } = (0, import_hooks40.useAppConfig)();
|
|
10802
|
+
const { isLocationBlocked } = (0, import_hooks40.useGeoBlock)();
|
|
10791
10803
|
return (0, import_react17.useMemo)(() => {
|
|
10792
10804
|
const baseTabs = tabs != null ? tabs : getDefaultEventListTabs(labels);
|
|
10793
10805
|
return baseTabs.flatMap((tab) => {
|
|
10794
10806
|
if (!tab.venueLogo) return [tab];
|
|
10795
|
-
const availabilityState = (0,
|
|
10807
|
+
const availabilityState = (0, import_hooks40.getVenueAvailabilityState)({
|
|
10796
10808
|
venueId: tab.venueLogo,
|
|
10797
10809
|
disabledVenues,
|
|
10798
10810
|
// A globally inactive or default-disabled venue is hidden until
|
|
@@ -10987,15 +10999,15 @@ var EventList = ({
|
|
|
10987
10999
|
stateRef
|
|
10988
11000
|
}) => {
|
|
10989
11001
|
var _a, _b, _c, _d, _e, _f;
|
|
10990
|
-
const labels = (0,
|
|
10991
|
-
const { disabledVenues } = (0,
|
|
11002
|
+
const labels = (0, import_hooks41.useLabels)();
|
|
11003
|
+
const { disabledVenues } = (0, import_hooks41.useAppConfig)();
|
|
10992
11004
|
const {
|
|
10993
11005
|
features: { enableVenueEventDiscoveryFilters, showSportsMarkets }
|
|
10994
|
-
} = (0,
|
|
11006
|
+
} = (0, import_hooks41.useSdkUiConfig)();
|
|
10995
11007
|
const isDiscoveryFiltersEnabled = enableVenueEventDiscoveryFilters && !search;
|
|
10996
11008
|
const resolvedTabs = useEventListTabs();
|
|
10997
11009
|
const visibleVenues = (0, import_react18.useMemo)(
|
|
10998
|
-
() => disabledVenues.length === 0 ? void 0 : (0,
|
|
11010
|
+
() => disabledVenues.length === 0 ? void 0 : (0, import_hooks41.getVisibleVenueIdsByConfig)(import_sdk16.VENUES, disabledVenues),
|
|
10999
11011
|
[disabledVenues]
|
|
11000
11012
|
);
|
|
11001
11013
|
const [internalActiveTabValue, setInternalActiveTabValue] = (0, import_react18.useState)(
|
|
@@ -11064,7 +11076,7 @@ var EventList = ({
|
|
|
11064
11076
|
if (controlledCategoryPath == null) setInternalCategoryPath([]);
|
|
11065
11077
|
setCollapsedCategoryIds(/* @__PURE__ */ new Set());
|
|
11066
11078
|
}, [baseCategoryId, controlledCategoryPath, isDiscoveryFiltersEnabled]);
|
|
11067
|
-
const { categories: topLevelCategories } = (0,
|
|
11079
|
+
const { categories: topLevelCategories } = (0, import_hooks41.useCategories)({
|
|
11068
11080
|
queryKeyScope: "event-list-top-categories",
|
|
11069
11081
|
enabled: isDiscoveryFiltersEnabled,
|
|
11070
11082
|
limit: 100
|
|
@@ -11081,7 +11093,7 @@ var EventList = ({
|
|
|
11081
11093
|
])
|
|
11082
11094
|
);
|
|
11083
11095
|
}, [baseCategoryId, categoryPath, sortedTopLevelCategories]);
|
|
11084
|
-
const { childrenByParentId: baseChildrenByParentId, isLoading: isBaseCategoryChildrenLoading } = (0,
|
|
11096
|
+
const { childrenByParentId: baseChildrenByParentId, isLoading: isBaseCategoryChildrenLoading } = (0, import_hooks41.useCategoryChildren)({
|
|
11085
11097
|
queryKeyScope: "event-list-category-children",
|
|
11086
11098
|
enabled: isDiscoveryFiltersEnabled,
|
|
11087
11099
|
parentIds: baseCategoryChildPrefetchIds,
|
|
@@ -11102,7 +11114,7 @@ var EventList = ({
|
|
|
11102
11114
|
}
|
|
11103
11115
|
return Array.from(ids);
|
|
11104
11116
|
}, [baseCategoryId, baseChildrenByParentId, categoryPath]);
|
|
11105
|
-
const { childrenByParentId: visibleChildrenByParentId } = (0,
|
|
11117
|
+
const { childrenByParentId: visibleChildrenByParentId } = (0, import_hooks41.useCategoryChildren)({
|
|
11106
11118
|
queryKeyScope: "event-list-category-children",
|
|
11107
11119
|
enabled: isDiscoveryFiltersEnabled,
|
|
11108
11120
|
parentIds: visibleChildPrefetchIds,
|
|
@@ -11118,7 +11130,7 @@ var EventList = ({
|
|
|
11118
11130
|
}
|
|
11119
11131
|
return Array.from(ids);
|
|
11120
11132
|
}, [categoryPath, visibleChildrenByParentId]);
|
|
11121
|
-
const { childrenByParentId: visibleGrandchildrenByParentId } = (0,
|
|
11133
|
+
const { childrenByParentId: visibleGrandchildrenByParentId } = (0, import_hooks41.useCategoryChildren)({
|
|
11122
11134
|
queryKeyScope: "event-list-category-children",
|
|
11123
11135
|
enabled: isDiscoveryFiltersEnabled,
|
|
11124
11136
|
parentIds: visibleGrandchildPrefetchIds,
|
|
@@ -11203,14 +11215,14 @@ var EventList = ({
|
|
|
11203
11215
|
isFetchingNextPage,
|
|
11204
11216
|
isPlaceholderData,
|
|
11205
11217
|
loadedPageCount
|
|
11206
|
-
} = (0,
|
|
11218
|
+
} = (0, import_hooks41.useVenueEvents)({
|
|
11207
11219
|
queryKeyScope: "event-list",
|
|
11208
11220
|
venues,
|
|
11209
11221
|
search,
|
|
11210
11222
|
categoryIds: resolvedCategoryIds,
|
|
11211
11223
|
matchStatus,
|
|
11212
11224
|
limit: requestLimit,
|
|
11213
|
-
status: [
|
|
11225
|
+
status: [import_hooks41.MarketStatus.open],
|
|
11214
11226
|
sortBy: sortQueryParams.sortBy,
|
|
11215
11227
|
sortDir: sortQueryParams.sortDir,
|
|
11216
11228
|
endDateFrom,
|
|
@@ -11246,7 +11258,7 @@ var EventList = ({
|
|
|
11246
11258
|
const visibleMidpointVenueMarketIds = (0, import_react18.useMemo)(() => {
|
|
11247
11259
|
return collectMidpointVenueMarketIds(visibleVenueMarkets);
|
|
11248
11260
|
}, [visibleVenueMarkets]);
|
|
11249
|
-
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0,
|
|
11261
|
+
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0, import_hooks41.useVenueMarketMidpoints)({
|
|
11250
11262
|
venueMarketIds: visibleMidpointVenueMarketIds,
|
|
11251
11263
|
enabled: visibleMidpointVenueMarketIds.length > 0
|
|
11252
11264
|
});
|
|
@@ -11427,7 +11439,7 @@ var EventList = ({
|
|
|
11427
11439
|
onMarketClick,
|
|
11428
11440
|
getMarketHref,
|
|
11429
11441
|
href: getEventHref == null ? void 0 : getEventHref(event),
|
|
11430
|
-
marketStatus:
|
|
11442
|
+
marketStatus: import_hooks41.MarketStatus.open
|
|
11431
11443
|
},
|
|
11432
11444
|
event.id
|
|
11433
11445
|
)),
|
|
@@ -11507,15 +11519,15 @@ var EventList = ({
|
|
|
11507
11519
|
EventList.displayName = "EventList";
|
|
11508
11520
|
|
|
11509
11521
|
// src/pages/event-market/index.tsx
|
|
11510
|
-
var
|
|
11522
|
+
var import_hooks74 = require("@agg-build/hooks");
|
|
11511
11523
|
var import_react45 = require("react");
|
|
11512
11524
|
|
|
11513
11525
|
// src/events/item-details/index.tsx
|
|
11514
|
-
var
|
|
11526
|
+
var import_hooks51 = require("@agg-build/hooks");
|
|
11515
11527
|
var import_react25 = require("react");
|
|
11516
11528
|
|
|
11517
11529
|
// src/primitives/chart/chart-type-switch.tsx
|
|
11518
|
-
var
|
|
11530
|
+
var import_hooks42 = require("@agg-build/hooks");
|
|
11519
11531
|
var import_react19 = require("react");
|
|
11520
11532
|
|
|
11521
11533
|
// src/primitives/chart/chart-type-switch.constants.ts
|
|
@@ -11547,7 +11559,7 @@ var ChartTypeSwitch = ({
|
|
|
11547
11559
|
onValueChange,
|
|
11548
11560
|
className
|
|
11549
11561
|
}) => {
|
|
11550
|
-
const labels = (0,
|
|
11562
|
+
const labels = (0, import_hooks42.useLabels)();
|
|
11551
11563
|
const options = (0, import_react19.useMemo)(
|
|
11552
11564
|
() => CHART_TYPE_SWITCH_OPTION_KEYS.map((chartType) => ({
|
|
11553
11565
|
value: chartType,
|
|
@@ -11623,7 +11635,7 @@ var ChartTypeSwitch = ({
|
|
|
11623
11635
|
ChartTypeSwitch.displayName = "ChartTypeSwitch";
|
|
11624
11636
|
|
|
11625
11637
|
// src/trading/trading-context/index.tsx
|
|
11626
|
-
var
|
|
11638
|
+
var import_hooks43 = require("@agg-build/hooks");
|
|
11627
11639
|
|
|
11628
11640
|
// src/events/market-details/market-details.utils.ts
|
|
11629
11641
|
var import_sdk18 = require("@agg-build/sdk");
|
|
@@ -12329,7 +12341,7 @@ var buildMarketDetailsModel = ({
|
|
|
12329
12341
|
};
|
|
12330
12342
|
|
|
12331
12343
|
// src/events/market-details/orderbook-aggregation.ts
|
|
12332
|
-
var
|
|
12344
|
+
var import_hooks44 = require("@agg-build/hooks");
|
|
12333
12345
|
var PRICE_PRECISION = 1e6;
|
|
12334
12346
|
var SIZE_PRECISION = 1e8;
|
|
12335
12347
|
var POSITIVE_OUTCOME_KEYS = /* @__PURE__ */ new Set(["yes", "y", "true", "up", "buy", "long"]);
|
|
@@ -12450,7 +12462,7 @@ var buildRowsFromAccumulator = ({
|
|
|
12450
12462
|
const venueBreakdown = Object.fromEntries(
|
|
12451
12463
|
Object.entries(level.venueBreakdownScaled).filter(([, scaledSize]) => scaledSize > 0).map(([venue2, scaledSize]) => [venue2, fromScaled(scaledSize, SIZE_PRECISION)])
|
|
12452
12464
|
);
|
|
12453
|
-
const resolvedFallbackVenue = fallbackVenue != null ? fallbackVenue :
|
|
12465
|
+
const resolvedFallbackVenue = fallbackVenue != null ? fallbackVenue : import_hooks44.Venue.polymarket;
|
|
12454
12466
|
const venues = resolveVenues(venueBreakdown, resolvedFallbackVenue);
|
|
12455
12467
|
const venue = resolvePrimaryVenue(venueBreakdown, resolvedFallbackVenue);
|
|
12456
12468
|
return {
|
|
@@ -12737,7 +12749,7 @@ var shouldAutoFallbackToAllRange = ({
|
|
|
12737
12749
|
};
|
|
12738
12750
|
|
|
12739
12751
|
// src/events/shared/chart-venue-selection.ts
|
|
12740
|
-
var
|
|
12752
|
+
var import_hooks45 = require("@agg-build/hooks");
|
|
12741
12753
|
var resolveChartVenueOutcomes = ({
|
|
12742
12754
|
eligibleVenueOutcomes,
|
|
12743
12755
|
livePrices
|
|
@@ -12749,7 +12761,7 @@ var resolveChartVenueOutcomes = ({
|
|
|
12749
12761
|
const probabilityDifference = (leftProbability != null ? leftProbability : 2) - (rightProbability != null ? rightProbability : 2);
|
|
12750
12762
|
if (probabilityDifference !== 0) return probabilityDifference;
|
|
12751
12763
|
if (left.venue === right.venue) return 0;
|
|
12752
|
-
const sortedVenues = (0,
|
|
12764
|
+
const sortedVenues = (0, import_hooks45.sortVenues)([left.venue, right.venue]);
|
|
12753
12765
|
return sortedVenues[0] === left.venue ? -1 : 1;
|
|
12754
12766
|
});
|
|
12755
12767
|
const venueOutcomesByVenue = /* @__PURE__ */ new Map();
|
|
@@ -12844,7 +12856,7 @@ var getDisplayOutcomePrice = ({
|
|
|
12844
12856
|
};
|
|
12845
12857
|
|
|
12846
12858
|
// src/events/shared/sports-live-score.tsx
|
|
12847
|
-
var
|
|
12859
|
+
var import_hooks46 = require("@agg-build/hooks");
|
|
12848
12860
|
var import_react20 = require("react");
|
|
12849
12861
|
var import_jsx_runtime144 = require("react/jsx-runtime");
|
|
12850
12862
|
var SPORTS_SCORE_LAYOUTS = {
|
|
@@ -12860,7 +12872,7 @@ var SportsLiveScore = ({
|
|
|
12860
12872
|
variant = "detail",
|
|
12861
12873
|
className
|
|
12862
12874
|
}) => {
|
|
12863
|
-
const labels = (0,
|
|
12875
|
+
const labels = (0, import_hooks46.useLabels)();
|
|
12864
12876
|
if (!state || state.participants.length !== 2) return null;
|
|
12865
12877
|
const [firstParticipant, secondParticipant] = state.participants;
|
|
12866
12878
|
const firstScore = firstParticipant == null ? void 0 : firstParticipant.score;
|
|
@@ -13054,7 +13066,7 @@ var SportsLiveScore = ({
|
|
|
13054
13066
|
SportsLiveScore.displayName = "SportsLiveScore";
|
|
13055
13067
|
|
|
13056
13068
|
// src/events/item-details/event-list-item-details-market-selector.tsx
|
|
13057
|
-
var
|
|
13069
|
+
var import_hooks47 = require("@agg-build/hooks");
|
|
13058
13070
|
var import_react21 = require("react");
|
|
13059
13071
|
var import_jsx_runtime145 = require("react/jsx-runtime");
|
|
13060
13072
|
var MARKET_PILL_MAX_ROWS = 2;
|
|
@@ -13153,10 +13165,10 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
13153
13165
|
onChange
|
|
13154
13166
|
}) => {
|
|
13155
13167
|
var _a;
|
|
13156
|
-
const labels = (0,
|
|
13168
|
+
const labels = (0, import_hooks47.useLabels)();
|
|
13157
13169
|
const {
|
|
13158
13170
|
features: { enableAnimations }
|
|
13159
|
-
} = (0,
|
|
13171
|
+
} = (0, import_hooks47.useSdkUiConfig)();
|
|
13160
13172
|
const containerRef = (0, import_react21.useRef)(null);
|
|
13161
13173
|
const measurementContainerRef = (0, import_react21.useRef)(null);
|
|
13162
13174
|
const moreButtonRef = (0, import_react21.useRef)(null);
|
|
@@ -13607,17 +13619,17 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
13607
13619
|
};
|
|
13608
13620
|
|
|
13609
13621
|
// src/events/item-details/settlement-summary.tsx
|
|
13610
|
-
var
|
|
13622
|
+
var import_hooks50 = require("@agg-build/hooks");
|
|
13611
13623
|
var import_react24 = require("react");
|
|
13612
13624
|
|
|
13613
13625
|
// src/trading/settlement/index.tsx
|
|
13614
|
-
var
|
|
13626
|
+
var import_hooks49 = require("@agg-build/hooks");
|
|
13615
13627
|
var import_react23 = require("react");
|
|
13616
13628
|
|
|
13617
13629
|
// src/trading/utils.ts
|
|
13618
|
-
var
|
|
13630
|
+
var import_hooks48 = require("@agg-build/hooks");
|
|
13619
13631
|
var import_dayjs6 = __toESM(require("dayjs"));
|
|
13620
|
-
var defaultLabels = (0,
|
|
13632
|
+
var defaultLabels = (0, import_hooks48.resolveAggUiLabels)("en-US");
|
|
13621
13633
|
var defaultSettlementSectionLabel = defaultLabels.trading.settlementSection;
|
|
13622
13634
|
var defaultTradingDisclaimer = defaultLabels.trading.disclaimer;
|
|
13623
13635
|
var getTradingDateLabel = (value) => {
|
|
@@ -14055,7 +14067,7 @@ var Settlement = ({
|
|
|
14055
14067
|
isLoading = false
|
|
14056
14068
|
}) => {
|
|
14057
14069
|
var _a, _b, _c, _d, _e;
|
|
14058
|
-
const labels = (0,
|
|
14070
|
+
const labels = (0, import_hooks49.useLabels)();
|
|
14059
14071
|
const blocks = (0, import_react23.useMemo)(
|
|
14060
14072
|
() => dedupeSettlementSources({
|
|
14061
14073
|
eventDescription,
|
|
@@ -14242,7 +14254,7 @@ var SettlementSummary = ({
|
|
|
14242
14254
|
settlementSectionId = SETTLEMENT_SECTION_ID,
|
|
14243
14255
|
className
|
|
14244
14256
|
}) => {
|
|
14245
|
-
const labels = (0,
|
|
14257
|
+
const labels = (0, import_hooks50.useLabels)();
|
|
14246
14258
|
const settlementDifferences = (0, import_react24.useMemo)(
|
|
14247
14259
|
() => prepareSettlementDifferences(settlementDiff == null ? void 0 : settlementDiff.differences),
|
|
14248
14260
|
[settlementDiff == null ? void 0 : settlementDiff.differences]
|
|
@@ -14377,7 +14389,7 @@ var EventListItemDetailsLoadingState = ({
|
|
|
14377
14389
|
classNames,
|
|
14378
14390
|
ariaLabel
|
|
14379
14391
|
}) => {
|
|
14380
|
-
const labels = (0,
|
|
14392
|
+
const labels = (0, import_hooks51.useLabels)();
|
|
14381
14393
|
return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
14382
14394
|
Skeleton,
|
|
14383
14395
|
{
|
|
@@ -14391,7 +14403,7 @@ var EventListItemDetailsUnavailableState = ({
|
|
|
14391
14403
|
classNames,
|
|
14392
14404
|
ariaLabel
|
|
14393
14405
|
}) => {
|
|
14394
|
-
const labels = (0,
|
|
14406
|
+
const labels = (0, import_hooks51.useLabels)();
|
|
14395
14407
|
return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
14396
14408
|
Card,
|
|
14397
14409
|
{
|
|
@@ -14409,7 +14421,7 @@ var EventListItemDetailsNotFoundState = ({
|
|
|
14409
14421
|
classNames: _classNames,
|
|
14410
14422
|
ariaLabel: _ariaLabel
|
|
14411
14423
|
}) => {
|
|
14412
|
-
const labels = (0,
|
|
14424
|
+
const labels = (0, import_hooks51.useLabels)();
|
|
14413
14425
|
return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
14414
14426
|
StateMessage,
|
|
14415
14427
|
{
|
|
@@ -14440,8 +14452,8 @@ var EventListItemDetailsGraphSection = ({
|
|
|
14440
14452
|
onRangeOverrideChange
|
|
14441
14453
|
}) => {
|
|
14442
14454
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
14443
|
-
const labels = (0,
|
|
14444
|
-
const tradingContext = (0,
|
|
14455
|
+
const labels = (0, import_hooks51.useLabels)();
|
|
14456
|
+
const tradingContext = (0, import_hooks43.useEventTradingContext)();
|
|
14445
14457
|
const [selectedGraphVenue, setSelectedGraphVenue] = (0, import_react25.useState)(null);
|
|
14446
14458
|
const [chartOutcomeLabel, setChartOutcomeLabel] = (0, import_react25.useState)(
|
|
14447
14459
|
(_c = (_b = (_a = tradingContext == null ? void 0 : tradingContext.selectedOutcome) == null ? void 0 : _a.label) == null ? void 0 : _b.trim()) != null ? _c : null
|
|
@@ -14458,10 +14470,10 @@ var EventListItemDetailsGraphSection = ({
|
|
|
14458
14470
|
chart: { selectedChartTimeRange },
|
|
14459
14471
|
formatting: { formatPercent, formatPrice },
|
|
14460
14472
|
general: { theme }
|
|
14461
|
-
} = (0,
|
|
14473
|
+
} = (0, import_hooks51.useSdkUiConfig)();
|
|
14462
14474
|
const isDarkTheme = theme === "dark";
|
|
14463
14475
|
const effectiveChartTimeRange = rangeOverride != null ? rangeOverride : selectedChartTimeRange;
|
|
14464
|
-
const rollingWindow = (0,
|
|
14476
|
+
const rollingWindow = (0, import_hooks51.useRollingChartWindow)({ range: effectiveChartTimeRange });
|
|
14465
14477
|
const availableMarkets = (0, import_react25.useMemo)(() => {
|
|
14466
14478
|
var _a2, _b2, _c2, _d2;
|
|
14467
14479
|
if (venueMarkets.length === 0) return [];
|
|
@@ -14492,7 +14504,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
14492
14504
|
isLoading: isScopedMarketChartLoading,
|
|
14493
14505
|
error: scopedMarketChartError,
|
|
14494
14506
|
refetch: refetchScopedMarketChart
|
|
14495
|
-
} = (0,
|
|
14507
|
+
} = (0, import_hooks51.useMarketChart)({
|
|
14496
14508
|
marketId: chartPrimaryOutcomeId,
|
|
14497
14509
|
venueMarketIds: availableVenueOutcomes.map((item) => item.outcome.id),
|
|
14498
14510
|
interval: rollingWindow.interval,
|
|
@@ -14549,7 +14561,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
14549
14561
|
const resolvedOutcomePriceByMarketId = (0, import_react25.useMemo)(() => {
|
|
14550
14562
|
const map = /* @__PURE__ */ new Map();
|
|
14551
14563
|
for (const market of availableMarkets) {
|
|
14552
|
-
const marketTradingState = (0,
|
|
14564
|
+
const marketTradingState = (0, import_hooks51.resolveMarketTradingState)(market);
|
|
14553
14565
|
if (marketTradingState.kind !== "resolved") continue;
|
|
14554
14566
|
const outcomePriceMap = resolveResolvedOutcomePriceMap(market.venueMarketOutcomes);
|
|
14555
14567
|
if (outcomePriceMap) {
|
|
@@ -14765,12 +14777,12 @@ var EventListItemDetailsContent = ({
|
|
|
14765
14777
|
const lastAppliedEventSyncKeyRef = (0, import_react25.useRef)(null);
|
|
14766
14778
|
const lastAppliedDefaultRef = (0, import_react25.useRef)(null);
|
|
14767
14779
|
const [chartRangeOverride, setChartRangeOverride] = (0, import_react25.useState)(null);
|
|
14768
|
-
const config = (0,
|
|
14769
|
-
const labels = (0,
|
|
14770
|
-
const tradingContext = (0,
|
|
14780
|
+
const config = (0, import_hooks51.useSdkUiConfig)();
|
|
14781
|
+
const labels = (0, import_hooks51.useLabels)();
|
|
14782
|
+
const tradingContext = (0, import_hooks43.useEventTradingContext)();
|
|
14771
14783
|
const eventSyncKey = (0, import_react25.useMemo)(() => resolveEventDetailsSyncKey(event), [event]);
|
|
14772
14784
|
const resolvedEventTradingState = (0, import_react25.useMemo)(() => {
|
|
14773
|
-
return eventTradingState != null ? eventTradingState : (0,
|
|
14785
|
+
return eventTradingState != null ? eventTradingState : (0, import_hooks51.resolveEventTradingState)(event);
|
|
14774
14786
|
}, [event, eventTradingState]);
|
|
14775
14787
|
const scopedSelectedMarket = (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? (_a = tradingContext.selectedMarket) != null ? _a : resolvedEventTradingState.primaryMarket : resolvedEventTradingState.primaryMarket;
|
|
14776
14788
|
const venueMarkets = (0, import_react25.useMemo)(
|
|
@@ -14781,12 +14793,12 @@ var EventListItemDetailsContent = ({
|
|
|
14781
14793
|
return normalizeVenueMarketCluster(venueMarkets);
|
|
14782
14794
|
}, [venueMarkets]);
|
|
14783
14795
|
const scopedSelectedMarketId = (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? tradingContext.selectedMarketId : null;
|
|
14784
|
-
(0,
|
|
14796
|
+
(0, import_hooks51.useEventOrderbookData)(
|
|
14785
14797
|
resolvedEventTradingState.isTradingDisabled ? [] : resolvedEventTradingState.displayMarkets,
|
|
14786
14798
|
scopedSelectedMarketId
|
|
14787
14799
|
);
|
|
14788
|
-
const wsLivePrices = (0,
|
|
14789
|
-
const wsBestPrices = (0,
|
|
14800
|
+
const wsLivePrices = (0, import_hooks51.useLiveOutcomePrices)(eventDetailVenueMarkets);
|
|
14801
|
+
const wsBestPrices = (0, import_hooks51.useLiveBestPrices)(eventDetailVenueMarkets);
|
|
14790
14802
|
const resolvedMidpointsResult = midpointsResult != null ? midpointsResult : {
|
|
14791
14803
|
prices: /* @__PURE__ */ new Map(),
|
|
14792
14804
|
bestMidpointsByOutcomeId: /* @__PURE__ */ new Map(),
|
|
@@ -14801,7 +14813,7 @@ var EventListItemDetailsContent = ({
|
|
|
14801
14813
|
const bestMidpoint = resolvedMidpointsResult.bestMidpoint;
|
|
14802
14814
|
const restBestPrices = resolvedMidpointsResult.bestPrices;
|
|
14803
14815
|
const bestPrices = (0, import_react25.useMemo)(
|
|
14804
|
-
() => (0,
|
|
14816
|
+
() => (0, import_hooks51.mergeBestPricesPreferringLive)(restBestPrices, wsBestPrices),
|
|
14805
14817
|
[restBestPrices, wsBestPrices]
|
|
14806
14818
|
);
|
|
14807
14819
|
const livePrices = (0, import_react25.useMemo)(() => {
|
|
@@ -14920,7 +14932,7 @@ var EventListItemDetailsContent = ({
|
|
|
14920
14932
|
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
14921
14933
|
RemoteImage,
|
|
14922
14934
|
{
|
|
14923
|
-
src: (0,
|
|
14935
|
+
src: (0, import_hooks51.optimizedImageUrl)(event.image, 60),
|
|
14924
14936
|
alt: "",
|
|
14925
14937
|
className: "agg-event-image size-10 rounded-agg-lg object-cover md:size-[60px]"
|
|
14926
14938
|
}
|
|
@@ -15107,7 +15119,7 @@ var EventListItemDetailsContent = ({
|
|
|
15107
15119
|
}
|
|
15108
15120
|
),
|
|
15109
15121
|
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("span", { "aria-hidden": "true", className: "hidden h-4 w-px bg-agg-separator md:block" }),
|
|
15110
|
-
|
|
15122
|
+
import_hooks51.CHART_TIME_RANGES.map((timeRange) => {
|
|
15111
15123
|
const effectiveRange = chartRangeOverride != null ? chartRangeOverride : config.chart.selectedChartTimeRange;
|
|
15112
15124
|
const isActive = timeRange === effectiveRange;
|
|
15113
15125
|
return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
@@ -15158,7 +15170,7 @@ var EventListItemDetailsByEventId = (_a) => {
|
|
|
15158
15170
|
error,
|
|
15159
15171
|
isError,
|
|
15160
15172
|
isLoading
|
|
15161
|
-
} = (0,
|
|
15173
|
+
} = (0, import_hooks51.useVenueEvent)({
|
|
15162
15174
|
eventId: resolvedEventId,
|
|
15163
15175
|
enabled: !!resolvedEventId
|
|
15164
15176
|
});
|
|
@@ -15235,11 +15247,11 @@ var EventListItemDetails = (props) => {
|
|
|
15235
15247
|
EventListItemDetails.displayName = "EventListItemDetails";
|
|
15236
15248
|
|
|
15237
15249
|
// src/events/market-details/index.tsx
|
|
15238
|
-
var
|
|
15250
|
+
var import_hooks55 = require("@agg-build/hooks");
|
|
15239
15251
|
var import_react29 = require("react");
|
|
15240
15252
|
|
|
15241
15253
|
// src/events/orderbook/index.tsx
|
|
15242
|
-
var
|
|
15254
|
+
var import_hooks52 = require("@agg-build/hooks");
|
|
15243
15255
|
var import_react27 = require("react");
|
|
15244
15256
|
|
|
15245
15257
|
// src/events/orderbook/orderbook.constants.ts
|
|
@@ -15469,7 +15481,7 @@ OrderbookWithStates.displayName = "OrderbookWithStates";
|
|
|
15469
15481
|
// src/events/orderbook/index.tsx
|
|
15470
15482
|
var import_jsx_runtime151 = require("react/jsx-runtime");
|
|
15471
15483
|
var OrderbookVenueLogos = ({ venues }) => {
|
|
15472
|
-
const visible = (0,
|
|
15484
|
+
const visible = (0, import_hooks52.sortVenues)(venues).slice(0, orderbookMaxVisibleVenues);
|
|
15473
15485
|
const overflow = venues.length - visible.length;
|
|
15474
15486
|
return /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex flex-row items-center justify-start gap-0.5 md:gap-1", children: [
|
|
15475
15487
|
visible.map((venue) => /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(VenueLogo, { venue, size: "small" }, venue)),
|
|
@@ -15577,7 +15589,7 @@ var Orderbook = ({
|
|
|
15577
15589
|
const {
|
|
15578
15590
|
enableWebsocketsLogs,
|
|
15579
15591
|
formatting: { formatPrice }
|
|
15580
|
-
} = (0,
|
|
15592
|
+
} = (0, import_hooks52.useAggUiConfig)();
|
|
15581
15593
|
const labels = __spreadValues(__spreadValues({}, orderbookDefaultLabels), labelsProp);
|
|
15582
15594
|
const scrollContainerRef = (0, import_react27.useRef)(null);
|
|
15583
15595
|
const spreadRowRef = (0, import_react27.useRef)(null);
|
|
@@ -15888,7 +15900,7 @@ var resolveOrderEligibilityMessage = (labels, reason) => {
|
|
|
15888
15900
|
};
|
|
15889
15901
|
|
|
15890
15902
|
// src/events/market-details/market-details-outcome-button.tsx
|
|
15891
|
-
var
|
|
15903
|
+
var import_hooks53 = require("@agg-build/hooks");
|
|
15892
15904
|
var import_jsx_runtime152 = require("react/jsx-runtime");
|
|
15893
15905
|
var marketDetailsOutcomeButtonToneClasses = {
|
|
15894
15906
|
positive: {
|
|
@@ -15939,7 +15951,7 @@ var OutcomePriceContent = ({
|
|
|
15939
15951
|
value,
|
|
15940
15952
|
textClassName
|
|
15941
15953
|
}) => {
|
|
15942
|
-
const { formatPrice } = (0,
|
|
15954
|
+
const { formatPrice } = (0, import_hooks53.useAggUiConfig)().formatting;
|
|
15943
15955
|
if (isLoading) {
|
|
15944
15956
|
return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
15945
15957
|
"span",
|
|
@@ -16052,7 +16064,7 @@ var MarketDetailsOutcomeButton = ({
|
|
|
16052
16064
|
MarketDetailsOutcomeButton.displayName = "MarketDetailsOutcomeButton";
|
|
16053
16065
|
|
|
16054
16066
|
// src/events/market-details/market-details-graph-panel.tsx
|
|
16055
|
-
var
|
|
16067
|
+
var import_hooks54 = require("@agg-build/hooks");
|
|
16056
16068
|
var import_react28 = require("react");
|
|
16057
16069
|
var import_jsx_runtime153 = require("react/jsx-runtime");
|
|
16058
16070
|
var MarketDetailsGraphPanel = ({
|
|
@@ -16069,13 +16081,13 @@ var MarketDetailsGraphPanel = ({
|
|
|
16069
16081
|
classNames
|
|
16070
16082
|
}) => {
|
|
16071
16083
|
var _a, _b, _c;
|
|
16072
|
-
const config = (0,
|
|
16084
|
+
const config = (0, import_hooks54.useSdkUiConfig)();
|
|
16073
16085
|
const {
|
|
16074
16086
|
formatting: { formatPercent, formatCompactCurrency, formatPrice },
|
|
16075
16087
|
general: { theme }
|
|
16076
16088
|
} = config;
|
|
16077
16089
|
const isDarkTheme = theme === "dark";
|
|
16078
|
-
const labels = (0,
|
|
16090
|
+
const labels = (0, import_hooks54.useLabels)();
|
|
16079
16091
|
const selectedTimeRange = config.chart.selectedChartTimeRange;
|
|
16080
16092
|
const setSelectedTimeRange = config.chart.setSelectedChartTimeRange;
|
|
16081
16093
|
const [chartRangeOverride, setChartRangeOverride] = (0, import_react28.useState)(null);
|
|
@@ -16095,7 +16107,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
16095
16107
|
livePrices
|
|
16096
16108
|
});
|
|
16097
16109
|
}, [livePrices, venueMarkets, resolvedChartOutcomeLabel, chartSelectedOutcomeId]);
|
|
16098
|
-
const rollingWindow = (0,
|
|
16110
|
+
const rollingWindow = (0, import_hooks54.useRollingChartWindow)({ range: effectiveChartTimeRange });
|
|
16099
16111
|
const chartPrimaryOutcomeId = (_b = (_a = chartOutcomesByVenue[0]) == null ? void 0 : _a.outcome.id) != null ? _b : null;
|
|
16100
16112
|
const chartVenueOutcomeIds = (0, import_react28.useMemo)(() => {
|
|
16101
16113
|
return chartOutcomesByVenue.map((item) => item.outcome.id);
|
|
@@ -16105,7 +16117,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
16105
16117
|
isLoading: isMarketChartLoading,
|
|
16106
16118
|
error: marketChartError,
|
|
16107
16119
|
refetch: refetchMarketChart
|
|
16108
|
-
} = (0,
|
|
16120
|
+
} = (0, import_hooks54.useMarketChart)({
|
|
16109
16121
|
marketId: chartPrimaryOutcomeId,
|
|
16110
16122
|
venueMarketIds: chartVenueOutcomeIds,
|
|
16111
16123
|
interval: rollingWindow.interval,
|
|
@@ -16315,7 +16327,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
16315
16327
|
}
|
|
16316
16328
|
),
|
|
16317
16329
|
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)("span", { "aria-hidden": "true", className: "hidden h-4 w-px bg-agg-separator md:block" }),
|
|
16318
|
-
|
|
16330
|
+
import_hooks54.CHART_TIME_RANGES.map((timeRange) => {
|
|
16319
16331
|
const isActive = effectiveChartTimeRange === timeRange;
|
|
16320
16332
|
const isDisabled = isResolvedMarket && timeRange !== "ALL";
|
|
16321
16333
|
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
@@ -16358,7 +16370,7 @@ var MarketDetailsUnavailableState = ({
|
|
|
16358
16370
|
ariaLabel,
|
|
16359
16371
|
classNames
|
|
16360
16372
|
}) => {
|
|
16361
|
-
const labels = (0,
|
|
16373
|
+
const labels = (0, import_hooks55.useLabels)();
|
|
16362
16374
|
return /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
|
|
16363
16375
|
Card,
|
|
16364
16376
|
{
|
|
@@ -16382,7 +16394,7 @@ var MarketDetailsNotFoundState = ({
|
|
|
16382
16394
|
ariaLabel: _ariaLabel,
|
|
16383
16395
|
classNames: _classNames
|
|
16384
16396
|
}) => {
|
|
16385
|
-
const labels = (0,
|
|
16397
|
+
const labels = (0, import_hooks55.useLabels)();
|
|
16386
16398
|
return /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
|
|
16387
16399
|
StateMessage,
|
|
16388
16400
|
{
|
|
@@ -16421,33 +16433,33 @@ var MarketDetailsContent = ({
|
|
|
16421
16433
|
midpointsResult
|
|
16422
16434
|
}) => {
|
|
16423
16435
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
16424
|
-
const config = (0,
|
|
16436
|
+
const config = (0, import_hooks55.useSdkUiConfig)();
|
|
16425
16437
|
const {
|
|
16426
16438
|
features: { enableAnimations },
|
|
16427
16439
|
formatting: { formatPercent }
|
|
16428
16440
|
} = config;
|
|
16429
|
-
const labels = (0,
|
|
16430
|
-
const tradingContext = (0,
|
|
16441
|
+
const labels = (0, import_hooks55.useLabels)();
|
|
16442
|
+
const tradingContext = (0, import_hooks55.useEventTradingContext)();
|
|
16431
16443
|
const detailsContentId = (0, import_react29.useId)();
|
|
16432
16444
|
const tradeSide = (_a = tradingContext == null ? void 0 : tradingContext.tradeSide) != null ? _a : "buy";
|
|
16433
16445
|
const resolvedMarket = (0, import_react29.useMemo)(() => {
|
|
16434
16446
|
return resolveMarketFromVenueMarkets(venueMarkets, marketId);
|
|
16435
16447
|
}, [venueMarkets, marketId]);
|
|
16436
16448
|
const clusterVenueMarkets = resolvedMarket == null ? void 0 : resolvedMarket.venueMarkets;
|
|
16437
|
-
const wsLivePrices = (0,
|
|
16438
|
-
const wsBestPrices = (0,
|
|
16439
|
-
const wsBestCandidates = (0,
|
|
16449
|
+
const wsLivePrices = (0, import_hooks55.useLiveOutcomePrices)(clusterVenueMarkets);
|
|
16450
|
+
const wsBestPrices = (0, import_hooks55.useLiveBestPrices)(clusterVenueMarkets);
|
|
16451
|
+
const wsBestCandidates = (0, import_hooks55.useLiveBestPriceCandidates)(clusterVenueMarkets);
|
|
16440
16452
|
const scopedResolvedMarket = (0, import_react29.useMemo)(() => {
|
|
16441
16453
|
var _a2, _b2;
|
|
16442
16454
|
if (!resolvedMarket) return null;
|
|
16443
16455
|
return (_b2 = (_a2 = resolvedMarket.venueMarkets.find((venueMarket) => venueMarket.id === resolvedMarket.id)) != null ? _a2 : resolvedMarket.venueMarkets[0]) != null ? _b2 : null;
|
|
16444
16456
|
}, [resolvedMarket]);
|
|
16445
|
-
const isResolvedMarket = (0,
|
|
16446
|
-
(0,
|
|
16457
|
+
const isResolvedMarket = (0, import_hooks55.resolveMarketTradingState)(scopedResolvedMarket).kind === "resolved";
|
|
16458
|
+
(0, import_hooks55.useEventOrderbookData)(
|
|
16447
16459
|
isResolvedMarket ? [] : resolvedMarket == null ? void 0 : resolvedMarket.venueMarkets,
|
|
16448
16460
|
(_b = scopedResolvedMarket == null ? void 0 : scopedResolvedMarket.id) != null ? _b : null
|
|
16449
16461
|
);
|
|
16450
|
-
const fetchedClusterMidpointResult = (0,
|
|
16462
|
+
const fetchedClusterMidpointResult = (0, import_hooks55.useMidpoints)(midpointsResult ? [] : clusterVenueMarkets);
|
|
16451
16463
|
const clusterMidpointResult = midpointsResult != null ? midpointsResult : fetchedClusterMidpointResult;
|
|
16452
16464
|
const clusterMidpoints = (_c = clusterMidpointResult.bestMidpointsByOutcomeId) != null ? _c : clusterMidpointResult.prices;
|
|
16453
16465
|
const clusterBestMidpointsByOutcomeId = clusterMidpoints;
|
|
@@ -16456,7 +16468,7 @@ var MarketDetailsContent = ({
|
|
|
16456
16468
|
const clusterBestMidpointVenue = clusterMidpointResult.bestMidpointVenue;
|
|
16457
16469
|
const clusterBestPricesRest = clusterMidpointResult.bestPrices;
|
|
16458
16470
|
const clusterBestPrices = (0, import_react29.useMemo)(
|
|
16459
|
-
() => (0,
|
|
16471
|
+
() => (0, import_hooks55.mergeBestPricesPreferringLive)(clusterBestPricesRest, wsBestPrices),
|
|
16460
16472
|
[clusterBestPricesRest, wsBestPrices]
|
|
16461
16473
|
);
|
|
16462
16474
|
const clusterBestPriceVenuesByOutcomeId = clusterMidpointResult.bestPriceVenuesByOutcomeId;
|
|
@@ -16491,7 +16503,7 @@ var MarketDetailsContent = ({
|
|
|
16491
16503
|
return (_a2 = model.market.venueMarkets.find((venueMarket) => venueMarket.id === model.market.id)) != null ? _a2 : model.primaryVenueMarket;
|
|
16492
16504
|
}, [model]);
|
|
16493
16505
|
const marketTradingState = (0, import_react29.useMemo)(() => {
|
|
16494
|
-
return (0,
|
|
16506
|
+
return (0, import_hooks55.resolveMarketTradingState)(scopedMarketForCard);
|
|
16495
16507
|
}, [scopedMarketForCard]);
|
|
16496
16508
|
const isOutcomeSelectionLocked = showResolvingState || marketTradingState.isTradingDisabled;
|
|
16497
16509
|
const isUpcomingMarket = marketTradingState.kind === "unopened";
|
|
@@ -16653,7 +16665,7 @@ var MarketDetailsContent = ({
|
|
|
16653
16665
|
fallbackPrice: midpointsFallback == null ? void 0 : midpointsFallback.get(displayOutcome.id)
|
|
16654
16666
|
});
|
|
16655
16667
|
if (referencePrice != null) return referencePrice;
|
|
16656
|
-
return (0,
|
|
16668
|
+
return (0, import_hooks55.findLivePriceById)(wsLivePrices, displayOutcome.id);
|
|
16657
16669
|
}, [
|
|
16658
16670
|
clusterBestMidpoint,
|
|
16659
16671
|
clusterBestMidpointsByOutcomeId,
|
|
@@ -16678,7 +16690,7 @@ var MarketDetailsContent = ({
|
|
|
16678
16690
|
}, [model, selectedOutcomeLabel, selectedOutcomeId]);
|
|
16679
16691
|
const orderBookEnabled = isOpened && effectiveSelectedTab === "order-book" && !marketTradingState.isTradingDisabled;
|
|
16680
16692
|
const primaryOutcomeId = (_g = (_f = selectedOutcomesByVenue[0]) == null ? void 0 : _f.outcome.id) != null ? _g : null;
|
|
16681
|
-
const marketOrderbookResult = (0,
|
|
16693
|
+
const marketOrderbookResult = (0, import_hooks55.useMarketOrderbook)({
|
|
16682
16694
|
venueMarketOutcomeId: primaryOutcomeId,
|
|
16683
16695
|
enabled: orderBookEnabled && !!primaryOutcomeId,
|
|
16684
16696
|
venueOutcomes: selectedOutcomesByVenue.map((item) => ({
|
|
@@ -16864,7 +16876,7 @@ var MarketDetailsContent = ({
|
|
|
16864
16876
|
!compactHeader ? /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
|
|
16865
16877
|
RemoteImage,
|
|
16866
16878
|
{
|
|
16867
|
-
src: (0,
|
|
16879
|
+
src: (0, import_hooks55.optimizedImageUrl)(model.image, 60),
|
|
16868
16880
|
alt: "",
|
|
16869
16881
|
className: "agg-market-image size-12 rounded-agg-lg object-cover md:size-[60px]"
|
|
16870
16882
|
}
|
|
@@ -17118,7 +17130,7 @@ var MarketDetailsContent = ({
|
|
|
17118
17130
|
};
|
|
17119
17131
|
var MarketDetails = (_a) => {
|
|
17120
17132
|
var _b = _a, { isOpened } = _b, props = __objRest(_b, ["isOpened"]);
|
|
17121
|
-
const labels = (0,
|
|
17133
|
+
const labels = (0, import_hooks55.useLabels)();
|
|
17122
17134
|
if (props.isLoading) {
|
|
17123
17135
|
return /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
|
|
17124
17136
|
Skeleton,
|
|
@@ -17173,13 +17185,13 @@ var resolveIsResolvedEvent = (sourceMarkets, eventTradingState) => {
|
|
|
17173
17185
|
return eventTradingState.kind === "resolved";
|
|
17174
17186
|
}
|
|
17175
17187
|
if (sourceMarkets.length === 0) return false;
|
|
17176
|
-
return sourceMarkets.every((market) => (0,
|
|
17188
|
+
return sourceMarkets.every((market) => (0, import_hooks55.resolveMarketTradingState)(market).kind === "resolved");
|
|
17177
17189
|
};
|
|
17178
17190
|
var resolveResolvedWinnerMarketId = (sourceMarkets, eventTradingState) => {
|
|
17179
17191
|
var _a, _b, _c, _d, _e;
|
|
17180
17192
|
const preferredMarket = (_a = eventTradingState == null ? void 0 : eventTradingState.primaryMarket) != null ? _a : null;
|
|
17181
17193
|
if (preferredMarket && sourceMarkets.some((market) => market.id === preferredMarket.id)) {
|
|
17182
|
-
if ((0,
|
|
17194
|
+
if ((0, import_hooks55.resolveMarketTradingState)(preferredMarket).kind === "resolved") {
|
|
17183
17195
|
return preferredMarket.id;
|
|
17184
17196
|
}
|
|
17185
17197
|
}
|
|
@@ -17200,8 +17212,8 @@ var MarketDetailsList = ({
|
|
|
17200
17212
|
midpointsResult
|
|
17201
17213
|
}) => {
|
|
17202
17214
|
var _a, _b;
|
|
17203
|
-
const labels = (0,
|
|
17204
|
-
const tradingContext = (0,
|
|
17215
|
+
const labels = (0, import_hooks55.useLabels)();
|
|
17216
|
+
const tradingContext = (0, import_hooks55.useEventTradingContext)();
|
|
17205
17217
|
const selectedMarketId = (_a = tradingContext == null ? void 0 : tradingContext.selectedMarketId) != null ? _a : null;
|
|
17206
17218
|
const [expandedMarketId, setExpandedMarketId] = (0, import_react29.useState)(null);
|
|
17207
17219
|
const [areResolvedMarketsVisible, setAreResolvedMarketsVisible] = (0, import_react29.useState)(false);
|
|
@@ -17210,10 +17222,10 @@ var MarketDetailsList = ({
|
|
|
17210
17222
|
markets: rawMarkets,
|
|
17211
17223
|
isLoading,
|
|
17212
17224
|
error
|
|
17213
|
-
} = (0,
|
|
17225
|
+
} = (0, import_hooks55.useVenueMarkets)({
|
|
17214
17226
|
venueEventId: resolvedEventId,
|
|
17215
17227
|
enabled: !providedMarkets && !!resolvedEventId,
|
|
17216
|
-
status:
|
|
17228
|
+
status: import_hooks55.MarketStatus.open,
|
|
17217
17229
|
// Keep in lockstep with useEnrichedVenueEvent: limit is part of the React
|
|
17218
17230
|
// Query key, so a mismatch would fork the shared cache into two requests.
|
|
17219
17231
|
// fetchAll drains every page — events can exceed any single-page limit
|
|
@@ -17258,7 +17270,7 @@ var MarketDetailsList = ({
|
|
|
17258
17270
|
const resolved = [];
|
|
17259
17271
|
const closed = [];
|
|
17260
17272
|
sourceMarkets.forEach((market) => {
|
|
17261
|
-
const marketStateKind = (0,
|
|
17273
|
+
const marketStateKind = (0, import_hooks55.resolveMarketTradingState)(market).kind;
|
|
17262
17274
|
if (marketStateKind === "resolved") {
|
|
17263
17275
|
resolved.push(market);
|
|
17264
17276
|
return;
|
|
@@ -17290,10 +17302,10 @@ var MarketDetailsList = ({
|
|
|
17290
17302
|
const hasPrefetchedMarkets = !!providedMarkets || !!((_b = eventTradingState == null ? void 0 : eventTradingState.marketStates) == null ? void 0 : _b.length);
|
|
17291
17303
|
const midpointEligibleMarkets = (0, import_react29.useMemo)(() => {
|
|
17292
17304
|
return displayedMarkets.filter(
|
|
17293
|
-
(market) => (0,
|
|
17305
|
+
(market) => (0, import_hooks55.resolveMarketTradingState)(market).kind !== "resolved"
|
|
17294
17306
|
);
|
|
17295
17307
|
}, [displayedMarkets]);
|
|
17296
|
-
const { prices: midpointsFallback, venueByOutcomeId: midpointsFallbackVenues } = (0,
|
|
17308
|
+
const { prices: midpointsFallback, venueByOutcomeId: midpointsFallbackVenues } = (0, import_hooks55.useViewportMidpoints)(midpointEligibleMarkets);
|
|
17297
17309
|
(0, import_react29.useEffect)(() => {
|
|
17298
17310
|
if (isResolvedEvent) {
|
|
17299
17311
|
setAreResolvedMarketsVisible(false);
|
|
@@ -17312,7 +17324,7 @@ var MarketDetailsList = ({
|
|
|
17312
17324
|
return;
|
|
17313
17325
|
}
|
|
17314
17326
|
const fallbackSelectableMarket = displayedMarkets.find(
|
|
17315
|
-
(market) => !(0,
|
|
17327
|
+
(market) => !(0, import_hooks55.resolveMarketTradingState)(market).isTradingDisabled
|
|
17316
17328
|
);
|
|
17317
17329
|
if (!fallbackSelectableMarket) {
|
|
17318
17330
|
return;
|
|
@@ -17334,7 +17346,7 @@ var MarketDetailsList = ({
|
|
|
17334
17346
|
setExpandedMarketId(marketId);
|
|
17335
17347
|
onExpandedMarketChange == null ? void 0 : onExpandedMarketChange(marketId);
|
|
17336
17348
|
if (marketId === selectedMarketId) return;
|
|
17337
|
-
if ((0,
|
|
17349
|
+
if ((0, import_hooks55.resolveMarketTradingState)(market).isTradingDisabled) return;
|
|
17338
17350
|
tradingContext == null ? void 0 : tradingContext.selectMarket(market.id, market);
|
|
17339
17351
|
};
|
|
17340
17352
|
if (!hasPrefetchedMarkets && isLoading) {
|
|
@@ -17434,7 +17446,7 @@ var isVenue = (0, import_sdk19.enumGuard)(import_sdk19.Venue);
|
|
|
17434
17446
|
var parseVenue = (v) => (0, import_sdk19.safeParse)(v, isVenue);
|
|
17435
17447
|
|
|
17436
17448
|
// src/trading/settlement/settlement-details.tsx
|
|
17437
|
-
var
|
|
17449
|
+
var import_hooks56 = require("@agg-build/hooks");
|
|
17438
17450
|
var import_jsx_runtime155 = require("react/jsx-runtime");
|
|
17439
17451
|
var hasContent = (value) => {
|
|
17440
17452
|
return typeof value === "string" && value.trim().length > 0;
|
|
@@ -17458,11 +17470,11 @@ var buildVenueSettlementRules = (venueMarkets) => {
|
|
|
17458
17470
|
};
|
|
17459
17471
|
var SettlementDetails = ({ className }) => {
|
|
17460
17472
|
var _a, _b, _c, _d, _e, _f;
|
|
17461
|
-
const tradingContext = (0,
|
|
17473
|
+
const tradingContext = (0, import_hooks56.useEventTradingContext)();
|
|
17462
17474
|
const selectedEvent = (_a = tradingContext == null ? void 0 : tradingContext.selectedEvent) != null ? _a : null;
|
|
17463
17475
|
const selectedMarket = (_b = tradingContext == null ? void 0 : tradingContext.selectedMarket) != null ? _b : null;
|
|
17464
17476
|
if (!selectedEvent) return null;
|
|
17465
|
-
const activeMarket = selectedMarket != null ? selectedMarket : (0,
|
|
17477
|
+
const activeMarket = selectedMarket != null ? selectedMarket : (0, import_hooks56.resolveDefaultTradingMarket)(selectedEvent);
|
|
17466
17478
|
if (!activeMarket) return null;
|
|
17467
17479
|
const allVenueMarkets = normalizeVenueMarketCluster(selectedEvent.venueMarkets);
|
|
17468
17480
|
const activeMarketCluster = normalizeVenueMarketCluster(
|
|
@@ -17503,7 +17515,7 @@ var SettlementDetails = ({ className }) => {
|
|
|
17503
17515
|
SettlementDetails.displayName = "SettlementDetails";
|
|
17504
17516
|
|
|
17505
17517
|
// src/trading/place-order/index.tsx
|
|
17506
|
-
var
|
|
17518
|
+
var import_hooks67 = require("@agg-build/hooks");
|
|
17507
17519
|
var import_sdk24 = require("@agg-build/sdk");
|
|
17508
17520
|
var import_react37 = __toESM(require("@number-flow/react"));
|
|
17509
17521
|
var Popover = __toESM(require("@radix-ui/react-popover"));
|
|
@@ -17513,14 +17525,14 @@ var import_utc2 = __toESM(require("dayjs/plugin/utc"));
|
|
|
17513
17525
|
var import_react38 = require("react");
|
|
17514
17526
|
|
|
17515
17527
|
// src/geo-block-banner/index.tsx
|
|
17516
|
-
var
|
|
17528
|
+
var import_hooks57 = require("@agg-build/hooks");
|
|
17517
17529
|
var import_jsx_runtime156 = require("react/jsx-runtime");
|
|
17518
17530
|
var GeoBlockBanner = ({
|
|
17519
17531
|
venue,
|
|
17520
17532
|
termsUrl = AGG_TERMS_OF_SERVICE_URL,
|
|
17521
17533
|
className
|
|
17522
17534
|
}) => {
|
|
17523
|
-
const labels = (0,
|
|
17535
|
+
const labels = (0, import_hooks57.useLabels)();
|
|
17524
17536
|
const message = venue ? labels.trading.geoBlockVenueMessage(venue) : labels.trading.geoBlockGenericMessage;
|
|
17525
17537
|
return /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
|
|
17526
17538
|
"div",
|
|
@@ -17553,7 +17565,7 @@ var venueRequiresSharedKyc = ({
|
|
|
17553
17565
|
};
|
|
17554
17566
|
|
|
17555
17567
|
// src/kyc/shared-kyc-modal.tsx
|
|
17556
|
-
var
|
|
17568
|
+
var import_hooks58 = require("@agg-build/hooks");
|
|
17557
17569
|
var Dialog3 = __toESM(require("@radix-ui/react-dialog"));
|
|
17558
17570
|
var import_jsx_runtime157 = require("react/jsx-runtime");
|
|
17559
17571
|
var SharedKycModal = ({
|
|
@@ -17563,7 +17575,7 @@ var SharedKycModal = ({
|
|
|
17563
17575
|
onOpenChange,
|
|
17564
17576
|
onStartVerification
|
|
17565
17577
|
}) => {
|
|
17566
|
-
const labels = (0,
|
|
17578
|
+
const labels = (0, import_hooks58.useLabels)();
|
|
17567
17579
|
const modalLabels = labels.trading.sharedKyc.modal;
|
|
17568
17580
|
const isInitiating = state === "initiating";
|
|
17569
17581
|
const handleOpenChange = (nextOpen) => {
|
|
@@ -17840,7 +17852,7 @@ var useSharedKycFlow = ({
|
|
|
17840
17852
|
};
|
|
17841
17853
|
|
|
17842
17854
|
// src/notifications/agg-notification-events-provider.tsx
|
|
17843
|
-
var
|
|
17855
|
+
var import_hooks59 = require("@agg-build/hooks");
|
|
17844
17856
|
var import_react31 = require("react");
|
|
17845
17857
|
var import_jsx_runtime158 = require("react/jsx-runtime");
|
|
17846
17858
|
var firedOrderNotificationKeys = /* @__PURE__ */ new Set();
|
|
@@ -17933,7 +17945,7 @@ var CLIENT_DEPOSIT_ACTIVITY_SUPPRESSION_MS = 2 * 60 * 1e3;
|
|
|
17933
17945
|
|
|
17934
17946
|
// src/onboarding/index.tsx
|
|
17935
17947
|
var import_react36 = require("react");
|
|
17936
|
-
var
|
|
17948
|
+
var import_hooks65 = require("@agg-build/hooks");
|
|
17937
17949
|
var Dialog6 = __toESM(require("@radix-ui/react-dialog"));
|
|
17938
17950
|
|
|
17939
17951
|
// src/onboarding/onboarding-modal.constants.ts
|
|
@@ -17958,7 +17970,7 @@ var ONCHAIN_VENUES = [
|
|
|
17958
17970
|
|
|
17959
17971
|
// src/onboarding/steps/how-it-works.tsx
|
|
17960
17972
|
var import_react32 = require("react");
|
|
17961
|
-
var
|
|
17973
|
+
var import_hooks60 = require("@agg-build/hooks");
|
|
17962
17974
|
var import_jsx_runtime159 = require("react/jsx-runtime");
|
|
17963
17975
|
var defaultIcons = {
|
|
17964
17976
|
createAccount: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(CreateAccountIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
|
|
@@ -17967,7 +17979,7 @@ var defaultIcons = {
|
|
|
17967
17979
|
stayInControl: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(StayInControlIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" })
|
|
17968
17980
|
};
|
|
17969
17981
|
var HowItWorksStep = ({ onContinue, icons }) => {
|
|
17970
|
-
const labels = (0,
|
|
17982
|
+
const labels = (0, import_hooks60.useLabels)();
|
|
17971
17983
|
const scrollRef = (0, import_react32.useRef)(null);
|
|
17972
17984
|
const [showTopGradient, setShowTopGradient] = (0, import_react32.useState)(false);
|
|
17973
17985
|
const [showBottomGradient, setShowBottomGradient] = (0, import_react32.useState)(true);
|
|
@@ -18041,10 +18053,10 @@ HowItWorksStep.displayName = "HowItWorksStep";
|
|
|
18041
18053
|
|
|
18042
18054
|
// src/onboarding/steps/profile-setup.tsx
|
|
18043
18055
|
var import_react33 = require("react");
|
|
18044
|
-
var
|
|
18056
|
+
var import_hooks61 = require("@agg-build/hooks");
|
|
18045
18057
|
var import_jsx_runtime160 = require("react/jsx-runtime");
|
|
18046
18058
|
var ProfileSetupStep = ({ onContinue }) => {
|
|
18047
|
-
const labels = (0,
|
|
18059
|
+
const labels = (0, import_hooks61.useLabels)();
|
|
18048
18060
|
const [username, setUsername] = (0, import_react33.useState)("");
|
|
18049
18061
|
const [avatarFile, setAvatarFile] = (0, import_react33.useState)();
|
|
18050
18062
|
const [avatarPreview, setAvatarPreview] = (0, import_react33.useState)();
|
|
@@ -18174,7 +18186,7 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
18174
18186
|
ProfileSetupStep.displayName = "ProfileSetupStep";
|
|
18175
18187
|
|
|
18176
18188
|
// src/onboarding/steps/connect-accounts.tsx
|
|
18177
|
-
var
|
|
18189
|
+
var import_hooks62 = require("@agg-build/hooks");
|
|
18178
18190
|
var import_jsx_runtime161 = require("react/jsx-runtime");
|
|
18179
18191
|
var OnchainVenueLogos = () => {
|
|
18180
18192
|
return /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("div", { className: "flex gap-1 sm:gap-0 sm:-space-x-5", children: ONCHAIN_VENUES.map((venue, index) => /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("div", { style: { zIndex: ONCHAIN_VENUES.length - index }, children: /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(VenueLogo, { venue, variant: "logo", size: "medium", className: "sm:h-8 sm:w-8" }) }, venue)) });
|
|
@@ -18188,7 +18200,7 @@ var VenueCard = ({
|
|
|
18188
18200
|
onConnect,
|
|
18189
18201
|
connected = false
|
|
18190
18202
|
}) => {
|
|
18191
|
-
const labels = (0,
|
|
18203
|
+
const labels = (0, import_hooks62.useLabels)();
|
|
18192
18204
|
const action = connected ? /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(CheckCircleIcon, { className: "h-6 w-6 text-agg-success" }) : /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
|
|
18193
18205
|
Button,
|
|
18194
18206
|
{
|
|
@@ -18247,7 +18259,7 @@ var ConnectAccountsStep = ({
|
|
|
18247
18259
|
onContinue,
|
|
18248
18260
|
connectedOnchain = false
|
|
18249
18261
|
}) => {
|
|
18250
|
-
const labels = (0,
|
|
18262
|
+
const labels = (0, import_hooks62.useLabels)();
|
|
18251
18263
|
const canContinue = connectedOnchain;
|
|
18252
18264
|
return /* @__PURE__ */ (0, import_jsx_runtime161.jsxs)("div", { className: "flex flex-col gap-6", children: [
|
|
18253
18265
|
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectAccounts.title }),
|
|
@@ -18282,7 +18294,7 @@ ConnectAccountsStep.displayName = "ConnectAccountsStep";
|
|
|
18282
18294
|
|
|
18283
18295
|
// src/onboarding/steps/connect-onchain-modal.tsx
|
|
18284
18296
|
var import_react34 = require("react");
|
|
18285
|
-
var
|
|
18297
|
+
var import_hooks63 = require("@agg-build/hooks");
|
|
18286
18298
|
var Dialog4 = __toESM(require("@radix-ui/react-dialog"));
|
|
18287
18299
|
var import_jsx_runtime162 = require("react/jsx-runtime");
|
|
18288
18300
|
var ConnectOnchainModal = ({
|
|
@@ -18290,7 +18302,7 @@ var ConnectOnchainModal = ({
|
|
|
18290
18302
|
onOpenChange,
|
|
18291
18303
|
onConnect
|
|
18292
18304
|
}) => {
|
|
18293
|
-
const labels = (0,
|
|
18305
|
+
const labels = (0, import_hooks63.useLabels)();
|
|
18294
18306
|
const [connecting, setConnecting] = (0, import_react34.useState)(false);
|
|
18295
18307
|
const [error, setError] = (0, import_react34.useState)();
|
|
18296
18308
|
const handleCancel = (0, import_react34.useCallback)(() => {
|
|
@@ -18389,7 +18401,7 @@ var ConnectOnchainModal = ({
|
|
|
18389
18401
|
ConnectOnchainModal.displayName = "ConnectOnchainModal";
|
|
18390
18402
|
|
|
18391
18403
|
// src/onboarding/steps/connect-kalshi-modal.tsx
|
|
18392
|
-
var
|
|
18404
|
+
var import_hooks64 = require("@agg-build/hooks");
|
|
18393
18405
|
var import_sdk22 = require("@agg-build/sdk");
|
|
18394
18406
|
var Dialog5 = __toESM(require("@radix-ui/react-dialog"));
|
|
18395
18407
|
var import_react35 = require("react");
|
|
@@ -18416,8 +18428,8 @@ var ConnectKalshiModal = ({
|
|
|
18416
18428
|
onOpenChange,
|
|
18417
18429
|
onVerify
|
|
18418
18430
|
}) => {
|
|
18419
|
-
const labels = (0,
|
|
18420
|
-
const { disabledVenues, isLoading: isAppConfigLoading } = (0,
|
|
18431
|
+
const labels = (0, import_hooks64.useLabels)();
|
|
18432
|
+
const { disabledVenues, isLoading: isAppConfigLoading } = (0, import_hooks64.useAppConfig)();
|
|
18421
18433
|
const apiKeyInputRef = (0, import_react35.useRef)(null);
|
|
18422
18434
|
const errorId = (0, import_react35.useId)();
|
|
18423
18435
|
const [apiKeyId, setApiKeyId] = (0, import_react35.useState)("");
|
|
@@ -18425,7 +18437,7 @@ var ConnectKalshiModal = ({
|
|
|
18425
18437
|
const [isVerifying, setIsVerifying] = (0, import_react35.useState)(false);
|
|
18426
18438
|
const [isConnected, setIsConnected] = (0, import_react35.useState)(false);
|
|
18427
18439
|
const [error, setError] = (0, import_react35.useState)();
|
|
18428
|
-
const availabilityState = (0,
|
|
18440
|
+
const availabilityState = (0, import_hooks64.getVenueAvailabilityState)({
|
|
18429
18441
|
venueId: import_sdk22.Venue.kalshi,
|
|
18430
18442
|
disabledVenues,
|
|
18431
18443
|
isConfigLoading: isAppConfigLoading
|
|
@@ -18727,7 +18739,7 @@ var OnboardingModal = ({
|
|
|
18727
18739
|
connectedOnchain = false
|
|
18728
18740
|
}) => {
|
|
18729
18741
|
var _a;
|
|
18730
|
-
const labels = (0,
|
|
18742
|
+
const labels = (0, import_hooks65.useLabels)();
|
|
18731
18743
|
const [step, setStep] = (0, import_react36.useState)(ONBOARDING_STEPS.HOW_IT_WORKS);
|
|
18732
18744
|
const stepLabels = {
|
|
18733
18745
|
[ONBOARDING_STEPS.HOW_IT_WORKS]: labels.onboarding.modal.stepHowItWorks,
|
|
@@ -18812,12 +18824,12 @@ var requestAggWithdrawModalOpen = () => {
|
|
|
18812
18824
|
};
|
|
18813
18825
|
|
|
18814
18826
|
// src/trading/fund-kalshi-modal.tsx
|
|
18815
|
-
var
|
|
18827
|
+
var import_hooks66 = require("@agg-build/hooks");
|
|
18816
18828
|
var import_sdk23 = require("@agg-build/sdk");
|
|
18817
18829
|
var Dialog7 = __toESM(require("@radix-ui/react-dialog"));
|
|
18818
18830
|
var import_jsx_runtime165 = require("react/jsx-runtime");
|
|
18819
18831
|
var FundKalshiModal = ({ open, onOpenChange }) => {
|
|
18820
|
-
const labels = (0,
|
|
18832
|
+
const labels = (0, import_hooks66.useLabels)();
|
|
18821
18833
|
const modalLabels = labels.trading.fundKalshiModal;
|
|
18822
18834
|
return /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(Modal, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime165.jsxs)(
|
|
18823
18835
|
Modal.Container,
|
|
@@ -19380,8 +19392,14 @@ var extractGeoBlockedVenues = (warnings) => {
|
|
|
19380
19392
|
);
|
|
19381
19393
|
};
|
|
19382
19394
|
var getSmartRouteTotalFees = (feeBreakdown) => {
|
|
19395
|
+
var _a;
|
|
19383
19396
|
if (!feeBreakdown) return null;
|
|
19384
|
-
const feeParts = [
|
|
19397
|
+
const feeParts = [
|
|
19398
|
+
feeBreakdown.venueFees,
|
|
19399
|
+
(_a = feeBreakdown.builderFee) != null ? _a : 0,
|
|
19400
|
+
feeBreakdown.bridgeFees,
|
|
19401
|
+
feeBreakdown.executionGas
|
|
19402
|
+
];
|
|
19385
19403
|
if (!feeParts.every(Number.isFinite)) return null;
|
|
19386
19404
|
return feeParts.reduce((total, fee) => total + Math.round(fee * 100) / 100, 0);
|
|
19387
19405
|
};
|
|
@@ -21784,7 +21802,7 @@ var PlaceOrderSlippageControl = ({
|
|
|
21784
21802
|
minimumValue: slippageMinimumValue
|
|
21785
21803
|
}) => {
|
|
21786
21804
|
var _a, _b;
|
|
21787
|
-
const labels = (0,
|
|
21805
|
+
const labels = (0, import_hooks67.useLabels)();
|
|
21788
21806
|
const containerRef = (0, import_react38.useRef)(null);
|
|
21789
21807
|
const triggerRef = (0, import_react38.useRef)(null);
|
|
21790
21808
|
const inputRef = (0, import_react38.useRef)(null);
|
|
@@ -22058,7 +22076,7 @@ var PlaceOrderResolvedView = ({
|
|
|
22058
22076
|
showResolvingState = false
|
|
22059
22077
|
}) => {
|
|
22060
22078
|
var _a, _b;
|
|
22061
|
-
const labels = (0,
|
|
22079
|
+
const labels = (0, import_hooks67.useLabels)();
|
|
22062
22080
|
const tradingLabels = labels.trading;
|
|
22063
22081
|
const resolvingTimestamp = (_a = resolutionTimestamp != null ? resolutionTimestamp : tradingState.resolvesAt) != null ? _a : tradingState.endsAt;
|
|
22064
22082
|
const isResolvingMarket = showResolvingState && !tradingState.winningOutcome;
|
|
@@ -22360,17 +22378,17 @@ var PlaceOrder = ({
|
|
|
22360
22378
|
features: { enableAnimations, showFeesBreakdown, showLimitOrders: limitOrdersFeature },
|
|
22361
22379
|
formatting: { formatPrice },
|
|
22362
22380
|
general: { locale }
|
|
22363
|
-
} = (0,
|
|
22364
|
-
const labels = (0,
|
|
22381
|
+
} = (0, import_hooks67.useSdkUiConfig)();
|
|
22382
|
+
const labels = (0, import_hooks67.useLabels)();
|
|
22365
22383
|
const tradingLabels = labels.trading;
|
|
22366
22384
|
const toastCtx = useOptionalToast();
|
|
22367
|
-
const { isTradingBlocked } = (0,
|
|
22368
|
-
const tradingContext = (0,
|
|
22385
|
+
const { isTradingBlocked } = (0, import_hooks67.useGeoBlock)();
|
|
22386
|
+
const tradingContext = (0, import_hooks67.useEventTradingContext)();
|
|
22369
22387
|
const selectedEvent = (_a = tradingContext == null ? void 0 : tradingContext.selectedEvent) != null ? _a : null;
|
|
22370
22388
|
const selectedMarket = (_b = tradingContext == null ? void 0 : tradingContext.selectedMarket) != null ? _b : null;
|
|
22371
22389
|
const selectedOutcomeId = (_c = tradingContext == null ? void 0 : tradingContext.selectedOutcomeId) != null ? _c : null;
|
|
22372
22390
|
const resolvedEventTradingState = (0, import_react38.useMemo)(() => {
|
|
22373
|
-
return eventTradingState != null ? eventTradingState : (0,
|
|
22391
|
+
return eventTradingState != null ? eventTradingState : (0, import_hooks67.resolveEventTradingState)(selectedEvent);
|
|
22374
22392
|
}, [eventTradingState, selectedEvent]);
|
|
22375
22393
|
const scopedSelectedEvent = (0, import_react38.useMemo)(() => {
|
|
22376
22394
|
var _a2;
|
|
@@ -22398,7 +22416,7 @@ var PlaceOrder = ({
|
|
|
22398
22416
|
)) != null ? _f : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venueMarketOutcomes[0]) != null ? _g : null;
|
|
22399
22417
|
const scopedSelectedOutcomeId = (_h = scopedSelectedOutcome == null ? void 0 : scopedSelectedOutcome.id) != null ? _h : null;
|
|
22400
22418
|
const resolvedTradingState = (0, import_react38.useMemo)(() => {
|
|
22401
|
-
return (0,
|
|
22419
|
+
return (0, import_hooks67.resolveMarketTradingState)(scopedSelectedMarket);
|
|
22402
22420
|
}, [scopedSelectedMarket]);
|
|
22403
22421
|
const resolvedReadOnlyMarket = (0, import_react38.useMemo)(() => {
|
|
22404
22422
|
var _a2;
|
|
@@ -22412,11 +22430,11 @@ var PlaceOrder = ({
|
|
|
22412
22430
|
scopedSelectedMarket
|
|
22413
22431
|
]);
|
|
22414
22432
|
const resolvedReadOnlyTradingState = (0, import_react38.useMemo)(() => {
|
|
22415
|
-
return (0,
|
|
22433
|
+
return (0, import_hooks67.resolveMarketTradingState)(resolvedReadOnlyMarket);
|
|
22416
22434
|
}, [resolvedReadOnlyMarket]);
|
|
22417
22435
|
const isEndedWithoutKnownWinner = showResolvingState && !resolvedEventTradingState.winningOutcome && !resolvedReadOnlyTradingState.winningOutcome;
|
|
22418
22436
|
const orderEligibility = (0, import_react38.useMemo)(
|
|
22419
|
-
() => (0,
|
|
22437
|
+
() => (0, import_hooks67.resolveOrderEligibility)({
|
|
22420
22438
|
event: scopedSelectedEvent,
|
|
22421
22439
|
market: scopedSelectedMarket,
|
|
22422
22440
|
outcome: scopedSelectedOutcome,
|
|
@@ -22425,16 +22443,16 @@ var PlaceOrder = ({
|
|
|
22425
22443
|
[scopedSelectedEvent, scopedSelectedMarket, scopedSelectedOutcome, resolvedEventTradingState]
|
|
22426
22444
|
);
|
|
22427
22445
|
const isResolvedOutcomeCtaLocked = resolvedEventTradingState.kind === "resolved" || resolvedTradingState.kind === "resolved";
|
|
22428
|
-
const { isAuthenticated, user } = (0,
|
|
22446
|
+
const { isAuthenticated, user } = (0, import_hooks67.useAggAuthContext)();
|
|
22429
22447
|
const sharedKycFlow = useSharedKycFlow({
|
|
22430
22448
|
integration: sharedKyc,
|
|
22431
22449
|
userId: isAuthenticated ? user == null ? void 0 : user.id : null,
|
|
22432
22450
|
fallbackErrorMessage: tradingLabels.sharedKyc.modal.error
|
|
22433
22451
|
});
|
|
22434
|
-
const { executionMode: resolvedExecutionMode, isPaperMode } = (0,
|
|
22452
|
+
const { executionMode: resolvedExecutionMode, isPaperMode } = (0, import_hooks67.useResolvedExecutionMode)(executionMode);
|
|
22435
22453
|
const showLimitOrders = limitOrdersFeature && !isPaperMode;
|
|
22436
|
-
const liveBalanceState = (0,
|
|
22437
|
-
const paperBalancesQuery = (0,
|
|
22454
|
+
const liveBalanceState = (0, import_hooks67.useAggBalanceState)();
|
|
22455
|
+
const paperBalancesQuery = (0, import_hooks67.useManagedBalances)({
|
|
22438
22456
|
enabled: Boolean(isAuthenticated && isPaperMode),
|
|
22439
22457
|
mode: "paper"
|
|
22440
22458
|
});
|
|
@@ -22454,22 +22472,22 @@ var PlaceOrder = ({
|
|
|
22454
22472
|
const liveAvailableBalance = (_i = liveBalanceState.availableBalance) != null ? _i : liveBalanceState.totalBalance;
|
|
22455
22473
|
const totalBalance = isPaperMode ? paperTotalBalance : liveAvailableBalance;
|
|
22456
22474
|
const isBalanceLoading = isPaperMode ? paperBalancesQuery.isLoading : liveBalanceState.isLoading;
|
|
22457
|
-
const executeManaged = (0,
|
|
22458
|
-
const placeLimitOrder = (0,
|
|
22459
|
-
const aggClient = (0,
|
|
22460
|
-
const queryClient = (0,
|
|
22461
|
-
const { disabledVenues, isLoading: isAppConfigLoading } = (0,
|
|
22462
|
-
const { data: kalshiKeyStatus, refetch: refetchKalshiKeyStatus } = (0,
|
|
22475
|
+
const executeManaged = (0, import_hooks67.useExecuteManaged)();
|
|
22476
|
+
const placeLimitOrder = (0, import_hooks67.usePlaceLimitOrder)();
|
|
22477
|
+
const aggClient = (0, import_hooks67.useAggClient)();
|
|
22478
|
+
const queryClient = (0, import_hooks67.useQueryClient)();
|
|
22479
|
+
const { disabledVenues, isLoading: isAppConfigLoading } = (0, import_hooks67.useAppConfig)();
|
|
22480
|
+
const { data: kalshiKeyStatus, refetch: refetchKalshiKeyStatus } = (0, import_hooks67.useVenueKeyStatus)(
|
|
22463
22481
|
import_sdk24.Venue.kalshi,
|
|
22464
22482
|
isAuthenticated
|
|
22465
22483
|
);
|
|
22466
22484
|
const [isConnectKalshiModalOpen, setIsConnectKalshiModalOpen] = (0, import_react38.useState)(false);
|
|
22467
22485
|
const [isFundKalshiModalOpen, setIsFundKalshiModalOpen] = (0, import_react38.useState)(false);
|
|
22468
|
-
const livePrices = (0,
|
|
22486
|
+
const livePrices = (0, import_hooks67.useLiveOutcomePrices)(
|
|
22469
22487
|
scopedSelectedMarket ? [scopedSelectedMarket] : void 0
|
|
22470
22488
|
);
|
|
22471
|
-
const wsBestPrices = (0,
|
|
22472
|
-
const fetchedClusterMidpointResult = (0,
|
|
22489
|
+
const wsBestPrices = (0, import_hooks67.useLiveBestPrices)(scopedSelectedMarket ? [scopedSelectedMarket] : void 0);
|
|
22490
|
+
const fetchedClusterMidpointResult = (0, import_hooks67.useMidpoints)(
|
|
22473
22491
|
midpointsResult ? [] : scopedSelectedMarket ? [scopedSelectedMarket] : []
|
|
22474
22492
|
);
|
|
22475
22493
|
const clusterMidpointResult = midpointsResult != null ? midpointsResult : fetchedClusterMidpointResult;
|
|
@@ -22477,7 +22495,7 @@ var PlaceOrder = ({
|
|
|
22477
22495
|
const clusterBestMidpoint = clusterMidpointResult.bestMidpoint;
|
|
22478
22496
|
const clusterBestPricesRest = clusterMidpointResult.bestPrices;
|
|
22479
22497
|
const clusterBestPrices = (0, import_react38.useMemo)(
|
|
22480
|
-
() => (0,
|
|
22498
|
+
() => (0, import_hooks67.mergeBestPricesPreferringLive)(clusterBestPricesRest, wsBestPrices),
|
|
22481
22499
|
[clusterBestPricesRest, wsBestPrices]
|
|
22482
22500
|
);
|
|
22483
22501
|
const [internalTab, setInternalTab] = (0, import_react38.useState)("buy");
|
|
@@ -22571,7 +22589,7 @@ var PlaceOrder = ({
|
|
|
22571
22589
|
scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.id,
|
|
22572
22590
|
scopedSelectedOutcomeId
|
|
22573
22591
|
]);
|
|
22574
|
-
const debouncedAmount = (0,
|
|
22592
|
+
const debouncedAmount = (0, import_hooks67.useDebouncedValue)(internalAmount, 300);
|
|
22575
22593
|
const isQuoteInputEditing = internalAmount !== debouncedAmount;
|
|
22576
22594
|
const isLimitOrder = showLimitOrders && executionType === "limit";
|
|
22577
22595
|
const isSell = (0, import_react38.useMemo)(() => internalTab === "sell", [internalTab]);
|
|
@@ -22589,7 +22607,7 @@ var PlaceOrder = ({
|
|
|
22589
22607
|
);
|
|
22590
22608
|
const visibleLimitVenueOptions = (0, import_react38.useMemo)(() => {
|
|
22591
22609
|
return limitVenueOptions.filter((option) => {
|
|
22592
|
-
return (0,
|
|
22610
|
+
return (0, import_hooks67.getVenueAvailabilityState)({
|
|
22593
22611
|
venueId: option.venue,
|
|
22594
22612
|
disabledVenues,
|
|
22595
22613
|
isConfigLoading: isAppConfigLoading
|
|
@@ -22601,7 +22619,7 @@ var PlaceOrder = ({
|
|
|
22601
22619
|
dataUpdatedAt: executionPositionsUpdatedAt,
|
|
22602
22620
|
isLoading: isExecutionPositionsLoading,
|
|
22603
22621
|
isFetching: isExecutionPositionsFetching
|
|
22604
|
-
} = (0,
|
|
22622
|
+
} = (0, import_hooks67.useExecutionPositions)({
|
|
22605
22623
|
enabled: Boolean(isAuthenticated && isSell),
|
|
22606
22624
|
mode: isPaperMode ? "paper" : void 0
|
|
22607
22625
|
});
|
|
@@ -22635,7 +22653,7 @@ var PlaceOrder = ({
|
|
|
22635
22653
|
);
|
|
22636
22654
|
const hasValidLimitVenueQuoteAmount = debouncedAmount > 0;
|
|
22637
22655
|
const isLimitVenueQuoteEnabled = isLimitOrder && isQuotePanelActive && !isEndedWithoutKnownWinner && !submissionProgressState && !isBeforeActionPending && !placeLimitOrder.isPending && hasValidLimitVenueQuoteAmount && orderEligibility.canPlaceOrder && (!isSell || sellFilledForOutcomeId === scopedSelectedOutcomeId && !isQuoteInputEditing);
|
|
22638
|
-
const limitVenueQuotes = (0,
|
|
22656
|
+
const limitVenueQuotes = (0, import_hooks67.useLimitOrderVenueQuotes)({
|
|
22639
22657
|
requests: limitVenueQuoteRequests,
|
|
22640
22658
|
tradeSide: internalTab,
|
|
22641
22659
|
amount: debouncedAmount,
|
|
@@ -22669,7 +22687,7 @@ var PlaceOrder = ({
|
|
|
22669
22687
|
// server's reservation check — and the automatic pick, which sorts on
|
|
22670
22688
|
// price alone, would happily choose one. Only narrow once we know
|
|
22671
22689
|
// where the shares are; an empty map means positions haven't resolved.
|
|
22672
|
-
(!isSell || sellableSharesByVenue.size === 0 || ((_a2 = sellableSharesByVenue.get(option.venue)) != null ? _a2 : 0) > 0) && (0,
|
|
22690
|
+
(!isSell || sellableSharesByVenue.size === 0 || ((_a2 = sellableSharesByVenue.get(option.venue)) != null ? _a2 : 0) > 0) && (0, import_hooks67.getVenueAvailabilityState)({
|
|
22673
22691
|
venueId: option.venue,
|
|
22674
22692
|
disabledVenues,
|
|
22675
22693
|
isConfigLoading: isAppConfigLoading
|
|
@@ -22700,7 +22718,7 @@ var PlaceOrder = ({
|
|
|
22700
22718
|
if (!selectedLimitVenue || !geoBlockedLimitVenues.has(selectedLimitVenue)) return;
|
|
22701
22719
|
setSelectedLimitVenue(null);
|
|
22702
22720
|
}, [geoBlockedLimitVenues, selectedLimitVenue]);
|
|
22703
|
-
const smartRoute = (0,
|
|
22721
|
+
const smartRoute = (0, import_hooks67.useSmartRoute)(__spreadProps(__spreadValues({
|
|
22704
22722
|
venueMarketOutcomeId: scopedSelectedOutcomeId,
|
|
22705
22723
|
maxSpend: isSell ? void 0 : debouncedAmount,
|
|
22706
22724
|
sellShares: isSell ? debouncedAmount : void 0,
|
|
@@ -22773,7 +22791,7 @@ var PlaceOrder = ({
|
|
|
22773
22791
|
},
|
|
22774
22792
|
[debouncedAmount, isSell, scopedSelectedOutcomeId, smartRoute.data, smartRoute.isLoading]
|
|
22775
22793
|
);
|
|
22776
|
-
const venueSellQuotes = (0,
|
|
22794
|
+
const venueSellQuotes = (0, import_hooks67.useVenueSellQuotes)({
|
|
22777
22795
|
venueMarketOutcomeId: scopedSelectedOutcomeId,
|
|
22778
22796
|
accountId: (_n = user == null ? void 0 : user.id) != null ? _n : null,
|
|
22779
22797
|
positionVersion: executionPositionsUpdatedAt,
|
|
@@ -22998,7 +23016,7 @@ var PlaceOrder = ({
|
|
|
22998
23016
|
);
|
|
22999
23017
|
const isKalshiAccountActive = (_F = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.connected) != null ? _F : (legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.status) === "active";
|
|
23000
23018
|
const hasKalshiConnectionState = kalshiKeyStatus !== void 0 || (user == null ? void 0 : user.venueAccounts) != null;
|
|
23001
|
-
const isKalshiAvailable = (0,
|
|
23019
|
+
const isKalshiAvailable = (0, import_hooks67.getVenueAvailabilityState)({
|
|
23002
23020
|
venueId: "kalshi",
|
|
23003
23021
|
disabledVenues,
|
|
23004
23022
|
isConfigLoading: isAppConfigLoading
|
|
@@ -23053,7 +23071,7 @@ var PlaceOrder = ({
|
|
|
23053
23071
|
scopedSelectedOutcomeId
|
|
23054
23072
|
]
|
|
23055
23073
|
);
|
|
23056
|
-
const executionProgress = (0,
|
|
23074
|
+
const executionProgress = (0, import_hooks67.useExecutionProgress)({
|
|
23057
23075
|
orderIds: (_G = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) != null ? _G : null,
|
|
23058
23076
|
quoteId: (_H = submissionProgressState == null ? void 0 : submissionProgressState.quoteId) != null ? _H : null,
|
|
23059
23077
|
mode: isPaperMode ? "paper" : void 0,
|
|
@@ -23401,8 +23419,8 @@ var PlaceOrder = ({
|
|
|
23401
23419
|
}
|
|
23402
23420
|
if (submissionProgressState.phase === "success" && submissionProgressState.summary) {
|
|
23403
23421
|
emitTerminalOrderNotifications();
|
|
23404
|
-
(0,
|
|
23405
|
-
(0,
|
|
23422
|
+
(0, import_hooks67.invalidateBalanceQueries)(queryClient);
|
|
23423
|
+
(0, import_hooks67.invalidatePositionQueries)(queryClient);
|
|
23406
23424
|
if (debugStore && debugAttemptId) {
|
|
23407
23425
|
debugStore.updateAttempt(debugAttemptId, {
|
|
23408
23426
|
status: "succeeded",
|
|
@@ -23706,7 +23724,7 @@ var PlaceOrder = ({
|
|
|
23706
23724
|
limitPriceRaw: effectiveLimitPriceRaw,
|
|
23707
23725
|
side: internalTab
|
|
23708
23726
|
});
|
|
23709
|
-
const availabilityState = (0,
|
|
23727
|
+
const availabilityState = (0, import_hooks67.getVenueAvailabilityState)({
|
|
23710
23728
|
venueId: option.venue,
|
|
23711
23729
|
disabledVenues,
|
|
23712
23730
|
isConfigLoading: isAppConfigLoading
|
|
@@ -23776,6 +23794,7 @@ var PlaceOrder = ({
|
|
|
23776
23794
|
return formatUsd(totalFees, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
23777
23795
|
}, [activeFeeBreakdown]);
|
|
23778
23796
|
const feeBreakdownRows = (0, import_react38.useMemo)(() => {
|
|
23797
|
+
var _a2, _b2;
|
|
23779
23798
|
if (!activeFeeBreakdown) return [];
|
|
23780
23799
|
return [
|
|
23781
23800
|
{
|
|
@@ -23786,6 +23805,18 @@ var PlaceOrder = ({
|
|
|
23786
23805
|
maximumFractionDigits: 2
|
|
23787
23806
|
})
|
|
23788
23807
|
},
|
|
23808
|
+
// Only Hyperliquid charges a builder slice today; every other route
|
|
23809
|
+
// would show a bare "$0.00" line.
|
|
23810
|
+
...((_a2 = activeFeeBreakdown.builderFee) != null ? _a2 : 0) > 0 ? [
|
|
23811
|
+
{
|
|
23812
|
+
kind: "amount",
|
|
23813
|
+
label: tradingLabels.feeBreakdownBuilderFee,
|
|
23814
|
+
value: formatUsd((_b2 = activeFeeBreakdown.builderFee) != null ? _b2 : 0, {
|
|
23815
|
+
minimumFractionDigits: 2,
|
|
23816
|
+
maximumFractionDigits: 2
|
|
23817
|
+
})
|
|
23818
|
+
}
|
|
23819
|
+
] : [],
|
|
23789
23820
|
{
|
|
23790
23821
|
kind: "amount",
|
|
23791
23822
|
label: tradingLabels.feeBreakdownExecutionGas,
|
|
@@ -25237,7 +25268,7 @@ var PlaceOrder = ({
|
|
|
25237
25268
|
className: "agg-order-submit h-12 w-full px-8 text-agg-base leading-agg-6 shadow-none",
|
|
25238
25269
|
disabled: !orderEligibility.canPlaceOrder || shouldShowGeoBlockBanner,
|
|
25239
25270
|
"aria-label": tradingLabels.signInToTrade,
|
|
25240
|
-
onClick:
|
|
25271
|
+
onClick: import_hooks67.requestAggAuthChooserOpen,
|
|
25241
25272
|
children: tradingLabels.signInToTrade
|
|
25242
25273
|
}
|
|
25243
25274
|
) : /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(
|
|
@@ -25313,7 +25344,7 @@ var PlaceOrder = ({
|
|
|
25313
25344
|
PlaceOrder.displayName = "PlaceOrder";
|
|
25314
25345
|
|
|
25315
25346
|
// src/trading/use-claim-winnings.ts
|
|
25316
|
-
var
|
|
25347
|
+
var import_hooks68 = require("@agg-build/hooks");
|
|
25317
25348
|
var import_react39 = require("react");
|
|
25318
25349
|
var toClaimError = (err) => {
|
|
25319
25350
|
if (err instanceof Error) return err;
|
|
@@ -25321,11 +25352,11 @@ var toClaimError = (err) => {
|
|
|
25321
25352
|
};
|
|
25322
25353
|
function useClaimWinnings(options = {}) {
|
|
25323
25354
|
const { onClaim, onClaimResult, onClaimSubmitError, externalClaimingKeys } = options;
|
|
25324
|
-
const labels = (0,
|
|
25355
|
+
const labels = (0, import_hooks68.useLabels)();
|
|
25325
25356
|
const claimNotificationLabels = labels.notifications.claim;
|
|
25326
25357
|
const toastCtx = useOptionalToast();
|
|
25327
|
-
const queryClient = (0,
|
|
25328
|
-
const redeemMutation = (0,
|
|
25358
|
+
const queryClient = (0, import_hooks68.useQueryClient)();
|
|
25359
|
+
const redeemMutation = (0, import_hooks68.useRedeem)();
|
|
25329
25360
|
const [activeRedeems, setActiveRedeems] = (0, import_react39.useState)({});
|
|
25330
25361
|
const activeClaimKeysRef = (0, import_react39.useRef)(/* @__PURE__ */ new Set());
|
|
25331
25362
|
const pendingClaimToastIdsRef = (0, import_react39.useRef)({});
|
|
@@ -25335,7 +25366,7 @@ function useClaimWinnings(options = {}) {
|
|
|
25335
25366
|
() => Object.values(activeRedeems),
|
|
25336
25367
|
[activeRedeems]
|
|
25337
25368
|
);
|
|
25338
|
-
const lifecycleStates = (0,
|
|
25369
|
+
const lifecycleStates = (0, import_hooks68.useRedeemLifecycles)(lifecycleInputs);
|
|
25339
25370
|
const internalClaimingIds = (0, import_react39.useMemo)(() => {
|
|
25340
25371
|
const out = __spreadValues({}, submittingClaimKeys);
|
|
25341
25372
|
for (const [claimKey, active] of Object.entries(activeRedeems)) {
|
|
@@ -25350,13 +25381,13 @@ function useClaimWinnings(options = {}) {
|
|
|
25350
25381
|
[externalClaimingKeys, internalClaimingIds]
|
|
25351
25382
|
);
|
|
25352
25383
|
const invalidateClaimUiState = (0, import_react39.useCallback)(() => {
|
|
25353
|
-
(0,
|
|
25354
|
-
(0,
|
|
25384
|
+
(0, import_hooks68.invalidateBalanceQueries)(queryClient);
|
|
25385
|
+
(0, import_hooks68.invalidatePositionQueries)(queryClient);
|
|
25355
25386
|
queryClient.invalidateQueries({
|
|
25356
|
-
queryKey:
|
|
25387
|
+
queryKey: import_hooks68.executionKeys.claimablePositionsCount(),
|
|
25357
25388
|
refetchType: "active"
|
|
25358
25389
|
});
|
|
25359
|
-
(0,
|
|
25390
|
+
(0, import_hooks68.invalidateUserActivityQueries)(queryClient);
|
|
25360
25391
|
}, [queryClient]);
|
|
25361
25392
|
const claim = (0, import_react39.useCallback)(
|
|
25362
25393
|
(_0) => __async(null, [_0], function* ({ claimKey, winningOutcomeIds, payload }) {
|
|
@@ -25553,7 +25584,7 @@ function useClaimWinnings(options = {}) {
|
|
|
25553
25584
|
}
|
|
25554
25585
|
|
|
25555
25586
|
// src/trading/use-resolved-market-claim.ts
|
|
25556
|
-
var
|
|
25587
|
+
var import_hooks69 = require("@agg-build/hooks");
|
|
25557
25588
|
var import_react40 = require("react");
|
|
25558
25589
|
var sharesFormatter = new Intl.NumberFormat("en-US", { maximumFractionDigits: 2 });
|
|
25559
25590
|
var dateFormatter = new Intl.DateTimeFormat("en-US", {
|
|
@@ -25570,12 +25601,12 @@ var formatResolutionDate = (value) => {
|
|
|
25570
25601
|
function useResolvedMarketClaim(options = {}) {
|
|
25571
25602
|
var _a;
|
|
25572
25603
|
const { market, enabled = true, executionMode } = options;
|
|
25573
|
-
const { isAuthenticated } = (0,
|
|
25574
|
-
const tradingState = (0, import_react40.useMemo)(() => (0,
|
|
25604
|
+
const { isAuthenticated } = (0, import_hooks69.useAggAuthState)();
|
|
25605
|
+
const tradingState = (0, import_react40.useMemo)(() => (0, import_hooks69.resolveMarketTradingState)(market), [market]);
|
|
25575
25606
|
const isResolved = tradingState.kind === "resolved";
|
|
25576
25607
|
const marketId = (_a = market == null ? void 0 : market.id) != null ? _a : null;
|
|
25577
25608
|
const shouldFetch = Boolean(enabled && isAuthenticated && isResolved && marketId);
|
|
25578
|
-
const { positions } = (0,
|
|
25609
|
+
const { positions } = (0, import_hooks69.useExecutionPositions)(__spreadValues({
|
|
25579
25610
|
enabled: shouldFetch,
|
|
25580
25611
|
status: "active",
|
|
25581
25612
|
limit: 50
|
|
@@ -25592,7 +25623,7 @@ function useResolvedMarketClaim(options = {}) {
|
|
|
25592
25623
|
(outcome) => outcome.winner === true && outcome.totalSize > 0
|
|
25593
25624
|
);
|
|
25594
25625
|
if (winningOutcomes.length === 0) return void 0;
|
|
25595
|
-
const totals = (0,
|
|
25626
|
+
const totals = (0, import_hooks69.computeClosedPositionTotals)(group);
|
|
25596
25627
|
const winningShares = winningOutcomes.reduce((sum, outcome) => sum + outcome.totalSize, 0);
|
|
25597
25628
|
const winningOutcomeLabel = (_a2 = resolveResolvedOutcomeLabel({
|
|
25598
25629
|
market: market != null ? market : group.venueMarket,
|
|
@@ -25676,7 +25707,7 @@ var resolveEventMarketPageStickyState = ({
|
|
|
25676
25707
|
};
|
|
25677
25708
|
|
|
25678
25709
|
// src/pages/event-market/event-market.shared.tsx
|
|
25679
|
-
var
|
|
25710
|
+
var import_hooks70 = require("@agg-build/hooks");
|
|
25680
25711
|
var Dialog8 = __toESM(require("@radix-ui/react-dialog"));
|
|
25681
25712
|
var import_react41 = require("react");
|
|
25682
25713
|
var import_jsx_runtime170 = require("react/jsx-runtime");
|
|
@@ -25746,7 +25777,7 @@ var EventMarketPageMobileTrade = ({
|
|
|
25746
25777
|
onBeforePrimaryAction,
|
|
25747
25778
|
sharedKyc
|
|
25748
25779
|
}) => {
|
|
25749
|
-
const labels = (0,
|
|
25780
|
+
const labels = (0, import_hooks70.useLabels)();
|
|
25750
25781
|
if (!showPlaceOrder) return null;
|
|
25751
25782
|
const handleOpenChange = (nextOpen) => {
|
|
25752
25783
|
onOpenChange(nextOpen);
|
|
@@ -25802,7 +25833,7 @@ var EventMarketPageMobileTrade = ({
|
|
|
25802
25833
|
var EventMarketPageUnavailableState = ({
|
|
25803
25834
|
ariaLabel: _ariaLabel
|
|
25804
25835
|
}) => {
|
|
25805
|
-
const labels = (0,
|
|
25836
|
+
const labels = (0, import_hooks70.useLabels)();
|
|
25806
25837
|
return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(
|
|
25807
25838
|
StateMessage,
|
|
25808
25839
|
{
|
|
@@ -25818,7 +25849,7 @@ var EventMarketPageUnavailableState = ({
|
|
|
25818
25849
|
var EventMarketPageNotFoundState = ({
|
|
25819
25850
|
ariaLabel: _ariaLabel
|
|
25820
25851
|
}) => {
|
|
25821
|
-
const labels = (0,
|
|
25852
|
+
const labels = (0, import_hooks70.useLabels)();
|
|
25822
25853
|
return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(
|
|
25823
25854
|
StateMessage,
|
|
25824
25855
|
{
|
|
@@ -25915,11 +25946,11 @@ var EventMarketPageLoadingState = ({
|
|
|
25915
25946
|
};
|
|
25916
25947
|
|
|
25917
25948
|
// src/pages/event-market/sports-event-market-page.tsx
|
|
25918
|
-
var
|
|
25949
|
+
var import_hooks73 = require("@agg-build/hooks");
|
|
25919
25950
|
var import_react44 = require("react");
|
|
25920
25951
|
|
|
25921
25952
|
// src/pages/event-market/sports-markets.tsx
|
|
25922
|
-
var
|
|
25953
|
+
var import_hooks72 = require("@agg-build/hooks");
|
|
25923
25954
|
var import_react43 = require("react");
|
|
25924
25955
|
|
|
25925
25956
|
// src/pages/event-market/sports-event-market.utils.ts
|
|
@@ -26924,7 +26955,7 @@ var mergeSportsSectionMarketsIntoEvent = ({
|
|
|
26924
26955
|
};
|
|
26925
26956
|
|
|
26926
26957
|
// src/pages/event-market/sports-market-card.tsx
|
|
26927
|
-
var
|
|
26958
|
+
var import_hooks71 = require("@agg-build/hooks");
|
|
26928
26959
|
var import_react42 = require("react");
|
|
26929
26960
|
|
|
26930
26961
|
// src/pages/event-market/sports-line-rail.tsx
|
|
@@ -27273,11 +27304,11 @@ var SportsMarketCard = ({
|
|
|
27273
27304
|
midpointsResult
|
|
27274
27305
|
}) => {
|
|
27275
27306
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
27276
|
-
const labels = (0,
|
|
27307
|
+
const labels = (0, import_hooks71.useLabels)();
|
|
27277
27308
|
const {
|
|
27278
27309
|
formatting: { formatCompactCurrency }
|
|
27279
|
-
} = (0,
|
|
27280
|
-
const tradingContext = (0,
|
|
27310
|
+
} = (0, import_hooks71.useSdkUiConfig)();
|
|
27311
|
+
const tradingContext = (0, import_hooks71.useEventTradingContext)();
|
|
27281
27312
|
const slide = (0, import_react42.useMemo)(() => buildSportsSlideFromGroup(group), [group]);
|
|
27282
27313
|
const [selectedLineIndex, setSelectedLineIndex] = (0, import_react42.useState)(slide.defaultStopIndex);
|
|
27283
27314
|
const combinedLegs = (0, import_react42.useMemo)(() => resolveSportsCombinedLegs(group), [group]);
|
|
@@ -27318,7 +27349,7 @@ var SportsMarketCard = ({
|
|
|
27318
27349
|
const justOpened = isExpanded && !wasExpandedRef.current;
|
|
27319
27350
|
wasExpandedRef.current = isExpanded;
|
|
27320
27351
|
if (!justOpened || !activeMarket) return;
|
|
27321
|
-
if ((0,
|
|
27352
|
+
if ((0, import_hooks71.resolveMarketTradingState)(activeMarket).isTradingDisabled) return;
|
|
27322
27353
|
const selectedOutcomeId = tradingContext == null ? void 0 : tradingContext.selectedOutcomeId;
|
|
27323
27354
|
const hasInScopeOutcome = selectedOutcomeId != null && activeMarket.venueMarketOutcomes.some((outcome) => outcome.id === selectedOutcomeId);
|
|
27324
27355
|
if (hasInScopeOutcome) return;
|
|
@@ -27438,7 +27469,7 @@ var SportsMarketCard = ({
|
|
|
27438
27469
|
stops: slide.stops.map((stop) => ({
|
|
27439
27470
|
value: stop.value,
|
|
27440
27471
|
venues: stop.venues,
|
|
27441
|
-
disabled: stop.market.status !==
|
|
27472
|
+
disabled: stop.market.status !== import_hooks71.MarketStatus.open
|
|
27442
27473
|
})),
|
|
27443
27474
|
selectedIndex: selectedLineIndex,
|
|
27444
27475
|
onSelect: handleLineSelect,
|
|
@@ -27542,7 +27573,7 @@ var SportsTabButton = ({
|
|
|
27542
27573
|
);
|
|
27543
27574
|
};
|
|
27544
27575
|
var SportsMarketsLoadingState = () => {
|
|
27545
|
-
const labels = (0,
|
|
27576
|
+
const labels = (0, import_hooks72.useLabels)();
|
|
27546
27577
|
return /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)(
|
|
27547
27578
|
"div",
|
|
27548
27579
|
{
|
|
@@ -27580,13 +27611,13 @@ var SportsMarkets = ({
|
|
|
27580
27611
|
midpointsResult
|
|
27581
27612
|
}) => {
|
|
27582
27613
|
var _a, _b;
|
|
27583
|
-
const labels = (0,
|
|
27584
|
-
const tradingContext = (0,
|
|
27614
|
+
const labels = (0, import_hooks72.useLabels)();
|
|
27615
|
+
const tradingContext = (0, import_hooks72.useEventTradingContext)();
|
|
27585
27616
|
const hasAggKey = Boolean(event.aggKey);
|
|
27586
|
-
const gameMarketsQuery = (0,
|
|
27617
|
+
const gameMarketsQuery = (0, import_hooks72.useVenueMarkets)({
|
|
27587
27618
|
aggKey: event.aggKey ? [event.aggKey] : void 0,
|
|
27588
27619
|
limit: 100,
|
|
27589
|
-
status:
|
|
27620
|
+
status: import_hooks72.MarketStatus.open,
|
|
27590
27621
|
enabled: hasAggKey
|
|
27591
27622
|
});
|
|
27592
27623
|
const {
|
|
@@ -27622,7 +27653,7 @@ var SportsMarkets = ({
|
|
|
27622
27653
|
const [stableMarketsByTab, setStableMarketsByTab] = (0, import_react43.useState)({});
|
|
27623
27654
|
const activeTabLabel = resolveSportsSectionLabel(labels, activeTab);
|
|
27624
27655
|
const sectionFilters = resolveSportsSectionFilters(activeTab);
|
|
27625
|
-
const sectionMarketsQuery = (0,
|
|
27656
|
+
const sectionMarketsQuery = (0, import_hooks72.useVenueMarkets)({
|
|
27626
27657
|
aggKey: event.aggKey ? [event.aggKey] : void 0,
|
|
27627
27658
|
sportsMarketType: sectionFilters.sportsMarketType,
|
|
27628
27659
|
period: sectionFilters.period,
|
|
@@ -27632,7 +27663,7 @@ var SportsMarkets = ({
|
|
|
27632
27663
|
// heavy tab (e.g. "Other" spans other/team_props/player_props/specials/
|
|
27633
27664
|
// completion — hundreds of markets on prop-rich events) from ~15 calls to 1-3.
|
|
27634
27665
|
limit: 100,
|
|
27635
|
-
status:
|
|
27666
|
+
status: import_hooks72.MarketStatus.open,
|
|
27636
27667
|
enabled: hasAggKey
|
|
27637
27668
|
});
|
|
27638
27669
|
const {
|
|
@@ -27718,7 +27749,7 @@ var SportsMarkets = ({
|
|
|
27718
27749
|
return;
|
|
27719
27750
|
}
|
|
27720
27751
|
setExpandedGroupId(groupId);
|
|
27721
|
-
if ((0,
|
|
27752
|
+
if ((0, import_hooks72.resolveMarketTradingState)(market).isTradingDisabled) return;
|
|
27722
27753
|
if (market.id !== (tradingContext == null ? void 0 : tradingContext.selectedMarketId)) {
|
|
27723
27754
|
tradingContext == null ? void 0 : tradingContext.selectMarket(market.id, market);
|
|
27724
27755
|
}
|
|
@@ -27834,7 +27865,7 @@ var SportsEventMarketPage = ({
|
|
|
27834
27865
|
sectionMarketsByKey
|
|
27835
27866
|
});
|
|
27836
27867
|
}, [event, sectionMarketsByKey]);
|
|
27837
|
-
const eventTradingState = (0, import_react44.useMemo)(() => (0,
|
|
27868
|
+
const eventTradingState = (0, import_react44.useMemo)(() => (0, import_hooks73.resolveEventTradingState)(composedEvent), [composedEvent]);
|
|
27838
27869
|
const hasSportsSections = (0, import_react44.useMemo)(
|
|
27839
27870
|
() => resolveVisibleSportsSectionTabs(event).length > 0,
|
|
27840
27871
|
[event]
|
|
@@ -27842,12 +27873,12 @@ var SportsEventMarketPage = ({
|
|
|
27842
27873
|
const stickyOrderPanelState = resolveEventMarketPageStickyState({
|
|
27843
27874
|
stickyOrderPanel
|
|
27844
27875
|
});
|
|
27845
|
-
const { executionMode: resolvedExecutionMode } = (0,
|
|
27876
|
+
const { executionMode: resolvedExecutionMode } = (0, import_hooks73.useResolvedExecutionMode)(executionMode);
|
|
27846
27877
|
const [isMobileTradeOpen, setIsMobileTradeOpen] = (0, import_react44.useState)(false);
|
|
27847
27878
|
const isMobileViewport = useIsMobileEventMarketViewport(SPORTS_EVENT_MARKET_MEDIA_QUERY);
|
|
27848
|
-
const tradingContext = (0,
|
|
27849
|
-
const { stateByEventId: sportsLiveStateByEventId } = (0,
|
|
27850
|
-
const midpointsResult = (0,
|
|
27879
|
+
const tradingContext = (0, import_hooks73.useEventTradingContext)();
|
|
27880
|
+
const { stateByEventId: sportsLiveStateByEventId } = (0, import_hooks73.useSportsLive)([event.id]);
|
|
27881
|
+
const midpointsResult = (0, import_hooks73.useMidpoints)(composedEvent.venueMarkets);
|
|
27851
27882
|
const internalResolvedClaim = useResolvedMarketClaim({
|
|
27852
27883
|
market: eventTradingState.primaryMarket,
|
|
27853
27884
|
enabled: eventTradingState.kind === "resolved",
|
|
@@ -27859,7 +27890,7 @@ var SportsEventMarketPage = ({
|
|
|
27859
27890
|
(0, import_react44.useEffect)(() => {
|
|
27860
27891
|
return () => {
|
|
27861
27892
|
var _a;
|
|
27862
|
-
(_a = setTradeSideRef.current) == null ? void 0 : _a.call(setTradeSideRef,
|
|
27893
|
+
(_a = setTradeSideRef.current) == null ? void 0 : _a.call(setTradeSideRef, import_hooks73.TradeSide.Buy);
|
|
27863
27894
|
};
|
|
27864
27895
|
}, []);
|
|
27865
27896
|
const handleSectionMarketsChange = (0, import_react44.useCallback)(
|
|
@@ -28070,19 +28101,19 @@ var EventMarketPageContent = ({
|
|
|
28070
28101
|
onRecurringMarketNavigate
|
|
28071
28102
|
}) => {
|
|
28072
28103
|
var _a;
|
|
28073
|
-
const eventTradingState = (0, import_react45.useMemo)(() => (0,
|
|
28104
|
+
const eventTradingState = (0, import_react45.useMemo)(() => (0, import_hooks74.resolveEventTradingState)(event), [event]);
|
|
28074
28105
|
const stickyOrderPanelState = resolveEventMarketPageStickyState({
|
|
28075
28106
|
stickyOrderPanel
|
|
28076
28107
|
});
|
|
28077
|
-
const { executionMode: resolvedExecutionMode } = (0,
|
|
28108
|
+
const { executionMode: resolvedExecutionMode } = (0, import_hooks74.useResolvedExecutionMode)(executionMode);
|
|
28078
28109
|
const [isMobileTradeOpen, setIsMobileTradeOpen] = (0, import_react45.useState)(false);
|
|
28079
28110
|
const isMobileViewport = useIsMobileEventMarketViewport();
|
|
28080
|
-
const tradingContext = (0,
|
|
28081
|
-
const labels = (0,
|
|
28082
|
-
const recurringQuery = (0,
|
|
28111
|
+
const tradingContext = (0, import_hooks74.useEventTradingContext)();
|
|
28112
|
+
const labels = (0, import_hooks74.useLabels)();
|
|
28113
|
+
const recurringQuery = (0, import_hooks74.useRecurringCryptoMarkets)({ event });
|
|
28083
28114
|
const currentTimestamp = useCurrentTimestamp(recurringQuery.isRecurringCryptoMarket);
|
|
28084
28115
|
const recurringTimeline = (0, import_react45.useMemo)(
|
|
28085
|
-
() => currentTimestamp == null ? null : (0,
|
|
28116
|
+
() => currentTimestamp == null ? null : (0, import_hooks74.resolveRecurringCryptoTimeline)(recurringQuery.windows, event, currentTimestamp),
|
|
28086
28117
|
[currentTimestamp, event, recurringQuery.windows]
|
|
28087
28118
|
);
|
|
28088
28119
|
const isRecurringCryptoMarket = (recurringTimeline == null ? void 0 : recurringTimeline.viewed) != null;
|
|
@@ -28162,7 +28193,7 @@ var EventMarketPageContent = ({
|
|
|
28162
28193
|
() => normalizeVenueMarketCluster(event.venueMarkets),
|
|
28163
28194
|
[event.venueMarkets]
|
|
28164
28195
|
);
|
|
28165
|
-
const midpointsResult = (0,
|
|
28196
|
+
const midpointsResult = (0, import_hooks74.useMidpoints)(
|
|
28166
28197
|
recurringQuery.isRecurringCryptoMarket && eventTradingState.kind !== "open" ? [] : eventDetailVenueMarkets
|
|
28167
28198
|
);
|
|
28168
28199
|
const internalResolvedClaim = useResolvedMarketClaim({
|
|
@@ -28176,7 +28207,7 @@ var EventMarketPageContent = ({
|
|
|
28176
28207
|
(0, import_react45.useEffect)(() => {
|
|
28177
28208
|
return () => {
|
|
28178
28209
|
var _a2;
|
|
28179
|
-
(_a2 = setTradeSideRef.current) == null ? void 0 : _a2.call(setTradeSideRef,
|
|
28210
|
+
(_a2 = setTradeSideRef.current) == null ? void 0 : _a2.call(setTradeSideRef, import_hooks74.TradeSide.Buy);
|
|
28180
28211
|
};
|
|
28181
28212
|
}, []);
|
|
28182
28213
|
if (!event.venueMarkets.length) {
|
|
@@ -28318,14 +28349,14 @@ var EventMarketPage = (props) => {
|
|
|
28318
28349
|
var _a;
|
|
28319
28350
|
const {
|
|
28320
28351
|
features: { showSportsMarkets }
|
|
28321
|
-
} = (0,
|
|
28352
|
+
} = (0, import_hooks74.useSdkUiConfig)();
|
|
28322
28353
|
const hasEventProp = "event" in props && !!props.event;
|
|
28323
28354
|
const {
|
|
28324
28355
|
event: fetchedEvent,
|
|
28325
28356
|
error: eventError,
|
|
28326
28357
|
isLoading: isFetchingEvent,
|
|
28327
28358
|
isEnriching
|
|
28328
|
-
} = (0,
|
|
28359
|
+
} = (0, import_hooks74.useEnrichedVenueEvent)({
|
|
28329
28360
|
eventId: hasEventProp ? "" : (_a = props.eventId) != null ? _a : "",
|
|
28330
28361
|
enabled: !props.isLoading && !hasEventProp && !!props.eventId
|
|
28331
28362
|
});
|
|
@@ -28591,14 +28622,14 @@ var HomeSearchResults = ({
|
|
|
28591
28622
|
onEventClick,
|
|
28592
28623
|
onMarketClick
|
|
28593
28624
|
}) => {
|
|
28594
|
-
const labels = (0,
|
|
28595
|
-
const { search: searchConfig } = (0,
|
|
28596
|
-
const { disabledVenues } = (0,
|
|
28625
|
+
const labels = (0, import_hooks75.useLabels)();
|
|
28626
|
+
const { search: searchConfig } = (0, import_hooks75.useSdkUiConfig)();
|
|
28627
|
+
const { disabledVenues } = (0, import_hooks75.useAppConfig)();
|
|
28597
28628
|
const [activeVenueTabValue, setActiveVenueTabValue] = (0, import_react48.useState)("all");
|
|
28598
28629
|
const eventListTabs = useEventListTabs();
|
|
28599
28630
|
const { headerRef, titleRef, shouldUseSelectOverflow } = useEventListTabsHeaderOverflow(eventListTabs);
|
|
28600
28631
|
const visibleVenues = (0, import_react48.useMemo)(
|
|
28601
|
-
() => disabledVenues.length === 0 ? void 0 : (0,
|
|
28632
|
+
() => disabledVenues.length === 0 ? void 0 : (0, import_hooks75.getVisibleVenueIdsByConfig)(import_sdk25.VENUES, disabledVenues),
|
|
28602
28633
|
[disabledVenues]
|
|
28603
28634
|
);
|
|
28604
28635
|
const activeVenueTab = (0, import_react48.useMemo)(() => {
|
|
@@ -28616,7 +28647,7 @@ var HomeSearchResults = ({
|
|
|
28616
28647
|
hasNextPage,
|
|
28617
28648
|
isFetchingNextPage,
|
|
28618
28649
|
isPlaceholderData
|
|
28619
|
-
} = (0,
|
|
28650
|
+
} = (0, import_hooks75.useSearch)({
|
|
28620
28651
|
q: query,
|
|
28621
28652
|
type: "events",
|
|
28622
28653
|
categoryIds: activeTabValue === ALL_CATEGORIES_TAB_VALUE ? void 0 : activeCategoryTab == null ? void 0 : activeCategoryTab.categoryIds,
|
|
@@ -28644,7 +28675,7 @@ var HomeSearchResults = ({
|
|
|
28644
28675
|
const visibleMidpointVenueMarketIds = (0, import_react48.useMemo)(() => {
|
|
28645
28676
|
return collectVisibleVenueMarketIds(visibleVenueMarkets);
|
|
28646
28677
|
}, [visibleVenueMarkets]);
|
|
28647
|
-
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0,
|
|
28678
|
+
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0, import_hooks75.useVenueMarketMidpoints)({
|
|
28648
28679
|
venueMarketIds: visibleMidpointVenueMarketIds,
|
|
28649
28680
|
enabled: visibleMidpointVenueMarketIds.length > 0
|
|
28650
28681
|
});
|
|
@@ -28793,7 +28824,7 @@ var HomePage = ({
|
|
|
28793
28824
|
stickyOrderPanel
|
|
28794
28825
|
}) => {
|
|
28795
28826
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
28796
|
-
const labels = (0,
|
|
28827
|
+
const labels = (0, import_hooks75.useLabels)();
|
|
28797
28828
|
const {
|
|
28798
28829
|
search: {
|
|
28799
28830
|
value: searchValue,
|
|
@@ -28803,11 +28834,11 @@ var HomePage = ({
|
|
|
28803
28834
|
onSelect: onSelectEventInternal
|
|
28804
28835
|
},
|
|
28805
28836
|
features: { enableEventDiscoveryUrlPersistence }
|
|
28806
|
-
} = (0,
|
|
28807
|
-
const { executionMode } = (0,
|
|
28808
|
-
const { isLoading: isAppConfigLoading } = (0,
|
|
28837
|
+
} = (0, import_hooks75.useSdkUiConfig)();
|
|
28838
|
+
const { executionMode } = (0, import_hooks75.useResolvedExecutionMode)();
|
|
28839
|
+
const { isLoading: isAppConfigLoading } = (0, import_hooks75.useAppConfig)();
|
|
28809
28840
|
const primaryEventListTabs = useEventListTabs();
|
|
28810
|
-
const { capture, consume } = (0,
|
|
28841
|
+
const { capture, consume } = (0, import_hooks75.useEventListState)();
|
|
28811
28842
|
const [snapshot] = (0, import_react48.useState)(() => consume());
|
|
28812
28843
|
const eventListStateRef = (0, import_react48.useRef)(null);
|
|
28813
28844
|
const handleSelectEvent = (0, import_react48.useCallback)(
|
|
@@ -28877,7 +28908,7 @@ var HomePage = ({
|
|
|
28877
28908
|
}, [isShowingAllResults, normalizedSearchValue, selectedEvent]);
|
|
28878
28909
|
const resolvedSelectedEvent = selectedEvent != null ? selectedEvent : stickySelectedEvent;
|
|
28879
28910
|
const resolvedAllCategoryTabLabel = allCategoryTabLabel === DEFAULT_ALL_CATEGORY_TAB_LABEL ? labels.home.trending : allCategoryTabLabel;
|
|
28880
|
-
const { categories, isLoading: isCategoriesLoading } = (0,
|
|
28911
|
+
const { categories, isLoading: isCategoriesLoading } = (0, import_hooks75.useCategories)({
|
|
28881
28912
|
limit: categoriesLimit,
|
|
28882
28913
|
enabled: !hasCustomTabs
|
|
28883
28914
|
});
|
|
@@ -29279,13 +29310,13 @@ var HomePage = ({
|
|
|
29279
29310
|
HomePage.displayName = "HomePage";
|
|
29280
29311
|
|
|
29281
29312
|
// src/pages/user-profile/index.tsx
|
|
29282
|
-
var
|
|
29313
|
+
var import_hooks83 = require("@agg-build/hooks");
|
|
29283
29314
|
var import_sdk29 = require("@agg-build/sdk");
|
|
29284
29315
|
var import_dayjs9 = __toESM(require("dayjs"));
|
|
29285
29316
|
var import_react51 = require("react");
|
|
29286
29317
|
|
|
29287
29318
|
// src/pages/user-profile/components/available-balance-card.tsx
|
|
29288
|
-
var
|
|
29319
|
+
var import_hooks76 = require("@agg-build/hooks");
|
|
29289
29320
|
var import_sdk26 = require("@agg-build/sdk");
|
|
29290
29321
|
var import_jsx_runtime177 = require("react/jsx-runtime");
|
|
29291
29322
|
var BASE_URL = "https://assets.snagsolutions.io";
|
|
@@ -29336,7 +29367,7 @@ var AvailableBalanceCard = ({
|
|
|
29336
29367
|
onManage,
|
|
29337
29368
|
manageButtonRef
|
|
29338
29369
|
}) => {
|
|
29339
|
-
const labels = (0,
|
|
29370
|
+
const labels = (0, import_hooks76.useLabels)();
|
|
29340
29371
|
const balanceLabels = labels.userProfile.balance;
|
|
29341
29372
|
const resolvedLabel = label2 != null ? label2 : balanceLabels.availableBalance;
|
|
29342
29373
|
const hasPaperBalance = chains.some(isPaperChain);
|
|
@@ -29490,7 +29521,7 @@ var AvailableBalanceCard = ({
|
|
|
29490
29521
|
AvailableBalanceCard.displayName = "AvailableBalanceCard";
|
|
29491
29522
|
|
|
29492
29523
|
// src/pages/user-profile/components/claim-activity-breakdown-modal.tsx
|
|
29493
|
-
var
|
|
29524
|
+
var import_hooks77 = require("@agg-build/hooks");
|
|
29494
29525
|
var import_sdk27 = require("@agg-build/sdk");
|
|
29495
29526
|
var import_jsx_runtime178 = require("react/jsx-runtime");
|
|
29496
29527
|
var CLAIM_VENUE_LABELS = {
|
|
@@ -29512,7 +29543,7 @@ var ClaimActivityBreakdownModal = ({
|
|
|
29512
29543
|
onTransactionSelect
|
|
29513
29544
|
}) => {
|
|
29514
29545
|
var _a;
|
|
29515
|
-
const labels = (0,
|
|
29546
|
+
const labels = (0, import_hooks77.useLabels)();
|
|
29516
29547
|
return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(
|
|
29517
29548
|
Modal,
|
|
29518
29549
|
{
|
|
@@ -29621,7 +29652,7 @@ var ClaimActivityBreakdownModal = ({
|
|
|
29621
29652
|
};
|
|
29622
29653
|
|
|
29623
29654
|
// src/pages/user-profile/components/manage-balances-modal.tsx
|
|
29624
|
-
var
|
|
29655
|
+
var import_hooks78 = require("@agg-build/hooks");
|
|
29625
29656
|
var import_sdk28 = require("@agg-build/sdk");
|
|
29626
29657
|
var Dialog9 = __toESM(require("@radix-ui/react-dialog"));
|
|
29627
29658
|
var import_react49 = require("react");
|
|
@@ -29702,11 +29733,11 @@ var ManageBalancesModal = ({
|
|
|
29702
29733
|
open,
|
|
29703
29734
|
onOpenChange
|
|
29704
29735
|
}) => {
|
|
29705
|
-
const labels = (0,
|
|
29736
|
+
const labels = (0, import_hooks78.useLabels)();
|
|
29706
29737
|
const refillLabels = labels.balanceRefill;
|
|
29707
|
-
const balanceState = (0,
|
|
29708
|
-
const depositAddressesQuery = (0,
|
|
29709
|
-
const policiesQuery = (0,
|
|
29738
|
+
const balanceState = (0, import_hooks78.useAggBalance)();
|
|
29739
|
+
const depositAddressesQuery = (0, import_hooks78.useDepositAddresses)({ enabled: open });
|
|
29740
|
+
const policiesQuery = (0, import_hooks78.useBalanceRefillPolicies)({ enabled: open });
|
|
29710
29741
|
const toastContext = useOptionalToast();
|
|
29711
29742
|
const descriptionId = (0, import_react49.useId)();
|
|
29712
29743
|
const savingRef = (0, import_react49.useRef)(false);
|
|
@@ -30327,7 +30358,7 @@ var ManageBalancesModal = ({
|
|
|
30327
30358
|
ManageBalancesModal.displayName = "ManageBalancesModal";
|
|
30328
30359
|
|
|
30329
30360
|
// src/pages/user-profile/components/positions-activity.tsx
|
|
30330
|
-
var
|
|
30361
|
+
var import_hooks81 = require("@agg-build/hooks");
|
|
30331
30362
|
var import_react50 = require("react");
|
|
30332
30363
|
|
|
30333
30364
|
// src/pages/user-profile/user-profile.constants.ts
|
|
@@ -31118,7 +31149,7 @@ var EmptyState = ({ title: title2, description, className }) => {
|
|
|
31118
31149
|
EmptyState.displayName = "EmptyState";
|
|
31119
31150
|
|
|
31120
31151
|
// src/pages/user-profile/components/open-order-row.tsx
|
|
31121
|
-
var
|
|
31152
|
+
var import_hooks79 = require("@agg-build/hooks");
|
|
31122
31153
|
var import_jsx_runtime182 = require("react/jsx-runtime");
|
|
31123
31154
|
var shouldUseNativeLinkNavigation2 = (event) => {
|
|
31124
31155
|
return event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button === 1;
|
|
@@ -31160,7 +31191,7 @@ var OpenOrderRow = ({
|
|
|
31160
31191
|
expirationHeader
|
|
31161
31192
|
}) => {
|
|
31162
31193
|
var _a, _b, _c, _d;
|
|
31163
|
-
const labels = (0,
|
|
31194
|
+
const labels = (0, import_hooks79.useLabels)().userProfile.openOrders;
|
|
31164
31195
|
const resolvedCancelLabel = cancelLabel != null ? cancelLabel : labels.cancel;
|
|
31165
31196
|
const resolvedCancelAriaLabel = cancelAriaLabel != null ? cancelAriaLabel : labels.cancelOrderAria(order.id);
|
|
31166
31197
|
const resolvedLimitPriceHeader = limitPriceHeader != null ? limitPriceHeader : labels.limitPriceHeader;
|
|
@@ -31214,7 +31245,7 @@ var OpenOrderRow = ({
|
|
|
31214
31245
|
/* @__PURE__ */ (0, import_jsx_runtime182.jsx)("div", { className: "agg-open-order-image flex h-10 w-10 shrink-0 items-center justify-center lg:h-15 lg:w-15", children: /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
|
|
31215
31246
|
RemoteImage,
|
|
31216
31247
|
{
|
|
31217
|
-
src: (0,
|
|
31248
|
+
src: (0, import_hooks79.optimizedImageUrl)(order.thumbnailSrc, 60),
|
|
31218
31249
|
alt: "",
|
|
31219
31250
|
className: "h-full w-full rounded-agg-sm object-cover"
|
|
31220
31251
|
}
|
|
@@ -31272,7 +31303,7 @@ var OpenOrderRow = ({
|
|
|
31272
31303
|
OpenOrderRow.displayName = "OpenOrderRow";
|
|
31273
31304
|
|
|
31274
31305
|
// src/pages/user-profile/components/position-row.tsx
|
|
31275
|
-
var
|
|
31306
|
+
var import_hooks80 = require("@agg-build/hooks");
|
|
31276
31307
|
var import_jsx_runtime183 = require("react/jsx-runtime");
|
|
31277
31308
|
var shouldUseNativeLinkNavigation3 = (event) => {
|
|
31278
31309
|
return event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button === 1;
|
|
@@ -31410,8 +31441,8 @@ var PositionRow = ({
|
|
|
31410
31441
|
onClaim,
|
|
31411
31442
|
isClaiming = false
|
|
31412
31443
|
}) => {
|
|
31413
|
-
const labels = (0,
|
|
31414
|
-
const { formatCurrency: formatCurrency2, formatPrice } = (0,
|
|
31444
|
+
const labels = (0, import_hooks80.useLabels)().userProfile.positions;
|
|
31445
|
+
const { formatCurrency: formatCurrency2, formatPrice } = (0, import_hooks80.useAggUiConfig)().formatting;
|
|
31415
31446
|
const model = toPositionRowViewModel(
|
|
31416
31447
|
position,
|
|
31417
31448
|
{
|
|
@@ -31469,7 +31500,7 @@ var PositionRow = ({
|
|
|
31469
31500
|
/* @__PURE__ */ (0, import_jsx_runtime183.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_runtime183.jsx)(
|
|
31470
31501
|
RemoteImage,
|
|
31471
31502
|
{
|
|
31472
|
-
src: (0,
|
|
31503
|
+
src: (0, import_hooks80.optimizedImageUrl)(model.thumbnailSrc, 60),
|
|
31473
31504
|
alt: "",
|
|
31474
31505
|
className: "h-full w-full rounded-agg-sm object-cover"
|
|
31475
31506
|
}
|
|
@@ -31638,10 +31669,10 @@ var PositionsActivity = ({
|
|
|
31638
31669
|
initialPositionFilter = "active",
|
|
31639
31670
|
className
|
|
31640
31671
|
}) => {
|
|
31641
|
-
const userProfileLabels = (0,
|
|
31672
|
+
const userProfileLabels = (0, import_hooks81.useLabels)().userProfile;
|
|
31642
31673
|
const positionsLabels = userProfileLabels.positions;
|
|
31643
31674
|
const openOrdersLabels = userProfileLabels.openOrders;
|
|
31644
|
-
const { formatCurrency: formatCurrency2, formatPrice } = (0,
|
|
31675
|
+
const { formatCurrency: formatCurrency2, formatPrice } = (0, import_hooks81.useAggUiConfig)().formatting;
|
|
31645
31676
|
const tabItems = (0, import_react50.useMemo)(
|
|
31646
31677
|
() => getTabItems(userProfileLabels.tabs, showOpenOrders),
|
|
31647
31678
|
[showOpenOrders, userProfileLabels.tabs]
|
|
@@ -31909,7 +31940,7 @@ var PositionsActivity = ({
|
|
|
31909
31940
|
/* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
|
|
31910
31941
|
"img",
|
|
31911
31942
|
{
|
|
31912
|
-
src: (0,
|
|
31943
|
+
src: (0, import_hooks81.optimizedImageUrl)(item.thumbnailSrc, 48),
|
|
31913
31944
|
alt: "",
|
|
31914
31945
|
className: "size-12 shrink-0 rounded-agg-lg object-cover"
|
|
31915
31946
|
}
|
|
@@ -32272,7 +32303,7 @@ var buildAggTxExplorerHref = (chainId, txHash) => {
|
|
|
32272
32303
|
};
|
|
32273
32304
|
|
|
32274
32305
|
// src/pages/user-profile/components/user-info-card.tsx
|
|
32275
|
-
var
|
|
32306
|
+
var import_hooks82 = require("@agg-build/hooks");
|
|
32276
32307
|
|
|
32277
32308
|
// src/primitives/conditional-wrapper.tsx
|
|
32278
32309
|
var ConditionalWrapper = ({
|
|
@@ -32340,7 +32371,7 @@ var UserInfoCard = ({
|
|
|
32340
32371
|
className
|
|
32341
32372
|
}) => {
|
|
32342
32373
|
var _a;
|
|
32343
|
-
const labels = (0,
|
|
32374
|
+
const labels = (0, import_hooks82.useLabels)();
|
|
32344
32375
|
const wallets = (_a = user.connectedWallets) != null ? _a : [];
|
|
32345
32376
|
const hasWallets = wallets.length > 0;
|
|
32346
32377
|
return /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)(
|
|
@@ -32356,7 +32387,7 @@ var UserInfoCard = ({
|
|
|
32356
32387
|
/* @__PURE__ */ (0, import_jsx_runtime187.jsx)("div", { className: "agg-profile-avatar shrink-0", children: user.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
32357
32388
|
RemoteImage,
|
|
32358
32389
|
{
|
|
32359
|
-
src: (0,
|
|
32390
|
+
src: (0, import_hooks82.optimizedImageUrl)(user.avatarUrl, 120),
|
|
32360
32391
|
alt: user.username,
|
|
32361
32392
|
className: "h-20 w-20 rounded-full object-cover sm:h-[120px] sm:w-[120px]"
|
|
32362
32393
|
}
|
|
@@ -32989,15 +33020,15 @@ var UserProfilePage = ({
|
|
|
32989
33020
|
(0, import_react51.useEffect)(() => {
|
|
32990
33021
|
setIsHydrated(true);
|
|
32991
33022
|
}, []);
|
|
32992
|
-
const { user: currentUser, isAuthenticated } = (0,
|
|
32993
|
-
const { isDepositBlocked } = (0,
|
|
32994
|
-
const balanceState = (0,
|
|
32995
|
-
const labels = (0,
|
|
33023
|
+
const { user: currentUser, isAuthenticated } = (0, import_hooks83.useAggAuthState)();
|
|
33024
|
+
const { isDepositBlocked } = (0, import_hooks83.useGeoBlock)();
|
|
33025
|
+
const balanceState = (0, import_hooks83.useAggBalance)();
|
|
33026
|
+
const labels = (0, import_hooks83.useLabels)();
|
|
32996
33027
|
const {
|
|
32997
33028
|
features: { showLimitOrders }
|
|
32998
|
-
} = (0,
|
|
32999
|
-
const client = (0,
|
|
33000
|
-
const cancelOrderMutation = (0,
|
|
33029
|
+
} = (0, import_hooks83.useSdkUiConfig)();
|
|
33030
|
+
const client = (0, import_hooks83.useAggClient)();
|
|
33031
|
+
const cancelOrderMutation = (0, import_hooks83.useCancelManagedOrder)();
|
|
33001
33032
|
const toastContext = useOptionalToast();
|
|
33002
33033
|
const [internalCancellingIds, setInternalCancellingIds] = (0, import_react51.useState)({});
|
|
33003
33034
|
const { claim: startClaim, claimingKeys } = useClaimWinnings({
|
|
@@ -33018,7 +33049,7 @@ var UserProfilePage = ({
|
|
|
33018
33049
|
const [selectedClaimActivity, setSelectedClaimActivity] = (0, import_react51.useState)(null);
|
|
33019
33050
|
const [isManageBalancesOpen, setIsManageBalancesOpen] = (0, import_react51.useState)(false);
|
|
33020
33051
|
const manageBalancesButtonRef = (0, import_react51.useRef)(null);
|
|
33021
|
-
const { executionMode: resolvedExecutionMode, isPaperMode } = (0,
|
|
33052
|
+
const { executionMode: resolvedExecutionMode, isPaperMode } = (0, import_hooks83.useResolvedExecutionMode)(executionMode);
|
|
33022
33053
|
const queryExecutionMode = resolvedExecutionMode === "paper" ? "paper" : void 0;
|
|
33023
33054
|
const handleManageBalancesOpenChange = (0, import_react51.useCallback)((open) => {
|
|
33024
33055
|
setIsManageBalancesOpen(open);
|
|
@@ -33028,13 +33059,13 @@ var UserProfilePage = ({
|
|
|
33028
33059
|
return (_a2 = manageBalancesButtonRef.current) == null ? void 0 : _a2.focus();
|
|
33029
33060
|
});
|
|
33030
33061
|
}, []);
|
|
33031
|
-
const activePositionsQuery = (0,
|
|
33062
|
+
const activePositionsQuery = (0, import_hooks83.useExecutionPositions)({
|
|
33032
33063
|
enabled: shouldUseHookData && isAuthenticated,
|
|
33033
33064
|
status: "active",
|
|
33034
33065
|
limit: 25,
|
|
33035
33066
|
mode: queryExecutionMode
|
|
33036
33067
|
});
|
|
33037
|
-
const closedPositionsQuery = (0,
|
|
33068
|
+
const closedPositionsQuery = (0, import_hooks83.useExecutionPositions)({
|
|
33038
33069
|
enabled: shouldUseHookData && isAuthenticated,
|
|
33039
33070
|
status: "closed",
|
|
33040
33071
|
limit: 25,
|
|
@@ -33050,62 +33081,62 @@ var UserProfilePage = ({
|
|
|
33050
33081
|
(0, import_react51.useEffect)(() => {
|
|
33051
33082
|
setPositionFilter(initialPositionFilter);
|
|
33052
33083
|
}, [initialPositionFilter]);
|
|
33053
|
-
const ordersQuery = (0,
|
|
33084
|
+
const ordersQuery = (0, import_hooks83.useExecutionOrders)({
|
|
33054
33085
|
enabled: shouldUseHookData && isAuthenticated,
|
|
33055
33086
|
limit: 25,
|
|
33056
33087
|
mode: queryExecutionMode,
|
|
33057
33088
|
refetchIntervalMs: 5e3
|
|
33058
33089
|
});
|
|
33059
|
-
const pendingOpenOrdersQuery = (0,
|
|
33090
|
+
const pendingOpenOrdersQuery = (0, import_hooks83.useExecutionOrders)({
|
|
33060
33091
|
enabled: shouldUseHookData && isAuthenticated && !openOrders,
|
|
33061
33092
|
status: OPEN_ORDER_QUERY_STATUSES[0],
|
|
33062
33093
|
orderType: "limit",
|
|
33063
33094
|
limit: 25,
|
|
33064
33095
|
mode: queryExecutionMode
|
|
33065
33096
|
});
|
|
33066
|
-
const signingOpenOrdersQuery = (0,
|
|
33097
|
+
const signingOpenOrdersQuery = (0, import_hooks83.useExecutionOrders)({
|
|
33067
33098
|
enabled: shouldUseHookData && isAuthenticated && !openOrders,
|
|
33068
33099
|
status: OPEN_ORDER_QUERY_STATUSES[1],
|
|
33069
33100
|
orderType: "limit",
|
|
33070
33101
|
limit: 25,
|
|
33071
33102
|
mode: queryExecutionMode
|
|
33072
33103
|
});
|
|
33073
|
-
const pendingBridgeOpenOrdersQuery = (0,
|
|
33104
|
+
const pendingBridgeOpenOrdersQuery = (0, import_hooks83.useExecutionOrders)({
|
|
33074
33105
|
enabled: shouldUseHookData && isAuthenticated && !openOrders,
|
|
33075
33106
|
status: OPEN_ORDER_QUERY_STATUSES[2],
|
|
33076
33107
|
orderType: "limit",
|
|
33077
33108
|
limit: 25,
|
|
33078
33109
|
mode: queryExecutionMode
|
|
33079
33110
|
});
|
|
33080
|
-
const submittingOpenOrdersQuery = (0,
|
|
33111
|
+
const submittingOpenOrdersQuery = (0, import_hooks83.useExecutionOrders)({
|
|
33081
33112
|
enabled: shouldUseHookData && isAuthenticated && !openOrders,
|
|
33082
33113
|
status: OPEN_ORDER_QUERY_STATUSES[3],
|
|
33083
33114
|
orderType: "limit",
|
|
33084
33115
|
limit: 25,
|
|
33085
33116
|
mode: queryExecutionMode
|
|
33086
33117
|
});
|
|
33087
|
-
const submittedOpenOrdersQuery = (0,
|
|
33118
|
+
const submittedOpenOrdersQuery = (0, import_hooks83.useExecutionOrders)({
|
|
33088
33119
|
enabled: shouldUseHookData && isAuthenticated && !openOrders,
|
|
33089
33120
|
status: OPEN_ORDER_QUERY_STATUSES[4],
|
|
33090
33121
|
orderType: "limit",
|
|
33091
33122
|
limit: 25,
|
|
33092
33123
|
mode: queryExecutionMode
|
|
33093
33124
|
});
|
|
33094
|
-
const openOpenOrdersQuery = (0,
|
|
33125
|
+
const openOpenOrdersQuery = (0, import_hooks83.useExecutionOrders)({
|
|
33095
33126
|
enabled: shouldUseHookData && isAuthenticated && !openOrders,
|
|
33096
33127
|
status: OPEN_ORDER_QUERY_STATUSES[5],
|
|
33097
33128
|
orderType: "limit",
|
|
33098
33129
|
limit: 25,
|
|
33099
33130
|
mode: queryExecutionMode
|
|
33100
33131
|
});
|
|
33101
|
-
const partiallyFilledOpenOrdersQuery = (0,
|
|
33132
|
+
const partiallyFilledOpenOrdersQuery = (0, import_hooks83.useExecutionOrders)({
|
|
33102
33133
|
enabled: shouldUseHookData && isAuthenticated && !openOrders,
|
|
33103
33134
|
status: OPEN_ORDER_QUERY_STATUSES[6],
|
|
33104
33135
|
orderType: "limit",
|
|
33105
33136
|
limit: 25,
|
|
33106
33137
|
mode: queryExecutionMode
|
|
33107
33138
|
});
|
|
33108
|
-
const cancelPendingOpenOrdersQuery = (0,
|
|
33139
|
+
const cancelPendingOpenOrdersQuery = (0, import_hooks83.useExecutionOrders)({
|
|
33109
33140
|
enabled: shouldUseHookData && isAuthenticated && !openOrders,
|
|
33110
33141
|
status: OPEN_ORDER_QUERY_STATUSES[7],
|
|
33111
33142
|
orderType: "limit",
|
|
@@ -33134,7 +33165,7 @@ var UserProfilePage = ({
|
|
|
33134
33165
|
submittingOpenOrdersQuery
|
|
33135
33166
|
]
|
|
33136
33167
|
);
|
|
33137
|
-
const activityQuery = (0,
|
|
33168
|
+
const activityQuery = (0, import_hooks83.useUserActivity)({
|
|
33138
33169
|
enabled: shouldUseHookData && isAuthenticated,
|
|
33139
33170
|
limit: 25
|
|
33140
33171
|
});
|
|
@@ -33221,7 +33252,7 @@ var UserProfilePage = ({
|
|
|
33221
33252
|
var _a2, _b2, _c2, _d, _e, _f;
|
|
33222
33253
|
if (user) return user;
|
|
33223
33254
|
const fullUser = profileUser != null ? profileUser : currentUser;
|
|
33224
|
-
const walletAddress = (0,
|
|
33255
|
+
const walletAddress = (0, import_hooks83.getWalletAddressFromUserProfile)(fullUser);
|
|
33225
33256
|
const fallbackUsername = walletAddress && shortenAddress(walletAddress) || "username";
|
|
33226
33257
|
const twitterAccount = (_a2 = fullUser == null ? void 0 : fullUser.accounts) == null ? void 0 : _a2.find(
|
|
33227
33258
|
(account) => String(account.provider).toLowerCase() === "twitter"
|
|
@@ -33283,8 +33314,8 @@ var UserProfilePage = ({
|
|
|
33283
33314
|
},
|
|
33284
33315
|
[paperSummary == null ? void 0 : paperSummary.earnings]
|
|
33285
33316
|
);
|
|
33286
|
-
const { disabledVenues, isLoading: isAppConfigLoading } = (0,
|
|
33287
|
-
const isKalshiAvailable = (0,
|
|
33317
|
+
const { disabledVenues, isLoading: isAppConfigLoading } = (0, import_hooks83.useAppConfig)();
|
|
33318
|
+
const isKalshiAvailable = (0, import_hooks83.getVenueAvailabilityState)({
|
|
33288
33319
|
venueId: import_sdk29.Venue.kalshi,
|
|
33289
33320
|
disabledVenues,
|
|
33290
33321
|
isConfigLoading: isAppConfigLoading
|
|
@@ -33512,7 +33543,7 @@ var UserProfilePage = ({
|
|
|
33512
33543
|
(groups) => {
|
|
33513
33544
|
return groups.flatMap((group) => {
|
|
33514
33545
|
var _a2, _b2, _c2, _d;
|
|
33515
|
-
const closedTotals = (0,
|
|
33546
|
+
const closedTotals = (0, import_hooks83.computeClosedPositionTotals)(group);
|
|
33516
33547
|
const winningOutcome = group.venueMarket.venueMarketOutcomes.find(
|
|
33517
33548
|
(outcome) => outcome.winner === true
|
|
33518
33549
|
);
|