@mx-cartographer/experiences 7.7.2 → 7.8.0-alpha-ram-goal-bug

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 (92) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/Account-BiB1F8lL.mjs +118 -0
  3. package/dist/{Account-BfkKlfsW.mjs → Account-DuOz1a27.mjs} +1 -1
  4. package/dist/AccountApi-DgZ8ILj1.mjs +19 -0
  5. package/dist/{AccountDetailsHeader-DqYIuhOs.mjs → AccountDetailsHeader-Cf2TUJnM.mjs} +4 -4
  6. package/dist/AccountDisplayName-CO7z3v99.mjs +11 -0
  7. package/dist/{AccountFields-yP8QdgPd.mjs → AccountFields-UdOvbQ5H.mjs} +7 -6
  8. package/dist/{AccountListItem-DMbu9ehd.mjs → AccountListItem-BPVxmNT_.mjs} +7 -7
  9. package/dist/AccountStore-BbPWe2C9.mjs +244 -0
  10. package/dist/Accounts-M-LTzStv.mjs +27 -0
  11. package/dist/{CategoryStore-Cnw9yUys.mjs → CategoryStore-BYICdb9m.mjs} +73 -73
  12. package/dist/CategoryUtil-meuejJqP.mjs +80 -0
  13. package/dist/{ConnectionsDrawer-BqR6FWJO.mjs → ConnectionsDrawer-BDpVTTSe.mjs} +1 -1
  14. package/dist/{DebtsStore-DuSdXM1k.mjs → DebtsStore-BIbOVCPe.mjs} +12 -12
  15. package/dist/{ExportCsvAction-HK5CeZWR.mjs → ExportCsvAction-CDuzTva1.mjs} +2 -2
  16. package/dist/GlobalAccountFilter-DQCPNc95.mjs +316 -0
  17. package/dist/GoalStore-B4LVt_kH.mjs +422 -0
  18. package/dist/{ManageIncome-BrTrlplL.mjs → ManageIncome-CL3hv8i9.mjs} +44 -44
  19. package/dist/NetWorthStore-yV43kJro.mjs +168 -0
  20. package/dist/{NotificationSettings-D4Vh3z8I.mjs → NotificationSettings-SPg3pwbX.mjs} +171 -169
  21. package/dist/{NotificationStore-CDX_kqHa.mjs → NotificationStore-Ck2KdNmT.mjs} +22 -14
  22. package/dist/{RecurringSettings-D2V6l77l.mjs → RecurringSettings-Bmnnpb48.mjs} +16 -16
  23. package/dist/{RecurringTransactionsStore-Caf1cq4v.mjs → RecurringTransactionsStore-BQBEJOPP.mjs} +91 -81
  24. package/dist/{RecurringTransactions-Bf4lX0Cn.mjs → RepeatingTransaction-miZVnk_A.mjs} +4 -4
  25. package/dist/{SettingsStore-krIRNwHK.mjs → SettingsStore-BHpuyujx.mjs} +1 -1
  26. package/dist/SkeletonLoader-BaNboJjD.mjs +38 -0
  27. package/dist/{SpendingLegend-gTCJLLkV.mjs → SpendingLegend-CD60HCYS.mjs} +33 -33
  28. package/dist/{TransactionDetails-7MHOshKQ.mjs → TransactionDetails-BDhz3DLT.mjs} +2 -2
  29. package/dist/TransactionStore-BSp5bOKg.mjs +705 -0
  30. package/dist/{User-LJpEwPtn.mjs → User-B0LnmiKO.mjs} +21 -20
  31. package/dist/WidgetContainer-BbPS3Yxz.mjs +555 -0
  32. package/dist/accounts/index.es.js +421 -391
  33. package/dist/accounts/stores/AccountStore.d.ts +30 -23
  34. package/dist/accounts/utils/Accounts.d.ts +2 -1
  35. package/dist/budgets/index.es.js +546 -540
  36. package/dist/budgets/store/BudgetsStore.d.ts +1 -0
  37. package/dist/cashflow/index.es.js +444 -457
  38. package/dist/categories/index.es.js +1 -1
  39. package/dist/categories/stores/CategoryStore.d.ts +10 -5
  40. package/dist/categories/util/CategoryUtil.d.ts +3 -2
  41. package/dist/common/components/GlobalAccountFilter.d.ts +11 -0
  42. package/dist/common/components/SkeletonLoader.d.ts +7 -0
  43. package/dist/common/components/WidgetContainer.d.ts +7 -6
  44. package/dist/common/components/globalaccountfilter/GlobalAccountFilterList.d.ts +7 -0
  45. package/dist/common/components/index.d.ts +2 -2
  46. package/dist/common/hooks/useAriaLive.d.ts +1 -1
  47. package/dist/common/index.es.js +459 -445
  48. package/dist/common/stores/AppDataStore.d.ts +3 -1
  49. package/dist/common/stores/GlobalCopyStore.d.ts +0 -1
  50. package/dist/common/stores/GlobalStore.d.ts +3 -3
  51. package/dist/common/stores/GlobalUiStore.d.ts +10 -6
  52. package/dist/common/stores/UserStore.d.ts +3 -2
  53. package/dist/common/types/Account.d.ts +9 -6
  54. package/dist/dashboard/index.es.js +84 -116
  55. package/dist/debts/index.es.js +417 -413
  56. package/dist/{exportTransactionsToCSV-BrTYdSgJ.mjs → exportTransactionsToCSV-DtQ7ovAR.mjs} +1 -1
  57. package/dist/finstrong/index.es.js +1167 -1110
  58. package/dist/goals/index.es.js +618 -598
  59. package/dist/goals/stores/GoalStore.d.ts +19 -4
  60. package/dist/help/index.es.js +13 -13
  61. package/dist/investments/index.es.js +330 -325
  62. package/dist/investments/stores/HoldingStore.d.ts +1 -0
  63. package/dist/networth/components/NetWorthChart.d.ts +3 -2
  64. package/dist/networth/components/NetWorthList.d.ts +3 -3
  65. package/dist/networth/index.es.js +423 -433
  66. package/dist/networth/stores/NetWorthStore.d.ts +20 -9
  67. package/dist/networth/utils/NetWorthUtils.d.ts +2 -2
  68. package/dist/notifications/index.es.js +90 -91
  69. package/dist/notifications/stores/NotificationStore.d.ts +3 -1
  70. package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +3 -0
  71. package/dist/recurringtransactions/index.es.js +543 -562
  72. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +4 -2
  73. package/dist/settings/index.es.js +253 -248
  74. package/dist/spending/index.es.js +282 -301
  75. package/dist/transactions/index.es.js +269 -263
  76. package/dist/transactions/stores/TransactionStore.d.ts +26 -77
  77. package/dist/transactions/stores/UiStore.d.ts +0 -2
  78. package/dist/trends/index.es.js +708 -699
  79. package/dist/{useAccountDisplayName-BTvP_pw6.mjs → useAccountDisplayName-Bot2tb4n.mjs} +1 -1
  80. package/package.json +3 -3
  81. package/dist/AccountStore-CWFzg8-E.mjs +0 -260
  82. package/dist/Accounts-CWt-NRq8.mjs +0 -9
  83. package/dist/CategoryUtil-DZflYFam.mjs +0 -78
  84. package/dist/ConnectDrawer-BOjfI6rz.mjs +0 -563
  85. package/dist/GoalStore-C7ahxxLi.mjs +0 -364
  86. package/dist/NetWorthStore-xWIo9CYU.mjs +0 -150
  87. package/dist/TransactionStore-DJwPaZuM.mjs +0 -677
  88. package/dist/WidgetContainer-CrK6tyHr.mjs +0 -572
  89. package/dist/common/components/accountfilter/AccountFilter.d.ts +0 -20
  90. package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +0 -31
  91. package/dist/common/components/accountfilter/index.d.ts +0 -1
  92. package/dist/{ToggleListItem-ciFTiqRS.mjs → Notification-Bs1fdbzI.mjs} +1 -1
@@ -1,116 +1,98 @@
1
- import { jsxs as d, jsx as t } from "react/jsx-runtime";
2
- import a from "react";
3
- import { observer as w } from "mobx-react-lite";
4
- import { startOfMonth as st } from "date-fns/startOfMonth";
5
- import { endOfMonth as rt } from "date-fns/endOfMonth";
1
+ import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
+ import l from "react";
3
+ import { observer as A } from "mobx-react-lite";
4
+ import { startOfMonth as at } from "date-fns/startOfMonth";
5
+ import { endOfMonth as ot } from "date-fns/endOfMonth";
6
6
  import v from "@mui/material/Box";
7
- import y from "@mui/material/Stack";
8
- import W from "@mui/material/Tab";
9
- import ct from "@mui/material/Tabs";
7
+ import b from "@mui/material/Stack";
8
+ import N from "@mui/material/Tab";
9
+ import it from "@mui/material/Tabs";
10
10
  import yt from "@mui/material/styles/useTheme";
11
- import { g as lt, a as dt, S as N, b as Q } from "../SpendingLegend-gTCJLLkV.mjs";
12
- import { Text as T, Icon as St } from "@mxenabled/mxui";
13
- import { f as E } from "../NumberFormatting-DjTD0t3W.mjs";
14
- import { u as D, b as $, m as H, d as gt, a as V, h as Ct, g as Tt } from "../hooks-ZMp65DFz.mjs";
15
- import { u as pt } from "../useWidgetLoadTimer-hIOioiKx.mjs";
16
- import { L as P } from "../Loader-DUaFpDGv.mjs";
17
- import { M as Mt } from "../MiniWidgetContainer-98-hKFqm.mjs";
18
- import { startOfToday as Z } from "date-fns/startOfToday";
19
- import xt from "@mui/material/Button";
20
- import { useTheme as vt } from "@mui/material";
21
- import { e as wt } from "../exportTransactionsToCSV-BrTYdSgJ.mjs";
22
- import { T as Dt, a as Lt } from "../TransactionDetails-7MHOshKQ.mjs";
23
- import It from "@mui/material/Collapse";
11
+ import { g as rt, a as st, S as $, b as Y } from "../SpendingLegend-CD60HCYS.mjs";
12
+ import { Text as T, Icon as _t } from "@mxenabled/mxui";
13
+ import { f as R } from "../NumberFormatting-DjTD0t3W.mjs";
14
+ import { u as I, m as E, d as lt, b as z, a as V, h as ct, g as bt } from "../hooks-ZMp65DFz.mjs";
15
+ import { u as dt } from "../useWidgetLoadTimer-hIOioiKx.mjs";
16
+ import { L as gt } from "../Loader-DUaFpDGv.mjs";
17
+ import { M as Ct } from "../MiniWidgetContainer-98-hKFqm.mjs";
18
+ import { startOfToday as q } from "date-fns/startOfToday";
19
+ import St from "@mui/material/Button";
20
+ import { useTheme as Tt } from "@mui/material";
21
+ import { e as Mt } from "../exportTransactionsToCSV-DtQ7ovAR.mjs";
22
+ import { T as Dt, a as xt } from "../TransactionDetails-BDhz3DLT.mjs";
23
+ import wt from "@mui/material/Collapse";
24
24
  import F from "@mui/material/Divider";
25
- import tt from "@mui/material/List";
26
- import et from "@mui/material/ListItem";
27
- import nt from "@mui/material/ListItemButton";
28
- import { u as At } from "../useScreenSize-B6JyS_Lj.mjs";
29
- import { D as ot } from "../Drawer-DV4NTsFg.mjs";
25
+ import J from "@mui/material/List";
26
+ import Q from "@mui/material/ListItem";
27
+ import Z from "@mui/material/ListItemButton";
28
+ import { u as Lt } from "../useScreenSize-B6JyS_Lj.mjs";
29
+ import { D as tt } from "../Drawer-DV4NTsFg.mjs";
30
30
  import { b as L } from "../Category-CevNQ03n.mjs";
31
- import { A as at, W as Et } from "../WidgetContainer-CrK6tyHr.mjs";
32
- const R = ({ amount: e, label: g, variant: o = "full" }) => /* @__PURE__ */ d(y, { direction: "column", children: [
33
- /* @__PURE__ */ t(T, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children: g }),
34
- /* @__PURE__ */ t(T, { variant: "XSmall", children: E(e, o === "mini" ? "0,0" : "0,0.00") })
35
- ] }), Wt = () => {
36
- const e = yt(), { goals: g, spending: o } = D(), { selectedAccounts: s } = $(), {
37
- categories: i,
38
- dateRangeCategoryTotals: r,
39
- dataRangeTotalsLoaded: n,
40
- loadDateRangeCategoryTotals: u
41
- } = H();
42
- pt({
43
- widgetName: "SpendingMiniWidget",
44
- isLoaded: n
45
- });
46
- const l = a.useMemo(
31
+ import { A as et, W as vt } from "../WidgetContainer-BbPS3Yxz.mjs";
32
+ const k = ({ amount: n, label: d, variant: a = "full" }) => /* @__PURE__ */ c(b, { direction: "column", children: [
33
+ /* @__PURE__ */ t(T, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children: d }),
34
+ /* @__PURE__ */ t(T, { variant: "XSmall", children: R(n, a === "mini" ? "0,0" : "0,0.00") })
35
+ ] }), At = () => {
36
+ const n = yt(), { goals: d, spending: a } = I(), { categories: o, dateRangeCategoryTotals: i } = E(), g = l.useMemo(
47
37
  () => [
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
38
+ n.palette.chartMono.chartMono5,
39
+ n.palette.chartMono.chartMono4,
40
+ n.palette.chartMono.chartMono3,
41
+ n.palette.chartMono.chartMono2,
42
+ n.palette.chartMono.chartMono1,
43
+ n.palette.chartMono.chartMono6
54
44
  ],
55
- [e]
56
- );
57
- a.useEffect(() => {
58
- u(
59
- s,
60
- st(/* @__PURE__ */ new Date()),
61
- rt(/* @__PURE__ */ new Date())
62
- ).finally();
63
- }, [s]);
64
- const [f, p] = a.useState(""), [m, M] = a.useState(0), b = a.useMemo(
65
- () => lt(i, g, e, r),
66
- [i, r]
67
- ), _ = a.useMemo(
68
- () => dt(i, r, l),
69
- [i, r, l]
70
- ), k = (S, O) => {
71
- M(O), p("");
72
- }, x = (S) => {
73
- p(f === S ? "" : S);
45
+ [n]
46
+ ), [e, r] = l.useState(""), [p, _] = l.useState(0), u = l.useMemo(
47
+ () => rt(o, d, n, i),
48
+ [o, i]
49
+ ), m = l.useMemo(
50
+ () => st(o, i, g),
51
+ [o, i, g]
52
+ ), M = (f, D) => {
53
+ _(D), r("");
54
+ }, y = (f) => {
55
+ r(e === f ? "" : f);
74
56
  };
75
- return n ? /* @__PURE__ */ d(v, { width: "100%", children: [
76
- /* @__PURE__ */ d(
77
- ct,
57
+ return /* @__PURE__ */ c(v, { width: "100%", children: [
58
+ /* @__PURE__ */ c(
59
+ it,
78
60
  {
79
- "aria-label": o.mini_title,
80
- onChange: k,
81
- value: m,
61
+ "aria-label": a.mini_title,
62
+ onChange: M,
63
+ value: p,
82
64
  variant: "fullWidth",
83
65
  children: [
84
66
  /* @__PURE__ */ t(
85
- W,
67
+ N,
86
68
  {
87
69
  "aria-controls": "spending-tabpanel",
88
70
  id: "spending-tab",
89
71
  label: /* @__PURE__ */ t(
90
- R,
72
+ k,
91
73
  {
92
- amount: b.totalAmount,
93
- label: o.spend_tab_title,
74
+ amount: u.totalAmount,
75
+ label: a.spend_tab_title,
94
76
  variant: "mini"
95
77
  }
96
78
  ),
97
- tabIndex: m === 0 ? 0 : -1
79
+ tabIndex: p === 0 ? 0 : -1
98
80
  }
99
81
  ),
100
82
  /* @__PURE__ */ t(
101
- W,
83
+ N,
102
84
  {
103
85
  "aria-controls": "income-tabpanel",
104
86
  id: "income-tab",
105
87
  label: /* @__PURE__ */ t(
106
- R,
88
+ k,
107
89
  {
108
- amount: _.totalAmount,
109
- label: o.income_tab_title,
90
+ amount: m.totalAmount,
91
+ label: a.income_tab_title,
110
92
  variant: "mini"
111
93
  }
112
94
  ),
113
- tabIndex: m === 1 ? 0 : -1
95
+ tabIndex: p === 1 ? 0 : -1
114
96
  }
115
97
  )
116
98
  ]
@@ -120,20 +102,20 @@ const R = ({ amount: e, label: g, variant: o = "full" }) => /* @__PURE__ */ d(y,
120
102
  v,
121
103
  {
122
104
  "aria-labelledby": "spending-tab",
123
- hidden: m !== 0,
105
+ hidden: p !== 0,
124
106
  id: "spending-tabpanel",
125
107
  role: "tabpanel",
126
- children: /* @__PURE__ */ d(y, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
108
+ children: /* @__PURE__ */ c(b, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
127
109
  /* @__PURE__ */ t(
128
- N,
110
+ $,
129
111
  {
130
- data: b,
131
- onSelected: x,
132
- selectedId: f,
133
- totalLabel: o.total_spending
112
+ data: u,
113
+ onSelected: y,
114
+ selectedId: e,
115
+ totalLabel: a.total_spending
134
116
  }
135
117
  ),
136
- /* @__PURE__ */ t(Q, { data: b, onSelected: x, selectedId: f })
118
+ /* @__PURE__ */ t(Y, { data: u, onSelected: y, selectedId: e })
137
119
  ] })
138
120
  }
139
121
  ),
@@ -141,65 +123,74 @@ const R = ({ amount: e, label: g, variant: o = "full" }) => /* @__PURE__ */ d(y,
141
123
  v,
142
124
  {
143
125
  "aria-labelledby": "income-tab",
144
- hidden: m !== 1,
126
+ hidden: p !== 1,
145
127
  id: "income-tabpanel",
146
128
  role: "tabpanel",
147
- children: /* @__PURE__ */ d(y, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
129
+ children: /* @__PURE__ */ c(b, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
148
130
  /* @__PURE__ */ t(
149
- N,
131
+ $,
150
132
  {
151
- data: _,
133
+ data: m,
152
134
  isIncome: !0,
153
- onSelected: x,
154
- selectedId: f,
155
- totalLabel: o.total_income
135
+ onSelected: y,
136
+ selectedId: e,
137
+ totalLabel: a.total_income
156
138
  }
157
139
  ),
158
- /* @__PURE__ */ t(Q, { data: _, onSelected: x, selectedId: f })
140
+ /* @__PURE__ */ t(Y, { data: m, onSelected: y, selectedId: e })
159
141
  ] })
160
142
  }
161
143
  )
162
- ] }) : /* @__PURE__ */ t(P, { height: 250 });
163
- }, Nt = w(Wt), Rt = ({ onPrimaryCtaClick: e, sx: g = {} }) => {
164
- const { visibleAccounts: o } = gt(), { spending: s } = D(), { isCopyLoaded: i, isInitialized: r, setSelectedAccounts: n } = $();
165
- return a.useEffect(() => {
166
- n(o);
167
- }, [o]), !i || !r ? /* @__PURE__ */ t(P, {}) : /* @__PURE__ */ t(
168
- Mt,
144
+ ] });
145
+ }, It = A(At), Et = ({ onPrimaryCtaClick: n, sx: d = {} }) => {
146
+ const { isAccountDataLoaded: a, loadAccountData: o } = lt(), { dateRangeTotalsLoaded: i, categoriesLoaded: g, loadCategories: e, loadDateRangeCategoryTotals: r } = E(), { spending: p } = I(), { isInitialized: _, selectedAccounts: u } = z();
147
+ return dt({
148
+ widgetName: "SpendingMiniWidget",
149
+ isLoaded: i
150
+ }), l.useEffect(() => {
151
+ a || o().finally(), g || e().finally();
152
+ }, []), l.useEffect(() => {
153
+ r(
154
+ u,
155
+ at(/* @__PURE__ */ new Date()),
156
+ ot(/* @__PURE__ */ new Date())
157
+ ).finally();
158
+ }, [u]), _ ? /* @__PURE__ */ t(
159
+ Ct,
169
160
  {
170
161
  className: "mx-exp-spending-miniwidget",
171
- onPrimaryCtaClick: e,
172
- primaryCtaLabel: s.primary_cta,
173
- sx: { height: "100%", ...g },
174
- title: s.mini_title,
175
- children: /* @__PURE__ */ t(Nt, {})
162
+ onPrimaryCtaClick: n,
163
+ primaryCtaLabel: p.primary_cta,
164
+ sx: { height: "100%", ...d },
165
+ title: p.mini_title,
166
+ children: /* @__PURE__ */ t(It, {})
176
167
  }
177
- );
178
- }, ye = w(Rt), $t = ({
179
- data: e,
180
- onSelected: g,
181
- selectedId: o = "",
182
- title: s
168
+ ) : /* @__PURE__ */ t(gt, {});
169
+ }, fe = A(Et), Wt = ({
170
+ data: n,
171
+ onSelected: d,
172
+ selectedId: a = "",
173
+ title: o
183
174
  }) => {
184
- const { spending: i } = D(), r = e.categoryData.find((n) => n.guid === o);
185
- return /* @__PURE__ */ d(y, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
186
- /* @__PURE__ */ t(T, { bold: !0, id: "spending-list-title", sx: { py: 12 }, variant: "h3", children: `${s} ${i.by_category}` }),
175
+ const { spending: i } = I(), g = n.categoryData.find((e) => e.guid === a);
176
+ return /* @__PURE__ */ c(b, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
177
+ /* @__PURE__ */ t(T, { bold: !0, id: "spending-list-title", sx: { py: 12 }, variant: "h3", children: `${o} ${i.by_category}` }),
187
178
  /* @__PURE__ */ t(F, { "aria-hidden": "true" }),
188
- /* @__PURE__ */ t(tt, { "aria-labelledby": "spending-list-title", children: e.categoryData.map((n) => /* @__PURE__ */ d(a.Fragment, { children: [
179
+ /* @__PURE__ */ t(J, { "aria-labelledby": "spending-list-title", children: n.categoryData.map((e) => /* @__PURE__ */ c(l.Fragment, { children: [
189
180
  /* @__PURE__ */ t(
190
- et,
181
+ Q,
191
182
  {
192
183
  disableGutters: !0,
193
184
  disablePadding: !0,
194
185
  sx: {
195
186
  minHeight: 44
196
187
  },
197
- children: /* @__PURE__ */ d(
198
- nt,
188
+ children: /* @__PURE__ */ c(
189
+ Z,
199
190
  {
200
- "aria-expanded": r?.guid === n.guid,
201
- id: `spending-list-category-${n.guid}`,
202
- onClick: () => g(n.guid),
191
+ "aria-expanded": g?.guid === e.guid,
192
+ id: `spending-list-category-${e.guid}`,
193
+ onClick: () => d(e.guid),
203
194
  sx: { minHeight: 44, px: 8, py: 0 },
204
195
  children: [
205
196
  /* @__PURE__ */ t(
@@ -208,20 +199,20 @@ const R = ({ amount: e, label: g, variant: o = "full" }) => /* @__PURE__ */ d(y,
208
199
  borderRadius: 4,
209
200
  flexShrink: 0,
210
201
  height: 8,
211
- sx: { backgroundColor: n.color, mr: 8 },
202
+ sx: { backgroundColor: e.color, mr: 8 },
212
203
  width: 8
213
204
  }
214
205
  ),
215
- /* @__PURE__ */ d(
216
- y,
206
+ /* @__PURE__ */ c(
207
+ b,
217
208
  {
218
209
  alignItems: "center",
219
210
  direction: "row",
220
211
  justifyContent: "space-between",
221
212
  width: "100%",
222
213
  children: [
223
- /* @__PURE__ */ t(T, { bold: o === n.guid, children: n.name }),
224
- /* @__PURE__ */ t(T, { bold: o === n.guid, variant: "Body", children: E(n.amount, "0,0.00") })
214
+ /* @__PURE__ */ t(T, { bold: a === e.guid, children: e.name }),
215
+ /* @__PURE__ */ t(T, { bold: a === e.guid, variant: "Body", children: R(e.amount, "0,0.00") })
225
216
  ]
226
217
  }
227
218
  )
@@ -231,57 +222,57 @@ const R = ({ amount: e, label: g, variant: o = "full" }) => /* @__PURE__ */ d(y,
231
222
  }
232
223
  ),
233
224
  /* @__PURE__ */ t(F, {}),
234
- n.categoryTotals && n.categoryTotals.length > 0 && /* @__PURE__ */ t(It, { in: r?.guid === n.guid, unmountOnExit: !0, children: /* @__PURE__ */ d(tt, { children: [
235
- r?.categoryTotals?.map((u) => /* @__PURE__ */ t(
236
- et,
225
+ e.categoryTotals && e.categoryTotals.length > 0 && /* @__PURE__ */ t(wt, { in: g?.guid === e.guid, unmountOnExit: !0, children: /* @__PURE__ */ c(J, { children: [
226
+ g?.categoryTotals?.map((r) => /* @__PURE__ */ t(
227
+ Q,
237
228
  {
238
229
  sx: {
239
230
  pl: 12,
240
231
  py: 0
241
232
  },
242
233
  children: /* @__PURE__ */ t(
243
- nt,
234
+ Z,
244
235
  {
245
- id: `spending-list-subcategory-${u.guid}`,
246
- onClick: () => g(u.guid, !0),
236
+ id: `spending-list-subcategory-${r.guid}`,
237
+ onClick: () => d(r.guid, !0),
247
238
  sx: { minHeight: 44, px: 8, py: 0 },
248
- children: /* @__PURE__ */ d(y, { direction: "row", justifyContent: "space-between", width: "100%", children: [
249
- /* @__PURE__ */ d(T, { children: [
250
- u.name,
239
+ children: /* @__PURE__ */ c(b, { direction: "row", justifyContent: "space-between", width: "100%", children: [
240
+ /* @__PURE__ */ c(T, { children: [
241
+ r.name,
251
242
  " "
252
243
  ] }),
253
- /* @__PURE__ */ t(T, { children: E(u.amount, "0,0.00") })
244
+ /* @__PURE__ */ t(T, { children: R(r.amount, "0,0.00") })
254
245
  ] })
255
246
  }
256
247
  )
257
248
  },
258
- u.guid
249
+ r.guid
259
250
  )),
260
251
  /* @__PURE__ */ t(F, {})
261
252
  ] }) })
262
- ] }, n.guid)) }),
263
- /* @__PURE__ */ t(T, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${i.total}: ${E(e.totalAmount, "0,0.00")}` })
253
+ ] }, e.guid)) }),
254
+ /* @__PURE__ */ t(T, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${i.total}: ${R(n.totalAmount, "0,0.00")}` })
264
255
  ] });
265
- }, kt = w($t), Ot = ({
266
- data: e,
267
- onSelected: g,
268
- onViewTransactions: o,
269
- selectedId: s,
256
+ }, Rt = A(Wt), Nt = ({
257
+ data: n,
258
+ onSelected: d,
259
+ onViewTransactions: a,
260
+ selectedId: o,
270
261
  title: i
271
262
  }) => {
272
- const { isDesktop: r, isMobile: n } = At(), { isLoadingCategoryTotals: u } = H(), { spending: l } = D();
273
- return /* @__PURE__ */ d(
274
- y,
263
+ const { isDesktop: g, isMobile: e } = Lt(), { dateRangeTotalsLoading: r } = E(), { spending: p } = I();
264
+ return /* @__PURE__ */ c(
265
+ b,
275
266
  {
276
- alignItems: n ? "center" : "flex-start",
277
- direction: n ? "column" : "row",
267
+ alignItems: e ? "center" : "flex-start",
268
+ direction: e ? "column" : "row",
278
269
  gap: { xs: 16, md: 64, xl: 100 },
279
270
  justifyContent: "center",
280
271
  pt: 50,
281
272
  px: 8,
282
273
  children: [
283
- u && /* @__PURE__ */ t(
284
- N,
274
+ r && /* @__PURE__ */ t(
275
+ $,
285
276
  {
286
277
  data: {
287
278
  categoryData: [],
@@ -291,214 +282,204 @@ const R = ({ amount: e, label: g, variant: o = "full" }) => /* @__PURE__ */ d(y,
291
282
  onSelected: () => {
292
283
  },
293
284
  selectedId: "",
294
- size: r ? 400 : 300,
285
+ size: g ? 400 : 300,
295
286
  totalLabel: "Loading ...",
296
287
  variant: "full"
297
288
  }
298
289
  ),
299
- !u && /* @__PURE__ */ t(
300
- N,
290
+ !r && /* @__PURE__ */ t(
291
+ $,
301
292
  {
302
- data: e,
293
+ data: n,
303
294
  onSelected: (m) => {
304
- g(m), setTimeout(() => document.getElementById(`spending-list-category-${m}`)?.focus(), 0);
295
+ d(m), setTimeout(() => document.getElementById(`spending-list-category-${m}`)?.focus(), 0);
305
296
  },
306
- onViewTransactions: o,
307
- selectedId: s,
308
- size: r ? 400 : 300,
309
- totalLabel: l.total_amount,
297
+ onViewTransactions: a,
298
+ selectedId: o,
299
+ size: g ? 400 : 300,
300
+ totalLabel: p.total_amount,
310
301
  variant: "full"
311
302
  }
312
303
  ),
313
- /* @__PURE__ */ t(kt, { data: e, onSelected: g, selectedId: s, title: i })
304
+ /* @__PURE__ */ t(Rt, { data: n, onSelected: d, selectedId: o, title: i })
314
305
  ]
315
306
  }
316
307
  );
317
- }, it = w(Ot), Bt = (e) => [
318
- e.palette.chartMono.chartMono5,
319
- e.palette.chartMono.chartMono4,
320
- e.palette.chartMono.chartMono3,
321
- e.palette.chartMono.chartMono2,
322
- e.palette.chartMono.chartMono1,
323
- e.palette.chartMono.chartMono6
324
- ], Gt = () => {
325
- const e = vt(), { is_mobile_webview: g } = V(), { clientConfig: o } = V(), {
326
- categories: s,
327
- dateRangeCategoryTotals: i,
328
- loadDateRangeCategoryTotals: r,
329
- dataRangeTotalsLoaded: n
330
- } = H(), {
331
- goals: u,
332
- spending: l,
333
- transactions: f
334
- } = D(), { displayedDateRange: p, selectedAccounts: m, selectedAccountGuids: M } = $(), {
335
- setFilter: b,
336
- sortedTransactions: _,
337
- sortedTransactionsWithSplits: k,
338
- tags: x
339
- } = Ct(), S = o?.master?.deep_link_params?.account_guids, O = o?.master?.deep_link_params?.view, [I, K] = a.useState(""), [A, ut] = a.useState(O === "income" ? 1 : 0), [U, X] = a.useState(""), [mt, B] = a.useState(!1);
340
- pt({
341
- widgetName: "SpendingWidget",
342
- isLoaded: n
343
- }), a.useEffect(() => {
344
- r(
345
- m,
346
- p.start,
347
- p.end
348
- ).finally();
349
- }, [m, p]);
350
- const G = a.useMemo(
351
- () => lt(s, u, e, i),
352
- [s, i]
353
- ), Y = a.useMemo(
354
- () => dt(s, i, Bt(e)),
355
- [s, i]
356
- ), j = a.useMemo(
357
- () => _.find((c) => c.guid === U),
358
- [U, _]
359
- ), ht = (c, C) => {
360
- ut(C), K("");
361
- }, q = (c, C = !1) => {
362
- C ? ft(c) : K(I === c || c === "0" ? "" : c);
363
- }, ft = (c) => {
364
- b({
308
+ }, nt = A(Nt), $t = (n) => [
309
+ n.palette.chartMono.chartMono5,
310
+ n.palette.chartMono.chartMono4,
311
+ n.palette.chartMono.chartMono3,
312
+ n.palette.chartMono.chartMono2,
313
+ n.palette.chartMono.chartMono1,
314
+ n.palette.chartMono.chartMono6
315
+ ], kt = () => {
316
+ const n = Tt(), { is_mobile_webview: d } = V(), { clientConfig: a } = V(), { categories: o, dateRangeCategoryTotals: i } = E(), {
317
+ goals: g,
318
+ spending: e,
319
+ transactions: r
320
+ } = I(), { displayedDateRange: p, selectedAccountGuids: _ } = z(), {
321
+ setFilter: u,
322
+ sortedTransactions: m,
323
+ sortedTransactionsWithSplits: M,
324
+ tags: y
325
+ } = ct(), f = a?.master?.deep_link_params?.account_guids, D = a?.master?.deep_link_params?.view, [x, C] = l.useState(""), [w, W] = l.useState(D === "income" ? 1 : 0), [H, P] = l.useState(""), [pt, O] = l.useState(!1), B = l.useMemo(
326
+ () => rt(o, g, n, i),
327
+ [o, i]
328
+ ), K = l.useMemo(
329
+ () => st(o, i, $t(n)),
330
+ [o, i]
331
+ ), G = l.useMemo(
332
+ () => m.find((s) => s.guid === H),
333
+ [H, m]
334
+ ), ut = (s, S) => {
335
+ W(S), C("");
336
+ }, U = (s, S = !1) => {
337
+ S ? mt(s) : C(x === s || s === "0" ? "" : s);
338
+ }, mt = (s) => {
339
+ u({
365
340
  ...{
366
- accounts: S || M,
341
+ accounts: f || _,
367
342
  dateRange: p
368
343
  },
369
- custom: (h) => I === "other" ? h.top_level_category_guid === c : h.category_guid === c,
344
+ custom: (h) => x === "other" ? h.top_level_category_guid === s : h.category_guid === s,
370
345
  showSplits: !0
371
- }), B(!0);
372
- }, J = (c) => {
373
- const C = {
374
- accounts: S || M,
346
+ }), O(!0);
347
+ }, X = (s) => {
348
+ const S = {
349
+ accounts: f || _,
375
350
  dateRange: p
376
351
  };
377
- if (A === 0)
378
- if (c === "other") {
379
- const h = G.categoryData.find((z) => z.guid === "other");
380
- b({
381
- ...C,
382
- custom: (z) => !!h?.categoryTotals?.find((_t) => _t.guid === z.top_level_category_guid)
352
+ if (w === 0)
353
+ if (s === "other") {
354
+ const h = B.categoryData.find((j) => j.guid === "other");
355
+ u({
356
+ ...S,
357
+ custom: (j) => !!h?.categoryTotals?.find((ft) => ft.guid === j.top_level_category_guid)
383
358
  });
384
359
  } else
385
- b({
386
- ...C,
387
- custom: (h) => c ? h.top_level_category_guid === c : h.top_level_category_guid !== L.INCOME && h.top_level_category_guid !== L.INVESTMENTS && h.top_level_category_guid !== L.TRANSFER,
388
- showSplits: !!c
360
+ u({
361
+ ...S,
362
+ custom: (h) => s ? h.top_level_category_guid === s : h.top_level_category_guid !== L.INCOME && h.category_guid !== L.INCOME && h.top_level_category_guid !== L.INVESTMENTS && h.top_level_category_guid !== L.TRANSFER,
363
+ showSplits: !!s
389
364
  });
390
365
  else
391
- b({
392
- ...C,
393
- custom: (h) => c ? h.category_guid === c : h.category_guid === L.INCOME || h.top_level_category_guid === L.INCOME
366
+ u({
367
+ ...S,
368
+ custom: (h) => s ? h.category_guid === s : h.category_guid === L.INCOME || h.top_level_category_guid === L.INCOME
394
369
  });
395
- B(!0);
396
- }, bt = () => {
397
- wt(k, x);
370
+ O(!0);
371
+ }, ht = () => {
372
+ Mt(M, y);
398
373
  };
399
- return /* @__PURE__ */ d(v, { children: [
400
- /* @__PURE__ */ d(ct, { onChange: ht, value: A, variant: "fullWidth", children: [
374
+ return /* @__PURE__ */ c(v, { children: [
375
+ /* @__PURE__ */ c(it, { onChange: ut, value: w, variant: "fullWidth", children: [
401
376
  /* @__PURE__ */ t(
402
- W,
377
+ N,
403
378
  {
404
379
  label: /* @__PURE__ */ t(
405
- R,
380
+ k,
406
381
  {
407
- amount: G.totalAmount,
408
- label: l.spend_tab_title
382
+ amount: B.totalAmount,
383
+ label: e.spend_tab_title
409
384
  }
410
385
  )
411
386
  }
412
387
  ),
413
388
  /* @__PURE__ */ t(
414
- W,
389
+ N,
415
390
  {
416
391
  label: /* @__PURE__ */ t(
417
- R,
392
+ k,
418
393
  {
419
- amount: Y.totalAmount,
420
- label: l.income_tab_title
394
+ amount: K.totalAmount,
395
+ label: e.income_tab_title
421
396
  }
422
397
  )
423
398
  }
424
399
  )
425
400
  ] }),
426
- A === 0 && /* @__PURE__ */ t(
427
- it,
401
+ w === 0 && /* @__PURE__ */ t(
402
+ nt,
428
403
  {
429
- data: G,
430
- onSelected: q,
431
- onViewTransactions: J,
432
- selectedId: I,
433
- title: l.spend_tab_title
404
+ data: B,
405
+ onSelected: U,
406
+ onViewTransactions: X,
407
+ selectedId: x,
408
+ title: e.spend_tab_title
434
409
  }
435
410
  ),
436
- A === 1 && /* @__PURE__ */ t(
437
- it,
411
+ w === 1 && /* @__PURE__ */ t(
412
+ nt,
438
413
  {
439
- data: Y,
440
- onSelected: q,
441
- onViewTransactions: J,
442
- selectedId: I,
443
- title: l.income_tab_title
414
+ data: K,
415
+ onSelected: U,
416
+ onViewTransactions: X,
417
+ selectedId: x,
418
+ title: e.income_tab_title
444
419
  }
445
420
  ),
446
421
  /* @__PURE__ */ t(
447
- ot,
422
+ tt,
448
423
  {
449
- ariaLabelClose: l.close_drawer_aria,
450
- isOpen: mt,
451
- onClose: () => B(!1),
452
- title: l.transactions_drawer_title,
453
- children: /* @__PURE__ */ d(y, { children: [
454
- !g && _.length > 0 && /* @__PURE__ */ t(y, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ t(
455
- xt,
424
+ ariaLabelClose: e.close_drawer_aria,
425
+ isOpen: pt,
426
+ onClose: () => O(!1),
427
+ title: e.transactions_drawer_title,
428
+ children: /* @__PURE__ */ c(b, { children: [
429
+ !d && m.length > 0 && /* @__PURE__ */ t(b, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ t(
430
+ St,
456
431
  {
457
- onClick: bt,
458
- startIcon: /* @__PURE__ */ t(St, { name: "ios_share" }),
432
+ onClick: ht,
433
+ startIcon: /* @__PURE__ */ t(_t, { name: "ios_share" }),
459
434
  variant: "text",
460
- children: f.export_csv_btn
435
+ children: r.export_csv_btn
461
436
  }
462
437
  ) }),
463
- /* @__PURE__ */ t(Dt, { onClick: X })
438
+ /* @__PURE__ */ t(Dt, { onClick: P })
464
439
  ] })
465
440
  }
466
441
  ),
467
442
  /* @__PURE__ */ t(
468
- ot,
443
+ tt,
469
444
  {
470
- ariaLabelClose: l.close_drawer_aria,
471
- isOpen: !!j,
472
- onClose: () => X(""),
473
- title: l.transaction_details_drawer_title,
474
- children: j && /* @__PURE__ */ t(Lt, { transaction: j })
445
+ ariaLabelClose: e.close_drawer_aria,
446
+ isOpen: !!G,
447
+ onClose: () => P(""),
448
+ title: e.transaction_details_drawer_title,
449
+ children: G && /* @__PURE__ */ t(xt, { transaction: G })
475
450
  }
476
451
  )
477
452
  ] });
478
- }, jt = w(Gt), zt = ({ onBackClick: e, sx: g = {} }) => {
479
- const { visibleAccounts: o } = gt(), { spending: s } = D(), { isCopyLoaded: i, isInitialized: r, setDisplayedDate: n, setSelectedAccounts: u } = $(), { onEvent: l } = Tt(), { clientConfig: f } = V(), p = f?.master?.deep_link_params?.date_range, [m, M] = a.useState(!1);
480
- a.useEffect(() => {
481
- u(o);
482
- }, [o]), a.useEffect(() => {
483
- p && Array.isArray(p) && p.length === 2 ? n(p[0], p[1]) : n(st(Z()), rt(Z())), M(!0), l(at.SPENDING_VIEW);
484
- }, []);
485
- const b = (_) => {
486
- n(_[0], _[1]);
453
+ }, Ot = A(kt), Bt = ({ onBackClick: n, sx: d = {} }) => {
454
+ const { isAccountDataLoaded: a, loadAccountData: o } = lt(), { categoriesLoaded: i, dateRangeTotalsLoaded: g, loadCategories: e, loadDateRangeCategoryTotals: r } = E(), { isTransactionDataLoaded: p, loadTransactionData: _ } = ct(), { spending: u } = I(), { displayedDateRange: m, isInitialized: M, setDisplayedDate: y, selectedAccounts: f } = z(), { onEvent: D } = bt(), { clientConfig: x } = V(), C = x?.master?.deep_link_params?.date_range;
455
+ dt({
456
+ widgetName: "SpendingWidget",
457
+ isLoaded: g
458
+ }), l.useEffect(() => {
459
+ C && Array.isArray(C) && C.length === 2 ? y(C[0], C[1]) : y(at(q()), ot(q())), a || o().finally(), i || e().finally(), p || _().finally(), D(et.SPENDING_VIEW);
460
+ }, []), l.useEffect(() => {
461
+ M && r(
462
+ f,
463
+ m.start,
464
+ m.end
465
+ ).finally();
466
+ }, [m, M, f]);
467
+ const w = (W) => {
468
+ y(W[0], W[1]);
487
469
  };
488
- return !i || !r || !m ? /* @__PURE__ */ t(P, {}) : /* @__PURE__ */ t(
489
- Et,
470
+ return M ? /* @__PURE__ */ t(
471
+ vt,
490
472
  {
491
- accountOptions: o,
492
- calendarActions: { onRangeChanged: b },
493
- onAccountsFilterClick: () => l(at.SPENDING_CLICK_FILTER),
494
- onBackClick: e,
495
- sx: g,
496
- title: s.title,
497
- children: /* @__PURE__ */ t(v, { width: "100%", children: /* @__PURE__ */ t(jt, {}) })
473
+ calendarActions: { onRangeChanged: w },
474
+ onAccountsFilterClick: () => D(et.SPENDING_CLICK_FILTER),
475
+ onBackClick: n,
476
+ sx: d,
477
+ title: u.title,
478
+ children: /* @__PURE__ */ t(v, { width: "100%", children: /* @__PURE__ */ t(Ot, {}) })
498
479
  }
499
- );
500
- }, Se = w(zt);
480
+ ) : /* @__PURE__ */ t(gt, {});
481
+ }, ye = A(Bt);
501
482
  export {
502
- ye as SpendingMiniWidget,
503
- Se as SpendingWidget
483
+ fe as SpendingMiniWidget,
484
+ ye as SpendingWidget
504
485
  };