Skip to content

Every analytics tool wants a subscription. And your data. I built Twiligent instead. YouTube stats. Instagram stats. One dashboard. Runs locally on your machine.

feat: update .gitignore

valzor8b62515a6555
diff --git a/.gitignore b/.gitignore
index 25f667a..f792186 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,3 +31,6 @@ Thumbs.db
*.log
npm-debug.log*
yarn-debug.log*
+
+*.bat
+.mcp.json
\ No newline at end of file
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index 0bf7584..1589afd 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -1,103 +1,46 @@
-import React, { useState, useEffect, useCallback } from 'react';
-import { ThemeProvider, CssBaseline, Box, Snackbar, Alert } from '@mui/material';
-import theme from './theme';
-import Sidebar from './layouts/Sidebar';
+import React from 'react';
+import { createBrowserRouter, RouterProvider, Navigate } from 'react-router-dom';
+import { ThemeProvider } from '@mui/material/styles';
+import CssBaseline from '@mui/material/CssBaseline';
+import theme from './themes/index';
+import { AppProvider } from './context/AppContext';
+import MainLayout from './layout/index';
import Overview from './features/analytics/overview/Overview';
import ChannelAnalytics from './features/analytics/channel/ChannelAnalytics';
-import AccountManager from './features/accounts/AccountManager';
-import Settings from './features/settings/Settings';
+import InstagramAnalytics from './features/analytics/instagram/InstagramAnalytics';
import VideoExplorer from './features/analytics/videos/VideoExplorer';
import ShortsExplorer from './features/analytics/shorts/ShortsExplorer';
import ReelsExplorer from './features/analytics/reels/ReelsExplorer';
-import InstagramAnalytics from './features/analytics/instagram/InstagramAnalytics';
import UploadContent from './features/publishing/UploadContent';
-import { api } from './services/api';
-import { normalizeAccount } from './utils/formatters';
-
-export default function App() {
- const [tab, setTab] = useState('overview');
- const [accounts, setAccounts] = useState([]);
- const [selectedAccount, setSelectedAccount] = useState(null);
- const [toast, setToast] = useState({ open: false, message: '', severity: 'success' });
- const [loading, setLoading] = useState(false);
-
- const showToast = useCallback((message, severity = 'success') => {
- setToast({ open: true, message, severity });
- }, []);
-
- const loadAccounts = useCallback(async () => {
- try {
- const data = await api.getAccounts();
- setAccounts(data.map(normalizeAccount));
- } catch (err) {
- showToast('Failed to load accounts: ' + err.message, 'error');
- }
- }, [showToast]);
-
- useEffect(() => { loadAccounts(); }, [loadAccounts]);
-
- const handleViewChannel = (account) => {
- setSelectedAccount(account);
- setTab(account.platform === 'instagram' ? 'ig-analytics' : 'channel');
- };
-
- const handleRefreshAll = async () => {
- setLoading(true);
- try {
- const res = await api.refreshAll();
- setAccounts((res.accounts || []).map(normalizeAccount));
- showToast('All accounts refreshed!');
- } catch (err) {
- showToast(err.message, 'error');
- } finally {
- setLoading(false);
- }
- };
+import AccountManager from './features/accounts/AccountManager';
+import Settings from './features/settings/Settings';
- const renderTab = () => {
- switch (tab) {
- case 'overview':
- return <Overview accounts={accounts} onViewChannel={handleViewChannel} onRefreshAll={handleRefreshAll} loading={loading} />;
- case 'channel':
- return selectedAccount
- ? <ChannelAnalytics account={selectedAccount} showToast={showToast} onBack={() => setTab('overview')} />
- : <Overview accounts={accounts} onViewChannel={handleViewChannel} onRefreshAll={handleRefreshAll} loading={loading} />;
- case 'videos':
- return <VideoExplorer accounts={accounts} showToast={showToast} />;
- case 'shorts':
- return <ShortsExplorer accounts={accounts} showToast={showToast} />;
- case 'reels':
- return <ReelsExplorer accounts={accounts} showToast={showToast} />;
- case 'upload':
- return <UploadContent accounts={accounts} showToast={showToast} />;
- case 'accounts':
- return <AccountManager accounts={accounts} setAccounts={setAccounts} showToast={showToast} onRefresh={loadAccounts} />;
- case 'ig-analytics':
- return selectedAccount?.platform === 'instagram'
- ? <InstagramAnalytics account={selectedAccount} showToast={showToast} onBack={() => setTab('overview')} />
- : <Overview accounts={accounts} onViewChannel={handleViewChannel} onRefreshAll={handleRefreshAll} loading={loading} />;
- case 'settings':
- return <Settings showToast={showToast} onRefresh={loadAccounts} />;
- default:
- return <Overview accounts={accounts} onViewChannel={handleViewChannel} onRefreshAll={handleRefreshAll} loading={loading} />;
- }
- };
+const router = createBrowserRouter([
+ {
+ path: '/',
+ element: <MainLayout />,
+ children: [
+ { index: true, element: <Overview /> },
+ { path: 'channel/:id', element: <ChannelAnalytics /> },
+ { path: 'instagram/:id', element: <InstagramAnalytics /> },
+ { path: 'videos', element: <VideoExplorer /> },
+ { path: 'shorts', element: <ShortsExplorer /> },
+ { path: 'reels', element: <ReelsExplorer /> },
+ { path: 'upload', element: <UploadContent /> },
+ { path: 'accounts', element: <AccountManager /> },
+ { path: 'settings', element: <Settings /> },
+ { path: '*', element: <Navigate to="/" replace /> },
+ ],
+ },
+]);
+export default function App() {
return (
<ThemeProvider theme={theme}>
<CssBaseline />
- <Box sx={{ display: 'flex', minHeight: '100vh', bgcolor: 'background.default' }}>
- <Sidebar tab={tab} setTab={setTab} accounts={accounts} onViewChannel={handleViewChannel} />
- <Box component="main" sx={{ flexGrow: 1, p: { xs: 2, md: 3 }, minWidth: 0, overflowX: 'hidden' }}>
- {renderTab()}
- </Box>
- </Box>
- <Snackbar open={toast.open} autoHideDuration={4000} onClose={() => setToast(t => ({ ...t, open: false }))}
- anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}>
- <Alert severity={toast.severity} variant="filled" onClose={() => setToast(t => ({ ...t, open: false }))}>
- {toast.message}
- </Alert>
- </Snackbar>
+ <AppProvider>
+ <RouterProvider router={router} />
+ </AppProvider>
</ThemeProvider>
);
}
diff --git a/frontend/src/components/MainCard.jsx b/frontend/src/components/MainCard.jsx
new file mode 100644
index 0000000..d9dda9b
--- /dev/null
+++ b/frontend/src/components/MainCard.jsx
@@ -0,0 +1,75 @@
+import React from 'react';
+import { Card, CardContent, CardHeader, Divider, Typography } from '@mui/material';
+import { GREY, PRIMARY } from '../themes/index';
+
+export default function MainCard({
+ border = true,
+ boxShadow = false,
+ children,
+ subheader,
+ content = true,
+ contentSX = {},
+ darkTitle = false,
+ divider = true,
+ elevation,
+ secondary,
+ shadow,
+ sx = {},
+ title,
+ modal = false,
+ ...others
+}) {
+ return (
+ <Card
+ elevation={elevation ?? 0}
+ sx={{
+ position: 'relative',
+ border: border ? `1px solid ${GREY.A800}` : 'none',
+ borderRadius: 2,
+ boxShadow: boxShadow
+ ? shadow || '0 1px 4px rgba(0,0,0,0.08)'
+ : 'none',
+ ':hover': {
+ boxShadow: boxShadow
+ ? shadow || '0 4px 12px rgba(0,0,0,0.12)'
+ : 'none',
+ },
+ ...(modal && {
+ position: 'absolute',
+ top: '50%',
+ left: '50%',
+ transform: 'translate(-50%, -50%)',
+ width: { xs: 'calc(100% - 50px)', sm: 'auto' },
+ maxWidth: 768,
+ }),
+ ...sx,
+ }}
+ {...others}
+ >
+ {title && (
+ <CardHeader
+ sx={{ p: 2.5 }}
+ title={
+ <Typography variant={darkTitle ? 'h4' : 'subtitle1'} sx={{ fontWeight: 600 }}>
+ {title}
+ </Typography>
+ }
+ action={secondary}
+ subheader={subheader && (
+ <Typography variant="body2" color="text.secondary" sx={{ mt: 0.5 }}>
+ {subheader}
+ </Typography>
+ )}
+ />
+ )}
+
+ {title && divider && <Divider />}
+
+ {content ? (
+ <CardContent sx={{ p: 2.5, ...contentSX }}>{children}</CardContent>
+ ) : (
+ children
+ )}
+ </Card>
+ );
+}
diff --git a/frontend/src/components/ui/StatCard.jsx b/frontend/src/components/ui/StatCard.jsx
index ee2de8f..5a23a21 100644
--- a/frontend/src/components/ui/StatCard.jsx
+++ b/frontend/src/components/ui/StatCard.jsx
@@ -1,109 +1,115 @@
import React from 'react';
import { Card, CardContent, Box, Typography, Skeleton } from '@mui/material';
+import { alpha } from '@mui/material/styles';
+import { TrendingUp, TrendingDown } from '@mui/icons-material';
-const GRADIENTS = {
- red: 'linear-gradient(135deg, #FF0000 0%, #FF4444 100%)',
- green: 'linear-gradient(135deg, #16A34A 0%, #22C55E 100%)',
- blue: 'linear-gradient(135deg, #1D4ED8 0%, #3B82F6 100%)',
- orange: 'linear-gradient(135deg, #C2410C 0%, #F97316 100%)',
- purple: 'linear-gradient(135deg, #7C3AED 0%, #A78BFA 100%)',
- teal: 'linear-gradient(135deg, #0F766E 0%, #14B8A6 100%)',
- pink: 'linear-gradient(135deg, #BE185D 0%, #EC4899 100%)',
- indigo: 'linear-gradient(135deg, #3730A3 0%, #6366F1 100%)',
- cyan: 'linear-gradient(135deg, #0E7490 0%, #22D3EE 100%)',
- amber: 'linear-gradient(135deg, #B45309 0%, #F59E0B 100%)',
+// Mantis-style palette for stat cards
+const PALETTE = {
+ blue: { bg: '#e6f4ff', icon: '#1890ff', text: '#003a8c' },
+ red: { bg: '#fff1f0', icon: '#ff4d4f', text: '#820014' },
+ green: { bg: '#f6ffed', icon: '#52c41a', text: '#135200' },
+ orange: { bg: '#fff7e6', icon: '#fa8c16', text: '#613400' },
+ purple: { bg: '#f9f0ff', icon: '#722ed1', text: '#22075e' },
+ teal: { bg: '#e6fffb', icon: '#13c2c2', text: '#006d75' },
+ pink: { bg: '#fff0f6', icon: '#eb2f96', text: '#780650' },
+ indigo: { bg: '#f0f5ff', icon: '#2f54eb', text: '#030852' },
+ cyan: { bg: '#e6fffb', icon: '#13c2c2', text: '#006d75' },
+ amber: { bg: '#fffbe6', icon: '#faad14', text: '#613400' },
};
-const GLOW = {
- red: 'rgba(255,0,0,0.15)',
- green: 'rgba(34,197,94,0.15)',
- blue: 'rgba(59,130,246,0.15)',
- orange: 'rgba(249,115,22,0.15)',
- purple: 'rgba(167,139,250,0.15)',
- teal: 'rgba(20,184,166,0.15)',
- pink: 'rgba(236,72,153,0.15)',
- indigo: 'rgba(99,102,241,0.15)',
- cyan: 'rgba(34,211,238,0.15)',
- amber: 'rgba(245,158,11,0.15)',
-};
-
-export default function StatCard({ icon, label, value, subtitle, gradient = 'blue', loading, small }) {
- const grad = GRADIENTS[gradient] || GRADIENTS.blue;
- const glow = GLOW[gradient] || GLOW.blue;
-
- return (
- <Card sx={{
- height: '100%',
- position: 'relative',
- overflow: 'hidden',
- '&::before': {
- content: '""',
- position: 'absolute',
- top: 0, left: 0, right: 0,
- height: '2px',
- background: grad,
- opacity: 0.8,
- },
- }}>
- <CardContent sx={{ p: small ? 1.75 : 2.25, '&:last-child': { pb: small ? 1.75 : 2.25 } }}>
- <Box sx={{ display: 'flex', alignItems: 'flex-start', gap: 1.75 }}>
- <Box sx={{
- width: small ? 40 : 48,
- height: small ? 40 : 48,
- borderRadius: '12px',
- background: grad,
- boxShadow: `0 4px 14px ${glow}`,
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- flexShrink: 0,
- }}>
- {React.cloneElement(icon, { sx: { color: '#fff', fontSize: small ? 20 : 24 } })}
- </Box>
+export default function StatCard({
+ icon,
+ label,
+ value,
+ subtitle,
+ gradient = 'blue',
+ loading,
+ small,
+ trend, // number: positive = up, negative = down
+ trendLabel, // string like "+12% this month"
+}) {
+ const pal = PALETTE[gradient] || PALETTE.blue;
- <Box sx={{ flex: 1, minWidth: 0 }}>
- <Typography sx={{
- color: 'text.secondary',
- fontSize: small ? 11 : 12,
- fontWeight: 600,
- letterSpacing: '0.04em',
- textTransform: 'uppercase',
- mb: 0.5,
- lineHeight: 1,
- }}>
- {label}
- </Typography>
+ return (
+ <Card
+ sx={{
+ height: '100%',
+ border: '1px solid',
+ borderColor: 'divider',
+ borderRadius: 2,
+ boxShadow: 'none',
+ transition: 'box-shadow 0.2s',
+ '&:hover': { boxShadow: '0 4px 16px rgba(0,0,0,0.08)' },
+ }}
+ >
+ <CardContent sx={{ p: small ? 2 : 2.5, '&:last-child': { pb: small ? 2 : 2.5 } }}>
+ <Box sx={{ display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between', mb: 1.5 }}>
+ <Box
+ sx={{
+ width: small ? 40 : 48,
+ height: small ? 40 : 48,
+ borderRadius: 1.5,
+ bgcolor: pal.bg,
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ flexShrink: 0,
+ }}
+ >
+ {React.cloneElement(icon, { sx: { color: pal.icon, fontSize: small ? 20 : 24 } })}
+ </Box>
- {loading ? (
- <Skeleton width="65%" height={small ? 26 : 34} sx={{ borderRadius: 1 }} />
- ) : (
- <Typography sx={{
- fontWeight: 800,
- fontSize: small ? '1.15rem' : '1.5rem',
- lineHeight: 1.15,
- letterSpacing: '-0.02em',
- color: 'text.primary',
- }}>
- {value}
- </Typography>
- )}
+ {trend !== undefined && !loading && (
+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.3 }}>
+ {trend >= 0
+ ? <TrendingUp sx={{ fontSize: 14, color: '#52c41a' }} />
+ : <TrendingDown sx={{ fontSize: 14, color: '#ff4d4f' }} />}
+ <Typography
+ variant="caption"
+ sx={{ fontWeight: 600, color: trend >= 0 ? '#52c41a' : '#ff4d4f', fontSize: '0.7rem' }}
+ >
+ {Math.abs(trend)}%
+ </Typography>
+ </Box>
+ )}
+ </Box>
- {subtitle && (
- <Typography sx={{
- color: 'text.secondary',
- fontSize: 11,
- mt: 0.4,
- lineHeight: 1.3,
- overflow: 'hidden',
- textOverflow: 'ellipsis',
- whiteSpace: 'nowrap',
- }}>
- {subtitle}
- </Typography>
- )}
- </Box>
- </Box>
- </CardContent>
- </Card>
- );
+ {loading ? (
+ <>
+ <Skeleton width="60%" height={small ? 28 : 36} sx={{ borderRadius: 1, mb: 0.5 }} />
+ <Skeleton width="80%" height={16} sx={{ borderRadius: 1 }} />
+ </>
+ ) : (
+ <>
+ <Typography
+ sx={{
+ fontWeight: 700,
+ fontSize: small ? '1.1rem' : '1.375rem',
+ lineHeight: 1.2,
+ color: 'text.primary',
+ mb: 0.25,
+ letterSpacing: '-0.02em',
+ }}
+ >
+ {value}
+ </Typography>
+ <Typography
+ variant="body2"
+ sx={{ color: 'text.secondary', fontWeight: 500, mb: trendLabel ? 0.5 : 0 }}
+ >
+ {label}
+ </Typography>
+ {(subtitle || trendLabel) && (
+ <Typography
+ variant="caption"
+ sx={{ color: 'text.secondary', display: 'block', lineHeight: 1.4 }}
+ >
+ {trendLabel || subtitle}
+ </Typography>
+ )}
+ </>
+ )}
+ </CardContent>
+ </Card>
+ );
}
diff --git a/frontend/src/context/AppContext.jsx b/frontend/src/context/AppContext.jsx
new file mode 100644
index 0000000..c42c043
--- /dev/null
+++ b/frontend/src/context/AppContext.jsx
@@ -0,0 +1,66 @@
+import React, { createContext, useContext, useState, useEffect, useCallback } from 'react';
+import { Snackbar, Alert } from '@mui/material';
+import { api } from '../services/api';
+import { normalizeAccount } from '../utils/formatters';
+
+const AppContext = createContext(null);
+
+export function AppProvider({ children }) {
+ const [accounts, setAccounts] = useState([]);
+ const [loading, setLoading] = useState(false);
+ const [toast, setToast] = useState({ open: false, message: '', severity: 'success' });
+
+ const showToast = useCallback((message, severity = 'success') => {
+ setToast({ open: true, message, severity });
+ }, []);
+
+ const loadAccounts = useCallback(async () => {
+ try {
+ const data = await api.getAccounts();
+ setAccounts(data.map(normalizeAccount));
+ } catch (err) {
+ showToast('Failed to load accounts: ' + err.message, 'error');
+ }
+ }, [showToast]);
+
+ const refreshAll = useCallback(async () => {
+ setLoading(true);
+ try {
+ const res = await api.refreshAll();
+ setAccounts((res.accounts || []).map(normalizeAccount));
+ showToast('All accounts refreshed!');
+ } catch (err) {
+ showToast(err.message, 'error');
+ } finally {
+ setLoading(false);
+ }
+ }, [showToast]);
+
+ useEffect(() => { loadAccounts(); }, [loadAccounts]);
+
+ return (
+ <AppContext.Provider value={{ accounts, setAccounts, loading, showToast, loadAccounts, refreshAll }}>
+ {children}
+ <Snackbar
+ open={toast.open}
+ autoHideDuration={4000}
+ onClose={() => setToast(t => ({ ...t, open: false }))}
+ anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
+ >
+ <Alert
+ severity={toast.severity}
+ onClose={() => setToast(t => ({ ...t, open: false }))}
+ sx={{ borderRadius: 2, boxShadow: '0 4px 20px rgba(0,0,0,0.15)' }}
+ >
+ {toast.message}
+ </Alert>
+ </Snackbar>
+ </AppContext.Provider>
+ );
+}
+
+export function useAppContext() {
+ const ctx = useContext(AppContext);
+ if (!ctx) throw new Error('useAppContext must be used within AppProvider');
+ return ctx;
+}
diff --git a/frontend/src/features/accounts/AccountManager.jsx b/frontend/src/features/accounts/AccountManager.jsx
index 93a201f..423a389 100644
--- a/frontend/src/features/accounts/AccountManager.jsx
+++ b/frontend/src/features/accounts/AccountManager.jsx
@@ -1,24 +1,28 @@
import React, { useState } from 'react';
import {
- Box, Typography, Grid, Card, CardContent, Button, TextField, Dialog,
+ Box, Typography, Grid, Button, TextField, Dialog,
DialogTitle, DialogContent, DialogActions, IconButton, Avatar, Chip,
LinearProgress, CircularProgress, InputAdornment, Tabs, Tab, Alert,
} from '@mui/material';
import {
Add, Delete, Refresh, Search, YouTube, People, Visibility, VideoLibrary,
- Link as LinkIcon, CheckCircle, Instagram, Favorite, Photo, Key,
+ Link as LinkIcon, CheckCircle, Instagram, Key,
} from '@mui/icons-material';
+import MainCard from '../../components/MainCard';
+import { useAppContext } from '../../context/AppContext';
import { api } from '../../services/api';
import { fmtNum, timeAgo } from '../../utils/formatters';
+import { PRIMARY, GREY } from '../../themes/index';
-export default function AccountManager({ accounts, showToast, onRefresh }) {
- const [dialogOpen, setDialogOpen] = useState(false);
- const [dialogTab, setDialogTab] = useState(0); // 0 = YouTube, 1 = Instagram
- const [input, setInput] = useState('');
- const [igToken, setIgToken] = useState('');
- const [resolving, setResolving] = useState(false);
- const [resolved, setResolved] = useState(null);
- const [adding, setAdding] = useState(false);
+export default function AccountManager() {
+ const { accounts, showToast, loadAccounts } = useAppContext();
+ const [dialogOpen, setDialogOpen] = useState(false);
+ const [dialogTab, setDialogTab] = useState(0);
+ const [input, setInput] = useState('');
+ const [igToken, setIgToken] = useState('');
+ const [resolving, setResolving] = useState(false);
+ const [resolved, setResolved] = useState(null);
+ const [adding, setAdding] = useState(false);
const [refreshingId, setRefreshingId] = useState(null);
const handleResolve = async () => {
@@ -40,11 +44,9 @@ export default function AccountManager({ accounts, showToast, onRefresh }) {
setAdding(true);
try {
await api.addAccount(input.trim());
- showToast('Channel added successfully!', 'success');
- setDialogOpen(false);
- setInput('');
- setResolved(null);
- onRefresh();
+ showToast('Channel added successfully!');
+ closeDialog();
+ loadAccounts();
} catch (err) {
showToast('Failed to add account: ' + err.message, 'error');
} finally {
@@ -52,11 +54,26 @@ export default function AccountManager({ accounts, showToast, onRefresh }) {
}
};
+ const handleAddInstagram = async () => {
+ if (!igToken.trim()) return;
+ setAdding(true);
+ try {
+ await api.addInstagramAccount(igToken.trim());
+ showToast('Instagram account added successfully!');
+ closeDialog();
+ loadAccounts();
+ } catch (err) {
+ showToast('Failed to add Instagram account: ' + err.message, 'error');
+ } finally {
+ setAdding(false);
+ }
+ };
+
const handleDelete = async (id) => {
try {
await api.deleteAccount(id);
- showToast('Account removed', 'success');
- onRefresh();
+ showToast('Account removed');
+ loadAccounts();
} catch (err) {
showToast('Failed to delete: ' + err.message, 'error');
}
@@ -66,8 +83,8 @@ export default function AccountManager({ accounts, showToast, onRefresh }) {
setRefreshingId(id);
try {
await api.refreshAccount(id);
- showToast('Account refreshed', 'success');
- onRefresh();
+ showToast('Account refreshed');
+ loadAccounts();
} catch (err) {
showToast('Refresh failed: ' + err.message, 'error');
} finally {
@@ -79,8 +96,8 @@ export default function AccountManager({ accounts, showToast, onRefresh }) {
setRefreshingId('all');
try {
await api.refreshAll();
- showToast('All accounts refreshed', 'success');
- onRefresh();
+ showToast('All accounts refreshed');
+ loadAccounts();
} catch (err) {
showToast('Refresh all failed: ' + err.message, 'error');
} finally {
@@ -88,22 +105,6 @@ export default function AccountManager({ accounts, showToast, onRefresh }) {
}
};
- const handleAddInstagram = async () => {
- if (!igToken.trim()) return;
- setAdding(true);
- try {
- await api.addInstagramAccount(igToken.trim());
- showToast('Instagram account added successfully!', 'success');
- setDialogOpen(false);
- setIgToken('');
- onRefresh();
- } catch (err) {
- showToast('Failed to add Instagram account: ' + err.message, 'error');
- } finally {
- setAdding(false);
- }
- };
-
const closeDialog = () => {
setDialogOpen(false);
setResolved(null);
@@ -116,168 +117,157 @@ export default function AccountManager({ accounts, showToast, onRefresh }) {
return (
<Box>
- <Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', mb: 3 }}>
- <Typography variant="h4" sx={{ fontWeight: 700 }}>
- Manage Accounts
- </Typography>
+ {/* Header */}
+ <Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', mb: 3, flexWrap: 'wrap', gap: 2 }}>
+ <Box>
+ <Typography variant="h4">Manage Accounts</Typography>
+ <Typography variant="body2" color="text.secondary" sx={{ mt: 0.25 }}>
+ {ytAccounts.length} YouTube channels · {igAccounts.length} Instagram accounts
+ </Typography>
+ </Box>
<Box sx={{ display: 'flex', gap: 1 }}>
- <Button variant="outlined" startIcon={<Refresh />} onClick={handleRefreshAll}
- disabled={refreshingId === 'all'} sx={{ borderColor: 'rgba(255,255,255,0.15)' }}>
- {refreshingId === 'all' ? 'Refreshing...' : 'Refresh All'}
+ <Button
+ variant="outlined"
+ startIcon={<Refresh />}
+ onClick={handleRefreshAll}
+ disabled={refreshingId === 'all'}
+ size="small"
+ >
+ {refreshingId === 'all' ? 'Refreshing…' : 'Refresh All'}
</Button>
- <Button variant="contained" startIcon={<Add />} onClick={() => setDialogOpen(true)}
- sx={{ background: 'linear-gradient(135deg, #667eea, #764ba2)' }}>
+ <Button variant="contained" startIcon={<Add />} onClick={() => setDialogOpen(true)} size="small">
Add Account
</Button>
</Box>
</Box>
{accounts.length === 0 ? (
- <Card sx={{ p: 6, textAlign: 'center' }}>
- <People sx={{ fontSize: 64, color: '#667eea', mb: 2 }} />
- <Typography variant="h6" sx={{ mb: 1, fontWeight: 600 }}>No Accounts Added</Typography>
- <Typography variant="body2" sx={{ color: 'text.secondary', mb: 3 }}>
- Add a YouTube channel or Instagram account to start tracking analytics.
- </Typography>
- <Button variant="contained" startIcon={<Add />} onClick={() => setDialogOpen(true)}
- sx={{ background: 'linear-gradient(135deg, #667eea, #764ba2)' }}>
- Add Your First Account
- </Button>
- </Card>
+ <MainCard>
+ <Box sx={{ textAlign: 'center', py: 6 }}>
+ <Box sx={{ width: 64, height: 64, borderRadius: '50%', bgcolor: PRIMARY.lighter, display: 'flex', alignItems: 'center', justifyContent: 'center', mx: 'auto', mb: 2 }}>
+ <People sx={{ fontSize: 32, color: PRIMARY.main }} />
+ </Box>
+ <Typography variant="h5" sx={{ mb: 1 }}>No Accounts Added</Typography>
+ <Typography variant="body2" color="text.secondary" sx={{ mb: 3, maxWidth: 360, mx: 'auto' }}>
+ Add a YouTube channel or Instagram account to start tracking analytics.
+ </Typography>
+ <Button variant="contained" startIcon={<Add />} onClick={() => setDialogOpen(true)}>
+ Add Your First Account
+ </Button>
+ </Box>
+ </MainCard>
) : (
<>
- {/* YouTube Accounts */}
+ {/* YouTube */}
{ytAccounts.length > 0 && (
<Box sx={{ mb: 4 }}>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2, display: 'flex', alignItems: 'center', gap: 1 }}>
- <YouTube sx={{ color: '#FF0000' }} /> YouTube Channels
- <Chip label={ytAccounts.length} size="small" sx={{ fontSize: 12, height: 22, bgcolor: 'rgba(255,0,0,0.1)', color: '#FF4444' }} />
- </Typography>
+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 1.5, mb: 2 }}>
+ <YouTube sx={{ color: '#ff4d4f', fontSize: 22 }} />
+ <Typography variant="h5">YouTube Channels</Typography>
+ <Chip label={ytAccounts.length} size="small" sx={{ bgcolor: '#fff1f0', color: '#ff4d4f', fontWeight: 600, fontSize: '0.72rem', height: 20 }} />
+ </Box>
<Grid container spacing={2.5}>
{ytAccounts.map(acct => (
<Grid size={{ xs: 12, sm: 6, md: 4 }} key={acct.id}>
- <Card sx={{ '&:hover': { transform: 'translateY(-2px)', transition: 'all 0.2s', borderColor: 'rgba(255,0,0,0.3)' } }}>
- <CardContent>
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 2, mb: 2 }}>
- <Avatar src={acct.thumbnail || acct.thumbnails?.default || acct.thumbnailUrl} sx={{ width: 56, height: 56, border: '2px solid rgba(255,0,0,0.2)' }}>
- <YouTube />
- </Avatar>
- <Box sx={{ flex: 1, minWidth: 0 }}>
- <Typography variant="subtitle1" sx={{ fontWeight: 700, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
- {acct.title || acct.channelId}
- </Typography>
- {acct.customUrl && (
- <Typography variant="caption" sx={{ color: 'text.secondary' }}>{acct.customUrl}</Typography>
- )}
- </Box>
+ <MainCard sx={{ transition: 'box-shadow 0.2s', '&:hover': { boxShadow: '0 4px 16px rgba(0,0,0,0.1)' } }}>
+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 1.5, mb: 2 }}>
+ <Avatar src={acct.thumbnail || acct.thumbnails?.default || acct.thumbnailUrl} sx={{ width: 48, height: 48, bgcolor: '#fff1f0' }}>
+ <YouTube sx={{ color: '#ff4d4f' }} />
+ </Avatar>
+ <Box sx={{ flex: 1, minWidth: 0 }}>
+ <Typography variant="subtitle1" noWrap sx={{ fontWeight: 600 }}>{acct.title || acct.channelId}</Typography>
+ {acct.customUrl && <Typography variant="caption" color="text.secondary">{acct.customUrl}</Typography>}
</Box>
- <Grid container spacing={1} sx={{ mb: 2 }}>
- <Grid size={4}>
- <Box sx={{ textAlign: 'center', p: 1, borderRadius: 2, bgcolor: 'rgba(255,0,0,0.06)' }}>
- <Typography variant="caption" sx={{ color: 'text.secondary', display: 'block' }}>Subscribers</Typography>
- <Typography variant="body2" sx={{ fontWeight: 700 }}>{fmtNum(acct.subscriberCount)}</Typography>
- </Box>
- </Grid>
- <Grid size={4}>
- <Box sx={{ textAlign: 'center', p: 1, borderRadius: 2, bgcolor: 'rgba(62,166,255,0.06)' }}>
- <Typography variant="caption" sx={{ color: 'text.secondary', display: 'block' }}>Views</Typography>
- <Typography variant="body2" sx={{ fontWeight: 700 }}>{fmtNum(acct.viewCount)}</Typography>
- </Box>
- </Grid>
- <Grid size={4}>
- <Box sx={{ textAlign: 'center', p: 1, borderRadius: 2, bgcolor: 'rgba(76,175,80,0.06)' }}>
- <Typography variant="caption" sx={{ color: 'text.secondary', display: 'block' }}>Videos</Typography>
- <Typography variant="body2" sx={{ fontWeight: 700 }}>{fmtNum(acct.videoCount)}</Typography>
+ </Box>
+ <Grid container spacing={1} sx={{ mb: 2 }}>
+ {[
+ { label: 'Subscribers', value: fmtNum(acct.subscriberCount), bg: '#fff1f0' },
+ { label: 'Views', value: fmtNum(acct.viewCount), bg: '#e6f4ff' },
+ { label: 'Videos', value: fmtNum(acct.videoCount), bg: '#f6ffed' },
+ ].map(m => (
+ <Grid size={4} key={m.label}>
+ <Box sx={{ textAlign: 'center', p: 1, borderRadius: 1.5, bgcolor: m.bg }}>
+ <Typography variant="caption" color="text.secondary" sx={{ display: 'block', fontSize: '0.65rem' }}>{m.label}</Typography>
+ <Typography variant="body2" sx={{ fontWeight: 700 }}>{m.value}</Typography>
</Box>
</Grid>
- </Grid>
- {acct.lastUpdated && (
- <Typography variant="caption" sx={{ color: 'text.secondary', display: 'block', mb: 1.5 }}>
- Last updated: {timeAgo(acct.lastUpdated)}
- </Typography>
- )}
- <Box sx={{ display: 'flex', gap: 1 }}>
- <Button size="small" startIcon={<Refresh />} onClick={() => handleRefreshOne(acct.id)}
- disabled={refreshingId === acct.id} fullWidth variant="outlined"
- sx={{ borderColor: 'rgba(255,255,255,0.1)', fontSize: 12 }}>
- {refreshingId === acct.id ? 'Refreshing...' : 'Refresh'}
- </Button>
- <IconButton size="small" onClick={() => handleDelete(acct.id)}
- sx={{ color: 'error.main', border: '1px solid rgba(255,0,0,0.2)', borderRadius: 2 }}>
- <Delete fontSize="small" />
- </IconButton>
- </Box>
- </CardContent>
- </Card>
+ ))}
+ </Grid>
+ {acct.lastUpdated && (
+ <Typography variant="caption" color="text.secondary" sx={{ display: 'block', mb: 1.5 }}>
+ Updated {timeAgo(acct.lastUpdated)}
+ </Typography>
+ )}
+ <Box sx={{ display: 'flex', gap: 1 }}>
+ <Button size="small" variant="outlined" startIcon={<Refresh />} fullWidth
+ onClick={() => handleRefreshOne(acct.id)} disabled={refreshingId === acct.id}>
+ {refreshingId === acct.id ? 'Refreshing…' : 'Refresh'}
+ </Button>
+ <IconButton size="small" onClick={() => handleDelete(acct.id)}
+ sx={{ color: 'error.main', border: `1px solid`, borderColor: 'error.light', borderRadius: 1.5, px: 1 }}>
+ <Delete sx={{ fontSize: 16 }} />
+ </IconButton>
+ </Box>
+ </MainCard>
</Grid>
))}
</Grid>
</Box>
)}
- {/* Instagram Accounts */}
+ {/* Instagram */}
{igAccounts.length > 0 && (
- <Box sx={{ mb: 4 }}>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2, display: 'flex', alignItems: 'center', gap: 1 }}>
- <Instagram sx={{ color: '#E1306C' }} /> Instagram Accounts
- <Chip label={igAccounts.length} size="small" sx={{ fontSize: 12, height: 22, bgcolor: 'rgba(225,48,108,0.1)', color: '#E1306C' }} />
- </Typography>
+ <Box>
+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 1.5, mb: 2 }}>
+ <Instagram sx={{ color: '#E1306C', fontSize: 22 }} />
+ <Typography variant="h5">Instagram Accounts</Typography>
+ <Chip label={igAccounts.length} size="small" sx={{ bgcolor: '#fff0f6', color: '#c41d7f', fontWeight: 600, fontSize: '0.72rem', height: 20 }} />
+ </Box>
<Grid container spacing={2.5}>
{igAccounts.map(acct => (
<Grid size={{ xs: 12, sm: 6, md: 4 }} key={acct.id}>
- <Card sx={{ '&:hover': { transform: 'translateY(-2px)', transition: 'all 0.2s', borderColor: 'rgba(225,48,108,0.3)' } }}>
- <CardContent>
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 2, mb: 2 }}>
- <Avatar src={acct.profilePictureUrl || acct.thumbnail} sx={{ width: 56, height: 56, border: '2px solid rgba(225,48,108,0.3)' }}>
- <Instagram />
- </Avatar>
- <Box sx={{ flex: 1, minWidth: 0 }}>
- <Typography variant="subtitle1" sx={{ fontWeight: 700, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
- {acct.title || acct.username || acct.igUsername}
- </Typography>
- {(acct.username || acct.igUsername) && (
- <Typography variant="caption" sx={{ color: 'text.secondary' }}>@{acct.username || acct.igUsername}</Typography>
- )}
- </Box>
+ <MainCard sx={{ transition: 'box-shadow 0.2s', '&:hover': { boxShadow: '0 4px 16px rgba(0,0,0,0.1)' } }}>
+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 1.5, mb: 2 }}>
+ <Avatar src={acct.profilePictureUrl || acct.thumbnail} sx={{ width: 48, height: 48, bgcolor: '#fff0f6' }}>
+ <Instagram sx={{ color: '#E1306C' }} />
+ </Avatar>
+ <Box sx={{ flex: 1, minWidth: 0 }}>
+ <Typography variant="subtitle1" noWrap sx={{ fontWeight: 600 }}>{acct.title || acct.username}</Typography>
+ {(acct.username || acct.igUsername) && (
+ <Typography variant="caption" color="text.secondary">@{acct.username || acct.igUsername}</Typography>
+ )}
</Box>
- <Grid container spacing={1} sx={{ mb: 2 }}>
- <Grid size={4}>
- <Box sx={{ textAlign: 'center', p: 1, borderRadius: 2, bgcolor: 'rgba(225,48,108,0.06)' }}>
- <Typography variant="caption" sx={{ color: 'text.secondary', display: 'block' }}>Followers</Typography>
- <Typography variant="body2" sx={{ fontWeight: 700 }}>{fmtNum(acct.followersCount)}</Typography>
- </Box>
- </Grid>
- <Grid size={4}>
- <Box sx={{ textAlign: 'center', p: 1, borderRadius: 2, bgcolor: 'rgba(138,58,185,0.06)' }}>
- <Typography variant="caption" sx={{ color: 'text.secondary', display: 'block' }}>Following</Typography>
- <Typography variant="body2" sx={{ fontWeight: 700 }}>{fmtNum(acct.followsCount)}</Typography>
- </Box>
- </Grid>
- <Grid size={4}>
- <Box sx={{ textAlign: 'center', p: 1, borderRadius: 2, bgcolor: 'rgba(81,91,212,0.06)' }}>
- <Typography variant="caption" sx={{ color: 'text.secondary', display: 'block' }}>Posts</Typography>
- <Typography variant="body2" sx={{ fontWeight: 700 }}>{fmtNum(acct.mediaCount)}</Typography>
+ </Box>
+ <Grid container spacing={1} sx={{ mb: 2 }}>
+ {[
+ { label: 'Followers', value: fmtNum(acct.followersCount), bg: '#fff0f6' },
+ { label: 'Following', value: fmtNum(acct.followsCount), bg: '#f9f0ff' },
+ { label: 'Posts', value: fmtNum(acct.mediaCount), bg: '#f6ffed' },
+ ].map(m => (
+ <Grid size={4} key={m.label}>
+ <Box sx={{ textAlign: 'center', p: 1, borderRadius: 1.5, bgcolor: m.bg }}>
+ <Typography variant="caption" color="text.secondary" sx={{ display: 'block', fontSize: '0.65rem' }}>{m.label}</Typography>
+ <Typography variant="body2" sx={{ fontWeight: 700 }}>{m.value}</Typography>
</Box>
</Grid>
- </Grid>
- {acct.lastUpdated && (
- <Typography variant="caption" sx={{ color: 'text.secondary', display: 'block', mb: 1.5 }}>
- Last updated: {timeAgo(acct.lastUpdated)}
- </Typography>
- )}
- <Box sx={{ display: 'flex', gap: 1 }}>
- <Button size="small" startIcon={<Refresh />} onClick={() => handleRefreshOne(acct.id)}
- disabled={refreshingId === acct.id} fullWidth variant="outlined"
- sx={{ borderColor: 'rgba(255,255,255,0.1)', fontSize: 12 }}>
- {refreshingId === acct.id ? 'Refreshing...' : 'Refresh'}
- </Button>
- <IconButton size="small" onClick={() => handleDelete(acct.id)}
- sx={{ color: 'error.main', border: '1px solid rgba(255,0,0,0.2)', borderRadius: 2 }}>
- <Delete fontSize="small" />
- </IconButton>
- </Box>
- </CardContent>
- </Card>
+ ))}
+ </Grid>
+ {acct.lastUpdated && (
+ <Typography variant="caption" color="text.secondary" sx={{ display: 'block', mb: 1.5 }}>
+ Updated {timeAgo(acct.lastUpdated)}
+ </Typography>
+ )}
+ <Box sx={{ display: 'flex', gap: 1 }}>
+ <Button size="small" variant="outlined" startIcon={<Refresh />} fullWidth
+ onClick={() => handleRefreshOne(acct.id)} disabled={refreshingId === acct.id}>
+ {refreshingId === acct.id ? 'Refreshing…' : 'Refresh'}
+ </Button>
+ <IconButton size="small" onClick={() => handleDelete(acct.id)}
+ sx={{ color: 'error.main', border: '1px solid', borderColor: 'error.light', borderRadius: 1.5, px: 1 }}>
+ <Delete sx={{ fontSize: 16 }} />
+ </IconButton>
+ </Box>
+ </MainCard>
</Grid>
))}
</Grid>
@@ -287,97 +277,72 @@ export default function AccountManager({ accounts, showToast, onRefresh }) {
)}
{/* Add Account Dialog */}
- <Dialog open={dialogOpen} onClose={closeDialog}
- maxWidth="sm" fullWidth PaperProps={{ sx: { bgcolor: '#1A1A1A', backgroundImage: 'none' } }}>
- <DialogTitle sx={{ fontWeight: 700, pb: 0 }}>
- Add Account
- </DialogTitle>
+ <Dialog open={dialogOpen} onClose={closeDialog} maxWidth="sm" fullWidth>
+ <DialogTitle>Add Account</DialogTitle>
<DialogContent>
- <Tabs value={dialogTab} onChange={(_, v) => setDialogTab(v)} sx={{ mb: 2, mt: 1 }}
- TabIndicatorProps={{ sx: { background: dialogTab === 0 ? '#FF0000' : 'linear-gradient(90deg, #F58529, #DD2A7B, #8134AF)' } }}>
- <Tab icon={<YouTube sx={{ color: dialogTab === 0 ? '#FF0000' : 'text.secondary' }} />}
- label="YouTube" iconPosition="start" sx={{ textTransform: 'none', fontWeight: 600 }} />
- <Tab icon={<Instagram sx={{ color: dialogTab === 1 ? '#E1306C' : 'text.secondary' }} />}
- label="Instagram" iconPosition="start" sx={{ textTransform: 'none', fontWeight: 600 }} />
+ <Tabs value={dialogTab} onChange={(_, v) => setDialogTab(v)} sx={{ mb: 2, mt: 0.5 }}>
+ <Tab icon={<YouTube sx={{ fontSize: 18 }} />} label="YouTube" iconPosition="start" />
+ <Tab icon={<Instagram sx={{ fontSize: 18 }} />} label="Instagram" iconPosition="start" />
</Tabs>
{dialogTab === 0 ? (
<>
- <Typography variant="body2" sx={{ color: 'text.secondary', mb: 2 }}>
+ <Typography variant="body2" color="text.secondary" sx={{ mb: 2 }}>
Enter a YouTube channel URL, @handle, or channel ID.
</Typography>
<Box sx={{ display: 'flex', gap: 1, mb: 2 }}>
<TextField fullWidth value={input} onChange={e => setInput(e.target.value)}
- placeholder="e.g. @MrBeast, https://youtube.com/@MrBeast, UCX6OQ3..."
+ placeholder="e.g. @MrBeast, https://youtube.com/@MrBeast, UCX6…"
size="small" onKeyDown={e => e.key === 'Enter' && handleResolve()}
- slotProps={{
- input: {
- startAdornment: <InputAdornment position="start"><LinkIcon sx={{ color: 'text.secondary' }} /></InputAdornment>,
- }
- }} />
- <Button variant="contained" onClick={handleResolve} disabled={resolving || !input.trim()}
- sx={{ background: 'linear-gradient(135deg, #FF0000, #FF4444)', minWidth: 100 }}>
- {resolving ? <CircularProgress size={20} /> : <Search />}
+ slotProps={{ input: { startAdornment: <InputAdornment position="start"><LinkIcon sx={{ color: 'text.secondary', fontSize: 18 }} /></InputAdornment> } }} />
+ <Button variant="contained" onClick={handleResolve} disabled={resolving || !input.trim()} sx={{ minWidth: 90 }}>
+ {resolving ? <CircularProgress size={18} color="inherit" /> : <Search />}
</Button>
</Box>
- {resolving && <LinearProgress color="error" sx={{ mb: 2 }} />}
+ {resolving && <LinearProgress sx={{ mb: 2, borderRadius: 1 }} />}
{resolved && (
- <Card sx={{ bgcolor: 'rgba(76,175,80,0.05)', border: '1px solid rgba(76,175,80,0.2)' }}>
- <CardContent sx={{ display: 'flex', alignItems: 'center', gap: 2, p: 2, '&:last-child': { pb: 2 } }}>
- <Avatar src={resolved.thumbnails?.medium || resolved.thumbnails?.default} sx={{ width: 56, height: 56 }}>
- <YouTube />
- </Avatar>
- <Box sx={{ flex: 1 }}>
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
- <Typography variant="subtitle1" sx={{ fontWeight: 700 }}>{resolved.title}</Typography>
- <CheckCircle sx={{ fontSize: 18, color: '#4CAF50' }} />
- </Box>
- <Typography variant="caption" sx={{ color: 'text.secondary' }}>
- {resolved.customUrl} {resolved.channelId && `• ${resolved.channelId}`}
- </Typography>
- {resolved.subscriberCount != null && (
- <Box sx={{ display: 'flex', gap: 1.5, mt: 0.5 }}>
- <Chip label={`${fmtNum(resolved.subscriberCount)} subs`} size="small" sx={{ fontSize: 11, height: 22 }} />
- <Chip label={`${fmtNum(resolved.videoCount)} videos`} size="small" sx={{ fontSize: 11, height: 22 }} />
- </Box>
- )}
+ <Box sx={{ p: 2, borderRadius: 2, bgcolor: '#f6ffed', border: '1px solid #b7eb8f', display: 'flex', alignItems: 'center', gap: 2 }}>
+ <Avatar src={resolved.thumbnails?.medium || resolved.thumbnails?.default} sx={{ width: 48, height: 48, bgcolor: '#d9f7be' }}>
+ <YouTube sx={{ color: '#52c41a' }} />
+ </Avatar>
+ <Box sx={{ flex: 1 }}>
+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
+ <Typography variant="subtitle1" sx={{ fontWeight: 600 }}>{resolved.title}</Typography>
+ <CheckCircle sx={{ fontSize: 16, color: '#52c41a' }} />
</Box>
- </CardContent>
- </Card>
+ <Typography variant="caption" color="text.secondary">{resolved.customUrl}</Typography>
+ {resolved.subscriberCount != null && (
+ <Box sx={{ display: 'flex', gap: 1, mt: 0.5 }}>
+ <Chip label={`${fmtNum(resolved.subscriberCount)} subs`} size="small" sx={{ fontSize: '0.7rem', height: 20 }} />
+ <Chip label={`${fmtNum(resolved.videoCount)} videos`} size="small" sx={{ fontSize: '0.7rem', height: 20 }} />
+ </Box>
+ )}
+ </Box>
+ </Box>
)}
</>
) : (
<>
- <Alert severity="info" sx={{ mb: 2, bgcolor: 'rgba(81,91,212,0.08)', '& .MuiAlert-icon': { color: '#8134AF' } }}>
- Paste your <b>Instagram Access Token</b> from the App Dashboard (Instagram &rarr; API setup &rarr; Generate Token).
- Tokens from the dashboard are already long-lived (~60 days).
+ <Alert severity="info" sx={{ mb: 2 }}>
+ Paste your <b>Instagram Access Token</b> from the App Dashboard. Your account must be a <b>Business</b> or <b>Creator</b> account.
</Alert>
- <Typography variant="body2" sx={{ color: 'text.secondary', mb: 2 }}>
- Your app needs the <b>instagram_business_basic</b> permission, and your Instagram account must be
- a <b>Business</b> or <b>Creator</b> professional account.
- </Typography>
<TextField fullWidth value={igToken} onChange={e => setIgToken(e.target.value)}
- placeholder="Paste your Instagram access token here..."
+ placeholder="Paste your Instagram access token here…"
size="small" multiline rows={3}
- slotProps={{
- input: {
- startAdornment: <InputAdornment position="start" sx={{ alignSelf: 'flex-start', mt: 1 }}><Key sx={{ color: 'text.secondary' }} /></InputAdornment>,
- }
- }} />
+ slotProps={{ input: { startAdornment: <InputAdornment position="start" sx={{ alignSelf: 'flex-start', mt: 1 }}><Key sx={{ color: 'text.secondary', fontSize: 18 }} /></InputAdornment> } }} />
</>
)}
</DialogContent>
<DialogActions sx={{ px: 3, pb: 2 }}>
- <Button onClick={closeDialog}>Cancel</Button>
+ <Button onClick={closeDialog} color="inherit">Cancel</Button>
{dialogTab === 0 ? (
- <Button variant="contained" onClick={handleAdd} disabled={!input.trim() || adding}
- sx={{ background: 'linear-gradient(135deg, #FF0000, #FF4444)' }}>
- {adding ? <CircularProgress size={20} /> : 'Add Channel'}
+ <Button variant="contained" onClick={handleAdd} disabled={!input.trim() || adding}>
+ {adding ? <CircularProgress size={18} color="inherit" /> : 'Add Channel'}
</Button>
) : (
<Button variant="contained" onClick={handleAddInstagram} disabled={!igToken.trim() || adding}
- sx={{ background: 'linear-gradient(135deg, #F58529, #DD2A7B, #8134AF)' }}>
- {adding ? <CircularProgress size={20} /> : 'Add Instagram'}
+ sx={{ bgcolor: '#c41d7f', '&:hover': { bgcolor: '#9e1068' } }}>
+ {adding ? <CircularProgress size={18} color="inherit" /> : 'Add Instagram'}
</Button>
)}
</DialogActions>
diff --git a/frontend/src/features/analytics/channel/ChannelAnalytics.jsx b/frontend/src/features/analytics/channel/ChannelAnalytics.jsx
index a4b492b..24b6786 100644
--- a/frontend/src/features/analytics/channel/ChannelAnalytics.jsx
+++ b/frontend/src/features/analytics/channel/ChannelAnalytics.jsx
@@ -1,41 +1,73 @@
import React, { useState, useEffect } from 'react';
+import { useParams, useNavigate } from 'react-router-dom';
import {
Box, Typography, Grid, Card, CardContent, Button, Avatar, Chip, Tabs, Tab,
LinearProgress, Table, TableBody, TableCell, TableContainer, TableHead, TableRow,
- IconButton, Tooltip, Divider, Skeleton, Paper, CircularProgress,
+ IconButton, Tooltip, Skeleton, Alert,
} from '@mui/material';
import {
ArrowBack, Refresh, Visibility, People, VideoLibrary, ThumbUp, Comment,
- TrendingUp, TrendingDown, Schedule, EmojiEvents, Speed, BarChart as BarChartIcon,
- Whatshot, Timeline, CalendarMonth, AccessTime, HighQuality, ClosedCaption,
- Tag, Category, Timelapse, WorkspacePremium, ShowChart, PieChartOutline,
- Subscriptions, QueryStats, Analytics, SignalCellularAlt, Insights,
- PlayCircleOutline,
+ TrendingUp, Schedule, EmojiEvents, Speed, Whatshot, CalendarMonth, AccessTime,
+ HighQuality, ClosedCaption, Tag, Timelapse, WorkspacePremium, SignalCellularAlt,
+ Subscriptions, QueryStats, PlayCircleOutline, BarChart as BarChartIcon,
} from '@mui/icons-material';
import {
BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip as ReTooltip,
ResponsiveContainer, LineChart, Line, PieChart, Pie, Cell, Legend,
- AreaChart, Area, RadarChart, PolarGrid, PolarAngleAxis, PolarRadiusAxis, Radar,
+ AreaChart, Area,
} from 'recharts';
import StatCard from '../../../components/ui/StatCard';
+import MainCard from '../../../components/MainCard';
+import { useAppContext } from '../../../context/AppContext';
import { api } from '../../../services/api';
-import { fmtNum, fmtNumFull, fmtDate, fmtPercent, fmtDuration, timeAgo, CATEGORY_MAP } from '../../../utils/formatters';
+import { fmtNum, fmtNumFull, fmtDate, fmtPercent, fmtDuration, CATEGORY_MAP } from '../../../utils/formatters';
+import { PRIMARY, SUCCESS, WARNING, ERROR, GREY } from '../../../themes/index';
+
+const C = {
+ blue: PRIMARY.main,
+ green: '#52c41a',
+ orange: '#fa8c16',
+ red: '#ff4d4f',
+ purple: '#722ed1',
+ cyan: '#13c2c2',
+ pink: '#eb2f96',
+ indigo: '#2f54eb',
+ amber: '#faad14',
+};
+
+const tooltipStyle = {
+ backgroundColor: '#fff',
+ border: `1px solid ${GREY.A800}`,
+ borderRadius: 8,
+ fontSize: 13,
+ color: GREY[700],
+ boxShadow: '0 4px 12px rgba(0,0,0,0.1)',
+};
+
+function ChartCard({ title, children, sx }) {
+ return (
+ <MainCard title={title} contentSX={{ p: 2, ...sx }}>
+ {children}
+ </MainCard>
+ );
+}
-const COLORS = ['#FF0000', '#3EA6FF', '#4CAF50', '#FF9800', '#AB47BC', '#26A69A', '#EC407A', '#5C6BC0', '#FFCA28', '#00BCD4'];
+export default function ChannelAnalytics() {
+ const { id } = useParams();
+ const navigate = useNavigate();
+ const { accounts, showToast } = useAppContext();
+ const account = accounts.find(a => a.id === id);
-export default function ChannelAnalytics({ account, showToast, onBack }) {
- const [data, setData] = useState(null);
+ const [data, setData] = useState(null);
const [loading, setLoading] = useState(true);
const [tabValue, setTabValue] = useState(0);
- useEffect(() => {
- loadAnalytics();
- }, [account.id]);
+ useEffect(() => { if (id) loadAnalytics(); }, [id]);
const loadAnalytics = async () => {
setLoading(true);
try {
- const res = await api.getAnalytics(account.id);
+ const res = await api.getAnalytics(id);
setData(res);
} catch (err) {
showToast('Failed to load analytics: ' + err.message, 'error');
@@ -44,18 +76,24 @@ export default function ChannelAnalytics({ account, showToast, onBack }) {
}
};
+ if (!account && !loading) {
+ return (
+ <Box>
+ <Button startIcon={<ArrowBack />} onClick={() => navigate('/')} sx={{ mb: 2 }}>Back to Overview</Button>
+ <Alert severity="error">Account not found. It may have been removed.</Alert>
+ </Box>
+ );
+ }
+
if (loading) {
return (
<Box>
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 2, mb: 3 }}>
- <Button startIcon={<ArrowBack />} onClick={onBack}>Back</Button>
- <Typography variant="h4" sx={{ fontWeight: 700 }}>Loading Analytics...</Typography>
- </Box>
- <LinearProgress color="error" sx={{ mb: 3 }} />
+ <Button startIcon={<ArrowBack />} onClick={() => navigate('/')} sx={{ mb: 2, color: 'text.secondary' }}>Back</Button>
+ <LinearProgress sx={{ mb: 3, borderRadius: 1 }} />
<Grid container spacing={2.5}>
{[...Array(8)].map((_, i) => (
<Grid size={{ xs: 12, sm: 6, md: 3 }} key={i}>
- <Skeleton variant="rounded" height={100} sx={{ borderRadius: 3 }} />
+ <Skeleton variant="rounded" height={110} sx={{ borderRadius: 2 }} />
</Grid>
))}
</Grid>
@@ -66,200 +104,148 @@ export default function ChannelAnalytics({ account, showToast, onBack }) {
if (!data) return null;
const { channel, analytics } = data;
- const dayData = analytics.publishDayDistribution
+ const dayData = analytics.publishDayDistribution
? Object.entries(analytics.publishDayDistribution).map(([day, count]) => ({ day, count }))
: [];
-
const hourData = analytics.publishHourDistribution
? Object.entries(analytics.publishHourDistribution)
.sort((a, b) => parseInt(a[0]) - parseInt(b[0]))
.map(([hour, count]) => ({ hour: `${hour}:00`, count }))
: [];
-
const durationData = analytics.durationDistribution
? [
- { name: 'Shorts (<1m)', value: analytics.durationDistribution.short, color: '#FF0000' },
- { name: 'Medium (1-10m)', value: analytics.durationDistribution.medium, color: '#3EA6FF' },
- { name: 'Long (10-60m)', value: analytics.durationDistribution.long, color: '#4CAF50' },
- { name: 'Very Long (>1h)', value: analytics.durationDistribution.veryLong, color: '#FF9800' },
+ { name: 'Shorts (<1m)', value: analytics.durationDistribution.short, color: C.red },
+ { name: 'Medium (1-10m)', value: analytics.durationDistribution.medium, color: C.blue },
+ { name: 'Long (10-60m)', value: analytics.durationDistribution.long, color: C.green },
+ { name: 'Very Long (>1h)',value: analytics.durationDistribution.veryLong, color: C.orange },
].filter(d => d.value > 0)
: [];
-
const catData = analytics.categoryDistribution
? Object.entries(analytics.categoryDistribution).map(([id, count]) => ({
name: CATEGORY_MAP[id] || `Cat ${id}`, value: count,
}))
: [];
+ const TABS = ['Overview', 'Videos', 'Engagement', 'Content', 'Publishing', 'Growth', 'Shorts vs Regular', 'Tags & SEO'];
+
return (
<Box>
- {/* Header */}
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 2, mb: 1 }}>
- <Button startIcon={<ArrowBack />} onClick={onBack} sx={{ color: 'text.secondary' }}>Back</Button>
- </Box>
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 2.5, mb: 3 }}>
- <Avatar src={channel.thumbnails?.high || channel.thumbnails?.medium} sx={{ width: 72, height: 72, border: '3px solid rgba(255,0,0,0.3)' }} />
- <Box sx={{ flex: 1 }}>
- <Typography variant="h4" sx={{ fontWeight: 700 }}>{channel.title}</Typography>
- <Box sx={{ display: 'flex', gap: 1.5, alignItems: 'center', mt: 0.5, flexWrap: 'wrap' }}>
- {channel.customUrl && <Chip label={channel.customUrl} size="small" variant="outlined" sx={{ borderColor: 'rgba(255,255,255,0.15)' }} />}
- {channel.country && channel.country !== 'Unknown' && <Chip label={channel.country} size="small" variant="outlined" sx={{ borderColor: 'rgba(255,255,255,0.15)' }} />}
- <Chip label={`${channel.channelAgeYears} years old`} size="small" variant="outlined" sx={{ borderColor: 'rgba(255,255,255,0.15)' }} />
- <Chip label={`Since ${fmtDate(channel.publishedAt)}`} size="small" variant="outlined" sx={{ borderColor: 'rgba(255,255,255,0.15)' }} />
+ {/* Back */}
+ <Button
+ startIcon={<ArrowBack />}
+ onClick={() => navigate('/')}
+ size="small"
+ sx={{ mb: 1.5, color: 'text.secondary', fontWeight: 500 }}
+ >
+ Back to Overview
+ </Button>
+
+ {/* Channel header */}
+ <MainCard sx={{ mb: 3 }} content={false}>
+ <Box sx={{ p: 2.5, display: 'flex', alignItems: 'center', gap: 2.5, flexWrap: 'wrap' }}>
+ <Avatar
+ src={channel.thumbnails?.high || channel.thumbnails?.medium}
+ sx={{ width: 64, height: 64, border: `2px solid ${GREY.A800}` }}
+ />
+ <Box sx={{ flex: 1, minWidth: 0 }}>
+ <Typography variant="h4" sx={{ mb: 0.5 }}>{channel.title}</Typography>
+ <Box sx={{ display: 'flex', gap: 1, flexWrap: 'wrap', alignItems: 'center' }}>
+ {channel.customUrl && (
+ <Chip label={channel.customUrl} size="small" variant="outlined" />
+ )}
+ {channel.country && channel.country !== 'Unknown' && (
+ <Chip label={channel.country} size="small" variant="outlined" />
+ )}
+ <Chip label={`${channel.channelAgeYears} years old`} size="small" variant="outlined" />
+ <Chip label={`Since ${fmtDate(channel.publishedAt)}`} size="small" variant="outlined" />
+ </Box>
</Box>
+ <Button
+ variant="contained"
+ startIcon={<Refresh />}
+ onClick={loadAnalytics}
+ size="small"
+ >
+ Refresh
+ </Button>
</Box>
- <Button variant="contained" startIcon={<Refresh />} onClick={loadAnalytics}
- sx={{ background: 'linear-gradient(135deg, #FF0000, #FF4444)' }}>Refresh</Button>
+ </MainCard>
+
+ {/* Tabs */}
+ <Box sx={{ borderBottom: `1px solid ${GREY.A800}`, mb: 3 }}>
+ <Tabs
+ value={tabValue}
+ onChange={(_, v) => setTabValue(v)}
+ variant="scrollable"
+ scrollButtons="auto"
+ sx={{ minHeight: 46 }}
+ >
+ {TABS.map(label => <Tab key={label} label={label} />)}
+ </Tabs>
</Box>
- {/* Navigation Tabs */}
- <Tabs value={tabValue} onChange={(_, v) => setTabValue(v)} sx={{ mb: 3 }}
- textColor="inherit" TabIndicatorProps={{ sx: { bgcolor: '#FF0000' } }}
- variant="scrollable" scrollButtons="auto">
- <Tab label="Overview" />
- <Tab label="Videos" />
- <Tab label="Engagement" />
- <Tab label="Content" />
- <Tab label="Publishing" />
- <Tab label="Growth" />
- <Tab label="Shorts vs Regular" />
- <Tab label="Tags & SEO" />
- </Tabs>
-
{/* TAB 0: Overview */}
{tabValue === 0 && (
<Box>
- {/* Primary KPIs */}
- <Grid container spacing={2} sx={{ mb: 3 }}>
- <Grid size={{ xs: 6, sm: 4, md: 2 }}>
- <StatCard icon={<Visibility />} label="Total Views" value={fmtNum(channel.viewCount)} subtitle={fmtNumFull(channel.viewCount)} gradient="red" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 2 }}>
- <StatCard icon={<People />} label="Subscribers" value={fmtNum(channel.subscriberCount)} subtitle={fmtNumFull(channel.subscriberCount)} gradient="green" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 2 }}>
- <StatCard icon={<VideoLibrary />} label="Total Videos" value={fmtNum(channel.videoCount)} subtitle={`${analytics.totalVideos} analyzed`} gradient="orange" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 2 }}>
- <StatCard icon={<ThumbUp />} label="Total Likes" value={fmtNum(analytics.totalLikes)} subtitle={fmtNumFull(analytics.totalLikes)} gradient="blue" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 2 }}>
- <StatCard icon={<Comment />} label="Total Comments" value={fmtNum(analytics.totalComments)} subtitle={fmtNumFull(analytics.totalComments)} gradient="purple" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 2 }}>
- <StatCard icon={<TrendingUp />} label="Engagement Rate" value={fmtPercent(analytics.overallEngagementRate)} subtitle="Likes+Comments/Views" gradient="teal" small />
- </Grid>
+ <Grid container spacing={2} sx={{ mb: 2.5 }}>
+ <Grid size={{ xs: 6, sm: 4, md: 2 }}><StatCard icon={<Visibility />} label="Total Views" value={fmtNum(channel.viewCount)} subtitle={fmtNumFull(channel.viewCount)} gradient="red" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 2 }}><StatCard icon={<People />} label="Subscribers" value={fmtNum(channel.subscriberCount)} subtitle={fmtNumFull(channel.subscriberCount)} gradient="green" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 2 }}><StatCard icon={<VideoLibrary />} label="Total Videos" value={fmtNum(channel.videoCount)} subtitle={`${analytics.totalVideos} analyzed`} gradient="orange" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 2 }}><StatCard icon={<ThumbUp />} label="Total Likes" value={fmtNum(analytics.totalLikes)} subtitle={fmtNumFull(analytics.totalLikes)} gradient="blue" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 2 }}><StatCard icon={<Comment />} label="Total Comments" value={fmtNum(analytics.totalComments)} subtitle={fmtNumFull(analytics.totalComments)} gradient="purple" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 2 }}><StatCard icon={<TrendingUp />} label="Engagement Rate" value={fmtPercent(analytics.overallEngagementRate)} subtitle="Likes+Comments/Views" gradient="teal" small /></Grid>
</Grid>
-
- {/* Secondary KPIs */}
- <Grid container spacing={2} sx={{ mb: 3 }}>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<Speed />} label="Avg Views/Video" value={fmtNum(analytics.avgViews)} gradient="cyan" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<ThumbUp />} label="Avg Likes/Video" value={fmtNum(analytics.avgLikes)} gradient="indigo" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<Comment />} label="Avg Comments/Video" value={fmtNum(analytics.avgComments)} gradient="pink" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<QueryStats />} label="Median Views" value={fmtNum(analytics.medianViews)} gradient="amber" small />
- </Grid>
+ <Grid container spacing={2} sx={{ mb: 2.5 }}>
+ <Grid size={{ xs: 6, sm: 4, md: 3 }}><StatCard icon={<Speed />} label="Avg Views/Video" value={fmtNum(analytics.avgViews)} gradient="cyan" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 3 }}><StatCard icon={<ThumbUp />} label="Avg Likes/Video" value={fmtNum(analytics.avgLikes)} gradient="indigo" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 3 }}><StatCard icon={<Comment />} label="Avg Comments" value={fmtNum(analytics.avgComments)} gradient="pink" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 3 }}><StatCard icon={<QueryStats />} label="Median Views" value={fmtNum(analytics.medianViews)} gradient="amber" small /></Grid>
</Grid>
-
- {/* Channel-Level Computed Metrics */}
- <Grid container spacing={2} sx={{ mb: 3 }}>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<Visibility />} label="Views per Subscriber" value={channel.viewsPerSubscriber} gradient="red" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<TrendingUp />} label="Avg Subs Gained/Day" value={fmtNum(channel.avgSubGainPerDay)} gradient="green" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<Visibility />} label="Avg Views/Day" value={fmtNum(channel.avgViewsPerDay)} gradient="blue" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<Timelapse />} label="Avg Duration" value={analytics.avgDurationFormatted} gradient="orange" small />
- </Grid>
+ <Grid container spacing={2} sx={{ mb: 2.5 }}>
+ <Grid size={{ xs: 6, sm: 4, md: 3 }}><StatCard icon={<Visibility />} label="Views/Subscriber" value={channel.viewsPerSubscriber} gradient="red" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 3 }}><StatCard icon={<TrendingUp />} label="Avg Subs/Day" value={fmtNum(channel.avgSubGainPerDay)} gradient="green" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 3 }}><StatCard icon={<Visibility />} label="Avg Views/Day" value={fmtNum(channel.avgViewsPerDay)} gradient="blue" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 3 }}><StatCard icon={<Timelapse />} label="Avg Duration" value={analytics.avgDurationFormatted} gradient="orange" small /></Grid>
</Grid>
-
- <Grid container spacing={2} sx={{ mb: 3 }}>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<CalendarMonth />} label="Est. Monthly Views" value={fmtNum(channel.estimatedMonthlyViews)} gradient="indigo" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<People />} label="Est. Monthly Subs" value={fmtNum(channel.estimatedMonthlySubGain)} gradient="teal" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<Whatshot />} label="Virality Score" value={`${analytics.viralityScore}x`} subtitle="Best vs Average" gradient="pink" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<WorkspacePremium />} label="Consistency Score" value={`${analytics.consistencyScore}/100`} gradient="amber" small />
- </Grid>
+ <Grid container spacing={2} sx={{ mb: 2.5 }}>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<Schedule />} label="Videos (7d)" value={analytics.videosLast7Days} gradient="red" small /></Grid>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<Schedule />} label="Videos (30d)" value={analytics.videosLast30Days} gradient="blue" small /></Grid>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<Schedule />} label="Videos (90d)" value={analytics.videosLast90Days} gradient="green" small /></Grid>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<Schedule />} label="Videos (365d)" value={analytics.videosLast365Days} gradient="orange" small /></Grid>
</Grid>
-
- {/* Recent Activity */}
- <Grid container spacing={2} sx={{ mb: 3 }}>
- <Grid size={{ xs: 6, sm: 3 }}>
- <StatCard icon={<Schedule />} label="Videos Last 7 Days" value={analytics.videosLast7Days} gradient="red" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 3 }}>
- <StatCard icon={<Schedule />} label="Videos Last 30 Days" value={analytics.videosLast30Days} gradient="blue" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 3 }}>
- <StatCard icon={<Schedule />} label="Videos Last 90 Days" value={analytics.videosLast90Days} gradient="green" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 3 }}>
- <StatCard icon={<Schedule />} label="Videos Last Year" value={analytics.videosLast365Days} gradient="orange" small />
- </Grid>
- </Grid>
-
- {/* Upload Frequency */}
<Grid container spacing={2} sx={{ mb: 3 }}>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<Speed />} label="Uploads/Week" value={analytics.uploadFrequencyPerWeek} gradient="purple" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<Speed />} label="Uploads/Month" value={analytics.uploadFrequencyPerMonth} gradient="cyan" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<Timelapse />} label="Total Watch Time" value={fmtNum(analytics.estimatedTotalWatchTimeHours) + 'h'} subtitle="Estimated" gradient="indigo" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<Timelapse />} label="Total Duration" value={analytics.totalDurationFormatted} gradient="amber" small />
- </Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 3 }}><StatCard icon={<CalendarMonth />} label="Est. Monthly Views" value={fmtNum(channel.estimatedMonthlyViews)} gradient="indigo" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 3 }}><StatCard icon={<People />} label="Est. Monthly Subs" value={fmtNum(channel.estimatedMonthlySubGain)} gradient="teal" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 3 }}><StatCard icon={<Whatshot />} label="Virality Score" value={`${analytics.viralityScore}x`} gradient="pink" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 3 }}><StatCard icon={<WorkspacePremium />} label="Consistency" value={`${analytics.consistencyScore}/100`} gradient="amber" small /></Grid>
</Grid>
- {/* Best Performing Videos */}
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2, mt: 1 }}>
- <EmojiEvents sx={{ verticalAlign: 'middle', mr: 1, color: '#FFD700' }} /> Best Performing Videos
+ <Typography variant="h5" sx={{ mb: 2, display: 'flex', alignItems: 'center', gap: 1 }}>
+ <EmojiEvents sx={{ color: '#faad14' }} /> Best Performing Videos
</Typography>
- <Grid container spacing={2} sx={{ mb: 3 }}>
+ <Grid container spacing={2}>
{[
- { label: 'Most Viewed', video: analytics.bestByViews, color: '#FF0000' },
- { label: 'Most Liked', video: analytics.bestByLikes, color: '#4CAF50' },
- { label: 'Most Comments', video: analytics.bestByComments, color: '#3EA6FF' },
- { label: 'Best Engagement', video: analytics.bestByEngagement, color: '#FF9800' },
+ { label: 'Most Viewed', video: analytics.bestByViews, color: C.red },
+ { label: 'Most Liked', video: analytics.bestByLikes, color: C.green },
+ { label: 'Most Comments', video: analytics.bestByComments, color: C.blue },
+ { label: 'Best Engagement', video: analytics.bestByEngagement, color: C.orange },
].map(({ label, video, color }) => video && (
<Grid size={{ xs: 12, sm: 6, md: 3 }} key={label}>
- <Card sx={{ cursor: 'pointer', '&:hover': { transform: 'translateY(-2px)', transition: 'all 0.2s' } }}
- onClick={() => window.open(`https://www.youtube.com/watch?v=${video.videoId}`, '_blank', 'noopener')}>
+ <Card
+ sx={{ cursor: 'pointer', border: `1px solid ${GREY.A800}`, transition: 'box-shadow 0.2s', '&:hover': { boxShadow: '0 4px 16px rgba(0,0,0,0.12)' } }}
+ onClick={() => window.open(`https://www.youtube.com/watch?v=${video.videoId}`, '_blank', 'noopener')}
+ >
<Box sx={{ position: 'relative' }}>
- <Box component="img" src={video.thumbnail} sx={{ width: '100%', aspectRatio: '16/9', objectFit: 'cover' }} />
- <Chip label={label} size="small" sx={{ position: 'absolute', top: 8, left: 8, bgcolor: color, color: '#fff', fontWeight: 600 }} />
- <Box sx={{ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, display: 'flex', alignItems: 'center', justifyContent: 'center', bgcolor: 'rgba(0,0,0,0)', transition: 'all 0.2s', '&:hover': { bgcolor: 'rgba(0,0,0,0.4)' } }}>
- <PlayCircleOutline sx={{ fontSize: 40, color: '#fff', opacity: 0, transition: 'opacity 0.2s', '.MuiCard-root:hover &': { opacity: 1 } }} />
- </Box>
+ <Box component="img" src={video.thumbnail} sx={{ width: '100%', aspectRatio: '16/9', objectFit: 'cover', display: 'block' }} />
+ <Chip label={label} size="small" sx={{ position: 'absolute', top: 8, left: 8, bgcolor: color, color: '#fff', fontWeight: 600, fontSize: '0.7rem' }} />
</Box>
<CardContent sx={{ p: 1.5, '&:last-child': { pb: 1.5 } }}>
<Typography variant="body2" sx={{ fontWeight: 600, mb: 0.5, display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical', overflow: 'hidden' }}>
{video.title}
</Typography>
- <Box sx={{ display: 'flex', gap: 1.5, fontSize: 12, color: 'text.secondary', alignItems: 'center' }}>
- <span>{fmtNum(video.viewCount)} views</span>
- <span>{fmtNum(video.likeCount)} likes</span>
- <span>{fmtNum(video.commentCount)} comments</span>
- </Box>
+ <Typography variant="caption" color="text.secondary">
+ {fmtNum(video.viewCount)} views · {fmtNum(video.likeCount)} likes
+ </Typography>
</CardContent>
</Card>
</Grid>
@@ -271,39 +257,34 @@ export default function ChannelAnalytics({ account, showToast, onBack }) {
{/* TAB 1: Videos */}
{tabValue === 1 && (
<Box>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2 }}>
- Top 10 Videos by Views
- </Typography>
- <Card sx={{ mb: 3 }}>
- <CardContent>
- <ResponsiveContainer width="100%" height={350}>
- <BarChart data={(analytics.top10ByViews || []).map(v => ({ name: v?.title?.substring(0, 30) + '...', views: v?.viewCount || 0, likes: v?.likeCount || 0 }))}>
- <CartesianGrid strokeDasharray="3 3" stroke="rgba(255,255,255,0.06)" />
- <XAxis dataKey="name" tick={{ fill: '#aaa', fontSize: 10 }} angle={-20} textAnchor="end" height={80} />
- <YAxis tick={{ fill: '#aaa', fontSize: 12 }} tickFormatter={fmtNum} />
- <ReTooltip contentStyle={{ backgroundColor: '#1A1A1A', border: '1px solid rgba(255,255,255,0.1)', borderRadius: 8 }} formatter={v => fmtNumFull(v)} />
- <Bar dataKey="views" fill="#FF0000" radius={[6, 6, 0, 0]} name="Views" />
- <Bar dataKey="likes" fill="#4CAF50" radius={[6, 6, 0, 0]} name="Likes" />
- </BarChart>
- </ResponsiveContainer>
- </CardContent>
- </Card>
-
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2 }}>All Videos</Typography>
- <Card>
- <TableContainer sx={{ maxHeight: 600 }}>
+ <ChartCard title="Top 10 Videos by Views" sx={{ mb: 2.5 }}>
+ <ResponsiveContainer width="100%" height={320}>
+ <BarChart data={(analytics.top10ByViews || []).map(v => ({ name: (v?.title || '').slice(0, 28) + '…', views: v?.viewCount || 0, likes: v?.likeCount || 0 }))}>
+ <CartesianGrid strokeDasharray="3 3" stroke={GREY[200]} vertical={false} />
+ <XAxis dataKey="name" tick={{ fill: GREY[500], fontSize: 10 }} angle={-15} textAnchor="end" height={70} />
+ <YAxis tick={{ fill: GREY[500], fontSize: 12 }} tickFormatter={fmtNum} axisLine={false} tickLine={false} />
+ <ReTooltip contentStyle={tooltipStyle} formatter={v => fmtNumFull(v)} />
+ <Bar dataKey="views" fill={C.red} radius={[4, 4, 0, 0]} name="Views" />
+ <Bar dataKey="likes" fill={C.green} radius={[4, 4, 0, 0]} name="Likes" />
+ <Legend />
+ </BarChart>
+ </ResponsiveContainer>
+ </ChartCard>
+
+ <MainCard title="Video List" content={false}>
+ <TableContainer sx={{ maxHeight: 560 }}>
<Table size="small" stickyHeader>
<TableHead>
<TableRow>
- <TableCell sx={{ bgcolor: '#1A1A1A' }}>#</TableCell>
- <TableCell sx={{ bgcolor: '#1A1A1A' }}>Video</TableCell>
- <TableCell align="right" sx={{ bgcolor: '#1A1A1A' }}>Views</TableCell>
- <TableCell align="right" sx={{ bgcolor: '#1A1A1A' }}>Likes</TableCell>
- <TableCell align="right" sx={{ bgcolor: '#1A1A1A' }}>Comments</TableCell>
- <TableCell align="right" sx={{ bgcolor: '#1A1A1A' }}>Engagement</TableCell>
- <TableCell align="right" sx={{ bgcolor: '#1A1A1A' }}>Duration</TableCell>
- <TableCell align="right" sx={{ bgcolor: '#1A1A1A' }}>Published</TableCell>
- <TableCell align="center" sx={{ bgcolor: '#1A1A1A', width: 50 }}>Watch</TableCell>
+ <TableCell>#</TableCell>
+ <TableCell>Video</TableCell>
+ <TableCell align="right">Views</TableCell>
+ <TableCell align="right">Likes</TableCell>
+ <TableCell align="right">Comments</TableCell>
+ <TableCell align="right">Engagement</TableCell>
+ <TableCell align="right">Duration</TableCell>
+ <TableCell align="right">Published</TableCell>
+ <TableCell align="center" sx={{ width: 50 }} />
</TableRow>
</TableHead>
<TableBody>
@@ -313,28 +294,26 @@ export default function ChannelAnalytics({ account, showToast, onBack }) {
.map((v, i) => v && (
<TableRow key={v.videoId} hover sx={{ cursor: 'pointer' }}
onClick={() => window.open(`https://www.youtube.com/watch?v=${v.videoId}`, '_blank', 'noopener')}>
- <TableCell>{i + 1}</TableCell>
+ <TableCell><Typography variant="body2" sx={{ fontWeight: 600, color: 'text.secondary' }}>{i + 1}</Typography></TableCell>
<TableCell>
- <Typography variant="body2" sx={{ fontWeight: 500, maxWidth: 300, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
+ <Typography variant="body2" sx={{ fontWeight: 500, maxWidth: 280, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
{v.title}
</Typography>
</TableCell>
- <TableCell align="right" sx={{ fontWeight: 600 }}>{fmtNum(v.viewCount)}</TableCell>
- <TableCell align="right">{fmtNum(v.likeCount)}</TableCell>
- <TableCell align="right">{fmtNum(v.commentCount)}</TableCell>
+ <TableCell align="right"><Typography variant="body2" sx={{ fontWeight: 600 }}>{fmtNum(v.viewCount)}</Typography></TableCell>
+ <TableCell align="right"><Typography variant="body2">{fmtNum(v.likeCount)}</Typography></TableCell>
+ <TableCell align="right"><Typography variant="body2">{fmtNum(v.commentCount)}</Typography></TableCell>
<TableCell align="right">
<Chip label={fmtPercent(v.engagementRate)} size="small"
- sx={{ bgcolor: parseFloat(v.engagementRate) > 5 ? 'rgba(76,175,80,0.15)' : 'rgba(255,255,255,0.05)', color: parseFloat(v.engagementRate) > 5 ? '#4CAF50' : 'text.secondary', fontWeight: 600, fontSize: 12 }} />
- </TableCell>
- <TableCell align="right">{fmtDuration(v.durationSeconds)}</TableCell>
- <TableCell align="right">
- <Typography variant="caption" sx={{ color: 'text.secondary' }}>{fmtDate(v.publishedAt)}</Typography>
+ sx={{ bgcolor: parseFloat(v.engagementRate) > 5 ? '#f6ffed' : GREY[100], color: parseFloat(v.engagementRate) > 5 ? '#389e0d' : 'text.secondary', fontWeight: 600, fontSize: '0.7rem', height: 20 }} />
</TableCell>
+ <TableCell align="right"><Typography variant="body2">{fmtDuration(v.durationSeconds)}</Typography></TableCell>
+ <TableCell align="right"><Typography variant="caption" color="text.secondary">{fmtDate(v.publishedAt)}</Typography></TableCell>
<TableCell align="center">
<Tooltip title="Watch on YouTube">
<IconButton size="small" onClick={(e) => { e.stopPropagation(); window.open(`https://www.youtube.com/watch?v=${v.videoId}`, '_blank', 'noopener'); }}
- sx={{ color: '#FF0000', '&:hover': { bgcolor: 'rgba(255,0,0,0.1)' } }}>
- <PlayCircleOutline fontSize="small" />
+ sx={{ color: '#ff4d4f', '&:hover': { bgcolor: '#fff1f0' } }}>
+ <PlayCircleOutline sx={{ fontSize: 16 }} />
</IconButton>
</Tooltip>
</TableCell>
@@ -343,247 +322,171 @@ export default function ChannelAnalytics({ account, showToast, onBack }) {
</TableBody>
</Table>
</TableContainer>
- </Card>
+ </MainCard>
</Box>
)}
{/* TAB 2: Engagement */}
{tabValue === 2 && (
<Box>
- <Grid container spacing={2} sx={{ mb: 3 }}>
- <Grid size={{ xs: 6, sm: 4, md: 2 }}>
- <StatCard icon={<ThumbUp />} label="Total Engagement" value={fmtNum(analytics.totalEngagement)} gradient="blue" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 2 }}>
- <StatCard icon={<TrendingUp />} label="Engagement Rate" value={fmtPercent(analytics.overallEngagementRate)} gradient="green" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 2 }}>
- <StatCard icon={<ThumbUp />} label="Avg Like Rate" value={analytics.totalViews > 0 ? fmtPercent((analytics.totalLikes / analytics.totalViews * 100)) : '0%'} gradient="red" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 2 }}>
- <StatCard icon={<Comment />} label="Avg Comment Rate" value={analytics.totalViews > 0 ? fmtPercent((analytics.totalComments / analytics.totalViews * 100)) : '0%'} gradient="purple" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 2 }}>
- <StatCard icon={<Whatshot />} label="Virality Score" value={`${analytics.viralityScore}x`} gradient="orange" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 2 }}>
- <StatCard icon={<SignalCellularAlt />} label="Like/Comment Ratio" value={analytics.totalComments > 0 ? (analytics.totalLikes / analytics.totalComments).toFixed(1) + ':1' : 'N/A'} gradient="teal" small />
- </Grid>
+ <Grid container spacing={2} sx={{ mb: 2.5 }}>
+ <Grid size={{ xs: 6, sm: 4, md: 2 }}><StatCard icon={<ThumbUp />} label="Total Engagement" value={fmtNum(analytics.totalEngagement)} gradient="blue" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 2 }}><StatCard icon={<TrendingUp />} label="Engagement Rate" value={fmtPercent(analytics.overallEngagementRate)} gradient="green" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 2 }}><StatCard icon={<ThumbUp />} label="Avg Like Rate" value={analytics.totalViews > 0 ? fmtPercent(analytics.totalLikes / analytics.totalViews * 100) : '0%'} gradient="red" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 2 }}><StatCard icon={<Comment />} label="Avg Comment Rate" value={analytics.totalViews > 0 ? fmtPercent(analytics.totalComments / analytics.totalViews * 100) : '0%'} gradient="purple" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 2 }}><StatCard icon={<Whatshot />} label="Virality Score" value={`${analytics.viralityScore}x`} gradient="orange" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 2 }}><StatCard icon={<SignalCellularAlt />} label="Like/Comment Ratio" value={analytics.totalComments > 0 ? (analytics.totalLikes / analytics.totalComments).toFixed(1) + ':1' : 'N/A'} gradient="teal" small /></Grid>
</Grid>
-
- <Grid container spacing={2.5}>
+ <Grid container spacing={2.5} sx={{ mb: 2.5 }}>
<Grid size={{ xs: 12, md: 6 }}>
- <Card>
- <CardContent>
- <Typography variant="h6" sx={{ mb: 2, fontWeight: 600 }}>Engagement Rate Trend</Typography>
- <ResponsiveContainer width="100%" height={300}>
- <AreaChart data={(analytics.engagementTrend || [])}>
- <CartesianGrid strokeDasharray="3 3" stroke="rgba(255,255,255,0.06)" />
- <XAxis dataKey="month" tick={{ fill: '#aaa', fontSize: 11 }} />
- <YAxis tick={{ fill: '#aaa', fontSize: 11 }} tickFormatter={v => v + '%'} />
- <ReTooltip contentStyle={{ backgroundColor: '#1A1A1A', border: '1px solid rgba(255,255,255,0.1)', borderRadius: 8 }} />
- <Area type="monotone" dataKey="value" stroke="#4CAF50" fill="rgba(76,175,80,0.15)" strokeWidth={2} name="Engagement %" />
- </AreaChart>
- </ResponsiveContainer>
- </CardContent>
- </Card>
+ <ChartCard title="Engagement Rate Trend">
+ <ResponsiveContainer width="100%" height={280}>
+ <AreaChart data={analytics.engagementTrend || []}>
+ <defs><linearGradient id="egGrad" x1="0" y1="0" x2="0" y2="1"><stop offset="5%" stopColor={C.green} stopOpacity={0.15} /><stop offset="95%" stopColor={C.green} stopOpacity={0.01} /></linearGradient></defs>
+ <CartesianGrid strokeDasharray="3 3" stroke={GREY[200]} vertical={false} />
+ <XAxis dataKey="month" tick={{ fill: GREY[500], fontSize: 11 }} axisLine={false} tickLine={false} />
+ <YAxis tick={{ fill: GREY[500], fontSize: 11 }} tickFormatter={v => v + '%'} axisLine={false} tickLine={false} />
+ <ReTooltip contentStyle={tooltipStyle} />
+ <Area type="monotone" dataKey="value" stroke={C.green} fill="url(#egGrad)" strokeWidth={2} name="Engagement %" />
+ </AreaChart>
+ </ResponsiveContainer>
+ </ChartCard>
</Grid>
<Grid size={{ xs: 12, md: 6 }}>
- <Card>
- <CardContent>
- <Typography variant="h6" sx={{ mb: 2, fontWeight: 600 }}>Like Rate Trend</Typography>
- <ResponsiveContainer width="100%" height={300}>
- <AreaChart data={(analytics.likeRateTrend || [])}>
- <CartesianGrid strokeDasharray="3 3" stroke="rgba(255,255,255,0.06)" />
- <XAxis dataKey="month" tick={{ fill: '#aaa', fontSize: 11 }} />
- <YAxis tick={{ fill: '#aaa', fontSize: 11 }} tickFormatter={v => v + '%'} />
- <ReTooltip contentStyle={{ backgroundColor: '#1A1A1A', border: '1px solid rgba(255,255,255,0.1)', borderRadius: 8 }} />
- <Area type="monotone" dataKey="value" stroke="#FF0000" fill="rgba(255,0,0,0.1)" strokeWidth={2} name="Like Rate %" />
- </AreaChart>
- </ResponsiveContainer>
- </CardContent>
- </Card>
+ <ChartCard title="Like Rate Trend">
+ <ResponsiveContainer width="100%" height={280}>
+ <AreaChart data={analytics.likeRateTrend || []}>
+ <defs><linearGradient id="lrGrad" x1="0" y1="0" x2="0" y2="1"><stop offset="5%" stopColor={C.red} stopOpacity={0.12} /><stop offset="95%" stopColor={C.red} stopOpacity={0.01} /></linearGradient></defs>
+ <CartesianGrid strokeDasharray="3 3" stroke={GREY[200]} vertical={false} />
+ <XAxis dataKey="month" tick={{ fill: GREY[500], fontSize: 11 }} axisLine={false} tickLine={false} />
+ <YAxis tick={{ fill: GREY[500], fontSize: 11 }} tickFormatter={v => v + '%'} axisLine={false} tickLine={false} />
+ <ReTooltip contentStyle={tooltipStyle} />
+ <Area type="monotone" dataKey="value" stroke={C.red} fill="url(#lrGrad)" strokeWidth={2} name="Like Rate %" />
+ </AreaChart>
+ </ResponsiveContainer>
+ </ChartCard>
</Grid>
</Grid>
-
- <Card sx={{ mt: 2.5 }}>
- <CardContent>
- <Typography variant="h6" sx={{ mb: 2, fontWeight: 600 }}>Top 10 by Engagement Rate</Typography>
- <TableContainer>
- <Table size="small">
- <TableHead>
- <TableRow>
- <TableCell>#</TableCell>
- <TableCell>Video</TableCell>
- <TableCell align="right">Views</TableCell>
- <TableCell align="right">Likes</TableCell>
- <TableCell align="right">Comments</TableCell>
- <TableCell align="right">Engagement Rate</TableCell>
- <TableCell align="center" sx={{ width: 50 }}>Watch</TableCell>
+ <MainCard title="Top 10 by Engagement Rate" content={false}>
+ <TableContainer>
+ <Table size="small">
+ <TableHead>
+ <TableRow>
+ <TableCell>#</TableCell><TableCell>Video</TableCell><TableCell align="right">Views</TableCell>
+ <TableCell align="right">Likes</TableCell><TableCell align="right">Comments</TableCell>
+ <TableCell align="right">Eng. Rate</TableCell><TableCell align="center" sx={{ width: 50 }} />
+ </TableRow>
+ </TableHead>
+ <TableBody>
+ {(analytics.top10ByEngagement || []).map((v, i) => v && (
+ <TableRow key={v.videoId} hover sx={{ cursor: 'pointer' }} onClick={() => window.open(`https://www.youtube.com/watch?v=${v.videoId}`, '_blank', 'noopener')}>
+ <TableCell><Typography variant="body2" sx={{ fontWeight: 600, color: 'text.secondary' }}>{i + 1}</Typography></TableCell>
+ <TableCell><Typography variant="body2" sx={{ fontWeight: 500, maxWidth: 320, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{v.title}</Typography></TableCell>
+ <TableCell align="right"><Typography variant="body2">{fmtNum(v.viewCount)}</Typography></TableCell>
+ <TableCell align="right"><Typography variant="body2">{fmtNum(v.likeCount)}</Typography></TableCell>
+ <TableCell align="right"><Typography variant="body2">{fmtNum(v.commentCount)}</Typography></TableCell>
+ <TableCell align="right"><Chip label={fmtPercent(v.engagementRate)} size="small" sx={{ bgcolor: '#f6ffed', color: '#389e0d', fontWeight: 600, fontSize: '0.7rem', height: 20 }} /></TableCell>
+ <TableCell align="center">
+ <Tooltip title="Watch on YouTube"><IconButton size="small" onClick={(e) => { e.stopPropagation(); window.open(`https://www.youtube.com/watch?v=${v.videoId}`, '_blank', 'noopener'); }} sx={{ color: '#ff4d4f', '&:hover': { bgcolor: '#fff1f0' } }}><PlayCircleOutline sx={{ fontSize: 16 }} /></IconButton></Tooltip>
+ </TableCell>
</TableRow>
- </TableHead>
- <TableBody>
- {(analytics.top10ByEngagement || []).map((v, i) => v && (
- <TableRow key={v.videoId} hover sx={{ cursor: 'pointer' }}
- onClick={() => window.open(`https://www.youtube.com/watch?v=${v.videoId}`, '_blank', 'noopener')}>
- <TableCell>{i + 1}</TableCell>
- <TableCell>
- <Typography variant="body2" sx={{ fontWeight: 500, maxWidth: 350, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
- {v.title}
- </Typography>
- </TableCell>
- <TableCell align="right">{fmtNum(v.viewCount)}</TableCell>
- <TableCell align="right">{fmtNum(v.likeCount)}</TableCell>
- <TableCell align="right">{fmtNum(v.commentCount)}</TableCell>
- <TableCell align="right">
- <Chip label={fmtPercent(v.engagementRate)} size="small"
- sx={{ bgcolor: 'rgba(76,175,80,0.15)', color: '#4CAF50', fontWeight: 600 }} />
- </TableCell>
- <TableCell align="center">
- <Tooltip title="Watch on YouTube">
- <IconButton size="small" onClick={(e) => { e.stopPropagation(); window.open(`https://www.youtube.com/watch?v=${v.videoId}`, '_blank', 'noopener'); }}
- sx={{ color: '#FF0000', '&:hover': { bgcolor: 'rgba(255,0,0,0.1)' } }}>
- <PlayCircleOutline fontSize="small" />
- </IconButton>
- </Tooltip>
- </TableCell>
- </TableRow>
- ))}
- </TableBody>
- </Table>
- </TableContainer>
- </CardContent>
- </Card>
+ ))}
+ </TableBody>
+ </Table>
+ </TableContainer>
+ </MainCard>
</Box>
)}
{/* TAB 3: Content */}
{tabValue === 3 && (
<Box>
- <Grid container spacing={2} sx={{ mb: 3 }}>
- <Grid size={{ xs: 6, sm: 4, md: 2 }}>
- <StatCard icon={<HighQuality />} label="HD Videos" value={analytics.hdCount} subtitle={fmtPercent(analytics.hdPercentage)} gradient="blue" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 2 }}>
- <StatCard icon={<ClosedCaption />} label="With Captions" value={analytics.captionCount} subtitle={fmtPercent(analytics.captionPercentage)} gradient="green" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 2 }}>
- <StatCard icon={<WorkspacePremium />} label="Licensed" value={analytics.licensedCount} subtitle={fmtPercent(analytics.licensedPercentage)} gradient="purple" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 2 }}>
- <StatCard icon={<VideoLibrary />} label="Embeddable" value={analytics.embeddableCount} subtitle={fmtPercent(analytics.embeddablePercentage)} gradient="orange" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 2 }}>
- <StatCard icon={<People />} label="Made for Kids" value={analytics.madeForKidsCount} gradient="cyan" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 2 }}>
- <StatCard icon={<Timelapse />} label="Avg Duration" value={analytics.avgDurationFormatted} gradient="amber" small />
- </Grid>
+ <Grid container spacing={2} sx={{ mb: 2.5 }}>
+ <Grid size={{ xs: 6, sm: 4, md: 2 }}><StatCard icon={<HighQuality />} label="HD Videos" value={analytics.hdCount} subtitle={fmtPercent(analytics.hdPercentage)} gradient="blue" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 2 }}><StatCard icon={<ClosedCaption />} label="Captions" value={analytics.captionCount} subtitle={fmtPercent(analytics.captionPercentage)} gradient="green" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 2 }}><StatCard icon={<WorkspacePremium />} label="Licensed" value={analytics.licensedCount} subtitle={fmtPercent(analytics.licensedPercentage)} gradient="purple" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 2 }}><StatCard icon={<VideoLibrary />} label="Embeddable" value={analytics.embeddableCount} subtitle={fmtPercent(analytics.embeddablePercentage)} gradient="orange" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 2 }}><StatCard icon={<People />} label="Kids Content" value={analytics.madeForKidsCount} gradient="cyan" small /></Grid>
+ <Grid size={{ xs: 6, sm: 4, md: 2 }}><StatCard icon={<Timelapse />} label="Avg Duration" value={analytics.avgDurationFormatted} gradient="amber" small /></Grid>
</Grid>
-
- <Grid container spacing={2.5}>
+ <Grid container spacing={2.5} sx={{ mb: 2.5 }}>
<Grid size={{ xs: 12, md: 6 }}>
- <Card>
- <CardContent>
- <Typography variant="h6" sx={{ mb: 2, fontWeight: 600 }}>Duration Distribution</Typography>
- <ResponsiveContainer width="100%" height={300}>
- <PieChart>
- <Pie data={durationData} dataKey="value" nameKey="name" cx="50%" cy="50%" outerRadius={100} innerRadius={55} paddingAngle={4}>
- {durationData.map((d, i) => <Cell key={i} fill={d.color} />)}
- </Pie>
- <ReTooltip contentStyle={{ backgroundColor: '#1A1A1A', border: '1px solid rgba(255,255,255,0.1)', borderRadius: 8 }} />
- <Legend />
- </PieChart>
- </ResponsiveContainer>
- </CardContent>
- </Card>
+ <ChartCard title="Duration Distribution">
+ <ResponsiveContainer width="100%" height={280}>
+ <PieChart>
+ <Pie data={durationData} dataKey="value" nameKey="name" cx="50%" cy="50%" outerRadius={95} innerRadius={50} paddingAngle={3} strokeWidth={0}>
+ {durationData.map((d, i) => <Cell key={i} fill={d.color} />)}
+ </Pie>
+ <ReTooltip contentStyle={tooltipStyle} />
+ <Legend iconType="circle" iconSize={8} wrapperStyle={{ fontSize: 12 }} />
+ </PieChart>
+ </ResponsiveContainer>
+ </ChartCard>
</Grid>
<Grid size={{ xs: 12, md: 6 }}>
- <Card>
- <CardContent>
- <Typography variant="h6" sx={{ mb: 2, fontWeight: 600 }}>Category Distribution</Typography>
- <ResponsiveContainer width="100%" height={300}>
- <BarChart data={catData} layout="vertical">
- <CartesianGrid strokeDasharray="3 3" stroke="rgba(255,255,255,0.06)" />
- <XAxis type="number" tick={{ fill: '#aaa', fontSize: 12 }} />
- <YAxis dataKey="name" type="category" tick={{ fill: '#aaa', fontSize: 12 }} width={120} />
- <ReTooltip contentStyle={{ backgroundColor: '#1A1A1A', border: '1px solid rgba(255,255,255,0.1)', borderRadius: 8 }} />
- <Bar dataKey="value" fill="#3EA6FF" radius={[0, 6, 6, 0]} name="Videos" />
- </BarChart>
- </ResponsiveContainer>
- </CardContent>
- </Card>
+ <ChartCard title="Category Distribution">
+ <ResponsiveContainer width="100%" height={280}>
+ <BarChart data={catData} layout="vertical">
+ <CartesianGrid strokeDasharray="3 3" stroke={GREY[200]} horizontal={false} />
+ <XAxis type="number" tick={{ fill: GREY[500], fontSize: 12 }} axisLine={false} tickLine={false} />
+ <YAxis dataKey="name" type="category" tick={{ fill: GREY[500], fontSize: 11 }} width={110} axisLine={false} tickLine={false} />
+ <ReTooltip contentStyle={tooltipStyle} />
+ <Bar dataKey="value" fill={C.blue} radius={[0, 4, 4, 0]} name="Videos" />
+ </BarChart>
+ </ResponsiveContainer>
+ </ChartCard>
</Grid>
</Grid>
-
- {/* Views Distribution */}
- <Card sx={{ mt: 2.5 }}>
- <CardContent>
- <Typography variant="h6" sx={{ mb: 2, fontWeight: 600 }}>Views Distribution</Typography>
- <ResponsiveContainer width="100%" height={280}>
- <BarChart data={(analytics.viewsDistribution?.ranges || []).map((r, i) => ({ range: r, count: analytics.viewsDistribution.counts[i] || 0 }))}>
- <CartesianGrid strokeDasharray="3 3" stroke="rgba(255,255,255,0.06)" />
- <XAxis dataKey="range" tick={{ fill: '#aaa', fontSize: 10 }} angle={-20} textAnchor="end" height={60} />
- <YAxis tick={{ fill: '#aaa', fontSize: 12 }} />
- <ReTooltip contentStyle={{ backgroundColor: '#1A1A1A', border: '1px solid rgba(255,255,255,0.1)', borderRadius: 8 }} />
- <Bar dataKey="count" fill="#FF9800" radius={[6, 6, 0, 0]} name="Videos" />
- </BarChart>
- </ResponsiveContainer>
- </CardContent>
- </Card>
+ <ChartCard title="Views Distribution">
+ <ResponsiveContainer width="100%" height={260}>
+ <BarChart data={(analytics.viewsDistribution?.ranges || []).map((r, i) => ({ range: r, count: analytics.viewsDistribution.counts[i] || 0 }))}>
+ <CartesianGrid strokeDasharray="3 3" stroke={GREY[200]} vertical={false} />
+ <XAxis dataKey="range" tick={{ fill: GREY[500], fontSize: 10 }} angle={-15} textAnchor="end" height={60} />
+ <YAxis tick={{ fill: GREY[500], fontSize: 12 }} axisLine={false} tickLine={false} />
+ <ReTooltip contentStyle={tooltipStyle} />
+ <Bar dataKey="count" fill={C.orange} radius={[4, 4, 0, 0]} name="Videos" />
+ </BarChart>
+ </ResponsiveContainer>
+ </ChartCard>
</Box>
)}
{/* TAB 4: Publishing */}
{tabValue === 4 && (
<Box>
- <Grid container spacing={2} sx={{ mb: 3 }}>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<CalendarMonth />} label="Peak Publish Day" value={analytics.peakPublishDay || 'N/A'} gradient="blue" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<AccessTime />} label="Peak Publish Hour" value={analytics.peakPublishHour !== undefined ? `${analytics.peakPublishHour}:00 UTC` : 'N/A'} gradient="green" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<Speed />} label="Uploads/Week" value={analytics.uploadFrequencyPerWeek} gradient="orange" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<WorkspacePremium />} label="Consistency" value={`${analytics.consistencyScore}/100`} gradient="purple" small />
- </Grid>
+ <Grid container spacing={2} sx={{ mb: 2.5 }}>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<CalendarMonth />} label="Peak Publish Day" value={analytics.peakPublishDay || 'N/A'} gradient="blue" small /></Grid>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<AccessTime />} label="Peak Publish Hour" value={analytics.peakPublishHour !== undefined ? `${analytics.peakPublishHour}:00 UTC` : 'N/A'} gradient="green" small /></Grid>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<Speed />} label="Uploads/Week" value={analytics.uploadFrequencyPerWeek} gradient="orange" small /></Grid>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<WorkspacePremium />} label="Consistency" value={`${analytics.consistencyScore}/100`} gradient="purple" small /></Grid>
</Grid>
-
<Grid container spacing={2.5}>
<Grid size={{ xs: 12, md: 6 }}>
- <Card>
- <CardContent>
- <Typography variant="h6" sx={{ mb: 2, fontWeight: 600 }}>Publish Day Distribution</Typography>
- <ResponsiveContainer width="100%" height={300}>
- <BarChart data={dayData}>
- <CartesianGrid strokeDasharray="3 3" stroke="rgba(255,255,255,0.06)" />
- <XAxis dataKey="day" tick={{ fill: '#aaa', fontSize: 12 }} />
- <YAxis tick={{ fill: '#aaa', fontSize: 12 }} />
- <ReTooltip contentStyle={{ backgroundColor: '#1A1A1A', border: '1px solid rgba(255,255,255,0.1)', borderRadius: 8 }} />
- <Bar dataKey="count" fill="#3EA6FF" radius={[6, 6, 0, 0]} name="Videos" />
- </BarChart>
- </ResponsiveContainer>
- </CardContent>
- </Card>
+ <ChartCard title="Publish Day Distribution">
+ <ResponsiveContainer width="100%" height={280}>
+ <BarChart data={dayData}>
+ <CartesianGrid strokeDasharray="3 3" stroke={GREY[200]} vertical={false} />
+ <XAxis dataKey="day" tick={{ fill: GREY[500], fontSize: 12 }} axisLine={false} tickLine={false} />
+ <YAxis tick={{ fill: GREY[500], fontSize: 12 }} axisLine={false} tickLine={false} />
+ <ReTooltip contentStyle={tooltipStyle} />
+ <Bar dataKey="count" fill={C.blue} radius={[4, 4, 0, 0]} name="Videos" />
+ </BarChart>
+ </ResponsiveContainer>
+ </ChartCard>
</Grid>
<Grid size={{ xs: 12, md: 6 }}>
- <Card>
- <CardContent>
- <Typography variant="h6" sx={{ mb: 2, fontWeight: 600 }}>Publish Hour Distribution (UTC)</Typography>
- <ResponsiveContainer width="100%" height={300}>
- <AreaChart data={hourData}>
- <CartesianGrid strokeDasharray="3 3" stroke="rgba(255,255,255,0.06)" />
- <XAxis dataKey="hour" tick={{ fill: '#aaa', fontSize: 11 }} />
- <YAxis tick={{ fill: '#aaa', fontSize: 12 }} />
- <ReTooltip contentStyle={{ backgroundColor: '#1A1A1A', border: '1px solid rgba(255,255,255,0.1)', borderRadius: 8 }} />
- <Area type="monotone" dataKey="count" stroke="#FF9800" fill="rgba(255,152,0,0.15)" strokeWidth={2} name="Videos" />
- </AreaChart>
- </ResponsiveContainer>
- </CardContent>
- </Card>
+ <ChartCard title="Publish Hour Distribution (UTC)">
+ <ResponsiveContainer width="100%" height={280}>
+ <AreaChart data={hourData}>
+ <defs><linearGradient id="hourGrad" x1="0" y1="0" x2="0" y2="1"><stop offset="5%" stopColor={C.orange} stopOpacity={0.15} /><stop offset="95%" stopColor={C.orange} stopOpacity={0.01} /></linearGradient></defs>
+ <CartesianGrid strokeDasharray="3 3" stroke={GREY[200]} vertical={false} />
+ <XAxis dataKey="hour" tick={{ fill: GREY[500], fontSize: 11 }} axisLine={false} tickLine={false} />
+ <YAxis tick={{ fill: GREY[500], fontSize: 12 }} axisLine={false} tickLine={false} />
+ <ReTooltip contentStyle={tooltipStyle} />
+ <Area type="monotone" dataKey="count" stroke={C.orange} fill="url(#hourGrad)" strokeWidth={2} name="Videos" />
+ </AreaChart>
+ </ResponsiveContainer>
+ </ChartCard>
</Grid>
</Grid>
</Box>
@@ -592,127 +495,79 @@ export default function ChannelAnalytics({ account, showToast, onBack }) {
{/* TAB 5: Growth */}
{tabValue === 5 && (
<Box>
- <Grid container spacing={2} sx={{ mb: 3 }}>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<TrendingUp />} label="Est. Yearly Views" value={fmtNum(channel.estimatedYearlyViews)} gradient="red" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<People />} label="Est. Yearly Subs" value={fmtNum(channel.estimatedYearlySubGain)} gradient="green" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<Visibility />} label="Views/Day Avg" value={fmtNum(channel.avgViewsPerDay)} gradient="blue" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<Subscriptions />} label="Subs/Day Avg" value={fmtNum(channel.avgSubGainPerDay)} gradient="purple" small />
- </Grid>
+ <Grid container spacing={2} sx={{ mb: 2.5 }}>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<TrendingUp />} label="Est. Yearly Views" value={fmtNum(channel.estimatedYearlyViews)} gradient="red" small /></Grid>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<People />} label="Est. Yearly Subs" value={fmtNum(channel.estimatedYearlySubGain)} gradient="green" small /></Grid>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<Visibility />} label="Views/Day Avg" value={fmtNum(channel.avgViewsPerDay)} gradient="blue" small /></Grid>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<Subscriptions />} label="Subs/Day Avg" value={fmtNum(channel.avgSubGainPerDay)} gradient="purple" small /></Grid>
</Grid>
-
- <Card sx={{ mb: 2.5 }}>
- <CardContent>
- <Typography variant="h6" sx={{ mb: 2, fontWeight: 600 }}>Monthly Views Trend</Typography>
- <ResponsiveContainer width="100%" height={350}>
- <AreaChart data={(analytics.viewsTrend || [])}>
- <CartesianGrid strokeDasharray="3 3" stroke="rgba(255,255,255,0.06)" />
- <XAxis dataKey="month" tick={{ fill: '#aaa', fontSize: 11 }} />
- <YAxis tick={{ fill: '#aaa', fontSize: 11 }} tickFormatter={fmtNum} />
- <ReTooltip contentStyle={{ backgroundColor: '#1A1A1A', border: '1px solid rgba(255,255,255,0.1)', borderRadius: 8 }} formatter={v => fmtNumFull(v)} />
- <Area type="monotone" dataKey="value" stroke="#FF0000" fill="rgba(255,0,0,0.1)" strokeWidth={2} name="Views" />
- </AreaChart>
- </ResponsiveContainer>
- </CardContent>
- </Card>
-
- <Card>
- <CardContent>
- <Typography variant="h6" sx={{ mb: 2, fontWeight: 600 }}>Monthly Upload Count</Typography>
- <ResponsiveContainer width="100%" height={280}>
- <BarChart data={(analytics.viewsTrend || []).map(t => ({ month: t.month, uploads: t.count }))}>
- <CartesianGrid strokeDasharray="3 3" stroke="rgba(255,255,255,0.06)" />
- <XAxis dataKey="month" tick={{ fill: '#aaa', fontSize: 11 }} />
- <YAxis tick={{ fill: '#aaa', fontSize: 12 }} />
- <ReTooltip contentStyle={{ backgroundColor: '#1A1A1A', border: '1px solid rgba(255,255,255,0.1)', borderRadius: 8 }} />
- <Bar dataKey="uploads" fill="#4CAF50" radius={[6, 6, 0, 0]} name="Uploads" />
- </BarChart>
- </ResponsiveContainer>
- </CardContent>
- </Card>
+ <ChartCard title="Monthly Views Trend" sx={{ mb: 2.5 }}>
+ <ResponsiveContainer width="100%" height={320}>
+ <AreaChart data={analytics.viewsTrend || []}>
+ <defs><linearGradient id="viewGrad" x1="0" y1="0" x2="0" y2="1"><stop offset="5%" stopColor={C.red} stopOpacity={0.12} /><stop offset="95%" stopColor={C.red} stopOpacity={0.01} /></linearGradient></defs>
+ <CartesianGrid strokeDasharray="3 3" stroke={GREY[200]} vertical={false} />
+ <XAxis dataKey="month" tick={{ fill: GREY[500], fontSize: 11 }} axisLine={false} tickLine={false} />
+ <YAxis tick={{ fill: GREY[500], fontSize: 11 }} tickFormatter={fmtNum} axisLine={false} tickLine={false} />
+ <ReTooltip contentStyle={tooltipStyle} formatter={v => fmtNumFull(v)} />
+ <Area type="monotone" dataKey="value" stroke={C.red} fill="url(#viewGrad)" strokeWidth={2} name="Views" />
+ </AreaChart>
+ </ResponsiveContainer>
+ </ChartCard>
+ <ChartCard title="Monthly Upload Count">
+ <ResponsiveContainer width="100%" height={260}>
+ <BarChart data={(analytics.viewsTrend || []).map(t => ({ month: t.month, uploads: t.count }))}>
+ <CartesianGrid strokeDasharray="3 3" stroke={GREY[200]} vertical={false} />
+ <XAxis dataKey="month" tick={{ fill: GREY[500], fontSize: 11 }} axisLine={false} tickLine={false} />
+ <YAxis tick={{ fill: GREY[500], fontSize: 12 }} axisLine={false} tickLine={false} />
+ <ReTooltip contentStyle={tooltipStyle} />
+ <Bar dataKey="uploads" fill={C.green} radius={[4, 4, 0, 0]} name="Uploads" />
+ </BarChart>
+ </ResponsiveContainer>
+ </ChartCard>
</Box>
)}
{/* TAB 6: Shorts vs Regular */}
{tabValue === 6 && (
<Box>
- <Grid container spacing={2} sx={{ mb: 3 }}>
- <Grid size={{ xs: 6, sm: 3 }}>
- <StatCard icon={<Whatshot />} label="Shorts Count" value={analytics.shortsCount} gradient="red" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 3 }}>
- <StatCard icon={<VideoLibrary />} label="Regular Videos" value={analytics.regularCount} gradient="blue" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 3 }}>
- <StatCard icon={<Visibility />} label="Avg Short Views" value={fmtNum(analytics.avgShortViews)} gradient="orange" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 3 }}>
- <StatCard icon={<Visibility />} label="Avg Regular Views" value={fmtNum(analytics.avgRegularViews)} gradient="green" small />
- </Grid>
- </Grid>
- <Grid container spacing={2} sx={{ mb: 3 }}>
- <Grid size={{ xs: 6, sm: 3 }}>
- <StatCard icon={<ThumbUp />} label="Avg Short Likes" value={fmtNum(analytics.avgShortLikes)} gradient="pink" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 3 }}>
- <StatCard icon={<ThumbUp />} label="Avg Regular Likes" value={fmtNum(analytics.avgRegularLikes)} gradient="teal" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 3 }}>
- <StatCard icon={<BarChartIcon />} label="Shorts %" value={analytics.totalVideos > 0 ? fmtPercent(analytics.shortsCount / analytics.totalVideos * 100) : '0%'} gradient="purple" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 3 }}>
- <StatCard icon={<BarChartIcon />} label="Regular %" value={analytics.totalVideos > 0 ? fmtPercent(analytics.regularCount / analytics.totalVideos * 100) : '0%'} gradient="indigo" small />
- </Grid>
+ <Grid container spacing={2} sx={{ mb: 2.5 }}>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<Whatshot />} label="Shorts Count" value={analytics.shortsCount} gradient="red" small /></Grid>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<VideoLibrary />} label="Regular Videos" value={analytics.regularCount} gradient="blue" small /></Grid>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<Visibility />} label="Avg Short Views" value={fmtNum(analytics.avgShortViews)} gradient="orange" small /></Grid>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<Visibility />} label="Avg Regular Views" value={fmtNum(analytics.avgRegularViews)} gradient="green" small /></Grid>
</Grid>
-
<Grid container spacing={2.5}>
- <Grid size={{ xs: 12, md: 6 }}>
- <Card>
- <CardContent>
- <Typography variant="h6" sx={{ mb: 2, fontWeight: 600 }}>Content Split</Typography>
- <ResponsiveContainer width="100%" height={300}>
- <PieChart>
- <Pie
- data={[
- { name: 'Shorts', value: analytics.shortsCount, color: '#FF0000' },
- { name: 'Regular', value: analytics.regularCount, color: '#3EA6FF' },
- ].filter(d => d.value > 0)}
- dataKey="value" nameKey="name" cx="50%" cy="50%" outerRadius={100} innerRadius={55} paddingAngle={4}>
- {[{ color: '#FF0000' }, { color: '#3EA6FF' }].map((d, i) => <Cell key={i} fill={d.color} />)}
- </Pie>
- <ReTooltip contentStyle={{ backgroundColor: '#1A1A1A', border: '1px solid rgba(255,255,255,0.1)', borderRadius: 8 }} />
- <Legend />
- </PieChart>
- </ResponsiveContainer>
- </CardContent>
- </Card>
- </Grid>
- <Grid size={{ xs: 12, md: 6 }}>
- <Card>
- <CardContent>
- <Typography variant="h6" sx={{ mb: 2, fontWeight: 600 }}>Performance Comparison</Typography>
- <ResponsiveContainer width="100%" height={300}>
- <BarChart data={[
- { metric: 'Avg Views', Shorts: analytics.avgShortViews, Regular: analytics.avgRegularViews },
- { metric: 'Avg Likes', Shorts: analytics.avgShortLikes, Regular: analytics.avgRegularLikes },
- ]}>
- <CartesianGrid strokeDasharray="3 3" stroke="rgba(255,255,255,0.06)" />
- <XAxis dataKey="metric" tick={{ fill: '#aaa', fontSize: 12 }} />
- <YAxis tick={{ fill: '#aaa', fontSize: 12 }} tickFormatter={fmtNum} />
- <ReTooltip contentStyle={{ backgroundColor: '#1A1A1A', border: '1px solid rgba(255,255,255,0.1)', borderRadius: 8 }} formatter={v => fmtNumFull(v)} />
- <Bar dataKey="Shorts" fill="#FF0000" radius={[6, 6, 0, 0]} />
- <Bar dataKey="Regular" fill="#3EA6FF" radius={[6, 6, 0, 0]} />
- <Legend />
- </BarChart>
- </ResponsiveContainer>
- </CardContent>
- </Card>
+ <Grid size={{ xs: 12, md: 5 }}>
+ <ChartCard title="Content Split">
+ <ResponsiveContainer width="100%" height={280}>
+ <PieChart>
+ <Pie data={[{ name: 'Shorts', value: analytics.shortsCount, color: C.red }, { name: 'Regular', value: analytics.regularCount, color: C.blue }].filter(d => d.value > 0)}
+ dataKey="value" nameKey="name" cx="50%" cy="50%" outerRadius={95} innerRadius={50} paddingAngle={4} strokeWidth={0}>
+ {[{ color: C.red }, { color: C.blue }].map((d, i) => <Cell key={i} fill={d.color} />)}
+ </Pie>
+ <ReTooltip contentStyle={tooltipStyle} />
+ <Legend iconType="circle" iconSize={8} wrapperStyle={{ fontSize: 12 }} />
+ </PieChart>
+ </ResponsiveContainer>
+ </ChartCard>
+ </Grid>
+ <Grid size={{ xs: 12, md: 7 }}>
+ <ChartCard title="Performance Comparison">
+ <ResponsiveContainer width="100%" height={280}>
+ <BarChart data={[
+ { metric: 'Avg Views', Shorts: analytics.avgShortViews, Regular: analytics.avgRegularViews },
+ { metric: 'Avg Likes', Shorts: analytics.avgShortLikes, Regular: analytics.avgRegularLikes },
+ ]}>
+ <CartesianGrid strokeDasharray="3 3" stroke={GREY[200]} vertical={false} />
+ <XAxis dataKey="metric" tick={{ fill: GREY[500], fontSize: 12 }} axisLine={false} tickLine={false} />
+ <YAxis tick={{ fill: GREY[500], fontSize: 12 }} tickFormatter={fmtNum} axisLine={false} tickLine={false} />
+ <ReTooltip contentStyle={tooltipStyle} formatter={v => fmtNumFull(v)} />
+ <Bar dataKey="Shorts" fill={C.red} radius={[4, 4, 0, 0]} />
+ <Bar dataKey="Regular" fill={C.blue} radius={[4, 4, 0, 0]} />
+ <Legend />
+ </BarChart>
+ </ResponsiveContainer>
+ </ChartCard>
</Grid>
</Grid>
</Box>
@@ -721,58 +576,35 @@ export default function ChannelAnalytics({ account, showToast, onBack }) {
{/* TAB 7: Tags & SEO */}
{tabValue === 7 && (
<Box>
- <Grid container spacing={2} sx={{ mb: 3 }}>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<Tag />} label="Unique Tags" value={analytics.tagFrequency?.length || 0} gradient="blue" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<ClosedCaption />} label="Caption Rate" value={fmtPercent(analytics.captionPercentage)} gradient="green" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<HighQuality />} label="HD Rate" value={fmtPercent(analytics.hdPercentage)} gradient="purple" small />
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 3 }}>
- <StatCard icon={<VideoLibrary />} label="Embeddable Rate" value={fmtPercent(analytics.embeddablePercentage)} gradient="orange" small />
- </Grid>
+ <Grid container spacing={2} sx={{ mb: 2.5 }}>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<Tag />} label="Unique Tags" value={analytics.tagFrequency?.length || 0} gradient="blue" small /></Grid>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<ClosedCaption />} label="Caption Rate" value={fmtPercent(analytics.captionPercentage)} gradient="green" small /></Grid>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<HighQuality />} label="HD Rate" value={fmtPercent(analytics.hdPercentage)} gradient="purple" small /></Grid>
+ <Grid size={{ xs: 6, sm: 3 }}><StatCard icon={<VideoLibrary />} label="Embeddable Rate" value={fmtPercent(analytics.embeddablePercentage)} gradient="orange" small /></Grid>
</Grid>
-
- <Card>
- <CardContent>
- <Typography variant="h6" sx={{ mb: 2, fontWeight: 600 }}>
- <Tag sx={{ verticalAlign: 'middle', mr: 1 }} /> Most Used Tags
- </Typography>
- <Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 1 }}>
- {(analytics.tagFrequency || []).map(({ tag, count }, i) => (
- <Chip key={i} label={`${tag} (${count})`} size="small" variant="outlined"
- sx={{
- borderColor: `rgba(${i < 5 ? '255,0,0' : i < 15 ? '62,166,255' : '170,170,170'},${0.4 - i * 0.012})`,
- color: i < 5 ? '#FF4444' : i < 15 ? '#3EA6FF' : '#aaa',
- fontWeight: i < 5 ? 600 : 400,
- fontSize: Math.max(11, 14 - i * 0.15),
- }} />
- ))}
- {(!analytics.tagFrequency || analytics.tagFrequency.length === 0) && (
- <Typography variant="body2" sx={{ color: 'text.secondary' }}>No tags data available</Typography>
- )}
- </Box>
- </CardContent>
- </Card>
-
+ <MainCard title="Most Used Tags" sx={{ mb: 2.5 }}>
+ <Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 1 }}>
+ {(analytics.tagFrequency || []).map(({ tag, count }, i) => (
+ <Chip key={i} label={`${tag} (${count})`} size="small" variant="outlined"
+ sx={{ fontWeight: i < 5 ? 600 : 400, fontSize: Math.max(11, 14 - i * 0.1), borderColor: i < 5 ? PRIMARY.main : GREY[300], color: i < 5 ? PRIMARY.main : 'text.secondary' }} />
+ ))}
+ {(!analytics.tagFrequency || analytics.tagFrequency.length === 0) && (
+ <Typography variant="body2" color="text.secondary">No tags data available</Typography>
+ )}
+ </Box>
+ </MainCard>
{(analytics.tagFrequency || []).length > 0 && (
- <Card sx={{ mt: 2.5 }}>
- <CardContent>
- <Typography variant="h6" sx={{ mb: 2, fontWeight: 600 }}>Tag Usage Frequency</Typography>
- <ResponsiveContainer width="100%" height={400}>
- <BarChart data={(analytics.tagFrequency || []).slice(0, 20)} layout="vertical">
- <CartesianGrid strokeDasharray="3 3" stroke="rgba(255,255,255,0.06)" />
- <XAxis type="number" tick={{ fill: '#aaa', fontSize: 12 }} />
- <YAxis dataKey="tag" type="category" tick={{ fill: '#aaa', fontSize: 11 }} width={150} />
- <ReTooltip contentStyle={{ backgroundColor: '#1A1A1A', border: '1px solid rgba(255,255,255,0.1)', borderRadius: 8 }} />
- <Bar dataKey="count" fill="#FF0000" radius={[0, 6, 6, 0]} name="Usage Count" />
- </BarChart>
- </ResponsiveContainer>
- </CardContent>
- </Card>
+ <ChartCard title="Tag Usage Frequency (Top 20)">
+ <ResponsiveContainer width="100%" height={400}>
+ <BarChart data={(analytics.tagFrequency || []).slice(0, 20)} layout="vertical">
+ <CartesianGrid strokeDasharray="3 3" stroke={GREY[200]} horizontal={false} />
+ <XAxis type="number" tick={{ fill: GREY[500], fontSize: 12 }} axisLine={false} tickLine={false} />
+ <YAxis dataKey="tag" type="category" tick={{ fill: GREY[500], fontSize: 11 }} width={140} axisLine={false} tickLine={false} />
+ <ReTooltip contentStyle={tooltipStyle} />
+ <Bar dataKey="count" fill={C.red} radius={[0, 4, 4, 0]} name="Usage Count" />
+ </BarChart>
+ </ResponsiveContainer>
+ </ChartCard>
)}
</Box>
)}
diff --git a/frontend/src/features/analytics/instagram/InstagramAnalytics.jsx b/frontend/src/features/analytics/instagram/InstagramAnalytics.jsx
index 5641f46..d01529b 100644
--- a/frontend/src/features/analytics/instagram/InstagramAnalytics.jsx
+++ b/frontend/src/features/analytics/instagram/InstagramAnalytics.jsx
@@ -1,39 +1,65 @@
import React, { useState, useEffect } from 'react';
import {
- Box, Typography, Grid, Card, CardContent, Button, Avatar, Chip,
+ Box, Typography, Grid, Button, Avatar, Chip,
CircularProgress, LinearProgress, IconButton, Tooltip, Divider,
Table, TableBody, TableCell, TableContainer, TableHead, TableRow,
} from '@mui/material';
import {
Instagram, ArrowBack, Refresh, Favorite, ChatBubble, People,
- PersonAdd, Photo, Collections, Movie, Link as LinkIcon, OpenInNew,
- TrendingUp, CalendarMonth, Schedule, Speed, Star, ThumbDown,
- Tag, Notes, BarChart as BarChartIcon, Whatshot, WorkspacePremium,
- QueryStats,
+ PersonAdd, Photo, OpenInNew,
+ TrendingUp, CalendarMonth, Schedule, Speed, Star,
+ Tag, Whatshot, WorkspacePremium, QueryStats,
} from '@mui/icons-material';
import {
BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip as ReTooltip,
- ResponsiveContainer, PieChart, Pie, Cell, Legend, LineChart, Line,
+ ResponsiveContainer, PieChart, Pie, Cell, Legend,
AreaChart, Area,
} from 'recharts';
import StatCard from '../../../components/ui/StatCard';
+import MainCard from '../../../components/MainCard';
+import { useAppContext } from '../../../context/AppContext';
+import { useParams, useNavigate } from 'react-router-dom';
import { fmtNum, fmtNumFull, fmtDate, timeAgo } from '../../../utils/formatters';
import { api } from '../../../services/api';
+import { PRIMARY, GREY } from '../../../themes/index';
-const IG_GRADIENT = 'linear-gradient(135deg, #F58529, #DD2A7B, #8134AF, #515BD4)';
const IG_COLORS = ['#F58529', '#DD2A7B', '#8134AF', '#515BD4', '#FEDA77', '#405DE6'];
-const MEDIA_TYPE_NAMES = { IMAGE: 'Photos', VIDEO: 'Videos', CAROUSEL_ALBUM: 'Carousels', REEL: 'Reels' };
+const MEDIA_TYPE_NAMES = { IMAGE: 'Photos', VIDEO: 'Videos', CAROUSEL_ALBUM: 'Carousels', REEL: 'Reels' };
const MEDIA_TYPE_COLORS = { IMAGE: '#F58529', VIDEO: '#DD2A7B', CAROUSEL_ALBUM: '#8134AF', REEL: '#515BD4' };
-const chartTooltipStyle = { background: '#1A1A1A', border: '1px solid rgba(255,255,255,0.1)', borderRadius: 8 };
+const tooltipStyle = {
+ backgroundColor: '#fff',
+ border: `1px solid ${GREY.A800}`,
+ borderRadius: 8,
+ fontSize: 13,
+ fontWeight: 500,
+ color: GREY[700],
+ boxShadow: '0 4px 16px rgba(0,0,0,0.1)',
+};
-export default function InstagramAnalytics({ account, showToast, onBack }) {
- const [loading, setLoading] = useState(true);
- const [profile, setProfile] = useState(null);
- const [analytics, setAnalytics] = useState(null);
+function ChartCard({ title, children, height = 300 }) {
+ return (
+ <MainCard title={title} contentSX={{ p: 2 }}>
+ <ResponsiveContainer width="100%" height={height}>
+ {children}
+ </ResponsiveContainer>
+ </MainCard>
+ );
+}
+
+export default function InstagramAnalytics() {
+ const { id } = useParams();
+ const { accounts, showToast } = useAppContext();
+ const navigate = useNavigate();
+ const account = accounts.find(a => a.id === id);
+
+ const [loading, setLoading] = useState(true);
+ const [profile, setProfile] = useState(null);
+ const [analytics, setAnalytics] = useState(null);
const [refreshing, setRefreshing] = useState(false);
const loadAnalytics = async () => {
+ if (!account) return;
setLoading(true);
try {
const data = await api.getIGAnalytics(account.id);
@@ -46,7 +72,7 @@ export default function InstagramAnalytics({ account, showToast, onBack }) {
}
};
- useEffect(() => { loadAnalytics(); }, [account.id]);
+ useEffect(() => { loadAnalytics(); }, [id]);
const handleRefresh = async () => {
setRefreshing(true);
@@ -61,10 +87,19 @@ export default function InstagramAnalytics({ account, showToast, onBack }) {
}
};
+ if (!account) {
+ return (
+ <Box>
+ <Button startIcon={<ArrowBack />} onClick={() => navigate('/')} sx={{ mb: 2 }}>Back</Button>
+ <Typography color="text.secondary">Account not found.</Typography>
+ </Box>
+ );
+ }
+
if (loading) {
return (
<Box sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center', minHeight: '50vh' }}>
- <CircularProgress sx={{ color: '#DD2A7B' }} />
+ <CircularProgress />
</Box>
);
}
@@ -74,39 +109,41 @@ export default function InstagramAnalytics({ account, showToast, onBack }) {
const mediaTypeData = a.mediaTypeDistribution
? Object.entries(a.mediaTypeDistribution).map(([key, value], i) => ({
- name: MEDIA_TYPE_NAMES[key] || key,
+ name: MEDIA_TYPE_NAMES[key] || key,
value,
color: MEDIA_TYPE_COLORS[key] || IG_COLORS[i % IG_COLORS.length],
}))
: [];
const topPostsData = (a.topPosts || []).slice(0, 8).map((post, i) => ({
- name: `#${i + 1}`,
- likes: post.likeCount,
+ name: `#${i + 1}`,
+ likes: post.likeCount,
comments: post.commentsCount,
- total: post.likeCount + post.commentsCount,
}));
const perfByTypeData = a.performanceByType
? Object.entries(a.performanceByType).map(([type, s]) => ({
- name: MEDIA_TYPE_NAMES[type] || type,
- avgLikes: s.avgLikes,
+ name: MEDIA_TYPE_NAMES[type] || type,
+ avgLikes: s.avgLikes,
avgComments: s.avgComments,
- count: s.count,
- color: MEDIA_TYPE_COLORS[type] || '#999',
+ count: s.count,
+ color: MEDIA_TYPE_COLORS[type] || '#999',
}))
: [];
const dayOfWeekData = (a.postsByDayOfWeek || []).map(d => ({
- name: d.shortDay, posts: d.posts,
+ name: d.shortDay,
+ posts: d.posts,
avgEngagement: d.avgEngagement,
- avgLikes: d.avgLikes,
+ avgLikes: d.avgLikes,
}));
const timelineData = (a.engagementTimeline || []).map(m => ({
- name: m.month, posts: m.posts,
- likes: m.likes, comments: m.comments,
- avgLikes: m.avgLikes, engagement: m.engagement,
+ name: m.month,
+ posts: m.posts,
+ likes: m.likes,
+ comments: m.comments,
+ avgLikes: m.avgLikes,
}));
const captionData = a.captionLengthCorrelation || [];
@@ -116,527 +153,384 @@ export default function InstagramAnalytics({ account, showToast, onBack }) {
{/* Header */}
<Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', mb: 3 }}>
<Box sx={{ display: 'flex', alignItems: 'center', gap: 2 }}>
- <Button variant="outlined" onClick={onBack}
- sx={{ borderColor: 'rgba(255,255,255,0.15)', minWidth: 40, p: 1 }}>
+ <Button variant="outlined" onClick={() => navigate('/')} sx={{ minWidth: 40, p: 1 }}>
<ArrowBack />
</Button>
- <Avatar src={p.profilePictureUrl} sx={{ width: 56, height: 56, border: '3px solid #DD2A7B' }}>
+ <Avatar src={p.profilePictureUrl} sx={{ width: 56, height: 56 }}>
<Instagram />
</Avatar>
<Box>
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
- <Typography variant="h4" sx={{ fontWeight: 700 }}>{p.name || p.username}</Typography>
+ <Typography variant="h4">{p.name || p.username}</Typography>
<Instagram sx={{ color: '#DD2A7B' }} />
</Box>
- <Typography variant="body2" sx={{ color: 'text.secondary' }}>
- @{p.username}
- {p.website && (
- <Chip icon={<LinkIcon sx={{ fontSize: 14 }} />} label={p.website}
- size="small" clickable component="a" href={p.website} target="_blank"
- sx={{ ml: 1, fontSize: 11, height: 22 }} />
- )}
- </Typography>
+ <Typography variant="body2" color="text.secondary">@{p.username}</Typography>
{p.biography && (
- <Typography variant="caption" sx={{ color: 'text.secondary', mt: 0.5, display: 'block', maxWidth: 500 }}>
+ <Typography variant="caption" color="text.secondary" sx={{ mt: 0.5, display: 'block', maxWidth: 500 }}>
{p.biography}
</Typography>
)}
</Box>
</Box>
- <Button variant="contained" startIcon={refreshing ? <CircularProgress size={16} /> : <Refresh />}
- onClick={handleRefresh} disabled={refreshing}
- sx={{ background: IG_GRADIENT }}>
+ <Button variant="contained" startIcon={refreshing ? <CircularProgress size={16} color="inherit" /> : <Refresh />}
+ onClick={handleRefresh} disabled={refreshing}>
Refresh
</Button>
</Box>
- {refreshing && <LinearProgress sx={{ mb: 2, borderRadius: 1, '& .MuiLinearProgress-bar': { background: IG_GRADIENT } }} />}
+ {refreshing && <LinearProgress sx={{ mb: 2, borderRadius: 1 }} />}
{/* ROW 1: Key Stats */}
<Grid container spacing={2} sx={{ mb: 2.5 }}>
- <Grid size={{ xs: 12, sm: 6, md: 2 }}>
- <StatCard icon={<People />} label="Followers" value={fmtNum(p.followersCount)}
- subtitle={fmtNumFull(p.followersCount)} gradient="purple" small />
- </Grid>
- <Grid size={{ xs: 12, sm: 6, md: 2 }}>
- <StatCard icon={<PersonAdd />} label="Following" value={fmtNum(p.followsCount)}
- subtitle={fmtNumFull(p.followsCount)} gradient="blue" small />
- </Grid>
- <Grid size={{ xs: 12, sm: 6, md: 2 }}>
- <StatCard icon={<Photo />} label="Total Posts" value={fmtNum(a.totalPosts || p.mediaCount)}
- subtitle={`${a.fetchedPosts || 0} analyzed`} gradient="orange" small />
- </Grid>
- <Grid size={{ xs: 12, sm: 6, md: 2 }}>
- <StatCard icon={<Favorite />} label="Total Likes" value={fmtNum(a.totalLikes)}
- subtitle={fmtNumFull(a.totalLikes)} gradient="red" small />
- </Grid>
- <Grid size={{ xs: 12, sm: 6, md: 2 }}>
- <StatCard icon={<ChatBubble />} label="Total Comments" value={fmtNum(a.totalComments)}
- subtitle={fmtNumFull(a.totalComments)} gradient="teal" small />
- </Grid>
- <Grid size={{ xs: 12, sm: 6, md: 2 }}>
- <StatCard icon={<TrendingUp />} label="Engagement Rate" value={`${a.engagementRate || 0}%`}
- subtitle={`Avg ${fmtNum(a.avgLikes)} likes/post`} gradient="green" small />
- </Grid>
+ {[
+ { icon: <People />, label: 'Followers', value: fmtNum(p.followersCount), subtitle: fmtNumFull(p.followersCount), gradient: 'purple' },
+ { icon: <PersonAdd />, label: 'Following', value: fmtNum(p.followsCount), subtitle: fmtNumFull(p.followsCount), gradient: 'blue' },
+ { icon: <Photo />, label: 'Total Posts', value: fmtNum(a.totalPosts || p.mediaCount), subtitle: `${a.fetchedPosts || 0} analyzed`, gradient: 'orange' },
+ { icon: <Favorite />, label: 'Total Likes', value: fmtNum(a.totalLikes), subtitle: fmtNumFull(a.totalLikes), gradient: 'red' },
+ { icon: <ChatBubble />,label: 'Total Comments', value: fmtNum(a.totalComments), subtitle: fmtNumFull(a.totalComments), gradient: 'teal' },
+ { icon: <TrendingUp />,label: 'Engagement Rate', value: `${a.engagementRate || 0}%`, subtitle: `Avg ${fmtNum(a.avgLikes)} likes/post`, gradient: 'green' },
+ ].map((c, i) => (
+ <Grid key={i} size={{ xs: 12, sm: 6, md: 2 }}><StatCard {...c} small /></Grid>
+ ))}
</Grid>
- {/* ROW 2: Averages & Medians */}
+ {/* ROW 2: Averages & Ratios */}
<Grid container spacing={2} sx={{ mb: 2.5 }}>
- <Grid size={{ xs: 12, sm: 6, md: 2 }}>
- <StatCard icon={<Speed />} label="Avg Likes/Post" value={fmtNum(a.avgLikes)} gradient="cyan" small />
- </Grid>
- <Grid size={{ xs: 12, sm: 6, md: 2 }}>
- <StatCard icon={<ChatBubble />} label="Avg Comments" value={fmtNum(a.avgComments)} gradient="indigo" small />
- </Grid>
- <Grid size={{ xs: 12, sm: 6, md: 2 }}>
- <StatCard icon={<QueryStats />} label="Median Likes" value={fmtNum(a.medianLikes)} gradient="amber" small />
- </Grid>
- <Grid size={{ xs: 12, sm: 6, md: 2 }}>
- <StatCard icon={<People />} label="Follower Ratio"
- value={p.followersCount > 0 ? (p.followersCount / Math.max(1, p.followsCount)).toFixed(1) : '0'}
- subtitle="Followers / Following" gradient="pink" small />
- </Grid>
- <Grid size={{ xs: 12, sm: 6, md: 2 }}>
- <StatCard icon={<Favorite />} label="Likes/Follower" value={`${a.likesPerFollower || 0}%`}
- subtitle="Per post avg" gradient="red" small />
- </Grid>
- <Grid size={{ xs: 12, sm: 6, md: 2 }}>
- <StatCard icon={<TrendingUp />} label="Like:Comment" value={`${a.likesToCommentsRatio || 0}:1`}
- subtitle="Ratio" gradient="blue" small />
- </Grid>
+ {[
+ { icon: <Speed />, label: 'Avg Likes/Post', value: fmtNum(a.avgLikes), gradient: 'cyan' },
+ { icon: <ChatBubble />, label: 'Avg Comments', value: fmtNum(a.avgComments), gradient: 'indigo' },
+ { icon: <QueryStats />, label: 'Median Likes', value: fmtNum(a.medianLikes), gradient: 'amber' },
+ { icon: <People />, label: 'Follower Ratio', value: p.followersCount > 0 ? (p.followersCount / Math.max(1, p.followsCount)).toFixed(1) : '0', subtitle: 'Followers / Following', gradient: 'pink' },
+ { icon: <Favorite />, label: 'Likes/Follower', value: `${a.likesPerFollower || 0}%`, subtitle: 'Per post avg', gradient: 'red' },
+ { icon: <TrendingUp />, label: 'Like:Comment', value: `${a.likesToCommentsRatio || 0}:1`, subtitle: 'Ratio', gradient: 'blue' },
+ ].map((c, i) => (
+ <Grid key={i} size={{ xs: 12, sm: 6, md: 2 }}><StatCard {...c} small /></Grid>
+ ))}
</Grid>
- {/* ROW 3: Activity & Scores */}
+ {/* ROW 3: Activity */}
<Grid container spacing={2} sx={{ mb: 2.5 }}>
- <Grid size={{ xs: 12, sm: 6, md: 2 }}>
- <StatCard icon={<Schedule />} label="Posts/Week" value={a.postFrequency?.perWeek || 0}
- subtitle={`${a.postFrequency?.perMonth || 0}/month`} gradient="orange" small />
- </Grid>
- <Grid size={{ xs: 12, sm: 6, md: 2 }}>
- <StatCard icon={<CalendarMonth />} label="Last 7 Days" value={a.postsLast7Days || 0}
- subtitle="Recent posts" gradient="red" small />
- </Grid>
- <Grid size={{ xs: 12, sm: 6, md: 2 }}>
- <StatCard icon={<CalendarMonth />} label="Last 30 Days" value={a.postsLast30Days || 0}
- subtitle="Monthly" gradient="green" small />
- </Grid>
- <Grid size={{ xs: 12, sm: 6, md: 2 }}>
- <StatCard icon={<CalendarMonth />} label="Last 90 Days" value={a.postsLast90Days || 0}
- subtitle="Quarterly" gradient="blue" small />
- </Grid>
- <Grid size={{ xs: 12, sm: 6, md: 2 }}>
- <StatCard icon={<Whatshot />} label="Virality Score" value={`${a.viralityScore || 0}x`}
- subtitle="Best vs Average" gradient="pink" small />
- </Grid>
- <Grid size={{ xs: 12, sm: 6, md: 2 }}>
- <StatCard icon={<WorkspacePremium />} label="Consistency" value={`${a.consistencyScore || 0}/100`}
- subtitle="Engagement stability" gradient="amber" small />
- </Grid>
+ {[
+ { icon: <Schedule />, label: 'Posts/Week', value: a.postFrequency?.perWeek || 0, subtitle: `${a.postFrequency?.perMonth || 0}/month`, gradient: 'orange' },
+ { icon: <CalendarMonth />, label: 'Last 7 Days', value: a.postsLast7Days || 0, subtitle: 'Recent posts', gradient: 'red' },
+ { icon: <CalendarMonth />, label: 'Last 30 Days', value: a.postsLast30Days || 0, subtitle: 'Monthly', gradient: 'green' },
+ { icon: <CalendarMonth />, label: 'Last 90 Days', value: a.postsLast90Days || 0, subtitle: 'Quarterly', gradient: 'blue' },
+ { icon: <Whatshot />, label: 'Virality Score', value: `${a.viralityScore || 0}x`, subtitle: 'Best vs Average', gradient: 'pink' },
+ { icon: <WorkspacePremium />,label: 'Consistency', value: `${a.consistencyScore || 0}/100`, subtitle: 'Engagement stability', gradient: 'amber' },
+ ].map((c, i) => (
+ <Grid key={i} size={{ xs: 12, sm: 6, md: 2 }}><StatCard {...c} small /></Grid>
+ ))}
</Grid>
- {/* Best posting day & hour + Avg Engagement */}
- <Card sx={{ mb: 2.5 }}>
- <CardContent sx={{ py: 1.5, px: 2.5, '&:last-child': { pb: 1.5 } }}>
- <Box sx={{ display: 'flex', gap: 1.5, flexWrap: 'wrap', alignItems: 'center' }}>
- {a.bestPostingDay && (
- <Chip icon={<Star sx={{ color: '#F59E0B !important', fontSize: '16px !important' }} />}
- label={`Best Day: ${a.bestPostingDay}`}
- sx={{ fontSize: 12, fontWeight: 700, height: 30, bgcolor: 'rgba(245,158,11,0.1)', color: '#F59E0B', border: '1px solid rgba(245,158,11,0.2)' }} />
- )}
- {a.bestPostingHour && (
- <Chip icon={<Schedule sx={{ color: '#22C55E !important', fontSize: '16px !important' }} />}
- label={`Best Hour: ${a.bestPostingHour}`}
- sx={{ fontSize: 12, fontWeight: 700, height: 30, bgcolor: 'rgba(34,197,94,0.1)', color: '#22C55E', border: '1px solid rgba(34,197,94,0.2)' }} />
- )}
- <Chip icon={<TrendingUp sx={{ color: '#3B82F6 !important', fontSize: '16px !important' }} />}
- label={`Avg Engagement: ${fmtNum(a.avgEngagement || 0)}/post`}
- sx={{ fontSize: 12, fontWeight: 700, height: 30, bgcolor: 'rgba(59,130,246,0.1)', color: '#3B82F6', border: '1px solid rgba(59,130,246,0.2)' }} />
- <Chip icon={<WorkspacePremium sx={{ color: '#A78BFA !important', fontSize: '16px !important' }} />}
- label={`Consistency: ${a.consistencyScore || 0}/100`}
- sx={{ fontSize: 12, fontWeight: 700, height: 30, bgcolor: 'rgba(167,139,250,0.1)', color: '#A78BFA', border: '1px solid rgba(167,139,250,0.2)' }} />
- </Box>
- </CardContent>
- </Card>
+ {/* Insights chips */}
+ <MainCard sx={{ mb: 2.5 }}>
+ <Box sx={{ display: 'flex', gap: 1.5, flexWrap: 'wrap', alignItems: 'center' }}>
+ {a.bestPostingDay && (
+ <Chip icon={<Star sx={{ color: '#F59E0B !important', fontSize: '16px !important' }} />}
+ label={`Best Day: ${a.bestPostingDay}`}
+ sx={{ fontSize: 12, fontWeight: 700, height: 30, bgcolor: 'rgba(245,158,11,0.08)', color: '#D97706', border: '1px solid rgba(245,158,11,0.2)' }} />
+ )}
+ {a.bestPostingHour && (
+ <Chip icon={<Schedule sx={{ color: '#22C55E !important', fontSize: '16px !important' }} />}
+ label={`Best Hour: ${a.bestPostingHour}`}
+ sx={{ fontSize: 12, fontWeight: 700, height: 30, bgcolor: 'rgba(34,197,94,0.08)', color: '#16A34A', border: '1px solid rgba(34,197,94,0.2)' }} />
+ )}
+ <Chip icon={<TrendingUp sx={{ color: `${PRIMARY.main} !important`, fontSize: '16px !important' }} />}
+ label={`Avg Engagement: ${fmtNum(a.avgEngagement || 0)}/post`}
+ sx={{ fontSize: 12, fontWeight: 700, height: 30, bgcolor: PRIMARY.lighter, color: PRIMARY.dark, border: `1px solid ${PRIMARY.light}` }} />
+ <Chip icon={<WorkspacePremium sx={{ color: '#7C3AED !important', fontSize: '16px !important' }} />}
+ label={`Consistency: ${a.consistencyScore || 0}/100`}
+ sx={{ fontSize: 12, fontWeight: 700, height: 30, bgcolor: 'rgba(124,58,237,0.08)', color: '#7C3AED', border: '1px solid rgba(124,58,237,0.2)' }} />
+ </Box>
+ </MainCard>
- {/* CHARTS ROW 1: Engagement Timeline + Content Mix */}
- <Grid container spacing={2.5} sx={{ mb: 3 }}>
+ {/* Charts Row 1: Timeline + Content Mix */}
+ <Grid container spacing={2.5} sx={{ mb: 2.5 }}>
<Grid size={{ xs: 12, md: 8 }}>
- <Card>
- <CardContent>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2 }}>
- Engagement Timeline
+ <MainCard title="Engagement Timeline" contentSX={{ p: 2 }}>
+ {timelineData.length > 0 ? (
+ <ResponsiveContainer width="100%" height={300}>
+ <AreaChart data={timelineData}>
+ <CartesianGrid strokeDasharray="3 3" stroke={GREY[200]} vertical={false} />
+ <XAxis dataKey="name" tick={{ fill: GREY[500], fontSize: 11 }} axisLine={false} tickLine={false} />
+ <YAxis tick={{ fill: GREY[500], fontSize: 11 }} axisLine={false} tickLine={false} width={48} />
+ <ReTooltip contentStyle={tooltipStyle} />
+ <Area type="monotone" dataKey="likes" name="Likes" stroke="#DD2A7B" fill="rgba(221,42,123,0.1)" />
+ <Area type="monotone" dataKey="comments" name="Comments" stroke="#8134AF" fill="rgba(129,52,175,0.1)" />
+ </AreaChart>
+ </ResponsiveContainer>
+ ) : (
+ <Typography variant="body2" color="text.secondary" sx={{ textAlign: 'center', py: 4 }}>
+ Not enough data for timeline
</Typography>
- {timelineData.length > 0 ? (
- <ResponsiveContainer width="100%" height={300}>
- <AreaChart data={timelineData}>
- <CartesianGrid strokeDasharray="3 3" stroke="rgba(255,255,255,0.06)" />
- <XAxis dataKey="name" tick={{ fill: '#999', fontSize: 11 }} />
- <YAxis tick={{ fill: '#999', fontSize: 11 }} />
- <ReTooltip contentStyle={chartTooltipStyle} />
- <Area type="monotone" dataKey="likes" name="Likes" stroke="#DD2A7B" fill="rgba(221,42,123,0.2)" />
- <Area type="monotone" dataKey="comments" name="Comments" stroke="#8134AF" fill="rgba(129,52,175,0.2)" />
- </AreaChart>
- </ResponsiveContainer>
- ) : (
- <Typography variant="body2" sx={{ color: 'text.secondary', textAlign: 'center', py: 4 }}>
- Not enough data for timeline
- </Typography>
- )}
- </CardContent>
- </Card>
+ )}
+ </MainCard>
</Grid>
<Grid size={{ xs: 12, md: 4 }}>
- <Card>
- <CardContent>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2 }}>
- Content Type Mix
- </Typography>
- {mediaTypeData.length > 0 ? (
- <ResponsiveContainer width="100%" height={300}>
- <PieChart>
- <Pie data={mediaTypeData} dataKey="value" nameKey="name"
- cx="50%" cy="50%" outerRadius={70} innerRadius={35}
- label={({ cx, cy, midAngle, outerRadius, name, value }) => {
- const RADIAN = Math.PI / 180;
- const radius = outerRadius + 18;
- const x = cx + radius * Math.cos(-midAngle * RADIAN);
- const y = cy + radius * Math.sin(-midAngle * RADIAN);
- return (
- <text x={x} y={y} fill="#ccc" fontSize={11} fontWeight={500}
- textAnchor={x > cx ? 'start' : 'end'} dominantBaseline="central">
- {`${value}`}
- </text>
- );
- }}
- labelLine={{ strokeWidth: 1, stroke: '#666' }}>
- {mediaTypeData.map((entry, i) => (
- <Cell key={i} fill={entry.color} />
- ))}
- </Pie>
- <Legend wrapperStyle={{ fontSize: 12 }} />
- <ReTooltip contentStyle={chartTooltipStyle}
- formatter={(value, name) => [`${value} posts`, name]} />
- </PieChart>
- </ResponsiveContainer>
- ) : (
- <Typography variant="body2" sx={{ color: 'text.secondary', textAlign: 'center', py: 4 }}>
- No data
- </Typography>
- )}
- </CardContent>
- </Card>
+ <MainCard title="Content Type Mix" contentSX={{ p: 2 }}>
+ {mediaTypeData.length > 0 ? (
+ <ResponsiveContainer width="100%" height={300}>
+ <PieChart>
+ <Pie data={mediaTypeData} dataKey="value" nameKey="name"
+ cx="50%" cy="44%" outerRadius={70} innerRadius={35}
+ paddingAngle={3} strokeWidth={0}>
+ {mediaTypeData.map((entry, i) => <Cell key={i} fill={entry.color} />)}
+ </Pie>
+ <ReTooltip contentStyle={tooltipStyle} formatter={(v, n) => [`${v} posts`, n]} />
+ <Legend iconType="circle" iconSize={8} wrapperStyle={{ fontSize: 12, color: GREY[600], paddingTop: 8 }} />
+ </PieChart>
+ </ResponsiveContainer>
+ ) : (
+ <Typography variant="body2" color="text.secondary" sx={{ textAlign: 'center', py: 4 }}>No data</Typography>
+ )}
+ </MainCard>
</Grid>
</Grid>
- {/* CHARTS ROW 2: Performance by Type + Day of Week */}
- <Grid container spacing={2.5} sx={{ mb: 3 }}>
+ {/* Charts Row 2: Performance by Type + Day of Week */}
+ <Grid container spacing={2.5} sx={{ mb: 2.5 }}>
<Grid size={{ xs: 12, md: 6 }}>
- <Card>
- <CardContent>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2 }}>
- Performance by Content Type
- </Typography>
- {perfByTypeData.length > 0 ? (
- <ResponsiveContainer width="100%" height={280}>
- <BarChart data={perfByTypeData}>
- <CartesianGrid strokeDasharray="3 3" stroke="rgba(255,255,255,0.06)" />
- <XAxis dataKey="name" tick={{ fill: '#999', fontSize: 12 }} />
- <YAxis tick={{ fill: '#999', fontSize: 12 }} />
- <ReTooltip contentStyle={chartTooltipStyle} />
- <Bar dataKey="avgLikes" name="Avg Likes" fill="#DD2A7B" radius={[4, 4, 0, 0]} />
- <Bar dataKey="avgComments" name="Avg Comments" fill="#8134AF" radius={[4, 4, 0, 0]} />
- </BarChart>
- </ResponsiveContainer>
- ) : (
- <Typography variant="body2" sx={{ color: 'text.secondary', textAlign: 'center', py: 4 }}>
- No data
- </Typography>
- )}
- </CardContent>
- </Card>
+ <MainCard title="Performance by Content Type" contentSX={{ p: 2 }}>
+ {perfByTypeData.length > 0 ? (
+ <ResponsiveContainer width="100%" height={280}>
+ <BarChart data={perfByTypeData}>
+ <CartesianGrid strokeDasharray="3 3" stroke={GREY[200]} vertical={false} />
+ <XAxis dataKey="name" tick={{ fill: GREY[500], fontSize: 12 }} axisLine={false} tickLine={false} />
+ <YAxis tick={{ fill: GREY[500], fontSize: 12 }} axisLine={false} tickLine={false} width={48} />
+ <ReTooltip contentStyle={tooltipStyle} />
+ <Bar dataKey="avgLikes" name="Avg Likes" fill="#DD2A7B" radius={[4, 4, 0, 0]} />
+ <Bar dataKey="avgComments" name="Avg Comments" fill="#8134AF" radius={[4, 4, 0, 0]} />
+ </BarChart>
+ </ResponsiveContainer>
+ ) : (
+ <Typography variant="body2" color="text.secondary" sx={{ textAlign: 'center', py: 4 }}>No data</Typography>
+ )}
+ </MainCard>
</Grid>
<Grid size={{ xs: 12, md: 6 }}>
- <Card>
- <CardContent>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2 }}>
- Best Posting Days
- </Typography>
- {dayOfWeekData.length > 0 ? (
- <ResponsiveContainer width="100%" height={280}>
- <BarChart data={dayOfWeekData}>
- <CartesianGrid strokeDasharray="3 3" stroke="rgba(255,255,255,0.06)" />
- <XAxis dataKey="name" tick={{ fill: '#999', fontSize: 12 }} />
- <YAxis tick={{ fill: '#999', fontSize: 12 }} />
- <ReTooltip contentStyle={chartTooltipStyle} />
- <Bar dataKey="avgEngagement" name="Avg Engagement" fill="#F58529" radius={[4, 4, 0, 0]} />
- <Bar dataKey="posts" name="Posts" fill="rgba(255,255,255,0.15)" radius={[4, 4, 0, 0]} />
- </BarChart>
- </ResponsiveContainer>
- ) : (
- <Typography variant="body2" sx={{ color: 'text.secondary', textAlign: 'center', py: 4 }}>
- No data
- </Typography>
- )}
- </CardContent>
- </Card>
+ <MainCard title="Best Posting Days" contentSX={{ p: 2 }}>
+ {dayOfWeekData.length > 0 ? (
+ <ResponsiveContainer width="100%" height={280}>
+ <BarChart data={dayOfWeekData}>
+ <CartesianGrid strokeDasharray="3 3" stroke={GREY[200]} vertical={false} />
+ <XAxis dataKey="name" tick={{ fill: GREY[500], fontSize: 12 }} axisLine={false} tickLine={false} />
+ <YAxis tick={{ fill: GREY[500], fontSize: 12 }} axisLine={false} tickLine={false} width={48} />
+ <ReTooltip contentStyle={tooltipStyle} />
+ <Bar dataKey="avgEngagement" name="Avg Engagement" fill="#F58529" radius={[4, 4, 0, 0]} />
+ <Bar dataKey="posts" name="Posts" fill={GREY[200]} radius={[4, 4, 0, 0]} />
+ </BarChart>
+ </ResponsiveContainer>
+ ) : (
+ <Typography variant="body2" color="text.secondary" sx={{ textAlign: 'center', py: 4 }}>No data</Typography>
+ )}
+ </MainCard>
</Grid>
</Grid>
- {/* CHARTS ROW 3: Top Posts Bar + Caption Length Analysis */}
- <Grid container spacing={2.5} sx={{ mb: 3 }}>
+ {/* Charts Row 3: Top Posts + Caption Length */}
+ <Grid container spacing={2.5} sx={{ mb: 2.5 }}>
<Grid size={{ xs: 12, md: 6 }}>
- <Card>
- <CardContent>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2 }}>
- Top Posts by Engagement
- </Typography>
- {topPostsData.length > 0 ? (
- <ResponsiveContainer width="100%" height={280}>
- <BarChart data={topPostsData}>
- <CartesianGrid strokeDasharray="3 3" stroke="rgba(255,255,255,0.06)" />
- <XAxis dataKey="name" tick={{ fill: '#999', fontSize: 12 }} />
- <YAxis tick={{ fill: '#999', fontSize: 12 }} />
- <ReTooltip contentStyle={chartTooltipStyle} />
- <Bar dataKey="likes" name="Likes" fill="#DD2A7B" radius={[4, 4, 0, 0]} />
- <Bar dataKey="comments" name="Comments" fill="#8134AF" radius={[4, 4, 0, 0]} />
- </BarChart>
- </ResponsiveContainer>
- ) : (
- <Typography variant="body2" sx={{ color: 'text.secondary', textAlign: 'center', py: 4 }}>
- No data
- </Typography>
- )}
- </CardContent>
- </Card>
+ <MainCard title="Top Posts by Engagement" contentSX={{ p: 2 }}>
+ {topPostsData.length > 0 ? (
+ <ResponsiveContainer width="100%" height={280}>
+ <BarChart data={topPostsData}>
+ <CartesianGrid strokeDasharray="3 3" stroke={GREY[200]} vertical={false} />
+ <XAxis dataKey="name" tick={{ fill: GREY[500], fontSize: 12 }} axisLine={false} tickLine={false} />
+ <YAxis tick={{ fill: GREY[500], fontSize: 12 }} axisLine={false} tickLine={false} width={48} />
+ <ReTooltip contentStyle={tooltipStyle} />
+ <Bar dataKey="likes" name="Likes" fill="#DD2A7B" radius={[4, 4, 0, 0]} />
+ <Bar dataKey="comments" name="Comments" fill="#8134AF" radius={[4, 4, 0, 0]} />
+ </BarChart>
+ </ResponsiveContainer>
+ ) : (
+ <Typography variant="body2" color="text.secondary" sx={{ textAlign: 'center', py: 4 }}>No data</Typography>
+ )}
+ </MainCard>
</Grid>
<Grid size={{ xs: 12, md: 6 }}>
- <Card>
- <CardContent>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2 }}>
- Caption Length vs Engagement
- </Typography>
- {captionData.length > 0 ? (
- <ResponsiveContainer width="100%" height={280}>
- <BarChart data={captionData}>
- <CartesianGrid strokeDasharray="3 3" stroke="rgba(255,255,255,0.06)" />
- <XAxis dataKey="label" tick={{ fill: '#999', fontSize: 11 }} />
- <YAxis tick={{ fill: '#999', fontSize: 12 }} />
- <ReTooltip contentStyle={chartTooltipStyle} />
- <Bar dataKey="avgEngagement" name="Avg Engagement" fill="#515BD4" radius={[4, 4, 0, 0]} />
- </BarChart>
- </ResponsiveContainer>
- ) : (
- <Typography variant="body2" sx={{ color: 'text.secondary', textAlign: 'center', py: 4 }}>
- No data
- </Typography>
- )}
- </CardContent>
- </Card>
+ <MainCard title="Caption Length vs Engagement" contentSX={{ p: 2 }}>
+ {captionData.length > 0 ? (
+ <ResponsiveContainer width="100%" height={280}>
+ <BarChart data={captionData}>
+ <CartesianGrid strokeDasharray="3 3" stroke={GREY[200]} vertical={false} />
+ <XAxis dataKey="label" tick={{ fill: GREY[500], fontSize: 11 }} axisLine={false} tickLine={false} />
+ <YAxis tick={{ fill: GREY[500], fontSize: 12 }} axisLine={false} tickLine={false} width={48} />
+ <ReTooltip contentStyle={tooltipStyle} />
+ <Bar dataKey="avgEngagement" name="Avg Engagement" fill="#515BD4" radius={[4, 4, 0, 0]} />
+ </BarChart>
+ </ResponsiveContainer>
+ ) : (
+ <Typography variant="body2" color="text.secondary" sx={{ textAlign: 'center', py: 4 }}>No data</Typography>
+ )}
+ </MainCard>
</Grid>
</Grid>
{/* Monthly Posting Volume */}
{timelineData.length > 1 && (
- <Card sx={{ mb: 3 }}>
- <CardContent>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2 }}>
- Monthly Posting Volume
- </Typography>
- <ResponsiveContainer width="100%" height={250}>
- <BarChart data={timelineData}>
- <CartesianGrid strokeDasharray="3 3" stroke="rgba(255,255,255,0.06)" />
- <XAxis dataKey="name" tick={{ fill: '#999', fontSize: 11 }} />
- <YAxis tick={{ fill: '#999', fontSize: 12 }} />
- <ReTooltip contentStyle={chartTooltipStyle} />
- <Bar dataKey="posts" name="Posts" fill="#F58529" radius={[4, 4, 0, 0]} />
- </BarChart>
- </ResponsiveContainer>
- </CardContent>
- </Card>
+ <MainCard title="Monthly Posting Volume" contentSX={{ p: 2 }} sx={{ mb: 2.5 }}>
+ <ResponsiveContainer width="100%" height={250}>
+ <BarChart data={timelineData}>
+ <CartesianGrid strokeDasharray="3 3" stroke={GREY[200]} vertical={false} />
+ <XAxis dataKey="name" tick={{ fill: GREY[500], fontSize: 11 }} axisLine={false} tickLine={false} />
+ <YAxis tick={{ fill: GREY[500], fontSize: 12 }} axisLine={false} tickLine={false} width={48} />
+ <ReTooltip contentStyle={tooltipStyle} />
+ <Bar dataKey="posts" name="Posts" fill="#F58529" radius={[4, 4, 0, 0]} />
+ </BarChart>
+ </ResponsiveContainer>
+ </MainCard>
)}
{/* Top Hashtags */}
{(a.hashtagAnalysis || []).length > 0 && (
- <Card sx={{ mb: 3 }}>
- <CardContent>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2 }}>
- <Tag sx={{ verticalAlign: 'middle', mr: 1, color: '#DD2A7B' }} />
- Top Hashtags
- </Typography>
- <Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 1 }}>
- {a.hashtagAnalysis.slice(0, 20).map((h, i) => (
- <Tooltip key={h.tag} title={`Used ${h.count}x \u2022 Avg engagement: ${fmtNum(h.avgEngagement)}`}>
- <Chip label={`${h.tag} (${h.count})`}
- sx={{
- fontSize: 12, fontWeight: 500,
- bgcolor: `${IG_COLORS[i % IG_COLORS.length]}22`,
- borderColor: IG_COLORS[i % IG_COLORS.length],
- color: IG_COLORS[i % IG_COLORS.length],
- }}
- variant="outlined" />
- </Tooltip>
- ))}
- </Box>
- </CardContent>
- </Card>
+ <MainCard title="Top Hashtags" sx={{ mb: 2.5 }}>
+ <Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 1 }}>
+ {a.hashtagAnalysis.slice(0, 20).map((h, i) => (
+ <Tooltip key={h.tag} title={`Used ${h.count}x · Avg engagement: ${fmtNum(h.avgEngagement)}`}>
+ <Chip label={`${h.tag} (${h.count})`}
+ sx={{
+ fontSize: 12, fontWeight: 500,
+ bgcolor: `${IG_COLORS[i % IG_COLORS.length]}15`,
+ borderColor: IG_COLORS[i % IG_COLORS.length],
+ color: IG_COLORS[i % IG_COLORS.length],
+ }}
+ variant="outlined" />
+ </Tooltip>
+ ))}
+ </Box>
+ </MainCard>
)}
- {/* Recent Media Grid */}
- <Card sx={{ mb: 3 }}>
- <CardContent>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2 }}>
- Recent Posts ({a.fetchedPosts || 0} loaded)
- </Typography>
- {(a.recentMedia || []).length > 0 ? (
- <Grid container spacing={2}>
- {a.recentMedia.map((post) => (
- <Grid size={{ xs: 6, sm: 4, md: 3, lg: 2 }} key={post.id}>
- <Card sx={{
- position: 'relative', overflow: 'hidden', cursor: 'pointer',
- '&:hover': { transform: 'translateY(-2px)', transition: 'all 0.2s' },
- '&:hover .media-overlay': { opacity: 1 },
+ {/* Recent Posts Grid */}
+ <MainCard title={`Recent Posts (${a.fetchedPosts || 0} loaded)`} sx={{ mb: 2.5 }}>
+ {(a.recentMedia || []).length > 0 ? (
+ <Grid container spacing={2}>
+ {a.recentMedia.map((post) => (
+ <Grid size={{ xs: 6, sm: 4, md: 3, lg: 2 }} key={post.id}>
+ <Box
+ sx={{
+ position: 'relative', overflow: 'hidden', borderRadius: 1.5,
+ cursor: 'pointer', border: `1px solid ${GREY.A800}`,
+ '&:hover .overlay': { opacity: 1 },
+ '&:hover': { boxShadow: '0 4px 12px rgba(0,0,0,0.1)' },
}}
- onClick={() => post.permalink && window.open(post.permalink, '_blank')}>
- <Box sx={{
- width: '100%', paddingTop: '100%', position: 'relative',
- bgcolor: 'rgba(255,255,255,0.05)',
- }}>
- <Box component="img"
- src={post.thumbnailUrl || post.mediaUrl}
- sx={{
- position: 'absolute', top: 0, left: 0, width: '100%', height: '100%',
- objectFit: 'cover',
- }}
- onError={(e) => { e.target.style.display = 'none'; }}
- />
- {post.mediaType !== 'IMAGE' && (
- <Chip label={MEDIA_TYPE_NAMES[post.mediaType] || post.mediaType}
- size="small"
- sx={{
- position: 'absolute', top: 8, right: 8,
- bgcolor: 'rgba(0,0,0,0.7)', color: '#fff', fontSize: 10, height: 20,
- }} />
- )}
+ onClick={() => post.permalink && window.open(post.permalink, '_blank')}
+ >
+ <Box sx={{ width: '100%', paddingTop: '100%', position: 'relative', bgcolor: GREY[100] }}>
+ <Box component="img" src={post.thumbnailUrl || post.mediaUrl}
+ sx={{ position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', objectFit: 'cover' }}
+ onError={e => { e.target.style.display = 'none'; }}
+ />
+ {post.mediaType !== 'IMAGE' && (
+ <Chip label={MEDIA_TYPE_NAMES[post.mediaType] || post.mediaType} size="small"
+ sx={{ position: 'absolute', top: 6, right: 6, bgcolor: 'rgba(0,0,0,0.65)', color: '#fff', fontSize: 10, height: 20 }} />
+ )}
+ </Box>
+ <Box className="overlay" sx={{
+ position: 'absolute', bottom: 0, left: 0, right: 0,
+ background: 'linear-gradient(transparent, rgba(0,0,0,0.7))',
+ p: 1, opacity: 0, transition: 'opacity 0.2s',
+ display: 'flex', justifyContent: 'center', gap: 2,
+ }}>
+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5, color: '#fff' }}>
+ <Favorite sx={{ fontSize: 13 }} />
+ <Typography variant="caption" sx={{ fontWeight: 600 }}>{fmtNum(post.likeCount)}</Typography>
</Box>
- <Box className="media-overlay" sx={{
- position: 'absolute', bottom: 0, left: 0, right: 0,
- background: 'linear-gradient(transparent, rgba(0,0,0,0.8))',
- p: 1, opacity: 0, transition: 'opacity 0.2s',
- display: 'flex', justifyContent: 'center', gap: 2,
- }}>
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5, color: '#fff' }}>
- <Favorite sx={{ fontSize: 14 }} />
- <Typography variant="caption" sx={{ fontWeight: 600 }}>{fmtNum(post.likeCount)}</Typography>
- </Box>
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5, color: '#fff' }}>
- <ChatBubble sx={{ fontSize: 14 }} />
- <Typography variant="caption" sx={{ fontWeight: 600 }}>{fmtNum(post.commentsCount)}</Typography>
- </Box>
+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5, color: '#fff' }}>
+ <ChatBubble sx={{ fontSize: 13 }} />
+ <Typography variant="caption" sx={{ fontWeight: 600 }}>{fmtNum(post.commentsCount)}</Typography>
</Box>
- </Card>
- </Grid>
- ))}
- </Grid>
- ) : (
- <Typography variant="body2" sx={{ color: 'text.secondary', textAlign: 'center', py: 4 }}>
- No posts found
- </Typography>
- )}
- </CardContent>
- </Card>
+ </Box>
+ </Box>
+ </Grid>
+ ))}
+ </Grid>
+ ) : (
+ <Typography variant="body2" color="text.secondary" sx={{ textAlign: 'center', py: 4 }}>No posts found</Typography>
+ )}
+ </MainCard>
{/* Top Posts Table */}
{(a.topPosts || []).length > 0 && (
- <Card sx={{ mb: 3 }}>
- <CardContent>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2 }}>
- Top Performing Posts
- </Typography>
- <TableContainer>
- <Table size="small">
- <TableHead>
- <TableRow>
- <TableCell sx={{ fontWeight: 600 }}>#</TableCell>
- <TableCell sx={{ fontWeight: 600 }}>Caption</TableCell>
- <TableCell sx={{ fontWeight: 600 }}>Type</TableCell>
- <TableCell sx={{ fontWeight: 600 }} align="right">Likes</TableCell>
- <TableCell sx={{ fontWeight: 600 }} align="right">Comments</TableCell>
- <TableCell sx={{ fontWeight: 600 }} align="right">Engagement</TableCell>
- <TableCell sx={{ fontWeight: 600 }}>Date</TableCell>
- <TableCell></TableCell>
+ <MainCard title="Top Performing Posts" content={false} sx={{ mb: 2.5 }}>
+ <TableContainer>
+ <Table size="small">
+ <TableHead>
+ <TableRow>
+ <TableCell sx={{ fontWeight: 600 }}>#</TableCell>
+ <TableCell sx={{ fontWeight: 600 }}>Caption</TableCell>
+ <TableCell sx={{ fontWeight: 600 }}>Type</TableCell>
+ <TableCell sx={{ fontWeight: 600 }} align="right">Likes</TableCell>
+ <TableCell sx={{ fontWeight: 600 }} align="right">Comments</TableCell>
+ <TableCell sx={{ fontWeight: 600 }} align="right">Engagement</TableCell>
+ <TableCell sx={{ fontWeight: 600 }}>Date</TableCell>
+ <TableCell />
+ </TableRow>
+ </TableHead>
+ <TableBody>
+ {a.topPosts.slice(0, 10).map((post, i) => (
+ <TableRow key={post.id} hover>
+ <TableCell>{i + 1}</TableCell>
+ <TableCell sx={{ maxWidth: 250, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
+ {post.caption || '(no caption)'}
+ </TableCell>
+ <TableCell>
+ <Chip label={MEDIA_TYPE_NAMES[post.mediaType] || post.mediaType} size="small"
+ sx={{ fontSize: 10, height: 20, bgcolor: `${MEDIA_TYPE_COLORS[post.mediaType] || GREY[400]}22`, color: MEDIA_TYPE_COLORS[post.mediaType] || GREY[600] }} />
+ </TableCell>
+ <TableCell align="right">{fmtNum(post.likeCount)}</TableCell>
+ <TableCell align="right">{fmtNum(post.commentsCount)}</TableCell>
+ <TableCell align="right">{fmtNum(post.engagement)}</TableCell>
+ <TableCell>{fmtDate(post.timestamp)}</TableCell>
+ <TableCell>
+ {post.permalink && (
+ <IconButton size="small" onClick={() => window.open(post.permalink, '_blank')}>
+ <OpenInNew fontSize="small" />
+ </IconButton>
+ )}
+ </TableCell>
</TableRow>
- </TableHead>
- <TableBody>
- {a.topPosts.slice(0, 10).map((post, i) => (
- <TableRow key={post.id} hover>
- <TableCell>{i + 1}</TableCell>
- <TableCell sx={{ maxWidth: 250, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
- {post.caption || '(no caption)'}
- </TableCell>
- <TableCell>
- <Chip label={MEDIA_TYPE_NAMES[post.mediaType] || post.mediaType} size="small"
- sx={{ fontSize: 10, height: 20, bgcolor: `${MEDIA_TYPE_COLORS[post.mediaType] || '#999'}33`, color: MEDIA_TYPE_COLORS[post.mediaType] || '#999' }} />
- </TableCell>
- <TableCell align="right">{fmtNum(post.likeCount)}</TableCell>
- <TableCell align="right">{fmtNum(post.commentsCount)}</TableCell>
- <TableCell align="right">{fmtNum(post.engagement)}</TableCell>
- <TableCell>{fmtDate(post.timestamp)}</TableCell>
- <TableCell>
- {post.permalink && (
- <IconButton size="small" onClick={() => window.open(post.permalink, '_blank')}>
- <OpenInNew fontSize="small" />
- </IconButton>
- )}
- </TableCell>
- </TableRow>
- ))}
- </TableBody>
- </Table>
- </TableContainer>
- </CardContent>
- </Card>
+ ))}
+ </TableBody>
+ </Table>
+ </TableContainer>
+ </MainCard>
)}
{/* Performance by Type Table */}
{perfByTypeData.length > 0 && (
- <Card sx={{ mb: 3 }}>
- <CardContent>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2 }}>
- Performance Summary by Content Type
- </Typography>
- <TableContainer>
- <Table size="small">
- <TableHead>
- <TableRow>
- <TableCell sx={{ fontWeight: 600 }}>Type</TableCell>
- <TableCell sx={{ fontWeight: 600 }} align="right">Count</TableCell>
- <TableCell sx={{ fontWeight: 600 }} align="right">Avg Likes</TableCell>
- <TableCell sx={{ fontWeight: 600 }} align="right">Avg Comments</TableCell>
- <TableCell sx={{ fontWeight: 600 }} align="right">Avg Engagement</TableCell>
+ <MainCard title="Performance Summary by Content Type" content={false} sx={{ mb: 2.5 }}>
+ <TableContainer>
+ <Table size="small">
+ <TableHead>
+ <TableRow>
+ <TableCell sx={{ fontWeight: 600 }}>Type</TableCell>
+ <TableCell sx={{ fontWeight: 600 }} align="right">Count</TableCell>
+ <TableCell sx={{ fontWeight: 600 }} align="right">Avg Likes</TableCell>
+ <TableCell sx={{ fontWeight: 600 }} align="right">Avg Comments</TableCell>
+ <TableCell sx={{ fontWeight: 600 }} align="right">Avg Engagement</TableCell>
+ </TableRow>
+ </TableHead>
+ <TableBody>
+ {perfByTypeData.map(row => (
+ <TableRow key={row.name} hover>
+ <TableCell>
+ <Chip label={row.name} size="small"
+ sx={{ fontSize: 11, height: 22, bgcolor: `${row.color}22`, color: row.color }} />
+ </TableCell>
+ <TableCell align="right">{row.count}</TableCell>
+ <TableCell align="right">{fmtNum(row.avgLikes)}</TableCell>
+ <TableCell align="right">{fmtNum(row.avgComments)}</TableCell>
+ <TableCell align="right">{fmtNum(row.avgLikes + row.avgComments)}</TableCell>
</TableRow>
- </TableHead>
- <TableBody>
- {perfByTypeData.map(row => (
- <TableRow key={row.name} hover>
- <TableCell>
- <Chip label={row.name} size="small"
- sx={{ fontSize: 11, height: 22, bgcolor: `${row.color}33`, color: row.color }} />
- </TableCell>
- <TableCell align="right">{row.count}</TableCell>
- <TableCell align="right">{fmtNum(row.avgLikes)}</TableCell>
- <TableCell align="right">{fmtNum(row.avgComments)}</TableCell>
- <TableCell align="right">{fmtNum(row.avgLikes + row.avgComments)}</TableCell>
- </TableRow>
- ))}
- </TableBody>
- </Table>
- </TableContainer>
- </CardContent>
- </Card>
+ ))}
+ </TableBody>
+ </Table>
+ </TableContainer>
+ </MainCard>
)}
- {/* Last Updated */}
- <Typography variant="caption" sx={{ color: 'text.secondary', display: 'block', textAlign: 'center', mt: 3 }}>
+ <Typography variant="caption" color="text.secondary" sx={{ display: 'block', textAlign: 'center', mt: 3 }}>
Last updated: {timeAgo(account.lastUpdated)}
</Typography>
</Box>
diff --git a/frontend/src/features/analytics/overview/Overview.jsx b/frontend/src/features/analytics/overview/Overview.jsx
index 1d2d8d3..4bf0226 100644
--- a/frontend/src/features/analytics/overview/Overview.jsx
+++ b/frontend/src/features/analytics/overview/Overview.jsx
@@ -1,365 +1,411 @@
import React from 'react';
+import { useNavigate } from 'react-router-dom';
import {
- Box, Typography, Grid, Card, CardContent, Button, Avatar, Chip,
- LinearProgress, Table, TableBody, TableCell, TableContainer,
- TableHead, TableRow, IconButton, Tooltip,
+ Box, Typography, Grid, Avatar, Chip, Button,
+ Table, TableBody, TableCell, TableContainer,
+ TableHead, TableRow, IconButton, Tooltip, Divider, LinearProgress,
} from '@mui/material';
import {
- Visibility, People, VideoLibrary, YouTube, Refresh,
- OpenInNew, BarChart, Instagram,
+ Visibility, People, VideoLibrary, BarChart,
+ YouTube, Instagram, OpenInNew, Refresh,
} from '@mui/icons-material';
import {
- AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip as ReTooltip,
- ResponsiveContainer, PieChart, Pie, Cell, Legend,
+ AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip as ReTooltip,
+ ResponsiveContainer, PieChart, Pie, Cell, Legend,
} from 'recharts';
import StatCard from '../../../components/ui/StatCard';
+import MainCard from '../../../components/MainCard';
+import { useAppContext } from '../../../context/AppContext';
import { fmtNum, fmtNumFull, timeAgo } from '../../../utils/formatters';
+import { PRIMARY, GREY } from '../../../themes/index';
-const COLORS = ['#FF0000', '#3B82F6', '#22C55E', '#F59E0B', '#A78BFA', '#14B8A6', '#EC4899', '#6366F1'];
+const CHART_COLORS = [
+ PRIMARY.main, '#52c41a', '#fa8c16', '#722ed1',
+ '#13c2c2', '#eb2f96', '#2f54eb', '#faad14',
+];
-const sectionLabel = (text) => (
- <Typography sx={{
- fontSize: 11, fontWeight: 700, letterSpacing: '0.08em',
- textTransform: 'uppercase', color: 'text.secondary', mb: 2,
- }}>
- {text}
- </Typography>
-);
-
-const chartTooltipStyle = {
- backgroundColor: '#0E1420',
- border: '1px solid rgba(255,255,255,0.1)',
- borderRadius: 10,
- fontSize: 13,
- fontWeight: 500,
+const tooltipStyle = {
+ backgroundColor: '#fff',
+ border: `1px solid ${GREY.A800}`,
+ borderRadius: 8,
+ fontSize: 13,
+ fontWeight: 500,
+ color: GREY[700],
+ boxShadow: '0 4px 16px rgba(0,0,0,0.1)',
};
-export default function Overview({ accounts, onViewChannel, onRefreshAll, loading }) {
- const ytAccounts = accounts.filter(a => a.platform !== 'instagram');
- const igAccounts = accounts.filter(a => a.platform === 'instagram');
-
- const totals = accounts.reduce((acc, a) => {
- if (a.platform === 'instagram') {
- return { ...acc, followers: acc.followers + (a.followersCount || 0), posts: acc.posts + (a.mediaCount || 0) };
- }
- return {
- ...acc,
- subscribers: acc.subscribers + (a.subscriberCount || 0),
- views: acc.views + (a.viewCount || 0),
- videos: acc.videos + (a.videoCount || 0),
- };
- }, { subscribers: 0, views: 0, videos: 0, followers: 0, posts: 0 });
+export default function Overview() {
+ const { accounts, loading, refreshAll } = useAppContext();
+ const navigate = useNavigate();
- const totalAudience = totals.subscribers + totals.followers;
+ const ytAccounts = accounts.filter(a => a.platform !== 'instagram');
+ const igAccounts = accounts.filter(a => a.platform === 'instagram');
- const sorted = {
- byAudience: [...accounts].sort((a, b) => (b.subscriberCount || b.followersCount || 0) - (a.subscriberCount || a.followersCount || 0)),
- byContent: [...accounts].sort((a, b) => (b.viewCount || b.mediaCount || 0) - (a.viewCount || a.mediaCount || 0)),
+ const totals = accounts.reduce((acc, a) => {
+ if (a.platform === 'instagram') {
+ return { ...acc, followers: acc.followers + (a.followersCount || 0), posts: acc.posts + (a.mediaCount || 0) };
+ }
+ return {
+ ...acc,
+ subscribers: acc.subscribers + (a.subscriberCount || 0),
+ views: acc.views + (a.viewCount || 0),
+ videos: acc.videos + (a.videoCount || 0),
};
+ }, { subscribers: 0, views: 0, videos: 0, followers: 0, posts: 0 });
- const chartData = accounts.map(a => ({
- name: (a.title || '').length > 14 ? a.title.substring(0, 14) + '…' : a.title,
- audience: a.subscriberCount || a.followersCount || 0,
- platform: a.platform || 'youtube',
- }));
+ const totalAudience = totals.subscribers + totals.followers;
- const pieData = accounts.map((a, i) => ({
- name: (a.title || '').length > 14 ? a.title.substring(0, 14) + '…' : a.title,
- value: a.subscriberCount || a.followersCount || 0,
- color: COLORS[i % COLORS.length],
- }));
+ const sorted = {
+ byAudience: [...accounts].sort((a, b) =>
+ (b.subscriberCount || b.followersCount || 0) - (a.subscriberCount || a.followersCount || 0)),
+ byContent: [...accounts].sort((a, b) =>
+ (b.viewCount || b.mediaCount || 0) - (a.viewCount || a.mediaCount || 0)),
+ };
- return (
- <Box>
- {/* ── Header ─────────────────────────────────────────────── */}
- <Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', mb: 3.5 }}>
- <Box>
- <Typography variant="h4" sx={{ fontWeight: 800, mb: 0.5, letterSpacing: '-0.03em' }}>
- Dashboard Overview
- </Typography>
- <Typography variant="body2" sx={{ color: 'text.secondary' }}>
- {accounts.length === 0
- ? 'Add your first account to start tracking'
- : `Tracking ${accounts.length} account${accounts.length !== 1 ? 's' : ''} · ${ytAccounts.length} YouTube · ${igAccounts.length} Instagram`}
- </Typography>
- </Box>
- <Button
- variant="contained"
- startIcon={<Refresh sx={{ fontSize: 18 }} />}
- onClick={onRefreshAll}
- disabled={loading || accounts.length === 0}
- sx={{
- background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
- px: 2.5, py: 1.1,
- '&:hover': { background: 'linear-gradient(135deg, #7C8FF4 0%, #8A5BB8 100%)' },
- }}
- >
- {loading ? 'Refreshing…' : 'Refresh All'}
- </Button>
- </Box>
+ const chartData = accounts.map(a => ({
+ name: (a.title || '').slice(0, 14) + ((a.title || '').length > 14 ? '…' : ''),
+ audience: a.subscriberCount || a.followersCount || 0,
+ }));
- {loading && (
- <LinearProgress sx={{ mb: 3, borderRadius: 1, '& .MuiLinearProgress-bar': { background: 'linear-gradient(90deg, #667eea, #764ba2)' } }} />
- )}
+ const pieData = accounts.map((a, i) => ({
+ name: (a.title || '').slice(0, 14) + ((a.title || '').length > 14 ? '…' : ''),
+ value: a.subscriberCount || a.followersCount || 0,
+ color: CHART_COLORS[i % CHART_COLORS.length],
+ }));
- {/* ── KPI Cards ──────────────────────────────────────────── */}
- <Grid container spacing={2.5} sx={{ mb: 3 }}>
- <Grid size={{ xs: 12, sm: 6, md: 3 }}>
- <StatCard icon={<People />} label="Total Audience" value={fmtNum(totalAudience)}
- subtitle={`${fmtNum(totals.subscribers)} subs · ${fmtNum(totals.followers)} followers`} gradient="purple" />
- </Grid>
- <Grid size={{ xs: 12, sm: 6, md: 3 }}>
- <StatCard icon={<Visibility />} label="Total YT Views" value={fmtNum(totals.views)}
- subtitle={fmtNumFull(totals.views)} gradient="red" />
- </Grid>
- <Grid size={{ xs: 12, sm: 6, md: 3 }}>
- <StatCard icon={<VideoLibrary />} label="Total Content" value={fmtNum(totals.videos + totals.posts)}
- subtitle={`${fmtNum(totals.videos)} videos · ${fmtNum(totals.posts)} posts`} gradient="blue" />
- </Grid>
- <Grid size={{ xs: 12, sm: 6, md: 3 }}>
- <StatCard icon={<BarChart />} label="Accounts" value={accounts.length}
- subtitle={`${ytAccounts.length} YouTube · ${igAccounts.length} Instagram`} gradient="orange" />
- </Grid>
- </Grid>
+ const handleViewChannel = (acc) => {
+ if (acc.platform === 'instagram') navigate(`/instagram/${acc.id}`);
+ else navigate(`/channel/${acc.id}`);
+ };
- {accounts.length === 0 ? (
- <Card sx={{ p: 7, textAlign: 'center' }}>
- <Box sx={{
- width: 80, height: 80, borderRadius: '50%',
- background: 'linear-gradient(135deg, rgba(102,126,234,0.15), rgba(118,75,162,0.15))',
- display: 'flex', alignItems: 'center', justifyContent: 'center', mx: 'auto', mb: 3,
- }}>
- <People sx={{ fontSize: 40, color: '#667eea' }} />
- </Box>
- <Typography variant="h5" sx={{ mb: 1, fontWeight: 700 }}>Welcome to Social Analytics</Typography>
- <Typography variant="body2" sx={{ color: 'text.secondary', maxWidth: 400, mx: 'auto' }}>
- Add your first YouTube channel or Instagram account to start tracking analytics
- </Typography>
- </Card>
- ) : (
- <>
- {/* ── Charts Row ─────────────────────────────────────── */}
- <Grid container spacing={2.5} sx={{ mb: 2.5 }}>
- {/* Audience Area Chart */}
- <Grid size={{ xs: 12, md: 8 }}>
- <Card sx={{ height: '100%' }}>
- <CardContent sx={{ p: 2.5 }}>
- <Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', mb: 2.5 }}>
- <Box>
- {sectionLabel('Audience Comparison')}
- </Box>
- </Box>
- <ResponsiveContainer width="100%" height={280}>
- <AreaChart data={chartData} margin={{ top: 4, right: 4, left: 0, bottom: 0 }}>
- <defs>
- <linearGradient id="audGrad" x1="0" y1="0" x2="0" y2="1">
- <stop offset="5%" stopColor="#667eea" stopOpacity={0.35} />
- <stop offset="95%" stopColor="#667eea" stopOpacity={0.02} />
- </linearGradient>
- </defs>
- <CartesianGrid strokeDasharray="3 3" stroke="rgba(255,255,255,0.05)" vertical={false} />
- <XAxis dataKey="name" tick={{ fill: '#64748B', fontSize: 12, fontWeight: 500 }} axisLine={false} tickLine={false} />
- <YAxis tick={{ fill: '#64748B', fontSize: 12 }} tickFormatter={fmtNum} axisLine={false} tickLine={false} width={52} />
- <ReTooltip
- contentStyle={chartTooltipStyle}
- formatter={(v) => [fmtNumFull(v), 'Audience']}
- cursor={{ stroke: 'rgba(255,255,255,0.1)', strokeWidth: 1 }}
- />
- <Area type="monotone" dataKey="audience" stroke="#667eea" strokeWidth={2.5}
- fill="url(#audGrad)" dot={{ fill: '#667eea', r: 4, strokeWidth: 0 }}
- activeDot={{ r: 6, strokeWidth: 0 }} />
- </AreaChart>
- </ResponsiveContainer>
- </CardContent>
- </Card>
- </Grid>
+ return (
+ <Box>
+ {/* Page header */}
+ <Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', mb: 3 }}>
+ <Box>
+ <Typography variant="h4" sx={{ mb: 0.5 }}>Dashboard Overview</Typography>
+ <Typography variant="body2" color="text.secondary">
+ {accounts.length === 0
+ ? 'Add your first account to start tracking'
+ : `Tracking ${accounts.length} account${accounts.length !== 1 ? 's' : ''} · ${ytAccounts.length} YouTube · ${igAccounts.length} Instagram`}
+ </Typography>
+ </Box>
+ <Button
+ variant="contained"
+ startIcon={<Refresh sx={{ fontSize: 18 }} />}
+ onClick={refreshAll}
+ disabled={loading || accounts.length === 0}
+ size="medium"
+ >
+ {loading ? 'Refreshing…' : 'Refresh All'}
+ </Button>
+ </Box>
- {/* Pie Chart */}
- <Grid size={{ xs: 12, md: 4 }}>
- <Card sx={{ height: '100%' }}>
- <CardContent sx={{ p: 2.5 }}>
- {sectionLabel('Audience Share')}
- <ResponsiveContainer width="100%" height={280}>
- <PieChart>
- <Pie data={pieData} dataKey="value" nameKey="name"
- cx="50%" cy="45%" outerRadius={95} innerRadius={52}
- paddingAngle={3} strokeWidth={0}>
- {pieData.map((entry, i) => (
- <Cell key={i} fill={entry.color} />
- ))}
- </Pie>
- <ReTooltip contentStyle={chartTooltipStyle} formatter={(v) => fmtNumFull(v)} />
- <Legend iconType="circle" iconSize={8}
- wrapperStyle={{ fontSize: 12, color: '#94A3B8', paddingTop: 8 }} />
- </PieChart>
- </ResponsiveContainer>
- </CardContent>
- </Card>
- </Grid>
- </Grid>
+ {loading && <LinearProgress sx={{ mb: 2.5, borderRadius: 1 }} />}
- {/* ── Rankings ───────────────────────────────────────── */}
- <Grid container spacing={2.5} sx={{ mb: 2.5 }}>
- <Grid size={{ xs: 12, md: 6 }}>
- <Card>
- <CardContent sx={{ p: 2.5 }}>
- {sectionLabel('Top by Audience')}
- {sorted.byAudience.map((a, i) => {
- const isIG = a.platform === 'instagram';
- const medalColor = i === 0 ? '#F59E0B' : i === 1 ? '#94A3B8' : i === 2 ? '#CD7F32' : '#475569';
- return (
- <Box key={a.id} onClick={() => onViewChannel(a)} sx={{
- display: 'flex', alignItems: 'center', gap: 1.5,
- py: 1.1, px: 1.2, borderRadius: 2, cursor: 'pointer',
- transition: 'background 0.15s',
- '&:hover': { bgcolor: 'rgba(255,255,255,0.035)' },
- }}>
- <Typography sx={{ width: 22, fontWeight: 800, color: medalColor, fontSize: 15, lineHeight: 1 }}>
- {i + 1}
- </Typography>
- <Avatar src={a.thumbnail || a.profilePictureUrl || a.thumbnails?.default}
- sx={{ width: 34, height: 34, border: 'none' }} />
- <Box sx={{ flex: 1, minWidth: 0 }}>
- <Typography variant="body2" noWrap sx={{ fontWeight: 600, fontSize: 13 }}>{a.title}</Typography>
- </Box>
- {isIG ? <Instagram sx={{ fontSize: 15, color: '#E1306C' }} /> : <YouTube sx={{ fontSize: 15, color: '#FF0000' }} />}
- <Chip
- label={fmtNum(isIG ? a.followersCount : a.subscriberCount)}
- size="small"
- sx={{
- bgcolor: isIG ? 'rgba(225,48,108,0.1)' : 'rgba(34,197,94,0.1)',
- color: isIG ? '#EC4899' : '#22C55E',
- fontWeight: 700, fontSize: 11, height: 22,
- border: `1px solid ${isIG ? 'rgba(225,48,108,0.2)' : 'rgba(34,197,94,0.2)'}`,
- }}
- />
- </Box>
- );
- })}
- </CardContent>
- </Card>
- </Grid>
+ {/* KPI cards */}
+ <Grid container spacing={2.5} sx={{ mb: 3 }}>
+ {[
+ {
+ icon: <People />,
+ label: 'Total Audience',
+ value: fmtNum(totalAudience),
+ subtitle: `${fmtNum(totals.subscribers)} subs · ${fmtNum(totals.followers)} followers`,
+ gradient: 'purple',
+ },
+ {
+ icon: <Visibility />,
+ label: 'Total Views',
+ value: fmtNum(totals.views),
+ subtitle: fmtNumFull(totals.views),
+ gradient: 'red',
+ },
+ {
+ icon: <VideoLibrary />,
+ label: 'Total Content',
+ value: fmtNum(totals.videos + totals.posts),
+ subtitle: `${fmtNum(totals.videos)} videos · ${fmtNum(totals.posts)} posts`,
+ gradient: 'blue',
+ },
+ {
+ icon: <BarChart />,
+ label: 'Accounts',
+ value: accounts.length,
+ subtitle: `${ytAccounts.length} YouTube · ${igAccounts.length} Instagram`,
+ gradient: 'orange',
+ },
+ ].map((card, i) => (
+ <Grid key={i} size={{ xs: 12, sm: 6, md: 3 }}>
+ <StatCard {...card} loading={loading} />
+ </Grid>
+ ))}
+ </Grid>
- <Grid size={{ xs: 12, md: 6 }}>
- <Card>
- <CardContent sx={{ p: 2.5 }}>
- {sectionLabel('Top by Content')}
- {sorted.byContent.map((a, i) => {
- const isIG = a.platform === 'instagram';
- const medalColor = i === 0 ? '#F59E0B' : i === 1 ? '#94A3B8' : i === 2 ? '#CD7F32' : '#475569';
- return (
- <Box key={a.id} onClick={() => onViewChannel(a)} sx={{
- display: 'flex', alignItems: 'center', gap: 1.5,
- py: 1.1, px: 1.2, borderRadius: 2, cursor: 'pointer',
- transition: 'background 0.15s',
- '&:hover': { bgcolor: 'rgba(255,255,255,0.035)' },
- }}>
- <Typography sx={{ width: 22, fontWeight: 800, color: medalColor, fontSize: 15, lineHeight: 1 }}>
- {i + 1}
- </Typography>
- <Avatar src={a.thumbnail || a.profilePictureUrl || a.thumbnails?.default}
- sx={{ width: 34, height: 34, border: 'none' }} />
- <Box sx={{ flex: 1, minWidth: 0 }}>
- <Typography variant="body2" noWrap sx={{ fontWeight: 600, fontSize: 13 }}>{a.title}</Typography>
- </Box>
- {isIG ? <Instagram sx={{ fontSize: 15, color: '#E1306C' }} /> : <YouTube sx={{ fontSize: 15, color: '#FF0000' }} />}
- <Chip
- label={isIG ? `${fmtNum(a.mediaCount)} posts` : `${fmtNum(a.viewCount)} views`}
- size="small"
- sx={{
- bgcolor: isIG ? 'rgba(161,122,204,0.1)' : 'rgba(255,0,0,0.1)',
- color: isIG ? '#A78BFA' : '#FF4444',
- fontWeight: 700, fontSize: 11, height: 22,
- border: `1px solid ${isIG ? 'rgba(161,122,204,0.2)' : 'rgba(255,0,0,0.2)'}`,
- }}
- />
- </Box>
- );
- })}
- </CardContent>
- </Card>
- </Grid>
- </Grid>
+ {accounts.length === 0 ? (
+ <MainCard>
+ <Box sx={{ textAlign: 'center', py: 6 }}>
+ <Box
+ sx={{
+ width: 72,
+ height: 72,
+ borderRadius: '50%',
+ bgcolor: `${PRIMARY.lighter}`,
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ mx: 'auto',
+ mb: 2.5,
+ }}
+ >
+ <People sx={{ fontSize: 36, color: PRIMARY.main }} />
+ </Box>
+ <Typography variant="h5" sx={{ mb: 1 }}>Welcome to Twiligent</Typography>
+ <Typography variant="body2" color="text.secondary" sx={{ maxWidth: 380, mx: 'auto', mb: 2.5 }}>
+ Add your first YouTube channel or Instagram account to start tracking analytics
+ </Typography>
+ <Button variant="contained" onClick={() => navigate('/accounts')}>
+ Add Account
+ </Button>
+ </Box>
+ </MainCard>
+ ) : (
+ <>
+ {/* Charts */}
+ <Grid container spacing={2.5} sx={{ mb: 2.5 }}>
+ <Grid size={{ xs: 12, md: 8 }}>
+ <MainCard title="Audience Comparison" contentSX={{ p: 2 }}>
+ <ResponsiveContainer width="100%" height={280}>
+ <AreaChart data={chartData} margin={{ top: 4, right: 4, left: 0, bottom: 0 }}>
+ <defs>
+ <linearGradient id="audGrad" x1="0" y1="0" x2="0" y2="1">
+ <stop offset="5%" stopColor={PRIMARY.main} stopOpacity={0.18} />
+ <stop offset="95%" stopColor={PRIMARY.main} stopOpacity={0.01} />
+ </linearGradient>
+ </defs>
+ <CartesianGrid strokeDasharray="3 3" stroke={GREY[200]} vertical={false} />
+ <XAxis
+ dataKey="name"
+ tick={{ fill: GREY[500], fontSize: 12 }}
+ axisLine={false}
+ tickLine={false}
+ />
+ <YAxis
+ tick={{ fill: GREY[500], fontSize: 12 }}
+ tickFormatter={fmtNum}
+ axisLine={false}
+ tickLine={false}
+ width={52}
+ />
+ <ReTooltip
+ contentStyle={tooltipStyle}
+ formatter={(v) => [fmtNumFull(v), 'Audience']}
+ cursor={{ stroke: GREY[300], strokeWidth: 1 }}
+ />
+ <Area
+ type="monotone"
+ dataKey="audience"
+ stroke={PRIMARY.main}
+ strokeWidth={2}
+ fill="url(#audGrad)"
+ dot={{ fill: PRIMARY.main, r: 4, strokeWidth: 0 }}
+ activeDot={{ r: 6, strokeWidth: 0, fill: PRIMARY.dark }}
+ />
+ </AreaChart>
+ </ResponsiveContainer>
+ </MainCard>
+ </Grid>
- {/* ── All Accounts Table ─────────────────────────────── */}
- <Card>
- <CardContent sx={{ p: 2.5 }}>
- {sectionLabel('All Accounts')}
- <TableContainer>
- <Table size="small">
- <TableHead>
- <TableRow>
- <TableCell sx={{ width: 36 }}>#</TableCell>
- <TableCell>Account</TableCell>
- <TableCell align="center" sx={{ width: 80 }}>Platform</TableCell>
- <TableCell align="right">Audience</TableCell>
- <TableCell align="right">Content</TableCell>
- <TableCell align="right">Updated</TableCell>
- <TableCell align="center" sx={{ width: 60 }}></TableCell>
- </TableRow>
- </TableHead>
- <TableBody>
- {sorted.byAudience.map((a, i) => {
- const isIG = a.platform === 'instagram';
- return (
- <TableRow key={a.id} onClick={() => onViewChannel(a)}
- sx={{ cursor: 'pointer' }}>
- <TableCell>
- <Typography sx={{ fontWeight: 700, fontSize: 13, color: i < 3 ? '#F59E0B' : 'text.secondary' }}>
- {i + 1}
- </Typography>
- </TableCell>
- <TableCell>
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 1.5 }}>
- <Avatar src={a.thumbnail || a.profilePictureUrl || a.thumbnails?.default}
- sx={{ width: 34, height: 34, border: 'none' }} />
- <Box>
- <Typography sx={{ fontWeight: 600, fontSize: 13, lineHeight: 1.3 }}>{a.title}</Typography>
- <Typography sx={{ color: 'text.secondary', fontSize: 11 }}>
- {isIG ? `@${a.username || ''}` : (a.customUrl || a.channelId || '')}
- </Typography>
- </Box>
- </Box>
- </TableCell>
- <TableCell align="center">
- {isIG
- ? <Instagram sx={{ color: '#E1306C', fontSize: 18 }} />
- : <YouTube sx={{ color: '#FF0000', fontSize: 18 }} />}
- </TableCell>
- <TableCell align="right">
- <Typography sx={{ fontWeight: 700, fontSize: 13 }}>
- {fmtNum(isIG ? a.followersCount : a.subscriberCount)}
- </Typography>
- <Typography sx={{ color: 'text.secondary', fontSize: 10 }}>
- {isIG ? 'followers' : 'subscribers'}
- </Typography>
- </TableCell>
- <TableCell align="right" sx={{ fontSize: 13 }}>
- {isIG
- ? `${fmtNum(a.mediaCount)} posts`
- : `${fmtNum(a.viewCount)} views · ${fmtNum(a.videoCount)} videos`}
- </TableCell>
- <TableCell align="right">
- <Typography sx={{ color: 'text.secondary', fontSize: 11 }}>{timeAgo(a.lastUpdated)}</Typography>
- </TableCell>
- <TableCell align="center">
- <Tooltip title="View Analytics">
- <IconButton size="small" onClick={(e) => { e.stopPropagation(); onViewChannel(a); }}
- sx={{ color: 'text.secondary', '&:hover': { color: 'text.primary' } }}>
- <OpenInNew sx={{ fontSize: 15 }} />
- </IconButton>
- </Tooltip>
- </TableCell>
- </TableRow>
- );
- })}
- </TableBody>
- </Table>
- </TableContainer>
- </CardContent>
- </Card>
- </>
- )}
- </Box>
- );
+ <Grid size={{ xs: 12, md: 4 }}>
+ <MainCard title="Audience Share" contentSX={{ p: 2 }}>
+ <ResponsiveContainer width="100%" height={280}>
+ <PieChart>
+ <Pie
+ data={pieData}
+ dataKey="value"
+ nameKey="name"
+ cx="50%"
+ cy="44%"
+ outerRadius={90}
+ innerRadius={50}
+ paddingAngle={3}
+ strokeWidth={0}
+ >
+ {pieData.map((entry, i) => (
+ <Cell key={i} fill={entry.color} />
+ ))}
+ </Pie>
+ <ReTooltip contentStyle={tooltipStyle} formatter={(v) => fmtNumFull(v)} />
+ <Legend
+ iconType="circle"
+ iconSize={8}
+ wrapperStyle={{ fontSize: 12, color: GREY[600], paddingTop: 8 }}
+ />
+ </PieChart>
+ </ResponsiveContainer>
+ </MainCard>
+ </Grid>
+ </Grid>
+
+ {/* Leaderboards */}
+ <Grid container spacing={2.5} sx={{ mb: 2.5 }}>
+ {[
+ { title: 'Top by Audience', list: sorted.byAudience, metric: a => fmtNum(a.platform === 'instagram' ? a.followersCount : a.subscriberCount), metricLabel: a => a.platform === 'instagram' ? 'followers' : 'subscribers' },
+ { title: 'Top by Content', list: sorted.byContent, metric: a => a.platform === 'instagram' ? `${fmtNum(a.mediaCount)} posts` : `${fmtNum(a.viewCount)} views`, metricLabel: () => '' },
+ ].map(({ title, list, metric, metricLabel }) => (
+ <Grid key={title} size={{ xs: 12, md: 6 }}>
+ <MainCard title={title}>
+ {list.map((a, i) => {
+ const isIG = a.platform === 'instagram';
+ const medalColors = ['#faad14', '#8c8c8c', '#d4845a'];
+ return (
+ <Box
+ key={a.id}
+ onClick={() => handleViewChannel(a)}
+ sx={{
+ display: 'flex',
+ alignItems: 'center',
+ gap: 1.5,
+ py: 1,
+ px: 1,
+ borderRadius: 1.5,
+ cursor: 'pointer',
+ transition: 'background 0.15s',
+ '&:hover': { bgcolor: GREY[50] },
+ }}
+ >
+ <Typography
+ sx={{
+ width: 20,
+ fontWeight: 700,
+ fontSize: '0.875rem',
+ color: i < 3 ? medalColors[i] : GREY[400],
+ }}
+ >
+ {i + 1}
+ </Typography>
+ <Avatar
+ src={a.thumbnail || a.profilePictureUrl || a.thumbnails?.default}
+ sx={{ width: 32, height: 32, border: 'none', bgcolor: isIG ? '#E1306C' : '#FF0000' }}
+ >
+ {isIG ? <Instagram sx={{ fontSize: 14 }} /> : <YouTube sx={{ fontSize: 14 }} />}
+ </Avatar>
+ <Box sx={{ flex: 1, minWidth: 0 }}>
+ <Typography variant="body2" noWrap sx={{ fontWeight: 600, color: 'text.primary' }}>
+ {a.title}
+ </Typography>
+ </Box>
+ <Chip
+ label={metric(a)}
+ size="small"
+ sx={{
+ bgcolor: isIG ? '#fff0f6' : '#f6ffed',
+ color: isIG ? '#c41d7f' : '#389e0d',
+ fontWeight: 600,
+ fontSize: '0.7rem',
+ height: 22,
+ border: '1px solid',
+ borderColor: isIG ? '#ffadd2' : '#b7eb8f',
+ }}
+ />
+ </Box>
+ );
+ })}
+ </MainCard>
+ </Grid>
+ ))}
+ </Grid>
+
+ {/* Full accounts table */}
+ <MainCard title="All Accounts" content={false}>
+ <TableContainer>
+ <Table size="small">
+ <TableHead>
+ <TableRow>
+ <TableCell sx={{ width: 40 }}>#</TableCell>
+ <TableCell>Account</TableCell>
+ <TableCell align="center" sx={{ width: 80 }}>Platform</TableCell>
+ <TableCell align="right">Audience</TableCell>
+ <TableCell align="right">Content</TableCell>
+ <TableCell align="right">Updated</TableCell>
+ <TableCell align="center" sx={{ width: 52 }} />
+ </TableRow>
+ </TableHead>
+ <TableBody>
+ {sorted.byAudience.map((a, i) => {
+ const isIG = a.platform === 'instagram';
+ return (
+ <TableRow
+ key={a.id}
+ onClick={() => handleViewChannel(a)}
+ sx={{ cursor: 'pointer' }}
+ >
+ <TableCell>
+ <Typography
+ variant="body2"
+ sx={{ fontWeight: 700, color: i < 3 ? '#faad14' : 'text.secondary' }}
+ >
+ {i + 1}
+ </Typography>
+ </TableCell>
+ <TableCell>
+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 1.5 }}>
+ <Avatar
+ src={a.thumbnail || a.profilePictureUrl || a.thumbnails?.default}
+ sx={{ width: 32, height: 32, border: 'none', bgcolor: isIG ? '#E1306C' : '#FF0000' }}
+ >
+ {isIG ? <Instagram sx={{ fontSize: 14 }} /> : <YouTube sx={{ fontSize: 14 }} />}
+ </Avatar>
+ <Box>
+ <Typography variant="body2" sx={{ fontWeight: 600 }}>{a.title}</Typography>
+ <Typography variant="caption" color="text.secondary">
+ {isIG ? `@${a.username || ''}` : (a.customUrl || a.channelId || '')}
+ </Typography>
+ </Box>
+ </Box>
+ </TableCell>
+ <TableCell align="center">
+ {isIG
+ ? <Chip label="Instagram" size="small" sx={{ bgcolor: '#fff0f6', color: '#c41d7f', fontWeight: 600, fontSize: '0.65rem', height: 20 }} />
+ : <Chip label="YouTube" size="small" sx={{ bgcolor: '#fff1f0', color: '#a8071a', fontWeight: 600, fontSize: '0.65rem', height: 20 }} />}
+ </TableCell>
+ <TableCell align="right">
+ <Typography variant="body2" sx={{ fontWeight: 600 }}>
+ {fmtNum(isIG ? a.followersCount : a.subscriberCount)}
+ </Typography>
+ <Typography variant="caption" color="text.secondary">
+ {isIG ? 'followers' : 'subscribers'}
+ </Typography>
+ </TableCell>
+ <TableCell align="right">
+ <Typography variant="body2">
+ {isIG
+ ? `${fmtNum(a.mediaCount)} posts`
+ : `${fmtNum(a.viewCount)} views · ${fmtNum(a.videoCount)} vids`}
+ </Typography>
+ </TableCell>
+ <TableCell align="right">
+ <Typography variant="caption" color="text.secondary">{timeAgo(a.lastUpdated)}</Typography>
+ </TableCell>
+ <TableCell align="center">
+ <Tooltip title="View Analytics">
+ <IconButton
+ size="small"
+ onClick={(e) => { e.stopPropagation(); handleViewChannel(a); }}
+ sx={{ color: 'text.secondary', '&:hover': { color: PRIMARY.main, bgcolor: PRIMARY.lighter } }}
+ >
+ <OpenInNew sx={{ fontSize: 14 }} />
+ </IconButton>
+ </Tooltip>
+ </TableCell>
+ </TableRow>
+ );
+ })}
+ </TableBody>
+ </Table>
+ </TableContainer>
+ </MainCard>
+ </>
+ )}
+ </Box>
+ );
}
diff --git a/frontend/src/features/analytics/reels/ReelsExplorer.jsx b/frontend/src/features/analytics/reels/ReelsExplorer.jsx
index 1b5a19e..987f5a6 100644
--- a/frontend/src/features/analytics/reels/ReelsExplorer.jsx
+++ b/frontend/src/features/analytics/reels/ReelsExplorer.jsx
@@ -1,62 +1,64 @@
import React, { useState, useEffect, useMemo } from 'react';
import {
- Box, Typography, Card, CardContent, Grid, TextField, InputAdornment,
+ Box, Typography, Grid, TextField, InputAdornment,
Select, MenuItem, FormControl, InputLabel, Chip, LinearProgress,
Avatar, Button, Pagination, Skeleton,
} from '@mui/material';
import {
- Search, Visibility, FavoriteBorder, ChatBubbleOutline, PlayCircleOutline,
- Instagram, MovieFilter, Photo, Collections, ViewCarousel,
+ Search, FavoriteBorder, ChatBubbleOutline, PlayCircleOutline,
+ Instagram, MovieFilter, Photo, ViewCarousel,
} from '@mui/icons-material';
+import MainCard from '../../../components/MainCard';
+import { useAppContext } from '../../../context/AppContext';
import { api } from '../../../services/api';
-import { fmtNum, fmtDate, timeAgo } from '../../../utils/formatters';
+import { fmtNum, timeAgo } from '../../../utils/formatters';
+import { GREY } from '../../../themes/index';
const ITEMS_PER_PAGE = 24;
const MEDIA_TYPE_FILTER = [
- { label: 'All Types', value: 'all' },
- { label: 'Reels', value: 'REEL' },
- { label: 'Videos', value: 'VIDEO' },
- { label: 'Photos', value: 'IMAGE' },
- { label: 'Carousels', value: 'CAROUSEL_ALBUM' },
+ { label: 'All Types', value: 'all' },
+ { label: 'Reels', value: 'REEL' },
+ { label: 'Videos', value: 'VIDEO' },
+ { label: 'Photos', value: 'IMAGE' },
+ { label: 'Carousels', value: 'CAROUSEL_ALBUM' },
];
const MEDIA_TYPE_META = {
- REEL: { label: 'Reel', color: '#E1306C', icon: <MovieFilter sx={{ fontSize: '13px !important', color: '#fff !important' }} /> },
- VIDEO: { label: 'Video', color: '#833AB4', icon: <PlayCircleOutline sx={{ fontSize: '13px !important', color: '#fff !important' }} /> },
- IMAGE: { label: 'Photo', color: '#F77737', icon: <Photo sx={{ fontSize: '13px !important', color: '#fff !important' }} /> },
- CAROUSEL_ALBUM: { label: 'Carousel', color: '#405DE6', icon: <ViewCarousel sx={{ fontSize: '13px !important', color: '#fff !important' }} /> },
+ REEL: { label: 'Reel', color: '#E1306C', icon: <MovieFilter sx={{ fontSize: '12px !important', color: '#fff !important' }} /> },
+ VIDEO: { label: 'Video', color: '#833AB4', icon: <PlayCircleOutline sx={{ fontSize: '12px !important', color: '#fff !important' }} /> },
+ IMAGE: { label: 'Photo', color: '#F77737', icon: <Photo sx={{ fontSize: '12px !important', color: '#fff !important' }} /> },
+ CAROUSEL_ALBUM: { label: 'Carousel', color: '#405DE6', icon: <ViewCarousel sx={{ fontSize: '12px !important', color: '#fff !important' }} /> },
};
const PERFORMANCE_TIERS = [
- { label: 'All', value: 'all' },
- { label: 'Viral (>100K)', value: 'viral', min: 100000 },
- { label: 'High (10K–100K)', value: 'high', min: 10000, max: 100000 },
- { label: 'Medium (1K–10K)', value: 'medium', min: 1000, max: 10000 },
- { label: 'Low (<1K)', value: 'low', max: 1000 },
+ { label: 'All', value: 'all' },
+ { label: 'Viral (>100K)', value: 'viral', min: 100000 },
+ { label: 'High (10K–100K)', value: 'high', min: 10000, max: 100000 },
+ { label: 'Medium (1K–10K)', value: 'medium', min: 1000, max: 10000 },
+ { label: 'Low (<1K)', value: 'low', max: 1000 },
];
const SORT_OPTIONS = [
- { label: 'Most Liked', field: 'likeCount' },
- { label: 'Most Comments', field: 'commentsCount' },
+ { label: 'Most Liked', field: 'likeCount' },
+ { label: 'Most Comments', field: 'commentsCount' },
{ label: 'Best Engagement', field: 'engagementRate' },
- { label: 'Newest First', field: 'timestamp' },
+ { label: 'Newest First', field: 'timestamp' },
];
-export default function ReelsExplorer({ accounts, showToast }) {
- const [media, setMedia] = useState([]);
- const [loading, setLoading] = useState(true);
- const [search, setSearch] = useState('');
- const [accountFilter, setAccountFilter] = useState('all');
+export default function ReelsExplorer() {
+ const { accounts, showToast } = useAppContext();
+ const [media, setMedia] = useState([]);
+ const [loading, setLoading] = useState(true);
+ const [search, setSearch] = useState('');
+ const [accountFilter, setAccountFilter] = useState('all');
const [mediaTypeFilter, setMediaTypeFilter] = useState('all');
const [performanceTier, setPerformanceTier] = useState('all');
- const [sortField, setSortField] = useState('likeCount');
- const [page, setPage] = useState(1);
- const [igAccounts, setIgAccounts] = useState([]);
+ const [sortField, setSortField] = useState('likeCount');
+ const [page, setPage] = useState(1);
+ const [igAccounts, setIgAccounts] = useState([]);
- useEffect(() => {
- loadAllMedia();
- }, [accounts]);
+ useEffect(() => { loadAllMedia(); }, [accounts]);
const loadAllMedia = async () => {
setLoading(true);
@@ -69,26 +71,19 @@ export default function ReelsExplorer({ accounts, showToast }) {
const res = await api.getIGMedia(acct.id);
const items = res.media || [];
const acctName = acct.title || acct.username || acct.name || 'Unknown';
- acctList.push({
- id: acct.id,
- title: acctName,
- thumbnail: acct.profilePictureUrl || acct.thumbnailUrl || '',
- });
+ acctList.push({ id: acct.id, title: acctName, thumbnail: acct.profilePictureUrl || acct.thumbnailUrl || '' });
for (const m of items) {
const likes = m.likeCount || 0;
const comments = m.commentsCount || 0;
- const total = likes + comments;
allMedia.push({
...m,
accountName: acctName,
accountId: acct.id,
accountThumbnail: acct.profilePictureUrl || acct.thumbnailUrl || '',
- engagementRate: total > 0 ? total : 0,
+ engagementRate: likes + comments,
});
}
- } catch (e) {
- console.warn(`Failed to load media for IG account ${acct.id}:`, e.message);
- }
+ } catch (e) { /* skip */ }
}
setMedia(allMedia);
setIgAccounts(acctList);
@@ -101,63 +96,47 @@ export default function ReelsExplorer({ accounts, showToast }) {
const filteredMedia = useMemo(() => {
let result = [...media];
-
- if (accountFilter !== 'all') result = result.filter(r => r.accountId === accountFilter);
-
+ if (accountFilter !== 'all') result = result.filter(r => r.accountId === accountFilter);
if (mediaTypeFilter !== 'all') result = result.filter(r => r.mediaType === mediaTypeFilter);
-
if (search.trim()) {
const q = search.toLowerCase();
result = result.filter(r => r.caption?.toLowerCase().includes(q));
}
-
if (performanceTier !== 'all') {
const tier = PERFORMANCE_TIERS.find(t => t.value === performanceTier);
- if (tier) {
- if (tier.min != null) result = result.filter(r => (r.likeCount || 0) >= tier.min);
- if (tier.max != null) result = result.filter(r => (r.likeCount || 0) < tier.max);
- }
+ if (tier?.min != null) result = result.filter(r => (r.likeCount || 0) >= tier.min);
+ if (tier?.max != null) result = result.filter(r => (r.likeCount || 0) < tier.max);
}
-
result.sort((a, b) => {
const aVal = sortField === 'timestamp' ? new Date(a[sortField] || 0).getTime() : (parseFloat(a[sortField]) || 0);
const bVal = sortField === 'timestamp' ? new Date(b[sortField] || 0).getTime() : (parseFloat(b[sortField]) || 0);
return bVal - aVal;
});
-
return result;
}, [media, accountFilter, mediaTypeFilter, search, performanceTier, sortField]);
- const pageCount = Math.ceil(filteredMedia.length / ITEMS_PER_PAGE);
+ const pageCount = Math.ceil(filteredMedia.length / ITEMS_PER_PAGE);
const paginatedMedia = filteredMedia.slice((page - 1) * ITEMS_PER_PAGE, page * ITEMS_PER_PAGE);
const stats = useMemo(() => {
- const total = filteredMedia.length;
- const totalLikes = filteredMedia.reduce((s, r) => s + (r.likeCount || 0), 0);
+ const total = filteredMedia.length;
+ const totalLikes = filteredMedia.reduce((s, r) => s + (r.likeCount || 0), 0);
const totalComments = filteredMedia.reduce((s, r) => s + (r.commentsCount || 0), 0);
- const avgLikes = total > 0 ? Math.round(totalLikes / total) : 0;
- const reels = filteredMedia.filter(m => m.mediaType === 'REEL' || m.mediaType === 'VIDEO').length;
- const photos = filteredMedia.filter(m => m.mediaType === 'IMAGE').length;
- const carousels = filteredMedia.filter(m => m.mediaType === 'CAROUSEL_ALBUM').length;
- return { total, totalLikes, totalComments, avgLikes, reels, photos, carousels };
+ const avgLikes = total > 0 ? Math.round(totalLikes / total) : 0;
+ const reels = filteredMedia.filter(m => m.mediaType === 'REEL' || m.mediaType === 'VIDEO').length;
+ const photos = filteredMedia.filter(m => m.mediaType === 'IMAGE').length;
+ return { total, totalLikes, totalComments, avgLikes, reels, photos };
}, [filteredMedia]);
- const openOnInstagram = (permalink) => {
- if (permalink) window.open(permalink, '_blank', 'noopener');
- };
-
if (loading) {
return (
<Box>
- <Typography variant="h4" sx={{ fontWeight: 700, mb: 3 }}>
- <Instagram sx={{ verticalAlign: 'middle', mr: 1, color: '#E1306C', fontSize: 36 }} />
- IG Content Explorer
- </Typography>
- <LinearProgress sx={{ mb: 3, '& .MuiLinearProgress-bar': { background: 'linear-gradient(90deg, #833AB4, #E1306C, #F77737)' } }} />
+ <Typography variant="h4" sx={{ mb: 3 }}>IG Content Explorer</Typography>
+ <LinearProgress sx={{ mb: 3, borderRadius: 1 }} />
<Grid container spacing={2}>
{[...Array(8)].map((_, i) => (
<Grid size={{ xs: 6, sm: 4, md: 3, lg: 2 }} key={i}>
- <Skeleton variant="rounded" height={320} sx={{ borderRadius: 3 }} />
+ <Skeleton variant="rounded" height={320} sx={{ borderRadius: 2 }} />
</Grid>
))}
</Grid>
@@ -167,88 +146,61 @@ export default function ReelsExplorer({ accounts, showToast }) {
return (
<Box>
- {/* Header */}
- <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 3, flexWrap: 'wrap', gap: 2 }}>
- <Typography variant="h4" sx={{ fontWeight: 700 }}>
- <Instagram sx={{ verticalAlign: 'middle', mr: 1, color: '#E1306C', fontSize: 36 }} />
- IG Content Explorer
- </Typography>
- <Button variant="contained" onClick={loadAllMedia}
- sx={{ background: 'linear-gradient(135deg, #833AB4, #E1306C, #F77737)' }}>
- Refresh All
- </Button>
+ <Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', mb: 3, flexWrap: 'wrap', gap: 2 }}>
+ <Box>
+ <Typography variant="h4">IG Content Explorer</Typography>
+ <Typography variant="body2" color="text.secondary" sx={{ mt: 0.25 }}>
+ {media.length} posts across {igAccounts.length} accounts
+ </Typography>
+ </Box>
+ <Button variant="contained" onClick={loadAllMedia} size="small">Refresh</Button>
</Box>
{/* Summary Stats */}
<Grid container spacing={2} sx={{ mb: 3 }}>
- <Grid size={{ xs: 6, sm: 2 }}>
- <Card sx={{ textAlign: 'center', p: 1.5 }}>
- <Typography variant="caption" color="text.secondary">Total Posts</Typography>
- <Typography variant="h5" sx={{ fontWeight: 700 }}>{fmtNum(stats.total)}</Typography>
- </Card>
- </Grid>
- <Grid size={{ xs: 6, sm: 2 }}>
- <Card sx={{ textAlign: 'center', p: 1.5 }}>
- <Typography variant="caption" color="text.secondary">Reels</Typography>
- <Typography variant="h5" sx={{ fontWeight: 700, color: '#E1306C' }}>{fmtNum(stats.reels)}</Typography>
- </Card>
- </Grid>
- <Grid size={{ xs: 6, sm: 2 }}>
- <Card sx={{ textAlign: 'center', p: 1.5 }}>
- <Typography variant="caption" color="text.secondary">Photos</Typography>
- <Typography variant="h5" sx={{ fontWeight: 700, color: '#F77737' }}>{fmtNum(stats.photos)}</Typography>
- </Card>
- </Grid>
- <Grid size={{ xs: 6, sm: 2 }}>
- <Card sx={{ textAlign: 'center', p: 1.5 }}>
- <Typography variant="caption" color="text.secondary">Total Likes</Typography>
- <Typography variant="h5" sx={{ fontWeight: 700, color: '#E1306C' }}>{fmtNum(stats.totalLikes)}</Typography>
- </Card>
- </Grid>
- <Grid size={{ xs: 6, sm: 2 }}>
- <Card sx={{ textAlign: 'center', p: 1.5 }}>
- <Typography variant="caption" color="text.secondary">Total Comments</Typography>
- <Typography variant="h5" sx={{ fontWeight: 700, color: '#833AB4' }}>{fmtNum(stats.totalComments)}</Typography>
- </Card>
- </Grid>
- <Grid size={{ xs: 6, sm: 2 }}>
- <Card sx={{ textAlign: 'center', p: 1.5 }}>
- <Typography variant="caption" color="text.secondary">Avg Likes</Typography>
- <Typography variant="h5" sx={{ fontWeight: 700, color: '#F77737' }}>{fmtNum(stats.avgLikes)}</Typography>
- </Card>
- </Grid>
+ {[
+ { label: 'Total Posts', value: fmtNum(stats.total) },
+ { label: 'Reels & Videos', value: fmtNum(stats.reels) },
+ { label: 'Photos', value: fmtNum(stats.photos) },
+ { label: 'Total Likes', value: fmtNum(stats.totalLikes) },
+ { label: 'Total Comments', value: fmtNum(stats.totalComments) },
+ { label: 'Avg Likes', value: fmtNum(stats.avgLikes) },
+ ].map((s, i) => (
+ <Grid key={i} size={{ xs: 6, sm: 4, md: 2 }}>
+ <MainCard sx={{ textAlign: 'center' }}>
+ <Typography variant="caption" color="text.secondary" sx={{ display: 'block' }}>{s.label}</Typography>
+ <Typography variant="h5" sx={{ fontWeight: 700, mt: 0.5 }}>{s.value}</Typography>
+ </MainCard>
+ </Grid>
+ ))}
</Grid>
{/* Filters */}
- <Card sx={{ mb: 3, p: 2 }}>
+ <MainCard sx={{ mb: 2.5 }}>
<Grid container spacing={2} alignItems="center">
- <Grid size={{ xs: 12, sm: 2.4 }}>
- <TextField fullWidth size="small" placeholder="Search posts..."
- value={search} onChange={(e) => { setSearch(e.target.value); setPage(1); }}
- slotProps={{ input: { startAdornment: <InputAdornment position="start"><Search sx={{ color: 'text.secondary' }} /></InputAdornment> } }}
+ <Grid size={{ xs: 12, sm: 3 }}>
+ <TextField fullWidth size="small" placeholder="Search posts…"
+ value={search} onChange={e => { setSearch(e.target.value); setPage(1); }}
+ slotProps={{ input: { startAdornment: <InputAdornment position="start"><Search sx={{ color: 'text.secondary', fontSize: 18 }} /></InputAdornment> } }}
/>
</Grid>
- <Grid size={{ xs: 6, sm: 2.4 }}>
+ <Grid size={{ xs: 6, sm: 2.25 }}>
<FormControl fullWidth size="small">
<InputLabel>Media Type</InputLabel>
- <Select value={mediaTypeFilter} label="Media Type"
- onChange={(e) => { setMediaTypeFilter(e.target.value); setPage(1); }}>
- {MEDIA_TYPE_FILTER.map(t => (
- <MenuItem key={t.value} value={t.value}>{t.label}</MenuItem>
- ))}
+ <Select value={mediaTypeFilter} label="Media Type" onChange={e => { setMediaTypeFilter(e.target.value); setPage(1); }}>
+ {MEDIA_TYPE_FILTER.map(t => <MenuItem key={t.value} value={t.value}>{t.label}</MenuItem>)}
</Select>
</FormControl>
</Grid>
- <Grid size={{ xs: 6, sm: 2.4 }}>
+ <Grid size={{ xs: 6, sm: 2.25 }}>
<FormControl fullWidth size="small">
<InputLabel>Account</InputLabel>
- <Select value={accountFilter} label="Account"
- onChange={(e) => { setAccountFilter(e.target.value); setPage(1); }}>
+ <Select value={accountFilter} label="Account" onChange={e => { setAccountFilter(e.target.value); setPage(1); }}>
<MenuItem value="all">All Accounts ({igAccounts.length})</MenuItem>
{igAccounts.map(a => (
<MenuItem key={a.id} value={a.id}>
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
- {a.thumbnail && <Avatar src={a.thumbnail} sx={{ width: 20, height: 20 }} />}
+ {a.thumbnail && <Avatar src={a.thumbnail} sx={{ width: 18, height: 18 }} />}
{a.title}
</Box>
</MenuItem>
@@ -256,125 +208,105 @@ export default function ReelsExplorer({ accounts, showToast }) {
</Select>
</FormControl>
</Grid>
- <Grid size={{ xs: 6, sm: 2.4 }}>
+ <Grid size={{ xs: 6, sm: 2.25 }}>
<FormControl fullWidth size="small">
<InputLabel>Performance</InputLabel>
- <Select value={performanceTier} label="Performance"
- onChange={(e) => { setPerformanceTier(e.target.value); setPage(1); }}>
- {PERFORMANCE_TIERS.map(t => (
- <MenuItem key={t.value} value={t.value}>{t.label}</MenuItem>
- ))}
+ <Select value={performanceTier} label="Performance" onChange={e => { setPerformanceTier(e.target.value); setPage(1); }}>
+ {PERFORMANCE_TIERS.map(t => <MenuItem key={t.value} value={t.value}>{t.label}</MenuItem>)}
</Select>
</FormControl>
</Grid>
- <Grid size={{ xs: 6, sm: 2.4 }}>
+ <Grid size={{ xs: 6, sm: 2.25 }}>
<FormControl fullWidth size="small">
<InputLabel>Sort By</InputLabel>
- <Select value={sortField} label="Sort By"
- onChange={(e) => { setSortField(e.target.value); setPage(1); }}>
- {SORT_OPTIONS.map(s => (
- <MenuItem key={s.field} value={s.field}>{s.label}</MenuItem>
- ))}
+ <Select value={sortField} label="Sort By" onChange={e => { setSortField(e.target.value); setPage(1); }}>
+ {SORT_OPTIONS.map(s => <MenuItem key={s.field} value={s.field}>{s.label}</MenuItem>)}
</Select>
</FormControl>
</Grid>
</Grid>
- <Box sx={{ mt: 1.5 }}>
- <Typography variant="caption" color="text.secondary">
- Showing {paginatedMedia.length} of {filteredMedia.length} posts
- {mediaTypeFilter !== 'all' && ` • Type: ${MEDIA_TYPE_FILTER.find(t => t.value === mediaTypeFilter)?.label}`}
- {accountFilter !== 'all' && ` • Account: ${igAccounts.find(a => a.id === accountFilter)?.title}`}
- {performanceTier !== 'all' && ` • ${PERFORMANCE_TIERS.find(t => t.value === performanceTier)?.label}`}
- </Typography>
- </Box>
- </Card>
+ <Typography variant="caption" color="text.secondary" sx={{ display: 'block', mt: 1.5 }}>
+ Showing {paginatedMedia.length} of {filteredMedia.length} posts
+ </Typography>
+ </MainCard>
{/* Media Grid */}
<Grid container spacing={2}>
{paginatedMedia.map((r, i) => {
- const isVideo = r.mediaType === 'REEL' || r.mediaType === 'VIDEO';
+ const isVideo = r.mediaType === 'REEL' || r.mediaType === 'VIDEO';
const typeMeta = MEDIA_TYPE_META[r.mediaType] || MEDIA_TYPE_META.IMAGE;
return (
<Grid size={{ xs: 6, sm: 4, md: 3, lg: 2 }} key={`${r.id}-${i}`}>
- <Card sx={{
- cursor: 'pointer', borderRadius: 3, overflow: 'hidden',
- '&:hover': { transform: 'translateY(-4px)', transition: 'all 0.2s', boxShadow: '0 8px 24px rgba(0,0,0,0.4)' },
- }} onClick={() => openOnInstagram(r.permalink)}>
+ <MainCard
+ content={false}
+ sx={{ cursor: 'pointer', overflow: 'hidden', transition: 'box-shadow 0.2s', '&:hover': { boxShadow: '0 6px 20px rgba(0,0,0,0.12)' } }}
+ onClick={() => r.permalink && window.open(r.permalink, '_blank', 'noopener')}
+ >
<Box sx={{ position: 'relative' }}>
<Box component="img" src={r.thumbnailUrl || r.mediaUrl}
- sx={{ width: '100%', aspectRatio: isVideo ? '9/16' : '1/1', objectFit: 'cover', display: 'block', bgcolor: '#222' }}
- onError={(e) => { e.target.style.display = 'none'; }}
+ sx={{ width: '100%', aspectRatio: isVideo ? '9/16' : '1/1', objectFit: 'cover', display: 'block', bgcolor: GREY[200] }}
+ onError={e => { e.target.style.display = 'none'; }}
/>
- {/* Play overlay for videos/reels */}
{isVideo && (
<Box sx={{
position: 'absolute', top: 0, left: 0, right: 0, bottom: 0,
display: 'flex', alignItems: 'center', justifyContent: 'center',
- bgcolor: 'transparent', transition: 'all 0.2s',
- '&:hover': { bgcolor: 'rgba(0,0,0,0.35)' },
+ transition: 'background 0.2s',
+ '&:hover': { bgcolor: 'rgba(0,0,0,0.25)' },
}}>
<PlayCircleOutline sx={{
- fontSize: 44, color: '#fff', opacity: 0, transition: 'opacity 0.2s',
+ fontSize: 40, color: '#fff', opacity: 0, transition: 'opacity 0.2s',
'.MuiCard-root:hover &': { opacity: 1 },
}} />
</Box>
)}
- {/* Likes badge */}
- <Chip icon={<FavoriteBorder sx={{ fontSize: '13px !important', color: '#fff !important' }} />}
+ <Chip
+ icon={<FavoriteBorder sx={{ fontSize: '11px !important', color: '#fff !important' }} />}
label={fmtNum(r.likeCount)} size="small"
- sx={{ position: 'absolute', top: 6, right: 6, bgcolor: 'rgba(0,0,0,0.75)', color: '#fff', fontSize: 11, fontWeight: 600, height: 22 }} />
- {/* Media type badge */}
- <Chip icon={typeMeta.icon}
+ sx={{ position: 'absolute', top: 6, right: 6, bgcolor: 'rgba(0,0,0,0.75)', color: '#fff', fontSize: '0.68rem', fontWeight: 600, height: 20 }}
+ />
+ <Chip
+ icon={typeMeta.icon}
label={typeMeta.label} size="small"
- sx={{ position: 'absolute', bottom: 6, right: 6, bgcolor: `${typeMeta.color}dd`, color: '#fff', fontSize: 11, fontWeight: 600, height: 22 }} />
+ sx={{ position: 'absolute', bottom: 6, right: 6, bgcolor: `${typeMeta.color}dd`, color: '#fff', fontSize: '0.68rem', fontWeight: 600, height: 20 }}
+ />
</Box>
- <CardContent sx={{ p: 1.5, '&:last-child': { pb: 1.5 } }}>
- <Typography variant="body2" sx={{
- fontWeight: 600, mb: 0.5, fontSize: 12,
- display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical', overflow: 'hidden', lineHeight: 1.4,
- }}>
+ <Box sx={{ p: 1.5 }}>
+ <Typography variant="body2" sx={{ fontWeight: 600, mb: 0.5, fontSize: '0.75rem', display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical', overflow: 'hidden', lineHeight: 1.4 }}>
{r.caption || 'No caption'}
</Typography>
{igAccounts.length > 1 && (
- <Typography variant="caption" sx={{ color: 'text.secondary', display: 'block', mb: 0.5, fontSize: 11 }}>
- {r.accountName}
- </Typography>
+ <Typography variant="caption" color="text.secondary" sx={{ display: 'block', mb: 0.5 }}>{r.accountName}</Typography>
)}
- <Box sx={{ display: 'flex', gap: 1, fontSize: 11, color: 'text.secondary', alignItems: 'center' }}>
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.3 }}>
- <FavoriteBorder sx={{ fontSize: 12 }} /> {fmtNum(r.likeCount)}
- </Box>
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.3 }}>
- <ChatBubbleOutline sx={{ fontSize: 12 }} /> {fmtNum(r.commentsCount)}
- </Box>
- <Box sx={{ ml: 'auto', fontSize: 10 }}>{timeAgo(r.timestamp)}</Box>
+ <Box sx={{ display: 'flex', gap: 1, alignItems: 'center', color: 'text.secondary', fontSize: '0.7rem' }}>
+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.3 }}><FavoriteBorder sx={{ fontSize: 11 }} />{fmtNum(r.likeCount)}</Box>
+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.3 }}><ChatBubbleOutline sx={{ fontSize: 11 }} />{fmtNum(r.commentsCount)}</Box>
+ <Typography variant="caption" sx={{ ml: 'auto', fontSize: '0.65rem' }}>{timeAgo(r.timestamp)}</Typography>
</Box>
- </CardContent>
- </Card>
+ </Box>
+ </MainCard>
</Grid>
);
})}
</Grid>
- {/* Pagination */}
- {pageCount > 1 && (
- <Box sx={{ display: 'flex', justifyContent: 'center', mt: 3 }}>
- <Pagination count={pageCount} page={page} onChange={(_, p) => setPage(p)}
- sx={{ '& .Mui-selected': { background: 'linear-gradient(135deg, #833AB4, #E1306C) !important', color: '#fff' } }}
- shape="rounded" size="large" />
- </Box>
+ {filteredMedia.length === 0 && !loading && (
+ <MainCard>
+ <Box sx={{ textAlign: 'center', py: 6 }}>
+ <Instagram sx={{ fontSize: 56, color: GREY[300], mb: 2 }} />
+ <Typography variant="h5" color="text.secondary">No posts found</Typography>
+ <Typography variant="body2" color="text.secondary" sx={{ mt: 1 }}>
+ {(accounts || []).filter(a => a.platform === 'instagram').length === 0
+ ? 'Add an Instagram account first'
+ : 'Try adjusting your filters'}
+ </Typography>
+ </Box>
+ </MainCard>
)}
- {/* Empty state */}
- {filteredMedia.length === 0 && !loading && (
- <Box sx={{ textAlign: 'center', py: 8 }}>
- <Instagram sx={{ fontSize: 64, color: 'text.disabled', mb: 2 }} />
- <Typography variant="h6" color="text.secondary">No posts found</Typography>
- <Typography variant="body2" color="text.disabled" sx={{ mt: 1 }}>
- {(accounts || []).filter(a => a.platform === 'instagram').length === 0
- ? 'Add an Instagram account first to explore content'
- : 'Try adjusting your filters or search query'}
- </Typography>
+ {pageCount > 1 && (
+ <Box sx={{ display: 'flex', justifyContent: 'center', mt: 3 }}>
+ <Pagination count={pageCount} page={page} onChange={(_, p) => setPage(p)} shape="rounded" size="large" />
</Box>
)}
</Box>
diff --git a/frontend/src/features/analytics/shorts/ShortsExplorer.jsx b/frontend/src/features/analytics/shorts/ShortsExplorer.jsx
index adc7c0d..cfe5fbb 100644
--- a/frontend/src/features/analytics/shorts/ShortsExplorer.jsx
+++ b/frontend/src/features/analytics/shorts/ShortsExplorer.jsx
@@ -1,31 +1,35 @@
import React, { useState, useEffect, useMemo } from 'react';
import {
- Box, Typography, Card, CardContent, Grid, TextField, InputAdornment,
- Select, MenuItem, FormControl, InputLabel, Chip, IconButton, Tooltip,
+ Box, Typography, Grid, TextField, InputAdornment,
+ Select, MenuItem, FormControl, InputLabel, Chip,
LinearProgress, Avatar, Button, Pagination, Skeleton,
} from '@mui/material';
import {
- Search, Visibility, ThumbUp, Comment, PlayCircleOutline, YouTube,
+ Search, Visibility, ThumbUp as ThumbUpIcon, Comment as CommentIcon,
+ PlayCircleOutline, YouTube,
} from '@mui/icons-material';
+import MainCard from '../../../components/MainCard';
+import { useAppContext } from '../../../context/AppContext';
import { api } from '../../../services/api';
-import { fmtNum, fmtDate, fmtDuration, fmtPercent, timeAgo } from '../../../utils/formatters';
+import { fmtNum, fmtDuration, timeAgo } from '../../../utils/formatters';
+import { GREY } from '../../../themes/index';
const ITEMS_PER_PAGE = 24;
const PERFORMANCE_TIERS = [
- { label: 'All', value: 'all' },
- { label: 'Viral (>1M)', value: 'viral', min: 1000000 },
- { label: 'High (100K–1M)', value: 'high', min: 100000, max: 1000000 },
- { label: 'Medium (10K–100K)', value: 'medium', min: 10000, max: 100000 },
- { label: 'Low (<10K)', value: 'low', max: 10000 },
+ { label: 'All', value: 'all' },
+ { label: 'Viral (>1M)', value: 'viral', min: 1000000 },
+ { label: 'High (100K–1M)', value: 'high', min: 100000, max: 1000000 },
+ { label: 'Medium (10K–100K)', value: 'medium', min: 10000, max: 100000 },
+ { label: 'Low (<10K)', value: 'low', max: 10000 },
];
const SORT_OPTIONS = [
- { label: 'Most Viewed', field: 'viewCount' },
- { label: 'Most Liked', field: 'likeCount' },
- { label: 'Most Comments', field: 'commentCount' },
- { label: 'Best Engagement', field: 'engagementRate' },
- { label: 'Newest First', field: 'publishedAt' },
+ { label: 'Most Viewed', field: 'viewCount' },
+ { label: 'Most Liked', field: 'likeCount' },
+ { label: 'Most Comments', field: 'commentCount' },
+ { label: 'Best Engagement', field: 'engagementRate' },
+ { label: 'Newest First', field: 'publishedAt' },
];
function parseDurationToSeconds(iso) {
@@ -35,19 +39,18 @@ function parseDurationToSeconds(iso) {
return (parseInt(m[1] || 0) * 3600) + (parseInt(m[2] || 0) * 60) + parseInt(m[3] || 0);
}
-export default function ShortsExplorer({ accounts, showToast }) {
- const [shorts, setShorts] = useState([]);
- const [loading, setLoading] = useState(true);
- const [search, setSearch] = useState('');
- const [channelFilter, setChannelFilter] = useState('all');
+export default function ShortsExplorer() {
+ const { accounts, showToast } = useAppContext();
+ const [shorts, setShorts] = useState([]);
+ const [loading, setLoading] = useState(true);
+ const [search, setSearch] = useState('');
+ const [channelFilter, setChannelFilter] = useState('all');
const [performanceTier, setPerformanceTier] = useState('all');
- const [sortField, setSortField] = useState('viewCount');
- const [page, setPage] = useState(1);
- const [channels, setChannels] = useState([]);
+ const [sortField, setSortField] = useState('viewCount');
+ const [page, setPage] = useState(1);
+ const [channels, setChannels] = useState([]);
- useEffect(() => {
- loadAllShorts();
- }, [accounts]);
+ useEffect(() => { loadAllShorts(); }, [accounts]);
const loadAllShorts = async () => {
setLoading(true);
@@ -55,31 +58,27 @@ export default function ShortsExplorer({ accounts, showToast }) {
const allShorts = [];
const channelList = [];
for (const acct of (accounts || [])) {
+ if (acct.platform === 'instagram') continue;
try {
const res = await api.getVideos(acct.id);
const vids = res.videos || res.data?.videos || [];
- const channelTitle = acct.title || acct.name || acct.channelTitle || 'Unknown';
+ const channelTitle = acct.title || acct.channelTitle || 'Unknown';
channelList.push({ id: acct.id, title: channelTitle, thumbnail: acct.thumbnails?.default || acct.thumbnailUrl || '' });
for (const v of vids) {
const dur = v.durationSeconds || parseDurationToSeconds(v.duration);
if (dur > 0 && dur <= 60) {
- const thumb = v.thumbnail || v.thumbnails?.medium || v.thumbnails?.high || v.thumbnails?.default || '';
const views = v.viewCount || 0;
- const likes = v.likeCount || 0;
- const comments = v.commentCount || 0;
allShorts.push({
...v,
- thumbnail: thumb,
+ thumbnail: v.thumbnail || v.thumbnails?.medium || v.thumbnails?.high || v.thumbnails?.default || '',
channelTitle,
channelId: acct.id,
durationSeconds: dur,
- engagementRate: views > 0 ? ((likes + comments) / views * 100).toFixed(2) : '0.00',
+ engagementRate: views > 0 ? (((v.likeCount || 0) + (v.commentCount || 0)) / views * 100).toFixed(2) : '0.00',
});
}
}
- } catch (e) {
- console.warn(`Failed to load videos for ${acct.id}:`, e.message);
- }
+ } catch (e) { /* skip */ }
}
setShorts(allShorts);
setChannels(channelList);
@@ -99,10 +98,8 @@ export default function ShortsExplorer({ accounts, showToast }) {
}
if (performanceTier !== 'all') {
const tier = PERFORMANCE_TIERS.find(t => t.value === performanceTier);
- if (tier) {
- if (tier.min != null) result = result.filter(v => (v.viewCount || 0) >= tier.min);
- if (tier.max != null) result = result.filter(v => (v.viewCount || 0) < tier.max);
- }
+ if (tier?.min != null) result = result.filter(v => (v.viewCount || 0) >= tier.min);
+ if (tier?.max != null) result = result.filter(v => (v.viewCount || 0) < tier.max);
}
result.sort((a, b) => {
const aVal = sortField === 'publishedAt' ? new Date(a[sortField] || 0).getTime() : (parseFloat(a[sortField]) || 0);
@@ -112,35 +109,23 @@ export default function ShortsExplorer({ accounts, showToast }) {
return result;
}, [shorts, channelFilter, search, performanceTier, sortField]);
- const pageCount = Math.ceil(filteredShorts.length / ITEMS_PER_PAGE);
+ const pageCount = Math.ceil(filteredShorts.length / ITEMS_PER_PAGE);
const paginatedShorts = filteredShorts.slice((page - 1) * ITEMS_PER_PAGE, page * ITEMS_PER_PAGE);
- const stats = useMemo(() => {
- const total = filteredShorts.length;
- const totalViews = filteredShorts.reduce((s, v) => s + (v.viewCount || 0), 0);
- const totalLikes = filteredShorts.reduce((s, v) => s + (v.likeCount || 0), 0);
- const avgViews = total > 0 ? Math.round(totalViews / total) : 0;
- return { total, totalViews, totalLikes, avgViews };
- }, [filteredShorts]);
-
- const openOnYouTube = (videoId) => {
- window.open(`https://www.youtube.com/shorts/${videoId}`, '_blank', 'noopener');
- };
+ const stats = useMemo(() => ({
+ total: filteredShorts.length,
+ totalViews: filteredShorts.reduce((s, v) => s + (v.viewCount || 0), 0),
+ totalLikes: filteredShorts.reduce((s, v) => s + (v.likeCount || 0), 0),
+ avgViews: filteredShorts.length > 0 ? Math.round(filteredShorts.reduce((s, v) => s + (v.viewCount || 0), 0) / filteredShorts.length) : 0,
+ }), [filteredShorts]);
if (loading) {
return (
<Box>
- <Typography variant="h4" sx={{ fontWeight: 700, mb: 3 }}>
- <YouTube sx={{ verticalAlign: 'middle', mr: 1, color: '#FF0000', fontSize: 36 }} />
- Shorts Explorer
- </Typography>
- <LinearProgress color="error" sx={{ mb: 3 }} />
+ <Typography variant="h4" sx={{ mb: 3 }}>Shorts Explorer</Typography>
+ <LinearProgress sx={{ mb: 3, borderRadius: 1 }} />
<Grid container spacing={2}>
- {[...Array(8)].map((_, i) => (
- <Grid size={{ xs: 6, sm: 4, md: 3, lg: 2 }} key={i}>
- <Skeleton variant="rounded" height={320} sx={{ borderRadius: 3 }} />
- </Grid>
- ))}
+ {[...Array(8)].map((_, i) => <Grid size={{ xs: 6, sm: 4, md: 3, lg: 2 }} key={i}><Skeleton variant="rounded" height={300} sx={{ borderRadius: 2 }} /></Grid>)}
</Grid>
</Box>
);
@@ -148,65 +133,51 @@ export default function ShortsExplorer({ accounts, showToast }) {
return (
<Box>
- {/* Header */}
- <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 3, flexWrap: 'wrap', gap: 2 }}>
- <Typography variant="h4" sx={{ fontWeight: 700 }}>
- <YouTube sx={{ verticalAlign: 'middle', mr: 1, color: '#FF0000', fontSize: 36 }} />
- Shorts Explorer
- </Typography>
- <Button variant="contained" onClick={loadAllShorts}
- sx={{ background: 'linear-gradient(135deg, #FF0000, #FF4444)' }}>
- Refresh All
- </Button>
+ <Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', mb: 3, flexWrap: 'wrap', gap: 2 }}>
+ <Box>
+ <Typography variant="h4">Shorts Explorer</Typography>
+ <Typography variant="body2" color="text.secondary" sx={{ mt: 0.25 }}>
+ {shorts.length} shorts across {channels.length} channels
+ </Typography>
+ </Box>
+ <Button variant="contained" onClick={loadAllShorts} size="small">Refresh</Button>
</Box>
- {/* Summary Stats */}
+ {/* Summary */}
<Grid container spacing={2} sx={{ mb: 3 }}>
- <Grid size={{ xs: 6, sm: 3 }}>
- <Card sx={{ textAlign: 'center', p: 1.5 }}>
- <Typography variant="caption" color="text.secondary">Shorts</Typography>
- <Typography variant="h5" sx={{ fontWeight: 700 }}>{fmtNum(stats.total)}</Typography>
- </Card>
- </Grid>
- <Grid size={{ xs: 6, sm: 3 }}>
- <Card sx={{ textAlign: 'center', p: 1.5 }}>
- <Typography variant="caption" color="text.secondary">Total Views</Typography>
- <Typography variant="h5" sx={{ fontWeight: 700, color: '#FF0000' }}>{fmtNum(stats.totalViews)}</Typography>
- </Card>
- </Grid>
- <Grid size={{ xs: 6, sm: 3 }}>
- <Card sx={{ textAlign: 'center', p: 1.5 }}>
- <Typography variant="caption" color="text.secondary">Total Likes</Typography>
- <Typography variant="h5" sx={{ fontWeight: 700, color: '#4CAF50' }}>{fmtNum(stats.totalLikes)}</Typography>
- </Card>
- </Grid>
- <Grid size={{ xs: 6, sm: 3 }}>
- <Card sx={{ textAlign: 'center', p: 1.5 }}>
- <Typography variant="caption" color="text.secondary">Avg Views</Typography>
- <Typography variant="h5" sx={{ fontWeight: 700, color: '#FF9800' }}>{fmtNum(stats.avgViews)}</Typography>
- </Card>
- </Grid>
+ {[
+ { label: 'Shorts', value: fmtNum(stats.total) },
+ { label: 'Total Views', value: fmtNum(stats.totalViews) },
+ { label: 'Total Likes', value: fmtNum(stats.totalLikes) },
+ { label: 'Avg Views', value: fmtNum(stats.avgViews) },
+ ].map((s, i) => (
+ <Grid key={i} size={{ xs: 6, sm: 3 }}>
+ <MainCard sx={{ textAlign: 'center' }}>
+ <Typography variant="caption" color="text.secondary" sx={{ display: 'block' }}>{s.label}</Typography>
+ <Typography variant="h5" sx={{ fontWeight: 700, mt: 0.5 }}>{s.value}</Typography>
+ </MainCard>
+ </Grid>
+ ))}
</Grid>
{/* Filters */}
- <Card sx={{ mb: 3, p: 2 }}>
+ <MainCard sx={{ mb: 2.5 }}>
<Grid container spacing={2} alignItems="center">
<Grid size={{ xs: 12, sm: 3 }}>
- <TextField fullWidth size="small" placeholder="Search shorts..."
- value={search} onChange={(e) => { setSearch(e.target.value); setPage(1); }}
- slotProps={{ input: { startAdornment: <InputAdornment position="start"><Search sx={{ color: 'text.secondary' }} /></InputAdornment> } }}
+ <TextField fullWidth size="small" placeholder="Search shorts…"
+ value={search} onChange={e => { setSearch(e.target.value); setPage(1); }}
+ slotProps={{ input: { startAdornment: <InputAdornment position="start"><Search sx={{ color: 'text.secondary', fontSize: 18 }} /></InputAdornment> } }}
/>
</Grid>
<Grid size={{ xs: 6, sm: 3 }}>
<FormControl fullWidth size="small">
<InputLabel>Channel</InputLabel>
- <Select value={channelFilter} label="Channel"
- onChange={(e) => { setChannelFilter(e.target.value); setPage(1); }}>
+ <Select value={channelFilter} label="Channel" onChange={e => { setChannelFilter(e.target.value); setPage(1); }}>
<MenuItem value="all">All Channels ({channels.length})</MenuItem>
{channels.map(c => (
<MenuItem key={c.id} value={c.id}>
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
- {c.thumbnail && <Avatar src={c.thumbnail} sx={{ width: 20, height: 20 }} />}
+ {c.thumbnail && <Avatar src={c.thumbnail} sx={{ width: 18, height: 18 }} />}
{c.title}
</Box>
</MenuItem>
@@ -217,113 +188,78 @@ export default function ShortsExplorer({ accounts, showToast }) {
<Grid size={{ xs: 6, sm: 3 }}>
<FormControl fullWidth size="small">
<InputLabel>Performance</InputLabel>
- <Select value={performanceTier} label="Performance"
- onChange={(e) => { setPerformanceTier(e.target.value); setPage(1); }}>
- {PERFORMANCE_TIERS.map(t => (
- <MenuItem key={t.value} value={t.value}>{t.label}</MenuItem>
- ))}
+ <Select value={performanceTier} label="Performance" onChange={e => { setPerformanceTier(e.target.value); setPage(1); }}>
+ {PERFORMANCE_TIERS.map(t => <MenuItem key={t.value} value={t.value}>{t.label}</MenuItem>)}
</Select>
</FormControl>
</Grid>
<Grid size={{ xs: 12, sm: 3 }}>
<FormControl fullWidth size="small">
<InputLabel>Sort By</InputLabel>
- <Select value={sortField} label="Sort By"
- onChange={(e) => { setSortField(e.target.value); setPage(1); }}>
- {SORT_OPTIONS.map(s => (
- <MenuItem key={s.field} value={s.field}>{s.label}</MenuItem>
- ))}
+ <Select value={sortField} label="Sort By" onChange={e => { setSortField(e.target.value); setPage(1); }}>
+ {SORT_OPTIONS.map(s => <MenuItem key={s.field} value={s.field}>{s.label}</MenuItem>)}
</Select>
</FormControl>
</Grid>
</Grid>
- <Box sx={{ mt: 1.5 }}>
- <Typography variant="caption" color="text.secondary">
- Showing {paginatedShorts.length} of {filteredShorts.length} shorts
- {channelFilter !== 'all' && ` • Channel: ${channels.find(c => c.id === channelFilter)?.title}`}
- {performanceTier !== 'all' && ` • ${PERFORMANCE_TIERS.find(t => t.value === performanceTier)?.label}`}
- </Typography>
- </Box>
- </Card>
+ <Typography variant="caption" color="text.secondary" sx={{ display: 'block', mt: 1.5 }}>
+ Showing {paginatedShorts.length} of {filteredShorts.length} shorts
+ </Typography>
+ </MainCard>
- {/* Shorts Grid — vertical 9:16 card layout */}
+ {/* Grid */}
<Grid container spacing={2}>
{paginatedShorts.map((v, i) => (
<Grid size={{ xs: 6, sm: 4, md: 3, lg: 2 }} key={`${v.videoId}-${i}`}>
- <Card sx={{
- cursor: 'pointer', borderRadius: 3, overflow: 'hidden',
- '&:hover': { transform: 'translateY(-4px)', transition: 'all 0.2s', boxShadow: '0 8px 24px rgba(0,0,0,0.4)' },
- }} onClick={() => openOnYouTube(v.videoId)}>
+ <MainCard
+ content={false}
+ sx={{ cursor: 'pointer', overflow: 'hidden', transition: 'box-shadow 0.2s', '&:hover': { boxShadow: '0 6px 20px rgba(0,0,0,0.12)' } }}
+ onClick={() => window.open(`https://www.youtube.com/shorts/${v.videoId}`, '_blank', 'noopener')}
+ >
<Box sx={{ position: 'relative' }}>
<Box component="img" src={v.thumbnail}
- sx={{ width: '100%', aspectRatio: '9/16', objectFit: 'cover', display: 'block', bgcolor: '#222' }}
- onError={(e) => { e.target.style.display = 'none'; }}
+ sx={{ width: '100%', aspectRatio: '9/16', objectFit: 'cover', display: 'block', bgcolor: GREY[200] }}
+ onError={e => { e.target.style.display = 'none'; }}
/>
- {/* Play overlay */}
- <Box sx={{
- position: 'absolute', top: 0, left: 0, right: 0, bottom: 0,
- display: 'flex', alignItems: 'center', justifyContent: 'center',
- bgcolor: 'transparent', transition: 'all 0.2s',
- '&:hover': { bgcolor: 'rgba(0,0,0,0.35)' },
- }}>
- <PlayCircleOutline sx={{
- fontSize: 44, color: '#fff', opacity: 0, transition: 'opacity 0.2s',
- '.MuiCard-root:hover &': { opacity: 1 },
- }} />
- </Box>
- {/* Views badge */}
- <Chip icon={<Visibility sx={{ fontSize: '13px !important', color: '#fff !important' }} />}
+ <Chip icon={<Visibility sx={{ fontSize: '12px !important', color: '#fff !important' }} />}
label={fmtNum(v.viewCount)} size="small"
- sx={{ position: 'absolute', top: 6, right: 6, bgcolor: 'rgba(0,0,0,0.75)', color: '#fff', fontSize: 11, fontWeight: 600, height: 22 }} />
- {/* Duration badge */}
+ sx={{ position: 'absolute', top: 6, right: 6, bgcolor: 'rgba(0,0,0,0.75)', color: '#fff', fontSize: '0.68rem', fontWeight: 600, height: 20 }} />
<Chip label={fmtDuration(v.durationSeconds)} size="small"
- sx={{ position: 'absolute', bottom: 6, right: 6, bgcolor: 'rgba(0,0,0,0.85)', color: '#fff', fontSize: 11, fontWeight: 600, height: 22 }} />
+ sx={{ position: 'absolute', bottom: 6, right: 6, bgcolor: 'rgba(0,0,0,0.8)', color: '#fff', fontSize: '0.68rem', fontWeight: 600, height: 20 }} />
</Box>
- <CardContent sx={{ p: 1.5, '&:last-child': { pb: 1.5 } }}>
- <Typography variant="body2" sx={{
- fontWeight: 600, mb: 0.5, fontSize: 12,
- display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical', overflow: 'hidden', lineHeight: 1.4,
- }}>
+ <Box sx={{ p: 1.5 }}>
+ <Typography variant="body2" sx={{ fontWeight: 600, mb: 0.5, fontSize: '0.75rem', display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical', overflow: 'hidden', lineHeight: 1.4 }}>
{v.title}
</Typography>
{channels.length > 1 && (
- <Typography variant="caption" sx={{ color: 'text.secondary', display: 'block', mb: 0.5, fontSize: 11 }}>
- {v.channelTitle}
- </Typography>
+ <Typography variant="caption" color="text.secondary" sx={{ display: 'block', mb: 0.5 }}>{v.channelTitle}</Typography>
)}
- <Box sx={{ display: 'flex', gap: 1, fontSize: 11, color: 'text.secondary', alignItems: 'center' }}>
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.3 }}>
- <ThumbUp sx={{ fontSize: 12 }} /> {fmtNum(v.likeCount)}
- </Box>
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.3 }}>
- <Comment sx={{ fontSize: 12 }} /> {fmtNum(v.commentCount)}
- </Box>
- <Box sx={{ ml: 'auto', fontSize: 10 }}>{timeAgo(v.publishedAt)}</Box>
+ <Box sx={{ display: 'flex', gap: 1, alignItems: 'center', color: 'text.secondary', fontSize: '0.7rem' }}>
+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.3 }}><ThumbUpIcon sx={{ fontSize: 11 }} />{fmtNum(v.likeCount)}</Box>
+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.3 }}><CommentIcon sx={{ fontSize: 11 }} />{fmtNum(v.commentCount)}</Box>
+ <Typography variant="caption" sx={{ ml: 'auto', fontSize: '0.65rem' }}>{timeAgo(v.publishedAt)}</Typography>
</Box>
- </CardContent>
- </Card>
+ </Box>
+ </MainCard>
</Grid>
))}
</Grid>
- {/* Pagination */}
- {pageCount > 1 && (
- <Box sx={{ display: 'flex', justifyContent: 'center', mt: 3 }}>
- <Pagination count={pageCount} page={page} onChange={(_, p) => setPage(p)}
- color="error" shape="rounded" size="large" />
- </Box>
+ {filteredShorts.length === 0 && !loading && (
+ <MainCard>
+ <Box sx={{ textAlign: 'center', py: 6 }}>
+ <YouTube sx={{ fontSize: 56, color: GREY[300], mb: 2 }} />
+ <Typography variant="h5" color="text.secondary">No shorts found</Typography>
+ <Typography variant="body2" color="text.secondary" sx={{ mt: 1 }}>
+ {accounts?.length === 0 ? 'Add a channel first' : 'Try adjusting your filters'}
+ </Typography>
+ </Box>
+ </MainCard>
)}
- {/* Empty state */}
- {filteredShorts.length === 0 && !loading && (
- <Box sx={{ textAlign: 'center', py: 8 }}>
- <YouTube sx={{ fontSize: 64, color: 'text.disabled', mb: 2 }} />
- <Typography variant="h6" color="text.secondary">No shorts found</Typography>
- <Typography variant="body2" color="text.disabled" sx={{ mt: 1 }}>
- {accounts?.length === 0
- ? 'Add a channel first to explore shorts'
- : 'Try adjusting your filters or search query'}
- </Typography>
+ {pageCount > 1 && (
+ <Box sx={{ display: 'flex', justifyContent: 'center', mt: 3 }}>
+ <Pagination count={pageCount} page={page} onChange={(_, p) => setPage(p)} shape="rounded" size="large" />
</Box>
)}
</Box>
diff --git a/frontend/src/features/analytics/videos/VideoExplorer.jsx b/frontend/src/features/analytics/videos/VideoExplorer.jsx
index 350386b..e06d673 100644
--- a/frontend/src/features/analytics/videos/VideoExplorer.jsx
+++ b/frontend/src/features/analytics/videos/VideoExplorer.jsx
@@ -1,18 +1,21 @@
import React, { useState, useEffect, useMemo } from 'react';
import {
- Box, Typography, Card, CardContent, Grid, TextField, InputAdornment,
+ Box, Typography, Grid, TextField, InputAdornment,
Select, MenuItem, FormControl, InputLabel, Chip, IconButton, Tooltip,
LinearProgress, Table, TableBody, TableCell, TableContainer, TableHead,
TableRow, Avatar, Button, ToggleButton, ToggleButtonGroup, Pagination,
- Skeleton, Paper, Divider, TableSortLabel,
+ Skeleton, TableSortLabel,
} from '@mui/material';
import {
- Search, OpenInNew, Visibility, ThumbUp, Comment, FilterList,
- ViewList, ViewModule, Sort, PlayCircleOutline, TrendingUp,
- Schedule, Speed, YouTube,
+ Search, Visibility, ThumbUp, Comment,
+ ViewList, ViewModule, PlayCircleOutline, YouTube,
} from '@mui/icons-material';
+import MainCard from '../../../components/MainCard';
+import StatCard from '../../../components/ui/StatCard';
+import { useAppContext } from '../../../context/AppContext';
import { api } from '../../../services/api';
-import { fmtNum, fmtNumFull, fmtDate, fmtDuration, fmtPercent, timeAgo } from '../../../utils/formatters';
+import { fmtNum, fmtDate, fmtDuration, fmtPercent, timeAgo } from '../../../utils/formatters';
+import { PRIMARY, GREY } from '../../../themes/index';
const ITEMS_PER_PAGE = 25;
@@ -24,28 +27,27 @@ function parseDurationToSeconds(iso) {
}
const PERFORMANCE_TIERS = [
- { label: 'All', value: 'all' },
- { label: 'Viral (>1M)', value: 'viral', min: 1000000 },
- { label: 'High (100K–1M)', value: 'high', min: 100000, max: 1000000 },
+ { label: 'All', value: 'all' },
+ { label: 'Viral (>1M)', value: 'viral', min: 1000000 },
+ { label: 'High (100K–1M)', value: 'high', min: 100000, max: 1000000 },
{ label: 'Medium (10K–100K)', value: 'medium', min: 10000, max: 100000 },
- { label: 'Low (<10K)', value: 'low', max: 10000 },
+ { label: 'Low (<10K)', value: 'low', max: 10000 },
];
-export default function VideoExplorer({ accounts, showToast }) {
- const [videos, setVideos] = useState([]);
- const [loading, setLoading] = useState(true);
- const [search, setSearch] = useState('');
- const [channelFilter, setChannelFilter] = useState('all');
+export default function VideoExplorer() {
+ const { accounts, showToast } = useAppContext();
+ const [videos, setVideos] = useState([]);
+ const [loading, setLoading] = useState(true);
+ const [search, setSearch] = useState('');
+ const [channelFilter, setChannelFilter] = useState('all');
const [performanceTier, setPerformanceTier] = useState('all');
- const [sortField, setSortField] = useState('viewCount');
- const [sortOrder, setSortOrder] = useState('desc');
- const [viewMode, setViewMode] = useState('table');
- const [page, setPage] = useState(1);
- const [channels, setChannels] = useState([]);
+ const [sortField, setSortField] = useState('viewCount');
+ const [sortOrder, setSortOrder] = useState('desc');
+ const [viewMode, setViewMode] = useState('table');
+ const [page, setPage] = useState(1);
+ const [channels, setChannels] = useState([]);
- useEffect(() => {
- loadAllVideos();
- }, [accounts]);
+ useEffect(() => { loadAllVideos(); }, [accounts]);
const loadAllVideos = async () => {
setLoading(true);
@@ -53,29 +55,21 @@ export default function VideoExplorer({ accounts, showToast }) {
const allVids = [];
const channelList = [];
for (const acct of (accounts || [])) {
+ if (acct.platform === 'instagram') continue;
try {
const res = await api.getVideos(acct.id);
const vids = res.videos || res.data?.videos || [];
- const channelTitle = acct.title || acct.name || acct.channelTitle || 'Unknown';
+ const channelTitle = acct.title || acct.channelTitle || 'Unknown';
channelList.push({ id: acct.id, title: channelTitle, thumbnail: acct.thumbnails?.default || acct.thumbnailUrl || '' });
- allVids.push(...vids.map(v => {
- const thumb = v.thumbnail || v.thumbnails?.medium || v.thumbnails?.high || v.thumbnails?.default || '';
- const views = v.viewCount || 0;
- const likes = v.likeCount || 0;
- const comments = v.commentCount || 0;
- return {
- ...v,
- thumbnail: thumb,
- channelTitle,
- channelId: acct.id,
- channelThumbnail: acct.thumbnails?.default || acct.thumbnailUrl || '',
- engagementRate: views > 0 ? ((likes + comments) / views * 100).toFixed(2) : '0.00',
- durationSeconds: v.durationSeconds || parseDurationToSeconds(v.duration),
- };
- }));
- } catch (e) {
- console.warn(`Failed to load videos for ${acct.id}:`, e.message);
- }
+ allVids.push(...vids.map(v => ({
+ ...v,
+ thumbnail: v.thumbnail || v.thumbnails?.medium || v.thumbnails?.high || v.thumbnails?.default || '',
+ channelTitle,
+ channelId: acct.id,
+ engagementRate: (v.viewCount || 0) > 0 ? (((v.likeCount || 0) + (v.commentCount || 0)) / v.viewCount * 100).toFixed(2) : '0.00',
+ durationSeconds: v.durationSeconds || parseDurationToSeconds(v.duration),
+ })));
+ } catch (e) { /* skip failed channels */ }
}
setVideos(allVids);
setChannels(channelList);
@@ -88,81 +82,47 @@ export default function VideoExplorer({ accounts, showToast }) {
const filteredVideos = useMemo(() => {
let result = [...videos];
-
- // Channel filter
- if (channelFilter !== 'all') {
- result = result.filter(v => v.channelId === channelFilter);
- }
-
- // Search filter
+ if (channelFilter !== 'all') result = result.filter(v => v.channelId === channelFilter);
if (search.trim()) {
const q = search.toLowerCase();
- result = result.filter(v =>
- v.title?.toLowerCase().includes(q) ||
- (v.tags || []).some(t => t.toLowerCase().includes(q))
- );
+ result = result.filter(v => v.title?.toLowerCase().includes(q) || (v.tags || []).some(t => t.toLowerCase().includes(q)));
}
-
- // Performance tier
if (performanceTier !== 'all') {
const tier = PERFORMANCE_TIERS.find(t => t.value === performanceTier);
- if (tier) {
- if (tier.min != null) result = result.filter(v => (v.viewCount || 0) >= tier.min);
- if (tier.max != null) result = result.filter(v => (v.viewCount || 0) < tier.max);
- }
+ if (tier?.min != null) result = result.filter(v => (v.viewCount || 0) >= tier.min);
+ if (tier?.max != null) result = result.filter(v => (v.viewCount || 0) < tier.max);
}
-
- // Sort
result.sort((a, b) => {
- const aVal = a[sortField] ?? 0;
- const bVal = b[sortField] ?? 0;
+ const aVal = a[sortField] ?? 0, bVal = b[sortField] ?? 0;
if (typeof aVal === 'string') return sortOrder === 'asc' ? aVal.localeCompare(bVal) : bVal.localeCompare(aVal);
return sortOrder === 'asc' ? aVal - bVal : bVal - aVal;
});
-
return result;
}, [videos, channelFilter, search, performanceTier, sortField, sortOrder]);
- const pageCount = Math.ceil(filteredVideos.length / ITEMS_PER_PAGE);
+ const pageCount = Math.ceil(filteredVideos.length / ITEMS_PER_PAGE);
const paginatedVideos = filteredVideos.slice((page - 1) * ITEMS_PER_PAGE, page * ITEMS_PER_PAGE);
const handleSort = (field) => {
- if (sortField === field) {
- setSortOrder(prev => prev === 'asc' ? 'desc' : 'asc');
- } else {
- setSortField(field);
- setSortOrder('desc');
- }
- };
-
- const openOnYouTube = (videoId) => {
- window.open(`https://www.youtube.com/watch?v=${videoId}`, '_blank', 'noopener');
+ if (sortField === field) setSortOrder(prev => prev === 'asc' ? 'desc' : 'asc');
+ else { setSortField(field); setSortOrder('desc'); }
};
- // Stats summary
- const stats = useMemo(() => {
- const total = filteredVideos.length;
- const totalViews = filteredVideos.reduce((s, v) => s + (v.viewCount || 0), 0);
- const totalLikes = filteredVideos.reduce((s, v) => s + (v.likeCount || 0), 0);
- const totalComments = filteredVideos.reduce((s, v) => s + (v.commentCount || 0), 0);
- const avgViews = total > 0 ? Math.round(totalViews / total) : 0;
- return { total, totalViews, totalLikes, totalComments, avgViews };
- }, [filteredVideos]);
+ const stats = useMemo(() => ({
+ total: filteredVideos.length,
+ totalViews: filteredVideos.reduce((s, v) => s + (v.viewCount || 0), 0),
+ totalLikes: filteredVideos.reduce((s, v) => s + (v.likeCount || 0), 0),
+ totalComments: filteredVideos.reduce((s, v) => s + (v.commentCount || 0), 0),
+ avgViews: filteredVideos.length > 0 ? Math.round(filteredVideos.reduce((s, v) => s + (v.viewCount || 0), 0) / filteredVideos.length) : 0,
+ }), [filteredVideos]);
if (loading) {
return (
<Box>
- <Typography variant="h4" sx={{ fontWeight: 700, mb: 3 }}>
- <YouTube sx={{ verticalAlign: 'middle', mr: 1, color: '#FF0000', fontSize: 36 }} />
- Video Explorer
- </Typography>
- <LinearProgress color="error" sx={{ mb: 3 }} />
- <Grid container spacing={2}>
- {[...Array(6)].map((_, i) => (
- <Grid size={{ xs: 12, sm: 6, md: 4 }} key={i}>
- <Skeleton variant="rounded" height={200} sx={{ borderRadius: 3 }} />
- </Grid>
- ))}
+ <Typography variant="h4" sx={{ mb: 3 }}>Video Explorer</Typography>
+ <LinearProgress sx={{ mb: 3, borderRadius: 1 }} />
+ <Grid container spacing={2.5}>
+ {[...Array(6)].map((_, i) => <Grid size={{ xs: 12, sm: 6, md: 4 }} key={i}><Skeleton variant="rounded" height={180} sx={{ borderRadius: 2 }} /></Grid>)}
</Grid>
</Box>
);
@@ -171,71 +131,52 @@ export default function VideoExplorer({ accounts, showToast }) {
return (
<Box>
{/* Header */}
- <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 3, flexWrap: 'wrap', gap: 2 }}>
- <Typography variant="h4" sx={{ fontWeight: 700 }}>
- <YouTube sx={{ verticalAlign: 'middle', mr: 1, color: '#FF0000', fontSize: 36 }} />
- Video Explorer
- </Typography>
- <Button variant="contained" onClick={loadAllVideos}
- sx={{ background: 'linear-gradient(135deg, #FF0000, #FF4444)' }}>
- Refresh All
- </Button>
+ <Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', mb: 3, flexWrap: 'wrap', gap: 2 }}>
+ <Box>
+ <Typography variant="h4">Video Explorer</Typography>
+ <Typography variant="body2" color="text.secondary" sx={{ mt: 0.25 }}>
+ {videos.length} total videos across {channels.length} channels
+ </Typography>
+ </Box>
+ <Button variant="contained" onClick={loadAllVideos} size="small">Refresh</Button>
</Box>
- {/* Summary Stats */}
+ {/* Summary */}
<Grid container spacing={2} sx={{ mb: 3 }}>
- <Grid size={{ xs: 6, sm: 4, md: 2.4 }}>
- <Card sx={{ textAlign: 'center', p: 1.5 }}>
- <Typography variant="caption" color="text.secondary">Videos</Typography>
- <Typography variant="h5" sx={{ fontWeight: 700 }}>{fmtNum(stats.total)}</Typography>
- </Card>
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 2.4 }}>
- <Card sx={{ textAlign: 'center', p: 1.5 }}>
- <Typography variant="caption" color="text.secondary">Total Views</Typography>
- <Typography variant="h5" sx={{ fontWeight: 700, color: '#FF0000' }}>{fmtNum(stats.totalViews)}</Typography>
- </Card>
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 2.4 }}>
- <Card sx={{ textAlign: 'center', p: 1.5 }}>
- <Typography variant="caption" color="text.secondary">Total Likes</Typography>
- <Typography variant="h5" sx={{ fontWeight: 700, color: '#4CAF50' }}>{fmtNum(stats.totalLikes)}</Typography>
- </Card>
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 2.4 }}>
- <Card sx={{ textAlign: 'center', p: 1.5 }}>
- <Typography variant="caption" color="text.secondary">Total Comments</Typography>
- <Typography variant="h5" sx={{ fontWeight: 700, color: '#3EA6FF' }}>{fmtNum(stats.totalComments)}</Typography>
- </Card>
- </Grid>
- <Grid size={{ xs: 6, sm: 4, md: 2.4 }}>
- <Card sx={{ textAlign: 'center', p: 1.5 }}>
- <Typography variant="caption" color="text.secondary">Avg Views</Typography>
- <Typography variant="h5" sx={{ fontWeight: 700, color: '#FF9800' }}>{fmtNum(stats.avgViews)}</Typography>
- </Card>
- </Grid>
+ {[
+ { label: 'Videos', value: fmtNum(stats.total), gradient: 'blue' },
+ { label: 'Total Views', value: fmtNum(stats.totalViews), gradient: 'red' },
+ { label: 'Total Likes', value: fmtNum(stats.totalLikes), gradient: 'green' },
+ { label: 'Total Comments', value: fmtNum(stats.totalComments), gradient: 'orange' },
+ { label: 'Avg Views', value: fmtNum(stats.avgViews), gradient: 'purple' },
+ ].map((s, i) => (
+ <Grid key={i} size={{ xs: 6, sm: 4, md: 2.4 }}>
+ <MainCard sx={{ textAlign: 'center' }}>
+ <Typography variant="caption" color="text.secondary" sx={{ display: 'block' }}>{s.label}</Typography>
+ <Typography variant="h5" sx={{ fontWeight: 700, mt: 0.5 }}>{s.value}</Typography>
+ </MainCard>
+ </Grid>
+ ))}
</Grid>
{/* Filters */}
- <Card sx={{ mb: 3, p: 2 }}>
+ <MainCard sx={{ mb: 2.5 }}>
<Grid container spacing={2} alignItems="center">
<Grid size={{ xs: 12, sm: 4 }}>
- <TextField
- fullWidth size="small" placeholder="Search videos by title or tag..."
- value={search} onChange={(e) => { setSearch(e.target.value); setPage(1); }}
- slotProps={{ input: { startAdornment: <InputAdornment position="start"><Search sx={{ color: 'text.secondary' }} /></InputAdornment> } }}
+ <TextField fullWidth size="small" placeholder="Search by title or tag…"
+ value={search} onChange={e => { setSearch(e.target.value); setPage(1); }}
+ slotProps={{ input: { startAdornment: <InputAdornment position="start"><Search sx={{ color: 'text.secondary', fontSize: 18 }} /></InputAdornment> } }}
/>
</Grid>
<Grid size={{ xs: 6, sm: 3 }}>
<FormControl fullWidth size="small">
<InputLabel>Channel</InputLabel>
- <Select value={channelFilter} label="Channel"
- onChange={(e) => { setChannelFilter(e.target.value); setPage(1); }}>
+ <Select value={channelFilter} label="Channel" onChange={e => { setChannelFilter(e.target.value); setPage(1); }}>
<MenuItem value="all">All Channels ({channels.length})</MenuItem>
{channels.map(c => (
<MenuItem key={c.id} value={c.id}>
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
- {c.thumbnail && <Avatar src={c.thumbnail} sx={{ width: 20, height: 20 }} />}
+ {c.thumbnail && <Avatar src={c.thumbnail} sx={{ width: 18, height: 18 }} />}
{c.title}
</Box>
</MenuItem>
@@ -246,11 +187,8 @@ export default function VideoExplorer({ accounts, showToast }) {
<Grid size={{ xs: 6, sm: 3 }}>
<FormControl fullWidth size="small">
<InputLabel>Performance</InputLabel>
- <Select value={performanceTier} label="Performance"
- onChange={(e) => { setPerformanceTier(e.target.value); setPage(1); }}>
- {PERFORMANCE_TIERS.map(t => (
- <MenuItem key={t.value} value={t.value}>{t.label}</MenuItem>
- ))}
+ <Select value={performanceTier} label="Performance" onChange={e => { setPerformanceTier(e.target.value); setPage(1); }}>
+ {PERFORMANCE_TIERS.map(t => <MenuItem key={t.value} value={t.value}>{t.label}</MenuItem>)}
</Select>
</FormControl>
</Grid>
@@ -261,103 +199,52 @@ export default function VideoExplorer({ accounts, showToast }) {
</ToggleButtonGroup>
</Grid>
</Grid>
- <Box sx={{ mt: 1.5 }}>
- <Typography variant="caption" color="text.secondary">
- Showing {paginatedVideos.length} of {filteredVideos.length} videos
- {channelFilter !== 'all' && ` • Channel: ${channels.find(c => c.id === channelFilter)?.title}`}
- {performanceTier !== 'all' && ` • ${PERFORMANCE_TIERS.find(t => t.value === performanceTier)?.label}`}
- </Typography>
- </Box>
- </Card>
+ <Typography variant="caption" color="text.secondary" sx={{ display: 'block', mt: 1.5 }}>
+ Showing {paginatedVideos.length} of {filteredVideos.length} videos
+ </Typography>
+ </MainCard>
- {/* Table View */}
+ {/* Table */}
{viewMode === 'table' && (
- <Card>
- <TableContainer sx={{ maxHeight: 700 }}>
+ <MainCard content={false}>
+ <TableContainer sx={{ maxHeight: 680 }}>
<Table size="small" stickyHeader>
<TableHead>
<TableRow>
- <TableCell sx={{ bgcolor: '#1A1A1A', width: 40 }}>#</TableCell>
- <TableCell sx={{ bgcolor: '#1A1A1A', width: 60 }}></TableCell>
- <TableCell sx={{ bgcolor: '#1A1A1A' }}>
- <TableSortLabel active={sortField === 'title'} direction={sortField === 'title' ? sortOrder : 'asc'} onClick={() => handleSort('title')}>
- Video
- </TableSortLabel>
- </TableCell>
- {channels.length > 1 && <TableCell sx={{ bgcolor: '#1A1A1A' }}>Channel</TableCell>}
- <TableCell align="right" sx={{ bgcolor: '#1A1A1A' }}>
- <TableSortLabel active={sortField === 'viewCount'} direction={sortField === 'viewCount' ? sortOrder : 'desc'} onClick={() => handleSort('viewCount')}>
- Views
- </TableSortLabel>
- </TableCell>
- <TableCell align="right" sx={{ bgcolor: '#1A1A1A' }}>
- <TableSortLabel active={sortField === 'likeCount'} direction={sortField === 'likeCount' ? sortOrder : 'desc'} onClick={() => handleSort('likeCount')}>
- Likes
- </TableSortLabel>
- </TableCell>
- <TableCell align="right" sx={{ bgcolor: '#1A1A1A' }}>
- <TableSortLabel active={sortField === 'commentCount'} direction={sortField === 'commentCount' ? sortOrder : 'desc'} onClick={() => handleSort('commentCount')}>
- Comments
- </TableSortLabel>
- </TableCell>
- <TableCell align="right" sx={{ bgcolor: '#1A1A1A' }}>
- <TableSortLabel active={sortField === 'engagementRate'} direction={sortField === 'engagementRate' ? sortOrder : 'desc'} onClick={() => handleSort('engagementRate')}>
- Engagement
- </TableSortLabel>
- </TableCell>
- <TableCell align="right" sx={{ bgcolor: '#1A1A1A' }}>
- <TableSortLabel active={sortField === 'durationSeconds'} direction={sortField === 'durationSeconds' ? sortOrder : 'desc'} onClick={() => handleSort('durationSeconds')}>
- Duration
- </TableSortLabel>
- </TableCell>
- <TableCell align="right" sx={{ bgcolor: '#1A1A1A' }}>
- <TableSortLabel active={sortField === 'publishedAt'} direction={sortField === 'publishedAt' ? sortOrder : 'desc'} onClick={() => handleSort('publishedAt')}>
- Published
- </TableSortLabel>
- </TableCell>
- <TableCell align="center" sx={{ bgcolor: '#1A1A1A', width: 50 }}>Watch</TableCell>
+ <TableCell sx={{ width: 40 }}>#</TableCell>
+ <TableCell sx={{ width: 70 }} />
+ <TableCell><TableSortLabel active={sortField === 'title'} direction={sortField === 'title' ? sortOrder : 'asc'} onClick={() => handleSort('title')}>Video</TableSortLabel></TableCell>
+ {channels.length > 1 && <TableCell>Channel</TableCell>}
+ <TableCell align="right"><TableSortLabel active={sortField === 'viewCount'} direction={sortField === 'viewCount' ? sortOrder : 'desc'} onClick={() => handleSort('viewCount')}>Views</TableSortLabel></TableCell>
+ <TableCell align="right"><TableSortLabel active={sortField === 'likeCount'} direction={sortField === 'likeCount' ? sortOrder : 'desc'} onClick={() => handleSort('likeCount')}>Likes</TableSortLabel></TableCell>
+ <TableCell align="right"><TableSortLabel active={sortField === 'commentCount'} direction={sortField === 'commentCount' ? sortOrder : 'desc'} onClick={() => handleSort('commentCount')}>Comments</TableSortLabel></TableCell>
+ <TableCell align="right"><TableSortLabel active={sortField === 'engagementRate'} direction={sortField === 'engagementRate' ? sortOrder : 'desc'} onClick={() => handleSort('engagementRate')}>Engagement</TableSortLabel></TableCell>
+ <TableCell align="right"><TableSortLabel active={sortField === 'durationSeconds'} direction={sortField === 'durationSeconds' ? sortOrder : 'desc'} onClick={() => handleSort('durationSeconds')}>Duration</TableSortLabel></TableCell>
+ <TableCell align="right"><TableSortLabel active={sortField === 'publishedAt'} direction={sortField === 'publishedAt' ? sortOrder : 'desc'} onClick={() => handleSort('publishedAt')}>Published</TableSortLabel></TableCell>
+ <TableCell align="center" sx={{ width: 52 }} />
</TableRow>
</TableHead>
<TableBody>
{paginatedVideos.map((v, i) => (
- <TableRow key={`${v.videoId}-${i}`} hover sx={{ cursor: 'pointer' }} onClick={() => openOnYouTube(v.videoId)}>
- <TableCell>{(page - 1) * ITEMS_PER_PAGE + i + 1}</TableCell>
- <TableCell>
- {v.thumbnail && (
- <Box component="img" src={v.thumbnail} sx={{ width: 60, height: 34, borderRadius: 1, objectFit: 'cover' }} />
- )}
- </TableCell>
- <TableCell>
- <Typography variant="body2" sx={{ fontWeight: 500, maxWidth: 300, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
- {v.title}
- </Typography>
- </TableCell>
- {channels.length > 1 && (
- <TableCell>
- <Chip label={v.channelTitle} size="small" variant="outlined"
- sx={{ fontSize: 11, maxWidth: 120, '& .MuiChip-label': { overflow: 'hidden', textOverflow: 'ellipsis' } }} />
- </TableCell>
- )}
- <TableCell align="right" sx={{ fontWeight: 600 }}>{fmtNum(v.viewCount)}</TableCell>
- <TableCell align="right">{fmtNum(v.likeCount)}</TableCell>
- <TableCell align="right">{fmtNum(v.commentCount)}</TableCell>
+ <TableRow key={`${v.videoId}-${i}`} hover sx={{ cursor: 'pointer' }} onClick={() => window.open(`https://www.youtube.com/watch?v=${v.videoId}`, '_blank', 'noopener')}>
+ <TableCell><Typography variant="body2" color="text.secondary">{(page - 1) * ITEMS_PER_PAGE + i + 1}</Typography></TableCell>
+ <TableCell>{v.thumbnail && <Box component="img" src={v.thumbnail} sx={{ width: 60, height: 34, borderRadius: 1, objectFit: 'cover', display: 'block' }} />}</TableCell>
+ <TableCell><Typography variant="body2" sx={{ fontWeight: 500, maxWidth: 280, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{v.title}</Typography></TableCell>
+ {channels.length > 1 && <TableCell><Chip label={v.channelTitle} size="small" variant="outlined" sx={{ fontSize: '0.7rem', maxWidth: 120 }} /></TableCell>}
+ <TableCell align="right"><Typography variant="body2" sx={{ fontWeight: 600 }}>{fmtNum(v.viewCount)}</Typography></TableCell>
+ <TableCell align="right"><Typography variant="body2">{fmtNum(v.likeCount)}</Typography></TableCell>
+ <TableCell align="right"><Typography variant="body2">{fmtNum(v.commentCount)}</Typography></TableCell>
<TableCell align="right">
<Chip label={fmtPercent(v.engagementRate)} size="small"
- sx={{
- bgcolor: parseFloat(v.engagementRate) > 5 ? 'rgba(76,175,80,0.15)' : 'rgba(255,255,255,0.05)',
- color: parseFloat(v.engagementRate) > 5 ? '#4CAF50' : 'text.secondary',
- fontWeight: 600, fontSize: 11,
- }} />
- </TableCell>
- <TableCell align="right">{fmtDuration(v.durationSeconds)}</TableCell>
- <TableCell align="right">
- <Typography variant="caption" sx={{ color: 'text.secondary' }}>{fmtDate(v.publishedAt)}</Typography>
+ sx={{ bgcolor: parseFloat(v.engagementRate) > 5 ? '#f6ffed' : GREY[100], color: parseFloat(v.engagementRate) > 5 ? '#389e0d' : 'text.secondary', fontWeight: 600, fontSize: '0.68rem', height: 20 }} />
</TableCell>
+ <TableCell align="right"><Typography variant="body2">{fmtDuration(v.durationSeconds)}</Typography></TableCell>
+ <TableCell align="right"><Typography variant="caption" color="text.secondary">{fmtDate(v.publishedAt)}</Typography></TableCell>
<TableCell align="center">
<Tooltip title="Watch on YouTube">
- <IconButton size="small" onClick={(e) => { e.stopPropagation(); openOnYouTube(v.videoId); }}
- sx={{ color: '#FF0000', '&:hover': { bgcolor: 'rgba(255,0,0,0.1)' } }}>
- <PlayCircleOutline fontSize="small" />
+ <IconButton size="small" onClick={e => { e.stopPropagation(); window.open(`https://www.youtube.com/watch?v=${v.videoId}`, '_blank', 'noopener'); }}
+ sx={{ color: '#ff4d4f', '&:hover': { bgcolor: '#fff1f0' } }}>
+ <PlayCircleOutline sx={{ fontSize: 16 }} />
</IconButton>
</Tooltip>
</TableCell>
@@ -366,85 +253,59 @@ export default function VideoExplorer({ accounts, showToast }) {
</TableBody>
</Table>
</TableContainer>
- </Card>
+ </MainCard>
)}
- {/* Grid View */}
+ {/* Grid */}
{viewMode === 'grid' && (
<Grid container spacing={2}>
{paginatedVideos.map((v, i) => (
<Grid size={{ xs: 12, sm: 6, md: 4, lg: 3 }} key={`${v.videoId}-${i}`}>
- <Card sx={{
- cursor: 'pointer',
- '&:hover': { transform: 'translateY(-4px)', transition: 'all 0.2s', boxShadow: '0 8px 24px rgba(0,0,0,0.3)' },
- }} onClick={() => openOnYouTube(v.videoId)}>
+ <MainCard content={false} sx={{ cursor: 'pointer', transition: 'box-shadow 0.2s', '&:hover': { boxShadow: '0 6px 20px rgba(0,0,0,0.12)' } }}
+ onClick={() => window.open(`https://www.youtube.com/watch?v=${v.videoId}`, '_blank', 'noopener')}>
<Box sx={{ position: 'relative' }}>
- <Box component="img" src={v.thumbnail} sx={{ width: '100%', aspectRatio: '16/9', objectFit: 'cover' }} />
- {/* Play overlay */}
- <Box sx={{
- position: 'absolute', top: 0, left: 0, right: 0, bottom: 0,
- display: 'flex', alignItems: 'center', justifyContent: 'center',
- bgcolor: 'rgba(0,0,0,0)', transition: 'all 0.2s',
- '&:hover': { bgcolor: 'rgba(0,0,0,0.4)' },
- }}>
- <PlayCircleOutline sx={{
- fontSize: 48, color: '#fff', opacity: 0, transition: 'opacity 0.2s',
- '.MuiCard-root:hover &': { opacity: 1 }
- }} />
- </Box>
- {/* Duration badge */}
+ <Box component="img" src={v.thumbnail} sx={{ width: '100%', aspectRatio: '16/9', objectFit: 'cover', display: 'block' }} />
{v.durationSeconds > 0 && (
<Chip label={fmtDuration(v.durationSeconds)} size="small"
- sx={{ position: 'absolute', bottom: 6, right: 6, bgcolor: 'rgba(0,0,0,0.85)', color: '#fff', fontSize: 11, fontWeight: 600, height: 22 }} />
+ sx={{ position: 'absolute', bottom: 6, right: 6, bgcolor: 'rgba(0,0,0,0.8)', color: '#fff', fontSize: '0.68rem', fontWeight: 600, height: 20 }} />
)}
- {/* Views badge */}
- <Chip icon={<Visibility sx={{ fontSize: '14px !important', color: '#fff !important' }} />}
- label={fmtNum(v.viewCount)} size="small"
- sx={{ position: 'absolute', top: 6, right: 6, bgcolor: 'rgba(0,0,0,0.75)', color: '#fff', fontSize: 11, fontWeight: 600, height: 22 }} />
+ <Chip icon={<Visibility sx={{ fontSize: '12px !important', color: '#fff !important' }} />} label={fmtNum(v.viewCount)} size="small"
+ sx={{ position: 'absolute', top: 6, right: 6, bgcolor: 'rgba(0,0,0,0.75)', color: '#fff', fontSize: '0.68rem', fontWeight: 600, height: 20 }} />
</Box>
- <CardContent sx={{ p: 1.5, '&:last-child': { pb: 1.5 } }}>
+ <Box sx={{ p: 1.5 }}>
<Typography variant="body2" sx={{ fontWeight: 600, mb: 0.5, display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical', overflow: 'hidden', lineHeight: 1.4 }}>
{v.title}
</Typography>
- {channels.length > 1 && (
- <Typography variant="caption" sx={{ color: 'text.secondary', display: 'block', mb: 0.5 }}>
- {v.channelTitle}
- </Typography>
- )}
- <Box sx={{ display: 'flex', gap: 1.5, fontSize: 11, color: 'text.secondary', alignItems: 'center' }}>
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.3 }}>
- <ThumbUp sx={{ fontSize: 13 }} /> {fmtNum(v.likeCount)}
- </Box>
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.3 }}>
- <Comment sx={{ fontSize: 13 }} /> {fmtNum(v.commentCount)}
- </Box>
- <Box sx={{ ml: 'auto', fontSize: 11 }}>{timeAgo(v.publishedAt)}</Box>
+ {channels.length > 1 && <Typography variant="caption" color="text.secondary" sx={{ display: 'block', mb: 0.5 }}>{v.channelTitle}</Typography>}
+ <Box sx={{ display: 'flex', gap: 1.5, alignItems: 'center', color: 'text.secondary' }}>
+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.3, fontSize: '0.75rem' }}><ThumbUp sx={{ fontSize: 12 }} />{fmtNum(v.likeCount)}</Box>
+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.3, fontSize: '0.75rem' }}><Comment sx={{ fontSize: 12 }} />{fmtNum(v.commentCount)}</Box>
+ <Typography variant="caption" sx={{ ml: 'auto' }}>{timeAgo(v.publishedAt)}</Typography>
</Box>
- </CardContent>
- </Card>
+ </Box>
+ </MainCard>
</Grid>
))}
</Grid>
)}
+ {/* Empty state */}
+ {filteredVideos.length === 0 && !loading && (
+ <MainCard>
+ <Box sx={{ textAlign: 'center', py: 6 }}>
+ <YouTube sx={{ fontSize: 56, color: GREY[300], mb: 2 }} />
+ <Typography variant="h5" color="text.secondary">No videos found</Typography>
+ <Typography variant="body2" color="text.secondary" sx={{ mt: 1 }}>
+ {accounts?.length === 0 ? 'Add a channel first to explore videos' : 'Try adjusting your filters'}
+ </Typography>
+ </Box>
+ </MainCard>
+ )}
+
{/* Pagination */}
{pageCount > 1 && (
<Box sx={{ display: 'flex', justifyContent: 'center', mt: 3 }}>
- <Pagination count={pageCount} page={page} onChange={(_, p) => setPage(p)}
- color="error" shape="rounded" size="large" />
- </Box>
- )}
-
- {/* Empty state */}
- {filteredVideos.length === 0 && !loading && (
- <Box sx={{ textAlign: 'center', py: 8 }}>
- <YouTube sx={{ fontSize: 64, color: 'text.disabled', mb: 2 }} />
- <Typography variant="h6" color="text.secondary">No videos found</Typography>
- <Typography variant="body2" color="text.disabled" sx={{ mt: 1 }}>
- {accounts?.length === 0
- ? 'Add a channel first to explore videos'
- : 'Try adjusting your filters or search query'}
- </Typography>
+ <Pagination count={pageCount} page={page} onChange={(_, p) => setPage(p)} shape="rounded" size="large" />
</Box>
)}
</Box>
diff --git a/frontend/src/features/publishing/UploadContent.jsx b/frontend/src/features/publishing/UploadContent.jsx
index f06a971..845c242 100644
--- a/frontend/src/features/publishing/UploadContent.jsx
+++ b/frontend/src/features/publishing/UploadContent.jsx
@@ -7,6 +7,7 @@ import {
Tabs, Tab, Badge, Collapse, Dialog, DialogTitle, DialogContent, DialogActions,
Table, TableBody, TableCell, TableContainer, TableHead, TableRow,
} from '@mui/material';
+import { useAppContext } from '../../context/AppContext';
import {
CloudUpload, Instagram, Photo, Movie, ViewCarousel, AutoStories,
Delete, CheckCircle, Error as ErrorIcon, Schedule, Send,
@@ -28,7 +29,8 @@ const CONTENT_TYPES = [
const PUBLISH_STEPS = ['Select Media', 'Configure', 'Upload & Publish'];
-export default function UploadContent({ accounts, showToast }) {
+export default function UploadContent() {
+ const { accounts, showToast } = useAppContext();
const [igAccounts, setIgAccounts] = useState([]);
const [selectedAccount, setSelectedAccount] = useState('');
const [contentType, setContentType] = useState('');
diff --git a/frontend/src/features/settings/Settings.jsx b/frontend/src/features/settings/Settings.jsx
index 009d3db..f7b7d15 100644
--- a/frontend/src/features/settings/Settings.jsx
+++ b/frontend/src/features/settings/Settings.jsx
@@ -1,57 +1,50 @@
import React, { useState, useEffect } from 'react';
import {
- Box, Typography, Grid, Card, CardContent, Button, TextField,
+ Box, Typography, Grid, Button, TextField,
InputAdornment, IconButton, Chip, Divider, Alert, CircularProgress,
} from '@mui/material';
import {
- Key, Save, Visibility, VisibilityOff, CheckCircle, Error as ErrorIcon,
- Refresh, Info, GitHub, Code, Instagram, Cloud, Sync, Schedule,
+ Key, Save, Visibility, VisibilityOff, CheckCircle,
+ Refresh, Info, GitHub, Code, Instagram, Cloud, Sync,
} from '@mui/icons-material';
+import MainCard from '../../components/MainCard';
+import { useAppContext } from '../../context/AppContext';
import { api } from '../../services/api';
-
-export default function Settings({ showToast, onRefresh }) {
- const [apiKey, setApiKey] = useState('');
- const [igAppId, setIgAppId] = useState('');
- const [igAppSecret, setIgAppSecret] = useState('');
- const [cloudinaryName, setCloudinaryName] = useState('');
- const [cloudinaryPreset, setCloudinaryPreset] = useState('');
- const [githubToken, setGithubToken] = useState('');
- const [githubRepo, setGithubRepo] = useState('');
- const [githubBranch, setGithubBranch] = useState('main');
- const [showGhToken, setShowGhToken] = useState(false);
- const [savingGh, setSavingGh] = useState(false);
- const [syncingGh, setSyncingGh] = useState(false);
- const [showKey, setShowKey] = useState(false);
- const [showIgSecret, setShowIgSecret] = useState(false);
- const [saving, setSaving] = useState(false);
- const [savingIg, setSavingIg] = useState(false);
- const [savingCloud, setSavingCloud] = useState(false);
- const [testing, setTesting] = useState(false);
- const [testResult, setTestResult] = useState(null);
- const [loading, setLoading] = useState(true);
-
- useEffect(() => {
- loadKeys();
- }, []);
+import { PRIMARY } from '../../themes/index';
+
+export default function Settings() {
+ const { showToast, refreshAll } = useAppContext();
+
+ const [apiKey, setApiKey] = useState('');
+ const [igAppId, setIgAppId] = useState('');
+ const [igAppSecret, setIgAppSecret] = useState('');
+ const [cloudinaryName, setCloudinaryName] = useState('');
+ const [cloudinaryPreset, setCloudinaryPreset] = useState('');
+ const [githubToken, setGithubToken] = useState('');
+ const [githubRepo, setGithubRepo] = useState('');
+ const [githubBranch, setGithubBranch] = useState('main');
+ const [showKey, setShowKey] = useState(false);
+ const [showIgSecret, setShowIgSecret] = useState(false);
+ const [showGhToken, setShowGhToken] = useState(false);
+ const [saving, setSaving] = useState(false);
+ const [savingIg, setSavingIg] = useState(false);
+ const [savingCloud, setSavingCloud] = useState(false);
+ const [savingGh, setSavingGh] = useState(false);
+ const [syncingGh, setSyncingGh] = useState(false);
+ const [testing, setTesting] = useState(false);
+ const [testResult, setTestResult] = useState(null);
+ const [loading, setLoading] = useState(true);
+
+ useEffect(() => { loadKeys(); }, []);
const loadKeys = async () => {
setLoading(true);
try {
const res = await api.getKeys();
setApiKey(res.youtube || '');
- if (res.instagram) {
- setIgAppId(res.instagram.appId || '');
- setIgAppSecret(res.instagram.appSecret || '');
- }
- if (res.cloudinary) {
- setCloudinaryName(res.cloudinary.cloudName || '');
- setCloudinaryPreset(res.cloudinary.uploadPreset || '');
- }
- if (res.github) {
- setGithubToken(res.github.token || '');
- setGithubRepo(res.github.repo || '');
- setGithubBranch(res.github.branch || 'main');
- }
+ if (res.instagram) { setIgAppId(res.instagram.appId || ''); setIgAppSecret(res.instagram.appSecret || ''); }
+ if (res.cloudinary) { setCloudinaryName(res.cloudinary.cloudName || ''); setCloudinaryPreset(res.cloudinary.uploadPreset || ''); }
+ if (res.github) { setGithubToken(res.github.token || ''); setGithubRepo(res.github.repo || ''); setGithubBranch(res.github.branch || 'main'); }
} catch (err) {
showToast('Failed to load API keys', 'error');
} finally {
@@ -61,427 +54,294 @@ export default function Settings({ showToast, onRefresh }) {
const handleSave = async () => {
setSaving(true);
- try {
- await api.saveKey(apiKey);
- showToast('API key saved successfully', 'success');
- } catch (err) {
- showToast('Failed to save API key: ' + err.message, 'error');
- } finally {
- setSaving(false);
- }
+ try { await api.saveKey(apiKey); showToast('API key saved successfully', 'success'); }
+ catch (err) { showToast('Failed to save API key: ' + err.message, 'error'); }
+ finally { setSaving(false); }
};
const handleTest = async () => {
- setTesting(true);
- setTestResult(null);
+ setTesting(true); setTestResult(null);
try {
const res = await api.health();
- if (res.status === 'ok') {
- setTestResult({ success: true, message: 'API connection successful!' });
- } else {
- setTestResult({ success: false, message: 'API health check returned unexpected status.' });
- }
+ setTestResult({ success: res.status === 'ok', message: res.status === 'ok' ? 'API connection successful!' : 'Unexpected status.' });
} catch (err) {
setTestResult({ success: false, message: 'Connection failed: ' + err.message });
- } finally {
- setTesting(false);
- }
- };
-
- const handleRefreshAll = async () => {
- try {
- await api.refreshAll();
- showToast('All accounts refreshed successfully', 'success');
- onRefresh();
- } catch (err) {
- showToast('Refresh failed: ' + err.message, 'error');
- }
+ } finally { setTesting(false); }
};
const handleSaveInstagram = async () => {
setSavingIg(true);
- try {
- await api.saveKeys({ instagram: { appId: igAppId, appSecret: igAppSecret } });
- showToast('Instagram credentials saved successfully', 'success');
- } catch (err) {
- showToast('Failed to save Instagram credentials: ' + err.message, 'error');
- } finally {
- setSavingIg(false);
- }
+ try { await api.saveKeys({ instagram: { appId: igAppId, appSecret: igAppSecret } }); showToast('Instagram credentials saved successfully', 'success'); }
+ catch (err) { showToast('Failed to save Instagram credentials: ' + err.message, 'error'); }
+ finally { setSavingIg(false); }
};
const handleSaveCloudinary = async () => {
setSavingCloud(true);
- try {
- await api.saveKeys({ cloudinary: { cloudName: cloudinaryName, uploadPreset: cloudinaryPreset } });
- showToast('Cloudinary settings saved successfully', 'success');
- } catch (err) {
- showToast('Failed to save Cloudinary settings: ' + err.message, 'error');
- } finally {
- setSavingCloud(false);
- }
+ try { await api.saveKeys({ cloudinary: { cloudName: cloudinaryName, uploadPreset: cloudinaryPreset } }); showToast('Cloudinary settings saved successfully', 'success'); }
+ catch (err) { showToast('Failed to save Cloudinary settings: ' + err.message, 'error'); }
+ finally { setSavingCloud(false); }
};
const handleSaveGitHub = async () => {
setSavingGh(true);
- try {
- await api.saveKeys({ github: { token: githubToken, repo: githubRepo, branch: githubBranch } });
- showToast('GitHub Actions settings saved successfully', 'success');
- } catch (err) {
- showToast('Failed to save GitHub settings: ' + err.message, 'error');
- } finally {
- setSavingGh(false);
- }
+ try { await api.saveKeys({ github: { token: githubToken, repo: githubRepo, branch: githubBranch } }); showToast('GitHub Actions settings saved successfully', 'success'); }
+ catch (err) { showToast('Failed to save GitHub settings: ' + err.message, 'error'); }
+ finally { setSavingGh(false); }
};
const handleSyncGitHub = async () => {
setSyncingGh(true);
- try {
- await api.syncToGitHub();
- showToast('Scheduled posts synced to GitHub', 'success');
- } catch (err) {
- showToast('Sync failed: ' + err.message, 'error');
- } finally {
- setSyncingGh(false);
- }
+ try { await api.syncToGitHub(); showToast('Scheduled posts synced to GitHub', 'success'); }
+ catch (err) { showToast('Sync failed: ' + err.message, 'error'); }
+ finally { setSyncingGh(false); }
};
- const maskedKey = apiKey ? apiKey.substring(0, 8) + '•'.repeat(Math.max(0, apiKey.length - 12)) + apiKey.substring(apiKey.length - 4) : '';
- const maskedIgSecret = igAppSecret ? igAppSecret.substring(0, 6) + '•'.repeat(Math.max(0, igAppSecret.length - 10)) + igAppSecret.substring(igAppSecret.length - 4) : '';
- const maskedGhToken = githubToken ? 'ghp_' + '•'.repeat(Math.max(0, githubToken.length - 8)) + githubToken.substring(githubToken.length - 4) : '';
+ const masked = (val, start = 8, end = 4) =>
+ val ? val.substring(0, start) + '•'.repeat(Math.max(0, val.length - start - end)) + val.substring(val.length - end) : '';
return (
<Box>
- <Typography variant="h4" sx={{ fontWeight: 700, mb: 3 }}>
- Settings
- </Typography>
+ <Typography variant="h4" sx={{ mb: 3 }}>Settings</Typography>
<Grid container spacing={3}>
- {/* Left Column — all settings cards */}
<Grid size={{ xs: 12, md: 8 }}>
- {/* API Key Configuration */}
- <Card sx={{ mb: 3 }}>
- <CardContent>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 0.5 }}>
- <Key sx={{ verticalAlign: 'middle', mr: 1, color: '#FF9800' }} />
- YouTube Data API Key
- </Typography>
- <Typography variant="body2" sx={{ color: 'text.secondary', mb: 3 }}>
- Required to fetch YouTube channel and video data. Get your key from the{' '}
- <Box component="a" href="https://console.cloud.google.com/apis/credentials" target="_blank"
- sx={{ color: '#3EA6FF', textDecoration: 'none', '&:hover': { textDecoration: 'underline' } }}>
- Google Cloud Console
- </Box>.
- </Typography>
-
- <TextField fullWidth value={showKey ? apiKey : maskedKey}
- onChange={e => setApiKey(e.target.value)}
- placeholder="AIzaSy..." size="small"
- onFocus={() => setShowKey(true)}
- type={showKey ? 'text' : 'text'}
- slotProps={{
- input: {
- startAdornment: <InputAdornment position="start"><Key sx={{ color: 'text.secondary' }} /></InputAdornment>,
- endAdornment: (
- <InputAdornment position="end">
- <IconButton size="small" onClick={() => setShowKey(!showKey)}>
- {showKey ? <VisibilityOff fontSize="small" /> : <Visibility fontSize="small" />}
- </IconButton>
- </InputAdornment>
- ),
- }
- }}
- sx={{ mb: 2 }} />
-
- <Box sx={{ display: 'flex', gap: 1.5 }}>
- <Button variant="contained" startIcon={saving ? <CircularProgress size={16} /> : <Save />}
- onClick={handleSave} disabled={saving || !apiKey.trim()}
- sx={{ background: 'linear-gradient(135deg, #FF0000, #FF4444)' }}>
- Save Key
- </Button>
- <Button variant="outlined" startIcon={testing ? <CircularProgress size={16} /> : <CheckCircle />}
- onClick={handleTest} disabled={testing}
- sx={{ borderColor: 'rgba(255,255,255,0.15)' }}>
- Test Connection
- </Button>
- </Box>
-
- {testResult && (
- <Alert severity={testResult.success ? 'success' : 'error'} sx={{ mt: 2 }}>
- {testResult.message}
- </Alert>
- )}
- </CardContent>
- </Card>
-
- {/* Instagram Credentials */}
- <Card sx={{ mb: 3 }}>
- <CardContent>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 0.5 }}>
- <Instagram sx={{ verticalAlign: 'middle', mr: 1, color: '#E1306C' }} />
- Instagram App Credentials
- </Typography>
- <Typography variant="body2" sx={{ color: 'text.secondary', mb: 3 }}>
- Optional — enables long-lived token exchange (~60 days). Get these from{' '}
- <Box component="a" href="https://developers.facebook.com/apps/" target="_blank"
- sx={{ color: '#E1306C', textDecoration: 'none', '&:hover': { textDecoration: 'underline' } }}>
- App Dashboard → Instagram → API setup with Instagram login
- </Box>.
- </Typography>
-
- <TextField fullWidth value={igAppId}
- onChange={e => setIgAppId(e.target.value)}
- placeholder="Instagram App ID from App Dashboard" size="small" label="Instagram App ID"
- slotProps={{
- input: {
- startAdornment: <InputAdornment position="start"><Code sx={{ color: 'text.secondary' }} /></InputAdornment>,
- }
- }}
- sx={{ mb: 2 }} />
-
- <TextField fullWidth value={showIgSecret ? igAppSecret : maskedIgSecret}
- onChange={e => setIgAppSecret(e.target.value)}
- placeholder="Instagram App Secret from App Dashboard" size="small" label="Instagram App Secret"
- onFocus={() => setShowIgSecret(true)}
- slotProps={{
- input: {
- startAdornment: <InputAdornment position="start"><Key sx={{ color: 'text.secondary' }} /></InputAdornment>,
- endAdornment: (
- <InputAdornment position="end">
- <IconButton size="small" onClick={() => setShowIgSecret(!showIgSecret)}>
- {showIgSecret ? <VisibilityOff fontSize="small" /> : <Visibility fontSize="small" />}
- </IconButton>
- </InputAdornment>
- ),
- }
- }}
- sx={{ mb: 2 }} />
-
- <Button variant="contained" startIcon={savingIg ? <CircularProgress size={16} /> : <Save />}
- onClick={handleSaveInstagram} disabled={savingIg || (!igAppId.trim() && !igAppSecret.trim())}
- sx={{ background: 'linear-gradient(135deg, #F58529, #DD2A7B, #8134AF)' }}>
- Save Instagram Credentials
+ {/* YouTube API Key */}
+ <MainCard title="YouTube Data API Key" sx={{ mb: 3 }}>
+ <Typography variant="body2" color="text.secondary" sx={{ mb: 2.5 }}>
+ Required to fetch YouTube channel and video data. Get your key from the{' '}
+ <Box component="a" href="https://console.cloud.google.com/apis/credentials" target="_blank"
+ sx={{ color: PRIMARY.main, textDecoration: 'none', '&:hover': { textDecoration: 'underline' } }}>
+ Google Cloud Console
+ </Box>.
+ </Typography>
+ <TextField fullWidth value={showKey ? apiKey : masked(apiKey)}
+ onChange={e => setApiKey(e.target.value)}
+ placeholder="AIzaSy…" size="small"
+ onFocus={() => setShowKey(true)}
+ slotProps={{
+ input: {
+ startAdornment: <InputAdornment position="start"><Key sx={{ color: 'text.secondary' }} /></InputAdornment>,
+ endAdornment: (
+ <InputAdornment position="end">
+ <IconButton size="small" onClick={() => setShowKey(!showKey)}>
+ {showKey ? <VisibilityOff fontSize="small" /> : <Visibility fontSize="small" />}
+ </IconButton>
+ </InputAdornment>
+ ),
+ }
+ }}
+ sx={{ mb: 2 }}
+ />
+ <Box sx={{ display: 'flex', gap: 1.5 }}>
+ <Button variant="contained" startIcon={saving ? <CircularProgress size={16} color="inherit" /> : <Save />}
+ onClick={handleSave} disabled={saving || !apiKey.trim()}>
+ Save Key
</Button>
-
- <Alert severity="info" sx={{ mt: 2 }}>
- Only the <strong>Instagram App Secret</strong> is needed for token exchange. You can add accounts
- without credentials — tokens from the App Dashboard are already long-lived (60 days).
- </Alert>
- </CardContent>
- </Card>
-
- {/* Cloudinary CDN Settings */}
- <Card sx={{ mb: 3 }}>
- <CardContent>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 0.5 }}>
- <Cloud sx={{ verticalAlign: 'middle', mr: 1, color: '#3448C5' }} />
- Cloudinary CDN (for Instagram Uploads)
- </Typography>
- <Typography variant="body2" sx={{ color: 'text.secondary', mb: 3 }}>
- Instagram API requires media at a public URL. Cloudinary is used to host your files before publishing.
- Get a free account at{' '}
- <Box component="a" href="https://cloudinary.com/users/register_free" target="_blank"
- sx={{ color: '#3448C5', textDecoration: 'none', '&:hover': { textDecoration: 'underline' } }}>
- cloudinary.com
- </Box>. Use an <strong>unsigned upload preset</strong>.
- </Typography>
-
- <TextField fullWidth value={cloudinaryName}
- onChange={e => setCloudinaryName(e.target.value)}
- placeholder="e.g. my-cloud-name" size="small" label="Cloud Name"
- slotProps={{
- input: {
- startAdornment: <InputAdornment position="start"><Cloud sx={{ color: 'text.secondary' }} /></InputAdornment>,
- }
- }}
- sx={{ mb: 2 }} />
-
- <TextField fullWidth value={cloudinaryPreset}
- onChange={e => setCloudinaryPreset(e.target.value)}
- placeholder="e.g. ml_default (unsigned preset)" size="small" label="Upload Preset (unsigned)"
- slotProps={{
- input: {
- startAdornment: <InputAdornment position="start"><Code sx={{ color: 'text.secondary' }} /></InputAdornment>,
- }
- }}
- sx={{ mb: 2 }} />
-
- <Button variant="contained" startIcon={savingCloud ? <CircularProgress size={16} /> : <Save />}
- onClick={handleSaveCloudinary} disabled={savingCloud || !cloudinaryName.trim()}
- sx={{ background: 'linear-gradient(135deg, #3448C5, #0C6DD7)' }}>
- Save Cloudinary Settings
+ <Button variant="outlined" startIcon={testing ? <CircularProgress size={16} /> : <CheckCircle />}
+ onClick={handleTest} disabled={testing}>
+ Test Connection
</Button>
-
- <Alert severity="info" sx={{ mt: 2 }}>
- Create an <strong>unsigned upload preset</strong> in Cloudinary → Settings → Upload → Upload presets → Add.
- This allows direct browser uploads without exposing API secrets.
- </Alert>
- </CardContent>
- </Card>
-
- {/* GitHub Actions — Cloud Scheduling */}
- <Card sx={{ mb: 3 }}>
- <CardContent>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 0.5 }}>
- <GitHub sx={{ verticalAlign: 'middle', mr: 1 }} />
- GitHub Actions (Cloud Scheduling)
- </Typography>
- <Typography variant="body2" sx={{ color: 'text.secondary', mb: 3 }}>
- Publish scheduled posts from the cloud — even when your PC is off. Runs every 15 min via GitHub Actions (free).
- Create a{' '}
- <Box component="a" href="https://github.com/settings/tokens?type=beta" target="_blank"
- sx={{ color: '#fff', textDecoration: 'none', '&:hover': { textDecoration: 'underline' } }}>
- Fine-grained Personal Access Token
- </Box>{' '}
- with <strong>Contents: Read & Write</strong> permission.
- </Typography>
-
- <TextField fullWidth value={showGhToken ? githubToken : maskedGhToken}
- onChange={e => setGithubToken(e.target.value)}
- placeholder="ghp_xxxxxxxxxxxx" size="small" label="GitHub Personal Access Token"
- onFocus={() => setShowGhToken(true)}
- slotProps={{
- input: {
- startAdornment: <InputAdornment position="start"><Key sx={{ color: 'text.secondary' }} /></InputAdornment>,
- endAdornment: (
- <InputAdornment position="end">
- <IconButton size="small" onClick={() => setShowGhToken(!showGhToken)}>
- {showGhToken ? <VisibilityOff fontSize="small" /> : <Visibility fontSize="small" />}
- </IconButton>
- </InputAdornment>
- ),
- }
- }}
- sx={{ mb: 2 }} />
-
- <TextField fullWidth value={githubRepo}
- onChange={e => setGithubRepo(e.target.value)}
- placeholder="username/repo-name" size="small" label="Repository (owner/repo)"
- slotProps={{
- input: {
- startAdornment: <InputAdornment position="start"><GitHub sx={{ color: 'text.secondary' }} /></InputAdornment>,
- }
- }}
- sx={{ mb: 2 }} />
-
- <TextField fullWidth value={githubBranch}
- onChange={e => setGithubBranch(e.target.value)}
- placeholder="main" size="small" label="Branch"
- slotProps={{
- input: {
- startAdornment: <InputAdornment position="start"><Code sx={{ color: 'text.secondary' }} /></InputAdornment>,
- }
- }}
- sx={{ mb: 2 }} />
-
- <Box sx={{ display: 'flex', gap: 1.5, flexWrap: 'wrap' }}>
- <Button variant="contained" startIcon={savingGh ? <CircularProgress size={16} /> : <Save />}
- onClick={handleSaveGitHub} disabled={savingGh || !githubToken.trim() || !githubRepo.trim()}
- sx={{ background: 'linear-gradient(135deg, #333, #555)' }}>
- Save GitHub Settings
- </Button>
- <Button variant="outlined" startIcon={syncingGh ? <CircularProgress size={16} /> : <Sync />}
- onClick={handleSyncGitHub} disabled={syncingGh || !githubToken.trim() || !githubRepo.trim()}
- sx={{ borderColor: 'rgba(255,255,255,0.15)' }}>
- Sync Now
- </Button>
- </Box>
-
- <Alert severity="info" sx={{ mt: 2 }}>
- <strong>Setup steps:</strong><br />
- 1. Push this project to a GitHub repo<br />
- 2. Go to repo → Settings → Secrets → Actions → New Secret<br />
- 3. Add secret <code>ACCOUNTS_JSON</code> with the Base64 of your <code>accounts.json</code><br />
- &nbsp;&nbsp;&nbsp;PowerShell: <code>[Convert]::ToBase64String([IO.File]::ReadAllBytes("backend\data\accounts.json"))</code><br />
- 4. The workflow runs every 15 min automatically
- </Alert>
- </CardContent>
- </Card>
-
- {/* How to get API Keys */}
- <Card>
- <CardContent>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2 }}>
- <Info sx={{ verticalAlign: 'middle', mr: 1, color: '#3EA6FF' }} />
- How to Get a YouTube API Key
- </Typography>
- <Box component="ol" sx={{ pl: 2, color: 'text.secondary', '& li': { mb: 1.5, lineHeight: 1.6 } }}>
- <li>Go to the <Box component="a" href="https://console.cloud.google.com/" target="_blank" sx={{ color: '#3EA6FF' }}>Google Cloud Console</Box></li>
- <li>Create a new project or select an existing one</li>
- <li>Enable the <strong style={{ color: '#fff' }}>YouTube Data API v3</strong> from the API Library</li>
- <li>Go to <strong style={{ color: '#fff' }}>Credentials</strong> → <strong style={{ color: '#fff' }}>Create Credentials</strong> → <strong style={{ color: '#fff' }}>API Key</strong></li>
- <li>Copy the API key and paste it above</li>
- <li>Optional: Restrict the key to YouTube Data API v3 only for security</li>
- </Box>
- <Alert severity="info" sx={{ mt: 2 }}>
- The free quota allows ~10,000 units/day. Fetching a channel uses ~5 units, video details ~3 units per batch.
+ </Box>
+ {testResult && (
+ <Alert severity={testResult.success ? 'success' : 'error'} sx={{ mt: 2 }}>
+ {testResult.message}
</Alert>
+ )}
+ </MainCard>
- <Divider sx={{ my: 3 }} />
-
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2 }}>
- <Instagram sx={{ verticalAlign: 'middle', mr: 1, color: '#E1306C' }} />
- How to Get Instagram Access
- </Typography>
- <Box component="ol" sx={{ pl: 2, color: 'text.secondary', '& li': { mb: 1.5, lineHeight: 1.6 } }}>
- <li>Go to <Box component="a" href="https://developers.facebook.com/apps/" target="_blank" sx={{ color: '#E1306C' }}>Meta for Developers</Box> and create a new app (type: <strong style={{ color: '#fff' }}>Business</strong>)</li>
- <li>In the app dashboard, add the <strong style={{ color: '#fff' }}>Instagram</strong> product and set up <strong style={{ color: '#fff' }}>API setup with Instagram business login</strong></li>
- <li>Your Instagram account must be a <strong style={{ color: '#fff' }}>Business</strong> or <strong style={{ color: '#fff' }}>Creator</strong> professional account (no Facebook Page link needed)</li>
- <li>In the Instagram API setup section, find your <strong style={{ color: '#fff' }}>Instagram App ID</strong> and <strong style={{ color: '#fff' }}>Instagram App Secret</strong> under Business login settings</li>
- <li>Add your Instagram account as a <strong style={{ color: '#fff' }}>Tester</strong> under App Roles → Instagram Testers, then accept the invite</li>
- <li>Click <strong style={{ color: '#fff' }}>Generate Token</strong> next to your Instagram account to get a long-lived access token (60 days)</li>
- <li>Required permission: <strong style={{ color: '#fff' }}>instagram_business_basic</strong></li>
- <li>Paste the access token in the <strong style={{ color: '#fff' }}>Add Account → Instagram</strong> dialog</li>
- </Box>
- <Alert severity="warning" sx={{ mt: 2 }}>
- In development mode, only test users / Instagram Testers can use the app.
- Tokens from the App Dashboard are long-lived (~60 days). Tokens from the Business Login
- flow are short-lived (1 hour) and need the App Secret for exchange.
- </Alert>
- </CardContent>
- </Card>
+ {/* Instagram Credentials */}
+ <MainCard title="Instagram App Credentials" sx={{ mb: 3 }}>
+ <Typography variant="body2" color="text.secondary" sx={{ mb: 2.5 }}>
+ Optional — enables long-lived token exchange (~60 days). Get these from{' '}
+ <Box component="a" href="https://developers.facebook.com/apps/" target="_blank"
+ sx={{ color: '#E1306C', textDecoration: 'none', '&:hover': { textDecoration: 'underline' } }}>
+ App Dashboard → Instagram → API setup with Instagram login
+ </Box>.
+ </Typography>
+ <TextField fullWidth value={igAppId} onChange={e => setIgAppId(e.target.value)}
+ placeholder="Instagram App ID from App Dashboard" size="small" label="Instagram App ID"
+ slotProps={{ input: { startAdornment: <InputAdornment position="start"><Code sx={{ color: 'text.secondary' }} /></InputAdornment> } }}
+ sx={{ mb: 2 }} />
+ <TextField fullWidth value={showIgSecret ? igAppSecret : masked(igAppSecret, 6)}
+ onChange={e => setIgAppSecret(e.target.value)}
+ placeholder="Instagram App Secret from App Dashboard" size="small" label="Instagram App Secret"
+ onFocus={() => setShowIgSecret(true)}
+ slotProps={{
+ input: {
+ startAdornment: <InputAdornment position="start"><Key sx={{ color: 'text.secondary' }} /></InputAdornment>,
+ endAdornment: (
+ <InputAdornment position="end">
+ <IconButton size="small" onClick={() => setShowIgSecret(!showIgSecret)}>
+ {showIgSecret ? <VisibilityOff fontSize="small" /> : <Visibility fontSize="small" />}
+ </IconButton>
+ </InputAdornment>
+ ),
+ }
+ }}
+ sx={{ mb: 2 }} />
+ <Button variant="contained" startIcon={savingIg ? <CircularProgress size={16} color="inherit" /> : <Save />}
+ onClick={handleSaveInstagram} disabled={savingIg || (!igAppId.trim() && !igAppSecret.trim())}>
+ Save Instagram Credentials
+ </Button>
+ <Alert severity="info" sx={{ mt: 2 }}>
+ Only the <strong>Instagram App Secret</strong> is needed for token exchange. You can add accounts
+ without credentials — tokens from the App Dashboard are already long-lived (60 days).
+ </Alert>
+ </MainCard>
+
+ {/* Cloudinary */}
+ <MainCard title="Cloudinary CDN (for Instagram Uploads)" sx={{ mb: 3 }}>
+ <Typography variant="body2" color="text.secondary" sx={{ mb: 2.5 }}>
+ Instagram API requires media at a public URL. Cloudinary is used to host your files before publishing.
+ Get a free account at{' '}
+ <Box component="a" href="https://cloudinary.com/users/register_free" target="_blank"
+ sx={{ color: '#3448C5', textDecoration: 'none', '&:hover': { textDecoration: 'underline' } }}>
+ cloudinary.com
+ </Box>. Use an <strong>unsigned upload preset</strong>.
+ </Typography>
+ <TextField fullWidth value={cloudinaryName} onChange={e => setCloudinaryName(e.target.value)}
+ placeholder="e.g. my-cloud-name" size="small" label="Cloud Name"
+ slotProps={{ input: { startAdornment: <InputAdornment position="start"><Cloud sx={{ color: 'text.secondary' }} /></InputAdornment> } }}
+ sx={{ mb: 2 }} />
+ <TextField fullWidth value={cloudinaryPreset} onChange={e => setCloudinaryPreset(e.target.value)}
+ placeholder="e.g. ml_default (unsigned preset)" size="small" label="Upload Preset (unsigned)"
+ slotProps={{ input: { startAdornment: <InputAdornment position="start"><Code sx={{ color: 'text.secondary' }} /></InputAdornment> } }}
+ sx={{ mb: 2 }} />
+ <Button variant="contained" startIcon={savingCloud ? <CircularProgress size={16} color="inherit" /> : <Save />}
+ onClick={handleSaveCloudinary} disabled={savingCloud || !cloudinaryName.trim()}>
+ Save Cloudinary Settings
+ </Button>
+ <Alert severity="info" sx={{ mt: 2 }}>
+ Create an <strong>unsigned upload preset</strong> in Cloudinary → Settings → Upload → Upload presets → Add.
+ </Alert>
+ </MainCard>
+
+ {/* GitHub Actions */}
+ <MainCard title="GitHub Actions (Cloud Scheduling)" sx={{ mb: 3 }}>
+ <Typography variant="body2" color="text.secondary" sx={{ mb: 2.5 }}>
+ Publish scheduled posts from the cloud — even when your PC is off. Runs every 15 min via GitHub Actions (free).
+ Create a{' '}
+ <Box component="a" href="https://github.com/settings/tokens?type=beta" target="_blank"
+ sx={{ color: PRIMARY.main, textDecoration: 'none', '&:hover': { textDecoration: 'underline' } }}>
+ Fine-grained Personal Access Token
+ </Box>{' '}
+ with <strong>Contents: Read & Write</strong> permission.
+ </Typography>
+ <TextField fullWidth value={showGhToken ? githubToken : masked(githubToken)}
+ onChange={e => setGithubToken(e.target.value)}
+ placeholder="ghp_xxxxxxxxxxxx" size="small" label="GitHub Personal Access Token"
+ onFocus={() => setShowGhToken(true)}
+ slotProps={{
+ input: {
+ startAdornment: <InputAdornment position="start"><Key sx={{ color: 'text.secondary' }} /></InputAdornment>,
+ endAdornment: (
+ <InputAdornment position="end">
+ <IconButton size="small" onClick={() => setShowGhToken(!showGhToken)}>
+ {showGhToken ? <VisibilityOff fontSize="small" /> : <Visibility fontSize="small" />}
+ </IconButton>
+ </InputAdornment>
+ ),
+ }
+ }}
+ sx={{ mb: 2 }} />
+ <TextField fullWidth value={githubRepo} onChange={e => setGithubRepo(e.target.value)}
+ placeholder="username/repo-name" size="small" label="Repository (owner/repo)"
+ slotProps={{ input: { startAdornment: <InputAdornment position="start"><GitHub sx={{ color: 'text.secondary' }} /></InputAdornment> } }}
+ sx={{ mb: 2 }} />
+ <TextField fullWidth value={githubBranch} onChange={e => setGithubBranch(e.target.value)}
+ placeholder="main" size="small" label="Branch"
+ slotProps={{ input: { startAdornment: <InputAdornment position="start"><Code sx={{ color: 'text.secondary' }} /></InputAdornment> } }}
+ sx={{ mb: 2 }} />
+ <Box sx={{ display: 'flex', gap: 1.5, flexWrap: 'wrap' }}>
+ <Button variant="contained" startIcon={savingGh ? <CircularProgress size={16} color="inherit" /> : <Save />}
+ onClick={handleSaveGitHub} disabled={savingGh || !githubToken.trim() || !githubRepo.trim()}>
+ Save GitHub Settings
+ </Button>
+ <Button variant="outlined" startIcon={syncingGh ? <CircularProgress size={16} /> : <Sync />}
+ onClick={handleSyncGitHub} disabled={syncingGh || !githubToken.trim() || !githubRepo.trim()}>
+ Sync Now
+ </Button>
+ </Box>
+ <Alert severity="info" sx={{ mt: 2 }}>
+ <strong>Setup steps:</strong><br />
+ 1. Push this project to a GitHub repo<br />
+ 2. Go to repo → Settings → Secrets → Actions → New Secret<br />
+ 3. Add secret <code>ACCOUNTS_JSON</code> with the Base64 of your <code>accounts.json</code><br />
+ 4. The workflow runs every 15 min automatically
+ </Alert>
+ </MainCard>
+
+ {/* How to get API keys */}
+ <MainCard title="How to Get a YouTube API Key">
+ <Box component="ol" sx={{ pl: 2, color: 'text.secondary', '& li': { mb: 1.5, lineHeight: 1.6 } }}>
+ <li>Go to the <Box component="a" href="https://console.cloud.google.com/" target="_blank" sx={{ color: PRIMARY.main }}>Google Cloud Console</Box></li>
+ <li>Create a new project or select an existing one</li>
+ <li>Enable the <strong>YouTube Data API v3</strong> from the API Library</li>
+ <li>Go to <strong>Credentials</strong> → <strong>Create Credentials</strong> → <strong>API Key</strong></li>
+ <li>Copy the API key and paste it above</li>
+ <li>Optional: Restrict the key to YouTube Data API v3 only for security</li>
+ </Box>
+ <Alert severity="info" sx={{ mt: 2 }}>
+ The free quota allows ~10,000 units/day. Fetching a channel uses ~5 units, video details ~3 units per batch.
+ </Alert>
+
+ <Divider sx={{ my: 3 }} />
+
+ <Typography variant="subtitle1" sx={{ fontWeight: 600, mb: 2 }}>
+ How to Get Instagram Access
+ </Typography>
+ <Box component="ol" sx={{ pl: 2, color: 'text.secondary', '& li': { mb: 1.5, lineHeight: 1.6 } }}>
+ <li>Go to <Box component="a" href="https://developers.facebook.com/apps/" target="_blank" sx={{ color: '#E1306C' }}>Meta for Developers</Box> and create a new app (type: <strong>Business</strong>)</li>
+ <li>Add the <strong>Instagram</strong> product and set up <strong>API setup with Instagram business login</strong></li>
+ <li>Your account must be a <strong>Business</strong> or <strong>Creator</strong> professional account</li>
+ <li>Find your <strong>Instagram App ID</strong> and <strong>Instagram App Secret</strong> under Business login settings</li>
+ <li>Add your account as a <strong>Tester</strong> under App Roles → Instagram Testers</li>
+ <li>Click <strong>Generate Token</strong> next to your Instagram account to get a long-lived access token (60 days)</li>
+ <li>Required permission: <strong>instagram_business_basic</strong></li>
+ <li>Paste the access token in the <strong>Add Account → Instagram</strong> dialog</li>
+ </Box>
+ <Alert severity="warning" sx={{ mt: 2 }}>
+ In development mode, only test users / Instagram Testers can use the app.
+ Tokens from the App Dashboard are long-lived (~60 days).
+ </Alert>
+ </MainCard>
</Grid>
- {/* Right Column — Quick Actions + About (sticky at top) */}
+ {/* Right column — Quick Actions + About */}
<Grid size={{ xs: 12, md: 4 }}>
- <Box sx={{ position: 'sticky', top: 24 }}>
- <Card sx={{ mb: 2 }}>
- <CardContent>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2 }}>
- <Refresh sx={{ verticalAlign: 'middle', mr: 1, color: '#4CAF50' }} />
- Quick Actions
- </Typography>
- <Button fullWidth variant="outlined" startIcon={<Refresh />} onClick={handleRefreshAll}
- sx={{ borderColor: 'rgba(255,255,255,0.15)', mb: 1.5 }}>
- Refresh All Accounts
- </Button>
- <Button fullWidth variant="outlined" startIcon={<CheckCircle />} onClick={handleTest}
- sx={{ borderColor: 'rgba(255,255,255,0.15)' }}>
- Test API Health
- </Button>
- </CardContent>
- </Card>
+ <Box sx={{ position: 'sticky', top: 80 }}>
+ <MainCard title="Quick Actions" sx={{ mb: 2 }}>
+ <Button fullWidth variant="outlined" startIcon={<Refresh />} onClick={refreshAll} sx={{ mb: 1.5 }}>
+ Refresh All Accounts
+ </Button>
+ <Button fullWidth variant="outlined" startIcon={<CheckCircle />} onClick={handleTest}>
+ Test API Health
+ </Button>
+ </MainCard>
- <Card>
- <CardContent>
- <Typography variant="h6" sx={{ fontWeight: 600, mb: 2 }}>About</Typography>
- <Typography variant="body2" sx={{ color: 'text.secondary', mb: 2, lineHeight: 1.7 }}>
- Social Media Analytics Dashboard — a comprehensive analytics tool for tracking YouTube and Instagram
- performance with engagement metrics, growth tracking, and more.
- </Typography>
- <Divider sx={{ my: 2 }} />
- <Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 0.5 }}>
- <Chip label="React" size="small" variant="outlined" sx={{ borderColor: 'rgba(97,219,251,0.3)', color: '#61DAFB' }} />
- <Chip label="MUI v7" size="small" variant="outlined" sx={{ borderColor: 'rgba(0,127,255,0.3)', color: '#007FFF' }} />
- <Chip label="Recharts" size="small" variant="outlined" sx={{ borderColor: 'rgba(130,202,157,0.3)', color: '#82ca9d' }} />
- <Chip label="Node.js" size="small" variant="outlined" sx={{ borderColor: 'rgba(104,159,56,0.3)', color: '#68A038' }} />
- <Chip label="YouTube API v3" size="small" variant="outlined" sx={{ borderColor: 'rgba(255,0,0,0.3)', color: '#FF4444' }} />
- <Chip label="Instagram Graph API" size="small" variant="outlined" sx={{ borderColor: 'rgba(225,48,108,0.3)', color: '#E1306C' }} />
- </Box>
- </CardContent>
- </Card>
+ <MainCard title="About">
+ <Typography variant="body2" color="text.secondary" sx={{ mb: 2, lineHeight: 1.7 }}>
+ Social Media Analytics Dashboard — a comprehensive analytics tool for tracking YouTube and Instagram
+ performance with engagement metrics, growth tracking, and more.
+ </Typography>
+ <Divider sx={{ my: 2 }} />
+ <Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 0.5 }}>
+ {[
+ { label: 'React', color: '#61DAFB' },
+ { label: 'MUI v7', color: '#007FFF' },
+ { label: 'Recharts', color: '#82ca9d' },
+ { label: 'Node.js', color: '#68A038' },
+ { label: 'YouTube API v3', color: '#FF4444' },
+ { label: 'Instagram Graph API', color: '#E1306C' },
+ ].map(c => (
+ <Chip key={c.label} label={c.label} size="small" variant="outlined"
+ sx={{ borderColor: `${c.color}55`, color: c.color }} />
+ ))}
+ </Box>
+ </MainCard>
</Box>
</Grid>
</Grid>
diff --git a/frontend/src/layout/Drawer/DrawerHeader.jsx b/frontend/src/layout/Drawer/DrawerHeader.jsx
new file mode 100644
index 0000000..ba9c23b
--- /dev/null
+++ b/frontend/src/layout/Drawer/DrawerHeader.jsx
@@ -0,0 +1,36 @@
+import React from 'react';
+import { Box, Typography } from '@mui/material';
+import Logo from '../../components/ui/Logo';
+import { GREY, PRIMARY } from '../../themes/index';
+
+export default function DrawerHeader({ open }) {
+ return (
+ <Box
+ sx={{
+ display: 'flex',
+ alignItems: 'center',
+ gap: 1.5,
+ px: open ? 3 : 0,
+ justifyContent: open ? 'flex-start' : 'center',
+ minHeight: 60,
+ borderBottom: `1px solid ${GREY.A800}`,
+ flexShrink: 0,
+ }}
+ >
+ <Logo size={32} />
+ {open && (
+ <Typography
+ variant="h5"
+ sx={{
+ fontWeight: 700,
+ color: 'text.primary',
+ letterSpacing: '-0.3px',
+ whiteSpace: 'nowrap',
+ }}
+ >
+ Twiligent
+ </Typography>
+ )}
+ </Box>
+ );
+}
diff --git a/frontend/src/layout/Drawer/Navigation.jsx b/frontend/src/layout/Drawer/Navigation.jsx
new file mode 100644
index 0000000..1a7b2cf
--- /dev/null
+++ b/frontend/src/layout/Drawer/Navigation.jsx
@@ -0,0 +1,200 @@
+import React from 'react';
+import { useNavigate, useLocation } from 'react-router-dom';
+import {
+ Box, List, ListItemButton, ListItemIcon, ListItemText,
+ Typography, Divider, Avatar, Tooltip,
+} from '@mui/material';
+import {
+ Dashboard, YouTube, Subscriptions, ContentCut,
+ Instagram, CloudUpload, ManageAccounts, Settings,
+} from '@mui/icons-material';
+import { useAppContext } from '../../context/AppContext';
+import { PRIMARY, GREY } from '../../themes/index';
+
+const DRAWER_WIDTH = 260;
+
+const NAV_GROUPS = [
+ {
+ label: 'Analytics',
+ items: [
+ { path: '/', label: 'Overview', icon: <Dashboard /> },
+ { path: '/videos', label: 'All Videos', icon: <Subscriptions /> },
+ { path: '/shorts', label: 'Shorts', icon: <ContentCut /> },
+ { path: '/reels', label: 'IG Content', icon: <Instagram /> },
+ ],
+ },
+ {
+ label: 'Publishing',
+ items: [
+ { path: '/upload', label: 'Publish', icon: <CloudUpload /> },
+ ],
+ },
+ {
+ label: 'Management',
+ items: [
+ { path: '/accounts', label: 'Accounts', icon: <ManageAccounts /> },
+ { path: '/settings', label: 'Settings', icon: <Settings /> },
+ ],
+ },
+];
+
+function NavItem({ item, open }) {
+ const navigate = useNavigate();
+ const location = useLocation();
+ const active = location.pathname === item.path;
+
+ const button = (
+ <ListItemButton
+ selected={active}
+ onClick={() => navigate(item.path)}
+ sx={{
+ borderRadius: 1.5,
+ mb: 0.5,
+ px: open ? 2 : 1.5,
+ py: 1,
+ justifyContent: open ? 'flex-start' : 'center',
+ minHeight: 40,
+ position: 'relative',
+ ...(active && {
+ bgcolor: PRIMARY.lighter,
+ '&::after': {
+ content: '""',
+ position: 'absolute',
+ right: 0,
+ top: '20%',
+ height: '60%',
+ width: 2,
+ background: PRIMARY.main,
+ borderRadius: '2px 0 0 2px',
+ },
+ }),
+ }}
+ >
+ <ListItemIcon
+ sx={{
+ minWidth: open ? 36 : 'auto',
+ color: active ? PRIMARY.main : GREY[500],
+ '& svg': { fontSize: 20 },
+ }}
+ >
+ {item.icon}
+ </ListItemIcon>
+ {open && (
+ <ListItemText
+ primary={item.label}
+ primaryTypographyProps={{
+ fontSize: '0.875rem',
+ fontWeight: active ? 600 : 400,
+ color: active ? PRIMARY.main : 'text.primary',
+ }}
+ />
+ )}
+ </ListItemButton>
+ );
+
+ if (!open) {
+ return <Tooltip title={item.label} placement="right">{button}</Tooltip>;
+ }
+ return button;
+}
+
+export default function Navigation({ open }) {
+ const { accounts } = useAppContext();
+ const navigate = useNavigate();
+
+ const ytAccounts = accounts.filter(a => a.platform !== 'instagram');
+ const igAccounts = accounts.filter(a => a.platform === 'instagram');
+
+ return (
+ <Box sx={{ flex: 1, overflow: 'auto', px: open ? 1.5 : 1, py: 1.5 }}>
+ {NAV_GROUPS.map((group, gi) => (
+ <Box key={gi} sx={{ mb: 1 }}>
+ {open && (
+ <Typography
+ sx={{
+ px: 1, mb: 0.75,
+ fontSize: '0.7rem',
+ fontWeight: 600,
+ letterSpacing: '0.08em',
+ textTransform: 'uppercase',
+ color: 'text.secondary',
+ }}
+ >
+ {group.label}
+ </Typography>
+ )}
+ <List disablePadding>
+ {group.items.map(item => (
+ <NavItem key={item.path} item={item} open={open} />
+ ))}
+ </List>
+ {gi < NAV_GROUPS.length - 1 && (
+ <Divider sx={{ my: 1.5 }} />
+ )}
+ </Box>
+ ))}
+
+ {/* Accounts quick list */}
+ {open && accounts.length > 0 && (
+ <>
+ <Divider sx={{ my: 1.5 }} />
+ <Typography
+ sx={{
+ px: 1, mb: 0.75,
+ fontSize: '0.7rem',
+ fontWeight: 600,
+ letterSpacing: '0.08em',
+ textTransform: 'uppercase',
+ color: 'text.secondary',
+ }}
+ >
+ Accounts
+ </Typography>
+ <List disablePadding>
+ {accounts.map(acc => {
+ const isIG = acc.platform === 'instagram';
+ const path = isIG ? `/instagram/${acc.id}` : `/channel/${acc.id}`;
+ return (
+ <ListItemButton
+ key={acc.id}
+ onClick={() => navigate(path)}
+ sx={{
+ borderRadius: 1.5,
+ mb: 0.3,
+ px: 1.5,
+ py: 0.75,
+ '&:hover': { bgcolor: GREY[100] },
+ }}
+ >
+ <ListItemIcon sx={{ minWidth: 34 }}>
+ <Avatar
+ src={acc.thumbnail || acc.profilePictureUrl || acc.thumbnails?.default || ''}
+ sx={{
+ width: 24,
+ height: 24,
+ fontSize: '0.6rem',
+ bgcolor: isIG ? '#E1306C' : '#FF0000',
+ border: 'none',
+ }}
+ >
+ {isIG ? <Instagram sx={{ fontSize: 12 }} /> : <YouTube sx={{ fontSize: 12 }} />}
+ </Avatar>
+ </ListItemIcon>
+ <ListItemText
+ primary={acc.title}
+ primaryTypographyProps={{
+ fontSize: '0.8rem',
+ fontWeight: 400,
+ noWrap: true,
+ color: 'text.primary',
+ }}
+ />
+ </ListItemButton>
+ );
+ })}
+ </List>
+ </>
+ )}
+ </Box>
+ );
+}
diff --git a/frontend/src/layout/Drawer/index.jsx b/frontend/src/layout/Drawer/index.jsx
new file mode 100644
index 0000000..159e18a
--- /dev/null
+++ b/frontend/src/layout/Drawer/index.jsx
@@ -0,0 +1,59 @@
+import React from 'react';
+import { Drawer, Box, useMediaQuery } from '@mui/material';
+import DrawerHeader from './DrawerHeader';
+import Navigation from './Navigation';
+import { GREY } from '../../themes/index';
+
+export const DRAWER_WIDTH = 260;
+export const MINI_DRAWER_WIDTH = 72;
+
+export default function MainDrawer({ open, onClose }) {
+ const isMobile = useMediaQuery('(max-width:1024px)');
+
+ const drawerContent = (
+ <Box sx={{ display: 'flex', flexDirection: 'column', height: '100%', overflow: 'hidden' }}>
+ <DrawerHeader open={!isMobile ? open : true} />
+ <Navigation open={!isMobile ? open : true} />
+ </Box>
+ );
+
+ if (isMobile) {
+ return (
+ <Drawer
+ variant="temporary"
+ open={open}
+ onClose={onClose}
+ ModalProps={{ keepMounted: true }}
+ sx={{
+ '& .MuiDrawer-paper': {
+ width: DRAWER_WIDTH,
+ boxSizing: 'border-box',
+ borderRight: `1px solid ${GREY.A800}`,
+ },
+ }}
+ >
+ {drawerContent}
+ </Drawer>
+ );
+ }
+
+ return (
+ <Drawer
+ variant="permanent"
+ sx={{
+ width: open ? DRAWER_WIDTH : MINI_DRAWER_WIDTH,
+ flexShrink: 0,
+ transition: 'width 0.2s ease',
+ '& .MuiDrawer-paper': {
+ width: open ? DRAWER_WIDTH : MINI_DRAWER_WIDTH,
+ boxSizing: 'border-box',
+ overflowX: 'hidden',
+ transition: 'width 0.2s ease',
+ borderRight: `1px solid ${GREY.A800}`,
+ },
+ }}
+ >
+ {drawerContent}
+ </Drawer>
+ );
+}
diff --git a/frontend/src/layout/Header/index.jsx b/frontend/src/layout/Header/index.jsx
new file mode 100644
index 0000000..9a7b0bb
--- /dev/null
+++ b/frontend/src/layout/Header/index.jsx
@@ -0,0 +1,139 @@
+import React from 'react';
+import { useNavigate, useLocation } from 'react-router-dom';
+import {
+ AppBar, Toolbar, Box, IconButton, Typography,
+ Breadcrumbs, Link, useMediaQuery, Tooltip, Avatar, Badge,
+} from '@mui/material';
+import {
+ MenuOpen, Menu as MenuIcon, Refresh,
+ NavigateNext, Notifications, Settings,
+} from '@mui/icons-material';
+import { DRAWER_WIDTH, MINI_DRAWER_WIDTH } from '../Drawer/index';
+import { useAppContext } from '../../context/AppContext';
+import { GREY, PRIMARY } from '../../themes/index';
+
+const BREADCRUMB_MAP = {
+ '/': { label: 'Overview', parent: null },
+ '/videos': { label: 'All Videos', parent: 'Analytics' },
+ '/shorts': { label: 'Shorts', parent: 'Analytics' },
+ '/reels': { label: 'IG Content', parent: 'Analytics' },
+ '/upload': { label: 'Publish', parent: 'Publishing' },
+ '/accounts': { label: 'Accounts', parent: 'Management' },
+ '/settings': { label: 'Settings', parent: 'Management' },
+};
+
+export default function Header({ drawerOpen, onToggleDrawer }) {
+ const navigate = useNavigate();
+ const location = useLocation();
+ const isMobile = useMediaQuery('(max-width:1024px)');
+ const { loading, refreshAll } = useAppContext();
+
+ const drawerWidth = drawerOpen ? DRAWER_WIDTH : MINI_DRAWER_WIDTH;
+
+ // resolve breadcrumb for dynamic routes like /channel/:id and /instagram/:id
+ let pathname = location.pathname;
+ let crumb = BREADCRUMB_MAP[pathname];
+ if (!crumb && pathname.startsWith('/channel/')) {
+ crumb = { label: 'Channel Analytics', parent: 'Analytics' };
+ } else if (!crumb && pathname.startsWith('/instagram/')) {
+ crumb = { label: 'Instagram Analytics', parent: 'Analytics' };
+ }
+
+ return (
+ <AppBar
+ position="fixed"
+ sx={{
+ width: isMobile ? '100%' : `calc(100% - ${drawerWidth}px)`,
+ ml: isMobile ? 0 : `${drawerWidth}px`,
+ transition: 'width 0.2s ease, margin-left 0.2s ease',
+ zIndex: 1200,
+ bgcolor: 'background.paper',
+ borderBottom: `1px solid ${GREY.A800}`,
+ boxShadow: 'none',
+ }}
+ >
+ <Toolbar sx={{ minHeight: '60px !important', px: { xs: 2, sm: 3 }, gap: 2 }}>
+ {/* Drawer toggle */}
+ <IconButton
+ onClick={onToggleDrawer}
+ edge="start"
+ size="small"
+ sx={{
+ color: 'text.primary',
+ bgcolor: drawerOpen ? 'transparent' : GREY[100],
+ '&:hover': { bgcolor: GREY[100] },
+ }}
+ >
+ {drawerOpen ? <MenuOpen /> : <MenuIcon />}
+ </IconButton>
+
+ {/* Breadcrumbs */}
+ <Box sx={{ flex: 1 }}>
+ {crumb && (
+ <Breadcrumbs
+ separator={<NavigateNext fontSize="small" sx={{ color: GREY[400] }} />}
+ sx={{ '& .MuiBreadcrumbs-ol': { flexWrap: 'nowrap' } }}
+ >
+ <Link
+ underline="hover"
+ color="text.secondary"
+ onClick={() => navigate('/')}
+ sx={{ cursor: 'pointer', fontSize: '0.75rem', fontWeight: 500 }}
+ >
+ Dashboard
+ </Link>
+ {crumb.parent && (
+ <Typography sx={{ fontSize: '0.75rem', color: 'text.secondary' }}>
+ {crumb.parent}
+ </Typography>
+ )}
+ <Typography sx={{ fontSize: '0.75rem', fontWeight: 600, color: 'text.primary' }}>
+ {crumb.label}
+ </Typography>
+ </Breadcrumbs>
+ )}
+ </Box>
+
+ {/* Right actions */}
+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>
+ <Tooltip title="Refresh all accounts">
+ <IconButton
+ size="small"
+ onClick={refreshAll}
+ disabled={loading}
+ sx={{
+ color: loading ? PRIMARY.light : 'text.secondary',
+ '&:hover': { bgcolor: GREY[100] },
+ }}
+ >
+ <Refresh sx={{ fontSize: 20, ...(loading && { animation: 'spin 1s linear infinite' }) }} />
+ </IconButton>
+ </Tooltip>
+ <Tooltip title="Settings">
+ <IconButton
+ size="small"
+ onClick={() => navigate('/settings')}
+ sx={{ color: 'text.secondary', '&:hover': { bgcolor: GREY[100] } }}
+ >
+ <Settings sx={{ fontSize: 20 }} />
+ </IconButton>
+ </Tooltip>
+ <Avatar
+ sx={{
+ width: 32,
+ height: 32,
+ ml: 0.5,
+ bgcolor: PRIMARY.main,
+ fontSize: '0.8rem',
+ fontWeight: 600,
+ cursor: 'pointer',
+ }}
+ >
+ T
+ </Avatar>
+ </Box>
+ </Toolbar>
+ <style>{`@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }`}</style>
+ </AppBar>
+ );
+}
diff --git a/frontend/src/layout/index.jsx b/frontend/src/layout/index.jsx
new file mode 100644
index 0000000..9867f05
--- /dev/null
+++ b/frontend/src/layout/index.jsx
@@ -0,0 +1,48 @@
+import React, { useState } from 'react';
+import { Outlet } from 'react-router-dom';
+import { Box, Toolbar, useMediaQuery } from '@mui/material';
+import MainDrawer, { DRAWER_WIDTH, MINI_DRAWER_WIDTH } from './Drawer/index';
+import Header from './Header/index';
+
+export default function MainLayout() {
+ const isMobile = useMediaQuery('(max-width:1024px)');
+ const [drawerOpen, setDrawerOpen] = useState(true);
+
+ const toggleDrawer = () => setDrawerOpen(prev => !prev);
+
+ const contentMargin = isMobile ? 0 : (drawerOpen ? DRAWER_WIDTH : MINI_DRAWER_WIDTH);
+
+ return (
+ <Box sx={{ display: 'flex', minHeight: '100vh', bgcolor: 'background.default' }}>
+ <MainDrawer open={drawerOpen} onClose={() => setDrawerOpen(false)} />
+
+ <Box
+ component="main"
+ sx={{
+ flexGrow: 1,
+ ml: isMobile ? 0 : `${contentMargin}px`,
+ transition: 'margin-left 0.2s ease',
+ minWidth: 0,
+ display: 'flex',
+ flexDirection: 'column',
+ }}
+ >
+ <Header drawerOpen={drawerOpen} onToggleDrawer={toggleDrawer} />
+
+ {/* Offset for fixed header */}
+ <Toolbar sx={{ minHeight: '60px !important', flexShrink: 0 }} />
+
+ {/* Page content */}
+ <Box
+ sx={{
+ flex: 1,
+ p: { xs: 2, sm: 3 },
+ overflowX: 'hidden',
+ }}
+ >
+ <Outlet />
+ </Box>
+ </Box>
+ </Box>
+ );
+}
diff --git a/frontend/src/themes/index.jsx b/frontend/src/themes/index.jsx
new file mode 100644
index 0000000..e69a92d
--- /dev/null
+++ b/frontend/src/themes/index.jsx
@@ -0,0 +1,400 @@
+import { createTheme, alpha } from '@mui/material/styles';
+
+// Mantis palette — Ant Design blue as primary
+const PRIMARY = {
+ lighter: '#e6f4ff',
+ 100: '#bae0ff',
+ 200: '#91caff',
+ light: '#69b1ff',
+ 400: '#4096ff',
+ main: '#1890ff',
+ dark: '#096dd9',
+ 700: '#0050b3',
+ darker: '#003a8c',
+ 900: '#002766',
+ contrastText: '#fff',
+};
+
+const SECONDARY = {
+ lighter: '#f9f0ff',
+ light: '#d3adf7',
+ main: '#722ed1',
+ dark: '#531dab',
+ darker: '#22075e',
+ contrastText: '#fff',
+};
+
+const SUCCESS = {
+ lighter: '#f6ffed',
+ light: '#b7eb8f',
+ main: '#52c41a',
+ dark: '#389e0d',
+ darker: '#135200',
+ contrastText: '#fff',
+};
+
+const WARNING = {
+ lighter: '#fffbe6',
+ light: '#ffe58f',
+ main: '#faad14',
+ dark: '#d46b08',
+ darker: '#613400',
+ contrastText: '#212121',
+};
+
+const ERROR = {
+ lighter: '#fff1f0',
+ light: '#ffa39e',
+ main: '#ff4d4f',
+ dark: '#cf1322',
+ darker: '#820014',
+ contrastText: '#fff',
+};
+
+const INFO = {
+ lighter: '#e6fffb',
+ light: '#87e8de',
+ main: '#13c2c2',
+ dark: '#08979c',
+ darker: '#006d75',
+ contrastText: '#fff',
+};
+
+const GREY = {
+ 0: '#ffffff',
+ 50: '#fafafa',
+ 100: '#f5f5f5',
+ 200: '#f0f0f0',
+ 300: '#d9d9d9',
+ 400: '#bfbfbf',
+ 500: '#8c8c8c',
+ 600: '#595959',
+ 700: '#262626',
+ 800: '#141414',
+ 900: '#000000',
+ A50: '#fafafb',
+ A100: '#fafafa',
+ A200: '#bfbfbf',
+ A400: '#434343',
+ A700: '#1f1f1f',
+ A800: '#e6ebf1',
+};
+
+const theme = createTheme({
+ palette: {
+ mode: 'light',
+ primary: { ...PRIMARY },
+ secondary: { ...SECONDARY },
+ success: { ...SUCCESS },
+ warning: { ...WARNING },
+ error: { ...ERROR },
+ info: { ...INFO },
+ grey: GREY,
+ text: {
+ primary: GREY[700],
+ secondary: GREY[500],
+ disabled: GREY[400],
+ },
+ action: {
+ disabled: GREY[300],
+ },
+ divider: GREY[200],
+ background: {
+ paper: GREY[0],
+ default: GREY.A50,
+ },
+ },
+ typography: {
+ fontFamily: '"Inter", "Roboto", "Helvetica", "Arial", sans-serif',
+ htmlFontSize: 16,
+ fontWeightLight: 300,
+ fontWeightRegular: 400,
+ fontWeightMedium: 500,
+ fontWeightBold: 600,
+ h1: { fontWeight: 600, fontSize: '2.375rem', lineHeight: 1.21 },
+ h2: { fontWeight: 600, fontSize: '1.875rem', lineHeight: 1.27 },
+ h3: { fontWeight: 600, fontSize: '1.5rem', lineHeight: 1.33 },
+ h4: { fontWeight: 600, fontSize: '1.25rem', lineHeight: 1.4 },
+ h5: { fontWeight: 600, fontSize: '1rem', lineHeight: 1.5 },
+ h6: { fontWeight: 400, fontSize: '0.875rem', lineHeight: 1.57 },
+ body1: { fontSize: '0.875rem', lineHeight: 1.57 },
+ body2: { fontSize: '0.75rem', lineHeight: 1.66 },
+ subtitle1: { fontSize: '0.875rem', fontWeight: 600, lineHeight: 1.57 },
+ subtitle2: { fontSize: '0.75rem', fontWeight: 500, lineHeight: 1.66 },
+ caption: { fontSize: '0.75rem', lineHeight: 1.66 },
+ overline: { lineHeight: 2.66 },
+ button: { textTransform: 'capitalize' },
+ },
+ shape: { borderRadius: 8 },
+ breakpoints: {
+ values: { xs: 0, sm: 768, md: 1024, lg: 1266, xl: 1440 },
+ },
+ mixins: {
+ toolbar: { minHeight: 60, paddingTop: 8, paddingBottom: 8 },
+ },
+ components: {
+ MuiCssBaseline: {
+ styleOverrides: {
+ body: { fontFamily: '"Inter", "Roboto", "Helvetica", "Arial", sans-serif' },
+ '*::-webkit-scrollbar': { width: 6, height: 6 },
+ '*::-webkit-scrollbar-track': { background: GREY[100] },
+ '*::-webkit-scrollbar-thumb': { background: GREY[300], borderRadius: 3 },
+ },
+ },
+ MuiCard: {
+ defaultProps: { elevation: 0 },
+ styleOverrides: {
+ root: {
+ borderRadius: 8,
+ border: `1px solid ${GREY.A800}`,
+ boxShadow: 'none',
+ },
+ },
+ },
+ MuiCardContent: {
+ styleOverrides: {
+ root: { padding: 20, '&:last-child': { paddingBottom: 20 } },
+ },
+ },
+ MuiCardHeader: {
+ styleOverrides: {
+ root: { padding: '20px 20px 0' },
+ title: { fontSize: '0.875rem', fontWeight: 600 },
+ },
+ },
+ MuiPaper: {
+ defaultProps: { elevation: 0 },
+ styleOverrides: {
+ root: { backgroundImage: 'none' },
+ rounded: { borderRadius: 8 },
+ outlined: { borderColor: GREY.A800 },
+ },
+ },
+ MuiButton: {
+ defaultProps: { disableElevation: true },
+ styleOverrides: {
+ root: { fontWeight: 500, textTransform: 'capitalize', borderRadius: 8 },
+ contained: { '&:hover': { boxShadow: 'none' } },
+ sizeLarge: { padding: '8px 22px' },
+ sizeMedium: { padding: '6px 16px' },
+ sizeSmall: { padding: '4px 10px' },
+ },
+ },
+ MuiIconButton: {
+ styleOverrides: {
+ root: { borderRadius: 8 },
+ sizeSmall: { padding: 4 },
+ },
+ },
+ MuiChip: {
+ styleOverrides: {
+ root: { borderRadius: 4, fontWeight: 500, '&.MuiChip-light': { color: PRIMARY.main, background: PRIMARY.lighter } },
+ },
+ },
+ MuiDrawer: {
+ styleOverrides: {
+ paper: {
+ backgroundColor: GREY[0],
+ borderRight: `1px solid ${GREY.A800}`,
+ backgroundImage: 'none',
+ },
+ },
+ },
+ MuiAppBar: {
+ defaultProps: { elevation: 0, color: 'inherit' },
+ styleOverrides: {
+ root: {
+ borderBottom: `1px solid ${GREY.A800}`,
+ backgroundColor: GREY[0],
+ backgroundImage: 'none',
+ },
+ },
+ },
+ MuiListItemButton: {
+ styleOverrides: {
+ root: {
+ borderRadius: 8,
+ '&.Mui-selected': {
+ backgroundColor: PRIMARY.lighter,
+ color: PRIMARY.main,
+ '&:hover': { backgroundColor: alpha(PRIMARY.lighter, 0.9) },
+ '& .MuiListItemIcon-root': { color: PRIMARY.main },
+ },
+ '&:hover': { backgroundColor: alpha(PRIMARY.main, 0.04) },
+ },
+ },
+ },
+ MuiListItemIcon: {
+ styleOverrides: {
+ root: { minWidth: 36, color: GREY[600] },
+ },
+ },
+ MuiTextField: {
+ styleOverrides: {
+ root: {
+ '& .MuiOutlinedInput-root': {
+ borderRadius: 8,
+ '& fieldset': { borderColor: GREY.A800 },
+ '&:hover fieldset': { borderColor: PRIMARY.light },
+ '&.Mui-focused fieldset': { borderColor: PRIMARY.main },
+ },
+ },
+ },
+ },
+ MuiOutlinedInput: {
+ styleOverrides: {
+ root: { borderRadius: 8 },
+ input: { padding: '10.5px 14px' },
+ notchedOutline: { borderColor: GREY.A800 },
+ },
+ },
+ MuiSelect: {
+ styleOverrides: {
+ select: { padding: '10.5px 14px' },
+ },
+ },
+ MuiDivider: {
+ styleOverrides: {
+ root: { borderColor: GREY.A800 },
+ },
+ },
+ MuiTableHead: {
+ styleOverrides: {
+ root: {
+ background: GREY.A50,
+ '& .MuiTableCell-root': {
+ color: GREY[700],
+ fontWeight: 600,
+ fontSize: '0.75rem',
+ textTransform: 'uppercase',
+ letterSpacing: '0.04em',
+ borderBottom: `1px solid ${GREY.A800}`,
+ padding: '10px 16px',
+ },
+ },
+ },
+ },
+ MuiTableCell: {
+ styleOverrides: {
+ root: {
+ borderBottom: `1px solid ${GREY.A800}`,
+ padding: '12px 16px',
+ fontSize: '0.875rem',
+ },
+ },
+ },
+ MuiTableRow: {
+ styleOverrides: {
+ root: {
+ '&:last-of-type td': { borderBottom: 'none' },
+ '&:hover': { backgroundColor: alpha(PRIMARY.main, 0.03) },
+ },
+ },
+ },
+ MuiTab: {
+ styleOverrides: {
+ root: {
+ textTransform: 'capitalize',
+ minHeight: 46,
+ fontWeight: 500,
+ fontSize: '0.875rem',
+ '&.Mui-selected': { fontWeight: 600, color: PRIMARY.main },
+ },
+ },
+ },
+ MuiTabs: {
+ styleOverrides: {
+ indicator: { height: 2, borderRadius: '2px 2px 0 0' },
+ },
+ },
+ MuiTooltip: {
+ styleOverrides: {
+ tooltip: {
+ backgroundColor: GREY[700],
+ fontSize: '0.75rem',
+ borderRadius: 6,
+ padding: '6px 12px',
+ },
+ arrow: { color: GREY[700] },
+ },
+ },
+ MuiDialog: {
+ styleOverrides: {
+ paper: { borderRadius: 8, boxShadow: '0 20px 60px rgba(0,0,0,0.15)' },
+ },
+ },
+ MuiDialogTitle: {
+ styleOverrides: {
+ root: { padding: '20px 24px', fontSize: '1.125rem', fontWeight: 600 },
+ },
+ },
+ MuiDialogContent: {
+ styleOverrides: {
+ root: { padding: '16px 24px' },
+ },
+ },
+ MuiDialogActions: {
+ styleOverrides: {
+ root: { padding: '12px 20px' },
+ },
+ },
+ MuiLinearProgress: {
+ styleOverrides: {
+ root: { height: 6, borderRadius: 3, backgroundColor: GREY[200] },
+ bar: { borderRadius: 3 },
+ },
+ },
+ MuiAvatar: {
+ styleOverrides: {
+ root: {
+ width: 36,
+ height: 36,
+ fontSize: '0.875rem',
+ background: PRIMARY.lighter,
+ color: PRIMARY.main,
+ },
+ },
+ },
+ MuiBreadcrumbs: {
+ styleOverrides: {
+ separator: { color: GREY[400] },
+ },
+ },
+ MuiAlert: {
+ styleOverrides: {
+ root: { borderRadius: 8 },
+ standardSuccess: { background: SUCCESS.lighter, color: SUCCESS.darker, '& .MuiAlert-icon': { color: SUCCESS.main } },
+ standardWarning: { background: WARNING.lighter, color: WARNING.darker, '& .MuiAlert-icon': { color: WARNING.main } },
+ standardError: { background: ERROR.lighter, color: ERROR.darker, '& .MuiAlert-icon': { color: ERROR.main } },
+ standardInfo: { background: INFO.lighter, color: INFO.darker, '& .MuiAlert-icon': { color: INFO.main } },
+ },
+ },
+ MuiMenuItem: {
+ styleOverrides: {
+ root: { borderRadius: 4, margin: '0 4px', padding: '6px 12px', fontSize: '0.875rem' },
+ },
+ },
+ MuiInputLabel: {
+ styleOverrides: {
+ root: { fontSize: '0.875rem', fontWeight: 500 },
+ },
+ },
+ MuiFormHelperText: {
+ styleOverrides: {
+ root: { marginLeft: 0, fontSize: '0.75rem' },
+ },
+ },
+ MuiBadge: {
+ styleOverrides: {
+ standard: { minWidth: 18, height: 18, fontSize: '0.65rem' },
+ },
+ },
+ },
+});
+
+// Expose custom color tokens for use in components
+theme.palette.primary = { ...theme.palette.primary, ...PRIMARY };
+theme.palette.grey = { ...theme.palette.grey, ...GREY };
+
+export { PRIMARY, SECONDARY, SUCCESS, WARNING, ERROR, INFO, GREY };
+export default theme;
diff --git a/package-lock.json b/package-lock.json
index 334a9fb..be3d513 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -13,624 +13,3605 @@
"cors": "^2.8.5",
"express": "^4.18.2",
"node-fetch": "^2.7.0"
+ },
+ "devDependencies": {
+ "shadcn": "^4.11.0"
}
},
- "node_modules/accepts": {
- "version": "1.3.8",
- "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
- "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
+ "node_modules/@babel/code-frame": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz",
+ "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "mime-types": "~2.1.34",
- "negotiator": "0.6.3"
+ "@babel/helper-validator-identifier": "^7.29.7",
+ "js-tokens": "^4.0.0",
+ "picocolors": "^1.1.1"
},
"engines": {
- "node": ">= 0.6"
+ "node": ">=6.9.0"
}
},
- "node_modules/array-flatten": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
- "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==",
- "license": "MIT"
+ "node_modules/@babel/compat-data": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz",
+ "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
},
- "node_modules/body-parser": {
- "version": "1.20.4",
- "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.4.tgz",
- "integrity": "sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==",
+ "node_modules/@babel/core": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz",
+ "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==",
+ "dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
- "bytes": "~3.1.2",
- "content-type": "~1.0.5",
- "debug": "2.6.9",
- "depd": "2.0.0",
- "destroy": "~1.2.0",
- "http-errors": "~2.0.1",
- "iconv-lite": "~0.4.24",
- "on-finished": "~2.4.1",
- "qs": "~6.14.0",
- "raw-body": "~2.5.3",
- "type-is": "~1.6.18",
- "unpipe": "~1.0.0"
+ "@babel/code-frame": "^7.29.7",
+ "@babel/generator": "^7.29.7",
+ "@babel/helper-compilation-targets": "^7.29.7",
+ "@babel/helper-module-transforms": "^7.29.7",
+ "@babel/helpers": "^7.29.7",
+ "@babel/parser": "^7.29.7",
+ "@babel/template": "^7.29.7",
+ "@babel/traverse": "^7.29.7",
+ "@babel/types": "^7.29.7",
+ "@jridgewell/remapping": "^2.3.5",
+ "convert-source-map": "^2.0.0",
+ "debug": "^4.1.0",
+ "gensync": "^1.0.0-beta.2",
+ "json5": "^2.2.3",
+ "semver": "^6.3.1"
},
"engines": {
- "node": ">= 0.8",
- "npm": "1.2.8000 || >= 1.4.16"
+ "node": ">=6.9.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/babel"
}
},
- "node_modules/bytes": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
- "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
+ "node_modules/@babel/core/node_modules/debug": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+ "dev": true,
"license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
"engines": {
- "node": ">= 0.8"
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
}
},
- "node_modules/call-bind-apply-helpers": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
- "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
+ "node_modules/@babel/core/node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@babel/generator": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz",
+ "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "es-errors": "^1.3.0",
- "function-bind": "^1.1.2"
+ "@babel/parser": "^7.29.7",
+ "@babel/types": "^7.29.7",
+ "@jridgewell/gen-mapping": "^0.3.12",
+ "@jridgewell/trace-mapping": "^0.3.28",
+ "jsesc": "^3.0.2"
},
"engines": {
- "node": ">= 0.4"
+ "node": ">=6.9.0"
}
},
- "node_modules/call-bound": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
- "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
+ "node_modules/@babel/helper-annotate-as-pure": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.29.7.tgz",
+ "integrity": "sha512-OoK6239jHPuSQOoS0kfTVKn0b/rVTk0seKq4Gd2UMLtmOVLjDC0ki3e+c90Trqv2gMfvJFqkiljrr568+qddiw==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "call-bind-apply-helpers": "^1.0.2",
- "get-intrinsic": "^1.3.0"
+ "@babel/types": "^7.29.7"
},
"engines": {
- "node": ">= 0.4"
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-compilation-targets": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz",
+ "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/compat-data": "^7.29.7",
+ "@babel/helper-validator-option": "^7.29.7",
+ "browserslist": "^4.24.0",
+ "lru-cache": "^5.1.1",
+ "semver": "^6.3.1"
},
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
+ "engines": {
+ "node": ">=6.9.0"
}
},
- "node_modules/content-disposition": {
- "version": "0.5.4",
- "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
- "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
+ "node_modules/@babel/helper-create-class-features-plugin": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.29.7.tgz",
+ "integrity": "sha512-IY3ZD9Tmooqr3TUhc3DUWxiuo8xx1DWLhd5M7hQ+ZWJamqM2BbalrBJb2MisSLoYorOj75U03qULCxQTY9r3hg==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "safe-buffer": "5.2.1"
+ "@babel/helper-annotate-as-pure": "^7.29.7",
+ "@babel/helper-member-expression-to-functions": "^7.29.7",
+ "@babel/helper-optimise-call-expression": "^7.29.7",
+ "@babel/helper-replace-supers": "^7.29.7",
+ "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7",
+ "@babel/traverse": "^7.29.7",
+ "semver": "^6.3.1"
},
"engines": {
- "node": ">= 0.6"
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
}
},
- "node_modules/content-type": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
- "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
+ "node_modules/@babel/helper-globals": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz",
+ "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==",
+ "dev": true,
"license": "MIT",
"engines": {
- "node": ">= 0.6"
+ "node": ">=6.9.0"
}
},
- "node_modules/cookie": {
- "version": "0.7.2",
- "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
- "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
+ "node_modules/@babel/helper-member-expression-to-functions": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.29.7.tgz",
+ "integrity": "sha512-j+7JYmk1JYDtACIGj0QJqqWZjoUpMoEikQGADMaHgCMCSDqd2+P32rfcibUNrGOMWrlzK1WJBdxrB3JJQZwWtg==",
+ "dev": true,
"license": "MIT",
+ "dependencies": {
+ "@babel/traverse": "^7.29.7",
+ "@babel/types": "^7.29.7"
+ },
"engines": {
- "node": ">= 0.6"
+ "node": ">=6.9.0"
}
},
- "node_modules/cookie-signature": {
- "version": "1.0.7",
- "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz",
- "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==",
- "license": "MIT"
+ "node_modules/@babel/helper-module-imports": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz",
+ "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/traverse": "^7.29.7",
+ "@babel/types": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
},
- "node_modules/cors": {
- "version": "2.8.6",
- "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz",
- "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==",
+ "node_modules/@babel/helper-module-transforms": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz",
+ "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "object-assign": "^4",
- "vary": "^1"
+ "@babel/helper-module-imports": "^7.29.7",
+ "@babel/helper-validator-identifier": "^7.29.7",
+ "@babel/traverse": "^7.29.7"
},
"engines": {
- "node": ">= 0.10"
+ "node": ">=6.9.0"
},
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/express"
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
}
},
- "node_modules/debug": {
- "version": "2.6.9",
- "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
- "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "node_modules/@babel/helper-optimise-call-expression": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.29.7.tgz",
+ "integrity": "sha512-+kmGVjcT9RGYzoDwdwEqEvGgKe3BYq+O1iGzjFubaNgZHwYHP6lsF2Yghf4kEuv9BV7tYDZ913aBW9am6YKong==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "ms": "2.0.0"
+ "@babel/types": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
}
},
- "node_modules/depd": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
- "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
+ "node_modules/@babel/helper-plugin-utils": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz",
+ "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==",
+ "dev": true,
"license": "MIT",
"engines": {
- "node": ">= 0.8"
+ "node": ">=6.9.0"
}
},
- "node_modules/destroy": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
- "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
+ "node_modules/@babel/helper-replace-supers": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.29.7.tgz",
+ "integrity": "sha512-atfGXWSeCiF4DnKZIfmJfQRkSw9b9gNNXR1kqKjbhG4pGYCOnkp8OcTB8E3NXjBu8NpheSnOeNKz8KT7UNFTmQ==",
+ "dev": true,
"license": "MIT",
+ "dependencies": {
+ "@babel/helper-member-expression-to-functions": "^7.29.7",
+ "@babel/helper-optimise-call-expression": "^7.29.7",
+ "@babel/traverse": "^7.29.7"
+ },
"engines": {
- "node": ">= 0.8",
- "npm": "1.2.8000 || >= 1.4.16"
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
}
},
- "node_modules/dunder-proto": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
- "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
+ "node_modules/@babel/helper-skip-transparent-expression-wrappers": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.29.7.tgz",
+ "integrity": "sha512-brcMGQaVzIeUb+6/bs1Av0f8YuNNjKY2JyvfRCsFuFsdKccEQ5Ges2y74D74NZ1Rz8lKJ9ksJkfqwQFJ/iNEyQ==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "call-bind-apply-helpers": "^1.0.1",
- "es-errors": "^1.3.0",
- "gopd": "^1.2.0"
+ "@babel/traverse": "^7.29.7",
+ "@babel/types": "^7.29.7"
},
"engines": {
- "node": ">= 0.4"
+ "node": ">=6.9.0"
}
},
- "node_modules/ee-first": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
- "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
- "license": "MIT"
- },
- "node_modules/encodeurl": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
- "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
+ "node_modules/@babel/helper-string-parser": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz",
+ "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==",
+ "dev": true,
"license": "MIT",
"engines": {
- "node": ">= 0.8"
+ "node": ">=6.9.0"
}
},
- "node_modules/es-define-property": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
- "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
+ "node_modules/@babel/helper-validator-identifier": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz",
+ "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==",
+ "dev": true,
"license": "MIT",
"engines": {
- "node": ">= 0.4"
+ "node": ">=6.9.0"
}
},
- "node_modules/es-errors": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
- "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
+ "node_modules/@babel/helper-validator-option": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz",
+ "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==",
+ "dev": true,
"license": "MIT",
"engines": {
- "node": ">= 0.4"
+ "node": ">=6.9.0"
}
},
- "node_modules/es-object-atoms": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
- "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
+ "node_modules/@babel/helpers": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz",
+ "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "es-errors": "^1.3.0"
+ "@babel/template": "^7.29.7",
+ "@babel/types": "^7.29.7"
},
"engines": {
- "node": ">= 0.4"
+ "node": ">=6.9.0"
}
},
- "node_modules/escape-html": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
- "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
- "license": "MIT"
- },
- "node_modules/etag": {
- "version": "1.8.1",
- "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
- "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
+ "node_modules/@babel/parser": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz",
+ "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==",
+ "dev": true,
"license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.29.7"
+ },
+ "bin": {
+ "parser": "bin/babel-parser.js"
+ },
"engines": {
- "node": ">= 0.6"
+ "node": ">=6.0.0"
}
},
- "node_modules/express": {
- "version": "4.22.1",
- "resolved": "https://registry.npmjs.org/express/-/express-4.22.1.tgz",
- "integrity": "sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==",
+ "node_modules/@babel/plugin-syntax-jsx": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.29.7.tgz",
+ "integrity": "sha512-TSu8+mHCoEaaCDEZ0I3+6mvTBYR4PCxQwf2z9/r5Tbztv6NaLR3B9thGTTxX2WGuGHJqRiAbKPeGTJ5XWXVg6A==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "accepts": "~1.3.8",
- "array-flatten": "1.1.1",
- "body-parser": "~1.20.3",
- "content-disposition": "~0.5.4",
- "content-type": "~1.0.4",
- "cookie": "~0.7.1",
- "cookie-signature": "~1.0.6",
- "debug": "2.6.9",
- "depd": "2.0.0",
- "encodeurl": "~2.0.0",
- "escape-html": "~1.0.3",
- "etag": "~1.8.1",
- "finalhandler": "~1.3.1",
- "fresh": "~0.5.2",
- "http-errors": "~2.0.0",
- "merge-descriptors": "1.0.3",
- "methods": "~1.1.2",
- "on-finished": "~2.4.1",
- "parseurl": "~1.3.3",
- "path-to-regexp": "~0.1.12",
- "proxy-addr": "~2.0.7",
- "qs": "~6.14.0",
- "range-parser": "~1.2.1",
- "safe-buffer": "5.2.1",
- "send": "~0.19.0",
- "serve-static": "~1.16.2",
- "setprototypeof": "1.2.0",
- "statuses": "~2.0.1",
- "type-is": "~1.6.18",
- "utils-merge": "1.0.1",
- "vary": "~1.1.2"
+ "@babel/helper-plugin-utils": "^7.29.7"
},
"engines": {
- "node": ">= 0.10.0"
+ "node": ">=6.9.0"
},
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/express"
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
}
},
- "node_modules/finalhandler": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz",
- "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==",
+ "node_modules/@babel/plugin-syntax-typescript": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.29.7.tgz",
+ "integrity": "sha512-ngr+82Sh0xMz25TPCZi+nC2iTzjfCdWS2ONXTp/PtSCHCgaCNBpdMqgvJ2ccdLlClVZ7sisIgB914j/JFe+RZA==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "debug": "2.6.9",
- "encodeurl": "~2.0.0",
- "escape-html": "~1.0.3",
- "on-finished": "~2.4.1",
- "parseurl": "~1.3.3",
- "statuses": "~2.0.2",
- "unpipe": "~1.0.0"
+ "@babel/helper-plugin-utils": "^7.29.7"
},
"engines": {
- "node": ">= 0.8"
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
}
},
- "node_modules/forwarded": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
- "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
+ "node_modules/@babel/plugin-transform-modules-commonjs": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.29.7.tgz",
+ "integrity": "sha512-j0vCldybPC5b5dwCQOJ21uKtHzt7hxLygJTg9eF1ScfaikEDNfzn94XoW5Fi+seBR0nCyL23xaBFFkq7dTM8XQ==",
+ "dev": true,
"license": "MIT",
+ "dependencies": {
+ "@babel/helper-module-transforms": "^7.29.7",
+ "@babel/helper-plugin-utils": "^7.29.7"
+ },
"engines": {
- "node": ">= 0.6"
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
}
},
- "node_modules/fresh": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
- "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
+ "node_modules/@babel/plugin-transform-typescript": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.29.7.tgz",
+ "integrity": "sha512-jK52h8LaLc7JarhQV2ofeFMts4H7vnOXnqZNA6fYglBTZewRBE51KWt3BUltW1P+KoPsYkHoJeXePuz4zo2LMw==",
+ "dev": true,
"license": "MIT",
+ "dependencies": {
+ "@babel/helper-annotate-as-pure": "^7.29.7",
+ "@babel/helper-create-class-features-plugin": "^7.29.7",
+ "@babel/helper-plugin-utils": "^7.29.7",
+ "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7",
+ "@babel/plugin-syntax-typescript": "^7.29.7"
+ },
"engines": {
- "node": ">= 0.6"
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
}
},
- "node_modules/function-bind": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
- "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
+ "node_modules/@babel/preset-typescript": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.29.7.tgz",
+ "integrity": "sha512-/Foi8vKY2EVbed/1eZx0gJEEwHAIxogrySI7rULcRIvhZzbvoE/b5qG5Ghc0WKAFKOHA9SD1x7RsFlOYdutIiQ==",
+ "dev": true,
"license": "MIT",
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.29.7",
+ "@babel/helper-validator-option": "^7.29.7",
+ "@babel/plugin-syntax-jsx": "^7.29.7",
+ "@babel/plugin-transform-modules-commonjs": "^7.29.7",
+ "@babel/plugin-transform-typescript": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
}
},
- "node_modules/get-intrinsic": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
- "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
+ "node_modules/@babel/template": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz",
+ "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "call-bind-apply-helpers": "^1.0.2",
- "es-define-property": "^1.0.1",
- "es-errors": "^1.3.0",
- "es-object-atoms": "^1.1.1",
- "function-bind": "^1.1.2",
- "get-proto": "^1.0.1",
- "gopd": "^1.2.0",
- "has-symbols": "^1.1.0",
- "hasown": "^2.0.2",
- "math-intrinsics": "^1.1.0"
+ "@babel/code-frame": "^7.29.7",
+ "@babel/parser": "^7.29.7",
+ "@babel/types": "^7.29.7"
},
"engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
+ "node": ">=6.9.0"
}
},
- "node_modules/get-proto": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
- "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
+ "node_modules/@babel/traverse": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz",
+ "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "dunder-proto": "^1.0.1",
- "es-object-atoms": "^1.0.0"
+ "@babel/code-frame": "^7.29.7",
+ "@babel/generator": "^7.29.7",
+ "@babel/helper-globals": "^7.29.7",
+ "@babel/parser": "^7.29.7",
+ "@babel/template": "^7.29.7",
+ "@babel/types": "^7.29.7",
+ "debug": "^4.3.1"
},
"engines": {
- "node": ">= 0.4"
+ "node": ">=6.9.0"
}
},
- "node_modules/gopd": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
- "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
+ "node_modules/@babel/traverse/node_modules/debug": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+ "dev": true,
"license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
"engines": {
- "node": ">= 0.4"
+ "node": ">=6.0"
},
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
}
},
- "node_modules/has-symbols": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
- "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
+ "node_modules/@babel/traverse/node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@babel/types": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz",
+ "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==",
+ "dev": true,
"license": "MIT",
+ "dependencies": {
+ "@babel/helper-string-parser": "^7.29.7",
+ "@babel/helper-validator-identifier": "^7.29.7"
+ },
"engines": {
- "node": ">= 0.4"
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx": {
+ "version": "1.71.2",
+ "resolved": "https://registry.npmjs.org/@dotenvx/dotenvx/-/dotenvx-1.71.2.tgz",
+ "integrity": "sha512-Xj9T3Wr+Bo4ILKf9PZJBYJ4SJiZGC/pqIdzOMbX9jgAFb0oGuKkusLleYHN/N6zanZixNvmuMVWYR1T3YJuVTA==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "commander": "^11.1.0",
+ "dotenv": "^17.2.1",
+ "eciesjs": "^0.4.10",
+ "enquirer": "^2.4.1",
+ "execa": "^5.1.1",
+ "fdir": "^6.2.0",
+ "ignore": "^5.3.0",
+ "object-treeify": "1.1.33",
+ "picomatch": "^4.0.4",
+ "which": "^4.0.0",
+ "yocto-spinner": "^1.1.0"
+ },
+ "bin": {
+ "dotenvx": "src/cli/dotenvx.js"
},
"funding": {
- "url": "https://github.com/sponsors/ljharb"
+ "url": "https://dotenvx.com"
}
},
- "node_modules/hasown": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
- "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
+ "node_modules/@dotenvx/dotenvx/node_modules/commander": {
+ "version": "11.1.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz",
+ "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==",
+ "dev": true,
"license": "MIT",
- "dependencies": {
- "function-bind": "^1.1.2"
- },
"engines": {
- "node": ">= 0.4"
+ "node": ">=16"
}
},
- "node_modules/http-errors": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
- "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
+ "node_modules/@dotenvx/dotenvx/node_modules/execa": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",
+ "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "depd": "~2.0.0",
- "inherits": "~2.0.4",
- "setprototypeof": "~1.2.0",
- "statuses": "~2.0.2",
- "toidentifier": "~1.0.1"
+ "cross-spawn": "^7.0.3",
+ "get-stream": "^6.0.0",
+ "human-signals": "^2.1.0",
+ "is-stream": "^2.0.0",
+ "merge-stream": "^2.0.0",
+ "npm-run-path": "^4.0.1",
+ "onetime": "^5.1.2",
+ "signal-exit": "^3.0.3",
+ "strip-final-newline": "^2.0.0"
},
"engines": {
- "node": ">= 0.8"
+ "node": ">=10"
},
"funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/express"
+ "url": "https://github.com/sindresorhus/execa?sponsor=1"
}
},
- "node_modules/iconv-lite": {
- "version": "0.4.24",
- "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
- "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "node_modules/@dotenvx/dotenvx/node_modules/get-stream": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
+ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
+ "dev": true,
"license": "MIT",
- "dependencies": {
- "safer-buffer": ">= 2.1.2 < 3"
- },
"engines": {
- "node": ">=0.10.0"
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/inherits": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
- "license": "ISC"
- },
- "node_modules/ipaddr.js": {
- "version": "1.9.1",
- "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
- "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
- "license": "MIT",
+ "node_modules/@dotenvx/dotenvx/node_modules/human-signals": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
+ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",
+ "dev": true,
+ "license": "Apache-2.0",
"engines": {
- "node": ">= 0.10"
+ "node": ">=10.17.0"
}
},
- "node_modules/math-intrinsics": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
- "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
+ "node_modules/@dotenvx/dotenvx/node_modules/is-stream": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
+ "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
+ "dev": true,
"license": "MIT",
"engines": {
- "node": ">= 0.4"
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/media-typer": {
- "version": "0.3.0",
- "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
- "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
+ "node_modules/@dotenvx/dotenvx/node_modules/npm-run-path": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
+ "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
+ "dev": true,
"license": "MIT",
+ "dependencies": {
+ "path-key": "^3.0.0"
+ },
"engines": {
- "node": ">= 0.6"
+ "node": ">=8"
}
},
- "node_modules/merge-descriptors": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
- "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
+ "node_modules/@dotenvx/dotenvx/node_modules/onetime": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
+ "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
+ "dev": true,
"license": "MIT",
+ "dependencies": {
+ "mimic-fn": "^2.1.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/methods": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
- "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
+ "node_modules/@dotenvx/dotenvx/node_modules/signal-exit": {
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
+ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/strip-final-newline": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
+ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
+ "dev": true,
"license": "MIT",
"engines": {
- "node": ">= 0.6"
+ "node": ">=6"
}
},
- "node_modules/mime": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
- "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
+ "node_modules/@ecies/ciphers": {
+ "version": "0.2.6",
+ "resolved": "https://registry.npmjs.org/@ecies/ciphers/-/ciphers-0.2.6.tgz",
+ "integrity": "sha512-patgsRPKGkhhoBjETV4XxD0En4ui5fbX0hzayqI3M8tvNMGUoUvmyYAIWwlxBc1KX5cturfqByYdj5bYGRpN9g==",
+ "dev": true,
"license": "MIT",
- "bin": {
- "mime": "cli.js"
- },
"engines": {
- "node": ">=4"
+ "bun": ">=1",
+ "deno": ">=2.7.10",
+ "node": ">=16"
+ },
+ "peerDependencies": {
+ "@noble/ciphers": "^1.0.0"
}
},
- "node_modules/mime-db": {
- "version": "1.52.0",
- "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
- "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+ "node_modules/@hono/node-server": {
+ "version": "1.19.14",
+ "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.14.tgz",
+ "integrity": "sha512-GwtvgtXxnWsucXvbQXkRgqksiH2Qed37H9xHZocE5sA3N8O8O8/8FA3uclQXxXVzc9XBZuEOMK7+r02FmSpHtw==",
+ "dev": true,
"license": "MIT",
"engines": {
- "node": ">= 0.6"
+ "node": ">=18.14.1"
+ },
+ "peerDependencies": {
+ "hono": "^4"
}
},
- "node_modules/mime-types": {
- "version": "2.1.35",
- "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
- "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "node_modules/@jridgewell/gen-mapping": {
+ "version": "0.3.13",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
+ "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "mime-db": "1.52.0"
- },
+ "@jridgewell/sourcemap-codec": "^1.5.0",
+ "@jridgewell/trace-mapping": "^0.3.24"
+ }
+ },
+ "node_modules/@jridgewell/remapping": {
+ "version": "2.3.5",
+ "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz",
+ "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/gen-mapping": "^0.3.5",
+ "@jridgewell/trace-mapping": "^0.3.24"
+ }
+ },
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+ "dev": true,
+ "license": "MIT",
"engines": {
- "node": ">= 0.6"
+ "node": ">=6.0.0"
}
},
- "node_modules/ms": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
- "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.5.5",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
+ "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
+ "dev": true,
"license": "MIT"
},
- "node_modules/negotiator": {
- "version": "0.6.3",
- "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
- "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.31",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
+ "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
+ "dev": true,
"license": "MIT",
- "engines": {
- "node": ">= 0.6"
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
}
},
- "node_modules/node-fetch": {
- "version": "2.7.0",
- "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
- "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
+ "node_modules/@modelcontextprotocol/sdk": {
+ "version": "1.29.0",
+ "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.29.0.tgz",
+ "integrity": "sha512-zo37mZA9hJWpULgkRpowewez1y6ML5GsXJPY8FI0tBBCd77HEvza4jDqRKOXgHNn867PVGCyTdzqpz0izu5ZjQ==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "whatwg-url": "^5.0.0"
+ "@hono/node-server": "^1.19.9",
+ "ajv": "^8.17.1",
+ "ajv-formats": "^3.0.1",
+ "content-type": "^1.0.5",
+ "cors": "^2.8.5",
+ "cross-spawn": "^7.0.5",
+ "eventsource": "^3.0.2",
+ "eventsource-parser": "^3.0.0",
+ "express": "^5.2.1",
+ "express-rate-limit": "^8.2.1",
+ "hono": "^4.11.4",
+ "jose": "^6.1.3",
+ "json-schema-typed": "^8.0.2",
+ "pkce-challenge": "^5.0.0",
+ "raw-body": "^3.0.0",
+ "zod": "^3.25 || ^4.0",
+ "zod-to-json-schema": "^3.25.1"
},
"engines": {
- "node": "4.x || >=6.0.0"
+ "node": ">=18"
},
"peerDependencies": {
- "encoding": "^0.1.0"
+ "@cfworker/json-schema": "^4.1.1",
+ "zod": "^3.25 || ^4.0"
},
"peerDependenciesMeta": {
- "encoding": {
+ "@cfworker/json-schema": {
"optional": true
+ },
+ "zod": {
+ "optional": false
}
}
},
- "node_modules/object-assign": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
- "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
+ "node_modules/@modelcontextprotocol/sdk/node_modules/accepts": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",
+ "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==",
+ "dev": true,
"license": "MIT",
+ "dependencies": {
+ "mime-types": "^3.0.0",
+ "negotiator": "^1.0.0"
+ },
"engines": {
- "node": ">=0.10.0"
+ "node": ">= 0.6"
}
},
- "node_modules/object-inspect": {
- "version": "1.13.4",
- "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
- "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
+ "node_modules/@modelcontextprotocol/sdk/node_modules/body-parser": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz",
+ "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==",
+ "dev": true,
"license": "MIT",
+ "dependencies": {
+ "bytes": "^3.1.2",
+ "content-type": "^1.0.5",
+ "debug": "^4.4.3",
+ "http-errors": "^2.0.0",
+ "iconv-lite": "^0.7.0",
+ "on-finished": "^2.4.1",
+ "qs": "^6.14.1",
+ "raw-body": "^3.0.1",
+ "type-is": "^2.0.1"
+ },
"engines": {
- "node": ">= 0.4"
+ "node": ">=18"
},
"funding": {
- "url": "https://github.com/sponsors/ljharb"
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
}
},
- "node_modules/on-finished": {
- "version": "2.4.1",
- "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
- "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
+ "node_modules/@modelcontextprotocol/sdk/node_modules/content-disposition": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.1.0.tgz",
+ "integrity": "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g==",
+ "dev": true,
"license": "MIT",
- "dependencies": {
- "ee-first": "1.1.1"
- },
"engines": {
- "node": ">= 0.8"
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
}
},
- "node_modules/parseurl": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
- "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
+ "node_modules/@modelcontextprotocol/sdk/node_modules/cookie-signature": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz",
+ "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==",
+ "dev": true,
"license": "MIT",
"engines": {
- "node": ">= 0.8"
+ "node": ">=6.6.0"
}
},
- "node_modules/path-to-regexp": {
- "version": "0.1.12",
- "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
- "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==",
- "license": "MIT"
- },
- "node_modules/proxy-addr": {
- "version": "2.0.7",
- "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
- "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
+ "node_modules/@modelcontextprotocol/sdk/node_modules/debug": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "forwarded": "0.2.0",
- "ipaddr.js": "1.9.1"
+ "ms": "^2.1.3"
},
"engines": {
- "node": ">= 0.10"
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
}
},
- "node_modules/qs": {
- "version": "6.14.1",
- "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz",
- "integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==",
+ "node_modules/@modelcontextprotocol/sdk/node_modules/express": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",
+ "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "accepts": "^2.0.0",
+ "body-parser": "^2.2.1",
+ "content-disposition": "^1.0.0",
+ "content-type": "^1.0.5",
+ "cookie": "^0.7.1",
+ "cookie-signature": "^1.2.1",
+ "debug": "^4.4.0",
+ "depd": "^2.0.0",
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "etag": "^1.8.1",
+ "finalhandler": "^2.1.0",
+ "fresh": "^2.0.0",
+ "http-errors": "^2.0.0",
+ "merge-descriptors": "^2.0.0",
+ "mime-types": "^3.0.0",
+ "on-finished": "^2.4.1",
+ "once": "^1.4.0",
+ "parseurl": "^1.3.3",
+ "proxy-addr": "^2.0.7",
+ "qs": "^6.14.0",
+ "range-parser": "^1.2.1",
+ "router": "^2.2.0",
+ "send": "^1.1.0",
+ "serve-static": "^2.2.0",
+ "statuses": "^2.0.1",
+ "type-is": "^2.0.1",
+ "vary": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/@modelcontextprotocol/sdk/node_modules/finalhandler": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz",
+ "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "debug": "^4.4.0",
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "on-finished": "^2.4.1",
+ "parseurl": "^1.3.3",
+ "statuses": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 18.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/@modelcontextprotocol/sdk/node_modules/fresh": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz",
+ "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite": {
+ "version": "0.7.2",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz",
+ "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/@modelcontextprotocol/sdk/node_modules/media-typer": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz",
+ "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/@modelcontextprotocol/sdk/node_modules/merge-descriptors": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz",
+ "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@modelcontextprotocol/sdk/node_modules/mime-db": {
+ "version": "1.54.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",
+ "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/@modelcontextprotocol/sdk/node_modules/mime-types": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz",
+ "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "mime-db": "^1.54.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/@modelcontextprotocol/sdk/node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@modelcontextprotocol/sdk/node_modules/negotiator": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz",
+ "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/@modelcontextprotocol/sdk/node_modules/raw-body": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz",
+ "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "bytes": "~3.1.2",
+ "http-errors": "~2.0.1",
+ "iconv-lite": "~0.7.0",
+ "unpipe": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/@modelcontextprotocol/sdk/node_modules/send": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz",
+ "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "debug": "^4.4.3",
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "etag": "^1.8.1",
+ "fresh": "^2.0.0",
+ "http-errors": "^2.0.1",
+ "mime-types": "^3.0.2",
+ "ms": "^2.1.3",
+ "on-finished": "^2.4.1",
+ "range-parser": "^1.2.1",
+ "statuses": "^2.0.2"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/@modelcontextprotocol/sdk/node_modules/serve-static": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz",
+ "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "parseurl": "^1.3.3",
+ "send": "^1.2.0"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/@modelcontextprotocol/sdk/node_modules/type-is": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz",
+ "integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "content-type": "^2.0.0",
+ "media-typer": "^1.1.0",
+ "mime-types": "^3.0.0"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/@modelcontextprotocol/sdk/node_modules/type-is/node_modules/content-type": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz",
+ "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/@noble/ciphers": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz",
+ "integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@noble/curves": {
+ "version": "1.9.7",
+ "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz",
+ "integrity": "sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@noble/hashes": "1.8.0"
+ },
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@noble/hashes": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",
+ "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@nodelib/fs.scandir": {
+ "version": "2.1.5",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
+ "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@nodelib/fs.stat": "2.0.5",
+ "run-parallel": "^1.1.9"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@nodelib/fs.stat": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
+ "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@nodelib/fs.walk": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
+ "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@nodelib/fs.scandir": "2.1.5",
+ "fastq": "^1.6.0"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@sec-ant/readable-stream": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz",
+ "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@sindresorhus/merge-streams": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz",
+ "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@ts-morph/common": {
+ "version": "0.27.0",
+ "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.27.0.tgz",
+ "integrity": "sha512-Wf29UqxWDpc+i61k3oIOzcUfQt79PIT9y/MWfAGlrkjg6lBC1hwDECLXPVJAhWjiGbfBCxZd65F/LIZF3+jeJQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fast-glob": "^3.3.3",
+ "minimatch": "^10.0.1",
+ "path-browserify": "^1.0.1"
+ }
+ },
+ "node_modules/@types/validate-npm-package-name": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/@types/validate-npm-package-name/-/validate-npm-package-name-4.0.2.tgz",
+ "integrity": "sha512-lrpDziQipxCEeK5kWxvljWYhUvOiB2A9izZd9B2AFarYAkqZshb4lPbRs7zKEic6eGtH8V/2qJW+dPp9OtF6bw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/accepts": {
+ "version": "1.3.8",
+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
+ "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
+ "license": "MIT",
+ "dependencies": {
+ "mime-types": "~2.1.34",
+ "negotiator": "0.6.3"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/agent-base": {
+ "version": "7.1.4",
+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",
+ "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 14"
+ }
+ },
+ "node_modules/ajv": {
+ "version": "8.20.0",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz",
+ "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fast-deep-equal": "^3.1.3",
+ "fast-uri": "^3.0.1",
+ "json-schema-traverse": "^1.0.0",
+ "require-from-string": "^2.0.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
+ }
+ },
+ "node_modules/ajv-formats": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz",
+ "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ajv": "^8.0.0"
+ },
+ "peerDependencies": {
+ "ajv": "^8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "ajv": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/ansi-colors": {
+ "version": "4.1.3",
+ "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz",
+ "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/argparse": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
+ "dev": true,
+ "license": "Python-2.0"
+ },
+ "node_modules/array-flatten": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
+ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==",
+ "license": "MIT"
+ },
+ "node_modules/ast-types": {
+ "version": "0.16.1",
+ "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.16.1.tgz",
+ "integrity": "sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "tslib": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/balanced-match": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
+ "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "18 || 20 || >=22"
+ }
+ },
+ "node_modules/baseline-browser-mapping": {
+ "version": "2.10.35",
+ "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.35.tgz",
+ "integrity": "sha512-honAfLBde0HAFLdNyBEfuuENkF6zR+ozxqxa/2zJKHBe1qzLqyTSeRKpdPEHAP03rlDGyQOPnCSxnVpVqQo9Mg==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "baseline-browser-mapping": "dist/cli.cjs"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/body-parser": {
+ "version": "1.20.4",
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.4.tgz",
+ "integrity": "sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==",
+ "license": "MIT",
+ "dependencies": {
+ "bytes": "~3.1.2",
+ "content-type": "~1.0.5",
+ "debug": "2.6.9",
+ "depd": "2.0.0",
+ "destroy": "~1.2.0",
+ "http-errors": "~2.0.1",
+ "iconv-lite": "~0.4.24",
+ "on-finished": "~2.4.1",
+ "qs": "~6.14.0",
+ "raw-body": "~2.5.3",
+ "type-is": "~1.6.18",
+ "unpipe": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8",
+ "npm": "1.2.8000 || >= 1.4.16"
+ }
+ },
+ "node_modules/brace-expansion": {
+ "version": "5.0.6",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz",
+ "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "balanced-match": "^4.0.2"
+ },
+ "engines": {
+ "node": "18 || 20 || >=22"
+ }
+ },
+ "node_modules/braces": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
+ "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fill-range": "^7.1.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/browserslist": {
+ "version": "4.28.2",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz",
+ "integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/browserslist"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "baseline-browser-mapping": "^2.10.12",
+ "caniuse-lite": "^1.0.30001782",
+ "electron-to-chromium": "^1.5.328",
+ "node-releases": "^2.0.36",
+ "update-browserslist-db": "^1.2.3"
+ },
+ "bin": {
+ "browserslist": "cli.js"
+ },
+ "engines": {
+ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
+ }
+ },
+ "node_modules/bundle-name": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz",
+ "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "run-applescript": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/bytes": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
+ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/call-bind-apply-helpers": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
+ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/call-bound": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
+ "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "get-intrinsic": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/callsites": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
+ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/caniuse-lite": {
+ "version": "1.0.30001797",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001797.tgz",
+ "integrity": "sha512-l8xKG+gwAIExZGl9FrF7KUwuOmk6wbEPC9Xoy/RtnWv1XG0Q4LFlagaLpUv3Kiza3W/wm27zy0yWJEieYKAP6w==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/caniuse-lite"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "CC-BY-4.0"
+ },
+ "node_modules/chalk": {
+ "version": "5.6.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz",
+ "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^12.17.0 || ^14.13 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/cli-cursor": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz",
+ "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "restore-cursor": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/cli-spinners": {
+ "version": "2.9.2",
+ "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz",
+ "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/code-block-writer": {
+ "version": "13.0.3",
+ "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz",
+ "integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/commander": {
+ "version": "14.0.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz",
+ "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/content-disposition": {
+ "version": "0.5.4",
+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
+ "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
+ "license": "MIT",
+ "dependencies": {
+ "safe-buffer": "5.2.1"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/content-type": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
+ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/convert-source-map": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
+ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/cookie": {
+ "version": "0.7.2",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
+ "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/cookie-signature": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz",
+ "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==",
+ "license": "MIT"
+ },
+ "node_modules/cors": {
+ "version": "2.8.6",
+ "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz",
+ "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==",
+ "license": "MIT",
+ "dependencies": {
+ "object-assign": "^4",
+ "vary": "^1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/cosmiconfig": {
+ "version": "9.0.2",
+ "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.2.tgz",
+ "integrity": "sha512-gtTZxTDau1wL7Y7zifc2dd8jHSK/k6BTx/2Xp/BpdlAdnlYWFVt7qhJqgwi7637yRwRQ3qL4ZidbB4I8tA5VOg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "env-paths": "^2.2.1",
+ "import-fresh": "^3.3.0",
+ "js-yaml": "^4.1.0",
+ "parse-json": "^5.2.0"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/d-fischer"
+ },
+ "peerDependencies": {
+ "typescript": ">=4.9.5"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/cross-spawn": {
+ "version": "7.0.6",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "path-key": "^3.1.0",
+ "shebang-command": "^2.0.0",
+ "which": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/cross-spawn/node_modules/isexe": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/cross-spawn/node_modules/which": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "node-which": "bin/node-which"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/cssesc": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
+ "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "cssesc": "bin/cssesc"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/data-uri-to-buffer": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
+ "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 12"
+ }
+ },
+ "node_modules/debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "license": "MIT",
+ "dependencies": {
+ "ms": "2.0.0"
+ }
+ },
+ "node_modules/dedent": {
+ "version": "1.7.2",
+ "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.2.tgz",
+ "integrity": "sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA==",
+ "dev": true,
+ "license": "MIT",
+ "peerDependencies": {
+ "babel-plugin-macros": "^3.1.0"
+ },
+ "peerDependenciesMeta": {
+ "babel-plugin-macros": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/deepmerge": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
+ "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/default-browser": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.5.0.tgz",
+ "integrity": "sha512-H9LMLr5zwIbSxrmvikGuI/5KGhZ8E2zH3stkMgM5LpOWDutGM2JZaj460Udnf1a+946zc7YBgrqEWwbk7zHvGw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "bundle-name": "^4.1.0",
+ "default-browser-id": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/default-browser-id": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.1.tgz",
+ "integrity": "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/define-lazy-prop": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz",
+ "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/depd": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
+ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/destroy": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
+ "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8",
+ "npm": "1.2.8000 || >= 1.4.16"
+ }
+ },
+ "node_modules/diff": {
+ "version": "8.0.4",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.4.tgz",
+ "integrity": "sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.3.1"
+ }
+ },
+ "node_modules/dotenv": {
+ "version": "17.4.2",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.2.tgz",
+ "integrity": "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://dotenvx.com"
+ }
+ },
+ "node_modules/dunder-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
+ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "gopd": "^1.2.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/eciesjs": {
+ "version": "0.4.18",
+ "resolved": "https://registry.npmjs.org/eciesjs/-/eciesjs-0.4.18.tgz",
+ "integrity": "sha512-wG99Zcfcys9fZux7Cft8BAX/YrOJLJSZ3jyYPfhZHqN2E+Ffx+QXBDsv3gubEgPtV6dTzJMSQUwk1H98/t/0wQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@ecies/ciphers": "^0.2.5",
+ "@noble/ciphers": "^1.3.0",
+ "@noble/curves": "^1.9.7",
+ "@noble/hashes": "^1.8.0"
+ },
+ "engines": {
+ "bun": ">=1",
+ "deno": ">=2",
+ "node": ">=16"
+ }
+ },
+ "node_modules/ee-first": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
+ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
+ "license": "MIT"
+ },
+ "node_modules/electron-to-chromium": {
+ "version": "1.5.371",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.371.tgz",
+ "integrity": "sha512-e9htk9mAYL6AzmkEhSvVVw7IWGSBJ/Bqdn2eRyRLrj1g6sncN4WbFt5qnILYoCktktr45pyjIrOiRvBThQ808w==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/emoji-regex": {
+ "version": "10.6.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz",
+ "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/encodeurl": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
+ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/enquirer": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz",
+ "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-colors": "^4.1.1",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8.6"
+ }
+ },
+ "node_modules/env-paths": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",
+ "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/error-ex": {
+ "version": "1.3.4",
+ "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz",
+ "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-arrayish": "^0.2.1"
+ }
+ },
+ "node_modules/es-define-property": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
+ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-errors": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-object-atoms": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
+ "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/escalade": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
+ "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/escape-html": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
+ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
+ "license": "MIT"
+ },
+ "node_modules/esprima": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
+ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "bin": {
+ "esparse": "bin/esparse.js",
+ "esvalidate": "bin/esvalidate.js"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/etag": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
+ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/eventsource": {
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz",
+ "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "eventsource-parser": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=18.0.0"
+ }
+ },
+ "node_modules/eventsource-parser": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.1.0.tgz",
+ "integrity": "sha512-kJezFj9YFAMLeORyi7aCLxLbD5/qWMQnoMVlVPyHIll7lgRJCc3JVln9Vgl9nwQi0YkMnhdGTMNn7CkRRAptMg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.0.0"
+ }
+ },
+ "node_modules/execa": {
+ "version": "9.6.1",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-9.6.1.tgz",
+ "integrity": "sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@sindresorhus/merge-streams": "^4.0.0",
+ "cross-spawn": "^7.0.6",
+ "figures": "^6.1.0",
+ "get-stream": "^9.0.0",
+ "human-signals": "^8.0.1",
+ "is-plain-obj": "^4.1.0",
+ "is-stream": "^4.0.1",
+ "npm-run-path": "^6.0.0",
+ "pretty-ms": "^9.2.0",
+ "signal-exit": "^4.1.0",
+ "strip-final-newline": "^4.0.0",
+ "yoctocolors": "^2.1.1"
+ },
+ "engines": {
+ "node": "^18.19.0 || >=20.5.0"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/execa?sponsor=1"
+ }
+ },
+ "node_modules/express": {
+ "version": "4.22.1",
+ "resolved": "https://registry.npmjs.org/express/-/express-4.22.1.tgz",
+ "integrity": "sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==",
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "accepts": "~1.3.8",
+ "array-flatten": "1.1.1",
+ "body-parser": "~1.20.3",
+ "content-disposition": "~0.5.4",
+ "content-type": "~1.0.4",
+ "cookie": "~0.7.1",
+ "cookie-signature": "~1.0.6",
+ "debug": "2.6.9",
+ "depd": "2.0.0",
+ "encodeurl": "~2.0.0",
+ "escape-html": "~1.0.3",
+ "etag": "~1.8.1",
+ "finalhandler": "~1.3.1",
+ "fresh": "~0.5.2",
+ "http-errors": "~2.0.0",
+ "merge-descriptors": "1.0.3",
+ "methods": "~1.1.2",
+ "on-finished": "~2.4.1",
+ "parseurl": "~1.3.3",
+ "path-to-regexp": "~0.1.12",
+ "proxy-addr": "~2.0.7",
+ "qs": "~6.14.0",
+ "range-parser": "~1.2.1",
+ "safe-buffer": "5.2.1",
+ "send": "~0.19.0",
+ "serve-static": "~1.16.2",
+ "setprototypeof": "1.2.0",
+ "statuses": "~2.0.1",
+ "type-is": "~1.6.18",
+ "utils-merge": "1.0.1",
+ "vary": "~1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.10.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/express-rate-limit": {
+ "version": "8.5.2",
+ "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.5.2.tgz",
+ "integrity": "sha512-5Kb34ipNX694DH48vN9irak1Qx30nb0PLYHXfJgw4YEjiC3ZEmZJhwOp+VfiCYwFzvFTdB9QkArYS5kXa2cx2A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ip-address": "^10.2.0"
+ },
+ "engines": {
+ "node": ">= 16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/express-rate-limit"
+ },
+ "peerDependencies": {
+ "express": ">= 4.11"
+ }
+ },
+ "node_modules/fast-deep-equal": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/fast-glob": {
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
+ "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@nodelib/fs.stat": "^2.0.2",
+ "@nodelib/fs.walk": "^1.2.3",
+ "glob-parent": "^5.1.2",
+ "merge2": "^1.3.0",
+ "micromatch": "^4.0.8"
+ },
+ "engines": {
+ "node": ">=8.6.0"
+ }
+ },
+ "node_modules/fast-uri": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.2.tgz",
+ "integrity": "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/fastify"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/fastify"
+ }
+ ],
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/fastq": {
+ "version": "1.20.1",
+ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz",
+ "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "reusify": "^1.0.4"
+ }
+ },
+ "node_modules/fdir": {
+ "version": "6.5.0",
+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "peerDependencies": {
+ "picomatch": "^3 || ^4"
+ },
+ "peerDependenciesMeta": {
+ "picomatch": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/fetch-blob": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
+ "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/jimmywarting"
+ },
+ {
+ "type": "paypal",
+ "url": "https://paypal.me/jimmywarting"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "node-domexception": "^1.0.0",
+ "web-streams-polyfill": "^3.0.3"
+ },
+ "engines": {
+ "node": "^12.20 || >= 14.13"
+ }
+ },
+ "node_modules/figures": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz",
+ "integrity": "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-unicode-supported": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/fill-range": {
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
+ "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "to-regex-range": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/finalhandler": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz",
+ "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==",
+ "license": "MIT",
+ "dependencies": {
+ "debug": "2.6.9",
+ "encodeurl": "~2.0.0",
+ "escape-html": "~1.0.3",
+ "on-finished": "~2.4.1",
+ "parseurl": "~1.3.3",
+ "statuses": "~2.0.2",
+ "unpipe": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/formdata-polyfill": {
+ "version": "4.0.10",
+ "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
+ "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fetch-blob": "^3.1.2"
+ },
+ "engines": {
+ "node": ">=12.20.0"
+ }
+ },
+ "node_modules/forwarded": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
+ "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/fresh": {
+ "version": "0.5.2",
+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
+ "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/fs-extra": {
+ "version": "11.3.5",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.5.tgz",
+ "integrity": "sha512-eKpRKAovdpZtR1WopLHxlBWvAgPny3c4gX1G5Jhwmmw4XJj0ifSD5qB5TOo8hmA0wlRKDAOAhEE1yVPgs6Fgcg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "graceful-fs": "^4.2.0",
+ "jsonfile": "^6.0.1",
+ "universalify": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=14.14"
+ }
+ },
+ "node_modules/function-bind": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/fuzzysort": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/fuzzysort/-/fuzzysort-3.1.0.tgz",
+ "integrity": "sha512-sR9BNCjBg6LNgwvxlBd0sBABvQitkLzoVY9MYYROQVX/FvfJ4Mai9LsGhDgd8qYdds0bY77VzYd5iuB+v5rwQQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/gensync": {
+ "version": "1.0.0-beta.2",
+ "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
+ "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/get-east-asian-width": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz",
+ "integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/get-intrinsic": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
+ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "es-define-property": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "es-object-atoms": "^1.1.1",
+ "function-bind": "^1.1.2",
+ "get-proto": "^1.0.1",
+ "gopd": "^1.2.0",
+ "has-symbols": "^1.1.0",
+ "hasown": "^2.0.2",
+ "math-intrinsics": "^1.1.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/get-own-enumerable-keys": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/get-own-enumerable-keys/-/get-own-enumerable-keys-1.0.0.tgz",
+ "integrity": "sha512-PKsK2FSrQCyxcGHsGrLDcK0lx+0Ke+6e8KFFozA9/fIQLhQzPaRvJFdcz7+Axg3jUH/Mq+NI4xa5u/UT2tQskA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/get-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
+ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
+ "license": "MIT",
+ "dependencies": {
+ "dunder-proto": "^1.0.1",
+ "es-object-atoms": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/get-stream": {
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz",
+ "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@sec-ant/readable-stream": "^0.4.1",
+ "is-stream": "^4.0.1"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/glob-parent": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
+ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "is-glob": "^4.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/gopd": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/graceful-fs": {
+ "version": "4.2.11",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
+ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/has-symbols": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
+ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/hasown": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
+ "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
+ "license": "MIT",
+ "dependencies": {
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/hono": {
+ "version": "4.12.25",
+ "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.25.tgz",
+ "integrity": "sha512-2NFaIyNVgJmBs/ecmtGzlmluTFs5cHEWGTdu0t1HBwYzoGXOL5nUQBRMXsXWla5i4KkG//QMzVP88m1+I3fdAQ==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "engines": {
+ "node": ">=16.9.0"
+ }
+ },
+ "node_modules/http-errors": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
+ "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
+ "license": "MIT",
+ "dependencies": {
+ "depd": "~2.0.0",
+ "inherits": "~2.0.4",
+ "setprototypeof": "~1.2.0",
+ "statuses": "~2.0.2",
+ "toidentifier": "~1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/https-proxy-agent": {
+ "version": "7.0.6",
+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",
+ "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "agent-base": "^7.1.2",
+ "debug": "4"
+ },
+ "engines": {
+ "node": ">= 14"
+ }
+ },
+ "node_modules/https-proxy-agent/node_modules/debug": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/https-proxy-agent/node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/human-signals": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-8.0.1.tgz",
+ "integrity": "sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18.18.0"
+ }
+ },
+ "node_modules/iconv-lite": {
+ "version": "0.4.24",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
+ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "license": "MIT",
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/ignore": {
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
+ "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/import-fresh": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz",
+ "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "parent-module": "^1.0.0",
+ "resolve-from": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+ "license": "ISC"
+ },
+ "node_modules/ip-address": {
+ "version": "10.2.0",
+ "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.2.0.tgz",
+ "integrity": "sha512-/+S6j4E9AHvW9SWMSEY9Xfy66O5PWvVEJ08O0y5JGyEKQpojb0K0GKpz/v5HJ/G0vi3D2sjGK78119oXZeE0qA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 12"
+ }
+ },
+ "node_modules/ipaddr.js": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
+ "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/is-arrayish": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
+ "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/is-docker": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz",
+ "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "is-docker": "cli.js"
+ },
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-glob": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
+ "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-extglob": "^2.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-in-ssh": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-in-ssh/-/is-in-ssh-1.0.0.tgz",
+ "integrity": "sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-inside-container": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz",
+ "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-docker": "^3.0.0"
+ },
+ "bin": {
+ "is-inside-container": "cli.js"
+ },
+ "engines": {
+ "node": ">=14.16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-interactive": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz",
+ "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-number": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.12.0"
+ }
+ },
+ "node_modules/is-obj": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-3.0.0.tgz",
+ "integrity": "sha512-IlsXEHOjtKhpN8r/tRFj2nDyTmHvcfNeu/nrRIcXE17ROeatXchkojffa1SpdqW4cr/Fj6QkEf/Gn4zf6KKvEQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-plain-obj": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz",
+ "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-promise": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
+ "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/is-regexp": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-3.1.0.tgz",
+ "integrity": "sha512-rbku49cWloU5bSMI+zaRaXdQHXnthP6DZ/vLnfdSKyL4zUzuWnomtOEiZZOd+ioQ+avFo/qau3KPTc7Fjy1uPA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-stream": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz",
+ "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-unicode-supported": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz",
+ "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-wsl": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.1.tgz",
+ "integrity": "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-inside-container": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/isexe": {
+ "version": "3.1.5",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.5.tgz",
+ "integrity": "sha512-6B3tLtFqtQS4ekarvLVMZ+X+VlvQekbe4taUkf/rhVO3d/h0M2rfARm/pXLcPEsjjMsFgrFgSrhQIxcSVrBz8w==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/jose": {
+ "version": "6.2.3",
+ "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.3.tgz",
+ "integrity": "sha512-YYVDInQKFJfR/xa3ojUTl8c2KoTwiL1R5Wg9YCydwH0x0B9grbzlg5HC7mMjCtUJjbQ/YnGEZIhI5tCgfTb4Hw==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/panva"
+ }
+ },
+ "node_modules/js-tokens": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/js-yaml": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz",
+ "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/puzrin"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/nodeca"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "argparse": "^2.0.1"
+ },
+ "bin": {
+ "js-yaml": "bin/js-yaml.js"
+ }
+ },
+ "node_modules/jsesc": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
+ "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "jsesc": "bin/jsesc"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/json-parse-even-better-errors": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
+ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/json-schema-traverse": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/json-schema-typed": {
+ "version": "8.0.2",
+ "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.2.tgz",
+ "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==",
+ "dev": true,
+ "license": "BSD-2-Clause"
+ },
+ "node_modules/json5": {
+ "version": "2.2.3",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
+ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "json5": "lib/cli.js"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/jsonfile": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz",
+ "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "universalify": "^2.0.0"
+ },
+ "optionalDependencies": {
+ "graceful-fs": "^4.1.6"
+ }
+ },
+ "node_modules/kleur": {
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz",
+ "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/lines-and-columns": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
+ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/log-symbols": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-6.0.0.tgz",
+ "integrity": "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^5.3.0",
+ "is-unicode-supported": "^1.3.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/log-symbols/node_modules/is-unicode-supported": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz",
+ "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/lru-cache": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
+ "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "yallist": "^3.0.2"
+ }
+ },
+ "node_modules/math-intrinsics": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
+ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/media-typer": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
+ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/merge-descriptors": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
+ "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/merge-stream": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
+ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/merge2": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
+ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/methods": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
+ "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/micromatch": {
+ "version": "4.0.8",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
+ "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "braces": "^3.0.3",
+ "picomatch": "^2.3.1"
+ },
+ "engines": {
+ "node": ">=8.6"
+ }
+ },
+ "node_modules/micromatch/node_modules/picomatch": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
+ "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/mime": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
+ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
+ "license": "MIT",
+ "bin": {
+ "mime": "cli.js"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/mime-db": {
+ "version": "1.52.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime-types": {
+ "version": "2.1.35",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "license": "MIT",
+ "dependencies": {
+ "mime-db": "1.52.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mimic-fn": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
+ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/mimic-function": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz",
+ "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/minimatch": {
+ "version": "10.2.5",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz",
+ "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "dependencies": {
+ "brace-expansion": "^5.0.5"
+ },
+ "engines": {
+ "node": "18 || 20 || >=22"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/minimist": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
+ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
+ "license": "MIT"
+ },
+ "node_modules/nanoid": {
+ "version": "3.3.12",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz",
+ "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "bin": {
+ "nanoid": "bin/nanoid.cjs"
+ },
+ "engines": {
+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+ }
+ },
+ "node_modules/negotiator": {
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
+ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/node-domexception": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
+ "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
+ "deprecated": "Use your platform's native DOMException instead",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/jimmywarting"
+ },
+ {
+ "type": "github",
+ "url": "https://paypal.me/jimmywarting"
+ }
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.5.0"
+ }
+ },
+ "node_modules/node-fetch": {
+ "version": "2.7.0",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
+ "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
+ "license": "MIT",
+ "dependencies": {
+ "whatwg-url": "^5.0.0"
+ },
+ "engines": {
+ "node": "4.x || >=6.0.0"
+ },
+ "peerDependencies": {
+ "encoding": "^0.1.0"
+ },
+ "peerDependenciesMeta": {
+ "encoding": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/node-releases": {
+ "version": "2.0.47",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.47.tgz",
+ "integrity": "sha512-Uzmd6LXpouKo8EUK68IjH4+E01w/hXyV3R3g/geCJo+rXLNfh1xucB+LOzYEOQPSiUK3h/xZf0cQGcSsmyL2Og==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/npm-run-path": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-6.0.0.tgz",
+ "integrity": "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "path-key": "^4.0.0",
+ "unicorn-magic": "^0.3.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/npm-run-path/node_modules/path-key": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz",
+ "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/object-assign": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object-inspect": {
+ "version": "1.13.4",
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
+ "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/object-treeify": {
+ "version": "1.1.33",
+ "resolved": "https://registry.npmjs.org/object-treeify/-/object-treeify-1.1.33.tgz",
+ "integrity": "sha512-EFVjAYfzWqWsBMRHPMAXLCDIJnpMhdWAqR7xG6M6a2cs6PMFpl/+Z20w9zDW4vkxOFfddegBKq9Rehd0bxWE7A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/on-finished": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
+ "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
+ "license": "MIT",
+ "dependencies": {
+ "ee-first": "1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "wrappy": "1"
+ }
+ },
+ "node_modules/onetime": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz",
+ "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "mimic-function": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/open": {
+ "version": "11.0.0",
+ "resolved": "https://registry.npmjs.org/open/-/open-11.0.0.tgz",
+ "integrity": "sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "default-browser": "^5.4.0",
+ "define-lazy-prop": "^3.0.0",
+ "is-in-ssh": "^1.0.0",
+ "is-inside-container": "^1.0.0",
+ "powershell-utils": "^0.1.0",
+ "wsl-utils": "^0.3.0"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/ora": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/ora/-/ora-8.2.0.tgz",
+ "integrity": "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^5.3.0",
+ "cli-cursor": "^5.0.0",
+ "cli-spinners": "^2.9.2",
+ "is-interactive": "^2.0.0",
+ "is-unicode-supported": "^2.0.0",
+ "log-symbols": "^6.0.0",
+ "stdin-discarder": "^0.2.2",
+ "string-width": "^7.2.0",
+ "strip-ansi": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/ora/node_modules/ansi-regex": {
+ "version": "6.2.2",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
+ "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ }
+ },
+ "node_modules/ora/node_modules/strip-ansi": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",
+ "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^6.2.2"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+ }
+ },
+ "node_modules/parent-module": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
+ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "callsites": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/parse-json": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
+ "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^7.0.0",
+ "error-ex": "^1.3.1",
+ "json-parse-even-better-errors": "^2.3.0",
+ "lines-and-columns": "^1.1.6"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/parse-ms": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-4.0.0.tgz",
+ "integrity": "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/parseurl": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
+ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/path-browserify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
+ "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/path-key": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/path-to-regexp": {
+ "version": "0.1.12",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
+ "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==",
+ "license": "MIT"
+ },
+ "node_modules/picocolors": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/picomatch": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz",
+ "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/pkce-challenge": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.1.tgz",
+ "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/postcss": {
+ "version": "8.5.15",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.15.tgz",
+ "integrity": "sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/postcss"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "nanoid": "^3.3.12",
+ "picocolors": "^1.1.1",
+ "source-map-js": "^1.2.1"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >=14"
+ }
+ },
+ "node_modules/postcss-selector-parser": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.2.tgz",
+ "integrity": "sha512-Wjvt4scRFouioIInHf51IFNP4ltJ2EngJM+cZPGiqbKetBfmP3vpdPV8ID2S6JS6/jdo74N8+aEYH9lQr2C6sA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "cssesc": "^3.0.0",
+ "util-deprecate": "^1.0.2"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/powershell-utils": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/powershell-utils/-/powershell-utils-0.1.0.tgz",
+ "integrity": "sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/pretty-ms": {
+ "version": "9.3.0",
+ "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.3.0.tgz",
+ "integrity": "sha512-gjVS5hOP+M3wMm5nmNOucbIrqudzs9v/57bWRHQWLYklXqoXKrVfYW2W9+glfGsqtPgpiz5WwyEEB+ksXIx3gQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "parse-ms": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/prompts": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz",
+ "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "kleur": "^3.0.3",
+ "sisteransi": "^1.0.5"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/prompts/node_modules/kleur": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz",
+ "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/proxy-addr": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
+ "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
+ "license": "MIT",
+ "dependencies": {
+ "forwarded": "0.2.0",
+ "ipaddr.js": "1.9.1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/qs": {
+ "version": "6.14.1",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz",
+ "integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==",
"license": "BSD-3-Clause",
"dependencies": {
"side-channel": "^1.1.0"
@@ -639,31 +3620,207 @@
"node": ">=0.6"
},
"funding": {
- "url": "https://github.com/sponsors/ljharb"
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/queue-microtask": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
+ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/range-parser": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
+ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/raw-body": {
+ "version": "2.5.3",
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz",
+ "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==",
+ "license": "MIT",
+ "dependencies": {
+ "bytes": "~3.1.2",
+ "http-errors": "~2.0.1",
+ "iconv-lite": "~0.4.24",
+ "unpipe": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/recast": {
+ "version": "0.23.11",
+ "resolved": "https://registry.npmjs.org/recast/-/recast-0.23.11.tgz",
+ "integrity": "sha512-YTUo+Flmw4ZXiWfQKGcwwc11KnoRAYgzAE2E7mXKCjSviTKShtxBsN6YUUBB2gtaBzKzeKunxhUwNHQuRryhWA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ast-types": "^0.16.1",
+ "esprima": "~4.0.0",
+ "source-map": "~0.6.1",
+ "tiny-invariant": "^1.3.3",
+ "tslib": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/require-from-string": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
+ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/resolve-from": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
+ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/restore-cursor": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz",
+ "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "onetime": "^7.0.0",
+ "signal-exit": "^4.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/reusify": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
+ "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "iojs": ">=1.0.0",
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/router": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz",
+ "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "debug": "^4.4.0",
+ "depd": "^2.0.0",
+ "is-promise": "^4.0.0",
+ "parseurl": "^1.3.3",
+ "path-to-regexp": "^8.0.0"
+ },
+ "engines": {
+ "node": ">= 18"
+ }
+ },
+ "node_modules/router/node_modules/debug": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/router/node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/router/node_modules/path-to-regexp": {
+ "version": "8.4.2",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz",
+ "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
}
},
- "node_modules/range-parser": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
- "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
+ "node_modules/run-applescript": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.1.0.tgz",
+ "integrity": "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==",
+ "dev": true,
"license": "MIT",
"engines": {
- "node": ">= 0.6"
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/raw-body": {
- "version": "2.5.3",
- "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz",
- "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==",
+ "node_modules/run-parallel": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
+ "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
"license": "MIT",
"dependencies": {
- "bytes": "~3.1.2",
- "http-errors": "~2.0.1",
- "iconv-lite": "~0.4.24",
- "unpipe": "~1.0.0"
- },
- "engines": {
- "node": ">= 0.8"
+ "queue-microtask": "^1.2.2"
}
},
"node_modules/safe-buffer": {
@@ -692,6 +3849,16 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"license": "MIT"
},
+ "node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
"node_modules/send": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz",
@@ -743,6 +3910,93 @@
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
"license": "ISC"
},
+ "node_modules/shadcn": {
+ "version": "4.11.0",
+ "resolved": "https://registry.npmjs.org/shadcn/-/shadcn-4.11.0.tgz",
+ "integrity": "sha512-UV0cchFea9hO7poV1CuEP0wvmYjpAqcxCKdy23bndl2Du2ARtDs8A4xdzfhUjDBeOW1nNpJ6lXmsEpsply2SfQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/core": "^7.28.0",
+ "@babel/parser": "^7.28.0",
+ "@babel/plugin-transform-typescript": "^7.28.0",
+ "@babel/preset-typescript": "^7.27.1",
+ "@dotenvx/dotenvx": "^1.48.4",
+ "@modelcontextprotocol/sdk": "^1.26.0",
+ "@types/validate-npm-package-name": "^4.0.2",
+ "browserslist": "^4.26.2",
+ "commander": "^14.0.0",
+ "cosmiconfig": "^9.0.0",
+ "dedent": "^1.6.0",
+ "deepmerge": "^4.3.1",
+ "diff": "^8.0.2",
+ "execa": "^9.6.0",
+ "fast-glob": "^3.3.3",
+ "fs-extra": "^11.3.1",
+ "fuzzysort": "^3.1.0",
+ "https-proxy-agent": "^7.0.6",
+ "kleur": "^4.1.5",
+ "node-fetch": "^3.3.2",
+ "open": "^11.0.0",
+ "ora": "^8.2.0",
+ "postcss": "^8.5.6",
+ "postcss-selector-parser": "^7.1.0",
+ "prompts": "^2.4.2",
+ "recast": "^0.23.11",
+ "stringify-object": "^5.0.0",
+ "tailwind-merge": "^3.0.1",
+ "ts-morph": "^26.0.0",
+ "tsconfig-paths": "^4.2.0",
+ "validate-npm-package-name": "^7.0.1",
+ "zod": "^3.24.1",
+ "zod-to-json-schema": "^3.24.6"
+ },
+ "bin": {
+ "shadcn": "dist/index.js"
+ }
+ },
+ "node_modules/shadcn/node_modules/node-fetch": {
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
+ "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "data-uri-to-buffer": "^4.0.0",
+ "fetch-blob": "^3.1.4",
+ "formdata-polyfill": "^4.0.10"
+ },
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/node-fetch"
+ }
+ },
+ "node_modules/shebang-command": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "shebang-regex": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/shebang-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/side-channel": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
@@ -815,6 +4069,46 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/signal-exit": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
+ "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
+ "dev": true,
+ "license": "ISC",
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/sisteransi": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz",
+ "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/source-map-js": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
+ "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/statuses": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",
@@ -824,6 +4118,151 @@
"node": ">= 0.8"
}
},
+ "node_modules/stdin-discarder": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.2.2.tgz",
+ "integrity": "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/string-width": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
+ "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "emoji-regex": "^10.3.0",
+ "get-east-asian-width": "^1.0.0",
+ "strip-ansi": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/string-width/node_modules/ansi-regex": {
+ "version": "6.2.2",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
+ "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ }
+ },
+ "node_modules/string-width/node_modules/strip-ansi": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",
+ "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^6.2.2"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+ }
+ },
+ "node_modules/stringify-object": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-5.0.0.tgz",
+ "integrity": "sha512-zaJYxz2FtcMb4f+g60KsRNFOpVMUyuJgA51Zi5Z1DOTC3S59+OQiVOzE9GZt0x72uBGWKsQIuBKeF9iusmKFsg==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "get-own-enumerable-keys": "^1.0.0",
+ "is-obj": "^3.0.0",
+ "is-regexp": "^3.1.0"
+ },
+ "engines": {
+ "node": ">=14.16"
+ },
+ "funding": {
+ "url": "https://github.com/yeoman/stringify-object?sponsor=1"
+ }
+ },
+ "node_modules/strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/strip-bom": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
+ "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/strip-final-newline": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-4.0.0.tgz",
+ "integrity": "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/tailwind-merge": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.6.0.tgz",
+ "integrity": "sha512-uxL7qAVQriqRQPAyK3pj66VqskWqoZ37PW94jwOTwNfq/z9oyu1V+eqrZqtR2+fCiXdYOZe/Modt8GtvqNzu+w==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/dcastil"
+ }
+ },
+ "node_modules/tiny-invariant": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
+ "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/to-regex-range": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-number": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=8.0"
+ }
+ },
"node_modules/toidentifier": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
@@ -839,6 +4278,39 @@
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
"license": "MIT"
},
+ "node_modules/ts-morph": {
+ "version": "26.0.0",
+ "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-26.0.0.tgz",
+ "integrity": "sha512-ztMO++owQnz8c/gIENcM9XfCEzgoGphTv+nKpYNM1bgsdOVC/jRZuEBf6N+mLLDNg68Kl+GgUZfOySaRiG1/Ug==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@ts-morph/common": "~0.27.0",
+ "code-block-writer": "^13.0.3"
+ }
+ },
+ "node_modules/tsconfig-paths": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz",
+ "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "json5": "^2.2.2",
+ "minimist": "^1.2.6",
+ "strip-bom": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/tslib": {
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
+ "dev": true,
+ "license": "0BSD"
+ },
"node_modules/type-is": {
"version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
@@ -852,6 +4324,29 @@
"node": ">= 0.6"
}
},
+ "node_modules/unicorn-magic": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz",
+ "integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/universalify": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
+ "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 10.0.0"
+ }
+ },
"node_modules/unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
@@ -861,6 +4356,44 @@
"node": ">= 0.8"
}
},
+ "node_modules/update-browserslist-db": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz",
+ "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/browserslist"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "escalade": "^3.2.0",
+ "picocolors": "^1.1.1"
+ },
+ "bin": {
+ "update-browserslist-db": "cli.js"
+ },
+ "peerDependencies": {
+ "browserslist": ">= 4.21.0"
+ }
+ },
+ "node_modules/util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/utils-merge": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
@@ -870,6 +4403,16 @@
"node": ">= 0.4.0"
}
},
+ "node_modules/validate-npm-package-name": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-7.0.2.tgz",
+ "integrity": "sha512-hVDIBwsRruT73PbK7uP5ebUt+ezEtCmzZz3F59BSr2F6OVFnJ/6h8liuvdLrQ88Xmnk6/+xGGuq+pG9WwTuy3A==",
+ "dev": true,
+ "license": "ISC",
+ "engines": {
+ "node": "^20.17.0 || >=22.9.0"
+ }
+ },
"node_modules/vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
@@ -879,6 +4422,16 @@
"node": ">= 0.8"
}
},
+ "node_modules/web-streams-polyfill": {
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz",
+ "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 8"
+ }
+ },
"node_modules/webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
@@ -894,6 +4447,103 @@
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
}
+ },
+ "node_modules/which": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz",
+ "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "isexe": "^3.1.1"
+ },
+ "bin": {
+ "node-which": "bin/which.js"
+ },
+ "engines": {
+ "node": "^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/wsl-utils": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.3.1.tgz",
+ "integrity": "sha512-g/eziiSUNBSsdDJtCLB8bdYEUMj4jR7AGeUo96p/3dTafgjHhpF4RiCFPiRILwjQoDXx5MqkBr4fwWtR3Ky4Wg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-wsl": "^3.1.0",
+ "powershell-utils": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/yallist": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
+ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/yocto-spinner": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/yocto-spinner/-/yocto-spinner-1.2.0.tgz",
+ "integrity": "sha512-Yw0hUB6UA3o4YUgKy3oSe9a4cxoaZ9sBfYDw+JSxo6Id0KoJGoxzPA24qqUXYKBWABs/zDSGTz9kww7t3F0XGw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "yoctocolors": "^2.1.1"
+ },
+ "engines": {
+ "node": ">=18.19"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/yoctocolors": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.2.tgz",
+ "integrity": "sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/zod": {
+ "version": "3.25.76",
+ "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
+ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "funding": {
+ "url": "https://github.com/sponsors/colinhacks"
+ }
+ },
+ "node_modules/zod-to-json-schema": {
+ "version": "3.25.2",
+ "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.2.tgz",
+ "integrity": "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==",
+ "dev": true,
+ "license": "ISC",
+ "peerDependencies": {
+ "zod": "^3.25.28 || ^4"
+ }
}
}
}
diff --git a/package.json b/package.json
index 67759ee..1b2258e 100644
--- a/package.json
+++ b/package.json
@@ -7,13 +7,21 @@
"start": "node server.js",
"dev": "nodemon server.js"
},
- "keywords": ["analytics", "dashboard", "youtube", "social-media"],
+ "keywords": [
+ "analytics",
+ "dashboard",
+ "youtube",
+ "social-media"
+ ],
"author": "",
"license": "ISC",
"dependencies": {
- "express": "^4.18.2",
- "cors": "^2.8.5",
"body-parser": "^1.20.2",
+ "cors": "^2.8.5",
+ "express": "^4.18.2",
"node-fetch": "^2.7.0"
+ },
+ "devDependencies": {
+ "shadcn": "^4.11.0"
}
}