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