@ammarkhalidfarooq/dashboard-package 0.6.67 → 0.6.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1472,7 +1472,7 @@ var getActiveFilterChips = function getActiveFilterChips(apiData) {
1472
1472
  return ["Status: Successful", "Country: United States, UAE", "Amount: $50 – $5,000"];
1473
1473
  };
1474
1474
  var buildReportData = function buildReportData() {
1475
- var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$totalDonati, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _growth$overallAVGDon, _growth$totalRevenue, _growth$netRevenue, _growth$totalDonation, _growth$overallAVGDon2, _apiData$medianGift, _apiData$topDecileGif, _apiData$roasCard, _apiData$roasCardPrev, _apiData$adSpend, _apiData$attributedRe, _growth$conversionRat, _refundsRaw$refundRat, _refundsRaw$refundRat2, _refundsRaw$refundCou, _apiData$overviewStat2, _growth$totalRevenue2;
1475
+ var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$totalDonati, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _overview$overallAVGD2, _growth$overallAVGDon, _growth$totalRevenue, _growth$netRevenue, _growth$totalDonation, _growth$overallAVGDon2, _apiData$medianGift, _apiData$topDecileGif, _apiData$roasCard, _apiData$roasCardPrev, _apiData$adSpend, _apiData$attributedRe, _growth$conversionRat, _refundsRaw$refundRat, _refundsRaw$refundRat2, _refundsRaw$refundCou, _apiData$overviewStat2, _growth$totalRevenue2;
1476
1476
  var apiData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1477
1477
  var dateName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "Last Period";
1478
1478
  var overview = (apiData === null || apiData === void 0 || (_apiData$overviewStat = apiData.overviewStats) === null || _apiData$overviewStat === void 0 ? void 0 : _apiData$overviewStat.overview) || {};
@@ -1486,10 +1486,8 @@ var buildReportData = function buildReportData() {
1486
1486
  var totalVisits = Number((_apiData$totalVisits = apiData === null || apiData === void 0 ? void 0 : apiData.totalVisits) !== null && _apiData$totalVisits !== void 0 ? _apiData$totalVisits : 12438);
1487
1487
  var passThrough = totalRaised > 0 ? "".concat((netRaised / totalRaised * 100).toFixed(1), "% pass-through") : "92.3% pass-through";
1488
1488
  var donorMixRaw = apiData === null || apiData === void 0 ? void 0 : apiData.donorPieChartData;
1489
- var newDonors = 31;
1490
- var returningDonors = 184;
1491
- var avgGift = avgDonation;
1492
- var donorMixPrev = Number((_growth$overallAVGDon = growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) !== null && _growth$overallAVGDon !== void 0 ? _growth$overallAVGDon : 8.4);
1489
+ var newDonors = 0;
1490
+ var returningDonors = 0;
1493
1491
  if (Array.isArray(donorMixRaw)) {
1494
1492
  var nd = donorMixRaw.find(function (d) {
1495
1493
  return /new/i.test(d.type);
@@ -1499,18 +1497,15 @@ var buildReportData = function buildReportData() {
1499
1497
  }) || {};
1500
1498
  newDonors = nd.totalDonations || 0;
1501
1499
  returningDonors = rd.totalDonations || 0;
1502
- var totAmt = (nd.totalAmount || 0) + (rd.totalAmount || 0);
1503
- var totCnt = newDonors + returningDonors;
1504
- avgGift = totCnt > 0 ? totAmt / totCnt : avgDonation;
1505
1500
  } else if (donorMixRaw && _typeof(donorMixRaw) === "object") {
1506
1501
  newDonors = donorMixRaw.newDonors || 0;
1507
1502
  returningDonors = donorMixRaw.returningDonors || 0;
1508
- avgGift = donorMixRaw.avgGift || avgDonation;
1509
- donorMixPrev = donorMixRaw.donorMixPrev || donorMixPrev;
1510
1503
  }
1511
- var totalMix = newDonors + returningDonors || 1;
1512
- var newPct = Math.round(newDonors / totalMix * 100);
1513
- var retPct = 100 - newPct;
1504
+ var avgGift = Number(((_overview$overallAVGD2 = overview === null || overview === void 0 ? void 0 : overview.overallAVGDonations) !== null && _overview$overallAVGD2 !== void 0 ? _overview$overallAVGD2 : 0).toFixed(2));
1505
+ var donorMixPrev = Number(((_growth$overallAVGDon = growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) !== null && _growth$overallAVGDon !== void 0 ? _growth$overallAVGDon : 0).toFixed(2));
1506
+ var totalMix = newDonors + returningDonors;
1507
+ var newPct = totalMix > 0 ? Math.round(newDonors / totalMix * 100) : 0;
1508
+ var retPct = totalMix > 0 ? 100 - newPct : 0;
1514
1509
  var hero = {
1515
1510
  value: "$".concat(formatNumber(totalRaised)),
1516
1511
  trend: "".concat(formatTrend((_growth$totalRevenue = growth === null || growth === void 0 ? void 0 : growth.totalRevenue) !== null && _growth$totalRevenue !== void 0 ? _growth$totalRevenue : 18), " vs ").concat(dateName || "last month"),
@@ -2301,15 +2296,155 @@ var DonationTypePanel = function DonationTypePanel(_ref0) {
2301
2296
  })]
2302
2297
  });
2303
2298
  };
2304
- var KpiCard = function KpiCard(_ref1) {
2299
+ var AcceptanceRaisedPanel = function AcceptanceRaisedPanel(_ref1) {
2305
2300
  var title = _ref1.title,
2306
- value = _ref1.value,
2307
- trend = _ref1.trend,
2308
- detail = _ref1.detail,
2309
- _ref1$variant = _ref1.variant,
2310
- variant = _ref1$variant === void 0 ? "secondary" : _ref1$variant,
2311
- _ref1$trendPositiveWh = _ref1.trendPositiveWhenNegative,
2312
- trendPositiveWhenNegative = _ref1$trendPositiveWh === void 0 ? false : _ref1$trendPositiveWh;
2301
+ subtitle = _ref1.subtitle,
2302
+ _ref1$acceptanceRate = _ref1.acceptanceRate,
2303
+ acceptanceRate = _ref1$acceptanceRate === void 0 ? 0 : _ref1$acceptanceRate,
2304
+ _ref1$acceptanceGrowt = _ref1.acceptanceGrowth,
2305
+ acceptanceGrowth = _ref1$acceptanceGrowt === void 0 ? 0 : _ref1$acceptanceGrowt,
2306
+ _ref1$raised = _ref1.raised,
2307
+ raised = _ref1$raised === void 0 ? 0 : _ref1$raised,
2308
+ _ref1$raisedGrowth = _ref1.raisedGrowth,
2309
+ raisedGrowth = _ref1$raisedGrowth === void 0 ? 0 : _ref1$raisedGrowth,
2310
+ _ref1$primaryColor = _ref1.primaryColor,
2311
+ primaryColor = _ref1$primaryColor === void 0 ? "#6366F1" : _ref1$primaryColor,
2312
+ _ref1$secondaryColor = _ref1.secondaryColor,
2313
+ secondaryColor = _ref1$secondaryColor === void 0 ? "#88bfd290" : _ref1$secondaryColor;
2314
+ return /*#__PURE__*/jsx(Panel, {
2315
+ title: title,
2316
+ subtitle: subtitle,
2317
+ children: /*#__PURE__*/jsxs("div", {
2318
+ style: {
2319
+ display: "flex",
2320
+ flexDirection: "column",
2321
+ alignItems: "center"
2322
+ },
2323
+ children: [/*#__PURE__*/jsx(Donut, {
2324
+ segments: [{
2325
+ value: acceptanceRate,
2326
+ color: primaryColor
2327
+ }, {
2328
+ value: Math.max(0, 100 - acceptanceRate),
2329
+ color: "#E5E7EB"
2330
+ }],
2331
+ size: 88,
2332
+ centerVal: "".concat(formatNumber(acceptanceRate), "%"),
2333
+ centerLabel: "accepted"
2334
+ }), /*#__PURE__*/jsxs("div", {
2335
+ style: {
2336
+ width: "100%",
2337
+ marginTop: 6
2338
+ },
2339
+ children: [/*#__PURE__*/jsxs("div", {
2340
+ style: {
2341
+ display: "flex",
2342
+ justifyContent: "space-between",
2343
+ alignItems: "center",
2344
+ marginBottom: 5
2345
+ },
2346
+ children: [/*#__PURE__*/jsxs("div", {
2347
+ style: {
2348
+ display: "flex",
2349
+ alignItems: "center",
2350
+ gap: 5
2351
+ },
2352
+ children: [/*#__PURE__*/jsx("div", {
2353
+ style: {
2354
+ width: 8,
2355
+ height: 8,
2356
+ borderRadius: 2,
2357
+ background: primaryColor,
2358
+ flexShrink: 0
2359
+ }
2360
+ }), /*#__PURE__*/jsx("span", {
2361
+ style: {
2362
+ fontSize: 9.5,
2363
+ color: "#6B7280"
2364
+ },
2365
+ children: "Acceptance"
2366
+ })]
2367
+ }), /*#__PURE__*/jsxs("div", {
2368
+ style: {
2369
+ display: "flex",
2370
+ alignItems: "baseline",
2371
+ gap: 4
2372
+ },
2373
+ children: [/*#__PURE__*/jsxs("span", {
2374
+ style: {
2375
+ fontSize: 9.5,
2376
+ fontWeight: 700,
2377
+ color: "#111827"
2378
+ },
2379
+ children: [formatNumber(acceptanceRate), "%"]
2380
+ }), /*#__PURE__*/jsx(TrendText, {
2381
+ style: {
2382
+ fontSize: 9
2383
+ },
2384
+ children: formatArrowTrend(acceptanceGrowth)
2385
+ })]
2386
+ })]
2387
+ }), /*#__PURE__*/jsxs("div", {
2388
+ style: {
2389
+ display: "flex",
2390
+ justifyContent: "space-between",
2391
+ alignItems: "center"
2392
+ },
2393
+ children: [/*#__PURE__*/jsxs("div", {
2394
+ style: {
2395
+ display: "flex",
2396
+ alignItems: "center",
2397
+ gap: 5
2398
+ },
2399
+ children: [/*#__PURE__*/jsx("div", {
2400
+ style: {
2401
+ width: 8,
2402
+ height: 8,
2403
+ borderRadius: 2,
2404
+ background: secondaryColor,
2405
+ flexShrink: 0
2406
+ }
2407
+ }), /*#__PURE__*/jsx("span", {
2408
+ style: {
2409
+ fontSize: 9.5,
2410
+ color: "#6B7280"
2411
+ },
2412
+ children: "Raised"
2413
+ })]
2414
+ }), /*#__PURE__*/jsxs("div", {
2415
+ style: {
2416
+ display: "flex",
2417
+ alignItems: "baseline",
2418
+ gap: 4
2419
+ },
2420
+ children: [/*#__PURE__*/jsx("span", {
2421
+ style: {
2422
+ fontSize: 9.5,
2423
+ fontWeight: 700,
2424
+ color: "#111827"
2425
+ },
2426
+ children: d$(raised)
2427
+ }), /*#__PURE__*/jsx(TrendText, {
2428
+ style: {
2429
+ fontSize: 9
2430
+ },
2431
+ children: formatArrowTrend(raisedGrowth)
2432
+ })]
2433
+ })]
2434
+ })]
2435
+ })]
2436
+ })
2437
+ });
2438
+ };
2439
+ var KpiCard = function KpiCard(_ref10) {
2440
+ var title = _ref10.title,
2441
+ value = _ref10.value,
2442
+ trend = _ref10.trend,
2443
+ detail = _ref10.detail,
2444
+ _ref10$variant = _ref10.variant,
2445
+ variant = _ref10$variant === void 0 ? "secondary" : _ref10$variant,
2446
+ _ref10$trendPositiveW = _ref10.trendPositiveWhenNegative,
2447
+ trendPositiveWhenNegative = _ref10$trendPositiveW === void 0 ? false : _ref10$trendPositiveW;
2313
2448
  var displayTrend = withTrendArrow(trend);
2314
2449
  var isPrimary = variant === "primary";
2315
2450
  return /*#__PURE__*/jsxs("div", {
@@ -2360,46 +2495,6 @@ var KpiCard = function KpiCard(_ref1) {
2360
2495
  })]
2361
2496
  });
2362
2497
  };
2363
- var StatPair = function StatPair(_ref10) {
2364
- var label = _ref10.label,
2365
- val = _ref10.val,
2366
- trend = _ref10.trend;
2367
- var displayTrend = withTrendArrow(trend);
2368
- return /*#__PURE__*/jsxs("div", {
2369
- style: {
2370
- marginBottom: 6
2371
- },
2372
- children: [/*#__PURE__*/jsx("div", {
2373
- style: {
2374
- fontSize: 8.5,
2375
- color: THEME.muted,
2376
- marginBottom: 1
2377
- },
2378
- children: label
2379
- }), /*#__PURE__*/jsxs("div", {
2380
- style: {
2381
- display: "flex",
2382
- alignItems: "baseline",
2383
- gap: 4
2384
- },
2385
- children: [/*#__PURE__*/jsx("span", {
2386
- style: {
2387
- fontSize: 13,
2388
- fontWeight: 700,
2389
- color: "#111827"
2390
- },
2391
- children: val
2392
- }), trend && /*#__PURE__*/jsx("span", {
2393
- style: {
2394
- fontSize: 9.5,
2395
- fontWeight: 600,
2396
- color: resolveTrendColor(displayTrend)
2397
- },
2398
- children: displayTrend
2399
- })]
2400
- })]
2401
- });
2402
- };
2403
2498
  var PageHeader = function PageHeader(_ref11) {
2404
2499
  var dateLabel = _ref11.dateLabel,
2405
2500
  generatedLabel = _ref11.generatedLabel,
@@ -2534,7 +2629,7 @@ var PageFooter = function PageFooter(_ref12) {
2534
2629
 
2535
2630
  // ─── Main component ───────────────────────────────────────────────────────────
2536
2631
  var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
2537
- var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _refundsRaw$refundRat, _refundsRaw$chargebac, _apiData$trafficSourc2, _metricByTitle$NetRa, _metricByTitle$Total, _metricByTitle$Total2, _metricByTitle$Total3, _metricByTitle$AvgDo, _metricByTitle$AvgDo2, _apiData$medianGift, _apiData$topDecileGif, _apiData$roasCard, _metricByTitle$ROAS, _apiData$roasCardPrev, _metricByTitle$ROAS2, _apiData$adSpend, _apiData$attributedRe, _metricByTitle$Conver, _metricByTitle$Conver2, _metricByTitle$Refund, _metricByTitle$Refund2, _refundsRaw$refundCou, _metricByTitle$Refund3, _mainChart$stacked, _ref16, _refundsRaw$refundRat2, _ob$growthPercentage, _ob$peakDay, _refCard$growthPercen;
2632
+ var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _refundsRaw$refundRat, _refundsRaw$chargebac, _apiData$trafficSourc, _apiData$trafficSourc2, _apiData$trafficSourc3, _metricByTitle$NetRa, _metricByTitle$Total, _metricByTitle$Total2, _metricByTitle$Total3, _metricByTitle$AvgDo, _metricByTitle$AvgDo2, _apiData$medianGift, _apiData$topDecileGif, _apiData$roasCard, _metricByTitle$ROAS, _apiData$roasCardPrev, _metricByTitle$ROAS2, _apiData$adSpend, _apiData$attributedRe, _metricByTitle$Conver, _metricByTitle$Conver2, _metricByTitle$Refund, _metricByTitle$Refund2, _refundsRaw$refundCou, _metricByTitle$Refund3, _mainChart$stacked, _refundsRaw$refundRat2, _ob$growthPercentage, _ob$peakDay, _up$acceptanceGrowth, _up$raisedGrowth, _dn$acceptanceGrowth, _dn$raisedGrowth, _refCard$growthPercen;
2538
2633
  var _ref13$apiData = _ref13.apiData,
2539
2634
  apiData = _ref13$apiData === void 0 ? {} : _ref13$apiData,
2540
2635
  _ref13$dateName = _ref13.dateName,
@@ -2617,28 +2712,8 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
2617
2712
  mixAvgGift = donorMix.avgGift,
2618
2713
  donorMixPrev = donorMix.donorMixPrev;
2619
2714
  var geoList = report.donorGeographyList;
2620
- var trafficItems = function (_apiData$trafficSourc) {
2621
- var items = Array.isArray(apiData === null || apiData === void 0 || (_apiData$trafficSourc = apiData.trafficSourceData) === null || _apiData$trafficSourc === void 0 ? void 0 : _apiData$trafficSourc.data) ? apiData.trafficSourceData.data : [];
2622
- if (items.length) return items;
2623
- return [{
2624
- source: "Paid Ads",
2625
- revenue: 98400,
2626
- share: 41
2627
- }, {
2628
- source: "Organic",
2629
- revenue: 62100,
2630
- share: 26
2631
- }, {
2632
- source: "Email",
2633
- revenue: 38600,
2634
- share: 16
2635
- }, {
2636
- source: "Direct",
2637
- revenue: 15500,
2638
- share: 6
2639
- }];
2640
- }();
2641
- var trafficTotal = Number((apiData === null || apiData === void 0 || (_apiData$trafficSourc2 = apiData.trafficSourceData) === null || _apiData$trafficSourc2 === void 0 ? void 0 : _apiData$trafficSourc2.totalRevenue) || 240900);
2715
+ var trafficItems = Array.isArray(apiData === null || apiData === void 0 || (_apiData$trafficSourc = apiData.trafficSourceData) === null || _apiData$trafficSourc === void 0 ? void 0 : _apiData$trafficSourc.data) ? apiData.trafficSourceData.data : [];
2716
+ 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);
2642
2717
  var revSeries = (mainChart.series || []).length ? mainChart.series : [{
2643
2718
  name: "Paid Ads",
2644
2719
  data: []
@@ -3048,7 +3123,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
3048
3123
  color: "#111827",
3049
3124
  marginBottom: 2
3050
3125
  },
3051
- children: kpi$(mixAvgGift)
3126
+ children: d$(mixAvgGift)
3052
3127
  }), /*#__PURE__*/jsx("div", {
3053
3128
  style: {
3054
3129
  fontSize: 9
@@ -3057,7 +3132,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
3057
3132
  style: {
3058
3133
  fontSize: 9
3059
3134
  },
3060
- children: formatArrowTrend((_ref16 = donorMixPrev !== null && donorMixPrev !== void 0 ? donorMixPrev : growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) !== null && _ref16 !== void 0 ? _ref16 : 0, {
3135
+ children: formatArrowTrend(donorMixPrev, {
3061
3136
  label: "vs last month"
3062
3137
  })
3063
3138
  })
@@ -3230,10 +3305,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
3230
3305
  display: "flex",
3231
3306
  gap: 12
3232
3307
  },
3233
- 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 (_ref17) {
3234
- var _ref18 = _slicedToArray(_ref17, 2),
3235
- l = _ref18[0],
3236
- v = _ref18[1];
3308
+ 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 (_ref16) {
3309
+ var _ref17 = _slicedToArray(_ref16, 2),
3310
+ l = _ref17[0],
3311
+ v = _ref17[1];
3237
3312
  return /*#__PURE__*/jsxs("div", {
3238
3313
  children: [/*#__PURE__*/jsx("div", {
3239
3314
  style: {
@@ -3253,76 +3328,22 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
3253
3328
  }, l);
3254
3329
  })
3255
3330
  })]
3256
- }), /*#__PURE__*/jsx(Panel, {
3331
+ }), /*#__PURE__*/jsx(AcceptanceRaisedPanel, {
3257
3332
  title: "Upsell",
3258
3333
  subtitle: "Acceptance & raised",
3259
- children: /*#__PURE__*/jsxs("div", {
3260
- style: {
3261
- display: "flex",
3262
- alignItems: "center",
3263
- gap: 12
3264
- },
3265
- children: [/*#__PURE__*/jsx(Donut, {
3266
- segments: [{
3267
- value: (up === null || up === void 0 ? void 0 : up.acceptanceRate) || 0,
3268
- color: C.indigo
3269
- }, {
3270
- value: Math.max(0, 100 - ((up === null || up === void 0 ? void 0 : up.acceptanceRate) || 0)),
3271
- color: "#E5E7EB"
3272
- }],
3273
- size: 76,
3274
- centerVal: "".concat(formatNumber((up === null || up === void 0 ? void 0 : up.acceptanceRate) || 0), "%"),
3275
- centerLabel: "accepted"
3276
- }), /*#__PURE__*/jsxs("div", {
3277
- style: {
3278
- flex: 1
3279
- },
3280
- children: [/*#__PURE__*/jsx(StatPair, {
3281
- label: "Acceptance",
3282
- val: pct((up === null || up === void 0 ? void 0 : up.acceptanceRate) || 0, 1),
3283
- trend: formatArrowTrend(up === null || up === void 0 ? void 0 : up.acceptanceGrowth)
3284
- }), /*#__PURE__*/jsx(StatPair, {
3285
- label: "Raised",
3286
- val: d$((up === null || up === void 0 ? void 0 : up.raised) || 0),
3287
- trend: formatArrowTrend(up === null || up === void 0 ? void 0 : up.raisedGrowth)
3288
- })]
3289
- })]
3290
- })
3291
- }), /*#__PURE__*/jsx(Panel, {
3334
+ acceptanceRate: (up === null || up === void 0 ? void 0 : up.acceptanceRate) || 0,
3335
+ acceptanceGrowth: (_up$acceptanceGrowth = up === null || up === void 0 ? void 0 : up.acceptanceGrowth) !== null && _up$acceptanceGrowth !== void 0 ? _up$acceptanceGrowth : 0,
3336
+ raised: (up === null || up === void 0 ? void 0 : up.raised) || 0,
3337
+ raisedGrowth: (_up$raisedGrowth = up === null || up === void 0 ? void 0 : up.raisedGrowth) !== null && _up$raisedGrowth !== void 0 ? _up$raisedGrowth : 0,
3338
+ primaryColor: C.indigo
3339
+ }), /*#__PURE__*/jsx(AcceptanceRaisedPanel, {
3292
3340
  title: "Downsell",
3293
3341
  subtitle: "Acceptance & raised",
3294
- children: /*#__PURE__*/jsxs("div", {
3295
- style: {
3296
- display: "flex",
3297
- alignItems: "center",
3298
- gap: 12
3299
- },
3300
- children: [/*#__PURE__*/jsx(Donut, {
3301
- segments: [{
3302
- value: (dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) || 0,
3303
- color: C.cyan
3304
- }, {
3305
- value: Math.max(0, 100 - ((dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) || 0)),
3306
- color: "#E5E7EB"
3307
- }],
3308
- size: 76,
3309
- centerVal: "".concat(formatNumber((dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) || 0), "%"),
3310
- centerLabel: "accepted"
3311
- }), /*#__PURE__*/jsxs("div", {
3312
- style: {
3313
- flex: 1
3314
- },
3315
- children: [/*#__PURE__*/jsx(StatPair, {
3316
- label: "Acceptance",
3317
- val: pct((dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) || 0, 1),
3318
- trend: formatArrowTrend(dn === null || dn === void 0 ? void 0 : dn.acceptanceGrowth)
3319
- }), /*#__PURE__*/jsx(StatPair, {
3320
- label: "Raised",
3321
- val: d$((dn === null || dn === void 0 ? void 0 : dn.raised) || 0),
3322
- trend: formatArrowTrend(dn === null || dn === void 0 ? void 0 : dn.raisedGrowth)
3323
- })]
3324
- })]
3325
- })
3342
+ acceptanceRate: (dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) || 0,
3343
+ acceptanceGrowth: (_dn$acceptanceGrowth = dn === null || dn === void 0 ? void 0 : dn.acceptanceGrowth) !== null && _dn$acceptanceGrowth !== void 0 ? _dn$acceptanceGrowth : 0,
3344
+ raised: (dn === null || dn === void 0 ? void 0 : dn.raised) || 0,
3345
+ raisedGrowth: (_dn$raisedGrowth = dn === null || dn === void 0 ? void 0 : dn.raisedGrowth) !== null && _dn$raisedGrowth !== void 0 ? _dn$raisedGrowth : 0,
3346
+ primaryColor: C.cyan
3326
3347
  }), /*#__PURE__*/jsxs(Panel, {
3327
3348
  title: "Referrals",
3328
3349
  subtitle: "Revenue trend \xB7 last ".concat(daysLabel),
@@ -3360,10 +3381,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
3360
3381
  display: "flex",
3361
3382
  gap: 12
3362
3383
  },
3363
- 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 (_ref19) {
3364
- var _ref20 = _slicedToArray(_ref19, 2),
3365
- l = _ref20[0],
3366
- v = _ref20[1];
3384
+ 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 (_ref18) {
3385
+ var _ref19 = _slicedToArray(_ref18, 2),
3386
+ l = _ref19[0],
3387
+ v = _ref19[1];
3367
3388
  return /*#__PURE__*/jsxs("div", {
3368
3389
  children: [/*#__PURE__*/jsx("div", {
3369
3390
  style: {