@mx-cartographer/experiences 7.3.2 → 7.4.0

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.
Files changed (131) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{Account-YwUMFz93.mjs → Account-01wOyrH1.mjs} +1 -1
  3. package/dist/{AccountDetailsContent-BgCST7mK.mjs → AccountDetailsContent-gke-5zMF.mjs} +10 -10
  4. package/dist/{AccountDetailsHeader-jAFWoHj7.mjs → AccountDetailsHeader-CRzfuFA2.mjs} +7 -7
  5. package/dist/{AccountFields-DPxMPBF0.mjs → AccountFields-CPkGZ3SD.mjs} +5 -5
  6. package/dist/{AccountListItem-D6rWAreC.mjs → AccountListItem-D4uG9yC-.mjs} +4 -4
  7. package/dist/{AccountStore-B5E98oM1.mjs → AccountStore-C1zMBzHq.mjs} +40 -29
  8. package/dist/{Accounts-UIlYCmHb.mjs → Accounts-D7QljYas.mjs} +1 -1
  9. package/dist/{BudgetUtil-CXvenbdN.mjs → BudgetUtil-wjoNuj7B.mjs} +1 -1
  10. package/dist/{CategorySelectorDrawer-Buy70Y3V.mjs → CategorySelectorDrawer-DqJK_rrL.mjs} +3 -3
  11. package/dist/{CategoryStore-BEdFs69_.mjs → CategoryStore-U7hOZAbP.mjs} +1 -1
  12. package/dist/{CategoryUtil-BR3H5i6n.mjs → CategoryUtil-DUM8NuGO.mjs} +1 -1
  13. package/dist/{ConnectDrawer-CbxHKlRv.mjs → ConnectDrawer-CuUj16NH.mjs} +2 -2
  14. package/dist/{ConnectionsDrawer-C6kanU7I.mjs → ConnectionsDrawer-Bz4uwdFE.mjs} +3 -3
  15. package/dist/{CurrencyInput-lSC7oPDg.mjs → CurrencyInput-xH-hqry9.mjs} +1 -1
  16. package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CBdcsyuk.mjs} +3 -3
  17. package/dist/{DebtsStore-DgIcphe_.mjs → DebtsStore-Bu8rRRSL.mjs} +1 -1
  18. package/dist/{Dialog-CWW597AF.mjs → Dialog-BPTr3qHE.mjs} +2 -2
  19. package/dist/Drawer-BEtCk82g.mjs +163 -0
  20. package/dist/{EmptyState-DA_lfRBv.mjs → EmptyState-DoxNUae-.mjs} +24 -22
  21. package/dist/{ExportCsvAction-DNSgmdyv.mjs → ExportCsvAction-DzTrtPzk.mjs} +3 -3
  22. package/dist/FinstrongStore-CfD6bbJk.mjs +441 -0
  23. package/dist/{GoalStore-CAlmSu4U.mjs → GoalStore-j6QYHgEa.mjs} +3 -3
  24. package/dist/{Help-hi9I9EYP.mjs → Help-BnPXM_N2.mjs} +2 -2
  25. package/dist/LineChart-DttMO7uS.mjs +581 -0
  26. package/dist/{ListItemAction-BmL5buOf.mjs → ListItemAction-uobBrm_a.mjs} +10 -10
  27. package/dist/{ManageIncome-Cypo9qY4.mjs → ManageIncome-CU5C0AeO.mjs} +97 -95
  28. package/dist/{MicroWidgetContainer-CFdMGJKg.mjs → MicroWidgetContainer-DEiRnYVa.mjs} +1 -1
  29. package/dist/{MiniWidgetContainer-BdgBvpga.mjs → MiniWidgetContainer-CmXpTylX.mjs} +1 -1
  30. package/dist/{NetWorthStore-CxqIxAgN.mjs → NetWorthStore-CpL_kqvx.mjs} +2 -2
  31. package/dist/{NotificationSettings-DxytNHlN.mjs → NotificationSettings-DI5B1spM.mjs} +5 -5
  32. package/dist/{OriginalBalanceAction-V6FEoIDe.mjs → OriginalBalanceAction-CCmnsd7y.mjs} +3 -3
  33. package/dist/{RecurringSettings-iIupYxJW.mjs → RecurringSettings-Cm5Bqcai.mjs} +4 -4
  34. package/dist/{RecurringTransactions-ej39mgA6.mjs → RecurringTransactions-CngsRZ3K.mjs} +45 -44
  35. package/dist/{RecurringTransactionsStore-BiwCzScZ.mjs → RecurringTransactionsStore-Bc1wCiNB.mjs} +1 -1
  36. package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-BuJ03S9d.mjs} +16 -16
  37. package/dist/SpendingLegend-B2BYr8B4.mjs +193 -0
  38. package/dist/{TransactionDetails-BUoNbsu-.mjs → TransactionDetails-CtbBBSoU.mjs} +396 -386
  39. package/dist/{TransactionStore-CtGTg0XS.mjs → TransactionStore-Dz-G8Wd0.mjs} +3 -3
  40. package/dist/{TrendsStore-5PvDT_o6.mjs → TrendsStore-BW9FGQeE.mjs} +1 -1
  41. package/dist/{User-Bj34_i8g.mjs → User-wXzDI4M8.mjs} +2 -2
  42. package/dist/{WidgetContainer-BnTgAfQn.mjs → WidgetContainer-6dsjtOVg.mjs} +4 -4
  43. package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
  44. package/dist/accounts/index.es.js +17 -17
  45. package/dist/accounts/stores/AccountStore.d.ts +2 -0
  46. package/dist/analytics/index.es.js +2 -2
  47. package/dist/budgets/index.es.js +13 -13
  48. package/dist/cashflow/index.es.js +49 -49
  49. package/dist/categories/index.es.js +2 -2
  50. package/dist/common/components/Select.d.ts +4 -2
  51. package/dist/common/components/charts/LineChart.d.ts +12 -2
  52. package/dist/common/components/charts/linechart/CustomLegend.d.ts +3 -1
  53. package/dist/common/components/charts/linechart/CustomMark.d.ts +4 -0
  54. package/dist/common/components/drawer/Drawer.d.ts +3 -0
  55. package/dist/common/components/drawer/Footer.d.ts +17 -0
  56. package/dist/common/index.es.js +33 -33
  57. package/dist/common/types/Finstrong.d.ts +54 -0
  58. package/dist/common/types/Widgets.d.ts +1 -0
  59. package/dist/common/types/index.d.ts +1 -1
  60. package/dist/common/types/localization/FinstrongCopy.d.ts +105 -2
  61. package/dist/common/types/localization/GoalsCopy.d.ts +1 -0
  62. package/dist/dashboard/index.es.js +2 -2
  63. package/dist/debts/index.es.js +11 -11
  64. package/dist/{exportTransactionsToCSV-C4PkIYP6.mjs → exportTransactionsToCSV-Cz2t0lmA.mjs} +2 -2
  65. package/dist/finstrong/FinstrongWidget.d.ts +1 -1
  66. package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
  67. package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
  68. package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
  69. package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
  70. package/dist/finstrong/components/FinancialStrengthGraph.d.ts +7 -1
  71. package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
  72. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
  73. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
  74. package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
  75. package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
  76. package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
  77. package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
  78. package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
  79. package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
  80. package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
  81. package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
  82. package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
  83. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
  84. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
  85. package/dist/finstrong/components/ProgressBar.d.ts +15 -0
  86. package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
  87. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
  88. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
  89. package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
  90. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
  91. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
  92. package/dist/finstrong/components/StatusChip.d.ts +5 -0
  93. package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
  94. package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +17 -0
  95. package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
  96. package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
  97. package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
  98. package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
  99. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
  100. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
  101. package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
  102. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +25 -0
  103. package/dist/finstrong/components/shared/DialScoreCard.d.ts +7 -1
  104. package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
  105. package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
  106. package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
  107. package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
  108. package/dist/finstrong/constants/index.d.ts +20 -0
  109. package/dist/finstrong/index.es.js +3174 -1069
  110. package/dist/finstrong/stores/FinstrongStore.d.ts +21 -2
  111. package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
  112. package/dist/goals/index.es.js +15 -15
  113. package/dist/help/index.es.js +3 -3
  114. package/dist/{hooks-Cy8JnjCg.mjs → hooks-C41HAxM5.mjs} +4 -4
  115. package/dist/investments/index.es.js +5 -5
  116. package/dist/merchants/index.es.js +1 -1
  117. package/dist/networth/index.es.js +33 -33
  118. package/dist/notifications/index.es.js +4 -4
  119. package/dist/recurringtransactions/index.es.js +43 -43
  120. package/dist/settings/index.es.js +8 -8
  121. package/dist/spending/index.es.js +261 -436
  122. package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
  123. package/dist/transactions/index.es.js +15 -15
  124. package/dist/trends/index.es.js +16 -16
  125. package/dist/{useAccountDisplayName-D6sQsNNQ.mjs → useAccountDisplayName-CMMlIOXF.mjs} +2 -2
  126. package/dist/{useInsightsEnabled-BxytCjq5.mjs → useInsightsEnabled-CNjP5cfR.mjs} +1 -1
  127. package/package.json +1 -1
  128. package/dist/Drawer-kEE73B87.mjs +0 -113
  129. package/dist/FinstrongStore-CL7t5lBL.mjs +0 -101
  130. package/dist/LineChart-eK4IQImU.mjs +0 -541
  131. package/dist/finstrong/utils/Finstrong.d.ts +0 -6
@@ -17,7 +17,7 @@ import { formatISO as H } from "date-fns/formatISO";
17
17
  import { fromUnixTime as V } from "date-fns/fromUnixTime";
18
18
  import { getUnixTime as y } from "date-fns/getUnixTime";
19
19
  import { isAfter as h } from "date-fns/isAfter";
20
- import { isBefore as i } from "date-fns/isBefore";
20
+ import { isBefore as u } from "date-fns/isBefore";
21
21
  import { isSameDay as X } from "date-fns/isSameDay";
22
22
  import { nextDay as E } from "date-fns/nextDay";
23
23
  import { parseISO as J } from "date-fns/parseISO";
@@ -29,9 +29,9 @@ import { subQuarters as N } from "date-fns/subQuarters";
29
29
  import { subYears as T } from "date-fns/subYears";
30
30
  import { lastDayOfMonth as q } from "date-fns/lastDayOfMonth";
31
31
  import { setDayOfYear as F } from "date-fns/setDayOfYear";
32
- import { g as R, a as ee, b as te, c as re, d as oe, e as ae, f as ne } from "./DateUtil-BcuH7ErC.mjs";
32
+ import { g as R, a as ee, b as te, c as re, d as oe, e as ae, f as ne } from "./DateUtil-CBdcsyuk.mjs";
33
33
  import { b as W } from "./NumberFormatting-Buh7u8Oi.mjs";
34
- import { f as v, D as k } from "./Dialog-CWW597AF.mjs";
34
+ import { f as v, a as k } from "./Dialog-BPTr3qHE.mjs";
35
35
  import { b as l } from "./Localization-2MODESHW.mjs";
36
36
  var s = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.EveryWeek = 1] = "EveryWeek", e[e.EveryOtherWeek = 2] = "EveryOtherWeek", e[e.EveryMonth = 3] = "EveryMonth", e[e.EveryOtherMonth = 4] = "EveryOtherMonth", e[e.EveryQuarter = 5] = "EveryQuarter", e[e.EveryOtherQuarter = 6] = "EveryOtherQuarter", e[e.EveryYear = 7] = "EveryYear", e[e.TwiceAMonth = 8] = "TwiceAMonth", e))(s || {}), p = /* @__PURE__ */ ((e) => (e[e.Paid = 0] = "Paid", e[e.Missed = 1] = "Missed", e[e.Upcoming = 2] = "Upcoming", e))(p || {}), O = /* @__PURE__ */ ((e) => (e[e.Expense = 0] = "Expense", e[e.Income = 1] = "Income", e))(O || {}), Y = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Subscription = 1] = "Subscription", e[e.Bill = 2] = "Bill", e[e.Income = 3] = "Income", e[e.Transfer = 4] = "Transfer", e))(Y || {});
37
37
  const se = ({ iconName: e, label: a, onClick: t, value: n }) => {
@@ -51,22 +51,23 @@ const se = ({ iconName: e, label: a, onClick: t, value: n }) => {
51
51
  o,
52
52
  /* @__PURE__ */ d(C, { children: /* @__PURE__ */ d(I, { name: "chevron_right", size: 24 }) })
53
53
  ] }) }) : /* @__PURE__ */ d(w, { disableGutters: !1, disablePadding: !1, children: o });
54
- }, Fe = se, Re = ({ label: e, onChange: a, options: t, value: n }) => /* @__PURE__ */ d(
54
+ }, Fe = se, Re = ({ label: e, onChange: a, options: t, value: n, ...o }) => /* @__PURE__ */ d(
55
55
  j,
56
56
  {
57
57
  InputLabelProps: { shrink: !0 },
58
58
  SelectProps: {
59
- IconComponent: (r) => /* @__PURE__ */ d(z, { size: 20, sx: { mr: 4 }, ...r })
59
+ IconComponent: (c) => /* @__PURE__ */ d(z, { size: 20, sx: { mr: 4 }, ...c })
60
60
  },
61
61
  defaultValue: 0,
62
62
  label: e,
63
- onChange: (r) => {
64
- a(Number(r.target.value));
63
+ onChange: (c) => {
64
+ a(Number(c.target.value));
65
65
  },
66
66
  select: !0,
67
67
  value: n,
68
68
  variant: "outlined",
69
- children: t.map((r) => /* @__PURE__ */ d($, { value: r.id, children: r.label }, r.id))
69
+ ...o,
70
+ children: t.map((c) => /* @__PURE__ */ d($, { value: c.id, children: c.label }, c.id))
70
71
  }
71
72
  ), ce = (e) => {
72
73
  if (!e) return "";
@@ -93,93 +94,93 @@ const se = ({ iconName: e, label: a, onClick: t, value: n }) => {
93
94
  status: p.Upcoming,
94
95
  type: e.repeating_transaction_type === Y.Income ? O.Income : O.Expense,
95
96
  transaction: void 0
96
- }, u = a.start, c = a.end;
97
+ }, c = a.start, i = a.end;
97
98
  switch (e.recurrence_type) {
98
99
  case s.EveryWeek:
99
- t.push(...ue(r, u, c));
100
+ t.push(...ue(r, c, i));
100
101
  break;
101
102
  case s.EveryOtherWeek:
102
- t.push(...de(r, u, c));
103
+ t.push(...de(r, c, i));
103
104
  break;
104
105
  case s.TwiceAMonth:
105
- t.push(...me(r, u, c));
106
+ t.push(...me(r, c, i));
106
107
  break;
107
108
  case s.EveryMonth:
108
- t.push(...le(r, u, c));
109
+ t.push(...le(r, c, i));
109
110
  break;
110
111
  case s.EveryOtherMonth:
111
- t.push(...he(r, u, c));
112
+ t.push(...he(r, c, i));
112
113
  break;
113
114
  case s.EveryQuarter:
114
- t.push(...fe(r, u, c));
115
+ t.push(...fe(r, c, i));
115
116
  break;
116
117
  case s.EveryOtherQuarter:
117
- t.push(...pe(r, u, c));
118
+ t.push(...pe(r, c, i));
118
119
  break;
119
120
  case s.EveryYear:
120
- t.push(...ye(r, u, c));
121
+ t.push(...ye(r, c, i));
121
122
  break;
122
123
  }
123
124
  for (const m of t) {
124
125
  const _ = e.transactions.find(
125
126
  (x) => x.repeating_transaction_guid === e.guid && x.date > y(D(m.expectedDate, 5)) && x.date < y(Q(m.expectedDate, 5))
126
127
  );
127
- _ ? (m.transaction = _, m.status = p.Paid, m.occurredOnDate = V(_.date)) : i(m.expectedDate, D(b(), 3)) && (m.status = p.Missed);
128
+ _ ? (m.transaction = _, m.status = p.Paid, m.occurredOnDate = V(_.date)) : u(m.expectedDate, D(b(), 3)) && (m.status = p.Missed);
128
129
  }
129
130
  return t;
130
131
  }, ue = (e, a, t) => {
131
132
  const n = [];
132
133
  let o = E(a, e.recurrenceDay);
133
- for (; i(o, t); )
134
+ for (; u(o, t); )
134
135
  n.push({ ...e, expectedDate: o }), o = E(o, e.recurrenceDay);
135
136
  return n;
136
137
  }, de = (e, a, t) => {
137
138
  const n = [], o = e.expectedDate;
138
- if (i(o, t)) {
139
+ if (u(o, t)) {
139
140
  let r = D(o, 14);
140
141
  for (; h(r, a) || X(r, a); )
141
142
  n.push({ ...e, expectedDate: r }), r = D(r, 14);
142
- for (r = o; h(r, a) && i(r, t); )
143
+ for (r = o; h(r, a) && u(r, t); )
143
144
  n.push({ ...e, expectedDate: r }), r = Q(r, 14);
144
145
  }
145
146
  return n;
146
147
  }, me = (e, a, t) => {
147
148
  const n = [];
148
149
  let o = g(a, e.recurrenceDay);
149
- for (; i(o, t); )
150
+ for (; u(o, t); )
150
151
  n.push({ ...e, expectedDate: o }), o = f(o, 1);
151
152
  let r = e.secondRecurrenceDay && e.secondRecurrenceDay < 28 ? g(a, e.secondRecurrenceDay) : q(a);
152
- for (; i(r, t); )
153
+ for (; u(r, t); )
153
154
  n.push({ ...e, expectedDate: r }), r = f(r, 1);
154
155
  return n;
155
156
  }, le = (e, a, t) => {
156
157
  const n = [];
157
158
  let o = g(a, e.recurrenceDay);
158
- for (n.push({ ...e, expectedDate: o }), o = f(o, 1); i(o, t); )
159
+ for (n.push({ ...e, expectedDate: o }), o = f(o, 1); u(o, t); )
159
160
  n.push({ ...e, expectedDate: o }), o = f(o, 1);
160
161
  return n;
161
162
  }, he = (e, a, t) => {
162
163
  const n = [], o = e.expectedDate;
163
- let r = i(o, t) ? o : Z(o, 2);
164
- for (; i(r, t); )
164
+ let r = u(o, t) ? o : Z(o, 2);
165
+ for (; u(r, t); )
165
166
  h(r, a) && n.push({ ...e, expectedDate: r }), r = f(r, 2);
166
167
  return n;
167
168
  }, fe = (e, a, t) => {
168
169
  const n = [], o = e.expectedDate;
169
- let r = i(o, t) ? o : N(o, 1);
170
- for (; i(r, t); )
170
+ let r = u(o, t) ? o : N(o, 1);
171
+ for (; u(r, t); )
171
172
  h(r, a) && n.push({ ...e, expectedDate: r }), r = A(r, 1);
172
173
  return n;
173
174
  }, pe = (e, a, t) => {
174
175
  const n = [], o = e.expectedDate;
175
- let r = i(o, t) ? o : N(o, 2);
176
- for (; i(r, t); )
176
+ let r = u(o, t) ? o : N(o, 2);
177
+ for (; u(r, t); )
177
178
  h(r, a) && n.push({ ...e, expectedDate: r }), r = A(r, 2);
178
179
  return n;
179
180
  }, ye = (e, a, t) => {
180
181
  const n = [], o = e.expectedDate;
181
- let r = i(o, t) ? o : T(o, 1);
182
- for (; i(r, t); )
182
+ let r = u(o, t) ? o : T(o, 1);
183
+ for (; u(r, t); )
183
184
  h(r, a) && n.push({ ...e, expectedDate: r }), r = K(r, 1);
184
185
  return n;
185
186
  }, et = (e, a) => {
@@ -195,11 +196,11 @@ const se = ({ iconName: e, label: a, onClick: t, value: n }) => {
195
196
  const n = [];
196
197
  for (const o of a) {
197
198
  const r = t.filter(
198
- (u) => u.repeating_transaction_guid === o.guid
199
+ (c) => c.repeating_transaction_guid === o.guid
199
200
  );
200
201
  t.length > 0 && n.push({
201
202
  ...o,
202
- account: e.find((u) => u.guid === o.account_guid),
203
+ account: e.find((c) => c.guid === o.account_guid),
203
204
  transactions: r
204
205
  });
205
206
  }
@@ -214,41 +215,41 @@ const se = ({ iconName: e, label: a, onClick: t, value: n }) => {
214
215
  recurrences: [t]
215
216
  }), a;
216
217
  }, []), ot = (e, a, t) => {
217
- const n = E(b(), a.recurrence_day), o = F(b(), a.recurrence_day), r = W(a.recurrence_day), u = a.second_recurrence_day ? W(a.second_recurrence_day) : "";
218
- let c = t ? l(e.monthly_ordinal, r) : e.monthly;
218
+ const n = E(b(), a.recurrence_day), o = F(b(), a.recurrence_day), r = W(a.recurrence_day), c = a.second_recurrence_day ? W(a.second_recurrence_day) : "";
219
+ let i = t ? l(e.monthly_ordinal, r) : e.monthly;
219
220
  switch (a.recurrence_type) {
220
221
  case s.EveryQuarter:
221
- c = t ? l(e.quarterly_ordinal, r) : e.quarterly;
222
+ i = t ? l(e.quarterly_ordinal, r) : e.quarterly;
222
223
  break;
223
224
  case s.EveryWeek:
224
- c = t ? l(
225
+ i = t ? l(
225
226
  e.weekly_ordinal,
226
227
  v(n, k.DAY_OF_WEEK)
227
228
  ) : e.weekly;
228
229
  break;
229
230
  case s.EveryYear:
230
- c = t ? l(
231
+ i = t ? l(
231
232
  e.anually_ordinal,
232
233
  v(o, k.MONTH_DAY)
233
234
  ) : e.anually;
234
235
  break;
235
236
  case s.EveryOtherWeek:
236
- c = t ? l(
237
+ i = t ? l(
237
238
  e.every_other_week_ordinal,
238
239
  v(n, k.DAY_OF_WEEK)
239
240
  ) : e.every_other_week;
240
241
  break;
241
242
  case s.EveryOtherMonth:
242
- c = t ? l(e.every_other_month_ordinal, r) : e.every_other_month;
243
+ i = t ? l(e.every_other_month_ordinal, r) : e.every_other_month;
243
244
  break;
244
245
  case s.EveryOtherQuarter:
245
- c = t ? l(e.every_other_quarter_ordinal, r) : e.every_other_quarter;
246
+ i = t ? l(e.every_other_quarter_ordinal, r) : e.every_other_quarter;
246
247
  break;
247
248
  case s.TwiceAMonth:
248
- c = t ? l(e.twice_a_month_ordinal, r, u) : e.twice_a_month;
249
+ i = t ? l(e.twice_a_month_ordinal, r, c) : e.twice_a_month;
249
250
  break;
250
251
  }
251
- return c;
252
+ return i;
252
253
  }, at = (e, a) => {
253
254
  let t = a;
254
255
  switch (e) {
@@ -8,7 +8,7 @@ import { startOfMonth as S } from "date-fns/startOfMonth";
8
8
  import { startOfToday as c } from "date-fns/startOfToday";
9
9
  import { subDays as y } from "date-fns/subDays";
10
10
  import { F as x, A as o } from "./Fetch-DecPFeGU.mjs";
11
- import { b as E, a, c as d, d as u } from "./RecurringTransactions-ej39mgA6.mjs";
11
+ import { b as E, a, c as d, d as u } from "./RecurringTransactions-CngsRZ3K.mjs";
12
12
  var A = /* @__PURE__ */ ((r) => (r.Small = "small", r.Medium = "medium", r.Large = "large", r))(A || {});
13
13
  const U = 44;
14
14
  class h {
@@ -4,40 +4,40 @@ import { startOfMonth as _ } from "date-fns/startOfMonth";
4
4
  import { subMonths as y } from "date-fns/subMonths";
5
5
  import { endOfMonth as M } from "date-fns/endOfMonth";
6
6
  import { b as n, P as l } from "./Category-CevNQ03n.mjs";
7
- import { f as m, D as T } from "./Dialog-CWW597AF.mjs";
7
+ import { f as m, a as T } from "./Dialog-BPTr3qHE.mjs";
8
8
  const i = (e) => (e.top_level_category_guid === n.INCOME || e.category_guid === n.INCOME) && !h(e), C = (e) => !i(e) && !f(e), p = (e) => l.includes(e.top_level_category_guid) || l.includes(e.category_guid), f = (e) => e.top_level_category_guid === n.TRANSFER || e.category_guid === n.TRANSFER, h = (e) => e.top_level_category_guid === n.INVESTMENTS || e.category_guid === n.INVESTMENTS, N = (e) => !i(e) && !p(e) && !f(e) && !h(e), w = (e) => e.filter((r) => r.category_guid === r.top_level_category_guid), F = (e, r) => {
9
9
  if (r === 0) return 0;
10
- const o = (e - r) / r;
11
- return isNaN(o) ? 0 : o;
10
+ const a = (e - r) / r;
11
+ return isNaN(a) ? 0 : a;
12
12
  }, g = (e, r) => {
13
- const o = [];
13
+ const a = [];
14
14
  let t = _(r?.start ?? y(/* @__PURE__ */ new Date(), 5));
15
15
  const s = r?.end ?? /* @__PURE__ */ new Date();
16
16
  for (; d(t, s); )
17
- o.push({
17
+ a.push({
18
18
  x: m(t, T.MONTH_SHORT),
19
- y: e.filter((a) => a.year === t.getFullYear() && a.month === t.getMonth() + 1).reduce((a, c) => a + c.total, 0)
19
+ y: e.filter((o) => o.year === t.getFullYear() && o.month === t.getMonth() + 1).reduce((o, c) => o + c.total, 0)
20
20
  }), t = u(t, 1);
21
- return o;
21
+ return a;
22
22
  }, b = (e, r) => {
23
- const o = e.filter(i);
24
- return g(o, r).map((t) => ({ ...t, y: Math.abs(t.y) }));
23
+ const a = e.filter(i);
24
+ return g(a, r).map((t) => ({ ...t, y: Math.abs(t.y) }));
25
25
  }, A = (e, r) => {
26
- const o = e.filter(p);
27
- return g(o, r).map((t) => ({ ...t, y: Math.abs(t.y) }));
26
+ const a = e.filter(p);
27
+ return g(a, r).map((t) => ({ ...t, y: Math.abs(t.y) }));
28
28
  }, x = (e, r) => {
29
- const o = e.filter(N);
30
- return g(o, r);
29
+ const a = e.filter(N);
30
+ return g(a, r);
31
31
  }, H = (e) => {
32
- const r = [], o = e.filter(
33
- (a) => a.top_level_category_guid !== n.INCOME && a.top_level_category_guid !== n.TRANSFER && a.total > 0
32
+ const r = [], a = e.filter(
33
+ (o) => o.top_level_category_guid !== n.INCOME && o.top_level_category_guid !== n.TRANSFER && o.total > 0
34
34
  );
35
35
  let t = _(y(/* @__PURE__ */ new Date(), 5));
36
36
  const s = M(/* @__PURE__ */ new Date());
37
37
  for (; d(t, s); )
38
38
  r.push({
39
39
  x: m(t, T.MONTH_SHORT),
40
- y: o.filter((a) => a.year === t.getFullYear() && a.month === t.getMonth() + 1).reduce((a, c) => a + c.total, 0)
40
+ y: a.filter((o) => o.year === t.getFullYear() && o.month === t.getMonth() + 1).reduce((o, c) => o + c.total, 0)
41
41
  }), t = u(t, 1);
42
42
  return r;
43
43
  };
@@ -0,0 +1,193 @@
1
+ import { b as _ } from "./CategoryUtil-DUM8NuGO.mjs";
2
+ import { b as p } from "./Category-CevNQ03n.mjs";
3
+ import { jsxs as y, Fragment as v, jsx as c } from "react/jsx-runtime";
4
+ import x from "react";
5
+ import { observer as w } from "mobx-react-lite";
6
+ import f from "@mui/material/Stack";
7
+ import { CategoryIcon as M, CategoryIconVariants as N, Text as h } from "@mxenabled/mxui";
8
+ import { u as k } from "./TransactionDetails-CtbBBSoU.mjs";
9
+ import A from "@mui/material/Button";
10
+ import { useTheme as G } from "@mui/material";
11
+ import { D as O } from "./Donut-oaQFlbit.mjs";
12
+ import { u as $ } from "./hooks-C41HAxM5.mjs";
13
+ import { u as j } from "./useScreenSize-B6JyS_Lj.mjs";
14
+ import { f as D } from "./NumberFormatting-Buh7u8Oi.mjs";
15
+ import R from "@mui/material/Box";
16
+ const T = 5, B = (i, l, g, d) => d.reduce((o, n) => {
17
+ const a = i.find((s) => s.guid === n.category_guid);
18
+ if (!a) return o;
19
+ const t = a.parent_guid ?? a.guid, r = i.find((s) => s.guid === t);
20
+ if (!r) return o;
21
+ const m = {
22
+ guid: a.guid,
23
+ name: a.guid === t ? `${l.parent_category_totals_label_general} ${a.name}` : a.name,
24
+ color: _(r.guid, g),
25
+ amount: n.total
26
+ }, e = o.find((s) => s.guid === t);
27
+ return e ? (e.amount += n.total, e.categoryTotals?.push(m)) : o.push({
28
+ guid: t,
29
+ name: r.name,
30
+ color: _(r.guid, g),
31
+ categoryTotals: [m],
32
+ amount: n.total
33
+ }), o;
34
+ }, []), ot = (i, l, g, d) => {
35
+ const o = B(i, l, g, d), n = o.filter(
36
+ (e) => e.guid !== p.INCOME && e.guid !== p.INVESTMENTS && e.guid !== p.TRANSFER
37
+ ).sort((e, s) => s.amount - e.amount), a = n.reduce(
38
+ (e, s) => e + s.amount,
39
+ 0
40
+ ), t = n.length > T ? T : n.length, r = n.slice(0, t), m = r.map((e) => ({
41
+ id: e.guid,
42
+ color: _(e.guid, g),
43
+ label: e.name,
44
+ value: e.amount / a * 100
45
+ }));
46
+ if (n.length > 5) {
47
+ const e = n.slice(T, o.length), s = e.reduce(
48
+ (C, u) => C + u.amount,
49
+ 0
50
+ );
51
+ r.push({
52
+ guid: "other",
53
+ color: g.palette.categories.others || "",
54
+ name: l.saving_goal_other,
55
+ categoryTotals: e,
56
+ amount: s
57
+ }), m.push({
58
+ id: "other",
59
+ color: g.palette.categories.others || "",
60
+ label: l.saving_goal_other,
61
+ value: s / a * 100
62
+ });
63
+ }
64
+ return {
65
+ categoryData: r,
66
+ donutData: m,
67
+ totalAmount: a
68
+ };
69
+ }, nt = (i, l, g) => {
70
+ const d = i.filter(
71
+ (t) => t.guid === p.INCOME || t.parent_guid === p.INCOME
72
+ ), o = l.filter((t) => d.some((r) => r.guid === t.category_guid)).sort((t, r) => t.total - r.total).map((t, r) => ({
73
+ guid: t.category_guid,
74
+ name: i.find((m) => m.guid === t.category_guid)?.name,
75
+ color: g[r],
76
+ categoryTotals: [],
77
+ amount: Math.abs(t.total)
78
+ })), n = o.reduce(
79
+ (t, r) => t + r.amount,
80
+ 0
81
+ ), a = o.map((t) => ({
82
+ id: t.guid,
83
+ color: t.color,
84
+ label: t.name,
85
+ value: t.amount / n * 100
86
+ }));
87
+ return {
88
+ categoryData: o,
89
+ donutData: a,
90
+ totalAmount: n
91
+ };
92
+ }, H = ({
93
+ data: i,
94
+ isIncome: l = !1,
95
+ onSelected: g,
96
+ onViewTransactions: d,
97
+ selectedId: o,
98
+ size: n = 150,
99
+ totalLabel: a,
100
+ variant: t = "mini"
101
+ }) => {
102
+ const { spending: r } = $(), m = G(), { isTablet: e } = j(), { announce: s, ariaLive: C } = k(), u = x.useMemo(
103
+ () => o ? i.categoryData.find((b) => b.guid === o) : void 0,
104
+ [o]
105
+ );
106
+ x.useEffect(() => {
107
+ if (u) {
108
+ const b = D(u.amount, "0,0");
109
+ s(`${u.name}: ${b}`);
110
+ }
111
+ }, [u, s]);
112
+ const S = x.useMemo(() => i.donutData.length > 0 ? i.donutData : [{ id: "0", color: m.palette.divider, value: 100 }], [i, m]), E = () => {
113
+ d?.(o);
114
+ }, I = e ? 32 : 48;
115
+ return /* @__PURE__ */ y(v, { children: [
116
+ C,
117
+ /* @__PURE__ */ c(O, { data: S, onClick: g, selectedId: o, size: n, children: /* @__PURE__ */ c(f, { alignItems: "center", height: "100%", justifyContent: "center", width: "100%", children: /* @__PURE__ */ y(f, { alignItems: "center", justifyContent: "center", minHeight: n, minWidth: n, children: [
118
+ u && /* @__PURE__ */ y(
119
+ f,
120
+ {
121
+ alignItems: "center",
122
+ gap: t === "mini" ? 0 : 8,
123
+ mb: t === "mini" ? 0 : 8,
124
+ mt: t === "mini" ? 0 : -16,
125
+ sx: t === "mini" ? { gap: 0, mb: 0 } : { gap: { xs: 4, xl: 8 }, mb: { xs: 4, xl: 8 } },
126
+ children: [
127
+ /* @__PURE__ */ c(
128
+ M,
129
+ {
130
+ categoryGuid: l ? p.INCOME : u.guid,
131
+ size: t === "mini" ? 24 : I,
132
+ variant: N.Transparent
133
+ }
134
+ ),
135
+ /* @__PURE__ */ c(
136
+ h,
137
+ {
138
+ color: "secondary",
139
+ noWrap: !0,
140
+ variant: t === "mini" ? "Tiny" : "Body",
141
+ children: u ? u.name : a
142
+ }
143
+ )
144
+ ]
145
+ }
146
+ ),
147
+ !u && t === "full" && /* @__PURE__ */ c(h, { bold: !0, color: "secondary", sx: { mb: { xs: 4, xl: 8 } }, children: a }),
148
+ /* @__PURE__ */ c(h, { variant: t === "mini" ? "H2" : "H1", children: u ? D(u.amount, "0,0") : D(i.totalAmount, "0,0") }),
149
+ !u && t === "mini" && /* @__PURE__ */ c(h, { color: "secondary", noWrap: !0, variant: "Tiny", children: a }),
150
+ t === "full" && /* @__PURE__ */ c(
151
+ A,
152
+ {
153
+ "aria-label": `View ${u?.name || ""} Transactions`,
154
+ disabled: i.categoryData.length === 0,
155
+ onClick: E,
156
+ sx: { mt: { xl: 4, xs: 0 }, zIndex: 1 },
157
+ variant: "text",
158
+ children: r.view_transactions
159
+ }
160
+ )
161
+ ] }) }) })
162
+ ] });
163
+ }, et = w(H), rt = ({ data: i, onSelected: l, selectedId: g }) => {
164
+ const d = (o, n) => {
165
+ (o.key === "Enter" || o.key === " ") && (o.preventDefault(), l(n));
166
+ };
167
+ return /* @__PURE__ */ c(f, { gap: 8, height: "100%", justifyContent: "center", my: "auto", children: i.categoryData.map((o) => /* @__PURE__ */ y(
168
+ f,
169
+ {
170
+ alignItems: "center",
171
+ "aria-label": o.name,
172
+ "aria-pressed": o.guid === g,
173
+ direction: "row",
174
+ gap: 8,
175
+ onClick: () => l(o.guid),
176
+ onKeyDown: (n) => d(n, o.guid),
177
+ role: "button",
178
+ sx: { cursor: "pointer" },
179
+ tabIndex: 0,
180
+ children: [
181
+ /* @__PURE__ */ c(R, { borderRadius: 4, height: 8, sx: { backgroundColor: o.color }, width: 8 }),
182
+ /* @__PURE__ */ c(h, { bold: o.guid === g, variant: "XSmall", children: o.name })
183
+ ]
184
+ },
185
+ o.guid
186
+ )) });
187
+ };
188
+ export {
189
+ et as S,
190
+ nt as a,
191
+ rt as b,
192
+ ot as g
193
+ };