@microcosmmoney/portal-react 3.13.4 → 3.13.6

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.
Files changed (40) hide show
  1. package/dist/main-portal/components/auctions/AuctionsPage.js +2 -2
  2. package/dist/main-portal/components/income/ManagerIncomePage.js +1 -16
  3. package/dist/main-portal/components/layout/AppSidebar.js +1 -1
  4. package/dist/main-portal/components/layout/TerminalSidebar.js +1 -1
  5. package/dist/main-portal/components/mining/MiningModal.js +2 -2
  6. package/dist/main-portal/components/profile/ProfilePage.js +2 -2
  7. package/dist/main-portal/components/providers/SolanaWalletProvider.js +1 -1
  8. package/dist/main-portal/components/queue/QueueStatusPage.js +2 -71
  9. package/dist/main-portal/components/resources/public-mining-modal.js +1 -1
  10. package/dist/main-portal/components/stations/StationDetailPage.js +1 -3
  11. package/dist/main-portal/components/stations/StationListPage.js +2 -4
  12. package/dist/main-portal/components/stations/StationsPage.js +2 -5
  13. package/dist/main-portal/config/menu-config.d.ts +0 -2
  14. package/dist/main-portal/config/menu-config.js +14 -67
  15. package/dist/main-portal/hooks/useAuth.d.ts +1 -2
  16. package/dist/main-portal/hooks/useAuth.js +0 -2
  17. package/dist/main-portal/lib/api/blockchain.d.ts +0 -44
  18. package/dist/main-portal/lib/api/blockchain.js +0 -195
  19. package/dist/main-portal/lib/api/services/index.d.ts +0 -1
  20. package/dist/main-portal/lib/api/services/index.js +0 -1
  21. package/dist/main-portal/lib/api/services/organization.d.ts +1 -6
  22. package/dist/main-portal/lib/api/services/organization.js +0 -12
  23. package/dist/main-portal/lib/oauth-config.js +3 -3
  24. package/dist/main-portal/lib/types/common.types.d.ts +0 -32
  25. package/dist/main-portal/lib/types/user.types.d.ts +1 -33
  26. package/package.json +1 -1
  27. package/dist/main-portal/hooks/useStrategies.d.ts +0 -134
  28. package/dist/main-portal/hooks/useStrategies.js +0 -28
  29. package/dist/main-portal/lib/api/services/ai.d.ts +0 -139
  30. package/dist/main-portal/lib/api/services/ai.js +0 -214
  31. package/dist/main-portal/lib/order-id-generator.d.ts +0 -19
  32. package/dist/main-portal/lib/order-id-generator.js +0 -97
  33. package/dist/main-portal/lib/strategy/defaults.d.ts +0 -2
  34. package/dist/main-portal/lib/strategy/defaults.js +0 -58
  35. package/dist/main-portal/lib/strategy/index.d.ts +0 -3
  36. package/dist/main-portal/lib/strategy/index.js +0 -20
  37. package/dist/main-portal/lib/strategy/tooltips.d.ts +0 -1
  38. package/dist/main-portal/lib/strategy/tooltips.js +0 -50
  39. package/dist/main-portal/lib/strategy/types.d.ts +0 -74
  40. package/dist/main-portal/lib/strategy/types.js +0 -2
@@ -35,7 +35,7 @@ const BADGE_VARIANTS = {
35
35
  // BID_STATUS_MAP moved to component scope for i18n
36
36
  function AuctionsPage() {
37
37
  const t = (0, next_intl_1.useTranslations)('auctionsDash');
38
- const { user, isAdmin } = (0, useAuth_1.useAuth)();
38
+ const { user } = (0, useAuth_1.useAuth)();
39
39
  const UNIT_LABELS = {
40
40
  station: t('station'), matrix: t('matrix'), sector: t('sector'), system: t('system'),
41
41
  };
@@ -203,7 +203,7 @@ function AuctionsPage() {
203
203
  };
204
204
  if (loading)
205
205
  return ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center h-[60vh]", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-8 h-8 animate-spin text-neutral-400" }) }));
206
- return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-3 py-4 space-y-3 xs:px-4 xs:space-y-4 sm:px-6 sm:py-6 sm:space-y-6 font-mono", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-lg sm:text-2xl font-bold text-white tracking-wider", children: t('title') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs sm:text-sm text-neutral-400", children: t('subtitle') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", onClick: () => { loadAuctions(); loadMyBids(); loadHistory(); sonner_1.toast.success(t('refreshed')); }, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: "w-4 h-4 mr-2" }), t('refresh')] }), isAdmin() && ((0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", onClick: () => setIsCreateAuctionDialogOpen(true), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Plus, { className: "w-4 h-4 mr-2" }), t('createAuction')] }))] })] }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-3 sm:p-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t('ongoing') }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-cyan-400 font-mono", children: auctions.length }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('auctionsCount') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t('totalBids') }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-white font-mono", children: stats.totalBids }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('bidsCount') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t('highestBid') }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-white font-mono", children: stats.highestBid > 0 ? stats.highestBid : '--' }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: "MCC" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t('totalLocked') }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-cyan-400 font-mono", children: stats.totalVolume > 0 ? stats.totalVolume : '--' }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: "MCC" })] })] }) }) }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Flame, { className: "w-4 h-4 text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-sm font-medium text-neutral-300 tracking-wider", children: t('activeAuctions') }), (0, jsx_runtime_1.jsxs)("span", { className: "text-xs text-neutral-500", children: ["(", auctions.length, ")"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Clock, { className: "w-3 h-3" }), (0, jsx_runtime_1.jsx)("span", { children: t('autoRefresh') })] })] }), auctions.length === 0 ? ((0, jsx_runtime_1.jsxs)("div", { className: "text-center py-16", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Gavel, { className: "w-10 h-10 text-neutral-700 mx-auto mb-3" }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-sm mb-2", children: t('noActiveAuctions') }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs max-w-md mx-auto", children: t('auctionExplainer') })] })) : ((0, jsx_runtime_1.jsx)("div", { className: "space-y-4", children: auctions.map((auction) => {
206
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-3 py-4 space-y-3 xs:px-4 xs:space-y-4 sm:px-6 sm:py-6 sm:space-y-6 font-mono", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-lg sm:text-2xl font-bold text-white tracking-wider", children: t('title') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs sm:text-sm text-neutral-400", children: t('subtitle') })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex gap-2", children: (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", onClick: () => { loadAuctions(); loadMyBids(); loadHistory(); sonner_1.toast.success(t('refreshed')); }, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: "w-4 h-4 mr-2" }), t('refresh')] }) })] }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-3 sm:p-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t('ongoing') }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-cyan-400 font-mono", children: auctions.length }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('auctionsCount') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t('totalBids') }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-white font-mono", children: stats.totalBids }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('bidsCount') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t('highestBid') }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-white font-mono", children: stats.highestBid > 0 ? stats.highestBid : '--' }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: "MCC" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t('totalLocked') }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-cyan-400 font-mono", children: stats.totalVolume > 0 ? stats.totalVolume : '--' }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: "MCC" })] })] }) }) }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Flame, { className: "w-4 h-4 text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-sm font-medium text-neutral-300 tracking-wider", children: t('activeAuctions') }), (0, jsx_runtime_1.jsxs)("span", { className: "text-xs text-neutral-500", children: ["(", auctions.length, ")"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Clock, { className: "w-3 h-3" }), (0, jsx_runtime_1.jsx)("span", { children: t('autoRefresh') })] })] }), auctions.length === 0 ? ((0, jsx_runtime_1.jsxs)("div", { className: "text-center py-16", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Gavel, { className: "w-10 h-10 text-neutral-700 mx-auto mb-3" }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-sm mb-2", children: t('noActiveAuctions') }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs max-w-md mx-auto", children: t('auctionExplainer') })] })) : ((0, jsx_runtime_1.jsx)("div", { className: "space-y-4", children: auctions.map((auction) => {
207
207
  const unitType = auction.unit_type || 'station';
208
208
  const minNextBid = auction.current_price + auction.bid_increment;
209
209
  const priceUp = auction.starting_price > 0
@@ -11,7 +11,6 @@ const button_1 = require("../ui/button");
11
11
  const input_1 = require("../ui/input");
12
12
  const label_1 = require("../ui/label");
13
13
  const sonner_1 = require("sonner");
14
- const useAuth_1 = require("../../hooks/useAuth");
15
14
  const api_service_1 = require("../../lib/api-service");
16
15
  const api_1 = require("../../lib/types/api");
17
16
  const utils_1 = require("../../lib/utils");
@@ -44,9 +43,7 @@ const getLevelLabel = (level) => {
44
43
  };
45
44
  function ManagerIncomePage() {
46
45
  const t = (0, next_intl_1.useTranslations)('managerIncome');
47
- const { isAdmin } = (0, useAuth_1.useAuth)();
48
46
  const [income, setIncome] = (0, react_1.useState)(null);
49
- const [teamCustody, setTeamCustody] = (0, react_1.useState)(null);
50
47
  const [loading, setLoading] = (0, react_1.useState)(true);
51
48
  const [refreshing, setRefreshing] = (0, react_1.useState)(false);
52
49
  const [dateRange, setDateRange] = (0, react_1.useState)('30d');
@@ -96,18 +93,6 @@ function ManagerIncomePage() {
96
93
  console.warn('[ManagerIncome] Failed to fetch income data:', e);
97
94
  setIncome(null);
98
95
  }
99
- if (isAdmin()) {
100
- try {
101
- const custodyRes = await (0, api_service_1.getTeamCustodySummary)();
102
- if (custodyRes && custodyRes.success) {
103
- setTeamCustody(custodyRes);
104
- }
105
- }
106
- catch (e) {
107
- console.warn('[ManagerIncome] Failed to fetch team custody data:', e);
108
- setTeamCustody(null);
109
- }
110
- }
111
96
  setLoading(false);
112
97
  };
113
98
  const handleRefresh = async () => {
@@ -143,5 +128,5 @@ function ManagerIncomePage() {
143
128
  return ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("p-2 rounded bg-neutral-800", getLevelColor(level)), children: getLevelIcon(level) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-white font-medium", children: getLevelLabel(level) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-500", children: [role, " - ", share * 100, "%"] })] })] }), (0, jsx_runtime_1.jsx)(badge_1.Badge, { variant: "outline", className: incomeAmount > 0
144
129
  ? "bg-white/20 text-white border border-white/30"
145
130
  : "bg-neutral-500/20 text-neutral-300 border border-neutral-600", children: incomeAmount > 0 ? t('hasIncome') : t('noIncome') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between text-sm mb-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: t('cumulativeIncome') }), (0, jsx_runtime_1.jsxs)("span", { className: "text-white font-mono", children: [incomeAmount.toLocaleString(undefined, { minimumFractionDigits: 2 }), " MCC"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-800 rounded-full h-2", children: (0, jsx_runtime_1.jsx)("div", { className: "bg-cyan-400 h-2 rounded-full transition-all", style: { width: `${percentage}%` } }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-4 pt-3 border-t border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xl font-bold text-white font-mono", children: recordCount }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('outputRecords') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xl font-bold text-white font-mono", children: recordCount > 0 ? (incomeAmount / recordCount).toFixed(2) : '0.00' }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('avgPerRecord') })] })] })] }) }, level));
146
- }) }), isAdmin() && teamCustody && ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.PiggyBank, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('teamCustodySummary') })] }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-3", children: teamCustody.wallets.map((wallet, idx) => ((0, jsx_runtime_1.jsxs)("div", { className: "p-3 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: wallet.wallet_type }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg font-bold text-white font-mono", children: parseFloat(wallet.total_received).toLocaleString() }), wallet.wallet_address && ((0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-500 mt-1 truncate font-mono", title: wallet.wallet_address, children: [wallet.wallet_address.slice(0, 8), "..."] }))] }, idx))) }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-4 pt-4 border-t border-neutral-700 flex justify-between items-center", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 tracking-wider", children: "total_custody" }), (0, jsx_runtime_1.jsxs)("span", { className: "text-2xl font-bold text-white font-mono", children: [parseFloat(teamCustody.total_received).toLocaleString(), " MCC"] })] })] }) })), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.History, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('outputHistory') })] }), (0, jsx_runtime_1.jsx)(MiningDistributionHistory_1.MiningDistributionHistory, { title: "", description: "", showUserColumn: true, limit: 10 })] }) })] }));
131
+ }) }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.History, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('outputHistory') })] }), (0, jsx_runtime_1.jsx)(MiningDistributionHistory_1.MiningDistributionHistory, { title: "", description: "", showUserColumn: true, limit: 10 })] }) })] }));
147
132
  }
@@ -84,5 +84,5 @@ function AppSidebar({ ...props }) {
84
84
  console.error(tc("logoutFailed"), error);
85
85
  }
86
86
  };
87
- return ((0, jsx_runtime_1.jsxs)(sidebar_1.Sidebar, { collapsible: "icon", ...props, children: [(0, jsx_runtime_1.jsx)(sidebar_1.SidebarHeader, { children: (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenu, { children: (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenuItem, { children: (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenuButton, { size: "lg", asChild: true, children: (0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: "/user-system/dashboard", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex aspect-square size-8 items-center justify-center rounded-lg bg-[#6366F1] text-white", children: (0, jsx_runtime_1.jsx)("span", { className: "text-lg font-bold", children: "M" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [(0, jsx_runtime_1.jsx)("span", { className: "truncate font-semibold", children: "Microcosm" }), (0, jsx_runtime_1.jsx)("span", { className: "truncate text-xs text-sidebar-foreground/50", children: "Open User System" })] })] }) }) }) }) }), (0, jsx_runtime_1.jsxs)(sidebar_1.SidebarContent, { children: [(0, jsx_runtime_1.jsxs)(sidebar_1.SidebarGroup, { children: [(0, jsx_runtime_1.jsx)(sidebar_1.SidebarGroupLabel, { children: tc('sidebarMenu') }), (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenu, { children: menus.userMenu.map((item) => ((0, jsx_runtime_1.jsx)(NavMenuItem, { item: item }, item.href))) })] }), menus.agentMenu && menus.agentMenu.length > 0 && ((0, jsx_runtime_1.jsxs)(sidebar_1.SidebarGroup, { children: [(0, jsx_runtime_1.jsx)(sidebar_1.SidebarGroupLabel, { children: tc('sidebarAgentManagement') }), (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenu, { children: menus.agentMenu.map((item) => ((0, jsx_runtime_1.jsx)(NavMenuItem, { item: item }, item.href))) })] })), menus.adminMenu && menus.adminMenu.length > 0 && ((0, jsx_runtime_1.jsxs)(sidebar_1.SidebarGroup, { children: [(0, jsx_runtime_1.jsx)(sidebar_1.SidebarGroupLabel, { children: tc('sidebarSystemManagement') }), (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenu, { children: menus.adminMenu.map((item) => ((0, jsx_runtime_1.jsx)(NavMenuItem, { item: item }, item.href))) })] }))] }), (0, jsx_runtime_1.jsxs)(sidebar_1.SidebarFooter, { children: [(0, jsx_runtime_1.jsx)(separator_1.Separator, { className: "mb-2" }), (0, jsx_runtime_1.jsxs)(sidebar_1.SidebarMenu, { children: [(0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenuItem, { children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 px-2 py-1.5", children: [(0, jsx_runtime_1.jsx)(avatar_1.Avatar, { className: "h-8 w-8", children: (0, jsx_runtime_1.jsx)(avatar_1.AvatarFallback, { className: "bg-[#6366F1] text-white", children: userInfo?.email?.charAt(0).toUpperCase() || "U" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-1 flex-col text-left text-sm leading-tight", children: [(0, jsx_runtime_1.jsx)("span", { className: "truncate font-semibold", children: userInfo?.email?.split("@")[0] || tc('defaultUser') }), (0, jsx_runtime_1.jsxs)("span", { className: "truncate text-xs text-sidebar-foreground/50", children: [userRole === "admin" && tc('admin'), userRole === "agent" && tc('agent'), userRole === "user" && tc('normalUser')] })] })] }) }), (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenuItem, { children: (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "ghost", size: "sm", className: "w-full justify-start", onClick: handleLogout, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.LogOut, { className: "mr-2 h-4 w-4" }), tc('logout')] }) })] })] }), (0, jsx_runtime_1.jsx)(sidebar_1.SidebarRail, {})] }));
87
+ return ((0, jsx_runtime_1.jsxs)(sidebar_1.Sidebar, { collapsible: "icon", ...props, children: [(0, jsx_runtime_1.jsx)(sidebar_1.SidebarHeader, { children: (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenu, { children: (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenuItem, { children: (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenuButton, { size: "lg", asChild: true, children: (0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: "/user-system/dashboard", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex aspect-square size-8 items-center justify-center rounded-lg bg-[#6366F1] text-white", children: (0, jsx_runtime_1.jsx)("span", { className: "text-lg font-bold", children: "M" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [(0, jsx_runtime_1.jsx)("span", { className: "truncate font-semibold", children: "Microcosm" }), (0, jsx_runtime_1.jsx)("span", { className: "truncate text-xs text-sidebar-foreground/50", children: "Open User System" })] })] }) }) }) }) }), (0, jsx_runtime_1.jsxs)(sidebar_1.SidebarContent, { children: [(0, jsx_runtime_1.jsxs)(sidebar_1.SidebarGroup, { children: [(0, jsx_runtime_1.jsx)(sidebar_1.SidebarGroupLabel, { children: tc('sidebarMenu') }), (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenu, { children: menus.userMenu.map((item) => ((0, jsx_runtime_1.jsx)(NavMenuItem, { item: item }, item.href))) })] }), menus.agentMenu && menus.agentMenu.length > 0 && ((0, jsx_runtime_1.jsxs)(sidebar_1.SidebarGroup, { children: [(0, jsx_runtime_1.jsx)(sidebar_1.SidebarGroupLabel, { children: tc('sidebarAgentManagement') }), (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenu, { children: menus.agentMenu.map((item) => ((0, jsx_runtime_1.jsx)(NavMenuItem, { item: item }, item.href))) })] }))] }), (0, jsx_runtime_1.jsxs)(sidebar_1.SidebarFooter, { children: [(0, jsx_runtime_1.jsx)(separator_1.Separator, { className: "mb-2" }), (0, jsx_runtime_1.jsxs)(sidebar_1.SidebarMenu, { children: [(0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenuItem, { children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 px-2 py-1.5", children: [(0, jsx_runtime_1.jsx)(avatar_1.Avatar, { className: "h-8 w-8", children: (0, jsx_runtime_1.jsx)(avatar_1.AvatarFallback, { className: "bg-[#6366F1] text-white", children: userInfo?.email?.charAt(0).toUpperCase() || "U" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-1 flex-col text-left text-sm leading-tight", children: [(0, jsx_runtime_1.jsx)("span", { className: "truncate font-semibold", children: userInfo?.email?.split("@")[0] || tc('defaultUser') }), (0, jsx_runtime_1.jsx)("span", { className: "truncate text-xs text-sidebar-foreground/50", children: userRole === "agent" ? tc('agent') : tc('normalUser') })] })] }) }), (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenuItem, { children: (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "ghost", size: "sm", className: "w-full justify-start", onClick: handleLogout, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.LogOut, { className: "mr-2 h-4 w-4" }), tc('logout')] }) })] })] }), (0, jsx_runtime_1.jsx)(sidebar_1.SidebarRail, {})] }));
88
88
  }
@@ -99,7 +99,7 @@ function TerminalSidebar() {
99
99
  const handleLogout = () => {
100
100
  (0, auth_service_1.logOut)();
101
101
  };
102
- const sidebarContent = ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col h-full md:bg-neutral-900 border-r border-neutral-700/50 md:border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "hidden xs:flex items-center justify-end px-2 xs:px-3 py-1", children: (0, jsx_runtime_1.jsx)("button", { onClick: () => setCollapsed(!collapsed), className: "p-1 rounded text-neutral-400 hover:text-cyan-400 transition-colors", title: collapsed ? tc('expandSidebar') : tc('collapseSidebar'), children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: (0, utils_1.cn)("w-4 h-4 transition-transform", !collapsed && "rotate-180") }) }) }), (0, jsx_runtime_1.jsxs)("nav", { className: "flex-1 overflow-y-auto px-2 xs:px-3 space-y-0.5 xs:space-y-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "space-y-0.5 xs:space-y-1 mb-4 xs:mb-6", children: menus.userMenu.map((item) => ((0, jsx_runtime_1.jsx)(TerminalMenuItem, { item: item, collapsed: collapsed, onNavigate: handleMobileNavigate }, item.href))) }), menus.agentMenu && menus.agentMenu.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-0.5 xs:space-y-1 mb-4 xs:mb-6", children: [!collapsed && ((0, jsx_runtime_1.jsx)("div", { className: "px-2 xs:px-3 py-1.5 xs:py-2 text-[10px] xs:text-xs text-neutral-500 uppercase tracking-wider font-medium", children: "AGENT" })), menus.agentMenu.map((item) => ((0, jsx_runtime_1.jsx)(TerminalMenuItem, { item: item, collapsed: collapsed, onNavigate: handleMobileNavigate }, item.href)))] }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-4 xs:mt-6 pt-3 xs:pt-4 border-t border-neutral-800 px-2 xs:px-3 pb-2 xs:pb-3 safe-area-bottom", children: [!collapsed && ((0, jsx_runtime_1.jsx)(navigation_1.Link, { href: "/profile", onClick: handleMobileNavigate, className: "mb-3 xs:mb-4 p-2 xs:p-3 bg-neutral-800 border border-neutral-700 rounded-lg block hover:border-neutral-600 hover:bg-neutral-800/80 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 xs:gap-3", children: [(0, jsx_runtime_1.jsx)(hover_avatar_1.HoverAvatar, { src: userInfo?.avatar_url, fallback: displayName, size: 36, fallbackClassName: "bg-neutral-700 text-neutral-400" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 min-w-0", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-xs xs:text-sm font-medium text-white truncate", children: displayName }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 xs:gap-1.5", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-1.5 h-1.5 bg-green-400 rounded-full animate-pulse" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[9px] xs:text-[10px] text-neutral-500 uppercase tracking-wider", children: userRole === 'admin' ? 'ADMIN' : 'USER' })] })] })] }) })), collapsed && ((0, jsx_runtime_1.jsx)(navigation_1.Link, { href: "/profile", className: "flex justify-center mb-3", children: (0, jsx_runtime_1.jsx)(hover_avatar_1.HoverAvatar, { src: userInfo?.avatar_url, fallback: displayName, size: 32, fallbackClassName: "bg-neutral-700 text-neutral-400" }) })), (0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: "/profile", onClick: handleMobileNavigate, className: "w-full flex items-center gap-2 xs:gap-3 px-2 xs:px-3 py-2 xs:py-2.5 rounded transition-colors text-neutral-400 hover:text-cyan-400 hover:bg-cyan-400/10 touch-target", title: collapsed ? tc('accountManagement') : undefined, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Link2, { className: "w-4 h-4 xs:w-5 xs:h-5 shrink-0" }), !collapsed && (0, jsx_runtime_1.jsx)("span", { className: "text-xs xs:text-sm font-medium text-truncate-safe", children: tc('accountManagement') })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleLogout, className: (0, utils_1.cn)("w-full mt-1 flex items-center gap-2 xs:gap-3 px-2 xs:px-3 py-2 xs:py-2.5 rounded text-neutral-500 hover:text-red-400 hover:bg-neutral-800 transition-colors touch-target", collapsed ? "justify-center" : ""), title: collapsed ? tc('logout') : undefined, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.LogOut, { className: "w-4 h-4 xs:w-5 xs:h-5 shrink-0" }), !collapsed && (0, jsx_runtime_1.jsx)("span", { className: "text-xs xs:text-sm", children: tc('logout') })] })] })] }));
102
+ const sidebarContent = ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col h-full md:bg-neutral-900 border-r border-neutral-700/50 md:border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "hidden xs:flex items-center justify-end px-2 xs:px-3 py-1", children: (0, jsx_runtime_1.jsx)("button", { onClick: () => setCollapsed(!collapsed), className: "p-1 rounded text-neutral-400 hover:text-cyan-400 transition-colors", title: collapsed ? tc('expandSidebar') : tc('collapseSidebar'), children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: (0, utils_1.cn)("w-4 h-4 transition-transform", !collapsed && "rotate-180") }) }) }), (0, jsx_runtime_1.jsxs)("nav", { className: "flex-1 overflow-y-auto px-2 xs:px-3 space-y-0.5 xs:space-y-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "space-y-0.5 xs:space-y-1 mb-4 xs:mb-6", children: menus.userMenu.map((item) => ((0, jsx_runtime_1.jsx)(TerminalMenuItem, { item: item, collapsed: collapsed, onNavigate: handleMobileNavigate }, item.href))) }), menus.agentMenu && menus.agentMenu.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-0.5 xs:space-y-1 mb-4 xs:mb-6", children: [!collapsed && ((0, jsx_runtime_1.jsx)("div", { className: "px-2 xs:px-3 py-1.5 xs:py-2 text-[10px] xs:text-xs text-neutral-500 uppercase tracking-wider font-medium", children: "AGENT" })), menus.agentMenu.map((item) => ((0, jsx_runtime_1.jsx)(TerminalMenuItem, { item: item, collapsed: collapsed, onNavigate: handleMobileNavigate }, item.href)))] }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-4 xs:mt-6 pt-3 xs:pt-4 border-t border-neutral-800 px-2 xs:px-3 pb-2 xs:pb-3 safe-area-bottom", children: [!collapsed && ((0, jsx_runtime_1.jsx)(navigation_1.Link, { href: "/profile", onClick: handleMobileNavigate, className: "mb-3 xs:mb-4 p-2 xs:p-3 bg-neutral-800 border border-neutral-700 rounded-lg block hover:border-neutral-600 hover:bg-neutral-800/80 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 xs:gap-3", children: [(0, jsx_runtime_1.jsx)(hover_avatar_1.HoverAvatar, { src: userInfo?.avatar_url, fallback: displayName, size: 36, fallbackClassName: "bg-neutral-700 text-neutral-400" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 min-w-0", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-xs xs:text-sm font-medium text-white truncate", children: displayName }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 xs:gap-1.5", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-1.5 h-1.5 bg-green-400 rounded-full animate-pulse" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[9px] xs:text-[10px] text-neutral-500 uppercase tracking-wider", children: "USER" })] })] })] }) })), collapsed && ((0, jsx_runtime_1.jsx)(navigation_1.Link, { href: "/profile", className: "flex justify-center mb-3", children: (0, jsx_runtime_1.jsx)(hover_avatar_1.HoverAvatar, { src: userInfo?.avatar_url, fallback: displayName, size: 32, fallbackClassName: "bg-neutral-700 text-neutral-400" }) })), (0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: "/profile", onClick: handleMobileNavigate, className: "w-full flex items-center gap-2 xs:gap-3 px-2 xs:px-3 py-2 xs:py-2.5 rounded transition-colors text-neutral-400 hover:text-cyan-400 hover:bg-cyan-400/10 touch-target", title: collapsed ? tc('accountManagement') : undefined, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Link2, { className: "w-4 h-4 xs:w-5 xs:h-5 shrink-0" }), !collapsed && (0, jsx_runtime_1.jsx)("span", { className: "text-xs xs:text-sm font-medium text-truncate-safe", children: tc('accountManagement') })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleLogout, className: (0, utils_1.cn)("w-full mt-1 flex items-center gap-2 xs:gap-3 px-2 xs:px-3 py-2 xs:py-2.5 rounded text-neutral-500 hover:text-red-400 hover:bg-neutral-800 transition-colors touch-target", collapsed ? "justify-center" : ""), title: collapsed ? tc('logout') : undefined, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.LogOut, { className: "w-4 h-4 xs:w-5 xs:h-5 shrink-0" }), !collapsed && (0, jsx_runtime_1.jsx)("span", { className: "text-xs xs:text-sm", children: tc('logout') })] })] })] }));
103
103
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => setMobileOpen(!mobileOpen), className: "md:hidden fixed top-3 2xs:top-3.5 left-2 2xs:left-3 xs:left-4 z-[60] p-1.5 2xs:p-2 bg-neutral-800/60 backdrop-blur-md border border-neutral-700/50 rounded text-neutral-400 hover:text-white touch-target", children: mobileOpen ? (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "w-4 h-4 2xs:w-5 2xs:h-5" }) : (0, jsx_runtime_1.jsx)(lucide_react_1.Menu, { className: "w-4 h-4 2xs:w-5 2xs:h-5" }) }), mobileOpen && ((0, jsx_runtime_1.jsx)("div", { className: "md:hidden fixed inset-0 top-14 2xs:top-16 bg-black/60 z-40 overscroll-contain touch-none", onClick: () => setMobileOpen(false) })), (0, jsx_runtime_1.jsx)("aside", { className: (0, utils_1.cn)("fixed md:relative md:flex-shrink-0 top-14 2xs:top-16 md:top-0 z-[45] md:z-40 sidebar-frost", "h-[calc(100vh-56px)] 2xs:h-[calc(100vh-64px)] md:h-full", "transition-[left,width] duration-300 md:transition-all",
104
104
  // Width: full on tiny, 80% on small phone, w-64 on tablet+
105
105
  mobileOpen
@@ -55,7 +55,7 @@ const STABLECOIN_VAULTS = {
55
55
  usdt: new web3_js_1.PublicKey("BnHA9jSm88wzQS4c2nCgTXch1Byzc3FWn2G7Wgrvazy3"),
56
56
  };
57
57
  const POOL_PDA_WALLET = new web3_js_1.PublicKey("GSBWtaX9WcBh8jUcmbXtQ1afQPHKSUKvsTxkqpJU3G9S");
58
- const SOLANA_RPC = process.env.NEXT_PUBLIC_SOLANA_RPC_URL || "";
58
+ const SOLANA_RPC = process.env.NEXT_PUBLIC_HELIUS_RPC_URL || process.env.NEXT_PUBLIC_SOLANA_RPC_URL || "https://api.mainnet-beta.solana.com";
59
59
  const COIN_INFO = {
60
60
  usdc: { symbol: 'USDC', name: 'USD Coin', icon: '💵' },
61
61
  usdt: { symbol: 'USDT', name: 'Tether', icon: '💴' },
@@ -298,5 +298,5 @@ function MiningModal({ isOpen, onClose, userDetails, onSuccess }) {
298
298
  const ci = COIN_INFO[stablecoin];
299
299
  const OrderSummary = () => ((0, jsx_runtime_1.jsxs)("div", { className: "p-3 rounded bg-neutral-800 border border-neutral-700 space-y-2 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: t("mintQuantity") }), (0, jsx_runtime_1.jsxs)("span", { className: "text-white font-bold font-mono", children: [(miningRequest.mcc_amount / 1000000000).toLocaleString(), " MCC"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: t("payAmount") }), (0, jsx_runtime_1.jsxs)("span", { className: "text-cyan-400 font-bold font-mono", children: [paymentAmount, " ", ci.symbol] })] })] }));
300
300
  const TxLink = ({ sig, label }) => ((0, jsx_runtime_1.jsxs)("a", { href: `https://solscan.io/tx/${sig}`, target: "_blank", rel: "noopener noreferrer", className: "inline-flex items-center gap-1 text-xs text-cyan-400 hover:underline", children: [label || `${sig.slice(0, 16)}...${sig.slice(-16)}`, " ", (0, jsx_runtime_1.jsx)(lucide_react_1.ExternalLink, { className: "w-3 h-3" })] }));
301
- return ((0, jsx_runtime_1.jsx)("div", { className: "fixed inset-0 z-50 flex items-end 2xs:items-center justify-center bg-black/50 backdrop-blur-sm font-mono", children: (0, jsx_runtime_1.jsx)("div", { className: "relative w-full max-w-2xl mx-0 2xs:mx-3 xs:mx-4 max-h-[95vh] 2xs:max-h-[90vh] overflow-y-auto rounded-t-2xl 2xs:rounded-xl", children: (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { filename: "mining_request.json", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-4 2xs:mb-5 xs:mb-6", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-base 2xs:text-lg xs:text-xl font-bold text-white mb-1", children: t("title") }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs text-neutral-400 tracking-wider", children: t("subtitle") })] }), (0, jsx_runtime_1.jsx)("button", { onClick: handleClose, disabled: loading, className: "text-neutral-400 hover:text-white transition-colors p-1 min-w-[44px] min-h-[44px] flex items-center justify-center", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "w-5 h-5" }) })] }), step === "input" && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [ratioInfo && ((0, jsx_runtime_1.jsx)("div", { className: "p-3 rounded bg-neutral-800 border border-neutral-700", children: (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-3 gap-4 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("currentPhase") }), (0, jsx_runtime_1.jsxs)("div", { className: "text-white font-bold font-mono", children: ["Phase ", ratioInfo.current_stage] })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1 flex items-center gap-1", children: [t("techBonus"), (0, jsx_runtime_1.jsx)("span", { className: "cursor-help text-neutral-500 hover:text-cyan-400", title: t("techBonusTooltip"), children: "?" })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-cyan-400 font-bold font-mono", children: "0%" })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("mintPrice") }), (0, jsx_runtime_1.jsxs)("div", { className: "text-cyan-400 font-bold font-mono", children: ["1 MCC \u2248 ", (ratioInfo.usdc_per_mcc * 4).toFixed(2), " USD"] })] })] }) })), (0, jsx_runtime_1.jsx)("div", { className: "p-4 rounded bg-cyan-400/20 border border-cyan-400/50", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-3", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-5 h-5 text-cyan-400 flex-shrink-0 mt-0.5" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-cyan-400 font-bold text-sm mb-1", children: t("solanaOnly") }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-300 text-xs leading-relaxed", children: t("solanaOnlyDescMining") })] })] }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("label", { className: "block text-xs text-neutral-400 tracking-wider mb-2", children: [t("paymentMethod"), " ", (0, jsx_runtime_1.jsxs)("span", { className: "text-cyan-400", children: ["(", t("paymentMethodHint"), ")"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [(0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: () => setShowStablecoinDropdown(!showStablecoinDropdown), className: "w-full px-4 py-3 bg-neutral-800 border border-neutral-600 rounded text-white flex items-center justify-between hover:border-neutral-500 transition-colors", children: [(0, jsx_runtime_1.jsxs)("span", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { children: ci.icon }), (0, jsx_runtime_1.jsx)("span", { children: ci.symbol }), (0, jsx_runtime_1.jsxs)("span", { className: "text-neutral-400 text-sm", children: ["(", ci.name, ")"] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: `w-4 h-4 transition-transform ${showStablecoinDropdown ? 'rotate-180' : ''}` })] }), showStablecoinDropdown && ((0, jsx_runtime_1.jsx)("div", { className: "absolute z-10 w-full mt-1 bg-neutral-900 border border-neutral-700 rounded shadow-lg", children: Object.keys(COIN_INFO).map(type => ((0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: () => { setStablecoin(type); setShowStablecoinDropdown(false); }, className: `w-full px-4 py-3 text-left flex items-center gap-2 hover:bg-neutral-800 transition-colors ${stablecoin === type ? 'bg-neutral-800 text-cyan-400' : 'text-white'}`, children: [(0, jsx_runtime_1.jsx)("span", { children: COIN_INFO[type].icon }), (0, jsx_runtime_1.jsx)("span", { children: COIN_INFO[type].symbol }), (0, jsx_runtime_1.jsxs)("span", { className: "text-neutral-400 text-sm", children: ["(", COIN_INFO[type].name, ")"] })] }, type))) }))] }), connected && ((0, jsx_runtime_1.jsxs)("div", { className: "mt-2 flex items-center justify-between text-xs", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: t("stablecoinEqual") }), (0, jsx_runtime_1.jsx)("span", { className: `font-medium ${stablecoinBalance === null ? 'text-neutral-400' : stablecoinBalance === 0 ? 'text-red-400' : 'text-white'}`, children: loadingBalance ? t("loading") : stablecoinBalance === null ? t("balanceUnknown") : t("balance", { amount: stablecoinBalance.toFixed(2), symbol: ci.symbol }) })] }))] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "block text-xs text-neutral-400 tracking-wider mb-2", children: t("mintAmountLabel", { symbol: "MCC" }) }), (0, jsx_runtime_1.jsx)("input", { type: "number", inputMode: "decimal", value: mccAmount, onChange: e => setMccAmount(e.target.value), placeholder: t("inputPlaceholder", { symbol: "MCC" }), className: "w-full px-3 2xs:px-4 py-3 bg-neutral-800 border border-neutral-600 rounded text-white placeholder-neutral-400 focus:outline-none focus:border-cyan-400 text-base", min: "0", step: "0.01" })] }), mccAmount && parseFloat(mccAmount) > 0 && ratioInfo && ((0, jsx_runtime_1.jsxs)("div", { className: "p-4 rounded bg-cyan-400/20 border border-cyan-400/50 space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-2", children: t("estimatedPayment") }), (0, jsx_runtime_1.jsxs)("div", { className: "text-2xl font-bold text-cyan-400 font-mono", children: [(parseFloat(mccAmount) * ratioInfo.usdc_per_mcc * 4).toFixed(2), " ", ci.symbol] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "pt-3 border-t border-cyan-400/30", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-400 tracking-wider", children: t("youWillReceive") }), (0, jsx_runtime_1.jsxs)("span", { className: "text-lg font-bold text-white font-mono", children: [parseFloat(mccAmount).toFixed(4), " MCC"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 mt-1", children: t("mccToWallet") })] })] })), error && (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 p-3 rounded bg-red-500/20 border border-red-500/50 text-red-500 text-sm", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-4 h-4" }), error] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-3", children: [(0, jsx_runtime_1.jsx)("button", { onClick: handleClose, className: "flex-1 px-4 py-3 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent rounded transition-colors", children: t("cancel") }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleSubmit, disabled: loading || !mccAmount || parseFloat(mccAmount) <= 0, className: "flex-1 px-4 py-3 bg-cyan-700 hover:bg-cyan-600 text-white rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2", children: [loading && (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-4 h-4 animate-spin" }), loading ? t("processing") : t("confirmMint")] })] })] })), step === "paymentMethod" && miningRequest && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)(OrderSummary, {}), (0, jsx_runtime_1.jsx)("div", { className: "p-3 rounded bg-cyan-500/10 border border-cyan-500/30 text-xs text-cyan-300", children: t("stablecoinReminder", { symbol: ci.symbol }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider uppercase mb-1", children: t("selectPaymentMethod") }), (0, jsx_runtime_1.jsx)("button", { onClick: handleSelectQrPayment, className: "w-full p-4 rounded border-2 border-cyan-400/50 bg-cyan-400/5 hover:bg-cyan-400/10 hover:border-cyan-400/70 transition-all text-left group", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-12 h-12 rounded-lg bg-cyan-400/20 flex items-center justify-center flex-shrink-0", children: (0, jsx_runtime_1.jsx)(lucide_react_1.QrCode, { className: "w-6 h-6 text-cyan-400" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-white font-bold text-sm", children: t("mobileQrScan") }), (0, jsx_runtime_1.jsx)("span", { className: "px-1.5 py-0.5 rounded text-[10px] font-bold bg-cyan-400/20 text-cyan-400 tracking-wider", children: t("recommended") })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 text-xs mt-1 leading-relaxed", children: t("mobileQrDesc") })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.Smartphone, { className: "w-5 h-5 text-neutral-500 group-hover:text-cyan-400 transition-colors flex-shrink-0" })] }) }), (0, jsx_runtime_1.jsx)("button", { onClick: handleSelectBrowserPayment, disabled: !connected, className: "w-full p-4 rounded border border-neutral-700 bg-neutral-800/50 hover:bg-neutral-800 hover:border-neutral-600 transition-all text-left group disabled:opacity-40 disabled:cursor-not-allowed", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-12 h-12 rounded-lg bg-neutral-700/50 flex items-center justify-center flex-shrink-0", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Monitor, { className: "w-6 h-6 text-neutral-400" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-300 font-bold text-sm", children: t("browserExtension") }) }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 text-xs mt-1 leading-relaxed", children: connected ? t("browserExtConnected") : t("browserExtNotConnected") })] })] }) }), error && (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 p-3 rounded bg-red-500/20 border border-red-500/50 text-red-500 text-sm", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-4 h-4" }), error] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => { setStep("input"); setError(""); }, className: "w-full px-4 py-2 text-neutral-400 hover:text-neutral-300 text-sm transition-colors", children: ["\u2190 ", t("goBack")] })] })), step === "qrPayment" && miningRequest && solanaPayUrl && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-3 2xs:space-y-4", children: [(0, jsx_runtime_1.jsx)(terminal_1.TerminalBadge, { variant: "info", children: t("waitingQrPayment") }), (0, jsx_runtime_1.jsx)(OrderSummary, {}), (0, jsx_runtime_1.jsxs)("div", { className: "p-2 2xs:p-3 rounded bg-amber-500/10 border border-amber-500/30", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-xs 2xs:text-sm", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Shield, { className: "w-4 h-4 text-amber-400 flex-shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-amber-400 font-bold", children: t("confirmPayWithSymbol", { symbol: ci.symbol }) })] }), (0, jsx_runtime_1.jsxs)("p", { className: "text-neutral-400 text-[10px] 2xs:text-xs mt-1 ml-6", children: [t("insufficientBalance", { symbol: ci.symbol }), (0, jsx_runtime_1.jsx)("button", { onClick: () => { monitorAbortRef.current = true; setStep("input"); setQrMonitoring(false); }, className: "text-cyan-400 hover:underline ml-1", children: t("switchToken") })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center space-y-3 2xs:space-y-4", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 text-xs 2xs:text-sm text-center", children: t("scanQrToPayDesktop") }), (0, jsx_runtime_1.jsx)("div", { className: "bg-white p-3 2xs:p-4 xs:p-5 rounded-xl", children: (0, jsx_runtime_1.jsx)(qrcode_react_1.QRCodeSVG, { value: solanaPayUrl, size: 200, level: "H", includeMargin: false, className: "w-[160px] h-[160px] 2xs:w-[180px] 2xs:h-[180px] xs:w-[220px] xs:h-[220px] sm:w-[280px] sm:h-[280px]", imageSettings: { src: "/mcc-logo-40.png", x: undefined, y: undefined, height: 40, width: 40, excavate: true } }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-[10px] 2xs:text-xs", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-3 h-3 animate-spin" }), t("waitingQrScan")] })] }), qrMonitoring && (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center gap-2 text-cyan-400 text-xs 2xs:text-sm py-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-4 h-4 animate-spin" }), t("monitoringOnchain")] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => { monitorAbortRef.current = true; setStep(isMobile ? "input" : "paymentMethod"); setQrMonitoring(false); setError(""); }, className: "w-full px-4 py-2 text-neutral-400 hover:text-neutral-300 text-xs 2xs:text-sm transition-colors min-h-[44px]", children: ["\u2190 ", t("goBack")] })] })), step === "payment" && miningRequest && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)(terminal_1.TerminalBadge, { variant: "info", children: t("waitingPayment") }), (0, jsx_runtime_1.jsx)(OrderSummary, {}), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-8 h-8 animate-spin text-cyan-400" }) }), (0, jsx_runtime_1.jsx)("p", { className: "text-center text-neutral-400 text-sm", children: t("processingTransfer", { symbol: ci.symbol }) })] })), step === "confirming" && txSignature && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)(terminal_1.TerminalBadge, { variant: "warning", children: t("verifying") }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-8 h-8 animate-spin text-cyan-400" }) }), (0, jsx_runtime_1.jsx)("p", { className: "text-center text-neutral-400 text-sm mb-2", children: t("verifyingTransaction") }), (0, jsx_runtime_1.jsxs)("div", { className: "p-3 rounded bg-neutral-800 border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("txSignature") }), (0, jsx_runtime_1.jsxs)("div", { className: "font-mono text-xs text-cyan-400 break-all", children: [txSignature.slice(0, 16), "...", txSignature.slice(-16)] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-2", children: (0, jsx_runtime_1.jsx)(TxLink, { sig: txSignature, label: t("viewOnExplorer") }) })] })] })), step === "success" && confirmationResult && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)("div", { className: "w-16 h-16 rounded-full bg-white/10 flex items-center justify-center", children: (0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "w-8 h-8 text-white" }) }) }), (0, jsx_runtime_1.jsx)("h3", { className: "text-xl font-bold text-center text-white", children: t("mintSuccess") }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 rounded bg-white/10 border border-neutral-700 space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("youReceived") }), (0, jsx_runtime_1.jsxs)("div", { className: "text-3xl font-bold text-white font-mono", children: ["+", (confirmationResult.mcc_distributed.user / 1000000000).toLocaleString(), " MCC"] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 mt-1", children: t("sentToWallet") })] }), (0, jsx_runtime_1.jsxs)("div", { className: "pt-3 border-t border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("paymentTx", { symbol: ci.symbol }) }), (0, jsx_runtime_1.jsx)(TxLink, { sig: txSignature })] })] }), confirmationResult.onchain_tx_signature && ((0, jsx_runtime_1.jsxs)("div", { className: "p-4 rounded bg-neutral-800 border border-neutral-700 space-y-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider", children: t("onchainDistribution") }), (0, jsx_runtime_1.jsx)(TxLink, { sig: confirmationResult.onchain_tx_signature })] })), (0, jsx_runtime_1.jsx)("div", { className: "flex gap-3", children: (0, jsx_runtime_1.jsx)("button", { onClick: handleClose, className: "flex-1 px-4 py-3 bg-cyan-700 hover:bg-cyan-600 text-white rounded transition-colors", children: t("doneAndRefresh") }) })] })), step === "error" && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)("div", { className: "w-16 h-16 rounded-full bg-red-500/20 flex items-center justify-center", children: (0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-8 h-8 text-red-500" }) }) }), (0, jsx_runtime_1.jsx)("h3", { className: "text-xl font-bold text-center text-red-500", children: t("mintFailed") }), (0, jsx_runtime_1.jsx)("div", { className: "p-4 rounded bg-red-500/20 border border-red-500/50", children: (0, jsx_runtime_1.jsx)("p", { className: "text-red-500 text-sm whitespace-pre-line", children: error }) }), (0, jsx_runtime_1.jsx)("button", { onClick: () => { setStep("input"); setError(""); }, className: "w-full px-4 py-3 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent rounded transition-colors", children: t("back") })] }))] }) }) }));
301
+ return ((0, jsx_runtime_1.jsx)("div", { className: "fixed inset-0 z-50 flex items-end 2xs:items-center justify-center bg-black/50 backdrop-blur-sm font-mono", children: (0, jsx_runtime_1.jsx)("div", { className: "relative w-full max-w-2xl mx-0 2xs:mx-3 xs:mx-4 max-h-[95vh] 2xs:max-h-[90vh] overflow-y-auto rounded-t-2xl 2xs:rounded-xl", children: (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { filename: "mining_request.json", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-4 2xs:mb-5 xs:mb-6", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-base 2xs:text-lg xs:text-xl font-bold text-white mb-1", children: t("title") }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs text-neutral-400 tracking-wider", children: t("subtitle") })] }), (0, jsx_runtime_1.jsx)("button", { onClick: handleClose, disabled: loading, className: "text-neutral-400 hover:text-white transition-colors p-1 min-w-[44px] min-h-[44px] flex items-center justify-center", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "w-5 h-5" }) })] }), step === "input" && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [ratioInfo && ((0, jsx_runtime_1.jsx)("div", { className: "p-3 rounded bg-neutral-800 border border-neutral-700", children: (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-3 gap-4 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("currentPhase") }), (0, jsx_runtime_1.jsxs)("div", { className: "text-white font-bold font-mono", children: ["Phase ", ratioInfo.current_stage] })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1 flex items-center gap-1", children: [t("techBonus"), (0, jsx_runtime_1.jsx)("span", { className: "cursor-help text-neutral-500 hover:text-cyan-400", title: t("techBonusTooltip"), children: "?" })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-cyan-400 font-bold font-mono", children: "0%" })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("mintPrice") }), (0, jsx_runtime_1.jsxs)("div", { className: "text-cyan-400 font-bold font-mono", children: ["1 MCC \u2248 ", (ratioInfo.usdc_per_mcc * 4).toFixed(2), " USD"] })] })] }) })), (0, jsx_runtime_1.jsx)("div", { className: "p-4 rounded bg-cyan-400/20 border border-cyan-400/50", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-3", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-5 h-5 text-cyan-400 flex-shrink-0 mt-0.5" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-cyan-400 font-bold text-sm mb-1", children: t("solanaOnly") }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-300 text-xs leading-relaxed", children: t("solanaOnlyDescMining") })] })] }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("label", { className: "block text-xs text-neutral-400 tracking-wider mb-2", children: [t("paymentMethod"), " ", (0, jsx_runtime_1.jsxs)("span", { className: "text-cyan-400", children: ["(", t("paymentMethodHint"), ")"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [(0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: () => setShowStablecoinDropdown(!showStablecoinDropdown), className: "w-full px-4 py-3 bg-neutral-800 border border-neutral-600 rounded text-white flex items-center justify-between hover:border-neutral-500 transition-colors", children: [(0, jsx_runtime_1.jsxs)("span", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { children: ci.icon }), (0, jsx_runtime_1.jsx)("span", { children: ci.symbol }), (0, jsx_runtime_1.jsxs)("span", { className: "text-neutral-400 text-sm", children: ["(", ci.name, ")"] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: `w-4 h-4 transition-transform ${showStablecoinDropdown ? 'rotate-180' : ''}` })] }), showStablecoinDropdown && ((0, jsx_runtime_1.jsx)("div", { className: "absolute z-10 w-full mt-1 bg-neutral-900 border border-neutral-700 rounded shadow-lg", children: Object.keys(COIN_INFO).map(type => ((0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: () => { setStablecoin(type); setShowStablecoinDropdown(false); }, className: `w-full px-4 py-3 text-left flex items-center gap-2 hover:bg-neutral-800 transition-colors ${stablecoin === type ? 'bg-neutral-800 text-cyan-400' : 'text-white'}`, children: [(0, jsx_runtime_1.jsx)("span", { children: COIN_INFO[type].icon }), (0, jsx_runtime_1.jsx)("span", { children: COIN_INFO[type].symbol }), (0, jsx_runtime_1.jsxs)("span", { className: "text-neutral-400 text-sm", children: ["(", COIN_INFO[type].name, ")"] })] }, type))) }))] }), connected && ((0, jsx_runtime_1.jsxs)("div", { className: "mt-2 flex items-center justify-between text-xs", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: t("stablecoinEqual") }), (0, jsx_runtime_1.jsx)("span", { className: `font-medium ${stablecoinBalance === null ? 'text-neutral-400' : stablecoinBalance === 0 ? 'text-red-400' : 'text-white'}`, children: loadingBalance ? t("loading") : stablecoinBalance === null ? t("balanceUnknown") : t("balance", { amount: stablecoinBalance.toFixed(2), symbol: ci.symbol }) })] }))] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "block text-xs text-neutral-400 tracking-wider mb-2", children: t("mintAmountLabel", { symbol: "MCC" }) }), (0, jsx_runtime_1.jsx)("input", { type: "number", inputMode: "decimal", value: mccAmount, onChange: e => setMccAmount(e.target.value), placeholder: t("inputPlaceholder", { symbol: "MCC" }), className: "w-full px-3 2xs:px-4 py-3 bg-neutral-800 border border-neutral-600 rounded text-white placeholder-neutral-400 focus:outline-none focus:border-cyan-400 text-base", min: "0", step: "0.01" })] }), mccAmount && parseFloat(mccAmount) > 0 && ratioInfo && ((0, jsx_runtime_1.jsxs)("div", { className: "p-4 rounded bg-cyan-400/20 border border-cyan-400/50 space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-2", children: t("estimatedPayment") }), (0, jsx_runtime_1.jsxs)("div", { className: "text-2xl font-bold text-cyan-400 font-mono", children: [(parseFloat(mccAmount) * ratioInfo.usdc_per_mcc * 4).toFixed(2), " ", ci.symbol] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "pt-3 border-t border-cyan-400/30", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-400 tracking-wider", children: t("youWillReceive") }), (0, jsx_runtime_1.jsxs)("span", { className: "text-lg font-bold text-white font-mono", children: [parseFloat(mccAmount).toFixed(4), " MCC"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 mt-1", children: t("mccToWallet") })] })] })), error && (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 p-3 rounded bg-red-500/20 border border-red-500/50 text-red-500 text-sm", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-4 h-4" }), error] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-3", children: [(0, jsx_runtime_1.jsx)("button", { onClick: handleClose, className: "flex-1 px-4 py-3 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent rounded transition-colors", children: t("cancel") }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleSubmit, disabled: loading || !mccAmount || parseFloat(mccAmount) <= 0, className: "flex-1 px-4 py-3 bg-cyan-700 hover:bg-cyan-600 text-white rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2", children: [loading && (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-4 h-4 animate-spin" }), loading ? t("processing") : t("confirmMint")] })] })] })), step === "paymentMethod" && miningRequest && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)(OrderSummary, {}), (0, jsx_runtime_1.jsx)("div", { className: "p-3 rounded bg-cyan-500/10 border border-cyan-500/30 text-xs text-cyan-300", children: t("stablecoinReminder", { symbol: ci.symbol }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider uppercase mb-1", children: t("selectPaymentMethod") }), (0, jsx_runtime_1.jsx)("button", { onClick: handleSelectQrPayment, className: "w-full p-4 rounded border border-neutral-700 bg-neutral-800/30 hover:bg-cyan-400/10 hover:border-cyan-400/70 focus:bg-cyan-400/10 focus:border-cyan-400 focus:outline-none transition-all text-left group", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-12 h-12 rounded-lg bg-neutral-700/50 group-hover:bg-cyan-400/20 group-focus:bg-cyan-400/20 transition-colors flex items-center justify-center flex-shrink-0", children: (0, jsx_runtime_1.jsx)(lucide_react_1.QrCode, { className: "w-6 h-6 text-neutral-400 group-hover:text-cyan-400 group-focus:text-cyan-400 transition-colors" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-300 group-hover:text-white group-focus:text-white font-bold text-sm transition-colors", children: t("mobileQrScan") }), (0, jsx_runtime_1.jsx)("span", { className: "px-1.5 py-0.5 rounded text-[10px] font-bold bg-cyan-400/20 text-cyan-400 tracking-wider", children: t("recommended") })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 group-hover:text-neutral-400 group-focus:text-neutral-400 text-xs mt-1 leading-relaxed transition-colors", children: t("mobileQrDesc") })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.Smartphone, { className: "w-5 h-5 text-neutral-500 group-hover:text-cyan-400 group-focus:text-cyan-400 transition-colors flex-shrink-0" })] }) }), (0, jsx_runtime_1.jsx)("button", { onClick: handleSelectBrowserPayment, disabled: !connected, className: "w-full p-4 rounded border border-neutral-700 bg-neutral-800/30 hover:bg-cyan-400/10 hover:border-cyan-400/70 focus:bg-cyan-400/10 focus:border-cyan-400 focus:outline-none transition-all text-left group disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-neutral-800/30 disabled:hover:border-neutral-700", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-12 h-12 rounded-lg bg-neutral-700/50 group-hover:bg-cyan-400/20 group-focus:bg-cyan-400/20 transition-colors flex items-center justify-center flex-shrink-0", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Monitor, { className: "w-6 h-6 text-neutral-400 group-hover:text-cyan-400 group-focus:text-cyan-400 transition-colors" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-300 group-hover:text-white group-focus:text-white font-bold text-sm transition-colors", children: t("browserExtension") }) }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 group-hover:text-neutral-400 group-focus:text-neutral-400 text-xs mt-1 leading-relaxed transition-colors", children: connected ? t("browserExtConnected") : t("browserExtNotConnected") })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.Monitor, { className: "w-5 h-5 text-neutral-500 group-hover:text-cyan-400 group-focus:text-cyan-400 transition-colors flex-shrink-0" })] }) }), error && (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 p-3 rounded bg-red-500/20 border border-red-500/50 text-red-500 text-sm", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-4 h-4" }), error] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => { setStep("input"); setError(""); }, className: "w-full px-4 py-2 text-neutral-400 hover:text-neutral-300 text-sm transition-colors", children: ["\u2190 ", t("goBack")] })] })), step === "qrPayment" && miningRequest && solanaPayUrl && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-3 2xs:space-y-4", children: [(0, jsx_runtime_1.jsx)(terminal_1.TerminalBadge, { variant: "info", children: t("waitingQrPayment") }), (0, jsx_runtime_1.jsx)(OrderSummary, {}), (0, jsx_runtime_1.jsxs)("div", { className: "p-2 2xs:p-3 rounded bg-amber-500/10 border border-amber-500/30", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-xs 2xs:text-sm", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Shield, { className: "w-4 h-4 text-amber-400 flex-shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-amber-400 font-bold", children: t("confirmPayWithSymbol", { symbol: ci.symbol }) })] }), (0, jsx_runtime_1.jsxs)("p", { className: "text-neutral-400 text-[10px] 2xs:text-xs mt-1 ml-6", children: [t("insufficientBalance", { symbol: ci.symbol }), (0, jsx_runtime_1.jsx)("button", { onClick: () => { monitorAbortRef.current = true; setStep("input"); setQrMonitoring(false); }, className: "text-cyan-400 hover:underline ml-1", children: t("switchToken") })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center space-y-3 2xs:space-y-4", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 text-xs 2xs:text-sm text-center", children: t("scanQrToPayDesktop") }), (0, jsx_runtime_1.jsx)("div", { className: "bg-white p-3 2xs:p-4 xs:p-5 rounded-xl", children: (0, jsx_runtime_1.jsx)(qrcode_react_1.QRCodeSVG, { value: solanaPayUrl, size: 200, level: "H", includeMargin: false, className: "w-[160px] h-[160px] 2xs:w-[180px] 2xs:h-[180px] xs:w-[220px] xs:h-[220px] sm:w-[280px] sm:h-[280px]", imageSettings: { src: "/mcc-logo-40.png", x: undefined, y: undefined, height: 40, width: 40, excavate: true } }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-[10px] 2xs:text-xs", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-3 h-3 animate-spin" }), t("waitingQrScan")] })] }), qrMonitoring && (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center gap-2 text-cyan-400 text-xs 2xs:text-sm py-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-4 h-4 animate-spin" }), t("monitoringOnchain")] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => { monitorAbortRef.current = true; setStep(isMobile ? "input" : "paymentMethod"); setQrMonitoring(false); setError(""); }, className: "w-full px-4 py-2 text-neutral-400 hover:text-neutral-300 text-xs 2xs:text-sm transition-colors min-h-[44px]", children: ["\u2190 ", t("goBack")] })] })), step === "payment" && miningRequest && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)(terminal_1.TerminalBadge, { variant: "info", children: t("waitingPayment") }), (0, jsx_runtime_1.jsx)(OrderSummary, {}), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-8 h-8 animate-spin text-cyan-400" }) }), (0, jsx_runtime_1.jsx)("p", { className: "text-center text-neutral-400 text-sm", children: t("processingTransfer", { symbol: ci.symbol }) })] })), step === "confirming" && txSignature && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)(terminal_1.TerminalBadge, { variant: "warning", children: t("verifying") }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-8 h-8 animate-spin text-cyan-400" }) }), (0, jsx_runtime_1.jsx)("p", { className: "text-center text-neutral-400 text-sm mb-2", children: t("verifyingTransaction") }), (0, jsx_runtime_1.jsxs)("div", { className: "p-3 rounded bg-neutral-800 border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("txSignature") }), (0, jsx_runtime_1.jsxs)("div", { className: "font-mono text-xs text-cyan-400 break-all", children: [txSignature.slice(0, 16), "...", txSignature.slice(-16)] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-2", children: (0, jsx_runtime_1.jsx)(TxLink, { sig: txSignature, label: t("viewOnExplorer") }) })] })] })), step === "success" && confirmationResult && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)("div", { className: "w-16 h-16 rounded-full bg-white/10 flex items-center justify-center", children: (0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "w-8 h-8 text-white" }) }) }), (0, jsx_runtime_1.jsx)("h3", { className: "text-xl font-bold text-center text-white", children: t("mintSuccess") }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 rounded bg-white/10 border border-neutral-700 space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("youReceived") }), (0, jsx_runtime_1.jsxs)("div", { className: "text-3xl font-bold text-white font-mono", children: ["+", (confirmationResult.mcc_distributed.user / 1000000000).toLocaleString(), " MCC"] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 mt-1", children: t("sentToWallet") })] }), (0, jsx_runtime_1.jsxs)("div", { className: "pt-3 border-t border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("paymentTx", { symbol: ci.symbol }) }), (0, jsx_runtime_1.jsx)(TxLink, { sig: txSignature })] })] }), confirmationResult.onchain_tx_signature && ((0, jsx_runtime_1.jsxs)("div", { className: "p-4 rounded bg-neutral-800 border border-neutral-700 space-y-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider", children: t("onchainDistribution") }), (0, jsx_runtime_1.jsx)(TxLink, { sig: confirmationResult.onchain_tx_signature })] })), (0, jsx_runtime_1.jsx)("div", { className: "flex gap-3", children: (0, jsx_runtime_1.jsx)("button", { onClick: handleClose, className: "flex-1 px-4 py-3 bg-cyan-700 hover:bg-cyan-600 text-white rounded transition-colors", children: t("doneAndRefresh") }) })] })), step === "error" && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)("div", { className: "w-16 h-16 rounded-full bg-red-500/20 flex items-center justify-center", children: (0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-8 h-8 text-red-500" }) }) }), (0, jsx_runtime_1.jsx)("h3", { className: "text-xl font-bold text-center text-red-500", children: t("mintFailed") }), (0, jsx_runtime_1.jsx)("div", { className: "p-4 rounded bg-red-500/20 border border-red-500/50", children: (0, jsx_runtime_1.jsx)("p", { className: "text-red-500 text-sm whitespace-pre-line", children: error }) }), (0, jsx_runtime_1.jsx)("button", { onClick: () => { setStep("input"); setError(""); }, className: "w-full px-4 py-3 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent rounded transition-colors", children: t("back") })] }))] }) }) }));
302
302
  }
@@ -116,8 +116,8 @@ function ProfilePage() {
116
116
  setLevelLoading(false);
117
117
  }
118
118
  };
119
- const getRoleLabel = (role) => role === "admin" || role === "platform_admin" ? t('platformAdmin') : role === "team_member" ? t('teamMember') : t('normalUser');
120
- const getRoleBadgeVariant = (role) => role === "admin" || role === "platform_admin" ? "default" : role === "team_member" ? "secondary" : "outline";
119
+ const getRoleLabel = (role) => role === "team_member" ? t('teamMember') : t('normalUser');
120
+ const getRoleBadgeVariant = (role) => role === "team_member" ? "secondary" : "outline";
121
121
  const formatDate = (dateStr) => { if (!dateStr)
122
122
  return "-"; try {
123
123
  return new Date(dateStr).toLocaleDateString("zh-CN", { year: "numeric", month: "long", day: "numeric" });
@@ -10,7 +10,7 @@ const wallet_adapter_react_ui_1 = require("@solana/wallet-adapter-react-ui");
10
10
  require("@solana/wallet-adapter-react-ui/styles.css");
11
11
  function SolanaWalletProvider({ children }) {
12
12
  const endpoint = (0, react_1.useMemo)(() => {
13
- return process.env.NEXT_PUBLIC_SOLANA_RPC_URL || '';
13
+ return process.env.NEXT_PUBLIC_HELIUS_RPC_URL || process.env.NEXT_PUBLIC_SOLANA_RPC_URL || 'https://api.mainnet-beta.solana.com';
14
14
  }, []);
15
15
  const wallets = (0, react_1.useMemo)(() => [], []);
16
16
  return ((0, jsx_runtime_1.jsx)(wallet_adapter_react_1.ConnectionProvider, { endpoint: endpoint, children: (0, jsx_runtime_1.jsx)(wallet_adapter_react_1.WalletProvider, { wallets: wallets, autoConnect: true, children: (0, jsx_runtime_1.jsx)(wallet_adapter_react_ui_1.WalletModalProvider, { children: children }) }) }));
@@ -19,21 +19,16 @@ const lucide_react_1 = require("lucide-react");
19
19
  const next_intl_1 = require("next-intl");
20
20
  function QueueStatusPage() {
21
21
  const t = (0, next_intl_1.useTranslations)('queueStatus');
22
- const { isAdmin, user } = (0, useAuth_1.useAuth)();
22
+ const { user } = (0, useAuth_1.useAuth)();
23
23
  const [userQueue, setUserQueue] = (0, react_1.useState)(null);
24
- const [adminQueue, setAdminQueue] = (0, react_1.useState)(null);
25
- const [expansionCheck, setExpansionCheck] = (0, react_1.useState)(null);
26
24
  const [loading, setLoading] = (0, react_1.useState)(true);
27
25
  const [refreshing, setRefreshing] = (0, react_1.useState)(false);
28
26
  const [submitting, setSubmitting] = (0, react_1.useState)(false);
29
27
  const [showJoinDialog, setShowJoinDialog] = (0, react_1.useState)(false);
30
28
  const [showLeaveDialog, setShowLeaveDialog] = (0, react_1.useState)(false);
31
29
  const [showCancelDialog, setShowCancelDialog] = (0, react_1.useState)(false);
32
- const [showProcessDialog, setShowProcessDialog] = (0, react_1.useState)(false);
33
- const [showExpansionDialog, setShowExpansionDialog] = (0, react_1.useState)(false);
34
30
  const [preferredStation, setPreferredStation] = (0, react_1.useState)('');
35
31
  const [leaveReason, setLeaveReason] = (0, react_1.useState)('');
36
- const [batchSize, setBatchSize] = (0, react_1.useState)(50);
37
32
  const USER_LEVEL_INFO = {
38
33
  miner: { label: t('miner'), labelEn: 'Miner', icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Gem, { className: "w-5 h-5" }), color: 'text-cyan-300', bgColor: 'bg-cyan-900/30' },
39
34
  commander: { label: t('commander'), labelEn: 'Commander', icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Star, { className: "w-5 h-5" }), color: 'text-cyan-300', bgColor: 'bg-cyan-900/30' },
@@ -61,26 +56,6 @@ function QueueStatusPage() {
61
56
  catch (e) {
62
57
  console.warn('[QueueStatus] Failed to fetch user queue status:', e);
63
58
  }
64
- if (isAdmin()) {
65
- try {
66
- const adminRes = await (0, api_service_1.getAdminQueueStatus)();
67
- if (adminRes.success) {
68
- setAdminQueue(adminRes);
69
- }
70
- }
71
- catch (e) {
72
- console.warn('[QueueStatus] Failed to fetch admin queue status:', e);
73
- }
74
- try {
75
- const expansionRes = await (0, api_service_1.checkExpansionNeeded)();
76
- if (expansionRes.success) {
77
- setExpansionCheck(expansionRes);
78
- }
79
- }
80
- catch (e) {
81
- console.warn('[QueueStatus] Failed to fetch expansion check:', e);
82
- }
83
- }
84
59
  }
85
60
  catch (error) {
86
61
  console.error('[QueueStatus] Failed to load data:', error);
@@ -178,46 +153,6 @@ function QueueStatusPage() {
178
153
  setSubmitting(false);
179
154
  }
180
155
  };
181
- const handleProcessQueue = async () => {
182
- try {
183
- setSubmitting(true);
184
- const result = await (0, api_service_1.processQueue)(batchSize);
185
- if (result.success) {
186
- sonner_1.toast.success(t('processComplete', { assigned: result.assigned, processed: result.processed }));
187
- setShowProcessDialog(false);
188
- loadData();
189
- }
190
- else {
191
- sonner_1.toast.error(t('processFailed'));
192
- }
193
- }
194
- catch (error) {
195
- sonner_1.toast.error(error instanceof Error ? error.message : t('processFailed'));
196
- }
197
- finally {
198
- setSubmitting(false);
199
- }
200
- };
201
- const handleTriggerExpansion = async () => {
202
- try {
203
- setSubmitting(true);
204
- const result = await (0, api_service_1.triggerExpansion)();
205
- if (result.success) {
206
- sonner_1.toast.success(result.message || t('expansionSuccess', { territory: result.new_territory_id ?? '' }));
207
- setShowExpansionDialog(false);
208
- loadData();
209
- }
210
- else {
211
- sonner_1.toast.error(result.error || t('expansionFailed'));
212
- }
213
- }
214
- catch (error) {
215
- sonner_1.toast.error(error instanceof Error ? error.message : t('expansionFailed'));
216
- }
217
- finally {
218
- setSubmitting(false);
219
- }
220
- };
221
156
  const getQueueStatusBadge = (status) => {
222
157
  switch (status) {
223
158
  case 'pending':
@@ -237,9 +172,5 @@ function QueueStatusPage() {
237
172
  return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto font-mono space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-3xl font-bold text-white", children: t('title') }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 mt-1", children: t('subtitle') })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { onClick: handleRefresh, disabled: refreshing, className: "bg-neutral-800 hover:bg-neutral-700 text-white", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: `w-4 h-4 mr-2 ${refreshing ? 'animate-spin' : ''}` }), t('refresh')] })] }), (0, jsx_runtime_1.jsxs)(card_1.Card, { className: "bg-black border-neutral-800 dash-card", children: [(0, jsx_runtime_1.jsxs)(card_1.CardHeader, { children: [(0, jsx_runtime_1.jsxs)(card_1.CardTitle, { className: "text-white flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Users, { className: "w-5 h-5" }), t('myStatus')] }), (0, jsx_runtime_1.jsx)(card_1.CardDescription, { className: "text-neutral-400", children: t('myStatusDesc') })] }), (0, jsx_runtime_1.jsx)(card_1.CardContent, { children: loading ? ((0, jsx_runtime_1.jsxs)("div", { className: "text-center py-8", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-8 h-8 animate-spin mx-auto text-neutral-400" }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 mt-2", children: t('loading') })] })) : ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(() => {
238
173
  const levelInfo = getUserLevelInfo(userQueue?.user_type);
239
174
  return ((0, jsx_runtime_1.jsx)("div", { className: `rounded-lg p-4 border border-neutral-800 ${levelInfo.bgColor}`, children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: `rounded-full p-2 ${levelInfo.color}`, children: levelInfo.icon }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('currentPosition') }), (0, jsx_runtime_1.jsxs)("p", { className: `text-lg font-semibold ${levelInfo.color}`, children: [levelInfo.label, (0, jsx_runtime_1.jsxs)("span", { className: "text-neutral-500 text-sm ml-2", children: ["(", levelInfo.labelEn, ")"] })] })] })] }), (0, jsx_runtime_1.jsxs)(badge_1.Badge, { className: `${levelInfo.bgColor} ${levelInfo.color} border-current`, children: ["Lv.", Object.keys(USER_LEVEL_INFO).indexOf(userQueue?.user_type?.toLowerCase() || 'miner') + 3] })] }) }));
240
- })(), userQueue?.is_onboarded ? ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-950 rounded-lg p-6 border border-neutral-700/50", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-cyan-400/10 rounded-full p-3", children: (0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "w-6 h-6 text-white" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-lg font-semibold text-white", children: t('onboarded') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('onboardedTo', { station: userQueue.station_name || userQueue.territory_id || '' }) })] })] }), (0, jsx_runtime_1.jsx)(badge_1.Badge, { className: "bg-white/20 text-white border-neutral-700", children: t('active') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 rounded-lg p-4 text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-xl font-bold text-white font-mono", children: userQueue.territory_id }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('territoryId') })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { onClick: () => setShowLeaveDialog(true), className: "bg-neutral-800 hover:bg-neutral-700 text-neutral-300 h-full", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.LogOut, { className: "w-4 h-4 mr-2" }), t('applyLeave')] })] })] })) : userQueue?.in_queue ? ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-950 rounded-lg p-6 border border-neutral-800", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-cyan-400/10 rounded-full p-3", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Timer, { className: "w-6 h-6 text-cyan-300" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-lg font-semibold text-white", children: t('inQueue') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('waitingAssignment') })] })] }), getQueueStatusBadge(userQueue.status)] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4 mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-3xl font-bold text-white font-mono", children: userQueue.position || '-' }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('currentPos') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-3xl font-bold text-white font-mono", children: userQueue.estimated_wait_minutes || '-' }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('estimatedWait') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-sm font-semibold text-white truncate", children: userQueue.preferred_territory_id || t('autoAssign') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('preferredTerritory') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-sm font-semibold text-white", children: userQueue.joined_at ? new Date(userQueue.joined_at).toLocaleString() : '-' }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('joinedAt') })] })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { onClick: () => setShowCancelDialog(true), className: "w-full bg-neutral-800 hover:bg-neutral-700 text-white", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.XCircle, { className: "w-4 h-4 mr-2" }), t('cancelQueue')] })] })) : ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-950 rounded-lg p-6 border border-neutral-800", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 mb-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-800 rounded-full p-3", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Building2, { className: "w-6 h-6 text-neutral-400" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-lg font-semibold text-white", children: t('notOnboarded') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('notOnboardedDesc') })] })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { onClick: () => setShowJoinDialog(true), className: "w-full bg-white/20 hover:bg-neutral-800 text-white border border-neutral-700", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.LogIn, { className: "w-4 h-4 mr-2" }), t('joinNow')] })] }))] })) })] }), isAdmin() && adminQueue && ((0, jsx_runtime_1.jsxs)(card_1.Card, { className: "bg-black border-neutral-800 dash-card", children: [(0, jsx_runtime_1.jsxs)(card_1.CardHeader, { children: [(0, jsx_runtime_1.jsxs)(card_1.CardTitle, { className: "text-white flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Clock, { className: "w-5 h-5" }), t('queueManagement')] }), (0, jsx_runtime_1.jsx)(card_1.CardDescription, { className: "text-neutral-400", children: t('queueManagementDesc') })] }), (0, jsx_runtime_1.jsxs)(card_1.CardContent, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4 mb-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-950 rounded-lg p-4 border border-neutral-800 text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-3xl font-bold text-white font-mono", children: adminQueue.pending_count }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('pending') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-950 rounded-lg p-4 border border-neutral-800 text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-3xl font-bold text-white font-mono", children: adminQueue.processing_count }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('processing') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-950 rounded-lg p-4 border border-neutral-800 text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-3xl font-bold text-white font-mono", children: adminQueue.total_in_queue }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('totalInQueue') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-950 rounded-lg p-4 border border-neutral-800 text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-sm font-semibold text-white", children: adminQueue.oldest_pending
241
- ? new Date(adminQueue.oldest_pending).toLocaleString()
242
- : '-' }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('oldestPending') })] })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { onClick: () => setShowProcessDialog(true), disabled: adminQueue.pending_count === 0, className: "w-full bg-cyan-900/50 hover:bg-cyan-900/70 text-cyan-300 border border-cyan-800", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Play, { className: "w-4 h-4 mr-2" }), t('processQueue')] })] })] })), isAdmin() && expansionCheck && ((0, jsx_runtime_1.jsxs)(card_1.Card, { className: "bg-black border-neutral-800 dash-card", children: [(0, jsx_runtime_1.jsxs)(card_1.CardHeader, { children: [(0, jsx_runtime_1.jsxs)(card_1.CardTitle, { className: "text-white flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Plus, { className: "w-5 h-5" }), t('expansionTitle')] }), (0, jsx_runtime_1.jsx)(card_1.CardDescription, { className: "text-neutral-400", children: t('expansionDesc') })] }), (0, jsx_runtime_1.jsxs)(card_1.CardContent, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4 mb-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-950 rounded-lg p-4 border border-neutral-800 text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-3xl font-bold text-white font-mono", children: expansionCheck.current_stats.total_stations }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('totalTerritories') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-950 rounded-lg p-4 border border-neutral-800 text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-3xl font-bold text-white font-mono", children: expansionCheck.current_stats.full_stations }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('fullTerritories') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-950 rounded-lg p-4 border border-neutral-800 text-center", children: [(0, jsx_runtime_1.jsxs)("p", { className: "text-3xl font-bold text-white font-mono", children: [(expansionCheck.current_stats.avg_occupancy * 100).toFixed(1), "%"] }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('avgOccupancy') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-950 rounded-lg p-4 border border-neutral-800 text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-3xl font-bold text-white font-mono", children: expansionCheck.current_stats.pending_queue }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('queueWaiting') })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between p-4 bg-neutral-950 rounded-lg border border-neutral-800 mb-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-3", children: expansionCheck.needs_expansion ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertTriangle, { className: "w-6 h-6 text-cyan-300" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("p", { className: "text-white font-semibold", children: t('needsExpansion') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: expansionCheck.reason })] })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "w-6 h-6 text-white" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("p", { className: "text-white font-semibold", children: t('capacitySufficient') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('noExpansionNeeded') })] })] })) }), (0, jsx_runtime_1.jsx)(badge_1.Badge, { className: expansionCheck.needs_expansion
243
- ? 'bg-cyan-400/20 text-cyan-300 border-cyan-400/30'
244
- : 'bg-white/20 text-white border-neutral-700', children: expansionCheck.needs_expansion ? t('suggestExpansion') : t('normal') })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { onClick: () => setShowExpansionDialog(true), className: "w-full bg-cyan-400/20 hover:bg-cyan-400/30 text-cyan-300 border border-cyan-400/30", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Plus, { className: "w-4 h-4 mr-2" }), t('triggerExpansion')] })] })] })), (0, jsx_runtime_1.jsx)(dialog_1.Dialog, { open: showJoinDialog, onOpenChange: setShowJoinDialog, children: (0, jsx_runtime_1.jsxs)(dialog_1.DialogContent, { className: "bg-neutral-900 border-neutral-800", children: [(0, jsx_runtime_1.jsxs)(dialog_1.DialogHeader, { children: [(0, jsx_runtime_1.jsx)(dialog_1.DialogTitle, { className: "text-white", children: t('joinDialogTitle') }), (0, jsx_runtime_1.jsx)(dialog_1.DialogDescription, { className: "text-neutral-400", children: t('joinDialogDesc') })] }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-4 py-4", children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(label_1.Label, { className: "text-neutral-300", children: t('preferredStationLabel') }), (0, jsx_runtime_1.jsx)(input_1.Input, { value: preferredStation, onChange: (e) => setPreferredStation(e.target.value), placeholder: t('preferredStationPlaceholder'), className: "bg-neutral-800 border-neutral-700 text-white mt-1" }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-500 mt-1", children: t('preferredStationHint') })] }) }), (0, jsx_runtime_1.jsxs)(dialog_1.DialogFooter, { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)(button_1.Button, { variant: "outline", onClick: () => setShowJoinDialog(false), disabled: submitting, className: "bg-neutral-800 hover:bg-neutral-700 text-white border-neutral-700", children: t('cancel') }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleJoinQueue, disabled: submitting, className: "bg-cyan-400/20 hover:bg-cyan-400/30 text-cyan-300 border border-cyan-400/30", children: submitting ? t('submitting') : t('joinQueue') }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleJoinStation, disabled: submitting, className: "bg-white/20 hover:bg-neutral-800 text-white border border-neutral-700", children: submitting ? t('submitting') : t('immediateJoin') })] })] }) }), (0, jsx_runtime_1.jsx)(dialog_1.Dialog, { open: showLeaveDialog, onOpenChange: setShowLeaveDialog, children: (0, jsx_runtime_1.jsxs)(dialog_1.DialogContent, { className: "bg-neutral-900 border-neutral-800", children: [(0, jsx_runtime_1.jsxs)(dialog_1.DialogHeader, { children: [(0, jsx_runtime_1.jsx)(dialog_1.DialogTitle, { className: "text-white", children: t('leaveDialogTitle') }), (0, jsx_runtime_1.jsx)(dialog_1.DialogDescription, { className: "text-neutral-400", children: t('leaveDialogDesc') })] }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-4 py-4", children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(label_1.Label, { className: "text-neutral-300", children: t('leaveReasonLabel') }), (0, jsx_runtime_1.jsx)(input_1.Input, { value: leaveReason, onChange: (e) => setLeaveReason(e.target.value), placeholder: t('leaveReasonPlaceholder'), className: "bg-neutral-800 border-neutral-700 text-white mt-1" })] }) }), (0, jsx_runtime_1.jsxs)(dialog_1.DialogFooter, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { variant: "outline", onClick: () => setShowLeaveDialog(false), disabled: submitting, className: "bg-neutral-800 hover:bg-neutral-700 text-white border-neutral-700", children: t('cancel') }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleLeaveStation, disabled: submitting, className: "bg-red-900/50 hover:bg-red-900/70 text-red-400 border border-red-800", children: submitting ? t('submitting') : t('confirmLeave') })] })] }) }), (0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialog, { open: showCancelDialog, onOpenChange: setShowCancelDialog, children: (0, jsx_runtime_1.jsxs)(alert_dialog_1.AlertDialogContent, { className: "bg-neutral-900 border-neutral-800", children: [(0, jsx_runtime_1.jsxs)(alert_dialog_1.AlertDialogHeader, { children: [(0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogTitle, { className: "text-white", children: t('cancelQueueTitle') }), (0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogDescription, { className: "text-neutral-400", children: t('cancelQueueDesc') })] }), (0, jsx_runtime_1.jsxs)(alert_dialog_1.AlertDialogFooter, { children: [(0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogCancel, { disabled: submitting, className: "bg-neutral-800 hover:bg-neutral-700 text-white border-neutral-700", children: t('goBack') }), (0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogAction, { onClick: handleCancelQueue, disabled: submitting, className: "bg-red-900/50 hover:bg-red-900/70 text-red-400 border border-red-800", children: submitting ? t('submitting') : t('confirmCancel') })] })] }) }), (0, jsx_runtime_1.jsx)(dialog_1.Dialog, { open: showProcessDialog, onOpenChange: setShowProcessDialog, children: (0, jsx_runtime_1.jsxs)(dialog_1.DialogContent, { className: "bg-neutral-900 border-neutral-800", children: [(0, jsx_runtime_1.jsxs)(dialog_1.DialogHeader, { children: [(0, jsx_runtime_1.jsx)(dialog_1.DialogTitle, { className: "text-white", children: t('processDialogTitle') }), (0, jsx_runtime_1.jsx)(dialog_1.DialogDescription, { className: "text-neutral-400", children: t('processDialogDesc') })] }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-4 py-4", children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(label_1.Label, { className: "text-neutral-300", children: t('batchSize') }), (0, jsx_runtime_1.jsx)(input_1.Input, { type: "number", value: batchSize, onChange: (e) => setBatchSize(parseInt(e.target.value) || 50), min: 1, max: 200, className: "bg-neutral-800 border-neutral-700 text-white mt-1" }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-500 mt-1", children: t('batchSizeHint') })] }) }), (0, jsx_runtime_1.jsxs)(dialog_1.DialogFooter, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { variant: "outline", onClick: () => setShowProcessDialog(false), disabled: submitting, className: "bg-neutral-800 hover:bg-neutral-700 text-white border-neutral-700", children: t('cancel') }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleProcessQueue, disabled: submitting, className: "bg-cyan-900/50 hover:bg-cyan-900/70 text-cyan-300 border border-cyan-800", children: submitting ? t('submitting') : t('startProcessing') })] })] }) }), (0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialog, { open: showExpansionDialog, onOpenChange: setShowExpansionDialog, children: (0, jsx_runtime_1.jsxs)(alert_dialog_1.AlertDialogContent, { className: "bg-neutral-900 border-neutral-800", children: [(0, jsx_runtime_1.jsxs)(alert_dialog_1.AlertDialogHeader, { children: [(0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogTitle, { className: "text-white", children: t('expansionDialogTitle') }), (0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogDescription, { className: "text-neutral-400", children: t('expansionDialogDesc') })] }), (0, jsx_runtime_1.jsxs)(alert_dialog_1.AlertDialogFooter, { children: [(0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogCancel, { disabled: submitting, className: "bg-neutral-800 hover:bg-neutral-700 text-white border-neutral-700", children: t('cancel') }), (0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogAction, { onClick: handleTriggerExpansion, disabled: submitting, className: "bg-cyan-400/20 hover:bg-cyan-400/30 text-cyan-300 border border-cyan-400/30", children: submitting ? t('submitting') : t('confirmExpansion') })] })] }) })] }));
175
+ })(), userQueue?.is_onboarded ? ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-950 rounded-lg p-6 border border-neutral-700/50", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-cyan-400/10 rounded-full p-3", children: (0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "w-6 h-6 text-white" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-lg font-semibold text-white", children: t('onboarded') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('onboardedTo', { station: userQueue.station_name || userQueue.territory_id || '' }) })] })] }), (0, jsx_runtime_1.jsx)(badge_1.Badge, { className: "bg-white/20 text-white border-neutral-700", children: t('active') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 rounded-lg p-4 text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-xl font-bold text-white font-mono", children: userQueue.territory_id }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('territoryId') })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { onClick: () => setShowLeaveDialog(true), className: "bg-neutral-800 hover:bg-neutral-700 text-neutral-300 h-full", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.LogOut, { className: "w-4 h-4 mr-2" }), t('applyLeave')] })] })] })) : userQueue?.in_queue ? ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-950 rounded-lg p-6 border border-neutral-800", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-cyan-400/10 rounded-full p-3", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Timer, { className: "w-6 h-6 text-cyan-300" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-lg font-semibold text-white", children: t('inQueue') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('waitingAssignment') })] })] }), getQueueStatusBadge(userQueue.status)] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4 mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-3xl font-bold text-white font-mono", children: userQueue.position || '-' }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('currentPos') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-3xl font-bold text-white font-mono", children: userQueue.estimated_wait_minutes || '-' }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('estimatedWait') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-sm font-semibold text-white truncate", children: userQueue.preferred_territory_id || t('autoAssign') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('preferredTerritory') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-sm font-semibold text-white", children: userQueue.joined_at ? new Date(userQueue.joined_at).toLocaleString() : '-' }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('joinedAt') })] })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { onClick: () => setShowCancelDialog(true), className: "w-full bg-neutral-800 hover:bg-neutral-700 text-white", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.XCircle, { className: "w-4 h-4 mr-2" }), t('cancelQueue')] })] })) : ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-950 rounded-lg p-6 border border-neutral-800", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 mb-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-800 rounded-full p-3", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Building2, { className: "w-6 h-6 text-neutral-400" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-lg font-semibold text-white", children: t('notOnboarded') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('notOnboardedDesc') })] })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { onClick: () => setShowJoinDialog(true), className: "w-full bg-white/20 hover:bg-neutral-800 text-white border border-neutral-700", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.LogIn, { className: "w-4 h-4 mr-2" }), t('joinNow')] })] }))] })) })] }), (0, jsx_runtime_1.jsx)(dialog_1.Dialog, { open: showJoinDialog, onOpenChange: setShowJoinDialog, children: (0, jsx_runtime_1.jsxs)(dialog_1.DialogContent, { className: "bg-neutral-900 border-neutral-800", children: [(0, jsx_runtime_1.jsxs)(dialog_1.DialogHeader, { children: [(0, jsx_runtime_1.jsx)(dialog_1.DialogTitle, { className: "text-white", children: t('joinDialogTitle') }), (0, jsx_runtime_1.jsx)(dialog_1.DialogDescription, { className: "text-neutral-400", children: t('joinDialogDesc') })] }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-4 py-4", children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(label_1.Label, { className: "text-neutral-300", children: t('preferredStationLabel') }), (0, jsx_runtime_1.jsx)(input_1.Input, { value: preferredStation, onChange: (e) => setPreferredStation(e.target.value), placeholder: t('preferredStationPlaceholder'), className: "bg-neutral-800 border-neutral-700 text-white mt-1" }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-500 mt-1", children: t('preferredStationHint') })] }) }), (0, jsx_runtime_1.jsxs)(dialog_1.DialogFooter, { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)(button_1.Button, { variant: "outline", onClick: () => setShowJoinDialog(false), disabled: submitting, className: "bg-neutral-800 hover:bg-neutral-700 text-white border-neutral-700", children: t('cancel') }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleJoinQueue, disabled: submitting, className: "bg-cyan-400/20 hover:bg-cyan-400/30 text-cyan-300 border border-cyan-400/30", children: submitting ? t('submitting') : t('joinQueue') }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleJoinStation, disabled: submitting, className: "bg-white/20 hover:bg-neutral-800 text-white border border-neutral-700", children: submitting ? t('submitting') : t('immediateJoin') })] })] }) }), (0, jsx_runtime_1.jsx)(dialog_1.Dialog, { open: showLeaveDialog, onOpenChange: setShowLeaveDialog, children: (0, jsx_runtime_1.jsxs)(dialog_1.DialogContent, { className: "bg-neutral-900 border-neutral-800", children: [(0, jsx_runtime_1.jsxs)(dialog_1.DialogHeader, { children: [(0, jsx_runtime_1.jsx)(dialog_1.DialogTitle, { className: "text-white", children: t('leaveDialogTitle') }), (0, jsx_runtime_1.jsx)(dialog_1.DialogDescription, { className: "text-neutral-400", children: t('leaveDialogDesc') })] }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-4 py-4", children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(label_1.Label, { className: "text-neutral-300", children: t('leaveReasonLabel') }), (0, jsx_runtime_1.jsx)(input_1.Input, { value: leaveReason, onChange: (e) => setLeaveReason(e.target.value), placeholder: t('leaveReasonPlaceholder'), className: "bg-neutral-800 border-neutral-700 text-white mt-1" })] }) }), (0, jsx_runtime_1.jsxs)(dialog_1.DialogFooter, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { variant: "outline", onClick: () => setShowLeaveDialog(false), disabled: submitting, className: "bg-neutral-800 hover:bg-neutral-700 text-white border-neutral-700", children: t('cancel') }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleLeaveStation, disabled: submitting, className: "bg-red-900/50 hover:bg-red-900/70 text-red-400 border border-red-800", children: submitting ? t('submitting') : t('confirmLeave') })] })] }) }), (0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialog, { open: showCancelDialog, onOpenChange: setShowCancelDialog, children: (0, jsx_runtime_1.jsxs)(alert_dialog_1.AlertDialogContent, { className: "bg-neutral-900 border-neutral-800", children: [(0, jsx_runtime_1.jsxs)(alert_dialog_1.AlertDialogHeader, { children: [(0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogTitle, { className: "text-white", children: t('cancelQueueTitle') }), (0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogDescription, { className: "text-neutral-400", children: t('cancelQueueDesc') })] }), (0, jsx_runtime_1.jsxs)(alert_dialog_1.AlertDialogFooter, { children: [(0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogCancel, { disabled: submitting, className: "bg-neutral-800 hover:bg-neutral-700 text-white border-neutral-700", children: t('goBack') }), (0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogAction, { onClick: handleCancelQueue, disabled: submitting, className: "bg-red-900/50 hover:bg-red-900/70 text-red-400 border border-red-800", children: submitting ? t('submitting') : t('confirmCancel') })] })] }) })] }));
245
176
  }
@@ -15,7 +15,7 @@ const solana_pay_1 = require("../../lib/solana/solana-pay");
15
15
  const next_intl_1 = require("next-intl");
16
16
  const STABLECOIN_MINTS = { usdc: new web3_js_1.PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"), usdt: new web3_js_1.PublicKey("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB") };
17
17
  const STABLECOIN_VAULTS = { usdc: new web3_js_1.PublicKey("5L8vPTvGH14keLq4R6CGGvSFksZFjb7bRPXarCwZbmUA"), usdt: new web3_js_1.PublicKey("BnHA9jSm88wzQS4c2nCgTXch1Byzc3FWn2G7Wgrvazy3") };
18
- const SOLANA_RPC = process.env.NEXT_PUBLIC_SOLANA_RPC_URL || "";
18
+ const SOLANA_RPC = process.env.NEXT_PUBLIC_HELIUS_RPC_URL || process.env.NEXT_PUBLIC_SOLANA_RPC_URL || "https://api.mainnet-beta.solana.com";
19
19
  const COIN_INFO = { usdc: { symbol: 'USDC', name: 'USD Coin', icon: '💵' }, usdt: { symbol: 'USDT', name: 'Tether', icon: '💴' } };
20
20
  function PublicMiningModal({ isOpen, onClose, onSuccess }) {
21
21
  const t = (0, next_intl_1.useTranslations)("miningModal");