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