@ammarkhalidfarooq/dashboard-package 0.5.36 → 0.5.37

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.cjs.js CHANGED
@@ -1467,14 +1467,16 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
1467
1467
  rows = _ref$rows === void 0 ? [] : _ref$rows,
1468
1468
  _ref$gridTemplateColu = _ref.gridTemplateColumns,
1469
1469
  gridTemplateColumns = _ref$gridTemplateColu === void 0 ? "3fr 1fr 1.5fr 0.8fr 1fr " : _ref$gridTemplateColu,
1470
- height = _ref.height;
1470
+ height = _ref.height,
1471
+ _ref$compact = _ref.compact,
1472
+ compact = _ref$compact === void 0 ? false : _ref$compact;
1471
1473
  return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1472
1474
  sx: {
1473
1475
  bgcolor: "#fff",
1474
- borderRadius: 4,
1476
+ borderRadius: compact ? 3 : 4,
1475
1477
  border: "1px solid #f0f0f0",
1476
- boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
1477
- p: 3,
1478
+ boxShadow: compact ? "0 2px 12px rgba(0,0,0,0.05)" : "0 4px 24px rgba(0,0,0,0.06)",
1479
+ p: compact ? 1.5 : 3,
1478
1480
  height: height
1479
1481
  // height: "100%",
1480
1482
  },
@@ -1483,20 +1485,20 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
1483
1485
  display: "flex",
1484
1486
  justifyContent: "space-between",
1485
1487
  alignItems: "flex-start",
1486
- mb: 3
1488
+ mb: compact ? 1.25 : 3
1487
1489
  },
1488
1490
  children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1489
1491
  children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1490
1492
  sx: {
1491
1493
  fontWeight: 700,
1492
- fontSize: "18px",
1494
+ fontSize: compact ? "14px" : "18px",
1493
1495
  color: "#000",
1494
1496
  textAlign: "left"
1495
1497
  },
1496
1498
  children: title
1497
1499
  }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1498
1500
  sx: {
1499
- fontSize: "13px",
1501
+ fontSize: compact ? "10px" : "13px",
1500
1502
  color: "rgba(0, 0, 0, 0.4)",
1501
1503
  mt: 0.2
1502
1504
  },
@@ -1504,7 +1506,7 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
1504
1506
  })]
1505
1507
  }), actionLabel && /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1506
1508
  sx: {
1507
- fontSize: "13px",
1509
+ fontSize: compact ? "10px" : "13px",
1508
1510
  fontWeight: 600,
1509
1511
  color: "rgb(99, 99, 230)",
1510
1512
  cursor: "pointer"
@@ -1513,24 +1515,24 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
1513
1515
  })]
1514
1516
  }), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
1515
1517
  sx: {
1516
- overflowX: "auto"
1518
+ overflowX: compact ? "hidden" : "auto"
1517
1519
  },
1518
1520
  children: /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1519
1521
  sx: {
1520
- minWidth: "600px"
1522
+ minWidth: compact ? 0 : "600px"
1521
1523
  },
1522
1524
  children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
1523
1525
  sx: {
1524
1526
  display: "grid",
1525
1527
  gridTemplateColumns: gridTemplateColumns,
1526
- gap: 2,
1527
- pb: 2.5,
1528
+ gap: compact ? 1 : 2,
1529
+ pb: compact ? 1 : 2.5,
1528
1530
  borderBottom: "1px solid #f0f0f0"
1529
1531
  },
1530
1532
  children: columns.map(function (header) {
1531
1533
  return /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1532
1534
  sx: {
1533
- fontSize: "12px",
1535
+ fontSize: compact ? "9px" : "12px",
1534
1536
  color: "rgba(0, 0, 0, 0.4)",
1535
1537
  fontWeight: 500,
1536
1538
  textAlign: "left"
@@ -1548,8 +1550,8 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
1548
1550
  sx: {
1549
1551
  display: "grid",
1550
1552
  gridTemplateColumns: gridTemplateColumns,
1551
- gap: 2,
1552
- py: 1.2,
1553
+ gap: compact ? 1 : 2,
1554
+ py: compact ? 0.5 : 1.2,
1553
1555
  alignItems: "center",
1554
1556
  borderBottom: idx === rows.length - 1 ? "none" : "1px solid #f5f5f5"
1555
1557
  },
@@ -1561,9 +1563,9 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
1561
1563
  },
1562
1564
  children: [row.id && /*#__PURE__*/jsxRuntime.jsx(material.Avatar, {
1563
1565
  sx: {
1564
- width: 28,
1565
- height: 28,
1566
- fontSize: "10px",
1566
+ width: compact ? 22 : 28,
1567
+ height: compact ? 22 : 28,
1568
+ fontSize: compact ? "8px" : "10px",
1567
1569
  fontWeight: 700,
1568
1570
  bgcolor: row.avatarBg || "#F3F4F6",
1569
1571
  color: "rgb(99, 99, 230)"
@@ -1582,7 +1584,7 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
1582
1584
  })
1583
1585
  }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1584
1586
  sx: {
1585
- fontSize: "12px",
1587
+ fontSize: compact ? "10px" : "12px",
1586
1588
  fontWeight: 700,
1587
1589
  color: "#000"
1588
1590
  },
@@ -1590,7 +1592,7 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
1590
1592
  })]
1591
1593
  }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1592
1594
  sx: {
1593
- fontSize: "13px",
1595
+ fontSize: compact ? "10px" : "13px",
1594
1596
  fontWeight: 600,
1595
1597
  color: "#000",
1596
1598
  textAlign: "left"
@@ -1610,7 +1612,7 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
1610
1612
  variant: "determinate",
1611
1613
  value: Math.min(100, Math.max(0, (_row$progress = row.progress) !== null && _row$progress !== void 0 ? _row$progress : 0)),
1612
1614
  sx: {
1613
- height: 8,
1615
+ height: compact ? 6 : 8,
1614
1616
  borderRadius: 4,
1615
1617
  bgcolor: "#F3F4F6",
1616
1618
  "& .MuiLinearProgress-bar": {
@@ -1621,7 +1623,7 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
1621
1623
  })
1622
1624
  }), /*#__PURE__*/jsxRuntime.jsxs(material.Typography, {
1623
1625
  sx: {
1624
- fontSize: "11px",
1626
+ fontSize: compact ? "9px" : "11px",
1625
1627
  color: "rgba(0, 0, 0, 0.4)",
1626
1628
  minWidth: "30px"
1627
1629
  },
@@ -1637,7 +1639,7 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
1637
1639
  children: row.val2
1638
1640
  }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1639
1641
  sx: {
1640
- fontSize: "13px",
1642
+ fontSize: compact ? "10px" : "13px",
1641
1643
  fontWeight: row.highlightVal3 ? 700 : 500,
1642
1644
  color: row.highlightVal3 ? row.val3Color || "#22C55E" : "#000",
1643
1645
  textAlign: "left"
@@ -1692,12 +1694,12 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
1692
1694
  }) : /*#__PURE__*/jsxRuntime.jsx(material.Box, {
1693
1695
  sx: {
1694
1696
  display: "inline-block",
1695
- px: 1.5,
1696
- py: 0.5,
1697
+ px: compact ? 1 : 1.5,
1698
+ py: compact ? 0.25 : 0.5,
1697
1699
  borderRadius: "100px",
1698
1700
  bgcolor: row.statusBg,
1699
1701
  color: row.statusColor,
1700
- fontSize: "11px",
1702
+ fontSize: compact ? "9px" : "11px",
1701
1703
  fontWeight: 700,
1702
1704
  textAlign: "center"
1703
1705
  },
@@ -1743,6 +1745,8 @@ var DonorMixCard = function DonorMixCard(_ref) {
1743
1745
  bottomSummaryValue = _ref$bottomSummaryVal === void 0 ? "$130.58" : _ref$bottomSummaryVal,
1744
1746
  _ref$bottomSummaryTre = _ref.bottomSummaryTrend,
1745
1747
  bottomSummaryTrend = _ref$bottomSummaryTre === void 0 ? "8.4% vs last month" : _ref$bottomSummaryTre,
1748
+ _ref$compact = _ref.compact,
1749
+ compact = _ref$compact === void 0 ? false : _ref$compact,
1746
1750
  _ref$sx = _ref.sx,
1747
1751
  sx = _ref$sx === void 0 ? {} : _ref$sx;
1748
1752
  var chartOptions = {
@@ -1811,7 +1815,7 @@ var DonorMixCard = function DonorMixCard(_ref) {
1811
1815
  borderRadius: 4,
1812
1816
  border: "1px solid #f0f0f0",
1813
1817
  boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
1814
- p: 3,
1818
+ p: compact ? 1.5 : 3,
1815
1819
  // height: "100%",
1816
1820
  // width: "100%",
1817
1821
  display: "flex",
@@ -1822,16 +1826,15 @@ var DonorMixCard = function DonorMixCard(_ref) {
1822
1826
  children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1823
1827
  sx: {
1824
1828
  fontWeight: 700,
1825
- fontSize: "18px",
1829
+ fontSize: compact ? "14px" : "18px",
1826
1830
  color: "#000",
1827
1831
  textAlign: "left"
1828
1832
  },
1829
1833
  children: title
1830
1834
  }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1831
1835
  sx: {
1832
- fontSize: "13px",
1836
+ fontSize: compact ? "10px" : "13px",
1833
1837
  color: "rgba(0, 0, 0, 0.4)",
1834
- // mt: 0.2,
1835
1838
  textAlign: "left"
1836
1839
  },
1837
1840
  children: subtitle
@@ -1839,7 +1842,7 @@ var DonorMixCard = function DonorMixCard(_ref) {
1839
1842
  }), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
1840
1843
  sx: {
1841
1844
  position: "relative",
1842
- height: "180px",
1845
+ height: compact ? "110px" : "180px",
1843
1846
  // mb: 1,
1844
1847
  display: "flex",
1845
1848
  justifyContent: "center"
@@ -1848,7 +1851,7 @@ var DonorMixCard = function DonorMixCard(_ref) {
1848
1851
  options: chartOptions,
1849
1852
  series: series,
1850
1853
  type: "donut",
1851
- width: "210"
1854
+ width: compact ? "140" : "210"
1852
1855
  })
1853
1856
  }), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1854
1857
  sx: {},
@@ -1857,7 +1860,7 @@ var DonorMixCard = function DonorMixCard(_ref) {
1857
1860
  sx: {
1858
1861
  display: "flex",
1859
1862
  justifyContent: "space-between",
1860
- mb: idx === items.length - 1 ? showBottomSummary ? 1 : 0 : 1
1863
+ mb: idx === items.length - 1 ? showBottomSummary ? compact ? 0.5 : 1 : 0 : compact ? 0.5 : 1
1861
1864
  },
1862
1865
  children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1863
1866
  sx: {
@@ -1874,7 +1877,7 @@ var DonorMixCard = function DonorMixCard(_ref) {
1874
1877
  }
1875
1878
  }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1876
1879
  sx: {
1877
- fontSize: "13px",
1880
+ fontSize: compact ? "10px" : "13px",
1878
1881
  fontWeight: 500,
1879
1882
  color: "rgba(0, 0, 0, 0.4)"
1880
1883
  },
@@ -1882,7 +1885,7 @@ var DonorMixCard = function DonorMixCard(_ref) {
1882
1885
  })]
1883
1886
  }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1884
1887
  sx: {
1885
- fontSize: "13px",
1888
+ fontSize: compact ? "10px" : "13px",
1886
1889
  fontWeight: 700,
1887
1890
  color: "#111"
1888
1891
  },
@@ -1894,7 +1897,7 @@ var DonorMixCard = function DonorMixCard(_ref) {
1894
1897
  // display: "flex",
1895
1898
  // justifyContent: "space-between",
1896
1899
  // alignItems: "center",
1897
- pt: 2,
1900
+ pt: compact ? 1 : 2,
1898
1901
  borderTop: "1px solid #f0f0f0",
1899
1902
  textAlign: "left"
1900
1903
  },
@@ -2144,7 +2147,9 @@ var MetricSparklineCard = function MetricSparklineCard(_ref) {
2144
2147
  footerMetrics = _ref$footerMetrics === void 0 ? [] : _ref$footerMetrics,
2145
2148
  sx = _ref.sx,
2146
2149
  _ref$bottomSection = _ref.bottomSection,
2147
- bottomSection = _ref$bottomSection === void 0 ? false : _ref$bottomSection;
2150
+ bottomSection = _ref$bottomSection === void 0 ? false : _ref$bottomSection,
2151
+ _ref$compact = _ref.compact,
2152
+ compact = _ref$compact === void 0 ? false : _ref$compact;
2148
2153
  // Extract values for chart series
2149
2154
  var series = [{
2150
2155
  name: title,
@@ -2218,8 +2223,8 @@ var MetricSparklineCard = function MetricSparklineCard(_ref) {
2218
2223
  };
2219
2224
  return /*#__PURE__*/jsxRuntime.jsxs(material.Card, {
2220
2225
  sx: _objectSpread2({
2221
- p: 3,
2222
- borderRadius: 4,
2226
+ p: compact ? 1.25 : 3,
2227
+ borderRadius: compact ? 3 : 4,
2223
2228
  border: "1px solid #f0f0f0",
2224
2229
  boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
2225
2230
  bgcolor: "#fff",
@@ -2233,7 +2238,7 @@ var MetricSparklineCard = function MetricSparklineCard(_ref) {
2233
2238
  children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
2234
2239
  sx: {
2235
2240
  fontWeight: 700,
2236
- fontSize: "16px",
2241
+ fontSize: compact ? "13px" : "16px",
2237
2242
  color: "#000",
2238
2243
  textAlign: "left"
2239
2244
  },
@@ -2349,7 +2354,9 @@ var MetricDonutCard = function MetricDonutCard(_ref) {
2349
2354
  raisedTrend = _ref.raisedTrend,
2350
2355
  _ref$chartColors = _ref.chartColors,
2351
2356
  chartColors = _ref$chartColors === void 0 ? ["rgb(99, 99, 230)", "#88bfd290"] : _ref$chartColors,
2352
- sx = _ref.sx;
2357
+ sx = _ref.sx,
2358
+ _ref$compact = _ref.compact,
2359
+ compact = _ref$compact === void 0 ? false : _ref$compact;
2353
2360
  var chartOptions = {
2354
2361
  chart: {
2355
2362
  type: "radialBar",
@@ -2405,8 +2412,8 @@ var MetricDonutCard = function MetricDonutCard(_ref) {
2405
2412
  var series = [acceptanceRate];
2406
2413
  return /*#__PURE__*/jsxRuntime.jsxs(material.Card, {
2407
2414
  sx: _objectSpread2({
2408
- p: 3,
2409
- borderRadius: 4,
2415
+ p: compact ? 1.25 : 3,
2416
+ borderRadius: compact ? 3 : 4,
2410
2417
  border: "1px solid #f0f0f0",
2411
2418
  boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
2412
2419
  bgcolor: "#fff",
@@ -2419,7 +2426,7 @@ var MetricDonutCard = function MetricDonutCard(_ref) {
2419
2426
  children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
2420
2427
  sx: {
2421
2428
  fontWeight: 700,
2422
- fontSize: "16px",
2429
+ fontSize: compact ? "13px" : "16px",
2423
2430
  color: "#000",
2424
2431
  textAlign: "left"
2425
2432
  },
@@ -2435,9 +2442,9 @@ var MetricDonutCard = function MetricDonutCard(_ref) {
2435
2442
  })]
2436
2443
  }), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
2437
2444
  sx: {
2438
- height: 160,
2445
+ height: compact ? 90 : 160,
2439
2446
  position: "relative",
2440
- mt: 1,
2447
+ mt: compact ? 0.5 : 1,
2441
2448
  display: "flex",
2442
2449
  justifyContent: "center"
2443
2450
  },
@@ -4136,14 +4143,16 @@ var RefundsChargebacksCard = function RefundsChargebacksCard(_ref) {
4136
4143
  };
4137
4144
 
4138
4145
  var cardHeight = function cardHeight(exportMode) {
4139
- return exportMode ? 210 : 300;
4146
+ return exportMode ? 158 : 300;
4140
4147
  };
4141
4148
  var ReportDetailsSection = function ReportDetailsSection(_ref) {
4142
4149
  var _orderBumpData$chart, _orderBumpData$peakDa, _referralData$chartDa;
4143
4150
  var reportData = _ref.reportData,
4144
4151
  dateName = _ref.dateName,
4145
4152
  _ref$exportMode = _ref.exportMode,
4146
- exportMode = _ref$exportMode === void 0 ? false : _ref$exportMode;
4153
+ exportMode = _ref$exportMode === void 0 ? false : _ref$exportMode,
4154
+ _ref$section = _ref.section,
4155
+ section = _ref$section === void 0 ? "all" : _ref$section;
4147
4156
  var activeCampaigns = reportData.activeCampaigns,
4148
4157
  donorMix = reportData.donorMix,
4149
4158
  donationTypeData = reportData.donationTypeData,
@@ -4154,164 +4163,407 @@ var ReportDetailsSection = function ReportDetailsSection(_ref) {
4154
4163
  downsellData = reportData.downsellData,
4155
4164
  referralData = reportData.referralData,
4156
4165
  refundsChargebacksData = reportData.refundsChargebacksData;
4166
+ var gridSx = {
4167
+ display: "grid",
4168
+ gridTemplateColumns: exportMode ? "repeat(4, 1fr)" : {
4169
+ xs: "1fr",
4170
+ sm: "1fr 1fr",
4171
+ lg: "repeat(4, 1fr)"
4172
+ },
4173
+ gap: exportMode ? 0.75 : 2
4174
+ };
4175
+ var cardSx = {
4176
+ maxHeight: cardHeight(exportMode),
4177
+ minHeight: exportMode ? cardHeight(exportMode) : undefined
4178
+ };
4179
+ var campaignsRow = /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
4180
+ sx: {
4181
+ display: "grid",
4182
+ gridTemplateColumns: exportMode ? "1fr 200px" : {
4183
+ xs: "1fr",
4184
+ lg: "2.25fr 1fr"
4185
+ },
4186
+ gap: exportMode ? 0.75 : 2,
4187
+ mb: exportMode ? 0.75 : 2,
4188
+ alignItems: "stretch"
4189
+ },
4190
+ children: [/*#__PURE__*/jsxRuntime.jsx(ActiveCampaignsCard, {
4191
+ title: "Active campaigns",
4192
+ subtitle: "Live fundraisers ranked by velocity",
4193
+ actionLabel: exportMode ? undefined : "View all",
4194
+ columns: ["Campaign", "Raised", "Progress", "Donors", "Status"],
4195
+ gridTemplateColumns: "2.2fr 0.9fr 1.3fr 0.6fr 0.8fr",
4196
+ rows: activeCampaigns,
4197
+ compact: exportMode
4198
+ }), /*#__PURE__*/jsxRuntime.jsx(DonorMixCard, {
4199
+ title: "Donor mix",
4200
+ subtitle: "Acquisition vs retention",
4201
+ series: [donorMix.newDonors, donorMix.returningDonors],
4202
+ labels: ["New donors", "Returning"],
4203
+ colors: ["#10B981", "rgb(99, 99, 230)"],
4204
+ centerLabel: "donors",
4205
+ centerValue: String(donorMix.totalMix),
4206
+ items: [{
4207
+ label: "New donors",
4208
+ val: "".concat(donorMix.newDonors, " \xB7 ").concat(donorMix.newPct, "%"),
4209
+ color: "#10B981"
4210
+ }, {
4211
+ label: "Returning",
4212
+ val: "".concat(donorMix.returningDonors, " \xB7 ").concat(donorMix.retPct, "%"),
4213
+ color: "rgb(99, 99, 230)"
4214
+ }],
4215
+ bottomSummaryValue: "$".concat(formatNumber(donorMix.avgGift)),
4216
+ bottomSummaryTrend: "".concat(donorMix.donorMixPrev, "% vs ").concat(dateName || "last month"),
4217
+ compact: exportMode,
4218
+ sx: {
4219
+ height: "100%"
4220
+ }
4221
+ })]
4222
+ });
4223
+ var middleCards = /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
4224
+ sx: gridSx,
4225
+ children: [/*#__PURE__*/jsxRuntime.jsx(DonationTypeBarChart, {
4226
+ sx: _objectSpread2(_objectSpread2({}, cardSx), exportMode && {
4227
+ p: 1.25,
4228
+ borderRadius: 3
4229
+ }),
4230
+ donationTypeData: donationTypeData
4231
+ }), /*#__PURE__*/jsxRuntime.jsx(PaidDonorGeographyCard, {
4232
+ sx: _objectSpread2(_objectSpread2({}, cardSx), exportMode && {
4233
+ p: 1.25,
4234
+ borderRadius: 3
4235
+ }),
4236
+ donorGeographyData: donorGeographyData
4237
+ }), /*#__PURE__*/jsxRuntime.jsx(RefundsChargebacksCard, {
4238
+ sx: _objectSpread2(_objectSpread2({}, cardSx), exportMode && {
4239
+ p: 1.25,
4240
+ borderRadius: 3
4241
+ }),
4242
+ refundsChargebacksData: refundsChargebacksData
4243
+ }), /*#__PURE__*/jsxRuntime.jsx(TrafficSourceCard, {
4244
+ sx: _objectSpread2(_objectSpread2({}, cardSx), exportMode && {
4245
+ p: 1.25,
4246
+ borderRadius: 3
4247
+ }),
4248
+ trafficSourceData: (trafficSourceData === null || trafficSourceData === void 0 ? void 0 : trafficSourceData.data) || [],
4249
+ total: "$".concat(formatNumber((trafficSourceData === null || trafficSourceData === void 0 ? void 0 : trafficSourceData.totalRevenue) || 0))
4250
+ })]
4251
+ });
4252
+ var bottomCards = /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
4253
+ sx: gridSx,
4254
+ children: [/*#__PURE__*/jsxRuntime.jsx(MetricSparklineCard, {
4255
+ title: "Order Bump",
4256
+ subtitle: "Revenue trend \xB7 last 30 days",
4257
+ value: "$".concat(formatNumber((orderBumpData === null || orderBumpData === void 0 ? void 0 : orderBumpData.totalRevenue) || 0)),
4258
+ trend: "".concat((orderBumpData === null || orderBumpData === void 0 ? void 0 : orderBumpData.growthPercentage) >= 0 ? "▲" : "▼", " ").concat(Math.abs((orderBumpData === null || orderBumpData === void 0 ? void 0 : orderBumpData.growthPercentage) || 0).toFixed(1), "% vs last month"),
4259
+ chartData: (orderBumpData === null || orderBumpData === void 0 || (_orderBumpData$chart = orderBumpData.chart) === null || _orderBumpData$chart === void 0 ? void 0 : _orderBumpData$chart.map(function (item) {
4260
+ return {
4261
+ label: item.label,
4262
+ value: item.revenue
4263
+ };
4264
+ })) || [],
4265
+ footerMetrics: [{
4266
+ label: "Avg/day",
4267
+ value: "$".concat(formatNumber((orderBumpData === null || orderBumpData === void 0 ? void 0 : orderBumpData.averagePerDay) || 0))
4268
+ }, {
4269
+ label: "Peak day",
4270
+ value: "$".concat(formatNumber((orderBumpData === null || orderBumpData === void 0 || (_orderBumpData$peakDa = orderBumpData.peakDay) === null || _orderBumpData$peakDa === void 0 ? void 0 : _orderBumpData$peakDa.amount) || 0))
4271
+ }, {
4272
+ label: "Orders",
4273
+ value: formatNumber((orderBumpData === null || orderBumpData === void 0 ? void 0 : orderBumpData.totalOrders) || 0)
4274
+ }],
4275
+ sx: cardSx,
4276
+ bottomSection: true,
4277
+ compact: exportMode
4278
+ }), /*#__PURE__*/jsxRuntime.jsx(MetricDonutCard, {
4279
+ title: "Upsell",
4280
+ subtitle: "Acceptance & raised",
4281
+ acceptanceRate: (upsellData === null || upsellData === void 0 ? void 0 : upsellData.acceptanceRate) || 0,
4282
+ acceptanceVal: "".concat(formatNumber((upsellData === null || upsellData === void 0 ? void 0 : upsellData.totalUpsellsAttached) || 0)),
4283
+ acceptanceTrend: "".concat((upsellData === null || upsellData === void 0 ? void 0 : upsellData.acceptanceGrowth) >= 0 ? "▲" : "▼", " ").concat(Math.abs((upsellData === null || upsellData === void 0 ? void 0 : upsellData.acceptanceGrowth) || 0).toFixed(1), "%"),
4284
+ raisedVal: "$".concat(formatNumber((upsellData === null || upsellData === void 0 ? void 0 : upsellData.raised) || 0)),
4285
+ raisedTrend: "".concat((upsellData === null || upsellData === void 0 ? void 0 : upsellData.raisedGrowth) >= 0 ? "▲" : "▼", " ").concat(Math.abs((upsellData === null || upsellData === void 0 ? void 0 : upsellData.raisedGrowth) || 0).toFixed(1), "%"),
4286
+ sx: cardSx,
4287
+ compact: exportMode
4288
+ }), /*#__PURE__*/jsxRuntime.jsx(MetricDonutCard, {
4289
+ title: "Downsell",
4290
+ subtitle: "Acceptance & raised",
4291
+ acceptanceRate: (downsellData === null || downsellData === void 0 ? void 0 : downsellData.acceptanceRate) || 0,
4292
+ acceptanceVal: "".concat(formatNumber((downsellData === null || downsellData === void 0 ? void 0 : downsellData.acceptanceRate) || 0), "%"),
4293
+ acceptanceTrend: "".concat(formatNumber((downsellData === null || downsellData === void 0 ? void 0 : downsellData.acceptanceGrowth) || 0), "%"),
4294
+ raisedVal: "$".concat(formatNumber((downsellData === null || downsellData === void 0 ? void 0 : downsellData.raised) || 0)),
4295
+ raisedTrend: "".concat(formatNumber((downsellData === null || downsellData === void 0 ? void 0 : downsellData.raisedGrowth) || 0), "%"),
4296
+ sx: cardSx,
4297
+ compact: exportMode
4298
+ }), /*#__PURE__*/jsxRuntime.jsx(MetricSparklineCard, {
4299
+ title: "Referrals",
4300
+ subtitle: "Revenue trend \xB7 last 30 days",
4301
+ value: "$".concat(formatNumber((referralData === null || referralData === void 0 ? void 0 : referralData.totalRevenue) || 0)),
4302
+ trend: "\u25B2 ".concat((referralData === null || referralData === void 0 ? void 0 : referralData.growthPercentage) || 0, "% vs last month"),
4303
+ chartData: (referralData === null || referralData === void 0 || (_referralData$chartDa = referralData.chartData) === null || _referralData$chartDa === void 0 ? void 0 : _referralData$chartDa.map(function (item) {
4304
+ return {
4305
+ label: item.date,
4306
+ value: item.revenue
4307
+ };
4308
+ })) || [],
4309
+ footerMetrics: [{
4310
+ label: "Referrers",
4311
+ value: formatNumber((referralData === null || referralData === void 0 ? void 0 : referralData.totalReferrers) || 0)
4312
+ }, {
4313
+ label: "Avg gift",
4314
+ value: "$".concat(formatNumber((referralData === null || referralData === void 0 ? void 0 : referralData.averageGift) || 0))
4315
+ }, {
4316
+ label: "Conv. rate",
4317
+ value: "".concat(formatNumber((referralData === null || referralData === void 0 ? void 0 : referralData.conversionRate) || 0), "%")
4318
+ }],
4319
+ sx: cardSx,
4320
+ bottomSection: true,
4321
+ compact: exportMode
4322
+ })]
4323
+ });
4324
+ if (section === "top") {
4325
+ return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
4326
+ children: [campaignsRow, middleCards]
4327
+ });
4328
+ }
4329
+ if (section === "bottom") {
4330
+ return /*#__PURE__*/jsxRuntime.jsx(material.Box, {
4331
+ children: bottomCards
4332
+ });
4333
+ }
4157
4334
  return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
4158
4335
  sx: {
4159
4336
  mt: exportMode ? 0 : 2
4160
4337
  },
4161
- children: [/*#__PURE__*/jsxRuntime.jsxs(material.Grid, {
4162
- container: true,
4163
- spacing: exportMode ? 1 : 2,
4338
+ children: [campaignsRow, middleCards, /*#__PURE__*/jsxRuntime.jsx(material.Box, {
4164
4339
  sx: {
4165
- mb: exportMode ? 1 : 2
4340
+ mt: exportMode ? 0.75 : 2
4166
4341
  },
4167
- children: [/*#__PURE__*/jsxRuntime.jsx(material.Grid, {
4168
- item: true,
4169
- xs: 12,
4170
- lg: 9,
4171
- children: /*#__PURE__*/jsxRuntime.jsx(ActiveCampaignsCard, {
4172
- title: "Active campaigns",
4173
- subtitle: "Live fundraisers ranked by velocity",
4174
- actionLabel: "View all",
4175
- columns: ["Campaign", "Raised", "Progress", "Donors", "Status"],
4176
- gridTemplateColumns: "2.5fr 1fr 1.5fr 0.7fr 0.9fr",
4177
- rows: activeCampaigns
4178
- })
4179
- }), /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
4180
- item: true,
4181
- xs: 12,
4182
- lg: 3,
4183
- children: /*#__PURE__*/jsxRuntime.jsx(DonorMixCard, {
4184
- title: "Donor mix",
4185
- subtitle: "Acquisition vs retention",
4186
- series: [donorMix.newDonors, donorMix.returningDonors],
4187
- labels: ["New donors", "Returning"],
4188
- colors: ["#10B981", "rgb(99, 99, 230)"],
4189
- centerLabel: "donors",
4190
- centerValue: String(donorMix.totalMix),
4191
- items: [{
4192
- label: "New donors",
4193
- val: "".concat(donorMix.newDonors, " \xB7 ").concat(donorMix.newPct, "%"),
4194
- color: "#10B981"
4195
- }, {
4196
- label: "Returning",
4197
- val: "".concat(donorMix.returningDonors, " \xB7 ").concat(donorMix.retPct, "%"),
4198
- color: "rgb(99, 99, 230)"
4199
- }],
4200
- bottomSummaryValue: "$".concat(formatNumber(donorMix.avgGift)),
4201
- bottomSummaryTrend: "".concat(donorMix.donorMixPrev, "% vs ").concat(dateName || "last month"),
4202
- sx: {
4203
- height: "100%"
4204
- }
4205
- })
4206
- })]
4207
- }), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
4342
+ children: bottomCards
4343
+ })]
4344
+ });
4345
+ };
4346
+
4347
+ var COLORS$1 = ["#6363E6", "#10B981", "#06B6D4"];
4348
+ var formatYLabel = function formatYLabel(v) {
4349
+ if (v >= 10000) return "$".concat((v / 1000).toFixed(0), "K");
4350
+ if (v >= 1000) return "$".concat((v / 1000).toFixed(1), "K");
4351
+ return "$".concat(v.toFixed(0));
4352
+ };
4353
+ var ReportLineChart = function ReportLineChart(_ref) {
4354
+ var _ref$series = _ref.series,
4355
+ series = _ref$series === void 0 ? [] : _ref$series,
4356
+ _ref$categories = _ref.categories,
4357
+ categories = _ref$categories === void 0 ? [] : _ref$categories,
4358
+ _ref$width = _ref.width,
4359
+ width = _ref$width === void 0 ? 730 : _ref$width,
4360
+ _ref$height = _ref.height,
4361
+ height = _ref$height === void 0 ? 200 : _ref$height;
4362
+ var allVals = series.flatMap(function (s) {
4363
+ return s.data || [];
4364
+ });
4365
+ if (!allVals.length) {
4366
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
4367
+ style: {
4368
+ height: height,
4369
+ background: "#F8FAFF",
4370
+ borderRadius: 8
4371
+ }
4372
+ });
4373
+ }
4374
+ var PL = 44;
4375
+ var PR = 12;
4376
+ var PT = 10;
4377
+ var PB = 24;
4378
+ var IW = width - PL - PR;
4379
+ var IH = height - PT - PB;
4380
+ var max = Math.max.apply(Math, _toConsumableArray(allVals).concat([0]));
4381
+ var range = max || 1;
4382
+ var xp = function xp(i, n) {
4383
+ return PL + i / Math.max(n - 1, 1) * IW;
4384
+ };
4385
+ var yp = function yp(v) {
4386
+ return PT + IH - v / range * IH;
4387
+ };
4388
+ var yTicks = [0, 0.25, 0.5, 0.75, 1].map(function (t) {
4389
+ return t * range;
4390
+ });
4391
+ var step = Math.max(1, Math.floor(categories.length / 6));
4392
+ var shownCats = categories.filter(function (_, i) {
4393
+ return i % step === 0 || i === categories.length - 1;
4394
+ });
4395
+ return /*#__PURE__*/jsxRuntime.jsxs("svg", {
4396
+ width: width,
4397
+ height: height,
4398
+ style: {
4399
+ display: "block"
4400
+ },
4401
+ children: [yTicks.map(function (v, i) {
4402
+ var y = yp(v);
4403
+ return /*#__PURE__*/jsxRuntime.jsxs("g", {
4404
+ children: [/*#__PURE__*/jsxRuntime.jsx("line", {
4405
+ x1: PL,
4406
+ y1: y,
4407
+ x2: width - PR,
4408
+ y2: y,
4409
+ stroke: "#E5E7EB",
4410
+ strokeWidth: 1
4411
+ }), /*#__PURE__*/jsxRuntime.jsx("text", {
4412
+ x: PL - 6,
4413
+ y: y + 4,
4414
+ textAnchor: "end",
4415
+ fontSize: 10,
4416
+ fill: "#9CA3AF",
4417
+ children: formatYLabel(v)
4418
+ })]
4419
+ }, i);
4420
+ }), series.map(function (s, si) {
4421
+ var data = s.data || [];
4422
+ if (!data.length) return null;
4423
+ var pathD = data.map(function (v, i) {
4424
+ return "".concat(i === 0 ? "M" : "L").concat(xp(i, data.length).toFixed(1), ",").concat(yp(v).toFixed(1));
4425
+ }).join(" ");
4426
+ return /*#__PURE__*/jsxRuntime.jsx("path", {
4427
+ d: pathD,
4428
+ fill: "none",
4429
+ stroke: COLORS$1[si % COLORS$1.length],
4430
+ strokeWidth: 2.5,
4431
+ strokeLinecap: "round",
4432
+ strokeLinejoin: "round"
4433
+ }, s.name || si);
4434
+ }), shownCats.map(function (label, i) {
4435
+ var origIdx = categories.indexOf(label);
4436
+ var x = xp(origIdx < 0 ? i * step : origIdx, categories.length);
4437
+ return /*#__PURE__*/jsxRuntime.jsx("text", {
4438
+ x: x,
4439
+ y: height - 6,
4440
+ textAnchor: "middle",
4441
+ fontSize: 10,
4442
+ fill: "#9CA3AF",
4443
+ children: label
4444
+ }, i);
4445
+ })]
4446
+ });
4447
+ };
4448
+
4449
+ var LEGEND = [{
4450
+ label: "Paid Ads",
4451
+ color: "#6363E6"
4452
+ }, {
4453
+ label: "Organic",
4454
+ color: "#10B981"
4455
+ }, {
4456
+ label: "Email",
4457
+ color: "#06B6D4"
4458
+ }];
4459
+ var ReportExportChartCard = function ReportExportChartCard(_ref) {
4460
+ var item = _ref.item,
4461
+ _ref$chartWidth = _ref.chartWidth,
4462
+ chartWidth = _ref$chartWidth === void 0 ? 730 : _ref$chartWidth;
4463
+ return /*#__PURE__*/jsxRuntime.jsx(material.Card, {
4464
+ sx: {
4465
+ width: "100%",
4466
+ boxShadow: "0 2px 12px rgba(0,0,0,0.05)",
4467
+ borderRadius: 3,
4468
+ border: "1px solid #f0f0f0"
4469
+ },
4470
+ children: /*#__PURE__*/jsxRuntime.jsxs(material.CardContent, {
4208
4471
  sx: {
4209
- display: "grid",
4210
- gridTemplateColumns: exportMode ? "repeat(4, 1fr)" : {
4211
- xs: "1fr",
4212
- sm: "1fr 1fr",
4213
- lg: "repeat(4, 1fr)"
4214
- },
4215
- gap: exportMode ? 1 : 2
4216
- },
4217
- children: [/*#__PURE__*/jsxRuntime.jsx(DonationTypeBarChart, {
4218
- sx: {
4219
- maxHeight: cardHeight(exportMode)
4220
- },
4221
- donationTypeData: donationTypeData
4222
- }), /*#__PURE__*/jsxRuntime.jsx(PaidDonorGeographyCard, {
4223
- sx: {
4224
- maxHeight: cardHeight(exportMode)
4225
- },
4226
- donorGeographyData: donorGeographyData
4227
- }), /*#__PURE__*/jsxRuntime.jsx(RefundsChargebacksCard, {
4228
- sx: {
4229
- maxHeight: cardHeight(exportMode)
4230
- },
4231
- refundsChargebacksData: refundsChargebacksData
4232
- }), /*#__PURE__*/jsxRuntime.jsx(TrafficSourceCard, {
4233
- sx: {
4234
- maxHeight: cardHeight(exportMode)
4235
- },
4236
- trafficSourceData: (trafficSourceData === null || trafficSourceData === void 0 ? void 0 : trafficSourceData.data) || [],
4237
- total: "$".concat(formatNumber((trafficSourceData === null || trafficSourceData === void 0 ? void 0 : trafficSourceData.totalRevenue) || 0))
4238
- }), /*#__PURE__*/jsxRuntime.jsx(MetricSparklineCard, {
4239
- title: "Order Bump",
4240
- subtitle: "Revenue trend \xB7 last 30 days",
4241
- value: "$".concat(formatNumber((orderBumpData === null || orderBumpData === void 0 ? void 0 : orderBumpData.totalRevenue) || 0)),
4242
- trend: "".concat((orderBumpData === null || orderBumpData === void 0 ? void 0 : orderBumpData.growthPercentage) >= 0 ? "▲" : "▼", " ").concat(Math.abs((orderBumpData === null || orderBumpData === void 0 ? void 0 : orderBumpData.growthPercentage) || 0).toFixed(1), "% vs last month"),
4243
- chartData: (orderBumpData === null || orderBumpData === void 0 || (_orderBumpData$chart = orderBumpData.chart) === null || _orderBumpData$chart === void 0 ? void 0 : _orderBumpData$chart.map(function (item) {
4244
- return {
4245
- label: item.label,
4246
- value: item.revenue
4247
- };
4248
- })) || [],
4249
- footerMetrics: [{
4250
- label: "Avg/day",
4251
- value: "$".concat(formatNumber((orderBumpData === null || orderBumpData === void 0 ? void 0 : orderBumpData.averagePerDay) || 0))
4252
- }, {
4253
- label: "Peak day",
4254
- value: "$".concat(formatNumber((orderBumpData === null || orderBumpData === void 0 || (_orderBumpData$peakDa = orderBumpData.peakDay) === null || _orderBumpData$peakDa === void 0 ? void 0 : _orderBumpData$peakDa.amount) || 0))
4255
- }, {
4256
- label: "Orders",
4257
- value: formatNumber((orderBumpData === null || orderBumpData === void 0 ? void 0 : orderBumpData.totalOrders) || 0)
4258
- }],
4259
- sx: {
4260
- maxHeight: cardHeight(exportMode)
4261
- },
4262
- bottomSection: true
4263
- }), /*#__PURE__*/jsxRuntime.jsx(MetricDonutCard, {
4264
- title: "Upsell",
4265
- subtitle: "Acceptance & raised",
4266
- acceptanceRate: (upsellData === null || upsellData === void 0 ? void 0 : upsellData.acceptanceRate) || 0,
4267
- acceptanceVal: "".concat(formatNumber((upsellData === null || upsellData === void 0 ? void 0 : upsellData.totalUpsellsAttached) || 0)),
4268
- acceptanceTrend: "".concat((upsellData === null || upsellData === void 0 ? void 0 : upsellData.acceptanceGrowth) >= 0 ? "▲" : "▼", " ").concat(Math.abs((upsellData === null || upsellData === void 0 ? void 0 : upsellData.acceptanceGrowth) || 0).toFixed(1), "%"),
4269
- raisedVal: "$".concat(formatNumber((upsellData === null || upsellData === void 0 ? void 0 : upsellData.raised) || 0)),
4270
- raisedTrend: "".concat((upsellData === null || upsellData === void 0 ? void 0 : upsellData.raisedGrowth) >= 0 ? "▲" : "▼", " ").concat(Math.abs((upsellData === null || upsellData === void 0 ? void 0 : upsellData.raisedGrowth) || 0).toFixed(1), "%"),
4271
- sx: {
4272
- maxHeight: cardHeight(exportMode)
4273
- }
4274
- }), /*#__PURE__*/jsxRuntime.jsx(MetricDonutCard, {
4275
- title: "Downsell",
4276
- subtitle: "Acceptance & raised",
4277
- acceptanceRate: (downsellData === null || downsellData === void 0 ? void 0 : downsellData.acceptanceRate) || 0,
4278
- acceptanceVal: "".concat(formatNumber((downsellData === null || downsellData === void 0 ? void 0 : downsellData.acceptanceRate) || 0), "%"),
4279
- acceptanceTrend: "".concat(formatNumber((downsellData === null || downsellData === void 0 ? void 0 : downsellData.acceptanceGrowth) || 0), "%"),
4280
- raisedVal: "$".concat(formatNumber((downsellData === null || downsellData === void 0 ? void 0 : downsellData.raised) || 0)),
4281
- raisedTrend: "".concat(formatNumber((downsellData === null || downsellData === void 0 ? void 0 : downsellData.raisedGrowth) || 0), "%"),
4282
- sx: {
4283
- maxHeight: cardHeight(exportMode)
4472
+ p: 2,
4473
+ "&:last-child": {
4474
+ pb: 2
4284
4475
  }
4285
- }), /*#__PURE__*/jsxRuntime.jsx(MetricSparklineCard, {
4286
- title: "Referrals",
4287
- subtitle: "Revenue trend \xB7 last 30 days",
4288
- value: "$".concat(formatNumber((referralData === null || referralData === void 0 ? void 0 : referralData.totalRevenue) || 0)),
4289
- trend: "\u25B2 ".concat((referralData === null || referralData === void 0 ? void 0 : referralData.growthPercentage) || 0, "% vs last month"),
4290
- chartData: (referralData === null || referralData === void 0 || (_referralData$chartDa = referralData.chartData) === null || _referralData$chartDa === void 0 ? void 0 : _referralData$chartDa.map(function (item) {
4291
- return {
4292
- label: item.date,
4293
- value: item.revenue
4294
- };
4295
- })) || [],
4296
- footerMetrics: [{
4297
- label: "Referrers",
4298
- value: formatNumber((referralData === null || referralData === void 0 ? void 0 : referralData.totalReferrers) || 0)
4299
- }, {
4300
- label: "Avg gift",
4301
- value: "$".concat(formatNumber((referralData === null || referralData === void 0 ? void 0 : referralData.averageGift) || 0))
4302
- }, {
4303
- label: "Conv. rate",
4304
- value: "".concat(formatNumber((referralData === null || referralData === void 0 ? void 0 : referralData.conversionRate) || 0), "%")
4305
- }],
4476
+ },
4477
+ children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
4306
4478
  sx: {
4307
- maxHeight: cardHeight(exportMode)
4479
+ display: "flex",
4480
+ justifyContent: "space-between",
4481
+ alignItems: "flex-start",
4482
+ mb: 1
4308
4483
  },
4309
- bottomSection: true
4484
+ children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
4485
+ children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
4486
+ sx: {
4487
+ fontWeight: 700,
4488
+ fontSize: 15,
4489
+ color: "#000",
4490
+ mb: 0.25
4491
+ },
4492
+ children: item.label
4493
+ }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
4494
+ sx: {
4495
+ fontSize: 11,
4496
+ color: "rgba(0,0,0,0.4)",
4497
+ mb: 1
4498
+ },
4499
+ children: item.subtitle || "Last 30 days · daily aggregation"
4500
+ }), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
4501
+ sx: {
4502
+ display: "flex",
4503
+ alignItems: "center",
4504
+ gap: 1
4505
+ },
4506
+ children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
4507
+ sx: {
4508
+ fontWeight: 700,
4509
+ fontSize: 22,
4510
+ color: "#000"
4511
+ },
4512
+ children: item.value
4513
+ }), item.trend && /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
4514
+ sx: {
4515
+ bgcolor: "#D1FAE5",
4516
+ color: "#047857",
4517
+ px: 1,
4518
+ py: 0.25,
4519
+ borderRadius: "100px",
4520
+ fontSize: 11,
4521
+ fontWeight: 600
4522
+ },
4523
+ children: ["\u25B2 ", item.trend]
4524
+ })]
4525
+ })]
4526
+ }), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
4527
+ sx: {
4528
+ display: "flex",
4529
+ gap: 1.5,
4530
+ flexShrink: 0
4531
+ },
4532
+ children: LEGEND.map(function (leg) {
4533
+ return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
4534
+ sx: {
4535
+ display: "flex",
4536
+ alignItems: "center",
4537
+ gap: 0.5
4538
+ },
4539
+ children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
4540
+ sx: {
4541
+ width: 8,
4542
+ height: 8,
4543
+ borderRadius: "50%",
4544
+ bgcolor: leg.color
4545
+ }
4546
+ }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
4547
+ sx: {
4548
+ fontSize: 10,
4549
+ color: "rgba(0,0,0,0.55)"
4550
+ },
4551
+ children: leg.label
4552
+ })]
4553
+ }, leg.label);
4554
+ })
4555
+ })]
4556
+ }), /*#__PURE__*/jsxRuntime.jsx(ReportLineChart, {
4557
+ series: item.series || [],
4558
+ categories: item.categories || [],
4559
+ width: chartWidth,
4560
+ height: 185
4310
4561
  })]
4311
- })]
4562
+ })
4312
4563
  });
4313
4564
  };
4314
4565
 
4566
+ var EXPORT_CHART_W = 730;
4315
4567
  var ReportBody = function ReportBody(_ref) {
4316
4568
  var _ref$apiData = _ref.apiData,
4317
4569
  apiData = _ref$apiData === void 0 ? {} : _ref$apiData,
@@ -4327,15 +4579,18 @@ var ReportBody = function ReportBody(_ref) {
4327
4579
  var activeFilterChips = React.useMemo(function () {
4328
4580
  return getActiveFilterChips(apiData);
4329
4581
  }, [apiData]);
4330
- var chartBlock = /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
4582
+ var chartBlock = exportMode ? /*#__PURE__*/jsxRuntime.jsx(ReportExportChartCard, {
4583
+ item: reportData.mainChart,
4584
+ chartWidth: EXPORT_CHART_W
4585
+ }) : /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
4331
4586
  container: true,
4332
- spacing: exportMode ? 1 : 2,
4587
+ spacing: 2,
4333
4588
  sx: {
4334
4589
  mb: 0
4335
4590
  },
4336
4591
  children: /*#__PURE__*/jsxRuntime.jsx(RenderChartCard, {
4337
4592
  item: _objectSpread2(_objectSpread2({}, reportData.mainChart), {}, {
4338
- height: exportMode ? 210 : 320
4593
+ height: 320
4339
4594
  }),
4340
4595
  index: 0,
4341
4596
  md: 12,
@@ -4348,8 +4603,8 @@ var ReportBody = function ReportBody(_ref) {
4348
4603
  if (variant === "page1") {
4349
4604
  return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
4350
4605
  sx: {
4351
- px: exportMode ? 2.5 : 0,
4352
- py: exportMode ? 2 : 0
4606
+ px: exportMode ? 2 : 0,
4607
+ py: exportMode ? 1.5 : 0
4353
4608
  },
4354
4609
  children: [/*#__PURE__*/jsxRuntime.jsx(ReportHeader, {
4355
4610
  dateName: dateName,
@@ -4365,13 +4620,28 @@ var ReportBody = function ReportBody(_ref) {
4365
4620
  if (variant === "page2") {
4366
4621
  return /*#__PURE__*/jsxRuntime.jsx(material.Box, {
4367
4622
  sx: {
4368
- px: exportMode ? 2.5 : 0,
4369
- py: exportMode ? 2 : 0
4623
+ px: exportMode ? 2 : 0,
4624
+ py: exportMode ? 1.5 : 0
4370
4625
  },
4371
4626
  children: /*#__PURE__*/jsxRuntime.jsx(ReportDetailsSection, {
4372
4627
  reportData: reportData,
4373
4628
  dateName: dateName,
4374
- exportMode: exportMode
4629
+ exportMode: exportMode,
4630
+ section: "top"
4631
+ })
4632
+ });
4633
+ }
4634
+ if (variant === "page3") {
4635
+ return /*#__PURE__*/jsxRuntime.jsx(material.Box, {
4636
+ sx: {
4637
+ px: exportMode ? 2 : 0,
4638
+ py: exportMode ? 1.5 : 0
4639
+ },
4640
+ children: /*#__PURE__*/jsxRuntime.jsx(ReportDetailsSection, {
4641
+ reportData: reportData,
4642
+ dateName: dateName,
4643
+ exportMode: exportMode,
4644
+ section: "bottom"
4375
4645
  })
4376
4646
  });
4377
4647
  }
@@ -4384,7 +4654,8 @@ var ReportBody = function ReportBody(_ref) {
4384
4654
  metrics: reportData.metrics
4385
4655
  }), chartBlock, /*#__PURE__*/jsxRuntime.jsx(ReportDetailsSection, {
4386
4656
  reportData: reportData,
4387
- dateName: dateName
4657
+ dateName: dateName,
4658
+ section: "all"
4388
4659
  })]
4389
4660
  });
4390
4661
  };
@@ -4432,6 +4703,12 @@ var ReportExportLayout = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
4432
4703
  children: /*#__PURE__*/jsxRuntime.jsx(ReportBody, _objectSpread2(_objectSpread2({}, bodyProps), {}, {
4433
4704
  variant: "page2"
4434
4705
  }))
4706
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
4707
+ "data-export-page": "3",
4708
+ style: pageStyle,
4709
+ children: /*#__PURE__*/jsxRuntime.jsx(ReportBody, _objectSpread2(_objectSpread2({}, bodyProps), {}, {
4710
+ variant: "page3"
4711
+ }))
4435
4712
  })]
4436
4713
  })
4437
4714
  });
@@ -4583,7 +4860,7 @@ var NewOverview = function NewOverview(_ref) {
4583
4860
  case 1:
4584
4861
  _context.n = 2;
4585
4862
  return new Promise(function (r) {
4586
- return setTimeout(r, 1200);
4863
+ return setTimeout(r, 600);
4587
4864
  });
4588
4865
  case 2:
4589
4866
  container = exportLayoutRef.current;
@@ -4821,9 +5098,9 @@ var NewOverview = function NewOverview(_ref) {
4821
5098
  position: "fixed",
4822
5099
  top: 0,
4823
5100
  left: 0,
5101
+ transform: "translateX(-10000px)",
4824
5102
  zIndex: -1,
4825
5103
  pointerEvents: "none",
4826
- opacity: 0.01,
4827
5104
  overflow: "hidden"
4828
5105
  },
4829
5106
  children: /*#__PURE__*/jsxRuntime.jsx(ReportExportLayout, {