@mx-cartographer/experiences 6.24.15-alpha.al1 → 6.24.15-alpha.al3

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
@@ -20358,32 +20358,37 @@ const ef = (e) => e.reduce((a, i) => {
20358
20358
  }, nf = (e, n) => {
20359
20359
  const a = typeof e == "string" ? parseFloat(e.replace(/[^0-9.-]+/g, "")) : e, i = typeof n == "string" ? parseFloat(n.replace(/[^0-9.-]+/g, "")) : n;
20360
20360
  return (a || 0) - (i || 0);
20361
- }, af = (e) => e.reduce((n, a) => {
20362
- const i = a.top_level_category_guid, o = a.category_guid;
20363
- return i && (n[i] || (n[i] = { monthlyTotals: [], transactions: [], transactionCount: 0 }), n[i].transactions.push(a), o === i && n[i].transactionCount++), o && o !== i && (n[o] || (n[o] = { monthlyTotals: [], transactions: [], transactionCount: 0 }), n[o].transactions.push(a), n[o].transactionCount++), n;
20364
- }, {}), tl = (e) => e.reduce((n, a) => n + a.total, 0), of = (e, n, a) => ({
20361
+ }, af = (e) => {
20362
+ const n = e.reduce((a, i) => {
20363
+ const o = i.top_level_category_guid, r = i.category_guid;
20364
+ return o && (a[o] || (a[o] = { monthlyTotals: [], transactions: [], transactionCount: 0 }), a[o].transactions.push(i)), r && r !== o && (a[r] || (a[r] = { monthlyTotals: [], transactions: [], transactionCount: 0 }), a[r].transactions.push(i)), a;
20365
+ }, {});
20366
+ return Object.values(n).forEach((a) => {
20367
+ a.transactionCount = a.transactions.length;
20368
+ }), n;
20369
+ }, tl = (e) => e.reduce((n, a) => n + Math.abs(a.total), 0), of = (e, n, a) => ({
20365
20370
  guid: e,
20366
20371
  name: Fo(e),
20367
20372
  amount: tl(n),
20368
20373
  monthlyTotals: n,
20369
20374
  transactions: a,
20370
20375
  transactionCount: a.length
20371
- }), rf = (e, n, a, i, o) => {
20372
- const r = tl(a), { subcategoryAmount: s, subcategoryTransactionCount: c } = n.reduce(
20373
- (d, _) => ({
20374
- subcategoryAmount: d.subcategoryAmount + _.amount,
20375
- subcategoryTransactionCount: d.subcategoryTransactionCount + (_.transactionCount || 0)
20376
+ }), rf = (e, n, a, i) => {
20377
+ const o = tl(a), { subcategoryAmount: r, subcategoryTransactionCount: s } = n.reduce(
20378
+ (c, d) => ({
20379
+ subcategoryAmount: c.subcategoryAmount + Math.abs(d.amount),
20380
+ subcategoryTransactionCount: c.subcategoryTransactionCount + (d.transactionCount || 0)
20376
20381
  }),
20377
20382
  { subcategoryAmount: 0, subcategoryTransactionCount: 0 }
20378
20383
  );
20379
20384
  return {
20380
20385
  guid: e,
20381
20386
  name: Fo(e),
20382
- amount: r + s,
20387
+ amount: o + r,
20383
20388
  subcategories: n,
20384
20389
  monthlyTotals: a,
20385
20390
  transactions: i,
20386
- transactionCount: o + c
20391
+ transactionCount: i.length + s
20387
20392
  };
20388
20393
  }, sf = (e, n) => {
20389
20394
  const a = af(n), i = {}, o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
@@ -20403,8 +20408,7 @@ const ef = (e) => e.reduce((a, i) => {
20403
20408
  d,
20404
20409
  m,
20405
20410
  _.monthlyTotals,
20406
- u.transactions,
20407
- u.transactionCount
20411
+ u.transactions
20408
20412
  );
20409
20413
  });
20410
20414
  }, nl = ({ selectedTab: e, onTabChange: n }) => /* @__PURE__ */ t(