@mx-cartographer/experiences 8.0.0-alpha.bb3 → 8.0.0-alpha.sms1

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 (182) hide show
  1. package/CHANGELOG.md +128 -1
  2. package/dist/{Account-Bxw0_4FU.mjs → Account-BDXA6PWh.mjs} +1 -1
  3. package/dist/{AccountDetailsContent-CAM9y39M.mjs → AccountDetailsContent-CUztd3-b.mjs} +87 -83
  4. package/dist/AccountDetailsHeader-i3KFhNuo.mjs +87 -0
  5. package/dist/{AccountFields-C9FlatNb.mjs → AccountFields-QZspYAji.mjs} +6 -6
  6. package/dist/{AccountListItem-JFMZROh7.mjs → AccountListItem-DX5upmCS.mjs} +5 -5
  7. package/dist/{AccountStore-BgNOyMdp.mjs → AccountStore-BcnDpyLL.mjs} +19 -8
  8. package/dist/{Accounts-BRf_YeTf.mjs → Accounts-DXfZotRC.mjs} +1 -1
  9. package/dist/{BeatApi-DhJpgCLz.mjs → BeatApi-De2IaqH2.mjs} +1 -1
  10. package/dist/{BeatStore-IBnXd4YK.mjs → BeatStore-D_NYuBSz.mjs} +1 -1
  11. package/dist/{BudgetUtil-B2ZXyw-g.mjs → BudgetUtil-Df2nII9u.mjs} +2 -2
  12. package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-DqJK_rrL.mjs} +23 -21
  13. package/dist/{CategoryStore-yHI0hWmK.mjs → CategoryStore-DTgyAMM7.mjs} +12 -10
  14. package/dist/{CategoryUtil-pZRIYOgN.mjs → CategoryUtil-C5cR-nfQ.mjs} +1 -1
  15. package/dist/{ConnectDrawer-BQNs-hjk.mjs → ConnectDrawer-BIbTqYOH.mjs} +2 -2
  16. package/dist/{ConnectionsDrawer-ByGQE7D5.mjs → ConnectionsDrawer-BFfY3_zB.mjs} +3 -3
  17. package/dist/{CurrencyInput-DUsQbkXb.mjs → CurrencyInput-BFKcs-_K.mjs} +2 -2
  18. package/dist/{CurrencyText-kyC1aseI.mjs → CurrencyText-Dr0EZ7bp.mjs} +1 -1
  19. package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CBdcsyuk.mjs} +3 -3
  20. package/dist/{DebtsStore-C9bblOgW.mjs → DebtsStore-BbJB0nmu.mjs} +1 -1
  21. package/dist/{Dialog-CWW597AF.mjs → Dialog-BPTr3qHE.mjs} +2 -2
  22. package/dist/{Donut-oaQFlbit.mjs → Donut-Dmy3JTWd.mjs} +12 -12
  23. package/dist/Drawer-BEtCk82g.mjs +163 -0
  24. package/dist/{EmptyState-DA_lfRBv.mjs → EmptyState-DoxNUae-.mjs} +24 -22
  25. package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-DzTrtPzk.mjs} +3 -3
  26. package/dist/{Fetch-87LIQbEA.mjs → Fetch-DecPFeGU.mjs} +24 -22
  27. package/dist/FinstrongStore-BIrX0Xg2.mjs +451 -0
  28. package/dist/{GoalStore-D-aB35SY.mjs → GoalStore-DpWY3gVb.mjs} +5 -5
  29. package/dist/{Help-B6dIcujh.mjs → Help-BnPXM_N2.mjs} +2 -2
  30. package/dist/LineChart-bc1D9xBE.mjs +581 -0
  31. package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-uobBrm_a.mjs} +10 -10
  32. package/dist/{ManageIncome-1s_q5W4X.mjs → ManageIncome-NpXHhO1n.mjs} +177 -174
  33. package/dist/{MerchantStore-DrFvsUyy.mjs → MerchantStore-WvZ4gnQe.mjs} +1 -1
  34. package/dist/{MicroWidgetContainer-DpeqN9n3.mjs → MicroWidgetContainer-DEiRnYVa.mjs} +1 -1
  35. package/dist/{MiniWidgetContainer-D0gfmbaF.mjs → MiniWidgetContainer-CmXpTylX.mjs} +1 -1
  36. package/dist/{NetWorthStore-DCsTZpuS.mjs → NetWorthStore-lsuhEpn6.mjs} +2 -2
  37. package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-CNmJWVeI.mjs} +241 -238
  38. package/dist/{NotificationStore-BxP_P2dA.mjs → NotificationStore-Ck2KdNmT.mjs} +10 -10
  39. package/dist/{NumberFormatting-Buh7u8Oi.mjs → NumberFormatting-DjTD0t3W.mjs} +9 -9
  40. package/dist/{OriginalBalanceAction-CWuVvRq9.mjs → OriginalBalanceAction-DK8_LkPz.mjs} +4 -4
  41. package/dist/{RecurringSettings-A_rAGCTP.mjs → RecurringSettings-CqZh1SQa.mjs} +17 -17
  42. package/dist/{RecurringTransactions-DK8dWldr.mjs → RecurringTransactions-BKcYmpv3.mjs} +46 -45
  43. package/dist/{RecurringTransactionsStore-C4YOD7_D.mjs → RecurringTransactionsStore-Ni5tSQIO.mjs} +80 -73
  44. package/dist/{SettingsStore-BcgS_Ohv.mjs → SettingsStore-krIRNwHK.mjs} +3 -3
  45. package/dist/SkeletonLoader-BaNboJjD.mjs +38 -0
  46. package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-BuJ03S9d.mjs} +16 -16
  47. package/dist/SpendingLegend-CjX-hX2O.mjs +193 -0
  48. package/dist/{ToggleListItem-r0Kx56wF.mjs → ToggleListItem-ciFTiqRS.mjs} +19 -14
  49. package/dist/TransactionApi-CjBoLleL.mjs +86 -0
  50. package/dist/TransactionDetails-5M2vfr59.mjs +1379 -0
  51. package/dist/{TransactionStore-ai3uII_r.mjs → TransactionStore-D-Q3BU9Z.mjs} +119 -121
  52. package/dist/TrendsStore-BW9FGQeE.mjs +182 -0
  53. package/dist/{User-BQUxBeZV.mjs → User-wXzDI4M8.mjs} +2 -2
  54. package/dist/{ViewMoreMicroCard-SCn2wt4i.mjs → ViewMoreMicroCard-C0832BMe.mjs} +702 -723
  55. package/dist/{WidgetContainer-BHWANqT4.mjs → WidgetContainer-BhQ1Kx2z.mjs} +4 -4
  56. package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
  57. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +4 -1
  58. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +2 -1
  59. package/dist/accounts/index.es.js +229 -222
  60. package/dist/accounts/stores/AccountStore.d.ts +2 -0
  61. package/dist/analytics/index.es.js +2 -2
  62. package/dist/budgets/index.es.js +380 -382
  63. package/dist/cashflow/index.es.js +405 -413
  64. package/dist/categories/index.es.js +2 -2
  65. package/dist/categories/stores/CategoryStore.d.ts +1 -1
  66. package/dist/common/components/ErrorBoundary.d.ts +1 -1
  67. package/dist/common/components/Select.d.ts +4 -2
  68. package/dist/common/components/charts/LineChart.d.ts +12 -2
  69. package/dist/common/components/charts/index.d.ts +0 -3
  70. package/dist/common/components/charts/linechart/CustomLegend.d.ts +3 -1
  71. package/dist/common/components/charts/linechart/CustomMark.d.ts +4 -0
  72. package/dist/common/components/drawer/Drawer.d.ts +3 -0
  73. package/dist/common/components/drawer/Footer.d.ts +17 -0
  74. package/dist/common/hooks/index.d.ts +0 -1
  75. package/dist/common/hooks/useAriaLive.d.ts +1 -1
  76. package/dist/common/index.es.js +320 -321
  77. package/dist/common/stores/GlobalStore.d.ts +7 -1
  78. package/dist/common/types/Finstrong.d.ts +54 -0
  79. package/dist/common/types/Global.d.ts +1 -0
  80. package/dist/common/types/Widgets.d.ts +1 -0
  81. package/dist/common/types/index.d.ts +1 -1
  82. package/dist/common/types/localization/FinstrongCopy.d.ts +105 -2
  83. package/dist/common/types/localization/GoalsCopy.d.ts +1 -0
  84. package/dist/dashboard/index.es.js +2 -2
  85. package/dist/debts/index.es.js +506 -498
  86. package/dist/exportTransactionsToCSV-Cz2t0lmA.mjs +48 -0
  87. package/dist/finstrong/FinstrongWidget.d.ts +1 -1
  88. package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
  89. package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
  90. package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
  91. package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
  92. package/dist/finstrong/components/FinancialStrengthGraph.d.ts +7 -1
  93. package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
  94. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
  95. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
  96. package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
  97. package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
  98. package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
  99. package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
  100. package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
  101. package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
  102. package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
  103. package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
  104. package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
  105. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
  106. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
  107. package/dist/finstrong/components/ProgressBar.d.ts +15 -0
  108. package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
  109. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
  110. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
  111. package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
  112. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
  113. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
  114. package/dist/finstrong/components/StatusChip.d.ts +5 -0
  115. package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
  116. package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +17 -0
  117. package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
  118. package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
  119. package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
  120. package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
  121. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
  122. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
  123. package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
  124. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +25 -0
  125. package/dist/finstrong/components/shared/DialScoreCard.d.ts +7 -1
  126. package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
  127. package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
  128. package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
  129. package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
  130. package/dist/finstrong/constants/index.d.ts +9 -0
  131. package/dist/finstrong/index.es.js +3171 -1063
  132. package/dist/finstrong/stores/FinstrongStore.d.ts +25 -2
  133. package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
  134. package/dist/goals/index.es.js +566 -562
  135. package/dist/help/index.es.js +3 -3
  136. package/dist/{hooks-D6XlXHf4.mjs → hooks-C41HAxM5.mjs} +3 -3
  137. package/dist/insights/index.es.js +1 -1
  138. package/dist/investments/index.es.js +437 -435
  139. package/dist/merchants/index.es.js +2 -2
  140. package/dist/microinsights/beaticons/BeatIcon.d.ts +2 -9
  141. package/dist/microinsights/beaticons/BeatMerchantLogo.d.ts +3 -2
  142. package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +2 -1
  143. package/dist/microinsights/cards/{MicroInsightCard.d.ts → BaseCard.d.ts} +1 -8
  144. package/dist/microinsights/cards/{BeatCard.d.ts → InsightCard.d.ts} +2 -2
  145. package/dist/microinsights/cards/NoRelevantInsightsCard.d.ts +2 -5
  146. package/dist/microinsights/cards/ZeroStateCard.d.ts +2 -5
  147. package/dist/microinsights/carousel/BeatList.d.ts +10 -0
  148. package/dist/microinsights/carousel/CarouselControls.d.ts +1 -3
  149. package/dist/microinsights/carousel/CarouselHeader.d.ts +1 -2
  150. package/dist/microinsights/constants/App.d.ts +0 -1
  151. package/dist/microinsights/index.d.ts +3 -3
  152. package/dist/microinsights/index.es.js +7 -7
  153. package/dist/microinsights/interfaces.d.ts +0 -6
  154. package/dist/networth/index.es.js +188 -186
  155. package/dist/notifications/index.es.js +95 -96
  156. package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +3 -0
  157. package/dist/recurringtransactions/index.es.js +584 -560
  158. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +1 -0
  159. package/dist/settings/index.es.js +286 -280
  160. package/dist/spending/index.es.js +269 -421
  161. package/dist/spending/utils/SpendingData.d.ts +2 -1
  162. package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -0
  163. package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
  164. package/dist/transactions/index.es.js +226 -220
  165. package/dist/transactions/stores/TransactionStore.d.ts +1 -1
  166. package/dist/transactions/stores/UiStore.d.ts +0 -2
  167. package/dist/trends/index.es.js +963 -586
  168. package/dist/{useAccountDisplayName-BUAApBIb.mjs → useAccountDisplayName-CFNF8766.mjs} +2 -2
  169. package/dist/{useCombineEvents-BUDIR1ba.mjs → useCombineEvents-CRwX-qWE.mjs} +1 -1
  170. package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-CNjP5cfR.mjs} +1 -1
  171. package/package.json +7 -7
  172. package/dist/AccountDetailsHeader-JtSX6Uf9.mjs +0 -120
  173. package/dist/Drawer-kEE73B87.mjs +0 -113
  174. package/dist/FinstrongStore-F2c607dj.mjs +0 -101
  175. package/dist/LineChart-D4GI7nVh.mjs +0 -541
  176. package/dist/TransactionApi-B3Tksf7L.mjs +0 -86
  177. package/dist/TransactionDetails-oP1eSuiS.mjs +0 -1334
  178. package/dist/TrendsStore-DCYbpXPO.mjs +0 -559
  179. package/dist/common/hooks/usePrevious.d.ts +0 -2
  180. package/dist/exportTransactionsToCSV-7bVS7KXf.mjs +0 -47
  181. package/dist/finstrong/utils/Finstrong.d.ts +0 -6
  182. package/dist/useAriaLive-B3_pRUio.mjs +0 -35
@@ -1,4 +1,4 @@
1
- import { jsx as I } from "react/jsx-runtime";
1
+ import { jsx as g } from "react/jsx-runtime";
2
2
  import M from "@mui/material/Box";
3
3
  import H from "@mui/material/FormControlLabel";
4
4
  import P from "@mui/material/Radio";
@@ -12,15 +12,15 @@ import { isBefore as v } from "date-fns/isBefore";
12
12
  import { startOfMonth as h } from "date-fns/startOfMonth";
13
13
  import { startOfToday as m } from "date-fns/startOfToday";
14
14
  import { subDays as B } from "date-fns/subDays";
15
- import { O as n, a as y, T as b } from "./User-BQUxBeZV.mjs";
16
- import { T as u } from "./TransactionApi-B3Tksf7L.mjs";
15
+ import { O as o, a as y, T as b } from "./User-wXzDI4M8.mjs";
16
+ import { T as L } from "./TransactionApi-CjBoLleL.mjs";
17
17
  import { b as Y } from "./Category-CevNQ03n.mjs";
18
- import { f as F } from "./exportTransactionsToCSV-7bVS7KXf.mjs";
18
+ import { f as F } from "./exportTransactionsToCSV-Cz2t0lmA.mjs";
19
19
  import { format as W } from "date-fns/format";
20
- import { fromUnixTime as z } from "date-fns/fromUnixTime";
21
- import { f as g, D as C, O as $ } from "./Dialog-CWW597AF.mjs";
22
- import { endOfMonth as k } from "date-fns/endOfMonth";
23
- import { B as L } from "./BeatApi-DhJpgCLz.mjs";
20
+ import { fromUnixTime as $ } from "date-fns/fromUnixTime";
21
+ import { f as I, a as C, O as k } from "./Dialog-BPTr3qHE.mjs";
22
+ import { endOfMonth as z } from "date-fns/endOfMonth";
23
+ import { B as u } from "./BeatApi-De2IaqH2.mjs";
24
24
  const X = ({
25
25
  checked: l = !1,
26
26
  label: t,
@@ -29,7 +29,7 @@ const X = ({
29
29
  value: A
30
30
  }) => {
31
31
  const d = U(), s = d.palette.mode === "light" ? d.palette.grey[400] : d.palette.grey[700], c = l ? d.palette.action.active : s;
32
- return /* @__PURE__ */ I(
32
+ return /* @__PURE__ */ g(
33
33
  M,
34
34
  {
35
35
  bgcolor: "background.paper",
@@ -41,10 +41,10 @@ const X = ({
41
41
  pr: 8,
42
42
  py: 4,
43
43
  sx: { "&:hover": { borderColor: d.palette.action.active }, ...a },
44
- children: /* @__PURE__ */ I(K, { title: e, children: /* @__PURE__ */ I(
44
+ children: /* @__PURE__ */ g(K, { title: e, children: /* @__PURE__ */ g(
45
45
  H,
46
46
  {
47
- control: /* @__PURE__ */ I(
47
+ control: /* @__PURE__ */ g(
48
48
  P,
49
49
  {
50
50
  disableRipple: !0,
@@ -71,7 +71,7 @@ const X = ({
71
71
  left: "flex-start",
72
72
  right: "flex-end"
73
73
  }
74
- }, o = {
74
+ }, n = {
75
75
  ADD: "Add",
76
76
  ADD_CATEGORY: "Add Category",
77
77
  CHANGE_CATEGORY: "Change Category",
@@ -110,215 +110,215 @@ const X = ({
110
110
  UNHIDE_TRANSACTION: "Unhide Transaction"
111
111
  }, R = {
112
112
  // splits
113
- [n.ON_TRANSACTION_SPLIT_CLICK]: {
114
- action: o.SELECT,
113
+ [o.ON_TRANSACTION_SPLIT_CLICK]: {
114
+ action: n.SELECT,
115
115
  category: T.TRANSACTION_DETAILS,
116
116
  label: r.SPLITS
117
117
  },
118
- [n.ON_TRANSACTION_SPLIT_CATEGORY_CLICK]: {
119
- action: o.ADD_CATEGORY,
118
+ [o.ON_TRANSACTION_SPLIT_CATEGORY_CLICK]: {
119
+ action: n.ADD_CATEGORY,
120
120
  category: T.TRANSACTION_DETAILS,
121
121
  label: r.SPLITS
122
122
  },
123
- [n.ON_TRANSACTION_SPLIT_DELETE_CLICK]: {
124
- action: o.DELETE,
123
+ [o.ON_TRANSACTION_SPLIT_DELETE_CLICK]: {
124
+ action: n.DELETE,
125
125
  category: T.TRANSACTION_DETAILS,
126
126
  label: r.SPLITS
127
127
  },
128
- [n.ON_TRANSACTION_SPLIT_SAVE_CLICK]: {
129
- action: o.SPLIT,
128
+ [o.ON_TRANSACTION_SPLIT_SAVE_CLICK]: {
129
+ action: n.SPLIT,
130
130
  category: T.TRANSACTION_DETAILS,
131
131
  label: r.SPLITS
132
132
  },
133
- [n.ON_TRANSACTION_UNSPLIT]: {
134
- action: o.UNSPLIT,
133
+ [o.ON_TRANSACTION_UNSPLIT]: {
134
+ action: n.UNSPLIT,
135
135
  category: T.TRANSACTION_DETAILS,
136
136
  label: r.SPLITS
137
137
  },
138
138
  // category
139
- [n.ON_TRANSACTION_CATEGORY_CLICK]: {
140
- action: o.SELECT,
139
+ [o.ON_TRANSACTION_CATEGORY_CLICK]: {
140
+ action: n.SELECT,
141
141
  category: T.TRANSACTIONS_LIST,
142
142
  label: r.CATEGORY
143
143
  },
144
- [n.ON_TRANSACTION_CATEGORY_CHANGED]: {
145
- action: o.CHANGE_CATEGORY,
144
+ [o.ON_TRANSACTION_CATEGORY_CHANGED]: {
145
+ action: n.CHANGE_CATEGORY,
146
146
  category: T.TRANSACTION_DETAILS,
147
147
  label: r.CATEGORY
148
148
  },
149
149
  // date
150
- [n.ON_TRANSACTION_DATE_CHANGED]: {
151
- action: o.SAVE,
150
+ [o.ON_TRANSACTION_DATE_CHANGED]: {
151
+ action: n.SAVE,
152
152
  category: T.TRANSACTION_DETAILS,
153
153
  label: r.DATE
154
154
  },
155
- [n.ON_TRANSACTION_DATE_CLICK]: {
156
- action: o.SELECT,
155
+ [o.ON_TRANSACTION_DATE_CLICK]: {
156
+ action: n.SELECT,
157
157
  category: T.TRANSACTION_DETAILS,
158
158
  label: r.DATE
159
159
  },
160
160
  // merchant logo
161
- [n.ON_TRANSACTION_DELETE_LOGO_CANCEL]: {
162
- action: o.CLOSE,
161
+ [o.ON_TRANSACTION_DELETE_LOGO_CANCEL]: {
162
+ action: n.CLOSE,
163
163
  category: T.TRANSACTION_DETAILS,
164
164
  label: r.DELETE_MERCHANT_LOGO
165
165
  },
166
- [n.ON_TRANSACTION_DELETE_LOGO_CLICK]: {
167
- action: o.SELECT,
166
+ [o.ON_TRANSACTION_DELETE_LOGO_CLICK]: {
167
+ action: n.SELECT,
168
168
  category: T.TRANSACTION_DETAILS,
169
169
  label: r.DELETE_MERCHANT_LOGO
170
170
  },
171
- [n.ON_TRANSACTION_DELETE_LOGO_DELETED]: {
172
- action: o.DELETE,
171
+ [o.ON_TRANSACTION_DELETE_LOGO_DELETED]: {
172
+ action: n.DELETE,
173
173
  category: T.TRANSACTION_DETAILS,
174
174
  label: r.DELETE_MERCHANT_LOGO
175
175
  },
176
176
  // description
177
- [n.ON_TRANSACTION_DESCRIPTION_EDIT_CLICK]: {
178
- action: o.EDIT,
177
+ [o.ON_TRANSACTION_DESCRIPTION_EDIT_CLICK]: {
178
+ action: n.EDIT,
179
179
  category: T.TRANSACTION_DETAILS,
180
180
  label: r.DESCRIPTION
181
181
  },
182
- [n.ON_TRANSACTION_DESCRIPTION_SAVE_CLICK]: {
183
- action: o.SAVE,
182
+ [o.ON_TRANSACTION_DESCRIPTION_SAVE_CLICK]: {
183
+ action: n.SAVE,
184
184
  category: T.TRANSACTION_DETAILS,
185
185
  label: r.DESCRIPTION
186
186
  },
187
187
  // hide transactions
188
- [n.ON_TRANSACTION_HIDDEN]: {
189
- action: o.SAVE,
188
+ [o.ON_TRANSACTION_HIDDEN]: {
189
+ action: n.SAVE,
190
190
  category: T.TRANSACTION_DETAILS,
191
191
  label: r.HIDE_TRANSACTION
192
192
  },
193
- [n.ON_TRANSACTION_HIDE_CLICK]: {
194
- action: o.SELECT,
193
+ [o.ON_TRANSACTION_HIDE_CLICK]: {
194
+ action: n.SELECT,
195
195
  category: T.TRANSACTION_DETAILS,
196
196
  label: r.HIDE_TRANSACTION
197
197
  },
198
- [n.ON_TRANSACTION_HIDE_CANCEL_CLICK]: {
199
- action: o.CLOSE,
198
+ [o.ON_TRANSACTION_HIDE_CANCEL_CLICK]: {
199
+ action: n.CLOSE,
200
200
  category: T.TRANSACTION_DETAILS,
201
201
  label: r.HIDE_TRANSACTION
202
202
  },
203
203
  // transaction list
204
- [n.ON_TRANSACTION_LIST_ITEM_CLICK]: {
205
- action: o.SELECT,
204
+ [o.ON_TRANSACTION_LIST_ITEM_CLICK]: {
205
+ action: n.SELECT,
206
206
  category: T.TRANSACTIONS_LIST,
207
207
  label: r.TRANSACTION
208
208
  },
209
209
  // memo
210
- [n.ON_TRANSACTION_MEMO_CHANGED]: {
211
- action: o.SAVE,
210
+ [o.ON_TRANSACTION_MEMO_CHANGED]: {
211
+ action: n.SAVE,
212
212
  category: T.TRANSACTION_DETAILS,
213
213
  label: r.MEMO
214
214
  },
215
- [n.ON_TRANSACTION_MEMO_CLICK]: {
216
- action: o.SELECT,
215
+ [o.ON_TRANSACTION_MEMO_CLICK]: {
216
+ action: n.SELECT,
217
217
  category: T.TRANSACTION_DETAILS,
218
218
  label: r.MEMO
219
219
  },
220
220
  // tags
221
- [n.ON_TRANSACTION_TAGS_CHANGED]: {
222
- action: o.SAVE,
221
+ [o.ON_TRANSACTION_TAGS_CHANGED]: {
222
+ action: n.SAVE,
223
223
  category: T.TRANSACTION_DETAILS,
224
224
  label: r.TAGS
225
225
  },
226
- [n.ON_TRANSACTION_TAGS_CLICK]: {
227
- action: o.SELECT,
226
+ [o.ON_TRANSACTION_TAGS_CLICK]: {
227
+ action: n.SELECT,
228
228
  category: T.TRANSACTION_DETAILS,
229
229
  label: r.TAGS
230
230
  },
231
- [n.ON_TRANSACTION_TAGS_TAG_ADD_CANCEL_CLICK]: {
232
- action: o.CLOSE,
231
+ [o.ON_TRANSACTION_TAGS_TAG_ADD_CANCEL_CLICK]: {
232
+ action: n.CLOSE,
233
233
  category: T.TRANSACTION_DETAILS,
234
234
  label: r.TAGS
235
235
  },
236
- [n.ON_TRANSACTION_TAGS_TAG_ADD_CLICK]: {
237
- action: o.ADD,
236
+ [o.ON_TRANSACTION_TAGS_TAG_ADD_CLICK]: {
237
+ action: n.ADD,
238
238
  category: T.TRANSACTION_DETAILS,
239
239
  label: r.TAG_ADD
240
240
  },
241
- [n.ON_TRANSACTION_TAGS_TAG_ADDED]: {
242
- action: o.SAVE,
241
+ [o.ON_TRANSACTION_TAGS_TAG_ADDED]: {
242
+ action: n.SAVE,
243
243
  category: T.TRANSACTION_DETAILS,
244
244
  label: r.TAG_ADD
245
245
  },
246
- [n.ON_TRANSACTION_TAGS_TAG_DELETE_CLICK]: {
247
- action: o.SELECT,
246
+ [o.ON_TRANSACTION_TAGS_TAG_DELETE_CLICK]: {
247
+ action: n.SELECT,
248
248
  category: T.TRANSACTION_DETAILS,
249
249
  label: r.TAG_DELETE
250
250
  },
251
- [n.ON_TRANSACTION_TAGS_TAG_DELETE_CANCEL_CLICK]: {
252
- action: o.CLOSE,
251
+ [o.ON_TRANSACTION_TAGS_TAG_DELETE_CANCEL_CLICK]: {
252
+ action: n.CLOSE,
253
253
  category: T.TRANSACTION_DETAILS,
254
254
  label: r.TAG_DELETE
255
255
  },
256
- [n.ON_TRANSACTION_TAGS_TAG_DELETED]: {
257
- action: o.SAVE,
256
+ [o.ON_TRANSACTION_TAGS_TAG_DELETED]: {
257
+ action: n.SAVE,
258
258
  category: T.TRANSACTION_DETAILS,
259
259
  label: r.TAG_DELETE
260
260
  },
261
- [n.ON_TRANSACTION_TAGS_TAG_EDIT_CLICK]: {
262
- action: o.EDIT,
261
+ [o.ON_TRANSACTION_TAGS_TAG_EDIT_CLICK]: {
262
+ action: n.EDIT,
263
263
  category: T.TRANSACTION_DETAILS,
264
264
  label: r.TAG_EDIT
265
265
  },
266
- [n.ON_TRANSACTION_TAGS_TAG_EDIT_SAVED]: {
267
- action: o.SAVE,
266
+ [o.ON_TRANSACTION_TAGS_TAG_EDIT_SAVED]: {
267
+ action: n.SAVE,
268
268
  category: T.TRANSACTION_DETAILS,
269
269
  label: r.TAG_EDIT
270
270
  },
271
271
  // flag
272
- [n.ON_TRANSACTION_TOGGLE_FLAG_CLICK]: {
273
- action: o.SELECT,
272
+ [o.ON_TRANSACTION_TOGGLE_FLAG_CLICK]: {
273
+ action: n.SELECT,
274
274
  category: T.TRANSACTION_DETAILS,
275
275
  label: r.FLAG
276
276
  },
277
277
  // hide
278
- [n.ON_TRANSACTION_UNHIDDEN]: {
279
- action: o.SAVE,
278
+ [o.ON_TRANSACTION_UNHIDDEN]: {
279
+ action: n.SAVE,
280
280
  category: T.TRANSACTION_DETAILS,
281
281
  label: r.UNHIDE_TRANSACTION
282
282
  },
283
- [n.ON_TRANSACTION_UNHIDE_CLICK]: {
284
- action: o.SELECT,
283
+ [o.ON_TRANSACTION_UNHIDE_CLICK]: {
284
+ action: n.SELECT,
285
285
  category: T.TRANSACTION_DETAILS,
286
286
  label: r.UNHIDE_TRANSACTION
287
287
  },
288
- [n.ON_TRANSACTION_UNHIDE_CANCEL_CLICK]: {
289
- action: o.CLOSE,
288
+ [o.ON_TRANSACTION_UNHIDE_CANCEL_CLICK]: {
289
+ action: n.CLOSE,
290
290
  category: T.TRANSACTION_DETAILS,
291
291
  label: r.UNHIDE_TRANSACTION
292
292
  },
293
293
  // export CSV
294
- [n.ON_TRANSACTION_EXPORT_CSV_CLICK]: {
295
- action: o.SELECT,
294
+ [o.ON_TRANSACTION_EXPORT_CSV_CLICK]: {
295
+ action: n.SELECT,
296
296
  category: T.TRANSACTIONS_WIDGET,
297
297
  label: r.EXPORT_CSV
298
298
  },
299
299
  // add transaction
300
- [n.ON_TRANSACTION_MANUAL_ADD_CLICK]: {
301
- action: o.SELECT,
300
+ [o.ON_TRANSACTION_MANUAL_ADD_CLICK]: {
301
+ action: n.SELECT,
302
302
  category: T.TRANSACTIONS_WIDGET,
303
303
  label: r.ADD_TRANSACTION
304
304
  },
305
- [n.ON_TRANSACTION_MANUAL_ADD_ADDED]: {
306
- action: o.ADD,
305
+ [o.ON_TRANSACTION_MANUAL_ADD_ADDED]: {
306
+ action: n.ADD,
307
307
  category: T.TRANSACTIONS_WIDGET,
308
308
  label: r.ADD_TRANSACTION
309
309
  },
310
- [n.ON_TRANSACTION_DELETE_CLICK]: {
311
- action: o.SELECT,
310
+ [o.ON_TRANSACTION_DELETE_CLICK]: {
311
+ action: n.SELECT,
312
312
  category: T.TRANSACTIONS_WIDGET,
313
313
  label: r.DELETE_TRANSACTION
314
314
  },
315
- [n.ON_TRANSACTION_DELETE_CANCEL]: {
316
- action: o.CLOSE,
315
+ [o.ON_TRANSACTION_DELETE_CANCEL]: {
316
+ action: n.CLOSE,
317
317
  category: T.TRANSACTIONS_WIDGET,
318
318
  label: r.DELETE_TRANSACTION
319
319
  },
320
- [n.ON_TRANSACTION_DELETE_DELETED]: {
321
- action: o.DELETE,
320
+ [o.ON_TRANSACTION_DELETE_DELETED]: {
321
+ action: n.DELETE,
322
322
  category: T.TRANSACTIONS_WIDGET,
323
323
  label: r.DELETE_TRANSACTION
324
324
  }
@@ -331,26 +331,26 @@ const X = ({
331
331
  AMOUNT: "amount"
332
332
  }, Z = (l, t, a, e = []) => {
333
333
  const A = t.reduce((c, i) => ({ ...c, [i.guid]: i }), {}), d = a.reduce((c, i) => ({ ...c, [i.guid]: i }), {}), s = e.reduce((c, i) => {
334
- const { transaction_guid: N, tag_guid: E } = i;
335
- if (!c[N])
334
+ const { transaction_guid: S, tag_guid: E } = i;
335
+ if (!c[S])
336
336
  return {
337
337
  ...c,
338
- [N]: [E]
338
+ [S]: [E]
339
339
  };
340
- const S = [...c[N], E];
340
+ const N = [...c[S], E];
341
341
  return {
342
342
  ...c,
343
- [N]: S
343
+ [S]: N
344
344
  };
345
345
  }, {});
346
346
  return l.map((c) => {
347
- const i = A[c.account_guid], N = c.category_guid ? d[c.category_guid] : null, E = s[c.guid] ?? [];
347
+ const i = A[c.account_guid], S = c.category_guid ? d[c.category_guid] : null, E = s[c.guid] ?? [];
348
348
  return {
349
349
  ...c,
350
350
  account: i?.user_name || "Unknown",
351
351
  accountIsClosed: i?.is_closed,
352
352
  accountIsHidden: i?.is_hidden,
353
- category: N?.name || "Uncategorized",
353
+ category: S?.name || "Uncategorized",
354
354
  isIncome: c.top_level_category_guid === Y.INCOME,
355
355
  isPending: c.feed_status === y.PENDING,
356
356
  number: i?.account_number || "",
@@ -361,8 +361,8 @@ const X = ({
361
361
  }, q = "uncategorized", J = (l, t, a, e, A, d) => {
362
362
  const s = Q(l, A, d), c = tt(s, a, e);
363
363
  return t.forEach((i) => {
364
- const N = c.findIndex((S) => S.guid === i), E = d.filter((S) => S.parent_guid === i);
365
- c.splice(N + 1, 0, ...E);
364
+ const S = c.findIndex((N) => N.guid === i), E = d.filter((N) => N.parent_guid === i);
365
+ c.splice(S + 1, 0, ...E);
366
366
  }), c;
367
367
  }, Q = (l, t, a) => {
368
368
  const {
@@ -372,15 +372,15 @@ const X = ({
372
372
  searchTerm: s = "",
373
373
  showSplits: c = !1
374
374
  } = l;
375
- return a.filter((i) => c ? !i.has_been_split : !i.parent_guid).filter((i) => !!e.find((N) => N === i.account_guid)).filter((i) => i.date >= O(A.start) && i.date <= O(A.end)).filter(d).filter((i) => {
375
+ return a.filter((i) => c ? !i.has_been_split : !i.parent_guid).filter((i) => !!e.find((S) => S === i.account_guid)).filter((i) => i.date >= O(A.start) && i.date <= O(A.end)).filter(d).filter((i) => {
376
376
  if (s === q && i.has_been_split)
377
377
  return !1;
378
378
  if (/^spl/i.test(s) && (i.has_been_split || i.parent_guid))
379
379
  return !0;
380
380
  const E = i.tags.some(
381
381
  (w) => _(s, t.find((x) => x.guid === w)?.name)
382
- ), S = z(i.date);
383
- return _(s, i.payee) || _(s, i.feed_description) || _(s, i.category) || _(s, g(S, C.MONTH)) || _(s, g(S, C.DAY)) || _(s, g(S, C.FULL_MONTH_DAY)) || _(s, g(S, C.MONTH_DAY_YEAR)) || _(s, W(S, $)) || _(s, i.account) || _(s, `${i.amount}`) || _(s, i.memo) || E;
382
+ ), N = $(i.date);
383
+ return _(s, i.payee) || _(s, i.feed_description) || _(s, i.category) || _(s, I(N, C.MONTH)) || _(s, I(N, C.DAY)) || _(s, I(N, C.FULL_MONTH_DAY)) || _(s, I(N, C.MONTH_DAY_YEAR)) || _(s, W(N, k)) || _(s, i.account) || _(s, `${i.amount}`) || _(s, i.memo) || E;
384
384
  });
385
385
  }, tt = (l, t, a) => [...l].sort((e, A) => {
386
386
  const d = t, s = (e[d] || "") > (A[d] || "");
@@ -420,9 +420,8 @@ const X = ({
420
420
  };
421
421
  class et {
422
422
  beginDate = h(/* @__PURE__ */ new Date());
423
- endDate = k(/* @__PURE__ */ new Date());
423
+ endDate = z(/* @__PURE__ */ new Date());
424
424
  expandedSplits = [];
425
- isInitialized = !1;
426
425
  height = 550;
427
426
  width = 1e3;
428
427
  shouldDisableDrawerScroll = !1;
@@ -437,7 +436,6 @@ class et {
437
436
  setDateRange = (t, a) => {
438
437
  this.beginDate = t, this.endDate = a;
439
438
  };
440
- setIsInitialized = (t) => this.isInitialized = t;
441
439
  setIsAmountValid = (t) => this.isAmountValid = t;
442
440
  setSearchValue = (t) => this.searchValue = t;
443
441
  setSelectedAccountGuids = (t) => this.selectedAccountGuids = t;
@@ -462,8 +460,8 @@ class et {
462
460
  class ft {
463
461
  globalStore;
464
462
  uiStore;
465
- api = new u("/", "");
466
- beatApi = new L("/", "");
463
+ api = new L("/", "");
464
+ beatApi = new u("/", "");
467
465
  associatedBeats = [];
468
466
  associatedBeatsLoaded = !1;
469
467
  transactions = [];
@@ -481,25 +479,33 @@ class ft {
481
479
  sortDirection = G.DESC;
482
480
  onAnalyticEvent = j;
483
481
  constructor(t) {
484
- this.globalStore = t, this.uiStore = new et(), this.api = new u(
482
+ this.globalStore = t, this.uiStore = new et(), this.api = new L(
485
483
  t.endpoint,
486
484
  t.sessionToken,
487
485
  t.onError
488
- ), this.beatApi = new L(t.endpoint, t.sessionToken, t.onError), p(this);
486
+ ), this.beatApi = new u(t.endpoint, t.sessionToken, t.onError), p(this);
489
487
  }
490
488
  loadTransactionData = async () => {
491
- await Promise.all([
489
+ this.globalStore.accountStore.isAccountDataLoaded || await this.globalStore.accountStore.loadAccountData(), this.globalStore.categoryStore.categoriesLoaded || await this.globalStore.categoryStore.loadCategories(), await Promise.all([
492
490
  this.loadAssociatedBeats(h(/* @__PURE__ */ new Date())),
493
491
  this.loadTags(),
494
492
  this.loadTaggings(),
495
493
  this.loadTransactionRules(),
496
494
  // By default loads 90 days of transactions
497
495
  this.loadTransactions(this.cachedStartDate)
498
- ]), this.uiStore.setIsInitialized(!0);
496
+ ]);
499
497
  };
500
498
  get isTransactionDataLoaded() {
501
499
  return this.associatedBeatsLoaded && this.tagsLoaded && this.taggingsLoaded && this.transactionRulesLoaded && this.transactionsLoaded;
502
500
  }
501
+ get detailedTransactions() {
502
+ return this.isTransactionDataLoaded ? Z(
503
+ this.transactions,
504
+ this.globalStore.accountStore.visibleAccounts,
505
+ this.globalStore.categoryStore.categories,
506
+ this.taggings
507
+ ) : [];
508
+ }
503
509
  get sortedTransactions() {
504
510
  return J(
505
511
  this.filter,
@@ -513,14 +519,6 @@ class ft {
513
519
  get sortedTransactionsWithSplits() {
514
520
  return F(this.sortedTransactions, this.transactions);
515
521
  }
516
- get detailedTransactions() {
517
- return Z(
518
- this.transactions,
519
- this.globalStore.accountStore.visibleAccounts,
520
- this.globalStore.categoryStore.categories,
521
- this.taggings
522
- );
523
- }
524
522
  setAssociatedBeats = (t) => {
525
523
  this.associatedBeats = t, this.associatedBeatsLoaded = !0;
526
524
  };
@@ -0,0 +1,182 @@
1
+ import { jsxs as d, jsx as l } from "react/jsx-runtime";
2
+ import x from "react";
3
+ import S from "@mui/material/ListItem";
4
+ import R from "@mui/material/ListItemButton";
5
+ import f from "@mui/material/ListItemIcon";
6
+ import A from "@mui/material/ListItemText";
7
+ import h from "@mui/material/Stack";
8
+ import { Text as y } from "@mxenabled/mxui";
9
+ import { makeAutoObservable as N } from "mobx";
10
+ import { addSeconds as v } from "date-fns/addSeconds";
11
+ import { differenceInCalendarMonths as w } from "date-fns/differenceInCalendarMonths";
12
+ import { endOfMonth as D } from "date-fns/endOfMonth";
13
+ import { subMonths as I } from "date-fns/subMonths";
14
+ import { b as E, C as _, c as O } from "./Category-CevNQ03n.mjs";
15
+ import { f as L, a as T } from "./Dialog-BPTr3qHE.mjs";
16
+ const at = ({
17
+ onClick: e,
18
+ leftIcon: t,
19
+ rightIcon: o,
20
+ title: r,
21
+ subtitle: a,
22
+ rightContent: n,
23
+ titleBold: s = !0,
24
+ rightContentBold: m = !0
25
+ }) => {
26
+ const c = /* @__PURE__ */ d(x.Fragment, { children: [
27
+ t && /* @__PURE__ */ l(f, { sx: { ml: 0 }, children: t }),
28
+ /* @__PURE__ */ l(A, { children: /* @__PURE__ */ d(
29
+ h,
30
+ {
31
+ sx: {
32
+ alignItems: "center",
33
+ flexDirection: "row",
34
+ marginLeft: 12
35
+ },
36
+ children: [
37
+ /* @__PURE__ */ d(h, { sx: { flex: 1, minWidth: 0 }, children: [
38
+ /* @__PURE__ */ l(y, { bold: s, variant: "body1", children: r }),
39
+ a && /* @__PURE__ */ l(y, { variant: "caption", children: a })
40
+ ] }),
41
+ /* @__PURE__ */ d(h, { sx: { flexDirection: "row", alignItems: "center", gap: 1 }, children: [
42
+ n && /* @__PURE__ */ l(y, { bold: m, display: "flex", variant: "body1", children: n }),
43
+ o && /* @__PURE__ */ l(f, { children: o })
44
+ ] })
45
+ ]
46
+ }
47
+ ) })
48
+ ] });
49
+ return /* @__PURE__ */ l(S, { sx: { bgcolor: "background.paper" }, children: e ? /* @__PURE__ */ l(
50
+ R,
51
+ {
52
+ onClick: e,
53
+ sx: {
54
+ py: 14
55
+ },
56
+ children: c
57
+ }
58
+ ) : /* @__PURE__ */ l(
59
+ h,
60
+ {
61
+ sx: {
62
+ py: 14,
63
+ px: 24,
64
+ width: "100%",
65
+ flexDirection: "row",
66
+ alignItems: "center"
67
+ },
68
+ children: c
69
+ }
70
+ ) });
71
+ }, W = (e) => _[e] ?? _.default, F = (e) => O[e];
72
+ function G(e, t) {
73
+ const o = [], r = new Date(e);
74
+ for (; r <= t; ) {
75
+ const a = r.getFullYear(), n = String(r.getMonth() + 1).padStart(2, "0");
76
+ o.push(+`${a}${n}`), r.setMonth(r.getMonth() + 1);
77
+ }
78
+ return o;
79
+ }
80
+ const $ = (e) => e.reduce((o, r) => {
81
+ const a = {
82
+ top_level_category_guid: r.top_level_category_guid,
83
+ category_guid: r.category_guid,
84
+ amount: r.total,
85
+ year_month: r.year_month
86
+ }, { top_level_category_guid: n, category_guid: s } = a;
87
+ return o[s] || (o[s] = []), o[s].push(a), n !== s && (o[n] || (o[n] = []), o[n].push(a)), o;
88
+ }, {}), nt = (e, t, o) => {
89
+ const r = $(e), a = G(t, o);
90
+ return Object.entries(r).map(([s, m]) => {
91
+ const c = m[0].top_level_category_guid, b = a.map((i) => {
92
+ const g = m.filter((p) => p.year_month === i).reduce((p, M) => p + Math.abs(M.amount), 0), u = Number(String(i).slice(0, 4)), C = Number(String(i).slice(4));
93
+ return { x: new Date(u, C - 1), y: g };
94
+ }).sort((i, g) => i.x.getTime() - g.x.getTime());
95
+ return {
96
+ top_level_category_guid: c,
97
+ category_guid: s,
98
+ category_name: F(s),
99
+ category_color: W(c),
100
+ dataset: b
101
+ };
102
+ });
103
+ }, st = (e, t) => {
104
+ const o = typeof e == "string" ? parseFloat(e.replace(/[^0-9.-]+/g, "")) : e, r = typeof t == "string" ? parseFloat(t.replace(/[^0-9.-]+/g, "")) : t;
105
+ return (o || 0) - (r || 0);
106
+ }, j = (e, t) => {
107
+ const o = e.subCategories.filter((n) => n.currentAmount !== 0), r = e.totalMonthlyAmounts.slice(-t), a = (n) => n.substring(0, 3) + " " + n.slice(-4);
108
+ return r.map((n) => {
109
+ const s = a(n.label), m = o.map((i) => {
110
+ const g = i.monthlyAmounts.slice(-t).find((u) => a(u.label) === s);
111
+ return {
112
+ label: i.name,
113
+ amount: Math.abs(g?.amount || 0),
114
+ header: s
115
+ };
116
+ }), c = e.monthlyAmounts.slice(-t).find((i) => a(i.label) === s);
117
+ return [{
118
+ label: e.name,
119
+ amount: Math.abs(c?.amount || 0),
120
+ header: s
121
+ }, ...m].sort((i, g) => g.amount - i.amount);
122
+ });
123
+ }, k = (e, t) => {
124
+ const o = e ? e.totalMonthlyAmounts.slice(-t).map((a) => ({
125
+ x: a.label.substring(0, 3),
126
+ y: Math.abs(a.amount)
127
+ })) : [], r = e ? j(e, t) : [];
128
+ return { monthlyAmounts: o, tooltipLabels: r };
129
+ }, H = (e) => e.slice().filter(
130
+ (t) => t.totalAmount !== 0 && t.isTransfer === !1 && t.guid !== E.INVESTMENTS
131
+ ).sort((t, o) => Math.abs(o.totalAmount) - Math.abs(t.totalAmount));
132
+ class it {
133
+ globalStore;
134
+ selectedCategoryData = null;
135
+ selectedDateRange;
136
+ visibleListLength = 5;
137
+ constructor(t) {
138
+ this.globalStore = t, this.selectedDateRange = {
139
+ start: v(D(I(/* @__PURE__ */ new Date(), 6)), 1),
140
+ end: D(/* @__PURE__ */ new Date())
141
+ }, N(this);
142
+ }
143
+ setSelectedCategoryData = (t) => {
144
+ this.selectedCategoryData = t;
145
+ };
146
+ setSelectedDateRange = (t) => {
147
+ this.selectedDateRange = t;
148
+ };
149
+ setVisibleListLength = (t) => {
150
+ this.visibleListLength = t;
151
+ };
152
+ get sortedDetailedCategoriesWithTransactions() {
153
+ return H(
154
+ this.globalStore.categoryStore.detailedCategoriesWithTransactions
155
+ );
156
+ }
157
+ get selectedDateRangeMonthCount() {
158
+ return w(this.selectedDateRange.end, this.selectedDateRange.start) + 1;
159
+ }
160
+ get selectedDateRangeMonthRange() {
161
+ const t = L(this.selectedDateRange.start, T.MONTH_LONG), o = L(this.selectedDateRange.end, T.MONTH_LONG);
162
+ return `${t} - ${o}`;
163
+ }
164
+ get visibleCategories() {
165
+ return this.sortedDetailedCategoriesWithTransactions.slice(0, this.visibleListLength);
166
+ }
167
+ get collapsedCategories() {
168
+ return this.sortedDetailedCategoriesWithTransactions.slice(this.visibleListLength);
169
+ }
170
+ get categoryDetailsChartData() {
171
+ return k(
172
+ this.selectedCategoryData,
173
+ this.selectedDateRangeMonthCount
174
+ );
175
+ }
176
+ }
177
+ export {
178
+ at as L,
179
+ it as T,
180
+ st as a,
181
+ nt as g
182
+ };