@agg-build/ui 4.18.1 → 4.19.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/README.md +1 -0
- package/dist/{chunk-ZNOAKSPT.mjs → chunk-47CCGQH6.mjs} +2 -2
- package/dist/{chunk-2OBJ7DYT.mjs → chunk-5YHKIJ23.mjs} +21 -10
- package/dist/{chunk-2UPO6G3S.mjs → chunk-DWPBGMVJ.mjs} +50 -6
- package/dist/{chunk-VUZ72Q7H.mjs → chunk-DXASFSVL.mjs} +3 -2
- package/dist/{chunk-YXMDEUHP.mjs → chunk-GT3DCFIT.mjs} +494 -41
- package/dist/{chunk-HFL3CEWG.mjs → chunk-NSQQ62QK.mjs} +4 -4
- package/dist/{chunk-NRPS2D3Q.mjs → chunk-ROA5K67W.mjs} +1 -1
- package/dist/{chunk-JJ3VVCEP.mjs → chunk-WOCZ4TVT.mjs} +12 -8
- package/dist/{chunk-WIGSRHUG.mjs → chunk-XZVGHKMW.mjs} +3 -2
- package/dist/{event-market-GX24AP2H.mjs → event-market-2BAMDM5I.mjs} +6 -6
- package/dist/events.js +60 -11
- package/dist/events.mjs +4 -4
- package/dist/index.js +1148 -621
- package/dist/index.mjs +17 -9
- package/dist/modals.js +3 -2
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +580 -53
- package/dist/pages.mjs +16 -8
- package/dist/primitives.js +3 -2
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +21 -9
- package/dist/trading.mjs +4 -4
- package/dist/types/pages/index.d.mts +1 -0
- package/dist/types/pages/index.d.ts +1 -0
- package/dist/types/pages/leaderboard/components/leaderboard-header-row.d.mts +7 -0
- package/dist/types/pages/leaderboard/components/leaderboard-header-row.d.ts +7 -0
- package/dist/types/pages/leaderboard/components/leaderboard-row.d.mts +7 -0
- package/dist/types/pages/leaderboard/components/leaderboard-row.d.ts +7 -0
- package/dist/types/pages/leaderboard/components/leaderboard-skeleton.d.mts +3 -0
- package/dist/types/pages/leaderboard/components/leaderboard-skeleton.d.ts +3 -0
- package/dist/types/pages/leaderboard/components/segmented-control.d.mts +18 -0
- package/dist/types/pages/leaderboard/components/segmented-control.d.ts +18 -0
- package/dist/types/pages/leaderboard/index.d.mts +28 -0
- package/dist/types/pages/leaderboard/index.d.ts +28 -0
- package/dist/types/pages/leaderboard/leaderboard.constants.d.mts +8 -0
- package/dist/types/pages/leaderboard/leaderboard.constants.d.ts +8 -0
- package/dist/types/pages/leaderboard/leaderboard.types.d.mts +11 -0
- package/dist/types/pages/leaderboard/leaderboard.types.d.ts +11 -0
- package/dist/types/pages/user-profile/position-view-model.d.mts +2 -4
- package/dist/types/pages/user-profile/position-view-model.d.ts +2 -4
- package/dist/types/primitives/remote-image/index.d.mts +1 -1
- package/dist/types/primitives/remote-image/index.d.ts +1 -1
- package/dist/types/primitives/remote-image/remote-image.types.d.mts +6 -0
- package/dist/types/primitives/remote-image/remote-image.types.d.ts +6 -0
- package/dist/types/shared/pnl-format.d.mts +20 -0
- package/dist/types/shared/pnl-format.d.ts +20 -0
- package/package.json +3 -3
- /package/dist/types/{pages/user-profile/components → shared}/default-avatar.d.mts +0 -0
- /package/dist/types/{pages/user-profile/components → shared}/default-avatar.d.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -7335,7 +7335,8 @@ var init_remote_image = __esm({
|
|
|
7335
7335
|
width,
|
|
7336
7336
|
height,
|
|
7337
7337
|
onClick,
|
|
7338
|
-
ariaLabel
|
|
7338
|
+
ariaLabel,
|
|
7339
|
+
fallback
|
|
7339
7340
|
}) => {
|
|
7340
7341
|
const {
|
|
7341
7342
|
general: { theme }
|
|
@@ -7392,7 +7393,7 @@ var init_remote_image = __esm({
|
|
|
7392
7393
|
className: cn(placeholderClasses, classNames == null ? void 0 : classNames.placeholder),
|
|
7393
7394
|
"aria-hidden": true,
|
|
7394
7395
|
"aria-errormessage": "Image failed to load",
|
|
7395
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
7396
|
+
children: fallback != null ? fallback : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
7396
7397
|
Icon,
|
|
7397
7398
|
{
|
|
7398
7399
|
name: "image",
|
|
@@ -13600,13 +13601,17 @@ var init_event_list_item_details_utils = __esm({
|
|
|
13600
13601
|
nowSec = (0, import_dayjs4.default)().unix(),
|
|
13601
13602
|
selectedMarket
|
|
13602
13603
|
}) => {
|
|
13603
|
-
var _a
|
|
13604
|
+
var _a;
|
|
13604
13605
|
const scopedMarkets = selectedMarket ? [selectedMarket] : event.venueMarkets;
|
|
13605
|
-
const
|
|
13606
|
-
|
|
13607
|
-
|
|
13608
|
-
|
|
13609
|
-
|
|
13606
|
+
const resolveHistoryStart = (startDate, creationDate) => {
|
|
13607
|
+
const start = toUnixTimestamp(startDate);
|
|
13608
|
+
if (start != null && start <= nowSec) return start;
|
|
13609
|
+
const created = toUnixTimestamp(creationDate);
|
|
13610
|
+
if (created != null && created <= nowSec) return created;
|
|
13611
|
+
return null;
|
|
13612
|
+
};
|
|
13613
|
+
const preferredEventStart = resolveHistoryStart(event.startDate, event.creationDate);
|
|
13614
|
+
const marketStartCandidates = scopedMarkets.map((market) => resolveHistoryStart(market.startDate, market.creationDate)).filter((value) => value != null);
|
|
13610
13615
|
const metadataStarts = [preferredEventStart, ...marketStartCandidates].filter(
|
|
13611
13616
|
(value) => value != null
|
|
13612
13617
|
);
|
|
@@ -13644,7 +13649,7 @@ var init_event_list_item_details_utils = __esm({
|
|
|
13644
13649
|
const matchingRange = CHART_RANGE_PRIORITY.find((range) => {
|
|
13645
13650
|
return RANGE_SECONDS_BY_TIME_RANGE[range] >= requiredSeconds;
|
|
13646
13651
|
});
|
|
13647
|
-
return (
|
|
13652
|
+
return (_a = matchingRange != null ? matchingRange : fallbackRange) != null ? _a : "ALL";
|
|
13648
13653
|
};
|
|
13649
13654
|
matchOutcomeByLabel = (outcome, selectedOutcomeLabel) => {
|
|
13650
13655
|
const normalizedSelectedLabel = normalizeLabel(selectedOutcomeLabel);
|
|
@@ -17424,6 +17429,20 @@ var init_item_details = __esm({
|
|
|
17424
17429
|
resolvedEventTradingState.isTradingDisabled ? [] : resolvedEventTradingState.displayMarkets,
|
|
17425
17430
|
scopedSelectedMarketId
|
|
17426
17431
|
);
|
|
17432
|
+
const selectedBetdexOutcomes = (0, import_react31.useMemo)(
|
|
17433
|
+
() => eventDetailVenueMarkets.filter((market) => market.venue === "betdex").flatMap(
|
|
17434
|
+
(market) => market.venueMarketOutcomes.map((outcome) => ({
|
|
17435
|
+
venue: market.venue,
|
|
17436
|
+
venueMarketOutcomeId: outcome.id
|
|
17437
|
+
}))
|
|
17438
|
+
),
|
|
17439
|
+
[eventDetailVenueMarkets]
|
|
17440
|
+
);
|
|
17441
|
+
(0, import_hooks59.useMarketOrderbook)({
|
|
17442
|
+
venueOutcomes: selectedBetdexOutcomes,
|
|
17443
|
+
enabled: !resolvedEventTradingState.isTradingDisabled && selectedBetdexOutcomes.length > 0,
|
|
17444
|
+
live: false
|
|
17445
|
+
});
|
|
17427
17446
|
const wsLivePrices = (0, import_hooks59.useLiveOutcomePrices)(eventDetailVenueMarkets);
|
|
17428
17447
|
const wsBestPrices = (0, import_hooks59.useLiveBestPrices)(eventDetailVenueMarkets);
|
|
17429
17448
|
const resolvedMidpointsResult = midpointsResult != null ? midpointsResult : {
|
|
@@ -17561,6 +17580,7 @@ var init_item_details = __esm({
|
|
|
17561
17580
|
src: (0, import_hooks59.optimizedImageUrl)(event.image, 60),
|
|
17562
17581
|
retinaSrc: (0, import_hooks59.retinaImageUrl)(event.image, 60),
|
|
17563
17582
|
alt: "",
|
|
17583
|
+
fallback: event.venue ? /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(VenueLogo, { venue: event.venue, size: "large" }) : void 0,
|
|
17564
17584
|
className: "agg-event-image size-10 rounded-agg-lg object-cover md:size-[60px]"
|
|
17565
17585
|
}
|
|
17566
17586
|
),
|
|
@@ -17712,7 +17732,7 @@ var init_item_details = __esm({
|
|
|
17712
17732
|
selectedOutcomeId: (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? tradingContext.selectedOutcomeId : (_f = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venueMarketOutcomes[0]) == null ? void 0 : _f.id,
|
|
17713
17733
|
eventEndDate: event.endDate,
|
|
17714
17734
|
contractWindow,
|
|
17715
|
-
range: config.chart.selectedChartTimeRange,
|
|
17735
|
+
range: chartRangeOverride != null ? chartRangeOverride : config.chart.selectedChartTimeRange,
|
|
17716
17736
|
live: !resolvedEventTradingState.isTradingDisabled && config.features.enableLiveUpdates
|
|
17717
17737
|
},
|
|
17718
17738
|
event.id
|
|
@@ -17762,7 +17782,7 @@ var init_item_details = __esm({
|
|
|
17762
17782
|
) : null,
|
|
17763
17783
|
!contractWindow ? /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("span", { "aria-hidden": "true", className: "hidden h-4 w-px bg-agg-separator md:block" }) : null,
|
|
17764
17784
|
!contractWindow && import_hooks59.CHART_TIME_RANGES.map((timeRange) => {
|
|
17765
|
-
const effectiveRange =
|
|
17785
|
+
const effectiveRange = chartRangeOverride != null ? chartRangeOverride : config.chart.selectedChartTimeRange;
|
|
17766
17786
|
const isActive = timeRange === effectiveRange;
|
|
17767
17787
|
return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
|
|
17768
17788
|
Button,
|
|
@@ -19351,6 +19371,13 @@ var init_market_details = __esm({
|
|
|
19351
19371
|
labels
|
|
19352
19372
|
});
|
|
19353
19373
|
}, [config.formatting.formatCompactCurrency, venueMarkets, image, labels, marketId, title2]);
|
|
19374
|
+
const primaryVenue = (0, import_react36.useMemo)(
|
|
19375
|
+
() => {
|
|
19376
|
+
var _a2, _b2;
|
|
19377
|
+
return (_b2 = (_a2 = venueMarkets.find((venueMarket) => venueMarket.id === marketId)) != null ? _a2 : venueMarkets[0]) == null ? void 0 : _b2.venue;
|
|
19378
|
+
},
|
|
19379
|
+
[venueMarkets, marketId]
|
|
19380
|
+
);
|
|
19354
19381
|
const livePrices = (0, import_react36.useMemo)(() => {
|
|
19355
19382
|
const merged = /* @__PURE__ */ new Map();
|
|
19356
19383
|
if (midpointsFallback == null ? void 0 : midpointsFallback.size) {
|
|
@@ -19557,6 +19584,26 @@ var init_market_details = __esm({
|
|
|
19557
19584
|
});
|
|
19558
19585
|
}, [model, selectedOutcomeLabel, selectedOutcomeId]);
|
|
19559
19586
|
const orderBookEnabled = isOpened && effectiveSelectedTab === "order-book" && !marketTradingState.isTradingDisabled;
|
|
19587
|
+
const betdexSeedOutcomes = (0, import_react36.useMemo)(
|
|
19588
|
+
() => {
|
|
19589
|
+
var _a2;
|
|
19590
|
+
return ((_a2 = model == null ? void 0 : model.market.venueMarkets) != null ? _a2 : []).filter((venueMarket) => venueMarket.venue === "betdex").flatMap(
|
|
19591
|
+
(venueMarket) => {
|
|
19592
|
+
var _a3;
|
|
19593
|
+
return ((_a3 = venueMarket.venueMarketOutcomes) != null ? _a3 : []).map((outcome) => ({
|
|
19594
|
+
venue: venueMarket.venue,
|
|
19595
|
+
venueMarketOutcomeId: outcome.id
|
|
19596
|
+
}));
|
|
19597
|
+
}
|
|
19598
|
+
);
|
|
19599
|
+
},
|
|
19600
|
+
[model]
|
|
19601
|
+
);
|
|
19602
|
+
(0, import_hooks63.useMarketOrderbook)({
|
|
19603
|
+
venueOutcomes: betdexSeedOutcomes,
|
|
19604
|
+
enabled: !orderBookEnabled && !marketTradingState.isTradingDisabled && betdexSeedOutcomes.length > 0,
|
|
19605
|
+
live: false
|
|
19606
|
+
});
|
|
19560
19607
|
const selectedVenueOutcome = selectedOutcomesByVenue.find(
|
|
19561
19608
|
(item) => item.outcomeId === selectedOutcomeId
|
|
19562
19609
|
);
|
|
@@ -19751,6 +19798,7 @@ var init_market_details = __esm({
|
|
|
19751
19798
|
src: (0, import_hooks63.optimizedImageUrl)(model.image, 60),
|
|
19752
19799
|
retinaSrc: (0, import_hooks63.retinaImageUrl)(model.image, 60),
|
|
19753
19800
|
alt: "",
|
|
19801
|
+
fallback: primaryVenue ? /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(VenueLogo, { venue: primaryVenue, size: "large" }) : void 0,
|
|
19754
19802
|
className: "agg-market-image size-12 rounded-agg-lg object-cover md:size-[60px]"
|
|
19755
19803
|
}
|
|
19756
19804
|
) : null,
|
|
@@ -23257,7 +23305,7 @@ var init_index_place_order_utils = __esm({
|
|
|
23257
23305
|
selectedMarket,
|
|
23258
23306
|
tradeSide = "buy"
|
|
23259
23307
|
}) => {
|
|
23260
|
-
var _a, _b, _c, _d, _e;
|
|
23308
|
+
var _a, _b, _c, _d, _e, _f;
|
|
23261
23309
|
if (!selectedMarket) {
|
|
23262
23310
|
return {
|
|
23263
23311
|
tone: "warning",
|
|
@@ -23277,7 +23325,15 @@ var init_index_place_order_utils = __esm({
|
|
|
23277
23325
|
};
|
|
23278
23326
|
}
|
|
23279
23327
|
if (quoteData.status === "no_orderbooks") {
|
|
23280
|
-
const
|
|
23328
|
+
const warnings = (_a = quoteData.warnings) != null ? _a : [];
|
|
23329
|
+
if (warnings.length > 0 && warnings.every((warning) => warning.reason === "hosted_cash_unavailable")) {
|
|
23330
|
+
return {
|
|
23331
|
+
tone: "warning",
|
|
23332
|
+
message: labels.betdexBalanceUnavailable,
|
|
23333
|
+
placement: "above-action"
|
|
23334
|
+
};
|
|
23335
|
+
}
|
|
23336
|
+
const serverError = (_b = quoteData.error) == null ? void 0 : _b.trim();
|
|
23281
23337
|
return {
|
|
23282
23338
|
tone: "error",
|
|
23283
23339
|
message: serverError || labels.noOrderbooks,
|
|
@@ -23294,24 +23350,24 @@ var init_index_place_order_utils = __esm({
|
|
|
23294
23350
|
if (quoteData.status === "insufficient_input_amount") {
|
|
23295
23351
|
return {
|
|
23296
23352
|
tone: "error",
|
|
23297
|
-
message: (
|
|
23353
|
+
message: (_c = quoteData.message) != null ? _c : labels.insufficientInputAmount,
|
|
23298
23354
|
placement: "above-action"
|
|
23299
23355
|
};
|
|
23300
23356
|
}
|
|
23301
23357
|
if (quoteData.status === "invalid_input") {
|
|
23302
23358
|
return {
|
|
23303
23359
|
tone: "error",
|
|
23304
|
-
message: (
|
|
23360
|
+
message: (_d = quoteData.message) != null ? _d : labels.quoteUnavailable,
|
|
23305
23361
|
placement: "above-action"
|
|
23306
23362
|
};
|
|
23307
23363
|
}
|
|
23308
23364
|
if (quoteData.status === "insufficient_position") {
|
|
23309
|
-
const total = (
|
|
23365
|
+
const total = (_e = quoteData.positionAvailability) == null ? void 0 : _e.totalSellableShares;
|
|
23310
23366
|
const message = total != null ? labels.insufficientPosition(total) : labels.insufficientPositionGeneric;
|
|
23311
23367
|
return { tone: "error", message, placement: "above-action" };
|
|
23312
23368
|
}
|
|
23313
23369
|
if (quoteData.status === "insufficient_depth") {
|
|
23314
|
-
const serverError = (
|
|
23370
|
+
const serverError = (_f = quoteData.error) == null ? void 0 : _f.trim();
|
|
23315
23371
|
return {
|
|
23316
23372
|
tone: "error",
|
|
23317
23373
|
message: tradeSide === "sell" ? serverError || labels.insufficientSellDepth : serverError || labels.insufficientLiquidity,
|
|
@@ -25993,6 +26049,7 @@ var init_place_order = __esm({
|
|
|
25993
26049
|
headerSubtitle,
|
|
25994
26050
|
headerImage,
|
|
25995
26051
|
headerTitle,
|
|
26052
|
+
headerVenue,
|
|
25996
26053
|
onClose
|
|
25997
26054
|
}) => {
|
|
25998
26055
|
if (!headerTitle) return null;
|
|
@@ -26003,6 +26060,7 @@ var init_place_order = __esm({
|
|
|
26003
26060
|
{
|
|
26004
26061
|
src: headerImage,
|
|
26005
26062
|
alt: "",
|
|
26063
|
+
fallback: headerVenue ? /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(VenueLogo, { venue: headerVenue, size: "large" }) : void 0,
|
|
26006
26064
|
className: "agg-order-market-image h-12 w-12 shrink-0 overflow-hidden rounded-agg-lg object-cover"
|
|
26007
26065
|
}
|
|
26008
26066
|
),
|
|
@@ -26329,7 +26387,7 @@ var init_place_order = __esm({
|
|
|
26329
26387
|
showResolvingState = false,
|
|
26330
26388
|
midpointsResult
|
|
26331
26389
|
}) => {
|
|
26332
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha;
|
|
26390
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia;
|
|
26333
26391
|
const {
|
|
26334
26392
|
enableDebug: isExecutionDebugEnabled,
|
|
26335
26393
|
features: { enableAnimations, showFeesBreakdown, showLimitOrders: limitOrdersFeature },
|
|
@@ -28615,6 +28673,7 @@ var init_place_order = __esm({
|
|
|
28615
28673
|
headerSubtitle,
|
|
28616
28674
|
headerImage,
|
|
28617
28675
|
headerTitle,
|
|
28676
|
+
headerVenue: (_ia = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) != null ? _ia : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.venue,
|
|
28618
28677
|
onClose
|
|
28619
28678
|
}),
|
|
28620
28679
|
/* @__PURE__ */ (0, import_jsx_runtime189.jsxs)("div", { className: cn("agg-order-panel-content flex flex-col gap-6", classNames == null ? void 0 : classNames.content), children: [
|
|
@@ -33425,6 +33484,10 @@ __export(src_exports, {
|
|
|
33425
33484
|
ImageIcon: () => ImageIcon,
|
|
33426
33485
|
InfoIcon: () => InfoIcon,
|
|
33427
33486
|
InlineAlert: () => InlineAlert,
|
|
33487
|
+
LEADERBOARD_DEFAULT_METRIC: () => LEADERBOARD_DEFAULT_METRIC,
|
|
33488
|
+
LEADERBOARD_DEFAULT_PERIOD: () => LEADERBOARD_DEFAULT_PERIOD,
|
|
33489
|
+
LEADERBOARD_METRICS: () => LEADERBOARD_METRICS,
|
|
33490
|
+
LeaderboardPage: () => LeaderboardPage,
|
|
33428
33491
|
LineChart: () => LineChart,
|
|
33429
33492
|
LinkAccountsIcon: () => LinkAccountsIcon,
|
|
33430
33493
|
LoadingIcon: () => LoadingIcon,
|
|
@@ -33593,7 +33656,7 @@ var import_hooks43 = require("@agg-build/hooks");
|
|
|
33593
33656
|
var DropdownMenu = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
33594
33657
|
init_constants();
|
|
33595
33658
|
|
|
33596
|
-
// src/
|
|
33659
|
+
// src/shared/default-avatar.tsx
|
|
33597
33660
|
init_utils();
|
|
33598
33661
|
var import_jsx_runtime150 = require("react/jsx-runtime");
|
|
33599
33662
|
var DefaultAvatar = ({ className }) => {
|
|
@@ -35166,6 +35229,7 @@ var EventListItemContent = ({
|
|
|
35166
35229
|
src: (0, import_hooks44.optimizedImageUrl)(resolvedImage, 40),
|
|
35167
35230
|
retinaSrc: (0, import_hooks44.retinaImageUrl)(resolvedImage, 40),
|
|
35168
35231
|
alt: "",
|
|
35232
|
+
fallback: event.venue ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(VenueLogo, { venue: event.venue, size: "medium" }) : void 0,
|
|
35169
35233
|
classNames: {
|
|
35170
35234
|
root: "agg-event-image h-10 w-10 shrink-0 rounded-agg-lg object-cover",
|
|
35171
35235
|
image: "transition-transform duration-300 group-hover/agg-event-card:scale-110"
|
|
@@ -38508,24 +38572,58 @@ var USER_PROFILE_POSITION_FILTERS = [
|
|
|
38508
38572
|
{ value: "closed", label: "Closed" }
|
|
38509
38573
|
];
|
|
38510
38574
|
|
|
38511
|
-
// src/
|
|
38512
|
-
var
|
|
38513
|
-
avgPrefix: "avg",
|
|
38514
|
-
nowPrefix: "now",
|
|
38515
|
-
finalPrefix: "final"
|
|
38516
|
-
};
|
|
38517
|
-
var missingLabel = "\u2014";
|
|
38575
|
+
// src/shared/pnl-format.ts
|
|
38576
|
+
var MISSING_VALUE_LABEL = "\u2014";
|
|
38518
38577
|
var usdFormatter = new Intl.NumberFormat("en-US", {
|
|
38519
38578
|
style: "currency",
|
|
38520
38579
|
currency: "USD",
|
|
38521
38580
|
minimumFractionDigits: 2,
|
|
38522
38581
|
maximumFractionDigits: 2
|
|
38523
38582
|
});
|
|
38583
|
+
var isFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value);
|
|
38584
|
+
var formatCurrency = (value, formatCurrencyOverride) => {
|
|
38585
|
+
if (!isFiniteNumber(value)) return MISSING_VALUE_LABEL;
|
|
38586
|
+
if (formatCurrencyOverride) return formatCurrencyOverride(value);
|
|
38587
|
+
return usdFormatter.format(value);
|
|
38588
|
+
};
|
|
38589
|
+
var NEGLIGIBLE_CURRENCY_THRESHOLD = 5e-3;
|
|
38590
|
+
var formatSignedCurrency = (value, formatCurrencyOverride, options = {}) => {
|
|
38591
|
+
if (!isFiniteNumber(value)) return MISSING_VALUE_LABEL;
|
|
38592
|
+
if (value === 0) return formatCurrency(0, formatCurrencyOverride);
|
|
38593
|
+
const sign = value > 0 ? "+" : "-";
|
|
38594
|
+
const magnitude = Math.abs(value);
|
|
38595
|
+
if (options.markNegligible && magnitude < NEGLIGIBLE_CURRENCY_THRESHOLD) {
|
|
38596
|
+
return `${sign}<${formatCurrency(0.01, formatCurrencyOverride)}`;
|
|
38597
|
+
}
|
|
38598
|
+
return `${sign}${formatCurrency(magnitude, formatCurrencyOverride)}`;
|
|
38599
|
+
};
|
|
38600
|
+
var formatCurrencyMarkingNegligible = (value, formatCurrencyOverride) => {
|
|
38601
|
+
if (!isFiniteNumber(value)) return MISSING_VALUE_LABEL;
|
|
38602
|
+
if (value !== 0 && Math.abs(value) < NEGLIGIBLE_CURRENCY_THRESHOLD) {
|
|
38603
|
+
return `<${formatCurrency(0.01, formatCurrencyOverride)}`;
|
|
38604
|
+
}
|
|
38605
|
+
return formatCurrency(value, formatCurrencyOverride);
|
|
38606
|
+
};
|
|
38607
|
+
var getPositionTone = (value) => {
|
|
38608
|
+
if (!isFiniteNumber(value) || value === 0) return "neutral";
|
|
38609
|
+
return value > 0 ? "positive" : "negative";
|
|
38610
|
+
};
|
|
38611
|
+
var toneClassName = (tone) => {
|
|
38612
|
+
if (tone === "positive") return "text-agg-success";
|
|
38613
|
+
if (tone === "negative") return "text-agg-error";
|
|
38614
|
+
return "text-agg-muted-foreground";
|
|
38615
|
+
};
|
|
38616
|
+
|
|
38617
|
+
// src/pages/user-profile/position-view-model.ts
|
|
38618
|
+
var defaultLabels2 = {
|
|
38619
|
+
avgPrefix: "avg",
|
|
38620
|
+
nowPrefix: "now",
|
|
38621
|
+
finalPrefix: "final"
|
|
38622
|
+
};
|
|
38524
38623
|
var percentFormatter = new Intl.NumberFormat("en-US", {
|
|
38525
38624
|
minimumFractionDigits: 0,
|
|
38526
38625
|
maximumFractionDigits: 1
|
|
38527
38626
|
});
|
|
38528
|
-
var isFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value);
|
|
38529
38627
|
var parseCurrencyLabel = (label2) => {
|
|
38530
38628
|
if (!label2) return null;
|
|
38531
38629
|
const normalized = label2.replace(/[$,\s]/g, "");
|
|
@@ -38546,23 +38644,13 @@ var parsePercentLabel = (label2) => {
|
|
|
38546
38644
|
const parsed = Number(match[1].replace(/,/g, ""));
|
|
38547
38645
|
return Number.isFinite(parsed) ? parsed : null;
|
|
38548
38646
|
};
|
|
38549
|
-
var formatCurrency = (value, formatCurrencyOverride) => {
|
|
38550
|
-
if (!isFiniteNumber(value)) return missingLabel;
|
|
38551
|
-
if (formatCurrencyOverride) return formatCurrencyOverride(value);
|
|
38552
|
-
return usdFormatter.format(value);
|
|
38553
|
-
};
|
|
38554
|
-
var formatSignedCurrency = (value, formatCurrencyOverride) => {
|
|
38555
|
-
if (!isFiniteNumber(value)) return missingLabel;
|
|
38556
|
-
if (value === 0) return formatCurrency(0, formatCurrencyOverride);
|
|
38557
|
-
return `${value > 0 ? "+" : "-"}${formatCurrency(Math.abs(value), formatCurrencyOverride)}`;
|
|
38558
|
-
};
|
|
38559
38647
|
var formatPriceCents2 = (value, formatPrice) => {
|
|
38560
|
-
if (!isFiniteNumber(value)) return
|
|
38648
|
+
if (!isFiniteNumber(value)) return MISSING_VALUE_LABEL;
|
|
38561
38649
|
if (formatPrice) return formatPrice(value);
|
|
38562
38650
|
return `${Math.round(value * 100)}\xA2`;
|
|
38563
38651
|
};
|
|
38564
38652
|
var formatSignedPercent = (value) => {
|
|
38565
|
-
if (!isFiniteNumber(value)) return
|
|
38653
|
+
if (!isFiniteNumber(value)) return MISSING_VALUE_LABEL;
|
|
38566
38654
|
if (value === 0) return "0%";
|
|
38567
38655
|
return `${value > 0 ? "+" : "-"}${percentFormatter.format(Math.abs(value))}%`;
|
|
38568
38656
|
};
|
|
@@ -38650,10 +38738,6 @@ var getFinalPnlPercent = (position, pnlValue) => {
|
|
|
38650
38738
|
}
|
|
38651
38739
|
return null;
|
|
38652
38740
|
};
|
|
38653
|
-
var getPositionTone = (value) => {
|
|
38654
|
-
if (!isFiniteNumber(value) || value === 0) return "neutral";
|
|
38655
|
-
return value > 0 ? "positive" : "negative";
|
|
38656
|
-
};
|
|
38657
38741
|
var toPositionRowViewModel = (position, labels = defaultLabels2, formatters = {}) => {
|
|
38658
38742
|
const { formatCurrency: currency, formatPrice: price } = formatters;
|
|
38659
38743
|
const positionStatus = resolvePositionStatus(position);
|
|
@@ -38667,10 +38751,10 @@ var toPositionRowViewModel = (position, labels = defaultLabels2, formatters = {}
|
|
|
38667
38751
|
position,
|
|
38668
38752
|
positionStatus,
|
|
38669
38753
|
bucket: resolvePositionBucket(position),
|
|
38670
|
-
title: position.title ||
|
|
38754
|
+
title: position.title || MISSING_VALUE_LABEL,
|
|
38671
38755
|
thumbnailSrc: position.thumbnailSrc,
|
|
38672
|
-
selectedOutcomeLabel: position.outcomeLabel ||
|
|
38673
|
-
resolutionLabel: position.resolutionLabel || position.outcomeLabel ||
|
|
38756
|
+
selectedOutcomeLabel: position.outcomeLabel || MISSING_VALUE_LABEL,
|
|
38757
|
+
resolutionLabel: position.resolutionLabel || position.outcomeLabel || MISSING_VALUE_LABEL,
|
|
38674
38758
|
venueShareBreakdown: position.venueShareBreakdown,
|
|
38675
38759
|
totalTraded: {
|
|
38676
38760
|
primaryLabel: formatCurrency(getTotalTradedValue(position), currency),
|
|
@@ -39307,11 +39391,6 @@ var import_jsx_runtime204 = require("react/jsx-runtime");
|
|
|
39307
39391
|
var shouldUseNativeLinkNavigation3 = (event) => {
|
|
39308
39392
|
return event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button === 1;
|
|
39309
39393
|
};
|
|
39310
|
-
var toneTextClassName = (tone) => {
|
|
39311
|
-
if (tone === "positive") return "text-agg-success";
|
|
39312
|
-
if (tone === "negative") return "text-agg-error";
|
|
39313
|
-
return "text-agg-muted-foreground";
|
|
39314
|
-
};
|
|
39315
39394
|
var OutcomePill = ({ label: label2 }) => /* @__PURE__ */ (0, import_jsx_runtime204.jsx)("span", { className: "agg-position-outcome max-w-[120px] inline-flex items-center justify-center rounded-full bg-agg-secondary-hover px-4 py-[6px]", children: /* @__PURE__ */ (0, import_jsx_runtime204.jsx)("span", { className: "whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground truncate", children: label2 }) });
|
|
39316
39395
|
var ResolutionPill = ({ label: label2 }) => /* @__PURE__ */ (0, import_jsx_runtime204.jsx)("span", { className: "agg-position-resolution-pill inline-flex w-full items-center justify-center overflow-hidden rounded-full bg-agg-secondary-hover px-4 py-[6px] md:w-auto", children: /* @__PURE__ */ (0, import_jsx_runtime204.jsx)("span", { className: "truncate whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: label2 }) });
|
|
39317
39396
|
var VenueShares = ({
|
|
@@ -39410,7 +39489,7 @@ var PositionValueCell = ({
|
|
|
39410
39489
|
{
|
|
39411
39490
|
className: cn(
|
|
39412
39491
|
"font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
|
|
39413
|
-
|
|
39492
|
+
toneClassName(value.tone)
|
|
39414
39493
|
),
|
|
39415
39494
|
children: value.deltaLabel
|
|
39416
39495
|
}
|
|
@@ -39423,7 +39502,7 @@ var PositionValueCell = ({
|
|
|
39423
39502
|
{
|
|
39424
39503
|
className: cn(
|
|
39425
39504
|
"font-agg-sans text-agg-xs leading-agg-4 font-agg-normal",
|
|
39426
|
-
|
|
39505
|
+
toneClassName(value.tone)
|
|
39427
39506
|
),
|
|
39428
39507
|
children: value.percentLabel
|
|
39429
39508
|
}
|
|
@@ -41688,10 +41767,454 @@ var UserProfilePage = ({
|
|
|
41688
41767
|
};
|
|
41689
41768
|
UserProfilePage.displayName = "UserProfilePage";
|
|
41690
41769
|
|
|
41770
|
+
// src/pages/leaderboard/index.tsx
|
|
41771
|
+
var import_hooks105 = require("@agg-build/hooks");
|
|
41772
|
+
var import_react69 = require("react");
|
|
41773
|
+
init_button();
|
|
41774
|
+
init_error_boundary();
|
|
41775
|
+
init_icon();
|
|
41776
|
+
init_state_message();
|
|
41777
|
+
init_utils();
|
|
41778
|
+
|
|
41779
|
+
// src/pages/leaderboard/components/leaderboard-header-row.tsx
|
|
41780
|
+
var import_hooks102 = require("@agg-build/hooks");
|
|
41781
|
+
init_utils();
|
|
41782
|
+
|
|
41783
|
+
// src/pages/leaderboard/leaderboard.constants.ts
|
|
41784
|
+
var LEADERBOARD_DEFAULT_PERIOD = "30d";
|
|
41785
|
+
var LEADERBOARD_DEFAULT_METRIC = "realizedPnl";
|
|
41786
|
+
var LEADERBOARD_METRICS = ["realizedPnl", "volume"];
|
|
41787
|
+
var LEADERBOARD_TOP_RANKS = 3;
|
|
41788
|
+
var LEADERBOARD_GRID_CLASS = "grid grid-cols-[36px_minmax(0,1fr)] grid-rows-[auto_auto] gap-x-3 gap-y-2 sm:grid-cols-[48px_minmax(0,1fr)_88px_128px_128px] sm:grid-rows-1 sm:gap-x-3 sm:gap-y-0";
|
|
41789
|
+
|
|
41790
|
+
// src/pages/leaderboard/components/leaderboard-header-row.tsx
|
|
41791
|
+
var import_jsx_runtime209 = require("react/jsx-runtime");
|
|
41792
|
+
var SORT_CARET = /* @__PURE__ */ (0, import_jsx_runtime209.jsx)("svg", { viewBox: "0 0 10 10", className: "size-2.5", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime209.jsx)("path", { d: "M5 8 1 3h8z", fill: "currentColor" }) });
|
|
41793
|
+
function LeaderboardHeaderRow({
|
|
41794
|
+
metric,
|
|
41795
|
+
onMetricChange
|
|
41796
|
+
}) {
|
|
41797
|
+
const labels = (0, import_hooks102.useLabels)().leaderboard;
|
|
41798
|
+
const sortable = (key, text) => {
|
|
41799
|
+
const active = metric === key;
|
|
41800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(
|
|
41801
|
+
"span",
|
|
41802
|
+
{
|
|
41803
|
+
role: "columnheader",
|
|
41804
|
+
"aria-sort": active ? "descending" : void 0,
|
|
41805
|
+
className: "text-right",
|
|
41806
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)(
|
|
41807
|
+
"button",
|
|
41808
|
+
{
|
|
41809
|
+
type: "button",
|
|
41810
|
+
onClick: () => onMetricChange(key),
|
|
41811
|
+
className: cn(
|
|
41812
|
+
"inline-flex cursor-pointer items-center justify-end gap-1 uppercase tracking-wide outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-agg-primary-hover",
|
|
41813
|
+
active ? "font-agg-bold text-agg-foreground" : "hover:text-agg-foreground"
|
|
41814
|
+
),
|
|
41815
|
+
children: [
|
|
41816
|
+
text,
|
|
41817
|
+
active ? SORT_CARET : null
|
|
41818
|
+
]
|
|
41819
|
+
}
|
|
41820
|
+
)
|
|
41821
|
+
}
|
|
41822
|
+
);
|
|
41823
|
+
};
|
|
41824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)(
|
|
41825
|
+
"div",
|
|
41826
|
+
{
|
|
41827
|
+
role: "row",
|
|
41828
|
+
className: cn(
|
|
41829
|
+
LEADERBOARD_GRID_CLASS,
|
|
41830
|
+
"agg-leaderboard-header hidden h-10 items-center border-b border-agg-separator bg-agg-secondary-hover px-5 text-agg-xs leading-agg-4 uppercase tracking-wide text-agg-muted-foreground sm:grid"
|
|
41831
|
+
),
|
|
41832
|
+
children: [
|
|
41833
|
+
/* @__PURE__ */ (0, import_jsx_runtime209.jsx)("span", { role: "columnheader", children: labels.columns.rank }),
|
|
41834
|
+
/* @__PURE__ */ (0, import_jsx_runtime209.jsx)("span", { role: "columnheader", children: labels.columns.trader }),
|
|
41835
|
+
/* @__PURE__ */ (0, import_jsx_runtime209.jsx)("span", { role: "columnheader", className: "text-right", children: labels.columns.orders }),
|
|
41836
|
+
sortable("volume", labels.columns.volume),
|
|
41837
|
+
sortable("realizedPnl", labels.columns.realizedPnl)
|
|
41838
|
+
]
|
|
41839
|
+
}
|
|
41840
|
+
);
|
|
41841
|
+
}
|
|
41842
|
+
|
|
41843
|
+
// src/pages/leaderboard/components/leaderboard-row.tsx
|
|
41844
|
+
var import_hooks103 = require("@agg-build/hooks");
|
|
41845
|
+
init_remote_image();
|
|
41846
|
+
init_utils();
|
|
41847
|
+
var import_jsx_runtime210 = require("react/jsx-runtime");
|
|
41848
|
+
var integer = new Intl.NumberFormat("en-US");
|
|
41849
|
+
function LeaderboardRowView({
|
|
41850
|
+
row,
|
|
41851
|
+
isCurrentUser,
|
|
41852
|
+
className
|
|
41853
|
+
}) {
|
|
41854
|
+
var _a, _b, _c;
|
|
41855
|
+
const labels = (0, import_hooks103.useLabels)().leaderboard;
|
|
41856
|
+
const { formatCurrency: formatCurrency2 } = (0, import_hooks103.useAggUiConfig)().formatting;
|
|
41857
|
+
const tone = getPositionTone(row.realizedPnl);
|
|
41858
|
+
const shortWallet = shortenAddress(row.walletAddress);
|
|
41859
|
+
const identity = (_b = (_a = row.username) != null ? _a : shortWallet) != null ? _b : labels.anonymousTrader;
|
|
41860
|
+
const identityKind = row.username ? "username" : shortWallet ? "wallet" : "anonymous";
|
|
41861
|
+
const isTop = row.rank != null && row.rank <= LEADERBOARD_TOP_RANKS;
|
|
41862
|
+
const hasOrders = Number.isFinite(row.orders);
|
|
41863
|
+
const cell = (caption2, value, extra) => /* @__PURE__ */ (0, import_jsx_runtime210.jsxs)("span", { role: "cell", className: "flex flex-col text-left tabular-nums sm:block sm:text-right", children: [
|
|
41864
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)("span", { className: "agg-type-caption uppercase tracking-wide text-agg-muted-foreground sm:hidden", children: caption2 }),
|
|
41865
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)("span", { className: cn("text-agg-sm leading-agg-5", extra), children: value })
|
|
41866
|
+
] });
|
|
41867
|
+
return /* @__PURE__ */ (0, import_jsx_runtime210.jsxs)(
|
|
41868
|
+
"div",
|
|
41869
|
+
{
|
|
41870
|
+
role: "row",
|
|
41871
|
+
"aria-current": isCurrentUser ? "true" : void 0,
|
|
41872
|
+
className: cn(
|
|
41873
|
+
LEADERBOARD_GRID_CLASS,
|
|
41874
|
+
"agg-leaderboard-row items-center px-4 py-3 sm:min-h-16 sm:px-5",
|
|
41875
|
+
isCurrentUser ? "bg-agg-trade-highlight-surface shadow-[inset_3px_0_0_var(--agg-color-primary)]" : "hover:bg-agg-secondary-hover/60",
|
|
41876
|
+
className
|
|
41877
|
+
),
|
|
41878
|
+
children: [
|
|
41879
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
41880
|
+
"span",
|
|
41881
|
+
{
|
|
41882
|
+
role: "cell",
|
|
41883
|
+
"data-testid": "agg-leaderboard-rank",
|
|
41884
|
+
className: cn(
|
|
41885
|
+
"agg-leaderboard-rank row-span-2 inline-flex size-7 items-center justify-center rounded-agg-full text-agg-sm tabular-nums sm:row-span-1",
|
|
41886
|
+
// cn() is a plain join: colour classes must be mutually exclusive.
|
|
41887
|
+
row.rank === 1 ? "border border-agg-primary bg-agg-secondary-hover font-agg-bold text-agg-primary" : isTop ? "border border-agg-separator bg-agg-secondary-hover font-agg-bold text-agg-foreground" : "text-agg-muted-foreground"
|
|
41888
|
+
),
|
|
41889
|
+
children: (_c = row.rank) != null ? _c : "\u2013"
|
|
41890
|
+
}
|
|
41891
|
+
),
|
|
41892
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsxs)("div", { role: "cell", className: "agg-leaderboard-identity flex min-w-0 items-center gap-3", children: [
|
|
41893
|
+
row.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
41894
|
+
RemoteImage,
|
|
41895
|
+
{
|
|
41896
|
+
src: (0, import_hooks103.optimizedImageUrl)(row.avatarUrl, 80),
|
|
41897
|
+
alt: "",
|
|
41898
|
+
className: "size-10 shrink-0 rounded-agg-full object-cover"
|
|
41899
|
+
}
|
|
41900
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(DefaultAvatar, { className: "size-10 rounded-agg-full" }),
|
|
41901
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsxs)("div", { className: "flex min-w-0 flex-col", children: [
|
|
41902
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsxs)("span", { className: "flex items-center gap-2", children: [
|
|
41903
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
41904
|
+
"span",
|
|
41905
|
+
{
|
|
41906
|
+
className: cn(
|
|
41907
|
+
"truncate text-agg-sm leading-agg-5",
|
|
41908
|
+
identityKind === "username" && "font-agg-bold text-agg-foreground",
|
|
41909
|
+
identityKind === "wallet" && "font-mono font-agg-medium text-agg-foreground",
|
|
41910
|
+
identityKind === "anonymous" && "font-agg-medium text-agg-muted-foreground"
|
|
41911
|
+
),
|
|
41912
|
+
children: identity
|
|
41913
|
+
}
|
|
41914
|
+
),
|
|
41915
|
+
isCurrentUser ? /* @__PURE__ */ (0, import_jsx_runtime210.jsx)("span", { className: "rounded-agg-full bg-agg-primary px-1.5 text-agg-2xs font-agg-bold uppercase leading-agg-4 tracking-wide text-agg-on-primary", children: labels.you }) : null
|
|
41916
|
+
] }),
|
|
41917
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)("span", { className: "text-agg-xs leading-agg-4 text-agg-muted-foreground", children: hasOrders ? labels.tradesCount(row.orders) : MISSING_VALUE_LABEL })
|
|
41918
|
+
] })
|
|
41919
|
+
] }),
|
|
41920
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsxs)("div", { className: "col-start-2 grid grid-cols-3 gap-2 sm:contents", children: [
|
|
41921
|
+
cell(labels.columns.orders, hasOrders ? integer.format(row.orders) : MISSING_VALUE_LABEL),
|
|
41922
|
+
cell(labels.columns.volume, formatCurrencyMarkingNegligible(row.volume, formatCurrency2)),
|
|
41923
|
+
cell(
|
|
41924
|
+
labels.columns.realizedPnl,
|
|
41925
|
+
formatSignedCurrency(row.realizedPnl, formatCurrency2, { markNegligible: true }),
|
|
41926
|
+
cn("font-agg-bold", toneClassName(tone))
|
|
41927
|
+
)
|
|
41928
|
+
] })
|
|
41929
|
+
]
|
|
41930
|
+
}
|
|
41931
|
+
);
|
|
41932
|
+
}
|
|
41933
|
+
|
|
41934
|
+
// src/pages/leaderboard/components/leaderboard-skeleton.tsx
|
|
41935
|
+
var import_hooks104 = require("@agg-build/hooks");
|
|
41936
|
+
init_utils();
|
|
41937
|
+
var import_jsx_runtime211 = require("react/jsx-runtime");
|
|
41938
|
+
function LeaderboardSkeleton({ rows = 4 }) {
|
|
41939
|
+
const labels = (0, import_hooks104.useLabels)().leaderboard;
|
|
41940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime211.jsx)("div", { role: "status", "aria-label": labels.loadingAria, className: "agg-leaderboard-skeleton", children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)(
|
|
41941
|
+
"div",
|
|
41942
|
+
{
|
|
41943
|
+
className: cn(
|
|
41944
|
+
LEADERBOARD_GRID_CLASS,
|
|
41945
|
+
"items-center border-b border-agg-separator px-4 py-3 last:border-b-0 sm:min-h-16 sm:px-5"
|
|
41946
|
+
),
|
|
41947
|
+
children: [
|
|
41948
|
+
/* @__PURE__ */ (0, import_jsx_runtime211.jsx)("span", { className: "size-7 rounded-agg-full bg-agg-secondary-hover/80" }),
|
|
41949
|
+
/* @__PURE__ */ (0, import_jsx_runtime211.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
41950
|
+
/* @__PURE__ */ (0, import_jsx_runtime211.jsx)("span", { className: "size-10 rounded-agg-full bg-agg-secondary-hover/80" }),
|
|
41951
|
+
/* @__PURE__ */ (0, import_jsx_runtime211.jsxs)("div", { className: "flex flex-1 flex-col gap-2", children: [
|
|
41952
|
+
/* @__PURE__ */ (0, import_jsx_runtime211.jsx)("span", { className: "h-3 w-2/5 rounded-agg-sm bg-agg-secondary-hover/80" }),
|
|
41953
|
+
/* @__PURE__ */ (0, import_jsx_runtime211.jsx)("span", { className: "h-3 w-1/5 rounded-agg-sm bg-agg-secondary-hover/80" })
|
|
41954
|
+
] })
|
|
41955
|
+
] }),
|
|
41956
|
+
/* @__PURE__ */ (0, import_jsx_runtime211.jsx)("span", { className: "hidden h-3 w-10 justify-self-end rounded-agg-sm bg-agg-secondary-hover/80 sm:block" }),
|
|
41957
|
+
/* @__PURE__ */ (0, import_jsx_runtime211.jsx)("span", { className: "hidden h-3 w-16 justify-self-end rounded-agg-sm bg-agg-secondary-hover/80 sm:block" }),
|
|
41958
|
+
/* @__PURE__ */ (0, import_jsx_runtime211.jsx)("span", { className: "hidden h-3 w-14 justify-self-end rounded-agg-sm bg-agg-secondary-hover/80 sm:block" })
|
|
41959
|
+
]
|
|
41960
|
+
},
|
|
41961
|
+
i
|
|
41962
|
+
)) });
|
|
41963
|
+
}
|
|
41964
|
+
|
|
41965
|
+
// src/pages/leaderboard/components/segmented-control.tsx
|
|
41966
|
+
init_utils();
|
|
41967
|
+
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
41968
|
+
function SegmentedControl({
|
|
41969
|
+
label: label2,
|
|
41970
|
+
value,
|
|
41971
|
+
onChange,
|
|
41972
|
+
items,
|
|
41973
|
+
className,
|
|
41974
|
+
itemClassName
|
|
41975
|
+
}) {
|
|
41976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
41977
|
+
"div",
|
|
41978
|
+
{
|
|
41979
|
+
role: "group",
|
|
41980
|
+
"aria-label": label2,
|
|
41981
|
+
className: cn(
|
|
41982
|
+
"agg-segmented flex h-10 w-full items-stretch overflow-clip rounded-agg-sm border border-agg-separator sm:w-auto",
|
|
41983
|
+
className
|
|
41984
|
+
),
|
|
41985
|
+
children: items.map((item, idx) => {
|
|
41986
|
+
const isActive = item.value === value;
|
|
41987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime212.jsxs)("div", { className: "flex flex-1 items-stretch sm:flex-none", children: [
|
|
41988
|
+
idx > 0 ? /* @__PURE__ */ (0, import_jsx_runtime212.jsx)("div", { className: "w-px bg-agg-separator", "aria-hidden": true }) : null,
|
|
41989
|
+
/* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
41990
|
+
"button",
|
|
41991
|
+
{
|
|
41992
|
+
type: "button",
|
|
41993
|
+
"aria-pressed": isActive,
|
|
41994
|
+
onClick: () => onChange(item.value),
|
|
41995
|
+
className: cn(
|
|
41996
|
+
"agg-segmented-trigger flex flex-1 cursor-pointer items-center justify-center px-3 font-agg-sans text-agg-sm leading-agg-5 whitespace-nowrap outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-agg-primary-hover sm:px-4",
|
|
41997
|
+
isActive ? "bg-agg-secondary-hover font-agg-bold text-agg-foreground" : "bg-agg-secondary font-agg-normal text-agg-muted-foreground hover:bg-agg-secondary-hover hover:text-agg-foreground",
|
|
41998
|
+
itemClassName
|
|
41999
|
+
),
|
|
42000
|
+
children: item.label
|
|
42001
|
+
}
|
|
42002
|
+
)
|
|
42003
|
+
] }, item.value);
|
|
42004
|
+
})
|
|
42005
|
+
}
|
|
42006
|
+
);
|
|
42007
|
+
}
|
|
42008
|
+
|
|
42009
|
+
// src/pages/leaderboard/index.tsx
|
|
42010
|
+
var import_jsx_runtime213 = require("react/jsx-runtime");
|
|
42011
|
+
function LeaderboardPage(props) {
|
|
42012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(AggErrorBoundary, { onError: props.onError, children: /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(LeaderboardPageInner, __spreadValues({}, props)) });
|
|
42013
|
+
}
|
|
42014
|
+
function LeaderboardPageInner({
|
|
42015
|
+
rows: rowsProp,
|
|
42016
|
+
isLoading: isLoadingProp,
|
|
42017
|
+
error: errorProp,
|
|
42018
|
+
hasNextPage: hasNextPageProp,
|
|
42019
|
+
isLoadingMore: isLoadingMoreProp,
|
|
42020
|
+
onLoadMore: onLoadMoreProp,
|
|
42021
|
+
period: periodProp,
|
|
42022
|
+
onPeriodChange,
|
|
42023
|
+
metric: metricProp,
|
|
42024
|
+
onMetricChange,
|
|
42025
|
+
currentUserId: currentUserIdProp,
|
|
42026
|
+
appName,
|
|
42027
|
+
className,
|
|
42028
|
+
classNames
|
|
42029
|
+
}) {
|
|
42030
|
+
const allLabels = (0, import_hooks105.useLabels)();
|
|
42031
|
+
const labels = allLabels.leaderboard;
|
|
42032
|
+
const { user } = (0, import_hooks105.useAggAuthState)();
|
|
42033
|
+
const [periodState, setPeriodState] = (0, import_react69.useState)(LEADERBOARD_DEFAULT_PERIOD);
|
|
42034
|
+
const [metricState, setMetricState] = (0, import_react69.useState)(LEADERBOARD_DEFAULT_METRIC);
|
|
42035
|
+
const period = periodProp != null ? periodProp : periodState;
|
|
42036
|
+
const metric = metricProp != null ? metricProp : metricState;
|
|
42037
|
+
const handlePeriodChange = (0, import_react69.useCallback)(
|
|
42038
|
+
(next) => {
|
|
42039
|
+
if (periodProp === void 0) setPeriodState(next);
|
|
42040
|
+
onPeriodChange == null ? void 0 : onPeriodChange(next);
|
|
42041
|
+
},
|
|
42042
|
+
[onPeriodChange, periodProp]
|
|
42043
|
+
);
|
|
42044
|
+
const handleMetricChange = (0, import_react69.useCallback)(
|
|
42045
|
+
(next) => {
|
|
42046
|
+
if (metricProp === void 0) setMetricState(next);
|
|
42047
|
+
onMetricChange == null ? void 0 : onMetricChange(next);
|
|
42048
|
+
},
|
|
42049
|
+
[metricProp, onMetricChange]
|
|
42050
|
+
);
|
|
42051
|
+
const shouldUseHookData = !rowsProp;
|
|
42052
|
+
const query = (0, import_hooks105.useLeaderboard)({ period, metric, enabled: shouldUseHookData });
|
|
42053
|
+
const rows = rowsProp != null ? rowsProp : query.rows;
|
|
42054
|
+
const isLoading = isLoadingProp != null ? isLoadingProp : shouldUseHookData && query.isLoading;
|
|
42055
|
+
const error = errorProp != null ? errorProp : shouldUseHookData ? query.error : null;
|
|
42056
|
+
const hasNextPage = hasNextPageProp != null ? hasNextPageProp : shouldUseHookData && query.hasNextPage;
|
|
42057
|
+
const isLoadingMore = isLoadingMoreProp != null ? isLoadingMoreProp : shouldUseHookData && query.isFetchingNextPage;
|
|
42058
|
+
const fetchNextPage = query.fetchNextPage;
|
|
42059
|
+
const onLoadMore = (0, import_react69.useMemo)(
|
|
42060
|
+
() => onLoadMoreProp != null ? onLoadMoreProp : shouldUseHookData ? () => void fetchNextPage() : void 0,
|
|
42061
|
+
[onLoadMoreProp, shouldUseHookData, fetchNextPage]
|
|
42062
|
+
);
|
|
42063
|
+
const retry = shouldUseHookData ? () => void query.refetch() : void 0;
|
|
42064
|
+
const currentUserId = currentUserIdProp != null ? currentUserIdProp : user == null ? void 0 : user.id;
|
|
42065
|
+
const [sentinel, setSentinel] = (0, import_react69.useState)(null);
|
|
42066
|
+
(0, import_react69.useEffect)(() => {
|
|
42067
|
+
const target = sentinel;
|
|
42068
|
+
if (!target || !hasNextPage || !onLoadMore || typeof IntersectionObserver === "undefined")
|
|
42069
|
+
return;
|
|
42070
|
+
const observer = new IntersectionObserver(
|
|
42071
|
+
(entries) => {
|
|
42072
|
+
var _a;
|
|
42073
|
+
if (!((_a = entries[0]) == null ? void 0 : _a.isIntersecting) || isLoading || isLoadingMore) return;
|
|
42074
|
+
onLoadMore();
|
|
42075
|
+
},
|
|
42076
|
+
{ rootMargin: "60px 0px" }
|
|
42077
|
+
);
|
|
42078
|
+
observer.observe(target);
|
|
42079
|
+
return () => observer.disconnect();
|
|
42080
|
+
}, [sentinel, hasNextPage, isLoading, isLoadingMore, onLoadMore]);
|
|
42081
|
+
const hasRows = rows.length > 0;
|
|
42082
|
+
const showInlineError = Boolean(error) && hasRows;
|
|
42083
|
+
const periodItems = import_hooks105.LEADERBOARD_PERIODS.map((value) => ({ value, label: labels.periods[value] }));
|
|
42084
|
+
const metricItems = LEADERBOARD_METRICS.map((value) => ({ value, label: labels.metrics[value] }));
|
|
42085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime213.jsxs)(
|
|
42086
|
+
"div",
|
|
42087
|
+
{
|
|
42088
|
+
className: cn(
|
|
42089
|
+
"agg-leaderboard mx-auto flex w-full max-w-[960px] flex-col px-4 py-6 sm:px-6 gap-5 font-agg-sans text-agg-foreground",
|
|
42090
|
+
className,
|
|
42091
|
+
classNames == null ? void 0 : classNames.root
|
|
42092
|
+
),
|
|
42093
|
+
children: [
|
|
42094
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsxs)("header", { className: cn("agg-leaderboard-title flex flex-col gap-1", classNames == null ? void 0 : classNames.header), children: [
|
|
42095
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)("h1", { className: "agg-type-heading m-0", children: labels.title }),
|
|
42096
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)("p", { className: "m-0 text-agg-sm leading-agg-5 text-agg-muted-foreground", children: labels.subtitle(appName, labels.periods[period]) })
|
|
42097
|
+
] }),
|
|
42098
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsxs)(
|
|
42099
|
+
"div",
|
|
42100
|
+
{
|
|
42101
|
+
className: cn(
|
|
42102
|
+
"agg-leaderboard-toolbar flex flex-col gap-3 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between",
|
|
42103
|
+
classNames == null ? void 0 : classNames.toolbar
|
|
42104
|
+
),
|
|
42105
|
+
children: [
|
|
42106
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsxs)("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-3", children: [
|
|
42107
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)("span", { className: "agg-type-caption uppercase tracking-wide text-agg-muted-foreground", children: labels.periodLabel }),
|
|
42108
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
42109
|
+
SegmentedControl,
|
|
42110
|
+
{
|
|
42111
|
+
label: labels.periodLabel,
|
|
42112
|
+
value: period,
|
|
42113
|
+
onChange: handlePeriodChange,
|
|
42114
|
+
items: periodItems
|
|
42115
|
+
}
|
|
42116
|
+
)
|
|
42117
|
+
] }),
|
|
42118
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsxs)("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-3", children: [
|
|
42119
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)("span", { className: "agg-type-caption uppercase tracking-wide text-agg-muted-foreground", children: labels.rankByLabel }),
|
|
42120
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
42121
|
+
SegmentedControl,
|
|
42122
|
+
{
|
|
42123
|
+
label: labels.rankByLabel,
|
|
42124
|
+
value: metric,
|
|
42125
|
+
onChange: handleMetricChange,
|
|
42126
|
+
items: metricItems
|
|
42127
|
+
}
|
|
42128
|
+
)
|
|
42129
|
+
] })
|
|
42130
|
+
]
|
|
42131
|
+
}
|
|
42132
|
+
),
|
|
42133
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsxs)(
|
|
42134
|
+
"section",
|
|
42135
|
+
{
|
|
42136
|
+
"aria-label": labels.title,
|
|
42137
|
+
className: cn(
|
|
42138
|
+
"agg-leaderboard-list overflow-clip rounded-agg-xl border border-agg-separator bg-agg-secondary shadow-agg-card",
|
|
42139
|
+
classNames == null ? void 0 : classNames.list
|
|
42140
|
+
),
|
|
42141
|
+
children: [
|
|
42142
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsxs)("div", { role: "table", "aria-label": labels.title, className: "agg-leaderboard-table", children: [
|
|
42143
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)(LeaderboardHeaderRow, { metric, onMetricChange: handleMetricChange }),
|
|
42144
|
+
!isLoading && hasRows ? /* @__PURE__ */ (0, import_jsx_runtime213.jsx)("div", { className: "divide-y divide-agg-separator", children: rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
42145
|
+
LeaderboardRowView,
|
|
42146
|
+
{
|
|
42147
|
+
row,
|
|
42148
|
+
isCurrentUser: currentUserId !== void 0 && row.userId === currentUserId,
|
|
42149
|
+
className: classNames == null ? void 0 : classNames.row
|
|
42150
|
+
},
|
|
42151
|
+
row.userId
|
|
42152
|
+
)) }) : null
|
|
42153
|
+
] }),
|
|
42154
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(LeaderboardSkeleton, {}) : error && !hasRows ? /* @__PURE__ */ (0, import_jsx_runtime213.jsx)("div", { className: "py-10", children: /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
42155
|
+
StateMessage,
|
|
42156
|
+
{
|
|
42157
|
+
title: labels.errorTitle,
|
|
42158
|
+
description: labels.errorDescription,
|
|
42159
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(Icon, { name: "warning" }),
|
|
42160
|
+
onAction: retry
|
|
42161
|
+
}
|
|
42162
|
+
) }) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime213.jsx)("div", { className: "py-10", children: /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
42163
|
+
StateMessage,
|
|
42164
|
+
{
|
|
42165
|
+
title: labels.emptyTitle,
|
|
42166
|
+
description: labels.emptyDescription,
|
|
42167
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(Icon, { name: "search-empty" })
|
|
42168
|
+
}
|
|
42169
|
+
) }) : null,
|
|
42170
|
+
(hasNextPage || showInlineError) && !isLoading ? /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
42171
|
+
"div",
|
|
42172
|
+
{
|
|
42173
|
+
className: cn(
|
|
42174
|
+
"agg-leaderboard-footer relative flex items-center justify-center gap-3 border-t border-agg-separator p-3.5",
|
|
42175
|
+
classNames == null ? void 0 : classNames.footer
|
|
42176
|
+
),
|
|
42177
|
+
children: showInlineError ? /* @__PURE__ */ (0, import_jsx_runtime213.jsxs)(import_jsx_runtime213.Fragment, { children: [
|
|
42178
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)("span", { role: "alert", className: "text-agg-sm leading-agg-5 text-agg-error", children: labels.errorTitle }),
|
|
42179
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)(Button, { variant: "tertiary", size: "small", onClick: retry != null ? retry : onLoadMore, children: allLabels.common.retry })
|
|
42180
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime213.jsxs)(import_jsx_runtime213.Fragment, { children: [
|
|
42181
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
42182
|
+
"div",
|
|
42183
|
+
{
|
|
42184
|
+
ref: setSentinel,
|
|
42185
|
+
className: "agg-leaderboard-sentinel absolute inset-x-0 top-0 h-px",
|
|
42186
|
+
"aria-hidden": true
|
|
42187
|
+
}
|
|
42188
|
+
),
|
|
42189
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
42190
|
+
Button,
|
|
42191
|
+
{
|
|
42192
|
+
variant: "tertiary",
|
|
42193
|
+
size: "small",
|
|
42194
|
+
onClick: onLoadMore,
|
|
42195
|
+
disabled: isLoadingMore,
|
|
42196
|
+
isLoading: isLoadingMore,
|
|
42197
|
+
"aria-label": labels.showMore,
|
|
42198
|
+
children: labels.showMore
|
|
42199
|
+
}
|
|
42200
|
+
)
|
|
42201
|
+
] })
|
|
42202
|
+
}
|
|
42203
|
+
) : null
|
|
42204
|
+
]
|
|
42205
|
+
}
|
|
42206
|
+
),
|
|
42207
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)("p", { className: "m-0 text-agg-xs leading-agg-4 text-agg-muted-foreground", children: labels.pnlFootnote })
|
|
42208
|
+
]
|
|
42209
|
+
}
|
|
42210
|
+
);
|
|
42211
|
+
}
|
|
42212
|
+
LeaderboardPage.displayName = "LeaderboardPage";
|
|
42213
|
+
|
|
41691
42214
|
// src/deposit/index.tsx
|
|
41692
|
-
var
|
|
42215
|
+
var import_hooks116 = require("@agg-build/hooks");
|
|
41693
42216
|
var import_deposit = require("@agg-build/hooks/deposit");
|
|
41694
|
-
var
|
|
42217
|
+
var import_react72 = require("react");
|
|
41695
42218
|
init_modal();
|
|
41696
42219
|
init_deposit_notification_events();
|
|
41697
42220
|
|
|
@@ -41924,14 +42447,14 @@ var NETWORK_TO_CURRENCY_CODE = {
|
|
|
41924
42447
|
};
|
|
41925
42448
|
|
|
41926
42449
|
// src/deposit/steps/card-deposit.tsx
|
|
41927
|
-
var
|
|
41928
|
-
var
|
|
42450
|
+
var import_hooks106 = require("@agg-build/hooks");
|
|
42451
|
+
var import_react70 = require("react");
|
|
41929
42452
|
init_utils();
|
|
41930
42453
|
init_modal();
|
|
41931
42454
|
init_button();
|
|
41932
42455
|
init_select();
|
|
41933
42456
|
init_icon();
|
|
41934
|
-
var
|
|
42457
|
+
var import_jsx_runtime214 = require("react/jsx-runtime");
|
|
41935
42458
|
var CardDepositStep = ({
|
|
41936
42459
|
amount: amount2,
|
|
41937
42460
|
currency,
|
|
@@ -41947,9 +42470,9 @@ var CardDepositStep = ({
|
|
|
41947
42470
|
onNetworkChange,
|
|
41948
42471
|
onContinue
|
|
41949
42472
|
}) => {
|
|
41950
|
-
const labels = (0,
|
|
41951
|
-
const [localAmount, setLocalAmount] = (0,
|
|
41952
|
-
(0,
|
|
42473
|
+
const labels = (0, import_hooks106.useLabels)();
|
|
42474
|
+
const [localAmount, setLocalAmount] = (0, import_react70.useState)(amount2);
|
|
42475
|
+
(0, import_react70.useEffect)(() => {
|
|
41953
42476
|
setLocalAmount(amount2);
|
|
41954
42477
|
}, [amount2]);
|
|
41955
42478
|
const numericAmount = Number(localAmount) || 0;
|
|
@@ -41957,33 +42480,33 @@ var CardDepositStep = ({
|
|
|
41957
42480
|
const isBelowMin = minAmount != null && hasInput && numericAmount < minAmount;
|
|
41958
42481
|
const isValid = numericAmount > 0 && !isBelowMin;
|
|
41959
42482
|
const formattedMin = minAmount != null ? `$${minAmount}` : void 0;
|
|
41960
|
-
return /* @__PURE__ */ (0,
|
|
41961
|
-
/* @__PURE__ */ (0,
|
|
42483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)(import_jsx_runtime214.Fragment, { children: [
|
|
42484
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
41962
42485
|
Modal.Header,
|
|
41963
42486
|
{
|
|
41964
42487
|
title: labels.deposit.cardFlow.title,
|
|
41965
42488
|
hideBorder: true,
|
|
41966
|
-
leftElement: /* @__PURE__ */ (0,
|
|
42489
|
+
leftElement: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
41967
42490
|
"button",
|
|
41968
42491
|
{
|
|
41969
42492
|
type: "button",
|
|
41970
42493
|
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
41971
42494
|
onClick: onBack,
|
|
41972
42495
|
"aria-label": "Go back",
|
|
41973
|
-
children: /* @__PURE__ */ (0,
|
|
42496
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
41974
42497
|
}
|
|
41975
42498
|
)
|
|
41976
42499
|
}
|
|
41977
42500
|
),
|
|
41978
|
-
/* @__PURE__ */ (0,
|
|
41979
|
-
/* @__PURE__ */ (0,
|
|
41980
|
-
/* @__PURE__ */ (0,
|
|
41981
|
-
/* @__PURE__ */ (0,
|
|
41982
|
-
/* @__PURE__ */ (0,
|
|
41983
|
-
formattedMin ? /* @__PURE__ */ (0,
|
|
42501
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("div", { className: "flex flex-col gap-5", children: [
|
|
42502
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
42503
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("div", { className: "flex-1 flex flex-col gap-2", children: [
|
|
42504
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
42505
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.cardFlow.amountLabel }),
|
|
42506
|
+
formattedMin ? /* @__PURE__ */ (0, import_jsx_runtime214.jsx)("p", { className: "agg-type-label text-agg-foreground", children: labels.deposit.cardFlow.minRequired(formattedMin) }) : null
|
|
41984
42507
|
] }),
|
|
41985
|
-
/* @__PURE__ */ (0,
|
|
41986
|
-
/* @__PURE__ */ (0,
|
|
42508
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("div", { className: "flex gap-3 items-center", children: [
|
|
42509
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsxs)(
|
|
41987
42510
|
"div",
|
|
41988
42511
|
{
|
|
41989
42512
|
className: cn(
|
|
@@ -41991,7 +42514,7 @@ var CardDepositStep = ({
|
|
|
41991
42514
|
isBelowMin ? "border-agg-primary border-2" : "border-agg-separator"
|
|
41992
42515
|
),
|
|
41993
42516
|
children: [
|
|
41994
|
-
/* @__PURE__ */ (0,
|
|
42517
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
41995
42518
|
"input",
|
|
41996
42519
|
{
|
|
41997
42520
|
type: "text",
|
|
@@ -42007,11 +42530,11 @@ var CardDepositStep = ({
|
|
|
42007
42530
|
}
|
|
42008
42531
|
}
|
|
42009
42532
|
),
|
|
42010
|
-
/* @__PURE__ */ (0,
|
|
42533
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)("span", { className: "agg-type-body text-agg-muted-foreground", children: "$" })
|
|
42011
42534
|
]
|
|
42012
42535
|
}
|
|
42013
42536
|
),
|
|
42014
|
-
/* @__PURE__ */ (0,
|
|
42537
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)("div", { className: "w-[100px]", children: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
42015
42538
|
Select,
|
|
42016
42539
|
{
|
|
42017
42540
|
items: [{ value: currency, label: currency }],
|
|
@@ -42023,8 +42546,8 @@ var CardDepositStep = ({
|
|
|
42023
42546
|
) })
|
|
42024
42547
|
] })
|
|
42025
42548
|
] }),
|
|
42026
|
-
isBelowMin && formattedMin ? /* @__PURE__ */ (0,
|
|
42027
|
-
/* @__PURE__ */ (0,
|
|
42549
|
+
isBelowMin && formattedMin ? /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("div", { className: "flex items-center gap-2", role: "alert", "aria-live": "assertive", children: [
|
|
42550
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
42028
42551
|
Icon,
|
|
42029
42552
|
{
|
|
42030
42553
|
name: "warning",
|
|
@@ -42032,12 +42555,12 @@ var CardDepositStep = ({
|
|
|
42032
42555
|
"aria-hidden": "true"
|
|
42033
42556
|
}
|
|
42034
42557
|
),
|
|
42035
|
-
/* @__PURE__ */ (0,
|
|
42558
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)("p", { className: "agg-type-label text-agg-error", children: labels.deposit.cardFlow.minAmountError(formattedMin) })
|
|
42036
42559
|
] }) : null
|
|
42037
42560
|
] }),
|
|
42038
|
-
/* @__PURE__ */ (0,
|
|
42039
|
-
/* @__PURE__ */ (0,
|
|
42040
|
-
/* @__PURE__ */ (0,
|
|
42561
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
42562
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.cardFlow.networkLabel }),
|
|
42563
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
42041
42564
|
Select,
|
|
42042
42565
|
{
|
|
42043
42566
|
items: networkOptions,
|
|
@@ -42048,7 +42571,7 @@ var CardDepositStep = ({
|
|
|
42048
42571
|
}
|
|
42049
42572
|
)
|
|
42050
42573
|
] }),
|
|
42051
|
-
/* @__PURE__ */ (0,
|
|
42574
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
42052
42575
|
Button,
|
|
42053
42576
|
{
|
|
42054
42577
|
variant: "secondary",
|
|
@@ -42064,12 +42587,12 @@ var CardDepositStep = ({
|
|
|
42064
42587
|
};
|
|
42065
42588
|
|
|
42066
42589
|
// src/deposit/steps/card-payment-pending.tsx
|
|
42067
|
-
var
|
|
42590
|
+
var import_hooks107 = require("@agg-build/hooks");
|
|
42068
42591
|
init_modal();
|
|
42069
42592
|
init_button();
|
|
42070
42593
|
init_copy_button();
|
|
42071
42594
|
init_icon();
|
|
42072
|
-
var
|
|
42595
|
+
var import_jsx_runtime215 = require("react/jsx-runtime");
|
|
42073
42596
|
var CardPaymentPendingStep = ({
|
|
42074
42597
|
providerName,
|
|
42075
42598
|
walletAddress,
|
|
@@ -42077,29 +42600,29 @@ var CardPaymentPendingStep = ({
|
|
|
42077
42600
|
onViewActivity,
|
|
42078
42601
|
onChooseAnotherProvider
|
|
42079
42602
|
}) => {
|
|
42080
|
-
const labels = (0,
|
|
42081
|
-
return /* @__PURE__ */ (0,
|
|
42082
|
-
/* @__PURE__ */ (0,
|
|
42603
|
+
const labels = (0, import_hooks107.useLabels)();
|
|
42604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime215.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime215.jsxs)(Modal.Body, { classNames: { root: "px-5 py-8 sm:px-8 sm:py-10" }, children: [
|
|
42605
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)(
|
|
42083
42606
|
"button",
|
|
42084
42607
|
{
|
|
42085
42608
|
type: "button",
|
|
42086
42609
|
className: "absolute right-8 top-7 flex items-center justify-center text-agg-foreground transition-colors cursor-pointer hover:text-agg-foreground/80",
|
|
42087
42610
|
onClick: onClose,
|
|
42088
42611
|
"aria-label": labels.common.close,
|
|
42089
|
-
children: /* @__PURE__ */ (0,
|
|
42612
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(CloseIcon, { className: "h-6 w-6" })
|
|
42090
42613
|
}
|
|
42091
42614
|
),
|
|
42092
|
-
/* @__PURE__ */ (0,
|
|
42093
|
-
/* @__PURE__ */ (0,
|
|
42094
|
-
/* @__PURE__ */ (0,
|
|
42095
|
-
/* @__PURE__ */ (0,
|
|
42096
|
-
/* @__PURE__ */ (0,
|
|
42615
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsxs)("div", { className: "flex flex-col items-center gap-8", children: [
|
|
42616
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)("div", { className: "flex h-[60px] w-[60px] items-center justify-center text-agg-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(ExternalLinkIcon, { className: "h-[60px] w-[60px]" }) }),
|
|
42617
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsxs)("div", { className: "flex flex-col items-center gap-3 text-center", children: [
|
|
42618
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)("h3", { className: "text-agg-2xl leading-agg-8 font-agg-bold text-agg-foreground", children: labels.deposit.cardFlow.pendingTitle(providerName) }),
|
|
42619
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)("p", { className: "agg-type-body text-agg-foreground", children: labels.deposit.cardFlow.pendingDescription })
|
|
42097
42620
|
] }),
|
|
42098
|
-
walletAddress ? /* @__PURE__ */ (0,
|
|
42099
|
-
/* @__PURE__ */ (0,
|
|
42100
|
-
/* @__PURE__ */ (0,
|
|
42101
|
-
/* @__PURE__ */ (0,
|
|
42102
|
-
/* @__PURE__ */ (0,
|
|
42621
|
+
walletAddress ? /* @__PURE__ */ (0, import_jsx_runtime215.jsxs)("div", { className: "flex w-full flex-col items-center gap-3 rounded-agg-md bg-agg-secondary-hover p-5", children: [
|
|
42622
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)("p", { className: "agg-type-label text-agg-foreground w-full", children: labels.deposit.cardFlow.pendingWalletAddressHelp }),
|
|
42623
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsxs)("div", { className: "flex w-full h-10 items-center gap-2 rounded border border-agg-separator bg-agg-secondary px-3 py-[10px]", children: [
|
|
42624
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)("p", { className: "agg-type-body flex-1 min-w-0 truncate text-agg-foreground", children: walletAddress }),
|
|
42625
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)(
|
|
42103
42626
|
CopyButton,
|
|
42104
42627
|
{
|
|
42105
42628
|
value: walletAddress,
|
|
@@ -42109,11 +42632,11 @@ var CardPaymentPendingStep = ({
|
|
|
42109
42632
|
)
|
|
42110
42633
|
] })
|
|
42111
42634
|
] }) : null,
|
|
42112
|
-
/* @__PURE__ */ (0,
|
|
42113
|
-
/* @__PURE__ */ (0,
|
|
42114
|
-
/* @__PURE__ */ (0,
|
|
42635
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsxs)("div", { className: "flex items-start justify-center gap-3", children: [
|
|
42636
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)(Button, { variant: "secondary", size: "large", className: "w-[120px]", onClick: onClose, children: labels.common.close }),
|
|
42637
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)(Button, { variant: "primary", size: "large", onClick: onViewActivity, children: labels.deposit.cardFlow.viewActivity })
|
|
42115
42638
|
] }),
|
|
42116
|
-
/* @__PURE__ */ (0,
|
|
42639
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)(
|
|
42117
42640
|
"button",
|
|
42118
42641
|
{
|
|
42119
42642
|
type: "button",
|
|
@@ -42127,26 +42650,26 @@ var CardPaymentPendingStep = ({
|
|
|
42127
42650
|
};
|
|
42128
42651
|
|
|
42129
42652
|
// src/deposit/steps/card-provider.tsx
|
|
42130
|
-
var
|
|
42653
|
+
var import_hooks108 = require("@agg-build/hooks");
|
|
42131
42654
|
init_modal();
|
|
42132
42655
|
init_button();
|
|
42133
42656
|
init_loading_icon();
|
|
42134
42657
|
init_icon();
|
|
42135
42658
|
init_usdc();
|
|
42136
|
-
var
|
|
42659
|
+
var import_jsx_runtime216 = require("react/jsx-runtime");
|
|
42137
42660
|
var CardProviderItem = ({ provider, onSelect }) => {
|
|
42138
|
-
const labels = (0,
|
|
42661
|
+
const labels = (0, import_hooks108.useLabels)();
|
|
42139
42662
|
const badgeText = provider.badge === "best" ? labels.deposit.cardFlow.providerBadges.best : provider.badge === "low-kyc" ? labels.deposit.cardFlow.providerBadges.lowKyc : void 0;
|
|
42140
|
-
return /* @__PURE__ */ (0,
|
|
42663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
42141
42664
|
"button",
|
|
42142
42665
|
{
|
|
42143
42666
|
type: "button",
|
|
42144
42667
|
className: "w-full rounded-xl border border-agg-separator px-4 py-3 text-left bg-agg-secondary hover:bg-agg-secondary-hover transition-colors cursor-pointer",
|
|
42145
42668
|
onClick: () => onSelect(provider.id),
|
|
42146
|
-
children: /* @__PURE__ */ (0,
|
|
42147
|
-
/* @__PURE__ */ (0,
|
|
42148
|
-
/* @__PURE__ */ (0,
|
|
42149
|
-
badgeText ? /* @__PURE__ */ (0,
|
|
42669
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime216.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
42670
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
42671
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)("p", { className: "text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: provider.name }),
|
|
42672
|
+
badgeText ? /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
42150
42673
|
"span",
|
|
42151
42674
|
{
|
|
42152
42675
|
className: `rounded border px-2 py-[2px] text-[10px] leading-[14px] font-agg-bold uppercase ${provider.badge === "best" ? "border-agg-primary/50 text-agg-primary bg-agg-secondary" : "border-agg-separator text-agg-foreground bg-agg-secondary"}`,
|
|
@@ -42154,16 +42677,16 @@ var CardProviderItem = ({ provider, onSelect }) => {
|
|
|
42154
42677
|
}
|
|
42155
42678
|
) : null
|
|
42156
42679
|
] }),
|
|
42157
|
-
/* @__PURE__ */ (0,
|
|
42158
|
-
/* @__PURE__ */ (0,
|
|
42159
|
-
/* @__PURE__ */ (0,
|
|
42160
|
-
/* @__PURE__ */ (0,
|
|
42680
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
42681
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsxs)("div", { className: "text-right", children: [
|
|
42682
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)("p", { className: "agg-type-body text-agg-foreground", children: provider.quote }),
|
|
42683
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsxs)("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
42161
42684
|
labels.deposit.cardFlow.feeLabel,
|
|
42162
42685
|
" ",
|
|
42163
42686
|
provider.fee
|
|
42164
42687
|
] })
|
|
42165
42688
|
] }),
|
|
42166
|
-
/* @__PURE__ */ (0,
|
|
42689
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)(ChevronRightIcon, { className: "h-5 w-5 text-agg-muted-foreground" })
|
|
42167
42690
|
] })
|
|
42168
42691
|
] })
|
|
42169
42692
|
}
|
|
@@ -42181,41 +42704,41 @@ var CardProviderStep = ({
|
|
|
42181
42704
|
onSelectProvider,
|
|
42182
42705
|
onRetry
|
|
42183
42706
|
}) => {
|
|
42184
|
-
const labels = (0,
|
|
42185
|
-
return /* @__PURE__ */ (0,
|
|
42186
|
-
/* @__PURE__ */ (0,
|
|
42707
|
+
const labels = (0, import_hooks108.useLabels)();
|
|
42708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime216.jsxs)(import_jsx_runtime216.Fragment, { children: [
|
|
42709
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
42187
42710
|
Modal.Header,
|
|
42188
42711
|
{
|
|
42189
42712
|
title: labels.deposit.cardFlow.selectProviderTitle,
|
|
42190
42713
|
hideBorder: true,
|
|
42191
|
-
leftElement: /* @__PURE__ */ (0,
|
|
42714
|
+
leftElement: /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
42192
42715
|
"button",
|
|
42193
42716
|
{
|
|
42194
42717
|
type: "button",
|
|
42195
42718
|
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
42196
42719
|
onClick: onBack,
|
|
42197
42720
|
"aria-label": labels.deposit.back,
|
|
42198
|
-
children: /* @__PURE__ */ (0,
|
|
42721
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
42199
42722
|
}
|
|
42200
42723
|
)
|
|
42201
42724
|
}
|
|
42202
42725
|
),
|
|
42203
|
-
/* @__PURE__ */ (0,
|
|
42204
|
-
/* @__PURE__ */ (0,
|
|
42205
|
-
/* @__PURE__ */ (0,
|
|
42206
|
-
/* @__PURE__ */ (0,
|
|
42207
|
-
/* @__PURE__ */ (0,
|
|
42726
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime216.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
42727
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
42728
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)(UsdcIcon, { className: "h-4 w-4 shrink-0" }),
|
|
42729
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)("span", { className: "agg-type-body font-agg-bold text-agg-foreground", children: token }),
|
|
42730
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsxs)("span", { className: "agg-type-body text-agg-foreground", children: [
|
|
42208
42731
|
"$",
|
|
42209
42732
|
amount2,
|
|
42210
42733
|
" ",
|
|
42211
42734
|
currency
|
|
42212
42735
|
] })
|
|
42213
42736
|
] }),
|
|
42214
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
42215
|
-
/* @__PURE__ */ (0,
|
|
42216
|
-
/* @__PURE__ */ (0,
|
|
42217
|
-
] }) : error ? /* @__PURE__ */ (0,
|
|
42218
|
-
/* @__PURE__ */ (0,
|
|
42737
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime216.jsxs)("div", { className: "flex min-h-[200px] flex-col items-center justify-center gap-3", children: [
|
|
42738
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)(LoadingIcon, { variant: "prominent" }),
|
|
42739
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)("p", { className: "agg-type-body text-agg-foreground", children: labels.deposit.cardFlow.loadingQuotes })
|
|
42740
|
+
] }) : error ? /* @__PURE__ */ (0, import_jsx_runtime216.jsxs)("div", { className: "flex min-h-[200px] flex-col items-center justify-center gap-6 px-2 text-center", children: [
|
|
42741
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
42219
42742
|
Icon,
|
|
42220
42743
|
{
|
|
42221
42744
|
name: "quotes-warning",
|
|
@@ -42224,13 +42747,13 @@ var CardProviderStep = ({
|
|
|
42224
42747
|
color: "currentColor"
|
|
42225
42748
|
}
|
|
42226
42749
|
),
|
|
42227
|
-
/* @__PURE__ */ (0,
|
|
42228
|
-
/* @__PURE__ */ (0,
|
|
42229
|
-
/* @__PURE__ */ (0,
|
|
42750
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsxs)("div", { className: "flex max-w-[320px] flex-col gap-2", children: [
|
|
42751
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)("p", { className: "text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: labels.deposit.cardFlow.errorLoadingQuotesTitle }),
|
|
42752
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)("p", { className: "agg-type-body text-agg-muted-foreground", children: labels.deposit.cardFlow.errorLoadingQuotesDescription })
|
|
42230
42753
|
] }),
|
|
42231
|
-
onRetry ? /* @__PURE__ */ (0,
|
|
42232
|
-
] }) : providers.length === 0 ? /* @__PURE__ */ (0,
|
|
42233
|
-
providers.map((provider) => /* @__PURE__ */ (0,
|
|
42754
|
+
onRetry ? /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(Button, { variant: "secondary", size: "medium", onClick: onRetry, children: labels.deposit.cardFlow.retry }) : null
|
|
42755
|
+
] }) : providers.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime216.jsx)("div", { className: "flex min-h-[200px] items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime216.jsx)("p", { className: "agg-type-body text-agg-muted-foreground", children: labels.deposit.cardFlow.noQuotes }) }) : /* @__PURE__ */ (0, import_jsx_runtime216.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
42756
|
+
providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
42234
42757
|
CardProviderItem,
|
|
42235
42758
|
{
|
|
42236
42759
|
provider,
|
|
@@ -42238,63 +42761,63 @@ var CardProviderStep = ({
|
|
|
42238
42761
|
},
|
|
42239
42762
|
provider.id
|
|
42240
42763
|
)),
|
|
42241
|
-
sessionError ? /* @__PURE__ */ (0,
|
|
42764
|
+
sessionError ? /* @__PURE__ */ (0, import_jsx_runtime216.jsx)("p", { className: "agg-type-label text-agg-error text-center", children: sessionError }) : null
|
|
42242
42765
|
] })
|
|
42243
42766
|
] }) })
|
|
42244
42767
|
] });
|
|
42245
42768
|
};
|
|
42246
42769
|
|
|
42247
42770
|
// src/deposit/steps/card-purchase-success.tsx
|
|
42248
|
-
var
|
|
42771
|
+
var import_hooks109 = require("@agg-build/hooks");
|
|
42249
42772
|
init_modal();
|
|
42250
42773
|
init_button();
|
|
42251
42774
|
init_icon();
|
|
42252
|
-
var
|
|
42253
|
-
var SummaryRow = ({ label: label2, value }) => /* @__PURE__ */ (0,
|
|
42254
|
-
/* @__PURE__ */ (0,
|
|
42255
|
-
/* @__PURE__ */ (0,
|
|
42775
|
+
var import_jsx_runtime217 = require("react/jsx-runtime");
|
|
42776
|
+
var SummaryRow = ({ label: label2, value }) => /* @__PURE__ */ (0, import_jsx_runtime217.jsxs)("div", { className: "flex items-center justify-between border-b border-agg-separator py-2 last:border-b-0", children: [
|
|
42777
|
+
/* @__PURE__ */ (0, import_jsx_runtime217.jsx)("p", { className: "text-[12px] leading-4 font-agg-bold uppercase text-agg-muted-foreground", children: label2 }),
|
|
42778
|
+
/* @__PURE__ */ (0, import_jsx_runtime217.jsx)("p", { className: "agg-type-label text-agg-foreground", children: value })
|
|
42256
42779
|
] });
|
|
42257
42780
|
var CardPurchaseSuccessStep = ({
|
|
42258
42781
|
summary,
|
|
42259
42782
|
onDone,
|
|
42260
42783
|
onClose
|
|
42261
42784
|
}) => {
|
|
42262
|
-
const labels = (0,
|
|
42263
|
-
return /* @__PURE__ */ (0,
|
|
42264
|
-
/* @__PURE__ */ (0,
|
|
42785
|
+
const labels = (0, import_hooks109.useLabels)();
|
|
42786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime217.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime217.jsxs)(Modal.Body, { classNames: { root: "px-5 py-8 sm:px-8 sm:py-10" }, children: [
|
|
42787
|
+
/* @__PURE__ */ (0, import_jsx_runtime217.jsx)(
|
|
42265
42788
|
"button",
|
|
42266
42789
|
{
|
|
42267
42790
|
type: "button",
|
|
42268
42791
|
className: "absolute right-8 top-7 flex items-center justify-center text-agg-foreground transition-colors hover:text-agg-foreground/80",
|
|
42269
42792
|
onClick: onClose,
|
|
42270
42793
|
"aria-label": labels.common.close,
|
|
42271
|
-
children: /* @__PURE__ */ (0,
|
|
42794
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(CloseIcon, { className: "h-6 w-6" })
|
|
42272
42795
|
}
|
|
42273
42796
|
),
|
|
42274
|
-
/* @__PURE__ */ (0,
|
|
42275
|
-
/* @__PURE__ */ (0,
|
|
42276
|
-
/* @__PURE__ */ (0,
|
|
42277
|
-
/* @__PURE__ */ (0,
|
|
42278
|
-
/* @__PURE__ */ (0,
|
|
42797
|
+
/* @__PURE__ */ (0, import_jsx_runtime217.jsxs)("div", { className: "flex flex-col items-center gap-8", children: [
|
|
42798
|
+
/* @__PURE__ */ (0, import_jsx_runtime217.jsx)("div", { className: "flex h-[60px] w-[60px] items-center justify-center rounded-full bg-agg-success/15", children: /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(SuccessCheckIcon, { className: "h-6 w-6 text-agg-success" }) }),
|
|
42799
|
+
/* @__PURE__ */ (0, import_jsx_runtime217.jsxs)("div", { className: "flex flex-col items-center gap-3 text-center", children: [
|
|
42800
|
+
/* @__PURE__ */ (0, import_jsx_runtime217.jsx)("h3", { className: "text-agg-2xl leading-agg-8 font-agg-bold text-agg-foreground", children: labels.deposit.cardFlow.successTitle }),
|
|
42801
|
+
/* @__PURE__ */ (0, import_jsx_runtime217.jsx)("p", { className: "agg-type-body text-agg-foreground", children: labels.deposit.cardFlow.successDescription })
|
|
42279
42802
|
] }),
|
|
42280
|
-
/* @__PURE__ */ (0,
|
|
42281
|
-
/* @__PURE__ */ (0,
|
|
42803
|
+
/* @__PURE__ */ (0, import_jsx_runtime217.jsxs)("div", { className: "w-full rounded-lg border border-agg-separator bg-agg-secondary px-3 py-1", children: [
|
|
42804
|
+
/* @__PURE__ */ (0, import_jsx_runtime217.jsx)(
|
|
42282
42805
|
SummaryRow,
|
|
42283
42806
|
{
|
|
42284
42807
|
label: labels.deposit.summary.amountReceived,
|
|
42285
42808
|
value: summary.amountReceived
|
|
42286
42809
|
}
|
|
42287
42810
|
),
|
|
42288
|
-
/* @__PURE__ */ (0,
|
|
42289
|
-
/* @__PURE__ */ (0,
|
|
42811
|
+
/* @__PURE__ */ (0, import_jsx_runtime217.jsx)(SummaryRow, { label: labels.deposit.summary.network, value: summary.network }),
|
|
42812
|
+
/* @__PURE__ */ (0, import_jsx_runtime217.jsx)(SummaryRow, { label: labels.deposit.cardFlow.summary.fees, value: summary.fees })
|
|
42290
42813
|
] }),
|
|
42291
|
-
/* @__PURE__ */ (0,
|
|
42814
|
+
/* @__PURE__ */ (0, import_jsx_runtime217.jsx)(Button, { variant: "secondary", size: "large", className: "w-[120px]", onClick: onDone, children: labels.deposit.done })
|
|
42292
42815
|
] })
|
|
42293
42816
|
] }) });
|
|
42294
42817
|
};
|
|
42295
42818
|
|
|
42296
42819
|
// src/deposit/steps/crypto-transfer.tsx
|
|
42297
|
-
var
|
|
42820
|
+
var import_hooks111 = require("@agg-build/hooks");
|
|
42298
42821
|
init_button();
|
|
42299
42822
|
init_copy_button();
|
|
42300
42823
|
init_icon();
|
|
@@ -42302,10 +42825,10 @@ init_modal();
|
|
|
42302
42825
|
init_select();
|
|
42303
42826
|
|
|
42304
42827
|
// src/shared/transfer-fee-summary.tsx
|
|
42305
|
-
var
|
|
42828
|
+
var import_hooks110 = require("@agg-build/hooks");
|
|
42306
42829
|
init_tooltip();
|
|
42307
|
-
var
|
|
42308
|
-
var separator = /* @__PURE__ */ (0,
|
|
42830
|
+
var import_jsx_runtime218 = require("react/jsx-runtime");
|
|
42831
|
+
var separator = /* @__PURE__ */ (0, import_jsx_runtime218.jsx)("span", { className: "text-agg-muted-foreground", "aria-hidden": "true", children: "\xB7" });
|
|
42309
42832
|
var normalizeFeeLabel = (label2) => label2.replace(/\s*~\s*$/, "");
|
|
42310
42833
|
var TransferFeeSummary = ({
|
|
42311
42834
|
estimate,
|
|
@@ -42313,46 +42836,46 @@ var TransferFeeSummary = ({
|
|
|
42313
42836
|
minDeposit,
|
|
42314
42837
|
eta
|
|
42315
42838
|
}) => {
|
|
42316
|
-
const labels = (0,
|
|
42839
|
+
const labels = (0, import_hooks110.useLabels)();
|
|
42317
42840
|
if (!estimate) return null;
|
|
42318
42841
|
if (view === "deposit") {
|
|
42319
|
-
return /* @__PURE__ */ (0,
|
|
42320
|
-
minDeposit ? /* @__PURE__ */ (0,
|
|
42842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)("p", { className: "agg-type-label flex flex-wrap items-center gap-x-2 gap-y-1 text-agg-foreground", children: [
|
|
42843
|
+
minDeposit ? /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)("span", { children: [
|
|
42321
42844
|
labels.deposit.sendCrypto.minDepositPrefix,
|
|
42322
42845
|
" ",
|
|
42323
42846
|
minDeposit
|
|
42324
42847
|
] }) : null,
|
|
42325
42848
|
minDeposit ? separator : null,
|
|
42326
|
-
/* @__PURE__ */ (0,
|
|
42849
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsxs)("span", { children: [
|
|
42327
42850
|
normalizeFeeLabel(labels.deposit.walletFlow.feePrefix),
|
|
42328
42851
|
": ",
|
|
42329
42852
|
estimate.estimatedFees
|
|
42330
42853
|
] }),
|
|
42331
42854
|
eta ? separator : null,
|
|
42332
|
-
eta ? /* @__PURE__ */ (0,
|
|
42855
|
+
eta ? /* @__PURE__ */ (0, import_jsx_runtime218.jsx)("span", { children: eta }) : null
|
|
42333
42856
|
] });
|
|
42334
42857
|
}
|
|
42335
|
-
return /* @__PURE__ */ (0,
|
|
42336
|
-
/* @__PURE__ */ (0,
|
|
42858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)("div", { className: "agg-type-label flex flex-wrap items-center gap-x-2 gap-y-1 text-agg-foreground", children: [
|
|
42859
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsxs)("span", { children: [
|
|
42337
42860
|
labels.withdraw.walletFlow.estimatedFees,
|
|
42338
42861
|
": ",
|
|
42339
42862
|
estimate.estimatedFees
|
|
42340
42863
|
] }),
|
|
42341
42864
|
separator,
|
|
42342
|
-
/* @__PURE__ */ (0,
|
|
42343
|
-
/* @__PURE__ */ (0,
|
|
42865
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsxs)("span", { className: "inline-flex items-center gap-1", children: [
|
|
42866
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsxs)("span", { children: [
|
|
42344
42867
|
labels.withdraw.walletFlow.networkReserve,
|
|
42345
42868
|
": ",
|
|
42346
42869
|
estimate.networkReserve
|
|
42347
42870
|
] }),
|
|
42348
|
-
/* @__PURE__ */ (0,
|
|
42871
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
|
|
42349
42872
|
Tooltip,
|
|
42350
42873
|
{
|
|
42351
42874
|
"aria-label": labels.withdraw.walletFlow.networkReserveTooltipAria,
|
|
42352
42875
|
size: "medium",
|
|
42353
|
-
content: /* @__PURE__ */ (0,
|
|
42354
|
-
/* @__PURE__ */ (0,
|
|
42355
|
-
/* @__PURE__ */ (0,
|
|
42876
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)("div", { className: "text-center", children: [
|
|
42877
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsx)("p", { children: labels.withdraw.walletFlow.networkReserveTooltipLineOne }),
|
|
42878
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsx)("p", { children: labels.withdraw.walletFlow.networkReserveTooltipLineTwo })
|
|
42356
42879
|
] }),
|
|
42357
42880
|
classNames: {
|
|
42358
42881
|
content: "min-w-96 max-w-none!",
|
|
@@ -42363,7 +42886,7 @@ var TransferFeeSummary = ({
|
|
|
42363
42886
|
)
|
|
42364
42887
|
] }),
|
|
42365
42888
|
separator,
|
|
42366
|
-
/* @__PURE__ */ (0,
|
|
42889
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsxs)("span", { children: [
|
|
42367
42890
|
labels.withdraw.walletFlow.youReceive,
|
|
42368
42891
|
": ",
|
|
42369
42892
|
estimate.youReceive
|
|
@@ -42373,21 +42896,21 @@ var TransferFeeSummary = ({
|
|
|
42373
42896
|
|
|
42374
42897
|
// src/deposit/components/DepositQRCode.tsx
|
|
42375
42898
|
var import_qrcode = require("qrcode.react");
|
|
42376
|
-
var
|
|
42899
|
+
var import_jsx_runtime219 = require("react/jsx-runtime");
|
|
42377
42900
|
function DepositQRCode({
|
|
42378
42901
|
depositAddress,
|
|
42379
42902
|
networkLogoUrl,
|
|
42380
42903
|
networkLogo,
|
|
42381
42904
|
size = 160
|
|
42382
42905
|
}) {
|
|
42383
|
-
const logoOverlay = networkLogo ? /* @__PURE__ */ (0,
|
|
42906
|
+
const logoOverlay = networkLogo ? /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
42384
42907
|
"div",
|
|
42385
42908
|
{
|
|
42386
42909
|
className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-sm",
|
|
42387
42910
|
style: { width: 32, height: 32, backgroundColor: "#FFFFFF", padding: 2 },
|
|
42388
42911
|
children: networkLogo
|
|
42389
42912
|
}
|
|
42390
|
-
) : networkLogoUrl ? /* @__PURE__ */ (0,
|
|
42913
|
+
) : networkLogoUrl ? /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
42391
42914
|
"img",
|
|
42392
42915
|
{
|
|
42393
42916
|
src: networkLogoUrl,
|
|
@@ -42398,7 +42921,7 @@ function DepositQRCode({
|
|
|
42398
42921
|
style: { backgroundColor: "#FFFFFF", padding: 2 }
|
|
42399
42922
|
}
|
|
42400
42923
|
) : null;
|
|
42401
|
-
return /* @__PURE__ */ (0,
|
|
42924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
42402
42925
|
"div",
|
|
42403
42926
|
{
|
|
42404
42927
|
className: "inline-flex items-center justify-center rounded-xl border",
|
|
@@ -42407,8 +42930,8 @@ function DepositQRCode({
|
|
|
42407
42930
|
borderColor: "#E5E7EB",
|
|
42408
42931
|
backgroundColor: "#FFFFFF"
|
|
42409
42932
|
},
|
|
42410
|
-
children: /* @__PURE__ */ (0,
|
|
42411
|
-
/* @__PURE__ */ (0,
|
|
42933
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime219.jsxs)("div", { className: "relative", style: { width: size, height: size }, children: [
|
|
42934
|
+
/* @__PURE__ */ (0, import_jsx_runtime219.jsx)(import_qrcode.QRCodeSVG, { value: depositAddress, size, level: "H" }),
|
|
42412
42935
|
logoOverlay
|
|
42413
42936
|
] })
|
|
42414
42937
|
}
|
|
@@ -42417,27 +42940,27 @@ function DepositQRCode({
|
|
|
42417
42940
|
DepositQRCode.displayName = "DepositQRCode";
|
|
42418
42941
|
|
|
42419
42942
|
// src/deposit/steps/crypto-transfer.tsx
|
|
42420
|
-
var
|
|
42943
|
+
var import_jsx_runtime220 = require("react/jsx-runtime");
|
|
42421
42944
|
var CryptoAddressLoadingState = () => {
|
|
42422
|
-
const labels = (0,
|
|
42945
|
+
const labels = (0, import_hooks111.useLabels)();
|
|
42423
42946
|
const sendCryptoLabels = labels.deposit.sendCrypto;
|
|
42424
|
-
return /* @__PURE__ */ (0,
|
|
42947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime220.jsxs)(
|
|
42425
42948
|
"div",
|
|
42426
42949
|
{
|
|
42427
42950
|
className: "flex w-full flex-col items-center justify-center gap-6 py-10 text-center text-agg-foreground",
|
|
42428
42951
|
role: "status",
|
|
42429
42952
|
"aria-live": "polite",
|
|
42430
42953
|
children: [
|
|
42431
|
-
/* @__PURE__ */ (0,
|
|
42954
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
42432
42955
|
"span",
|
|
42433
42956
|
{
|
|
42434
42957
|
className: "h-9 w-9 animate-spin rounded-full border-2 border-agg-primary/25 border-t-agg-primary",
|
|
42435
42958
|
"aria-hidden": "true"
|
|
42436
42959
|
}
|
|
42437
42960
|
),
|
|
42438
|
-
/* @__PURE__ */ (0,
|
|
42439
|
-
/* @__PURE__ */ (0,
|
|
42440
|
-
/* @__PURE__ */ (0,
|
|
42961
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsxs)("div", { className: "flex w-full flex-col items-center gap-2", children: [
|
|
42962
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6", children: sendCryptoLabels.addressLoadingTitle }),
|
|
42963
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)("p", { className: "max-w-[300px] text-agg-sm leading-agg-5", children: sendCryptoLabels.addressLoadingDescription })
|
|
42441
42964
|
] })
|
|
42442
42965
|
]
|
|
42443
42966
|
}
|
|
@@ -42464,38 +42987,38 @@ var CryptoTransferStep = ({
|
|
|
42464
42987
|
onDone
|
|
42465
42988
|
}) => {
|
|
42466
42989
|
var _a;
|
|
42467
|
-
const labels = (0,
|
|
42990
|
+
const labels = (0, import_hooks111.useLabels)();
|
|
42468
42991
|
const selectedNetworkOption = networkOptions.find((n) => n.value === selectedNetwork);
|
|
42469
42992
|
const networkLogoUrl = (_a = selectedNetworkOption == null ? void 0 : selectedNetworkOption.iconUrl) != null ? _a : "";
|
|
42470
42993
|
const networkLogo = selectedNetworkOption == null ? void 0 : selectedNetworkOption.icon;
|
|
42471
|
-
const transferFeeEstimate = (0,
|
|
42994
|
+
const transferFeeEstimate = (0, import_hooks111.useWithdrawEstimate)({
|
|
42472
42995
|
amount: getEstimateAmountFromMinDeposit(minDeposit),
|
|
42473
42996
|
selectedToken,
|
|
42474
42997
|
selectedNetwork
|
|
42475
42998
|
});
|
|
42476
|
-
return /* @__PURE__ */ (0,
|
|
42477
|
-
/* @__PURE__ */ (0,
|
|
42999
|
+
return /* @__PURE__ */ (0, import_jsx_runtime220.jsxs)(import_jsx_runtime220.Fragment, { children: [
|
|
43000
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
42478
43001
|
Modal.Header,
|
|
42479
43002
|
{
|
|
42480
43003
|
title: labels.deposit.sendCrypto.title,
|
|
42481
43004
|
hideBorder: true,
|
|
42482
|
-
leftElement: /* @__PURE__ */ (0,
|
|
43005
|
+
leftElement: /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
42483
43006
|
"button",
|
|
42484
43007
|
{
|
|
42485
43008
|
type: "button",
|
|
42486
43009
|
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
42487
43010
|
onClick: onBack,
|
|
42488
43011
|
"aria-label": "Go back",
|
|
42489
|
-
children: /* @__PURE__ */ (0,
|
|
43012
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
42490
43013
|
}
|
|
42491
43014
|
)
|
|
42492
43015
|
}
|
|
42493
43016
|
),
|
|
42494
|
-
/* @__PURE__ */ (0,
|
|
42495
|
-
/* @__PURE__ */ (0,
|
|
42496
|
-
/* @__PURE__ */ (0,
|
|
42497
|
-
/* @__PURE__ */ (0,
|
|
42498
|
-
/* @__PURE__ */ (0,
|
|
43017
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime220.jsxs)("div", { className: "flex flex-col gap-7", children: [
|
|
43018
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)("div", { className: "flex flex-col gap-5", children: /* @__PURE__ */ (0, import_jsx_runtime220.jsxs)("div", { className: "flex gap-5", children: [
|
|
43019
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsxs)("div", { className: "flex flex-1 flex-col gap-2 min-w-0", children: [
|
|
43020
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.sendCrypto.tokenLabel }),
|
|
43021
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
42499
43022
|
Select,
|
|
42500
43023
|
{
|
|
42501
43024
|
items: tokenOptions,
|
|
@@ -42505,9 +43028,9 @@ var CryptoTransferStep = ({
|
|
|
42505
43028
|
}
|
|
42506
43029
|
)
|
|
42507
43030
|
] }),
|
|
42508
|
-
/* @__PURE__ */ (0,
|
|
42509
|
-
/* @__PURE__ */ (0,
|
|
42510
|
-
/* @__PURE__ */ (0,
|
|
43031
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsxs)("div", { className: "flex flex-1 flex-col gap-2 min-w-0", children: [
|
|
43032
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.sendCrypto.networkLabel }),
|
|
43033
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
42511
43034
|
Select,
|
|
42512
43035
|
{
|
|
42513
43036
|
items: networkOptions,
|
|
@@ -42518,7 +43041,7 @@ var CryptoTransferStep = ({
|
|
|
42518
43041
|
)
|
|
42519
43042
|
] })
|
|
42520
43043
|
] }) }),
|
|
42521
|
-
/* @__PURE__ */ (0,
|
|
43044
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)("div", { className: "mx-auto", children: isLoadingAddress ? /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(CryptoAddressLoadingState, {}) : addressError ? /* @__PURE__ */ (0, import_jsx_runtime220.jsx)("div", { className: "flex h-[192px] w-[192px] items-center justify-center rounded-xl border border-agg-separator bg-agg-secondary", children: /* @__PURE__ */ (0, import_jsx_runtime220.jsx)("p", { className: "agg-type-label text-center text-agg-error px-3", children: addressError }) }) : /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
42522
43045
|
DepositQRCode,
|
|
42523
43046
|
{
|
|
42524
43047
|
depositAddress,
|
|
@@ -42526,11 +43049,11 @@ var CryptoTransferStep = ({
|
|
|
42526
43049
|
networkLogo
|
|
42527
43050
|
}
|
|
42528
43051
|
) }),
|
|
42529
|
-
/* @__PURE__ */ (0,
|
|
42530
|
-
/* @__PURE__ */ (0,
|
|
42531
|
-
/* @__PURE__ */ (0,
|
|
42532
|
-
isLoadingAddress ? /* @__PURE__ */ (0,
|
|
42533
|
-
/* @__PURE__ */ (0,
|
|
43052
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
43053
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.sendCrypto.depositAddressLabel }),
|
|
43054
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsxs)("div", { className: "flex items-center gap-2 rounded border border-agg-separator bg-agg-secondary h-10 px-3", children: [
|
|
43055
|
+
isLoadingAddress ? /* @__PURE__ */ (0, import_jsx_runtime220.jsx)("div", { className: "h-4 flex-1 animate-pulse rounded bg-agg-muted-foreground/20" }) : /* @__PURE__ */ (0, import_jsx_runtime220.jsx)("p", { className: "agg-type-body flex-1 min-w-0 truncate text-agg-foreground", children: depositAddress }),
|
|
43056
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
42534
43057
|
CopyButton,
|
|
42535
43058
|
{
|
|
42536
43059
|
value: depositAddress,
|
|
@@ -42542,7 +43065,7 @@ var CryptoTransferStep = ({
|
|
|
42542
43065
|
}
|
|
42543
43066
|
)
|
|
42544
43067
|
] }),
|
|
42545
|
-
/* @__PURE__ */ (0,
|
|
43068
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
42546
43069
|
TransferFeeSummary,
|
|
42547
43070
|
{
|
|
42548
43071
|
estimate: transferFeeEstimate,
|
|
@@ -42552,11 +43075,11 @@ var CryptoTransferStep = ({
|
|
|
42552
43075
|
}
|
|
42553
43076
|
)
|
|
42554
43077
|
] }),
|
|
42555
|
-
/* @__PURE__ */ (0,
|
|
42556
|
-
/* @__PURE__ */ (0,
|
|
42557
|
-
/* @__PURE__ */ (0,
|
|
43078
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsxs)("div", { className: "flex items-start gap-3 rounded-lg bg-agg-secondary-hover p-3", children: [
|
|
43079
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)(WarningIcon, { className: "h-4 w-4 text-agg-muted-foreground mt-0.5" }),
|
|
43080
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)("p", { className: "text-agg-xs leading-agg-4 text-agg-foreground", children: labels.deposit.sendCrypto.warning })
|
|
42558
43081
|
] }),
|
|
42559
|
-
/* @__PURE__ */ (0,
|
|
43082
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
42560
43083
|
Button,
|
|
42561
43084
|
{
|
|
42562
43085
|
variant: "secondary",
|
|
@@ -42571,12 +43094,12 @@ var CryptoTransferStep = ({
|
|
|
42571
43094
|
};
|
|
42572
43095
|
|
|
42573
43096
|
// src/deposit/steps/deposit-method.tsx
|
|
42574
|
-
var
|
|
43097
|
+
var import_hooks112 = require("@agg-build/hooks");
|
|
42575
43098
|
init_utils();
|
|
42576
43099
|
init_modal();
|
|
42577
43100
|
init_icon();
|
|
42578
43101
|
init_loading_icon();
|
|
42579
|
-
var
|
|
43102
|
+
var import_jsx_runtime221 = require("react/jsx-runtime");
|
|
42580
43103
|
var DepositMethodCard = ({
|
|
42581
43104
|
icon,
|
|
42582
43105
|
title: title2,
|
|
@@ -42585,7 +43108,7 @@ var DepositMethodCard = ({
|
|
|
42585
43108
|
highlighted = false,
|
|
42586
43109
|
disabled = false,
|
|
42587
43110
|
onContinue
|
|
42588
|
-
}) => /* @__PURE__ */ (0,
|
|
43111
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime221.jsxs)(
|
|
42589
43112
|
"div",
|
|
42590
43113
|
{
|
|
42591
43114
|
className: cn(
|
|
@@ -42607,13 +43130,13 @@ var DepositMethodCard = ({
|
|
|
42607
43130
|
}
|
|
42608
43131
|
},
|
|
42609
43132
|
children: [
|
|
42610
|
-
/* @__PURE__ */ (0,
|
|
42611
|
-
/* @__PURE__ */ (0,
|
|
42612
|
-
/* @__PURE__ */ (0,
|
|
42613
|
-
/* @__PURE__ */ (0,
|
|
43133
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsx)("div", { className: "shrink-0 flex items-center justify-center h-10 w-10 rounded-lg bg-agg-secondary-hover", children: icon }),
|
|
43134
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
43135
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsx)("p", { className: "agg-type-body-strong text-agg-foreground", children: title2 }),
|
|
43136
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsx)("p", { className: "agg-type-label text-agg-muted-foreground", children: description })
|
|
42614
43137
|
] }),
|
|
42615
|
-
value ? /* @__PURE__ */ (0,
|
|
42616
|
-
/* @__PURE__ */ (0,
|
|
43138
|
+
value ? /* @__PURE__ */ (0, import_jsx_runtime221.jsx)("p", { className: "agg-type-label text-agg-muted-foreground", children: value }) : null,
|
|
43139
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsx)("div", { className: "shrink-0 text-agg-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(ChevronRightIcon, { className: "h-5 w-5" }) })
|
|
42617
43140
|
]
|
|
42618
43141
|
}
|
|
42619
43142
|
);
|
|
@@ -42628,32 +43151,32 @@ var DepositMethodStep = ({
|
|
|
42628
43151
|
depositAddressesReady = true,
|
|
42629
43152
|
onSelectMethod
|
|
42630
43153
|
}) => {
|
|
42631
|
-
const labels = (0,
|
|
42632
|
-
return /* @__PURE__ */ (0,
|
|
42633
|
-
/* @__PURE__ */ (0,
|
|
42634
|
-
/* @__PURE__ */ (0,
|
|
42635
|
-
/* @__PURE__ */ (0,
|
|
43154
|
+
const labels = (0, import_hooks112.useLabels)();
|
|
43155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime221.jsxs)(import_jsx_runtime221.Fragment, { children: [
|
|
43156
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsx)(Modal.Header, { title: labels.deposit.title, hideBorder: true }),
|
|
43157
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime221.jsxs)("div", { className: "flex flex-col gap-5", children: [
|
|
43158
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsxs)("p", { className: "agg-type-body text-agg-foreground", children: [
|
|
42636
43159
|
labels.deposit.balancePrefix,
|
|
42637
43160
|
" ",
|
|
42638
43161
|
formatCompactUsd(balance)
|
|
42639
43162
|
] }),
|
|
42640
|
-
/* @__PURE__ */ (0,
|
|
42641
|
-
showWalletMethod ? /* @__PURE__ */ (0,
|
|
43163
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
43164
|
+
showWalletMethod ? /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
|
|
42642
43165
|
DepositMethodCard,
|
|
42643
43166
|
{
|
|
42644
|
-
icon: /* @__PURE__ */ (0,
|
|
43167
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(WalletIcon, { className: "h-6 w-6 text-agg-muted-foreground" }),
|
|
42645
43168
|
title: labels.deposit.methods.walletTitle(walletLabel),
|
|
42646
43169
|
description: labels.deposit.methods.walletDescription,
|
|
42647
|
-
value: isWalletBalanceLoading ? /* @__PURE__ */ (0,
|
|
43170
|
+
value: isWalletBalanceLoading ? /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(LoadingIcon, { size: "small" }) : formatTokenAmount(walletBalance, walletToken),
|
|
42648
43171
|
highlighted: highlightedMethod === "wallet",
|
|
42649
43172
|
disabled: !depositAddressesReady,
|
|
42650
43173
|
onContinue: () => onSelectMethod("wallet")
|
|
42651
43174
|
}
|
|
42652
43175
|
) : null,
|
|
42653
|
-
/* @__PURE__ */ (0,
|
|
43176
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
|
|
42654
43177
|
DepositMethodCard,
|
|
42655
43178
|
{
|
|
42656
|
-
icon: /* @__PURE__ */ (0,
|
|
43179
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(BoltIcon, { className: "h-6 w-6 text-agg-muted-foreground" }),
|
|
42657
43180
|
title: labels.deposit.methods.cryptoTitle,
|
|
42658
43181
|
description: labels.deposit.methods.cryptoDescription,
|
|
42659
43182
|
highlighted: highlightedMethod === "crypto",
|
|
@@ -42661,10 +43184,10 @@ var DepositMethodStep = ({
|
|
|
42661
43184
|
onContinue: () => onSelectMethod("crypto")
|
|
42662
43185
|
}
|
|
42663
43186
|
),
|
|
42664
|
-
/* @__PURE__ */ (0,
|
|
43187
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
|
|
42665
43188
|
DepositMethodCard,
|
|
42666
43189
|
{
|
|
42667
|
-
icon: /* @__PURE__ */ (0,
|
|
43190
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(CreditCardIcon, { className: "h-6 w-6 text-agg-muted-foreground" }),
|
|
42668
43191
|
title: labels.deposit.methods.cardTitle,
|
|
42669
43192
|
description: labels.deposit.methods.cardDescription,
|
|
42670
43193
|
highlighted: highlightedMethod === "card",
|
|
@@ -42677,14 +43200,14 @@ var DepositMethodStep = ({
|
|
|
42677
43200
|
};
|
|
42678
43201
|
|
|
42679
43202
|
// src/deposit/steps/wallet-form.tsx
|
|
42680
|
-
var
|
|
43203
|
+
var import_hooks113 = require("@agg-build/hooks");
|
|
42681
43204
|
init_utils();
|
|
42682
43205
|
init_modal();
|
|
42683
43206
|
init_button();
|
|
42684
43207
|
init_loading_icon();
|
|
42685
43208
|
init_select();
|
|
42686
43209
|
init_icon();
|
|
42687
|
-
var
|
|
43210
|
+
var import_jsx_runtime222 = require("react/jsx-runtime");
|
|
42688
43211
|
var WalletFormStep = ({
|
|
42689
43212
|
walletLabel,
|
|
42690
43213
|
walletBalance,
|
|
@@ -42707,40 +43230,40 @@ var WalletFormStep = ({
|
|
|
42707
43230
|
onMax,
|
|
42708
43231
|
onConfirm
|
|
42709
43232
|
}) => {
|
|
42710
|
-
const labels = (0,
|
|
43233
|
+
const labels = (0, import_hooks113.useLabels)();
|
|
42711
43234
|
const isConfirmEnabled = !isSubmitting && !isBalanceLoading && Number(amount2) > 0 && Number(amount2) <= walletBalance;
|
|
42712
|
-
return /* @__PURE__ */ (0,
|
|
42713
|
-
/* @__PURE__ */ (0,
|
|
43235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(import_jsx_runtime222.Fragment, { children: [
|
|
43236
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
|
|
42714
43237
|
Modal.Header,
|
|
42715
43238
|
{
|
|
42716
43239
|
title: labels.deposit.walletFlow.title,
|
|
42717
43240
|
hideBorder: true,
|
|
42718
|
-
leftElement: /* @__PURE__ */ (0,
|
|
43241
|
+
leftElement: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
|
|
42719
43242
|
"button",
|
|
42720
43243
|
{
|
|
42721
43244
|
type: "button",
|
|
42722
43245
|
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
42723
43246
|
onClick: onBack,
|
|
42724
43247
|
"aria-label": "Go back",
|
|
42725
|
-
children: /* @__PURE__ */ (0,
|
|
43248
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
42726
43249
|
}
|
|
42727
43250
|
)
|
|
42728
43251
|
}
|
|
42729
43252
|
),
|
|
42730
|
-
/* @__PURE__ */ (0,
|
|
42731
|
-
/* @__PURE__ */ (0,
|
|
42732
|
-
/* @__PURE__ */ (0,
|
|
42733
|
-
/* @__PURE__ */ (0,
|
|
43253
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "flex flex-col gap-7", children: [
|
|
43254
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
43255
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)("p", { className: "agg-type-label text-agg-foreground", children: walletLabel }),
|
|
43256
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
42734
43257
|
labels.deposit.balanceLabel,
|
|
42735
43258
|
" ",
|
|
42736
|
-
isBalanceLoading ? /* @__PURE__ */ (0,
|
|
43259
|
+
isBalanceLoading ? /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(LoadingIcon, { size: "small" }) : formatTokenAmount(walletBalance, selectedToken)
|
|
42737
43260
|
] })
|
|
42738
43261
|
] }),
|
|
42739
|
-
/* @__PURE__ */ (0,
|
|
42740
|
-
/* @__PURE__ */ (0,
|
|
42741
|
-
/* @__PURE__ */ (0,
|
|
42742
|
-
/* @__PURE__ */ (0,
|
|
42743
|
-
/* @__PURE__ */ (0,
|
|
43262
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "flex flex-col gap-5", children: [
|
|
43263
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "flex gap-5", children: [
|
|
43264
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "flex flex-1 flex-col gap-2 min-w-0", children: [
|
|
43265
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.walletFlow.tokenLabel }),
|
|
43266
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
|
|
42744
43267
|
Select,
|
|
42745
43268
|
{
|
|
42746
43269
|
items: tokenOptions,
|
|
@@ -42750,9 +43273,9 @@ var WalletFormStep = ({
|
|
|
42750
43273
|
}
|
|
42751
43274
|
)
|
|
42752
43275
|
] }),
|
|
42753
|
-
networkOptions.length >= 1 ? /* @__PURE__ */ (0,
|
|
42754
|
-
/* @__PURE__ */ (0,
|
|
42755
|
-
/* @__PURE__ */ (0,
|
|
43276
|
+
networkOptions.length >= 1 ? /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "flex flex-1 flex-col gap-2 min-w-0", children: [
|
|
43277
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.walletFlow.networkLabel }),
|
|
43278
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
|
|
42756
43279
|
Select,
|
|
42757
43280
|
{
|
|
42758
43281
|
items: networkOptions,
|
|
@@ -42763,9 +43286,9 @@ var WalletFormStep = ({
|
|
|
42763
43286
|
)
|
|
42764
43287
|
] }) : null
|
|
42765
43288
|
] }),
|
|
42766
|
-
/* @__PURE__ */ (0,
|
|
42767
|
-
/* @__PURE__ */ (0,
|
|
42768
|
-
/* @__PURE__ */ (0,
|
|
43289
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
43290
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.walletFlow.amountLabel }),
|
|
43291
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(
|
|
42769
43292
|
"div",
|
|
42770
43293
|
{
|
|
42771
43294
|
className: cn(
|
|
@@ -42774,7 +43297,7 @@ var WalletFormStep = ({
|
|
|
42774
43297
|
"h-10 px-3"
|
|
42775
43298
|
),
|
|
42776
43299
|
children: [
|
|
42777
|
-
/* @__PURE__ */ (0,
|
|
43300
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
|
|
42778
43301
|
"input",
|
|
42779
43302
|
{
|
|
42780
43303
|
type: "text",
|
|
@@ -42786,7 +43309,7 @@ var WalletFormStep = ({
|
|
|
42786
43309
|
onChange: (event) => onAmountChange(event.target.value)
|
|
42787
43310
|
}
|
|
42788
43311
|
),
|
|
42789
|
-
/* @__PURE__ */ (0,
|
|
43312
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
|
|
42790
43313
|
"button",
|
|
42791
43314
|
{
|
|
42792
43315
|
type: "button",
|
|
@@ -42800,8 +43323,8 @@ var WalletFormStep = ({
|
|
|
42800
43323
|
}
|
|
42801
43324
|
)
|
|
42802
43325
|
] }),
|
|
42803
|
-
estimatedReceive && feeEstimate && eta ? /* @__PURE__ */ (0,
|
|
42804
|
-
formErrorMessage ? /* @__PURE__ */ (0,
|
|
43326
|
+
estimatedReceive && feeEstimate && eta ? /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("p", { className: "agg-type-label text-agg-foreground", children: `\u2248 ${estimatedReceive} \xB7 ${labels.deposit.walletFlow.feePrefix} ${feeEstimate} \xB7 ${eta}` }) : null,
|
|
43327
|
+
formErrorMessage ? /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(
|
|
42805
43328
|
"div",
|
|
42806
43329
|
{
|
|
42807
43330
|
className: cn(
|
|
@@ -42809,13 +43332,13 @@ var WalletFormStep = ({
|
|
|
42809
43332
|
formErrorTone === "warning" ? "text-agg-warning" : "text-agg-error"
|
|
42810
43333
|
),
|
|
42811
43334
|
children: [
|
|
42812
|
-
/* @__PURE__ */ (0,
|
|
42813
|
-
/* @__PURE__ */ (0,
|
|
43335
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)(WarningIcon, { className: "mt-0.5 h-4 w-4 shrink-0" }),
|
|
43336
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)("p", { className: "agg-type-label", children: formErrorMessage })
|
|
42814
43337
|
]
|
|
42815
43338
|
}
|
|
42816
43339
|
) : null
|
|
42817
43340
|
] }),
|
|
42818
|
-
/* @__PURE__ */ (0,
|
|
43341
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
|
|
42819
43342
|
Button,
|
|
42820
43343
|
{
|
|
42821
43344
|
variant: isConfirmEnabled ? "primary" : "secondary",
|
|
@@ -42833,31 +43356,31 @@ var WalletFormStep = ({
|
|
|
42833
43356
|
};
|
|
42834
43357
|
|
|
42835
43358
|
// src/deposit/steps/wallet-processing.tsx
|
|
42836
|
-
var
|
|
42837
|
-
var
|
|
43359
|
+
var import_hooks114 = require("@agg-build/hooks");
|
|
43360
|
+
var import_react71 = require("react");
|
|
42838
43361
|
init_modal();
|
|
42839
43362
|
init_icon();
|
|
42840
|
-
var
|
|
43363
|
+
var import_jsx_runtime223 = require("react/jsx-runtime");
|
|
42841
43364
|
var WalletProcessingStep = ({
|
|
42842
43365
|
steps,
|
|
42843
43366
|
errorMessage,
|
|
42844
43367
|
onComplete
|
|
42845
43368
|
}) => {
|
|
42846
|
-
const labels = (0,
|
|
42847
|
-
(0,
|
|
43369
|
+
const labels = (0, import_hooks114.useLabels)();
|
|
43370
|
+
(0, import_react71.useEffect)(() => {
|
|
42848
43371
|
const allDone = steps.length > 0 && steps.every((s) => s.status === "complete");
|
|
42849
43372
|
if (allDone) {
|
|
42850
43373
|
onComplete();
|
|
42851
43374
|
}
|
|
42852
43375
|
}, [steps, onComplete]);
|
|
42853
|
-
return /* @__PURE__ */ (0,
|
|
42854
|
-
/* @__PURE__ */ (0,
|
|
42855
|
-
/* @__PURE__ */ (0,
|
|
43376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime223.jsxs)(import_jsx_runtime223.Fragment, { children: [
|
|
43377
|
+
/* @__PURE__ */ (0, import_jsx_runtime223.jsx)(Modal.Header, { title: labels.deposit.processingTitle, hideBorder: true }),
|
|
43378
|
+
/* @__PURE__ */ (0, import_jsx_runtime223.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime223.jsxs)("div", { className: "flex flex-col gap-5", children: [
|
|
42856
43379
|
steps.map((step) => {
|
|
42857
43380
|
const isComplete = step.status === "complete";
|
|
42858
43381
|
const isActive = step.status === "active";
|
|
42859
|
-
return /* @__PURE__ */ (0,
|
|
42860
|
-
isComplete ? /* @__PURE__ */ (0,
|
|
43382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime223.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
43383
|
+
isComplete ? /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(CheckCircleIcon, { className: "h-4 w-4 text-agg-primary" }) : /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(
|
|
42861
43384
|
"span",
|
|
42862
43385
|
{
|
|
42863
43386
|
className: [
|
|
@@ -42867,7 +43390,7 @@ var WalletProcessingStep = ({
|
|
|
42867
43390
|
].join(" ")
|
|
42868
43391
|
}
|
|
42869
43392
|
),
|
|
42870
|
-
/* @__PURE__ */ (0,
|
|
43393
|
+
/* @__PURE__ */ (0, import_jsx_runtime223.jsx)(
|
|
42871
43394
|
"p",
|
|
42872
43395
|
{
|
|
42873
43396
|
className: isComplete || isActive ? "agg-type-body text-agg-foreground" : "agg-type-body text-agg-muted-foreground",
|
|
@@ -42876,63 +43399,63 @@ var WalletProcessingStep = ({
|
|
|
42876
43399
|
)
|
|
42877
43400
|
] }, step.id);
|
|
42878
43401
|
}),
|
|
42879
|
-
errorMessage ? /* @__PURE__ */ (0,
|
|
43402
|
+
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("p", { className: "agg-type-body text-agg-destructive", children: errorMessage }) : null
|
|
42880
43403
|
] }) })
|
|
42881
43404
|
] });
|
|
42882
43405
|
};
|
|
42883
43406
|
|
|
42884
43407
|
// src/deposit/steps/wallet-success.tsx
|
|
42885
|
-
var
|
|
43408
|
+
var import_hooks115 = require("@agg-build/hooks");
|
|
42886
43409
|
init_modal();
|
|
42887
43410
|
init_button();
|
|
42888
43411
|
init_icon();
|
|
42889
|
-
var
|
|
42890
|
-
var SummaryRow2 = ({ label: label2, value }) => /* @__PURE__ */ (0,
|
|
42891
|
-
/* @__PURE__ */ (0,
|
|
42892
|
-
/* @__PURE__ */ (0,
|
|
43412
|
+
var import_jsx_runtime224 = require("react/jsx-runtime");
|
|
43413
|
+
var SummaryRow2 = ({ label: label2, value }) => /* @__PURE__ */ (0, import_jsx_runtime224.jsxs)("div", { className: "flex items-center justify-between border-b border-agg-separator py-2 last:border-b-0", children: [
|
|
43414
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)("p", { className: "text-[12px] leading-4 font-agg-bold uppercase text-agg-muted-foreground", children: label2 }),
|
|
43415
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)("p", { className: "agg-type-label text-agg-foreground", children: value })
|
|
42893
43416
|
] });
|
|
42894
43417
|
var WalletSuccessStep = ({
|
|
42895
43418
|
summary,
|
|
42896
43419
|
onDone,
|
|
42897
43420
|
onClose
|
|
42898
43421
|
}) => {
|
|
42899
|
-
const labels = (0,
|
|
42900
|
-
return /* @__PURE__ */ (0,
|
|
42901
|
-
/* @__PURE__ */ (0,
|
|
43422
|
+
const labels = (0, import_hooks115.useLabels)();
|
|
43423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime224.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime224.jsxs)(Modal.Body, { classNames: { root: "px-5 py-8 sm:px-8 sm:py-10" }, children: [
|
|
43424
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)(
|
|
42902
43425
|
"button",
|
|
42903
43426
|
{
|
|
42904
43427
|
type: "button",
|
|
42905
43428
|
className: "absolute right-8 top-7 flex items-center justify-center text-agg-foreground transition-colors hover:text-agg-foreground/80",
|
|
42906
43429
|
onClick: onClose,
|
|
42907
43430
|
"aria-label": labels.common.close,
|
|
42908
|
-
children: /* @__PURE__ */ (0,
|
|
43431
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(CloseIcon, { className: "h-6 w-6" })
|
|
42909
43432
|
}
|
|
42910
43433
|
),
|
|
42911
|
-
/* @__PURE__ */ (0,
|
|
42912
|
-
/* @__PURE__ */ (0,
|
|
42913
|
-
/* @__PURE__ */ (0,
|
|
42914
|
-
/* @__PURE__ */ (0,
|
|
42915
|
-
/* @__PURE__ */ (0,
|
|
43434
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsxs)("div", { className: "flex flex-col items-center gap-8", children: [
|
|
43435
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)("div", { className: "flex h-[60px] w-[60px] items-center justify-center rounded-full bg-agg-success/15", children: /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(SuccessCheckIcon, { className: "h-6 w-6 text-agg-success" }) }),
|
|
43436
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsxs)("div", { className: "flex flex-col items-center gap-3 text-center", children: [
|
|
43437
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)("h3", { className: "text-agg-2xl leading-agg-8 font-agg-bold text-agg-foreground", children: labels.deposit.successTitle }),
|
|
43438
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)("p", { className: "agg-type-body text-agg-foreground", children: labels.deposit.successDescription })
|
|
42916
43439
|
] }),
|
|
42917
|
-
/* @__PURE__ */ (0,
|
|
42918
|
-
/* @__PURE__ */ (0,
|
|
43440
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsxs)("div", { className: "w-full rounded-lg border border-agg-separator bg-agg-secondary px-3 py-1", children: [
|
|
43441
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)(
|
|
42919
43442
|
SummaryRow2,
|
|
42920
43443
|
{
|
|
42921
43444
|
label: labels.deposit.summary.amountReceived,
|
|
42922
43445
|
value: summary.amountReceived
|
|
42923
43446
|
}
|
|
42924
43447
|
),
|
|
42925
|
-
/* @__PURE__ */ (0,
|
|
42926
|
-
/* @__PURE__ */ (0,
|
|
42927
|
-
/* @__PURE__ */ (0,
|
|
43448
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)(SummaryRow2, { label: labels.deposit.summary.network, value: summary.network }),
|
|
43449
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)(SummaryRow2, { label: labels.deposit.summary.fromWallet, value: summary.fromWallet }),
|
|
43450
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)(SummaryRow2, { label: labels.deposit.summary.gasFee, value: summary.gasFee })
|
|
42928
43451
|
] }),
|
|
42929
|
-
/* @__PURE__ */ (0,
|
|
43452
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)(Button, { variant: "secondary", size: "large", className: "w-[120px]", onClick: onDone, children: labels.deposit.done })
|
|
42930
43453
|
] })
|
|
42931
43454
|
] }) });
|
|
42932
43455
|
};
|
|
42933
43456
|
|
|
42934
43457
|
// src/deposit/index.tsx
|
|
42935
|
-
var
|
|
43458
|
+
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
42936
43459
|
var PENDING_CARD_SESSION_KEY = "agg-pending-card-session";
|
|
42937
43460
|
var DEFAULT_WALLET_CHAIN_ID = "1";
|
|
42938
43461
|
var DEFAULT_WALLET_TOKEN = "USDC";
|
|
@@ -42982,7 +43505,7 @@ function isControlledDepositModalProps(props) {
|
|
|
42982
43505
|
}
|
|
42983
43506
|
function DepositModalSelfDriven({ open, onOpenChange }) {
|
|
42984
43507
|
const depositProps = (0, import_deposit.useDepositFlow)({ open, onOpenChange });
|
|
42985
|
-
return /* @__PURE__ */ (0,
|
|
43508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(DepositModalControlled, __spreadValues({}, depositProps));
|
|
42986
43509
|
}
|
|
42987
43510
|
function DepositModalControlled({
|
|
42988
43511
|
open,
|
|
@@ -43016,49 +43539,49 @@ function DepositModalControlled({
|
|
|
43016
43539
|
pendingCardPurchaseSummary
|
|
43017
43540
|
}) {
|
|
43018
43541
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
43019
|
-
const { isWeb3User } = (0,
|
|
43020
|
-
const { walletActions } = (0,
|
|
43021
|
-
const labels = (0,
|
|
43542
|
+
const { isWeb3User } = (0, import_hooks116.useAggAuthState)();
|
|
43543
|
+
const { walletActions } = (0, import_hooks116.useAggUiConfig)();
|
|
43544
|
+
const labels = (0, import_hooks116.useLabels)();
|
|
43022
43545
|
const defaultMethod = isWeb3User ? "wallet" : "crypto";
|
|
43023
|
-
const [step, setStep] = (0,
|
|
43546
|
+
const [step, setStep] = (0, import_react72.useState)(
|
|
43024
43547
|
() => pendingCardPurchaseSummary ? "card-success" : "method"
|
|
43025
43548
|
);
|
|
43026
|
-
const [highlightedMethod, setHighlightedMethod] = (0,
|
|
43027
|
-
const walletSubmitInFlightRef = (0,
|
|
43028
|
-
const walletDepositAttemptIdRef = (0,
|
|
43029
|
-
const notifiedWalletDepositStatusesRef = (0,
|
|
43030
|
-
const [isWalletSubmitting, setIsWalletSubmitting] = (0,
|
|
43031
|
-
const [cardProviders, setCardProviders] = (0,
|
|
43032
|
-
const [quotesLoading, setQuotesLoading] = (0,
|
|
43033
|
-
const [quotesError, setQuotesError] = (0,
|
|
43034
|
-
const [sessionError, setSessionError] = (0,
|
|
43035
|
-
const [pendingProviderName, setPendingProviderName] = (0,
|
|
43036
|
-
const [pendingProviderWalletAddress, setPendingProviderWalletAddress] = (0,
|
|
43037
|
-
(0,
|
|
43549
|
+
const [highlightedMethod, setHighlightedMethod] = (0, import_react72.useState)(defaultMethod);
|
|
43550
|
+
const walletSubmitInFlightRef = (0, import_react72.useRef)(false);
|
|
43551
|
+
const walletDepositAttemptIdRef = (0, import_react72.useRef)(0);
|
|
43552
|
+
const notifiedWalletDepositStatusesRef = (0, import_react72.useRef)(/* @__PURE__ */ new Set());
|
|
43553
|
+
const [isWalletSubmitting, setIsWalletSubmitting] = (0, import_react72.useState)(false);
|
|
43554
|
+
const [cardProviders, setCardProviders] = (0, import_react72.useState)([]);
|
|
43555
|
+
const [quotesLoading, setQuotesLoading] = (0, import_react72.useState)(false);
|
|
43556
|
+
const [quotesError, setQuotesError] = (0, import_react72.useState)(null);
|
|
43557
|
+
const [sessionError, setSessionError] = (0, import_react72.useState)(null);
|
|
43558
|
+
const [pendingProviderName, setPendingProviderName] = (0, import_react72.useState)("");
|
|
43559
|
+
const [pendingProviderWalletAddress, setPendingProviderWalletAddress] = (0, import_react72.useState)("");
|
|
43560
|
+
(0, import_react72.useEffect)(() => {
|
|
43038
43561
|
if (pendingCardPurchaseSummary) {
|
|
43039
43562
|
clearPendingCardSession();
|
|
43040
43563
|
setStep("card-success");
|
|
43041
43564
|
}
|
|
43042
43565
|
}, [pendingCardPurchaseSummary]);
|
|
43043
|
-
const [walletChainId, setWalletChainId] = (0,
|
|
43044
|
-
const [walletToken, setWalletToken] = (0,
|
|
43045
|
-
const [sendChainId, setSendChainId] = (0,
|
|
43046
|
-
const [sendToken, setSendToken] = (0,
|
|
43566
|
+
const [walletChainId, setWalletChainId] = (0, import_react72.useState)("");
|
|
43567
|
+
const [walletToken, setWalletToken] = (0, import_react72.useState)("");
|
|
43568
|
+
const [sendChainId, setSendChainId] = (0, import_react72.useState)("");
|
|
43569
|
+
const [sendToken, setSendToken] = (0, import_react72.useState)("");
|
|
43047
43570
|
const {
|
|
43048
43571
|
isReady,
|
|
43049
43572
|
isTimedOut,
|
|
43050
43573
|
error: addrError,
|
|
43051
43574
|
supportedChains,
|
|
43052
43575
|
getAddress
|
|
43053
|
-
} = (0,
|
|
43054
|
-
const fallbackNetworkOptions = (0,
|
|
43055
|
-
const networkOptions = (0,
|
|
43576
|
+
} = (0, import_hooks116.useDepositAddresses)({ enabled: open });
|
|
43577
|
+
const fallbackNetworkOptions = (0, import_react72.useMemo)(() => mapNetworksToOptions(), []);
|
|
43578
|
+
const networkOptions = (0, import_react72.useMemo)(() => {
|
|
43056
43579
|
if (!(supportedChains == null ? void 0 : supportedChains.length)) return fallbackNetworkOptions;
|
|
43057
43580
|
return withNetworkIcons(
|
|
43058
43581
|
supportedChains.map((c) => ({ value: String(c.chainId), label: c.name }))
|
|
43059
43582
|
);
|
|
43060
43583
|
}, [supportedChains, fallbackNetworkOptions]);
|
|
43061
|
-
const walletNetworkOptions = (0,
|
|
43584
|
+
const walletNetworkOptions = (0, import_react72.useMemo)(() => {
|
|
43062
43585
|
if (!(supportedChains == null ? void 0 : supportedChains.length) || !connectedWalletKind) return networkOptions;
|
|
43063
43586
|
const filtered = supportedChains.filter(
|
|
43064
43587
|
(c) => connectedWalletKind === "solana" ? import_deposit.SVM_CHAIN_IDS.has(c.chainId) : !import_deposit.SVM_CHAIN_IDS.has(c.chainId)
|
|
@@ -43066,17 +43589,17 @@ function DepositModalControlled({
|
|
|
43066
43589
|
if (filtered.length === 0) return networkOptions;
|
|
43067
43590
|
return withNetworkIcons(filtered.map((c) => ({ value: String(c.chainId), label: c.name })));
|
|
43068
43591
|
}, [supportedChains, networkOptions, connectedWalletKind]);
|
|
43069
|
-
const walletTokenOptions = (0,
|
|
43592
|
+
const walletTokenOptions = (0, import_react72.useMemo)(() => {
|
|
43070
43593
|
const chain = supportedChains == null ? void 0 : supportedChains.find((c) => String(c.chainId) === walletChainId);
|
|
43071
43594
|
if (!chain) return withTokenIcons(DEFAULT_CURRENCY_OPTIONS);
|
|
43072
43595
|
return withTokenIcons(chain.tokens.map((t) => ({ value: t.symbol, label: t.symbol })));
|
|
43073
43596
|
}, [supportedChains, walletChainId]);
|
|
43074
|
-
const sendTokenOptions = (0,
|
|
43597
|
+
const sendTokenOptions = (0, import_react72.useMemo)(() => {
|
|
43075
43598
|
const chain = supportedChains == null ? void 0 : supportedChains.find((c) => String(c.chainId) === sendChainId);
|
|
43076
43599
|
if (!chain) return withTokenIcons(DEFAULT_CURRENCY_OPTIONS);
|
|
43077
43600
|
return withTokenIcons(chain.tokens.map((t) => ({ value: t.symbol, label: t.symbol })));
|
|
43078
43601
|
}, [supportedChains, sendChainId]);
|
|
43079
|
-
(0,
|
|
43602
|
+
(0, import_react72.useEffect)(() => {
|
|
43080
43603
|
if (walletNetworkOptions.length > 0) {
|
|
43081
43604
|
if (!walletChainId || !walletNetworkOptions.some((o) => o.value === walletChainId)) {
|
|
43082
43605
|
const ethereumMainnetOption = walletNetworkOptions.find(
|
|
@@ -43087,30 +43610,30 @@ function DepositModalControlled({
|
|
|
43087
43610
|
}
|
|
43088
43611
|
}
|
|
43089
43612
|
}, [walletNetworkOptions, walletChainId, initialWalletChainId]);
|
|
43090
|
-
(0,
|
|
43613
|
+
(0, import_react72.useEffect)(() => {
|
|
43091
43614
|
if (networkOptions.length > 0) {
|
|
43092
43615
|
if (!sendChainId || !networkOptions.some((o) => o.value === sendChainId)) {
|
|
43093
43616
|
setSendChainId(networkOptions[0].value);
|
|
43094
43617
|
}
|
|
43095
43618
|
}
|
|
43096
43619
|
}, [networkOptions, sendChainId]);
|
|
43097
|
-
(0,
|
|
43620
|
+
(0, import_react72.useEffect)(() => {
|
|
43098
43621
|
var _a2, _b2;
|
|
43099
43622
|
if (walletTokenOptions.length > 0) {
|
|
43100
43623
|
const preferredToken = (_b2 = (_a2 = walletTokenOptions.find((option) => option.value === DEFAULT_WALLET_TOKEN)) == null ? void 0 : _a2.value) != null ? _b2 : walletTokenOptions[0].value;
|
|
43101
43624
|
setWalletToken(preferredToken);
|
|
43102
43625
|
}
|
|
43103
43626
|
}, [walletTokenOptions]);
|
|
43104
|
-
(0,
|
|
43627
|
+
(0, import_react72.useEffect)(() => {
|
|
43105
43628
|
var _a2, _b2;
|
|
43106
43629
|
setSendToken((_b2 = (_a2 = sendTokenOptions == null ? void 0 : sendTokenOptions[0]) == null ? void 0 : _a2.value) != null ? _b2 : "");
|
|
43107
43630
|
}, [sendTokenOptions]);
|
|
43108
|
-
(0,
|
|
43631
|
+
(0, import_react72.useEffect)(() => {
|
|
43109
43632
|
if (walletChainId) {
|
|
43110
43633
|
onWalletNetworkChange == null ? void 0 : onWalletNetworkChange(walletChainId);
|
|
43111
43634
|
}
|
|
43112
43635
|
}, [walletChainId, onWalletNetworkChange]);
|
|
43113
|
-
(0,
|
|
43636
|
+
(0, import_react72.useEffect)(() => {
|
|
43114
43637
|
if (walletToken) {
|
|
43115
43638
|
onWalletTokenChange == null ? void 0 : onWalletTokenChange(walletToken);
|
|
43116
43639
|
}
|
|
@@ -43129,7 +43652,7 @@ function DepositModalControlled({
|
|
|
43129
43652
|
fromWallet: walletFlow.walletLabel,
|
|
43130
43653
|
gasFee: ""
|
|
43131
43654
|
}, walletFlow.successSummary);
|
|
43132
|
-
const handleWalletDepositNotification = (0,
|
|
43655
|
+
const handleWalletDepositNotification = (0, import_react72.useCallback)(
|
|
43133
43656
|
(status, errorMessage) => {
|
|
43134
43657
|
if (notifiedWalletDepositStatusesRef.current.has(status)) return;
|
|
43135
43658
|
notifiedWalletDepositStatusesRef.current.add(status);
|
|
@@ -43143,13 +43666,13 @@ function DepositModalControlled({
|
|
|
43143
43666
|
},
|
|
43144
43667
|
[walletFlow.amount, walletToken]
|
|
43145
43668
|
);
|
|
43146
|
-
(0,
|
|
43669
|
+
(0, import_react72.useEffect)(() => {
|
|
43147
43670
|
if (step === "wallet-processing" && !isWalletSubmitting && walletFlow.transactionStatus === "settled") {
|
|
43148
43671
|
handleWalletDepositNotification("completed");
|
|
43149
43672
|
setStep("wallet-success");
|
|
43150
43673
|
}
|
|
43151
43674
|
}, [handleWalletDepositNotification, isWalletSubmitting, step, walletFlow.transactionStatus]);
|
|
43152
|
-
(0,
|
|
43675
|
+
(0, import_react72.useEffect)(() => {
|
|
43153
43676
|
if (!onCancelWalletDeposit) return;
|
|
43154
43677
|
if (step === "wallet-processing" && !isWalletSubmitting && walletFlow.transactionStatus === "error") {
|
|
43155
43678
|
walletSubmitInFlightRef.current = false;
|
|
@@ -43302,8 +43825,8 @@ function DepositModalControlled({
|
|
|
43302
43825
|
onOpenChange(isOpen);
|
|
43303
43826
|
};
|
|
43304
43827
|
const depositModalMaxWidth = step === "method" ? "600px" : "480px";
|
|
43305
|
-
return /* @__PURE__ */ (0,
|
|
43306
|
-
step === "method" ? /* @__PURE__ */ (0,
|
|
43828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(Modal.Container, { maxWidth: depositModalMaxWidth, "aria-label": "Deposit", children: [
|
|
43829
|
+
step === "method" ? /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
|
|
43307
43830
|
DepositMethodStep,
|
|
43308
43831
|
{
|
|
43309
43832
|
balance: walletFlow.balance,
|
|
@@ -43317,7 +43840,7 @@ function DepositModalControlled({
|
|
|
43317
43840
|
onSelectMethod: handleSelectMethod
|
|
43318
43841
|
}
|
|
43319
43842
|
) : null,
|
|
43320
|
-
step === "wallet-form" ? /* @__PURE__ */ (0,
|
|
43843
|
+
step === "wallet-form" ? /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
|
|
43321
43844
|
WalletFormStep,
|
|
43322
43845
|
{
|
|
43323
43846
|
walletLabel: walletFlow.walletLabel,
|
|
@@ -43383,7 +43906,7 @@ function DepositModalControlled({
|
|
|
43383
43906
|
})
|
|
43384
43907
|
}
|
|
43385
43908
|
) : null,
|
|
43386
|
-
step === "wallet-processing" ? /* @__PURE__ */ (0,
|
|
43909
|
+
step === "wallet-processing" ? /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
|
|
43387
43910
|
WalletProcessingStep,
|
|
43388
43911
|
{
|
|
43389
43912
|
steps: processingSteps,
|
|
@@ -43391,7 +43914,7 @@ function DepositModalControlled({
|
|
|
43391
43914
|
onComplete: () => setStep("wallet-success")
|
|
43392
43915
|
}
|
|
43393
43916
|
) : null,
|
|
43394
|
-
step === "wallet-success" ? /* @__PURE__ */ (0,
|
|
43917
|
+
step === "wallet-success" ? /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
|
|
43395
43918
|
WalletSuccessStep,
|
|
43396
43919
|
{
|
|
43397
43920
|
summary: resolvedSuccessSummary,
|
|
@@ -43399,7 +43922,7 @@ function DepositModalControlled({
|
|
|
43399
43922
|
onClose: () => handleOpenChange(false)
|
|
43400
43923
|
}
|
|
43401
43924
|
) : null,
|
|
43402
|
-
step === "card-deposit" && cardFlow ? /* @__PURE__ */ (0,
|
|
43925
|
+
step === "card-deposit" && cardFlow ? /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
|
|
43403
43926
|
CardDepositStep,
|
|
43404
43927
|
{
|
|
43405
43928
|
amount: cardFlow.amount,
|
|
@@ -43417,7 +43940,7 @@ function DepositModalControlled({
|
|
|
43417
43940
|
onContinue: handleContinueCardDeposit
|
|
43418
43941
|
}
|
|
43419
43942
|
) : null,
|
|
43420
|
-
step === "card-provider" && cardFlow ? /* @__PURE__ */ (0,
|
|
43943
|
+
step === "card-provider" && cardFlow ? /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
|
|
43421
43944
|
CardProviderStep,
|
|
43422
43945
|
{
|
|
43423
43946
|
amount: cardFlow.amount,
|
|
@@ -43432,7 +43955,7 @@ function DepositModalControlled({
|
|
|
43432
43955
|
onRetry: handleRetryQuotes
|
|
43433
43956
|
}
|
|
43434
43957
|
) : null,
|
|
43435
|
-
step === "card-payment-pending" ? /* @__PURE__ */ (0,
|
|
43958
|
+
step === "card-payment-pending" ? /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
|
|
43436
43959
|
CardPaymentPendingStep,
|
|
43437
43960
|
{
|
|
43438
43961
|
providerName: pendingProviderName,
|
|
@@ -43442,7 +43965,7 @@ function DepositModalControlled({
|
|
|
43442
43965
|
onChooseAnotherProvider: handleChooseAnotherProvider
|
|
43443
43966
|
}
|
|
43444
43967
|
) : null,
|
|
43445
|
-
step === "card-success" ? /* @__PURE__ */ (0,
|
|
43968
|
+
step === "card-success" ? /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
|
|
43446
43969
|
CardPurchaseSuccessStep,
|
|
43447
43970
|
{
|
|
43448
43971
|
summary: (_g = pendingCardPurchaseSummary != null ? pendingCardPurchaseSummary : cardFlow == null ? void 0 : cardFlow.purchaseSummary) != null ? _g : {
|
|
@@ -43454,7 +43977,7 @@ function DepositModalControlled({
|
|
|
43454
43977
|
onDone: handleDoneCardPurchase
|
|
43455
43978
|
}
|
|
43456
43979
|
) : null,
|
|
43457
|
-
step === "crypto-transfer" ? /* @__PURE__ */ (0,
|
|
43980
|
+
step === "crypto-transfer" ? /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
|
|
43458
43981
|
CryptoTransferStep,
|
|
43459
43982
|
{
|
|
43460
43983
|
tokenOptions: sendTokenOptions,
|
|
@@ -43483,37 +44006,37 @@ var ignoreCardChange = (_value) => {
|
|
|
43483
44006
|
};
|
|
43484
44007
|
var DepositModal = (props) => {
|
|
43485
44008
|
if (!isControlledDepositModalProps(props)) {
|
|
43486
|
-
return /* @__PURE__ */ (0,
|
|
44009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(DepositModalSelfDriven, __spreadValues({}, props));
|
|
43487
44010
|
}
|
|
43488
|
-
return /* @__PURE__ */ (0,
|
|
44011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(DepositModalControlled, __spreadValues({}, props));
|
|
43489
44012
|
};
|
|
43490
44013
|
DepositModal.displayName = "DepositModal";
|
|
43491
44014
|
|
|
43492
44015
|
// src/withdraw/index.tsx
|
|
43493
|
-
var
|
|
44016
|
+
var import_react73 = require("react");
|
|
43494
44017
|
var import_withdraw = require("@agg-build/hooks/withdraw");
|
|
43495
44018
|
init_modal();
|
|
43496
44019
|
|
|
43497
44020
|
// src/withdraw/steps/withdraw-method.tsx
|
|
43498
|
-
var
|
|
44021
|
+
var import_hooks117 = require("@agg-build/hooks");
|
|
43499
44022
|
init_icon();
|
|
43500
44023
|
init_modal();
|
|
43501
44024
|
init_utils();
|
|
43502
|
-
var
|
|
44025
|
+
var import_jsx_runtime226 = require("react/jsx-runtime");
|
|
43503
44026
|
var WithdrawMethodStep = ({
|
|
43504
44027
|
balance,
|
|
43505
44028
|
onSelectMethod
|
|
43506
44029
|
}) => {
|
|
43507
|
-
const labels = (0,
|
|
43508
|
-
return /* @__PURE__ */ (0,
|
|
43509
|
-
/* @__PURE__ */ (0,
|
|
43510
|
-
/* @__PURE__ */ (0,
|
|
43511
|
-
/* @__PURE__ */ (0,
|
|
44030
|
+
const labels = (0, import_hooks117.useLabels)();
|
|
44031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(import_jsx_runtime226.Fragment, { children: [
|
|
44032
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Modal.Header, { title: labels.withdraw.title, hideBorder: true }),
|
|
44033
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)("div", { className: "flex flex-col gap-5", children: [
|
|
44034
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsxs)("p", { className: "agg-type-body text-agg-foreground", children: [
|
|
43512
44035
|
labels.withdraw.balancePrefix,
|
|
43513
44036
|
" ",
|
|
43514
44037
|
formatCompactUsd(balance)
|
|
43515
44038
|
] }),
|
|
43516
|
-
/* @__PURE__ */ (0,
|
|
44039
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
|
|
43517
44040
|
"div",
|
|
43518
44041
|
{
|
|
43519
44042
|
className: cn(
|
|
@@ -43530,12 +44053,12 @@ var WithdrawMethodStep = ({
|
|
|
43530
44053
|
}
|
|
43531
44054
|
},
|
|
43532
44055
|
children: [
|
|
43533
|
-
/* @__PURE__ */ (0,
|
|
43534
|
-
/* @__PURE__ */ (0,
|
|
43535
|
-
/* @__PURE__ */ (0,
|
|
43536
|
-
/* @__PURE__ */ (0,
|
|
44056
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)("div", { className: "shrink-0 flex items-center justify-center h-10 w-10 rounded-lg bg-agg-secondary-hover", children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(WalletIcon, { className: "h-6 w-6 text-agg-muted-foreground" }) }),
|
|
44057
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
44058
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)("p", { className: "agg-type-body-strong text-agg-foreground", children: labels.withdraw.methods.walletTitle }),
|
|
44059
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)("p", { className: "agg-type-label text-agg-muted-foreground", children: labels.withdraw.methods.walletDescription })
|
|
43537
44060
|
] }),
|
|
43538
|
-
/* @__PURE__ */ (0,
|
|
44061
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)("div", { className: "shrink-0 text-agg-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(ChevronRightIcon, { className: "h-5 w-5" }) })
|
|
43539
44062
|
]
|
|
43540
44063
|
}
|
|
43541
44064
|
)
|
|
@@ -43544,14 +44067,14 @@ var WithdrawMethodStep = ({
|
|
|
43544
44067
|
};
|
|
43545
44068
|
|
|
43546
44069
|
// src/withdraw/steps/withdraw-amount.tsx
|
|
43547
|
-
var
|
|
44070
|
+
var import_hooks118 = require("@agg-build/hooks");
|
|
43548
44071
|
init_button();
|
|
43549
44072
|
init_icon();
|
|
43550
44073
|
init_loading_icon();
|
|
43551
44074
|
init_modal();
|
|
43552
44075
|
init_select();
|
|
43553
44076
|
init_utils();
|
|
43554
|
-
var
|
|
44077
|
+
var import_jsx_runtime227 = require("react/jsx-runtime");
|
|
43555
44078
|
var formatRawTokenAmount = (rawAmount, decimals) => {
|
|
43556
44079
|
if (!rawAmount) return "0";
|
|
43557
44080
|
const raw = BigInt(rawAmount);
|
|
@@ -43595,7 +44118,7 @@ var WithdrawAmountStep = ({
|
|
|
43595
44118
|
onContinue
|
|
43596
44119
|
}) => {
|
|
43597
44120
|
var _a, _b, _c, _d;
|
|
43598
|
-
const labels = (0,
|
|
44121
|
+
const labels = (0, import_hooks118.useLabels)();
|
|
43599
44122
|
const SOLANA_CHAIN_ID = "792703809";
|
|
43600
44123
|
const isSolanaDest = selectedNetwork === SOLANA_CHAIN_ID;
|
|
43601
44124
|
const trimmedDestination = destinationWallet.trim();
|
|
@@ -43603,7 +44126,7 @@ var WithdrawAmountStep = ({
|
|
|
43603
44126
|
const isValid = Number(amount2) > 0 && isValidAddress;
|
|
43604
44127
|
const amountRaw = amount2 && Number(amount2) > 0 ? parseTokenAmountToRaw(amount2, destDecimals) : null;
|
|
43605
44128
|
const destinationChainId = Number(selectedNetwork) || null;
|
|
43606
|
-
const preview = (0,
|
|
44129
|
+
const preview = (0, import_hooks118.useWithdrawPreview)({
|
|
43607
44130
|
amountRaw,
|
|
43608
44131
|
tokenSymbol: selectedToken || null,
|
|
43609
44132
|
destinationChainId,
|
|
@@ -43620,29 +44143,29 @@ var WithdrawAmountStep = ({
|
|
|
43620
44143
|
youReceive: preview.data.receiveAmountRaw != null ? `~${formatRawTokenAmount(preview.data.receiveAmountRaw, destDecimals)} ${selectedToken}` : "\u2014"
|
|
43621
44144
|
} : null;
|
|
43622
44145
|
const shouldShowWithdrawEstimate = Boolean(withdrawEstimate);
|
|
43623
|
-
return /* @__PURE__ */ (0,
|
|
43624
|
-
/* @__PURE__ */ (0,
|
|
44146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(import_jsx_runtime227.Fragment, { children: [
|
|
44147
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
43625
44148
|
Modal.Header,
|
|
43626
44149
|
{
|
|
43627
44150
|
title: labels.withdraw.walletFlow.title,
|
|
43628
44151
|
hideBorder: true,
|
|
43629
|
-
leftElement: /* @__PURE__ */ (0,
|
|
44152
|
+
leftElement: /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
43630
44153
|
"button",
|
|
43631
44154
|
{
|
|
43632
44155
|
type: "button",
|
|
43633
44156
|
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
43634
44157
|
onClick: onBack,
|
|
43635
44158
|
"aria-label": labels.withdraw.back,
|
|
43636
|
-
children: /* @__PURE__ */ (0,
|
|
44159
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
43637
44160
|
}
|
|
43638
44161
|
)
|
|
43639
44162
|
}
|
|
43640
44163
|
),
|
|
43641
|
-
/* @__PURE__ */ (0,
|
|
43642
|
-
/* @__PURE__ */ (0,
|
|
43643
|
-
/* @__PURE__ */ (0,
|
|
43644
|
-
/* @__PURE__ */ (0,
|
|
43645
|
-
/* @__PURE__ */ (0,
|
|
44164
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)("div", { className: "flex flex-col gap-5", children: [
|
|
44165
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsxs)("div", { className: "flex flex-col gap-5", children: [
|
|
44166
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
44167
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.recipientAddressLabel }),
|
|
44168
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
43646
44169
|
"input",
|
|
43647
44170
|
{
|
|
43648
44171
|
type: "text",
|
|
@@ -43658,17 +44181,17 @@ var WithdrawAmountStep = ({
|
|
|
43658
44181
|
}
|
|
43659
44182
|
)
|
|
43660
44183
|
] }),
|
|
43661
|
-
/* @__PURE__ */ (0,
|
|
43662
|
-
/* @__PURE__ */ (0,
|
|
43663
|
-
/* @__PURE__ */ (0,
|
|
43664
|
-
/* @__PURE__ */ (0,
|
|
44184
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
44185
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
44186
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.amountLabel }),
|
|
44187
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsxs)("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
43665
44188
|
labels.withdraw.balancePrefix,
|
|
43666
44189
|
" ",
|
|
43667
44190
|
balanceDisplay
|
|
43668
44191
|
] })
|
|
43669
44192
|
] }),
|
|
43670
|
-
/* @__PURE__ */ (0,
|
|
43671
|
-
/* @__PURE__ */ (0,
|
|
44193
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsxs)("div", { className: "flex h-10 items-center gap-2 rounded border border-agg-separator bg-agg-secondary px-3 focus-within:border-agg-primary transition-colors", children: [
|
|
44194
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
43672
44195
|
"input",
|
|
43673
44196
|
{
|
|
43674
44197
|
type: "text",
|
|
@@ -43683,8 +44206,8 @@ var WithdrawAmountStep = ({
|
|
|
43683
44206
|
onChange: (e) => onAmountChange(e.target.value)
|
|
43684
44207
|
}
|
|
43685
44208
|
),
|
|
43686
|
-
/* @__PURE__ */ (0,
|
|
43687
|
-
onMaxClick ? /* @__PURE__ */ (0,
|
|
44209
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)("span", { className: "agg-type-body text-agg-muted-foreground shrink-0", children: selectedToken }),
|
|
44210
|
+
onMaxClick ? /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
43688
44211
|
"button",
|
|
43689
44212
|
{
|
|
43690
44213
|
type: "button",
|
|
@@ -43695,10 +44218,10 @@ var WithdrawAmountStep = ({
|
|
|
43695
44218
|
) : null
|
|
43696
44219
|
] })
|
|
43697
44220
|
] }),
|
|
43698
|
-
/* @__PURE__ */ (0,
|
|
43699
|
-
/* @__PURE__ */ (0,
|
|
43700
|
-
/* @__PURE__ */ (0,
|
|
43701
|
-
/* @__PURE__ */ (0,
|
|
44221
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsxs)("div", { className: "flex flex-col gap-3 sm:flex-row sm:gap-5", children: [
|
|
44222
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsxs)("div", { className: "flex-1 flex flex-col gap-2 min-w-0", children: [
|
|
44223
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.tokenLabel }),
|
|
44224
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
43702
44225
|
Select,
|
|
43703
44226
|
{
|
|
43704
44227
|
items: tokenOptions,
|
|
@@ -43708,9 +44231,9 @@ var WithdrawAmountStep = ({
|
|
|
43708
44231
|
}
|
|
43709
44232
|
)
|
|
43710
44233
|
] }),
|
|
43711
|
-
/* @__PURE__ */ (0,
|
|
43712
|
-
/* @__PURE__ */ (0,
|
|
43713
|
-
/* @__PURE__ */ (0,
|
|
44234
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsxs)("div", { className: "flex-1 flex flex-col gap-2 min-w-0", children: [
|
|
44235
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.networkLabel }),
|
|
44236
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
43714
44237
|
Select,
|
|
43715
44238
|
{
|
|
43716
44239
|
items: networkOptions,
|
|
@@ -43721,51 +44244,51 @@ var WithdrawAmountStep = ({
|
|
|
43721
44244
|
)
|
|
43722
44245
|
] })
|
|
43723
44246
|
] }),
|
|
43724
|
-
shouldShowWithdrawEstimate && withdrawEstimate ? /* @__PURE__ */ (0,
|
|
43725
|
-
previewUnviableMessage ? /* @__PURE__ */ (0,
|
|
44247
|
+
shouldShowWithdrawEstimate && withdrawEstimate ? /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(TransferFeeSummary, { estimate: withdrawEstimate, view: "withdraw" }) : null,
|
|
44248
|
+
previewUnviableMessage ? /* @__PURE__ */ (0, import_jsx_runtime227.jsx)("p", { className: "agg-type-label text-agg-error", role: "alert", children: previewUnviableMessage }) : null
|
|
43726
44249
|
] }),
|
|
43727
|
-
/* @__PURE__ */ (0,
|
|
44250
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
43728
44251
|
Button,
|
|
43729
44252
|
{
|
|
43730
44253
|
variant: isValid && !isConfirming && !previewUnviable && !previewLoading ? "primary" : "secondary",
|
|
43731
44254
|
size: "large",
|
|
43732
44255
|
className: "w-full",
|
|
43733
44256
|
disabled: isDisabled,
|
|
43734
|
-
prefix: previewLoading && !isConfirming ? /* @__PURE__ */ (0,
|
|
44257
|
+
prefix: previewLoading && !isConfirming ? /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(LoadingIcon, { size: "small", className: "mr-2 text-current" }) : void 0,
|
|
43735
44258
|
onClick: onContinue,
|
|
43736
44259
|
children: isConfirming ? labels.common.loading : previewLoading ? labels.withdraw.walletFlow.calculatingFees : labels.withdraw.walletFlow.confirm
|
|
43737
44260
|
}
|
|
43738
44261
|
),
|
|
43739
|
-
error ? /* @__PURE__ */ (0,
|
|
44262
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime227.jsx)("p", { className: "agg-type-label text-agg-error text-center", role: "alert", children: error }) : null
|
|
43740
44263
|
] }) })
|
|
43741
44264
|
] });
|
|
43742
44265
|
};
|
|
43743
44266
|
|
|
43744
44267
|
// src/withdraw/steps/withdraw-success.tsx
|
|
43745
|
-
var
|
|
44268
|
+
var import_hooks119 = require("@agg-build/hooks");
|
|
43746
44269
|
init_modal();
|
|
43747
44270
|
init_button();
|
|
43748
44271
|
init_icon();
|
|
43749
44272
|
init_utils();
|
|
43750
|
-
var
|
|
43751
|
-
var SummaryRow3 = ({ label: label2, value }) => /* @__PURE__ */ (0,
|
|
43752
|
-
/* @__PURE__ */ (0,
|
|
43753
|
-
/* @__PURE__ */ (0,
|
|
44273
|
+
var import_jsx_runtime228 = require("react/jsx-runtime");
|
|
44274
|
+
var SummaryRow3 = ({ label: label2, value }) => /* @__PURE__ */ (0, import_jsx_runtime228.jsxs)("div", { className: "flex items-center justify-between gap-4 border-b border-agg-separator py-2 last:border-b-0", children: [
|
|
44275
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)("p", { className: "min-w-0 text-[12px] leading-4 font-agg-bold uppercase text-agg-muted-foreground", children: label2 }),
|
|
44276
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)("p", { className: "min-w-0 text-right text-[14px] leading-5 text-agg-foreground", children: value })
|
|
43754
44277
|
] });
|
|
43755
|
-
var WithdrawCloseButton = ({ onClose, label: label2 }) => /* @__PURE__ */ (0,
|
|
44278
|
+
var WithdrawCloseButton = ({ onClose, label: label2 }) => /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(
|
|
43756
44279
|
"button",
|
|
43757
44280
|
{
|
|
43758
44281
|
type: "button",
|
|
43759
44282
|
className: "absolute right-8 top-7 flex cursor-pointer items-center justify-center text-agg-foreground transition-colors hover:text-agg-foreground/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
|
|
43760
44283
|
onClick: onClose,
|
|
43761
44284
|
"aria-label": label2,
|
|
43762
|
-
children: /* @__PURE__ */ (0,
|
|
44285
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(CloseIcon, { className: "h-6 w-6" })
|
|
43763
44286
|
}
|
|
43764
44287
|
);
|
|
43765
44288
|
var LoadingGlyph = ({
|
|
43766
44289
|
className,
|
|
43767
44290
|
enableAnimations
|
|
43768
|
-
}) => /* @__PURE__ */ (0,
|
|
44291
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(
|
|
43769
44292
|
"span",
|
|
43770
44293
|
{
|
|
43771
44294
|
"aria-hidden": "true",
|
|
@@ -43791,33 +44314,33 @@ var WithdrawLoadingStep = ({
|
|
|
43791
44314
|
lifecycleState,
|
|
43792
44315
|
onClose
|
|
43793
44316
|
}) => {
|
|
43794
|
-
const labels = (0,
|
|
44317
|
+
const labels = (0, import_hooks119.useLabels)();
|
|
43795
44318
|
const {
|
|
43796
44319
|
features: { enableAnimations }
|
|
43797
|
-
} = (0,
|
|
44320
|
+
} = (0, import_hooks119.useSdkUiConfig)();
|
|
43798
44321
|
const walletFlowLabels = labels.withdraw.walletFlow;
|
|
43799
44322
|
const activeIndex = loadingActiveIndexFor(lifecycleState);
|
|
43800
44323
|
const loadingSteps = getLoadingSteps(walletFlowLabels);
|
|
43801
|
-
return /* @__PURE__ */ (0,
|
|
43802
|
-
/* @__PURE__ */ (0,
|
|
43803
|
-
/* @__PURE__ */ (0,
|
|
43804
|
-
/* @__PURE__ */ (0,
|
|
44324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime228.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(Modal.Body, { classNames: { root: "px-8 py-7" }, children: /* @__PURE__ */ (0, import_jsx_runtime228.jsxs)("div", { className: "flex flex-col gap-7", children: [
|
|
44325
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
44326
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)("h3", { className: "text-agg-2xl leading-agg-8 font-agg-bold text-agg-foreground", children: walletFlowLabels.successTitle }),
|
|
44327
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)(
|
|
43805
44328
|
"button",
|
|
43806
44329
|
{
|
|
43807
44330
|
type: "button",
|
|
43808
44331
|
className: "flex cursor-pointer items-center justify-center text-agg-foreground transition-colors hover:text-agg-foreground/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
|
|
43809
44332
|
onClick: onClose,
|
|
43810
44333
|
"aria-label": labels.common.close,
|
|
43811
|
-
children: /* @__PURE__ */ (0,
|
|
44334
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(CloseIcon, { className: "h-6 w-6" })
|
|
43812
44335
|
}
|
|
43813
44336
|
)
|
|
43814
44337
|
] }),
|
|
43815
|
-
/* @__PURE__ */ (0,
|
|
44338
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)("div", { className: "flex flex-col gap-5", role: "status", "aria-live": "polite", children: loadingSteps.map((step, index) => {
|
|
43816
44339
|
const isComplete = index < activeIndex;
|
|
43817
44340
|
const isActive = index === activeIndex;
|
|
43818
44341
|
const textClassName = isActive || isComplete ? "text-agg-foreground" : "text-agg-muted-foreground";
|
|
43819
|
-
return /* @__PURE__ */ (0,
|
|
43820
|
-
isComplete ? /* @__PURE__ */ (0,
|
|
44342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime228.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
44343
|
+
isComplete ? /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(
|
|
43821
44344
|
Icon,
|
|
43822
44345
|
{
|
|
43823
44346
|
name: "check-circle",
|
|
@@ -43826,24 +44349,24 @@ var WithdrawLoadingStep = ({
|
|
|
43826
44349
|
"aria-hidden": "true"
|
|
43827
44350
|
}
|
|
43828
44351
|
) : null,
|
|
43829
|
-
isActive ? /* @__PURE__ */ (0,
|
|
44352
|
+
isActive ? /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(
|
|
43830
44353
|
LoadingGlyph,
|
|
43831
44354
|
{
|
|
43832
44355
|
enableAnimations,
|
|
43833
44356
|
className: "h-4 w-4 shrink-0 text-agg-primary"
|
|
43834
44357
|
}
|
|
43835
44358
|
) : null,
|
|
43836
|
-
!isComplete && !isActive ? /* @__PURE__ */ (0,
|
|
44359
|
+
!isComplete && !isActive ? /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(
|
|
43837
44360
|
"span",
|
|
43838
44361
|
{
|
|
43839
44362
|
"aria-hidden": "true",
|
|
43840
44363
|
className: "h-4 w-4 shrink-0 rounded-full border border-agg-separator"
|
|
43841
44364
|
}
|
|
43842
44365
|
) : null,
|
|
43843
|
-
/* @__PURE__ */ (0,
|
|
44366
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)("p", { className: cn("min-w-0 flex-1 text-agg-base leading-agg-6", textClassName), children: step.label })
|
|
43844
44367
|
] }, step.id);
|
|
43845
44368
|
}) }),
|
|
43846
|
-
/* @__PURE__ */ (0,
|
|
44369
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: walletFlowLabels.loadingDescription })
|
|
43847
44370
|
] }) }) });
|
|
43848
44371
|
};
|
|
43849
44372
|
var resultCopyFor = ({
|
|
@@ -43878,7 +44401,7 @@ var WithdrawSuccessStep = ({
|
|
|
43878
44401
|
onRetry,
|
|
43879
44402
|
onClose
|
|
43880
44403
|
}) => {
|
|
43881
|
-
const labels = (0,
|
|
44404
|
+
const labels = (0, import_hooks119.useLabels)();
|
|
43882
44405
|
const walletFlowLabels = labels.withdraw.walletFlow;
|
|
43883
44406
|
const { title: title2, description } = resultCopyFor({
|
|
43884
44407
|
status: resultStatus,
|
|
@@ -43886,10 +44409,10 @@ var WithdrawSuccessStep = ({
|
|
|
43886
44409
|
labels: walletFlowLabels
|
|
43887
44410
|
});
|
|
43888
44411
|
const isFailed = resultStatus === "failed";
|
|
43889
|
-
return /* @__PURE__ */ (0,
|
|
43890
|
-
/* @__PURE__ */ (0,
|
|
43891
|
-
/* @__PURE__ */ (0,
|
|
43892
|
-
/* @__PURE__ */ (0,
|
|
44412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime228.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime228.jsxs)(Modal.Body, { classNames: { root: "px-10 py-12" }, children: [
|
|
44413
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)(WithdrawCloseButton, { onClose, label: labels.common.close }),
|
|
44414
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsxs)("div", { className: "flex flex-col items-center justify-center gap-8 text-center", children: [
|
|
44415
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)(
|
|
43893
44416
|
"div",
|
|
43894
44417
|
{
|
|
43895
44418
|
className: cn(
|
|
@@ -43897,12 +44420,12 @@ var WithdrawSuccessStep = ({
|
|
|
43897
44420
|
isFailed ? "bg-agg-error/15" : "bg-agg-success/15"
|
|
43898
44421
|
),
|
|
43899
44422
|
"aria-hidden": "true",
|
|
43900
|
-
children: isFailed ? /* @__PURE__ */ (0,
|
|
44423
|
+
children: isFailed ? /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(CloseIcon, { className: "h-6 w-6 text-agg-error" }) : /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(SuccessCheckIcon, { className: "h-6 w-6 text-agg-success" })
|
|
43901
44424
|
}
|
|
43902
44425
|
),
|
|
43903
|
-
/* @__PURE__ */ (0,
|
|
43904
|
-
/* @__PURE__ */ (0,
|
|
43905
|
-
/* @__PURE__ */ (0,
|
|
44426
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsxs)("div", { className: "flex w-full flex-col items-center gap-3 text-center text-agg-foreground", children: [
|
|
44427
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)("h3", { className: "text-agg-2xl leading-agg-8 font-agg-bold", children: title2 }),
|
|
44428
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)(
|
|
43906
44429
|
"p",
|
|
43907
44430
|
{
|
|
43908
44431
|
className: "max-w-[400px] text-agg-base leading-agg-6",
|
|
@@ -43911,35 +44434,35 @@ var WithdrawSuccessStep = ({
|
|
|
43911
44434
|
}
|
|
43912
44435
|
)
|
|
43913
44436
|
] }),
|
|
43914
|
-
!isFailed ? /* @__PURE__ */ (0,
|
|
43915
|
-
/* @__PURE__ */ (0,
|
|
44437
|
+
!isFailed ? /* @__PURE__ */ (0, import_jsx_runtime228.jsxs)("div", { className: "flex w-full max-w-[400px] flex-col rounded-agg-lg border border-agg-separator bg-agg-secondary px-3 py-1 text-left", children: [
|
|
44438
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)(
|
|
43916
44439
|
SummaryRow3,
|
|
43917
44440
|
{
|
|
43918
44441
|
label: walletFlowLabels.summary.requestedWithdrawal,
|
|
43919
44442
|
value: requestedWithdrawal
|
|
43920
44443
|
}
|
|
43921
44444
|
),
|
|
43922
|
-
/* @__PURE__ */ (0,
|
|
44445
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)(
|
|
43923
44446
|
SummaryRow3,
|
|
43924
44447
|
{
|
|
43925
44448
|
label: walletFlowLabels.summary.amountReceived,
|
|
43926
44449
|
value: summary.amountReceived
|
|
43927
44450
|
}
|
|
43928
44451
|
),
|
|
43929
|
-
/* @__PURE__ */ (0,
|
|
43930
|
-
/* @__PURE__ */ (0,
|
|
43931
|
-
/* @__PURE__ */ (0,
|
|
44452
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)(SummaryRow3, { label: walletFlowLabels.summary.fees, value: summary.fees }),
|
|
44453
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)(SummaryRow3, { label: walletFlowLabels.summary.network, value: summary.network }),
|
|
44454
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)(SummaryRow3, { label: walletFlowLabels.summary.toWallet, value: summary.toWallet })
|
|
43932
44455
|
] }) : null,
|
|
43933
|
-
isFailed ? /* @__PURE__ */ (0,
|
|
43934
|
-
/* @__PURE__ */ (0,
|
|
43935
|
-
/* @__PURE__ */ (0,
|
|
43936
|
-
] }) : /* @__PURE__ */ (0,
|
|
44456
|
+
isFailed ? /* @__PURE__ */ (0, import_jsx_runtime228.jsxs)("div", { className: "flex items-center justify-center gap-3", children: [
|
|
44457
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)(Button, { variant: "secondary", size: "large", className: "w-[120px]", onClick: onClose, children: walletFlowLabels.close }),
|
|
44458
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)(Button, { variant: "primary", size: "large", className: "w-[123px]", onClick: onRetry, children: walletFlowLabels.retry })
|
|
44459
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(Button, { variant: "secondary", size: "large", className: "w-[120px]", onClick: onDone, children: labels.withdraw.done })
|
|
43937
44460
|
] })
|
|
43938
44461
|
] }) });
|
|
43939
44462
|
};
|
|
43940
44463
|
|
|
43941
44464
|
// src/withdraw/index.tsx
|
|
43942
|
-
var
|
|
44465
|
+
var import_jsx_runtime229 = require("react/jsx-runtime");
|
|
43943
44466
|
var DEFAULT_TOKEN_DECIMALS2 = 6;
|
|
43944
44467
|
var TOKEN_DECIMALS_BY_SYMBOL2 = {
|
|
43945
44468
|
BNB: 18,
|
|
@@ -44022,7 +44545,7 @@ function WithdrawModalSelfDriven({
|
|
|
44022
44545
|
onOpenChange
|
|
44023
44546
|
}) {
|
|
44024
44547
|
const withdrawProps = (0, import_withdraw.useWithdrawFlow)({ open, onOpenChange });
|
|
44025
|
-
return /* @__PURE__ */ (0,
|
|
44548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(WithdrawModalControlled, __spreadValues({}, withdrawProps));
|
|
44026
44549
|
}
|
|
44027
44550
|
function WithdrawModalControlled({
|
|
44028
44551
|
open,
|
|
@@ -44036,14 +44559,14 @@ function WithdrawModalControlled({
|
|
|
44036
44559
|
onSelectWithdrawProvider,
|
|
44037
44560
|
onDoneWithdraw
|
|
44038
44561
|
}) {
|
|
44039
|
-
const [flowState, setFlowState] = (0,
|
|
44562
|
+
const [flowState, setFlowState] = (0, import_react73.useState)({
|
|
44040
44563
|
status: "form",
|
|
44041
44564
|
formStep: "method"
|
|
44042
44565
|
});
|
|
44043
|
-
const [isConfirming, setIsConfirming] = (0,
|
|
44044
|
-
const [confirmError, setConfirmError] = (0,
|
|
44566
|
+
const [isConfirming, setIsConfirming] = (0, import_react73.useState)(false);
|
|
44567
|
+
const [confirmError, setConfirmError] = (0, import_react73.useState)(null);
|
|
44045
44568
|
const { state: withdrawalLifecycleState, reset: resetWithdrawalLifecycle } = (0, import_withdraw.useWithdrawalLifecycle)(withdrawFlow.withdrawalId);
|
|
44046
|
-
(0,
|
|
44569
|
+
(0, import_react73.useEffect)(() => {
|
|
44047
44570
|
if (!open) {
|
|
44048
44571
|
setFlowState({ status: "form", formStep: "method" });
|
|
44049
44572
|
setIsConfirming(false);
|
|
@@ -44051,7 +44574,7 @@ function WithdrawModalControlled({
|
|
|
44051
44574
|
resetWithdrawalLifecycle();
|
|
44052
44575
|
}
|
|
44053
44576
|
}, [open, resetWithdrawalLifecycle]);
|
|
44054
|
-
(0,
|
|
44577
|
+
(0, import_react73.useEffect)(() => {
|
|
44055
44578
|
if (flowState.status !== "loading") return;
|
|
44056
44579
|
if (!withdrawalLifecycleState.terminal) return;
|
|
44057
44580
|
if (withdrawalLifecycleState.status === "completed") {
|
|
@@ -44120,15 +44643,15 @@ function WithdrawModalControlled({
|
|
|
44120
44643
|
tokenSymbol: withdrawFlow.selectedToken,
|
|
44121
44644
|
chainId: withdrawFlow.selectedNetwork
|
|
44122
44645
|
});
|
|
44123
|
-
return /* @__PURE__ */ (0,
|
|
44124
|
-
flowState.status === "form" && flowState.formStep === "method" ? /* @__PURE__ */ (0,
|
|
44646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime229.jsxs)(Modal.Container, { maxWidth: modalMaxWidth, "aria-label": "Withdraw", children: [
|
|
44647
|
+
flowState.status === "form" && flowState.formStep === "method" ? /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
|
|
44125
44648
|
WithdrawMethodStep,
|
|
44126
44649
|
{
|
|
44127
44650
|
balance: withdrawFlow.balance,
|
|
44128
44651
|
onSelectMethod: () => setFlowState({ status: "form", formStep: "withdraw-amount" })
|
|
44129
44652
|
}
|
|
44130
44653
|
) : null,
|
|
44131
|
-
flowState.status === "form" && flowState.formStep === "withdraw-amount" ? /* @__PURE__ */ (0,
|
|
44654
|
+
flowState.status === "form" && flowState.formStep === "withdraw-amount" ? /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
|
|
44132
44655
|
WithdrawAmountStep,
|
|
44133
44656
|
{
|
|
44134
44657
|
amount: withdrawFlow.amount,
|
|
@@ -44154,14 +44677,14 @@ function WithdrawModalControlled({
|
|
|
44154
44677
|
onContinue: handleConfirm
|
|
44155
44678
|
}
|
|
44156
44679
|
) : null,
|
|
44157
|
-
flowState.status === "loading" ? /* @__PURE__ */ (0,
|
|
44680
|
+
flowState.status === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
|
|
44158
44681
|
WithdrawLoadingStep,
|
|
44159
44682
|
{
|
|
44160
44683
|
lifecycleState: withdrawalLifecycleState,
|
|
44161
44684
|
onClose: () => handleOpenChange(false)
|
|
44162
44685
|
}
|
|
44163
44686
|
) : null,
|
|
44164
|
-
flowState.status === "success" || flowState.status === "partial_success" || flowState.status === "failed" ? /* @__PURE__ */ (0,
|
|
44687
|
+
flowState.status === "success" || flowState.status === "partial_success" || flowState.status === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
|
|
44165
44688
|
WithdrawSuccessStep,
|
|
44166
44689
|
{
|
|
44167
44690
|
summary: terminalSummary,
|
|
@@ -44178,34 +44701,34 @@ function WithdrawModalControlled({
|
|
|
44178
44701
|
}
|
|
44179
44702
|
var WithdrawModal = (props) => {
|
|
44180
44703
|
if (isControlledWithdrawModalProps(props)) {
|
|
44181
|
-
return /* @__PURE__ */ (0,
|
|
44704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(WithdrawModalControlled, __spreadValues({}, props));
|
|
44182
44705
|
}
|
|
44183
|
-
return /* @__PURE__ */ (0,
|
|
44706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(WithdrawModalSelfDriven, __spreadValues({}, props));
|
|
44184
44707
|
};
|
|
44185
44708
|
WithdrawModal.displayName = "WithdrawModal";
|
|
44186
44709
|
|
|
44187
44710
|
// src/paper-trading/paper-trading-onboarding.tsx
|
|
44188
|
-
var
|
|
44711
|
+
var import_hooks121 = require("@agg-build/hooks");
|
|
44189
44712
|
init_utils();
|
|
44190
44713
|
|
|
44191
44714
|
// src/paper-trading/paper-onboarding-modal.tsx
|
|
44192
|
-
var
|
|
44193
|
-
var
|
|
44715
|
+
var import_react74 = require("react");
|
|
44716
|
+
var import_hooks120 = require("@agg-build/hooks");
|
|
44194
44717
|
init_utils();
|
|
44195
44718
|
init_button();
|
|
44196
44719
|
init_icon();
|
|
44197
44720
|
init_modal();
|
|
44198
|
-
var
|
|
44721
|
+
var import_jsx_runtime230 = require("react/jsx-runtime");
|
|
44199
44722
|
var PaperOnboardingModal = ({
|
|
44200
44723
|
open,
|
|
44201
44724
|
onDismiss,
|
|
44202
44725
|
startingBalanceLabel,
|
|
44203
44726
|
classNames
|
|
44204
44727
|
}) => {
|
|
44205
|
-
const labels = (0,
|
|
44728
|
+
const labels = (0, import_hooks120.useLabels)();
|
|
44206
44729
|
const copy = labels.paperTrading.onboarding;
|
|
44207
|
-
const [stepIndex, setStepIndex] = (0,
|
|
44208
|
-
const steps = (0,
|
|
44730
|
+
const [stepIndex, setStepIndex] = (0, import_react74.useState)(0);
|
|
44731
|
+
const steps = (0, import_react74.useMemo)(
|
|
44209
44732
|
() => [
|
|
44210
44733
|
{
|
|
44211
44734
|
key: "realMarkets",
|
|
@@ -44232,17 +44755,17 @@ var PaperOnboardingModal = ({
|
|
|
44232
44755
|
const isFirst = stepIndex === 0;
|
|
44233
44756
|
const isLast = stepIndex === total - 1;
|
|
44234
44757
|
const step = steps[stepIndex];
|
|
44235
|
-
const handleBack = (0,
|
|
44758
|
+
const handleBack = (0, import_react74.useCallback)(() => {
|
|
44236
44759
|
setStepIndex((current) => Math.max(0, current - 1));
|
|
44237
44760
|
}, []);
|
|
44238
|
-
const handleNext = (0,
|
|
44761
|
+
const handleNext = (0, import_react74.useCallback)(() => {
|
|
44239
44762
|
if (isLast) {
|
|
44240
44763
|
onDismiss();
|
|
44241
44764
|
return;
|
|
44242
44765
|
}
|
|
44243
44766
|
setStepIndex((current) => Math.min(total - 1, current + 1));
|
|
44244
44767
|
}, [isLast, onDismiss, total]);
|
|
44245
|
-
const handleOpenChange = (0,
|
|
44768
|
+
const handleOpenChange = (0, import_react74.useCallback)(
|
|
44246
44769
|
(next) => {
|
|
44247
44770
|
if (next) return;
|
|
44248
44771
|
setStepIndex(0);
|
|
@@ -44250,7 +44773,7 @@ var PaperOnboardingModal = ({
|
|
|
44250
44773
|
},
|
|
44251
44774
|
[onDismiss]
|
|
44252
44775
|
);
|
|
44253
|
-
return /* @__PURE__ */ (0,
|
|
44776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(
|
|
44254
44777
|
Modal.Container,
|
|
44255
44778
|
{
|
|
44256
44779
|
maxWidth: "480px",
|
|
@@ -44268,9 +44791,9 @@ var PaperOnboardingModal = ({
|
|
|
44268
44791
|
// Only the radius needs overriding, from the container's default 16.
|
|
44269
44792
|
container: cn("rounded-agg-xl! md:rounded-agg-xl!", classNames == null ? void 0 : classNames.card)
|
|
44270
44793
|
},
|
|
44271
|
-
children: /* @__PURE__ */ (0,
|
|
44272
|
-
/* @__PURE__ */ (0,
|
|
44273
|
-
/* @__PURE__ */ (0,
|
|
44794
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime230.jsxs)("div", { className: cn("agg-paper-onboarding", "flex w-full flex-col gap-5 p-6"), children: [
|
|
44795
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsxs)("div", { className: "flex w-full items-start justify-center gap-5", children: [
|
|
44796
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsx)(
|
|
44274
44797
|
"div",
|
|
44275
44798
|
{
|
|
44276
44799
|
className: cn(
|
|
@@ -44278,12 +44801,12 @@ var PaperOnboardingModal = ({
|
|
|
44278
44801
|
"rounded-agg-lg bg-agg-primary/10 text-agg-primary",
|
|
44279
44802
|
classNames == null ? void 0 : classNames.icon
|
|
44280
44803
|
),
|
|
44281
|
-
children: /* @__PURE__ */ (0,
|
|
44804
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(Icon, { name: step.icon, className: "!h-6 !w-6", "aria-hidden": "true" })
|
|
44282
44805
|
}
|
|
44283
44806
|
),
|
|
44284
|
-
/* @__PURE__ */ (0,
|
|
44285
|
-
/* @__PURE__ */ (0,
|
|
44286
|
-
/* @__PURE__ */ (0,
|
|
44807
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2 break-words", children: [
|
|
44808
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
44809
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsx)(
|
|
44287
44810
|
"p",
|
|
44288
44811
|
{
|
|
44289
44812
|
className: cn(
|
|
@@ -44296,7 +44819,7 @@ var PaperOnboardingModal = ({
|
|
|
44296
44819
|
children: copy.stepEyebrow({ current: stepIndex + 1, total })
|
|
44297
44820
|
}
|
|
44298
44821
|
),
|
|
44299
|
-
/* @__PURE__ */ (0,
|
|
44822
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsx)(
|
|
44300
44823
|
"p",
|
|
44301
44824
|
{
|
|
44302
44825
|
className: cn(
|
|
@@ -44307,11 +44830,11 @@ var PaperOnboardingModal = ({
|
|
|
44307
44830
|
}
|
|
44308
44831
|
)
|
|
44309
44832
|
] }),
|
|
44310
|
-
/* @__PURE__ */ (0,
|
|
44833
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsx)("p", { className: cn("text-agg-sm leading-agg-5 text-agg-foreground", classNames == null ? void 0 : classNames.body), children: step.body })
|
|
44311
44834
|
] })
|
|
44312
44835
|
] }),
|
|
44313
|
-
/* @__PURE__ */ (0,
|
|
44314
|
-
/* @__PURE__ */ (0,
|
|
44836
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsxs)("div", { className: cn("flex w-full items-center justify-between", classNames == null ? void 0 : classNames.footer), children: [
|
|
44837
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsx)("div", { className: cn("flex items-center gap-1", classNames == null ? void 0 : classNames.dots), "aria-hidden": "true", children: steps.map((dotStep, index) => /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(
|
|
44315
44838
|
"span",
|
|
44316
44839
|
{
|
|
44317
44840
|
className: cn(
|
|
@@ -44321,8 +44844,8 @@ var PaperOnboardingModal = ({
|
|
|
44321
44844
|
},
|
|
44322
44845
|
dotStep.key
|
|
44323
44846
|
)) }),
|
|
44324
|
-
/* @__PURE__ */ (0,
|
|
44325
|
-
/* @__PURE__ */ (0,
|
|
44847
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
44848
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsx)(
|
|
44326
44849
|
Button,
|
|
44327
44850
|
{
|
|
44328
44851
|
variant: "secondary",
|
|
@@ -44332,7 +44855,7 @@ var PaperOnboardingModal = ({
|
|
|
44332
44855
|
children: isFirst ? copy.skip : copy.back
|
|
44333
44856
|
}
|
|
44334
44857
|
),
|
|
44335
|
-
/* @__PURE__ */ (0,
|
|
44858
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsx)(
|
|
44336
44859
|
Button,
|
|
44337
44860
|
{
|
|
44338
44861
|
variant: "primary",
|
|
@@ -44351,15 +44874,15 @@ var PaperOnboardingModal = ({
|
|
|
44351
44874
|
PaperOnboardingModal.displayName = "PaperOnboardingModal";
|
|
44352
44875
|
|
|
44353
44876
|
// src/paper-trading/paper-trading-onboarding.tsx
|
|
44354
|
-
var
|
|
44877
|
+
var import_jsx_runtime231 = require("react/jsx-runtime");
|
|
44355
44878
|
var FALLBACK_STARTING_BALANCE = 1e4;
|
|
44356
44879
|
var PaperTradingOnboarding = ({
|
|
44357
44880
|
classNames
|
|
44358
44881
|
}) => {
|
|
44359
|
-
const { isOpen, dismiss } = (0,
|
|
44360
|
-
const { paperStartingBalance } = (0,
|
|
44882
|
+
const { isOpen, dismiss } = (0, import_hooks121.usePaperOnboarding)();
|
|
44883
|
+
const { paperStartingBalance } = (0, import_hooks121.useAppConfig)();
|
|
44361
44884
|
if (!isOpen) return null;
|
|
44362
|
-
return /* @__PURE__ */ (0,
|
|
44885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(
|
|
44363
44886
|
PaperOnboardingModal,
|
|
44364
44887
|
{
|
|
44365
44888
|
open: true,
|
|
@@ -44374,8 +44897,8 @@ var PaperTradingOnboarding = ({
|
|
|
44374
44897
|
PaperTradingOnboarding.displayName = "PaperTradingOnboarding";
|
|
44375
44898
|
|
|
44376
44899
|
// src/profile/index.tsx
|
|
44377
|
-
var
|
|
44378
|
-
var
|
|
44900
|
+
var import_react77 = require("react");
|
|
44901
|
+
var import_hooks124 = require("@agg-build/hooks");
|
|
44379
44902
|
var import_sdk32 = require("@agg-build/sdk");
|
|
44380
44903
|
init_modal();
|
|
44381
44904
|
init_icon();
|
|
@@ -44401,11 +44924,11 @@ var getProfileTabItems = () => [
|
|
|
44401
44924
|
];
|
|
44402
44925
|
|
|
44403
44926
|
// src/profile/tabs/about-tab.tsx
|
|
44404
|
-
var
|
|
44405
|
-
var
|
|
44927
|
+
var import_react75 = require("react");
|
|
44928
|
+
var import_hooks122 = require("@agg-build/hooks");
|
|
44406
44929
|
init_utils();
|
|
44407
44930
|
init_primitives();
|
|
44408
|
-
var
|
|
44931
|
+
var import_jsx_runtime232 = require("react/jsx-runtime");
|
|
44409
44932
|
var AboutTab = ({
|
|
44410
44933
|
avatarPreview,
|
|
44411
44934
|
onDeleteProfile: _onDeleteProfile,
|
|
@@ -44415,13 +44938,13 @@ var AboutTab = ({
|
|
|
44415
44938
|
draftAvatarPreview,
|
|
44416
44939
|
avatarError: _avatarError
|
|
44417
44940
|
}) => {
|
|
44418
|
-
const labels = (0,
|
|
44419
|
-
const fileInputRef = (0,
|
|
44420
|
-
const handleAvatarClick = (0,
|
|
44941
|
+
const labels = (0, import_hooks122.useLabels)();
|
|
44942
|
+
const fileInputRef = (0, import_react75.useRef)(null);
|
|
44943
|
+
const handleAvatarClick = (0, import_react75.useCallback)(() => {
|
|
44421
44944
|
var _a;
|
|
44422
44945
|
(_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
44423
44946
|
}, []);
|
|
44424
|
-
const handleFileChange = (0,
|
|
44947
|
+
const handleFileChange = (0, import_react75.useCallback)(
|
|
44425
44948
|
(e) => {
|
|
44426
44949
|
var _a;
|
|
44427
44950
|
const file = (_a = e.target.files) == null ? void 0 : _a[0];
|
|
@@ -44437,8 +44960,8 @@ var AboutTab = ({
|
|
|
44437
44960
|
);
|
|
44438
44961
|
const resolvedPreview = draftAvatarPreview != null ? draftAvatarPreview : avatarPreview;
|
|
44439
44962
|
const hasAvatarPreview = Boolean(resolvedPreview);
|
|
44440
|
-
return /* @__PURE__ */ (0,
|
|
44441
|
-
/* @__PURE__ */ (0,
|
|
44963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)("div", { className: "agg-profile-about flex flex-col gap-8", children: /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)("div", { className: "agg-profile-avatar-section flex w-full items-center gap-6", children: [
|
|
44964
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsxs)(
|
|
44442
44965
|
"button",
|
|
44443
44966
|
{
|
|
44444
44967
|
type: "button",
|
|
@@ -44455,13 +44978,13 @@ var AboutTab = ({
|
|
|
44455
44978
|
),
|
|
44456
44979
|
"aria-label": labels.onboarding.profileSetup.uploadProfilePictureAria,
|
|
44457
44980
|
children: [
|
|
44458
|
-
!hasAvatarPreview ? /* @__PURE__ */ (0,
|
|
44981
|
+
!hasAvatarPreview ? /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
44459
44982
|
"svg",
|
|
44460
44983
|
{
|
|
44461
44984
|
"aria-hidden": true,
|
|
44462
44985
|
viewBox: "0 0 80 80",
|
|
44463
44986
|
className: "pointer-events-none absolute inset-0 h-full w-full text-agg-separator group-hover:text-agg-muted-foreground",
|
|
44464
|
-
children: /* @__PURE__ */ (0,
|
|
44987
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
44465
44988
|
"circle",
|
|
44466
44989
|
{
|
|
44467
44990
|
cx: "40",
|
|
@@ -44475,18 +44998,18 @@ var AboutTab = ({
|
|
|
44475
44998
|
)
|
|
44476
44999
|
}
|
|
44477
45000
|
) : null,
|
|
44478
|
-
resolvedPreview ? /* @__PURE__ */ (0,
|
|
45001
|
+
resolvedPreview ? /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
44479
45002
|
RemoteImage,
|
|
44480
45003
|
{
|
|
44481
45004
|
src: resolvedPreview,
|
|
44482
45005
|
alt: labels.onboarding.profileSetup.profilePreviewAlt,
|
|
44483
45006
|
className: "h-full w-full object-cover"
|
|
44484
45007
|
}
|
|
44485
|
-
) : /* @__PURE__ */ (0,
|
|
45008
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Icon, { name: "profile", className: "h-7 w-7 text-agg-muted-foreground" })
|
|
44486
45009
|
]
|
|
44487
45010
|
}
|
|
44488
45011
|
),
|
|
44489
|
-
/* @__PURE__ */ (0,
|
|
45012
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
44490
45013
|
"input",
|
|
44491
45014
|
{
|
|
44492
45015
|
ref: fileInputRef,
|
|
@@ -44497,8 +45020,8 @@ var AboutTab = ({
|
|
|
44497
45020
|
"aria-hidden": "true"
|
|
44498
45021
|
}
|
|
44499
45022
|
),
|
|
44500
|
-
/* @__PURE__ */ (0,
|
|
44501
|
-
/* @__PURE__ */ (0,
|
|
45023
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsxs)("div", { className: "agg-form-section flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
45024
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
44502
45025
|
"label",
|
|
44503
45026
|
{
|
|
44504
45027
|
htmlFor: "profile-username",
|
|
@@ -44506,7 +45029,7 @@ var AboutTab = ({
|
|
|
44506
45029
|
children: "Username"
|
|
44507
45030
|
}
|
|
44508
45031
|
),
|
|
44509
|
-
/* @__PURE__ */ (0,
|
|
45032
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
44510
45033
|
"input",
|
|
44511
45034
|
{
|
|
44512
45035
|
id: "profile-username",
|
|
@@ -44535,9 +45058,9 @@ AboutTab.displayName = "AboutTab";
|
|
|
44535
45058
|
// src/profile/tabs/accounts-wallets-tab.tsx
|
|
44536
45059
|
init_icon();
|
|
44537
45060
|
init_utils();
|
|
44538
|
-
var
|
|
44539
|
-
var SectionTitle = ({ children }) => /* @__PURE__ */ (0,
|
|
44540
|
-
var AccountRow = ({ children, className }) => /* @__PURE__ */ (0,
|
|
45061
|
+
var import_jsx_runtime233 = require("react/jsx-runtime");
|
|
45062
|
+
var SectionTitle = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime233.jsx)("h3", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children });
|
|
45063
|
+
var AccountRow = ({ children, className }) => /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
|
|
44541
45064
|
"div",
|
|
44542
45065
|
{
|
|
44543
45066
|
className: cn(
|
|
@@ -44553,11 +45076,11 @@ var AccountIdentity = ({
|
|
|
44553
45076
|
icon,
|
|
44554
45077
|
label: label2,
|
|
44555
45078
|
iconClassName
|
|
44556
|
-
}) => /* @__PURE__ */ (0,
|
|
44557
|
-
/* @__PURE__ */ (0,
|
|
44558
|
-
/* @__PURE__ */ (0,
|
|
45079
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime233.jsxs)("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
45080
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsx)("span", { className: cn("flex h-5 w-5 shrink-0 items-center justify-center", iconClassName), children: /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(Icon, { name: icon, size: "small", color: "currentColor" }) }),
|
|
45081
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsx)("span", { className: "truncate text-agg-base font-agg-normal leading-6 text-agg-foreground", children: label2 })
|
|
44559
45082
|
] });
|
|
44560
|
-
var ConnectTextButton = ({ onClick }) => /* @__PURE__ */ (0,
|
|
45083
|
+
var ConnectTextButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
|
|
44561
45084
|
"button",
|
|
44562
45085
|
{
|
|
44563
45086
|
type: "button",
|
|
@@ -44566,7 +45089,7 @@ var ConnectTextButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime2
|
|
|
44566
45089
|
children: "Connect"
|
|
44567
45090
|
}
|
|
44568
45091
|
);
|
|
44569
|
-
var DisconnectTextButton = ({ onClick }) => /* @__PURE__ */ (0,
|
|
45092
|
+
var DisconnectTextButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
|
|
44570
45093
|
"button",
|
|
44571
45094
|
{
|
|
44572
45095
|
type: "button",
|
|
@@ -44575,7 +45098,7 @@ var DisconnectTextButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runti
|
|
|
44575
45098
|
children: "Disconnect"
|
|
44576
45099
|
}
|
|
44577
45100
|
);
|
|
44578
|
-
var VerifiedBadge = () => /* @__PURE__ */ (0,
|
|
45101
|
+
var VerifiedBadge = () => /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(Icon, { name: "check-badge", size: "small", color: "var(--agg-color-primary, #536dfe)" });
|
|
44579
45102
|
var getWalletIconName = (wallet) => {
|
|
44580
45103
|
const chain = wallet.chain.toLowerCase();
|
|
44581
45104
|
if (chain === "solana" || chain === "svm") {
|
|
@@ -44593,12 +45116,12 @@ var ConnectedAccountRow = ({
|
|
|
44593
45116
|
onDisconnect
|
|
44594
45117
|
}) => {
|
|
44595
45118
|
const displayLabel = connected ? connectedLabel != null ? connectedLabel : label2 : label2;
|
|
44596
|
-
return /* @__PURE__ */ (0,
|
|
44597
|
-
/* @__PURE__ */ (0,
|
|
44598
|
-
/* @__PURE__ */ (0,
|
|
44599
|
-
connected ? /* @__PURE__ */ (0,
|
|
45119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime233.jsxs)(AccountRow, { className: "agg-social-account-row gap-4", children: [
|
|
45120
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsxs)("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
45121
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsx)(AccountIdentity, { icon, label: displayLabel, iconClassName }),
|
|
45122
|
+
connected ? /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(VerifiedBadge, {}) : null
|
|
44600
45123
|
] }),
|
|
44601
|
-
connected ? /* @__PURE__ */ (0,
|
|
45124
|
+
connected ? /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(DisconnectTextButton, { onClick: onDisconnect }) : /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(ConnectTextButton, { onClick: onConnect })
|
|
44602
45125
|
] });
|
|
44603
45126
|
};
|
|
44604
45127
|
var AccountsWalletsTab = ({
|
|
@@ -44617,11 +45140,11 @@ var AccountsWalletsTab = ({
|
|
|
44617
45140
|
const google = socialAccounts == null ? void 0 : socialAccounts.google;
|
|
44618
45141
|
const apple = socialAccounts == null ? void 0 : socialAccounts.apple;
|
|
44619
45142
|
const hasEmail = Boolean(email);
|
|
44620
|
-
return /* @__PURE__ */ (0,
|
|
44621
|
-
/* @__PURE__ */ (0,
|
|
44622
|
-
/* @__PURE__ */ (0,
|
|
44623
|
-
/* @__PURE__ */ (0,
|
|
44624
|
-
/* @__PURE__ */ (0,
|
|
45143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime233.jsxs)("div", { className: "agg-accounts-wallets-tab flex flex-col gap-6", children: [
|
|
45144
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsxs)("div", { className: "agg-social-accounts-section flex flex-col gap-3", children: [
|
|
45145
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsx)(SectionTitle, { children: "Connected accounts" }),
|
|
45146
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsxs)("div", { className: "agg-social-accounts-list flex flex-col gap-4", children: [
|
|
45147
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
|
|
44625
45148
|
ConnectedAccountRow,
|
|
44626
45149
|
{
|
|
44627
45150
|
icon: "google",
|
|
@@ -44633,7 +45156,7 @@ var AccountsWalletsTab = ({
|
|
|
44633
45156
|
onDisconnect: onDisconnectGoogle
|
|
44634
45157
|
}
|
|
44635
45158
|
),
|
|
44636
|
-
/* @__PURE__ */ (0,
|
|
45159
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
|
|
44637
45160
|
ConnectedAccountRow,
|
|
44638
45161
|
{
|
|
44639
45162
|
icon: "apple",
|
|
@@ -44645,7 +45168,7 @@ var AccountsWalletsTab = ({
|
|
|
44645
45168
|
onDisconnect: onDisconnectApple
|
|
44646
45169
|
}
|
|
44647
45170
|
),
|
|
44648
|
-
/* @__PURE__ */ (0,
|
|
45171
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
|
|
44649
45172
|
ConnectedAccountRow,
|
|
44650
45173
|
{
|
|
44651
45174
|
icon: "twitter",
|
|
@@ -44657,7 +45180,7 @@ var AccountsWalletsTab = ({
|
|
|
44657
45180
|
onDisconnect: onDisconnectTwitter
|
|
44658
45181
|
}
|
|
44659
45182
|
),
|
|
44660
|
-
/* @__PURE__ */ (0,
|
|
45183
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
|
|
44661
45184
|
ConnectedAccountRow,
|
|
44662
45185
|
{
|
|
44663
45186
|
icon: "email",
|
|
@@ -44670,12 +45193,12 @@ var AccountsWalletsTab = ({
|
|
|
44670
45193
|
)
|
|
44671
45194
|
] })
|
|
44672
45195
|
] }),
|
|
44673
|
-
wallets.length > 0 ? /* @__PURE__ */ (0,
|
|
44674
|
-
/* @__PURE__ */ (0,
|
|
44675
|
-
/* @__PURE__ */ (0,
|
|
45196
|
+
wallets.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime233.jsxs)("div", { className: "agg-wallets-section flex flex-col gap-3", children: [
|
|
45197
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsx)(SectionTitle, { children: "Wallets" }),
|
|
45198
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsx)("div", { className: "flex flex-col gap-2", children: wallets.map((wallet) => {
|
|
44676
45199
|
var _a;
|
|
44677
|
-
return /* @__PURE__ */ (0,
|
|
44678
|
-
/* @__PURE__ */ (0,
|
|
45200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(AccountRow, { className: "gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime233.jsxs)("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
45201
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
|
|
44679
45202
|
AccountIdentity,
|
|
44680
45203
|
{
|
|
44681
45204
|
icon: getWalletIconName(wallet),
|
|
@@ -44683,7 +45206,7 @@ var AccountsWalletsTab = ({
|
|
|
44683
45206
|
label: (_a = wallet.displayAddress) != null ? _a : wallet.address
|
|
44684
45207
|
}
|
|
44685
45208
|
),
|
|
44686
|
-
/* @__PURE__ */ (0,
|
|
45209
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsx)(VerifiedBadge, {})
|
|
44687
45210
|
] }) }, `${wallet.chain}:${wallet.address}`);
|
|
44688
45211
|
}) })
|
|
44689
45212
|
] }) : null
|
|
@@ -44692,12 +45215,12 @@ var AccountsWalletsTab = ({
|
|
|
44692
45215
|
AccountsWalletsTab.displayName = "AccountsWalletsTab";
|
|
44693
45216
|
|
|
44694
45217
|
// src/profile/tabs/trading-access-tab.tsx
|
|
44695
|
-
var
|
|
44696
|
-
var
|
|
45218
|
+
var import_hooks123 = require("@agg-build/hooks");
|
|
45219
|
+
var import_react76 = require("react");
|
|
44697
45220
|
init_icon();
|
|
44698
45221
|
init_venue_logo();
|
|
44699
45222
|
init_utils();
|
|
44700
|
-
var
|
|
45223
|
+
var import_jsx_runtime234 = require("react/jsx-runtime");
|
|
44701
45224
|
var TRADING_ACCESS_VENUES = [
|
|
44702
45225
|
"kalshi",
|
|
44703
45226
|
"polymarket",
|
|
@@ -44712,8 +45235,8 @@ var TRADING_ACCESS_VENUES = [
|
|
|
44712
45235
|
"pred"
|
|
44713
45236
|
];
|
|
44714
45237
|
var TRADING_ACCESS_VENUE_ITEMS = TRADING_ACCESS_VENUES.map((id) => ({ id }));
|
|
44715
|
-
var SectionTitle2 = ({ children }) => /* @__PURE__ */ (0,
|
|
44716
|
-
var AccessRow = ({ children }) => /* @__PURE__ */ (0,
|
|
45238
|
+
var SectionTitle2 = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime234.jsx)("h3", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children });
|
|
45239
|
+
var AccessRow = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(
|
|
44717
45240
|
"div",
|
|
44718
45241
|
{
|
|
44719
45242
|
className: cn(
|
|
@@ -44725,17 +45248,17 @@ var AccessRow = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime229.jsx)
|
|
|
44725
45248
|
}
|
|
44726
45249
|
);
|
|
44727
45250
|
var AvailableStatus = () => {
|
|
44728
|
-
const labels = (0,
|
|
44729
|
-
return /* @__PURE__ */ (0,
|
|
44730
|
-
/* @__PURE__ */ (0,
|
|
44731
|
-
/* @__PURE__ */ (0,
|
|
45251
|
+
const labels = (0, import_hooks123.useLabels)();
|
|
45252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
45253
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Icon, { name: "check-badge", size: "small", className: "text-agg-primary" }),
|
|
45254
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)("span", { className: "text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground whitespace-nowrap", children: labels.trading.tradingAccessAvailable })
|
|
44732
45255
|
] });
|
|
44733
45256
|
};
|
|
44734
45257
|
var GeoblockedStatus = () => {
|
|
44735
|
-
const labels = (0,
|
|
44736
|
-
return /* @__PURE__ */ (0,
|
|
44737
|
-
/* @__PURE__ */ (0,
|
|
44738
|
-
/* @__PURE__ */ (0,
|
|
45258
|
+
const labels = (0, import_hooks123.useLabels)();
|
|
45259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)("div", { className: "flex items-center gap-2 text-agg-muted-foreground", children: [
|
|
45260
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Icon, { name: "warning-filled", size: "small", color: "currentColor" }),
|
|
45261
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)("span", { className: "text-agg-sm font-agg-normal leading-agg-5 whitespace-nowrap", children: labels.trading.venueUnavailableInRegion })
|
|
44739
45262
|
] });
|
|
44740
45263
|
};
|
|
44741
45264
|
var TradingAccessTab = ({
|
|
@@ -44743,21 +45266,21 @@ var TradingAccessTab = ({
|
|
|
44743
45266
|
onConnectKalshi,
|
|
44744
45267
|
onDisconnectKalshi
|
|
44745
45268
|
}) => {
|
|
44746
|
-
const labels = (0,
|
|
44747
|
-
const { disabledVenues, isLoading: isAppConfigLoading } = (0,
|
|
44748
|
-
const { isLocationBlocked } = (0,
|
|
44749
|
-
const visibleVenues = (0,
|
|
44750
|
-
() => (0,
|
|
45269
|
+
const labels = (0, import_hooks123.useLabels)();
|
|
45270
|
+
const { disabledVenues, isLoading: isAppConfigLoading } = (0, import_hooks123.useAppConfig)();
|
|
45271
|
+
const { isLocationBlocked } = (0, import_hooks123.useGeoBlock)();
|
|
45272
|
+
const visibleVenues = (0, import_react76.useMemo)(
|
|
45273
|
+
() => (0, import_hooks123.getVisibleVenuesByConfig)(TRADING_ACCESS_VENUE_ITEMS, disabledVenues),
|
|
44751
45274
|
[disabledVenues]
|
|
44752
45275
|
);
|
|
44753
|
-
return /* @__PURE__ */ (0,
|
|
44754
|
-
/* @__PURE__ */ (0,
|
|
44755
|
-
/* @__PURE__ */ (0,
|
|
45276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)("div", { className: "agg-trading-access-section flex flex-col gap-4", children: [
|
|
45277
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)(SectionTitle2, { children: labels.trading.tradingAccessVenues }),
|
|
45278
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)("div", { className: "flex flex-col gap-3", children: visibleVenues.map(({ id: venue }) => {
|
|
44756
45279
|
var _a;
|
|
44757
45280
|
const venueAccount = venueAccounts == null ? void 0 : venueAccounts.find((account) => account.venue === venue);
|
|
44758
45281
|
const isKalshi = venue === "kalshi";
|
|
44759
45282
|
const isConnected = (venueAccount == null ? void 0 : venueAccount.status) === "active";
|
|
44760
|
-
const availabilityState = (0,
|
|
45283
|
+
const availabilityState = (0, import_hooks123.getVenueAvailabilityState)({
|
|
44761
45284
|
venueId: venue,
|
|
44762
45285
|
disabledVenues,
|
|
44763
45286
|
isConfigLoading: isKalshi && isAppConfigLoading,
|
|
@@ -44765,12 +45288,12 @@ var TradingAccessTab = ({
|
|
|
44765
45288
|
});
|
|
44766
45289
|
const displayName = (_a = venueLogoLabels[venue]) != null ? _a : venue;
|
|
44767
45290
|
if (availabilityState === "hidden") return null;
|
|
44768
|
-
return /* @__PURE__ */ (0,
|
|
44769
|
-
/* @__PURE__ */ (0,
|
|
44770
|
-
/* @__PURE__ */ (0,
|
|
44771
|
-
/* @__PURE__ */ (0,
|
|
45291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)(AccessRow, { children: [
|
|
45292
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsxs)("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
45293
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)(VenueLogo, { venue, size: "small" }),
|
|
45294
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)("span", { className: "truncate text-agg-base font-agg-normal leading-6 text-agg-foreground", children: displayName })
|
|
44772
45295
|
] }),
|
|
44773
|
-
availabilityState === "geoblocked" ? /* @__PURE__ */ (0,
|
|
45296
|
+
availabilityState === "geoblocked" ? /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(GeoblockedStatus, {}) : isKalshi && !isConnected ? /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(
|
|
44774
45297
|
"button",
|
|
44775
45298
|
{
|
|
44776
45299
|
type: "button",
|
|
@@ -44779,9 +45302,9 @@ var TradingAccessTab = ({
|
|
|
44779
45302
|
className: "shrink-0 cursor-pointer text-agg-sm font-agg-bold leading-agg-5 text-agg-primary whitespace-nowrap focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary disabled:cursor-not-allowed disabled:opacity-60",
|
|
44780
45303
|
children: labels.trading.tradingAccessAddKalshiAccount
|
|
44781
45304
|
}
|
|
44782
|
-
) : isKalshi ? /* @__PURE__ */ (0,
|
|
44783
|
-
/* @__PURE__ */ (0,
|
|
44784
|
-
onDisconnectKalshi ? /* @__PURE__ */ (0,
|
|
45305
|
+
) : isKalshi ? /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
45306
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)(AvailableStatus, {}),
|
|
45307
|
+
onDisconnectKalshi ? /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(
|
|
44785
45308
|
"button",
|
|
44786
45309
|
{
|
|
44787
45310
|
type: "button",
|
|
@@ -44790,7 +45313,7 @@ var TradingAccessTab = ({
|
|
|
44790
45313
|
children: labels.auth.disconnect
|
|
44791
45314
|
}
|
|
44792
45315
|
) : null
|
|
44793
|
-
] }) : /* @__PURE__ */ (0,
|
|
45316
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(AvailableStatus, {})
|
|
44794
45317
|
] }, venue);
|
|
44795
45318
|
}) })
|
|
44796
45319
|
] });
|
|
@@ -44798,7 +45321,7 @@ var TradingAccessTab = ({
|
|
|
44798
45321
|
TradingAccessTab.displayName = "TradingAccessTab";
|
|
44799
45322
|
|
|
44800
45323
|
// src/profile/index.tsx
|
|
44801
|
-
var
|
|
45324
|
+
var import_jsx_runtime235 = require("react/jsx-runtime");
|
|
44802
45325
|
var ProfileModal = ({
|
|
44803
45326
|
open,
|
|
44804
45327
|
onOpenChange,
|
|
@@ -44822,31 +45345,31 @@ var ProfileModal = ({
|
|
|
44822
45345
|
onDisconnectExchange
|
|
44823
45346
|
}) => {
|
|
44824
45347
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
44825
|
-
const client = (0,
|
|
44826
|
-
const { user } = (0,
|
|
45348
|
+
const client = (0, import_hooks124.useAggClient)();
|
|
45349
|
+
const { user } = (0, import_hooks124.useAggAuthState)();
|
|
44827
45350
|
const toastCtx = useOptionalToast();
|
|
44828
|
-
const [activeTab, setActiveTab] = (0,
|
|
44829
|
-
const profileTabItems = (0,
|
|
45351
|
+
const [activeTab, setActiveTab] = (0, import_react77.useState)(PROFILE_TAB_KEYS.PROFILE_ACCOUNTS);
|
|
45352
|
+
const profileTabItems = (0, import_react77.useMemo)(() => getProfileTabItems(), []);
|
|
44830
45353
|
const resolvedInitialUsername = (_a = username != null ? username : user == null ? void 0 : user.username) != null ? _a : "";
|
|
44831
|
-
const [draftUsername, setDraftUsername] = (0,
|
|
44832
|
-
const [draftAvatarFile, setDraftAvatarFile] = (0,
|
|
44833
|
-
const [draftAvatarPreview, setDraftAvatarPreview] = (0,
|
|
44834
|
-
const [isSaving, setIsSaving] = (0,
|
|
44835
|
-
const [avatarTypeError, setAvatarTypeError] = (0,
|
|
44836
|
-
const [isConnectKalshiModalOpen, setIsConnectKalshiModalOpen] = (0,
|
|
44837
|
-
const { data: kalshiStatus, refetch: refetchKalshiStatus } = (0,
|
|
45354
|
+
const [draftUsername, setDraftUsername] = (0, import_react77.useState)(resolvedInitialUsername);
|
|
45355
|
+
const [draftAvatarFile, setDraftAvatarFile] = (0, import_react77.useState)();
|
|
45356
|
+
const [draftAvatarPreview, setDraftAvatarPreview] = (0, import_react77.useState)();
|
|
45357
|
+
const [isSaving, setIsSaving] = (0, import_react77.useState)(false);
|
|
45358
|
+
const [avatarTypeError, setAvatarTypeError] = (0, import_react77.useState)(null);
|
|
45359
|
+
const [isConnectKalshiModalOpen, setIsConnectKalshiModalOpen] = (0, import_react77.useState)(false);
|
|
45360
|
+
const { data: kalshiStatus, refetch: refetchKalshiStatus } = (0, import_hooks124.useVenueKeyStatus)(
|
|
44838
45361
|
import_sdk32.Venue.kalshi,
|
|
44839
45362
|
open
|
|
44840
45363
|
);
|
|
44841
|
-
(0,
|
|
45364
|
+
(0, import_react77.useEffect)(() => {
|
|
44842
45365
|
var _a2;
|
|
44843
45366
|
setDraftUsername((_a2 = username != null ? username : user == null ? void 0 : user.username) != null ? _a2 : "");
|
|
44844
45367
|
}, [username, user == null ? void 0 : user.username]);
|
|
44845
|
-
(0,
|
|
45368
|
+
(0, import_react77.useEffect)(() => {
|
|
44846
45369
|
if (open) return;
|
|
44847
45370
|
setIsConnectKalshiModalOpen(false);
|
|
44848
45371
|
}, [open]);
|
|
44849
|
-
const handleOpenChange = (0,
|
|
45372
|
+
const handleOpenChange = (0, import_react77.useCallback)(
|
|
44850
45373
|
(isOpen) => {
|
|
44851
45374
|
var _a2;
|
|
44852
45375
|
if (!isOpen) {
|
|
@@ -44870,7 +45393,7 @@ var ProfileModal = ({
|
|
|
44870
45393
|
setDraftAvatarPreview
|
|
44871
45394
|
]
|
|
44872
45395
|
);
|
|
44873
|
-
const handleDraftAvatarChange = (0,
|
|
45396
|
+
const handleDraftAvatarChange = (0, import_react77.useCallback)(
|
|
44874
45397
|
(file, preview) => {
|
|
44875
45398
|
const ACCEPTED_AVATAR_TYPES = ["image/jpeg", "image/png", "image/gif", "image/webp"];
|
|
44876
45399
|
if (file && !ACCEPTED_AVATAR_TYPES.includes(file.type)) {
|
|
@@ -44885,7 +45408,7 @@ var ProfileModal = ({
|
|
|
44885
45408
|
);
|
|
44886
45409
|
const originalUsername = (_b = username != null ? username : user == null ? void 0 : user.username) != null ? _b : "";
|
|
44887
45410
|
const hasChanges = draftUsername !== originalUsername || draftAvatarFile !== void 0;
|
|
44888
|
-
const handleSave = (0,
|
|
45411
|
+
const handleSave = (0, import_react77.useCallback)(() => __async(null, null, function* () {
|
|
44889
45412
|
var _a2, _b2, _c2;
|
|
44890
45413
|
setIsSaving(true);
|
|
44891
45414
|
try {
|
|
@@ -44940,10 +45463,10 @@ var ProfileModal = ({
|
|
|
44940
45463
|
originalUsername,
|
|
44941
45464
|
toastCtx
|
|
44942
45465
|
]);
|
|
44943
|
-
const handleCancel = (0,
|
|
45466
|
+
const handleCancel = (0, import_react77.useCallback)(() => {
|
|
44944
45467
|
handleOpenChange(false);
|
|
44945
45468
|
}, [handleOpenChange]);
|
|
44946
|
-
const handleVerifyKalshi = (0,
|
|
45469
|
+
const handleVerifyKalshi = (0, import_react77.useCallback)(
|
|
44947
45470
|
(credentials) => __async(null, null, function* () {
|
|
44948
45471
|
if (onConnectKalshi) {
|
|
44949
45472
|
yield onConnectKalshi(credentials);
|
|
@@ -44961,12 +45484,12 @@ var ProfileModal = ({
|
|
|
44961
45484
|
}),
|
|
44962
45485
|
[client, onConnectKalshi, refetchKalshiStatus]
|
|
44963
45486
|
);
|
|
44964
|
-
const handleDisconnectKalshi = (0,
|
|
45487
|
+
const handleDisconnectKalshi = (0, import_react77.useCallback)(() => __async(null, null, function* () {
|
|
44965
45488
|
yield client.deleteVenueKey(import_sdk32.Venue.kalshi);
|
|
44966
45489
|
yield refetchKalshiStatus();
|
|
44967
45490
|
onDisconnectExchange == null ? void 0 : onDisconnectExchange(import_sdk32.Venue.kalshi);
|
|
44968
45491
|
}), [client, onDisconnectExchange, refetchKalshiStatus]);
|
|
44969
|
-
const resolvedVenueAccounts = (0,
|
|
45492
|
+
const resolvedVenueAccounts = (0, import_react77.useMemo)(() => {
|
|
44970
45493
|
var _a2;
|
|
44971
45494
|
const nonKalshiAccounts = (_a2 = user == null ? void 0 : user.venueAccounts) == null ? void 0 : _a2.filter((account) => account.venue !== "kalshi");
|
|
44972
45495
|
if (!kalshiStatus) return user == null ? void 0 : user.venueAccounts;
|
|
@@ -45022,7 +45545,7 @@ var ProfileModal = ({
|
|
|
45022
45545
|
if (typeof window === "undefined") return;
|
|
45023
45546
|
((_a2 = window.top) != null ? _a2 : window).location.assign(url);
|
|
45024
45547
|
};
|
|
45025
|
-
const surfaceError = (0,
|
|
45548
|
+
const surfaceError = (0, import_react77.useCallback)(
|
|
45026
45549
|
(err, title2) => {
|
|
45027
45550
|
const message = (err == null ? void 0 : err.message) || "Something went wrong. Please try again.";
|
|
45028
45551
|
if (toastCtx) {
|
|
@@ -45033,7 +45556,7 @@ var ProfileModal = ({
|
|
|
45033
45556
|
},
|
|
45034
45557
|
[toastCtx]
|
|
45035
45558
|
);
|
|
45036
|
-
const handleConnectTwitter = (0,
|
|
45559
|
+
const handleConnectTwitter = (0, import_react77.useCallback)(() => __async(null, null, function* () {
|
|
45037
45560
|
try {
|
|
45038
45561
|
const result = yield client.linkAccount({
|
|
45039
45562
|
provider: "twitter",
|
|
@@ -45047,7 +45570,7 @@ var ProfileModal = ({
|
|
|
45047
45570
|
surfaceError(err, "Could not connect X (Twitter)");
|
|
45048
45571
|
}
|
|
45049
45572
|
}), [client, onConnectTwitter, surfaceError]);
|
|
45050
|
-
const handleConnectGoogle = (0,
|
|
45573
|
+
const handleConnectGoogle = (0, import_react77.useCallback)(() => __async(null, null, function* () {
|
|
45051
45574
|
try {
|
|
45052
45575
|
const result = yield client.linkAccount({
|
|
45053
45576
|
provider: "google",
|
|
@@ -45061,7 +45584,7 @@ var ProfileModal = ({
|
|
|
45061
45584
|
surfaceError(err, "Could not connect Google");
|
|
45062
45585
|
}
|
|
45063
45586
|
}), [client, onConnectGoogle, surfaceError]);
|
|
45064
|
-
const handleConnectApple = (0,
|
|
45587
|
+
const handleConnectApple = (0, import_react77.useCallback)(() => __async(null, null, function* () {
|
|
45065
45588
|
try {
|
|
45066
45589
|
const result = yield client.linkAccount({
|
|
45067
45590
|
provider: "apple",
|
|
@@ -45075,7 +45598,7 @@ var ProfileModal = ({
|
|
|
45075
45598
|
surfaceError(err, "Could not connect Apple");
|
|
45076
45599
|
}
|
|
45077
45600
|
}), [client, onConnectApple, surfaceError]);
|
|
45078
|
-
const handleDisconnectTwitter = (0,
|
|
45601
|
+
const handleDisconnectTwitter = (0, import_react77.useCallback)(() => __async(null, null, function* () {
|
|
45079
45602
|
try {
|
|
45080
45603
|
yield client.disconnectAccount("twitter");
|
|
45081
45604
|
yield client.getCurrentUser();
|
|
@@ -45084,7 +45607,7 @@ var ProfileModal = ({
|
|
|
45084
45607
|
surfaceError(err, "Could not disconnect X (Twitter)");
|
|
45085
45608
|
}
|
|
45086
45609
|
}), [client, onDisconnectTwitter, surfaceError]);
|
|
45087
|
-
const handleDisconnectGoogle = (0,
|
|
45610
|
+
const handleDisconnectGoogle = (0, import_react77.useCallback)(() => __async(null, null, function* () {
|
|
45088
45611
|
try {
|
|
45089
45612
|
yield client.disconnectAccount("google");
|
|
45090
45613
|
yield client.getCurrentUser();
|
|
@@ -45093,7 +45616,7 @@ var ProfileModal = ({
|
|
|
45093
45616
|
surfaceError(err, "Could not disconnect Google");
|
|
45094
45617
|
}
|
|
45095
45618
|
}), [client, onDisconnectGoogle, surfaceError]);
|
|
45096
|
-
const handleDisconnectApple = (0,
|
|
45619
|
+
const handleDisconnectApple = (0, import_react77.useCallback)(() => __async(null, null, function* () {
|
|
45097
45620
|
try {
|
|
45098
45621
|
yield client.disconnectAccount("apple");
|
|
45099
45622
|
yield client.getCurrentUser();
|
|
@@ -45102,7 +45625,7 @@ var ProfileModal = ({
|
|
|
45102
45625
|
surfaceError(err, "Could not disconnect Apple");
|
|
45103
45626
|
}
|
|
45104
45627
|
}), [client, onDisconnectApple, surfaceError]);
|
|
45105
|
-
const handleConnectEmail = (0,
|
|
45628
|
+
const handleConnectEmail = (0, import_react77.useCallback)(() => __async(null, null, function* () {
|
|
45106
45629
|
var _a2;
|
|
45107
45630
|
const typedEmail = typeof window !== "undefined" ? (_a2 = window.prompt("Enter your email to receive a magic link")) == null ? void 0 : _a2.trim() : void 0;
|
|
45108
45631
|
if (!typedEmail) return;
|
|
@@ -45121,7 +45644,7 @@ var ProfileModal = ({
|
|
|
45121
45644
|
surfaceError(err, "Could not connect email");
|
|
45122
45645
|
}
|
|
45123
45646
|
}), [client, onConnectEmail, surfaceError, toastCtx]);
|
|
45124
|
-
const handleDisconnectWallet = (0,
|
|
45647
|
+
const handleDisconnectWallet = (0, import_react77.useCallback)(
|
|
45125
45648
|
(wallet) => __async(null, null, function* () {
|
|
45126
45649
|
const normalizedChain = wallet.chain.toLowerCase();
|
|
45127
45650
|
const provider = normalizedChain === "solana" || normalizedChain === "svm" ? "solana_wallet" : "wallet";
|
|
@@ -45135,7 +45658,7 @@ var ProfileModal = ({
|
|
|
45135
45658
|
}),
|
|
45136
45659
|
[client, onDisconnectWallet, surfaceError]
|
|
45137
45660
|
);
|
|
45138
|
-
const providerActionMap = (0,
|
|
45661
|
+
const providerActionMap = (0, import_react77.useMemo)(
|
|
45139
45662
|
() => ({
|
|
45140
45663
|
twitter: {
|
|
45141
45664
|
connect: () => {
|
|
@@ -45177,7 +45700,7 @@ var ProfileModal = ({
|
|
|
45177
45700
|
handleDisconnectTwitter
|
|
45178
45701
|
]
|
|
45179
45702
|
);
|
|
45180
|
-
const resolvedWallets = (0,
|
|
45703
|
+
const resolvedWallets = (0, import_react77.useMemo)(() => {
|
|
45181
45704
|
var _a2, _b2;
|
|
45182
45705
|
if (wallets) return wallets;
|
|
45183
45706
|
const walletAccounts = (_b2 = (_a2 = user == null ? void 0 : user.accounts) == null ? void 0 : _a2.filter((account) => {
|
|
@@ -45196,8 +45719,8 @@ var ProfileModal = ({
|
|
|
45196
45719
|
};
|
|
45197
45720
|
});
|
|
45198
45721
|
}, [user == null ? void 0 : user.accounts, wallets]);
|
|
45199
|
-
return /* @__PURE__ */ (0,
|
|
45200
|
-
/* @__PURE__ */ (0,
|
|
45722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(Modal, { open: open && !isConnectKalshiModalOpen, onOpenChange: handleOpenChange, children: [
|
|
45723
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(
|
|
45201
45724
|
Modal.Container,
|
|
45202
45725
|
{
|
|
45203
45726
|
maxWidth: "800px",
|
|
@@ -45206,8 +45729,8 @@ var ProfileModal = ({
|
|
|
45206
45729
|
container: cn("agg-profile-modal", "min-h-[37.5rem]")
|
|
45207
45730
|
},
|
|
45208
45731
|
children: [
|
|
45209
|
-
/* @__PURE__ */ (0,
|
|
45210
|
-
/* @__PURE__ */ (0,
|
|
45732
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(Modal.Header, { title: "Edit Profile", classNames: { root: "agg-profile-modal-header" } }),
|
|
45733
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)("div", { className: "agg-profile-tabs sm:hidden w-full", children: /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
45211
45734
|
Tabs,
|
|
45212
45735
|
{
|
|
45213
45736
|
className: "w-full [&>div]:w-full",
|
|
@@ -45216,14 +45739,14 @@ var ProfileModal = ({
|
|
|
45216
45739
|
items: profileTabItems.map((tab) => ({
|
|
45217
45740
|
value: tab.value,
|
|
45218
45741
|
label: tab.label,
|
|
45219
|
-
icon: /* @__PURE__ */ (0,
|
|
45742
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(Icon, { name: tab.icon, size: "small" })
|
|
45220
45743
|
})),
|
|
45221
45744
|
value: activeTab,
|
|
45222
45745
|
onChange: (val) => setActiveTab(val)
|
|
45223
45746
|
}
|
|
45224
45747
|
) }),
|
|
45225
|
-
/* @__PURE__ */ (0,
|
|
45226
|
-
/* @__PURE__ */ (0,
|
|
45748
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(Modal.Body, { classNames: { root: cn("agg-profile-modal-body", "overflow-x-visible") }, children: /* @__PURE__ */ (0, import_jsx_runtime235.jsxs)("div", { className: "agg-profile-layout flex flex-col sm:flex-row sm:gap-10", children: [
|
|
45749
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
45227
45750
|
"nav",
|
|
45228
45751
|
{
|
|
45229
45752
|
className: cn(
|
|
@@ -45239,7 +45762,7 @@ var ProfileModal = ({
|
|
|
45239
45762
|
"aria-label": "Profile sections",
|
|
45240
45763
|
children: profileTabItems.map((tab) => {
|
|
45241
45764
|
const isActive = activeTab === tab.value;
|
|
45242
|
-
return /* @__PURE__ */ (0,
|
|
45765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(
|
|
45243
45766
|
"button",
|
|
45244
45767
|
{
|
|
45245
45768
|
type: "button",
|
|
@@ -45255,9 +45778,9 @@ var ProfileModal = ({
|
|
|
45255
45778
|
isActive ? "font-agg-normal text-agg-foreground bg-agg-secondary-hover" : "font-agg-normal text-agg-foreground"
|
|
45256
45779
|
),
|
|
45257
45780
|
children: [
|
|
45258
|
-
isActive ? /* @__PURE__ */ (0,
|
|
45259
|
-
/* @__PURE__ */ (0,
|
|
45260
|
-
/* @__PURE__ */ (0,
|
|
45781
|
+
isActive ? /* @__PURE__ */ (0, import_jsx_runtime235.jsx)("div", { className: "absolute left-0 top-0 bottom-0 w-1 bg-agg-primary" }) : null,
|
|
45782
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(Icon, { name: tab.icon, size: "small", color: "currentColor" }),
|
|
45783
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)("span", { className: "shrink-0 whitespace-nowrap", children: tab.label })
|
|
45261
45784
|
]
|
|
45262
45785
|
},
|
|
45263
45786
|
tab.value
|
|
@@ -45265,9 +45788,9 @@ var ProfileModal = ({
|
|
|
45265
45788
|
})
|
|
45266
45789
|
}
|
|
45267
45790
|
) }),
|
|
45268
|
-
/* @__PURE__ */ (0,
|
|
45269
|
-
activeTab === PROFILE_TAB_KEYS.PROFILE_ACCOUNTS ? /* @__PURE__ */ (0,
|
|
45270
|
-
/* @__PURE__ */ (0,
|
|
45791
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsxs)("div", { className: "agg-profile-content min-w-0 flex-1", children: [
|
|
45792
|
+
activeTab === PROFILE_TAB_KEYS.PROFILE_ACCOUNTS ? /* @__PURE__ */ (0, import_jsx_runtime235.jsxs)("div", { className: "agg-profile-accounts-tab flex flex-col gap-8", children: [
|
|
45793
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
45271
45794
|
AboutTab,
|
|
45272
45795
|
{
|
|
45273
45796
|
username: username != null ? username : user == null ? void 0 : user.username,
|
|
@@ -45281,7 +45804,7 @@ var ProfileModal = ({
|
|
|
45281
45804
|
avatarError: avatarTypeError
|
|
45282
45805
|
}
|
|
45283
45806
|
),
|
|
45284
|
-
/* @__PURE__ */ (0,
|
|
45807
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
45285
45808
|
AccountsWalletsTab,
|
|
45286
45809
|
{
|
|
45287
45810
|
socialAccounts: resolvedSocialAccounts,
|
|
@@ -45300,7 +45823,7 @@ var ProfileModal = ({
|
|
|
45300
45823
|
}
|
|
45301
45824
|
)
|
|
45302
45825
|
] }) : null,
|
|
45303
|
-
activeTab === PROFILE_TAB_KEYS.TRADING_ACCESS ? /* @__PURE__ */ (0,
|
|
45826
|
+
activeTab === PROFILE_TAB_KEYS.TRADING_ACCESS ? /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
45304
45827
|
TradingAccessTab,
|
|
45305
45828
|
{
|
|
45306
45829
|
venueAccounts: resolvedVenueAccounts,
|
|
@@ -45311,9 +45834,9 @@ var ProfileModal = ({
|
|
|
45311
45834
|
) : null
|
|
45312
45835
|
] })
|
|
45313
45836
|
] }) }),
|
|
45314
|
-
/* @__PURE__ */ (0,
|
|
45315
|
-
/* @__PURE__ */ (0,
|
|
45316
|
-
/* @__PURE__ */ (0,
|
|
45837
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(Modal.Footer, { classNames: { root: "agg-profile-modal-footer" }, children: [
|
|
45838
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(Button, { variant: "secondary", size: "large", onClick: handleCancel, className: "min-w-[120px]", children: "Cancel" }),
|
|
45839
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
45317
45840
|
Button,
|
|
45318
45841
|
{
|
|
45319
45842
|
variant: "primary",
|
|
@@ -45328,7 +45851,7 @@ var ProfileModal = ({
|
|
|
45328
45851
|
]
|
|
45329
45852
|
}
|
|
45330
45853
|
),
|
|
45331
|
-
/* @__PURE__ */ (0,
|
|
45854
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
45332
45855
|
ConnectKalshiModal,
|
|
45333
45856
|
{
|
|
45334
45857
|
open: open && isConnectKalshiModalOpen,
|
|
@@ -45341,37 +45864,37 @@ var ProfileModal = ({
|
|
|
45341
45864
|
ProfileModal.displayName = "ProfileModal";
|
|
45342
45865
|
|
|
45343
45866
|
// src/geo-block-modal/index.tsx
|
|
45344
|
-
var
|
|
45345
|
-
var
|
|
45867
|
+
var import_hooks125 = require("@agg-build/hooks");
|
|
45868
|
+
var import_react78 = require("react");
|
|
45346
45869
|
init_button();
|
|
45347
45870
|
init_icon();
|
|
45348
45871
|
init_modal();
|
|
45349
45872
|
init_utils();
|
|
45350
|
-
var
|
|
45873
|
+
var import_jsx_runtime236 = require("react/jsx-runtime");
|
|
45351
45874
|
var GeoBlockModal = ({
|
|
45352
45875
|
open,
|
|
45353
45876
|
onOpenChange,
|
|
45354
45877
|
onConfirm,
|
|
45355
45878
|
classNames
|
|
45356
45879
|
}) => {
|
|
45357
|
-
const labels = (0,
|
|
45358
|
-
const handleConfirm = (0,
|
|
45880
|
+
const labels = (0, import_hooks125.useLabels)();
|
|
45881
|
+
const handleConfirm = (0, import_react78.useCallback)(() => {
|
|
45359
45882
|
onConfirm == null ? void 0 : onConfirm();
|
|
45360
45883
|
onOpenChange(false);
|
|
45361
45884
|
}, [onConfirm, onOpenChange]);
|
|
45362
|
-
return /* @__PURE__ */ (0,
|
|
45885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
45363
45886
|
Modal,
|
|
45364
45887
|
{
|
|
45365
45888
|
open,
|
|
45366
45889
|
onOpenChange,
|
|
45367
45890
|
"aria-label": labels.trading.geoBlockModalAriaLabel,
|
|
45368
|
-
children: /* @__PURE__ */ (0,
|
|
45891
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)(
|
|
45369
45892
|
Modal.Container,
|
|
45370
45893
|
{
|
|
45371
45894
|
maxWidth: "480px",
|
|
45372
45895
|
classNames: { container: cn("!rounded-agg-2xl", classNames == null ? void 0 : classNames.container) },
|
|
45373
45896
|
children: [
|
|
45374
|
-
/* @__PURE__ */ (0,
|
|
45897
|
+
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
45375
45898
|
Modal.Header,
|
|
45376
45899
|
{
|
|
45377
45900
|
title: "",
|
|
@@ -45383,19 +45906,19 @@ var GeoBlockModal = ({
|
|
|
45383
45906
|
}
|
|
45384
45907
|
}
|
|
45385
45908
|
),
|
|
45386
|
-
/* @__PURE__ */ (0,
|
|
45387
|
-
/* @__PURE__ */ (0,
|
|
45909
|
+
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Modal.Body, { classNames: { root: cn("!px-10 !pt-0 !pb-12", classNames == null ? void 0 : classNames.body) }, children: /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)("div", { className: "flex flex-col items-center gap-8", children: [
|
|
45910
|
+
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
45388
45911
|
Icon,
|
|
45389
45912
|
{
|
|
45390
45913
|
name: "internet-security",
|
|
45391
45914
|
className: "h-[60px] w-[60px] text-agg-muted-foreground"
|
|
45392
45915
|
}
|
|
45393
45916
|
),
|
|
45394
|
-
/* @__PURE__ */ (0,
|
|
45395
|
-
/* @__PURE__ */ (0,
|
|
45396
|
-
/* @__PURE__ */ (0,
|
|
45917
|
+
/* @__PURE__ */ (0, import_jsx_runtime236.jsxs)("div", { className: "flex flex-col items-center gap-3 text-center", children: [
|
|
45918
|
+
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)("h2", { className: "text-agg-2xl font-agg-bold leading-agg-8 text-agg-foreground", children: labels.trading.geoBlockModalTitle }),
|
|
45919
|
+
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)("p", { className: "text-agg-base font-agg-normal leading-agg-6 text-agg-foreground", children: labels.trading.geoBlockModalDescription })
|
|
45397
45920
|
] }),
|
|
45398
|
-
/* @__PURE__ */ (0,
|
|
45921
|
+
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
45399
45922
|
Button,
|
|
45400
45923
|
{
|
|
45401
45924
|
variant: "secondary",
|
|
@@ -45501,6 +46024,10 @@ init_deposit_modal_events();
|
|
|
45501
46024
|
ImageIcon,
|
|
45502
46025
|
InfoIcon,
|
|
45503
46026
|
InlineAlert,
|
|
46027
|
+
LEADERBOARD_DEFAULT_METRIC,
|
|
46028
|
+
LEADERBOARD_DEFAULT_PERIOD,
|
|
46029
|
+
LEADERBOARD_METRICS,
|
|
46030
|
+
LeaderboardPage,
|
|
45504
46031
|
LineChart,
|
|
45505
46032
|
LinkAccountsIcon,
|
|
45506
46033
|
LoadingIcon,
|