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