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

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