@mx-cartographer/experiences 9.1.0-alpha.bb1 → 9.1.1

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 (248) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +10 -10
  3. package/dist/Account-DR7Plrqy.mjs +119 -0
  4. package/dist/Account-DR7Plrqy.mjs.map +1 -0
  5. package/dist/AccountDetailsDrawer-C1hhmlmI.mjs +922 -0
  6. package/dist/AccountDetailsDrawer-C1hhmlmI.mjs.map +1 -0
  7. package/dist/AccountDetailsHeader-BliEZhz7.mjs +230 -0
  8. package/dist/AccountDetailsHeader-BliEZhz7.mjs.map +1 -0
  9. package/dist/AccountUtils-Cbh8r9cP.mjs +29 -0
  10. package/dist/AccountUtils-Cbh8r9cP.mjs.map +1 -0
  11. package/dist/Analytics-CkYXKvco.mjs +54 -0
  12. package/dist/Analytics-CkYXKvco.mjs.map +1 -0
  13. package/dist/Analytics-WeZYytR0.mjs +140 -0
  14. package/dist/Analytics-WeZYytR0.mjs.map +1 -0
  15. package/dist/ApiEndpoints-DXwIYNUV.mjs +50 -0
  16. package/dist/ApiEndpoints-DXwIYNUV.mjs.map +1 -0
  17. package/dist/BeatMaterialIcon-1KOfRZrA.mjs +27 -0
  18. package/dist/BeatMaterialIcon-1KOfRZrA.mjs.map +1 -0
  19. package/dist/BudgetUtil-Bg2AQJpQ.mjs +75 -0
  20. package/dist/BudgetUtil-Bg2AQJpQ.mjs.map +1 -0
  21. package/dist/Category-DEKZGLYe.mjs +302 -0
  22. package/dist/Category-DEKZGLYe.mjs.map +1 -0
  23. package/dist/CategorySelectorDrawer-NJsFsKP1.mjs +431 -0
  24. package/dist/CategorySelectorDrawer-NJsFsKP1.mjs.map +1 -0
  25. package/dist/Connect-BH0Pt6zc.mjs +43 -0
  26. package/dist/Connect-BH0Pt6zc.mjs.map +1 -0
  27. package/dist/ConnectCard-D7uxoH5Y.mjs +55 -0
  28. package/dist/ConnectCard-D7uxoH5Y.mjs.map +1 -0
  29. package/dist/ConnectDrawer-CW4LA3H3.mjs +58 -0
  30. package/dist/ConnectDrawer-CW4LA3H3.mjs.map +1 -0
  31. package/dist/ConnectionsDrawer-CZU9ku-k.mjs +54 -0
  32. package/dist/ConnectionsDrawer-CZU9ku-k.mjs.map +1 -0
  33. package/dist/CurrencyDialog-DumQCTPO.mjs +374 -0
  34. package/dist/CurrencyDialog-DumQCTPO.mjs.map +1 -0
  35. package/dist/CurrencyInput-DaGEQaLW.mjs +88 -0
  36. package/dist/CurrencyInput-DaGEQaLW.mjs.map +1 -0
  37. package/dist/CurrencyText-CCbE6MmF.mjs +21 -0
  38. package/dist/CurrencyText-CCbE6MmF.mjs.map +1 -0
  39. package/dist/DateFormats-HudZ3Bjs.mjs +65 -0
  40. package/dist/DateFormats-HudZ3Bjs.mjs.map +1 -0
  41. package/dist/DateUtil-CzBmbjmA.mjs +75 -0
  42. package/dist/DateUtil-CzBmbjmA.mjs.map +1 -0
  43. package/dist/DebtUtils-i4pI2Uoe.mjs +154 -0
  44. package/dist/DebtUtils-i4pI2Uoe.mjs.map +1 -0
  45. package/dist/Dialog-Bvd2n8hz.mjs +67 -0
  46. package/dist/Dialog-Bvd2n8hz.mjs.map +1 -0
  47. package/dist/Donut-SzzfZDHF.mjs +89 -0
  48. package/dist/Donut-SzzfZDHF.mjs.map +1 -0
  49. package/dist/Drawer-DsnW2o0v.mjs +175 -0
  50. package/dist/Drawer-DsnW2o0v.mjs.map +1 -0
  51. package/dist/EmbeddedCard-DH8vQ3qN.mjs +859 -0
  52. package/dist/EmbeddedCard-DH8vQ3qN.mjs.map +1 -0
  53. package/dist/EmptyState-CJUDc3kD.mjs +85 -0
  54. package/dist/EmptyState-CJUDc3kD.mjs.map +1 -0
  55. package/dist/Error-Dtw6yxkf.mjs +85 -0
  56. package/dist/Error-Dtw6yxkf.mjs.map +1 -0
  57. package/dist/ErrorBoundary-CsdOcnJ9.mjs +24 -0
  58. package/dist/ErrorBoundary-CsdOcnJ9.mjs.map +1 -0
  59. package/dist/ExportCsvAction-C9KWH3Az.mjs +25 -0
  60. package/dist/ExportCsvAction-C9KWH3Az.mjs.map +1 -0
  61. package/dist/GlobalAccountFilter-BhzR5Vb1.mjs +230 -0
  62. package/dist/GlobalAccountFilter-BhzR5Vb1.mjs.map +1 -0
  63. package/dist/GlobalCopyApi-wcnDUzMV.mjs +129 -0
  64. package/dist/GlobalCopyApi-wcnDUzMV.mjs.map +1 -0
  65. package/dist/GoalsUtil-C9EnLWvC.mjs +108 -0
  66. package/dist/GoalsUtil-C9EnLWvC.mjs.map +1 -0
  67. package/dist/HeaderCell-P8w6CmfO.mjs +7 -0
  68. package/dist/HeaderCell-P8w6CmfO.mjs.map +1 -0
  69. package/dist/Help-CkQTjORd.mjs +300 -0
  70. package/dist/Help-CkQTjORd.mjs.map +1 -0
  71. package/dist/Help-aERwhajy.mjs +3210 -0
  72. package/dist/Help-aERwhajy.mjs.map +1 -0
  73. package/dist/IconBacking-DgT8DCeh.mjs +40 -0
  74. package/dist/IconBacking-DgT8DCeh.mjs.map +1 -0
  75. package/dist/InformationTooltip-4su8bn1e.mjs +42 -0
  76. package/dist/InformationTooltip-4su8bn1e.mjs.map +1 -0
  77. package/dist/InvestmentUtil-BItV7uEs.mjs +135 -0
  78. package/dist/InvestmentUtil-BItV7uEs.mjs.map +1 -0
  79. package/dist/LineChart-CUfiH86G.mjs +613 -0
  80. package/dist/LineChart-CUfiH86G.mjs.map +1 -0
  81. package/dist/ListItemAction-BqUCLj_w.mjs +70 -0
  82. package/dist/ListItemAction-BqUCLj_w.mjs.map +1 -0
  83. package/dist/ListItemRow-kH1rn8Xu.mjs +68 -0
  84. package/dist/ListItemRow-kH1rn8Xu.mjs.map +1 -0
  85. package/dist/ListItemWrapper-DRse79Iu.mjs +44 -0
  86. package/dist/ListItemWrapper-DRse79Iu.mjs.map +1 -0
  87. package/dist/Loader-CxeBwuPG.mjs +22 -0
  88. package/dist/Loader-CxeBwuPG.mjs.map +1 -0
  89. package/dist/Localization-DnoVyBNK.mjs +39 -0
  90. package/dist/Localization-DnoVyBNK.mjs.map +1 -0
  91. package/dist/ManageIncome-Be9WHv-s.mjs +906 -0
  92. package/dist/ManageIncome-Be9WHv-s.mjs.map +1 -0
  93. package/dist/MicroWidgetContainer-B2NnKBgW.mjs +46 -0
  94. package/dist/MicroWidgetContainer-B2NnKBgW.mjs.map +1 -0
  95. package/dist/MiniWidgetContainer-Bmv_WeUd.mjs +67 -0
  96. package/dist/MiniWidgetContainer-Bmv_WeUd.mjs.map +1 -0
  97. package/dist/NetWorthUtils-Dj7CgAg2.mjs +96 -0
  98. package/dist/NetWorthUtils-Dj7CgAg2.mjs.map +1 -0
  99. package/dist/Notification-DTNYSd8P.mjs +8 -0
  100. package/dist/Notification-DTNYSd8P.mjs.map +1 -0
  101. package/dist/NotificationSettings-CW7okUrk.mjs +678 -0
  102. package/dist/NotificationSettings-CW7okUrk.mjs.map +1 -0
  103. package/dist/NotificationUtils-BRGFTePr.mjs +24 -0
  104. package/dist/NotificationUtils-BRGFTePr.mjs.map +1 -0
  105. package/dist/NumberFormatting--XMeeBfr.mjs +50 -0
  106. package/dist/NumberFormatting--XMeeBfr.mjs.map +1 -0
  107. package/dist/OriginalBalanceAction-YrvxBYAl.mjs +115 -0
  108. package/dist/OriginalBalanceAction-YrvxBYAl.mjs.map +1 -0
  109. package/dist/RecurringSettings-kRqAViNn.mjs +89 -0
  110. package/dist/RecurringSettings-kRqAViNn.mjs.map +1 -0
  111. package/dist/RecurringTransactionsUtil-CHWmqvW5.mjs +299 -0
  112. package/dist/RecurringTransactionsUtil-CHWmqvW5.mjs.map +1 -0
  113. package/dist/ResponsiveButton-CC9F_Ezk.mjs +46 -0
  114. package/dist/ResponsiveButton-CC9F_Ezk.mjs.map +1 -0
  115. package/dist/SearchBox-Cpgu_gdO.mjs +51 -0
  116. package/dist/SearchBox-Cpgu_gdO.mjs.map +1 -0
  117. package/dist/Select-CSpkK5cR.mjs +62 -0
  118. package/dist/Select-CSpkK5cR.mjs.map +1 -0
  119. package/dist/SelectionBox-B4xELRgp.mjs +49 -0
  120. package/dist/SelectionBox-B4xELRgp.mjs.map +1 -0
  121. package/dist/SingleSegmentDonut-7Uy6VEld.mjs +70 -0
  122. package/dist/SingleSegmentDonut-7Uy6VEld.mjs.map +1 -0
  123. package/dist/Sizes-DISGrlUg.mjs +7 -0
  124. package/dist/Sizes-DISGrlUg.mjs.map +1 -0
  125. package/dist/SkeletonLoader-BaNboJjD.mjs +39 -0
  126. package/dist/SkeletonLoader-BaNboJjD.mjs.map +1 -0
  127. package/dist/SpendingData-Fii_xATx.mjs +54 -0
  128. package/dist/SpendingData-Fii_xATx.mjs.map +1 -0
  129. package/dist/SpendingLegend-CxvNOg3c.mjs +204 -0
  130. package/dist/SpendingLegend-CxvNOg3c.mjs.map +1 -0
  131. package/dist/StatusBar-CPfSXe80.mjs +31 -0
  132. package/dist/StatusBar-CPfSXe80.mjs.map +1 -0
  133. package/dist/TabContentContainer-B0eYJP5p.mjs +49 -0
  134. package/dist/TabContentContainer-B0eYJP5p.mjs.map +1 -0
  135. package/dist/ToggleListItem-Dl1lXNwj.mjs +92 -0
  136. package/dist/ToggleListItem-Dl1lXNwj.mjs.map +1 -0
  137. package/dist/TransactionDetails-roZ5xLq8.mjs +1708 -0
  138. package/dist/TransactionDetails-roZ5xLq8.mjs.map +1 -0
  139. package/dist/TransactionUtils-BphBJBbU.mjs +235 -0
  140. package/dist/TransactionUtils-BphBJBbU.mjs.map +1 -0
  141. package/dist/TrendsUtil-D9z3kIj_.mjs +70 -0
  142. package/dist/TrendsUtil-D9z3kIj_.mjs.map +1 -0
  143. package/dist/UserStore-BjnNCO5a.mjs +3121 -0
  144. package/dist/UserStore-BjnNCO5a.mjs.map +1 -0
  145. package/dist/ViewMoreMicroCard-fnwE0hqd.mjs +1280 -0
  146. package/dist/ViewMoreMicroCard-fnwE0hqd.mjs.map +1 -0
  147. package/dist/WidgetContainer-DJnp6t6c.mjs +483 -0
  148. package/dist/WidgetContainer-DJnp6t6c.mjs.map +1 -0
  149. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsDrawer.d.ts +6 -0
  150. package/dist/accounts/index.d.ts +1 -0
  151. package/dist/accounts/index.es.js +784 -12
  152. package/dist/accounts/index.es.js.map +1 -0
  153. package/dist/analytics/index.es.js +140 -155
  154. package/dist/analytics/index.es.js.map +1 -0
  155. package/dist/budgets/index.es.js +1267 -1317
  156. package/dist/budgets/index.es.js.map +1 -0
  157. package/dist/cashflow/context/hooks.d.ts +7 -6
  158. package/dist/cashflow/index.es.js +944 -1076
  159. package/dist/cashflow/index.es.js.map +1 -0
  160. package/dist/categories/index.es.js +5 -4
  161. package/dist/categories/index.es.js.map +1 -0
  162. package/dist/common/components/DataRow.d.ts +1 -0
  163. package/dist/common/components/ListItemWrapper.d.ts +2 -1
  164. package/dist/common/constants/Analytics.d.ts +3 -0
  165. package/dist/common/index.es.js +310 -101
  166. package/dist/common/index.es.js.map +1 -0
  167. package/dist/core/index.es.js +105 -80
  168. package/dist/core/index.es.js.map +1 -0
  169. package/dist/core/stores/CashflowStore.d.ts +8 -7
  170. package/dist/core/stores/RecurringTransactionsStore.d.ts +53 -1
  171. package/dist/core/stores/TransactionStore.d.ts +1 -0
  172. package/dist/core/types/localization/RecurringCopy.d.ts +14 -1
  173. package/dist/core/types/localization/SpendingCopy.d.ts +1 -0
  174. package/dist/core/utils/AccountUtils.d.ts +8 -0
  175. package/dist/core/utils/DateUtil.d.ts +2 -0
  176. package/dist/core/utils/RecurringTransactionsUtil.d.ts +2 -1
  177. package/dist/dashboard/index.es.js +142 -185
  178. package/dist/dashboard/index.es.js.map +1 -0
  179. package/dist/debts/index.es.js +1273 -1384
  180. package/dist/debts/index.es.js.map +1 -0
  181. package/dist/finstrong/index.es.js +3473 -3367
  182. package/dist/finstrong/index.es.js.map +1 -0
  183. package/dist/goals/index.es.js +984 -1103
  184. package/dist/goals/index.es.js.map +1 -0
  185. package/dist/help/index.es.js +26 -3
  186. package/dist/help/index.es.js.map +1 -0
  187. package/dist/hooks-97sNJ_lf.mjs +78 -0
  188. package/dist/hooks-97sNJ_lf.mjs.map +1 -0
  189. package/dist/insights/components/insights/WeeklyNoSpendDays/BubbleWeek.d.ts +4 -1
  190. package/dist/insights/components/insights/WeeklyNoSpendDays/WeeklyNoSpendDays.d.ts +4 -2
  191. package/dist/insights/index.es.js +4871 -93
  192. package/dist/insights/index.es.js.map +1 -0
  193. package/dist/investments/index.es.js +1523 -1533
  194. package/dist/investments/index.es.js.map +1 -0
  195. package/dist/merchants/index.es.js +65 -75
  196. package/dist/merchants/index.es.js.map +1 -0
  197. package/dist/microinsights/index.es.js +826 -15
  198. package/dist/microinsights/index.es.js.map +1 -0
  199. package/dist/networth/index.es.js +504 -550
  200. package/dist/networth/index.es.js.map +1 -0
  201. package/dist/notifications/index.es.js +162 -169
  202. package/dist/notifications/index.es.js.map +1 -0
  203. package/dist/recurringtransactions/components/RecurringTransactionDetails.d.ts +3 -2
  204. package/dist/recurringtransactions/components/RecurringTransactionDetailsDrawer.d.ts +3 -0
  205. package/dist/recurringtransactions/components/RecurringTransactionList.d.ts +11 -0
  206. package/dist/recurringtransactions/components/UpcomingRecurrenceCard.d.ts +8 -0
  207. package/dist/recurringtransactions/components/actions/LinkTransactionDrawer.d.ts +10 -0
  208. package/dist/recurringtransactions/components/actions/MarkAsPaidDialog.d.ts +7 -0
  209. package/dist/recurringtransactions/components/actions/MarkAsUnpaidDialog.d.ts +7 -0
  210. package/dist/recurringtransactions/index.es.js +1012 -10
  211. package/dist/recurringtransactions/index.es.js.map +1 -0
  212. package/dist/settings/index.es.js +892 -13
  213. package/dist/settings/index.es.js.map +1 -0
  214. package/dist/spending/index.es.js +457 -400
  215. package/dist/spending/index.es.js.map +1 -0
  216. package/dist/transactions/components/shared/transactionlist/TransactionRow.d.ts +1 -0
  217. package/dist/transactions/index.es.js +604 -10
  218. package/dist/transactions/index.es.js.map +1 -0
  219. package/dist/trends/index.es.js +1408 -1268
  220. package/dist/trends/index.es.js.map +1 -0
  221. package/dist/useAccountDisplayName-BsiXA0qf.mjs +24 -0
  222. package/dist/useAccountDisplayName-BsiXA0qf.mjs.map +1 -0
  223. package/dist/useAriaLive-MkYebyUR.mjs +36 -0
  224. package/dist/useAriaLive-MkYebyUR.mjs.map +1 -0
  225. package/dist/useDimensions-CeDR9V8N.mjs +37 -0
  226. package/dist/useDimensions-CeDR9V8N.mjs.map +1 -0
  227. package/dist/useInsightsEnabled-D5Sdm0TJ.mjs +12 -0
  228. package/dist/useInsightsEnabled-D5Sdm0TJ.mjs.map +1 -0
  229. package/dist/useScreenSize-mWpmnh5w.mjs +37 -0
  230. package/dist/useScreenSize-mWpmnh5w.mjs.map +1 -0
  231. package/dist/useWidgetLoadTimer-B0tB-yzL.mjs +20 -0
  232. package/dist/useWidgetLoadTimer-B0tB-yzL.mjs.map +1 -0
  233. package/package.json +30 -30
  234. package/dist/Analytics-BKzTPees.mjs +0 -61
  235. package/dist/GlobalCopyApi-BeXzaDH9.mjs +0 -487
  236. package/dist/HeaderCell-EhCUSjvj.mjs +0 -10
  237. package/dist/Loader-BlVzRtUd.mjs +0 -73
  238. package/dist/MiniWidgetContainer-COwnjfy7.mjs +0 -110
  239. package/dist/OriginalBalanceAction-sbiqaxok.mjs +0 -110
  240. package/dist/SpendingLegend-D15ixlQ1.mjs +0 -222
  241. package/dist/accounts-DkyAiLpg.mjs +0 -15632
  242. package/dist/core-BexP5oiV.mjs +0 -4047
  243. package/dist/help-CctDYrAH.mjs +0 -2308
  244. package/dist/insights/components/insights/P2pCategorization/_tests_/P2pCategorizationMultipleTransaction.test.d.ts +0 -0
  245. package/dist/insights/components/insights/P2pCategorization/_tests_/P2pCategorizationSingleTransaction.test.d.ts +0 -0
  246. package/dist/microinsights-CRf3ChsJ.mjs +0 -1814
  247. package/dist/recurringtransactions-gbJ_NA8u.mjs +0 -1564
  248. package/dist/settings-ZMHe439l.mjs +0 -1526
@@ -1,1564 +0,0 @@
1
- import { a as X, f as pe, l as ct, s as K } from "./GlobalCopyApi-BeXzaDH9.mjs";
2
- import { J as P, Y as lt, _t as B, bt as Fe, d as se, f as Pe, gt as $, h as dt, ht as L, ln as N, mt as v, p as ut, un as O } from "./core-BexP5oiV.mjs";
3
- import { $t as We, En as ie, Fn as le, Gn as mt, Pn as he, Rn as pt, an as ht, c as gt, lr as z, mr as ze, nn as _t, qn as yt, rn as ft, sr as w, ur as Ct, xn as Ue, yr as $e } from "./accounts-DkyAiLpg.mjs";
4
- import { n as ye } from "./Analytics-BKzTPees.mjs";
5
- import { E as V, O as xt, d as F, h as ee, k as Be, p as C, t as fe, w as I } from "./Loader-BlVzRtUd.mjs";
6
- import { n as bt, t as vt } from "./MiniWidgetContainer-COwnjfy7.mjs";
7
- import p from "react";
8
- import { observer as b } from "mobx-react-lite";
9
- import u from "@mui/material/Stack";
10
- import { H2 as Rt, H3 as St, InstitutionLogo as He, MerchantLogo as te, P as H, Text as y } from "@mxenabled/mxui";
11
- import { addMonths as wt } from "date-fns/addMonths";
12
- import { endOfMonth as j } from "date-fns/endOfMonth";
13
- import { isBefore as Dt } from "date-fns/isBefore";
14
- import { startOfMonth as q } from "date-fns/startOfMonth";
15
- import { startOfToday as W } from "date-fns/startOfToday";
16
- import { subMonths as Tt } from "date-fns/subMonths";
17
- import Ce from "@mui/material/Button";
18
- import { Add as It, Cancel as Ye, CheckCircle as Ke, ChevronLeft as Et, ChevronRight as At, CurrencyExchange as Lt, Delete as Mt, MonetizationOn as Nt, ReceiptLong as Ot, Schedule as kt } from "@mxenabled/mx-icons";
19
- import { Fragment as G, jsx as e, jsxs as s } from "react/jsx-runtime";
20
- import { isSameDay as Gt } from "date-fns/isSameDay";
21
- import { useTheme as xe } from "@mui/material/styles";
22
- import T from "@mui/material/Box";
23
- import { addYears as Ae } from "date-fns/addYears";
24
- import { endOfToday as be } from "date-fns/endOfToday";
25
- import { subDays as ne } from "date-fns/subDays";
26
- import ce from "@mui/material/Tab";
27
- import je from "@mui/material/Tabs";
28
- import Le from "@mui/material/IconButton";
29
- import { fromUnixTime as Ft } from "date-fns/fromUnixTime";
30
- import { formatISO as Pt } from "date-fns/formatISO";
31
- import { parseISO as Wt } from "date-fns/parseISO";
32
- import { setDayOfYear as zt } from "date-fns/setDayOfYear";
33
- import k from "@mui/material/Divider";
34
- import J from "@mui/material/List";
35
- import ve from "@mui/material/ListItem";
36
- import qe from "@mui/material/ListItemButton";
37
- import Qe from "@mui/material/ListItemText";
38
- import Xe from "@mui/material/ListItemAvatar";
39
- import Ut from "@mui/material/ListSubheader";
40
- import $t from "@mui/material/Badge";
41
- import { AdapterDateFns as Ze } from "@mui/x-date-pickers/AdapterDateFnsV3";
42
- import { DateCalendar as Bt } from "@mui/x-date-pickers/DateCalendar";
43
- import me from "@mui/material/Grid";
44
- import { getDayOfYear as Ht } from "date-fns/getDayOfYear";
45
- import { DatePicker as Yt } from "@mui/x-date-pickers";
46
- import { LocalizationProvider as Je } from "@mui/x-date-pickers/LocalizationProvider";
47
- import { getWeeksInMonth as Me } from "date-fns/getWeeksInMonth";
48
- import { enCA as Kt } from "date-fns/locale/en-CA";
49
- import { enUS as Ne } from "date-fns/locale/en-US";
50
- import { es as jt } from "date-fns/locale/es";
51
- import { fr as qt } from "date-fns/locale/fr";
52
- import { frCA as Qt } from "date-fns/locale/fr-CA";
53
- import { PickersDay as Xt } from "@mui/x-date-pickers/PickersDay";
54
- var Ve = ({ frequency: t, firstDay: n, secondDay: r, onFrequencyChange: i, onFirstDayChange: o, onSecondDayChange: l }) => {
55
- const { recurring: a } = C(), c = p.useMemo(() => [
56
- {
57
- id: v.EveryWeek,
58
- label: a.frequency_every_week
59
- },
60
- {
61
- id: v.EveryOtherWeek,
62
- label: a.frequency_every_other_week
63
- },
64
- {
65
- id: v.TwiceAMonth,
66
- label: a.frequency_twice_a_month
67
- },
68
- {
69
- id: v.EveryMonth,
70
- label: a.frequency_every_month
71
- },
72
- {
73
- id: v.EveryOtherMonth,
74
- label: a.frequency_every_other_month
75
- },
76
- {
77
- id: v.EveryQuarter,
78
- label: a.frequency_every_quarter
79
- },
80
- {
81
- id: v.EveryOtherQuarter,
82
- label: a.frequency_every_other_quarter
83
- },
84
- {
85
- id: v.EveryYear,
86
- label: a.frequency_every_year
87
- }
88
- ], [a]), d = [
89
- {
90
- id: 0,
91
- label: a.weekday_sunday
92
- },
93
- {
94
- id: 1,
95
- label: a.weekday_monday
96
- },
97
- {
98
- id: 2,
99
- label: a.weekday_tuesday
100
- },
101
- {
102
- id: 3,
103
- label: a.weekday_wednesday
104
- },
105
- {
106
- id: 4,
107
- label: a.weekday_thursday
108
- },
109
- {
110
- id: 5,
111
- label: a.weekday_friday
112
- },
113
- {
114
- id: 6,
115
- label: a.weekday_saturday
116
- }
117
- ], m = [...Array(31).keys()].map((R) => ({
118
- id: R + 1,
119
- label: lt(R + 1)
120
- }));
121
- m[30].label += ` (${a.last_day_of_month})`;
122
- const h = m.slice(0, 15), _ = m.slice(14), x = t === v.EveryWeek || t === v.EveryOtherWeek, f = t === v.TwiceAMonth || t === v.EveryMonth || t === v.EveryOtherMonth || t === v.EveryQuarter || t === v.EveryOtherQuarter, D = zt(W(), n), g = D < W() ? Ae(D, 1) : D, E = (R) => {
123
- R && o(Ht(R));
124
- };
125
- return /* @__PURE__ */ s(u, {
126
- gap: 24,
127
- sx: { m: 24 },
128
- children: [
129
- /* @__PURE__ */ e(ie, {
130
- label: a.frequency,
131
- onChange: i,
132
- options: c,
133
- value: t
134
- }),
135
- x && /* @__PURE__ */ e(ie, {
136
- label: a.day_of_the_week,
137
- onChange: o,
138
- options: d,
139
- value: n
140
- }),
141
- f && /* @__PURE__ */ e(ie, {
142
- label: t === v.TwiceAMonth ? a.first_day_of_the_month : a.day_of_the_month,
143
- onChange: o,
144
- options: t === v.TwiceAMonth ? h : m,
145
- value: n
146
- }),
147
- t === v.TwiceAMonth && /* @__PURE__ */ e(ie, {
148
- label: a.second_day_of_the_month,
149
- onChange: l,
150
- options: _,
151
- value: r || 0
152
- }),
153
- t === v.EveryYear && /* @__PURE__ */ e(Je, {
154
- dateAdapter: Ze,
155
- children: /* @__PURE__ */ e(Yt, {
156
- disablePast: !0,
157
- label: a.next_payment_date,
158
- maxDate: ne(Ae(W(), 1), 1),
159
- minDate: W(),
160
- onChange: E,
161
- value: g
162
- })
163
- })
164
- ]
165
- });
166
- }, Zt = b(({ repeatingTransaction: t }) => {
167
- const { recurring: n } = C(), { updateRepeatingTransaction: r } = I(), { onEvent: i } = F(), [o, l] = p.useState(!1), [a, c] = p.useState(t.recurrence_type), [d, m] = p.useState(t.recurrence_day), [h, _] = p.useState(t.second_recurrence_day), x = async () => {
168
- await r({
169
- ...t,
170
- recurrence_type: a,
171
- recurrence_day: d,
172
- second_recurrence_day: h
173
- }), l(!1);
174
- }, f = () => {
175
- l(!0), i(w.RECURRING_TRANSACTIONS_DETAILS_CLICK_PAYMENT_SCHEDULE);
176
- };
177
- return /* @__PURE__ */ s(G, { children: [/* @__PURE__ */ e(he, {
178
- iconName: "sync",
179
- label: n.activity_schedule,
180
- onClick: f,
181
- value: `${se(n, t, !0)}`
182
- }), /* @__PURE__ */ e(z, {
183
- ariaLabelClose: n.close_drawer_aria,
184
- isOpen: o,
185
- onClose: () => l(!1),
186
- onPrimaryAction: x,
187
- title: n.payment_schedule,
188
- children: /* @__PURE__ */ e(Ve, {
189
- firstDay: d,
190
- frequency: a,
191
- onFirstDayChange: m,
192
- onFrequencyChange: c,
193
- onSecondDayChange: _,
194
- secondDay: h
195
- })
196
- })] });
197
- }), et = b(({ onDeleted: t, recurringTransaction: n }) => {
198
- const { recurring: r } = C(), { selectedAccountGuids: i } = ee(), { onEvent: o } = F(), { deleteRepeatingTransaction: l } = I(), { setFilter: a, transactions: c } = V(), { amount: d, description: m, merchant_guid: h } = n, [_, x] = p.useState(!1), [f, D] = p.useState("");
199
- p.useEffect(() => {
200
- a({
201
- accounts: i,
202
- dateRange: {
203
- start: ne(W(), 90),
204
- end: j(W())
205
- },
206
- custom: (S) => S.repeating_transaction_guid === n.guid
207
- });
208
- }, [n]);
209
- const g = p.useMemo(() => c.find((S) => S.guid === f), [f, c]), E = n.repeating_transaction_type === B.Income, R = async () => {
210
- await l(n.guid), t();
211
- }, U = () => {
212
- x(!0), o(w.RECURRING_TRANSACTIONS_DETAILS_CLICK_DELETE);
213
- };
214
- return /* @__PURE__ */ s(u, {
215
- bgcolor: "background.default",
216
- direction: "column",
217
- height: "100%",
218
- children: [
219
- /* @__PURE__ */ s(u, {
220
- direction: "column",
221
- m: 24,
222
- children: [
223
- /* @__PURE__ */ e(te, {
224
- categoryGuid: g?.category_guid || "",
225
- merchantGuid: h,
226
- size: 64,
227
- sx: { mb: 12 }
228
- }),
229
- /* @__PURE__ */ e(y, {
230
- bold: !0,
231
- variant: "body1",
232
- children: m
233
- }),
234
- /* @__PURE__ */ s(H, {
235
- color: E ? "success.main" : "text.primary",
236
- sx: { my: 4 },
237
- variant: "h1",
238
- children: [E ? "+" : "", P(d, "0,0.00")]
239
- }),
240
- /* @__PURE__ */ e(y, {
241
- color: "text.secondary",
242
- variant: "body2",
243
- children: `${r.next_payment_date}: ${O(Pe(n.recurrence_type, Wt(n.predicted_occurs_on), n.recurrence_day), N.MONTH_DAY_YEAR)}`
244
- })
245
- ]
246
- }),
247
- /* @__PURE__ */ s(J, {
248
- sx: { bgcolor: "background.paper" },
249
- children: [
250
- n.account && /* @__PURE__ */ s(G, { children: [/* @__PURE__ */ e(he, {
251
- iconName: "checkbook",
252
- label: r.account,
253
- value: n.account.displayName || ""
254
- }), /* @__PURE__ */ e(k, { variant: "inset" })] }),
255
- g?.category && /* @__PURE__ */ s(G, { children: [/* @__PURE__ */ e(he, {
256
- iconName: "monetization_on",
257
- label: r.category,
258
- value: g.category
259
- }), /* @__PURE__ */ e(k, { variant: "inset" })] }),
260
- /* @__PURE__ */ e(Zt, { repeatingTransaction: n }),
261
- /* @__PURE__ */ e(k, {})
262
- ]
263
- }),
264
- /* @__PURE__ */ e(Ce, {
265
- color: "error",
266
- onClick: U,
267
- startIcon: /* @__PURE__ */ e(Mt, {}),
268
- sx: {
269
- mx: 24,
270
- my: 16
271
- },
272
- variant: "text",
273
- children: E ? r.delete_income_title : r.delete_expense_title
274
- }),
275
- /* @__PURE__ */ e(y, {
276
- bold: !0,
277
- sx: {
278
- ml: 24,
279
- mt: 16
280
- },
281
- variant: "body1",
282
- children: r.paid_transactions
283
- }),
284
- /* @__PURE__ */ e(We, {
285
- height: "30dvh",
286
- onClick: D
287
- }),
288
- /* @__PURE__ */ e(z, {
289
- ariaLabelClose: r.close_drawer_aria,
290
- isOpen: !!f && !!g,
291
- onClose: () => D(""),
292
- title: r.transaction_details_drawer_title,
293
- children: g && /* @__PURE__ */ e(gt, { transaction: g })
294
- }),
295
- /* @__PURE__ */ e(Ct, {
296
- copy: {
297
- title: E ? r.delete_income_title : r.delete_expense_title,
298
- close_aria: r.close_drawer_aria
299
- },
300
- isOpen: _,
301
- onClose: () => x(!1),
302
- onPrimaryAction: R,
303
- children: /* @__PURE__ */ e(y, { children: E ? r.delete_income_description : r.delete_expense_description })
304
- })
305
- ]
306
- });
307
- }), tt = b(({ onClick: t = () => {
308
- }, repeatingTransaction: n }) => {
309
- const { recurring: r } = C(), [i, o] = p.useState(!1), l = p.useMemo(() => n.transactions.length === 0 ? "" : n.transactions[0].category_guid || "", [n]), a = n.account?.displayName || "", c = n.repeating_transaction_type === B.Income, d = se(r, n, !0);
310
- return /* @__PURE__ */ s(ve, {
311
- disableGutters: !0,
312
- disablePadding: !0,
313
- children: [/* @__PURE__ */ s(qe, {
314
- onClick: () => {
315
- t(n), o(!0);
316
- },
317
- children: [/* @__PURE__ */ e(Xe, { children: /* @__PURE__ */ e(te, {
318
- categoryGuid: l,
319
- merchantGuid: n.merchant_guid
320
- }) }), /* @__PURE__ */ e(Qe, { children: /* @__PURE__ */ s(u, {
321
- direction: "row",
322
- gap: 4,
323
- sx: { justifyContent: "space-between" },
324
- children: [/* @__PURE__ */ s(u, {
325
- direction: "column",
326
- sx: { width: "50%" },
327
- children: [/* @__PURE__ */ e(y, {
328
- bold: !0,
329
- variant: "body1",
330
- children: n.description
331
- }), /* @__PURE__ */ s(u, {
332
- alignItems: "center",
333
- direction: "row",
334
- gap: 6,
335
- children: [n.account?.institution_guid && /* @__PURE__ */ e(He, {
336
- alt: a,
337
- institutionGuid: n.account?.institution_guid,
338
- size: 12
339
- }), /* @__PURE__ */ e(y, {
340
- variant: "caption",
341
- children: a
342
- })]
343
- })]
344
- }), /* @__PURE__ */ s(u, {
345
- alignItems: "flex-end",
346
- sx: { width: "50%" },
347
- children: [/* @__PURE__ */ s(y, {
348
- bold: !0,
349
- color: c ? "success.main" : "text.primary",
350
- variant: "body1",
351
- children: [c ? "+" : "", P(n.amount, "0,0.00")]
352
- }), /* @__PURE__ */ e(u, {
353
- direction: "row",
354
- sx: {
355
- alignItems: "center",
356
- gap: 6,
357
- justifyContent: "flex-end",
358
- textTransform: "uppercase",
359
- width: "100%"
360
- },
361
- children: /* @__PURE__ */ e(y, {
362
- bold: !0,
363
- color: "text.secondary",
364
- variant: "caption",
365
- children: d
366
- })
367
- })]
368
- })]
369
- }) })]
370
- }), /* @__PURE__ */ e(z, {
371
- ariaLabelClose: r.close_drawer_aria,
372
- isOpen: i,
373
- onClose: () => o(!1),
374
- title: n.repeating_transaction_type === B.Income ? r.income_details : r.expense_details,
375
- children: /* @__PURE__ */ e(et, {
376
- onDeleted: () => o(!1),
377
- recurringTransaction: n
378
- })
379
- })]
380
- });
381
- }), Jt = b(({ bgcolor: t = "background.default", description: n, onSearch: r, onSelected: i }) => {
382
- const { recurring: o } = C(), { searchValue: l, setSearchValue: a } = ht();
383
- return /* @__PURE__ */ s(u, {
384
- sx: {
385
- bgcolor: t,
386
- gap: 16,
387
- pt: 8
388
- },
389
- children: [
390
- n && /* @__PURE__ */ e(H, {
391
- sx: { mx: 24 },
392
- children: n
393
- }),
394
- /* @__PURE__ */ e(pt, {
395
- ariaLabel: o.select_transaction_search_aria,
396
- cancelAriaLabel: o.select_transaction_search_cancel_aria,
397
- onChange: (c) => {
398
- a(c), r(c);
399
- },
400
- placeholder: o.select_transaction_search_placeholder,
401
- searchValue: l
402
- }),
403
- /* @__PURE__ */ e(We, {
404
- bgcolor: t,
405
- filter: (c) => !!c.merchant_guid,
406
- height: "auto",
407
- onClick: i,
408
- showLoader: !1
409
- })
410
- ]
411
- });
412
- }), Vt = b(({ bgcolor: t = "background.default", firstDay: n, secondDay: r, frequency: i, onFrequencyChange: o, onFirstDayChange: l, onSecondDayChange: a, transaction: c }) => {
413
- const { recurring: d } = C();
414
- return /* @__PURE__ */ s(u, {
415
- bgcolor: t,
416
- gap: 24,
417
- height: "100%",
418
- children: [/* @__PURE__ */ s(u, { children: [/* @__PURE__ */ e(_t, {
419
- bgcolor: t,
420
- children: dt(c.date)
421
- }), /* @__PURE__ */ e(ft, { transaction: c })] }), /* @__PURE__ */ s(T, { children: [/* @__PURE__ */ e(y, {
422
- bold: !0,
423
- sx: { mx: 24 },
424
- variant: "body1",
425
- children: d.payment_schedule
426
- }), /* @__PURE__ */ e(Ve, {
427
- firstDay: n,
428
- frequency: i,
429
- onFirstDayChange: l,
430
- onFrequencyChange: o,
431
- onSecondDayChange: a,
432
- secondDay: r
433
- })] })]
434
- });
435
- }), ge = (t) => t.top_level_category_guid !== pe.INCOME && t.transaction_type === Fe.DEBIT, en = (t, n) => ge(t) ? t.payee?.toLowerCase().includes(n.toLowerCase()) || t.description.toLowerCase().includes(n.toLowerCase()) || t.feed_description.toLowerCase().includes(n.toLowerCase()) : !1, _e = (t) => t.top_level_category_guid === pe.INCOME || t.top_level_category_guid === pe.TRANSFER && t.transaction_type === Fe.CREDIT, tn = (t, n) => _e(t) ? t.payee?.toLowerCase().includes(n.toLowerCase()) || t.description?.toLowerCase().includes(n.toLowerCase()) || t.feed_description?.toLowerCase().includes(n.toLowerCase()) : !1, Re = b(({ isIncome: t = !1, label: n, onAddRecurringTransaction: r = () => null }) => {
436
- const { recurring: i } = C(), { filter: o, setFilter: l, transactions: a } = V(), { addRepeatingTransaction: c } = I(), { user: d } = xt(), [m, h] = p.useState(!1), [_, x] = p.useState(""), [f, D] = p.useState(v.EveryMonth), [g, E] = p.useState(1), [R, U] = p.useState(15), S = p.useMemo(() => a.find((A) => A.guid === _), [_, a]), re = () => {
437
- h(!0), l(t ? {
438
- ...o,
439
- custom: _e
440
- } : {
441
- ...o,
442
- custom: ge
443
- });
444
- }, Q = async () => {
445
- if (!S) {
446
- ae();
447
- return;
448
- }
449
- r();
450
- const A = Pe(f, Ft(S.date), g);
451
- await c({
452
- account_guid: S.account_guid,
453
- amount: S.amount,
454
- created_by: 0,
455
- merchant_guid: S.merchant_guid,
456
- description: S.payee || S.description || S.feed_description,
457
- predicted_occurs_on: Pt(A, { representation: "date" }),
458
- recurrence_day: g,
459
- recurrence_type: f,
460
- repeating_transaction_type: t ? B.Income : B.Bill,
461
- second_recurrence_day: R,
462
- transaction_type: S.transaction_type,
463
- user_guid: d.guid
464
- }, S), ae();
465
- }, ae = () => {
466
- x(""), h(!1);
467
- };
468
- return /* @__PURE__ */ s(G, { children: [
469
- /* @__PURE__ */ e(Ce, {
470
- onClick: re,
471
- startIcon: /* @__PURE__ */ e(It, { size: 24 }),
472
- variant: "contained",
473
- children: n
474
- }),
475
- /* @__PURE__ */ e(z, {
476
- ariaLabelClose: i.close_drawer_aria,
477
- isOpen: m,
478
- onClose: () => h(!1),
479
- title: n,
480
- children: /* @__PURE__ */ e(Jt, {
481
- description: t ? i.add_income_description : i.add_expense_description,
482
- onSearch: (A) => {
483
- l({
484
- ...o,
485
- custom: (Y) => t ? A ? tn(Y, A) : _e(Y) : A ? en(Y, A) : ge(Y)
486
- });
487
- },
488
- onSelected: (A) => x(A)
489
- })
490
- }),
491
- /* @__PURE__ */ e(z, {
492
- ariaLabelClose: i.close_drawer_aria,
493
- isOpen: !!_,
494
- onClose: () => x(""),
495
- onPrimaryAction: Q,
496
- title: t ? i.income_details : i.expense_details,
497
- children: S && /* @__PURE__ */ e(Vt, {
498
- firstDay: g,
499
- frequency: f,
500
- onFirstDayChange: E,
501
- onFrequencyChange: D,
502
- onSecondDayChange: U,
503
- secondDay: R,
504
- transaction: S
505
- })
506
- })
507
- ] });
508
- }), nt = b(({ zeroStateFor: t }) => {
509
- const { recurring: n } = C(), { onEvent: r } = F(), i = t === "income", o = i ? n.recurring_setting_zero_state_income_title : n.recurring_setting_zero_state_expenses_title, l = i ? n.recurring_setting_zero_state_income_description : n.recurring_setting_zero_state_expenses_description, a = i ? n.add_income : n.add_expense;
510
- return /* @__PURE__ */ s(u, {
511
- sx: {
512
- alignItems: "center",
513
- p: 24,
514
- pt: 48
515
- },
516
- children: [
517
- /* @__PURE__ */ e(Ot, { size: 48 }),
518
- /* @__PURE__ */ e(H, {
519
- sx: {
520
- my: 8,
521
- fontWeight: 600
522
- },
523
- variant: "body1",
524
- children: o
525
- }),
526
- /* @__PURE__ */ e(H, {
527
- color: "text.secondary",
528
- sx: { mb: 32 },
529
- variant: "subtitle2",
530
- children: l
531
- }),
532
- /* @__PURE__ */ e(Re, {
533
- isIncome: i,
534
- label: a,
535
- onAddRecurringTransaction: () => {
536
- r(i ? w.RECURRING_TRANSACTIONS_CLICK_ADD_INCOME : w.RECURRING_ACTIVITY_CLICK_ADD_EXPENSE);
537
- }
538
- })
539
- ]
540
- });
541
- }), nn = b(() => {
542
- const { recurring: t } = C(), { detailedRepeatingTransactions: n } = I(), { onEvent: r } = F(), i = (a) => {
543
- r(w.RECURRING_TRANSACTIONS_CLICK_EXPENSE, { repeating_transaction_guid: a.guid });
544
- }, o = () => {
545
- r(w.RECURRING_TRANSACTIONS_CLICK_ADD_EXPENSE);
546
- }, l = n.filter((a) => a.repeating_transaction_type !== B.Income && (a.transactions.length > 0 || a.recurrence_type === v.EveryYear));
547
- return /* @__PURE__ */ e(G, { children: l.length !== 0 ? /* @__PURE__ */ s(u, {
548
- sx: {
549
- height: "calc(100vh - 109px)",
550
- maxHeight: "calc(100vh - 109px)"
551
- },
552
- children: [/* @__PURE__ */ e(T, {
553
- sx: {
554
- flex: 1,
555
- overflow: "auto"
556
- },
557
- children: /* @__PURE__ */ e(J, {
558
- sx: { bgcolor: "background.paper" },
559
- children: l.map((a, c) => /* @__PURE__ */ s(p.Fragment, { children: [/* @__PURE__ */ e(tt, {
560
- onClick: i,
561
- repeatingTransaction: a
562
- }), /* @__PURE__ */ e(k, { variant: c < l.length - 1 ? "inset" : "fullWidth" })] }, a.guid))
563
- })
564
- }), /* @__PURE__ */ s(T, { children: [/* @__PURE__ */ e(k, {}), /* @__PURE__ */ e(T, {
565
- sx: {
566
- alignContent: "center",
567
- bgcolor: "background.paper",
568
- justifyContent: "flex-end",
569
- px: 24,
570
- py: 12,
571
- textAlign: "right"
572
- },
573
- children: /* @__PURE__ */ e(Re, {
574
- label: t.add_expense,
575
- onAddRecurringTransaction: o
576
- })
577
- })] })]
578
- }) : /* @__PURE__ */ e(nt, { zeroStateFor: "expenses" }) });
579
- }), rn = b(({ forOverview: t = !1 }) => {
580
- const { recurring: n } = C(), { detailedRepeatingTransactions: r } = I(), { onEvent: i } = F(), o = (c) => {
581
- i(w.RECURRING_TRANSACTIONS_CLICK_INCOME, { repeating_transaction_guid: c.guid });
582
- }, l = () => {
583
- i(w.RECURRING_TRANSACTIONS_CLICK_ADD_INCOME);
584
- }, a = r.filter((c) => c.repeating_transaction_type === B.Income && (c.transactions.length > 0 || c.recurrence_type === v.EveryYear));
585
- return /* @__PURE__ */ e(G, { children: a.length !== 0 ? /* @__PURE__ */ s(u, {
586
- sx: {
587
- height: t ? "calc(100vh - 62px)" : "calc(100vh - 109px)",
588
- maxHeight: t ? "calc(100vh - 62px)" : "calc(100vh - 109px)"
589
- },
590
- children: [
591
- t && /* @__PURE__ */ e(y, {
592
- bold: !0,
593
- sx: {
594
- mb: 4,
595
- mt: 12,
596
- mx: 24
597
- },
598
- variant: "body2",
599
- children: n.income
600
- }),
601
- /* @__PURE__ */ e(T, {
602
- sx: {
603
- flex: 1,
604
- overflow: "auto"
605
- },
606
- children: /* @__PURE__ */ e(J, {
607
- sx: { bgcolor: "background.paper" },
608
- children: a.map((c, d) => /* @__PURE__ */ s(p.Fragment, { children: [/* @__PURE__ */ e(tt, {
609
- onClick: o,
610
- repeatingTransaction: c
611
- }), /* @__PURE__ */ e(k, { variant: d < a.length - 1 ? "inset" : "fullWidth" })] }, c.guid))
612
- })
613
- }),
614
- /* @__PURE__ */ s(T, { children: [/* @__PURE__ */ e(k, {}), /* @__PURE__ */ e(T, {
615
- sx: {
616
- alignContent: "center",
617
- bgcolor: "background.paper",
618
- justifyContent: "flex-end",
619
- px: 24,
620
- py: 12,
621
- textAlign: "right"
622
- },
623
- children: /* @__PURE__ */ e(Re, {
624
- isIncome: !0,
625
- label: n.add_income,
626
- onAddRecurringTransaction: l
627
- })
628
- })] })
629
- ]
630
- }) : /* @__PURE__ */ e(nt, { zeroStateFor: "income" }) });
631
- }), rt = b(({ defaultSelectedTab: t = 0 }) => {
632
- const [n, r] = p.useState(t), { onEvent: i } = F(), { recurring: o } = C();
633
- return /* @__PURE__ */ s(T, {
634
- bgcolor: "background.default",
635
- height: "100%",
636
- children: [
637
- /* @__PURE__ */ s(je, {
638
- onChange: (a, c) => {
639
- r(c), i(c === 0 ? "recurring_transactions_widget_manage_expenses" : "recurring_transactions_widget_edit_income");
640
- },
641
- sx: {
642
- bgcolor: "background.paper",
643
- mb: 0
644
- },
645
- value: n,
646
- variant: "fullWidth",
647
- children: [/* @__PURE__ */ e(ce, { label: o.expenses }), /* @__PURE__ */ e(ce, { label: o.income })]
648
- }),
649
- n === 0 && /* @__PURE__ */ e(nn, {}),
650
- n === 1 && /* @__PURE__ */ e(rn, {})
651
- ]
652
- });
653
- }), de = {
654
- gridRow: 1,
655
- gridColumn: 1,
656
- zIndex: 2
657
- }, ue = (t) => t ? { margin: "0 0 -6px -4px" } : void 0, Se = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(le, {
658
- backingSx: { backgroundColor: "background.paper" },
659
- size: n,
660
- sx: { ...ue(t) },
661
- children: /* @__PURE__ */ e(kt, {
662
- color: "primary",
663
- filled: !0,
664
- sx: {
665
- fontSize: n,
666
- ...de
667
- }
668
- })
669
- }), we = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(le, {
670
- backingSx: { backgroundColor: "background.paper" },
671
- size: n,
672
- sx: { ...ue(t) },
673
- children: /* @__PURE__ */ e(Nt, {
674
- filled: !0,
675
- sx: {
676
- color: "categories.income",
677
- fontSize: n,
678
- ...de
679
- }
680
- })
681
- }), De = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(le, {
682
- backingSx: { backgroundColor: "background.paper" },
683
- size: n,
684
- sx: { ...ue(t) },
685
- children: /* @__PURE__ */ e(Ye, {
686
- color: "error",
687
- filled: !0,
688
- sx: {
689
- fontSize: n,
690
- ...de
691
- }
692
- })
693
- }), Te = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(le, {
694
- backingSx: { backgroundColor: "background.paper" },
695
- size: n,
696
- sx: { ...ue(t) },
697
- children: /* @__PURE__ */ e(Ke, {
698
- color: "success",
699
- filled: !0,
700
- sx: {
701
- fontSize: n,
702
- ...de
703
- }
704
- })
705
- }), an = b(({ day: t, outsideCurrentMonth: n, ...r }) => {
706
- const { recurring: i } = C(), { selectedAccountGuids: o } = ee(), { recurrences: l, setSelectedDay: a } = I(), c = p.useMemo(() => l.filter((g) => o.includes(g.accountGuid)), [o, l]).filter((g) => Gt(g.occurredOnDate || g.expectedDate, t)), d = c.some((g) => g.type !== $.Income && g.status === L.Upcoming), m = c.some((g) => g.type !== $.Income && g.status === L.Missed), h = c.some((g) => g.type !== $.Income && g.status === L.Paid), _ = c.some((g) => g.type === $.Income), x = (d ? 1 : 0) + (m ? 1 : 0) + (h ? 1 : 0) + (_ ? 1 : 0), f = [
707
- h && i.paid,
708
- m && i.missed,
709
- d && i.upcoming,
710
- _ && i.income
711
- ].filter(Boolean), D = f.length > 0 ? `${O(t, N.MONTH_DAY_YEAR)}, ${f.join(", ")}` : O(t, N.MONTH_DAY_YEAR);
712
- return /* @__PURE__ */ e($t, {
713
- badgeContent: c.length > 0 && /* @__PURE__ */ s(G, { children: [
714
- m && /* @__PURE__ */ e(De, { isOffset: !0 }),
715
- h && /* @__PURE__ */ e(Te, { isOffset: !0 }),
716
- d && /* @__PURE__ */ e(Se, { isOffset: !0 }),
717
- _ && /* @__PURE__ */ e(we, { isOffset: !0 })
718
- ] }),
719
- overlap: "circular",
720
- sx: { "& .MuiBadge-badge": {
721
- padding: 0,
722
- marginRight: `${(x - 1) * 6 + 1}px`,
723
- flexWrap: "nowrap"
724
- } },
725
- children: /* @__PURE__ */ e(Xt, {
726
- "aria-label": D,
727
- day: t,
728
- onClick: () => a(t),
729
- outsideCurrentMonth: n,
730
- sx: { "&.MuiPickersDay-root": { ...n && { color: "text.disabled" } } },
731
- ...r
732
- })
733
- });
734
- }), oe = ({ icon: t, label: n }) => /* @__PURE__ */ s(u, {
735
- alignItems: "center",
736
- flexDirection: "row",
737
- sx: { gap: 6 },
738
- children: [/* @__PURE__ */ e(t, {}), /* @__PURE__ */ e(y, {
739
- variant: "caption",
740
- children: n
741
- })]
742
- }), on = b(() => {
743
- const { recurring: t } = C();
744
- return /* @__PURE__ */ s(u, {
745
- alignItems: "center",
746
- "aria-hidden": !0,
747
- flexDirection: "row",
748
- gap: 16,
749
- justifyContent: "center",
750
- mt: 12,
751
- children: [
752
- /* @__PURE__ */ e(oe, {
753
- icon: Se,
754
- label: t.expense
755
- }),
756
- /* @__PURE__ */ e(oe, {
757
- icon: we,
758
- label: t.income
759
- }),
760
- /* @__PURE__ */ e(oe, {
761
- icon: De,
762
- label: t.missed
763
- }),
764
- /* @__PURE__ */ e(oe, {
765
- icon: Te,
766
- label: t.paid
767
- })
768
- ]
769
- });
770
- }), Oe = 58, sn = () => {
771
- const t = ct();
772
- return {
773
- [X.EN_US]: Ne,
774
- [X.EN_CA]: Kt,
775
- [X.FR]: qt,
776
- [X.FR_CA]: Qt,
777
- [X.ES]: jt
778
- }[t] || Ne;
779
- }, at = b(() => {
780
- const t = xe(), { onEvent: n } = F(), { recurring: r } = C(), { selectedDay: i, setDateRange: o } = I(), [l, a] = p.useState(Me(/* @__PURE__ */ new Date()) * 44 + Oe), c = (h) => {
781
- a(Me(h) * 44 + Oe), o({
782
- start: q(h),
783
- end: j(h)
784
- }), d(h), n(w.RECURRING_TRANSACTIONS_CLICK_CALENDAR_RIGHT);
785
- }, d = (h) => {
786
- h && requestAnimationFrame(() => {
787
- const _ = document.getElementById("recurrence-list");
788
- _?.setAttribute("tabindex", "-1"), _?.focus();
789
- });
790
- }, m = /* @__PURE__ */ e(Bt, {
791
- minDate: q(/* @__PURE__ */ new Date()),
792
- onChange: d,
793
- onMonthChange: c,
794
- showDaysOutsideCurrentMonth: !0,
795
- slots: { day: an },
796
- sx: {
797
- "& .MuiPickersArrowSwitcher-button": {
798
- color: "primary.main",
799
- "&:disabled": { color: "action.disabled" }
800
- },
801
- "& .MuiButtonBase-root.MuiPickersDay-root": {
802
- borderRadius: "4px",
803
- "&:focus, &:hover": { borderRadius: "4px" }
804
- },
805
- "& .MuiPickersCalendarHeader-root": {
806
- mt: 0,
807
- pl: 16,
808
- pr: 8
809
- },
810
- "& .MuiPickersCalendarHeader-label": {
811
- fontFamily: t.typography.body1.fontFamily,
812
- fontSize: t.typography.body1.fontSize,
813
- fontWeight: 600
814
- },
815
- "& .MuiDayCalendar-slideTransition": { minHeight: l },
816
- "&.MuiDateCalendar-root": { minHeight: l + 44 },
817
- "& .MuiButtonBase-root, .MuiDayCalendar-weekDayLabel": {
818
- height: 44,
819
- width: 44,
820
- margin: 0
821
- },
822
- "& .MuiDayCalendar-weekDayLabel": {
823
- fontFamily: t.typography.h3.fontFamily,
824
- fontSize: t.typography.body2.fontSize
825
- },
826
- "& .MuiPickersDay-dayOutsideMonth": { color: "text.secondary" },
827
- textTransform: "capitalize"
828
- },
829
- value: i,
830
- views: ["day"]
831
- });
832
- return /* @__PURE__ */ e(u, {
833
- "aria-labelledby": "calendar-label",
834
- justifyContent: "center",
835
- role: "group",
836
- children: /* @__PURE__ */ s(Je, {
837
- adapterLocale: sn(),
838
- dateAdapter: Ze,
839
- children: [
840
- i && m,
841
- !i && m,
842
- /* @__PURE__ */ e(y, {
843
- id: "calendar-label",
844
- sx: { alignSelf: "center" },
845
- variant: "body2",
846
- children: r.calendar_tooltip
847
- }),
848
- /* @__PURE__ */ e(on, {})
849
- ]
850
- })
851
- });
852
- }), cn = (t) => {
853
- if (t.type === $.Income) return /* @__PURE__ */ e(we, {});
854
- switch (t.status) {
855
- case L.Missed:
856
- return /* @__PURE__ */ e(De, {});
857
- case L.Paid:
858
- return /* @__PURE__ */ e(Te, {});
859
- default:
860
- return /* @__PURE__ */ e(Se, {});
861
- }
862
- }, ln = (t, n) => {
863
- switch (t.status) {
864
- case L.Paid:
865
- return t.expectedDate ? K(n.paid_on, O(t.occurredOnDate || t.expectedDate, N.MONTH_DAY)) : n.paid;
866
- case L.Missed:
867
- return K(n.missed_on, O(t.expectedDate, N.MONTH_DAY));
868
- case L.Upcoming:
869
- return K(n.upcoming_on, O(t.expectedDate, N.MONTH_DAY));
870
- default:
871
- return n.unknown;
872
- }
873
- }, ke = ({ recurrence: t, isMini: n = !1, onRecurrenceClick: r = () => {
874
- }, showOrdinal: i = !1 }) => {
875
- const { recurring: o } = C(), { detailedRepeatingTransactions: l } = I(), [a, c] = p.useState(!1), d = p.useMemo(() => l.find((g) => g.guid === t.repeatingTransactionGuid), [t, l]), m = t.type === $.Income, h = t.status === L.Paid, _ = t.status === L.Missed, x = t.status === L.Upcoming;
876
- let f = o.paid?.toLowerCase();
877
- return _ ? f = o.missed?.toLowerCase() : x && (f = i ? se(o, d || {}, !0) : se(o, d || {}, !1)), /* @__PURE__ */ s(ve, {
878
- disableGutters: !0,
879
- disablePadding: !0,
880
- children: [/* @__PURE__ */ s(qe, {
881
- onClick: () => {
882
- c(!0), r(t);
883
- },
884
- children: [/* @__PURE__ */ e(Xe, { children: /* @__PURE__ */ e(te, {
885
- categoryGuid: t.categoryGuid,
886
- merchantGuid: t.merchantGuid
887
- }) }), /* @__PURE__ */ e(Qe, { children: /* @__PURE__ */ s(u, {
888
- direction: "row",
889
- gap: 4,
890
- sx: {
891
- justifyContent: "space-between",
892
- textOverflow: "ellipsis",
893
- textWrap: "nowrap"
894
- },
895
- children: [/* @__PURE__ */ s(u, {
896
- direction: "column",
897
- width: "50%",
898
- children: [/* @__PURE__ */ e(y, {
899
- bold: !0,
900
- variant: "body1",
901
- children: t.name
902
- }), /* @__PURE__ */ e(u, {
903
- alignItems: "center",
904
- direction: "row",
905
- gap: 6,
906
- children: n ? /* @__PURE__ */ s(u, {
907
- direction: "row",
908
- gap: 4,
909
- children: [cn(t), /* @__PURE__ */ e(y, {
910
- variant: "caption",
911
- children: ln(t, o)
912
- })]
913
- }) : /* @__PURE__ */ s(G, { children: [t.institutionGuid && /* @__PURE__ */ e(He, {
914
- alt: `${t.institutionName} institution logo`,
915
- institutionGuid: t.institutionGuid,
916
- size: 12
917
- }), /* @__PURE__ */ e(y, {
918
- sx: { maxWidth: 250 },
919
- variant: "caption",
920
- children: t.institutionName
921
- })] })
922
- })]
923
- }), /* @__PURE__ */ s(u, {
924
- alignItems: "flex-end",
925
- width: "100%",
926
- children: [/* @__PURE__ */ s(y, {
927
- bold: !0,
928
- color: m ? "success.main" : "text.primary",
929
- variant: "body1",
930
- children: [m ? "+" : "", P(t.amount, "0,0.00")]
931
- }), !n && /* @__PURE__ */ s(u, {
932
- direction: "row",
933
- sx: {
934
- alignItems: "center",
935
- gap: 6,
936
- justifyContent: "flex-end",
937
- textTransform: "uppercase",
938
- width: "100%"
939
- },
940
- children: [
941
- h && /* @__PURE__ */ e(Ke, {
942
- color: "success",
943
- filled: !0,
944
- size: 12
945
- }),
946
- _ && /* @__PURE__ */ e(Ye, {
947
- color: "error",
948
- filled: !0,
949
- size: 12
950
- }),
951
- /* @__PURE__ */ e(y, {
952
- bold: !0,
953
- color: "text.secondary",
954
- variant: "caption",
955
- children: f
956
- })
957
- ]
958
- })]
959
- })]
960
- }) })]
961
- }), /* @__PURE__ */ e(z, {
962
- ariaLabelClose: o.close_drawer_aria,
963
- isOpen: a,
964
- onClose: () => c(!1),
965
- title: t.type === $.Income ? o.income_details : o.expense_details,
966
- children: d && /* @__PURE__ */ e(et, {
967
- onDeleted: () => c(!1),
968
- recurringTransaction: d
969
- })
970
- })]
971
- });
972
- }, Z = b(({ recurrences: t, isMini: n = !1, onResetClick: r, onRecurrenceClick: i, sx: o = {}, title: l }) => {
973
- const { recurring: a } = C(), c = p.useMemo(() => ut(t), [t]);
974
- return /* @__PURE__ */ s(u, {
975
- id: "recurrence-list",
976
- sx: {
977
- gap: 8,
978
- mt: 4,
979
- ...o
980
- },
981
- "tab-index": -1,
982
- children: [l && /* @__PURE__ */ s(u, {
983
- sx: {
984
- alignItems: "center",
985
- flexDirection: "row",
986
- justifyContent: "space-between",
987
- px: 24
988
- },
989
- children: [/* @__PURE__ */ e(St, {
990
- bold: !0,
991
- variant: "body1",
992
- children: l
993
- }), r && /* @__PURE__ */ e(Ce, {
994
- onClick: r,
995
- size: "small",
996
- variant: "text",
997
- children: a.reset
998
- })]
999
- }), t.length === 0 ? /* @__PURE__ */ e(y, {
1000
- fontStyle: "italic",
1001
- sx: {
1002
- py: 24,
1003
- textAlign: "center"
1004
- },
1005
- children: a.no_activities
1006
- }) : /* @__PURE__ */ e(J, { children: n ? t.map((d, m) => /* @__PURE__ */ s(p.Fragment, { children: [/* @__PURE__ */ e(ke, {
1007
- isMini: n,
1008
- onRecurrenceClick: i,
1009
- recurrence: d
1010
- }), /* @__PURE__ */ e(k, { sx: { mx: 24 } })] }, `recurrence-${m}`)) : c.map((d, m) => /* @__PURE__ */ s(p.Fragment, { children: [/* @__PURE__ */ e(ve, { children: /* @__PURE__ */ e(J, {
1011
- subheader: /* @__PURE__ */ e(Ut, {
1012
- sx: {
1013
- bgcolor: "background.paper",
1014
- ml: 8,
1015
- pb: 4,
1016
- pt: 12
1017
- },
1018
- children: /* @__PURE__ */ e(y, {
1019
- bold: !0,
1020
- variant: "caption",
1021
- children: O(d.date, N.DAY_OF_WEEK_MONTH_DAY)
1022
- })
1023
- }),
1024
- sx: { width: "100%" },
1025
- children: d.recurrences.map((h, _) => /* @__PURE__ */ e(p.Fragment, { children: /* @__PURE__ */ e(ke, {
1026
- isMini: n,
1027
- onRecurrenceClick: i,
1028
- recurrence: h
1029
- }) }, `day-recurrence-${_}`))
1030
- }) }, d.id), /* @__PURE__ */ e(k, { sx: { mx: 24 } })] }, `recurrence-${m}`)) })]
1031
- });
1032
- }), Ge = b(({ expected: t, isExpense: n = !0, missed: r, paid: i, title: o, total: l, upcoming: a }) => {
1033
- const c = xe(), { isSmallMobile: d } = ze(), { recurring: m } = C(), h = p.useMemo(() => {
1034
- const _ = [{
1035
- color: c.palette.success.main,
1036
- percentage: `${i / t}`
1037
- }];
1038
- return r && _.push({
1039
- color: c.palette.error.main,
1040
- percentage: `${r / t}`
1041
- }), _;
1042
- }, [
1043
- i,
1044
- t,
1045
- r
1046
- ]);
1047
- return /* @__PURE__ */ s(u, { children: [
1048
- /* @__PURE__ */ s(u, {
1049
- sx: {
1050
- flexDirection: "row",
1051
- justifyContent: "space-between",
1052
- pb: 12
1053
- },
1054
- children: [/* @__PURE__ */ e(y, {
1055
- bold: !0,
1056
- variant: "body1",
1057
- children: `${o} (${l})`
1058
- }), /* @__PURE__ */ e(y, {
1059
- bold: !0,
1060
- color: n ? "text.primary" : "success.main",
1061
- variant: "body1",
1062
- children: `${n ? "-" : "+"}${P(t, "0,0.00")}`
1063
- })]
1064
- }),
1065
- /* @__PURE__ */ e($e, {
1066
- data: h,
1067
- height: 12
1068
- }),
1069
- /* @__PURE__ */ s(u, {
1070
- sx: {
1071
- alignItems: "center",
1072
- flexDirection: "row",
1073
- gap: 2,
1074
- my: 8
1075
- },
1076
- children: [
1077
- /* @__PURE__ */ e(T, { sx: {
1078
- bgcolor: "success.main",
1079
- height: 8,
1080
- mr: 8,
1081
- width: 8
1082
- } }),
1083
- !d && /* @__PURE__ */ e(y, {
1084
- bold: !0,
1085
- variant: "body2",
1086
- children: P(i, "0,0.00")
1087
- }),
1088
- /* @__PURE__ */ e(y, {
1089
- variant: "caption",
1090
- children: m.paid?.toLowerCase()
1091
- }),
1092
- r !== void 0 && /* @__PURE__ */ s(G, { children: [
1093
- /* @__PURE__ */ e(T, { sx: {
1094
- bgcolor: "error.main",
1095
- height: 8,
1096
- ml: 16,
1097
- mr: 8,
1098
- width: 8
1099
- } }),
1100
- !d && /* @__PURE__ */ e(y, {
1101
- bold: !0,
1102
- variant: "body2",
1103
- children: P(r, "0,0.00")
1104
- }),
1105
- /* @__PURE__ */ e(y, {
1106
- variant: "caption",
1107
- children: m.missed?.toLowerCase()
1108
- })
1109
- ] }),
1110
- /* @__PURE__ */ e(T, { sx: {
1111
- bgcolor: "divider",
1112
- height: 8,
1113
- ml: 16,
1114
- mr: 8,
1115
- width: 8
1116
- } }),
1117
- !d && /* @__PURE__ */ e(y, {
1118
- bold: !0,
1119
- variant: "body2",
1120
- children: P(a, "0,0.00")
1121
- }),
1122
- /* @__PURE__ */ e(y, {
1123
- variant: "caption",
1124
- children: m.upcoming?.toLowerCase()
1125
- })
1126
- ]
1127
- })
1128
- ] });
1129
- }), dn = b(() => {
1130
- const { recurring: t } = C(), { availableWidth: n } = Be(), { isDesktop: r, isSmallMobile: i, isMobile: o } = ze(n), { onEvent: l } = F(), { currentMonthExpenses: a, currentMonthIncome: c, dateRange: d, expenseTotal: m, incomeTotal: h, missedExpenseTotal: _, pastRecurrences: x, paidExpenseTotal: f, paidIncomeTotal: D, selectedDay: g, selectedDayRecurrences: E, setDateRange: R, upcomingExpenseTotal: U, upcomingIncomeTotal: S, upcomingRecurrences: re } = I(), [Q, ae] = p.useState(0), A = Dt(d.start, /* @__PURE__ */ new Date()), Y = (M, st) => {
1131
- ae(st);
1132
- }, Ie = (M) => {
1133
- l(w.RECURRING_TRANSACTIONS_CLICK_UPCOMING, { transaction_guid: M.transaction?.guid });
1134
- }, Ee = (M) => {
1135
- l(w.RECURRING_TRANSACTIONS_CLICK_PAID, { transaction_guid: M.transaction?.guid });
1136
- }, it = () => {
1137
- const M = wt(d.start, 1);
1138
- R({
1139
- start: q(M),
1140
- end: j(M)
1141
- });
1142
- }, ot = () => {
1143
- const M = Tt(d.start, 1);
1144
- R({
1145
- start: q(M),
1146
- end: j(M)
1147
- });
1148
- };
1149
- return /* @__PURE__ */ s(me, {
1150
- container: !0,
1151
- sx: { pt: 16 },
1152
- children: [/* @__PURE__ */ s(me, {
1153
- size: {
1154
- sm: 12,
1155
- md: "grow"
1156
- },
1157
- width: "100%",
1158
- children: [/* @__PURE__ */ s(u, {
1159
- sx: {
1160
- gap: 16,
1161
- px: r ? 48 : 24
1162
- },
1163
- children: [
1164
- /* @__PURE__ */ s(u, {
1165
- alignItems: "center",
1166
- direction: "row",
1167
- justifyContent: "space-between",
1168
- children: [/* @__PURE__ */ e(Rt, {
1169
- variant: "h3",
1170
- children: K(t.header_title, O(d.start, N.MONTH_LONG))
1171
- }), !r && /* @__PURE__ */ s(u, {
1172
- direction: "row",
1173
- gap: 4,
1174
- children: [/* @__PURE__ */ e(Le, {
1175
- color: "primary",
1176
- disabled: A,
1177
- onClick: ot,
1178
- children: /* @__PURE__ */ e(Et, {})
1179
- }), /* @__PURE__ */ e(Le, {
1180
- color: "primary",
1181
- onClick: it,
1182
- children: /* @__PURE__ */ e(At, {})
1183
- })]
1184
- })]
1185
- }),
1186
- /* @__PURE__ */ e(Ge, {
1187
- expected: m,
1188
- missed: _,
1189
- paid: f,
1190
- title: t.expenses,
1191
- total: a.length,
1192
- upcoming: U
1193
- }),
1194
- /* @__PURE__ */ e(Ge, {
1195
- expected: h,
1196
- isExpense: !1,
1197
- paid: D,
1198
- title: t.deposits,
1199
- total: c.length,
1200
- upcoming: S
1201
- }),
1202
- r && /* @__PURE__ */ e(Z, {
1203
- onRecurrenceClick: Ie,
1204
- recurrences: re,
1205
- title: t.upcoming_activity
1206
- })
1207
- ]
1208
- }), !r && /* @__PURE__ */ s(u, {
1209
- sx: { px: o ? 0 : 24 },
1210
- children: [
1211
- /* @__PURE__ */ s(je, {
1212
- onChange: Y,
1213
- value: Q,
1214
- variant: "fullWidth",
1215
- children: [/* @__PURE__ */ e(ce, { label: /* @__PURE__ */ e(y, {
1216
- bold: !0,
1217
- sx: { textTransform: "none" },
1218
- variant: "body1",
1219
- children: i ? t.upcoming : t.upcoming_activity
1220
- }) }), /* @__PURE__ */ e(ce, { label: /* @__PURE__ */ e(y, {
1221
- bold: !0,
1222
- sx: { textTransform: "none" },
1223
- variant: "body1",
1224
- children: i ? t.past : t.past_transactions
1225
- }) })]
1226
- }),
1227
- Q === 0 && /* @__PURE__ */ e(Z, {
1228
- onRecurrenceClick: Ie,
1229
- recurrences: re
1230
- }),
1231
- Q === 1 && /* @__PURE__ */ e(Z, {
1232
- onRecurrenceClick: Ee,
1233
- recurrences: x
1234
- })
1235
- ]
1236
- })]
1237
- }), r && /* @__PURE__ */ e(me, {
1238
- size: { xs: "auto" },
1239
- sx: { minWidth: 450 },
1240
- children: /* @__PURE__ */ s(u, {
1241
- gap: 24,
1242
- children: [/* @__PURE__ */ e(at, {}), /* @__PURE__ */ e(Z, {
1243
- onRecurrenceClick: Ee,
1244
- recurrences: E || x,
1245
- title: g ? K(t.day_transactions, O(g, N.MONTH_DAY)) : t.past_transactions
1246
- })]
1247
- })
1248
- })]
1249
- });
1250
- }), yr = b(({ onBackClick: t, onMenuClick: n, sx: r = {} }) => {
1251
- const { recurring: i } = C(), { isInitialized: o, selectedAccountGuids: l } = ee(), { isDataLoaded: a, loadRepeatingTransactionData: c, setDateRange: d } = I(), { setFilter: m } = V(), { onEvent: h } = F(), [_, x] = p.useState(!1);
1252
- return ye({
1253
- widgetName: "RecurringTransactionsWidget",
1254
- isLoaded: a
1255
- }), p.useEffect(() => {
1256
- a || c().finally();
1257
- }, []), p.useEffect(() => {
1258
- m({
1259
- dateRange: {
1260
- start: ne(W(), 90),
1261
- end: be()
1262
- },
1263
- accounts: l
1264
- }), d({
1265
- start: q(/* @__PURE__ */ new Date()),
1266
- end: j(/* @__PURE__ */ new Date())
1267
- });
1268
- }, [l]), o ? /* @__PURE__ */ s(mt, {
1269
- actions: [{
1270
- label: i.action_title,
1271
- iconName: "credit_card_gear",
1272
- onClick: () => {
1273
- x(!0), h(w.RECURRING_TRANSACTIONS_CLICK_SETTINGS);
1274
- }
1275
- }],
1276
- hasDivider: !0,
1277
- onAccountsFilterClick: () => h(w.RECURRING_TRANSACTIONS_CLICK_FILTER),
1278
- onBackClick: t,
1279
- onMenuClick: n,
1280
- sx: r,
1281
- title: i.title,
1282
- children: [a ? /* @__PURE__ */ e(dn, {}) : /* @__PURE__ */ e(Ue, {
1283
- sx: { m: 48 },
1284
- variant: "list"
1285
- }), /* @__PURE__ */ e(z, {
1286
- ariaLabelClose: i.close_drawer_aria,
1287
- isOpen: _,
1288
- onClose: () => x(!1),
1289
- shouldShowHeaderBorders: !1,
1290
- title: i.action_title,
1291
- children: /* @__PURE__ */ e(rt, {})
1292
- })]
1293
- }) : /* @__PURE__ */ e(fe, {});
1294
- }), un = b(() => {
1295
- const { recurring: t } = C(), { availableWidth: n } = Be(), { selectedDay: r, selectedDayRecurrences: i, setSelectedDay: o, upcomingRecurrences: l } = I(), a = n < 750;
1296
- return /* @__PURE__ */ s(u, {
1297
- flexDirection: a ? "column" : "row",
1298
- width: "100%",
1299
- children: [
1300
- /* @__PURE__ */ e(at, {}),
1301
- !a && /* @__PURE__ */ e(k, {
1302
- flexItem: !0,
1303
- orientation: "vertical",
1304
- sx: {
1305
- my: 16,
1306
- ml: 16
1307
- }
1308
- }),
1309
- /* @__PURE__ */ e(Z, {
1310
- isMini: !0,
1311
- onResetClick: r ? () => o(r) : void 0,
1312
- recurrences: i || l.slice(0, 5),
1313
- sx: {
1314
- width: a ? "100%" : "calc(100% - 336px)",
1315
- mt: 12
1316
- },
1317
- title: r ? K(t.day_transactions, O(r, N.MONTH_DAY)) : t.upcoming_activity
1318
- })
1319
- ]
1320
- });
1321
- }), fr = b(({ onPrimaryCtaClick: t, sx: n }) => {
1322
- const { recurring: r } = C(), { setFilter: i } = V(), { isDataLoaded: o, loadRepeatingTransactionData: l } = I(), { isInitialized: a, selectedAccountGuids: c } = ee();
1323
- return ye({
1324
- widgetName: "RecurringTransactionsMiniWidget",
1325
- isLoaded: o
1326
- }), p.useEffect(() => {
1327
- o || l().finally();
1328
- }, []), p.useEffect(() => {
1329
- c.length > 0 && i({
1330
- dateRange: {
1331
- start: ne(W(), 90),
1332
- end: be()
1333
- },
1334
- accounts: c
1335
- });
1336
- }, [c]), a ? /* @__PURE__ */ e(vt, {
1337
- className: "mx-exp-recurring-transactions-miniwidget",
1338
- onPrimaryCtaClick: t,
1339
- primaryCtaLabel: r.primary_cta,
1340
- primaryCtaLabelAria: r.primary_cta_aria,
1341
- subTitle: r.sub_title,
1342
- sx: n,
1343
- title: r.mini_title,
1344
- children: o ? /* @__PURE__ */ e(un, {}) : /* @__PURE__ */ e(Ue, {
1345
- sx: { mx: 16 },
1346
- variant: "list"
1347
- })
1348
- }) : /* @__PURE__ */ e(fe, {});
1349
- }), mn = b(() => {
1350
- const { recurring: t } = C();
1351
- return /* @__PURE__ */ s(u, {
1352
- sx: {
1353
- alignItems: "start",
1354
- flexDirection: "row",
1355
- gap: 12
1356
- },
1357
- children: [/* @__PURE__ */ e(Lt, { size: 32 }), /* @__PURE__ */ s(u, { children: [/* @__PURE__ */ e(H, {
1358
- fontWeight: 600,
1359
- variant: "body1",
1360
- children: t.zero_state_content_header
1361
- }), /* @__PURE__ */ e(H, {
1362
- color: "text.secondary",
1363
- variant: "subtitle2",
1364
- children: t.zero_state_content_description
1365
- })] })]
1366
- });
1367
- }), pn = ({ amount: t, bgcolor: n, isLargeScreen: r, isSmallScreen: i, label: o }) => /* @__PURE__ */ s(u, {
1368
- sx: {
1369
- alignItems: "center",
1370
- flexDirection: "row",
1371
- gap: 8
1372
- },
1373
- children: [/* @__PURE__ */ e(T, { sx: {
1374
- borderRadius: "2px",
1375
- bgcolor: n,
1376
- height: 8,
1377
- width: 8
1378
- } }), /* @__PURE__ */ s(u, {
1379
- sx: {
1380
- alignItems: "center",
1381
- flexDirection: "row",
1382
- gap: 2
1383
- },
1384
- children: [!i && /* @__PURE__ */ e(y, {
1385
- bold: !0,
1386
- variant: "caption",
1387
- children: P(t, t === 0 || !r ? "0,0" : "0,0.00")
1388
- }), /* @__PURE__ */ e(y, {
1389
- variant: "caption",
1390
- children: o
1391
- })]
1392
- })]
1393
- }), hn = ({ upcomingRecurrences: t, logoSize: n = 32, maxLogos: r = 3 }) => {
1394
- const i = (o) => o * (n / 2);
1395
- return /* @__PURE__ */ e(T, {
1396
- sx: {
1397
- position: "relative",
1398
- width: 64
1399
- },
1400
- children: t.map((o, l) => l < r ? /* @__PURE__ */ e(T, {
1401
- sx: {
1402
- borderRadius: "4px",
1403
- left: i(l),
1404
- outlineColor: "common.white",
1405
- outlineStyle: "solid",
1406
- outlineWidth: 2,
1407
- position: "absolute"
1408
- },
1409
- children: /* @__PURE__ */ e(te, {
1410
- categoryGuid: o.categoryGuid || "",
1411
- merchantGuid: o.merchantGuid || "",
1412
- size: n
1413
- })
1414
- }, `${o.categoryGuid}-${o.merchantGuid}-${l}`) : null)
1415
- });
1416
- }, gn = ({ upcomingRecurrences: t, maxLogos: n = 3 }) => /* @__PURE__ */ e(u, {
1417
- sx: {
1418
- flexDirection: "row",
1419
- gap: 4
1420
- },
1421
- children: t?.slice(0, n).map((r, i) => /* @__PURE__ */ e(te, {
1422
- categoryGuid: r.categoryGuid || "",
1423
- merchantGuid: r.merchantGuid || ""
1424
- }, `${r.categoryGuid}-${r.merchantGuid}-${i}`))
1425
- }), _n = b(() => {
1426
- const t = xe(), [n, { width: r }] = bt(), { upcomingRecurrences: i, expenseTotal: o, missedExpenseTotal: l, paidExpenseTotal: a, upcomingExpenseTotal: c } = I(), { recurring: d } = C(), m = r <= 288, h = r >= 450, _ = 32, x = i.length > 0, f = p.useMemo(() => P(o, o === 0 ? "0,0" : "0,0.00"), [o]), D = p.useMemo(() => {
1427
- const R = [{
1428
- color: t.palette.success.main,
1429
- percentage: `${a / o}`
1430
- }];
1431
- return l && R.push({
1432
- color: t.palette.error.main,
1433
- percentage: `${l / o}`
1434
- }), R;
1435
- }, [
1436
- a,
1437
- o,
1438
- l,
1439
- t.palette.success.main,
1440
- t.palette.error.main
1441
- ]), g = () => x ? m ? /* @__PURE__ */ e(hn, {
1442
- logoSize: _,
1443
- maxLogos: 3,
1444
- upcomingRecurrences: i.slice(0, 3)
1445
- }) : /* @__PURE__ */ e(gn, {
1446
- maxLogos: 3,
1447
- upcomingRecurrences: i.slice(0, 3)
1448
- }) : /* @__PURE__ */ e(u, { sx: { width: m ? 64 : 104 } }), E = [
1449
- {
1450
- amount: a,
1451
- bgColor: "success.main",
1452
- label: d.paid
1453
- },
1454
- {
1455
- amount: l,
1456
- bgColor: "error.main",
1457
- label: d.missed
1458
- },
1459
- {
1460
- amount: c,
1461
- bgColor: "neutral.light",
1462
- label: d.upcoming
1463
- }
1464
- ];
1465
- return /* @__PURE__ */ s(G, { children: [/* @__PURE__ */ s(u, {
1466
- ref: n,
1467
- sx: {
1468
- flexDirection: "row",
1469
- justifyContent: "space-between"
1470
- },
1471
- children: [/* @__PURE__ */ s(u, {
1472
- sx: [f.length >= 10 && m ? { flexDirection: "column" } : {
1473
- flexDirection: "row",
1474
- gap: 2
1475
- }, {
1476
- alignItems: "baseline",
1477
- overflow: "hidden",
1478
- textOverflow: "ellipsis",
1479
- whiteSpace: "nowrap"
1480
- }],
1481
- children: [/* @__PURE__ */ e(y, {
1482
- sx: { width: "100%" },
1483
- variant: f.length >= 10 && m ? "h3" : "h2",
1484
- children: f
1485
- }), /* @__PURE__ */ e(H, {
1486
- sx: { pr: 12 },
1487
- variant: "caption",
1488
- children: d.expected
1489
- })]
1490
- }), g()]
1491
- }), /* @__PURE__ */ s(u, {
1492
- sx: { pt: 12 },
1493
- children: [/* @__PURE__ */ e($e, { data: D }), /* @__PURE__ */ e(u, {
1494
- sx: {
1495
- alignItems: "center",
1496
- flexDirection: "row",
1497
- gap: 16,
1498
- mt: 4
1499
- },
1500
- children: E.map((R, U) => /* @__PURE__ */ e(pn, {
1501
- amount: R.amount,
1502
- bgcolor: R.bgColor,
1503
- isLargeScreen: h,
1504
- isSmallScreen: m,
1505
- label: R.label
1506
- }, `recurrence-legend-${U}`))
1507
- })]
1508
- })] });
1509
- }), Cr = b(({ onCTAClick: t }) => {
1510
- const { onEvent: n } = F(), { isInitialized: r, selectedAccountGuids: i } = ee(), { loadRepeatingTransactionData: o, upcomingRecurrences: l, repeatingTransactions: a, setDateRange: c, isDataLoaded: d } = I(), { setFilter: m } = V(), { recurring: h, budgets: _ } = C();
1511
- ye({
1512
- widgetName: "RecurringTransactionsMicroWidget",
1513
- isLoaded: d
1514
- }), p.useEffect(() => {
1515
- d || o().finally(() => {
1516
- n(w.RECURRING_TRANSACTIONS_LOAD_WIDGET, { state: l.length > 0 ? "default" : "zeroState" });
1517
- });
1518
- }, []), p.useEffect(() => {
1519
- r && (m({
1520
- dateRange: {
1521
- start: ne(W(), 90),
1522
- end: be()
1523
- },
1524
- accounts: i
1525
- }), c({
1526
- start: q(/* @__PURE__ */ new Date()),
1527
- end: j(/* @__PURE__ */ new Date())
1528
- }));
1529
- }, [r, i]);
1530
- const x = () => {
1531
- n(l.length > 0 ? w.RECURRING_TRANSACTIONS_CLICK_GET_STARTED : w.RECURRING_TRANSACTIONS_CLICK_VIEW_ALL), t();
1532
- };
1533
- if (!r || !d) return /* @__PURE__ */ e(fe, { height: 100 });
1534
- const f = !a?.length;
1535
- return /* @__PURE__ */ e(yt, {
1536
- className: "mx-recurring-transaction-microwidget",
1537
- ctaLabel: f ? _.get_started_cta : h.primary_cta,
1538
- onCTAClick: x,
1539
- title: h.recurring_expenses,
1540
- children: f ? /* @__PURE__ */ e(mn, {}) : /* @__PURE__ */ e(_n, {})
1541
- });
1542
- }), xr = b(({ isOpen: t, onClose: n, selectedTab: r }) => {
1543
- const { cashflow: i } = C();
1544
- return /* @__PURE__ */ e(z, {
1545
- ariaLabelClose: i.close_settings_aria,
1546
- isOpen: t,
1547
- onClose: n,
1548
- title: i.cashflow_settings,
1549
- children: /* @__PURE__ */ e(rt, { defaultSelectedTab: r })
1550
- });
1551
- });
1552
- export {
1553
- rt as a,
1554
- _e as c,
1555
- Jt as d,
1556
- yr as i,
1557
- tn as l,
1558
- Cr as n,
1559
- rn as o,
1560
- fr as r,
1561
- nn as s,
1562
- xr as t,
1563
- Vt as u
1564
- };