@mx-cartographer/experiences 7.0.27-alpha.sms5 → 7.0.27-alpha.sms6

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 (54) hide show
  1. package/dist/{Account-BW3-oYEs.mjs → Account-CK-DrCEa.mjs} +1 -1
  2. package/dist/{AccountDetailsContent-UxSEMBo_.mjs → AccountDetailsContent-BZAbCT6q.mjs} +8 -8
  3. package/dist/{AccountDetailsHeader-Eb3WvBGm.mjs → AccountDetailsHeader-DXTi1p0V.mjs} +11 -11
  4. package/dist/{AccountFields-CIz-r3gP.mjs → AccountFields-Bxvi1C4Z.mjs} +2 -2
  5. package/dist/{AccountListItem-B-ZjJ4Gp.mjs → AccountListItem-CnE3rCVZ.mjs} +3 -3
  6. package/dist/{AccountStore-BaMynkQT.mjs → AccountStore-DiGbJBUT.mjs} +2 -2
  7. package/dist/{Accounts-CA-nqAjT.mjs → Accounts-BBkQjUmS.mjs} +1 -1
  8. package/dist/{BudgetUtil-CeSLAcsl.mjs → BudgetUtil-D5jO0box.mjs} +1 -1
  9. package/dist/{CategorySelectorDrawer-BJ9jlCyt.mjs → CategorySelectorDrawer-joMax4Fb.mjs} +1 -1
  10. package/dist/{ConnectDrawer-phFH6OHt.mjs → ConnectDrawer-D86nRDxQ.mjs} +1 -1
  11. package/dist/{ConnectionsDrawer-ihxkAi1P.mjs → ConnectionsDrawer-BkNr5Up0.mjs} +2 -2
  12. package/dist/{CurrencyInput-bEx2Mbd0.mjs → CurrencyInput-BkflFU_-.mjs} +1 -1
  13. package/dist/{DebtsStore-VkyMADzd.mjs → DebtsStore-qrqY9Abz.mjs} +1 -1
  14. package/dist/{ExportCsvAction-CbdFfDV5.mjs → ExportCsvAction-DRfdZis1.mjs} +3 -3
  15. package/dist/{GoalStore-eSOkI6uE.mjs → GoalStore-BQRcowCN.mjs} +2 -2
  16. package/dist/{Help-KAAMEubC.mjs → Help-B3dFeYi2.mjs} +1 -1
  17. package/dist/{LineChart-BWWmmJxV.mjs → LineChart-Dyps2sOy.mjs} +1 -1
  18. package/dist/{ListItemAction-DNZZ5fSa.mjs → ListItemAction-BgKx_n6d.mjs} +1 -1
  19. package/dist/{ManageIncome-DbsiKUoO.mjs → ManageIncome-CFh-N0KK.mjs} +4 -4
  20. package/dist/{MicroWidgetContainer-Dxz8uBN9.mjs → MicroWidgetContainer-DPDsZIiS.mjs} +1 -1
  21. package/dist/{MiniWidgetContainer-CTyjmE1h.mjs → MiniWidgetContainer-BzW7V_04.mjs} +1 -1
  22. package/dist/{NetWorthStore-B6xF9eGH.mjs → NetWorthStore-DWG9Mkuu.mjs} +2 -2
  23. package/dist/{NotificationSettings-D9eiZJk9.mjs → NotificationSettings-BaG4tpPe.mjs} +219 -214
  24. package/dist/{OriginalBalanceAction-DepsKiJz.mjs → OriginalBalanceAction-B--pIAF0.mjs} +3 -3
  25. package/dist/{RecurringSettings-Dj29piAQ.mjs → RecurringSettings-C9TjSuS_.mjs} +3 -3
  26. package/dist/{TransactionDetails-C-z3HGTT.mjs → TransactionDetails-C2gYzV0z.mjs} +37 -37
  27. package/dist/{TransactionStore-Cep_Eeql.mjs → TransactionStore-CZOvxcSw.mjs} +2 -2
  28. package/dist/{TrendsStore-WrHxzdbQ.mjs → TrendsStore-pvzHAX6B.mjs} +225 -231
  29. package/dist/{User-Dq9Qj764.mjs → User-D-O9EHMb.mjs} +1 -1
  30. package/dist/{WidgetContainer-CdBs9WOZ.mjs → WidgetContainer-Bn6JPnY3.mjs} +2 -2
  31. package/dist/accounts/index.es.js +12 -12
  32. package/dist/analytics/index.es.js +11 -11
  33. package/dist/budgets/index.es.js +10 -10
  34. package/dist/cashflow/index.es.js +7 -7
  35. package/dist/categories/index.es.js +1 -1
  36. package/dist/common/index.es.js +105 -104
  37. package/dist/dashboard/index.es.js +2 -2
  38. package/dist/debts/index.es.js +9 -9
  39. package/dist/{exportTransactionsToCSV-B5qAKd6C.mjs → exportTransactionsToCSV-zyHeWfQo.mjs} +1 -1
  40. package/dist/finstrong/index.es.js +6 -6
  41. package/dist/goals/index.es.js +11 -11
  42. package/dist/help/index.es.js +3 -3
  43. package/dist/{hooks-DkUqN6JE.mjs → hooks-DlI63qSB.mjs} +8 -8
  44. package/dist/investments/index.es.js +3 -3
  45. package/dist/merchants/index.es.js +1 -1
  46. package/dist/networth/index.es.js +7 -7
  47. package/dist/notifications/index.es.js +2 -2
  48. package/dist/recurringtransactions/index.es.js +8 -8
  49. package/dist/settings/index.es.js +6 -6
  50. package/dist/spending/index.es.js +14 -14
  51. package/dist/transactions/index.es.js +13 -13
  52. package/dist/trends/index.es.js +70 -69
  53. package/dist/useInsightsEnabled-fGr6xrSj.mjs +11 -0
  54. package/package.json +1 -1
@@ -1,74 +1,69 @@
1
- import M, { useState as J, useEffect as K, useRef as vt } from "react";
2
- import { l as St, u as _t, k as Q } from "./hooks-DkUqN6JE.mjs";
3
1
  import { jsxs as f, jsx as s } from "react/jsx-runtime";
2
+ import M, { useRef as Ct, useState as bt, useEffect as vt } from "react";
4
3
  import L from "@mui/material/Box";
5
4
  import T from "@mui/material/Stack";
6
- import { useTheme as U } from "@mui/material/styles";
7
- import { LineChart as Mt } from "@mui/x-charts";
8
- import { u as Z } from "./useScreenSize-B6JyS_Lj.mjs";
9
- import { u as Tt } from "./useDimensions-27p2evRx.mjs";
10
- import { observer as Dt } from "mobx-react-lite";
11
- import At from "@mui/material/Card";
12
- import Lt from "@mui/material/CardContent";
5
+ import { useTheme as J } from "@mui/material/styles";
6
+ import { LineChart as St } from "@mui/x-charts";
7
+ import { u as K } from "./useScreenSize-B6JyS_Lj.mjs";
8
+ import { u as _t } from "./useDimensions-27p2evRx.mjs";
9
+ import { observer as Mt } from "mobx-react-lite";
10
+ import Tt from "@mui/material/Card";
11
+ import Dt from "@mui/material/CardContent";
13
12
  import P from "@mui/material/Divider";
14
13
  import X from "@mui/material/Grid";
15
- import { CategoryIcon as Rt, Text as S } from "@mxenabled/mxui";
16
- import { b as It } from "./Localization-2MODESHW.mjs";
14
+ import { CategoryIcon as At, Text as S } from "@mxenabled/mxui";
15
+ import { u as Lt, l as Q } from "./hooks-DlI63qSB.mjs";
16
+ import { b as Rt } from "./Localization-2MODESHW.mjs";
17
17
  import { C as O } from "./CurrencyText-YUhH2caW.mjs";
18
- import { useTheme as wt, Card as Ht, CardContent as Et, Box as kt } from "@mui/material";
19
- import { f as R, D as I } from "./Dialog-CWW597AF.mjs";
20
- import Gt from "@mui/material/Button";
21
- import { C as A, b as Nt, c as Bt } from "./Category-CevNQ03n.mjs";
22
- import { f as z } from "./NumberFormatting-CtWHhyBX.mjs";
23
- import Ot from "@mui/material/ListItem";
24
- import $t from "@mui/material/ListItemButton";
25
- import V from "@mui/material/ListItemIcon";
26
- import Wt from "@mui/material/ListItemText";
27
- import { makeAutoObservable as jt } from "mobx";
28
- import { addSeconds as Ft } from "date-fns/addSeconds";
29
- import { differenceInCalendarMonths as Yt } from "date-fns/differenceInCalendarMonths";
18
+ import { useTheme as wt, Card as Ht, CardContent as It, Box as kt } from "@mui/material";
19
+ import { f as R, D as w } from "./Dialog-CWW597AF.mjs";
20
+ import Et from "@mui/material/Button";
21
+ import { C as A, b as Gt, c as Nt } from "./Category-CevNQ03n.mjs";
22
+ import { f as V } from "./NumberFormatting-CtWHhyBX.mjs";
23
+ import Bt from "@mui/material/ListItem";
24
+ import Ot from "@mui/material/ListItemButton";
25
+ import z from "@mui/material/ListItemIcon";
26
+ import $t from "@mui/material/ListItemText";
27
+ import { makeAutoObservable as Wt } from "mobx";
28
+ import { addSeconds as jt } from "date-fns/addSeconds";
29
+ import { differenceInCalendarMonths as Ft } from "date-fns/differenceInCalendarMonths";
30
30
  import { endOfMonth as q } from "date-fns/endOfMonth";
31
- import { subMonths as Pt } from "date-fns/subMonths";
32
- const Ee = () => {
33
- const { isInitialized: o, appDataStore: e } = St(), [r, n] = J(!1);
34
- return K(() => {
35
- o && e.clientInsightProfile?.is_enabled && n(!0);
36
- }, [o, e.clientInsightProfile]), r;
37
- }, tt = ({ categoryGuid: o, topLevelCategoryGuid: e }) => {
38
- const { categories: r } = _t(), { getCategoryName: n } = Q(), a = n(o);
31
+ import { subMonths as Yt } from "date-fns/subMonths";
32
+ const U = ({ categoryGuid: r, topLevelCategoryGuid: e }) => {
33
+ const { categories: o } = Lt(), { getCategoryName: a } = Q(), n = a(r);
39
34
  return /* @__PURE__ */ f(T, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
40
35
  /* @__PURE__ */ s(
41
36
  L,
42
37
  {
43
- "aria-label": It(r.category_icon_label_aria, a),
38
+ "aria-label": Rt(o.category_icon_label_aria, n),
44
39
  mb: 4,
45
40
  role: "img",
46
- children: /* @__PURE__ */ s(Rt, { categoryGuid: e })
41
+ children: /* @__PURE__ */ s(At, { categoryGuid: e })
47
42
  }
48
43
  ),
49
- /* @__PURE__ */ s(S, { variant: "Body", children: a })
44
+ /* @__PURE__ */ s(S, { variant: "Body", children: n })
50
45
  ] });
51
- }, Xt = ({
52
- categoryGuids: { guid: o, topLevelGuid: e },
53
- hoveredAreaData: r,
54
- cursorPosition: n,
55
- chartContainerRef: a
46
+ }, Pt = ({
47
+ categoryGuids: { guid: r, topLevelGuid: e },
48
+ hoveredAreaData: o,
49
+ cursorPosition: a,
50
+ chartContainerRef: n
56
51
  }) => {
57
- const i = U(), c = vt(null), [h, g] = J({ x: n.x, y: n.y });
58
- if (K(() => {
52
+ const i = J(), l = Ct(null), [h, g] = bt({ x: a.x, y: a.y });
53
+ if (vt(() => {
59
54
  (() => {
60
- const u = c.current, x = a.current;
55
+ const u = l.current, x = n.current;
61
56
  if (!u || !x) return;
62
- const y = u.getBoundingClientRect(), C = x.getBoundingClientRect();
63
- let p = n.x, v = n.y;
64
- p + y.width * 2 > C.right ? p = n.x - y.width : p - y.width < C.left && (p = n.x), v + y.height * 2 > C.bottom && (v = n.y - y.height), g({ x: p, y: v });
57
+ const y = u.getBoundingClientRect(), b = x.getBoundingClientRect();
58
+ let p = a.x, v = a.y;
59
+ p + y.width * 2 > b.right ? p = a.x - y.width : p - y.width < b.left && (p = a.x), v + y.height * 2 > b.bottom && (v = a.y - y.height), g({ x: p, y: v });
65
60
  })();
66
- }, [n, a]), !r) return null;
67
- const b = r.reduce((d, u) => d + u.y, 0);
61
+ }, [a, n]), !o) return null;
62
+ const C = o.reduce((d, u) => d + u.y, 0);
68
63
  return /* @__PURE__ */ s(
69
- At,
64
+ Tt,
70
65
  {
71
- ref: c,
66
+ ref: l,
72
67
  sx: {
73
68
  position: "absolute",
74
69
  top: h.y,
@@ -76,14 +71,14 @@ const Ee = () => {
76
71
  width: 250,
77
72
  pointerEvents: "none"
78
73
  },
79
- children: /* @__PURE__ */ f(Lt, { children: [
74
+ children: /* @__PURE__ */ f(Dt, { children: [
80
75
  /* @__PURE__ */ f(L, { alignItems: "center", display: "flex", flexDirection: "column", children: [
81
- /* @__PURE__ */ s(tt, { categoryGuid: o, topLevelCategoryGuid: e }),
82
- /* @__PURE__ */ s(S, { variant: "Small", children: `${r.length}-month total` }),
83
- /* @__PURE__ */ s(O, { amount: b, bold: !0, formatString: "0,0", variant: "body2" })
76
+ /* @__PURE__ */ s(U, { categoryGuid: r, topLevelCategoryGuid: e }),
77
+ /* @__PURE__ */ s(S, { variant: "Small", children: `${o.length}-month total` }),
78
+ /* @__PURE__ */ s(O, { amount: C, bold: !0, formatString: "0,0", variant: "body2" })
84
79
  ] }),
85
80
  /* @__PURE__ */ s(P, { sx: { my: 16, width: "100%" } }),
86
- /* @__PURE__ */ s(X, { container: !0, children: r.map((d, u) => /* @__PURE__ */ f(M.Fragment, { children: [
81
+ /* @__PURE__ */ s(X, { container: !0, children: o.map((d, u) => /* @__PURE__ */ f(M.Fragment, { children: [
87
82
  u > 0 && u % 3 === 0 && /* @__PURE__ */ s(P, { sx: { my: 16, width: "100%" } }),
88
83
  /* @__PURE__ */ s(X, { item: !0, xs: 4, children: /* @__PURE__ */ f(L, { alignItems: "center", display: "flex", flexDirection: "column", children: [
89
84
  /* @__PURE__ */ s(S, { color: i.palette.text.secondary, variant: "XSmall", children: d.x }),
@@ -101,44 +96,44 @@ const Ee = () => {
101
96
  ] })
102
97
  }
103
98
  );
104
- }, zt = Dt(Xt), Vt = ({
105
- categoryGuids: { guid: o, topLevelGuid: e },
106
- itemData: { dataIndex: r },
107
- series: n,
108
- xData: a
99
+ }, Xt = Mt(Pt), Vt = ({
100
+ categoryGuids: { guid: r, topLevelGuid: e },
101
+ itemData: { dataIndex: o },
102
+ series: a,
103
+ xData: n
109
104
  }) => {
110
- const i = wt(), c = n.data[r], h = a[r];
111
- return c === void 0 || !h ? null : /* @__PURE__ */ s(Ht, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ s(Et, { children: /* @__PURE__ */ f(kt, { alignItems: "center", display: "flex", flexDirection: "column", children: [
112
- /* @__PURE__ */ s(tt, { categoryGuid: o, topLevelCategoryGuid: e }),
113
- /* @__PURE__ */ s(S, { color: i.palette.text.secondary, variant: "Small", children: R(h, I.MONTH_SHORT_YEAR) }),
114
- /* @__PURE__ */ s(O, { amount: String(c), bold: !0, formatString: "0,0", variant: "Body" })
105
+ const i = wt(), l = a.data[o], h = n[o];
106
+ return l === void 0 || !h ? null : /* @__PURE__ */ s(Ht, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ s(It, { children: /* @__PURE__ */ f(kt, { alignItems: "center", display: "flex", flexDirection: "column", children: [
107
+ /* @__PURE__ */ s(U, { categoryGuid: r, topLevelCategoryGuid: e }),
108
+ /* @__PURE__ */ s(S, { color: i.palette.text.secondary, variant: "Small", children: R(h, w.MONTH_SHORT_YEAR) }),
109
+ /* @__PURE__ */ s(O, { amount: String(l), bold: !0, formatString: "0,0", variant: "Body" })
115
110
  ] }) }) });
116
- }, qt = ({
117
- sx: o,
111
+ }, zt = ({
112
+ sx: r,
118
113
  categoryGuids: e,
119
- hoveredLegend: r,
120
- legendRef: n,
121
- onHoverLegend: a,
114
+ hoveredLegend: o,
115
+ legendRef: a,
116
+ onHoverLegend: n,
122
117
  onClickLegend: i
123
118
  }) => {
124
- const { isMobile: c } = Z(), { getCategoryName: h } = Q();
119
+ const { isMobile: l } = K(), { getCategoryName: h } = Q();
125
120
  return /* @__PURE__ */ s(
126
121
  T,
127
122
  {
128
123
  direction: "row",
129
124
  flexWrap: "wrap",
130
- gap: c ? 2 : 6,
125
+ gap: l ? 2 : 6,
131
126
  justifyContent: "start",
132
- ref: n,
133
- sx: o,
134
- children: e.map(({ guid: g, top_level_guid: b }) => {
135
- const d = r === g, u = A[g], x = A[b], y = u ?? x ?? A.default, C = y + "33";
127
+ ref: a,
128
+ sx: r,
129
+ children: e.map(({ guid: g, top_level_guid: C }) => {
130
+ const d = o === g, u = A[g], x = A[C], y = u ?? x ?? A.default, b = y + "33";
136
131
  return /* @__PURE__ */ f(
137
- Gt,
132
+ Et,
138
133
  {
139
134
  onClick: () => i(g),
140
- onMouseEnter: () => a(g),
141
- onMouseLeave: () => a(null),
135
+ onMouseEnter: () => n(g),
136
+ onMouseLeave: () => n(null),
142
137
  sx: {
143
138
  color: "text.primary",
144
139
  fontWeight: "normal",
@@ -157,9 +152,9 @@ const Ee = () => {
157
152
  sx: {
158
153
  width: 16,
159
154
  height: 16,
160
- marginRight: c ? 5 : 10,
155
+ marginRight: l ? 5 : 10,
161
156
  borderRadius: "2px",
162
- backgroundColor: r ? d ? y : C : y
157
+ backgroundColor: o ? d ? y : b : y
163
158
  }
164
159
  }
165
160
  ),
@@ -171,44 +166,44 @@ const Ee = () => {
171
166
  })
172
167
  }
173
168
  );
174
- }, ke = ({
175
- onHoverArea: o,
169
+ }, Ie = ({
170
+ onHoverArea: r,
176
171
  onHoverPoint: e,
177
- onHoverLegend: r,
178
- onClickLegend: n,
179
- stackedDatasets: a,
172
+ onHoverLegend: o,
173
+ onClickLegend: a,
174
+ stackedDatasets: n,
180
175
  unstackedDatasets: i = [],
181
- availableHeight: c = 0,
176
+ availableHeight: l = 0,
182
177
  minimumHeight: h = 350
183
178
  }) => {
184
- const g = U(), { isMobile: b } = Z(), [d, { height: u }] = Tt(), x = M.useRef(null), [y, C] = M.useState(0);
179
+ const g = J(), { isMobile: C } = K(), [d, { height: u }] = _t(), x = M.useRef(null), [y, b] = M.useState(0);
185
180
  M.useEffect(() => {
186
- const t = Math.max(c - u, h);
187
- C(t);
188
- }, [c, u]);
189
- const [p, v] = M.useState(null), [et, w] = M.useState({
181
+ const t = Math.max(l - u, h);
182
+ b(t);
183
+ }, [l, u]);
184
+ const [p, v] = M.useState(null), [Z, H] = M.useState({
190
185
  hoveredSeriesId: null,
191
186
  hoveredAreaData: null,
192
187
  isAreaHovered: !1,
193
188
  cursorPos: { x: 0, y: 0 }
194
- }), { hoveredSeriesId: D, hoveredAreaData: $, isAreaHovered: ot, cursorPos: H } = et, W = ot && D && $, j = !W, G = [...a, ...i], rt = G[0]?.dataset.length ?? 0, N = G.flatMap((t) => t.dataset.map((l) => l.x)), nt = G.flatMap((t) => t.dataset.map((l) => l.y)), at = a[0]?.dataset?.map(
195
- (t, l) => a.reduce((m, _) => m + _.dataset[l]?.y || 0, 0)
196
- ) ?? [0], st = Math.max(...at), it = Math.max(
197
- ...i.flatMap((t) => t.dataset.map((l) => l.y))
198
- ), lt = Math.floor(Math.min(...nt) / 100) * 100, ct = Math.ceil(Math.max(st, it) / 100) * 100, E = a.map((t, l) => ({
199
- id: `stacked-${l}`,
189
+ }), { hoveredSeriesId: D, hoveredAreaData: $, isAreaHovered: tt, cursorPos: I } = Z, W = tt && D && $, j = !W, G = [...n, ...i], et = G[0]?.dataset.length ?? 0, N = G.flatMap((t) => t.dataset.map((c) => c.x)), ot = G.flatMap((t) => t.dataset.map((c) => c.y)), rt = n[0]?.dataset?.map(
190
+ (t, c) => n.reduce((m, _) => m + _.dataset[c]?.y || 0, 0)
191
+ ) ?? [0], at = Math.max(...rt), nt = Math.max(
192
+ ...i.flatMap((t) => t.dataset.map((c) => c.y))
193
+ ), st = Math.floor(Math.min(...ot) / 100) * 100, it = Math.ceil(Math.max(at, nt) / 100) * 100, k = n.map((t, c) => ({
194
+ id: `stacked-${c}`,
200
195
  guid: t.category_guid,
201
196
  top_level_guid: t.top_level_category_guid,
202
197
  area: !0,
203
- color: a[l].category_color ?? g.palette.primary.main,
198
+ color: n[c].category_color ?? g.palette.primary.main,
204
199
  data: t.dataset.map((m) => m.y),
205
- label: a[l].category_name,
200
+ label: n[c].category_name,
206
201
  stack: "total",
207
202
  type: "line",
208
203
  highlightScope: { highlight: "item" },
209
- valueFormatter: (m) => z(m, "0,0")
210
- })), F = i.map((t, l) => ({
211
- id: `unstacked-${l}`,
204
+ valueFormatter: (m) => V(m, "0,0")
205
+ })), F = i.map((t, c) => ({
206
+ id: `unstacked-${c}`,
212
207
  guid: t.category_guid,
213
208
  top_level_guid: t.top_level_category_guid,
214
209
  area: !1,
@@ -216,66 +211,66 @@ const Ee = () => {
216
211
  data: t.dataset.map((m) => m.y),
217
212
  label: t.category_name,
218
213
  type: "line",
219
- valueFormatter: (m) => z(m, "0,0")
220
- })), Y = [...E, ...F], dt = [
221
- ...E.map(({ guid: t, top_level_guid: l }) => ({
214
+ valueFormatter: (m) => V(m, "0,0")
215
+ })), Y = [...k, ...F], ct = [
216
+ ...k.map(({ guid: t, top_level_guid: c }) => ({
222
217
  guid: t,
223
- top_level_guid: l
218
+ top_level_guid: c
224
219
  })),
225
- ...F.map(({ guid: t, top_level_guid: l }) => ({
220
+ ...F.map(({ guid: t, top_level_guid: c }) => ({
226
221
  guid: t,
227
- top_level_guid: l
222
+ top_level_guid: c
228
223
  }))
229
- ], k = (t) => {
230
- const m = t.startsWith("stacked-") ? a[parseInt(t.split("-")[1])] : i[parseInt(t.split("-")[1])];
224
+ ], E = (t) => {
225
+ const m = t.startsWith("stacked-") ? n[parseInt(t.split("-")[1])] : i[parseInt(t.split("-")[1])];
231
226
  return {
232
227
  guid: m?.category_guid,
233
228
  topLevelGuid: m?.top_level_category_guid
234
229
  };
235
- }, ut = (t) => {
236
- v(t), r?.(t ?? "");
230
+ }, lt = (t) => {
231
+ v(t), o?.(t ?? "");
232
+ }, dt = (t) => {
233
+ a?.(t ?? "");
234
+ }, ut = () => {
235
+ const t = E(String(D)).guid;
236
+ t && a?.(t);
237
237
  }, mt = (t) => {
238
- n?.(t ?? "");
239
- }, gt = () => {
240
- const t = k(String(D)).guid;
241
- t && n?.(t);
242
- }, ht = (t) => {
243
- const l = String(t?.seriesId), m = k(l).guid, _ = Y.find((B) => B.id === l), ft = _ && t?.dataIndex !== void 0, xt = _ && t?.dataIndex === void 0;
244
- if (ft)
245
- w({
246
- hoveredSeriesId: l,
238
+ const c = String(t?.seriesId), m = E(c).guid, _ = Y.find((B) => B.id === c), pt = _ && t?.dataIndex !== void 0, yt = _ && t?.dataIndex === void 0;
239
+ if (pt)
240
+ H({
241
+ hoveredSeriesId: c,
247
242
  hoveredAreaData: null,
248
243
  isAreaHovered: !1,
249
- cursorPos: H
244
+ cursorPos: I
250
245
  }), e?.(m);
251
- else if (xt) {
252
- const B = _?.data.map((bt, Ct) => ({
253
- x: N[Ct],
254
- y: bt
246
+ else if (yt) {
247
+ const B = _?.data.map((ft, xt) => ({
248
+ x: N[xt],
249
+ y: ft
255
250
  })) ?? [];
256
- w({
257
- hoveredSeriesId: l,
251
+ H({
252
+ hoveredSeriesId: c,
258
253
  hoveredAreaData: B,
259
254
  isAreaHovered: !0,
260
- cursorPos: H
261
- }), o?.(m);
255
+ cursorPos: I
256
+ }), r?.(m);
262
257
  } else
263
- w({
258
+ H({
264
259
  hoveredSeriesId: null,
265
260
  hoveredAreaData: null,
266
261
  isAreaHovered: !1,
267
- cursorPos: H
262
+ cursorPos: I
268
263
  });
269
- }, pt = (t) => {
270
- const l = t.currentTarget.getBoundingClientRect();
271
- w((m) => ({
264
+ }, gt = (t) => {
265
+ const c = t.currentTarget.getBoundingClientRect();
266
+ H((m) => ({
272
267
  ...m,
273
268
  cursorPos: {
274
- x: t.clientX - l.left,
275
- y: t.clientY - l.top
269
+ x: t.clientX - c.left,
270
+ y: t.clientY - c.top
276
271
  }
277
272
  }));
278
- }, yt = {
273
+ }, ht = {
279
274
  p: 4,
280
275
  "& .MuiBarLabel-root": {
281
276
  fontSize: 10,
@@ -291,17 +286,17 @@ const Ee = () => {
291
286
  '& [class*="MuiLineElement-series-unstacked-"]': {
292
287
  strokeWidth: 3
293
288
  },
294
- ...p && E.reduce((t, l, m) => {
289
+ ...p && k.reduce((t, c, m) => {
295
290
  const _ = `.MuiAreaElement-series-stacked-${m}`;
296
291
  return t[_] = {
297
- opacity: E[m].guid === p ? 0.9 : 0.2
292
+ opacity: k[m].guid === p ? 0.9 : 0.2
298
293
  }, t;
299
294
  }, {})
300
295
  };
301
296
  return /* @__PURE__ */ s(
302
297
  L,
303
298
  {
304
- onMouseMove: pt,
299
+ onMouseMove: gt,
305
300
  ref: x,
306
301
  sx: {
307
302
  position: "relative",
@@ -322,12 +317,12 @@ const Ee = () => {
322
317
  sx: { width: "100%", position: "relative" },
323
318
  children: [
324
319
  /* @__PURE__ */ s(
325
- Mt,
320
+ St,
326
321
  {
327
322
  height: y,
328
323
  margin: { bottom: 50 },
329
- onAreaClick: gt,
330
- onHighlightChange: ht,
324
+ onAreaClick: ut,
325
+ onHighlightChange: mt,
331
326
  series: Y,
332
327
  skipAnimation: !0,
333
328
  slotProps: {
@@ -339,13 +334,13 @@ const Ee = () => {
339
334
  itemContent: (t) => j && D ? /* @__PURE__ */ s(
340
335
  Vt,
341
336
  {
342
- categoryGuids: k(D),
337
+ categoryGuids: E(D),
343
338
  xData: N,
344
339
  ...t
345
340
  }
346
341
  ) : null
347
342
  },
348
- sx: yt,
343
+ sx: ht,
349
344
  tooltip: {
350
345
  trigger: j ? "item" : "none"
351
346
  },
@@ -353,39 +348,39 @@ const Ee = () => {
353
348
  {
354
349
  data: N,
355
350
  scaleType: "time",
356
- valueFormatter: (t) => R(t, I.MONTH_SHORT_YEAR),
357
- tickNumber: rt
351
+ valueFormatter: (t) => R(t, w.MONTH_SHORT_YEAR),
352
+ tickNumber: et
358
353
  // How many ticks to show on the x-axis
359
354
  }
360
355
  ],
361
356
  yAxis: [
362
357
  {
363
- min: lt,
364
- max: ct || 100
358
+ min: st,
359
+ max: it || 100
365
360
  }
366
361
  ]
367
362
  }
368
363
  ),
369
364
  /* @__PURE__ */ s(
370
- qt,
365
+ zt,
371
366
  {
372
- categoryGuids: dt,
367
+ categoryGuids: ct,
373
368
  hoveredLegend: p,
374
369
  legendRef: d,
375
- onClickLegend: mt,
376
- onHoverLegend: ut,
377
- sx: { px: b ? 0 : 24 }
370
+ onClickLegend: dt,
371
+ onHoverLegend: lt,
372
+ sx: { px: C ? 0 : 24 }
378
373
  }
379
374
  ),
380
375
  W && /* @__PURE__ */ s(
381
- zt,
376
+ Xt,
382
377
  {
383
- categoryGuids: k(D),
378
+ categoryGuids: E(D),
384
379
  chartContainerRef: x,
385
- cursorPosition: H,
380
+ cursorPosition: I,
386
381
  hoveredAreaData: $.map((t) => ({
387
382
  ...t,
388
- x: R(t.x, I.MONTH_SHORT_YEAR)
383
+ x: R(t.x, w.MONTH_SHORT_YEAR)
389
384
  }))
390
385
  }
391
386
  )
@@ -394,19 +389,19 @@ const Ee = () => {
394
389
  )
395
390
  }
396
391
  );
397
- }, Ge = ({
398
- onClick: o,
392
+ }, ke = ({
393
+ onClick: r,
399
394
  leftIcon: e,
400
- rightIcon: r,
401
- title: n,
402
- subtitle: a,
395
+ rightIcon: o,
396
+ title: a,
397
+ subtitle: n,
403
398
  rightContent: i,
404
- titleBold: c = !0,
399
+ titleBold: l = !0,
405
400
  rightContentBold: h = !0
406
401
  }) => {
407
402
  const g = /* @__PURE__ */ f(M.Fragment, { children: [
408
- e && /* @__PURE__ */ s(V, { sx: { ml: 0 }, children: e }),
409
- /* @__PURE__ */ s(Wt, { children: /* @__PURE__ */ f(
403
+ e && /* @__PURE__ */ s(z, { sx: { ml: 0 }, children: e }),
404
+ /* @__PURE__ */ s($t, { children: /* @__PURE__ */ f(
410
405
  T,
411
406
  {
412
407
  sx: {
@@ -416,21 +411,21 @@ const Ee = () => {
416
411
  },
417
412
  children: [
418
413
  /* @__PURE__ */ f(T, { sx: { flex: 1, minWidth: 0 }, children: [
419
- /* @__PURE__ */ s(S, { bold: c, variant: "body1", children: n }),
420
- a && /* @__PURE__ */ s(S, { variant: "caption", children: a })
414
+ /* @__PURE__ */ s(S, { bold: l, variant: "body1", children: a }),
415
+ n && /* @__PURE__ */ s(S, { variant: "caption", children: n })
421
416
  ] }),
422
417
  /* @__PURE__ */ f(T, { sx: { flexDirection: "row", alignItems: "center", gap: 1 }, children: [
423
418
  i && /* @__PURE__ */ s(S, { bold: h, display: "flex", variant: "body1", children: i }),
424
- r && /* @__PURE__ */ s(V, { children: r })
419
+ o && /* @__PURE__ */ s(z, { children: o })
425
420
  ] })
426
421
  ]
427
422
  }
428
423
  ) })
429
424
  ] });
430
- return /* @__PURE__ */ s(Ot, { sx: { bgcolor: "background.paper" }, children: o ? /* @__PURE__ */ s(
431
- $t,
425
+ return /* @__PURE__ */ s(Bt, { sx: { bgcolor: "background.paper" }, children: r ? /* @__PURE__ */ s(
426
+ Ot,
432
427
  {
433
- onClick: o,
428
+ onClick: r,
434
429
  sx: {
435
430
  py: 14
436
431
  },
@@ -449,77 +444,77 @@ const Ee = () => {
449
444
  children: g
450
445
  }
451
446
  ) });
452
- }, Jt = (o) => A[o] ?? A.default, Kt = (o) => Bt[o];
453
- function Qt(o, e) {
454
- const r = [], n = new Date(o);
455
- for (; n <= e; ) {
456
- const a = n.getFullYear(), i = String(n.getMonth() + 1).padStart(2, "0");
457
- r.push(+`${a}${i}`), n.setMonth(n.getMonth() + 1);
447
+ }, qt = (r) => A[r] ?? A.default, Jt = (r) => Nt[r];
448
+ function Kt(r, e) {
449
+ const o = [], a = new Date(r);
450
+ for (; a <= e; ) {
451
+ const n = a.getFullYear(), i = String(a.getMonth() + 1).padStart(2, "0");
452
+ o.push(+`${n}${i}`), a.setMonth(a.getMonth() + 1);
458
453
  }
459
- return r;
454
+ return o;
460
455
  }
461
- const Ut = (o) => o.reduce((r, n) => {
462
- const a = {
463
- top_level_category_guid: n.top_level_category_guid,
464
- category_guid: n.category_guid,
465
- amount: n.total,
466
- year_month: n.year_month
467
- }, { top_level_category_guid: i, category_guid: c } = a;
468
- return r[c] || (r[c] = []), r[c].push(a), i !== c && (r[i] || (r[i] = []), r[i].push(a)), r;
469
- }, {}), Ne = (o, e, r) => {
470
- const n = Ut(o), a = Qt(e, r);
471
- return Object.entries(n).map(([c, h]) => {
472
- const g = h[0].top_level_category_guid, b = a.map((d) => {
456
+ const Qt = (r) => r.reduce((o, a) => {
457
+ const n = {
458
+ top_level_category_guid: a.top_level_category_guid,
459
+ category_guid: a.category_guid,
460
+ amount: a.total,
461
+ year_month: a.year_month
462
+ }, { top_level_category_guid: i, category_guid: l } = n;
463
+ return o[l] || (o[l] = []), o[l].push(n), i !== l && (o[i] || (o[i] = []), o[i].push(n)), o;
464
+ }, {}), Ee = (r, e, o) => {
465
+ const a = Qt(r), n = Kt(e, o);
466
+ return Object.entries(a).map(([l, h]) => {
467
+ const g = h[0].top_level_category_guid, C = n.map((d) => {
473
468
  const u = h.filter((p) => p.year_month === d).reduce((p, v) => p + Math.abs(v.amount), 0), x = Number(String(d).slice(0, 4)), y = Number(String(d).slice(4));
474
469
  return { x: new Date(x, y - 1), y: u };
475
470
  }).sort((d, u) => d.x.getTime() - u.x.getTime());
476
471
  return {
477
472
  top_level_category_guid: g,
478
- category_guid: c,
479
- category_name: Kt(c),
480
- category_color: Jt(g),
481
- dataset: b
473
+ category_guid: l,
474
+ category_name: Jt(l),
475
+ category_color: qt(g),
476
+ dataset: C
482
477
  };
483
478
  });
484
- }, Be = (o, e) => {
485
- const r = typeof o == "string" ? parseFloat(o.replace(/[^0-9.-]+/g, "")) : o, n = typeof e == "string" ? parseFloat(e.replace(/[^0-9.-]+/g, "")) : e;
486
- return (r || 0) - (n || 0);
487
- }, Zt = (o, e) => {
488
- const r = o.subCategories.filter((i) => i.currentAmount !== 0), n = o.totalMonthlyAmounts.slice(-e), a = (i) => i.substring(0, 3) + " " + i.slice(-4);
489
- return n.map((i) => {
490
- const c = a(i.label), h = r.map((d) => {
491
- const u = d.monthlyAmounts.slice(-e).find((x) => a(x.label) === c);
479
+ }, Ge = (r, e) => {
480
+ const o = typeof r == "string" ? parseFloat(r.replace(/[^0-9.-]+/g, "")) : r, a = typeof e == "string" ? parseFloat(e.replace(/[^0-9.-]+/g, "")) : e;
481
+ return (o || 0) - (a || 0);
482
+ }, Ut = (r, e) => {
483
+ const o = r.subCategories.filter((i) => i.currentAmount !== 0), a = r.totalMonthlyAmounts.slice(-e), n = (i) => i.substring(0, 3) + " " + i.slice(-4);
484
+ return a.map((i) => {
485
+ const l = n(i.label), h = o.map((d) => {
486
+ const u = d.monthlyAmounts.slice(-e).find((x) => n(x.label) === l);
492
487
  return {
493
488
  label: d.name,
494
489
  amount: Math.abs(u?.amount || 0),
495
- header: c
490
+ header: l
496
491
  };
497
- }), g = o.monthlyAmounts.slice(-e).find((d) => a(d.label) === c);
492
+ }), g = r.monthlyAmounts.slice(-e).find((d) => n(d.label) === l);
498
493
  return [{
499
- label: o.name,
494
+ label: r.name,
500
495
  amount: Math.abs(g?.amount || 0),
501
- header: c
496
+ header: l
502
497
  }, ...h].sort((d, u) => u.amount - d.amount);
503
498
  });
504
- }, te = (o, e) => {
505
- const r = o ? o.totalMonthlyAmounts.slice(-e).map((a) => ({
506
- x: a.label.substring(0, 3),
507
- y: Math.abs(a.amount)
508
- })) : [], n = o ? Zt(o, e) : [];
509
- return { monthlyAmounts: r, tooltipLabels: n };
510
- }, ee = (o) => o.slice().filter(
511
- (e) => e.totalAmount !== 0 && e.isTransfer === !1 && e.guid !== Nt.INVESTMENTS
512
- ).sort((e, r) => Math.abs(r.totalAmount) - Math.abs(e.totalAmount));
513
- class Oe {
499
+ }, Zt = (r, e) => {
500
+ const o = r ? r.totalMonthlyAmounts.slice(-e).map((n) => ({
501
+ x: n.label.substring(0, 3),
502
+ y: Math.abs(n.amount)
503
+ })) : [], a = r ? Ut(r, e) : [];
504
+ return { monthlyAmounts: o, tooltipLabels: a };
505
+ }, te = (r) => r.slice().filter(
506
+ (e) => e.totalAmount !== 0 && e.isTransfer === !1 && e.guid !== Gt.INVESTMENTS
507
+ ).sort((e, o) => Math.abs(o.totalAmount) - Math.abs(e.totalAmount));
508
+ class Ne {
514
509
  globalStore;
515
510
  selectedCategoryData = null;
516
511
  selectedDateRange;
517
512
  visibleListLength = 5;
518
513
  constructor(e) {
519
514
  this.globalStore = e, this.selectedDateRange = {
520
- start: Ft(q(Pt(/* @__PURE__ */ new Date(), 6)), 1),
515
+ start: jt(q(Yt(/* @__PURE__ */ new Date(), 6)), 1),
521
516
  end: q(/* @__PURE__ */ new Date())
522
- }, jt(this);
517
+ }, Wt(this);
523
518
  }
524
519
  setSelectedCategoryData = (e) => {
525
520
  this.selectedCategoryData = e;
@@ -531,16 +526,16 @@ class Oe {
531
526
  this.visibleListLength = e;
532
527
  };
533
528
  get sortedDetailedCategoriesWithTransactions() {
534
- return ee(
529
+ return te(
535
530
  this.globalStore.categoryStore.detailedCategoriesWithTransactions
536
531
  );
537
532
  }
538
533
  get selectedDateRangeMonthCount() {
539
- return Yt(this.selectedDateRange.end, this.selectedDateRange.start) + 1;
534
+ return Ft(this.selectedDateRange.end, this.selectedDateRange.start) + 1;
540
535
  }
541
536
  get selectedDateRangeMonthRange() {
542
- const e = R(this.selectedDateRange.start, I.MONTH_LONG), r = R(this.selectedDateRange.end, I.MONTH_LONG);
543
- return `${e} - ${r}`;
537
+ const e = R(this.selectedDateRange.start, w.MONTH_LONG), o = R(this.selectedDateRange.end, w.MONTH_LONG);
538
+ return `${e} - ${o}`;
544
539
  }
545
540
  get visibleCategories() {
546
541
  return this.sortedDetailedCategoriesWithTransactions.slice(0, this.visibleListLength);
@@ -549,17 +544,16 @@ class Oe {
549
544
  return this.sortedDetailedCategoriesWithTransactions.slice(this.visibleListLength);
550
545
  }
551
546
  get categoryDetailsChartData() {
552
- return te(
547
+ return Zt(
553
548
  this.selectedCategoryData,
554
549
  this.selectedDateRangeMonthCount
555
550
  );
556
551
  }
557
552
  }
558
553
  export {
559
- Ge as L,
560
- ke as S,
561
- Oe as T,
562
- Be as a,
563
- Ne as g,
564
- Ee as u
554
+ ke as L,
555
+ Ie as S,
556
+ Ne as T,
557
+ Ge as a,
558
+ Ee as g
565
559
  };