@mx-cartographer/experiences 8.0.0-alpha.bb4 → 8.0.0-alpha.mega1

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 (154) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/{Account-B4CDD-zq.mjs → Account-CvR2-dSR.mjs} +1 -1
  3. package/dist/AccountDetailsContent-CitErkuS.mjs +686 -0
  4. package/dist/{AccountDetailsHeader-DRjFuyJT.mjs → AccountDetailsHeader-BkG3MNYo.mjs} +19 -19
  5. package/dist/{AccountFields-Cl4KHoSj.mjs → AccountFields-zCMqet85.mjs} +10 -12
  6. package/dist/AccountListItem-DHrz8Mml.mjs +90 -0
  7. package/dist/{AccountStore-HbVblv86.mjs → AccountStore-LgfBcYMe.mjs} +101 -75
  8. package/dist/Accounts-Bzy1_REQ.mjs +9 -0
  9. package/dist/{BudgetUtil-Jv8h9H9l.mjs → BudgetUtil-BmZXkL0C.mjs} +32 -32
  10. package/dist/{CashflowStore-CA190BPF.mjs → CashflowStore-D9Dpuz7X.mjs} +25 -18
  11. package/dist/{Category-Ccoew_sA.mjs → Category-CevNQ03n.mjs} +2 -2
  12. package/dist/{CategorySelectorDrawer-Dl006GKy.mjs → CategorySelectorDrawer-B-I3kajA.mjs} +27 -27
  13. package/dist/CategoryStore-CA3tS1BO.mjs +186 -0
  14. package/dist/CategoryUtil-DUM8NuGO.mjs +78 -0
  15. package/dist/{ConnectDrawer-DVp54lUH.mjs → ConnectDrawer-BkvlItWx.mjs} +55 -56
  16. package/dist/{ConnectionsDrawer-Dsc04-4Z.mjs → ConnectionsDrawer-VmuVFHbL.mjs} +5 -5
  17. package/dist/CurrencyInput-itK0R3wV.mjs +85 -0
  18. package/dist/{DateUtil-CDPZw_-m.mjs → DateUtil-CBdcsyuk.mjs} +1 -1
  19. package/dist/{DebtsStore-pL63fmdT.mjs → DebtsStore-Bq-aPy-5.mjs} +3 -3
  20. package/dist/{Dialog-CDV0kKxj.mjs → Dialog-BPTr3qHE.mjs} +24 -24
  21. package/dist/Drawer-By9V-B5L.mjs +178 -0
  22. package/dist/{ExportCsvAction-QhQK4_FU.mjs → ExportCsvAction-Cglo8Mca.mjs} +4 -4
  23. package/dist/{FinstrongStore-BGf36b0z.mjs → FinstrongStore-BIrX0Xg2.mjs} +56 -56
  24. package/dist/{GoalStore-C1-w3Y1E.mjs → GoalStore-1P19goZ7.mjs} +111 -151
  25. package/dist/HeaderCell-DjuifqHJ.mjs +6 -0
  26. package/dist/{Help-c-zHlDbv.mjs → Help-DhcC-C05.mjs} +8 -8
  27. package/dist/{Help-DBfsTkAi.mjs → Help-Ea3BlXQp.mjs} +146 -125
  28. package/dist/{IconBacking-DgT8DCeh.mjs → IconBacking-B9oC6uL2.mjs} +11 -11
  29. package/dist/LineChart-KpPw1phO.mjs +580 -0
  30. package/dist/{ListItemAction-BNCWQAN_.mjs → ListItemAction-BxTkF6Tz.mjs} +2 -2
  31. package/dist/Loader-DUaFpDGv.mjs +24 -0
  32. package/dist/{ManageIncome-8EsStyIQ.mjs → ManageIncome-CaoQl609.mjs} +142 -142
  33. package/dist/MicroWidgetContainer-r6mtxRer.mjs +52 -0
  34. package/dist/MiniWidgetContainer-Bg02sF1Y.mjs +71 -0
  35. package/dist/{NetWorthStore-Bti6u-d9.mjs → NetWorthStore-rC0q7P7t.mjs} +4 -4
  36. package/dist/NotificationSettings-uzM8tCoH.mjs +674 -0
  37. package/dist/{NotificationStore-Ck2KdNmT.mjs → NotificationStore-CDX_kqHa.mjs} +14 -22
  38. package/dist/{OriginalBalanceAction-2Y_3U_mg.mjs → OriginalBalanceAction-C6jdS4ws.mjs} +9 -9
  39. package/dist/{RecurringSettings-DAncu--R.mjs → RecurringSettings-B4ybrS0B.mjs} +17 -17
  40. package/dist/{RecurringTransactions-CxcSL1dY.mjs → RecurringTransactions-BqijW_8S.mjs} +79 -79
  41. package/dist/{RecurringTransactionsStore-CNFxyGB6.mjs → RecurringTransactionsStore-BhBUVm9a.mjs} +81 -91
  42. package/dist/{ResponsiveButton-Cn6-R7ue.mjs → ResponsiveButton-DZFp78fJ.mjs} +10 -10
  43. package/dist/SearchBox-B2_zLv8-.mjs +42 -0
  44. package/dist/{SettingsStore-BASMQSIp.mjs → SettingsStore-krIRNwHK.mjs} +1 -1
  45. package/dist/{SingleSegmentDonut-7Uy6VEld.mjs → SingleSegmentDonut-BgbLgwHi.mjs} +6 -6
  46. package/dist/SpendingData-DQ1b9uqq.mjs +53 -0
  47. package/dist/{SpendingLegend-6FqtMcBV.mjs → SpendingLegend-CDO060GT.mjs} +65 -65
  48. package/dist/{StatusBar-CPfSXe80.mjs → StatusBar-BK_uYHAB.mjs} +6 -6
  49. package/dist/{TabContentContainer-CnMXkVqr.mjs → TabContentContainer-j01JYR_7.mjs} +8 -8
  50. package/dist/TransactionDetails-m5PddMQn.mjs +1380 -0
  51. package/dist/TransactionStore-PRlwE-TF.mjs +677 -0
  52. package/dist/TrendsStore-yO7qYv97.mjs +186 -0
  53. package/dist/{User-BklmOUSd.mjs → User-Cnlegl1N.mjs} +107 -107
  54. package/dist/{ViewMoreMicroCard-DAkyNRlD.mjs → ViewMoreMicroCard-DwR0v_ll.mjs} +211 -205
  55. package/dist/{WidgetContainer-CDh9fjpR.mjs → WidgetContainer-CoFDmQRE.mjs} +36 -36
  56. package/dist/accounts/index.es.js +200 -197
  57. package/dist/accounts/stores/AccountStore.d.ts +22 -25
  58. package/dist/accounts/utils/Accounts.d.ts +1 -2
  59. package/dist/analytics/index.es.js +27 -27
  60. package/dist/budgets/components/AddBudgets.d.ts +2 -1
  61. package/dist/budgets/index.es.js +703 -669
  62. package/dist/budgets/store/BudgetsStore.d.ts +0 -1
  63. package/dist/cashflow/index.es.js +420 -404
  64. package/dist/categories/index.es.js +2 -2
  65. package/dist/categories/stores/CategoryStore.d.ts +3 -6
  66. package/dist/categories/util/CategoryUtil.d.ts +2 -3
  67. package/dist/common/components/ErrorBoundary.d.ts +1 -1
  68. package/dist/common/components/Loader.d.ts +2 -1
  69. package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +1 -1
  70. package/dist/common/components/barchart/Bar.d.ts +25 -0
  71. package/dist/common/components/barchart/BarChart.d.ts +34 -0
  72. package/dist/common/components/barchart/BarColumn.d.ts +37 -0
  73. package/dist/common/components/barchart/Legend.d.ts +8 -0
  74. package/dist/common/components/barchart/Util.d.ts +42 -0
  75. package/dist/common/components/barchart/index.d.ts +1 -0
  76. package/dist/common/components/charts/linechart/CustomMark.d.ts +1 -1
  77. package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
  78. package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
  79. package/dist/common/components/index.d.ts +1 -0
  80. package/dist/common/hooks/index.d.ts +2 -0
  81. package/dist/common/hooks/useAriaLive.d.ts +1 -1
  82. package/dist/common/hooks/usePrevious.d.ts +2 -0
  83. package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
  84. package/dist/common/index.es.js +712 -436
  85. package/dist/common/stores/AppDataStore.d.ts +1 -3
  86. package/dist/common/stores/GlobalCopyStore.d.ts +1 -0
  87. package/dist/common/stores/GlobalStore.d.ts +3 -3
  88. package/dist/common/stores/GlobalUiStore.d.ts +2 -3
  89. package/dist/common/stores/UserStore.d.ts +2 -3
  90. package/dist/common/types/Account.d.ts +6 -9
  91. package/dist/common/types/localization/TransactionsCopy.d.ts +1 -0
  92. package/dist/common/utils/Theme.d.ts +3 -1
  93. package/dist/dashboard/index.es.js +93 -91
  94. package/dist/debts/components/DebtsChart.d.ts +2 -1
  95. package/dist/debts/index.es.js +529 -527
  96. package/dist/{exportTransactionsToCSV-BgV_wTLT.mjs → exportTransactionsToCSV-DuAaI5XA.mjs} +3 -3
  97. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +4 -5
  98. package/dist/finstrong/index.es.js +876 -867
  99. package/dist/goals/index.es.js +526 -525
  100. package/dist/goals/stores/GoalStore.d.ts +4 -17
  101. package/dist/help/components/content/BottomImageContent.d.ts +1 -1
  102. package/dist/help/components/content/LeftImageContent.d.ts +1 -1
  103. package/dist/help/components/content/RightImageContent.d.ts +1 -1
  104. package/dist/help/components/content/TopImageContent.d.ts +1 -1
  105. package/dist/help/index.es.js +13 -9
  106. package/dist/{hooks-C41HAxM5.mjs → hooks-ZMp65DFz.mjs} +11 -11
  107. package/dist/investments/index.es.js +534 -531
  108. package/dist/investments/stores/HoldingStore.d.ts +0 -1
  109. package/dist/merchants/index.es.js +8 -8
  110. package/dist/microinsights/MicroCardTemplate.d.ts +16 -0
  111. package/dist/microinsights/index.d.ts +1 -0
  112. package/dist/microinsights/index.es.js +101 -14
  113. package/dist/networth/components/NetWorthChange.d.ts +1 -3
  114. package/dist/networth/index.es.js +284 -285
  115. package/dist/notifications/index.es.js +95 -94
  116. package/dist/notifications/stores/NotificationStore.d.ts +1 -3
  117. package/dist/recurringtransactions/index.es.js +582 -562
  118. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +2 -4
  119. package/dist/settings/index.es.js +340 -337
  120. package/dist/spending/index.es.js +281 -268
  121. package/dist/transactions/components/shared/transactionlist/DateRow.d.ts +7 -0
  122. package/dist/transactions/index.es.js +253 -255
  123. package/dist/transactions/stores/TransactionStore.d.ts +77 -21
  124. package/dist/transactions/stores/UiStore.d.ts +2 -0
  125. package/dist/trends/components/TrendsTable.d.ts +0 -2
  126. package/dist/trends/index.es.js +838 -793
  127. package/dist/trends/utils/TrendsData.d.ts +1 -0
  128. package/dist/{useAccountDisplayName-CcIp09Xc.mjs → useAccountDisplayName-B7iXTNM8.mjs} +2 -2
  129. package/dist/{useCombineEvents-kNzLTWCp.mjs → useCombineEvents-CRwX-qWE.mjs} +2 -2
  130. package/dist/{useInsightsEnabled-CNjP5cfR.mjs → useInsightsEnabled-B7dxpDrX.mjs} +1 -1
  131. package/dist/{useScreenSize-B5afALev.mjs → useScreenSize-B6JyS_Lj.mjs} +1 -1
  132. package/dist/useWidgetLoadTimer-hIOioiKx.mjs +19 -0
  133. package/package.json +57 -52
  134. package/dist/AccountDetailsContent-adZTkM52.mjs +0 -683
  135. package/dist/AccountListItem-wgmlex-_.mjs +0 -90
  136. package/dist/Accounts-CRUehOiy.mjs +0 -27
  137. package/dist/CategoryStore-MUwRWH9e.mjs +0 -176
  138. package/dist/CategoryUtil-DfVKKkRf.mjs +0 -80
  139. package/dist/CurrencyInput-D1cjbdCI.mjs +0 -85
  140. package/dist/Drawer-BF40nbsH.mjs +0 -163
  141. package/dist/HeaderCell-P8w6CmfO.mjs +0 -6
  142. package/dist/LineChart-C1PxNf7P.mjs +0 -581
  143. package/dist/Loader-Ckqi9Rx6.mjs +0 -21
  144. package/dist/MicroWidgetContainer-BGpNl5ZS.mjs +0 -45
  145. package/dist/MiniWidgetContainer-CKzf_Ira.mjs +0 -56
  146. package/dist/NotificationSettings-B74rQVYC.mjs +0 -672
  147. package/dist/SearchBox-B7km148n.mjs +0 -39
  148. package/dist/SkeletonLoader-BaNboJjD.mjs +0 -38
  149. package/dist/SpendingData-DPQ96k3x.mjs +0 -55
  150. package/dist/TransactionDetails-Bn0qY5Hw.mjs +0 -1336
  151. package/dist/TransactionStore-DbwAutwC.mjs +0 -671
  152. package/dist/TrendsStore-_mRaFUdf.mjs +0 -182
  153. package/dist/common/components/SkeletonLoader.d.ts +0 -7
  154. package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +0 -3
@@ -1,213 +1,224 @@
1
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
- import i from "react";
3
- import { observer as w } from "mobx-react-lite";
4
- import { startOfMonth as nt } from "date-fns/startOfMonth";
5
- import { endOfMonth as ot } from "date-fns/endOfMonth";
6
- import v from "@mui/material/Box";
7
- import b from "@mui/material/Stack";
8
- import k from "@mui/material/Tab";
9
- import at from "@mui/material/Tabs";
10
- import { useTheme as mt } from "@mui/material/styles";
11
- import { g as it, a as rt, S as G, b as q } from "../SpendingLegend-6FqtMcBV.mjs";
12
- import { Text as C, Icon as ht } from "@mxenabled/mxui";
13
- import { f as R } from "../NumberFormatting-DjTD0t3W.mjs";
14
- import { u as L, m as W, d as st, b as P, a as F, h as ct, g as ft, n as bt } from "../hooks-C41HAxM5.mjs";
15
- import { L as lt } from "../Loader-Ckqi9Rx6.mjs";
16
- import { M as _t } from "../MiniWidgetContainer-CKzf_Ira.mjs";
17
- import { startOfToday as J } from "date-fns/startOfToday";
18
- import yt from "@mui/material/Button";
19
- import { useTheme as Ct } from "@mui/material";
20
- import { e as St } from "../exportTransactionsToCSV-BgV_wTLT.mjs";
21
- import { T as Tt, a as Mt } from "../TransactionDetails-Bn0qY5Hw.mjs";
1
+ import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
+ import a from "react";
3
+ import { observer as x } from "mobx-react-lite";
4
+ import { startOfMonth as it } from "date-fns/startOfMonth";
5
+ import { endOfMonth as rt } from "date-fns/endOfMonth";
6
+ import M from "@mui/material/Box";
7
+ import C from "@mui/material/Stack";
8
+ import E from "@mui/material/Tab";
9
+ import st from "@mui/material/Tabs";
10
+ import bt from "@mui/material/styles/useTheme";
11
+ import { g as ct, a as lt, S as W, b as Q } from "../SpendingLegend-CDO060GT.mjs";
12
+ import { Text as y, Icon as _t } from "@mxenabled/mxui";
13
+ import { f as A } from "../NumberFormatting-DjTD0t3W.mjs";
14
+ import { u as w, b as R, m as F, d as dt, a as V, h as Ct, g as yt } from "../hooks-ZMp65DFz.mjs";
15
+ import { u as gt } from "../useWidgetLoadTimer-hIOioiKx.mjs";
16
+ import { L as P } from "../Loader-DUaFpDGv.mjs";
17
+ import { M as St } from "../MiniWidgetContainer-Bg02sF1Y.mjs";
18
+ import { startOfToday as Z } from "date-fns/startOfToday";
19
+ import Tt from "@mui/material/Button";
20
+ import { useTheme as Mt } from "@mui/material";
21
+ import { e as xt } from "../exportTransactionsToCSV-DuAaI5XA.mjs";
22
+ import { T as wt, a as vt } from "../TransactionDetails-m5PddMQn.mjs";
22
23
  import Dt from "@mui/material/Collapse";
23
24
  import z from "@mui/material/Divider";
24
- import Q from "@mui/material/List";
25
- import X from "@mui/material/ListItem";
26
- import xt from "@mui/material/ListItemButton";
27
- import { u as vt } from "../useScreenSize-B5afALev.mjs";
28
- import { D as Z } from "../Drawer-BF40nbsH.mjs";
29
- import { b as x } from "../Category-Ccoew_sA.mjs";
30
- import { A as tt, W as wt } from "../WidgetContainer-CDh9fjpR.mjs";
31
- const j = ({ amount: n, label: d }) => /* @__PURE__ */ s(b, { direction: "column", children: [
32
- /* @__PURE__ */ t(C, { bold: !0, sx: { textTransform: "none" }, variant: "body1", children: d }),
33
- /* @__PURE__ */ t(C, { variant: "caption", children: R(n, "0,0") })
34
- ] }), Lt = () => {
35
- const n = mt(), { goals: d, spending: o } = L(), { categories: r, dateRangeCategoryTotals: a } = W(), c = i.useMemo(
25
+ import tt from "@mui/material/List";
26
+ import et from "@mui/material/ListItem";
27
+ import Lt from "@mui/material/ListItemButton";
28
+ import { u as It } from "../useScreenSize-B6JyS_Lj.mjs";
29
+ import { D as nt } from "../Drawer-By9V-B5L.mjs";
30
+ import { b as L } from "../Category-CevNQ03n.mjs";
31
+ import { A as ot, W as At } from "../WidgetContainer-CoFDmQRE.mjs";
32
+ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column", children: [
33
+ /* @__PURE__ */ t(y, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children: d }),
34
+ /* @__PURE__ */ t(y, { variant: "XSmall", children: A(e, "0,0") })
35
+ ] }), Et = () => {
36
+ const e = bt(), { goals: d, spending: o } = w(), { selectedAccounts: r } = R(), {
37
+ categories: i,
38
+ dateRangeCategoryTotals: s,
39
+ dataRangeTotalsLoaded: n,
40
+ loadDateRangeCategoryTotals: u
41
+ } = F();
42
+ gt({
43
+ widgetName: "SpendingMiniWidget",
44
+ isLoaded: n
45
+ });
46
+ const c = a.useMemo(
36
47
  () => [
37
- n.palette.chartMono.chartMono5,
38
- n.palette.chartMono.chartMono4,
39
- n.palette.chartMono.chartMono3,
40
- n.palette.chartMono.chartMono2,
41
- n.palette.chartMono.chartMono1,
42
- n.palette.chartMono.chartMono6
48
+ e.palette.chartMono.chartMono5,
49
+ e.palette.chartMono.chartMono4,
50
+ e.palette.chartMono.chartMono3,
51
+ e.palette.chartMono.chartMono2,
52
+ e.palette.chartMono.chartMono1,
53
+ e.palette.chartMono.chartMono6
43
54
  ],
44
- [n]
45
- ), [e, l] = i.useState(""), [g, _] = i.useState(0), m = i.useMemo(
46
- () => it(r, d, n, a),
47
- [r, a]
48
- ), p = i.useMemo(
49
- () => rt(r, a, c),
50
- [r, a, c]
51
- ), A = (y, T) => {
52
- _(T), l("");
53
- }, f = (y) => {
54
- l(e === y ? "" : y);
55
+ [e]
56
+ );
57
+ a.useEffect(() => {
58
+ u(
59
+ r,
60
+ it(/* @__PURE__ */ new Date()),
61
+ rt(/* @__PURE__ */ new Date())
62
+ ).finally();
63
+ }, [r]);
64
+ const [m, g] = a.useState(""), [h, v] = a.useState(0), _ = a.useMemo(
65
+ () => ct(i, d, e, s),
66
+ [i, s]
67
+ ), f = a.useMemo(
68
+ () => lt(i, s, c),
69
+ [i, s, c]
70
+ ), O = (T, k) => {
71
+ v(k), g("");
72
+ }, S = (T) => {
73
+ g(m === T ? "" : T);
55
74
  };
56
- return /* @__PURE__ */ s(v, { width: "100%", children: [
57
- /* @__PURE__ */ s(
58
- at,
75
+ return n ? /* @__PURE__ */ l(M, { width: "100%", children: [
76
+ /* @__PURE__ */ l(
77
+ st,
59
78
  {
60
79
  "aria-label": o.mini_title,
61
- onChange: A,
62
- value: g,
80
+ onChange: O,
81
+ value: h,
63
82
  variant: "fullWidth",
64
83
  children: [
65
84
  /* @__PURE__ */ t(
66
- k,
85
+ E,
67
86
  {
68
87
  "aria-controls": "spending-tabpanel",
69
88
  id: "spending-tab",
70
89
  label: /* @__PURE__ */ t(
71
- j,
90
+ N,
72
91
  {
73
- amount: m.totalAmount,
92
+ amount: _.totalAmount,
74
93
  label: o.spend_tab_title
75
94
  }
76
95
  ),
77
- tabIndex: g === 0 ? 0 : -1
96
+ tabIndex: h === 0 ? 0 : -1
78
97
  }
79
98
  ),
80
99
  /* @__PURE__ */ t(
81
- k,
100
+ E,
82
101
  {
83
102
  "aria-controls": "income-tabpanel",
84
103
  id: "income-tab",
85
104
  label: /* @__PURE__ */ t(
86
- j,
105
+ N,
87
106
  {
88
- amount: p.totalAmount,
107
+ amount: f.totalAmount,
89
108
  label: o.income_tab_title
90
109
  }
91
110
  ),
92
- tabIndex: g === 1 ? 0 : -1
111
+ tabIndex: h === 1 ? 0 : -1
93
112
  }
94
113
  )
95
114
  ]
96
115
  }
97
116
  ),
98
117
  /* @__PURE__ */ t(
99
- v,
118
+ M,
100
119
  {
101
120
  "aria-labelledby": "spending-tab",
102
- hidden: g !== 0,
121
+ hidden: h !== 0,
103
122
  id: "spending-tabpanel",
104
123
  role: "tabpanel",
105
- children: /* @__PURE__ */ s(b, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
124
+ children: /* @__PURE__ */ l(C, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
106
125
  /* @__PURE__ */ t(
107
- G,
126
+ W,
108
127
  {
109
- data: m,
110
- onSelected: f,
111
- selectedId: e,
128
+ data: _,
129
+ onSelected: S,
130
+ selectedId: m,
112
131
  totalLabel: o.total_spending
113
132
  }
114
133
  ),
115
- /* @__PURE__ */ t(q, { data: m, onSelected: f, selectedId: e })
134
+ /* @__PURE__ */ t(Q, { data: _, onSelected: S, selectedId: m })
116
135
  ] })
117
136
  }
118
137
  ),
119
138
  /* @__PURE__ */ t(
120
- v,
139
+ M,
121
140
  {
122
141
  "aria-labelledby": "income-tab",
123
- hidden: g !== 1,
142
+ hidden: h !== 1,
124
143
  id: "income-tabpanel",
125
144
  role: "tabpanel",
126
- children: /* @__PURE__ */ s(b, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
145
+ children: /* @__PURE__ */ l(C, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
127
146
  /* @__PURE__ */ t(
128
- G,
147
+ W,
129
148
  {
130
- data: p,
149
+ data: f,
131
150
  isIncome: !0,
132
- onSelected: f,
133
- selectedId: e,
151
+ onSelected: S,
152
+ selectedId: m,
134
153
  totalLabel: o.total_income
135
154
  }
136
155
  ),
137
- /* @__PURE__ */ t(q, { data: p, onSelected: f, selectedId: e })
156
+ /* @__PURE__ */ t(Q, { data: f, onSelected: S, selectedId: m })
138
157
  ] })
139
158
  }
140
159
  )
141
- ] });
142
- }, At = w(Lt), It = ({ onPrimaryCtaClick: n, sx: d = {} }) => {
143
- const { isAccountDataLoaded: o, loadAccountData: r, visibleAccounts: a } = st(), { categoriesLoaded: c, loadCategories: e, loadDateRangeCategoryTotals: l } = W(), { spending: g } = L(), { isInitialized: _, selectedAccounts: m, setSelectedAccounts: p } = P();
144
- return i.useEffect(() => {
145
- o || r().finally(), c || e().finally();
146
- }, []), i.useEffect(() => {
147
- p(a);
148
- }, [a]), i.useEffect(() => {
149
- l(
150
- m,
151
- nt(/* @__PURE__ */ new Date()),
152
- ot(/* @__PURE__ */ new Date())
153
- ).finally();
154
- }, [m]), _ ? /* @__PURE__ */ t(
155
- _t,
160
+ ] }) : /* @__PURE__ */ t(P, { height: 250 });
161
+ }, Wt = x(Et), Nt = ({ onPrimaryCtaClick: e, sx: d = {} }) => {
162
+ const { visibleAccounts: o } = dt(), { spending: r } = w(), { isCopyLoaded: i, isInitialized: s, setSelectedAccounts: n } = R();
163
+ return a.useEffect(() => {
164
+ n(o);
165
+ }, [o]), !i || !s ? /* @__PURE__ */ t(P, {}) : /* @__PURE__ */ t(
166
+ St,
156
167
  {
157
168
  className: "mx-exp-spending-miniwidget",
158
- onPrimaryCtaClick: n,
159
- primaryCtaLabel: g.primary_cta,
169
+ onPrimaryCtaClick: e,
170
+ primaryCtaLabel: r.primary_cta,
160
171
  sx: { height: "100%", ...d },
161
- title: g.mini_title,
162
- children: /* @__PURE__ */ t(At, {})
172
+ title: r.mini_title,
173
+ children: /* @__PURE__ */ t(Wt, {})
163
174
  }
164
- ) : /* @__PURE__ */ t(lt, {});
165
- }, me = w(It), Et = ({
166
- data: n,
175
+ );
176
+ }, _e = x(Nt), Rt = ({
177
+ data: e,
167
178
  onSelected: d,
168
179
  selectedId: o = "",
169
180
  title: r
170
181
  }) => {
171
- const { spending: a } = L(), c = n.categoryData.find((e) => e.guid === o);
172
- return /* @__PURE__ */ s(b, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
173
- /* @__PURE__ */ t(C, { bold: !0, sx: { py: 12 }, children: `${r} ${a.by_category}` }),
182
+ const { spending: i } = w(), s = e.categoryData.find((n) => n.guid === o);
183
+ return /* @__PURE__ */ l(C, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
184
+ /* @__PURE__ */ t(y, { bold: !0, sx: { py: 12 }, children: `${r} ${i.by_category}` }),
174
185
  /* @__PURE__ */ t(z, { "aria-hidden": "true" }),
175
- /* @__PURE__ */ t(Q, { children: n.categoryData.map((e) => /* @__PURE__ */ s(i.Fragment, { children: [
186
+ /* @__PURE__ */ t(tt, { children: e.categoryData.map((n) => /* @__PURE__ */ l(a.Fragment, { children: [
176
187
  /* @__PURE__ */ t(
177
- X,
188
+ et,
178
189
  {
179
190
  disableGutters: !0,
180
191
  disablePadding: !0,
181
192
  sx: {
182
193
  minHeight: 44
183
194
  },
184
- children: /* @__PURE__ */ s(
185
- xt,
195
+ children: /* @__PURE__ */ l(
196
+ Lt,
186
197
  {
187
- "aria-expanded": c?.guid === e.guid,
188
- onClick: () => d(e.guid),
198
+ "aria-expanded": s?.guid === n.guid,
199
+ onClick: () => d(n.guid),
189
200
  sx: { minHeight: 44, px: 8, py: 0 },
190
201
  children: [
191
202
  /* @__PURE__ */ t(
192
- v,
203
+ M,
193
204
  {
194
205
  borderRadius: 4,
195
206
  flexShrink: 0,
196
207
  height: 8,
197
- sx: { backgroundColor: e.color, mr: 8 },
208
+ sx: { backgroundColor: n.color, mr: 8 },
198
209
  width: 8
199
210
  }
200
211
  ),
201
- /* @__PURE__ */ s(
202
- b,
212
+ /* @__PURE__ */ l(
213
+ C,
203
214
  {
204
215
  alignItems: "center",
205
216
  direction: "row",
206
217
  justifyContent: "space-between",
207
218
  width: "100%",
208
219
  children: [
209
- /* @__PURE__ */ t(C, { bold: o === e.guid, children: e.name }),
210
- /* @__PURE__ */ t(C, { bold: o === e.guid, variant: "body1", children: R(e.amount, "0,0") })
220
+ /* @__PURE__ */ t(y, { bold: o === n.guid, children: n.name }),
221
+ /* @__PURE__ */ t(y, { bold: o === n.guid, variant: "Body", children: A(n.amount, "0,0") })
211
222
  ]
212
223
  }
213
224
  )
@@ -217,50 +228,50 @@ const j = ({ amount: n, label: d }) => /* @__PURE__ */ s(b, { direction: "column
217
228
  }
218
229
  ),
219
230
  /* @__PURE__ */ t(z, {}),
220
- e.categoryTotals && e.categoryTotals.length > 0 && /* @__PURE__ */ t(Dt, { in: c?.guid === e.guid, unmountOnExit: !0, children: /* @__PURE__ */ s(Q, { children: [
221
- c?.categoryTotals?.map((l) => /* @__PURE__ */ t(
222
- X,
231
+ n.categoryTotals && n.categoryTotals.length > 0 && /* @__PURE__ */ t(Dt, { in: s?.guid === n.guid, unmountOnExit: !0, children: /* @__PURE__ */ l(tt, { children: [
232
+ s?.categoryTotals?.map((u) => /* @__PURE__ */ t(
233
+ et,
223
234
  {
224
235
  sx: {
225
236
  pl: 24,
226
237
  pr: 8,
227
238
  py: 0
228
239
  },
229
- children: /* @__PURE__ */ s(b, { direction: "row", justifyContent: "space-between", width: "100%", children: [
230
- /* @__PURE__ */ s(C, { children: [
231
- l.name,
240
+ children: /* @__PURE__ */ l(C, { direction: "row", justifyContent: "space-between", width: "100%", children: [
241
+ /* @__PURE__ */ l(y, { children: [
242
+ u.name,
232
243
  " "
233
244
  ] }),
234
- /* @__PURE__ */ t(C, { children: R(l.amount, "0,0") })
245
+ /* @__PURE__ */ t(y, { children: A(u.amount, "0,0") })
235
246
  ] })
236
247
  },
237
- l.guid
248
+ u.guid
238
249
  )),
239
250
  /* @__PURE__ */ t(z, {})
240
251
  ] }) })
241
- ] }, e.guid)) }),
242
- /* @__PURE__ */ t(C, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${a.total}: ${R(n.totalAmount, "0,0")}` })
252
+ ] }, n.guid)) }),
253
+ /* @__PURE__ */ t(y, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${i.total}: ${A(e.totalAmount, "0,0")}` })
243
254
  ] });
244
- }, Wt = w(Et), Nt = ({
245
- data: n,
255
+ }, Ot = x(Rt), kt = ({
256
+ data: e,
246
257
  onSelected: d,
247
258
  onViewTransactions: o,
248
259
  selectedId: r,
249
- title: a
260
+ title: i
250
261
  }) => {
251
- const { isDesktop: c, isMobile: e } = vt(), { isLoadingCategoryTotals: l } = W(), { spending: g } = L();
252
- return /* @__PURE__ */ s(
253
- b,
262
+ const { isDesktop: s, isMobile: n } = It(), { isLoadingCategoryTotals: u } = F(), { spending: c } = w();
263
+ return /* @__PURE__ */ l(
264
+ C,
254
265
  {
255
- alignItems: e ? "center" : "flex-start",
256
- direction: e ? "column" : "row",
266
+ alignItems: n ? "center" : "flex-start",
267
+ direction: n ? "column" : "row",
257
268
  gap: { xs: 16, md: 64, xl: 100 },
258
269
  justifyContent: "center",
259
270
  pt: 50,
260
271
  px: 8,
261
272
  children: [
262
- l && /* @__PURE__ */ t(
263
- G,
273
+ u && /* @__PURE__ */ t(
274
+ W,
264
275
  {
265
276
  data: {
266
277
  categoryData: [],
@@ -270,201 +281,203 @@ const j = ({ amount: n, label: d }) => /* @__PURE__ */ s(b, { direction: "column
270
281
  onSelected: () => {
271
282
  },
272
283
  selectedId: "",
273
- size: c ? 400 : 300,
284
+ size: s ? 400 : 300,
274
285
  totalLabel: "Loading ...",
275
286
  variant: "full"
276
287
  }
277
288
  ),
278
- !l && /* @__PURE__ */ t(
279
- G,
289
+ !u && /* @__PURE__ */ t(
290
+ W,
280
291
  {
281
- data: n,
292
+ data: e,
282
293
  onSelected: d,
283
294
  onViewTransactions: o,
284
295
  selectedId: r,
285
- size: c ? 400 : 300,
286
- totalLabel: g.total_amount,
296
+ size: s ? 400 : 300,
297
+ totalLabel: c.total_amount,
287
298
  variant: "full"
288
299
  }
289
300
  ),
290
- /* @__PURE__ */ t(Wt, { data: n, onSelected: d, selectedId: r, title: a })
301
+ /* @__PURE__ */ t(Ot, { data: e, onSelected: d, selectedId: r, title: i })
291
302
  ]
292
303
  }
293
304
  );
294
- }, et = w(Nt), Ot = (n) => [
295
- n.palette.chartMono.chartMono5,
296
- n.palette.chartMono.chartMono4,
297
- n.palette.chartMono.chartMono3,
298
- n.palette.chartMono.chartMono2,
299
- n.palette.chartMono.chartMono1,
300
- n.palette.chartMono.chartMono6
301
- ], Rt = () => {
302
- const n = Ct(), { is_mobile_webview: d } = F(), { clientConfig: o } = F(), { categories: r, dateRangeCategoryTotals: a } = W(), {
303
- goals: c,
304
- spending: e,
305
- transactions: l
306
- } = L(), { displayedDateRange: g, selectedAccountGuids: _ } = P(), {
307
- setFilter: m,
308
- sortedTransactions: p,
309
- sortedTransactionsWithSplits: A,
310
- tags: f
311
- } = ct(), y = o?.master?.deep_link_params?.account_guids, T = o?.master?.deep_link_params?.view, [M, N] = i.useState(""), [D, S] = i.useState(T === "income" ? 1 : 0), [O, I] = i.useState(""), [dt, H] = i.useState(!1), $ = i.useMemo(
312
- () => it(r, c, n, a),
313
- [r, a]
314
- ), K = i.useMemo(
315
- () => rt(r, a, Ot(n)),
316
- [r, a]
317
- ), B = i.useMemo(
318
- () => p.find((u) => u.guid === O),
319
- [O, p]
320
- ), gt = (u, E) => {
321
- S(E), N("");
322
- }, U = (u) => {
323
- N(M === u || u === "0" ? "" : u);
324
- }, Y = (u) => {
325
- const E = {
326
- accounts: y || _,
305
+ }, at = x(kt), $t = (e) => [
306
+ e.palette.chartMono.chartMono5,
307
+ e.palette.chartMono.chartMono4,
308
+ e.palette.chartMono.chartMono3,
309
+ e.palette.chartMono.chartMono2,
310
+ e.palette.chartMono.chartMono1,
311
+ e.palette.chartMono.chartMono6
312
+ ], Bt = () => {
313
+ const e = Mt(), { is_mobile_webview: d } = V(), { clientConfig: o } = V(), {
314
+ categories: r,
315
+ dateRangeCategoryTotals: i,
316
+ loadDateRangeCategoryTotals: s,
317
+ dataRangeTotalsLoaded: n
318
+ } = F(), {
319
+ goals: u,
320
+ spending: c,
321
+ transactions: m
322
+ } = w(), { displayedDateRange: g, selectedAccounts: h, selectedAccountGuids: v } = R(), {
323
+ setFilter: _,
324
+ sortedTransactions: f,
325
+ sortedTransactionsWithSplits: O,
326
+ tags: S
327
+ } = Ct(), T = o?.master?.deep_link_params?.account_guids, k = o?.master?.deep_link_params?.view, [$, H] = a.useState(""), [I, pt] = a.useState(k === "income" ? 1 : 0), [K, U] = a.useState(""), [ut, X] = a.useState(!1);
328
+ gt({
329
+ widgetName: "SpendingWidget",
330
+ isLoaded: n
331
+ }), a.useEffect(() => {
332
+ s(
333
+ h,
334
+ g.start,
335
+ g.end
336
+ ).finally();
337
+ }, [h, g]);
338
+ const B = a.useMemo(
339
+ () => ct(r, u, e, i),
340
+ [r, i]
341
+ ), Y = a.useMemo(
342
+ () => lt(r, i, $t(e)),
343
+ [r, i]
344
+ ), G = a.useMemo(
345
+ () => f.find((p) => p.guid === K),
346
+ [K, f]
347
+ ), mt = (p, D) => {
348
+ pt(D), H("");
349
+ }, q = (p) => {
350
+ H($ === p || p === "0" ? "" : p);
351
+ }, J = (p) => {
352
+ const D = {
353
+ accounts: T || v,
327
354
  dateRange: g
328
355
  };
329
- if (D === 0)
330
- if (u === "other") {
331
- const h = $.categoryData.find((V) => V.guid === "other");
332
- m({
333
- ...E,
334
- custom: (V) => !!h?.categoryTotals?.find((ut) => ut.guid === V.top_level_category_guid)
356
+ if (I === 0)
357
+ if (p === "other") {
358
+ const b = B.categoryData.find((j) => j.guid === "other");
359
+ _({
360
+ ...D,
361
+ custom: (j) => !!b?.categoryTotals?.find((ft) => ft.guid === j.top_level_category_guid)
335
362
  });
336
363
  } else
337
- m({
338
- ...E,
339
- custom: (h) => u ? h.top_level_category_guid === u : h.top_level_category_guid !== x.INCOME && h.category_guid !== x.INCOME && h.top_level_category_guid !== x.INVESTMENTS && h.top_level_category_guid !== x.TRANSFER,
340
- showSplits: !!u
364
+ _({
365
+ ...D,
366
+ custom: (b) => p ? b.top_level_category_guid === p : b.top_level_category_guid !== L.INCOME && b.top_level_category_guid !== L.INVESTMENTS && b.top_level_category_guid !== L.TRANSFER,
367
+ showSplits: !!p
341
368
  });
342
369
  else
343
- m({
344
- ...E,
345
- custom: (h) => u ? h.category_guid === u : h.category_guid === x.INCOME || h.top_level_category_guid === x.INCOME
370
+ _({
371
+ ...D,
372
+ custom: (b) => p ? b.category_guid === p : b.category_guid === L.INCOME || b.top_level_category_guid === L.INCOME
346
373
  });
347
- H(!0);
348
- }, pt = () => {
349
- St(A, f);
374
+ X(!0);
375
+ }, ht = () => {
376
+ xt(O, S);
350
377
  };
351
- return /* @__PURE__ */ s(v, { children: [
352
- /* @__PURE__ */ s(at, { onChange: gt, value: D, variant: "fullWidth", children: [
378
+ return /* @__PURE__ */ l(M, { children: [
379
+ /* @__PURE__ */ l(st, { onChange: mt, value: I, variant: "fullWidth", children: [
353
380
  /* @__PURE__ */ t(
354
- k,
381
+ E,
355
382
  {
356
383
  label: /* @__PURE__ */ t(
357
- j,
384
+ N,
358
385
  {
359
- amount: $.totalAmount,
360
- label: e.spend_tab_title
386
+ amount: B.totalAmount,
387
+ label: c.spend_tab_title
361
388
  }
362
389
  )
363
390
  }
364
391
  ),
365
392
  /* @__PURE__ */ t(
366
- k,
393
+ E,
367
394
  {
368
395
  label: /* @__PURE__ */ t(
369
- j,
396
+ N,
370
397
  {
371
- amount: K.totalAmount,
372
- label: e.income_tab_title
398
+ amount: Y.totalAmount,
399
+ label: c.income_tab_title
373
400
  }
374
401
  )
375
402
  }
376
403
  )
377
404
  ] }),
378
- D === 0 && /* @__PURE__ */ t(
379
- et,
405
+ I === 0 && /* @__PURE__ */ t(
406
+ at,
380
407
  {
381
- data: $,
382
- onSelected: U,
383
- onViewTransactions: Y,
384
- selectedId: M,
385
- title: e.spend_tab_title
408
+ data: B,
409
+ onSelected: q,
410
+ onViewTransactions: J,
411
+ selectedId: $,
412
+ title: c.spend_tab_title
386
413
  }
387
414
  ),
388
- D === 1 && /* @__PURE__ */ t(
389
- et,
415
+ I === 1 && /* @__PURE__ */ t(
416
+ at,
390
417
  {
391
- data: K,
392
- onSelected: U,
393
- onViewTransactions: Y,
394
- selectedId: M,
395
- title: e.income_tab_title
418
+ data: Y,
419
+ onSelected: q,
420
+ onViewTransactions: J,
421
+ selectedId: $,
422
+ title: c.income_tab_title
396
423
  }
397
424
  ),
398
425
  /* @__PURE__ */ t(
399
- Z,
426
+ nt,
400
427
  {
401
- ariaLabelClose: e.close_drawer_aria,
402
- isOpen: dt,
403
- onClose: () => H(!1),
404
- title: e.transactions_drawer_title,
405
- children: /* @__PURE__ */ s(b, { children: [
406
- !d && p.length > 0 && /* @__PURE__ */ t(b, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ t(
407
- yt,
428
+ ariaLabelClose: c.close_drawer_aria,
429
+ isOpen: ut,
430
+ onClose: () => X(!1),
431
+ title: c.transactions_drawer_title,
432
+ children: /* @__PURE__ */ l(C, { children: [
433
+ !d && f.length > 0 && /* @__PURE__ */ t(C, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ t(
434
+ Tt,
408
435
  {
409
- onClick: pt,
410
- startIcon: /* @__PURE__ */ t(ht, { name: "ios_share" }),
436
+ onClick: ht,
437
+ startIcon: /* @__PURE__ */ t(_t, { name: "ios_share" }),
411
438
  variant: "text",
412
- children: l.export_csv_btn
439
+ children: m.export_csv_btn
413
440
  }
414
441
  ) }),
415
- /* @__PURE__ */ t(Tt, { onClick: I })
442
+ /* @__PURE__ */ t(wt, { onClick: U })
416
443
  ] })
417
444
  }
418
445
  ),
419
446
  /* @__PURE__ */ t(
420
- Z,
447
+ nt,
421
448
  {
422
- ariaLabelClose: e.close_drawer_aria,
423
- isOpen: !!B,
424
- onClose: () => I(""),
425
- title: e.transaction_details_drawer_title,
426
- children: B && /* @__PURE__ */ t(Mt, { transaction: B })
449
+ ariaLabelClose: c.close_drawer_aria,
450
+ isOpen: !!G,
451
+ onClose: () => U(""),
452
+ title: c.transaction_details_drawer_title,
453
+ children: G && /* @__PURE__ */ t(vt, { transaction: G })
427
454
  }
428
455
  )
429
456
  ] });
430
- }, kt = w(Rt), Gt = ({ onBackClick: n, sx: d = {} }) => {
431
- const { visibleAccounts: o, isAccountDataLoaded: r, loadAccountData: a } = st(), { categoriesLoaded: c, loadCategories: e, loadDateRangeCategoryTotals: l } = W(), { isTransactionDataLoaded: g, loadTransactionData: _ } = ct(), { spending: m } = L(), {
432
- displayedDateRange: p,
433
- isInitialized: A,
434
- setDisplayedDate: f,
435
- setSelectedAccounts: y,
436
- selectedAccounts: T
437
- } = P(), { onEvent: M } = ft(), { onLoad: N } = bt(), { clientConfig: D } = F(), S = D?.master?.deep_link_params?.date_range;
438
- i.useEffect(() => {
439
- S && Array.isArray(S) && S.length === 2 ? f(S[0], S[1]) : f(nt(J()), ot(J())), r || a().finally(), c || e().finally(), g || _().finally(), M(tt.SPENDING_VIEW);
440
- }, []), i.useEffect(() => {
441
- y(o);
442
- }, [o]), i.useEffect(() => {
443
- l(
444
- T,
445
- p.start,
446
- p.end
447
- ).finally(() => {
448
- N?.("SpendingWidget");
449
- });
450
- }, [p, T]);
451
- const O = (I) => {
452
- f(I[0], I[1]);
457
+ }, Gt = x(Bt), jt = ({ onBackClick: e, sx: d = {} }) => {
458
+ const { visibleAccounts: o } = dt(), { spending: r } = w(), { isCopyLoaded: i, isInitialized: s, setDisplayedDate: n, setSelectedAccounts: u } = R(), { onEvent: c } = yt(), { clientConfig: m } = V(), g = m?.master?.deep_link_params?.date_range, [h, v] = a.useState(!1);
459
+ a.useEffect(() => {
460
+ u(o);
461
+ }, [o]), a.useEffect(() => {
462
+ g && Array.isArray(g) && g.length === 2 ? n(g[0], g[1]) : n(it(Z()), rt(Z())), v(!0), c(ot.SPENDING_VIEW);
463
+ }, []);
464
+ const _ = (f) => {
465
+ n(f[0], f[1]);
453
466
  };
454
- return A ? /* @__PURE__ */ t(
455
- wt,
467
+ return !i || !s || !h ? /* @__PURE__ */ t(P, {}) : /* @__PURE__ */ t(
468
+ At,
456
469
  {
457
470
  accountOptions: o,
458
- calendarActions: { onRangeChanged: O },
459
- onAccountsFilterClick: () => M(tt.SPENDING_CLICK_FILTER),
460
- onBackClick: n,
471
+ calendarActions: { onRangeChanged: _ },
472
+ onAccountsFilterClick: () => c(ot.SPENDING_CLICK_FILTER),
473
+ onBackClick: e,
461
474
  sx: d,
462
- title: m.title,
463
- children: /* @__PURE__ */ t(v, { height: "calc(100dvh - 150px)", overflow: "scroll", width: "100%", children: /* @__PURE__ */ t(kt, {}) })
475
+ title: r.title,
476
+ children: /* @__PURE__ */ t(M, { width: "100%", children: /* @__PURE__ */ t(Gt, {}) })
464
477
  }
465
- ) : /* @__PURE__ */ t(lt, {});
466
- }, he = w(Gt);
478
+ );
479
+ }, Ce = x(jt);
467
480
  export {
468
- me as SpendingMiniWidget,
469
- he as SpendingWidget
481
+ _e as SpendingMiniWidget,
482
+ Ce as SpendingWidget
470
483
  };