@ammarkhalidfarooq/dashboard-package 0.6.128 → 0.6.129

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,12 +1,13 @@
1
1
  import React, { Suspense, lazy, useState, useRef, useEffect, useMemo } from 'react';
2
- import { Box, Button, Menu, MenuItem, useTheme, useMediaQuery, Grid, Card, CardContent, Typography, IconButton, ThemeProvider, CircularProgress, Avatar, LinearProgress, Stack, TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Skeleton } from '@mui/material';
3
- import { MoreHoriz, TrendingDown, TrendingUp, MoreVert, Check, InfoOutlined, Settings, PeopleAltOutlined, RequestQuoteOutlined, PaidOutlined, Adjust, PersonOutlined, IndeterminateCheckBoxOutlined, FavoriteOutlined, SearchOutlined, HighlightOff, Email } from '@mui/icons-material';
2
+ import { Box, Button, Menu, MenuItem, useTheme, useMediaQuery, Grid, Card, CardContent, Typography, IconButton, ThemeProvider, CircularProgress, LinearProgress, Stack, Avatar, TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Skeleton } from '@mui/material';
3
+ import { MoreHoriz, TrendingDown, TrendingUp, MoreVert, Check, InfoOutlined, Settings, PeopleAltOutlined, RequestQuoteOutlined, PaidOutlined, PersonOutlined, IndeterminateCheckBoxOutlined, FavoriteOutlined, SearchOutlined, HighlightOff, Email } from '@mui/icons-material';
4
4
  import { createTheme } from '@mui/material/styles';
5
5
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
6
6
  import Grid$1 from '@mui/material/Grid';
7
7
  import Box$1 from '@mui/material/Box';
8
8
  import Typography$1 from '@mui/material/Typography';
9
9
  import ReactApexChart from 'react-apexcharts';
10
+ import { SiSnapchat, SiYoutube, SiTiktok, SiGoogleads, SiMeta } from 'react-icons/si';
10
11
 
11
12
  var theme = createTheme({
12
13
  cssVariables: true,
@@ -1019,482 +1020,281 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
1019
1020
  title = _ref$title === void 0 ? "Active campaigns" : _ref$title,
1020
1021
  _ref$subtitle = _ref.subtitle,
1021
1022
  subtitle = _ref$subtitle === void 0 ? "Live fundraisers ranked by velocity" : _ref$subtitle,
1023
+ actionLabel = _ref.actionLabel,
1022
1024
  _ref$columns = _ref.columns,
1023
- columns = _ref$columns === void 0 ? ["Campaign", "Raised", "Progress", "Donors", "Avg gift"] : _ref$columns,
1025
+ columns = _ref$columns === void 0 ? ["Campaign", "Raised", "Progress", "Donors", "Avg Gift"] : _ref$columns,
1024
1026
  _ref$rows = _ref.rows,
1025
1027
  rows = _ref$rows === void 0 ? [] : _ref$rows,
1026
1028
  _ref$gridTemplateColu = _ref.gridTemplateColumns,
1027
- gridTemplateColumns = _ref$gridTemplateColu === void 0 ? "3fr 1fr 1.5fr 0.8fr 1fr" : _ref$gridTemplateColu;
1028
- var theme = useTheme();
1029
- var isMobile = useMediaQuery(theme.breakpoints.down("sm"));
1030
- var isTablet = useMediaQuery(theme.breakpoints.between("sm", "md"));
1031
-
1032
- /* ─── Desktop / Tablet: Grid Table ─── */
1033
- if (!isMobile) {
1034
- return /*#__PURE__*/jsxs(Box, {
1035
- sx: {
1036
- bgcolor: "#fff",
1037
- borderRadius: 4,
1038
- border: "1px solid #f0f0f0",
1039
- boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
1040
- p: 3
1041
- },
1029
+ gridTemplateColumns = _ref$gridTemplateColu === void 0 ? "3fr 1fr 1.5fr 0.8fr 1fr " : _ref$gridTemplateColu,
1030
+ height = _ref.height,
1031
+ _ref$compact = _ref.compact,
1032
+ compact = _ref$compact === void 0 ? false : _ref$compact,
1033
+ _ref$sx = _ref.sx,
1034
+ sx = _ref$sx === void 0 ? {} : _ref$sx,
1035
+ _ref$headerSx = _ref.headerSx,
1036
+ headerSx = _ref$headerSx === void 0 ? {} : _ref$headerSx,
1037
+ _ref$tableSx = _ref.tableSx,
1038
+ tableSx = _ref$tableSx === void 0 ? {} : _ref$tableSx;
1039
+ return /*#__PURE__*/jsxs(Box, {
1040
+ sx: _objectSpread2({
1041
+ bgcolor: "#fff",
1042
+ borderRadius: compact ? 3 : 4,
1043
+ border: "1px solid #f0f0f0",
1044
+ boxShadow: compact ? "0 2px 12px rgba(0,0,0,0.05)" : "0 4px 24px rgba(0,0,0,0.06)",
1045
+ p: compact ? 1.5 : 3,
1046
+ height: height
1047
+ }, sx),
1048
+ children: [/*#__PURE__*/jsxs(Box, {
1049
+ sx: _objectSpread2({
1050
+ display: "flex",
1051
+ justifyContent: "space-between",
1052
+ alignItems: "flex-start",
1053
+ mb: compact ? 1.25 : 3
1054
+ }, headerSx),
1042
1055
  children: [/*#__PURE__*/jsxs(Box, {
1043
- sx: {
1044
- mb: 3
1045
- },
1046
1056
  children: [/*#__PURE__*/jsx(Typography, {
1047
1057
  sx: {
1048
1058
  fontWeight: 700,
1049
- fontSize: "18px",
1050
- color: "#000"
1059
+ fontSize: compact ? "14px" : "18px",
1060
+ color: "#000",
1061
+ textAlign: "left",
1062
+ lineHeight: 1.15
1051
1063
  },
1052
1064
  children: title
1053
1065
  }), /*#__PURE__*/jsx(Typography, {
1054
1066
  sx: {
1055
- fontSize: "13px",
1056
- color: "rgba(0,0,0,0.4)",
1057
- mt: 0.2
1067
+ fontSize: compact ? "10px" : "13px",
1068
+ color: "rgba(0, 0, 0, 0.4)",
1069
+ textAlign: "left",
1070
+ lineHeight: 1.15
1058
1071
  },
1059
1072
  children: subtitle
1060
1073
  })]
1061
- }), /*#__PURE__*/jsx(Box, {
1074
+ }), actionLabel && /*#__PURE__*/jsx(Typography, {
1062
1075
  sx: {
1063
- overflowX: "auto"
1076
+ fontSize: compact ? "10px" : "13px",
1077
+ fontWeight: 600,
1078
+ color: "rgb(99, 99, 230)",
1079
+ cursor: "pointer"
1064
1080
  },
1065
- children: /*#__PURE__*/jsxs(Box, {
1081
+ children: actionLabel
1082
+ })]
1083
+ }), /*#__PURE__*/jsx(Box, {
1084
+ sx: _objectSpread2({
1085
+ overflowX: compact ? "hidden" : "auto"
1086
+ }, tableSx),
1087
+ children: /*#__PURE__*/jsxs(Box, {
1088
+ sx: {
1089
+ minWidth: compact ? 0 : "600px"
1090
+ },
1091
+ children: [/*#__PURE__*/jsx(Box, {
1066
1092
  sx: {
1067
- minWidth: "600px"
1093
+ display: "grid",
1094
+ gridTemplateColumns: gridTemplateColumns,
1095
+ gap: compact ? 1 : 2,
1096
+ pb: compact ? 1 : 2.5,
1097
+ borderBottom: "1px solid #f0f0f0"
1068
1098
  },
1069
- children: [/*#__PURE__*/jsx(Box, {
1070
- sx: {
1071
- display: "grid",
1072
- gridTemplateColumns: gridTemplateColumns,
1073
- gap: 2,
1074
- pb: 2.5,
1075
- borderBottom: "1px solid #f0f0f0"
1076
- },
1077
- children: columns.map(function (header, colIdx) {
1078
- return /*#__PURE__*/jsx(Typography, {
1079
- sx: {
1080
- fontSize: "12px",
1081
- color: "rgba(0,0,0,0.4)",
1082
- fontWeight: 500,
1083
- whiteSpace: "nowrap",
1084
- textAlign: colIdx === 0 ? "left" : "center"
1085
- },
1086
- children: header
1087
- }, header);
1088
- })
1089
- }), /*#__PURE__*/jsx(Box, {
1090
- sx: {
1091
- mt: 1
1092
- },
1093
- children: rows.map(function (row, idx) {
1094
- var isDisabled = row.comingSoon;
1095
- return /*#__PURE__*/jsxs(Box, {
1099
+ children: columns.map(function (header) {
1100
+ return /*#__PURE__*/jsx(Typography, {
1101
+ sx: {
1102
+ fontSize: compact ? "9px" : "12px",
1103
+ color: "rgba(0, 0, 0, 0.4)",
1104
+ fontWeight: 500,
1105
+ textAlign: "left"
1106
+ },
1107
+ children: header
1108
+ }, header);
1109
+ })
1110
+ }), /*#__PURE__*/jsx(Box, {
1111
+ sx: {
1112
+ mt: 1
1113
+ },
1114
+ children: rows.map(function (row, idx) {
1115
+ var _row$progress;
1116
+ return /*#__PURE__*/jsxs(Box, {
1117
+ sx: {
1118
+ display: "grid",
1119
+ gridTemplateColumns: gridTemplateColumns,
1120
+ gap: compact ? 1 : 2,
1121
+ py: compact ? 0.5 : 1.2,
1122
+ alignItems: "center",
1123
+ borderBottom: idx === rows.length - 1 ? "none" : "1px solid #f5f5f5"
1124
+ },
1125
+ children: [/*#__PURE__*/jsxs(Box, {
1096
1126
  sx: {
1097
- display: "grid",
1098
- gridTemplateColumns: gridTemplateColumns,
1099
- gap: 2,
1100
- py: 1.2,
1127
+ display: "flex",
1101
1128
  alignItems: "center",
1102
- borderBottom: idx === rows.length - 1 ? "none" : "1px solid #f5f5f5",
1103
- opacity: isDisabled ? 0.55 : 1,
1104
- transition: "opacity 0.2s ease"
1129
+ gap: 1.5
1105
1130
  },
1106
- children: [/*#__PURE__*/jsxs(Box, {
1131
+ children: [(row.icon || row.id) && /*#__PURE__*/jsx(Box, {
1107
1132
  sx: {
1133
+ width: compact ? 22 : 32,
1134
+ height: compact ? 22 : 32,
1135
+ borderRadius: "50%",
1136
+ bgcolor: "#fff",
1137
+ border: "2px solid ".concat(row.avatarBorder || row.avatarBg || "#E5E7EB"),
1108
1138
  display: "flex",
1109
1139
  alignItems: "center",
1110
- gap: 1.5,
1111
- minWidth: 0
1140
+ justifyContent: "center",
1141
+ flexShrink: 0,
1142
+ boxSizing: "border-box",
1143
+ filter: row.comingSoon ? "grayscale(1)" : "none",
1144
+ opacity: row.comingSoon ? 0.55 : 1
1112
1145
  },
1113
- children: [row.id && /*#__PURE__*/jsx(Avatar, {
1146
+ children: row.icon ? /*#__PURE__*/jsx(row.icon, {
1147
+ size: compact ? 12 : 16,
1148
+ color: row.iconColor || row.avatarBorder || row.avatarBg
1149
+ }) : /*#__PURE__*/jsx(Typography, {
1114
1150
  sx: {
1115
- width: 28,
1116
- height: 28,
1117
- fontSize: "10px",
1151
+ fontSize: compact ? "8px" : "10px",
1118
1152
  fontWeight: 700,
1119
- bgcolor: row.avatarBg || "#F3F4F6",
1120
- color: row.avatarColor || "#fff",
1121
- flexShrink: 0
1153
+ color: row.avatarColor || "#111"
1122
1154
  },
1123
1155
  children: row.id
1124
- }), /*#__PURE__*/jsxs(Box, {
1125
- sx: {
1126
- display: "flex",
1127
- alignItems: "center",
1128
- gap: 0.8,
1129
- flexWrap: "nowrap",
1130
- minWidth: 0
1131
- },
1132
- children: [/*#__PURE__*/jsx(Typography, {
1133
- sx: {
1134
- fontSize: "12px",
1135
- fontWeight: 700,
1136
- color: "#000",
1137
- whiteSpace: "nowrap"
1138
- },
1139
- children: row.name
1140
- }), isDisabled && /*#__PURE__*/jsx(Box, {
1141
- sx: {
1142
- display: "inline-flex",
1143
- alignItems: "center",
1144
- px: 0.8,
1145
- py: 0.2,
1146
- borderRadius: "100px",
1147
- bgcolor: "#F3F4F6",
1148
- border: "1px solid #E5E7EB",
1149
- flexShrink: 0,
1150
- whiteSpace: "nowrap"
1151
- },
1152
- children: /*#__PURE__*/jsx(Typography, {
1153
- sx: {
1154
- fontSize: "8px",
1155
- fontWeight: 700,
1156
- color: "#6B7280",
1157
- letterSpacing: "0.3px",
1158
- textTransform: "uppercase",
1159
- whiteSpace: "nowrap"
1160
- },
1161
- children: "Coming Soon"
1162
- })
1163
- })]
1164
- })]
1156
+ })
1165
1157
  }), /*#__PURE__*/jsx(Typography, {
1166
1158
  sx: {
1167
- fontSize: "13px",
1168
- fontWeight: 600,
1169
- color: isDisabled ? "#9CA3AF" : "#000",
1170
- whiteSpace: "nowrap",
1171
- textAlign: "center"
1159
+ fontSize: compact ? "10px" : "12px",
1160
+ fontWeight: 700,
1161
+ color: row.comingSoon ? "#9CA3AF" : "#000"
1172
1162
  },
1173
- children: row.val1
1174
- }), row.type === "progress" ? /*#__PURE__*/jsxs(Box, {
1163
+ children: row.name
1164
+ })]
1165
+ }), /*#__PURE__*/jsx(Typography, {
1166
+ sx: {
1167
+ fontSize: compact ? "10px" : "13px",
1168
+ fontWeight: 600,
1169
+ color: row.comingSoon ? "#9CA3AF" : "#000",
1170
+ textAlign: "left"
1171
+ },
1172
+ children: row.val1
1173
+ }), row.type === "progress" ? /*#__PURE__*/jsxs(Box, {
1174
+ sx: {
1175
+ display: "flex",
1176
+ alignItems: "center",
1177
+ gap: 1.5
1178
+ },
1179
+ children: [/*#__PURE__*/jsx(Box, {
1175
1180
  sx: {
1176
- display: "flex",
1177
- alignItems: "center",
1178
- gap: 1.5,
1179
- justifyContent: "center"
1181
+ flexGrow: 1
1180
1182
  },
1181
- children: [/*#__PURE__*/jsx(Box, {
1183
+ children: /*#__PURE__*/jsx(LinearProgress, {
1184
+ variant: "determinate",
1185
+ value: Math.min(100, Math.max(0, (_row$progress = row.progress) !== null && _row$progress !== void 0 ? _row$progress : 0)),
1182
1186
  sx: {
1183
- flexGrow: 1,
1184
- maxWidth: "80px"
1185
- },
1186
- children: /*#__PURE__*/jsx(LinearProgress, {
1187
- variant: "determinate",
1188
- value: row.progress,
1189
- sx: {
1190
- height: 8,
1187
+ height: compact ? 6 : 8,
1188
+ borderRadius: 4,
1189
+ bgcolor: "#F3F4F6",
1190
+ "& .MuiLinearProgress-bar": {
1191
1191
  borderRadius: 4,
1192
- bgcolor: "#F3F4F6",
1193
- "& .MuiLinearProgress-bar": {
1194
- borderRadius: 4,
1195
- bgcolor: row.progressColor || "rgb(99,99,230)"
1196
- }
1192
+ bgcolor: row.progressColor || "rgb(99, 99, 230)"
1197
1193
  }
1198
- })
1199
- }), /*#__PURE__*/jsxs(Typography, {
1200
- sx: {
1201
- fontSize: "11px",
1202
- color: "rgba(0,0,0,0.4)",
1203
- minWidth: "30px",
1204
- textAlign: "center"
1205
- },
1206
- children: [row.progress, "%"]
1207
- })]
1208
- }) : /*#__PURE__*/jsx(Typography, {
1209
- sx: {
1210
- fontSize: "13px",
1211
- fontWeight: 600,
1212
- color: isDisabled ? "#9CA3AF" : "#000",
1213
- whiteSpace: "nowrap",
1214
- textAlign: "center"
1215
- },
1216
- children: row.val2
1217
- }), /*#__PURE__*/jsx(Typography, {
1194
+ }
1195
+ })
1196
+ }), /*#__PURE__*/jsxs(Typography, {
1218
1197
  sx: {
1219
- fontSize: "13px",
1220
- fontWeight: row.highlightVal3 ? 700 : 500,
1221
- color: isDisabled ? "#9CA3AF" : row.highlightVal3 ? row.val3Color || "#22C55E" : "#000",
1222
- whiteSpace: "nowrap",
1223
- textAlign: "center"
1198
+ fontSize: compact ? "9px" : "11px",
1199
+ color: "rgba(0, 0, 0, 0.4)",
1200
+ minWidth: "30px"
1224
1201
  },
1225
- children: row.val3
1226
- }), /*#__PURE__*/jsx(Typography, {
1202
+ children: [row.progress, "%"]
1203
+ })]
1204
+ }) : /*#__PURE__*/jsx(Typography, {
1205
+ sx: {
1206
+ fontSize: "13px",
1207
+ fontWeight: 600,
1208
+ color: row.comingSoon ? "#9CA3AF" : "#000",
1209
+ textAlign: "left"
1210
+ },
1211
+ children: row.val2
1212
+ }), /*#__PURE__*/jsx(Typography, {
1213
+ sx: {
1214
+ fontSize: compact ? "10px" : "13px",
1215
+ fontWeight: row.highlightVal3 ? 700 : 500,
1216
+ color: row.comingSoon ? "#9CA3AF" : row.highlightVal3 ? row.val3Color || "#22C55E" : "#000",
1217
+ textAlign: "left"
1218
+ },
1219
+ children: row.val3
1220
+ }), /*#__PURE__*/jsx(Typography, {
1221
+ sx: {
1222
+ fontSize: "13px",
1223
+ fontWeight: 500,
1224
+ color: row.comingSoon ? "#9CA3AF" : "#000",
1225
+ textAlign: "left"
1226
+ },
1227
+ children: row.val4
1228
+ }), columns.length > 5 && /*#__PURE__*/jsx(Box, {
1229
+ children: row.comingSoon ? /*#__PURE__*/jsx(Box, {
1227
1230
  sx: {
1228
- fontSize: "13px",
1229
- fontWeight: 500,
1230
- color: isDisabled ? "#9CA3AF" : "#000",
1231
- whiteSpace: "nowrap",
1232
- textAlign: "center"
1231
+ display: "inline-block",
1232
+ px: compact ? 1 : 1.5,
1233
+ py: compact ? 0.25 : 0.5,
1234
+ borderRadius: "100px",
1235
+ bgcolor: "#F3F4F6",
1236
+ color: "#9CA3AF",
1237
+ fontSize: compact ? "9px" : "11px",
1238
+ fontWeight: 700,
1239
+ textAlign: "center",
1240
+ whiteSpace: "nowrap"
1233
1241
  },
1234
- children: row.val4
1235
- }), columns.length > 5 && /*#__PURE__*/jsx(Box, {
1242
+ children: "Coming Soon"
1243
+ }) : row.type === "trend" ? /*#__PURE__*/jsx(Box, {
1236
1244
  sx: {
1237
1245
  display: "flex",
1238
- justifyContent: "center"
1246
+ alignItems: "center",
1247
+ gap: 0.5
1239
1248
  },
1240
- children: row.type === "trend" ? /*#__PURE__*/jsxs(Box, {
1241
- sx: {
1242
- display: "flex",
1243
- alignItems: "center",
1244
- gap: 0.5
1245
- },
1249
+ children: row.trendType === "up" ? /*#__PURE__*/jsxs(Fragment, {
1246
1250
  children: [/*#__PURE__*/jsx(Typography, {
1247
1251
  sx: {
1248
1252
  fontSize: "14px",
1249
- color: row.trendType === "up" ? "#22C55E" : "#EF4444"
1253
+ color: "#22C55E"
1250
1254
  },
1251
- children: row.trendType === "up" ? "▲" : "▼"
1255
+ children: "\u25B2"
1252
1256
  }), /*#__PURE__*/jsx(Typography, {
1253
1257
  sx: {
1254
1258
  fontSize: "12px",
1255
- color: row.trendType === "up" ? "#22C55E" : "#EF4444",
1256
- fontWeight: 700,
1257
- whiteSpace: "nowrap"
1259
+ color: "#22C55E",
1260
+ fontWeight: 700
1258
1261
  },
1259
- children: isTablet ? row.trendType === "up" ? "Up" : "Down" : row.trendLabel
1262
+ children: row.trendLabel
1263
+ })]
1264
+ }) : /*#__PURE__*/jsxs(Fragment, {
1265
+ children: [/*#__PURE__*/jsx(Typography, {
1266
+ sx: {
1267
+ fontSize: "14px",
1268
+ color: "#EF4444"
1269
+ },
1270
+ children: "\u25BC"
1271
+ }), /*#__PURE__*/jsx(Typography, {
1272
+ sx: {
1273
+ fontSize: "12px",
1274
+ color: "#EF4444",
1275
+ fontWeight: 700
1276
+ },
1277
+ children: row.trendLabel
1260
1278
  })]
1261
- }) : row.type === "comingSoon" ? /*#__PURE__*/jsx(Typography, {
1262
- sx: {
1263
- fontSize: "12px",
1264
- color: "#9CA3AF",
1265
- fontWeight: 500,
1266
- textAlign: "center"
1267
- },
1268
- children: "\u2014"
1269
- }) : /*#__PURE__*/jsx(Box, {
1270
- sx: {
1271
- display: "inline-block",
1272
- px: 1.5,
1273
- py: 0.5,
1274
- borderRadius: "100px",
1275
- bgcolor: row.statusBg,
1276
- color: row.statusColor,
1277
- fontSize: "11px",
1278
- fontWeight: 700
1279
- },
1280
- children: row.status
1281
1279
  })
1282
- })]
1283
- }, idx);
1284
- })
1285
- })]
1286
- })
1287
- })]
1288
- });
1289
- }
1290
-
1291
- /* ─── Mobile: Stacked Card Layout ─── */
1292
- return /*#__PURE__*/jsxs(Box, {
1293
- sx: {
1294
- bgcolor: "#fff",
1295
- borderRadius: 4,
1296
- border: "1px solid #f0f0f0",
1297
- boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
1298
- p: 2
1299
- },
1300
- children: [/*#__PURE__*/jsxs(Box, {
1301
- sx: {
1302
- mb: 2
1303
- },
1304
- children: [/*#__PURE__*/jsx(Typography, {
1305
- sx: {
1306
- fontWeight: 700,
1307
- fontSize: "16px",
1308
- color: "#000"
1309
- },
1310
- children: title
1311
- }), /*#__PURE__*/jsx(Typography, {
1312
- sx: {
1313
- fontSize: "11px",
1314
- color: "rgba(0,0,0,0.4)",
1315
- mt: 0.2
1316
- },
1317
- children: subtitle
1318
- })]
1319
- }), /*#__PURE__*/jsx(Box, {
1320
- sx: {
1321
- display: "flex",
1322
- flexDirection: "column",
1323
- gap: 1.5
1324
- },
1325
- children: rows.map(function (row, idx) {
1326
- var isDisabled = row.comingSoon;
1327
- return /*#__PURE__*/jsxs(Box, {
1328
- sx: {
1329
- p: 2,
1330
- borderRadius: 3,
1331
- border: isDisabled ? "1px dashed #E5E7EB" : "1px solid #F3F4F6",
1332
- bgcolor: isDisabled ? "#FAFAFA" : "#fff",
1333
- opacity: isDisabled ? 0.7 : 1,
1334
- transition: "opacity 0.2s ease"
1335
- },
1336
- children: [/*#__PURE__*/jsxs(Box, {
1337
- sx: {
1338
- display: "flex",
1339
- alignItems: "center",
1340
- gap: 1.5,
1341
- mb: isDisabled ? 0 : 1.5
1342
- },
1343
- children: [row.id && /*#__PURE__*/jsx(Avatar, {
1344
- sx: {
1345
- width: 32,
1346
- height: 32,
1347
- fontSize: "11px",
1348
- fontWeight: 700,
1349
- bgcolor: row.avatarBg || "#F3F4F6",
1350
- color: row.avatarColor || "#fff",
1351
- flexShrink: 0
1352
- },
1353
- children: row.id
1354
- }), /*#__PURE__*/jsxs(Box, {
1355
- sx: {
1356
- display: "flex",
1357
- alignItems: "center",
1358
- gap: 1,
1359
- flex: 1,
1360
- flexWrap: "nowrap"
1361
- },
1362
- children: [/*#__PURE__*/jsx(Typography, {
1363
- sx: {
1364
- fontSize: "14px",
1365
- fontWeight: 700,
1366
- color: "#000"
1367
- },
1368
- children: row.name
1369
- }), isDisabled && /*#__PURE__*/jsx(Box, {
1370
- sx: {
1371
- display: "inline-flex",
1372
- alignItems: "center",
1373
- px: 1,
1374
- py: 0.3,
1375
- borderRadius: "100px",
1376
- bgcolor: "#F3F4F6",
1377
- border: "1px solid #E5E7EB",
1378
- flexShrink: 0
1379
- },
1380
- children: /*#__PURE__*/jsx(Typography, {
1280
+ }) : /*#__PURE__*/jsx(Box, {
1381
1281
  sx: {
1382
- fontSize: "8px",
1282
+ display: "inline-block",
1283
+ px: compact ? 1 : 1.5,
1284
+ py: compact ? 0.25 : 0.5,
1285
+ borderRadius: "100px",
1286
+ bgcolor: row.statusBg,
1287
+ color: row.statusColor,
1288
+ fontSize: compact ? "9px" : "11px",
1383
1289
  fontWeight: 700,
1384
- color: "#6B7280",
1385
- letterSpacing: "0.3px",
1386
- textTransform: "uppercase"
1290
+ textAlign: "center"
1387
1291
  },
1388
- children: "Coming Soon"
1292
+ children: row.status
1389
1293
  })
1390
1294
  })]
1391
- }), row.type === "trend" && /*#__PURE__*/jsxs(Box, {
1392
- sx: {
1393
- display: "flex",
1394
- alignItems: "center",
1395
- gap: 0.3,
1396
- flexShrink: 0
1397
- },
1398
- children: [/*#__PURE__*/jsx(Typography, {
1399
- sx: {
1400
- fontSize: "12px",
1401
- color: row.trendType === "up" ? "#22C55E" : "#EF4444"
1402
- },
1403
- children: row.trendType === "up" ? "▲" : "▼"
1404
- }), /*#__PURE__*/jsx(Typography, {
1405
- sx: {
1406
- fontSize: "11px",
1407
- color: row.trendType === "up" ? "#22C55E" : "#EF4444",
1408
- fontWeight: 700
1409
- },
1410
- children: row.trendType === "up" ? "Up" : "Down"
1411
- })]
1412
- })]
1413
- }), !isDisabled && /*#__PURE__*/jsxs(Box, {
1414
- sx: {
1415
- display: "grid",
1416
- gridTemplateColumns: "1fr 1fr 1fr 1fr",
1417
- gap: 1
1418
- },
1419
- children: [/*#__PURE__*/jsxs(Box, {
1420
- children: [/*#__PURE__*/jsx(Typography, {
1421
- sx: {
1422
- fontSize: "9px",
1423
- color: "#9CA3AF",
1424
- fontWeight: 600,
1425
- textTransform: "uppercase",
1426
- letterSpacing: "0.3px"
1427
- },
1428
- children: "Spend"
1429
- }), /*#__PURE__*/jsx(Typography, {
1430
- sx: {
1431
- fontSize: "13px",
1432
- fontWeight: 700,
1433
- color: "#000",
1434
- mt: 0.3
1435
- },
1436
- children: row.val1
1437
- })]
1438
- }), /*#__PURE__*/jsxs(Box, {
1439
- children: [/*#__PURE__*/jsx(Typography, {
1440
- sx: {
1441
- fontSize: "9px",
1442
- color: "#9CA3AF",
1443
- fontWeight: 600,
1444
- textTransform: "uppercase",
1445
- letterSpacing: "0.3px"
1446
- },
1447
- children: "Revenue"
1448
- }), /*#__PURE__*/jsx(Typography, {
1449
- sx: {
1450
- fontSize: "13px",
1451
- fontWeight: 700,
1452
- color: "#000",
1453
- mt: 0.3
1454
- },
1455
- children: row.val2
1456
- })]
1457
- }), /*#__PURE__*/jsxs(Box, {
1458
- children: [/*#__PURE__*/jsx(Typography, {
1459
- sx: {
1460
- fontSize: "9px",
1461
- color: "#9CA3AF",
1462
- fontWeight: 600,
1463
- textTransform: "uppercase",
1464
- letterSpacing: "0.3px"
1465
- },
1466
- children: "ROAS"
1467
- }), /*#__PURE__*/jsx(Typography, {
1468
- sx: {
1469
- fontSize: "13px",
1470
- fontWeight: 700,
1471
- color: row.val3Color || "#22C55E",
1472
- mt: 0.3
1473
- },
1474
- children: row.val3
1475
- })]
1476
- }), /*#__PURE__*/jsxs(Box, {
1477
- children: [/*#__PURE__*/jsx(Typography, {
1478
- sx: {
1479
- fontSize: "9px",
1480
- color: "#9CA3AF",
1481
- fontWeight: 600,
1482
- textTransform: "uppercase",
1483
- letterSpacing: "0.3px"
1484
- },
1485
- children: "CPA"
1486
- }), /*#__PURE__*/jsx(Typography, {
1487
- sx: {
1488
- fontSize: "13px",
1489
- fontWeight: 700,
1490
- color: "#000",
1491
- mt: 0.3
1492
- },
1493
- children: row.val4
1494
- })]
1495
- })]
1496
- })]
1497
- }, idx);
1295
+ }, idx);
1296
+ })
1297
+ })]
1498
1298
  })
1499
1299
  })]
1500
1300
  });
@@ -1588,99 +1388,6 @@ var MetricCard$1 = function MetricCard(_ref) {
1588
1388
  });
1589
1389
  };
1590
1390
 
1591
- var DisplayCard = function DisplayCard(_ref) {
1592
- var title = _ref.title,
1593
- value = _ref.value,
1594
- subValue = _ref.subValue,
1595
- Icon = _ref.icon,
1596
- onClick = _ref.onClick,
1597
- _ref$sx = _ref.sx,
1598
- sx = _ref$sx === void 0 ? {} : _ref$sx,
1599
- _ref$isActive = _ref.isActive,
1600
- isActive = _ref$isActive === void 0 ? false : _ref$isActive;
1601
- return /*#__PURE__*/jsxs(Box, {
1602
- onClick: onClick,
1603
- sx: _objectSpread2({
1604
- height: "100px",
1605
- borderRadius: "24px",
1606
- display: "flex",
1607
- justifyContent: "space-between",
1608
- alignItems: "center",
1609
- boxShadow: "rgba(0, 0, 0, 0.06) 0px 4px 15px 0px",
1610
- // boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
1611
- // padding: "16px 16px 16px 18px",
1612
- py: "10px",
1613
- px: "16px",
1614
- cursor: "pointer",
1615
- bgcolor: "#fff",
1616
- border: isActive ? "1px solid rgb(99, 99, 230)" : "none",
1617
- // border: "2px solid #f0f0f0",
1618
- transition: "all 0.3s ease"
1619
- }, sx),
1620
- children: [/*#__PURE__*/jsxs(Box, {
1621
- sx: {
1622
- display: "flex",
1623
- flexDirection: "column",
1624
- gap: 0.5
1625
- },
1626
- children: [/*#__PURE__*/jsx(Typography, {
1627
- sx: {
1628
- fontWeight: "400",
1629
- color: isActive ? "#c1c1f5" : "#a1a1a8",
1630
- fontSize: "14px",
1631
- lineHeight: "16px",
1632
- textAlign: "left"
1633
- },
1634
- children: title
1635
- }), /*#__PURE__*/jsx(Typography, {
1636
- sx: {
1637
- lineHeight: "1.2",
1638
- textAlign: "left",
1639
- color: isActive ? "#6363e6" : "#000",
1640
- fontSize: "20px",
1641
- fontWeight: "700",
1642
- mb: 0.5
1643
- },
1644
- children: statusValue(value)
1645
- }), subValue && /*#__PURE__*/jsxs(Typography, {
1646
- sx: {
1647
- fontSize: "11px",
1648
- color: typeof subValue === "string" && (subValue.includes("%") || subValue.includes("new") || subValue.includes("x")) && !subValue.includes("/") && !subValue.includes("pass-through") ? "#22C55E" : "rgba(0, 0, 0, 0.4)",
1649
- fontWeight: "500",
1650
- display: "flex",
1651
- alignItems: "center",
1652
- gap: 0.5
1653
- },
1654
- children: [typeof subValue === "string" && (subValue.includes("%") || subValue.includes("new") || subValue.includes("x")) && !subValue.includes("/") && !subValue.includes("pass-through") && /*#__PURE__*/jsx("span", {
1655
- style: {
1656
- fontSize: "14px"
1657
- },
1658
- children: "\u25B2"
1659
- }), subValue]
1660
- })]
1661
- }), Icon && /*#__PURE__*/jsx(Box, {
1662
- sx: {
1663
- width: "44px",
1664
- height: "44px",
1665
- borderRadius: "50%",
1666
- backgroundColor: "#f7f7ff",
1667
- display: "flex",
1668
- alignItems: "center",
1669
- justifyContent: "center",
1670
- color: "rgb(99, 99, 230)"
1671
- },
1672
- children: /*#__PURE__*/jsx(Icon, {
1673
- sx: {
1674
- fontSize: "20px"
1675
- }
1676
- })
1677
- })]
1678
- });
1679
- };
1680
- var statusValue = function statusValue(value) {
1681
- return _typeof(value) === "object" && value !== null ? value.value !== undefined ? value.value : JSON.stringify(value) : value;
1682
- };
1683
-
1684
1391
  var PURPLE = "#6363E6";
1685
1392
  var REPORT_COLORS = {
1686
1393
  purple: PURPLE};
@@ -4914,6 +4621,8 @@ var DonorMixCard = function DonorMixCard(_ref) {
4914
4621
  border: "1px solid #f0f0f0",
4915
4622
  boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
4916
4623
  p: compact ? 1.5 : 3,
4624
+ // height: "100%",
4625
+ // width: "100%",
4917
4626
  display: "flex",
4918
4627
  flexDirection: "column"
4919
4628
  }, sx),
@@ -4943,6 +4652,7 @@ var DonorMixCard = function DonorMixCard(_ref) {
4943
4652
  sx: {
4944
4653
  position: "relative",
4945
4654
  height: compact ? "110px" : "180px",
4655
+ // mb: 1,
4946
4656
  display: "flex",
4947
4657
  justifyContent: "center"
4948
4658
  },
@@ -4953,16 +4663,14 @@ var DonorMixCard = function DonorMixCard(_ref) {
4953
4663
  width: compact ? "140" : "210"
4954
4664
  })
4955
4665
  }), /*#__PURE__*/jsxs(Box, {
4666
+ sx: {},
4956
4667
  children: [items.map(function (item, idx) {
4957
- var isComingSoon = item.comingSoon;
4958
4668
  return /*#__PURE__*/jsxs(Box, {
4959
4669
  sx: {
4960
4670
  display: "flex",
4961
4671
  justifyContent: "space-between",
4962
4672
  alignItems: "center",
4963
- mb: idx === items.length - 1 ? showBottomSummary ? compact ? 0.5 : 0 : 0 : compact ? 0.5 : 0,
4964
- opacity: isComingSoon ? 0.55 : 1,
4965
- transition: "opacity 0.2s ease"
4673
+ mb: idx === items.length - 1 ? showBottomSummary ? compact ? 0.5 : 0 : 0 : compact ? 0.5 : 0
4966
4674
  },
4967
4675
  children: [/*#__PURE__*/jsxs(Box, {
4968
4676
  sx: {
@@ -4974,38 +4682,31 @@ var DonorMixCard = function DonorMixCard(_ref) {
4974
4682
  sx: {
4975
4683
  width: 10,
4976
4684
  height: 10,
4977
- bgcolor: item.color,
4685
+ bgcolor: item.comingSoon ? "#D1D5DB" : item.color,
4978
4686
  borderRadius: "2px"
4979
4687
  }
4980
4688
  }), /*#__PURE__*/jsx(Typography, {
4981
4689
  sx: {
4982
4690
  fontSize: compact ? "10px" : "13px",
4983
4691
  fontWeight: 500,
4984
- color: isComingSoon ? "#9CA3AF" : "rgba(0, 0, 0, 0.4)"
4692
+ color: item.comingSoon ? "#9CA3AF" : "rgba(0, 0, 0, 0.4)"
4985
4693
  },
4986
4694
  children: item.label
4987
4695
  })]
4988
- }), isComingSoon ? /*#__PURE__*/jsx(Box, {
4696
+ }), item.comingSoon ? /*#__PURE__*/jsx(Box, {
4989
4697
  sx: {
4990
4698
  display: "inline-flex",
4991
4699
  alignItems: "center",
4992
4700
  px: 1,
4993
- py: 0.3,
4701
+ py: 0.2,
4994
4702
  borderRadius: "100px",
4995
4703
  bgcolor: "#F3F4F6",
4996
- border: "1px solid #E5E7EB"
4704
+ color: "#9CA3AF",
4705
+ fontSize: "10px",
4706
+ fontWeight: 700,
4707
+ whiteSpace: "nowrap"
4997
4708
  },
4998
- children: /*#__PURE__*/jsx(Typography, {
4999
- sx: {
5000
- fontSize: "9px",
5001
- fontWeight: 700,
5002
- color: "#6B7280",
5003
- letterSpacing: "0.3px",
5004
- textTransform: "uppercase",
5005
- lineHeight: 1
5006
- },
5007
- children: "Coming Soon"
5008
- })
4709
+ children: "Coming Soon"
5009
4710
  }) : /*#__PURE__*/jsx(Typography, {
5010
4711
  sx: {
5011
4712
  fontSize: compact ? "10px" : "13px",
@@ -5017,6 +4718,9 @@ var DonorMixCard = function DonorMixCard(_ref) {
5017
4718
  }, idx);
5018
4719
  }), showBottomSummary && /*#__PURE__*/jsxs(Box, {
5019
4720
  sx: {
4721
+ // display: "flex",
4722
+ // justifyContent: "space-between",
4723
+ // alignItems: "center",
5020
4724
  pt: compact ? 1 : 2,
5021
4725
  borderTop: "1px solid #f0f0f0",
5022
4726
  textAlign: "left"
@@ -6792,7 +6496,7 @@ var TopCampaignsConvRateCard = function TopCampaignsConvRateCard(_ref7) {
6792
6496
  })]
6793
6497
  });
6794
6498
  };
6795
- var getCampaignInitials$1 = function getCampaignInitials() {
6499
+ var getCampaignInitials$2 = function getCampaignInitials() {
6796
6500
  var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
6797
6501
  var words = name.match(/[A-Za-z]+/g) || [];
6798
6502
  if (words.length >= 2) {
@@ -6915,7 +6619,7 @@ var TopPerformingCampaignsCard = function TopPerformingCampaignsCard(_ref8) {
6915
6619
  fontSize: "10px",
6916
6620
  fontWeight: 700
6917
6621
  },
6918
- children: item.id || getCampaignInitials$1(item.name)
6622
+ children: item.id || getCampaignInitials$2(item.name)
6919
6623
  }), /*#__PURE__*/jsx(Typography, {
6920
6624
  sx: {
6921
6625
  fontSize: "13px",
@@ -17791,6 +17495,89 @@ var OverallSectionSkeleton = function OverallSectionSkeleton() {
17791
17495
  })]
17792
17496
  });
17793
17497
  };
17498
+ var PaidSectionSkeleton = function PaidSectionSkeleton() {
17499
+ return /*#__PURE__*/jsxs(Fragment, {
17500
+ children: [/*#__PURE__*/jsx(MetricCardsSkeleton, {
17501
+ count: 6,
17502
+ gridTemplateColumns: {
17503
+ xs: "1fr",
17504
+ sm: "1fr 1fr",
17505
+ md: "1fr 1fr 1fr",
17506
+ lg: "repeat(6, 1fr)"
17507
+ },
17508
+ gap: 2
17509
+ }), /*#__PURE__*/jsx(Grid, {
17510
+ container: true,
17511
+ spacing: 3,
17512
+ sx: {
17513
+ mt: 2.75
17514
+ },
17515
+ children: /*#__PURE__*/jsx(Grid, {
17516
+ item: true,
17517
+ xs: 12,
17518
+ sx: {
17519
+ paddingTop: "0px !important"
17520
+ },
17521
+ children: /*#__PURE__*/jsx(ChartCardSkeleton, {
17522
+ height: 400
17523
+ })
17524
+ })
17525
+ }), /*#__PURE__*/jsxs(Grid, {
17526
+ container: true,
17527
+ spacing: 3,
17528
+ sx: {
17529
+ mt: 2.25
17530
+ },
17531
+ children: [/*#__PURE__*/jsx(Grid, {
17532
+ item: true,
17533
+ xs: 12,
17534
+ md: 6,
17535
+ sx: {
17536
+ paddingTop: "0px !important",
17537
+ minHeight: 430
17538
+ },
17539
+ children: /*#__PURE__*/jsx(TableCardSkeleton, {})
17540
+ }), /*#__PURE__*/jsx(Grid, {
17541
+ item: true,
17542
+ xs: 12,
17543
+ md: 6,
17544
+ sx: {
17545
+ paddingTop: "0px !important",
17546
+ minHeight: 430
17547
+ },
17548
+ children: /*#__PURE__*/jsx(DonutCardSkeleton, {})
17549
+ })]
17550
+ }), /*#__PURE__*/jsxs(Grid, {
17551
+ container: true,
17552
+ spacing: 3,
17553
+ sx: {
17554
+ mt: 2.25
17555
+ },
17556
+ children: [/*#__PURE__*/jsx(Grid, {
17557
+ item: true,
17558
+ xs: 12,
17559
+ md: 6,
17560
+ sx: {
17561
+ paddingTop: "0px !important"
17562
+ },
17563
+ children: /*#__PURE__*/jsx(TableCardSkeleton, {
17564
+ height: 360,
17565
+ rowCount: 4
17566
+ })
17567
+ }), /*#__PURE__*/jsx(Grid, {
17568
+ item: true,
17569
+ xs: 12,
17570
+ md: 6,
17571
+ sx: {
17572
+ paddingTop: "0px !important"
17573
+ },
17574
+ children: /*#__PURE__*/jsx(PanelCardSkeleton, {
17575
+ height: 360
17576
+ })
17577
+ })]
17578
+ })]
17579
+ });
17580
+ };
17794
17581
  var OrganicSectionSkeleton = function OrganicSectionSkeleton() {
17795
17582
  return /*#__PURE__*/jsxs(Fragment, {
17796
17583
  children: [/*#__PURE__*/jsx(MetricCardsSkeleton, {
@@ -17931,7 +17718,7 @@ var EmailSectionSkeleton = function EmailSectionSkeleton() {
17931
17718
  });
17932
17719
  };
17933
17720
 
17934
- var formatKpi$2 = function formatKpi(value) {
17721
+ var formatKpi$3 = function formatKpi(value) {
17935
17722
  return Number(value !== null && value !== void 0 ? value : 0).toLocaleString("en-US", {
17936
17723
  minimumFractionDigits: 2,
17937
17724
  maximumFractionDigits: 2
@@ -18009,7 +17796,7 @@ var OverallSection = function OverallSection(_ref) {
18009
17796
  };
18010
17797
  var metricInfo = {
18011
17798
  "Total Raised": {
18012
- value: "$".concat(formatKpi$2((_apiData$overviewStat = apiData === null || apiData === void 0 || (_apiData$overviewStat2 = apiData.overviewStats) === null || _apiData$overviewStat2 === void 0 || (_apiData$overviewStat2 = _apiData$overviewStat2.overview) === null || _apiData$overviewStat2 === void 0 ? void 0 : _apiData$overviewStat2.totalRevenue) !== null && _apiData$overviewStat !== void 0 ? _apiData$overviewStat : 0)) || "$0",
17799
+ value: "$".concat(formatKpi$3((_apiData$overviewStat = apiData === null || apiData === void 0 || (_apiData$overviewStat2 = apiData.overviewStats) === null || _apiData$overviewStat2 === void 0 || (_apiData$overviewStat2 = _apiData$overviewStat2.overview) === null || _apiData$overviewStat2 === void 0 ? void 0 : _apiData$overviewStat2.totalRevenue) !== null && _apiData$overviewStat !== void 0 ? _apiData$overviewStat : 0)) || "$0",
18013
17800
  subValue: "".concat(Number((_apiData$overviewStat3 = apiData === null || apiData === void 0 || (_apiData$overviewStat4 = apiData.overviewStats) === null || _apiData$overviewStat4 === void 0 || (_apiData$overviewStat4 = _apiData$overviewStat4.overview) === null || _apiData$overviewStat4 === void 0 || (_apiData$overviewStat4 = _apiData$overviewStat4.growthPercentage) === null || _apiData$overviewStat4 === void 0 ? void 0 : _apiData$overviewStat4.totalRevenue) !== null && _apiData$overviewStat3 !== void 0 ? _apiData$overviewStat3 : 0).toFixed(2), "% vs pp"),
18014
17801
  label: "Total Raised",
18015
17802
  icon: /*#__PURE__*/jsx(PaidOutlined, {}),
@@ -18018,7 +17805,7 @@ var OverallSection = function OverallSection(_ref) {
18018
17805
  warning: false
18019
17806
  },
18020
17807
  "Net Raised": {
18021
- value: "$".concat(formatKpi$2((_apiData$overviewStat5 = apiData === null || apiData === void 0 || (_apiData$overviewStat6 = apiData.overviewStats) === null || _apiData$overviewStat6 === void 0 || (_apiData$overviewStat6 = _apiData$overviewStat6.overview) === null || _apiData$overviewStat6 === void 0 ? void 0 : _apiData$overviewStat6.netRevenue) !== null && _apiData$overviewStat5 !== void 0 ? _apiData$overviewStat5 : 0)),
17808
+ value: "$".concat(formatKpi$3((_apiData$overviewStat5 = apiData === null || apiData === void 0 || (_apiData$overviewStat6 = apiData.overviewStats) === null || _apiData$overviewStat6 === void 0 || (_apiData$overviewStat6 = _apiData$overviewStat6.overview) === null || _apiData$overviewStat6 === void 0 ? void 0 : _apiData$overviewStat6.netRevenue) !== null && _apiData$overviewStat5 !== void 0 ? _apiData$overviewStat5 : 0)),
18022
17809
  subValue: "".concat(Number((_apiData$overviewStat7 = apiData === null || apiData === void 0 || (_apiData$overviewStat8 = apiData.overviewStats) === null || _apiData$overviewStat8 === void 0 || (_apiData$overviewStat8 = _apiData$overviewStat8.overview.growthPercentage) === null || _apiData$overviewStat8 === void 0 ? void 0 : _apiData$overviewStat8.netRevenue) !== null && _apiData$overviewStat7 !== void 0 ? _apiData$overviewStat7 : 0).toFixed(2), "% vs pp\n "),
18023
17810
  label: "Net Raised",
18024
17811
  icon: /*#__PURE__*/jsx(RequestQuoteOutlined, {}),
@@ -18027,7 +17814,7 @@ var OverallSection = function OverallSection(_ref) {
18027
17814
  warning: false
18028
17815
  },
18029
17816
  "Total Donors": {
18030
- value: formatKpi$2((_apiData$overviewStat9 = apiData === null || apiData === void 0 || (_apiData$overviewStat0 = apiData.overviewStats) === null || _apiData$overviewStat0 === void 0 || (_apiData$overviewStat0 = _apiData$overviewStat0.overview) === null || _apiData$overviewStat0 === void 0 ? void 0 : _apiData$overviewStat0.totalDonations) !== null && _apiData$overviewStat9 !== void 0 ? _apiData$overviewStat9 : 0),
17817
+ value: formatKpi$3((_apiData$overviewStat9 = apiData === null || apiData === void 0 || (_apiData$overviewStat0 = apiData.overviewStats) === null || _apiData$overviewStat0 === void 0 || (_apiData$overviewStat0 = _apiData$overviewStat0.overview) === null || _apiData$overviewStat0 === void 0 ? void 0 : _apiData$overviewStat0.totalDonations) !== null && _apiData$overviewStat9 !== void 0 ? _apiData$overviewStat9 : 0),
18031
17818
  subValue: "".concat(Number((_apiData$overviewStat1 = apiData === null || apiData === void 0 || (_apiData$overviewStat10 = apiData.overviewStats) === null || _apiData$overviewStat10 === void 0 || (_apiData$overviewStat10 = _apiData$overviewStat10.overview.growthPercentage) === null || _apiData$overviewStat10 === void 0 ? void 0 : _apiData$overviewStat10.totalDonations) !== null && _apiData$overviewStat1 !== void 0 ? _apiData$overviewStat1 : 0).toFixed(2), "%") || "0 new",
18032
17819
  label: "Total Donors",
18033
17820
  icon: /*#__PURE__*/jsx(PeopleAltOutlined, {}),
@@ -18036,7 +17823,7 @@ var OverallSection = function OverallSection(_ref) {
18036
17823
  warning: false
18037
17824
  },
18038
17825
  "Avg Donation": {
18039
- value: "$".concat(formatKpi$2((_apiData$overviewStat11 = apiData === null || apiData === void 0 || (_apiData$overviewStat12 = apiData.overviewStats) === null || _apiData$overviewStat12 === void 0 || (_apiData$overviewStat12 = _apiData$overviewStat12.overview) === null || _apiData$overviewStat12 === void 0 ? void 0 : _apiData$overviewStat12.overallAVGDonations) !== null && _apiData$overviewStat11 !== void 0 ? _apiData$overviewStat11 : 0)),
17826
+ value: "$".concat(formatKpi$3((_apiData$overviewStat11 = apiData === null || apiData === void 0 || (_apiData$overviewStat12 = apiData.overviewStats) === null || _apiData$overviewStat12 === void 0 || (_apiData$overviewStat12 = _apiData$overviewStat12.overview) === null || _apiData$overviewStat12 === void 0 ? void 0 : _apiData$overviewStat12.overallAVGDonations) !== null && _apiData$overviewStat11 !== void 0 ? _apiData$overviewStat11 : 0)),
18040
17827
  subValue: "".concat(Number((_apiData$overviewStat13 = apiData === null || apiData === void 0 || (_apiData$overviewStat14 = apiData.overviewStats) === null || _apiData$overviewStat14 === void 0 || (_apiData$overviewStat14 = _apiData$overviewStat14.overview.growthPercentage) === null || _apiData$overviewStat14 === void 0 ? void 0 : _apiData$overviewStat14.overallAVGDonations) !== null && _apiData$overviewStat13 !== void 0 ? _apiData$overviewStat13 : 0).toFixed(2), "% vs pp\n "),
18041
17828
  label: "Average Donation Amount",
18042
17829
  icon: /*#__PURE__*/jsx(AverageDonationIcon, {}),
@@ -18045,7 +17832,7 @@ var OverallSection = function OverallSection(_ref) {
18045
17832
  warning: false
18046
17833
  },
18047
17834
  "ROAS": {
18048
- value: "".concat(formatKpi$2((_apiData$overviewStat15 = apiData === null || apiData === void 0 || (_apiData$overviewStat16 = apiData.overviewStats) === null || _apiData$overviewStat16 === void 0 || (_apiData$overviewStat16 = _apiData$overviewStat16.overview) === null || _apiData$overviewStat16 === void 0 ? void 0 : _apiData$overviewStat16.roas) !== null && _apiData$overviewStat15 !== void 0 ? _apiData$overviewStat15 : 0), "x"),
17835
+ value: "".concat(formatKpi$3((_apiData$overviewStat15 = apiData === null || apiData === void 0 || (_apiData$overviewStat16 = apiData.overviewStats) === null || _apiData$overviewStat16 === void 0 || (_apiData$overviewStat16 = _apiData$overviewStat16.overview) === null || _apiData$overviewStat16 === void 0 ? void 0 : _apiData$overviewStat16.roas) !== null && _apiData$overviewStat15 !== void 0 ? _apiData$overviewStat15 : 0), "x"),
18049
17836
  subValue: "".concat(Number((_apiData$overviewStat17 = apiData === null || apiData === void 0 || (_apiData$overviewStat18 = apiData.overviewStats) === null || _apiData$overviewStat18 === void 0 || (_apiData$overviewStat18 = _apiData$overviewStat18.overview) === null || _apiData$overviewStat18 === void 0 || (_apiData$overviewStat18 = _apiData$overviewStat18.growthPercentage) === null || _apiData$overviewStat18 === void 0 ? void 0 : _apiData$overviewStat18.roas) !== null && _apiData$overviewStat17 !== void 0 ? _apiData$overviewStat17 : 0).toFixed(2), "x vs pp"),
18050
17837
  label: "ROAS",
18051
17838
  icon: /*#__PURE__*/jsx(TrendingUp, {}),
@@ -18054,7 +17841,7 @@ var OverallSection = function OverallSection(_ref) {
18054
17841
  warning: false
18055
17842
  },
18056
17843
  "Conversion": {
18057
- value: "".concat(formatKpi$2((_apiData$overviewStat19 = apiData === null || apiData === void 0 || (_apiData$overviewStat20 = apiData.overviewStats) === null || _apiData$overviewStat20 === void 0 || (_apiData$overviewStat20 = _apiData$overviewStat20.overview) === null || _apiData$overviewStat20 === void 0 ? void 0 : _apiData$overviewStat20.conversionRate) !== null && _apiData$overviewStat19 !== void 0 ? _apiData$overviewStat19 : 0), "%"),
17844
+ value: "".concat(formatKpi$3((_apiData$overviewStat19 = apiData === null || apiData === void 0 || (_apiData$overviewStat20 = apiData.overviewStats) === null || _apiData$overviewStat20 === void 0 || (_apiData$overviewStat20 = _apiData$overviewStat20.overview) === null || _apiData$overviewStat20 === void 0 ? void 0 : _apiData$overviewStat20.conversionRate) !== null && _apiData$overviewStat19 !== void 0 ? _apiData$overviewStat19 : 0), "%"),
18058
17845
  subValue: "".concat(((_apiData$overviewStat21 = apiData === null || apiData === void 0 || (_apiData$overviewStat22 = apiData.overviewStats) === null || _apiData$overviewStat22 === void 0 || (_apiData$overviewStat22 = _apiData$overviewStat22.overview) === null || _apiData$overviewStat22 === void 0 || (_apiData$overviewStat22 = _apiData$overviewStat22.growthPercentage) === null || _apiData$overviewStat22 === void 0 ? void 0 : _apiData$overviewStat22.conversionRate) !== null && _apiData$overviewStat21 !== void 0 ? _apiData$overviewStat21 : 0).toFixed(2), "%") || "0%",
18059
17846
  label: "Conversion Rate",
18060
17847
  icon: /*#__PURE__*/jsx(ConversionRateIcon, {}),
@@ -18440,93 +18227,473 @@ var OverallSection$1 = /*#__PURE__*/Object.freeze({
18440
18227
  default: OverallSection
18441
18228
  });
18442
18229
 
18443
- var PaidSection = function PaidSection() {
18230
+ var formatKpi$2 = function formatKpi(value) {
18231
+ return Number(value !== null && value !== void 0 ? value : 0).toLocaleString("en-US", {
18232
+ minimumFractionDigits: 2,
18233
+ maximumFractionDigits: 2
18234
+ });
18235
+ };
18236
+ var CHANNEL_STYLES = {
18237
+ "Meta Ads": {
18238
+ id: "M",
18239
+ icon: SiMeta,
18240
+ avatarBg: "#1877F2",
18241
+ avatarBorder: "#1877F2",
18242
+ color: "#1877F2",
18243
+ comingSoon: false
18244
+ },
18245
+ "Google Ads": {
18246
+ id: "G",
18247
+ icon: SiGoogleads,
18248
+ avatarBg: "#4285F4",
18249
+ avatarBorder: "#4285F4",
18250
+ color: "#4285F4",
18251
+ comingSoon: true
18252
+ },
18253
+ "TikTok Ads": {
18254
+ id: "T",
18255
+ icon: SiTiktok,
18256
+ avatarBg: "#000000",
18257
+ avatarBorder: "#000000",
18258
+ color: "#000000",
18259
+ comingSoon: true
18260
+ },
18261
+ YouTube: {
18262
+ id: "Y",
18263
+ icon: SiYoutube,
18264
+ avatarBg: "#FF0000",
18265
+ avatarBorder: "#FF0000",
18266
+ color: "#FF0000",
18267
+ comingSoon: true
18268
+ },
18269
+ Snapchat: {
18270
+ id: "S",
18271
+ icon: SiSnapchat,
18272
+ avatarBg: "#FFFC00",
18273
+ avatarBorder: "#FFFC00",
18274
+ iconColor: "#8A6D00",
18275
+ color: "#FFFC00",
18276
+ comingSoon: true
18277
+ }
18278
+ };
18279
+ var formatGrowth$2 = function formatGrowth(value) {
18280
+ return "".concat(Number(value !== null && value !== void 0 ? value : 0).toFixed(2), "% vs pp");
18281
+ };
18282
+ var mapTimeSeries$2 = function mapTimeSeries(series) {
18283
+ if (!Array.isArray(series) || series.length === 0) {
18284
+ return {
18285
+ categories: [],
18286
+ data: []
18287
+ };
18288
+ }
18289
+ return {
18290
+ categories: series.map(function (item) {
18291
+ return item.date;
18292
+ }),
18293
+ data: series.map(function (item) {
18294
+ var _item$value;
18295
+ return (_item$value = item.value) !== null && _item$value !== void 0 ? _item$value : 0;
18296
+ })
18297
+ };
18298
+ };
18299
+ var getChannelStyle = function getChannelStyle() {
18300
+ var channel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
18301
+ return CHANNEL_STYLES[channel] || {
18302
+ id: channel.slice(0, 1).toUpperCase() || "?",
18303
+ avatarBg: "#F3F4F6",
18304
+ color: "#6366F1",
18305
+ comingSoon: true
18306
+ };
18307
+ };
18308
+ var mapChannelTrend = function mapChannelTrend(trend) {
18309
+ var normalized = (trend || "stable").toLowerCase();
18310
+ if (normalized === "down" || normalized === "declining") {
18311
+ return {
18312
+ type: "trend",
18313
+ trendType: "down",
18314
+ trendLabel: "Declining"
18315
+ };
18316
+ }
18317
+ if (normalized === "up" || normalized === "improving") {
18318
+ return {
18319
+ type: "trend",
18320
+ trendType: "up",
18321
+ trendLabel: "Improving"
18322
+ };
18323
+ }
18324
+ return {
18325
+ type: "status",
18326
+ status: "Stable",
18327
+ statusBg: "#F3F4F6",
18328
+ statusColor: "#6B7280"
18329
+ };
18330
+ };
18331
+ var getRoasColor = function getRoasColor(roas) {
18332
+ return Number(roas !== null && roas !== void 0 ? roas : 0) >= 2.5 ? "#22C55E" : "#EF4444";
18333
+ };
18334
+ var getCampaignInitials$1 = function getCampaignInitials() {
18335
+ var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
18336
+ var words = name.trim().split(/\s+/).filter(Boolean);
18337
+ if (words.length >= 2) {
18338
+ return (words[0][0] + words[1][0]).toUpperCase();
18339
+ }
18340
+ return name.slice(0, 2).toUpperCase() || "—";
18341
+ };
18342
+ var buildEmptySpendAllocation = function buildEmptySpendAllocation() {
18343
+ var channels = Object.keys(CHANNEL_STYLES);
18344
+ return {
18345
+ series: channels.map(function () {
18346
+ return 0;
18347
+ }),
18348
+ labels: channels,
18349
+ colors: channels.map(function (channel) {
18350
+ return CHANNEL_STYLES[channel].color;
18351
+ }),
18352
+ centerLabel: "total spend",
18353
+ centerValue: "$".concat(formatNumber(0)),
18354
+ subtitle: "Where $".concat(formatNumber(0), " went"),
18355
+ items: channels.map(function (channel) {
18356
+ return {
18357
+ label: channel,
18358
+ val: "0.0%",
18359
+ color: CHANNEL_STYLES[channel].color,
18360
+ comingSoon: CHANNEL_STYLES[channel].comingSoon
18361
+ };
18362
+ })
18363
+ };
18364
+ };
18365
+ var PaidSection = function PaidSection(_ref) {
18366
+ var _ref2, _rawOverview$totalSpe, _ref3, _rawOverview$totalRev, _ref4, _rawOverview$roas, _ref5, _rawOverview$costPerD, _rawOverview$conversi, _ref6, _rawOverview$averageD, _ref7, _rawOverview$totalDon, _ref8, _rawOverview$growthPe, _rawOverview$growthPe2, _ref9, _rawOverview$growthPe3, _rawOverview$growthPe4, _ref0, _rawOverview$growthPe5, _rawOverview$growthPe6, _rawOverview$growthPe7, _rawOverview$growthPe8, _rawOverview$growthPe9, _rawOverview$growthPe0, _rawOverview$growthPe1, _rawOverview$growthPe10, _apiData$spendVsReven, _apiData$spendVsReven2, _selectedInfo$categor, _spendAllocation$subt, _spendAllocation$seri, _spendAllocation$labe, _spendAllocation$colo, _spendAllocation$cent, _spendAllocation$cent2, _spendAllocation$item;
18367
+ var _ref$apiData = _ref.apiData,
18368
+ apiData = _ref$apiData === void 0 ? {} : _ref$apiData;
18369
+ _ref.dateName;
18370
+ var _ref$apiLoading = _ref.apiLoading,
18371
+ apiLoading = _ref$apiLoading === void 0 ? false : _ref$apiLoading,
18372
+ _ref$numberOfDays = _ref.numberOfDays,
18373
+ numberOfDays = _ref$numberOfDays === void 0 ? 30 : _ref$numberOfDays;
18444
18374
  var _useState = useState("Total Spent"),
18445
18375
  _useState2 = _slicedToArray(_useState, 2),
18446
18376
  activeMetric = _useState2[0],
18447
18377
  setActiveMetric = _useState2[1];
18448
- var categories = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
18449
- var metricInfo = {
18450
- "Total Spent": {
18451
- value: "$80,313",
18452
- subValue: "12% vs last month",
18453
- chartLabel: "Daily Spend",
18454
- data: [800, 950, 700, 1100, 900, 1200, 1300],
18455
- icon: IndeterminateCheckBoxOutlined
18456
- },
18457
- "Revinue Raised": {
18458
- value: "$240,398",
18459
- subValue: "12% vs last month",
18460
- chartLabel: "Daily Revenue",
18461
- data: [3200, 4100, 2800, 5600, 4200, 6100, 7500],
18462
- icon: PaidOutlined
18463
- },
18464
- ROAS: {
18465
- value: "3.0",
18466
- subValue: "12% vs last month",
18467
- chartLabel: "ROAS Trend",
18468
- data: [2.5, 3.1, 2.8, 4.2, 3.8, 4.5, 5.2],
18469
- icon: TrendingUp
18470
- },
18471
- "Cost per donor": {
18472
- value: "$373",
18473
- subValue: "12% vs last month",
18474
- chartLabel: "CPA Trend",
18475
- data: [350, 380, 360, 410, 390, 370, 373],
18476
- icon: PersonOutlined
18477
- },
18478
- "Conversion rate": {
18479
- value: "3.1%",
18480
- subValue: "12% vs last month",
18481
- chartLabel: "Conversion Rate",
18482
- data: [2.8, 3.0, 2.9, 3.4, 3.2, 3.1, 3.1],
18483
- icon: Adjust
18484
- },
18485
- "Avg donation": {
18486
- value: "$130.58",
18487
- subValue: "12% vs last month",
18488
- chartLabel: "Average Donation",
18489
- data: [120, 135, 125, 140, 130, 128, 130.58],
18490
- icon: PaidOutlined
18378
+ var rawOverview = (apiData === null || apiData === void 0 ? void 0 : apiData.overview) || {};
18379
+ var metaSummary = (apiData === null || apiData === void 0 ? void 0 : apiData.metaSummary) || {};
18380
+ var overview = {
18381
+ totalSpent: (_ref2 = (_rawOverview$totalSpe = rawOverview.totalSpent) !== null && _rawOverview$totalSpe !== void 0 ? _rawOverview$totalSpe : metaSummary.metaSpend) !== null && _ref2 !== void 0 ? _ref2 : 0,
18382
+ totalRevenue: (_ref3 = (_rawOverview$totalRev = rawOverview.totalRevenue) !== null && _rawOverview$totalRev !== void 0 ? _rawOverview$totalRev : metaSummary.attributedAmount) !== null && _ref3 !== void 0 ? _ref3 : 0,
18383
+ roas: (_ref4 = (_rawOverview$roas = rawOverview.roas) !== null && _rawOverview$roas !== void 0 ? _rawOverview$roas : metaSummary.roas) !== null && _ref4 !== void 0 ? _ref4 : 0,
18384
+ costPerDonor: (_ref5 = (_rawOverview$costPerD = rawOverview.costPerDonor) !== null && _rawOverview$costPerD !== void 0 ? _rawOverview$costPerD : metaSummary.cpa) !== null && _ref5 !== void 0 ? _ref5 : 0,
18385
+ conversionRate: (_rawOverview$conversi = rawOverview.conversionRate) !== null && _rawOverview$conversi !== void 0 ? _rawOverview$conversi : 0,
18386
+ averageDonation: (_ref6 = (_rawOverview$averageD = rawOverview.averageDonation) !== null && _rawOverview$averageD !== void 0 ? _rawOverview$averageD : metaSummary.averageGift) !== null && _ref6 !== void 0 ? _ref6 : 0,
18387
+ totalDonations: (_ref7 = (_rawOverview$totalDon = rawOverview.totalDonations) !== null && _rawOverview$totalDon !== void 0 ? _rawOverview$totalDon : metaSummary.donationsCount) !== null && _ref7 !== void 0 ? _ref7 : 0
18388
+ };
18389
+ var growth = {
18390
+ totalSpent: (_ref8 = (_rawOverview$growthPe = (_rawOverview$growthPe2 = rawOverview.growthPercentage) === null || _rawOverview$growthPe2 === void 0 ? void 0 : _rawOverview$growthPe2.totalSpent) !== null && _rawOverview$growthPe !== void 0 ? _rawOverview$growthPe : metaSummary.metaSpendChangePercent) !== null && _ref8 !== void 0 ? _ref8 : 0,
18391
+ totalRevenue: (_ref9 = (_rawOverview$growthPe3 = (_rawOverview$growthPe4 = rawOverview.growthPercentage) === null || _rawOverview$growthPe4 === void 0 ? void 0 : _rawOverview$growthPe4.totalRevenue) !== null && _rawOverview$growthPe3 !== void 0 ? _rawOverview$growthPe3 : metaSummary.attributedChangePercent) !== null && _ref9 !== void 0 ? _ref9 : 0,
18392
+ roas: (_ref0 = (_rawOverview$growthPe5 = (_rawOverview$growthPe6 = rawOverview.growthPercentage) === null || _rawOverview$growthPe6 === void 0 ? void 0 : _rawOverview$growthPe6.roas) !== null && _rawOverview$growthPe5 !== void 0 ? _rawOverview$growthPe5 : metaSummary.roasChange) !== null && _ref0 !== void 0 ? _ref0 : 0,
18393
+ costPerDonor: (_rawOverview$growthPe7 = (_rawOverview$growthPe8 = rawOverview.growthPercentage) === null || _rawOverview$growthPe8 === void 0 ? void 0 : _rawOverview$growthPe8.costPerDonor) !== null && _rawOverview$growthPe7 !== void 0 ? _rawOverview$growthPe7 : 0,
18394
+ conversionRate: (_rawOverview$growthPe9 = (_rawOverview$growthPe0 = rawOverview.growthPercentage) === null || _rawOverview$growthPe0 === void 0 ? void 0 : _rawOverview$growthPe0.conversionRate) !== null && _rawOverview$growthPe9 !== void 0 ? _rawOverview$growthPe9 : 0,
18395
+ averageDonation: (_rawOverview$growthPe1 = (_rawOverview$growthPe10 = rawOverview.growthPercentage) === null || _rawOverview$growthPe10 === void 0 ? void 0 : _rawOverview$growthPe10.averageDonation) !== null && _rawOverview$growthPe1 !== void 0 ? _rawOverview$growthPe1 : 0
18396
+ };
18397
+ var hasPaidOverview = Boolean(apiData === null || apiData === void 0 ? void 0 : apiData.overview);
18398
+ var spendSeries = mapTimeSeries$2(apiData === null || apiData === void 0 || (_apiData$spendVsReven = apiData.spendVsRevenue) === null || _apiData$spendVsReven === void 0 ? void 0 : _apiData$spendVsReven.spend);
18399
+ var revenueSeries = mapTimeSeries$2(apiData === null || apiData === void 0 || (_apiData$spendVsReven2 = apiData.spendVsRevenue) === null || _apiData$spendVsReven2 === void 0 ? void 0 : _apiData$spendVsReven2.revenue);
18400
+ var roasChartData = useMemo(function () {
18401
+ if (spendSeries.data.length === 0 || revenueSeries.data.length === 0) {
18402
+ return [];
18491
18403
  }
18404
+ var length = Math.min(spendSeries.data.length, revenueSeries.data.length);
18405
+ return Array.from({
18406
+ length: length
18407
+ }, function (_, index) {
18408
+ var _spendSeries$data$ind, _revenueSeries$data$i;
18409
+ var spend = (_spendSeries$data$ind = spendSeries.data[index]) !== null && _spendSeries$data$ind !== void 0 ? _spendSeries$data$ind : 0;
18410
+ var revenue = (_revenueSeries$data$i = revenueSeries.data[index]) !== null && _revenueSeries$data$i !== void 0 ? _revenueSeries$data$i : 0;
18411
+ return spend > 0 ? revenue / spend : 0;
18412
+ });
18413
+ }, [spendSeries.data, revenueSeries.data]);
18414
+ var fallbackCategories = spendSeries.categories.length ? spendSeries.categories : revenueSeries.categories.length ? revenueSeries.categories : ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
18415
+ var flatSeries = function flatSeries(value) {
18416
+ return fallbackCategories.length > 0 ? fallbackCategories.map(function () {
18417
+ return Number(value !== null && value !== void 0 ? value : 0);
18418
+ }) : [Number(value !== null && value !== void 0 ? value : 0)];
18492
18419
  };
18420
+ var metricInfo = useMemo(function () {
18421
+ if (!hasPaidOverview) {
18422
+ return {
18423
+ "Total Spent": {
18424
+ value: "$".concat(formatKpi$2(0)),
18425
+ subValue: formatGrowth$2(0),
18426
+ data: flatSeries(0),
18427
+ categories: fallbackCategories,
18428
+ icon: /*#__PURE__*/jsx(IndeterminateCheckBoxOutlined, {}),
18429
+ money: true,
18430
+ error: false,
18431
+ warning: false
18432
+ },
18433
+ "Revenue Raised": {
18434
+ value: "$".concat(formatKpi$2(0)),
18435
+ subValue: formatGrowth$2(0),
18436
+ data: flatSeries(0),
18437
+ categories: fallbackCategories,
18438
+ icon: /*#__PURE__*/jsx(PaidOutlined, {}),
18439
+ money: true,
18440
+ error: false,
18441
+ warning: false
18442
+ },
18443
+ ROAS: {
18444
+ value: "".concat(formatKpi$2(0), "x"),
18445
+ subValue: formatGrowth$2(0),
18446
+ data: flatSeries(0),
18447
+ categories: fallbackCategories,
18448
+ icon: /*#__PURE__*/jsx(TrendingUp, {}),
18449
+ money: false,
18450
+ error: false,
18451
+ warning: false
18452
+ },
18453
+ "Cost Per Donor": {
18454
+ value: "$".concat(formatKpi$2(0)),
18455
+ subValue: formatGrowth$2(0),
18456
+ data: flatSeries(0),
18457
+ categories: fallbackCategories,
18458
+ icon: /*#__PURE__*/jsx(PersonOutlined, {}),
18459
+ money: true,
18460
+ error: false,
18461
+ warning: false
18462
+ },
18463
+ "Conversion Rate": {
18464
+ value: "".concat(formatKpi$2(0), "%"),
18465
+ subValue: formatGrowth$2(0),
18466
+ data: flatSeries(0),
18467
+ categories: fallbackCategories,
18468
+ icon: /*#__PURE__*/jsx(ConversionRateIcon, {}),
18469
+ money: false,
18470
+ error: false,
18471
+ warning: false
18472
+ },
18473
+ "Avg Donation": {
18474
+ value: "$".concat(formatKpi$2(0)),
18475
+ subValue: formatGrowth$2(0),
18476
+ data: flatSeries(0),
18477
+ categories: fallbackCategories,
18478
+ icon: /*#__PURE__*/jsx(AverageDonationIcon, {}),
18479
+ money: true,
18480
+ error: false,
18481
+ warning: false
18482
+ }
18483
+ };
18484
+ }
18485
+ var chartCategories = spendSeries.categories.length > 0 ? spendSeries.categories : revenueSeries.categories.length > 0 ? revenueSeries.categories : fallbackCategories;
18486
+ return {
18487
+ "Total Spent": {
18488
+ value: "$".concat(formatKpi$2(overview.totalSpent)),
18489
+ subValue: formatGrowth$2(growth.totalSpent),
18490
+ data: spendSeries.data.length > 0 ? spendSeries.data : flatSeries(0),
18491
+ categories: chartCategories,
18492
+ icon: /*#__PURE__*/jsx(IndeterminateCheckBoxOutlined, {}),
18493
+ money: true,
18494
+ error: false,
18495
+ warning: false
18496
+ },
18497
+ "Revenue Raised": {
18498
+ value: "$".concat(formatKpi$2(overview.totalRevenue)),
18499
+ subValue: formatGrowth$2(growth.totalRevenue),
18500
+ data: revenueSeries.data.length > 0 ? revenueSeries.data : flatSeries(0),
18501
+ categories: chartCategories,
18502
+ icon: /*#__PURE__*/jsx(PaidOutlined, {}),
18503
+ money: true,
18504
+ error: false,
18505
+ warning: false
18506
+ },
18507
+ ROAS: {
18508
+ value: "".concat(formatKpi$2(overview.roas), "x"),
18509
+ subValue: formatGrowth$2(growth.roas),
18510
+ data: roasChartData.length > 0 ? roasChartData : flatSeries(0),
18511
+ categories: chartCategories,
18512
+ icon: /*#__PURE__*/jsx(TrendingUp, {}),
18513
+ money: false,
18514
+ error: false,
18515
+ warning: false
18516
+ },
18517
+ "Cost Per Donor": {
18518
+ value: "$".concat(formatKpi$2(overview.costPerDonor)),
18519
+ subValue: formatGrowth$2(growth.costPerDonor),
18520
+ data: flatSeries(overview.costPerDonor),
18521
+ categories: chartCategories,
18522
+ icon: /*#__PURE__*/jsx(PersonOutlined, {}),
18523
+ money: true,
18524
+ error: false,
18525
+ warning: false
18526
+ },
18527
+ "Conversion Rate": {
18528
+ value: "".concat(formatKpi$2(overview.conversionRate), "%"),
18529
+ subValue: formatGrowth$2(growth.conversionRate),
18530
+ data: flatSeries(overview.conversionRate),
18531
+ categories: chartCategories,
18532
+ icon: /*#__PURE__*/jsx(ConversionRateIcon, {}),
18533
+ money: false,
18534
+ error: false,
18535
+ warning: false
18536
+ },
18537
+ "Avg Donation": {
18538
+ value: "$".concat(formatKpi$2(overview.averageDonation)),
18539
+ subValue: formatGrowth$2(growth.averageDonation),
18540
+ data: flatSeries(overview.averageDonation),
18541
+ categories: chartCategories,
18542
+ icon: /*#__PURE__*/jsx(AverageDonationIcon, {}),
18543
+ money: true,
18544
+ error: false,
18545
+ warning: false
18546
+ }
18547
+ };
18548
+ }, [fallbackCategories, growth, hasPaidOverview, overview, revenueSeries, roasChartData, spendSeries]);
18549
+ var channelRows = useMemo(function () {
18550
+ var channels = apiData === null || apiData === void 0 ? void 0 : apiData.channelPerformance;
18551
+ if (!hasPaidOverview) return [];
18552
+ if (!Array.isArray(channels) || channels.length === 0) return [];
18553
+ return channels.map(function (item) {
18554
+ var _item$roas, _item$spend, _item$revenue, _item$cpa;
18555
+ var style = getChannelStyle(item.channel);
18556
+ var roas = Number((_item$roas = item.roas) !== null && _item$roas !== void 0 ? _item$roas : 0);
18557
+ return _objectSpread2({
18558
+ id: style.id,
18559
+ icon: style.icon,
18560
+ avatarBg: style.avatarBg,
18561
+ avatarBorder: style.avatarBorder,
18562
+ iconColor: style.iconColor || style.avatarBorder,
18563
+ comingSoon: style.comingSoon,
18564
+ name: item.channel,
18565
+ val1: "$".concat(formatNumber((_item$spend = item.spend) !== null && _item$spend !== void 0 ? _item$spend : 0)),
18566
+ val2: "$".concat(formatNumber((_item$revenue = item.revenue) !== null && _item$revenue !== void 0 ? _item$revenue : 0)),
18567
+ val3: "".concat(roas.toFixed(1), "x"),
18568
+ val4: "$".concat(formatNumber((_item$cpa = item.cpa) !== null && _item$cpa !== void 0 ? _item$cpa : 0)),
18569
+ highlightVal3: true,
18570
+ val3Color: getRoasColor(roas)
18571
+ }, mapChannelTrend(item.trend));
18572
+ });
18573
+ }, [apiData === null || apiData === void 0 ? void 0 : apiData.channelPerformance, hasPaidOverview]);
18574
+ var spendAllocation = useMemo(function () {
18575
+ var _allocation$totalSpen, _allocation$totalSpen2;
18576
+ var allocation = apiData === null || apiData === void 0 ? void 0 : apiData.spendAllocation;
18577
+ if (!hasPaidOverview) return [];
18578
+ if (!allocation || !Array.isArray(allocation.data) || allocation.data.length === 0) {
18579
+ return buildEmptySpendAllocation();
18580
+ }
18581
+ var items = allocation.data.map(function (item) {
18582
+ var _item$percentage, _item$spend2, _item$percentage2;
18583
+ var style = getChannelStyle(item.channel);
18584
+ return {
18585
+ label: item.channel,
18586
+ val: "".concat(Number((_item$percentage = item.percentage) !== null && _item$percentage !== void 0 ? _item$percentage : 0).toFixed(1), "%"),
18587
+ color: style.color,
18588
+ spend: (_item$spend2 = item.spend) !== null && _item$spend2 !== void 0 ? _item$spend2 : 0,
18589
+ percentage: (_item$percentage2 = item.percentage) !== null && _item$percentage2 !== void 0 ? _item$percentage2 : 0,
18590
+ comingSoon: style.comingSoon
18591
+ };
18592
+ });
18593
+ return {
18594
+ series: items.map(function (item) {
18595
+ return item.percentage;
18596
+ }),
18597
+ labels: items.map(function (item) {
18598
+ return item.label;
18599
+ }),
18600
+ colors: items.map(function (item) {
18601
+ return item.color;
18602
+ }),
18603
+ centerLabel: "total spend",
18604
+ centerValue: "$".concat(formatNumber((_allocation$totalSpen = allocation.totalSpend) !== null && _allocation$totalSpen !== void 0 ? _allocation$totalSpen : 0)),
18605
+ subtitle: "Where $".concat(formatNumber((_allocation$totalSpen2 = allocation.totalSpend) !== null && _allocation$totalSpen2 !== void 0 ? _allocation$totalSpen2 : 0), " went"),
18606
+ items: items.map(function (_ref1) {
18607
+ var label = _ref1.label,
18608
+ val = _ref1.val,
18609
+ color = _ref1.color,
18610
+ comingSoon = _ref1.comingSoon;
18611
+ return {
18612
+ label: label,
18613
+ val: val,
18614
+ color: color,
18615
+ comingSoon: comingSoon
18616
+ };
18617
+ })
18618
+ };
18619
+ }, [apiData === null || apiData === void 0 ? void 0 : apiData.spendAllocation, hasPaidOverview]);
18620
+ var topCampaignsData = useMemo(function () {
18621
+ var campaigns = apiData === null || apiData === void 0 ? void 0 : apiData.topCampaigns;
18622
+ if (!hasPaidOverview) return [];
18623
+ if (!Array.isArray(campaigns)) return [];
18624
+ if (campaigns.length === 0) return [];
18625
+ return campaigns.map(function (item) {
18626
+ var _item$spend3, _item$revenue2, _item$roas2;
18627
+ var name = item.campaignName || item.campaign || item.name || "Unknown";
18628
+ return {
18629
+ id: getCampaignInitials$1(name),
18630
+ name: name,
18631
+ spend: "$".concat(formatNumber((_item$spend3 = item.spend) !== null && _item$spend3 !== void 0 ? _item$spend3 : 0)),
18632
+ revenue: "$".concat(formatNumber((_item$revenue2 = item.revenue) !== null && _item$revenue2 !== void 0 ? _item$revenue2 : 0)),
18633
+ roas: "".concat(Number((_item$roas2 = item.roas) !== null && _item$roas2 !== void 0 ? _item$roas2 : 0).toFixed(1), "x")
18634
+ };
18635
+ });
18636
+ }, [apiData === null || apiData === void 0 ? void 0 : apiData.topCampaigns, hasPaidOverview]);
18637
+ var donorGeographyData = useMemo(function () {
18638
+ var geography = apiData === null || apiData === void 0 ? void 0 : apiData.donorGeography;
18639
+ if (!hasPaidOverview) return [];
18640
+ var rawCountries = Array.isArray(geography) ? geography : (geography === null || geography === void 0 ? void 0 : geography.countries) || (geography === null || geography === void 0 ? void 0 : geography.data) || [];
18641
+ return Array.isArray(rawCountries) ? rawCountries : [];
18642
+ }, [apiData === null || apiData === void 0 ? void 0 : apiData.donorGeography, hasPaidOverview]);
18493
18643
  var renderCard = function renderCard(title) {
18494
- return /*#__PURE__*/jsx(DisplayCard, {
18644
+ return /*#__PURE__*/jsx(MetricCard$1, {
18495
18645
  title: title,
18496
18646
  value: metricInfo[title].value,
18497
- subValue: metricInfo[title].subValue,
18647
+ caption: metricInfo[title].subValue,
18498
18648
  icon: metricInfo[title].icon,
18649
+ error: metricInfo[title].error,
18650
+ active: activeMetric === title,
18499
18651
  onClick: function onClick() {
18500
18652
  return setActiveMetric(title);
18501
18653
  },
18502
- isActive: activeMetric === title,
18503
- sx: {
18504
- flex: 1
18654
+ sx: metricInfo[title].error ? {
18655
+ border: "2px solid #ef4444",
18656
+ bgcolor: "#fffafa",
18657
+ cursor: "pointer"
18658
+ } : {
18659
+ cursor: "pointer"
18505
18660
  }
18506
- }, title);
18661
+ });
18507
18662
  };
18508
- var selectedInfo = metricInfo[activeMetric];
18663
+ var selectedInfo = metricInfo[activeMetric] || metricInfo["Total Spent"];
18664
+ var emptySpendAllocation = buildEmptySpendAllocation();
18665
+ var chartCategories = ((_selectedInfo$categor = selectedInfo.categories) === null || _selectedInfo$categor === void 0 ? void 0 : _selectedInfo$categor.length) > 0 ? selectedInfo.categories : fallbackCategories;
18509
18666
  var mainChart = {
18510
18667
  label: activeMetric,
18511
18668
  value: selectedInfo.value,
18512
18669
  trend: selectedInfo.subValue,
18513
18670
  data: selectedInfo.data,
18514
- categories: categories
18671
+ categories: chartCategories,
18672
+ hideControls: true,
18673
+ isAmount: selectedInfo.money
18515
18674
  };
18675
+ if (apiLoading) {
18676
+ return /*#__PURE__*/jsx(PaidSectionSkeleton, {});
18677
+ }
18516
18678
  return /*#__PURE__*/jsxs(Fragment, {
18517
18679
  children: [/*#__PURE__*/jsx(Box, {
18518
18680
  sx: {
18519
- display: "flex",
18520
- gap: 2,
18521
- mb: 1,
18522
- flexWrap: "wrap"
18681
+ display: "grid",
18682
+ gridTemplateColumns: {
18683
+ xs: "1fr",
18684
+ sm: "1fr 1fr",
18685
+ md: "1fr 1fr 1fr",
18686
+ lg: "repeat(6, 1fr)"
18687
+ },
18688
+ gap: "6px",
18689
+ mb: 0
18523
18690
  },
18524
18691
  children: Object.keys(metricInfo).map(renderCard)
18525
18692
  }), /*#__PURE__*/jsx(Grid, {
18526
18693
  container: true,
18527
18694
  spacing: 3,
18528
18695
  sx: {
18529
- mt: 1
18696
+ mt: "12px"
18530
18697
  },
18531
18698
  children: /*#__PURE__*/jsx(RenderChartCard, {
18532
18699
  item: mainChart,
@@ -18534,125 +18701,61 @@ var PaidSection = function PaidSection() {
18534
18701
  md: 12,
18535
18702
  type: "area",
18536
18703
  isPrimary: true,
18537
- isPremium: true
18704
+ isPremium: true,
18705
+ numberOfDays: numberOfDays,
18706
+ metric: activeMetric === "Conversion Rate" ? "Percent" : activeMetric === "ROAS" ? "ROAS" : selectedInfo.money ? "Revenue" : "Donors"
18538
18707
  })
18539
18708
  }), /*#__PURE__*/jsxs(Grid, {
18540
18709
  container: true,
18541
18710
  spacing: 3,
18542
18711
  sx: {
18543
- mt: 3
18712
+ mt: "6px"
18544
18713
  },
18545
18714
  children: [/*#__PURE__*/jsx(Grid, {
18546
18715
  item: true,
18547
18716
  xs: 12,
18548
18717
  md: 6,
18718
+ sx: {
18719
+ paddingTop: "0px !important",
18720
+ minHeight: "430px"
18721
+ },
18549
18722
  children: /*#__PURE__*/jsx(ActiveCampaignsCard, {
18550
- title: "Channel performance",
18723
+ title: "Channel Performance",
18551
18724
  subtitle: "Ad platforms ranked by ROAS",
18552
- columns: ["channel", "spend", "revenue", "ROAS", "CPA", "trend"],
18725
+ columns: ["Channel", "Ppend", "Revenue", "ROAS", "CPA", "Trend"],
18553
18726
  gridTemplateColumns: "2.2fr 1fr 1fr 0.8fr 0.8fr 1.2fr",
18554
- rows: [{
18555
- id: "M",
18556
- avatarBg: "#4267B2",
18557
- avatarColor: "#fff",
18558
- name: "Meta Ads",
18559
- val1: "$32,800",
18560
- val2: "$112,400",
18561
- val3: "3.4x",
18562
- val4: "$340",
18563
- type: "trend",
18564
- trendType: "up",
18565
- trendLabel: "Improving",
18566
- highlightVal3: true,
18567
- val3Color: "#22C55E",
18568
- comingSoon: false
18569
- }, {
18570
- id: "G",
18571
- avatarBg: "#C4C4C4",
18572
- avatarColor: "#fff",
18573
- name: "Google Ads",
18574
- val1: "—",
18575
- val2: "—",
18576
- val3: "—",
18577
- val4: "—",
18578
- type: "comingSoon",
18579
- comingSoon: true
18580
- }, {
18581
- id: "T",
18582
- avatarBg: "#C4C4C4",
18583
- avatarColor: "#fff",
18584
- name: "TikTok Ads",
18585
- val1: "—",
18586
- val2: "—",
18587
- val3: "—",
18588
- val4: "—",
18589
- type: "comingSoon",
18590
- comingSoon: true
18591
- }, {
18592
- id: "Y",
18593
- avatarBg: "#C4C4C4",
18594
- avatarColor: "#fff",
18595
- name: "YouTube",
18596
- val1: "—",
18597
- val2: "—",
18598
- val3: "—",
18599
- val4: "—",
18600
- type: "comingSoon",
18601
- comingSoon: true
18602
- }, {
18603
- id: "S",
18604
- avatarBg: "#C4C4C4",
18605
- avatarColor: "#fff",
18606
- name: "Snapchat",
18607
- val1: "—",
18608
- val2: "—",
18609
- val3: "—",
18610
- val4: "—",
18611
- type: "comingSoon",
18612
- comingSoon: true
18613
- }]
18727
+ height: "100%",
18728
+ rows: channelRows !== null && channelRows !== void 0 ? channelRows : []
18614
18729
  })
18615
18730
  }), /*#__PURE__*/jsx(Grid, {
18616
18731
  item: true,
18617
18732
  xs: 12,
18618
18733
  md: 6,
18734
+ sx: {
18735
+ paddingTop: "0px !important",
18736
+ minHeight: "430px",
18737
+ paddingLeft: {
18738
+ xs: "24px !important",
18739
+ md: "6px !important"
18740
+ },
18741
+ marginTop: {
18742
+ xs: "6px",
18743
+ md: "0px"
18744
+ }
18745
+ },
18619
18746
  children: /*#__PURE__*/jsx(DonorMixCard, {
18620
- title: "Spend allocation",
18621
- subtitle: "Where $80.3K went this month",
18622
- series: [100],
18623
- labels: ["Meta Ads"],
18624
- colors: ["#4267B2"],
18625
- centerLabel: "total spend",
18626
- centerValue: "$80.3K",
18627
- items: [{
18628
- label: "Meta Ads",
18629
- val: "100%",
18630
- color: "#4267B2",
18631
- comingSoon: false
18632
- }, {
18633
- label: "Google Ads",
18634
- val: "Coming Soon",
18635
- color: "#C4C4C4",
18636
- comingSoon: true
18637
- }, {
18638
- label: "TikTok",
18639
- val: "Coming Soon",
18640
- color: "#C4C4C4",
18641
- comingSoon: true
18642
- }, {
18643
- label: "YouTube",
18644
- val: "Coming Soon",
18645
- color: "#C4C4C4",
18646
- comingSoon: true
18647
- }, {
18648
- label: "Snapchat",
18649
- val: "Coming Soon",
18650
- color: "#C4C4C4",
18651
- comingSoon: true
18652
- }],
18747
+ title: "Spend Allocation",
18748
+ subtitle: (_spendAllocation$subt = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.subtitle) !== null && _spendAllocation$subt !== void 0 ? _spendAllocation$subt : emptySpendAllocation.subtitle,
18749
+ series: (_spendAllocation$seri = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.series) !== null && _spendAllocation$seri !== void 0 ? _spendAllocation$seri : emptySpendAllocation.series,
18750
+ labels: (_spendAllocation$labe = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.labels) !== null && _spendAllocation$labe !== void 0 ? _spendAllocation$labe : emptySpendAllocation.labels,
18751
+ colors: (_spendAllocation$colo = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.colors) !== null && _spendAllocation$colo !== void 0 ? _spendAllocation$colo : emptySpendAllocation.colors,
18752
+ centerLabel: (_spendAllocation$cent = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.centerLabel) !== null && _spendAllocation$cent !== void 0 ? _spendAllocation$cent : "total spend",
18753
+ centerValue: (_spendAllocation$cent2 = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.centerValue) !== null && _spendAllocation$cent2 !== void 0 ? _spendAllocation$cent2 : emptySpendAllocation.centerValue,
18754
+ items: (_spendAllocation$item = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.items) !== null && _spendAllocation$item !== void 0 ? _spendAllocation$item : emptySpendAllocation.items,
18653
18755
  showBottomSummary: false,
18654
18756
  sx: {
18655
- pb: 3.5
18757
+ pb: 3.5,
18758
+ height: "100%"
18656
18759
  }
18657
18760
  })
18658
18761
  })]
@@ -18660,18 +18763,44 @@ var PaidSection = function PaidSection() {
18660
18763
  container: true,
18661
18764
  spacing: 3,
18662
18765
  sx: {
18663
- mt: 3
18766
+ mt: "6px",
18767
+ alignItems: "stretch"
18664
18768
  },
18665
18769
  children: [/*#__PURE__*/jsx(Grid, {
18666
18770
  item: true,
18667
18771
  xs: 12,
18668
18772
  md: 6,
18669
- children: /*#__PURE__*/jsx(TopPerformingCampaignsCard, {})
18773
+ sx: {
18774
+ paddingTop: "0px !important",
18775
+ display: "flex"
18776
+ },
18777
+ children: /*#__PURE__*/jsx(Box, {
18778
+ sx: {
18779
+ width: "100%"
18780
+ },
18781
+ children: /*#__PURE__*/jsx(TopPerformingCampaignsCard, {
18782
+ data: topCampaignsData !== null && topCampaignsData !== void 0 ? topCampaignsData : []
18783
+ })
18784
+ })
18670
18785
  }), /*#__PURE__*/jsx(Grid, {
18671
18786
  item: true,
18672
18787
  xs: 12,
18673
18788
  md: 6,
18674
- children: /*#__PURE__*/jsx(PaidDonorGeographyCard, {})
18789
+ sx: {
18790
+ paddingTop: "0px !important",
18791
+ paddingLeft: {
18792
+ xs: "24px !important",
18793
+ md: "6px !important"
18794
+ },
18795
+ marginTop: {
18796
+ xs: "6px",
18797
+ md: "0px"
18798
+ },
18799
+ display: "flex"
18800
+ },
18801
+ children: /*#__PURE__*/jsx(PaidDonorGeographyCard, {
18802
+ donorGeographyData: donorGeographyData
18803
+ })
18675
18804
  })]
18676
18805
  })]
18677
18806
  });