@mx-cartographer/experiences 7.4.8-alpha.mm0 → 7.4.8

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 (61) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{Account-BrOTlmeK.mjs → Account-01wOyrH1.mjs} +1 -1
  3. package/dist/{AccountDetailsContent-B7FqH05C.mjs → AccountDetailsContent-COMjOzwr.mjs} +8 -8
  4. package/dist/{AccountDetailsHeader-C8MxsxhN.mjs → AccountDetailsHeader-Cbi5G6fJ.mjs} +4 -4
  5. package/dist/{AccountFields-BQZ-o6Kj.mjs → AccountFields-Cd_nOWmf.mjs} +2 -2
  6. package/dist/{AccountListItem-aIE9WWTO.mjs → AccountListItem-DxY4cCF1.mjs} +4 -4
  7. package/dist/{AccountStore-DqO84Aer.mjs → AccountStore-C1zMBzHq.mjs} +2 -2
  8. package/dist/{Accounts-DC_A4UCa.mjs → Accounts-D7QljYas.mjs} +1 -1
  9. package/dist/{BudgetUtil-BmZXkL0C.mjs → BudgetUtil-Df2nII9u.mjs} +1 -1
  10. package/dist/{CategorySelectorDrawer-SUgfE5GN.mjs → CategorySelectorDrawer-DqJK_rrL.mjs} +1 -1
  11. package/dist/{ConnectDrawer-KL8t1qSC.mjs → ConnectDrawer-CuUj16NH.mjs} +1 -1
  12. package/dist/{ConnectionsDrawer-DaK5uIL5.mjs → ConnectionsDrawer-Bz4uwdFE.mjs} +2 -2
  13. package/dist/{CurrencyInput-itK0R3wV.mjs → CurrencyInput-BFKcs-_K.mjs} +1 -1
  14. package/dist/{DebtsStore-DVPZbv2C.mjs → DebtsStore-Bu8rRRSL.mjs} +1 -1
  15. package/dist/{ExportCsvAction-Cglo8Mca.mjs → ExportCsvAction-DzTrtPzk.mjs} +3 -3
  16. package/dist/{GoalStore-o4rrjGSJ.mjs → GoalStore-CrNhjvNc.mjs} +2 -2
  17. package/dist/{Help-BjLMsuMS.mjs → Help-BnPXM_N2.mjs} +1 -1
  18. package/dist/{LineChart-BQRxZF3p.mjs → LineChart-bc1D9xBE.mjs} +1 -1
  19. package/dist/{ListItemAction-BxTkF6Tz.mjs → ListItemAction-uobBrm_a.mjs} +1 -1
  20. package/dist/{ManageIncome-rcnDYsBJ.mjs → ManageIncome-A69EUO5u.mjs} +75 -75
  21. package/dist/{MicroWidgetContainer-B2hO9rOG.mjs → MicroWidgetContainer-DEiRnYVa.mjs} +1 -1
  22. package/dist/{MiniWidgetContainer-98-hKFqm.mjs → MiniWidgetContainer-CmXpTylX.mjs} +1 -1
  23. package/dist/{NetWorthStore-DG2X69jG.mjs → NetWorthStore-CpL_kqvx.mjs} +2 -2
  24. package/dist/{NotificationSettings-C7FYNM7I.mjs → NotificationSettings-CNmJWVeI.mjs} +248 -250
  25. package/dist/{OriginalBalanceAction-C6jdS4ws.mjs → OriginalBalanceAction-DK8_LkPz.mjs} +3 -3
  26. package/dist/{RecurringSettings-C81H1l38.mjs → RecurringSettings-B0uObPlD.mjs} +3 -3
  27. package/dist/{SpendingLegend-DqZxN_BZ.mjs → SpendingLegend-Bf-wbJvb.mjs} +2 -2
  28. package/dist/{TransactionDetails-BA_E5nQ-.mjs → TransactionDetails-COH0OKNG.mjs} +5 -5
  29. package/dist/{TransactionStore-PRlwE-TF.mjs → TransactionStore-Dz-G8Wd0.mjs} +2 -2
  30. package/dist/{User-Cnlegl1N.mjs → User-wXzDI4M8.mjs} +1 -1
  31. package/dist/{ViewMoreMicroCard-DfPXJzbv.mjs → ViewMoreMicroCard-C0832BMe.mjs} +101 -105
  32. package/dist/{WidgetContainer-CaPjoWeE.mjs → WidgetContainer-6dsjtOVg.mjs} +2 -2
  33. package/dist/accounts/index.es.js +140 -148
  34. package/dist/analytics/index.es.js +2 -2
  35. package/dist/budgets/index.es.js +478 -483
  36. package/dist/cashflow/index.es.js +362 -367
  37. package/dist/categories/index.es.js +1 -1
  38. package/dist/common/hooks/index.d.ts +0 -1
  39. package/dist/common/index.es.js +33 -35
  40. package/dist/dashboard/index.es.js +88 -90
  41. package/dist/debts/index.es.js +342 -346
  42. package/dist/{exportTransactionsToCSV-DuAaI5XA.mjs → exportTransactionsToCSV-Cz2t0lmA.mjs} +1 -1
  43. package/dist/finstrong/index.es.js +350 -352
  44. package/dist/goals/index.es.js +511 -518
  45. package/dist/help/index.es.js +9 -13
  46. package/dist/{hooks-ZMp65DFz.mjs → hooks-C41HAxM5.mjs} +11 -11
  47. package/dist/investments/index.es.js +393 -395
  48. package/dist/merchants/index.es.js +1 -1
  49. package/dist/microinsights/index.es.js +1 -1
  50. package/dist/networth/index.es.js +240 -245
  51. package/dist/notifications/index.es.js +2 -2
  52. package/dist/recurringtransactions/index.es.js +285 -293
  53. package/dist/settings/index.es.js +249 -252
  54. package/dist/spending/index.es.js +126 -138
  55. package/dist/transactions/index.es.js +73 -77
  56. package/dist/trends/index.es.js +588 -601
  57. package/dist/{useAccountDisplayName-Cjx8YmKK.mjs → useAccountDisplayName-CMMlIOXF.mjs} +2 -2
  58. package/dist/{useInsightsEnabled-B7dxpDrX.mjs → useInsightsEnabled-CNjP5cfR.mjs} +1 -1
  59. package/package.json +1 -1
  60. package/dist/common/hooks/useWidgetLoadTimer.d.ts +0 -6
  61. package/dist/useWidgetLoadTimer-C1NBkyLd.mjs +0 -23
@@ -1,111 +1,110 @@
1
1
  import { jsxs as f, jsx as e, Fragment as rt } from "react/jsx-runtime";
2
- import u, { useRef as at, useState as it, useEffect as ct } from "react";
3
- import { observer as R } from "mobx-react-lite";
4
- import { CategoryIcon as Se, Text as $, Icon as fe, P as he, H3 as Fe, ChevronRightIcon as lt } from "@mxenabled/mxui";
5
- import H from "@mui/material/Box";
2
+ import l, { useRef as at, useState as it, useEffect as ct } from "react";
3
+ import { observer as k } from "mobx-react-lite";
4
+ import { CategoryIcon as Se, Text as K, Icon as fe, P as he, H3 as Pe, ChevronRightIcon as lt } from "@mxenabled/mxui";
5
+ import N from "@mui/material/Box";
6
6
  import b from "@mui/material/Stack";
7
7
  import _e from "@mui/material/Button";
8
8
  import { addSeconds as $e } from "date-fns/addSeconds";
9
- import { differenceInCalendarMonths as Re } from "date-fns/differenceInCalendarMonths";
9
+ import { differenceInCalendarMonths as Ae } from "date-fns/differenceInCalendarMonths";
10
10
  import { useTheme as be } from "@mui/material/styles";
11
11
  import { LineChart as dt } from "@mui/x-charts";
12
12
  import { u as ee } from "../useScreenSize-B6JyS_Lj.mjs";
13
13
  import { u as ut } from "../useDimensions-27p2evRx.mjs";
14
14
  import ht from "@mui/material/Card";
15
15
  import gt from "@mui/material/CardContent";
16
- import ke from "@mui/material/Divider";
17
- import Oe from "@mui/material/Grid";
18
- import { u as N, m as U, g as V, b as me, h as xe, d as ve, v as pe, p as ze, f as Ne, a as mt } from "../hooks-ZMp65DFz.mjs";
19
- import { b as Ke } from "../Localization-2MODESHW.mjs";
16
+ import Re from "@mui/material/Divider";
17
+ import We from "@mui/material/Grid";
18
+ import { u as W, m as U, g as P, b as me, h as xe, d as ve, w as pe, q as Fe, f as He, n as mt, a as pt } from "../hooks-C41HAxM5.mjs";
19
+ import { b as ze } from "../Localization-2MODESHW.mjs";
20
20
  import { C as Te } from "../CurrencyText-Dr0EZ7bp.mjs";
21
- import { useTheme as pt, Card as Ct, CardContent as yt, Box as ft, Stack as _t } from "@mui/material";
22
- import { f as J, a as F } from "../Dialog-BPTr3qHE.mjs";
23
- import { C as Ae, c as Tt } from "../Category-CevNQ03n.mjs";
24
- import { f as se, a as St } from "../NumberFormatting-DjTD0t3W.mjs";
25
- import { a as bt, g as xt, L as je } from "../TrendsStore-BW9FGQeE.mjs";
21
+ import { useTheme as Ct, Card as yt, CardContent as ft, Box as _t, Stack as Tt } from "@mui/material";
22
+ import { f as J, a as z } from "../Dialog-BPTr3qHE.mjs";
23
+ import { C as Me, c as St } from "../Category-CevNQ03n.mjs";
24
+ import { f as oe, a as bt } from "../NumberFormatting-DjTD0t3W.mjs";
25
+ import { a as xt, g as vt, L as Ke } from "../TrendsStore-BW9FGQeE.mjs";
26
26
  import { T as Gn } from "../TrendsStore-BW9FGQeE.mjs";
27
- import { i as vt, c as wt, d as Dt, e as It, f as Et, h as Lt, b as Ye, g as Ue, j as Ge } from "../SpendingData-BuJ03S9d.mjs";
28
- import Mt from "@mui/material/ToggleButton";
29
- import At from "@mui/material/ToggleButtonGroup";
30
- import { DataGridPro as Rt } from "@mui/x-data-grid-pro";
31
- import { H as Be } from "../HeaderCell-DjuifqHJ.mjs";
32
- import { T as G, b as kt } from "../ViewMoreMicroCard-DfPXJzbv.mjs";
33
- import { A as v, W as Xe } from "../WidgetContainer-CaPjoWeE.mjs";
34
- import { a as Ze, T as Qe } from "../TransactionDetails-BA_E5nQ-.mjs";
35
- import { D as He } from "../Drawer-BEtCk82g.mjs";
36
- import { u as we } from "../useWidgetLoadTimer-C1NBkyLd.mjs";
27
+ import { i as wt, c as Dt, d as It, e as Et, f as Lt, h as Mt, b as je, g as Ye, j as Oe } from "../SpendingData-BuJ03S9d.mjs";
28
+ import At from "@mui/material/ToggleButton";
29
+ import Rt from "@mui/material/ToggleButtonGroup";
30
+ import { DataGridPro as kt } from "@mui/x-data-grid-pro";
31
+ import { H as Ge } from "../HeaderCell-DjuifqHJ.mjs";
32
+ import { T as G, b as Ht } from "../ViewMoreMicroCard-C0832BMe.mjs";
33
+ import { A as v, W as Ue } from "../WidgetContainer-6dsjtOVg.mjs";
34
+ import { a as Xe, T as Ze } from "../TransactionDetails-COH0OKNG.mjs";
35
+ import { D as ke } from "../Drawer-BEtCk82g.mjs";
37
36
  import { L as ge } from "../Loader-DUaFpDGv.mjs";
38
- import { L as We } from "../LineChart-BQRxZF3p.mjs";
39
- import { M as Ht } from "../MiniWidgetContainer-98-hKFqm.mjs";
40
- import { subMonths as Nt } from "date-fns";
41
- import { TrendingUp as Wt, TrendingDown as Ot, MultilineChart as Gt, ExpandLess as Bt, ExpandMore as Vt } from "@mxenabled/mx-icons";
42
- import { M as Pt } from "../MicroWidgetContainer-B2hO9rOG.mjs";
37
+ import { L as Ne } from "../LineChart-bc1D9xBE.mjs";
38
+ import { M as Nt } from "../MiniWidgetContainer-CmXpTylX.mjs";
39
+ import { subMonths as Wt } from "date-fns";
40
+ import { TrendingUp as Ot, TrendingDown as Gt, MultilineChart as Bt, ExpandLess as Vt, ExpandMore as Pt } from "@mxenabled/mx-icons";
41
+ import { M as $t } from "../MicroWidgetContainer-DEiRnYVa.mjs";
43
42
  import Ft from "@mui/material/Collapse";
44
- import $t from "@mui/material/List";
45
- import zt from "@mui/material/ListItem";
46
- import Kt from "@mui/material/ListItemButton";
47
- import jt from "@mui/material/ListItemIcon";
48
- import Yt from "@mui/material/ListItemText";
43
+ import zt from "@mui/material/List";
44
+ import Kt from "@mui/material/ListItem";
45
+ import jt from "@mui/material/ListItemButton";
46
+ import Yt from "@mui/material/ListItemIcon";
47
+ import Ut from "@mui/material/ListItemText";
49
48
  import qe from "@mui/material/styles/useTheme";
50
- import Ut from "@mui/material/Paper";
51
- import { b as Xt } from "../CategoryUtil-DUM8NuGO.mjs";
52
- import { E as Zt } from "../ExportCsvAction-Cglo8Mca.mjs";
53
- import { u as Qt } from "../useInsightsEnabled-B7dxpDrX.mjs";
54
- import { E as qt } from "../EmptyState-DoxNUae-.mjs";
55
- import { l as Jt } from "../ConnectDrawer-KL8t1qSC.mjs";
56
- const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
57
- const { categories: t } = N(), { getCategoryName: n } = U(), s = n(o);
49
+ import Xt from "@mui/material/Paper";
50
+ import { b as Zt } from "../CategoryUtil-DUM8NuGO.mjs";
51
+ import { E as qt } from "../ExportCsvAction-DzTrtPzk.mjs";
52
+ import { u as Qt } from "../useInsightsEnabled-CNjP5cfR.mjs";
53
+ import { E as Jt } from "../EmptyState-DoxNUae-.mjs";
54
+ import { l as eo } from "../ConnectDrawer-CuUj16NH.mjs";
55
+ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
56
+ const { categories: t } = W(), { getCategoryName: n } = U(), s = n(o);
58
57
  return /* @__PURE__ */ f(b, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
59
58
  /* @__PURE__ */ e(
60
- H,
59
+ N,
61
60
  {
62
- "aria-label": Ke(t.category_icon_label_aria, s),
61
+ "aria-label": ze(t.category_icon_label_aria, s),
63
62
  mb: 4,
64
63
  role: "img",
65
64
  children: /* @__PURE__ */ e(Se, { categoryGuid: r })
66
65
  }
67
66
  ),
68
- /* @__PURE__ */ e($, { variant: "Body", children: s })
67
+ /* @__PURE__ */ e(K, { variant: "Body", children: s })
69
68
  ] });
70
- }, eo = ({
69
+ }, to = ({
71
70
  categoryGuids: { guid: o, topLevelGuid: r },
72
71
  hoveredAreaData: t,
73
72
  cursorPosition: n,
74
73
  chartContainerRef: s
75
74
  }) => {
76
- const h = be(), g = at(null), [d, c] = it({ x: n.x, y: n.y });
75
+ const d = be(), u = at(null), [g, c] = it({ x: n.x, y: n.y });
77
76
  if (ct(() => {
78
77
  (() => {
79
- const l = g.current, T = s.current;
80
- if (!l || !T) return;
81
- const a = l.getBoundingClientRect(), p = T.getBoundingClientRect();
82
- let _ = n.x, y = n.y;
83
- _ + a.width * 2 > p.right ? _ = n.x - a.width : _ - a.width < p.left && (_ = n.x), y + a.height * 2 > p.bottom && (y = n.y - a.height), c({ x: _, y });
78
+ const p = u.current, _ = s.current;
79
+ if (!p || !_) return;
80
+ const m = p.getBoundingClientRect(), i = _.getBoundingClientRect();
81
+ let T = n.x, y = n.y;
82
+ T + m.width * 2 > i.right ? T = n.x - m.width : T - m.width < i.left && (T = n.x), y + m.height * 2 > i.bottom && (y = n.y - m.height), c({ x: T, y });
84
83
  })();
85
84
  }, [n, s]), !t) return null;
86
- const m = t.reduce((C, l) => C + l.y, 0);
85
+ const h = t.reduce((C, p) => C + p.y, 0);
87
86
  return /* @__PURE__ */ e(
88
87
  ht,
89
88
  {
90
- ref: g,
89
+ ref: u,
91
90
  sx: {
92
91
  position: "absolute",
93
- top: d.y,
94
- left: d.x,
92
+ top: g.y,
93
+ left: g.x,
95
94
  width: 250,
96
95
  pointerEvents: "none"
97
96
  },
98
97
  children: /* @__PURE__ */ f(gt, { children: [
99
- /* @__PURE__ */ f(H, { alignItems: "center", display: "flex", flexDirection: "column", children: [
100
- /* @__PURE__ */ e(Je, { categoryGuid: o, topLevelCategoryGuid: r }),
101
- /* @__PURE__ */ e($, { variant: "Small", children: `${t.length}-month total` }),
102
- /* @__PURE__ */ e(Te, { amount: m, bold: !0, formatString: "0,0", variant: "body2" })
98
+ /* @__PURE__ */ f(N, { alignItems: "center", display: "flex", flexDirection: "column", children: [
99
+ /* @__PURE__ */ e(Qe, { categoryGuid: o, topLevelCategoryGuid: r }),
100
+ /* @__PURE__ */ e(K, { variant: "Small", children: `${t.length}-month total` }),
101
+ /* @__PURE__ */ e(Te, { amount: h, bold: !0, formatString: "0,0", variant: "body2" })
103
102
  ] }),
104
- /* @__PURE__ */ e(ke, { sx: { my: 16, width: "100%" } }),
105
- /* @__PURE__ */ e(Oe, { container: !0, children: t.map((C, l) => /* @__PURE__ */ f(u.Fragment, { children: [
106
- l > 0 && l % 3 === 0 && /* @__PURE__ */ e(ke, { sx: { my: 16, width: "100%" } }),
107
- /* @__PURE__ */ e(Oe, { item: !0, xs: 4, children: /* @__PURE__ */ f(H, { alignItems: "center", display: "flex", flexDirection: "column", children: [
108
- /* @__PURE__ */ e($, { color: h.palette.text.secondary, variant: "XSmall", children: C.x }),
103
+ /* @__PURE__ */ e(Re, { sx: { my: 16, width: "100%" } }),
104
+ /* @__PURE__ */ e(We, { container: !0, children: t.map((C, p) => /* @__PURE__ */ f(l.Fragment, { children: [
105
+ p > 0 && p % 3 === 0 && /* @__PURE__ */ e(Re, { sx: { my: 16, width: "100%" } }),
106
+ /* @__PURE__ */ e(We, { item: !0, xs: 4, children: /* @__PURE__ */ f(N, { alignItems: "center", display: "flex", flexDirection: "column", children: [
107
+ /* @__PURE__ */ e(K, { color: d.palette.text.secondary, variant: "XSmall", children: C.x }),
109
108
  /* @__PURE__ */ e(
110
109
  Te,
111
110
  {
@@ -116,46 +115,46 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
116
115
  }
117
116
  )
118
117
  ] }) })
119
- ] }, l)) })
118
+ ] }, p)) })
120
119
  ] })
121
120
  }
122
121
  );
123
- }, to = R(eo), oo = ({
122
+ }, oo = k(to), no = ({
124
123
  categoryGuids: { guid: o, topLevelGuid: r },
125
124
  itemData: { dataIndex: t },
126
125
  series: n,
127
126
  xData: s
128
127
  }) => {
129
- const h = pt(), g = n.data[t], d = s[t];
130
- return g === void 0 || !d ? null : /* @__PURE__ */ e(Ct, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ e(yt, { children: /* @__PURE__ */ f(ft, { alignItems: "center", display: "flex", flexDirection: "column", children: [
131
- /* @__PURE__ */ e(Je, { categoryGuid: o, topLevelCategoryGuid: r }),
132
- /* @__PURE__ */ e($, { color: h.palette.text.secondary, variant: "Small", children: J(d, F.MONTH_SHORT_YEAR) }),
133
- /* @__PURE__ */ e(Te, { amount: String(g), bold: !0, formatString: "0,0", variant: "Body" })
128
+ const d = Ct(), u = n.data[t], g = s[t];
129
+ return u === void 0 || !g ? null : /* @__PURE__ */ e(yt, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ e(ft, { children: /* @__PURE__ */ f(_t, { alignItems: "center", display: "flex", flexDirection: "column", children: [
130
+ /* @__PURE__ */ e(Qe, { categoryGuid: o, topLevelCategoryGuid: r }),
131
+ /* @__PURE__ */ e(K, { color: d.palette.text.secondary, variant: "Small", children: J(g, z.MONTH_SHORT_YEAR) }),
132
+ /* @__PURE__ */ e(Te, { amount: String(u), bold: !0, formatString: "0,0", variant: "Body" })
134
133
  ] }) }) });
135
- }, no = ({
134
+ }, so = ({
136
135
  sx: o,
137
136
  categoryGuids: r,
138
137
  hoveredLegend: t,
139
138
  legendRef: n,
140
139
  onHoverLegend: s,
141
- onClickLegend: h
140
+ onClickLegend: d
142
141
  }) => {
143
- const { isMobile: g } = ee(), { getCategoryName: d } = U();
142
+ const { isMobile: u } = ee(), { getCategoryName: g } = U();
144
143
  return /* @__PURE__ */ e(
145
144
  b,
146
145
  {
147
146
  direction: "row",
148
147
  flexWrap: "wrap",
149
- gap: g ? 2 : 6,
148
+ gap: u ? 2 : 6,
150
149
  justifyContent: "start",
151
150
  ref: n,
152
151
  sx: o,
153
- children: r.map(({ guid: c, top_level_guid: m }) => {
154
- const C = t === c, l = Ae[c], T = Ae[m], a = l ?? T ?? Ae.default, p = a + "33";
152
+ children: r.map(({ guid: c, top_level_guid: h }) => {
153
+ const C = t === c, p = Me[c], _ = Me[h], m = p ?? _ ?? Me.default, i = m + "33";
155
154
  return /* @__PURE__ */ f(
156
155
  _e,
157
156
  {
158
- onClick: () => h(c),
157
+ onClick: () => d(c),
159
158
  onMouseEnter: () => s(c),
160
159
  onMouseLeave: () => s(null),
161
160
  sx: {
@@ -171,18 +170,18 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
171
170
  },
172
171
  children: [
173
172
  /* @__PURE__ */ e(
174
- H,
173
+ N,
175
174
  {
176
175
  sx: {
177
176
  width: 16,
178
177
  height: 16,
179
- marginRight: g ? 5 : 10,
178
+ marginRight: u ? 5 : 10,
180
179
  borderRadius: "2px",
181
- backgroundColor: t ? C ? a : p : a
180
+ backgroundColor: t ? C ? m : i : m
182
181
  }
183
182
  }
184
183
  ),
185
- /* @__PURE__ */ e($, { variant: "Body", children: d(c) })
184
+ /* @__PURE__ */ e(K, { variant: "Body", children: g(c) })
186
185
  ]
187
186
  },
188
187
  c
@@ -190,111 +189,111 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
190
189
  })
191
190
  }
192
191
  );
193
- }, so = ({
192
+ }, ro = ({
194
193
  onHoverArea: o,
195
194
  onHoverPoint: r,
196
195
  onHoverLegend: t,
197
196
  onClickLegend: n,
198
197
  stackedDatasets: s,
199
- unstackedDatasets: h = [],
200
- availableHeight: g = 0,
201
- minimumHeight: d = 350
198
+ unstackedDatasets: d = [],
199
+ availableHeight: u = 0,
200
+ minimumHeight: g = 350
202
201
  }) => {
203
- const c = be(), { isMobile: m } = ee(), [C, { height: l }] = ut(), T = u.useRef(null), [a, p] = u.useState(0);
204
- u.useEffect(() => {
205
- const i = Math.max(g - l, d);
206
- p(i);
207
- }, [g, l]);
208
- const [_, y] = u.useState(null), [E, x] = u.useState({
202
+ const c = be(), { isMobile: h } = ee(), [C, { height: p }] = ut(), _ = l.useRef(null), [m, i] = l.useState(0);
203
+ l.useEffect(() => {
204
+ const a = Math.max(u - p, g);
205
+ i(a);
206
+ }, [u, p]);
207
+ const [T, y] = l.useState(null), [L, x] = l.useState({
209
208
  hoveredSeriesId: null,
210
209
  hoveredAreaData: null,
211
210
  isAreaHovered: !1,
212
211
  cursorPos: { x: 0, y: 0 }
213
- }), { hoveredSeriesId: I, hoveredAreaData: W, isAreaHovered: L, cursorPos: O } = E, A = L && I && W, M = !A, P = [...s, ...h], z = P[0]?.dataset.length ?? 0, X = P.flatMap((i) => i.dataset.map((S) => S.x)), Ce = P.flatMap((i) => i.dataset.map((S) => S.y)), te = s[0]?.dataset?.map(
214
- (i, S) => s.reduce((D, Y) => D + Y.dataset[S]?.y || 0, 0)
215
- ) ?? [0], re = Math.max(...te), Z = Math.max(
216
- ...h.flatMap((i) => i.dataset.map((S) => S.y))
217
- ), ce = Math.floor(Math.min(...Ce) / 100) * 100, oe = Math.ceil(Math.max(re, Z) / 100) * 100, K = s.map((i, S) => ({
212
+ }), { hoveredSeriesId: D, hoveredAreaData: O, isAreaHovered: A, cursorPos: M } = L, R = A && D && O, E = !R, X = [...s, ...d], ne = X[0]?.dataset.length ?? 0, B = X.flatMap((a) => a.dataset.map((S) => S.x)), Ce = X.flatMap((a) => a.dataset.map((S) => S.y)), ae = s[0]?.dataset?.map(
213
+ (a, S) => s.reduce((I, Y) => I + Y.dataset[S]?.y || 0, 0)
214
+ ) ?? [0], Z = Math.max(...ae), ie = Math.max(
215
+ ...d.flatMap((a) => a.dataset.map((S) => S.y))
216
+ ), q = Math.floor(Math.min(...Ce) / 100) * 100, ce = Math.ceil(Math.max(Z, ie) / 100) * 100, $ = s.map((a, S) => ({
218
217
  id: `stacked-${S}`,
219
- guid: i.category_guid,
220
- top_level_guid: i.top_level_category_guid,
218
+ guid: a.category_guid,
219
+ top_level_guid: a.top_level_category_guid,
221
220
  area: !0,
222
221
  color: s[S].category_color ?? c.palette.primary.main,
223
- data: i.dataset.map((D) => D.y),
222
+ data: a.dataset.map((I) => I.y),
224
223
  label: s[S].category_name,
225
224
  stack: "total",
226
225
  type: "line",
227
226
  highlightScope: { highlight: "item" },
228
- valueFormatter: (D) => se(D, "0,0")
229
- })), ae = h.map((i, S) => ({
227
+ valueFormatter: (I) => oe(I, "0,0")
228
+ })), te = d.map((a, S) => ({
230
229
  id: `unstacked-${S}`,
231
- guid: i.category_guid,
232
- top_level_guid: i.top_level_category_guid,
230
+ guid: a.category_guid,
231
+ top_level_guid: a.top_level_category_guid,
233
232
  area: !1,
234
- color: i.category_color,
235
- data: i.dataset.map((D) => D.y),
236
- label: i.category_name,
233
+ color: a.category_color,
234
+ data: a.dataset.map((I) => I.y),
235
+ label: a.category_name,
237
236
  type: "line",
238
- valueFormatter: (D) => se(D, "0,0")
239
- })), ne = [...K, ...ae], ie = [
240
- ...K.map(({ guid: i, top_level_guid: S }) => ({
241
- guid: i,
237
+ valueFormatter: (I) => oe(I, "0,0")
238
+ })), se = [...$, ...te], re = [
239
+ ...$.map(({ guid: a, top_level_guid: S }) => ({
240
+ guid: a,
242
241
  top_level_guid: S
243
242
  })),
244
- ...ae.map(({ guid: i, top_level_guid: S }) => ({
245
- guid: i,
243
+ ...te.map(({ guid: a, top_level_guid: S }) => ({
244
+ guid: a,
246
245
  top_level_guid: S
247
246
  }))
248
- ], Q = (i) => {
249
- const D = i.startsWith("stacked-") ? s[parseInt(i.split("-")[1])] : h[parseInt(i.split("-")[1])];
247
+ ], j = (a) => {
248
+ const I = a.startsWith("stacked-") ? s[parseInt(a.split("-")[1])] : d[parseInt(a.split("-")[1])];
250
249
  return {
251
- guid: D?.category_guid,
252
- topLevelGuid: D?.top_level_category_guid
250
+ guid: I?.category_guid,
251
+ topLevelGuid: I?.top_level_category_guid
253
252
  };
254
- }, w = (i) => {
255
- y(i), t?.(i ?? "");
256
- }, B = (i) => {
257
- n?.(i ?? "");
258
- }, j = () => {
259
- const i = Q(String(I)).guid;
260
- i && n?.(i);
261
- }, le = (i) => {
262
- const S = String(i?.seriesId), D = Q(S).guid, Y = ne.find((de) => de.id === S), Ie = Y && i?.dataIndex !== void 0, Ee = Y && i?.dataIndex === void 0;
263
- if (Ie)
253
+ }, w = (a) => {
254
+ y(a), t?.(a ?? "");
255
+ }, V = (a) => {
256
+ n?.(a ?? "");
257
+ }, F = () => {
258
+ const a = j(String(D)).guid;
259
+ a && n?.(a);
260
+ }, le = (a) => {
261
+ const S = String(a?.seriesId), I = j(S).guid, Y = se.find((de) => de.id === S), De = Y && a?.dataIndex !== void 0, Ie = Y && a?.dataIndex === void 0;
262
+ if (De)
264
263
  x({
265
264
  hoveredSeriesId: S,
266
265
  hoveredAreaData: null,
267
266
  isAreaHovered: !1,
268
- cursorPos: O
269
- }), r?.(D);
270
- else if (Ee) {
271
- const de = Y?.data.map((Le, Me) => ({
272
- x: X[Me],
273
- y: Le
267
+ cursorPos: M
268
+ }), r?.(I);
269
+ else if (Ie) {
270
+ const de = Y?.data.map((Ee, Le) => ({
271
+ x: B[Le],
272
+ y: Ee
274
273
  })) ?? [];
275
274
  x({
276
275
  hoveredSeriesId: S,
277
276
  hoveredAreaData: de,
278
277
  isAreaHovered: !0,
279
- cursorPos: O
280
- }), o?.(D);
278
+ cursorPos: M
279
+ }), o?.(I);
281
280
  } else
282
281
  x({
283
282
  hoveredSeriesId: null,
284
283
  hoveredAreaData: null,
285
284
  isAreaHovered: !1,
286
- cursorPos: O
285
+ cursorPos: M
287
286
  });
288
- }, ye = (i) => {
289
- const S = i.currentTarget.getBoundingClientRect();
290
- x((D) => ({
291
- ...D,
287
+ }, we = (a) => {
288
+ const S = a.currentTarget.getBoundingClientRect();
289
+ x((I) => ({
290
+ ...I,
292
291
  cursorPos: {
293
- x: i.clientX - S.left,
294
- y: i.clientY - S.top
292
+ x: a.clientX - S.left,
293
+ y: a.clientY - S.top
295
294
  }
296
295
  }));
297
- }, De = {
296
+ }, ye = {
298
297
  p: 4,
299
298
  "& .MuiBarLabel-root": {
300
299
  fontSize: 10,
@@ -310,18 +309,18 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
310
309
  '& [class*="MuiLineElement-series-unstacked-"]': {
311
310
  strokeWidth: 3
312
311
  },
313
- ..._ && K.reduce((i, S, D) => {
314
- const Y = `.MuiAreaElement-series-stacked-${D}`;
315
- return i[Y] = {
316
- opacity: K[D].guid === _ ? 0.9 : 0.2
317
- }, i;
312
+ ...T && $.reduce((a, S, I) => {
313
+ const Y = `.MuiAreaElement-series-stacked-${I}`;
314
+ return a[Y] = {
315
+ opacity: $[I].guid === T ? 0.9 : 0.2
316
+ }, a;
318
317
  }, {})
319
318
  };
320
319
  return /* @__PURE__ */ e(
321
- H,
320
+ N,
322
321
  {
323
- onMouseMove: ye,
324
- ref: T,
322
+ onMouseMove: we,
323
+ ref: _,
325
324
  sx: {
326
325
  position: "relative",
327
326
  touchAction: "pan-y",
@@ -343,11 +342,11 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
343
342
  /* @__PURE__ */ e(
344
343
  dt,
345
344
  {
346
- height: a,
345
+ height: m,
347
346
  margin: { bottom: 50 },
348
- onAreaClick: j,
347
+ onAreaClick: F,
349
348
  onHighlightChange: le,
350
- series: ne,
349
+ series: se,
351
350
  skipAnimation: !0,
352
351
  slotProps: {
353
352
  legend: {
@@ -355,56 +354,56 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
355
354
  }
356
355
  },
357
356
  slots: {
358
- itemContent: (i) => M && I ? /* @__PURE__ */ e(
359
- oo,
357
+ itemContent: (a) => E && D ? /* @__PURE__ */ e(
358
+ no,
360
359
  {
361
- categoryGuids: Q(I),
362
- xData: X,
363
- ...i
360
+ categoryGuids: j(D),
361
+ xData: B,
362
+ ...a
364
363
  }
365
364
  ) : null
366
365
  },
367
- sx: De,
366
+ sx: ye,
368
367
  tooltip: {
369
- trigger: M ? "item" : "none"
368
+ trigger: E ? "item" : "none"
370
369
  },
371
370
  xAxis: [
372
371
  {
373
- data: X,
372
+ data: B,
374
373
  scaleType: "time",
375
- valueFormatter: (i) => J(i, F.MONTH_SHORT_YEAR),
376
- tickNumber: z
374
+ valueFormatter: (a) => J(a, z.MONTH_SHORT_YEAR),
375
+ tickNumber: ne
377
376
  // How many ticks to show on the x-axis
378
377
  }
379
378
  ],
380
379
  yAxis: [
381
380
  {
382
- min: ce,
383
- max: oe || 100
381
+ min: q,
382
+ max: ce || 100
384
383
  }
385
384
  ]
386
385
  }
387
386
  ),
388
387
  /* @__PURE__ */ e(
389
- no,
388
+ so,
390
389
  {
391
- categoryGuids: ie,
392
- hoveredLegend: _,
390
+ categoryGuids: re,
391
+ hoveredLegend: T,
393
392
  legendRef: C,
394
- onClickLegend: B,
393
+ onClickLegend: V,
395
394
  onHoverLegend: w,
396
- sx: { px: m ? 0 : 24 }
395
+ sx: { px: h ? 0 : 24 }
397
396
  }
398
397
  ),
399
- A && /* @__PURE__ */ e(
400
- to,
398
+ R && /* @__PURE__ */ e(
399
+ oo,
401
400
  {
402
- categoryGuids: Q(I),
403
- chartContainerRef: T,
404
- cursorPosition: O,
405
- hoveredAreaData: W.map((i) => ({
406
- ...i,
407
- x: J(i.x, F.MONTH_SHORT_YEAR)
401
+ categoryGuids: j(D),
402
+ chartContainerRef: _,
403
+ cursorPosition: M,
404
+ hoveredAreaData: O.map((a) => ({
405
+ ...a,
406
+ x: J(a.x, z.MONTH_SHORT_YEAR)
408
407
  }))
409
408
  }
410
409
  )
@@ -413,29 +412,29 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
413
412
  )
414
413
  }
415
414
  );
416
- }, et = ({ selectedTab: o, onTabChange: r }) => /* @__PURE__ */ e(
417
- At,
415
+ }, Je = ({ selectedTab: o, onTabChange: r }) => /* @__PURE__ */ e(
416
+ Rt,
418
417
  {
419
418
  exclusive: !0,
420
419
  onChange: r,
421
420
  orientation: "horizontal",
422
421
  value: o,
423
- children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(Mt, { color: "primary", sx: { width: 56 }, value: t, children: t === "Chart" ? /* @__PURE__ */ e(fe, { name: "table_chart_view" }) : /* @__PURE__ */ e(fe, { name: "format_list_bulleted" }) }, t))
422
+ children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(At, { color: "primary", sx: { width: 56 }, value: t, children: t === "Chart" ? /* @__PURE__ */ e(fe, { name: "table_chart_view" }) : /* @__PURE__ */ e(fe, { name: "format_list_bulleted" }) }, t))
424
423
  }
425
- ), tt = ({ selectedDateRange: o, selectedCategoryGuid: r }) => {
426
- const { trends: t } = N(), { isMobile: n, isDesktop: s } = ee(), { getCategoryName: h } = U(), g = u.useMemo(() => {
427
- const d = J(
424
+ ), et = ({ selectedDateRange: o, selectedCategoryGuid: r }) => {
425
+ const { trends: t } = W(), { isMobile: n, isDesktop: s } = ee(), { getCategoryName: d } = U(), u = l.useMemo(() => {
426
+ const g = J(
428
427
  o.start,
429
- n ? F.MONTH_SHORT_YEAR : F.MONTH_YEAR
428
+ n ? z.MONTH_SHORT_YEAR : z.MONTH_YEAR
430
429
  ), c = J(
431
430
  o.end,
432
- n ? F.MONTH_SHORT_YEAR : F.MONTH_YEAR
431
+ n ? z.MONTH_SHORT_YEAR : z.MONTH_YEAR
433
432
  );
434
- return `${d} - ${c}`;
433
+ return `${g} - ${c}`;
435
434
  }, [o, n]);
436
- return /* @__PURE__ */ f(H, { sx: { mr: 10, minWidth: "60%" }, children: [
435
+ return /* @__PURE__ */ f(N, { sx: { mr: 10, minWidth: "60%" }, children: [
437
436
  /* @__PURE__ */ e(
438
- $,
437
+ K,
439
438
  {
440
439
  display: "block",
441
440
  fontWeight: 700,
@@ -445,220 +444,217 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
445
444
  textOverflow: "unset"
446
445
  },
447
446
  variant: s ? "H3" : "Body",
448
- children: h(r) || t.sub_title
447
+ children: d(r) || t.sub_title
449
448
  }
450
449
  ),
451
- /* @__PURE__ */ e($, { variant: s ? "Body" : "Small", children: g })
450
+ /* @__PURE__ */ e(K, { variant: s ? "Body" : "Small", children: u })
452
451
  ] });
453
- }, ro = (o) => {
452
+ }, ao = (o) => {
454
453
  const r = o.row[o.field];
455
454
  return /* @__PURE__ */ e(b, { alignItems: "flex-end", tabIndex: o.tabIndex, children: /* @__PURE__ */ e(Te, { amount: r, variant: "Small" }) });
456
- }, ao = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
457
- const { getCategoryName: t } = U(), { categories: n } = N(), s = n.default_categories[o]?.replace(/&amp;/g, "&") ?? t(o);
455
+ }, io = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
456
+ const { getCategoryName: t } = U(), { categories: n } = W(), s = n.default_categories[o]?.replace(/&amp;/g, "&") ?? t(o);
458
457
  return /* @__PURE__ */ f(b, { alignItems: "center", direction: "row", justifyContent: "center", children: [
459
458
  /* @__PURE__ */ e(
460
- H,
459
+ N,
461
460
  {
462
- "aria-label": Ke(n.category_icon_label_aria, s),
461
+ "aria-label": ze(n.category_icon_label_aria, s),
463
462
  role: "img",
464
463
  children: /* @__PURE__ */ e(Se, { categoryGuid: r })
465
464
  }
466
465
  ),
467
- /* @__PURE__ */ e($, { sx: { ml: 12, pb: 6 }, variant: "Small", children: s })
466
+ /* @__PURE__ */ e(K, { sx: { ml: 12, pb: 6 }, variant: "Small", children: s })
468
467
  ] });
469
- }, io = (o) => /* @__PURE__ */ e(b, { alignItems: "center", direction: "row", height: "100%", width: "100%", children: /* @__PURE__ */ e(
470
- ao,
468
+ }, co = (o) => /* @__PURE__ */ e(b, { alignItems: "center", direction: "row", height: "100%", width: "100%", children: /* @__PURE__ */ e(
469
+ io,
471
470
  {
472
471
  categoryGuid: o.row.category,
473
472
  topLevelCategoryGuid: o.row.top_level_category_guid
474
473
  }
475
- ) }), co = (o, r) => {
474
+ ) }), lo = (o, r) => {
476
475
  const t = [], n = new Date(o);
477
476
  for (; n <= r; ) {
478
- const s = J(n, F.MONTH);
477
+ const s = J(n, z.MONTH);
479
478
  t.push(s), n.setMonth(n.getMonth() + 1);
480
479
  }
481
480
  return t;
482
- }, ot = ({
481
+ }, tt = ({
483
482
  monthlyCategoryTotals: o,
484
483
  selectedDateRange: r,
485
484
  selectedCategory: t,
486
485
  onClickRow: n,
487
486
  height: s = "100dvh",
488
- sx: h = {}
487
+ sx: d = {}
489
488
  }) => {
490
- const { onEvent: g } = V(), d = J(/* @__PURE__ */ new Date(), F.MONTH_SHORT), [c, m] = u.useState([
491
- { field: d, sort: "desc" }
492
- ]), C = u.useMemo(() => co(r.start, r.end), [r]), l = [
489
+ const { onEvent: u } = P(), g = J(/* @__PURE__ */ new Date(), z.MONTH_SHORT), [c, h] = l.useState([
490
+ { field: g, sort: "desc" }
491
+ ]), C = l.useMemo(() => lo(r.start, r.end), [r]), p = [
493
492
  {
494
493
  field: "category",
495
494
  flex: 1,
496
495
  headerName: "Category",
497
496
  minWidth: 175,
498
- renderHeader: Be,
499
- renderCell: io,
497
+ renderHeader: Ge,
498
+ renderCell: co,
500
499
  sortable: !0,
501
500
  type: "string"
502
501
  },
503
502
  ...C.map(
504
- (a) => ({
505
- field: a,
503
+ (m) => ({
504
+ field: m,
506
505
  flex: 1,
507
- headerName: a,
506
+ headerName: m,
508
507
  minWidth: 100,
509
- renderHeader: Be,
510
- renderCell: ro,
508
+ renderHeader: Ge,
509
+ renderCell: ao,
511
510
  align: "right",
512
511
  headerAlign: "right",
513
512
  sortable: !0,
514
513
  hideSortIcons: !1,
515
514
  type: "number",
516
- sortComparator: bt
515
+ sortComparator: xt
517
516
  })
518
517
  )
519
- ], T = u.useMemo(() => {
520
- const a = o.filter(
521
- (y) => !vt(y) && !wt(y)
522
- ), _ = (t ? a.filter(
518
+ ], _ = l.useMemo(() => {
519
+ const m = o.filter(
520
+ (y) => !wt(y) && !Dt(y)
521
+ ), T = (t ? m.filter(
523
522
  (y) => y.category_guid === t || y.top_level_category_guid === t
524
- ) : a).reduce(
525
- (y, E) => {
526
- const { category_guid: x, top_level_category_guid: I, month: W, total: L, year: O } = E, A = t ? x : I;
527
- y[A] || (y[A] = {
528
- id: A,
529
- category: A,
523
+ ) : m).reduce(
524
+ (y, L) => {
525
+ const { category_guid: x, top_level_category_guid: D, month: O, total: A, year: M } = L, R = t ? x : D;
526
+ y[R] || (y[R] = {
527
+ id: R,
528
+ category: R,
530
529
  category_guid: x,
531
- top_level_category_guid: I
530
+ top_level_category_guid: D
532
531
  });
533
- const M = J(new Date(O, W - 1), F.MONTH_SHORT);
534
- return y[A][M] || (y[A][M] = 0), y[A][M] = y[A][M] + Math.abs(L), y;
532
+ const E = J(new Date(M, O - 1), z.MONTH_SHORT);
533
+ return y[R][E] || (y[R][E] = 0), y[R][E] = y[R][E] + Math.abs(A), y;
535
534
  },
536
535
  {}
537
536
  );
538
- return Object.values(_);
537
+ return Object.values(T);
539
538
  }, [o, t]);
540
- return /* @__PURE__ */ e(H, { sx: { height: s, width: "100%", overflowX: "auto", boxShadow: "none", ...h }, children: /* @__PURE__ */ e(
541
- Rt,
539
+ return /* @__PURE__ */ e(N, { sx: { height: s, width: "100%", overflowX: "auto", boxShadow: "none", ...d }, children: /* @__PURE__ */ e(
540
+ kt,
542
541
  {
543
- columns: l,
542
+ columns: p,
544
543
  disableColumnFilter: !0,
545
544
  disableColumnMenu: !0,
546
545
  hideFooter: !0,
547
546
  initialState: { sorting: { sortModel: c } },
548
- onRowClick: (a) => {
549
- n?.(a.row.category), g(v.TRENDS_CLICK_LIST_ITEM, {
547
+ onRowClick: (m) => {
548
+ n?.(m.row.category), u(v.TRENDS_CLICK_LIST_ITEM, {
550
549
  ...G,
551
- listItem: Tt[a.row.category]
550
+ listItem: St[m.row.category]
552
551
  });
553
552
  },
554
- onSortModelChange: (a) => {
555
- m(a), g(v.TRENDS_CLICK_TABLE_SORT, G);
553
+ onSortModelChange: (m) => {
554
+ h(m), u(v.TRENDS_CLICK_TABLE_SORT, G);
556
555
  },
557
- rows: T,
556
+ rows: _,
558
557
  slotProps: { baseIconButton: { color: "secondary", sx: { ml: 8 } } },
559
558
  sortModel: c,
560
559
  sortingOrder: ["asc", "desc"]
561
560
  }
562
561
  ) });
563
- }, lo = {
562
+ }, uo = {
564
563
  title: "Transaction List"
565
- }, uo = ({
564
+ }, ho = ({
566
565
  categoryGuid: o,
567
566
  dateRange: r,
568
567
  isOpen: t,
569
568
  onClose: n
570
569
  }) => {
571
- const { onEvent: s } = V(), { selectedAccountGuids: h } = me(), { common: g } = N(), { setFilter: d, sortedTransactions: c } = xe(), [m, C] = u.useState(""), l = u.useMemo(
572
- () => c.find((a) => a.guid === m),
573
- [m, c]
570
+ const { onEvent: s } = P(), { selectedAccountGuids: d } = me(), { common: u } = W(), { setFilter: g, sortedTransactions: c } = xe(), [h, C] = l.useState(""), p = l.useMemo(
571
+ () => c.find((m) => m.guid === h),
572
+ [h, c]
574
573
  );
575
- u.useEffect(() => {
576
- d({
577
- accounts: h,
574
+ l.useEffect(() => {
575
+ g({
576
+ accounts: d,
578
577
  dateRange: r,
579
- custom: (a) => o === "" || o === a.category_guid || o === a.top_level_category_guid,
578
+ custom: (m) => o === "" || o === m.category_guid || o === m.top_level_category_guid,
580
579
  showSplits: !!o
581
580
  });
582
- }, [h, o, r]), u.useEffect(() => s(v.TRENDS_VIEW_TRANSACTIONS), []);
583
- const T = () => {
581
+ }, [d, o, r]), l.useEffect(() => s(v.TRENDS_VIEW_TRANSACTIONS), []);
582
+ const _ = () => {
584
583
  C(""), n();
585
584
  };
586
585
  return /* @__PURE__ */ f(
587
- He,
586
+ ke,
588
587
  {
589
- ariaLabelClose: g.close_aria,
588
+ ariaLabelClose: u.close_aria,
590
589
  isOpen: t,
591
- onClose: T,
592
- title: lo.title,
590
+ onClose: _,
591
+ title: uo.title,
593
592
  children: [
594
- l && /* @__PURE__ */ e(Ze, { transaction: l }),
595
- !l && /* @__PURE__ */ e(Qe, { onClick: C })
593
+ p && /* @__PURE__ */ e(Xe, { transaction: p }),
594
+ !p && /* @__PURE__ */ e(Ze, { onClick: C })
596
595
  ]
597
596
  }
598
597
  );
599
- }, ho = R(uo), go = ({ onBackClick: o, sx: r }) => {
600
- const { onEvent: t } = V(), { isDesktop: n, isTablet: s, isMobile: h } = ee(), { visibleAccounts: g } = ve(), { loadMonthlyCategoryTotals: d, monthlyCategoryTotals: c, getCategoryName: m } = U(), { sortedTransactions: C } = xe(), { selectedDateRange: l, setSelectedDateRange: T } = pe(), { isCopyLoaded: a, isInitialized: p, selectedAccounts: _, setSelectedAccounts: y } = me(), { trends: E } = N(), [x, I] = u.useState(!1), [W, L] = u.useState(!1), [O, A] = u.useState("Chart"), [M, P] = u.useState(""), [z, X] = u.useState(window.innerHeight), te = z - (h ? 315 : 345);
601
- we({
602
- widgetName: "TrendsFullWidget",
603
- isLoaded: x
604
- }), u.useEffect(() => {
605
- const w = () => X(window.innerHeight);
598
+ }, go = k(ho), mo = ({ onBackClick: o, sx: r }) => {
599
+ const { onEvent: t } = P(), { isDesktop: n, isTablet: s, isMobile: d } = ee(), { visibleAccounts: u } = ve(), { loadMonthlyCategoryTotals: g, monthlyCategoryTotals: c, getCategoryName: h } = U(), { sortedTransactions: C } = xe(), { selectedDateRange: p, setSelectedDateRange: _ } = pe(), { isCopyLoaded: m, isInitialized: i, selectedAccounts: T, setSelectedAccounts: y } = me(), { trends: L } = W(), [x, D] = l.useState(!1), [O, A] = l.useState(!1), [M, R] = l.useState("Chart"), [E, X] = l.useState(""), [ne, B] = l.useState(window.innerHeight), ae = ne - (d ? 315 : 345);
600
+ l.useEffect(() => {
601
+ const w = () => B(window.innerHeight);
606
602
  return window.addEventListener("resize", w), () => window.removeEventListener("resize", w);
607
- }, []), u.useEffect(() => {
608
- y(g);
609
- }, [g]), u.useEffect(() => {
610
- p && d(
611
- _,
612
- l.start,
613
- l.end
603
+ }, []), l.useEffect(() => {
604
+ y(u);
605
+ }, [u]), l.useEffect(() => {
606
+ i && g(
607
+ T,
608
+ p.start,
609
+ p.end
614
610
  ).finally(() => {
615
- I(!0);
611
+ D(!0);
616
612
  });
617
- }, [p, _, l]);
618
- const re = u.useMemo(() => {
613
+ }, [i, T, p]);
614
+ const Z = l.useMemo(() => {
619
615
  if (!x) return { stackedDatasets: [], unstackedDatasets: [] };
620
- const w = xt(
616
+ const w = vt(
621
617
  c,
622
- l.start,
623
- l.end
624
- ), B = M.length ? w.filter(
625
- (j) => j.top_level_category_guid === M || j.category_guid === M
626
- ) : Dt(w);
618
+ p.start,
619
+ p.end
620
+ ), V = E.length ? w.filter(
621
+ (F) => F.top_level_category_guid === E || F.category_guid === E
622
+ ) : It(w);
627
623
  return {
628
- stackedDatasets: B.filter(It),
629
- unstackedDatasets: B.filter(Et)
624
+ stackedDatasets: V.filter(Et),
625
+ unstackedDatasets: V.filter(Lt)
630
626
  };
631
- }, [c, M, l]), Z = (w, B) => {
632
- A(B ?? O), t(v.TRENDS_CLICK_TOGGLE_VIEW);
633
- }, ce = (w) => {
634
- const B = $e(w?.[0], 1), j = w?.[1], le = Re(j, B);
635
- T({ start: B, end: j }), t(v.TRENDS_CLICK_TIME_WINDOW, {
627
+ }, [c, E, p]), ie = (w, V) => {
628
+ R(V ?? M), t(v.TRENDS_CLICK_TOGGLE_VIEW);
629
+ }, q = (w) => {
630
+ const V = $e(w?.[0], 1), F = w?.[1], le = Ae(F, V);
631
+ _({ start: V, end: F }), t(v.TRENDS_CLICK_TIME_WINDOW, {
636
632
  time_period: le + "M"
637
633
  });
638
- }, oe = () => {
634
+ }, ce = () => {
639
635
  t(v.TRENDS_CLICK_FILTER);
640
- }, K = (w) => {
641
- P(w);
642
- }, ae = (w) => {
643
- P(w), t(v.TRENDS_CLICK_LEGEND, { category: m(w) });
644
- }, ne = (w) => {
645
- t(v.TRENDS_HOVER_LEGEND, { category: m(w) });
646
- }, ie = (w) => {
636
+ }, $ = (w) => {
637
+ X(w);
638
+ }, te = (w) => {
639
+ X(w), t(v.TRENDS_CLICK_LEGEND, { category: h(w) });
640
+ }, se = (w) => {
641
+ t(v.TRENDS_HOVER_LEGEND, { category: h(w) });
642
+ }, re = (w) => {
647
643
  t(v.TRENDS_HOVER_AREA, { category: w });
648
- }, Q = (w) => {
644
+ }, j = (w) => {
649
645
  t(v.TRENDS_HOVER_POINT, { category: w });
650
646
  };
651
- return !a || !p || !x ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ f(
652
- Xe,
647
+ return !m || !i || !x ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ f(
648
+ Ue,
653
649
  {
654
- accountOptions: g,
655
- calendarActions: { onRangeChanged: ce },
656
- dateRange: l,
650
+ accountOptions: u,
651
+ calendarActions: { onRangeChanged: q },
652
+ dateRange: p,
657
653
  dateRangeVariant: "timeframebuttons",
658
- onAccountsFilterClick: oe,
654
+ onAccountsFilterClick: ce,
659
655
  onBackClick: o,
660
656
  sx: r,
661
- title: E.title,
657
+ title: L.title,
662
658
  children: [
663
659
  /* @__PURE__ */ f(
664
660
  b,
@@ -673,46 +669,46 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
673
669
  {
674
670
  flexDirection: "row",
675
671
  justifyContent: "space-between",
676
- sx: { pb: h ? 12 : 24, pt: h ? 24 : 48 },
672
+ sx: { pb: d ? 12 : 24, pt: d ? 24 : 48 },
677
673
  children: [
678
674
  /* @__PURE__ */ e(
679
- tt,
675
+ et,
680
676
  {
681
- selectedCategoryGuid: M,
682
- selectedDateRange: l
677
+ selectedCategoryGuid: E,
678
+ selectedDateRange: p
683
679
  }
684
680
  ),
685
- /* @__PURE__ */ e(et, { onTabChange: Z, selectedTab: O })
681
+ /* @__PURE__ */ e(Je, { onTabChange: ie, selectedTab: M })
686
682
  ]
687
683
  }
688
684
  ),
689
685
  /* @__PURE__ */ f(b, { alignItems: "center", flexDirection: "row", width: "100%", children: [
690
- /* @__PURE__ */ e(H, { flexGrow: 1, children: M && /* @__PURE__ */ f(_e, { onClick: () => P(""), sx: { p: 0, pr: 5 }, children: [
686
+ /* @__PURE__ */ e(N, { flexGrow: 1, children: E && /* @__PURE__ */ f(_e, { onClick: () => X(""), sx: { p: 0, pr: 5 }, children: [
691
687
  /* @__PURE__ */ e(fe, { name: "arrow_back" }),
692
- E.all_categories
688
+ L.all_categories
693
689
  ] }) }),
694
- /* @__PURE__ */ e(_e, { onClick: () => L(!0), sx: { px: 5 }, children: `${E.view_transactions} (${C.length})` })
690
+ /* @__PURE__ */ e(_e, { onClick: () => A(!0), sx: { px: 5 }, children: `${L.view_transactions} (${C.length})` })
695
691
  ] }),
696
- /* @__PURE__ */ f(H, { children: [
697
- O === "Chart" && /* @__PURE__ */ e(
698
- so,
692
+ /* @__PURE__ */ f(N, { children: [
693
+ M === "Chart" && /* @__PURE__ */ e(
694
+ ro,
699
695
  {
700
- availableHeight: te,
701
- onClickLegend: ae,
702
- onHoverArea: ie,
703
- onHoverLegend: ne,
704
- onHoverPoint: Q,
705
- stackedDatasets: re.stackedDatasets,
706
- unstackedDatasets: re.unstackedDatasets
696
+ availableHeight: ae,
697
+ onClickLegend: te,
698
+ onHoverArea: re,
699
+ onHoverLegend: se,
700
+ onHoverPoint: j,
701
+ stackedDatasets: Z.stackedDatasets,
702
+ unstackedDatasets: Z.unstackedDatasets
707
703
  }
708
704
  ),
709
- O === "Table" && /* @__PURE__ */ e(
710
- ot,
705
+ M === "Table" && /* @__PURE__ */ e(
706
+ tt,
711
707
  {
712
708
  monthlyCategoryTotals: c,
713
- onClickRow: K,
714
- selectedCategory: M,
715
- selectedDateRange: l
709
+ onClickRow: $,
710
+ selectedCategory: E,
711
+ selectedDateRange: p
716
712
  }
717
713
  )
718
714
  ] })
@@ -720,21 +716,21 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
720
716
  }
721
717
  ),
722
718
  /* @__PURE__ */ e(
723
- ho,
719
+ go,
724
720
  {
725
- categoryGuid: M,
726
- dateRange: l,
727
- isOpen: W,
728
- onClose: () => L(!1)
721
+ categoryGuid: E,
722
+ dateRange: p,
723
+ isOpen: O,
724
+ onClose: () => A(!1)
729
725
  }
730
726
  )
731
727
  ]
732
728
  }
733
729
  );
734
- }, Rn = R(go), mo = () => {
735
- const { monthlyCategoryTotals: o } = U(), { trends: r } = N(), t = be(), { availableHeight: n = 300 } = ze(), s = Lt(o);
730
+ }, Rn = k(mo), po = () => {
731
+ const { monthlyCategoryTotals: o } = U(), { trends: r } = W(), t = be(), { availableHeight: n = 300 } = Fe(), s = Mt(o);
736
732
  return /* @__PURE__ */ e(
737
- We,
733
+ Ne,
738
734
  {
739
735
  baseline: "min",
740
736
  colors: [t.palette.primary.main],
@@ -749,39 +745,36 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
749
745
  valueFormatterString: "0,0"
750
746
  }
751
747
  );
752
- }, po = R(mo), Co = ({ onPrimaryCtaClick: o, sx: r }) => {
753
- const { visibleAccounts: t } = ve(), { loadMonthlyCategoryTotals: n, monthlyTotalsLoaded: s } = U(), { isInitialized: h } = Ne(), { trends: g } = N(), { isCopyLoaded: d, selectedAccounts: c, setSelectedAccounts: m } = me();
754
- return we({
755
- widgetName: "TrendsMiniWidget",
756
- isLoaded: s
757
- }), u.useEffect(() => {
758
- m(t);
759
- }, [t]), u.useEffect(() => {
760
- h && n(c).finally();
761
- }, [h, c]), !d || !h ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ e(
762
- Ht,
748
+ }, Co = k(po), yo = ({ onPrimaryCtaClick: o, sx: r }) => {
749
+ const { visibleAccounts: t } = ve(), { loadMonthlyCategoryTotals: n, monthlyTotalsLoaded: s } = U(), { isInitialized: d } = He(), { trends: u } = W(), { isCopyLoaded: g, selectedAccounts: c, setSelectedAccounts: h } = me();
750
+ return l.useEffect(() => {
751
+ h(t);
752
+ }, [t]), l.useEffect(() => {
753
+ d && n(c).finally();
754
+ }, [d, c]), !g || !d ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ e(
755
+ Nt,
763
756
  {
764
757
  contentStyles: { height: "calc(100% - 72px)", ":last-child": { pb: 0 } },
765
758
  onPrimaryCtaClick: o,
766
- primaryCtaLabel: g.primary_cta,
767
- subTitle: g.sub_title,
759
+ primaryCtaLabel: u.primary_cta,
760
+ subTitle: u.sub_title,
768
761
  sx: { height: "100%", ...r },
769
- title: g.mini_title,
770
- children: s ? /* @__PURE__ */ e(po, {}) : /* @__PURE__ */ e(ge, {})
762
+ title: u.mini_title,
763
+ children: s ? /* @__PURE__ */ e(Co, {}) : /* @__PURE__ */ e(ge, {})
771
764
  }
772
765
  );
773
- }, kn = R(Co), yo = 70, Ve = ({
766
+ }, kn = k(yo), fo = 70, Be = ({
774
767
  title: o,
775
768
  totalAmount: r,
776
769
  transactionType: t,
777
770
  percentage: n,
778
771
  secondaryLabel: s,
779
- shouldDisplayPercentage: h
772
+ shouldDisplayPercentage: d
780
773
  }) => {
781
- const { availableWidth: g } = ze(), d = u.useRef(null), c = u.useRef(null), m = St(Number(Math.abs(n)), {
774
+ const { availableWidth: u } = Fe(), g = l.useRef(null), c = l.useRef(null), h = bt(Number(Math.abs(n)), {
782
775
  style: "percent",
783
776
  minimumIntegerDigits: 1
784
- }), C = g === 288 && se(r, "0,0.00").length > 10 ? se(r, "0,0") : se(r, "0,0.00"), l = t === "spending" ? n > 0 : n >= 0, T = t === "spending" ? "error.main" : "success.main", a = t === "spending" ? "success.main" : "text.secondary", p = d?.current, _ = c?.current, y = p && _ ? p.scrollWidth > _.clientWidth - yo : !1;
777
+ }), C = u === 288 && oe(r, "0,0.00").length > 10 ? oe(r, "0,0") : oe(r, "0,0.00"), p = t === "spending" ? n > 0 : n >= 0, _ = t === "spending" ? "error.main" : "success.main", m = t === "spending" ? "success.main" : "text.secondary", i = g?.current, T = c?.current, y = i && T ? i.scrollWidth > T.clientWidth - fo : !1;
785
778
  return /* @__PURE__ */ f(
786
779
  b,
787
780
  {
@@ -805,17 +798,17 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
805
798
  },
806
799
  children: [
807
800
  /* @__PURE__ */ e(he, { color: "text.secondary", variant: "caption", children: o }),
808
- h && /* @__PURE__ */ f(b, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
809
- l ? /* @__PURE__ */ e(Wt, { size: 20, sx: { color: T } }) : /* @__PURE__ */ e(Ot, { size: 20, sx: { color: a } }),
801
+ d && /* @__PURE__ */ f(b, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
802
+ p ? /* @__PURE__ */ e(Ot, { size: 20, sx: { color: _ } }) : /* @__PURE__ */ e(Gt, { size: 20, sx: { color: m } }),
810
803
  /* @__PURE__ */ e(
811
804
  he,
812
805
  {
813
806
  sx: {
814
- color: l ? T : a,
807
+ color: p ? _ : m,
815
808
  fontWeight: 600
816
809
  },
817
810
  variant: "body2",
818
- children: m
811
+ children: h
819
812
  }
820
813
  )
821
814
  ] })
@@ -833,17 +826,17 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
833
826
  },
834
827
  children: [
835
828
  /* @__PURE__ */ e(
836
- H,
829
+ N,
837
830
  {
838
- ref: d,
831
+ ref: g,
839
832
  sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
840
- children: /* @__PURE__ */ e(Fe, { children: C })
833
+ children: /* @__PURE__ */ e(Pe, { children: C })
841
834
  }
842
835
  ),
843
- h && g >= 450 && !y && /* @__PURE__ */ e(
836
+ d && u >= 450 && !y && /* @__PURE__ */ e(
844
837
  he,
845
838
  {
846
- color: l ? T : a,
839
+ color: p ? _ : m,
847
840
  variant: "caption",
848
841
  children: s
849
842
  }
@@ -854,52 +847,49 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
854
847
  ]
855
848
  }
856
849
  );
857
- }, fo = R(() => {
858
- const { trends: o } = N();
850
+ }, _o = k(() => {
851
+ const { trends: o } = W();
859
852
  return /* @__PURE__ */ f(b, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
860
- /* @__PURE__ */ e(Gt, { size: 32 }),
853
+ /* @__PURE__ */ e(Bt, { size: 32 }),
861
854
  /* @__PURE__ */ f(b, { children: [
862
855
  /* @__PURE__ */ e(he, { fontWeight: 600, variant: "body1", children: o.zero_state_content_header }),
863
856
  /* @__PURE__ */ e(he, { color: "text.secondary", variant: "subtitle2", children: o.zero_state_content_description })
864
857
  ] })
865
858
  ] });
866
- }), Hn = R(({ onCtaClick: o }) => {
867
- const { visibleAccounts: r } = ve(), { onEvent: t } = V(), { monthlyCategoryTotals: n, loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: h } = U(), g = {
868
- start: Nt(/* @__PURE__ */ new Date(), 1),
859
+ }), Hn = k(({ onCtaClick: o }) => {
860
+ const { visibleAccounts: r } = ve(), { onEvent: t } = P(), { monthlyCategoryTotals: n, loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: d } = U(), u = {
861
+ start: Wt(/* @__PURE__ */ new Date(), 1),
869
862
  end: /* @__PURE__ */ new Date()
870
- }, { trends: d } = N(), { selectedAccounts: c, setSelectedAccounts: m, isInitialized: C } = me();
871
- we({
872
- widgetName: "TrendsMicroWidget",
873
- isLoaded: h
874
- }), u.useEffect(() => {
875
- m(r);
876
- }, [r]), u.useEffect(() => {
877
- C && s(c, g.start).then(() => {
863
+ }, { trends: g } = W(), { selectedAccounts: c, setSelectedAccounts: h, isInitialized: C } = me();
864
+ l.useEffect(() => {
865
+ h(r);
866
+ }, [r]), l.useEffect(() => {
867
+ C && s(c, u.start).then(() => {
878
868
  t(v.TRENDS_LOAD_WIDGET, {
879
869
  state: r?.length ? "default" : "zeroState"
880
870
  });
881
871
  });
882
872
  }, [C, c]);
883
- const { spendingData: l, incomeData: T } = u.useMemo(
873
+ const { spendingData: p, incomeData: _ } = l.useMemo(
884
874
  () => ({
885
- spendingData: Ye(n, g),
886
- incomeData: Ue(n, g)
875
+ spendingData: je(n, u),
876
+ incomeData: Ye(n, u)
887
877
  }),
888
- [n, g]
889
- ), [a, p] = l, [_, y] = T, E = Ge(p.y, a.y), x = Ge(y.y, _.y), I = C && !r?.length, W = () => {
878
+ [n, u]
879
+ ), [m, i] = p, [T, y] = _, L = Oe(i.y, m.y), x = Oe(y.y, T.y), D = C && !r?.length, O = () => {
890
880
  t(
891
- I ? v.TRENDS_CLICK_GET_STARTED : v.TRENDS_CLICK_VIEW_MORE
881
+ D ? v.TRENDS_CLICK_GET_STARTED : v.TRENDS_CLICK_VIEW_MORE
892
882
  ), o();
893
883
  };
894
- return !h || !C ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ e(
895
- Pt,
884
+ return !d || !C ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ e(
885
+ $t,
896
886
  {
897
887
  className: "mx-trends-microwidget",
898
- ctaLabel: d.micro_primary_cta_label,
899
- onCTAClick: W,
900
- subHeader: I ? void 0 : d.micro_subheader,
901
- title: d.title,
902
- children: I ? /* @__PURE__ */ e(fo, {}) : /* @__PURE__ */ f(
888
+ ctaLabel: g.micro_primary_cta_label,
889
+ onCTAClick: O,
890
+ subHeader: D ? void 0 : g.micro_subheader,
891
+ title: g.title,
892
+ children: D ? /* @__PURE__ */ e(_o, {}) : /* @__PURE__ */ f(
903
893
  b,
904
894
  {
905
895
  sx: {
@@ -909,23 +899,23 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
909
899
  },
910
900
  children: [
911
901
  /* @__PURE__ */ e(
912
- Ve,
902
+ Be,
913
903
  {
914
- percentage: E,
915
- secondaryLabel: d.micro_secondary_label,
916
- shouldDisplayPercentage: p.y !== 0 && a.y !== 0,
917
- title: d.spending_label,
918
- totalAmount: p.y,
904
+ percentage: L,
905
+ secondaryLabel: g.micro_secondary_label,
906
+ shouldDisplayPercentage: i.y !== 0 && m.y !== 0,
907
+ title: g.spending_label,
908
+ totalAmount: i.y,
919
909
  transactionType: "spending"
920
910
  }
921
911
  ),
922
912
  /* @__PURE__ */ e(
923
- Ve,
913
+ Be,
924
914
  {
925
915
  percentage: x,
926
- secondaryLabel: d.micro_secondary_label,
927
- shouldDisplayPercentage: y.y !== 0 && _.y !== 0,
928
- title: d.income_label,
916
+ secondaryLabel: g.micro_secondary_label,
917
+ shouldDisplayPercentage: y.y !== 0 && T.y !== 0,
918
+ title: g.income_label,
929
919
  totalAmount: y.y,
930
920
  transactionType: "income"
931
921
  }
@@ -935,17 +925,17 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
935
925
  )
936
926
  }
937
927
  );
938
- }), _o = R(
928
+ }), To = k(
939
929
  ({ isExpanded: o, onClick: r }) => {
940
930
  const t = qe();
941
- return /* @__PURE__ */ e(zt, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(Kt, { onClick: r, sx: { justifyContent: "center" }, children: /* @__PURE__ */ f(
931
+ return /* @__PURE__ */ e(Kt, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(jt, { onClick: r, sx: { justifyContent: "center" }, children: /* @__PURE__ */ f(
942
932
  b,
943
933
  {
944
934
  sx: { color: t.palette.primary.main, flexDirection: "row", alignItems: "center" },
945
935
  children: [
946
- /* @__PURE__ */ e(Yt, { children: /* @__PURE__ */ e($, { bold: !0, variant: "body2", children: o ? "View less" : "View more" }) }),
947
- /* @__PURE__ */ e(jt, { sx: { color: t.palette.primary.main }, children: o ? /* @__PURE__ */ e(Bt, {}) : /* @__PURE__ */ e(
948
- Vt,
936
+ /* @__PURE__ */ e(Ut, { children: /* @__PURE__ */ e(K, { bold: !0, variant: "body2", children: o ? "View less" : "View more" }) }),
937
+ /* @__PURE__ */ e(Yt, { sx: { color: t.palette.primary.main }, children: o ? /* @__PURE__ */ e(Vt, {}) : /* @__PURE__ */ e(
938
+ Pt,
949
939
  {
950
940
  sx: {
951
941
  transition: "transform 0.3s ease-in-out",
@@ -957,101 +947,101 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
957
947
  }
958
948
  ) }) });
959
949
  }
960
- ), Pe = R(
950
+ ), Ve = k(
961
951
  ({
962
952
  totalAmount: o,
963
953
  guid: r,
964
954
  name: t,
965
955
  transactions: n,
966
956
  onClick: s,
967
- isLastItem: h = !1,
968
- showDivider: g = !0
957
+ isLastItem: d = !1,
958
+ showDivider: u = !0
969
959
  }) => {
970
- const { trends: d } = N(), { onEvent: c } = V(), m = `${n.length} ${n.length === 1 ? d.transaction : d.transactions}`, C = () => {
960
+ const { trends: g } = W(), { onEvent: c } = P(), h = `${n.length} ${n.length === 1 ? g.transaction : g.transactions}`, C = () => {
971
961
  s?.(), c(v.TRENDS_CLICK_LIST_ITEM, {
972
962
  ...G,
973
963
  listItem: t
974
964
  });
975
965
  };
976
- return /* @__PURE__ */ f(u.Fragment, { children: [
966
+ return /* @__PURE__ */ f(l.Fragment, { children: [
977
967
  /* @__PURE__ */ e(
978
- je,
968
+ Ke,
979
969
  {
980
970
  leftIcon: r ? /* @__PURE__ */ e(Se, { categoryGuid: r }) : void 0,
981
971
  onClick: C,
982
- rightContent: se(Math.abs(o), "0,0.00"),
972
+ rightContent: oe(Math.abs(o), "0,0.00"),
983
973
  rightIcon: s ? /* @__PURE__ */ e(lt, {}) : void 0,
984
- subtitle: m,
974
+ subtitle: h,
985
975
  title: t
986
976
  }
987
977
  ),
988
- g && /* @__PURE__ */ e(ke, { sx: { ml: h ? 24 : 68 } })
978
+ u && /* @__PURE__ */ e(Re, { sx: { ml: d ? 24 : 68 } })
989
979
  ] }, r);
990
980
  }
991
- ), To = R(
981
+ ), So = k(
992
982
  ({ availableHeight: o = 0, onCategoryClick: r }) => {
993
- const { collapsedCategories: t, visibleCategories: n, setVisibleListLength: s } = pe(), { isLargeDesktop: h, isDesktop: g } = ee(), { trends: d } = N(), { onEvent: c } = V(), [m, C] = u.useState(!1), l = g || h;
994
- u.useEffect(() => {
995
- const p = Math.floor(o / 64) - 1, _ = n.length + t.length;
996
- p !== n.length && (s(l ? Math.max(p, 5) : 5), C(p >= _));
983
+ const { collapsedCategories: t, visibleCategories: n, setVisibleListLength: s } = pe(), { isLargeDesktop: d, isDesktop: u } = ee(), { trends: g } = W(), { onEvent: c } = P(), [h, C] = l.useState(!1), p = u || d;
984
+ l.useEffect(() => {
985
+ const i = Math.floor(o / 64) - 1, T = n.length + t.length;
986
+ i !== n.length && (s(p ? Math.max(i, 5) : 5), C(i >= T));
997
987
  }, [o]);
998
- const T = () => {
999
- C(!m), c(v.TRENDS_CLICK_VIEW_MORE, {
988
+ const _ = () => {
989
+ C(!h), c(v.TRENDS_CLICK_VIEW_MORE, {
1000
990
  ...G
1001
991
  });
1002
- }, a = n.length + (m ? t.length : 0);
1003
- return /* @__PURE__ */ e(b, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ f($t, { children: [
1004
- /* @__PURE__ */ e(b, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(Fe, { children: d.categories }) }),
1005
- n.map((p, _) => /* @__PURE__ */ e(
1006
- Pe,
992
+ }, m = n.length + (h ? t.length : 0);
993
+ return /* @__PURE__ */ e(b, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ f(zt, { children: [
994
+ /* @__PURE__ */ e(b, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(Pe, { children: g.categories }) }),
995
+ n.map((i, T) => /* @__PURE__ */ e(
996
+ Ve,
1007
997
  {
1008
- ...p,
1009
- isLastItem: _ === a - 1,
1010
- onClick: p.transactions.length > 0 ? () => r(p) : void 0,
998
+ ...i,
999
+ isLastItem: T === m - 1,
1000
+ onClick: i.transactions.length > 0 ? () => r(i) : void 0,
1011
1001
  showDivider: !0
1012
1002
  },
1013
- p.guid
1003
+ i.guid
1014
1004
  )),
1015
1005
  /* @__PURE__ */ e(
1016
1006
  Ft,
1017
1007
  {
1018
- in: m,
1008
+ in: h,
1019
1009
  sx: { "&.MuiCollapse-root .MuiListItemButton-root": { paddingLeft: 24 } },
1020
- children: t.map((p, _) => {
1021
- const y = n.length + _;
1010
+ children: t.map((i, T) => {
1011
+ const y = n.length + T;
1022
1012
  return /* @__PURE__ */ e(
1023
- Pe,
1013
+ Ve,
1024
1014
  {
1025
- ...p,
1026
- isLastItem: y === a - 1,
1027
- onClick: p.transactions.length > 0 ? () => r(p) : void 0,
1015
+ ...i,
1016
+ isLastItem: y === m - 1,
1017
+ onClick: i.transactions.length > 0 ? () => r(i) : void 0,
1028
1018
  showDivider: !0
1029
1019
  },
1030
- p.guid
1020
+ i.guid
1031
1021
  );
1032
1022
  })
1033
1023
  }
1034
1024
  ),
1035
- t.length > 0 && /* @__PURE__ */ e(_o, { isExpanded: m, onClick: T })
1025
+ t.length > 0 && /* @__PURE__ */ e(To, { isExpanded: h, onClick: _ })
1036
1026
  ] }) });
1037
1027
  }
1038
- ), So = ({ beats: o, onInsightCardClick: r }) => {
1039
- const { onEvent: t } = V(), { isMobile: n, isDesktop: s, isLargeDesktop: h } = ee(), { beatStore: g, endpoint: d, sessionToken: c } = Ne(), m = s || h, C = m || n ? 1 : 2, l = () => null, T = (x) => {
1028
+ ), bo = ({ beats: o, onInsightCardClick: r }) => {
1029
+ const { onEvent: t } = P(), { isMobile: n, isDesktop: s, isLargeDesktop: d } = ee(), { beatStore: u, endpoint: g, sessionToken: c } = He(), h = s || d, C = h || n ? 1 : 2, p = () => null, _ = (x) => {
1040
1030
  r?.(x), t(v.TRENDS_CLICK_INSIGHT, G);
1041
- }, a = m ? 200 : 170, p = m ? 170 : 124, _ = m ? 56 : 0, y = o.length > 0 ? a + _ : p, E = m && o.length > 0 ? a : void 0;
1042
- return /* @__PURE__ */ e(_t, { sx: { height: y }, children: /* @__PURE__ */ e(
1043
- kt,
1031
+ }, m = h ? 200 : 170, i = h ? 170 : 124, T = h ? 56 : 0, y = o.length > 0 ? m + T : i, L = h && o.length > 0 ? m : void 0;
1032
+ return /* @__PURE__ */ e(Tt, { sx: { height: y }, children: /* @__PURE__ */ e(
1033
+ Ht,
1044
1034
  {
1045
- areBeatsLoading: g.isLoading,
1035
+ areBeatsLoading: u.isLoading,
1046
1036
  beats: o,
1047
- endpoint: d,
1048
- heightOverrides: E,
1049
- logOutUser: l,
1050
- onCardClick: T,
1037
+ endpoint: g,
1038
+ heightOverrides: L,
1039
+ logOutUser: p,
1040
+ onCardClick: _,
1051
1041
  showBorder: !0,
1052
1042
  showCTAColocatedWithText: !1,
1053
1043
  showCarouselControls: !0,
1054
- showHeader: m,
1044
+ showHeader: h,
1055
1045
  showIcon: !0,
1056
1046
  showWithMargin: !1,
1057
1047
  token: c,
@@ -1060,12 +1050,12 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
1060
1050
  visibleCardsCount: C
1061
1051
  }
1062
1052
  ) });
1063
- }, bo = R(So), xo = R(({ chartLabel: o, chartColor: r }) => {
1064
- const { onEvent: t } = V(), {
1053
+ }, xo = k(bo), vo = k(({ chartLabel: o, chartColor: r }) => {
1054
+ const { onEvent: t } = P(), {
1065
1055
  categoryDetailsChartData: { monthlyAmounts: n, tooltipLabels: s }
1066
1056
  } = pe();
1067
1057
  return /* @__PURE__ */ e(b, { sx: { pt: 12, width: "100%" }, children: /* @__PURE__ */ e(
1068
- We,
1058
+ Ne,
1069
1059
  {
1070
1060
  baseline: "min",
1071
1061
  colors: [r],
@@ -1093,100 +1083,100 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
1093
1083
  valueFormatterString: "0,0"
1094
1084
  }
1095
1085
  ) });
1096
- }), vo = R(({ onClose: o }) => {
1097
- const r = qe(), { onEvent: t } = V(), { common: n, trends: s } = N(), { selectedCategoryData: h, selectedDateRangeMonthRange: g } = pe(), { sortedTransactions: d } = xe(), [c, m] = u.useState(null);
1098
- if (!h)
1086
+ }), wo = k(({ onClose: o }) => {
1087
+ const r = qe(), { onEvent: t } = P(), { common: n, trends: s } = W(), { selectedCategoryData: d, selectedDateRangeMonthRange: u } = pe(), { sortedTransactions: g } = xe(), [c, h] = l.useState(null);
1088
+ if (!d)
1099
1089
  return null;
1100
- const { guid: C, name: l, is_income: T, totalAmount: a } = h, p = T ? s.category_income : s.category_spending, _ = Xt(C, r), y = T ? s.income_label : s.spending_label, E = ` ${h.transactions.length === 1 ? s.transaction : s.transactions} (${h.transactions.length})`, x = u.useMemo(
1101
- () => d.find((L) => L.guid === c),
1102
- [c, d]
1103
- ), I = (L) => L.category_guid === C || L.top_level_category_guid === C, W = () => {
1090
+ const { guid: C, name: p, is_income: _, totalAmount: m } = d, i = _ ? s.category_income : s.category_spending, T = Zt(C, r), y = _ ? s.income_label : s.spending_label, L = ` ${d.transactions.length === 1 ? s.transaction : s.transactions} (${d.transactions.length})`, x = l.useMemo(
1091
+ () => g.find((A) => A.guid === c),
1092
+ [c, g]
1093
+ ), D = (A) => A.category_guid === C || A.top_level_category_guid === C, O = () => {
1104
1094
  o?.(), t(v.TRENDS_CLICK_BACK, G);
1105
1095
  };
1106
1096
  return /* @__PURE__ */ f(
1107
- He,
1097
+ ke,
1108
1098
  {
1109
1099
  ariaLabelClose: s.close_category_details,
1110
1100
  isOpen: !0,
1111
- onClose: W,
1101
+ onClose: O,
1112
1102
  shouldShowHeaderShadow: !0,
1113
- title: p,
1103
+ title: i,
1114
1104
  children: [
1115
1105
  /* @__PURE__ */ f(b, { sx: { alignItems: "center", height: "100%" }, children: [
1116
- /* @__PURE__ */ f(Ut, { sx: { borderRadius: 0, pb: 4, pt: 16, width: "100%" }, children: [
1106
+ /* @__PURE__ */ f(Xt, { sx: { borderRadius: 0, pb: 4, pt: 16, width: "100%" }, children: [
1117
1107
  /* @__PURE__ */ e(
1118
- je,
1108
+ Ke,
1119
1109
  {
1120
1110
  leftIcon: /* @__PURE__ */ e(Se, { categoryGuid: C }),
1121
- rightContent: se(Math.abs(a), "0,0.00"),
1122
- subtitle: g,
1123
- title: l
1111
+ rightContent: oe(Math.abs(m), "0,0.00"),
1112
+ subtitle: u,
1113
+ title: p
1124
1114
  }
1125
1115
  ),
1126
- /* @__PURE__ */ e(xo, { chartColor: _, chartLabel: y }),
1116
+ /* @__PURE__ */ e(vo, { chartColor: T, chartLabel: y }),
1127
1117
  /* @__PURE__ */ f(b, { alignItems: "center", direction: "row", justifyContent: "space-between", sx: { mx: 24 }, children: [
1128
- /* @__PURE__ */ e($, { bold: !0, variant: "body1", children: E }),
1129
- /* @__PURE__ */ e(Zt, { filter: I })
1118
+ /* @__PURE__ */ e(K, { bold: !0, variant: "body1", children: L }),
1119
+ /* @__PURE__ */ e(qt, { filter: D })
1130
1120
  ] })
1131
1121
  ] }),
1132
1122
  /* @__PURE__ */ e(
1133
- Qe,
1123
+ Ze,
1134
1124
  {
1135
1125
  bgcolor: "transparent",
1136
- filter: I,
1126
+ filter: D,
1137
1127
  height: "calc(100vh - 475px)",
1138
- onClick: m
1128
+ onClick: h
1139
1129
  }
1140
1130
  )
1141
1131
  ] }),
1142
1132
  /* @__PURE__ */ e(
1143
- He,
1133
+ ke,
1144
1134
  {
1145
1135
  ariaLabelClose: n.close_aria,
1146
1136
  isOpen: !!x,
1147
- onClose: () => m(""),
1137
+ onClose: () => h(""),
1148
1138
  title: s.transaction,
1149
- children: x && /* @__PURE__ */ e(Ze, { transaction: x })
1139
+ children: x && /* @__PURE__ */ e(Xe, { transaction: x })
1150
1140
  }
1151
1141
  )
1152
1142
  ]
1153
1143
  }
1154
1144
  );
1155
- }), wo = (o, r) => {
1156
- const t = Ue(o, r), n = Ye(o, r);
1145
+ }), Do = (o, r) => {
1146
+ const t = Ye(o, r), n = je(o, r);
1157
1147
  return [t, n].filter((s) => s.length > 0);
1158
- }, Do = (o, r) => {
1159
- const [t, n] = o, s = t, h = n ?? t, g = [];
1148
+ }, Io = (o, r) => {
1149
+ const [t, n] = o, s = t, d = n ?? t, u = [];
1160
1150
  if (s) {
1161
- const d = s.reduce((c, m) => c + m.y, 0);
1162
- g.push({ label: r.income_label, amount: d });
1151
+ const g = s.reduce((c, h) => c + h.y, 0);
1152
+ u.push({ label: r.income_label, amount: g });
1163
1153
  }
1164
- if (h) {
1165
- const d = h.reduce((c, m) => c + m.y, 0);
1166
- g.push({ label: r.spending_label, amount: d });
1154
+ if (d) {
1155
+ const g = d.reduce((c, h) => c + h.y, 0);
1156
+ u.push({ label: r.spending_label, amount: g });
1167
1157
  }
1168
- return g;
1169
- }, Io = ({
1158
+ return u;
1159
+ }, Eo = ({
1170
1160
  availableHeight: o = 0,
1171
1161
  minHeight: r = 500,
1172
1162
  selectedDateRange: t,
1173
1163
  totals: n
1174
1164
  }) => {
1175
- const s = be(), { onEvent: h } = V(), { trends: g } = N(), { isSmallMobile: d, isMobile: c, isSmallTablet: m, isTablet: C } = ee(), l = [s.palette.chart?.chart1, s.palette.chart?.chart2], T = wo(n, t), a = Do(T, g), [p, _] = u.useState(0), y = 458, E = 195, x = 56, I = c || d ? E : m || C ? y : p;
1176
- return u.useEffect(() => {
1177
- const L = Math.max(o - x, r);
1178
- _(L);
1165
+ const s = be(), { onEvent: d } = P(), { trends: u } = W(), { isSmallMobile: g, isMobile: c, isSmallTablet: h, isTablet: C } = ee(), p = [s.palette.chart?.chart1, s.palette.chart?.chart2], _ = Do(n, t), m = Io(_, u), [i, T] = l.useState(0), y = 458, L = 195, x = 56, D = c || g ? L : h || C ? y : i;
1166
+ return l.useEffect(() => {
1167
+ const A = Math.max(o - x, r);
1168
+ T(A);
1179
1169
  }, [o]), /* @__PURE__ */ e(
1180
- We,
1170
+ Ne,
1181
1171
  {
1182
1172
  baseline: "min",
1183
- colors: l,
1173
+ colors: p,
1184
1174
  curveType: "bump",
1185
- datasets: T,
1186
- height: I,
1187
- labels: a,
1175
+ datasets: _,
1176
+ height: D,
1177
+ labels: m,
1188
1178
  onItemClick: () => {
1189
- h(v.TRENDS_CLICK_CHART, G);
1179
+ d(v.TRENDS_CLICK_CHART, G);
1190
1180
  },
1191
1181
  showArea: !0,
1192
1182
  showAxisHighlight: !0,
@@ -1199,7 +1189,7 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
1199
1189
  valueFormatterString: "0.0a"
1200
1190
  }
1201
1191
  );
1202
- }, Eo = R(Io), Lo = [
1192
+ }, Lo = k(Eo), Mo = [
1203
1193
  "BillAmountNotStandard",
1204
1194
  "CategorySpendingV2",
1205
1195
  "CostOfLivingToIncome",
@@ -1233,112 +1223,109 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
1233
1223
  "WeeklyNewMerchantsV2",
1234
1224
  "WeeklyNoSpendDays",
1235
1225
  "WeeklySmallPurchasesSummary"
1236
- ], Mo = ({ onBackClick: o, onInsightCardClick: r, sx: t }) => {
1237
- const { onEvent: n } = V(), { config: s } = mt(), { isLargeDesktop: h, isDesktop: g, isMobile: d } = ee(), { visibleAccounts: c } = ve(), { loadDateRangeCategoryTotals: m, loadMonthlyCategoryTotals: C, monthlyCategoryTotals: l } = U(), { setFilter: T } = xe(), { selectedDateRange: a, setSelectedCategoryData: p, setSelectedDateRange: _ } = pe(), {
1238
- isCopyLoaded: y,
1239
- isInitialized: E,
1240
- selectedAccounts: x,
1241
- selectedAccountGuids: I,
1242
- setSelectedAccounts: W
1243
- } = me(), { trends: L, connect: O } = N(), { beatStore: A } = Ne(), P = Qt() && s.show_insights_widget_in_master, z = g || h, [X, Ce] = u.useState(!1), [te, re] = u.useState(!1), [Z, ce] = u.useState("Chart"), [oe, K] = u.useState(""), [ae, ne] = u.useState(!1), [ie, Q] = u.useState(window.innerHeight), w = z ? 56 : 0, B = ie - 208, j = ie - (P ? 550 + w : 266), [le, ye] = u.useState(!1), De = s.show_connections_widget_in_master ? "buttons" : "no-buttons", i = u.useMemo(
1244
- () => c && c.length === 0 || l.length === 0,
1245
- [c, l]
1226
+ ], Ao = ({ onBackClick: o, onInsightCardClick: r, sx: t }) => {
1227
+ const { onEvent: n } = P(), { onLoad: s } = mt(), { config: d } = pt(), { isLargeDesktop: u, isDesktop: g, isMobile: c } = ee(), { visibleAccounts: h } = ve(), { loadDateRangeCategoryTotals: C, loadMonthlyCategoryTotals: p, monthlyCategoryTotals: _ } = U(), { setFilter: m } = xe(), { selectedDateRange: i, setSelectedCategoryData: T, setSelectedDateRange: y } = pe(), {
1228
+ isCopyLoaded: L,
1229
+ isInitialized: x,
1230
+ selectedAccounts: D,
1231
+ selectedAccountGuids: O,
1232
+ setSelectedAccounts: A
1233
+ } = me(), { trends: M, connect: R } = W(), { beatStore: E } = He(), ne = Qt() && d.show_insights_widget_in_master, B = g || u, [Ce, ae] = l.useState(!1), [Z, ie] = l.useState(!1), [q, ce] = l.useState("Chart"), [$, te] = l.useState(""), [se, re] = l.useState(!1), [j, w] = l.useState(window.innerHeight), V = B ? 56 : 0, F = j - 208, le = j - (ne ? 550 + V : 266), [we, ye] = l.useState(!1), a = d.show_connections_widget_in_master ? "buttons" : "no-buttons", S = l.useMemo(
1234
+ () => h && h.length === 0 || _.length === 0,
1235
+ [h, _]
1246
1236
  );
1247
- we({
1248
- widgetName: "TrendsWidget",
1249
- isLoaded: X
1250
- }), u.useEffect(() => {
1251
- E && A.loadBeats().finally(() => re(!0));
1252
- }, [E]);
1253
- const S = u.useMemo(() => te ? A.getFilteredBeats({ templates: Lo }) : [], [te]);
1254
- u.useEffect(() => {
1255
- const k = () => Q(window.innerHeight);
1256
- return window.addEventListener("resize", k), () => window.removeEventListener("resize", k);
1257
- }, []), u.useEffect(() => {
1258
- W(c);
1259
- }, [c]), u.useEffect(() => {
1260
- E && m(x, a.start, a.end).then(() => {
1261
- C(
1262
- x,
1263
- a.start,
1264
- a.end
1237
+ l.useEffect(() => {
1238
+ x && E.loadBeats().finally(() => ie(!0));
1239
+ }, [x]);
1240
+ const I = l.useMemo(() => Z ? E.getFilteredBeats({ templates: Mo }) : [], [Z]);
1241
+ l.useEffect(() => {
1242
+ const H = () => w(window.innerHeight);
1243
+ return window.addEventListener("resize", H), () => window.removeEventListener("resize", H);
1244
+ }, []), l.useEffect(() => {
1245
+ A(h);
1246
+ }, [h]), l.useEffect(() => {
1247
+ x && C(D, i.start, i.end).then(() => {
1248
+ p(
1249
+ D,
1250
+ i.start,
1251
+ i.end
1265
1252
  );
1266
1253
  }).finally(() => {
1267
- Ce(!0), n(v.TRENDS_LOAD_WIDGET, {
1254
+ ae(!0), n(v.TRENDS_LOAD_WIDGET, {
1268
1255
  ...G,
1269
- time_period: `${Re(a.end, a.start)}M`
1270
- });
1256
+ time_period: `${Ae(i.end, i.start)}M`
1257
+ }), s?.("TrendsWidget");
1271
1258
  });
1272
- }, [E, x, a]), u.useEffect(() => {
1273
- if (l.length !== 0) {
1274
- const k = {
1275
- accounts: I,
1276
- dateRange: { start: a.start, end: a.end }
1259
+ }, [x, D, i]), l.useEffect(() => {
1260
+ if (_.length !== 0) {
1261
+ const H = {
1262
+ accounts: O,
1263
+ dateRange: { start: i.start, end: i.end }
1277
1264
  };
1278
- T({
1279
- ...k,
1280
- custom: (q) => !!l.find(
1281
- (ue) => ue.top_level_category_guid === q.top_level_category_guid || ue.category_guid === q.category_guid
1265
+ m({
1266
+ ...H,
1267
+ custom: (Q) => !!_.find(
1268
+ (ue) => ue.top_level_category_guid === Q.top_level_category_guid || ue.category_guid === Q.category_guid
1282
1269
  )
1283
1270
  });
1284
1271
  }
1285
- }, [l]);
1286
- const D = (k) => {
1287
- p(k), ne(!0);
1288
- }, Y = () => {
1289
- p(null), ne(!1);
1272
+ }, [_]);
1273
+ const Y = (H) => {
1274
+ T(H), re(!0);
1275
+ }, De = () => {
1276
+ T(null), re(!1);
1290
1277
  }, Ie = () => {
1291
1278
  ye(!0), n(v.TRENDS_CLICK_CONNECT_ACCOUNTS);
1292
- }, Ee = (k, q) => {
1293
- ce(q ?? Z), n(v.TRENDS_CLICK_TOGGLE_VIEW, {
1279
+ }, de = (H, Q) => {
1280
+ ce(Q ?? q), n(v.TRENDS_CLICK_TOGGLE_VIEW, {
1294
1281
  ...G,
1295
- toggleView: q
1282
+ toggleView: Q
1296
1283
  });
1297
- }, de = (k) => {
1298
- const q = $e(k?.[0], 1), ue = k?.[1], st = Re(ue, q);
1299
- _({ start: q, end: ue }), n(v.TRENDS_CLICK_TIME_WINDOW, {
1284
+ }, Ee = (H) => {
1285
+ const Q = $e(H?.[0], 1), ue = H?.[1], st = Ae(ue, Q);
1286
+ y({ start: Q, end: ue }), n(v.TRENDS_CLICK_TIME_WINDOW, {
1300
1287
  ...G,
1301
1288
  time_period: st + "M"
1302
1289
  });
1303
- }, Le = (k) => {
1290
+ }, Le = (H) => {
1304
1291
  n(v.TRENDS_CLICK_FILTER, {
1305
1292
  ...G,
1306
- filterValue: k
1293
+ filterValue: H
1307
1294
  });
1308
- }, Me = (k) => {
1309
- K(k);
1295
+ }, ot = (H) => {
1296
+ te(H);
1310
1297
  }, nt = () => {
1311
- K(""), n(v.TRENDS_CLICK_ALL_CATEGORIES, G);
1298
+ te(""), n(v.TRENDS_CLICK_ALL_CATEGORIES, G);
1312
1299
  };
1313
- return !y || !X ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ f(
1314
- Xe,
1300
+ return !L || !Ce ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ f(
1301
+ Ue,
1315
1302
  {
1316
- accountOptions: c,
1317
- calendarActions: { onRangeChanged: de },
1318
- dateRange: a,
1319
- dateRangeVariant: d ? "timeframetabs" : "timeframebuttons",
1303
+ accountOptions: h,
1304
+ calendarActions: { onRangeChanged: Ee },
1305
+ dateRange: i,
1306
+ dateRangeVariant: c ? "timeframetabs" : "timeframebuttons",
1320
1307
  onAccountsFilterClick: Le,
1321
1308
  onBackClick: o,
1322
1309
  sx: t,
1323
- title: L.title,
1310
+ title: M.title,
1324
1311
  children: [
1325
- i && /* @__PURE__ */ e(
1326
- qt,
1312
+ S && /* @__PURE__ */ e(
1313
+ Jt,
1327
1314
  {
1328
- header: L.zero_state_content_header,
1315
+ header: M.zero_state_content_header,
1329
1316
  icon: "",
1330
1317
  onClick: Ie,
1331
- primaryButton: L.empty_state_primary,
1332
- subText: L.empty_state_sub_text,
1333
- sx: { height: B },
1334
- variant: De
1318
+ primaryButton: M.empty_state_primary,
1319
+ subText: M.empty_state_sub_text,
1320
+ sx: { height: F },
1321
+ variant: a
1335
1322
  }
1336
1323
  ),
1337
- !i && /* @__PURE__ */ f(
1324
+ !S && /* @__PURE__ */ f(
1338
1325
  b,
1339
1326
  {
1340
1327
  sx: {
1341
- px: d ? 0 : 48
1328
+ px: c ? 0 : 48
1342
1329
  },
1343
1330
  children: [
1344
1331
  /* @__PURE__ */ f(
@@ -1346,78 +1333,78 @@ const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
1346
1333
  {
1347
1334
  flexDirection: "row",
1348
1335
  justifyContent: "space-between",
1349
- sx: { pb: d ? 12 : 24, pt: d ? 24 : 48 },
1336
+ sx: { pb: c ? 12 : 24, pt: c ? 24 : 48 },
1350
1337
  children: [
1351
1338
  /* @__PURE__ */ e(
1352
- tt,
1339
+ et,
1353
1340
  {
1354
- selectedCategoryGuid: oe,
1355
- selectedDateRange: a
1341
+ selectedCategoryGuid: $,
1342
+ selectedDateRange: i
1356
1343
  }
1357
1344
  ),
1358
- /* @__PURE__ */ e(et, { onTabChange: Ee, selectedTab: Z })
1345
+ /* @__PURE__ */ e(Je, { onTabChange: de, selectedTab: q })
1359
1346
  ]
1360
1347
  }
1361
1348
  ),
1362
- /* @__PURE__ */ e(b, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(H, { flexGrow: 1, children: oe && /* @__PURE__ */ f(_e, { onClick: nt, sx: { p: 0, pr: 5 }, children: [
1349
+ /* @__PURE__ */ e(b, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(N, { flexGrow: 1, children: $ && /* @__PURE__ */ f(_e, { onClick: nt, sx: { p: 0, pr: 5 }, children: [
1363
1350
  /* @__PURE__ */ e(fe, { name: "arrow_back" }),
1364
- L.all_categories
1351
+ M.all_categories
1365
1352
  ] }) }) }),
1366
- /* @__PURE__ */ f(b, { flexDirection: z ? "row" : "column", gap: z ? 48 : 16, children: [
1367
- Z === "Chart" && /* @__PURE__ */ f(rt, { children: [
1368
- /* @__PURE__ */ e(H, { sx: { width: z ? "68%" : "100%" }, children: /* @__PURE__ */ e(
1369
- Eo,
1353
+ /* @__PURE__ */ f(b, { flexDirection: B ? "row" : "column", gap: B ? 48 : 16, children: [
1354
+ q === "Chart" && /* @__PURE__ */ f(rt, { children: [
1355
+ /* @__PURE__ */ e(N, { sx: { width: B ? "68%" : "100%" }, children: /* @__PURE__ */ e(
1356
+ Lo,
1370
1357
  {
1371
- availableHeight: B,
1358
+ availableHeight: F,
1372
1359
  minHeight: 450,
1373
- selectedDateRange: a,
1374
- totals: l
1360
+ selectedDateRange: i,
1361
+ totals: _
1375
1362
  }
1376
1363
  ) }),
1377
- /* @__PURE__ */ f(b, { gap: 16, sx: { width: z ? "32%" : "100%" }, children: [
1378
- P && te && S.length > 0 && /* @__PURE__ */ e(
1379
- bo,
1364
+ /* @__PURE__ */ f(b, { gap: 16, sx: { width: B ? "32%" : "100%" }, children: [
1365
+ ne && Z && I.length > 0 && /* @__PURE__ */ e(
1366
+ xo,
1380
1367
  {
1381
- beats: S,
1368
+ beats: I,
1382
1369
  onInsightCardClick: r
1383
1370
  }
1384
1371
  ),
1385
1372
  /* @__PURE__ */ e(
1386
- To,
1373
+ So,
1387
1374
  {
1388
- availableHeight: j,
1389
- onCategoryClick: D
1375
+ availableHeight: le,
1376
+ onCategoryClick: Y
1390
1377
  }
1391
1378
  )
1392
1379
  ] })
1393
1380
  ] }),
1394
- Z === "Table" && /* @__PURE__ */ e(H, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
1395
- ot,
1381
+ q === "Table" && /* @__PURE__ */ e(N, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
1382
+ tt,
1396
1383
  {
1397
1384
  height: "unset",
1398
- monthlyCategoryTotals: l,
1399
- onClickRow: Me,
1400
- selectedCategory: oe,
1401
- selectedDateRange: a
1385
+ monthlyCategoryTotals: _,
1386
+ onClickRow: ot,
1387
+ selectedCategory: $,
1388
+ selectedDateRange: i
1402
1389
  }
1403
1390
  ) })
1404
1391
  ] }),
1405
- ae && /* @__PURE__ */ e(vo, { onClose: Y })
1392
+ se && /* @__PURE__ */ e(wo, { onClose: De })
1406
1393
  ]
1407
1394
  }
1408
1395
  ),
1409
1396
  /* @__PURE__ */ e(
1410
- Jt,
1397
+ eo,
1411
1398
  {
1412
1399
  onClose: () => ye(!1),
1413
- showConnectWidget: le,
1414
- title: O.mini_title
1400
+ showConnectWidget: we,
1401
+ title: R.mini_title
1415
1402
  }
1416
1403
  )
1417
1404
  ]
1418
1405
  }
1419
1406
  );
1420
- }, Nn = R(Mo);
1407
+ }, Nn = k(Ao);
1421
1408
  export {
1422
1409
  Rn as TrendsFullWidget,
1423
1410
  Hn as TrendsMicroWidget,