@mx-cartographer/experiences 7.0.23-alpha.al1 → 7.0.23-alpha.al10

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 (58) hide show
  1. package/dist/{Account-BW3-oYEs.mjs → Account-CVVDlNDC.mjs} +1 -1
  2. package/dist/{AccountDetailsContent-UxSEMBo_.mjs → AccountDetailsContent-bQKVSCZF.mjs} +8 -8
  3. package/dist/{AccountDetailsHeader-Eb3WvBGm.mjs → AccountDetailsHeader-BGQAu0Xm.mjs} +8 -8
  4. package/dist/{AccountFields-CIz-r3gP.mjs → AccountFields-CC7kzfPK.mjs} +2 -2
  5. package/dist/{AccountListItem-B-ZjJ4Gp.mjs → AccountListItem-wgvQjLxW.mjs} +3 -3
  6. package/dist/{AccountStore-BaMynkQT.mjs → AccountStore-DpglOysH.mjs} +19 -19
  7. package/dist/{Accounts-CA-nqAjT.mjs → Accounts-ByViymVi.mjs} +1 -1
  8. package/dist/{BudgetUtil-CeSLAcsl.mjs → BudgetUtil-gzgNEDE7.mjs} +1 -1
  9. package/dist/{CategorySelectorDrawer-BJ9jlCyt.mjs → CategorySelectorDrawer-LpZcwQPa.mjs} +4 -4
  10. package/dist/{ConnectDrawer-phFH6OHt.mjs → ConnectDrawer-C2minBK_.mjs} +1 -1
  11. package/dist/{ConnectionsDrawer-ihxkAi1P.mjs → ConnectionsDrawer-Cd4dZuWL.mjs} +2 -2
  12. package/dist/{CurrencyInput-bEx2Mbd0.mjs → CurrencyInput-Dz4r9Rfe.mjs} +1 -1
  13. package/dist/{DebtsStore-VkyMADzd.mjs → DebtsStore-B51DTXVj.mjs} +1 -1
  14. package/dist/{GoalStore-eSOkI6uE.mjs → GoalStore-DqQ2FMx5.mjs} +2 -2
  15. package/dist/{Help-KAAMEubC.mjs → Help-DVPbIxMM.mjs} +1 -1
  16. package/dist/{LineChart-BWWmmJxV.mjs → LineChart-DLk-bww5.mjs} +1 -1
  17. package/dist/{ListItemAction-DNZZ5fSa.mjs → ListItemAction-DE6S0N5o.mjs} +1 -1
  18. package/dist/{ManageIncome-DbsiKUoO.mjs → ManageIncome-BokhnWOn.mjs} +4 -4
  19. package/dist/{MicroWidgetContainer-Dxz8uBN9.mjs → MicroWidgetContainer-5YscP1xa.mjs} +1 -1
  20. package/dist/{MiniWidgetContainer-CTyjmE1h.mjs → MiniWidgetContainer-BlsgwNew.mjs} +1 -1
  21. package/dist/{NetWorthStore-B6xF9eGH.mjs → NetWorthStore-C0hQSRzt.mjs} +2 -2
  22. package/dist/{NotificationSettings-BJFyyZYE.mjs → NotificationSettings-CWx6H-2z.mjs} +2 -2
  23. package/dist/{OriginalBalanceAction-DepsKiJz.mjs → OriginalBalanceAction-BKsSQVnI.mjs} +3 -3
  24. package/dist/{RecurringSettings-Dj29piAQ.mjs → RecurringSettings-CICRt51C.mjs} +3 -3
  25. package/dist/{TransactionDetails-C-z3HGTT.mjs → TransactionDetails-BXl0m15s.mjs} +37 -37
  26. package/dist/{TransactionStore-0tLtBEIC.mjs → TransactionStore-BElBVYfk.mjs} +248 -209
  27. package/dist/TrendsStore-DRuzsVVE.mjs +505 -0
  28. package/dist/TrendsWidget-CRi8EO04.mjs +6 -0
  29. package/dist/{User-Dq9Qj764.mjs → User-DtwqVm3K.mjs} +1 -1
  30. package/dist/{WidgetContainer-CdBs9WOZ.mjs → WidgetContainer-DK8aZO5l.mjs} +2 -2
  31. package/dist/accounts/index.es.js +12 -12
  32. package/dist/analytics/index.es.js +8 -8
  33. package/dist/budgets/index.es.js +10 -10
  34. package/dist/cashflow/index.es.js +7 -7
  35. package/dist/categories/index.es.js +1 -1
  36. package/dist/common/index.es.js +577 -518
  37. package/dist/dashboard/index.es.js +9 -9
  38. package/dist/debts/index.es.js +9 -9
  39. package/dist/{exportTransactionsToCSV-BDlt8u0n.mjs → exportTransactionsToCSV-Cf5VRYVr.mjs} +1 -1
  40. package/dist/finstrong/index.es.js +6 -6
  41. package/dist/goals/index.es.js +11 -11
  42. package/dist/help/index.es.js +3 -3
  43. package/dist/{hooks-DkUqN6JE.mjs → hooks-DUeXom8C.mjs} +13 -13
  44. package/dist/investments/index.es.js +3 -3
  45. package/dist/merchants/index.es.js +1 -1
  46. package/dist/microinsights/index.es.js +1969 -14
  47. package/dist/networth/index.es.js +7 -7
  48. package/dist/notifications/index.es.js +2 -2
  49. package/dist/recurringtransactions/index.es.js +8 -8
  50. package/dist/settings/index.es.js +24 -24
  51. package/dist/spending/index.es.js +21 -21
  52. package/dist/transactions/index.es.js +270 -259
  53. package/dist/trends/index.es.js +402 -778
  54. package/package.json +1 -1
  55. package/dist/ExportCsvAction-CbMfQ2Wa.mjs +0 -24
  56. package/dist/ResponsiveButton-DZFp78fJ.mjs +0 -45
  57. package/dist/TrendsStore-WrHxzdbQ.mjs +0 -565
  58. package/dist/ViewMoreMicroCard-DFAY0tA8.mjs +0 -1974
@@ -1,73 +1,61 @@
1
- import { jsx as e, jsxs as f, Fragment as Pe } from "react/jsx-runtime";
2
- import i from "react";
3
- import { observer as M } from "mobx-react-lite";
4
- import { Icon as ae, Text as X, CategoryIcon as Te, P as Y, H3 as De, ChevronRightIcon as Ke } from "@mxenabled/mxui";
5
- import O from "@mui/material/Box";
6
- import _ from "@mui/material/Stack";
7
- import pe from "@mui/material/Button";
8
- import { addSeconds as Ie } from "date-fns/addSeconds";
9
- import { differenceInCalendarMonths as Ce } from "date-fns/differenceInCalendarMonths";
10
- import { a as $e, g as je, S as Ye, L as Ee, u as Ue } from "../TrendsStore-WrHxzdbQ.mjs";
11
- import { T as to } from "../TrendsStore-WrHxzdbQ.mjs";
12
- import { i as Xe, c as Ze, d as Qe, e as qe, f as Je, h as et, b as Le, g as xe, j as _e } from "../SpendingData-D5vsfYKo.mjs";
13
- import tt from "@mui/material/ToggleButton";
14
- import nt from "@mui/material/ToggleButtonGroup";
15
- import { u as R, k as P, e as H, a as K, f as re, c as ie, v as q, l as ve, p as ot, m as st } from "../hooks-DkUqN6JE.mjs";
16
- import { u as $ } from "../useScreenSize-B6JyS_Lj.mjs";
17
- import { f as Z, D as B } from "../Dialog-CWW597AF.mjs";
18
- import { DataGridPro as at } from "@mui/x-data-grid-pro";
19
- import { C as rt } from "../CurrencyText-YUhH2caW.mjs";
20
- import { c as Me } from "../Category-CevNQ03n.mjs";
21
- import { b as it } from "../Localization-2MODESHW.mjs";
22
- import { H as be } from "../HeaderCell-DjuifqHJ.mjs";
23
- import { T as A, b as ct } from "../ViewMoreMicroCard-DFAY0tA8.mjs";
24
- import { A as y, W as Ae } from "../WidgetContainer-CdBs9WOZ.mjs";
25
- import { a as Re, T as ke } from "../TransactionDetails-C-z3HGTT.mjs";
26
- import { D as fe } from "../Drawer-kEE73B87.mjs";
27
- import { L as Q } from "../Loader-DUaFpDGv.mjs";
28
- import { useTheme as He } from "@mui/material/styles";
29
- import { L as ye } from "../LineChart-BWWmmJxV.mjs";
30
- import { M as lt } from "../MiniWidgetContainer-CTyjmE1h.mjs";
31
- import { subMonths as dt } from "date-fns";
32
- import { TrendingUp as ht, TrendingDown as ut, MultilineChart as mt, ExpandLess as gt, ExpandMore as pt } from "@mxenabled/mx-icons";
33
- import { a as Ct, f as U } from "../NumberFormatting-CtWHhyBX.mjs";
34
- import { M as ft } from "../MicroWidgetContainer-Dxz8uBN9.mjs";
35
- import Tt from "@mui/material/Collapse";
36
- import yt from "@mui/material/List";
37
- import _t from "@mui/material/ListItem";
38
- import bt from "@mui/material/ListItemButton";
39
- import St from "@mui/material/ListItemIcon";
40
- import wt from "@mui/material/ListItemText";
41
- import Ne from "@mui/material/styles/useTheme";
42
- import Dt from "@mui/material/Divider";
43
- import { useTheme as It, Stack as Et } from "@mui/material";
44
- import Lt from "@mui/material/Paper";
45
- import { b as xt } from "../CategoryUtil-BR3H5i6n.mjs";
46
- import { E as vt } from "../ExportCsvAction-CbMfQ2Wa.mjs";
47
- import { E as Mt } from "../EmptyState-C0lr9E5T.mjs";
48
- const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
49
- nt,
1
+ import { jsx as e, jsxs as f } from "react/jsx-runtime";
2
+ import a from "react";
3
+ import { observer as O } from "mobx-react-lite";
4
+ import { Icon as ne, Text as oe, CategoryIcon as Se, P as V, H3 as be } from "@mxenabled/mxui";
5
+ import z from "@mui/material/Box";
6
+ import S from "@mui/material/Stack";
7
+ import ce from "@mui/material/Button";
8
+ import { addSeconds as ge } from "date-fns/addSeconds";
9
+ import { differenceInCalendarMonths as se } from "date-fns/differenceInCalendarMonths";
10
+ import { a as De, g as we, S as Ee, u as ve } from "../TrendsStore-DRuzsVVE.mjs";
11
+ import { T as sn } from "../TrendsStore-DRuzsVVE.mjs";
12
+ import { i as Ie, c as xe, d as Me, e as Re, f as Le, h as Ae, b as Ne, g as We, j as le } from "../SpendingData-D5vsfYKo.mjs";
13
+ import He from "@mui/material/ToggleButton";
14
+ import ke from "@mui/material/ToggleButtonGroup";
15
+ import { u as R, j as G, g as j, a as Y, n as ae, c as q, s as he, k as Oe, p as ze, l as Ge } from "../hooks-DUeXom8C.mjs";
16
+ import { u as re } from "../useScreenSize-B6JyS_Lj.mjs";
17
+ import { f as K, D as k } from "../Dialog-CWW597AF.mjs";
18
+ import { DataGridPro as Fe } from "@mui/x-data-grid-pro";
19
+ import { C as Pe } from "../CurrencyText-YUhH2caW.mjs";
20
+ import { c as fe } from "../Category-CevNQ03n.mjs";
21
+ import { b as Ve } from "../Localization-2MODESHW.mjs";
22
+ import { H as de } from "../HeaderCell-DjuifqHJ.mjs";
23
+ import { T as B } from "../TrendsWidget-CRi8EO04.mjs";
24
+ import { A as p, W as pe } from "../WidgetContainer-DK8aZO5l.mjs";
25
+ import { a as Be, T as Ke } from "../TransactionDetails-BXl0m15s.mjs";
26
+ import { D as $e } from "../Drawer-kEE73B87.mjs";
27
+ import { L as $ } from "../Loader-DUaFpDGv.mjs";
28
+ import { useTheme as je } from "@mui/material/styles";
29
+ import { L as Ye } from "../LineChart-DLk-bww5.mjs";
30
+ import { M as Ze } from "../MiniWidgetContainer-BlsgwNew.mjs";
31
+ import { subMonths as Ue } from "date-fns";
32
+ import { TrendingUp as Xe, TrendingDown as qe, MultilineChart as Je } from "@mxenabled/mx-icons";
33
+ import { a as Qe, f as te } from "../NumberFormatting-CtWHhyBX.mjs";
34
+ import { M as et } from "../MicroWidgetContainer-5YscP1xa.mjs";
35
+ import { E as ue } from "../EmptyState-C0lr9E5T.mjs";
36
+ const tt = ({ selectedTab: t, onTabChange: r }) => /* @__PURE__ */ e(
37
+ ke,
50
38
  {
51
39
  exclusive: !0,
52
- onChange: o,
40
+ onChange: r,
53
41
  orientation: "horizontal",
54
- value: n,
55
- children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(tt, { color: "primary", sx: { width: 56 }, value: t, children: t === "Chart" ? /* @__PURE__ */ e(ae, { name: "table_chart_view" }) : /* @__PURE__ */ e(ae, { name: "format_list_bulleted" }) }, t))
42
+ value: t,
43
+ children: ["Chart", "Table"].map((n) => /* @__PURE__ */ e(He, { color: "primary", sx: { width: 56 }, value: n, children: n === "Chart" ? /* @__PURE__ */ e(ne, { name: "table_chart_view" }) : /* @__PURE__ */ e(ne, { name: "format_list_bulleted" }) }, n))
56
44
  }
57
- ), Oe = ({ selectedDateRange: n, selectedCategoryGuid: o }) => {
58
- const { trends: t } = R(), { isMobile: s, isDesktop: r } = $(), { getCategoryName: h } = P(), d = i.useMemo(() => {
59
- const c = Z(
60
- n.start,
61
- s ? B.MONTH_SHORT_YEAR : B.MONTH_YEAR
62
- ), l = Z(
63
- n.end,
64
- s ? B.MONTH_SHORT_YEAR : B.MONTH_YEAR
45
+ ), nt = ({ selectedDateRange: t, selectedCategoryGuid: r }) => {
46
+ const { trends: n } = R(), { isMobile: s, isDesktop: h } = re(), { getCategoryName: m } = G(), l = a.useMemo(() => {
47
+ const u = K(
48
+ t.start,
49
+ s ? k.MONTH_SHORT_YEAR : k.MONTH_YEAR
50
+ ), i = K(
51
+ t.end,
52
+ s ? k.MONTH_SHORT_YEAR : k.MONTH_YEAR
65
53
  );
66
- return `${c} - ${l}`;
67
- }, [n, s]);
68
- return /* @__PURE__ */ f(O, { sx: { mr: 10, minWidth: "60%" }, children: [
54
+ return `${u} - ${i}`;
55
+ }, [t, s]);
56
+ return /* @__PURE__ */ f(z, { sx: { mr: 10, minWidth: "60%" }, children: [
69
57
  /* @__PURE__ */ e(
70
- X,
58
+ oe,
71
59
  {
72
60
  display: "block",
73
61
  fontWeight: 700,
@@ -76,272 +64,272 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
76
64
  overflow: "visible",
77
65
  textOverflow: "unset"
78
66
  },
79
- variant: r ? "H3" : "Body",
80
- children: h(o) || t.sub_title
67
+ variant: h ? "H3" : "Body",
68
+ children: m(r) || n.sub_title
81
69
  }
82
70
  ),
83
- /* @__PURE__ */ e(X, { variant: r ? "Body" : "Small", children: d })
71
+ /* @__PURE__ */ e(oe, { variant: h ? "Body" : "Small", children: l })
84
72
  ] });
85
- }, At = (n) => {
86
- const o = n.row[n.field];
87
- return /* @__PURE__ */ e(_, { alignItems: "flex-end", tabIndex: n.tabIndex, children: /* @__PURE__ */ e(rt, { amount: o, variant: "Small" }) });
88
- }, Rt = ({ categoryGuid: n, topLevelCategoryGuid: o }) => {
89
- const { categories: t } = R(), s = t.default_categories[n]?.replace(/&/g, "&") ?? Me[n];
90
- return /* @__PURE__ */ f(_, { alignItems: "center", direction: "row", justifyContent: "center", children: [
73
+ }, ot = (t) => {
74
+ const r = t.row[t.field];
75
+ return /* @__PURE__ */ e(S, { alignItems: "flex-end", tabIndex: t.tabIndex, children: /* @__PURE__ */ e(Pe, { amount: r, variant: "Small" }) });
76
+ }, st = ({ categoryGuid: t, topLevelCategoryGuid: r }) => {
77
+ const { categories: n } = R(), s = n.default_categories[t]?.replace(/&/g, "&") ?? fe[t];
78
+ return /* @__PURE__ */ f(S, { alignItems: "center", direction: "row", justifyContent: "center", children: [
91
79
  /* @__PURE__ */ e(
92
- O,
80
+ z,
93
81
  {
94
- "aria-label": it(t.category_icon_label_aria, s),
82
+ "aria-label": Ve(n.category_icon_label_aria, s),
95
83
  role: "img",
96
- children: /* @__PURE__ */ e(Te, { categoryGuid: o })
84
+ children: /* @__PURE__ */ e(Se, { categoryGuid: r })
97
85
  }
98
86
  ),
99
- /* @__PURE__ */ e(X, { sx: { ml: 12, pb: 6 }, variant: "Small", children: s })
87
+ /* @__PURE__ */ e(oe, { sx: { ml: 12, pb: 6 }, variant: "Small", children: s })
100
88
  ] });
101
- }, kt = (n) => /* @__PURE__ */ e(_, { alignItems: "center", direction: "row", height: "100%", width: "100%", children: /* @__PURE__ */ e(
102
- Rt,
89
+ }, at = (t) => /* @__PURE__ */ e(S, { alignItems: "center", direction: "row", height: "100%", width: "100%", children: /* @__PURE__ */ e(
90
+ st,
103
91
  {
104
- categoryGuid: n.row.category,
105
- topLevelCategoryGuid: n.row.top_level_category_guid
92
+ categoryGuid: t.row.category,
93
+ topLevelCategoryGuid: t.row.top_level_category_guid
106
94
  }
107
- ) }), Ht = (n, o) => {
108
- const t = [], s = new Date(n);
109
- for (; s <= o; ) {
110
- const r = Z(s, B.MONTH);
111
- t.push(r), s.setMonth(s.getMonth() + 1);
95
+ ) }), rt = (t, r) => {
96
+ const n = [], s = new Date(t);
97
+ for (; s <= r; ) {
98
+ const h = K(s, k.MONTH);
99
+ n.push(h), s.setMonth(s.getMonth() + 1);
112
100
  }
113
- return t;
114
- }, Ve = ({
115
- monthlyCategoryTotals: n,
116
- selectedDateRange: o,
117
- selectedCategory: t,
101
+ return n;
102
+ }, it = ({
103
+ monthlyCategoryTotals: t,
104
+ selectedDateRange: r,
105
+ selectedCategory: n,
118
106
  onClickRow: s,
119
- height: r = "100dvh",
120
- sx: h = {}
107
+ height: h = "100dvh",
108
+ sx: m = {}
121
109
  }) => {
122
- const { onEvent: d } = H(), c = Z(/* @__PURE__ */ new Date(), B.MONTH_SHORT), [l, m] = i.useState([
123
- { field: c, sort: "desc" }
124
- ]), C = i.useMemo(() => Ht(o.start, o.end), [o]), u = [
110
+ const { onEvent: l } = j(), u = K(/* @__PURE__ */ new Date(), k.MONTH_SHORT), [i, _] = a.useState([
111
+ { field: u, sort: "desc" }
112
+ ]), y = a.useMemo(() => rt(r.start, r.end), [r]), c = [
125
113
  {
126
114
  field: "category",
127
115
  flex: 1,
128
116
  headerName: "Category",
129
117
  minWidth: 175,
130
- renderHeader: be,
131
- renderCell: kt,
118
+ renderHeader: de,
119
+ renderCell: at,
132
120
  sortable: !0,
133
121
  type: "string"
134
122
  },
135
- ...C.map(
136
- (a) => ({
137
- field: a,
123
+ ...y.map(
124
+ (o) => ({
125
+ field: o,
138
126
  flex: 1,
139
- headerName: a,
127
+ headerName: o,
140
128
  minWidth: 100,
141
- renderHeader: be,
142
- renderCell: At,
129
+ renderHeader: de,
130
+ renderCell: ot,
143
131
  align: "right",
144
132
  headerAlign: "right",
145
133
  sortable: !0,
146
134
  hideSortIcons: !1,
147
135
  type: "number",
148
- sortComparator: $e
136
+ sortComparator: De
149
137
  })
150
138
  )
151
- ], b = i.useMemo(() => {
152
- const a = n.filter(
153
- (p) => !Xe(p) && !Ze(p)
154
- ), T = (t ? a.filter(
155
- (p) => p.category_guid === t || p.top_level_category_guid === t
156
- ) : a).reduce(
157
- (p, E) => {
158
- const { category_guid: w, top_level_category_guid: I, month: k, total: D, year: N } = E, L = t ? w : I;
159
- p[L] || (p[L] = {
160
- id: L,
161
- category: L,
162
- category_guid: w,
163
- top_level_category_guid: I
139
+ ], C = a.useMemo(() => {
140
+ const o = t.filter(
141
+ (d) => !Ie(d) && !xe(d)
142
+ ), D = (n ? o.filter(
143
+ (d) => d.category_guid === n || d.top_level_category_guid === n
144
+ ) : o).reduce(
145
+ (d, x) => {
146
+ const { category_guid: v, top_level_category_guid: M, month: A, total: w, year: L } = x, E = n ? v : M;
147
+ d[E] || (d[E] = {
148
+ id: E,
149
+ category: E,
150
+ category_guid: v,
151
+ top_level_category_guid: M
164
152
  });
165
- const x = Z(new Date(N, k - 1), B.MONTH_SHORT);
166
- return p[L][x] || (p[L][x] = 0), p[L][x] = p[L][x] + Math.abs(D), p;
153
+ const T = K(new Date(L, A - 1), k.MONTH_SHORT);
154
+ return d[E][T] || (d[E][T] = 0), d[E][T] = d[E][T] + Math.abs(w), d;
167
155
  },
168
156
  {}
169
157
  );
170
- return Object.values(T);
171
- }, [n, t]);
172
- return /* @__PURE__ */ e(O, { sx: { height: r, width: "100%", overflowX: "auto", boxShadow: "none", ...h }, children: /* @__PURE__ */ e(
173
- at,
158
+ return Object.values(D);
159
+ }, [t, n]);
160
+ return /* @__PURE__ */ e(z, { sx: { height: h, width: "100%", overflowX: "auto", boxShadow: "none", ...m }, children: /* @__PURE__ */ e(
161
+ Fe,
174
162
  {
175
- columns: u,
163
+ columns: c,
176
164
  disableColumnFilter: !0,
177
165
  disableColumnMenu: !0,
178
166
  hideFooter: !0,
179
- initialState: { sorting: { sortModel: l } },
180
- onRowClick: (a) => {
181
- s?.(a.row.category), d(y.TRENDS_CLICK_LIST_ITEM, {
182
- ...A,
183
- listItem: Me[a.row.category]
167
+ initialState: { sorting: { sortModel: i } },
168
+ onRowClick: (o) => {
169
+ s?.(o.row.category), l(p.TRENDS_CLICK_LIST_ITEM, {
170
+ ...B,
171
+ listItem: fe[o.row.category]
184
172
  });
185
173
  },
186
- onSortModelChange: (a) => {
187
- m(a), d(y.TRENDS_CLICK_TABLE_SORT, A);
174
+ onSortModelChange: (o) => {
175
+ _(o), l(p.TRENDS_CLICK_TABLE_SORT, B);
188
176
  },
189
- rows: b,
177
+ rows: C,
190
178
  slotProps: { baseIconButton: { color: "secondary", sx: { ml: 8 } } },
191
- sortModel: l,
179
+ sortModel: i,
192
180
  sortingOrder: ["asc", "desc"]
193
181
  }
194
182
  ) });
195
- }, Nt = {
183
+ }, ct = {
196
184
  title: "Transaction List"
197
- }, Wt = ({
198
- categoryGuid: n,
199
- dateRange: o,
200
- isOpen: t,
185
+ }, lt = ({
186
+ categoryGuid: t,
187
+ dateRange: r,
188
+ isOpen: n,
201
189
  onClose: s
202
190
  }) => {
203
- const { onEvent: r } = H(), { selectedAccountGuids: h } = K(), { common: d } = R(), { setFilter: c, sortedTransactions: l } = re(), [m, C] = i.useState(""), u = i.useMemo(
204
- () => l.find((a) => a.guid === m),
205
- [m, l]
191
+ const { onEvent: h } = j(), { selectedAccountGuids: m } = Y(), { common: l } = R(), { setFilter: u, sortedTransactions: i } = ae(), [_, y] = a.useState(""), c = a.useMemo(
192
+ () => i.find((o) => o.guid === _),
193
+ [_, i]
206
194
  );
207
- i.useEffect(() => {
208
- c({
209
- accounts: h,
210
- dateRange: o,
211
- custom: (a) => n === "" || n === a.category_guid || n === a.top_level_category_guid,
212
- showSplits: !!n
195
+ a.useEffect(() => {
196
+ u({
197
+ accounts: m,
198
+ dateRange: r,
199
+ custom: (o) => t === "" || t === o.category_guid || t === o.top_level_category_guid,
200
+ showSplits: !!t
213
201
  });
214
- }, [h, n, o]), i.useEffect(() => r(y.TRENDS_VIEW_TRANSACTIONS), []);
215
- const b = () => {
216
- C(""), s();
202
+ }, [m, t, r]), a.useEffect(() => h(p.TRENDS_VIEW_TRANSACTIONS), []);
203
+ const C = () => {
204
+ y(""), s();
217
205
  };
218
206
  return /* @__PURE__ */ f(
219
- fe,
207
+ $e,
220
208
  {
221
- ariaLabelClose: d.close_aria,
222
- isOpen: t,
223
- onClose: b,
224
- title: Nt.title,
209
+ ariaLabelClose: l.close_aria,
210
+ isOpen: n,
211
+ onClose: C,
212
+ title: ct.title,
225
213
  children: [
226
- u && /* @__PURE__ */ e(Re, { transaction: u }),
227
- !u && /* @__PURE__ */ e(ke, { onClick: C })
214
+ c && /* @__PURE__ */ e(Be, { transaction: c }),
215
+ !c && /* @__PURE__ */ e(Ke, { onClick: y })
228
216
  ]
229
217
  }
230
218
  );
231
- }, Ot = M(Wt), Vt = ({ onBackClick: n, sx: o }) => {
232
- const { onEvent: t } = H(), { isDesktop: s, isTablet: r, isMobile: h } = $(), { visibleAccounts: d } = ie(), { loadMonthlyCategoryTotals: c, monthlyCategoryTotals: l, getCategoryName: m } = P(), { sortedTransactions: C } = re(), { selectedDateRange: u, setSelectedDateRange: b } = q(), { isCopyLoaded: a, isInitialized: g, selectedAccounts: T, setSelectedAccounts: p } = K(), { trends: E } = R(), [w, I] = i.useState(!1), [k, D] = i.useState(!1), [N, L] = i.useState("Chart"), [x, z] = i.useState(""), [F, ce] = i.useState(window.innerHeight), ee = F - (h ? 315 : 345);
233
- i.useEffect(() => {
234
- const S = () => ce(window.innerHeight);
235
- return window.addEventListener("resize", S), () => window.removeEventListener("resize", S);
236
- }, []), i.useEffect(() => {
237
- p(d);
238
- }, [d]), i.useEffect(() => {
239
- g && c(
240
- T,
241
- u.start,
242
- u.end
219
+ }, dt = O(lt), ut = ({ onBackClick: t, sx: r }) => {
220
+ const { onEvent: n } = j(), { isDesktop: s, isTablet: h, isMobile: m } = re(), { visibleAccounts: l } = q(), { loadMonthlyCategoryTotals: u, monthlyCategoryTotals: i, getCategoryName: _ } = G(), { sortedTransactions: y } = ae(), { selectedDateRange: c, setSelectedDateRange: C } = he(), { isCopyLoaded: o, isInitialized: b, selectedAccounts: D, setSelectedAccounts: d } = Y(), { trends: x } = R(), [v, M] = a.useState(!1), [A, w] = a.useState(!1), [L, E] = a.useState("Chart"), [T, F] = a.useState(""), [Z, J] = a.useState(window.innerHeight), U = Z - (m ? 315 : 345);
221
+ a.useEffect(() => {
222
+ const g = () => J(window.innerHeight);
223
+ return window.addEventListener("resize", g), () => window.removeEventListener("resize", g);
224
+ }, []), a.useEffect(() => {
225
+ d(l);
226
+ }, [l]), a.useEffect(() => {
227
+ b && u(
228
+ D,
229
+ c.start,
230
+ c.end
243
231
  ).finally(() => {
244
- I(!0);
232
+ M(!0);
245
233
  });
246
- }, [g, T, u]);
247
- const te = i.useMemo(() => {
248
- if (!w) return { stackedDatasets: [], unstackedDatasets: [] };
249
- const S = je(
250
- l,
251
- u.start,
252
- u.end
253
- ), W = x.length ? S.filter(
254
- (G) => G.top_level_category_guid === x || G.category_guid === x
255
- ) : Qe(S);
234
+ }, [b, D, c]);
235
+ const X = a.useMemo(() => {
236
+ if (!v) return { stackedDatasets: [], unstackedDatasets: [] };
237
+ const g = we(
238
+ i,
239
+ c.start,
240
+ c.end
241
+ ), H = T.length ? g.filter(
242
+ (P) => P.top_level_category_guid === T || P.category_guid === T
243
+ ) : Me(g);
256
244
  return {
257
- stackedDatasets: W.filter(qe),
258
- unstackedDatasets: W.filter(Je)
245
+ stackedDatasets: H.filter(Re),
246
+ unstackedDatasets: H.filter(Le)
259
247
  };
260
- }, [l, x, u]), ne = (S, W) => {
261
- L(W ?? N), t(y.TRENDS_CLICK_TOGGLE_VIEW);
262
- }, oe = (S) => {
263
- const W = Ie(S?.[0], 1), G = S?.[1], ge = Ce(G, W);
264
- b({ start: W, end: G }), t(y.TRENDS_CLICK_TIME_WINDOW, {
265
- time_period: ge + "M"
248
+ }, [i, T, c]), Q = (g, H) => {
249
+ E(H ?? L), n(p.TRENDS_CLICK_TOGGLE_VIEW);
250
+ }, I = (g) => {
251
+ const H = ge(g?.[0], 1), P = g?.[1], Ce = se(P, H);
252
+ C({ start: H, end: P }), n(p.TRENDS_CLICK_TIME_WINDOW, {
253
+ time_period: Ce + "M"
266
254
  });
267
- }, le = () => {
268
- t(y.TRENDS_CLICK_FILTER);
269
- }, se = (S) => {
270
- z(S);
271
- }, de = (S) => {
272
- z(S), t(y.TRENDS_CLICK_LEGEND, { category: m(S) });
273
- }, he = (S) => {
274
- t(y.TRENDS_HOVER_LEGEND, { category: m(S) });
275
- }, ue = (S) => {
276
- t(y.TRENDS_HOVER_AREA, { category: S });
277
- }, me = (S) => {
278
- t(y.TRENDS_HOVER_POINT, { category: S });
255
+ }, N = () => {
256
+ n(p.TRENDS_CLICK_FILTER);
257
+ }, W = (g) => {
258
+ F(g);
259
+ }, ee = (g) => {
260
+ F(g), n(p.TRENDS_CLICK_LEGEND, { category: _(g) });
261
+ }, _e = (g) => {
262
+ n(p.TRENDS_HOVER_LEGEND, { category: _(g) });
263
+ }, ye = (g) => {
264
+ n(p.TRENDS_HOVER_AREA, { category: g });
265
+ }, Te = (g) => {
266
+ n(p.TRENDS_HOVER_POINT, { category: g });
279
267
  };
280
- return !a || !g || !w ? /* @__PURE__ */ e(Q, {}) : /* @__PURE__ */ f(
281
- Ae,
268
+ return !o || !b || !v ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ f(
269
+ pe,
282
270
  {
283
- accountOptions: d,
284
- calendarActions: { onRangeChanged: oe },
285
- dateRange: u,
271
+ accountOptions: l,
272
+ calendarActions: { onRangeChanged: I },
273
+ dateRange: c,
286
274
  dateRangeVariant: "timeframebuttons",
287
- onAccountsFilterClick: le,
288
- onBackClick: n,
289
- sx: o,
290
- title: E.title,
275
+ onAccountsFilterClick: N,
276
+ onBackClick: t,
277
+ sx: r,
278
+ title: x.title,
291
279
  children: [
292
280
  /* @__PURE__ */ f(
293
- _,
281
+ S,
294
282
  {
295
283
  sx: {
296
284
  // eslint-disable-next-line no-nested-ternary
297
- px: s ? 48 : r ? 24 : 12
285
+ px: s ? 48 : h ? 24 : 12
298
286
  },
299
287
  children: [
300
288
  /* @__PURE__ */ f(
301
- _,
289
+ S,
302
290
  {
303
291
  flexDirection: "row",
304
292
  justifyContent: "space-between",
305
- sx: { pb: h ? 12 : 24, pt: h ? 24 : 48 },
293
+ sx: { pb: m ? 12 : 24, pt: m ? 24 : 48 },
306
294
  children: [
307
295
  /* @__PURE__ */ e(
308
- Oe,
296
+ nt,
309
297
  {
310
- selectedCategoryGuid: x,
311
- selectedDateRange: u
298
+ selectedCategoryGuid: T,
299
+ selectedDateRange: c
312
300
  }
313
301
  ),
314
- /* @__PURE__ */ e(We, { onTabChange: ne, selectedTab: N })
302
+ /* @__PURE__ */ e(tt, { onTabChange: Q, selectedTab: L })
315
303
  ]
316
304
  }
317
305
  ),
318
- /* @__PURE__ */ f(_, { alignItems: "center", flexDirection: "row", width: "100%", children: [
319
- /* @__PURE__ */ e(O, { flexGrow: 1, children: x && /* @__PURE__ */ f(pe, { onClick: () => z(""), sx: { p: 0, pr: 5 }, children: [
320
- /* @__PURE__ */ e(ae, { name: "arrow_back" }),
321
- E.all_categories
306
+ /* @__PURE__ */ f(S, { alignItems: "center", flexDirection: "row", width: "100%", children: [
307
+ /* @__PURE__ */ e(z, { flexGrow: 1, children: T && /* @__PURE__ */ f(ce, { onClick: () => F(""), sx: { p: 0, pr: 5 }, children: [
308
+ /* @__PURE__ */ e(ne, { name: "arrow_back" }),
309
+ x.all_categories
322
310
  ] }) }),
323
- /* @__PURE__ */ e(pe, { onClick: () => D(!0), sx: { px: 5 }, children: `${E.view_transactions} (${C.length})` })
311
+ /* @__PURE__ */ e(ce, { onClick: () => w(!0), sx: { px: 5 }, children: `${x.view_transactions} (${y.length})` })
324
312
  ] }),
325
- /* @__PURE__ */ f(O, { children: [
326
- N === "Chart" && /* @__PURE__ */ e(
327
- Ye,
313
+ /* @__PURE__ */ f(z, { children: [
314
+ L === "Chart" && /* @__PURE__ */ e(
315
+ Ee,
328
316
  {
329
- availableHeight: ee,
330
- onClickLegend: de,
331
- onHoverArea: ue,
332
- onHoverLegend: he,
333
- onHoverPoint: me,
334
- stackedDatasets: te.stackedDatasets,
335
- unstackedDatasets: te.unstackedDatasets
317
+ availableHeight: U,
318
+ onClickLegend: ee,
319
+ onHoverArea: ye,
320
+ onHoverLegend: _e,
321
+ onHoverPoint: Te,
322
+ stackedDatasets: X.stackedDatasets,
323
+ unstackedDatasets: X.unstackedDatasets
336
324
  }
337
325
  ),
338
- N === "Table" && /* @__PURE__ */ e(
339
- Ve,
326
+ L === "Table" && /* @__PURE__ */ e(
327
+ it,
340
328
  {
341
- monthlyCategoryTotals: l,
342
- onClickRow: se,
343
- selectedCategory: x,
344
- selectedDateRange: u
329
+ monthlyCategoryTotals: i,
330
+ onClickRow: W,
331
+ selectedCategory: T,
332
+ selectedDateRange: c
345
333
  }
346
334
  )
347
335
  ] })
@@ -349,27 +337,27 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
349
337
  }
350
338
  ),
351
339
  /* @__PURE__ */ e(
352
- Ot,
340
+ dt,
353
341
  {
354
- categoryGuid: x,
355
- dateRange: u,
356
- isOpen: k,
357
- onClose: () => D(!1)
342
+ categoryGuid: T,
343
+ dateRange: c,
344
+ isOpen: A,
345
+ onClose: () => w(!1)
358
346
  }
359
347
  )
360
348
  ]
361
349
  }
362
350
  );
363
- }, Xn = M(Vt), Gt = () => {
364
- const n = He(), { monthlyCategoryTotals: o } = P(), { trends: t } = R(), s = et(o);
351
+ }, Jt = O(ut), mt = () => {
352
+ const t = je(), { monthlyCategoryTotals: r } = G(), { trends: n } = R(), s = Ae(r);
365
353
  return /* @__PURE__ */ e(
366
- ye,
354
+ Ye,
367
355
  {
368
356
  baseline: "min",
369
- colors: [n.palette.primary.main],
357
+ colors: [t.palette.primary.main],
370
358
  datasets: [s],
371
359
  height: 300,
372
- labels: [t.spending_label],
360
+ labels: [n.spending_label],
373
361
  showArea: !0,
374
362
  showAverage: !0,
375
363
  showLegend: !0,
@@ -378,37 +366,37 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
378
366
  valueFormatterString: "0,0"
379
367
  }
380
368
  );
381
- }, Bt = M(Gt), zt = ({ onPrimaryCtaClick: n, sx: o }) => {
382
- const { visibleAccounts: t } = ie(), { loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: r } = P(), { isInitialized: h } = ve(), { trends: d } = R(), { isCopyLoaded: c, selectedAccounts: l, setSelectedAccounts: m } = K();
383
- return i.useEffect(() => {
384
- m(t);
385
- }, [t]), i.useEffect(() => {
386
- h && s(l).finally();
387
- }, [h, l]), !c || !h ? /* @__PURE__ */ e(Q, {}) : /* @__PURE__ */ e(
388
- lt,
369
+ }, gt = O(mt), ht = ({ onPrimaryCtaClick: t, sx: r }) => {
370
+ const { visibleAccounts: n } = q(), { loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: h } = G(), { isInitialized: m } = Oe(), { trends: l } = R(), { isCopyLoaded: u, selectedAccounts: i, setSelectedAccounts: _ } = Y();
371
+ return a.useEffect(() => {
372
+ _(n);
373
+ }, [n]), a.useEffect(() => {
374
+ m && s(i).finally();
375
+ }, [m, i]), !u || !m ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ e(
376
+ Ze,
389
377
  {
390
- onPrimaryCtaClick: n,
391
- primaryCtaLabel: d.primary_cta,
392
- subTitle: d.sub_title,
393
- sx: o,
394
- title: d.mini_title,
395
- children: r ? /* @__PURE__ */ e(Bt, {}) : /* @__PURE__ */ e(Q, {})
378
+ onPrimaryCtaClick: t,
379
+ primaryCtaLabel: l.primary_cta,
380
+ subTitle: l.sub_title,
381
+ sx: r,
382
+ title: l.mini_title,
383
+ children: h ? /* @__PURE__ */ e(gt, {}) : /* @__PURE__ */ e($, {})
396
384
  }
397
385
  );
398
- }, Zn = M(zt), Ft = 70, Se = ({
399
- title: n,
400
- totalAmount: o,
401
- transactionType: t,
386
+ }, Qt = O(ht), ft = 70, me = ({
387
+ title: t,
388
+ totalAmount: r,
389
+ transactionType: n,
402
390
  percentage: s,
403
- secondaryLabel: r,
404
- shouldDisplayPercentage: h
391
+ secondaryLabel: h,
392
+ shouldDisplayPercentage: m
405
393
  }) => {
406
- const { availableWidth: d } = ot(), c = i.useRef(null), l = i.useRef(null), m = Ct(Number(Math.abs(s)), {
394
+ const { availableWidth: l } = ze(), u = a.useRef(null), i = a.useRef(null), _ = Qe(Number(Math.abs(s)), {
407
395
  style: "percent",
408
396
  minimumIntegerDigits: 1
409
- }), C = d === 288 && U(o, "0,0.00").length > 10 ? U(o, "0,0") : U(o, "0,0.00"), u = t === "spending" ? s > 0 : s >= 0, b = t === "spending" ? "error.main" : "success.main", a = t === "spending" ? "success.main" : "text.secondary", g = c?.current, T = l?.current, p = g && T ? g.scrollWidth > T.clientWidth - Ft : !1;
397
+ }), y = l === 288 && te(r, "0,0.00").length > 10 ? te(r, "0,0") : te(r, "0,0.00"), c = n === "spending" ? s > 0 : s >= 0, C = n === "spending" ? "error.main" : "success.main", o = n === "spending" ? "success.main" : "text.secondary", b = u?.current, D = i?.current, d = b && D ? b.scrollWidth > D.clientWidth - ft : !1;
410
398
  return /* @__PURE__ */ f(
411
- _,
399
+ S,
412
400
  {
413
401
  sx: {
414
402
  border: 1,
@@ -421,7 +409,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
421
409
  },
422
410
  children: [
423
411
  /* @__PURE__ */ f(
424
- _,
412
+ S,
425
413
  {
426
414
  sx: {
427
415
  alignItems: "center",
@@ -429,18 +417,18 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
429
417
  justifyContent: "space-between"
430
418
  },
431
419
  children: [
432
- /* @__PURE__ */ e(Y, { color: "text.secondary", variant: "caption", children: n }),
433
- h && /* @__PURE__ */ f(_, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
434
- u ? /* @__PURE__ */ e(ht, { size: 20, sx: { color: b } }) : /* @__PURE__ */ e(ut, { size: 20, sx: { color: a } }),
420
+ /* @__PURE__ */ e(V, { color: "text.secondary", variant: "caption", children: t }),
421
+ m && /* @__PURE__ */ f(S, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
422
+ c ? /* @__PURE__ */ e(Xe, { size: 20, sx: { color: C } }) : /* @__PURE__ */ e(qe, { size: 20, sx: { color: o } }),
435
423
  /* @__PURE__ */ e(
436
- Y,
424
+ V,
437
425
  {
438
426
  sx: {
439
- color: u ? b : a,
427
+ color: c ? C : o,
440
428
  fontWeight: 600
441
429
  },
442
430
  variant: "body2",
443
- children: m
431
+ children: _
444
432
  }
445
433
  )
446
434
  ] })
@@ -448,9 +436,9 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
448
436
  }
449
437
  ),
450
438
  /* @__PURE__ */ f(
451
- _,
439
+ S,
452
440
  {
453
- ref: l,
441
+ ref: i,
454
442
  sx: {
455
443
  alignItems: "center",
456
444
  flexDirection: "row",
@@ -458,19 +446,19 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
458
446
  },
459
447
  children: [
460
448
  /* @__PURE__ */ e(
461
- O,
449
+ z,
462
450
  {
463
- ref: c,
451
+ ref: u,
464
452
  sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
465
- children: /* @__PURE__ */ e(De, { children: C })
453
+ children: /* @__PURE__ */ e(be, { children: y })
466
454
  }
467
455
  ),
468
- h && d >= 450 && !p && /* @__PURE__ */ e(
469
- Y,
456
+ m && l >= 450 && !d && /* @__PURE__ */ e(
457
+ V,
470
458
  {
471
- color: u ? b : a,
459
+ color: c ? C : o,
472
460
  variant: "caption",
473
- children: r
461
+ children: h
474
462
  }
475
463
  )
476
464
  ]
@@ -479,50 +467,50 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
479
467
  ]
480
468
  }
481
469
  );
482
- }, Pt = M(() => {
483
- const { trends: n } = R();
484
- return /* @__PURE__ */ f(_, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
485
- /* @__PURE__ */ e(mt, { size: 32 }),
486
- /* @__PURE__ */ f(_, { children: [
487
- /* @__PURE__ */ e(Y, { fontWeight: 600, variant: "body1", children: n.zero_state_content_header }),
488
- /* @__PURE__ */ e(Y, { color: "text.secondary", variant: "subtitle2", children: n.zero_state_content_description })
470
+ }, pt = O(() => {
471
+ const { trends: t } = R();
472
+ return /* @__PURE__ */ f(S, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
473
+ /* @__PURE__ */ e(Je, { size: 32 }),
474
+ /* @__PURE__ */ f(S, { children: [
475
+ /* @__PURE__ */ e(V, { fontWeight: 600, variant: "body1", children: t.zero_state_content_header }),
476
+ /* @__PURE__ */ e(V, { color: "text.secondary", variant: "subtitle2", children: t.zero_state_content_description })
489
477
  ] })
490
478
  ] });
491
- }), Qn = M(({ onCtaClick: n }) => {
492
- const { visibleAccounts: o } = ie(), { onEvent: t } = H(), { monthlyCategoryTotals: s, loadMonthlyCategoryTotals: r, monthlyTotalsLoaded: h } = P(), d = {
493
- start: dt(/* @__PURE__ */ new Date(), 1),
479
+ }), en = O(({ onCtaClick: t }) => {
480
+ const { visibleAccounts: r } = q(), { onEvent: n } = j(), { monthlyCategoryTotals: s, loadMonthlyCategoryTotals: h, monthlyTotalsLoaded: m } = G(), l = {
481
+ start: Ue(/* @__PURE__ */ new Date(), 1),
494
482
  end: /* @__PURE__ */ new Date()
495
- }, { trends: c } = R(), { selectedAccounts: l, setSelectedAccounts: m, isInitialized: C } = K();
496
- i.useEffect(() => {
497
- m(o);
498
- }, [o]), i.useEffect(() => {
499
- C && r(l, d.start).then(() => {
500
- t(y.TRENDS_LOAD_WIDGET, {
501
- state: o?.length ? "default" : "zeroState"
483
+ }, { trends: u } = R(), { selectedAccounts: i, setSelectedAccounts: _, isInitialized: y } = Y();
484
+ a.useEffect(() => {
485
+ _(r);
486
+ }, [r]), a.useEffect(() => {
487
+ y && h(i, l.start).then(() => {
488
+ n(p.TRENDS_LOAD_WIDGET, {
489
+ state: r?.length ? "default" : "zeroState"
502
490
  });
503
491
  });
504
- }, [C, l]);
505
- const { spendingData: u, incomeData: b } = i.useMemo(
492
+ }, [y, i]);
493
+ const { spendingData: c, incomeData: C } = a.useMemo(
506
494
  () => ({
507
- spendingData: Le(s, d),
508
- incomeData: xe(s, d)
495
+ spendingData: Ne(s, l),
496
+ incomeData: We(s, l)
509
497
  }),
510
- [s, d]
511
- ), [a, g] = u, [T, p] = b, E = _e(g.y, a.y), w = _e(p.y, T.y), I = C && !o?.length, k = () => {
512
- t(
513
- I ? y.TRENDS_CLICK_GET_STARTED : y.TRENDS_CLICK_VIEW_MORE
514
- ), n();
498
+ [s, l]
499
+ ), [o, b] = c, [D, d] = C, x = le(b.y, o.y), v = le(d.y, D.y), M = y && !r?.length, A = () => {
500
+ n(
501
+ M ? p.TRENDS_CLICK_GET_STARTED : p.TRENDS_CLICK_VIEW_MORE
502
+ ), t();
515
503
  };
516
- return !h || !C ? /* @__PURE__ */ e(Q, {}) : /* @__PURE__ */ e(
517
- ft,
504
+ return !m || !y ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ e(
505
+ et,
518
506
  {
519
507
  className: "mx-trends-microwidget",
520
- ctaLabel: c.micro_primary_cta_label,
521
- onCTAClick: k,
522
- subHeader: I ? void 0 : c.micro_subheader,
523
- title: c.title,
524
- children: I ? /* @__PURE__ */ e(Pt, {}) : /* @__PURE__ */ f(
525
- _,
508
+ ctaLabel: u.micro_primary_cta_label,
509
+ onCTAClick: A,
510
+ subHeader: M ? void 0 : u.micro_subheader,
511
+ title: u.title,
512
+ children: M ? /* @__PURE__ */ e(pt, {}) : /* @__PURE__ */ f(
513
+ S,
526
514
  {
527
515
  sx: {
528
516
  alignItems: "stretch",
@@ -531,24 +519,24 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
531
519
  },
532
520
  children: [
533
521
  /* @__PURE__ */ e(
534
- Se,
522
+ me,
535
523
  {
536
- percentage: E,
537
- secondaryLabel: c.micro_secondary_label,
538
- shouldDisplayPercentage: g.y !== 0 && a.y !== 0,
539
- title: c.spending_label,
540
- totalAmount: g.y,
524
+ percentage: x,
525
+ secondaryLabel: u.micro_secondary_label,
526
+ shouldDisplayPercentage: b.y !== 0 && o.y !== 0,
527
+ title: u.spending_label,
528
+ totalAmount: b.y,
541
529
  transactionType: "spending"
542
530
  }
543
531
  ),
544
532
  /* @__PURE__ */ e(
545
- Se,
533
+ me,
546
534
  {
547
- percentage: w,
548
- secondaryLabel: c.micro_secondary_label,
549
- shouldDisplayPercentage: p.y !== 0 && T.y !== 0,
550
- title: c.income_label,
551
- totalAmount: p.y,
535
+ percentage: v,
536
+ secondaryLabel: u.micro_secondary_label,
537
+ shouldDisplayPercentage: d.y !== 0 && D.y !== 0,
538
+ title: u.income_label,
539
+ totalAmount: d.y,
552
540
  transactionType: "income"
553
541
  }
554
542
  )
@@ -557,472 +545,108 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
557
545
  )
558
546
  }
559
547
  );
560
- }), Kt = M(
561
- ({ isExpanded: n, onClick: o }) => {
562
- const t = Ne();
563
- return /* @__PURE__ */ e(_t, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(bt, { onClick: o, sx: { justifyContent: "center" }, children: /* @__PURE__ */ f(
564
- _,
565
- {
566
- sx: { color: t.palette.primary.main, flexDirection: "row", alignItems: "center" },
567
- children: [
568
- /* @__PURE__ */ e(wt, { children: /* @__PURE__ */ e(X, { bold: !0, variant: "body2", children: n ? "View less" : "View more" }) }),
569
- /* @__PURE__ */ e(St, { sx: { color: t.palette.primary.main }, children: n ? /* @__PURE__ */ e(gt, {}) : /* @__PURE__ */ e(
570
- pt,
571
- {
572
- sx: {
573
- transition: "transform 0.3s ease-in-out",
574
- transform: n ? "rotate(180deg)" : "rotate(0deg)"
575
- }
576
- }
577
- ) })
578
- ]
579
- }
580
- ) }) });
581
- }
582
- ), we = M(
583
- ({
584
- totalAmount: n,
585
- guid: o,
586
- name: t,
587
- transactions: s,
588
- onClick: r,
589
- isLastItem: h = !1,
590
- showDivider: d = !0
591
- }) => {
592
- const { trends: c } = R(), { onEvent: l } = H(), m = `${s.length} ${s.length === 1 ? c.transaction : c.transactions}`, C = () => {
593
- r?.(), l(y.TRENDS_CLICK_LIST_ITEM, {
594
- ...A,
595
- listItem: t
596
- });
597
- };
598
- return /* @__PURE__ */ f(i.Fragment, { children: [
599
- /* @__PURE__ */ e(
600
- Ee,
601
- {
602
- leftIcon: o ? /* @__PURE__ */ e(Te, { categoryGuid: o }) : void 0,
603
- onClick: C,
604
- rightContent: U(Math.abs(n), "0,0.00"),
605
- rightIcon: r ? /* @__PURE__ */ e(Ke, {}) : void 0,
606
- subtitle: m,
607
- title: t
608
- }
609
- ),
610
- d && /* @__PURE__ */ e(Dt, { sx: { ml: h ? 24 : 68 } })
611
- ] }, o);
612
- }
613
- ), $t = M(
614
- ({ availableHeight: n = 0, onCategoryClick: o }) => {
615
- const { collapsedCategories: t, visibleCategories: s, setVisibleListLength: r } = q(), { isLargeDesktop: h, isDesktop: d } = $(), { trends: c } = R(), { onEvent: l } = H(), [m, C] = i.useState(!1), u = d || h;
616
- i.useEffect(() => {
617
- const g = Math.floor(n / 64) - 1, T = s.length + t.length;
618
- g !== s.length && (r(u ? Math.max(g, 5) : 5), C(g >= T));
619
- }, [n]);
620
- const b = () => {
621
- C(!m), l(y.TRENDS_CLICK_VIEW_MORE, {
622
- ...A
623
- });
624
- }, a = s.length + (m ? t.length : 0);
625
- return /* @__PURE__ */ e(_, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ f(yt, { children: [
626
- /* @__PURE__ */ e(_, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(De, { children: c.categories }) }),
627
- s.map((g, T) => /* @__PURE__ */ e(
628
- we,
629
- {
630
- ...g,
631
- isLastItem: T === a - 1,
632
- onClick: g.transactions.length > 0 ? () => o(g) : void 0,
633
- showDivider: !0
634
- },
635
- g.guid
636
- )),
637
- /* @__PURE__ */ e(
638
- Tt,
639
- {
640
- in: m,
641
- sx: { "&.MuiCollapse-root .MuiListItemButton-root": { paddingLeft: 24 } },
642
- children: t.map((g, T) => {
643
- const p = s.length + T;
644
- return /* @__PURE__ */ e(
645
- we,
646
- {
647
- ...g,
648
- isLastItem: p === a - 1,
649
- onClick: g.transactions.length > 0 ? () => o(g) : void 0,
650
- showDivider: !0
651
- },
652
- g.guid
653
- );
654
- })
655
- }
656
- ),
657
- t.length > 0 && /* @__PURE__ */ e(Kt, { isExpanded: m, onClick: b })
658
- ] }) });
659
- }
660
- ), jt = [
661
- "BillAmountNotStandard",
662
- "CategorySpendingV2",
663
- "CostOfLivingToIncome",
664
- "DebtPaymentReminderV2",
665
- "DiscoveredAccounts",
666
- "DuplicatePaymentV2",
667
- "FeeDetected",
668
- "GreenGasPurchasesSummary",
669
- "LargeTransaction",
670
- "LowAccountBalance",
671
- "MonthlyDebtToIncomeComparisonV2",
672
- "MonthlyDepositSummaryV2",
673
- "MonthlyNonEssentialCategorySummaryV2",
674
- "MonthlySavingsToIncomeComparison",
675
- "MonthlySpendToIncomeComparisonV2",
676
- "MonthlySubscriptionAggregateV2",
677
- "MonthlyTopMerchantSpendingV3",
678
- "MonthlyObligationsStatus",
679
- "QuarterlySummary",
680
- "SaveAnExtra100Dollars",
681
- "SaveEnoughToLiveOn",
682
- "SavingsOpportunityV2",
683
- "SubscriptionDetected",
684
- "SubscriptionPriceIncrease",
685
- "SetUpDirectDeposit",
686
- "SwitchDirectDeposit",
687
- "UnexpectedSubscriptionPayment",
688
- "UpcomingBill",
689
- "UpcomingSubscription",
690
- "WeekendSpendingSummaryV2",
691
- "WeeklyNewMerchantsV2",
692
- "WeeklyNoSpendDays",
693
- "WeeklySmallPurchasesSummary"
694
- ], Yt = ({ onInsightCardClick: n }) => {
695
- const o = It(), { onEvent: t } = H(), { isMobile: s, isDesktop: r, isLargeDesktop: h } = $(), { beatStore: d, endpoint: c, sessionToken: l } = ve(), { isInitialized: m } = K(), [C, u] = i.useState(!1), b = o.palette.mode === "dark", a = r || h, g = a || s ? 1 : 2;
696
- i.useEffect(() => {
697
- m && d.loadBeats().finally(() => u(!0));
698
- }, [m]);
699
- const T = i.useMemo(() => C ? d.getFilteredBeats({ templates: jt }) : [], [C]), p = () => null, E = (D) => {
700
- n?.(D), t(y.TRENDS_CLICK_INSIGHT, A);
701
- }, w = a ? 200 : 170, I = a ? 170 : 124, k = T.length > 0 ? w : I;
702
- return /* @__PURE__ */ e(Et, { sx: { height: k }, children: /* @__PURE__ */ e(
703
- ct,
704
- {
705
- areBeatsLoading: d.isLoading,
706
- beats: T,
707
- endpoint: c,
708
- logOutUser: p,
709
- onCardClick: E,
710
- showBorder: !0,
711
- showCTAColocatedWithText: !1,
712
- showCarouselControls: !0,
713
- showHeader: a,
714
- showIcon: !0,
715
- showWithMargin: !1,
716
- token: l,
717
- useDarkMode: b,
718
- userHasFullInsightFeedBeats: !1,
719
- variant: "outlined",
720
- visibleCardsCount: g
721
- }
722
- ) });
723
- }, Ut = M(Yt), Xt = M(({ chartLabel: n, chartColor: o }) => {
724
- const { onEvent: t } = H(), {
725
- categoryDetailsChartData: { monthlyAmounts: s, tooltipLabels: r }
726
- } = q();
727
- return /* @__PURE__ */ e(_, { sx: { pt: 12, width: "100%" }, children: /* @__PURE__ */ e(
728
- ye,
729
- {
730
- baseline: "min",
731
- colors: [o],
732
- curveType: "bump",
733
- customTooltipLabels: r,
734
- datasets: [s],
735
- height: 265,
736
- labels: [n],
737
- markStyles: () => ({
738
- stroke: o
739
- }),
740
- onItemClick: () => {
741
- t(y.TRENDS_CLICK_CHART, A);
742
- },
743
- showArea: !0,
744
- showAverage: !0,
745
- showAxisHighlight: !0,
746
- showLegend: !0,
747
- showTooltip: !0,
748
- showXAxis: !0,
749
- showXAxisTicks: !0,
750
- showYAxis: !0,
751
- showYAxisTicks: !0,
752
- useCustomMark: !0,
753
- valueFormatterString: "0,0"
754
- }
755
- ) });
756
- }), Zt = M(({ onClose: n }) => {
757
- const o = Ne(), { onEvent: t } = H(), { common: s, trends: r } = R(), { selectedCategoryData: h, selectedDateRangeMonthRange: d } = q(), { sortedTransactions: c } = re(), [l, m] = i.useState(null);
758
- if (!h)
759
- return null;
760
- const { guid: C, name: u, is_income: b, totalAmount: a } = h, g = b ? r.category_income : r.category_spending, T = xt(C, o), p = b ? r.income_label : r.spending_label, E = ` ${h.transactions.length === 1 ? r.transaction : r.transactions} (${h.transactions.length})`, w = i.useMemo(
761
- () => c.find((D) => D.guid === l),
762
- [l, c]
763
- ), I = (D) => D.category_guid === C || D.top_level_category_guid === C, k = () => {
764
- n?.(), t(y.TRENDS_CLICK_BACK, A);
765
- };
766
- return /* @__PURE__ */ f(
767
- fe,
768
- {
769
- ariaLabelClose: r.close_category_details,
770
- isOpen: !0,
771
- onClose: k,
772
- shouldShowHeaderShadow: !0,
773
- title: g,
774
- children: [
775
- /* @__PURE__ */ f(_, { sx: { alignItems: "center", height: "100%" }, children: [
776
- /* @__PURE__ */ f(Lt, { sx: { borderRadius: 0, pb: 4, pt: 16, width: "100%" }, children: [
777
- /* @__PURE__ */ e(
778
- Ee,
779
- {
780
- leftIcon: /* @__PURE__ */ e(Te, { categoryGuid: C }),
781
- rightContent: U(Math.abs(a), "0,0.00"),
782
- subtitle: d,
783
- title: u
784
- }
785
- ),
786
- /* @__PURE__ */ e(Xt, { chartColor: T, chartLabel: p }),
787
- /* @__PURE__ */ f(_, { alignItems: "center", direction: "row", justifyContent: "space-between", sx: { mx: 24 }, children: [
788
- /* @__PURE__ */ e(X, { bold: !0, variant: "body1", children: E }),
789
- /* @__PURE__ */ e(vt, { filter: I })
790
- ] })
791
- ] }),
792
- /* @__PURE__ */ e(
793
- ke,
794
- {
795
- bgcolor: "transparent",
796
- filter: I,
797
- height: "calc(100vh - 475px)",
798
- onClick: m
799
- }
800
- )
801
- ] }),
802
- /* @__PURE__ */ e(
803
- fe,
804
- {
805
- ariaLabelClose: s.close_aria,
806
- isOpen: !!w,
807
- onClose: () => m(""),
808
- title: r.transaction,
809
- children: w && /* @__PURE__ */ e(Re, { transaction: w })
810
- }
811
- )
812
- ]
813
- }
814
- );
815
- }), Qt = (n, o) => {
816
- const t = xe(n, o), s = Le(n, o);
817
- return [t, s].filter((r) => r.length > 0);
818
- }, qt = (n, o) => {
819
- const [t, s] = n, r = t, h = s ?? t, d = [];
820
- if (r) {
821
- const c = r.reduce((l, m) => l + m.y, 0);
822
- d.push({ label: o.income_label, amount: c });
823
- }
824
- if (h) {
825
- const c = h.reduce((l, m) => l + m.y, 0);
826
- d.push({ label: o.spending_label, amount: c });
827
- }
828
- return d;
829
- }, Jt = ({
830
- availableHeight: n = 0,
831
- minHeight: o = 500,
832
- selectedDateRange: t,
833
- totals: s
834
- }) => {
835
- const r = He(), { onEvent: h } = H(), { trends: d } = R(), { isSmallMobile: c, isMobile: l, isSmallTablet: m, isTablet: C } = $(), u = [r.palette.chart?.chart1, r.palette.chart?.chart2], b = Qt(s, t), a = qt(b, d), [g, T] = i.useState(0), p = 458, E = 195, w = 56, I = l || c ? E : m || C ? p : g;
836
- return i.useEffect(() => {
837
- const D = Math.max(n - w, o);
838
- T(D);
839
- }, [n]), /* @__PURE__ */ e(
840
- ye,
841
- {
842
- baseline: "min",
843
- colors: u,
844
- curveType: "bump",
845
- datasets: b,
846
- height: I,
847
- labels: a,
848
- onItemClick: () => {
849
- h(y.TRENDS_CLICK_CHART, A);
850
- },
851
- showArea: !0,
852
- showAxisHighlight: !0,
853
- showLegend: !0,
854
- showTooltip: !0,
855
- showXAxis: !0,
856
- showXAxisTicks: !0,
857
- showYAxis: !0,
858
- showYAxisTicks: !0,
859
- valueFormatterString: "0,0"
860
- }
861
- );
862
- }, en = M(Jt), tn = ({ onBackClick: n, onInsightCardClick: o, sx: t }) => {
863
- const { onEvent: s } = H(), { config: r } = st(), { isLargeDesktop: h, isDesktop: d, isMobile: c } = $(), { visibleAccounts: l } = ie(), { loadDateRangeCategoryTotals: m, loadMonthlyCategoryTotals: C, monthlyCategoryTotals: u } = P(), { setFilter: b } = re(), { selectedDateRange: a, setSelectedCategoryData: g, setSelectedDateRange: T } = q(), {
864
- isCopyLoaded: p,
865
- isInitialized: E,
866
- selectedAccounts: w,
867
- selectedAccountGuids: I,
868
- setSelectedAccounts: k
869
- } = K(), { trends: D } = R(), N = Ue(), L = d || h, [x, z] = i.useState(!1), [F, ce] = i.useState("Chart"), [J, ee] = i.useState(""), [te, ne] = i.useState(!1), [oe, le] = i.useState(window.innerHeight), se = oe - 208, de = oe - (N ? 494 : 266), [he, ue] = i.useState(!1);
870
- i.useEffect(() => {
871
- const v = () => le(window.innerHeight);
872
- return window.addEventListener("resize", v), () => window.removeEventListener("resize", v);
873
- }, []), i.useEffect(() => {
874
- console.log("accounts changed: ", l.length), l.length ? k(l) : (ue(!0), z(!0));
875
- }, [l]), i.useEffect(() => {
876
- E && m(w, a.start, a.end).then(() => {
877
- C(
878
- w,
879
- a.start,
880
- a.end
548
+ }), _t = ({ onBackClick: t, onInsightCardClick: r, sx: n }) => {
549
+ const { onEvent: s } = j(), { config: h } = Ge(), { isLargeDesktop: m, isDesktop: l, isMobile: u } = re(), { visibleAccounts: i } = q(), { loadDateRangeCategoryTotals: _, loadMonthlyCategoryTotals: y, monthlyCategoryTotals: c } = G(), { setFilter: C } = ae(), { selectedDateRange: o, setSelectedCategoryData: b, setSelectedDateRange: D } = he(), {
550
+ isCopyLoaded: d,
551
+ isInitialized: x,
552
+ selectedAccounts: v,
553
+ selectedAccountGuids: M,
554
+ setSelectedAccounts: A
555
+ } = Y(), { trends: w } = R();
556
+ ve();
557
+ const [L, E] = a.useState(!1);
558
+ a.useState("Chart"), a.useState(""), a.useState(!1);
559
+ const [T, F] = a.useState(window.innerHeight), Z = T - 208;
560
+ a.useEffect(() => {
561
+ const I = () => F(window.innerHeight);
562
+ return window.addEventListener("resize", I), () => window.removeEventListener("resize", I);
563
+ }, []), a.useEffect(() => {
564
+ A(i);
565
+ }, [i]), a.useEffect(() => {
566
+ x && _(v, o.start, o.end).then(() => {
567
+ y(
568
+ v,
569
+ o.start,
570
+ o.end
881
571
  );
882
572
  }).finally(() => {
883
- z(!0), s(y.TRENDS_LOAD_WIDGET, {
884
- ...A,
885
- time_period: `${Ce(a.end, a.start)}M`
573
+ E(!0), s(p.TRENDS_LOAD_WIDGET, {
574
+ ...B,
575
+ time_period: `${se(o.end, o.start)}M`
886
576
  });
887
577
  });
888
- }, [E, w, a]), i.useEffect(() => {
889
- if (u.length !== 0) {
890
- const v = {
891
- accounts: I,
892
- dateRange: { start: a.start, end: a.end }
578
+ }, [x, v, o]), a.useEffect(() => {
579
+ if (c.length !== 0) {
580
+ const I = {
581
+ accounts: M,
582
+ dateRange: { start: o.start, end: o.end }
893
583
  };
894
- b({
895
- ...v,
896
- custom: (V) => !!u.find(
897
- (j) => j.top_level_category_guid === V.top_level_category_guid || j.category_guid === V.category_guid
584
+ C({
585
+ ...I,
586
+ custom: (N) => !!c.find(
587
+ (W) => W.top_level_category_guid === N.top_level_category_guid || W.category_guid === N.category_guid
898
588
  )
899
589
  });
900
590
  }
901
- }, [u]);
902
- const me = (v) => {
903
- g(v), ne(!0);
904
- }, S = () => {
905
- g(null), ne(!1);
906
- }, W = (v, V) => {
907
- ce(V ?? F), s(y.TRENDS_CLICK_TOGGLE_VIEW, {
908
- ...A,
909
- toggleView: V
910
- });
911
- }, G = (v) => {
912
- const V = Ie(v?.[0], 1), j = v?.[1], Fe = Ce(j, V);
913
- T({ start: V, end: j }), s(y.TRENDS_CLICK_TIME_WINDOW, {
914
- ...A,
915
- time_period: Fe + "M"
591
+ }, [c]);
592
+ const J = (I) => {
593
+ const N = ge(I?.[0], 1), W = I?.[1], ee = se(W, N);
594
+ D({ start: N, end: W }), s(p.TRENDS_CLICK_TIME_WINDOW, {
595
+ ...B,
596
+ time_period: ee + "M"
916
597
  });
917
- }, ge = (v) => {
918
- s(y.TRENDS_CLICK_FILTER, {
919
- ...A,
920
- filterValue: v
598
+ }, ie = (I) => {
599
+ s(p.TRENDS_CLICK_FILTER, {
600
+ ...B,
601
+ filterValue: I
921
602
  });
922
- }, Ge = (v) => {
923
- ee(v);
924
- }, Be = () => {
925
- ee(""), s(y.TRENDS_CLICK_ALL_CATEGORIES, A);
926
- }, ze = r.show_connections_widget_in_master ? "buttons" : "no-buttons";
927
- return /* @__PURE__ */ f(
928
- Ae,
603
+ }, U = h.show_connections_widget_in_master ? "buttons" : "no-buttons", X = !i?.length, Q = i.length > 0;
604
+ return !d || !L ? /* @__PURE__ */ e($, {}) : (console.log("accounts: ", i), console.log("!accounts?.length: ", X), console.log("accounts.length > 0: ", Q), /* @__PURE__ */ f(
605
+ pe,
929
606
  {
930
- accountOptions: l,
931
- calendarActions: { onRangeChanged: G },
932
- dateRange: a,
933
- dateRangeVariant: c ? "timeframetabs" : "timeframebuttons",
934
- onAccountsFilterClick: ge,
935
- onBackClick: n,
936
- sx: t,
937
- title: D.title,
607
+ accountOptions: i,
608
+ calendarActions: { onRangeChanged: J },
609
+ dateRange: o,
610
+ dateRangeVariant: u ? "timeframetabs" : "timeframebuttons",
611
+ onAccountsFilterClick: ie,
612
+ onBackClick: t,
613
+ sx: n,
614
+ title: w.title,
938
615
  children: [
939
- !p || !x && /* @__PURE__ */ e(Q, {}),
940
- he ? /* @__PURE__ */ e(
941
- Mt,
616
+ /* @__PURE__ */ e(
617
+ ue,
942
618
  {
943
- header: D.zero_state_content_header,
619
+ header: w.zero_state_content_header,
944
620
  icon: "",
945
621
  onClick: () => {
946
622
  },
947
- primaryButton: D.empty_state_primary,
948
- subText: D.empty_state_sub_text,
949
- sx: { height: se },
950
- variant: ze
623
+ primaryButton: w.empty_state_primary,
624
+ subText: w.empty_state_sub_text,
625
+ sx: { height: Z },
626
+ variant: U
951
627
  }
952
- ) : /* @__PURE__ */ f(
953
- _,
628
+ ),
629
+ /* @__PURE__ */ e(
630
+ ue,
954
631
  {
955
- sx: {
956
- px: c ? 0 : 48
632
+ header: w.zero_state_content_header,
633
+ icon: "",
634
+ onClick: () => {
957
635
  },
958
- children: [
959
- /* @__PURE__ */ f(
960
- _,
961
- {
962
- flexDirection: "row",
963
- justifyContent: "space-between",
964
- sx: { pb: c ? 12 : 24, pt: c ? 24 : 48 },
965
- children: [
966
- /* @__PURE__ */ e(
967
- Oe,
968
- {
969
- selectedCategoryGuid: J,
970
- selectedDateRange: a
971
- }
972
- ),
973
- /* @__PURE__ */ e(We, { onTabChange: W, selectedTab: F })
974
- ]
975
- }
976
- ),
977
- /* @__PURE__ */ e(_, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(O, { flexGrow: 1, children: J && /* @__PURE__ */ f(pe, { onClick: Be, sx: { p: 0, pr: 5 }, children: [
978
- /* @__PURE__ */ e(ae, { name: "arrow_back" }),
979
- D.all_categories
980
- ] }) }) }),
981
- /* @__PURE__ */ f(_, { flexDirection: L ? "row" : "column", gap: L ? 48 : 16, children: [
982
- F === "Chart" && /* @__PURE__ */ f(Pe, { children: [
983
- /* @__PURE__ */ e(O, { sx: { width: L ? "68%" : "100%" }, children: /* @__PURE__ */ e(
984
- en,
985
- {
986
- availableHeight: se,
987
- minHeight: 450,
988
- selectedDateRange: a,
989
- totals: u
990
- }
991
- ) }),
992
- /* @__PURE__ */ f(_, { gap: 16, sx: { width: L ? "32%" : "100%" }, children: [
993
- N && /* @__PURE__ */ e(Ut, { onInsightCardClick: o }),
994
- /* @__PURE__ */ e(
995
- $t,
996
- {
997
- availableHeight: de,
998
- onCategoryClick: me
999
- }
1000
- )
1001
- ] })
1002
- ] }),
1003
- F === "Table" && /* @__PURE__ */ e(O, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
1004
- Ve,
1005
- {
1006
- height: "unset",
1007
- monthlyCategoryTotals: u,
1008
- onClickRow: Ge,
1009
- selectedCategory: J,
1010
- selectedDateRange: a
1011
- }
1012
- ) })
1013
- ] }),
1014
- te && /* @__PURE__ */ e(Zt, { onClose: S })
1015
- ]
636
+ primaryButton: w.empty_state_primary,
637
+ subText: w.empty_state_sub_text,
638
+ sx: { height: Z },
639
+ variant: U
1016
640
  }
1017
641
  )
1018
642
  ]
1019
643
  }
1020
- );
1021
- }, qn = M(tn);
644
+ ));
645
+ }, tn = O(_t);
1022
646
  export {
1023
- Xn as TrendsFullWidget,
1024
- Qn as TrendsMicroWidget,
1025
- Zn as TrendsMiniWidget,
1026
- to as TrendsStore,
1027
- qn as TrendsWidget
647
+ Jt as TrendsFullWidget,
648
+ en as TrendsMicroWidget,
649
+ Qt as TrendsMiniWidget,
650
+ sn as TrendsStore,
651
+ tn as TrendsWidget
1028
652
  };