@ammarkhalidfarooq/dashboard-package 0.6.66 → 0.6.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1474,7 +1474,7 @@ var getActiveFilterChips = function getActiveFilterChips(apiData) {
1474
1474
  return ["Status: Successful", "Country: United States, UAE", "Amount: $50 – $5,000"];
1475
1475
  };
1476
1476
  var buildReportData = function buildReportData() {
1477
- 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;
1477
+ 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;
1478
1478
  var apiData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1479
1479
  var dateName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "Last Period";
1480
1480
  var overview = (apiData === null || apiData === void 0 || (_apiData$overviewStat = apiData.overviewStats) === null || _apiData$overviewStat === void 0 ? void 0 : _apiData$overviewStat.overview) || {};
@@ -1490,8 +1490,6 @@ var buildReportData = function buildReportData() {
1490
1490
  var donorMixRaw = apiData === null || apiData === void 0 ? void 0 : apiData.donorPieChartData;
1491
1491
  var newDonors = 31;
1492
1492
  var returningDonors = 184;
1493
- var avgGift = avgDonation;
1494
- var donorMixPrev = Number((_growth$overallAVGDon = growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) !== null && _growth$overallAVGDon !== void 0 ? _growth$overallAVGDon : 8.4);
1495
1493
  if (Array.isArray(donorMixRaw)) {
1496
1494
  var nd = donorMixRaw.find(function (d) {
1497
1495
  return /new/i.test(d.type);
@@ -1501,15 +1499,12 @@ var buildReportData = function buildReportData() {
1501
1499
  }) || {};
1502
1500
  newDonors = nd.totalDonations || 0;
1503
1501
  returningDonors = rd.totalDonations || 0;
1504
- var totAmt = (nd.totalAmount || 0) + (rd.totalAmount || 0);
1505
- var totCnt = newDonors + returningDonors;
1506
- avgGift = totCnt > 0 ? totAmt / totCnt : avgDonation;
1507
1502
  } else if (donorMixRaw && _typeof(donorMixRaw) === "object") {
1508
1503
  newDonors = donorMixRaw.newDonors || 0;
1509
1504
  returningDonors = donorMixRaw.returningDonors || 0;
1510
- avgGift = donorMixRaw.avgGift || avgDonation;
1511
- donorMixPrev = donorMixRaw.donorMixPrev || donorMixPrev;
1512
1505
  }
1506
+ var avgGift = Number(((_overview$overallAVGD2 = overview === null || overview === void 0 ? void 0 : overview.overallAVGDonations) !== null && _overview$overallAVGD2 !== void 0 ? _overview$overallAVGD2 : 0).toFixed(2));
1507
+ var donorMixPrev = Number(((_growth$overallAVGDon = growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) !== null && _growth$overallAVGDon !== void 0 ? _growth$overallAVGDon : 0).toFixed(2));
1513
1508
  var totalMix = newDonors + returningDonors || 1;
1514
1509
  var newPct = Math.round(newDonors / totalMix * 100);
1515
1510
  var retPct = 100 - newPct;
@@ -2303,15 +2298,155 @@ var DonationTypePanel = function DonationTypePanel(_ref0) {
2303
2298
  })]
2304
2299
  });
2305
2300
  };
2306
- var KpiCard = function KpiCard(_ref1) {
2301
+ var AcceptanceRaisedPanel = function AcceptanceRaisedPanel(_ref1) {
2307
2302
  var title = _ref1.title,
2308
- value = _ref1.value,
2309
- trend = _ref1.trend,
2310
- detail = _ref1.detail,
2311
- _ref1$variant = _ref1.variant,
2312
- variant = _ref1$variant === void 0 ? "secondary" : _ref1$variant,
2313
- _ref1$trendPositiveWh = _ref1.trendPositiveWhenNegative,
2314
- trendPositiveWhenNegative = _ref1$trendPositiveWh === void 0 ? false : _ref1$trendPositiveWh;
2303
+ subtitle = _ref1.subtitle,
2304
+ _ref1$acceptanceRate = _ref1.acceptanceRate,
2305
+ acceptanceRate = _ref1$acceptanceRate === void 0 ? 0 : _ref1$acceptanceRate,
2306
+ _ref1$acceptanceGrowt = _ref1.acceptanceGrowth,
2307
+ acceptanceGrowth = _ref1$acceptanceGrowt === void 0 ? 0 : _ref1$acceptanceGrowt,
2308
+ _ref1$raised = _ref1.raised,
2309
+ raised = _ref1$raised === void 0 ? 0 : _ref1$raised,
2310
+ _ref1$raisedGrowth = _ref1.raisedGrowth,
2311
+ raisedGrowth = _ref1$raisedGrowth === void 0 ? 0 : _ref1$raisedGrowth,
2312
+ _ref1$primaryColor = _ref1.primaryColor,
2313
+ primaryColor = _ref1$primaryColor === void 0 ? "#6366F1" : _ref1$primaryColor,
2314
+ _ref1$secondaryColor = _ref1.secondaryColor,
2315
+ secondaryColor = _ref1$secondaryColor === void 0 ? "#88bfd290" : _ref1$secondaryColor;
2316
+ return /*#__PURE__*/jsxRuntime.jsx(Panel, {
2317
+ title: title,
2318
+ subtitle: subtitle,
2319
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
2320
+ style: {
2321
+ display: "flex",
2322
+ flexDirection: "column",
2323
+ alignItems: "center"
2324
+ },
2325
+ children: [/*#__PURE__*/jsxRuntime.jsx(Donut, {
2326
+ segments: [{
2327
+ value: acceptanceRate,
2328
+ color: primaryColor
2329
+ }, {
2330
+ value: Math.max(0, 100 - acceptanceRate),
2331
+ color: "#E5E7EB"
2332
+ }],
2333
+ size: 88,
2334
+ centerVal: "".concat(formatNumber(acceptanceRate), "%"),
2335
+ centerLabel: "accepted"
2336
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
2337
+ style: {
2338
+ width: "100%",
2339
+ marginTop: 6
2340
+ },
2341
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
2342
+ style: {
2343
+ display: "flex",
2344
+ justifyContent: "space-between",
2345
+ alignItems: "center",
2346
+ marginBottom: 5
2347
+ },
2348
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
2349
+ style: {
2350
+ display: "flex",
2351
+ alignItems: "center",
2352
+ gap: 5
2353
+ },
2354
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
2355
+ style: {
2356
+ width: 8,
2357
+ height: 8,
2358
+ borderRadius: 2,
2359
+ background: primaryColor,
2360
+ flexShrink: 0
2361
+ }
2362
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
2363
+ style: {
2364
+ fontSize: 9.5,
2365
+ color: "#6B7280"
2366
+ },
2367
+ children: "Acceptance"
2368
+ })]
2369
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
2370
+ style: {
2371
+ display: "flex",
2372
+ alignItems: "baseline",
2373
+ gap: 4
2374
+ },
2375
+ children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
2376
+ style: {
2377
+ fontSize: 9.5,
2378
+ fontWeight: 700,
2379
+ color: "#111827"
2380
+ },
2381
+ children: [formatNumber(acceptanceRate), "%"]
2382
+ }), /*#__PURE__*/jsxRuntime.jsx(TrendText, {
2383
+ style: {
2384
+ fontSize: 9
2385
+ },
2386
+ children: formatArrowTrend(acceptanceGrowth)
2387
+ })]
2388
+ })]
2389
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
2390
+ style: {
2391
+ display: "flex",
2392
+ justifyContent: "space-between",
2393
+ alignItems: "center"
2394
+ },
2395
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
2396
+ style: {
2397
+ display: "flex",
2398
+ alignItems: "center",
2399
+ gap: 5
2400
+ },
2401
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
2402
+ style: {
2403
+ width: 8,
2404
+ height: 8,
2405
+ borderRadius: 2,
2406
+ background: secondaryColor,
2407
+ flexShrink: 0
2408
+ }
2409
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
2410
+ style: {
2411
+ fontSize: 9.5,
2412
+ color: "#6B7280"
2413
+ },
2414
+ children: "Raised"
2415
+ })]
2416
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
2417
+ style: {
2418
+ display: "flex",
2419
+ alignItems: "baseline",
2420
+ gap: 4
2421
+ },
2422
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
2423
+ style: {
2424
+ fontSize: 9.5,
2425
+ fontWeight: 700,
2426
+ color: "#111827"
2427
+ },
2428
+ children: d$(raised)
2429
+ }), /*#__PURE__*/jsxRuntime.jsx(TrendText, {
2430
+ style: {
2431
+ fontSize: 9
2432
+ },
2433
+ children: formatArrowTrend(raisedGrowth)
2434
+ })]
2435
+ })]
2436
+ })]
2437
+ })]
2438
+ })
2439
+ });
2440
+ };
2441
+ var KpiCard = function KpiCard(_ref10) {
2442
+ var title = _ref10.title,
2443
+ value = _ref10.value,
2444
+ trend = _ref10.trend,
2445
+ detail = _ref10.detail,
2446
+ _ref10$variant = _ref10.variant,
2447
+ variant = _ref10$variant === void 0 ? "secondary" : _ref10$variant,
2448
+ _ref10$trendPositiveW = _ref10.trendPositiveWhenNegative,
2449
+ trendPositiveWhenNegative = _ref10$trendPositiveW === void 0 ? false : _ref10$trendPositiveW;
2315
2450
  var displayTrend = withTrendArrow(trend);
2316
2451
  var isPrimary = variant === "primary";
2317
2452
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -2362,46 +2497,6 @@ var KpiCard = function KpiCard(_ref1) {
2362
2497
  })]
2363
2498
  });
2364
2499
  };
2365
- var StatPair = function StatPair(_ref10) {
2366
- var label = _ref10.label,
2367
- val = _ref10.val,
2368
- trend = _ref10.trend;
2369
- var displayTrend = withTrendArrow(trend);
2370
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
2371
- style: {
2372
- marginBottom: 6
2373
- },
2374
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
2375
- style: {
2376
- fontSize: 8.5,
2377
- color: THEME.muted,
2378
- marginBottom: 1
2379
- },
2380
- children: label
2381
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
2382
- style: {
2383
- display: "flex",
2384
- alignItems: "baseline",
2385
- gap: 4
2386
- },
2387
- children: [/*#__PURE__*/jsxRuntime.jsx("span", {
2388
- style: {
2389
- fontSize: 13,
2390
- fontWeight: 700,
2391
- color: "#111827"
2392
- },
2393
- children: val
2394
- }), trend && /*#__PURE__*/jsxRuntime.jsx("span", {
2395
- style: {
2396
- fontSize: 9.5,
2397
- fontWeight: 600,
2398
- color: resolveTrendColor(displayTrend)
2399
- },
2400
- children: displayTrend
2401
- })]
2402
- })]
2403
- });
2404
- };
2405
2500
  var PageHeader = function PageHeader(_ref11) {
2406
2501
  var dateLabel = _ref11.dateLabel,
2407
2502
  generatedLabel = _ref11.generatedLabel,
@@ -2536,7 +2631,7 @@ var PageFooter = function PageFooter(_ref12) {
2536
2631
 
2537
2632
  // ─── Main component ───────────────────────────────────────────────────────────
2538
2633
  var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
2539
- 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;
2634
+ 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, _refundsRaw$refundRat2, _ob$growthPercentage, _ob$peakDay, _up$acceptanceGrowth, _up$raisedGrowth, _dn$acceptanceGrowth, _dn$raisedGrowth, _refCard$growthPercen;
2540
2635
  var _ref13$apiData = _ref13.apiData,
2541
2636
  apiData = _ref13$apiData === void 0 ? {} : _ref13$apiData,
2542
2637
  _ref13$dateName = _ref13.dateName,
@@ -2943,8 +3038,8 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
2943
3038
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
2944
3039
  style: {
2945
3040
  display: "flex",
2946
- alignItems: "center",
2947
- gap: 10
3041
+ flexDirection: "column",
3042
+ alignItems: "center"
2948
3043
  },
2949
3044
  children: [/*#__PURE__*/jsxRuntime.jsx(Donut, {
2950
3045
  segments: [{
@@ -2954,82 +3049,114 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
2954
3049
  value: returningDonors,
2955
3050
  color: C.emerald
2956
3051
  }],
2957
- size: 82,
3052
+ size: 88,
2958
3053
  centerVal: "".concat(formatNumber(totalMix)),
2959
3054
  centerLabel: "donors"
2960
3055
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
2961
3056
  style: {
2962
- flex: 1
3057
+ width: "100%",
3058
+ marginTop: 6
2963
3059
  },
2964
3060
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
2965
3061
  style: {
2966
3062
  display: "flex",
3063
+ justifyContent: "space-between",
2967
3064
  alignItems: "center",
2968
- gap: 6,
2969
3065
  marginBottom: 5
2970
3066
  },
2971
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
3067
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
2972
3068
  style: {
2973
- width: 8,
2974
- height: 8,
2975
- borderRadius: "50%",
2976
- background: C.indigo,
2977
- flexShrink: 0
2978
- }
3069
+ display: "flex",
3070
+ alignItems: "center",
3071
+ gap: 5
3072
+ },
3073
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
3074
+ style: {
3075
+ width: 8,
3076
+ height: 8,
3077
+ borderRadius: 2,
3078
+ background: C.indigo,
3079
+ flexShrink: 0
3080
+ }
3081
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
3082
+ style: {
3083
+ fontSize: 9.5,
3084
+ color: "#6B7280"
3085
+ },
3086
+ children: "New donors"
3087
+ })]
2979
3088
  }), /*#__PURE__*/jsxRuntime.jsxs("span", {
2980
3089
  style: {
2981
3090
  fontSize: 9.5,
2982
- color: "#374151"
3091
+ fontWeight: 700,
3092
+ color: "#111827"
2983
3093
  },
2984
- children: ["New donors ", formatNumber(newDonors), " \xB7 ", newPct, "%"]
3094
+ children: [formatNumber(newDonors), " \xB7 ", newPct, "%"]
2985
3095
  })]
2986
3096
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
2987
3097
  style: {
2988
3098
  display: "flex",
3099
+ justifyContent: "space-between",
2989
3100
  alignItems: "center",
2990
- gap: 6,
2991
- marginBottom: 7
3101
+ marginBottom: 8
2992
3102
  },
2993
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
3103
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
2994
3104
  style: {
2995
- width: 8,
2996
- height: 8,
2997
- borderRadius: "50%",
2998
- background: C.emerald,
2999
- flexShrink: 0
3000
- }
3105
+ display: "flex",
3106
+ alignItems: "center",
3107
+ gap: 5
3108
+ },
3109
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
3110
+ style: {
3111
+ width: 8,
3112
+ height: 8,
3113
+ borderRadius: 2,
3114
+ background: C.emerald,
3115
+ flexShrink: 0
3116
+ }
3117
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
3118
+ style: {
3119
+ fontSize: 9.5,
3120
+ color: "#6B7280"
3121
+ },
3122
+ children: "Returning"
3123
+ })]
3001
3124
  }), /*#__PURE__*/jsxRuntime.jsxs("span", {
3002
3125
  style: {
3003
3126
  fontSize: 9.5,
3004
- color: "#374151"
3127
+ fontWeight: 700,
3128
+ color: "#111827"
3005
3129
  },
3006
- children: ["Returning ", formatNumber(returningDonors), " \xB7 ", retPct, "%"]
3130
+ children: [formatNumber(returningDonors), " \xB7 ", retPct, "%"]
3007
3131
  })]
3008
3132
  }), /*#__PURE__*/jsxRuntime.jsx(Divider, {
3009
3133
  mb: 6
3010
3134
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
3011
3135
  style: {
3012
- fontSize: 14,
3013
- fontWeight: 800,
3014
- color: "#111827"
3136
+ fontSize: 9.5,
3137
+ color: "#9CA3AF",
3138
+ marginBottom: 2
3015
3139
  },
3016
- children: kpi$(mixAvgGift)
3140
+ children: "Avg gift"
3017
3141
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
3018
3142
  style: {
3019
- fontSize: 8.5,
3020
- color: "#9CA3AF"
3143
+ fontSize: 14,
3144
+ fontWeight: 800,
3145
+ color: "#111827",
3146
+ marginBottom: 2
3021
3147
  },
3022
- children: "Avg gift"
3148
+ children: d$(mixAvgGift)
3023
3149
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
3024
3150
  style: {
3025
- fontSize: 9,
3026
- marginTop: 1
3151
+ fontSize: 9
3027
3152
  },
3028
3153
  children: /*#__PURE__*/jsxRuntime.jsx(TrendText, {
3029
3154
  style: {
3030
3155
  fontSize: 9
3031
3156
  },
3032
- children: "".concat(Number((_ref16 = donorMixPrev !== null && donorMixPrev !== void 0 ? donorMixPrev : growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) !== null && _ref16 !== void 0 ? _ref16 : 0).toFixed(2), "% vs pp")
3157
+ children: formatArrowTrend(donorMixPrev, {
3158
+ label: "vs last month"
3159
+ })
3033
3160
  })
3034
3161
  })]
3035
3162
  })]
@@ -3200,10 +3327,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
3200
3327
  display: "flex",
3201
3328
  gap: 12
3202
3329
  },
3203
- 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) {
3204
- var _ref18 = _slicedToArray(_ref17, 2),
3205
- l = _ref18[0],
3206
- v = _ref18[1];
3330
+ 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) {
3331
+ var _ref17 = _slicedToArray(_ref16, 2),
3332
+ l = _ref17[0],
3333
+ v = _ref17[1];
3207
3334
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
3208
3335
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
3209
3336
  style: {
@@ -3223,76 +3350,22 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
3223
3350
  }, l);
3224
3351
  })
3225
3352
  })]
3226
- }), /*#__PURE__*/jsxRuntime.jsx(Panel, {
3353
+ }), /*#__PURE__*/jsxRuntime.jsx(AcceptanceRaisedPanel, {
3227
3354
  title: "Upsell",
3228
3355
  subtitle: "Acceptance & raised",
3229
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
3230
- style: {
3231
- display: "flex",
3232
- alignItems: "center",
3233
- gap: 12
3234
- },
3235
- children: [/*#__PURE__*/jsxRuntime.jsx(Donut, {
3236
- segments: [{
3237
- value: (up === null || up === void 0 ? void 0 : up.acceptanceRate) || 0,
3238
- color: C.indigo
3239
- }, {
3240
- value: Math.max(0, 100 - ((up === null || up === void 0 ? void 0 : up.acceptanceRate) || 0)),
3241
- color: "#E5E7EB"
3242
- }],
3243
- size: 76,
3244
- centerVal: "".concat(formatNumber((up === null || up === void 0 ? void 0 : up.acceptanceRate) || 0), "%"),
3245
- centerLabel: "accepted"
3246
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
3247
- style: {
3248
- flex: 1
3249
- },
3250
- children: [/*#__PURE__*/jsxRuntime.jsx(StatPair, {
3251
- label: "Acceptance",
3252
- val: pct((up === null || up === void 0 ? void 0 : up.acceptanceRate) || 0, 1),
3253
- trend: formatArrowTrend(up === null || up === void 0 ? void 0 : up.acceptanceGrowth)
3254
- }), /*#__PURE__*/jsxRuntime.jsx(StatPair, {
3255
- label: "Raised",
3256
- val: d$((up === null || up === void 0 ? void 0 : up.raised) || 0),
3257
- trend: formatArrowTrend(up === null || up === void 0 ? void 0 : up.raisedGrowth)
3258
- })]
3259
- })]
3260
- })
3261
- }), /*#__PURE__*/jsxRuntime.jsx(Panel, {
3356
+ acceptanceRate: (up === null || up === void 0 ? void 0 : up.acceptanceRate) || 0,
3357
+ acceptanceGrowth: (_up$acceptanceGrowth = up === null || up === void 0 ? void 0 : up.acceptanceGrowth) !== null && _up$acceptanceGrowth !== void 0 ? _up$acceptanceGrowth : 0,
3358
+ raised: (up === null || up === void 0 ? void 0 : up.raised) || 0,
3359
+ raisedGrowth: (_up$raisedGrowth = up === null || up === void 0 ? void 0 : up.raisedGrowth) !== null && _up$raisedGrowth !== void 0 ? _up$raisedGrowth : 0,
3360
+ primaryColor: C.indigo
3361
+ }), /*#__PURE__*/jsxRuntime.jsx(AcceptanceRaisedPanel, {
3262
3362
  title: "Downsell",
3263
3363
  subtitle: "Acceptance & raised",
3264
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
3265
- style: {
3266
- display: "flex",
3267
- alignItems: "center",
3268
- gap: 12
3269
- },
3270
- children: [/*#__PURE__*/jsxRuntime.jsx(Donut, {
3271
- segments: [{
3272
- value: (dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) || 0,
3273
- color: C.cyan
3274
- }, {
3275
- value: Math.max(0, 100 - ((dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) || 0)),
3276
- color: "#E5E7EB"
3277
- }],
3278
- size: 76,
3279
- centerVal: "".concat(formatNumber((dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) || 0), "%"),
3280
- centerLabel: "accepted"
3281
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
3282
- style: {
3283
- flex: 1
3284
- },
3285
- children: [/*#__PURE__*/jsxRuntime.jsx(StatPair, {
3286
- label: "Acceptance",
3287
- val: pct((dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) || 0, 1),
3288
- trend: formatArrowTrend(dn === null || dn === void 0 ? void 0 : dn.acceptanceGrowth)
3289
- }), /*#__PURE__*/jsxRuntime.jsx(StatPair, {
3290
- label: "Raised",
3291
- val: d$((dn === null || dn === void 0 ? void 0 : dn.raised) || 0),
3292
- trend: formatArrowTrend(dn === null || dn === void 0 ? void 0 : dn.raisedGrowth)
3293
- })]
3294
- })]
3295
- })
3364
+ acceptanceRate: (dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) || 0,
3365
+ acceptanceGrowth: (_dn$acceptanceGrowth = dn === null || dn === void 0 ? void 0 : dn.acceptanceGrowth) !== null && _dn$acceptanceGrowth !== void 0 ? _dn$acceptanceGrowth : 0,
3366
+ raised: (dn === null || dn === void 0 ? void 0 : dn.raised) || 0,
3367
+ raisedGrowth: (_dn$raisedGrowth = dn === null || dn === void 0 ? void 0 : dn.raisedGrowth) !== null && _dn$raisedGrowth !== void 0 ? _dn$raisedGrowth : 0,
3368
+ primaryColor: C.cyan
3296
3369
  }), /*#__PURE__*/jsxRuntime.jsxs(Panel, {
3297
3370
  title: "Referrals",
3298
3371
  subtitle: "Revenue trend \xB7 last ".concat(daysLabel),
@@ -3330,10 +3403,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
3330
3403
  display: "flex",
3331
3404
  gap: 12
3332
3405
  },
3333
- 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) {
3334
- var _ref20 = _slicedToArray(_ref19, 2),
3335
- l = _ref20[0],
3336
- v = _ref20[1];
3406
+ 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) {
3407
+ var _ref19 = _slicedToArray(_ref18, 2),
3408
+ l = _ref19[0],
3409
+ v = _ref19[1];
3337
3410
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
3338
3411
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
3339
3412
  style: {