@ammarkhalidfarooq/dashboard-package 0.6.95 → 0.6.96
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 +1133 -1160
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1133 -1160
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1484,7 +1484,7 @@ var parseDonationTypeChartData = function parseDonationTypeChartData(donationTyp
|
|
|
1484
1484
|
|
|
1485
1485
|
/** Normalizes refundAndChargeBacks from API for PDF + report cards. */
|
|
1486
1486
|
var parseRefundsChargebacks = function parseRefundsChargebacks(refundsData) {
|
|
1487
|
-
var _raw$refundRate, _raw$chargebackRate, _raw$totalRefundedAmo, _raw$totalRefunds, _raw$totalChargebacks, _raw$wonChargebacks, _raw$lostChargebacks, _raw$growthPercentage, _raw$totalRevenue;
|
|
1487
|
+
var _raw$refundRate, _raw$chargebackRate, _raw$totalRefundedAmo, _raw$totalRefunds, _raw$totalChargebacks, _raw$wonChargebacks, _raw$lostChargebacks, _raw$growthPercentage, _ref, _raw$disputedAmount, _raw$totalRevenue;
|
|
1488
1488
|
var raw = refundsData && _typeof(refundsData) === "object" ? refundsData : {};
|
|
1489
1489
|
return {
|
|
1490
1490
|
refundRate: Number((_raw$refundRate = raw.refundRate) !== null && _raw$refundRate !== void 0 ? _raw$refundRate : 0),
|
|
@@ -1495,6 +1495,7 @@ var parseRefundsChargebacks = function parseRefundsChargebacks(refundsData) {
|
|
|
1495
1495
|
wonChargebacks: Number((_raw$wonChargebacks = raw.wonChargebacks) !== null && _raw$wonChargebacks !== void 0 ? _raw$wonChargebacks : 0),
|
|
1496
1496
|
lostChargebacks: Number((_raw$lostChargebacks = raw.lostChargebacks) !== null && _raw$lostChargebacks !== void 0 ? _raw$lostChargebacks : 0),
|
|
1497
1497
|
growthPercentage: Number((_raw$growthPercentage = raw.growthPercentage) !== null && _raw$growthPercentage !== void 0 ? _raw$growthPercentage : 0),
|
|
1498
|
+
disputedAmount: Number((_ref = (_raw$disputedAmount = raw.disputedAmount) !== null && _raw$disputedAmount !== void 0 ? _raw$disputedAmount : raw.totalDisputed) !== null && _ref !== void 0 ? _ref : 0),
|
|
1498
1499
|
chartData: Array.isArray(raw.chartData) ? raw.chartData : [],
|
|
1499
1500
|
totalRevenue: Number((_raw$totalRevenue = raw.totalRevenue) !== null && _raw$totalRevenue !== void 0 ? _raw$totalRevenue : 0)
|
|
1500
1501
|
};
|
|
@@ -1502,11 +1503,11 @@ var parseRefundsChargebacks = function parseRefundsChargebacks(refundsData) {
|
|
|
1502
1503
|
|
|
1503
1504
|
/** Median / top-decile for avg donation KPI (not shown in Overall section UI). */
|
|
1504
1505
|
var parseAvgDonationDetail = function parseAvgDonationDetail() {
|
|
1505
|
-
var _apiData$overviewStat,
|
|
1506
|
+
var _apiData$overviewStat, _ref2, _ref3, _ref4, _ref5, _ref6, _overview$medianDonat, _ref7, _ref8, _ref9, _ref0, _ref1, _overview$topDecileDo;
|
|
1506
1507
|
var apiData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1507
1508
|
var overview = (apiData === null || apiData === void 0 || (_apiData$overviewStat = apiData.overviewStats) === null || _apiData$overviewStat === void 0 ? void 0 : _apiData$overviewStat.overview) || {};
|
|
1508
|
-
var median = Number((
|
|
1509
|
-
var topDecile = Number((
|
|
1509
|
+
var median = Number((_ref2 = (_ref3 = (_ref4 = (_ref5 = (_ref6 = (_overview$medianDonat = overview === null || overview === void 0 ? void 0 : overview.medianDonation) !== null && _overview$medianDonat !== void 0 ? _overview$medianDonat : overview === null || overview === void 0 ? void 0 : overview.medianGift) !== null && _ref6 !== void 0 ? _ref6 : overview === null || overview === void 0 ? void 0 : overview.median) !== null && _ref5 !== void 0 ? _ref5 : apiData === null || apiData === void 0 ? void 0 : apiData.medianGift) !== null && _ref4 !== void 0 ? _ref4 : apiData === null || apiData === void 0 ? void 0 : apiData.medianDonation) !== null && _ref3 !== void 0 ? _ref3 : apiData === null || apiData === void 0 ? void 0 : apiData.median) !== null && _ref2 !== void 0 ? _ref2 : 0);
|
|
1510
|
+
var topDecile = Number((_ref7 = (_ref8 = (_ref9 = (_ref0 = (_ref1 = (_overview$topDecileDo = overview === null || overview === void 0 ? void 0 : overview.topDecileDonation) !== null && _overview$topDecileDo !== void 0 ? _overview$topDecileDo : overview === null || overview === void 0 ? void 0 : overview.topDecileGift) !== null && _ref1 !== void 0 ? _ref1 : overview === null || overview === void 0 ? void 0 : overview.topDecile) !== null && _ref0 !== void 0 ? _ref0 : apiData === null || apiData === void 0 ? void 0 : apiData.topDecileGift) !== null && _ref9 !== void 0 ? _ref9 : apiData === null || apiData === void 0 ? void 0 : apiData.topDecileDonation) !== null && _ref8 !== void 0 ? _ref8 : apiData === null || apiData === void 0 ? void 0 : apiData.topDecile) !== null && _ref7 !== void 0 ? _ref7 : 0);
|
|
1510
1511
|
return {
|
|
1511
1512
|
median: median,
|
|
1512
1513
|
topDecile: topDecile
|
|
@@ -1518,11 +1519,11 @@ var parseAvgDonationDetail = function parseAvgDonationDetail() {
|
|
|
1518
1519
|
var parseDonorGeographyList = function parseDonorGeographyList(donorGeographyData) {
|
|
1519
1520
|
var rawCountries = Array.isArray(donorGeographyData) ? donorGeographyData : (donorGeographyData === null || donorGeographyData === void 0 ? void 0 : donorGeographyData.countries) || (donorGeographyData === null || donorGeographyData === void 0 ? void 0 : donorGeographyData.data) || [];
|
|
1520
1521
|
return rawCountries.map(function (item) {
|
|
1521
|
-
var _item$percentage,
|
|
1522
|
+
var _item$percentage, _ref10, _ref11, _item$value;
|
|
1522
1523
|
return {
|
|
1523
1524
|
country: item.countryName || item.country || item.name || "Unknown",
|
|
1524
1525
|
percentage: typeof item.percentage === "number" ? item.percentage : Number((_item$percentage = item.percentage) !== null && _item$percentage !== void 0 ? _item$percentage : 0),
|
|
1525
|
-
value: item.donations !== undefined ? item.donations : (
|
|
1526
|
+
value: item.donations !== undefined ? item.donations : (_ref10 = (_ref11 = (_item$value = item.value) !== null && _item$value !== void 0 ? _item$value : item.totalDonors) !== null && _ref11 !== void 0 ? _ref11 : item.donors) !== null && _ref10 !== void 0 ? _ref10 : 0
|
|
1526
1527
|
};
|
|
1527
1528
|
});
|
|
1528
1529
|
};
|
|
@@ -1674,7 +1675,8 @@ var buildReportData = function buildReportData() {
|
|
|
1674
1675
|
type: "progress",
|
|
1675
1676
|
progress: Math.round((campaign.collectedAmount || 0) / (campaign.usdTargetAmount || 1) * 100),
|
|
1676
1677
|
val3: formatNumber(campaign.uniqueDonationsCount || 0),
|
|
1677
|
-
val4: "$".concat(formatNumber(campaign.avgGift || 0))
|
|
1678
|
+
val4: "$".concat(formatNumber(campaign.avgGift || campaign.averageDonation || 0)),
|
|
1679
|
+
status: campaign.status || ""
|
|
1678
1680
|
};
|
|
1679
1681
|
});
|
|
1680
1682
|
return {
|
|
@@ -1711,12 +1713,9 @@ var MIN_H = 1123;
|
|
|
1711
1713
|
var MX = 32; // horizontal margin
|
|
1712
1714
|
var THEME = {
|
|
1713
1715
|
pageBg: "#F9FAFB",
|
|
1714
|
-
panelBg: "#FFFFFF",
|
|
1715
1716
|
panelBorder: "#E5E7EB",
|
|
1716
1717
|
brand: "#6366F1",
|
|
1717
1718
|
kpiBorderPrimary: "#C7D2FE",
|
|
1718
|
-
tableHeadBg: "#EEF2FF",
|
|
1719
|
-
tableAltBg: "#F8FAFF",
|
|
1720
1719
|
muted: "#9CA3AF",
|
|
1721
1720
|
text: "#111827",
|
|
1722
1721
|
trendUpBg: "#D1FAE5",
|
|
@@ -1747,56 +1746,6 @@ var pct = function pct(v) {
|
|
|
1747
1746
|
var dp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
1748
1747
|
return "".concat(Number(v !== null && v !== void 0 ? v : 0).toFixed(dp), "%");
|
|
1749
1748
|
};
|
|
1750
|
-
var TREND_UP = "#0B8F61";
|
|
1751
|
-
var TREND_DOWN = "#ef4444";
|
|
1752
|
-
var resolveTrendColor = function resolveTrendColor(trendText) {
|
|
1753
|
-
var trendPositiveWhenNegative = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1754
|
-
return getTrendColor(trendText, trendPositiveWhenNegative ? {
|
|
1755
|
-
up: TREND_DOWN,
|
|
1756
|
-
down: TREND_UP,
|
|
1757
|
-
neutral: TREND_UP
|
|
1758
|
-
} : {
|
|
1759
|
-
up: TREND_UP,
|
|
1760
|
-
down: TREND_DOWN,
|
|
1761
|
-
neutral: TREND_UP
|
|
1762
|
-
});
|
|
1763
|
-
};
|
|
1764
|
-
var withTrendArrow = function withTrendArrow(text) {
|
|
1765
|
-
var str = String(text !== null && text !== void 0 ? text : "").trim();
|
|
1766
|
-
if (!str || str.includes("▼") || str.includes("▲")) return str;
|
|
1767
|
-
var arrow = getTrendArrow(str);
|
|
1768
|
-
return arrow ? "".concat(arrow, " ").concat(str) : str;
|
|
1769
|
-
};
|
|
1770
|
-
var formatArrowTrend = function formatArrowTrend(value) {
|
|
1771
|
-
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
1772
|
-
_ref$suffix = _ref.suffix,
|
|
1773
|
-
suffix = _ref$suffix === void 0 ? "%" : _ref$suffix,
|
|
1774
|
-
_ref$decimals = _ref.decimals,
|
|
1775
|
-
decimals = _ref$decimals === void 0 ? 1 : _ref$decimals,
|
|
1776
|
-
_ref$label = _ref.label,
|
|
1777
|
-
label = _ref$label === void 0 ? "" : _ref$label;
|
|
1778
|
-
var n = Number(value !== null && value !== void 0 ? value : 0);
|
|
1779
|
-
var arrow = n >= 0 ? "▲" : "▼";
|
|
1780
|
-
var labelSuffix = label ? " ".concat(label) : "";
|
|
1781
|
-
if (suffix === "pp") return "".concat(arrow, " ").concat(Math.abs(n).toFixed(2), "pp").concat(labelSuffix);
|
|
1782
|
-
if (suffix === "x") return "".concat(arrow, " ").concat(Math.abs(n).toFixed(1), "x").concat(labelSuffix);
|
|
1783
|
-
return "".concat(arrow, " ").concat(Math.abs(n).toFixed(decimals), "%").concat(labelSuffix);
|
|
1784
|
-
};
|
|
1785
|
-
var TrendText = function TrendText(_ref2) {
|
|
1786
|
-
var children = _ref2.children,
|
|
1787
|
-
_ref2$invert = _ref2.invert,
|
|
1788
|
-
invert = _ref2$invert === void 0 ? false : _ref2$invert,
|
|
1789
|
-
_ref2$style = _ref2.style,
|
|
1790
|
-
style = _ref2$style === void 0 ? {} : _ref2$style;
|
|
1791
|
-
var text = withTrendArrow(children);
|
|
1792
|
-
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
1793
|
-
style: _objectSpread2({
|
|
1794
|
-
fontWeight: 600,
|
|
1795
|
-
color: resolveTrendColor(text, invert)
|
|
1796
|
-
}, style),
|
|
1797
|
-
children: text
|
|
1798
|
-
});
|
|
1799
|
-
};
|
|
1800
1749
|
|
|
1801
1750
|
// ─── SVG path helpers ─────────────────────────────────────────────────────────
|
|
1802
1751
|
var buildSmoothPath = function buildSmoothPath(points) {
|
|
@@ -1958,119 +1907,6 @@ var Divider = function Divider(_ref5) {
|
|
|
1958
1907
|
}
|
|
1959
1908
|
});
|
|
1960
1909
|
};
|
|
1961
|
-
var Panel = function Panel(_ref6) {
|
|
1962
|
-
var children = _ref6.children,
|
|
1963
|
-
title = _ref6.title,
|
|
1964
|
-
subtitle = _ref6.subtitle,
|
|
1965
|
-
action = _ref6.action,
|
|
1966
|
-
_ref6$style = _ref6.style,
|
|
1967
|
-
style = _ref6$style === void 0 ? {} : _ref6$style;
|
|
1968
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1969
|
-
style: _objectSpread2({
|
|
1970
|
-
border: "1px solid ".concat(THEME.panelBorder),
|
|
1971
|
-
borderRadius: 8,
|
|
1972
|
-
background: THEME.panelBg,
|
|
1973
|
-
padding: 12,
|
|
1974
|
-
display: "flex",
|
|
1975
|
-
flexDirection: "column",
|
|
1976
|
-
boxSizing: "border-box",
|
|
1977
|
-
boxShadow: "0 1px 0 rgba(15,23,42,0.03)"
|
|
1978
|
-
}, style),
|
|
1979
|
-
children: [(title || subtitle || action) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1980
|
-
style: {
|
|
1981
|
-
display: "flex",
|
|
1982
|
-
justifyContent: "space-between",
|
|
1983
|
-
alignItems: "flex-start",
|
|
1984
|
-
marginBottom: 8,
|
|
1985
|
-
flexShrink: 0
|
|
1986
|
-
},
|
|
1987
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1988
|
-
children: [title && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1989
|
-
style: {
|
|
1990
|
-
fontSize: 12,
|
|
1991
|
-
fontWeight: 700,
|
|
1992
|
-
color: THEME.text,
|
|
1993
|
-
lineHeight: 1.15
|
|
1994
|
-
},
|
|
1995
|
-
children: title
|
|
1996
|
-
}), subtitle && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1997
|
-
style: {
|
|
1998
|
-
fontSize: 9.5,
|
|
1999
|
-
color: THEME.muted,
|
|
2000
|
-
lineHeight: 1.15
|
|
2001
|
-
},
|
|
2002
|
-
children: subtitle
|
|
2003
|
-
})]
|
|
2004
|
-
}), action && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2005
|
-
style: {
|
|
2006
|
-
fontSize: 9.5,
|
|
2007
|
-
color: "#6366F1",
|
|
2008
|
-
fontWeight: 500,
|
|
2009
|
-
flexShrink: 0
|
|
2010
|
-
},
|
|
2011
|
-
children: action
|
|
2012
|
-
})]
|
|
2013
|
-
}), children]
|
|
2014
|
-
});
|
|
2015
|
-
};
|
|
2016
|
-
var MiniTable = function MiniTable(_ref7) {
|
|
2017
|
-
var _ref7$head = _ref7.head,
|
|
2018
|
-
head = _ref7$head === void 0 ? [] : _ref7$head,
|
|
2019
|
-
_ref7$rows = _ref7.rows,
|
|
2020
|
-
rows = _ref7$rows === void 0 ? [] : _ref7$rows,
|
|
2021
|
-
_ref7$colAlign = _ref7.colAlign,
|
|
2022
|
-
colAlign = _ref7$colAlign === void 0 ? [] : _ref7$colAlign;
|
|
2023
|
-
return /*#__PURE__*/jsxRuntime.jsxs("table", {
|
|
2024
|
-
style: {
|
|
2025
|
-
width: "100%",
|
|
2026
|
-
borderCollapse: "collapse",
|
|
2027
|
-
fontSize: 9.5,
|
|
2028
|
-
tableLayout: "fixed",
|
|
2029
|
-
background: "#fff"
|
|
2030
|
-
},
|
|
2031
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("thead", {
|
|
2032
|
-
children: /*#__PURE__*/jsxRuntime.jsx("tr", {
|
|
2033
|
-
style: {
|
|
2034
|
-
background: THEME.tableHeadBg
|
|
2035
|
-
},
|
|
2036
|
-
children: head.map(function (h, i) {
|
|
2037
|
-
return /*#__PURE__*/jsxRuntime.jsx("th", {
|
|
2038
|
-
style: {
|
|
2039
|
-
padding: "4px 6px",
|
|
2040
|
-
textAlign: colAlign[i] || (i === 0 ? "left" : "right"),
|
|
2041
|
-
fontWeight: 700,
|
|
2042
|
-
fontSize: 8.5,
|
|
2043
|
-
letterSpacing: "0.3px",
|
|
2044
|
-
color: "#64748B",
|
|
2045
|
-
borderBottom: "1px solid #DDE3EA"
|
|
2046
|
-
},
|
|
2047
|
-
children: h
|
|
2048
|
-
}, i);
|
|
2049
|
-
})
|
|
2050
|
-
})
|
|
2051
|
-
}), /*#__PURE__*/jsxRuntime.jsx("tbody", {
|
|
2052
|
-
children: rows.map(function (row, ri) {
|
|
2053
|
-
return /*#__PURE__*/jsxRuntime.jsx("tr", {
|
|
2054
|
-
style: {
|
|
2055
|
-
background: ri % 2 === 1 ? THEME.tableAltBg : "#fff"
|
|
2056
|
-
},
|
|
2057
|
-
children: row.map(function (cell, ci) {
|
|
2058
|
-
return /*#__PURE__*/jsxRuntime.jsx("td", {
|
|
2059
|
-
style: {
|
|
2060
|
-
padding: "4px 6px",
|
|
2061
|
-
textAlign: colAlign[ci] || (ci === 0 ? "left" : "right"),
|
|
2062
|
-
color: "#334155",
|
|
2063
|
-
borderBottom: ri < rows.length - 1 ? "1px solid #EEF2F7" : "none",
|
|
2064
|
-
verticalAlign: "middle"
|
|
2065
|
-
},
|
|
2066
|
-
children: cell
|
|
2067
|
-
}, ci);
|
|
2068
|
-
})
|
|
2069
|
-
}, ri);
|
|
2070
|
-
})
|
|
2071
|
-
})]
|
|
2072
|
-
});
|
|
2073
|
-
};
|
|
2074
1910
|
var ProgressBar = function ProgressBar(_ref8) {
|
|
2075
1911
|
var value = _ref8.value,
|
|
2076
1912
|
_ref8$color = _ref8.color,
|
|
@@ -2119,71 +1955,6 @@ var ProgressBar = function ProgressBar(_ref8) {
|
|
|
2119
1955
|
})]
|
|
2120
1956
|
});
|
|
2121
1957
|
};
|
|
2122
|
-
var DonorGeographyPanel = function DonorGeographyPanel(_ref9) {
|
|
2123
|
-
var _ref9$geoList = _ref9.geoList,
|
|
2124
|
-
geoList = _ref9$geoList === void 0 ? [] : _ref9$geoList,
|
|
2125
|
-
_ref9$totalDonors = _ref9.totalDonors,
|
|
2126
|
-
totalDonors = _ref9$totalDonors === void 0 ? 0 : _ref9$totalDonors,
|
|
2127
|
-
_ref9$barColor = _ref9.barColor,
|
|
2128
|
-
barColor = _ref9$barColor === void 0 ? "#6366F1" : _ref9$barColor;
|
|
2129
|
-
return /*#__PURE__*/jsxRuntime.jsx(Panel, {
|
|
2130
|
-
title: "Donor geography",
|
|
2131
|
-
subtitle: "Top countries - ".concat(formatNumber(totalDonors), " total"),
|
|
2132
|
-
children: (geoList.length ? geoList.slice(0, 6) : []).map(function (g, i) {
|
|
2133
|
-
var _g$percentage;
|
|
2134
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2135
|
-
style: {
|
|
2136
|
-
padding: i < 5 ? "0 0 5px" : 0,
|
|
2137
|
-
marginBottom: i < 5 ? 5 : 0,
|
|
2138
|
-
borderBottom: i < 5 ? "1px solid #F3F4F6" : "none"
|
|
2139
|
-
},
|
|
2140
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2141
|
-
style: {
|
|
2142
|
-
display: "flex",
|
|
2143
|
-
justifyContent: "space-between",
|
|
2144
|
-
alignItems: "center",
|
|
2145
|
-
gap: 6,
|
|
2146
|
-
marginBottom: 3
|
|
2147
|
-
},
|
|
2148
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2149
|
-
style: {
|
|
2150
|
-
fontSize: 9,
|
|
2151
|
-
color: "#374151",
|
|
2152
|
-
overflow: "hidden",
|
|
2153
|
-
textOverflow: "ellipsis",
|
|
2154
|
-
whiteSpace: "nowrap",
|
|
2155
|
-
minWidth: 0
|
|
2156
|
-
},
|
|
2157
|
-
children: g.country
|
|
2158
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
2159
|
-
style: {
|
|
2160
|
-
fontSize: 9,
|
|
2161
|
-
fontWeight: 700,
|
|
2162
|
-
color: "#111827",
|
|
2163
|
-
flexShrink: 0
|
|
2164
|
-
},
|
|
2165
|
-
children: [formatNumber(g.value), " - ", formatNumber(g.percentage), "%"]
|
|
2166
|
-
})]
|
|
2167
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2168
|
-
style: {
|
|
2169
|
-
height: 5,
|
|
2170
|
-
background: "#F3F4F6",
|
|
2171
|
-
borderRadius: 3,
|
|
2172
|
-
overflow: "hidden"
|
|
2173
|
-
},
|
|
2174
|
-
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2175
|
-
style: {
|
|
2176
|
-
width: "".concat(Math.min(100, Math.max(0, Number((_g$percentage = g.percentage) !== null && _g$percentage !== void 0 ? _g$percentage : 0))), "%"),
|
|
2177
|
-
height: "100%",
|
|
2178
|
-
background: barColor,
|
|
2179
|
-
borderRadius: 3
|
|
2180
|
-
}
|
|
2181
|
-
})
|
|
2182
|
-
})]
|
|
2183
|
-
}, i);
|
|
2184
|
-
})
|
|
2185
|
-
});
|
|
2186
|
-
};
|
|
2187
1958
|
var formatDonationTypeCategory = function formatDonationTypeCategory(label, slotWidth) {
|
|
2188
1959
|
var str = String(label !== null && label !== void 0 ? label : "").trim();
|
|
2189
1960
|
if (!str) return "";
|
|
@@ -2199,401 +1970,46 @@ var formatDonationTypeCategory = function formatDonationTypeCategory(label, slot
|
|
|
2199
1970
|
if (noYear.length <= maxChars) return noYear;
|
|
2200
1971
|
return "".concat(noYear.slice(0, Math.max(1, maxChars - 1)), "\u2026");
|
|
2201
1972
|
};
|
|
2202
|
-
var
|
|
2203
|
-
var
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
_ref0$oneTime = _ref0.oneTime,
|
|
2208
|
-
oneTime = _ref0$oneTime === void 0 ? [] : _ref0$oneTime,
|
|
2209
|
-
_ref0$recurringColor = _ref0.recurringColor,
|
|
2210
|
-
recurringColor = _ref0$recurringColor === void 0 ? "#6366F1" : _ref0$recurringColor,
|
|
2211
|
-
_ref0$oneTimeColor = _ref0.oneTimeColor,
|
|
2212
|
-
oneTimeColor = _ref0$oneTimeColor === void 0 ? "#10B981" : _ref0$oneTimeColor;
|
|
2213
|
-
var width = 158;
|
|
2214
|
-
var height = 96;
|
|
2215
|
-
var padL = 30;
|
|
2216
|
-
var padR = 2;
|
|
2217
|
-
var padT = 14;
|
|
2218
|
-
var padB = 20;
|
|
2219
|
-
var chartW = width - padL - padR;
|
|
2220
|
-
var chartH = height - padT - padB;
|
|
2221
|
-
var allVals = [].concat(_toConsumableArray(recurring), _toConsumableArray(oneTime));
|
|
2222
|
-
var maxVal = Math.max.apply(Math, _toConsumableArray(allVals).concat([0])) || 1;
|
|
2223
|
-
var n = categories.length;
|
|
2224
|
-
var yTicks = [0, maxVal / 2, maxVal];
|
|
2225
|
-
var groupW = n > 0 ? chartW / n : chartW;
|
|
2226
|
-
var labelFontSize = n > 3 ? 5 : 5.5;
|
|
2227
|
-
if (!n) {
|
|
2228
|
-
return /*#__PURE__*/jsxRuntime.jsxs("svg", {
|
|
2229
|
-
width: "100%",
|
|
2230
|
-
height: height,
|
|
2231
|
-
viewBox: "0 0 ".concat(width, " ").concat(height),
|
|
2232
|
-
style: {
|
|
2233
|
-
display: "block"
|
|
2234
|
-
},
|
|
2235
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("line", {
|
|
2236
|
-
x1: padL,
|
|
2237
|
-
y1: padT + chartH,
|
|
2238
|
-
x2: width - padR,
|
|
2239
|
-
y2: padT + chartH,
|
|
2240
|
-
stroke: "#f1f1f1"
|
|
2241
|
-
}), /*#__PURE__*/jsxRuntime.jsx("text", {
|
|
2242
|
-
x: padL - 4,
|
|
2243
|
-
y: padT + chartH + 3,
|
|
2244
|
-
textAnchor: "end",
|
|
2245
|
-
fontSize: 7,
|
|
2246
|
-
fill: "rgba(0,0,0,0.4)",
|
|
2247
|
-
children: "$0"
|
|
2248
|
-
})]
|
|
2249
|
-
});
|
|
2250
|
-
}
|
|
2251
|
-
var barW = Math.min(groupW * 0.3, 12);
|
|
2252
|
-
var baseY = padT + chartH;
|
|
2253
|
-
return /*#__PURE__*/jsxRuntime.jsxs("svg", {
|
|
2254
|
-
width: "100%",
|
|
2255
|
-
height: height,
|
|
2256
|
-
viewBox: "0 0 ".concat(width, " ").concat(height),
|
|
1973
|
+
var TrendPill$1 = function TrendPill(_ref12) {
|
|
1974
|
+
var children = _ref12.children,
|
|
1975
|
+
_ref12$positive = _ref12.positive,
|
|
1976
|
+
positive = _ref12$positive === void 0 ? true : _ref12$positive;
|
|
1977
|
+
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2257
1978
|
style: {
|
|
2258
|
-
display: "
|
|
1979
|
+
display: "inline-flex",
|
|
1980
|
+
alignItems: "center",
|
|
1981
|
+
background: positive ? THEME.trendUpBg : "#FEE2E2",
|
|
1982
|
+
color: positive ? THEME.trendUpText : "#DC2626",
|
|
1983
|
+
padding: "3px 10px",
|
|
1984
|
+
borderRadius: 100,
|
|
1985
|
+
fontSize: 9,
|
|
1986
|
+
fontWeight: 600,
|
|
1987
|
+
whiteSpace: "nowrap",
|
|
1988
|
+
lineHeight: 1.35
|
|
2259
1989
|
},
|
|
2260
|
-
children:
|
|
2261
|
-
children: categories.map(function (_, i) {
|
|
2262
|
-
return /*#__PURE__*/jsxRuntime.jsx("clipPath", {
|
|
2263
|
-
id: "donation-type-cat-clip-".concat(i),
|
|
2264
|
-
children: /*#__PURE__*/jsxRuntime.jsx("rect", {
|
|
2265
|
-
x: padL + i * groupW,
|
|
2266
|
-
y: baseY + 2,
|
|
2267
|
-
width: groupW,
|
|
2268
|
-
height: padB - 2
|
|
2269
|
-
})
|
|
2270
|
-
}, "clip-".concat(i));
|
|
2271
|
-
})
|
|
2272
|
-
}), yTicks.map(function (tick, i) {
|
|
2273
|
-
var y = padT + chartH - tick / maxVal * chartH;
|
|
2274
|
-
return /*#__PURE__*/jsxRuntime.jsxs("g", {
|
|
2275
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("line", {
|
|
2276
|
-
x1: padL,
|
|
2277
|
-
y1: y,
|
|
2278
|
-
x2: width - padR,
|
|
2279
|
-
y2: y,
|
|
2280
|
-
stroke: "#f1f1f1",
|
|
2281
|
-
strokeDasharray: "4"
|
|
2282
|
-
}), /*#__PURE__*/jsxRuntime.jsx("text", {
|
|
2283
|
-
x: padL - 4,
|
|
2284
|
-
y: y + 3,
|
|
2285
|
-
textAnchor: "end",
|
|
2286
|
-
fontSize: 7,
|
|
2287
|
-
fill: "rgba(0,0,0,0.4)",
|
|
2288
|
-
children: d$Compact(tick)
|
|
2289
|
-
})]
|
|
2290
|
-
}, "y-".concat(i));
|
|
2291
|
-
}), categories.map(function (cat, i) {
|
|
2292
|
-
var groupX = padL + i * groupW + groupW / 2;
|
|
2293
|
-
var rVal = recurring[i] || 0;
|
|
2294
|
-
var oVal = oneTime[i] || 0;
|
|
2295
|
-
var rH = rVal / maxVal * chartH;
|
|
2296
|
-
var oH = oVal / maxVal * chartH;
|
|
2297
|
-
var rX = groupX - barW - 1;
|
|
2298
|
-
var oX = groupX + 1;
|
|
2299
|
-
return /*#__PURE__*/jsxRuntime.jsxs("g", {
|
|
2300
|
-
children: [rVal > 0 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2301
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("rect", {
|
|
2302
|
-
x: rX,
|
|
2303
|
-
y: baseY - rH,
|
|
2304
|
-
width: barW,
|
|
2305
|
-
height: Math.max(rH, 1),
|
|
2306
|
-
fill: recurringColor,
|
|
2307
|
-
rx: 2
|
|
2308
|
-
}), /*#__PURE__*/jsxRuntime.jsx("text", {
|
|
2309
|
-
x: rX + barW / 2,
|
|
2310
|
-
y: baseY - rH - 3,
|
|
2311
|
-
textAnchor: "middle",
|
|
2312
|
-
fontSize: 6.5,
|
|
2313
|
-
fontWeight: 600,
|
|
2314
|
-
fill: "#111827",
|
|
2315
|
-
children: d$Compact(rVal)
|
|
2316
|
-
})]
|
|
2317
|
-
}), oVal > 0 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2318
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("rect", {
|
|
2319
|
-
x: oX,
|
|
2320
|
-
y: baseY - oH,
|
|
2321
|
-
width: barW,
|
|
2322
|
-
height: Math.max(oH, 1),
|
|
2323
|
-
fill: oneTimeColor,
|
|
2324
|
-
rx: 2
|
|
2325
|
-
}), /*#__PURE__*/jsxRuntime.jsx("text", {
|
|
2326
|
-
x: oX + barW / 2,
|
|
2327
|
-
y: baseY - oH - 3,
|
|
2328
|
-
textAnchor: "middle",
|
|
2329
|
-
fontSize: 6.5,
|
|
2330
|
-
fontWeight: 600,
|
|
2331
|
-
fill: "#111827",
|
|
2332
|
-
children: d$Compact(oVal)
|
|
2333
|
-
})]
|
|
2334
|
-
}), /*#__PURE__*/jsxRuntime.jsx("text", {
|
|
2335
|
-
x: groupX,
|
|
2336
|
-
y: height - 5,
|
|
2337
|
-
textAnchor: "middle",
|
|
2338
|
-
fontSize: labelFontSize,
|
|
2339
|
-
fill: "rgba(0,0,0,0.4)",
|
|
2340
|
-
clipPath: "url(#donation-type-cat-clip-".concat(i, ")"),
|
|
2341
|
-
children: formatDonationTypeCategory(cat, groupW)
|
|
2342
|
-
})]
|
|
2343
|
-
}, "bar-".concat(i));
|
|
2344
|
-
})]
|
|
1990
|
+
children: children
|
|
2345
1991
|
});
|
|
2346
1992
|
};
|
|
2347
|
-
var
|
|
2348
|
-
var
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
oneTimeColor = _ref1$oneTimeColor === void 0 ? "#10B981" : _ref1$oneTimeColor;
|
|
2353
|
-
var _parseDonationTypeCha = parseDonationTypeChartData(donationTypeData),
|
|
2354
|
-
categories = _parseDonationTypeCha.categories,
|
|
2355
|
-
recurring = _parseDonationTypeCha.recurring,
|
|
2356
|
-
oneTime = _parseDonationTypeCha.oneTime,
|
|
2357
|
-
recurringTotal = _parseDonationTypeCha.recurringTotal,
|
|
2358
|
-
oneTimeTotal = _parseDonationTypeCha.oneTimeTotal;
|
|
2359
|
-
return /*#__PURE__*/jsxRuntime.jsxs(Panel, {
|
|
2360
|
-
title: "Recurring vs one-time",
|
|
2361
|
-
subtitle: "Donation type - weekly",
|
|
2362
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2363
|
-
style: {
|
|
2364
|
-
display: "flex",
|
|
2365
|
-
flexWrap: "wrap",
|
|
2366
|
-
gap: "6px 10px",
|
|
2367
|
-
marginBottom: 4
|
|
2368
|
-
},
|
|
2369
|
-
children: [{
|
|
2370
|
-
label: "Recurring",
|
|
2371
|
-
total: recurringTotal,
|
|
2372
|
-
color: recurringColor
|
|
2373
|
-
}, {
|
|
2374
|
-
label: "One-time",
|
|
2375
|
-
total: oneTimeTotal,
|
|
2376
|
-
color: oneTimeColor
|
|
2377
|
-
}].map(function (item) {
|
|
2378
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2379
|
-
style: {
|
|
2380
|
-
display: "flex",
|
|
2381
|
-
alignItems: "center",
|
|
2382
|
-
gap: 4
|
|
2383
|
-
},
|
|
2384
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2385
|
-
style: {
|
|
2386
|
-
width: 6,
|
|
2387
|
-
height: 6,
|
|
2388
|
-
borderRadius: "50%",
|
|
2389
|
-
background: item.color,
|
|
2390
|
-
flexShrink: 0
|
|
2391
|
-
}
|
|
2392
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2393
|
-
style: {
|
|
2394
|
-
fontSize: 9.5,
|
|
2395
|
-
color: "#374151"
|
|
2396
|
-
},
|
|
2397
|
-
children: item.label
|
|
2398
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2399
|
-
style: {
|
|
2400
|
-
fontSize: 9.5,
|
|
2401
|
-
fontWeight: 700,
|
|
2402
|
-
color: "#111827"
|
|
2403
|
-
},
|
|
2404
|
-
children: d$(item.total)
|
|
2405
|
-
})]
|
|
2406
|
-
}, item.label);
|
|
2407
|
-
})
|
|
2408
|
-
}), /*#__PURE__*/jsxRuntime.jsx(DonationTypeBarSvg, {
|
|
2409
|
-
categories: categories,
|
|
2410
|
-
recurring: recurring,
|
|
2411
|
-
oneTime: oneTime,
|
|
2412
|
-
recurringColor: recurringColor,
|
|
2413
|
-
oneTimeColor: oneTimeColor
|
|
2414
|
-
})]
|
|
2415
|
-
});
|
|
1993
|
+
var isTrendPositive = function isTrendPositive(trendText) {
|
|
1994
|
+
var invert = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1995
|
+
var n = Number(String(trendText !== null && trendText !== void 0 ? trendText : "").replace(/[^0-9.\-+]/g, ""));
|
|
1996
|
+
if (Number.isNaN(n)) return true;
|
|
1997
|
+
return invert ? n <= 0 : n >= 0;
|
|
2416
1998
|
};
|
|
2417
|
-
var
|
|
2418
|
-
var
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
_ref10$raisedGrowth = _ref10.raisedGrowth,
|
|
2427
|
-
raisedGrowth = _ref10$raisedGrowth === void 0 ? 0 : _ref10$raisedGrowth,
|
|
2428
|
-
_ref10$primaryColor = _ref10.primaryColor,
|
|
2429
|
-
primaryColor = _ref10$primaryColor === void 0 ? "#6366F1" : _ref10$primaryColor,
|
|
2430
|
-
_ref10$secondaryColor = _ref10.secondaryColor,
|
|
2431
|
-
secondaryColor = _ref10$secondaryColor === void 0 ? "#88bfd290" : _ref10$secondaryColor;
|
|
2432
|
-
return /*#__PURE__*/jsxRuntime.jsx(Panel, {
|
|
2433
|
-
title: title,
|
|
2434
|
-
subtitle: subtitle,
|
|
1999
|
+
var PageOneHeader = function PageOneHeader(_ref13) {
|
|
2000
|
+
var dateLabel = _ref13.dateLabel,
|
|
2001
|
+
generatedLabel = _ref13.generatedLabel,
|
|
2002
|
+
windowLabel = _ref13.windowLabel;
|
|
2003
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2004
|
+
style: {
|
|
2005
|
+
padding: "36px ".concat(MX, "px 0"),
|
|
2006
|
+
flexShrink: 0
|
|
2007
|
+
},
|
|
2435
2008
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2436
2009
|
style: {
|
|
2437
2010
|
display: "flex",
|
|
2438
|
-
|
|
2439
|
-
alignItems: "
|
|
2440
|
-
},
|
|
2441
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Donut, {
|
|
2442
|
-
segments: [{
|
|
2443
|
-
value: acceptanceRate,
|
|
2444
|
-
color: primaryColor
|
|
2445
|
-
}, {
|
|
2446
|
-
value: Math.max(0, 100 - acceptanceRate),
|
|
2447
|
-
color: "#E5E7EB"
|
|
2448
|
-
}],
|
|
2449
|
-
size: 88,
|
|
2450
|
-
centerVal: "".concat(formatNumber(acceptanceRate), "%"),
|
|
2451
|
-
centerLabel: "accepted"
|
|
2452
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2453
|
-
style: {
|
|
2454
|
-
width: "100%",
|
|
2455
|
-
marginTop: 6
|
|
2456
|
-
},
|
|
2457
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2458
|
-
style: {
|
|
2459
|
-
display: "flex",
|
|
2460
|
-
justifyContent: "space-between",
|
|
2461
|
-
alignItems: "center",
|
|
2462
|
-
marginBottom: 5
|
|
2463
|
-
},
|
|
2464
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2465
|
-
style: {
|
|
2466
|
-
display: "flex",
|
|
2467
|
-
alignItems: "center",
|
|
2468
|
-
gap: 5
|
|
2469
|
-
},
|
|
2470
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2471
|
-
style: {
|
|
2472
|
-
width: 8,
|
|
2473
|
-
height: 8,
|
|
2474
|
-
borderRadius: 2,
|
|
2475
|
-
background: primaryColor,
|
|
2476
|
-
flexShrink: 0
|
|
2477
|
-
}
|
|
2478
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2479
|
-
style: {
|
|
2480
|
-
fontSize: 9.5,
|
|
2481
|
-
color: "#6B7280"
|
|
2482
|
-
},
|
|
2483
|
-
children: "Acceptance"
|
|
2484
|
-
})]
|
|
2485
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2486
|
-
style: {
|
|
2487
|
-
display: "flex",
|
|
2488
|
-
alignItems: "baseline",
|
|
2489
|
-
gap: 4
|
|
2490
|
-
},
|
|
2491
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
2492
|
-
style: {
|
|
2493
|
-
fontSize: 9.5,
|
|
2494
|
-
fontWeight: 700,
|
|
2495
|
-
color: "#111827"
|
|
2496
|
-
},
|
|
2497
|
-
children: [formatNumber(acceptanceRate), "%"]
|
|
2498
|
-
}), /*#__PURE__*/jsxRuntime.jsx(TrendText, {
|
|
2499
|
-
style: {
|
|
2500
|
-
fontSize: 9
|
|
2501
|
-
},
|
|
2502
|
-
children: formatArrowTrend(acceptanceGrowth)
|
|
2503
|
-
})]
|
|
2504
|
-
})]
|
|
2505
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2506
|
-
style: {
|
|
2507
|
-
display: "flex",
|
|
2508
|
-
justifyContent: "space-between",
|
|
2509
|
-
alignItems: "center"
|
|
2510
|
-
},
|
|
2511
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2512
|
-
style: {
|
|
2513
|
-
display: "flex",
|
|
2514
|
-
alignItems: "center",
|
|
2515
|
-
gap: 5
|
|
2516
|
-
},
|
|
2517
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2518
|
-
style: {
|
|
2519
|
-
width: 8,
|
|
2520
|
-
height: 8,
|
|
2521
|
-
borderRadius: 2,
|
|
2522
|
-
background: secondaryColor,
|
|
2523
|
-
flexShrink: 0
|
|
2524
|
-
}
|
|
2525
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2526
|
-
style: {
|
|
2527
|
-
fontSize: 9.5,
|
|
2528
|
-
color: "#6B7280"
|
|
2529
|
-
},
|
|
2530
|
-
children: "Raised"
|
|
2531
|
-
})]
|
|
2532
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2533
|
-
style: {
|
|
2534
|
-
display: "flex",
|
|
2535
|
-
alignItems: "baseline",
|
|
2536
|
-
gap: 4
|
|
2537
|
-
},
|
|
2538
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2539
|
-
style: {
|
|
2540
|
-
fontSize: 9.5,
|
|
2541
|
-
fontWeight: 700,
|
|
2542
|
-
color: "#111827"
|
|
2543
|
-
},
|
|
2544
|
-
children: d$(raised)
|
|
2545
|
-
}), /*#__PURE__*/jsxRuntime.jsx(TrendText, {
|
|
2546
|
-
style: {
|
|
2547
|
-
fontSize: 9
|
|
2548
|
-
},
|
|
2549
|
-
children: formatArrowTrend(raisedGrowth)
|
|
2550
|
-
})]
|
|
2551
|
-
})]
|
|
2552
|
-
})]
|
|
2553
|
-
})]
|
|
2554
|
-
})
|
|
2555
|
-
});
|
|
2556
|
-
};
|
|
2557
|
-
var TrendPill$1 = function TrendPill(_ref12) {
|
|
2558
|
-
var children = _ref12.children,
|
|
2559
|
-
_ref12$positive = _ref12.positive,
|
|
2560
|
-
positive = _ref12$positive === void 0 ? true : _ref12$positive;
|
|
2561
|
-
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2562
|
-
style: {
|
|
2563
|
-
display: "inline-flex",
|
|
2564
|
-
alignItems: "center",
|
|
2565
|
-
background: positive ? THEME.trendUpBg : "#FEE2E2",
|
|
2566
|
-
color: positive ? THEME.trendUpText : "#DC2626",
|
|
2567
|
-
padding: "3px 10px",
|
|
2568
|
-
borderRadius: 100,
|
|
2569
|
-
fontSize: 9,
|
|
2570
|
-
fontWeight: 600,
|
|
2571
|
-
whiteSpace: "nowrap",
|
|
2572
|
-
lineHeight: 1.35
|
|
2573
|
-
},
|
|
2574
|
-
children: children
|
|
2575
|
-
});
|
|
2576
|
-
};
|
|
2577
|
-
var isTrendPositive = function isTrendPositive(trendText) {
|
|
2578
|
-
var invert = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
2579
|
-
var n = Number(String(trendText !== null && trendText !== void 0 ? trendText : "").replace(/[^0-9.\-+]/g, ""));
|
|
2580
|
-
if (Number.isNaN(n)) return true;
|
|
2581
|
-
return invert ? n <= 0 : n >= 0;
|
|
2582
|
-
};
|
|
2583
|
-
var PageOneHeader = function PageOneHeader(_ref13) {
|
|
2584
|
-
var dateLabel = _ref13.dateLabel,
|
|
2585
|
-
generatedLabel = _ref13.generatedLabel,
|
|
2586
|
-
windowLabel = _ref13.windowLabel;
|
|
2587
|
-
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2588
|
-
style: {
|
|
2589
|
-
padding: "36px ".concat(MX, "px 0"),
|
|
2590
|
-
flexShrink: 0
|
|
2591
|
-
},
|
|
2592
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2593
|
-
style: {
|
|
2594
|
-
display: "flex",
|
|
2595
|
-
justifyContent: "space-between",
|
|
2596
|
-
alignItems: "flex-start"
|
|
2011
|
+
justifyContent: "space-between",
|
|
2012
|
+
alignItems: "flex-start"
|
|
2597
2013
|
},
|
|
2598
2014
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2599
2015
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -2844,159 +2260,1036 @@ var PageOneFooter = function PageOneFooter(_ref17) {
|
|
|
2844
2260
|
})
|
|
2845
2261
|
});
|
|
2846
2262
|
};
|
|
2847
|
-
var
|
|
2848
|
-
var
|
|
2849
|
-
generatedLabel = _ref18.generatedLabel
|
|
2850
|
-
|
|
2851
|
-
page = _ref18.page,
|
|
2852
|
-
windowLabel = _ref18.windowLabel;
|
|
2853
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2263
|
+
var PageTwoFooter = function PageTwoFooter(_ref18) {
|
|
2264
|
+
var generatedBy = _ref18.generatedBy,
|
|
2265
|
+
generatedLabel = _ref18.generatedLabel;
|
|
2266
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2854
2267
|
style: {
|
|
2855
|
-
padding: "
|
|
2856
|
-
|
|
2857
|
-
|
|
2268
|
+
padding: "14px ".concat(MX, "px 28px"),
|
|
2269
|
+
borderTop: "1px solid ".concat(THEME.panelBorder),
|
|
2270
|
+
marginTop: "auto",
|
|
2858
2271
|
flexShrink: 0
|
|
2859
2272
|
},
|
|
2860
|
-
children:
|
|
2273
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2861
2274
|
style: {
|
|
2862
2275
|
display: "flex",
|
|
2863
2276
|
justifyContent: "space-between",
|
|
2864
|
-
alignItems: "center"
|
|
2277
|
+
alignItems: "center",
|
|
2278
|
+
fontSize: 8,
|
|
2279
|
+
color: THEME.muted,
|
|
2280
|
+
lineHeight: 1.4
|
|
2281
|
+
},
|
|
2282
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
2283
|
+
children: ["Confidential", BULLET, "Generated by ", generatedBy, BULLET, generatedLabel]
|
|
2284
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
2285
|
+
children: ["Page 2 of 2", BULLET, "madinah.com"]
|
|
2286
|
+
})]
|
|
2287
|
+
})
|
|
2288
|
+
});
|
|
2289
|
+
};
|
|
2290
|
+
var P2Card = function P2Card(_ref19) {
|
|
2291
|
+
var children = _ref19.children,
|
|
2292
|
+
title = _ref19.title,
|
|
2293
|
+
subtitle = _ref19.subtitle,
|
|
2294
|
+
action = _ref19.action,
|
|
2295
|
+
_ref19$style = _ref19.style,
|
|
2296
|
+
style = _ref19$style === void 0 ? {} : _ref19$style;
|
|
2297
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2298
|
+
style: _objectSpread2({
|
|
2299
|
+
border: "1px solid ".concat(THEME.panelBorder),
|
|
2300
|
+
borderRadius: 12,
|
|
2301
|
+
background: "#FFFFFF",
|
|
2302
|
+
padding: "13px 14px 12px",
|
|
2303
|
+
display: "flex",
|
|
2304
|
+
flexDirection: "column",
|
|
2305
|
+
boxSizing: "border-box",
|
|
2306
|
+
minWidth: 0
|
|
2307
|
+
}, style),
|
|
2308
|
+
children: [(title || subtitle || action) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2309
|
+
style: {
|
|
2310
|
+
display: "flex",
|
|
2311
|
+
justifyContent: "space-between",
|
|
2312
|
+
alignItems: "flex-start",
|
|
2313
|
+
marginBottom: 10,
|
|
2314
|
+
flexShrink: 0,
|
|
2315
|
+
gap: 8
|
|
2865
2316
|
},
|
|
2866
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2317
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2867
2318
|
style: {
|
|
2868
|
-
|
|
2869
|
-
alignItems: "baseline",
|
|
2870
|
-
gap: 10
|
|
2319
|
+
minWidth: 0
|
|
2871
2320
|
},
|
|
2872
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("
|
|
2321
|
+
children: [title && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2873
2322
|
style: {
|
|
2874
|
-
fontSize:
|
|
2875
|
-
fontWeight:
|
|
2323
|
+
fontSize: 12,
|
|
2324
|
+
fontWeight: 700,
|
|
2876
2325
|
color: THEME.text,
|
|
2877
|
-
|
|
2326
|
+
lineHeight: 1.15
|
|
2878
2327
|
},
|
|
2879
|
-
children:
|
|
2880
|
-
}), /*#__PURE__*/jsxRuntime.jsx("
|
|
2328
|
+
children: title
|
|
2329
|
+
}), subtitle && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2881
2330
|
style: {
|
|
2882
|
-
fontSize:
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
textTransform: "uppercase"
|
|
2331
|
+
fontSize: 9,
|
|
2332
|
+
color: THEME.muted,
|
|
2333
|
+
marginTop: 2,
|
|
2334
|
+
lineHeight: 1.2
|
|
2887
2335
|
},
|
|
2888
|
-
children:
|
|
2336
|
+
children: subtitle
|
|
2889
2337
|
})]
|
|
2890
|
-
})
|
|
2891
|
-
}),
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2338
|
+
}), action]
|
|
2339
|
+
}), children]
|
|
2340
|
+
});
|
|
2341
|
+
};
|
|
2342
|
+
var campaignBarColor = function campaignBarColor() {
|
|
2343
|
+
var status = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
2344
|
+
var s = String(status).toLowerCase();
|
|
2345
|
+
if (s.includes("slow")) return "#F59E0B";
|
|
2346
|
+
if (s.includes("closing")) return "#14B8A6";
|
|
2347
|
+
return THEME.brand;
|
|
2348
|
+
};
|
|
2349
|
+
var StatusPill = function StatusPill(_ref20) {
|
|
2350
|
+
var _ref20$status = _ref20.status,
|
|
2351
|
+
status = _ref20$status === void 0 ? "" : _ref20$status;
|
|
2352
|
+
if (!String(status).trim()) {
|
|
2353
|
+
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2900
2354
|
style: {
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
marginTop: 2
|
|
2355
|
+
fontSize: 8,
|
|
2356
|
+
color: THEME.muted
|
|
2904
2357
|
},
|
|
2905
|
-
children:
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2358
|
+
children: "\u2014"
|
|
2359
|
+
});
|
|
2360
|
+
}
|
|
2361
|
+
var s = String(status).toLowerCase();
|
|
2362
|
+
var styles = s.includes("slow") ? {
|
|
2363
|
+
bg: "#FEF3C7",
|
|
2364
|
+
color: "#D97706",
|
|
2365
|
+
label: String(status).includes("$") ? status : "$ ".concat(status)
|
|
2366
|
+
} : s.includes("closing") ? {
|
|
2367
|
+
bg: "#DBEAFE",
|
|
2368
|
+
color: "#2563EB",
|
|
2369
|
+
label: status || "Closing"
|
|
2370
|
+
} : {
|
|
2371
|
+
bg: "#D1FAE5",
|
|
2372
|
+
color: "#059669",
|
|
2373
|
+
label: status || "Active"
|
|
2374
|
+
};
|
|
2375
|
+
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2376
|
+
style: {
|
|
2377
|
+
display: "inline-flex",
|
|
2378
|
+
alignItems: "center",
|
|
2379
|
+
background: styles.bg,
|
|
2380
|
+
color: styles.color,
|
|
2381
|
+
padding: "2px 8px",
|
|
2382
|
+
borderRadius: 100,
|
|
2383
|
+
fontSize: 8,
|
|
2384
|
+
fontWeight: 600,
|
|
2385
|
+
whiteSpace: "nowrap",
|
|
2386
|
+
lineHeight: 1.3
|
|
2387
|
+
},
|
|
2388
|
+
children: styles.label
|
|
2389
|
+
});
|
|
2390
|
+
};
|
|
2391
|
+
var P2CampaignTable = function P2CampaignTable(_ref21) {
|
|
2392
|
+
var _ref21$rows = _ref21.rows,
|
|
2393
|
+
rows = _ref21$rows === void 0 ? [] : _ref21$rows;
|
|
2394
|
+
return /*#__PURE__*/jsxRuntime.jsxs("table", {
|
|
2395
|
+
style: {
|
|
2396
|
+
width: "100%",
|
|
2397
|
+
borderCollapse: "collapse",
|
|
2398
|
+
fontSize: 9,
|
|
2399
|
+
tableLayout: "fixed"
|
|
2400
|
+
},
|
|
2401
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("thead", {
|
|
2402
|
+
children: /*#__PURE__*/jsxRuntime.jsx("tr", {
|
|
2403
|
+
children: ["Campaign", "Raised", "Progress", "Donors", "Status"].map(function (h, i) {
|
|
2404
|
+
return /*#__PURE__*/jsxRuntime.jsx("th", {
|
|
2405
|
+
style: {
|
|
2406
|
+
padding: "5px 4px",
|
|
2407
|
+
textAlign: i === 0 || i === 2 ? "left" : "right",
|
|
2408
|
+
fontWeight: 700,
|
|
2409
|
+
fontSize: 7.5,
|
|
2410
|
+
letterSpacing: "0.5px",
|
|
2411
|
+
color: THEME.muted,
|
|
2412
|
+
textTransform: "uppercase",
|
|
2413
|
+
borderBottom: "1px solid ".concat(THEME.panelBorder)
|
|
2414
|
+
},
|
|
2415
|
+
children: h
|
|
2416
|
+
}, h);
|
|
2417
|
+
})
|
|
2418
|
+
})
|
|
2419
|
+
}), /*#__PURE__*/jsxRuntime.jsx("tbody", {
|
|
2420
|
+
children: rows.length === 0 ? /*#__PURE__*/jsxRuntime.jsx("tr", {
|
|
2421
|
+
children: /*#__PURE__*/jsxRuntime.jsx("td", {
|
|
2422
|
+
colSpan: 5,
|
|
2913
2423
|
style: {
|
|
2914
|
-
|
|
2424
|
+
padding: "10px 4px",
|
|
2425
|
+
fontSize: 9,
|
|
2915
2426
|
color: THEME.muted,
|
|
2916
|
-
|
|
2427
|
+
textAlign: "center"
|
|
2917
2428
|
},
|
|
2918
|
-
children:
|
|
2919
|
-
})
|
|
2429
|
+
children: "No active campaigns"
|
|
2430
|
+
})
|
|
2431
|
+
}) : rows.map(function (row, ri) {
|
|
2432
|
+
return /*#__PURE__*/jsxRuntime.jsxs("tr", {
|
|
2433
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("td", {
|
|
2434
|
+
style: {
|
|
2435
|
+
padding: "6px 4px",
|
|
2436
|
+
color: "#374151",
|
|
2437
|
+
fontSize: 8.5,
|
|
2438
|
+
borderBottom: ri < rows.length - 1 ? "1px solid #F3F4F6" : "none",
|
|
2439
|
+
overflow: "hidden",
|
|
2440
|
+
textOverflow: "ellipsis",
|
|
2441
|
+
whiteSpace: "nowrap"
|
|
2442
|
+
},
|
|
2443
|
+
children: row.name
|
|
2444
|
+
}), /*#__PURE__*/jsxRuntime.jsx("td", {
|
|
2445
|
+
style: {
|
|
2446
|
+
padding: "6px 4px",
|
|
2447
|
+
textAlign: "right",
|
|
2448
|
+
fontWeight: 700,
|
|
2449
|
+
color: THEME.text,
|
|
2450
|
+
fontSize: 8.5,
|
|
2451
|
+
borderBottom: ri < rows.length - 1 ? "1px solid #F3F4F6" : "none"
|
|
2452
|
+
},
|
|
2453
|
+
children: row.raised
|
|
2454
|
+
}), /*#__PURE__*/jsxRuntime.jsx("td", {
|
|
2455
|
+
style: {
|
|
2456
|
+
padding: "6px 4px",
|
|
2457
|
+
borderBottom: ri < rows.length - 1 ? "1px solid #F3F4F6" : "none"
|
|
2458
|
+
},
|
|
2459
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ProgressBar, {
|
|
2460
|
+
value: row.progress,
|
|
2461
|
+
color: campaignBarColor(row.status),
|
|
2462
|
+
height: 5
|
|
2463
|
+
})
|
|
2464
|
+
}), /*#__PURE__*/jsxRuntime.jsx("td", {
|
|
2465
|
+
style: {
|
|
2466
|
+
padding: "6px 4px",
|
|
2467
|
+
textAlign: "right",
|
|
2468
|
+
fontWeight: 700,
|
|
2469
|
+
color: THEME.text,
|
|
2470
|
+
fontSize: 8.5,
|
|
2471
|
+
borderBottom: ri < rows.length - 1 ? "1px solid #F3F4F6" : "none"
|
|
2472
|
+
},
|
|
2473
|
+
children: row.donors
|
|
2474
|
+
}), /*#__PURE__*/jsxRuntime.jsx("td", {
|
|
2475
|
+
style: {
|
|
2476
|
+
padding: "6px 4px",
|
|
2477
|
+
textAlign: "right",
|
|
2478
|
+
borderBottom: ri < rows.length - 1 ? "1px solid #F3F4F6" : "none"
|
|
2479
|
+
},
|
|
2480
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StatusPill, {
|
|
2481
|
+
status: row.status
|
|
2482
|
+
})
|
|
2483
|
+
})]
|
|
2484
|
+
}, ri);
|
|
2485
|
+
})
|
|
2486
|
+
})]
|
|
2487
|
+
});
|
|
2488
|
+
};
|
|
2489
|
+
var P2DonorMixCard = function P2DonorMixCard(_ref22) {
|
|
2490
|
+
var newDonors = _ref22.newDonors,
|
|
2491
|
+
returningDonors = _ref22.returningDonors,
|
|
2492
|
+
totalMix = _ref22.totalMix,
|
|
2493
|
+
newPct = _ref22.newPct,
|
|
2494
|
+
retPct = _ref22.retPct,
|
|
2495
|
+
avgGift = _ref22.avgGift,
|
|
2496
|
+
avgGiftTrend = _ref22.avgGiftTrend;
|
|
2497
|
+
return /*#__PURE__*/jsxRuntime.jsx(P2Card, {
|
|
2498
|
+
title: "Donor mix",
|
|
2499
|
+
subtitle: "Acquisition vs retention",
|
|
2500
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2501
|
+
style: {
|
|
2502
|
+
display: "flex",
|
|
2503
|
+
flexDirection: "column",
|
|
2504
|
+
alignItems: "center"
|
|
2505
|
+
},
|
|
2506
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Donut, {
|
|
2507
|
+
segments: [{
|
|
2508
|
+
value: newDonors,
|
|
2509
|
+
color: "#10B981"
|
|
2510
|
+
}, {
|
|
2511
|
+
value: returningDonors,
|
|
2512
|
+
color: THEME.brand
|
|
2513
|
+
}],
|
|
2514
|
+
size: 84,
|
|
2515
|
+
centerVal: formatNumber(totalMix),
|
|
2516
|
+
centerLabel: "donors"
|
|
2920
2517
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2921
2518
|
style: {
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
textAlign: "right",
|
|
2925
|
-
alignSelf: "flex-end"
|
|
2519
|
+
width: "100%",
|
|
2520
|
+
marginTop: 8
|
|
2926
2521
|
},
|
|
2927
|
-
children: [
|
|
2522
|
+
children: [[{
|
|
2523
|
+
label: "New donors",
|
|
2524
|
+
color: "#10B981",
|
|
2525
|
+
count: newDonors,
|
|
2526
|
+
pct: newPct
|
|
2527
|
+
}, {
|
|
2528
|
+
label: "Returning",
|
|
2529
|
+
color: THEME.brand,
|
|
2530
|
+
count: returningDonors,
|
|
2531
|
+
pct: retPct
|
|
2532
|
+
}].map(function (item, i) {
|
|
2533
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2534
|
+
style: {
|
|
2535
|
+
display: "flex",
|
|
2536
|
+
justifyContent: "space-between",
|
|
2537
|
+
alignItems: "center",
|
|
2538
|
+
marginBottom: i === 0 ? 6 : 10
|
|
2539
|
+
},
|
|
2540
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2541
|
+
style: {
|
|
2542
|
+
display: "flex",
|
|
2543
|
+
alignItems: "center",
|
|
2544
|
+
gap: 5
|
|
2545
|
+
},
|
|
2546
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2547
|
+
style: {
|
|
2548
|
+
width: 7,
|
|
2549
|
+
height: 7,
|
|
2550
|
+
borderRadius: "50%",
|
|
2551
|
+
background: item.color,
|
|
2552
|
+
flexShrink: 0
|
|
2553
|
+
}
|
|
2554
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2555
|
+
style: {
|
|
2556
|
+
fontSize: 9,
|
|
2557
|
+
color: "#6B7280"
|
|
2558
|
+
},
|
|
2559
|
+
children: item.label
|
|
2560
|
+
})]
|
|
2561
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
2562
|
+
style: {
|
|
2563
|
+
fontSize: 9,
|
|
2564
|
+
fontWeight: 700,
|
|
2565
|
+
color: THEME.text
|
|
2566
|
+
},
|
|
2567
|
+
children: [formatNumber(item.count), BULLET, item.pct, "%"]
|
|
2568
|
+
})]
|
|
2569
|
+
}, item.label);
|
|
2570
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Divider, {
|
|
2571
|
+
mb: 8
|
|
2572
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2573
|
+
style: {
|
|
2574
|
+
fontSize: 9,
|
|
2575
|
+
color: THEME.muted,
|
|
2576
|
+
marginBottom: 3
|
|
2577
|
+
},
|
|
2578
|
+
children: "Avg gift"
|
|
2579
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2580
|
+
style: {
|
|
2581
|
+
fontSize: 16,
|
|
2582
|
+
fontWeight: 700,
|
|
2583
|
+
color: THEME.text,
|
|
2584
|
+
marginBottom: 6
|
|
2585
|
+
},
|
|
2586
|
+
children: d$(avgGift)
|
|
2587
|
+
}), /*#__PURE__*/jsxRuntime.jsx(TrendPill$1, {
|
|
2588
|
+
positive: isTrendPositive(avgGiftTrend),
|
|
2589
|
+
children: avgGiftTrend
|
|
2590
|
+
})]
|
|
2928
2591
|
})]
|
|
2929
|
-
})
|
|
2592
|
+
})
|
|
2593
|
+
});
|
|
2594
|
+
};
|
|
2595
|
+
var StackedDonationTypeBarSvg = function StackedDonationTypeBarSvg(_ref23) {
|
|
2596
|
+
var _ref23$categories = _ref23.categories,
|
|
2597
|
+
categories = _ref23$categories === void 0 ? [] : _ref23$categories,
|
|
2598
|
+
_ref23$recurring = _ref23.recurring,
|
|
2599
|
+
recurring = _ref23$recurring === void 0 ? [] : _ref23$recurring,
|
|
2600
|
+
_ref23$oneTime = _ref23.oneTime,
|
|
2601
|
+
oneTime = _ref23$oneTime === void 0 ? [] : _ref23$oneTime,
|
|
2602
|
+
_ref23$recurringColor = _ref23.recurringColor,
|
|
2603
|
+
recurringColor = _ref23$recurringColor === void 0 ? "#10B981" : _ref23$recurringColor,
|
|
2604
|
+
_ref23$oneTimeColor = _ref23.oneTimeColor,
|
|
2605
|
+
oneTimeColor = _ref23$oneTimeColor === void 0 ? "#6366F1" : _ref23$oneTimeColor;
|
|
2606
|
+
var width = 158;
|
|
2607
|
+
var height = 88;
|
|
2608
|
+
var padL = 22;
|
|
2609
|
+
var padR = 4;
|
|
2610
|
+
var padT = 8;
|
|
2611
|
+
var padB = 18;
|
|
2612
|
+
var chartW = width - padL - padR;
|
|
2613
|
+
var chartH = height - padT - padB;
|
|
2614
|
+
var totals = categories.map(function (_, i) {
|
|
2615
|
+
return (recurring[i] || 0) + (oneTime[i] || 0);
|
|
2616
|
+
});
|
|
2617
|
+
var maxVal = Math.max.apply(Math, _toConsumableArray(totals).concat([0])) || 1;
|
|
2618
|
+
var n = categories.length;
|
|
2619
|
+
var groupW = n > 0 ? chartW / n : chartW;
|
|
2620
|
+
var barW = Math.min(groupW * 0.42, 18);
|
|
2621
|
+
var baseY = padT + chartH;
|
|
2622
|
+
if (!n) {
|
|
2623
|
+
return /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
2624
|
+
width: "100%",
|
|
2625
|
+
height: height,
|
|
2626
|
+
viewBox: "0 0 ".concat(width, " ").concat(height),
|
|
2627
|
+
style: {
|
|
2628
|
+
display: "block"
|
|
2629
|
+
},
|
|
2630
|
+
children: /*#__PURE__*/jsxRuntime.jsx("line", {
|
|
2631
|
+
x1: padL,
|
|
2632
|
+
y1: baseY,
|
|
2633
|
+
x2: width - padR,
|
|
2634
|
+
y2: baseY,
|
|
2635
|
+
stroke: "#F3F4F6"
|
|
2636
|
+
})
|
|
2637
|
+
});
|
|
2638
|
+
}
|
|
2639
|
+
return /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
2640
|
+
width: "100%",
|
|
2641
|
+
height: height,
|
|
2642
|
+
viewBox: "0 0 ".concat(width, " ").concat(height),
|
|
2643
|
+
style: {
|
|
2644
|
+
display: "block"
|
|
2645
|
+
},
|
|
2646
|
+
children: categories.map(function (cat, i) {
|
|
2647
|
+
var groupX = padL + i * groupW + groupW / 2;
|
|
2648
|
+
var rVal = recurring[i] || 0;
|
|
2649
|
+
var oVal = oneTime[i] || 0;
|
|
2650
|
+
var total = rVal + oVal || 1;
|
|
2651
|
+
var oH = oVal / maxVal * chartH;
|
|
2652
|
+
var rH = rVal / maxVal * chartH;
|
|
2653
|
+
var x = groupX - barW / 2;
|
|
2654
|
+
return /*#__PURE__*/jsxRuntime.jsxs("g", {
|
|
2655
|
+
children: [oVal > 0 && /*#__PURE__*/jsxRuntime.jsx("rect", {
|
|
2656
|
+
x: x,
|
|
2657
|
+
y: baseY - oH,
|
|
2658
|
+
width: barW,
|
|
2659
|
+
height: Math.max(oH, total > 0 ? 1 : 0),
|
|
2660
|
+
fill: oneTimeColor,
|
|
2661
|
+
rx: 2
|
|
2662
|
+
}), rVal > 0 && /*#__PURE__*/jsxRuntime.jsx("rect", {
|
|
2663
|
+
x: x,
|
|
2664
|
+
y: baseY - oH - rH,
|
|
2665
|
+
width: barW,
|
|
2666
|
+
height: Math.max(rH, total > 0 ? 1 : 0),
|
|
2667
|
+
fill: recurringColor,
|
|
2668
|
+
rx: 2
|
|
2669
|
+
}), /*#__PURE__*/jsxRuntime.jsx("text", {
|
|
2670
|
+
x: groupX,
|
|
2671
|
+
y: height - 4,
|
|
2672
|
+
textAnchor: "middle",
|
|
2673
|
+
fontSize: 6.5,
|
|
2674
|
+
fill: THEME.muted,
|
|
2675
|
+
children: formatDonationTypeCategory(cat, groupW)
|
|
2676
|
+
})]
|
|
2677
|
+
}, "stack-".concat(i));
|
|
2678
|
+
})
|
|
2679
|
+
});
|
|
2680
|
+
};
|
|
2681
|
+
var P2DonationTypeCard = function P2DonationTypeCard(_ref24) {
|
|
2682
|
+
var donationTypeData = _ref24.donationTypeData;
|
|
2683
|
+
var _parseDonationTypeCha2 = parseDonationTypeChartData(donationTypeData),
|
|
2684
|
+
categories = _parseDonationTypeCha2.categories,
|
|
2685
|
+
recurring = _parseDonationTypeCha2.recurring,
|
|
2686
|
+
oneTime = _parseDonationTypeCha2.oneTime,
|
|
2687
|
+
recurringTotal = _parseDonationTypeCha2.recurringTotal,
|
|
2688
|
+
oneTimeTotal = _parseDonationTypeCha2.oneTimeTotal;
|
|
2689
|
+
return /*#__PURE__*/jsxRuntime.jsxs(P2Card, {
|
|
2690
|
+
title: "Recurring vs one-time",
|
|
2691
|
+
subtitle: "Donation type".concat(BULLET, "weekly"),
|
|
2692
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2693
|
+
style: {
|
|
2694
|
+
display: "flex",
|
|
2695
|
+
flexDirection: "column",
|
|
2696
|
+
gap: 4,
|
|
2697
|
+
marginBottom: 6
|
|
2698
|
+
},
|
|
2699
|
+
children: [{
|
|
2700
|
+
label: "Recurring",
|
|
2701
|
+
total: recurringTotal,
|
|
2702
|
+
color: "#10B981"
|
|
2703
|
+
}, {
|
|
2704
|
+
label: "One-time",
|
|
2705
|
+
total: oneTimeTotal,
|
|
2706
|
+
color: THEME.brand
|
|
2707
|
+
}].map(function (item) {
|
|
2708
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2709
|
+
style: {
|
|
2710
|
+
display: "flex",
|
|
2711
|
+
alignItems: "center",
|
|
2712
|
+
gap: 5
|
|
2713
|
+
},
|
|
2714
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2715
|
+
style: {
|
|
2716
|
+
width: 6,
|
|
2717
|
+
height: 6,
|
|
2718
|
+
borderRadius: "50%",
|
|
2719
|
+
background: item.color,
|
|
2720
|
+
flexShrink: 0
|
|
2721
|
+
}
|
|
2722
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2723
|
+
style: {
|
|
2724
|
+
fontSize: 9,
|
|
2725
|
+
color: "#6B7280"
|
|
2726
|
+
},
|
|
2727
|
+
children: item.label
|
|
2728
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2729
|
+
style: {
|
|
2730
|
+
fontSize: 9,
|
|
2731
|
+
fontWeight: 700,
|
|
2732
|
+
color: THEME.text
|
|
2733
|
+
},
|
|
2734
|
+
children: d$(item.total)
|
|
2735
|
+
})]
|
|
2736
|
+
}, item.label);
|
|
2737
|
+
})
|
|
2738
|
+
}), /*#__PURE__*/jsxRuntime.jsx(StackedDonationTypeBarSvg, {
|
|
2739
|
+
categories: categories,
|
|
2740
|
+
recurring: recurring,
|
|
2741
|
+
oneTime: oneTime
|
|
2742
|
+
})]
|
|
2743
|
+
});
|
|
2744
|
+
};
|
|
2745
|
+
var P2DonorGeographyCard = function P2DonorGeographyCard(_ref25) {
|
|
2746
|
+
var _ref25$geoList = _ref25.geoList,
|
|
2747
|
+
geoList = _ref25$geoList === void 0 ? [] : _ref25$geoList,
|
|
2748
|
+
_ref25$totalDonors = _ref25.totalDonors,
|
|
2749
|
+
totalDonors = _ref25$totalDonors === void 0 ? 0 : _ref25$totalDonors;
|
|
2750
|
+
return /*#__PURE__*/jsxRuntime.jsxs(P2Card, {
|
|
2751
|
+
title: "Donor geography",
|
|
2752
|
+
subtitle: "Top countries".concat(BULLET).concat(formatNumber(totalDonors), " total"),
|
|
2753
|
+
children: [(geoList.length ? geoList.slice(0, 6) : []).map(function (g, i) {
|
|
2754
|
+
var _g$percentage2;
|
|
2755
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2756
|
+
style: {
|
|
2757
|
+
marginBottom: i < 5 ? 7 : 0
|
|
2758
|
+
},
|
|
2759
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2760
|
+
style: {
|
|
2761
|
+
display: "flex",
|
|
2762
|
+
justifyContent: "space-between",
|
|
2763
|
+
alignItems: "center",
|
|
2764
|
+
gap: 6,
|
|
2765
|
+
marginBottom: 3
|
|
2766
|
+
},
|
|
2767
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2768
|
+
style: {
|
|
2769
|
+
fontSize: 8.5,
|
|
2770
|
+
color: "#374151",
|
|
2771
|
+
overflow: "hidden",
|
|
2772
|
+
textOverflow: "ellipsis",
|
|
2773
|
+
whiteSpace: "nowrap",
|
|
2774
|
+
minWidth: 0
|
|
2775
|
+
},
|
|
2776
|
+
children: g.country
|
|
2777
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
2778
|
+
style: {
|
|
2779
|
+
fontSize: 8.5,
|
|
2780
|
+
fontWeight: 700,
|
|
2781
|
+
color: THEME.text,
|
|
2782
|
+
flexShrink: 0
|
|
2783
|
+
},
|
|
2784
|
+
children: [formatNumber(g.value), BULLET, formatNumber(g.percentage), "%"]
|
|
2785
|
+
})]
|
|
2786
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2787
|
+
style: {
|
|
2788
|
+
height: 4,
|
|
2789
|
+
background: "#F3F4F6",
|
|
2790
|
+
borderRadius: 3,
|
|
2791
|
+
overflow: "hidden"
|
|
2792
|
+
},
|
|
2793
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2794
|
+
style: {
|
|
2795
|
+
width: "".concat(Math.min(100, Math.max(0, Number((_g$percentage2 = g.percentage) !== null && _g$percentage2 !== void 0 ? _g$percentage2 : 0))), "%"),
|
|
2796
|
+
height: "100%",
|
|
2797
|
+
background: THEME.brand,
|
|
2798
|
+
borderRadius: 3
|
|
2799
|
+
}
|
|
2800
|
+
})
|
|
2801
|
+
})]
|
|
2802
|
+
}, i);
|
|
2803
|
+
}), !geoList.length && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2804
|
+
style: {
|
|
2805
|
+
fontSize: 9,
|
|
2806
|
+
color: THEME.muted,
|
|
2807
|
+
textAlign: "center",
|
|
2808
|
+
padding: "8px 0"
|
|
2809
|
+
},
|
|
2810
|
+
children: "No geography data"
|
|
2811
|
+
})]
|
|
2812
|
+
});
|
|
2813
|
+
};
|
|
2814
|
+
var SparklineWithLabels = function SparklineWithLabels(_ref26) {
|
|
2815
|
+
var _ref26$data = _ref26.data,
|
|
2816
|
+
data = _ref26$data === void 0 ? [] : _ref26$data,
|
|
2817
|
+
_ref26$color = _ref26.color,
|
|
2818
|
+
color = _ref26$color === void 0 ? "#6366F1" : _ref26$color,
|
|
2819
|
+
_ref26$startLabel = _ref26.startLabel,
|
|
2820
|
+
startLabel = _ref26$startLabel === void 0 ? "" : _ref26$startLabel,
|
|
2821
|
+
_ref26$endLabel = _ref26.endLabel,
|
|
2822
|
+
endLabel = _ref26$endLabel === void 0 ? "" : _ref26$endLabel,
|
|
2823
|
+
_ref26$width = _ref26.width,
|
|
2824
|
+
width = _ref26$width === void 0 ? 150 : _ref26$width,
|
|
2825
|
+
_ref26$height = _ref26.height,
|
|
2826
|
+
height = _ref26$height === void 0 ? 42 : _ref26$height;
|
|
2827
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2828
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Sparkline, {
|
|
2829
|
+
data: data,
|
|
2830
|
+
color: color,
|
|
2831
|
+
width: width,
|
|
2832
|
+
height: height
|
|
2833
|
+
}), (startLabel || endLabel) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2834
|
+
style: {
|
|
2835
|
+
display: "flex",
|
|
2836
|
+
justifyContent: "space-between",
|
|
2837
|
+
marginTop: 2,
|
|
2838
|
+
fontSize: 7,
|
|
2839
|
+
color: THEME.muted
|
|
2840
|
+
},
|
|
2841
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2842
|
+
children: startLabel
|
|
2843
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2844
|
+
children: endLabel
|
|
2845
|
+
})]
|
|
2846
|
+
})]
|
|
2847
|
+
});
|
|
2848
|
+
};
|
|
2849
|
+
var getTrafficSourceColor = function getTrafficSourceColor() {
|
|
2850
|
+
var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
2851
|
+
var s = String(source).toLowerCase();
|
|
2852
|
+
if (s.includes("paid")) return THEME.brand;
|
|
2853
|
+
if (s.includes("organic")) return "#10B981";
|
|
2854
|
+
if (s.includes("email")) return "#3B82F6";
|
|
2855
|
+
if (s.includes("direct")) return "#9CA3AF";
|
|
2856
|
+
return "#CBD5E1";
|
|
2857
|
+
};
|
|
2858
|
+
var P2TrafficSourceCard = function P2TrafficSourceCard(_ref27) {
|
|
2859
|
+
var _ref27$items = _ref27.items,
|
|
2860
|
+
items = _ref27$items === void 0 ? [] : _ref27$items,
|
|
2861
|
+
_ref27$total = _ref27.total,
|
|
2862
|
+
total = _ref27$total === void 0 ? 0 : _ref27$total,
|
|
2863
|
+
daysLabel = _ref27.daysLabel;
|
|
2864
|
+
return /*#__PURE__*/jsxRuntime.jsxs(P2Card, {
|
|
2865
|
+
title: "Traffic source",
|
|
2866
|
+
subtitle: "Revenue by channel".concat(BULLET).concat(daysLabel),
|
|
2867
|
+
children: [items.length === 0 ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2868
|
+
style: {
|
|
2869
|
+
fontSize: 9,
|
|
2870
|
+
color: THEME.muted,
|
|
2871
|
+
textAlign: "center",
|
|
2872
|
+
padding: "8px 0"
|
|
2873
|
+
},
|
|
2874
|
+
children: "No traffic data"
|
|
2875
|
+
}) : items.map(function (item, i) {
|
|
2876
|
+
var source = item.source || item.name || "-";
|
|
2877
|
+
var revenue = Number(item.revenue || item.raised || 0);
|
|
2878
|
+
var share = Number(item.share || item.percentage || 0);
|
|
2879
|
+
var color = getTrafficSourceColor(source);
|
|
2880
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2881
|
+
style: {
|
|
2882
|
+
marginBottom: i < items.length - 1 ? 8 : 0
|
|
2883
|
+
},
|
|
2884
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2885
|
+
style: {
|
|
2886
|
+
display: "flex",
|
|
2887
|
+
alignItems: "center",
|
|
2888
|
+
gap: 5,
|
|
2889
|
+
marginBottom: 3
|
|
2890
|
+
},
|
|
2891
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2892
|
+
style: {
|
|
2893
|
+
width: 6,
|
|
2894
|
+
height: 6,
|
|
2895
|
+
borderRadius: "50%",
|
|
2896
|
+
background: color,
|
|
2897
|
+
flexShrink: 0
|
|
2898
|
+
}
|
|
2899
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2900
|
+
style: {
|
|
2901
|
+
fontSize: 8.5,
|
|
2902
|
+
color: "#374151",
|
|
2903
|
+
flex: 1,
|
|
2904
|
+
overflow: "hidden",
|
|
2905
|
+
textOverflow: "ellipsis",
|
|
2906
|
+
whiteSpace: "nowrap"
|
|
2907
|
+
},
|
|
2908
|
+
children: source
|
|
2909
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2910
|
+
style: {
|
|
2911
|
+
fontSize: 8.5,
|
|
2912
|
+
fontWeight: 700,
|
|
2913
|
+
color: THEME.text,
|
|
2914
|
+
flexShrink: 0
|
|
2915
|
+
},
|
|
2916
|
+
children: d$Compact(revenue)
|
|
2917
|
+
})]
|
|
2918
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2919
|
+
style: {
|
|
2920
|
+
display: "flex",
|
|
2921
|
+
alignItems: "center",
|
|
2922
|
+
gap: 6
|
|
2923
|
+
},
|
|
2924
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2925
|
+
style: {
|
|
2926
|
+
flex: 1,
|
|
2927
|
+
height: 4,
|
|
2928
|
+
background: "#F3F4F6",
|
|
2929
|
+
borderRadius: 3,
|
|
2930
|
+
overflow: "hidden"
|
|
2931
|
+
},
|
|
2932
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2933
|
+
style: {
|
|
2934
|
+
width: "".concat(Math.min(100, share), "%"),
|
|
2935
|
+
height: "100%",
|
|
2936
|
+
background: color,
|
|
2937
|
+
borderRadius: 3
|
|
2938
|
+
}
|
|
2939
|
+
})
|
|
2940
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
2941
|
+
style: {
|
|
2942
|
+
fontSize: 8,
|
|
2943
|
+
color: THEME.muted,
|
|
2944
|
+
minWidth: 24,
|
|
2945
|
+
textAlign: "right"
|
|
2946
|
+
},
|
|
2947
|
+
children: [formatNumber(share), "%"]
|
|
2948
|
+
})]
|
|
2949
|
+
})]
|
|
2950
|
+
}, i);
|
|
2951
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Divider, {
|
|
2952
|
+
mt: 8,
|
|
2953
|
+
mb: 0
|
|
2954
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2955
|
+
style: {
|
|
2956
|
+
display: "flex",
|
|
2957
|
+
justifyContent: "space-between",
|
|
2958
|
+
alignItems: "center",
|
|
2959
|
+
marginTop: 8
|
|
2960
|
+
},
|
|
2961
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2962
|
+
style: {
|
|
2963
|
+
fontSize: 9,
|
|
2964
|
+
color: THEME.muted
|
|
2965
|
+
},
|
|
2966
|
+
children: "Total"
|
|
2967
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2968
|
+
style: {
|
|
2969
|
+
fontSize: 10,
|
|
2970
|
+
fontWeight: 700,
|
|
2971
|
+
color: THEME.text
|
|
2972
|
+
},
|
|
2973
|
+
children: d$Compact(total)
|
|
2974
|
+
})]
|
|
2975
|
+
})]
|
|
2976
|
+
});
|
|
2977
|
+
};
|
|
2978
|
+
var P2RefundsCard = function P2RefundsCard(_ref28) {
|
|
2979
|
+
var refundRate = _ref28.refundRate,
|
|
2980
|
+
chargebackRate = _ref28.chargebackRate,
|
|
2981
|
+
refundGrowth = _ref28.refundGrowth,
|
|
2982
|
+
totalRefundedAmount = _ref28.totalRefundedAmount,
|
|
2983
|
+
disputedAmount = _ref28.disputedAmount,
|
|
2984
|
+
lostCases = _ref28.lostCases,
|
|
2985
|
+
_ref28$chartData = _ref28.chartData,
|
|
2986
|
+
chartData = _ref28$chartData === void 0 ? [] : _ref28$chartData,
|
|
2987
|
+
windowLabel = _ref28.windowLabel;
|
|
2988
|
+
var refundChart = chartData.map(function (d) {
|
|
2989
|
+
var _ref29, _ref30, _d$value;
|
|
2990
|
+
return Number((_ref29 = (_ref30 = (_d$value = d === null || d === void 0 ? void 0 : d.value) !== null && _d$value !== void 0 ? _d$value : d === null || d === void 0 ? void 0 : d.amount) !== null && _ref30 !== void 0 ? _ref30 : d) !== null && _ref29 !== void 0 ? _ref29 : 0);
|
|
2991
|
+
});
|
|
2992
|
+
return /*#__PURE__*/jsxRuntime.jsxs(P2Card, {
|
|
2993
|
+
title: "Refunds & chargebacks",
|
|
2994
|
+
subtitle: "Trust health".concat(BULLET).concat(windowLabel),
|
|
2995
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2996
|
+
style: {
|
|
2997
|
+
display: "flex",
|
|
2998
|
+
gap: 16,
|
|
2999
|
+
marginBottom: 8
|
|
3000
|
+
},
|
|
3001
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3002
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3003
|
+
style: {
|
|
3004
|
+
fontSize: 7.5,
|
|
3005
|
+
fontWeight: 700,
|
|
3006
|
+
letterSpacing: "0.5px",
|
|
3007
|
+
color: THEME.muted,
|
|
3008
|
+
textTransform: "uppercase",
|
|
3009
|
+
marginBottom: 3
|
|
3010
|
+
},
|
|
3011
|
+
children: "Refunds"
|
|
3012
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3013
|
+
style: {
|
|
3014
|
+
fontSize: 16,
|
|
3015
|
+
fontWeight: 700,
|
|
3016
|
+
color: THEME.text,
|
|
3017
|
+
lineHeight: 1.1
|
|
3018
|
+
},
|
|
3019
|
+
children: pct(refundRate, 1)
|
|
3020
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3021
|
+
style: {
|
|
3022
|
+
marginTop: 3
|
|
3023
|
+
},
|
|
3024
|
+
children: refundGrowth === 0 ? /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
3025
|
+
style: {
|
|
3026
|
+
fontSize: 8.5,
|
|
3027
|
+
color: THEME.muted
|
|
3028
|
+
},
|
|
3029
|
+
children: "stable"
|
|
3030
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(TrendPill$1, {
|
|
3031
|
+
positive: refundGrowth <= 0,
|
|
3032
|
+
children: formatTrend(refundGrowth, "pp")
|
|
3033
|
+
})
|
|
3034
|
+
})]
|
|
3035
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3036
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3037
|
+
style: {
|
|
3038
|
+
fontSize: 7.5,
|
|
3039
|
+
fontWeight: 700,
|
|
3040
|
+
letterSpacing: "0.5px",
|
|
3041
|
+
color: THEME.muted,
|
|
3042
|
+
textTransform: "uppercase",
|
|
3043
|
+
marginBottom: 3
|
|
3044
|
+
},
|
|
3045
|
+
children: "Chargebacks"
|
|
3046
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3047
|
+
style: {
|
|
3048
|
+
fontSize: 16,
|
|
3049
|
+
fontWeight: 700,
|
|
3050
|
+
color: THEME.text,
|
|
3051
|
+
lineHeight: 1.1
|
|
3052
|
+
},
|
|
3053
|
+
children: pct(chargebackRate, 1)
|
|
3054
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3055
|
+
style: {
|
|
3056
|
+
fontSize: 8.5,
|
|
3057
|
+
color: THEME.muted,
|
|
3058
|
+
marginTop: 3
|
|
3059
|
+
},
|
|
3060
|
+
children: "stable"
|
|
3061
|
+
})]
|
|
3062
|
+
})]
|
|
3063
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3064
|
+
style: {
|
|
3065
|
+
fontSize: 8,
|
|
3066
|
+
color: THEME.muted,
|
|
3067
|
+
lineHeight: 1.45,
|
|
3068
|
+
marginBottom: 8
|
|
3069
|
+
},
|
|
3070
|
+
children: [d$(totalRefundedAmount), " refunded", BULLET, d$(disputedAmount), " disputed", BULLET, formatNumber(lostCases), " ", lostCases === 1 ? "case" : "cases"]
|
|
3071
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Sparkline, {
|
|
3072
|
+
data: refundChart.length ? refundChart : [0, 0],
|
|
3073
|
+
color: "#F97316",
|
|
3074
|
+
width: 150,
|
|
3075
|
+
height: 36
|
|
3076
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3077
|
+
style: {
|
|
3078
|
+
display: "flex",
|
|
3079
|
+
gap: 10,
|
|
3080
|
+
marginTop: 6
|
|
3081
|
+
},
|
|
3082
|
+
children: [{
|
|
3083
|
+
label: "Refunds",
|
|
3084
|
+
color: "#F97316"
|
|
3085
|
+
}, {
|
|
3086
|
+
label: "Chargebacks",
|
|
3087
|
+
color: "#EF4444"
|
|
3088
|
+
}].map(function (leg) {
|
|
3089
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3090
|
+
style: {
|
|
3091
|
+
display: "flex",
|
|
3092
|
+
alignItems: "center",
|
|
3093
|
+
gap: 4
|
|
3094
|
+
},
|
|
3095
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3096
|
+
style: {
|
|
3097
|
+
width: 6,
|
|
3098
|
+
height: 6,
|
|
3099
|
+
borderRadius: "50%",
|
|
3100
|
+
background: leg.color
|
|
3101
|
+
}
|
|
3102
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
3103
|
+
style: {
|
|
3104
|
+
fontSize: 8,
|
|
3105
|
+
color: "#6B7280"
|
|
3106
|
+
},
|
|
3107
|
+
children: leg.label
|
|
3108
|
+
})]
|
|
3109
|
+
}, leg.label);
|
|
3110
|
+
})
|
|
3111
|
+
})]
|
|
3112
|
+
});
|
|
3113
|
+
};
|
|
3114
|
+
var P2RevenueTrendCard = function P2RevenueTrendCard(_ref31) {
|
|
3115
|
+
var title = _ref31.title,
|
|
3116
|
+
subtitle = _ref31.subtitle,
|
|
3117
|
+
value = _ref31.value,
|
|
3118
|
+
trend = _ref31.trend,
|
|
3119
|
+
chartData = _ref31.chartData,
|
|
3120
|
+
chartColor = _ref31.chartColor,
|
|
3121
|
+
startLabel = _ref31.startLabel,
|
|
3122
|
+
endLabel = _ref31.endLabel,
|
|
3123
|
+
_ref31$footerStats = _ref31.footerStats,
|
|
3124
|
+
footerStats = _ref31$footerStats === void 0 ? [] : _ref31$footerStats;
|
|
3125
|
+
return /*#__PURE__*/jsxRuntime.jsxs(P2Card, {
|
|
3126
|
+
title: title,
|
|
3127
|
+
subtitle: subtitle,
|
|
3128
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3129
|
+
style: {
|
|
3130
|
+
fontSize: 17,
|
|
3131
|
+
fontWeight: 700,
|
|
3132
|
+
color: THEME.text,
|
|
3133
|
+
lineHeight: 1.1
|
|
3134
|
+
},
|
|
3135
|
+
children: d$Compact(value)
|
|
3136
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2930
3137
|
style: {
|
|
2931
|
-
marginTop:
|
|
2932
|
-
|
|
2933
|
-
background: "#EEF2FF",
|
|
2934
|
-
border: "1px solid #D7DEFF",
|
|
2935
|
-
borderRadius: 4,
|
|
2936
|
-
padding: "4px 9px",
|
|
2937
|
-
fontSize: 9,
|
|
2938
|
-
lineHeight: 1.35,
|
|
2939
|
-
color: "#374151",
|
|
2940
|
-
maxWidth: "100%"
|
|
3138
|
+
marginTop: 4,
|
|
3139
|
+
marginBottom: 6
|
|
2941
3140
|
},
|
|
2942
|
-
children:
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
3141
|
+
children: /*#__PURE__*/jsxRuntime.jsx(TrendPill$1, {
|
|
3142
|
+
positive: isTrendPositive(trend),
|
|
3143
|
+
children: trend
|
|
3144
|
+
})
|
|
3145
|
+
}), /*#__PURE__*/jsxRuntime.jsx(SparklineWithLabels, {
|
|
3146
|
+
data: chartData,
|
|
3147
|
+
color: chartColor,
|
|
3148
|
+
startLabel: startLabel,
|
|
3149
|
+
endLabel: endLabel,
|
|
3150
|
+
width: 150,
|
|
3151
|
+
height: 40
|
|
3152
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Divider, {
|
|
3153
|
+
mt: 8,
|
|
3154
|
+
mb: 0
|
|
3155
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3156
|
+
style: {
|
|
3157
|
+
display: "flex",
|
|
3158
|
+
gap: 10,
|
|
3159
|
+
marginTop: 8,
|
|
3160
|
+
flexWrap: "wrap"
|
|
3161
|
+
},
|
|
3162
|
+
children: footerStats.map(function (_ref32) {
|
|
3163
|
+
var _ref33 = _slicedToArray(_ref32, 2),
|
|
3164
|
+
label = _ref33[0],
|
|
3165
|
+
val = _ref33[1];
|
|
3166
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3167
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3168
|
+
style: {
|
|
3169
|
+
fontSize: 7.5,
|
|
3170
|
+
color: THEME.muted,
|
|
3171
|
+
marginBottom: 3
|
|
3172
|
+
},
|
|
3173
|
+
children: label
|
|
3174
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3175
|
+
style: {
|
|
3176
|
+
fontSize: 10,
|
|
3177
|
+
fontWeight: 700,
|
|
3178
|
+
color: THEME.text
|
|
3179
|
+
},
|
|
3180
|
+
children: val
|
|
3181
|
+
})]
|
|
3182
|
+
}, label);
|
|
3183
|
+
})
|
|
2955
3184
|
})]
|
|
2956
3185
|
});
|
|
2957
3186
|
};
|
|
2958
|
-
var
|
|
2959
|
-
var
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
marginTop: "auto",
|
|
2968
|
-
flexShrink: 0
|
|
2969
|
-
},
|
|
3187
|
+
var P2AcceptanceCard = function P2AcceptanceCard(_ref34) {
|
|
3188
|
+
var title = _ref34.title,
|
|
3189
|
+
acceptanceRate = _ref34.acceptanceRate,
|
|
3190
|
+
acceptanceGrowth = _ref34.acceptanceGrowth,
|
|
3191
|
+
raised = _ref34.raised,
|
|
3192
|
+
raisedGrowth = _ref34.raisedGrowth;
|
|
3193
|
+
return /*#__PURE__*/jsxRuntime.jsx(P2Card, {
|
|
3194
|
+
title: title,
|
|
3195
|
+
subtitle: "Acceptance & raised",
|
|
2970
3196
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2971
3197
|
style: {
|
|
2972
3198
|
display: "flex",
|
|
2973
|
-
|
|
2974
|
-
alignItems: "center"
|
|
2975
|
-
fontSize: 8,
|
|
2976
|
-
color: THEME.muted
|
|
3199
|
+
flexDirection: "column",
|
|
3200
|
+
alignItems: "center"
|
|
2977
3201
|
},
|
|
2978
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
3202
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Donut, {
|
|
3203
|
+
segments: [{
|
|
3204
|
+
value: acceptanceRate,
|
|
3205
|
+
color: THEME.brand
|
|
3206
|
+
}, {
|
|
3207
|
+
value: Math.max(0, 100 - acceptanceRate),
|
|
3208
|
+
color: "#E5E7EB"
|
|
3209
|
+
}],
|
|
3210
|
+
size: 76,
|
|
3211
|
+
centerVal: "".concat(formatNumber(acceptanceRate), "%"),
|
|
3212
|
+
centerLabel: "accepted"
|
|
3213
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3214
|
+
style: {
|
|
3215
|
+
width: "100%",
|
|
3216
|
+
marginTop: 8
|
|
3217
|
+
},
|
|
3218
|
+
children: [{
|
|
3219
|
+
label: "Acceptance",
|
|
3220
|
+
value: "".concat(formatNumber(acceptanceRate), "%"),
|
|
3221
|
+
trend: formatTrend(acceptanceGrowth)
|
|
3222
|
+
}, {
|
|
3223
|
+
label: "Raised",
|
|
3224
|
+
value: d$Compact(raised),
|
|
3225
|
+
trend: formatTrend(raisedGrowth)
|
|
3226
|
+
}].map(function (row, i) {
|
|
3227
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3228
|
+
style: {
|
|
3229
|
+
display: "flex",
|
|
3230
|
+
justifyContent: "space-between",
|
|
3231
|
+
alignItems: "center",
|
|
3232
|
+
marginBottom: i === 0 ? 6 : 0
|
|
3233
|
+
},
|
|
3234
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3235
|
+
style: {
|
|
3236
|
+
display: "flex",
|
|
3237
|
+
alignItems: "center",
|
|
3238
|
+
gap: 5
|
|
3239
|
+
},
|
|
3240
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3241
|
+
style: {
|
|
3242
|
+
width: 7,
|
|
3243
|
+
height: 7,
|
|
3244
|
+
borderRadius: 2,
|
|
3245
|
+
background: THEME.brand,
|
|
3246
|
+
flexShrink: 0
|
|
3247
|
+
}
|
|
3248
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
3249
|
+
style: {
|
|
3250
|
+
fontSize: 9,
|
|
3251
|
+
color: "#6B7280"
|
|
3252
|
+
},
|
|
3253
|
+
children: row.label
|
|
3254
|
+
})]
|
|
3255
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3256
|
+
style: {
|
|
3257
|
+
display: "flex",
|
|
3258
|
+
alignItems: "center",
|
|
3259
|
+
gap: 5
|
|
3260
|
+
},
|
|
3261
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
3262
|
+
style: {
|
|
3263
|
+
fontSize: 9,
|
|
3264
|
+
fontWeight: 700,
|
|
3265
|
+
color: THEME.text
|
|
3266
|
+
},
|
|
3267
|
+
children: row.value
|
|
3268
|
+
}), /*#__PURE__*/jsxRuntime.jsx(TrendPill$1, {
|
|
3269
|
+
positive: isTrendPositive(row.trend),
|
|
3270
|
+
children: row.trend
|
|
3271
|
+
})]
|
|
3272
|
+
})]
|
|
3273
|
+
}, row.label);
|
|
3274
|
+
})
|
|
2982
3275
|
})]
|
|
2983
3276
|
})
|
|
2984
3277
|
});
|
|
2985
3278
|
};
|
|
2986
3279
|
|
|
2987
3280
|
// ─── Main component ───────────────────────────────────────────────────────────
|
|
2988
|
-
var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (
|
|
2989
|
-
var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _apiData$trafficSourc, _apiData$trafficSourc2,
|
|
2990
|
-
var
|
|
2991
|
-
name =
|
|
2992
|
-
|
|
2993
|
-
apiData =
|
|
2994
|
-
|
|
2995
|
-
dateName =
|
|
2996
|
-
|
|
2997
|
-
numberOfDays =
|
|
2998
|
-
|
|
2999
|
-
activeFilters =
|
|
3281
|
+
var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref35, ref) {
|
|
3282
|
+
var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _apiData$trafficSourc, _apiData$trafficSourc2, _growth$totalRevenue, _metricByTitle$AvgDo, _apiData$trafficSourc3, _metricByTitle$NetRa, _growth$netRevenue, _metricByTitle$Total, _metricByTitle$Total2, _growth$totalDonation, _metricByTitle$Total3, _metricByTitle$AvgDo2, _growth$overallAVGDon, _apiData$roasCard, _metricByTitle$ROAS, _apiData$roasCardPrev, _metricByTitle$ROAS2, _apiData$adSpend, _apiData$attributedRe, _metricByTitle$Conver, _growth$conversionRat, _metricByTitle$Conver2, _metricByTitle$Refund, _refunds$growthPercen, _metricByTitle$Refund2, _mainChart$stacked, _ob$totalRevenue, _ob$growthPercentage, _ob$averagePerDay, _ob$peakDay$amount, _ob$peakDay, _ob$totalOrders, _up$acceptanceRate, _up$acceptanceGrowth, _up$raised, _up$raisedGrowth, _dn$acceptanceRate, _dn$acceptanceGrowth, _dn$raised, _dn$raisedGrowth, _refCard$totalRevenue, _refCard$growthPercen, _refCard$totalReferre, _refCard$averageGift, _refCard$conversionRa;
|
|
3283
|
+
var _ref35$name = _ref35.name,
|
|
3284
|
+
name = _ref35$name === void 0 ? "" : _ref35$name,
|
|
3285
|
+
_ref35$apiData = _ref35.apiData,
|
|
3286
|
+
apiData = _ref35$apiData === void 0 ? {} : _ref35$apiData,
|
|
3287
|
+
_ref35$dateName = _ref35.dateName,
|
|
3288
|
+
dateName = _ref35$dateName === void 0 ? "Last Period" : _ref35$dateName,
|
|
3289
|
+
_ref35$numberOfDays = _ref35.numberOfDays,
|
|
3290
|
+
numberOfDays = _ref35$numberOfDays === void 0 ? 30 : _ref35$numberOfDays,
|
|
3291
|
+
_ref35$activeFilters = _ref35.activeFilters,
|
|
3292
|
+
activeFilters = _ref35$activeFilters === void 0 ? [] : _ref35$activeFilters;
|
|
3000
3293
|
var now = new Date();
|
|
3001
3294
|
var daysLabel = "".concat(numberOfDays, " day").concat(numberOfDays === 1 ? "" : "s");
|
|
3002
3295
|
var windowLabel = "".concat(numberOfDays, "-day window");
|
|
@@ -3013,42 +3306,6 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
|
|
|
3013
3306
|
hour12: false
|
|
3014
3307
|
}, gmtOptions)) + " GMT";
|
|
3015
3308
|
var dateLabel = dateName;
|
|
3016
|
-
var _normalizeFiltersText = function normalizeFiltersText(filtersInput) {
|
|
3017
|
-
if (typeof filtersInput === "string") {
|
|
3018
|
-
var str = filtersInput.trim();
|
|
3019
|
-
if (!str) return "";
|
|
3020
|
-
if (str.startsWith("[") || str.startsWith("{")) {
|
|
3021
|
-
try {
|
|
3022
|
-
return _normalizeFiltersText(JSON.parse(str));
|
|
3023
|
-
} catch (_) {
|
|
3024
|
-
// Keep raw text if not valid JSON.
|
|
3025
|
-
}
|
|
3026
|
-
}
|
|
3027
|
-
return str;
|
|
3028
|
-
}
|
|
3029
|
-
if (Array.isArray(filtersInput)) {
|
|
3030
|
-
var fromObjects = filtersInput.filter(function (item) {
|
|
3031
|
-
return item && _typeof(item) === "object" && item.value !== undefined && item.value !== null && "".concat(item.value).trim();
|
|
3032
|
-
}).map(function (item) {
|
|
3033
|
-
return "".concat(item.label || item.id || "Filter", ": ").concat(item.value);
|
|
3034
|
-
}).join(" | ").trim();
|
|
3035
|
-
if (fromObjects) return fromObjects;
|
|
3036
|
-
var fromStrings = filtersInput.map(function (item) {
|
|
3037
|
-
return typeof item === "string" ? item.trim() : "";
|
|
3038
|
-
}).filter(Boolean).join(" | ").trim();
|
|
3039
|
-
if (fromStrings) return fromStrings;
|
|
3040
|
-
}
|
|
3041
|
-
if (filtersInput && _typeof(filtersInput) === "object") {
|
|
3042
|
-
if (Array.isArray(filtersInput.activeFilters) || typeof filtersInput.activeFilters === "string") {
|
|
3043
|
-
return _normalizeFiltersText(filtersInput.activeFilters);
|
|
3044
|
-
}
|
|
3045
|
-
if (filtersInput.value !== undefined && filtersInput.value !== null && "".concat(filtersInput.value).trim()) {
|
|
3046
|
-
return "".concat(filtersInput.label || filtersInput.id || "Filter", ": ").concat(filtersInput.value).trim();
|
|
3047
|
-
}
|
|
3048
|
-
}
|
|
3049
|
-
return "";
|
|
3050
|
-
};
|
|
3051
|
-
var formattedActiveFilters = _normalizeFiltersText(activeFilters);
|
|
3052
3309
|
var parseFilterPills = function parseFilterPills(filtersInput) {
|
|
3053
3310
|
if (Array.isArray(filtersInput)) {
|
|
3054
3311
|
var fromObjects = filtersInput.filter(function (item) {
|
|
@@ -3095,9 +3352,9 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
|
|
|
3095
3352
|
chargebackRate = refunds.chargebackRate,
|
|
3096
3353
|
growthPercentage = refunds.growthPercentage,
|
|
3097
3354
|
totalRefundedAmount = refunds.totalRefundedAmount,
|
|
3098
|
-
totalRefunds = refunds.totalRefunds
|
|
3099
|
-
|
|
3100
|
-
lostChargebacks = refunds.lostChargebacks;
|
|
3355
|
+
totalRefunds = refunds.totalRefunds;
|
|
3356
|
+
refunds.totalChargebacks;
|
|
3357
|
+
var lostChargebacks = refunds.lostChargebacks;
|
|
3101
3358
|
var newDonors = donorMix.newDonors,
|
|
3102
3359
|
returningDonors = donorMix.returningDonors,
|
|
3103
3360
|
totalMix = donorMix.totalMix,
|
|
@@ -3106,8 +3363,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
|
|
|
3106
3363
|
mixAvgGift = donorMix.avgGift,
|
|
3107
3364
|
donorMixPrev = donorMix.donorMixPrev;
|
|
3108
3365
|
var geoList = report.donorGeographyList;
|
|
3109
|
-
var
|
|
3110
|
-
var trafficTotal = Number((_apiData$trafficSourc2 = apiData === null || apiData === void 0 || (_apiData$trafficSourc3 = apiData.trafficSourceData) === null || _apiData$trafficSourc3 === void 0 ? void 0 : _apiData$trafficSourc3.totalRevenue) !== null && _apiData$trafficSourc2 !== void 0 ? _apiData$trafficSourc2 : 0);
|
|
3366
|
+
var trafficTotal = Number((_apiData$trafficSourc = apiData === null || apiData === void 0 || (_apiData$trafficSourc2 = apiData.trafficSourceData) === null || _apiData$trafficSourc2 === void 0 ? void 0 : _apiData$trafficSourc2.totalRevenue) !== null && _apiData$trafficSourc !== void 0 ? _apiData$trafficSourc : 0);
|
|
3111
3367
|
var revSeries = mainChart.series || [{
|
|
3112
3368
|
name: "Paid Ads",
|
|
3113
3369
|
data: []
|
|
@@ -3157,12 +3413,30 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
|
|
|
3157
3413
|
return String(trend !== null && trend !== void 0 ? trend : "").replace(/x$/, "×");
|
|
3158
3414
|
};
|
|
3159
3415
|
var avgDonationDetailText = formatMetricDetail(((_metricByTitle$AvgDo = metricByTitle["Avg Donation"]) === null || _metricByTitle$AvgDo === void 0 ? void 0 : _metricByTitle$AvgDo.detail) || avgDonationDetail.detail);
|
|
3160
|
-
var
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3416
|
+
var campaignRows = activeCampaigns.map(function (c) {
|
|
3417
|
+
return {
|
|
3418
|
+
name: c.name,
|
|
3419
|
+
raised: c.val1,
|
|
3420
|
+
progress: c.progress,
|
|
3421
|
+
donors: c.val3,
|
|
3422
|
+
status: c.status
|
|
3423
|
+
};
|
|
3424
|
+
});
|
|
3425
|
+
var donorMixTrend = "".concat(formatTrend(donorMixPrev !== null && donorMixPrev !== void 0 ? donorMixPrev : 0), " vs last month");
|
|
3426
|
+
var trafficList = Array.isArray(apiData === null || apiData === void 0 || (_apiData$trafficSourc3 = apiData.trafficSourceData) === null || _apiData$trafficSourc3 === void 0 ? void 0 : _apiData$trafficSourc3.data) ? apiData.trafficSourceData.data : Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.trafficSourceData) ? apiData.trafficSourceData : [];
|
|
3427
|
+
var chartLabelAt = function chartLabelAt(chart, index) {
|
|
3428
|
+
var item = chart === null || chart === void 0 ? void 0 : chart[index];
|
|
3429
|
+
if (!item) return "";
|
|
3430
|
+
return item.date || item.label || item.category || "";
|
|
3165
3431
|
};
|
|
3432
|
+
var obChart = (ob === null || ob === void 0 ? void 0 : ob.chart) || [];
|
|
3433
|
+
var refChart = (refCard === null || refCard === void 0 ? void 0 : refCard.chartData) || [];
|
|
3434
|
+
var chartStartLabel = chartLabelAt(obChart, 0) || revCats[0] || "";
|
|
3435
|
+
var chartEndLabel = chartLabelAt(obChart, obChart.length - 1) || revCats[revCats.length - 1] || "";
|
|
3436
|
+
var refStartLabel = chartLabelAt(refChart, 0) || revCats[0] || "";
|
|
3437
|
+
var refEndLabel = chartLabelAt(refChart, refChart.length - 1) || revCats[revCats.length - 1] || "";
|
|
3438
|
+
var disputedAmount = refunds.disputedAmount;
|
|
3439
|
+
var refundChartData = refunds.chartData || [];
|
|
3166
3440
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3167
3441
|
ref: ref,
|
|
3168
3442
|
style: {
|
|
@@ -3369,419 +3643,118 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
|
|
|
3369
3643
|
background: THEME.pageBg,
|
|
3370
3644
|
display: "flex",
|
|
3371
3645
|
flexDirection: "column",
|
|
3372
|
-
fontFamily: "'Helvetica Neue', Helvetica, Arial, sans-serif",
|
|
3646
|
+
fontFamily: "'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif",
|
|
3373
3647
|
boxSizing: "border-box"
|
|
3374
3648
|
},
|
|
3375
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
3376
|
-
|
|
3377
|
-
|
|
3649
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(PageOneHeader, {
|
|
3650
|
+
dateLabel: dateLabel,
|
|
3651
|
+
generatedLabel: generatedLabel,
|
|
3652
|
+
windowLabel: windowLabel
|
|
3653
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3378
3654
|
style: {
|
|
3379
3655
|
flex: 1,
|
|
3380
|
-
padding: "
|
|
3656
|
+
padding: "14px ".concat(MX, "px 0"),
|
|
3381
3657
|
display: "flex",
|
|
3382
3658
|
flexDirection: "column",
|
|
3383
|
-
gap:
|
|
3659
|
+
gap: 10
|
|
3384
3660
|
},
|
|
3385
3661
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3386
3662
|
style: {
|
|
3387
3663
|
display: "grid",
|
|
3388
|
-
gridTemplateColumns: "2.
|
|
3389
|
-
gap:
|
|
3664
|
+
gridTemplateColumns: "2.15fr 1fr",
|
|
3665
|
+
gap: 10
|
|
3390
3666
|
},
|
|
3391
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
3667
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(P2Card, {
|
|
3392
3668
|
title: "Active campaigns",
|
|
3393
3669
|
subtitle: "Live fundraisers ranked by velocity",
|
|
3394
|
-
|
|
3395
|
-
head: ["Campaign", "Raised", "Progress", "Donors", "Avg Gift"],
|
|
3396
|
-
colAlign: ["left", "right", "left", "right", "right"],
|
|
3397
|
-
rows: activeCampaigns.map(function (c, i) {
|
|
3398
|
-
return [c.name, c.val1, /*#__PURE__*/jsxRuntime.jsx(ProgressBar, {
|
|
3399
|
-
value: c.progress
|
|
3400
|
-
}, "campaign-progress-".concat(i)), c.val3, c.val4];
|
|
3401
|
-
})
|
|
3402
|
-
})
|
|
3403
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Panel, {
|
|
3404
|
-
title: "Donor mix",
|
|
3405
|
-
subtitle: "Acquisition vs retention",
|
|
3406
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3670
|
+
action: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
3407
3671
|
style: {
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3672
|
+
fontSize: 9,
|
|
3673
|
+
color: THEME.brand,
|
|
3674
|
+
fontWeight: 500
|
|
3411
3675
|
},
|
|
3412
|
-
children:
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
}, {
|
|
3417
|
-
value: returningDonors,
|
|
3418
|
-
color: C.emerald
|
|
3419
|
-
}],
|
|
3420
|
-
size: 88,
|
|
3421
|
-
centerVal: "".concat(formatNumber(totalMix)),
|
|
3422
|
-
centerLabel: "donors"
|
|
3423
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3424
|
-
style: {
|
|
3425
|
-
width: "100%",
|
|
3426
|
-
marginTop: 6
|
|
3427
|
-
},
|
|
3428
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3429
|
-
style: {
|
|
3430
|
-
display: "flex",
|
|
3431
|
-
justifyContent: "space-between",
|
|
3432
|
-
alignItems: "center",
|
|
3433
|
-
marginBottom: 5
|
|
3434
|
-
},
|
|
3435
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3436
|
-
style: {
|
|
3437
|
-
display: "flex",
|
|
3438
|
-
alignItems: "center",
|
|
3439
|
-
gap: 5
|
|
3440
|
-
},
|
|
3441
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3442
|
-
style: {
|
|
3443
|
-
width: 8,
|
|
3444
|
-
height: 8,
|
|
3445
|
-
borderRadius: 2,
|
|
3446
|
-
background: C.indigo,
|
|
3447
|
-
flexShrink: 0
|
|
3448
|
-
}
|
|
3449
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
3450
|
-
style: {
|
|
3451
|
-
fontSize: 9.5,
|
|
3452
|
-
color: "#6B7280"
|
|
3453
|
-
},
|
|
3454
|
-
children: "New donors"
|
|
3455
|
-
})]
|
|
3456
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
3457
|
-
style: {
|
|
3458
|
-
fontSize: 9.5,
|
|
3459
|
-
fontWeight: 700,
|
|
3460
|
-
color: "#111827"
|
|
3461
|
-
},
|
|
3462
|
-
children: [formatNumber(newDonors), " - ", newPct, "%"]
|
|
3463
|
-
})]
|
|
3464
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3465
|
-
style: {
|
|
3466
|
-
display: "flex",
|
|
3467
|
-
justifyContent: "space-between",
|
|
3468
|
-
alignItems: "center",
|
|
3469
|
-
marginBottom: 8
|
|
3470
|
-
},
|
|
3471
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3472
|
-
style: {
|
|
3473
|
-
display: "flex",
|
|
3474
|
-
alignItems: "center",
|
|
3475
|
-
gap: 5
|
|
3476
|
-
},
|
|
3477
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3478
|
-
style: {
|
|
3479
|
-
width: 8,
|
|
3480
|
-
height: 8,
|
|
3481
|
-
borderRadius: 2,
|
|
3482
|
-
background: C.emerald,
|
|
3483
|
-
flexShrink: 0
|
|
3484
|
-
}
|
|
3485
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
3486
|
-
style: {
|
|
3487
|
-
fontSize: 9.5,
|
|
3488
|
-
color: "#6B7280"
|
|
3489
|
-
},
|
|
3490
|
-
children: "Returning"
|
|
3491
|
-
})]
|
|
3492
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
3493
|
-
style: {
|
|
3494
|
-
fontSize: 9.5,
|
|
3495
|
-
fontWeight: 700,
|
|
3496
|
-
color: "#111827"
|
|
3497
|
-
},
|
|
3498
|
-
children: [formatNumber(returningDonors), " - ", retPct, "%"]
|
|
3499
|
-
})]
|
|
3500
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Divider, {
|
|
3501
|
-
mb: 6
|
|
3502
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3503
|
-
style: {
|
|
3504
|
-
fontSize: 9.5,
|
|
3505
|
-
color: "#9CA3AF",
|
|
3506
|
-
marginBottom: 2
|
|
3507
|
-
},
|
|
3508
|
-
children: "Avg gift"
|
|
3509
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3510
|
-
style: {
|
|
3511
|
-
fontSize: 14,
|
|
3512
|
-
fontWeight: 800,
|
|
3513
|
-
color: "#111827",
|
|
3514
|
-
marginBottom: 2
|
|
3515
|
-
},
|
|
3516
|
-
children: d$(mixAvgGift)
|
|
3517
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3518
|
-
style: {
|
|
3519
|
-
fontSize: 9
|
|
3520
|
-
},
|
|
3521
|
-
children: /*#__PURE__*/jsxRuntime.jsx(TrendText, {
|
|
3522
|
-
style: {
|
|
3523
|
-
fontSize: 9
|
|
3524
|
-
},
|
|
3525
|
-
children: formatArrowTrend(donorMixPrev, {
|
|
3526
|
-
label: "vs last month"
|
|
3527
|
-
})
|
|
3528
|
-
})
|
|
3529
|
-
})]
|
|
3530
|
-
})]
|
|
3676
|
+
children: "View all"
|
|
3677
|
+
}),
|
|
3678
|
+
children: /*#__PURE__*/jsxRuntime.jsx(P2CampaignTable, {
|
|
3679
|
+
rows: campaignRows
|
|
3531
3680
|
})
|
|
3681
|
+
}), /*#__PURE__*/jsxRuntime.jsx(P2DonorMixCard, {
|
|
3682
|
+
newDonors: newDonors,
|
|
3683
|
+
returningDonors: returningDonors,
|
|
3684
|
+
totalMix: totalMix,
|
|
3685
|
+
newPct: newPct,
|
|
3686
|
+
retPct: retPct,
|
|
3687
|
+
avgGift: mixAvgGift,
|
|
3688
|
+
avgGiftTrend: donorMixTrend
|
|
3532
3689
|
})]
|
|
3533
3690
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3534
3691
|
style: {
|
|
3535
3692
|
display: "grid",
|
|
3536
3693
|
gridTemplateColumns: "repeat(4, 1fr)",
|
|
3537
|
-
gap:
|
|
3694
|
+
gap: 10
|
|
3538
3695
|
},
|
|
3539
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
3540
|
-
donationTypeData: report.donationTypeData
|
|
3541
|
-
|
|
3542
|
-
oneTimeColor: C.emerald
|
|
3543
|
-
}), /*#__PURE__*/jsxRuntime.jsx(DonorGeographyPanel, {
|
|
3696
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(P2DonationTypeCard, {
|
|
3697
|
+
donationTypeData: report.donationTypeData
|
|
3698
|
+
}), /*#__PURE__*/jsxRuntime.jsx(P2DonorGeographyCard, {
|
|
3544
3699
|
geoList: geoList,
|
|
3545
|
-
totalDonors: totalDonors
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
fontSize: 8,
|
|
3560
|
-
fontWeight: 700,
|
|
3561
|
-
letterSpacing: "0.5px",
|
|
3562
|
-
color: "#6B7280",
|
|
3563
|
-
marginBottom: 2
|
|
3564
|
-
},
|
|
3565
|
-
children: "Refunds"
|
|
3566
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3567
|
-
style: {
|
|
3568
|
-
fontSize: 15,
|
|
3569
|
-
fontWeight: 800,
|
|
3570
|
-
color: "#111827"
|
|
3571
|
-
},
|
|
3572
|
-
children: pct(refundRate, 1)
|
|
3573
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3574
|
-
style: {
|
|
3575
|
-
fontSize: 9,
|
|
3576
|
-
fontWeight: 600
|
|
3577
|
-
},
|
|
3578
|
-
children: /*#__PURE__*/jsxRuntime.jsx(TrendText, {
|
|
3579
|
-
invert: true,
|
|
3580
|
-
style: {
|
|
3581
|
-
fontSize: 9
|
|
3582
|
-
},
|
|
3583
|
-
children: growthPercentage === 0 ? "stable" : formatArrowTrend(growthPercentage)
|
|
3584
|
-
})
|
|
3585
|
-
})]
|
|
3586
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3587
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3588
|
-
style: {
|
|
3589
|
-
fontSize: 8,
|
|
3590
|
-
fontWeight: 700,
|
|
3591
|
-
letterSpacing: "0.5px",
|
|
3592
|
-
color: "#6B7280",
|
|
3593
|
-
marginBottom: 2
|
|
3594
|
-
},
|
|
3595
|
-
children: "Chargebacks"
|
|
3596
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3597
|
-
style: {
|
|
3598
|
-
fontSize: 15,
|
|
3599
|
-
fontWeight: 800,
|
|
3600
|
-
color: "#111827"
|
|
3601
|
-
},
|
|
3602
|
-
children: pct(chargebackRate, 1)
|
|
3603
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3604
|
-
style: {
|
|
3605
|
-
fontSize: 9,
|
|
3606
|
-
color: "#9CA3AF"
|
|
3607
|
-
},
|
|
3608
|
-
children: growthPercentage === 0 ? "stable" : /*#__PURE__*/jsxRuntime.jsx(TrendText, {
|
|
3609
|
-
invert: true,
|
|
3610
|
-
style: {
|
|
3611
|
-
fontSize: 9
|
|
3612
|
-
},
|
|
3613
|
-
children: formatArrowTrend(growthPercentage)
|
|
3614
|
-
})
|
|
3615
|
-
})]
|
|
3616
|
-
})]
|
|
3617
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Divider, {
|
|
3618
|
-
mb: 5
|
|
3619
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3620
|
-
style: {
|
|
3621
|
-
fontSize: 8,
|
|
3622
|
-
color: "#6B7280",
|
|
3623
|
-
lineHeight: 1.45
|
|
3624
|
-
},
|
|
3625
|
-
children: [d$(totalRefundedAmount), " refunded - ", formatNumber(totalChargebacks), " chargebacks - ", formatNumber(lostChargebacks), " cases lost"]
|
|
3626
|
-
})]
|
|
3627
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Panel, {
|
|
3628
|
-
title: "Traffic source",
|
|
3629
|
-
subtitle: "Revenue by channel - ".concat(daysLabel),
|
|
3630
|
-
children: /*#__PURE__*/jsxRuntime.jsx(MiniTable, {
|
|
3631
|
-
head: ["Source", "Revenue", "Share"],
|
|
3632
|
-
rows: [].concat(_toConsumableArray(trafficItems.map(function (t) {
|
|
3633
|
-
return [t.source || t.name || "-", d$(t.revenue || t.raised || 0), "".concat(formatNumber(t.share || t.percentage || 0), "%")];
|
|
3634
|
-
})), [["Total", d$(trafficTotal), ""]])
|
|
3635
|
-
})
|
|
3700
|
+
totalDonors: totalDonors
|
|
3701
|
+
}), /*#__PURE__*/jsxRuntime.jsx(P2RefundsCard, {
|
|
3702
|
+
refundRate: refundRate,
|
|
3703
|
+
chargebackRate: chargebackRate,
|
|
3704
|
+
refundGrowth: growthPercentage !== null && growthPercentage !== void 0 ? growthPercentage : 0,
|
|
3705
|
+
totalRefundedAmount: totalRefundedAmount,
|
|
3706
|
+
disputedAmount: disputedAmount !== null && disputedAmount !== void 0 ? disputedAmount : 0,
|
|
3707
|
+
lostCases: lostChargebacks !== null && lostChargebacks !== void 0 ? lostChargebacks : 0,
|
|
3708
|
+
chartData: refundChartData,
|
|
3709
|
+
windowLabel: windowLabel
|
|
3710
|
+
}), /*#__PURE__*/jsxRuntime.jsx(P2TrafficSourceCard, {
|
|
3711
|
+
items: trafficList,
|
|
3712
|
+
total: trafficTotal,
|
|
3713
|
+
daysLabel: daysLabel
|
|
3636
3714
|
})]
|
|
3637
3715
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3638
3716
|
style: {
|
|
3639
3717
|
display: "grid",
|
|
3640
3718
|
gridTemplateColumns: "repeat(4, 1fr)",
|
|
3641
|
-
gap:
|
|
3719
|
+
gap: 10
|
|
3642
3720
|
},
|
|
3643
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
3721
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(P2RevenueTrendCard, {
|
|
3644
3722
|
title: "Order Bump",
|
|
3645
|
-
subtitle: "Revenue trend
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
style: {
|
|
3655
|
-
fontSize: 10,
|
|
3656
|
-
fontWeight: 600,
|
|
3657
|
-
marginBottom: 5
|
|
3658
|
-
},
|
|
3659
|
-
children: /*#__PURE__*/jsxRuntime.jsx(TrendText, {
|
|
3660
|
-
style: {
|
|
3661
|
-
fontSize: 10
|
|
3662
|
-
},
|
|
3663
|
-
children: formatArrowTrend((_ob$growthPercentage = ob === null || ob === void 0 ? void 0 : ob.growthPercentage) !== null && _ob$growthPercentage !== void 0 ? _ob$growthPercentage : 0, {
|
|
3664
|
-
label: "vs pp"
|
|
3665
|
-
})
|
|
3666
|
-
})
|
|
3667
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Sparkline, {
|
|
3668
|
-
data: obData.length ? obData : [0, 0],
|
|
3669
|
-
color: C.indigo,
|
|
3670
|
-
width: 110,
|
|
3671
|
-
height: 34
|
|
3672
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Divider, {
|
|
3673
|
-
mt: 8,
|
|
3674
|
-
mb: 7
|
|
3675
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3676
|
-
style: {
|
|
3677
|
-
display: "flex",
|
|
3678
|
-
gap: 12
|
|
3679
|
-
},
|
|
3680
|
-
children: [["Avg/day", d$((ob === null || ob === void 0 ? void 0 : ob.averagePerDay) || 0)], ["Peak day", d$((ob === null || ob === void 0 || (_ob$peakDay = ob.peakDay) === null || _ob$peakDay === void 0 ? void 0 : _ob$peakDay.amount) || 0)], ["Orders", formatNumber((ob === null || ob === void 0 ? void 0 : ob.totalOrders) || 0)]].map(function (_ref21) {
|
|
3681
|
-
var _ref22 = _slicedToArray(_ref21, 2),
|
|
3682
|
-
l = _ref22[0],
|
|
3683
|
-
v = _ref22[1];
|
|
3684
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3685
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3686
|
-
style: {
|
|
3687
|
-
fontSize: 8,
|
|
3688
|
-
color: "#9CA3AF",
|
|
3689
|
-
marginBottom: 4
|
|
3690
|
-
},
|
|
3691
|
-
children: l
|
|
3692
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3693
|
-
style: {
|
|
3694
|
-
fontSize: 11.5,
|
|
3695
|
-
fontWeight: 700,
|
|
3696
|
-
color: "#111827"
|
|
3697
|
-
},
|
|
3698
|
-
children: v
|
|
3699
|
-
})]
|
|
3700
|
-
}, l);
|
|
3701
|
-
})
|
|
3702
|
-
})]
|
|
3703
|
-
}), /*#__PURE__*/jsxRuntime.jsx(AcceptanceRaisedPanel, {
|
|
3723
|
+
subtitle: "Revenue trend".concat(BULLET, "last ").concat(daysLabel),
|
|
3724
|
+
value: (_ob$totalRevenue = ob === null || ob === void 0 ? void 0 : ob.totalRevenue) !== null && _ob$totalRevenue !== void 0 ? _ob$totalRevenue : 0,
|
|
3725
|
+
trend: "".concat(formatTrend((_ob$growthPercentage = ob === null || ob === void 0 ? void 0 : ob.growthPercentage) !== null && _ob$growthPercentage !== void 0 ? _ob$growthPercentage : 0), " vs last month"),
|
|
3726
|
+
chartData: obData.length ? obData : [0, 0],
|
|
3727
|
+
chartColor: THEME.brand,
|
|
3728
|
+
startLabel: chartStartLabel,
|
|
3729
|
+
endLabel: chartEndLabel,
|
|
3730
|
+
footerStats: [["Avg/day", d$Compact((_ob$averagePerDay = ob === null || ob === void 0 ? void 0 : ob.averagePerDay) !== null && _ob$averagePerDay !== void 0 ? _ob$averagePerDay : 0)], ["Peak day", d$Compact((_ob$peakDay$amount = ob === null || ob === void 0 || (_ob$peakDay = ob.peakDay) === null || _ob$peakDay === void 0 ? void 0 : _ob$peakDay.amount) !== null && _ob$peakDay$amount !== void 0 ? _ob$peakDay$amount : 0)], ["Orders", formatNumber((_ob$totalOrders = ob === null || ob === void 0 ? void 0 : ob.totalOrders) !== null && _ob$totalOrders !== void 0 ? _ob$totalOrders : 0)]]
|
|
3731
|
+
}), /*#__PURE__*/jsxRuntime.jsx(P2AcceptanceCard, {
|
|
3704
3732
|
title: "Upsell",
|
|
3705
|
-
|
|
3706
|
-
acceptanceRate: (up === null || up === void 0 ? void 0 : up.acceptanceRate) || 0,
|
|
3733
|
+
acceptanceRate: (_up$acceptanceRate = up === null || up === void 0 ? void 0 : up.acceptanceRate) !== null && _up$acceptanceRate !== void 0 ? _up$acceptanceRate : 0,
|
|
3707
3734
|
acceptanceGrowth: (_up$acceptanceGrowth = up === null || up === void 0 ? void 0 : up.acceptanceGrowth) !== null && _up$acceptanceGrowth !== void 0 ? _up$acceptanceGrowth : 0,
|
|
3708
|
-
raised: (up === null || up === void 0 ? void 0 : up.raised)
|
|
3709
|
-
raisedGrowth: (_up$raisedGrowth = up === null || up === void 0 ? void 0 : up.raisedGrowth) !== null && _up$raisedGrowth !== void 0 ? _up$raisedGrowth : 0
|
|
3710
|
-
|
|
3711
|
-
}), /*#__PURE__*/jsxRuntime.jsx(AcceptanceRaisedPanel, {
|
|
3735
|
+
raised: (_up$raised = up === null || up === void 0 ? void 0 : up.raised) !== null && _up$raised !== void 0 ? _up$raised : 0,
|
|
3736
|
+
raisedGrowth: (_up$raisedGrowth = up === null || up === void 0 ? void 0 : up.raisedGrowth) !== null && _up$raisedGrowth !== void 0 ? _up$raisedGrowth : 0
|
|
3737
|
+
}), /*#__PURE__*/jsxRuntime.jsx(P2AcceptanceCard, {
|
|
3712
3738
|
title: "Downsell",
|
|
3713
|
-
|
|
3714
|
-
acceptanceRate: (dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) || 0,
|
|
3739
|
+
acceptanceRate: (_dn$acceptanceRate = dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) !== null && _dn$acceptanceRate !== void 0 ? _dn$acceptanceRate : 0,
|
|
3715
3740
|
acceptanceGrowth: (_dn$acceptanceGrowth = dn === null || dn === void 0 ? void 0 : dn.acceptanceGrowth) !== null && _dn$acceptanceGrowth !== void 0 ? _dn$acceptanceGrowth : 0,
|
|
3716
|
-
raised: (dn === null || dn === void 0 ? void 0 : dn.raised)
|
|
3717
|
-
raisedGrowth: (_dn$raisedGrowth = dn === null || dn === void 0 ? void 0 : dn.raisedGrowth) !== null && _dn$raisedGrowth !== void 0 ? _dn$raisedGrowth : 0
|
|
3718
|
-
|
|
3719
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(Panel, {
|
|
3741
|
+
raised: (_dn$raised = dn === null || dn === void 0 ? void 0 : dn.raised) !== null && _dn$raised !== void 0 ? _dn$raised : 0,
|
|
3742
|
+
raisedGrowth: (_dn$raisedGrowth = dn === null || dn === void 0 ? void 0 : dn.raisedGrowth) !== null && _dn$raisedGrowth !== void 0 ? _dn$raisedGrowth : 0
|
|
3743
|
+
}), /*#__PURE__*/jsxRuntime.jsx(P2RevenueTrendCard, {
|
|
3720
3744
|
title: "Referrals",
|
|
3721
|
-
subtitle: "Revenue trend
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3730
|
-
style: {
|
|
3731
|
-
fontSize: 10,
|
|
3732
|
-
fontWeight: 600,
|
|
3733
|
-
marginBottom: 5
|
|
3734
|
-
},
|
|
3735
|
-
children: /*#__PURE__*/jsxRuntime.jsx(TrendText, {
|
|
3736
|
-
style: {
|
|
3737
|
-
fontSize: 10
|
|
3738
|
-
},
|
|
3739
|
-
children: formatArrowTrend((_refCard$growthPercen = refCard === null || refCard === void 0 ? void 0 : refCard.growthPercentage) !== null && _refCard$growthPercen !== void 0 ? _refCard$growthPercen : 0, {
|
|
3740
|
-
label: "vs pp"
|
|
3741
|
-
})
|
|
3742
|
-
})
|
|
3743
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Sparkline, {
|
|
3744
|
-
data: refData.length ? refData : [0, 0],
|
|
3745
|
-
color: C.emerald,
|
|
3746
|
-
width: 110,
|
|
3747
|
-
height: 34
|
|
3748
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Divider, {
|
|
3749
|
-
mt: 8,
|
|
3750
|
-
mb: 7
|
|
3751
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3752
|
-
style: {
|
|
3753
|
-
display: "flex",
|
|
3754
|
-
gap: 12
|
|
3755
|
-
},
|
|
3756
|
-
children: [["Referrers", formatNumber((refCard === null || refCard === void 0 ? void 0 : refCard.totalReferrers) || 0)], ["Avg gift", d$((refCard === null || refCard === void 0 ? void 0 : refCard.averageGift) || 0)], ["Conv. rate", pct((refCard === null || refCard === void 0 ? void 0 : refCard.conversionRate) || 0, 1)]].map(function (_ref23) {
|
|
3757
|
-
var _ref24 = _slicedToArray(_ref23, 2),
|
|
3758
|
-
l = _ref24[0],
|
|
3759
|
-
v = _ref24[1];
|
|
3760
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3761
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3762
|
-
style: {
|
|
3763
|
-
fontSize: 8,
|
|
3764
|
-
color: "#9CA3AF",
|
|
3765
|
-
marginBottom: 4
|
|
3766
|
-
},
|
|
3767
|
-
children: l
|
|
3768
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3769
|
-
style: {
|
|
3770
|
-
fontSize: 11.5,
|
|
3771
|
-
fontWeight: 700,
|
|
3772
|
-
color: "#111827"
|
|
3773
|
-
},
|
|
3774
|
-
children: v
|
|
3775
|
-
})]
|
|
3776
|
-
}, l);
|
|
3777
|
-
})
|
|
3778
|
-
})]
|
|
3745
|
+
subtitle: "Revenue trend".concat(BULLET, "last ").concat(daysLabel),
|
|
3746
|
+
value: (_refCard$totalRevenue = refCard === null || refCard === void 0 ? void 0 : refCard.totalRevenue) !== null && _refCard$totalRevenue !== void 0 ? _refCard$totalRevenue : 0,
|
|
3747
|
+
trend: "".concat(formatTrend((_refCard$growthPercen = refCard === null || refCard === void 0 ? void 0 : refCard.growthPercentage) !== null && _refCard$growthPercen !== void 0 ? _refCard$growthPercen : 0), " vs last month"),
|
|
3748
|
+
chartData: refData.length ? refData : [0, 0],
|
|
3749
|
+
chartColor: "#10B981",
|
|
3750
|
+
startLabel: refStartLabel,
|
|
3751
|
+
endLabel: refEndLabel,
|
|
3752
|
+
footerStats: [["Referrers", formatNumber((_refCard$totalReferre = refCard === null || refCard === void 0 ? void 0 : refCard.totalReferrers) !== null && _refCard$totalReferre !== void 0 ? _refCard$totalReferre : 0)], ["Avg gift", d$Compact((_refCard$averageGift = refCard === null || refCard === void 0 ? void 0 : refCard.averageGift) !== null && _refCard$averageGift !== void 0 ? _refCard$averageGift : 0)], ["Conv. rate", pct((_refCard$conversionRa = refCard === null || refCard === void 0 ? void 0 : refCard.conversionRate) !== null && _refCard$conversionRa !== void 0 ? _refCard$conversionRa : 0, 1)]]
|
|
3779
3753
|
})]
|
|
3780
3754
|
})]
|
|
3781
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
3755
|
+
}), /*#__PURE__*/jsxRuntime.jsx(PageTwoFooter, {
|
|
3782
3756
|
generatedBy: name,
|
|
3783
|
-
generatedLabel: generatedLabel
|
|
3784
|
-
page: 2
|
|
3757
|
+
generatedLabel: generatedLabel
|
|
3785
3758
|
})]
|
|
3786
3759
|
})]
|
|
3787
3760
|
});
|