@mx-cartographer/experiences 7.4.1 → 7.4.3
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 +8 -0
- package/dist/{AccountDetailsContent-gke-5zMF.mjs → AccountDetailsContent-COMjOzwr.mjs} +5 -5
- package/dist/{AccountDetailsHeader-CRzfuFA2.mjs → AccountDetailsHeader-Cbi5G6fJ.mjs} +2 -2
- package/dist/{AccountFields-CPkGZ3SD.mjs → AccountFields-Cd_nOWmf.mjs} +1 -1
- package/dist/{AccountListItem-D4uG9yC-.mjs → AccountListItem-DxY4cCF1.mjs} +2 -2
- package/dist/{BudgetUtil-wjoNuj7B.mjs → BudgetUtil-Df2nII9u.mjs} +1 -1
- package/dist/{CurrencyInput-xH-hqry9.mjs → CurrencyInput-BFKcs-_K.mjs} +1 -1
- package/dist/{CurrencyText-kyC1aseI.mjs → CurrencyText-Dr0EZ7bp.mjs} +1 -1
- package/dist/{FinstrongStore-CfD6bbJk.mjs → FinstrongStore-BnBCtVTl.mjs} +1 -1
- package/dist/{GoalStore-j6QYHgEa.mjs → GoalStore-CrNhjvNc.mjs} +1 -1
- package/dist/{LineChart-DttMO7uS.mjs → LineChart-bc1D9xBE.mjs} +81 -81
- package/dist/{ManageIncome-CU5C0AeO.mjs → ManageIncome-A69EUO5u.mjs} +3 -3
- package/dist/{NotificationSettings-DI5B1spM.mjs → NotificationSettings-CNmJWVeI.mjs} +2 -2
- package/dist/{NumberFormatting-Buh7u8Oi.mjs → NumberFormatting-DjTD0t3W.mjs} +9 -9
- package/dist/{OriginalBalanceAction-CCmnsd7y.mjs → OriginalBalanceAction-DK8_LkPz.mjs} +2 -2
- package/dist/{RecurringSettings-Cm5Bqcai.mjs → RecurringSettings-B0uObPlD.mjs} +2 -2
- package/dist/{RecurringTransactions-CngsRZ3K.mjs → RecurringTransactions-BqijW_8S.mjs} +1 -1
- package/dist/{RecurringTransactionsStore-Bc1wCiNB.mjs → RecurringTransactionsStore-BhBUVm9a.mjs} +1 -1
- package/dist/{SpendingLegend-B2BYr8B4.mjs → SpendingLegend-BbrZWbFX.mjs} +2 -2
- package/dist/{TransactionDetails-CtbBBSoU.mjs → TransactionDetails-COH0OKNG.mjs} +2 -2
- package/dist/{ViewMoreMicroCard-dHzKolxh.mjs → ViewMoreMicroCard-C0832BMe.mjs} +420 -413
- package/dist/accounts/index.es.js +8 -8
- package/dist/budgets/index.es.js +5 -5
- package/dist/cashflow/index.es.js +7 -7
- package/dist/common/index.es.js +11 -11
- package/dist/debts/index.es.js +4 -4
- package/dist/finstrong/index.es.js +417 -413
- package/dist/goals/index.es.js +7 -7
- package/dist/investments/index.es.js +1 -1
- package/dist/microinsights/index.es.js +1 -1
- package/dist/microinsights/interfaces.d.ts +0 -1
- package/dist/networth/index.es.js +3 -3
- package/dist/notifications/index.es.js +1 -1
- package/dist/recurringtransactions/index.es.js +8 -8
- package/dist/settings/index.es.js +2 -2
- package/dist/spending/index.es.js +3 -3
- package/dist/transactions/index.es.js +4 -4
- package/dist/trends/index.es.js +319 -320
- package/package.json +1 -1
package/dist/trends/index.es.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { jsxs as f, jsx as e, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { observer as
|
|
4
|
-
import { CategoryIcon as Se, Text as K, Icon as fe, P as he, H3 as Pe, ChevronRightIcon as
|
|
5
|
-
import
|
|
1
|
+
import { jsxs as f, jsx as e, Fragment as st } from "react/jsx-runtime";
|
|
2
|
+
import l, { useRef as rt, useState as at, useEffect as it } from "react";
|
|
3
|
+
import { observer as k } from "mobx-react-lite";
|
|
4
|
+
import { CategoryIcon as Se, Text as K, Icon as fe, P as he, H3 as Pe, ChevronRightIcon as ct } from "@mxenabled/mxui";
|
|
5
|
+
import N from "@mui/material/Box";
|
|
6
6
|
import b from "@mui/material/Stack";
|
|
7
7
|
import _e from "@mui/material/Button";
|
|
8
8
|
import { addSeconds as $e } from "date-fns/addSeconds";
|
|
9
9
|
import { differenceInCalendarMonths as Ae } from "date-fns/differenceInCalendarMonths";
|
|
10
10
|
import { useTheme as be } from "@mui/material/styles";
|
|
11
|
-
import { LineChart as
|
|
11
|
+
import { LineChart as lt } from "@mui/x-charts";
|
|
12
12
|
import { u as ee } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
13
|
-
import { u as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
13
|
+
import { u as dt } from "../useDimensions-27p2evRx.mjs";
|
|
14
|
+
import ut from "@mui/material/Card";
|
|
15
|
+
import ht from "@mui/material/CardContent";
|
|
16
16
|
import Re from "@mui/material/Divider";
|
|
17
17
|
import We from "@mui/material/Grid";
|
|
18
|
-
import { u as
|
|
18
|
+
import { u as W, m as U, g as P, b as me, h as xe, d as ve, w as pe, f as He, q as gt, n as mt, a as pt } from "../hooks-C41HAxM5.mjs";
|
|
19
19
|
import { b as Fe } from "../Localization-2MODESHW.mjs";
|
|
20
|
-
import { C as Te } from "../CurrencyText-
|
|
21
|
-
import { useTheme as
|
|
20
|
+
import { C as Te } from "../CurrencyText-Dr0EZ7bp.mjs";
|
|
21
|
+
import { useTheme as Ct, Card as yt, CardContent as ft, Box as _t, Stack as Tt } from "@mui/material";
|
|
22
22
|
import { f as J, a as z } from "../Dialog-BPTr3qHE.mjs";
|
|
23
23
|
import { C as Me, c as St } from "../Category-CevNQ03n.mjs";
|
|
24
|
-
import { f as oe, a as bt } from "../NumberFormatting-
|
|
25
|
-
import { a as xt, g as vt, L as
|
|
24
|
+
import { f as oe, a as bt } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
25
|
+
import { a as xt, g as vt, L as ze } from "../TrendsStore-BW9FGQeE.mjs";
|
|
26
26
|
import { T as Gn } from "../TrendsStore-BW9FGQeE.mjs";
|
|
27
|
-
import { i as wt, c as Dt, d as It, e as Et, f as Lt, h as Mt, b as
|
|
27
|
+
import { i as wt, c as Dt, d as It, e as Et, f as Lt, h as Mt, b as Ke, g as je, j as Oe } from "../SpendingData-BuJ03S9d.mjs";
|
|
28
28
|
import At from "@mui/material/ToggleButton";
|
|
29
29
|
import Rt from "@mui/material/ToggleButtonGroup";
|
|
30
30
|
import { DataGridPro as kt } from "@mui/x-data-grid-pro";
|
|
31
31
|
import { H as Ge } from "../HeaderCell-DjuifqHJ.mjs";
|
|
32
|
-
import { T as G, b as Ht } from "../ViewMoreMicroCard-
|
|
33
|
-
import { A as
|
|
34
|
-
import { a as
|
|
32
|
+
import { T as G, b as Ht } from "../ViewMoreMicroCard-C0832BMe.mjs";
|
|
33
|
+
import { A as v, W as Ye } from "../WidgetContainer-6dsjtOVg.mjs";
|
|
34
|
+
import { a as Ue, T as Xe } from "../TransactionDetails-COH0OKNG.mjs";
|
|
35
35
|
import { D as ke } from "../Drawer-BEtCk82g.mjs";
|
|
36
36
|
import { L as ge } from "../Loader-DUaFpDGv.mjs";
|
|
37
|
-
import { L as Ne } from "../LineChart-
|
|
37
|
+
import { L as Ne } from "../LineChart-bc1D9xBE.mjs";
|
|
38
38
|
import { M as Nt } from "../MiniWidgetContainer-CmXpTylX.mjs";
|
|
39
39
|
import { subMonths as Wt } from "date-fns";
|
|
40
40
|
import { TrendingUp as Ot, TrendingDown as Gt, MultilineChart as Bt, ExpandLess as Vt, ExpandMore as Pt } from "@mxenabled/mx-icons";
|
|
@@ -45,18 +45,18 @@ import Kt from "@mui/material/ListItem";
|
|
|
45
45
|
import jt from "@mui/material/ListItemButton";
|
|
46
46
|
import Yt from "@mui/material/ListItemIcon";
|
|
47
47
|
import Ut from "@mui/material/ListItemText";
|
|
48
|
-
import
|
|
48
|
+
import Ze from "@mui/material/styles/useTheme";
|
|
49
49
|
import Xt from "@mui/material/Paper";
|
|
50
50
|
import { b as Zt } from "../CategoryUtil-DUM8NuGO.mjs";
|
|
51
51
|
import { E as qt } from "../ExportCsvAction-DzTrtPzk.mjs";
|
|
52
52
|
import { u as Qt } from "../useInsightsEnabled-CNjP5cfR.mjs";
|
|
53
53
|
import { E as Jt } from "../EmptyState-DoxNUae-.mjs";
|
|
54
54
|
import { l as eo } from "../ConnectDrawer-CuUj16NH.mjs";
|
|
55
|
-
const
|
|
56
|
-
const { categories: t } =
|
|
55
|
+
const qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
56
|
+
const { categories: t } = W(), { getCategoryName: n } = U(), r = n(o);
|
|
57
57
|
return /* @__PURE__ */ f(b, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
|
|
58
58
|
/* @__PURE__ */ e(
|
|
59
|
-
|
|
59
|
+
N,
|
|
60
60
|
{
|
|
61
61
|
"aria-label": Fe(t.category_icon_label_aria, r),
|
|
62
62
|
mb: 4,
|
|
@@ -72,21 +72,21 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
72
72
|
cursorPosition: n,
|
|
73
73
|
chartContainerRef: r
|
|
74
74
|
}) => {
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
75
|
+
const d = be(), u = rt(null), [g, c] = at({ x: n.x, y: n.y });
|
|
76
|
+
if (it(() => {
|
|
77
77
|
(() => {
|
|
78
|
-
const
|
|
79
|
-
if (!
|
|
80
|
-
const m =
|
|
78
|
+
const p = u.current, _ = r.current;
|
|
79
|
+
if (!p || !_) return;
|
|
80
|
+
const m = p.getBoundingClientRect(), i = _.getBoundingClientRect();
|
|
81
81
|
let T = n.x, y = n.y;
|
|
82
82
|
T + m.width * 2 > i.right ? T = n.x - m.width : T - m.width < i.left && (T = n.x), y + m.height * 2 > i.bottom && (y = n.y - m.height), c({ x: T, y });
|
|
83
83
|
})();
|
|
84
84
|
}, [n, r]), !t) return null;
|
|
85
|
-
const
|
|
85
|
+
const h = t.reduce((C, p) => C + p.y, 0);
|
|
86
86
|
return /* @__PURE__ */ e(
|
|
87
|
-
|
|
87
|
+
ut,
|
|
88
88
|
{
|
|
89
|
-
ref:
|
|
89
|
+
ref: u,
|
|
90
90
|
sx: {
|
|
91
91
|
position: "absolute",
|
|
92
92
|
top: g.y,
|
|
@@ -94,17 +94,17 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
94
94
|
width: 250,
|
|
95
95
|
pointerEvents: "none"
|
|
96
96
|
},
|
|
97
|
-
children: /* @__PURE__ */ f(
|
|
98
|
-
/* @__PURE__ */ f(
|
|
99
|
-
/* @__PURE__ */ e(
|
|
97
|
+
children: /* @__PURE__ */ f(ht, { children: [
|
|
98
|
+
/* @__PURE__ */ f(N, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
99
|
+
/* @__PURE__ */ e(qe, { categoryGuid: o, topLevelCategoryGuid: s }),
|
|
100
100
|
/* @__PURE__ */ e(K, { variant: "Small", children: `${t.length}-month total` }),
|
|
101
|
-
/* @__PURE__ */ e(Te, { amount:
|
|
101
|
+
/* @__PURE__ */ e(Te, { amount: h, bold: !0, formatString: "0,0", variant: "body2" })
|
|
102
102
|
] }),
|
|
103
103
|
/* @__PURE__ */ e(Re, { sx: { my: 16, width: "100%" } }),
|
|
104
|
-
/* @__PURE__ */ e(We, { container: !0, children: t.map((C,
|
|
105
|
-
|
|
106
|
-
/* @__PURE__ */ e(We, { item: !0, xs: 4, children: /* @__PURE__ */ f(
|
|
107
|
-
/* @__PURE__ */ e(K, { color:
|
|
104
|
+
/* @__PURE__ */ e(We, { container: !0, children: t.map((C, p) => /* @__PURE__ */ f(l.Fragment, { children: [
|
|
105
|
+
p > 0 && p % 3 === 0 && /* @__PURE__ */ e(Re, { sx: { my: 16, width: "100%" } }),
|
|
106
|
+
/* @__PURE__ */ e(We, { item: !0, xs: 4, children: /* @__PURE__ */ f(N, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
107
|
+
/* @__PURE__ */ e(K, { color: d.palette.text.secondary, variant: "XSmall", children: C.x }),
|
|
108
108
|
/* @__PURE__ */ e(
|
|
109
109
|
Te,
|
|
110
110
|
{
|
|
@@ -115,21 +115,21 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
115
115
|
}
|
|
116
116
|
)
|
|
117
117
|
] }) })
|
|
118
|
-
] },
|
|
118
|
+
] }, p)) })
|
|
119
119
|
] })
|
|
120
120
|
}
|
|
121
121
|
);
|
|
122
|
-
}, oo =
|
|
122
|
+
}, oo = k(to), no = ({
|
|
123
123
|
categoryGuids: { guid: o, topLevelGuid: s },
|
|
124
124
|
itemData: { dataIndex: t },
|
|
125
125
|
series: n,
|
|
126
126
|
xData: r
|
|
127
127
|
}) => {
|
|
128
|
-
const
|
|
129
|
-
return
|
|
130
|
-
/* @__PURE__ */ e(
|
|
131
|
-
/* @__PURE__ */ e(K, { color:
|
|
132
|
-
/* @__PURE__ */ e(Te, { amount: String(
|
|
128
|
+
const d = Ct(), u = n.data[t], g = r[t];
|
|
129
|
+
return u === void 0 || !g ? null : /* @__PURE__ */ e(yt, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ e(ft, { children: /* @__PURE__ */ f(_t, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
130
|
+
/* @__PURE__ */ e(qe, { categoryGuid: o, topLevelCategoryGuid: s }),
|
|
131
|
+
/* @__PURE__ */ e(K, { color: d.palette.text.secondary, variant: "Small", children: J(g, z.MONTH_SHORT_YEAR) }),
|
|
132
|
+
/* @__PURE__ */ e(Te, { amount: String(u), bold: !0, formatString: "0,0", variant: "Body" })
|
|
133
133
|
] }) }) });
|
|
134
134
|
}, so = ({
|
|
135
135
|
sx: o,
|
|
@@ -137,24 +137,24 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
137
137
|
hoveredLegend: t,
|
|
138
138
|
legendRef: n,
|
|
139
139
|
onHoverLegend: r,
|
|
140
|
-
onClickLegend:
|
|
140
|
+
onClickLegend: d
|
|
141
141
|
}) => {
|
|
142
|
-
const { isMobile:
|
|
142
|
+
const { isMobile: u } = ee(), { getCategoryName: g } = U();
|
|
143
143
|
return /* @__PURE__ */ e(
|
|
144
144
|
b,
|
|
145
145
|
{
|
|
146
146
|
direction: "row",
|
|
147
147
|
flexWrap: "wrap",
|
|
148
|
-
gap:
|
|
148
|
+
gap: u ? 2 : 6,
|
|
149
149
|
justifyContent: "start",
|
|
150
150
|
ref: n,
|
|
151
151
|
sx: o,
|
|
152
|
-
children: s.map(({ guid: c, top_level_guid:
|
|
153
|
-
const C = t === c,
|
|
152
|
+
children: s.map(({ guid: c, top_level_guid: h }) => {
|
|
153
|
+
const C = t === c, p = Me[c], _ = Me[h], m = p ?? _ ?? Me.default, i = m + "33";
|
|
154
154
|
return /* @__PURE__ */ f(
|
|
155
155
|
_e,
|
|
156
156
|
{
|
|
157
|
-
onClick: () =>
|
|
157
|
+
onClick: () => d(c),
|
|
158
158
|
onMouseEnter: () => r(c),
|
|
159
159
|
onMouseLeave: () => r(null),
|
|
160
160
|
sx: {
|
|
@@ -170,12 +170,12 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
170
170
|
},
|
|
171
171
|
children: [
|
|
172
172
|
/* @__PURE__ */ e(
|
|
173
|
-
|
|
173
|
+
N,
|
|
174
174
|
{
|
|
175
175
|
sx: {
|
|
176
176
|
width: 16,
|
|
177
177
|
height: 16,
|
|
178
|
-
marginRight:
|
|
178
|
+
marginRight: u ? 5 : 10,
|
|
179
179
|
borderRadius: "2px",
|
|
180
180
|
backgroundColor: t ? C ? m : i : m
|
|
181
181
|
}
|
|
@@ -195,24 +195,24 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
195
195
|
onHoverLegend: t,
|
|
196
196
|
onClickLegend: n,
|
|
197
197
|
stackedDatasets: r,
|
|
198
|
-
unstackedDatasets:
|
|
199
|
-
availableHeight:
|
|
198
|
+
unstackedDatasets: d = [],
|
|
199
|
+
availableHeight: u = 0,
|
|
200
200
|
minimumHeight: g = 350
|
|
201
201
|
}) => {
|
|
202
|
-
const c = be(), { isMobile:
|
|
203
|
-
|
|
204
|
-
const a = Math.max(
|
|
202
|
+
const c = be(), { isMobile: h } = ee(), [C, { height: p }] = dt(), _ = l.useRef(null), [m, i] = l.useState(0);
|
|
203
|
+
l.useEffect(() => {
|
|
204
|
+
const a = Math.max(u - p, g);
|
|
205
205
|
i(a);
|
|
206
|
-
}, [
|
|
207
|
-
const [T, y] =
|
|
206
|
+
}, [u, p]);
|
|
207
|
+
const [T, y] = l.useState(null), [L, x] = l.useState({
|
|
208
208
|
hoveredSeriesId: null,
|
|
209
209
|
hoveredAreaData: null,
|
|
210
210
|
isAreaHovered: !1,
|
|
211
211
|
cursorPos: { x: 0, y: 0 }
|
|
212
|
-
}), { hoveredSeriesId:
|
|
212
|
+
}), { hoveredSeriesId: D, hoveredAreaData: O, isAreaHovered: A, cursorPos: M } = L, R = A && D && O, E = !R, X = [...r, ...d], ne = X[0]?.dataset.length ?? 0, B = X.flatMap((a) => a.dataset.map((S) => S.x)), Ce = X.flatMap((a) => a.dataset.map((S) => S.y)), ae = r[0]?.dataset?.map(
|
|
213
213
|
(a, S) => r.reduce((I, Y) => I + Y.dataset[S]?.y || 0, 0)
|
|
214
214
|
) ?? [0], Z = Math.max(...ae), ie = Math.max(
|
|
215
|
-
...
|
|
215
|
+
...d.flatMap((a) => a.dataset.map((S) => S.y))
|
|
216
216
|
), q = Math.floor(Math.min(...Ce) / 100) * 100, ce = Math.ceil(Math.max(Z, ie) / 100) * 100, $ = r.map((a, S) => ({
|
|
217
217
|
id: `stacked-${S}`,
|
|
218
218
|
guid: a.category_guid,
|
|
@@ -225,7 +225,7 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
225
225
|
type: "line",
|
|
226
226
|
highlightScope: { highlight: "item" },
|
|
227
227
|
valueFormatter: (I) => oe(I, "0,0")
|
|
228
|
-
})), te =
|
|
228
|
+
})), te = d.map((a, S) => ({
|
|
229
229
|
id: `unstacked-${S}`,
|
|
230
230
|
guid: a.category_guid,
|
|
231
231
|
top_level_guid: a.top_level_category_guid,
|
|
@@ -245,17 +245,17 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
245
245
|
top_level_guid: S
|
|
246
246
|
}))
|
|
247
247
|
], j = (a) => {
|
|
248
|
-
const I = a.startsWith("stacked-") ? r[parseInt(a.split("-")[1])] :
|
|
248
|
+
const I = a.startsWith("stacked-") ? r[parseInt(a.split("-")[1])] : d[parseInt(a.split("-")[1])];
|
|
249
249
|
return {
|
|
250
250
|
guid: I?.category_guid,
|
|
251
251
|
topLevelGuid: I?.top_level_category_guid
|
|
252
252
|
};
|
|
253
|
-
},
|
|
253
|
+
}, w = (a) => {
|
|
254
254
|
y(a), t?.(a ?? "");
|
|
255
255
|
}, V = (a) => {
|
|
256
256
|
n?.(a ?? "");
|
|
257
257
|
}, F = () => {
|
|
258
|
-
const a = j(String(
|
|
258
|
+
const a = j(String(D)).guid;
|
|
259
259
|
a && n?.(a);
|
|
260
260
|
}, le = (a) => {
|
|
261
261
|
const S = String(a?.seriesId), I = j(S).guid, Y = se.find((de) => de.id === S), De = Y && a?.dataIndex !== void 0, Ie = Y && a?.dataIndex === void 0;
|
|
@@ -317,7 +317,7 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
317
317
|
}, {})
|
|
318
318
|
};
|
|
319
319
|
return /* @__PURE__ */ e(
|
|
320
|
-
|
|
320
|
+
N,
|
|
321
321
|
{
|
|
322
322
|
onMouseMove: we,
|
|
323
323
|
ref: _,
|
|
@@ -340,7 +340,7 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
340
340
|
sx: { width: "100%", position: "relative" },
|
|
341
341
|
children: [
|
|
342
342
|
/* @__PURE__ */ e(
|
|
343
|
-
|
|
343
|
+
lt,
|
|
344
344
|
{
|
|
345
345
|
height: m,
|
|
346
346
|
margin: { bottom: 50 },
|
|
@@ -354,10 +354,10 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
354
354
|
}
|
|
355
355
|
},
|
|
356
356
|
slots: {
|
|
357
|
-
itemContent: (a) => E &&
|
|
357
|
+
itemContent: (a) => E && D ? /* @__PURE__ */ e(
|
|
358
358
|
no,
|
|
359
359
|
{
|
|
360
|
-
categoryGuids: j(
|
|
360
|
+
categoryGuids: j(D),
|
|
361
361
|
xData: B,
|
|
362
362
|
...a
|
|
363
363
|
}
|
|
@@ -391,17 +391,17 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
391
391
|
hoveredLegend: T,
|
|
392
392
|
legendRef: C,
|
|
393
393
|
onClickLegend: V,
|
|
394
|
-
onHoverLegend:
|
|
395
|
-
sx: { px:
|
|
394
|
+
onHoverLegend: w,
|
|
395
|
+
sx: { px: h ? 0 : 24 }
|
|
396
396
|
}
|
|
397
397
|
),
|
|
398
|
-
|
|
398
|
+
R && /* @__PURE__ */ e(
|
|
399
399
|
oo,
|
|
400
400
|
{
|
|
401
|
-
categoryGuids: j(
|
|
401
|
+
categoryGuids: j(D),
|
|
402
402
|
chartContainerRef: _,
|
|
403
403
|
cursorPosition: M,
|
|
404
|
-
hoveredAreaData:
|
|
404
|
+
hoveredAreaData: O.map((a) => ({
|
|
405
405
|
...a,
|
|
406
406
|
x: J(a.x, z.MONTH_SHORT_YEAR)
|
|
407
407
|
}))
|
|
@@ -412,7 +412,7 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
412
412
|
)
|
|
413
413
|
}
|
|
414
414
|
);
|
|
415
|
-
},
|
|
415
|
+
}, Qe = ({ selectedTab: o, onTabChange: s }) => /* @__PURE__ */ e(
|
|
416
416
|
Rt,
|
|
417
417
|
{
|
|
418
418
|
exclusive: !0,
|
|
@@ -421,8 +421,8 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
421
421
|
value: o,
|
|
422
422
|
children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(At, { color: "primary", sx: { width: 56 }, value: t, children: t === "Chart" ? /* @__PURE__ */ e(fe, { name: "table_chart_view" }) : /* @__PURE__ */ e(fe, { name: "format_list_bulleted" }) }, t))
|
|
423
423
|
}
|
|
424
|
-
),
|
|
425
|
-
const { trends: t } =
|
|
424
|
+
), Je = ({ selectedDateRange: o, selectedCategoryGuid: s }) => {
|
|
425
|
+
const { trends: t } = W(), { isMobile: n, isDesktop: r } = ee(), { getCategoryName: d } = U(), u = l.useMemo(() => {
|
|
426
426
|
const g = J(
|
|
427
427
|
o.start,
|
|
428
428
|
n ? z.MONTH_SHORT_YEAR : z.MONTH_YEAR
|
|
@@ -432,7 +432,7 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
432
432
|
);
|
|
433
433
|
return `${g} - ${c}`;
|
|
434
434
|
}, [o, n]);
|
|
435
|
-
return /* @__PURE__ */ f(
|
|
435
|
+
return /* @__PURE__ */ f(N, { sx: { mr: 10, minWidth: "60%" }, children: [
|
|
436
436
|
/* @__PURE__ */ e(
|
|
437
437
|
K,
|
|
438
438
|
{
|
|
@@ -444,19 +444,19 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
444
444
|
textOverflow: "unset"
|
|
445
445
|
},
|
|
446
446
|
variant: r ? "H3" : "Body",
|
|
447
|
-
children:
|
|
447
|
+
children: d(s) || t.sub_title
|
|
448
448
|
}
|
|
449
449
|
),
|
|
450
|
-
/* @__PURE__ */ e(K, { variant: r ? "Body" : "Small", children:
|
|
450
|
+
/* @__PURE__ */ e(K, { variant: r ? "Body" : "Small", children: u })
|
|
451
451
|
] });
|
|
452
452
|
}, ao = (o) => {
|
|
453
453
|
const s = o.row[o.field];
|
|
454
454
|
return /* @__PURE__ */ e(b, { alignItems: "flex-end", tabIndex: o.tabIndex, children: /* @__PURE__ */ e(Te, { amount: s, variant: "Small" }) });
|
|
455
455
|
}, io = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
456
|
-
const { getCategoryName: t } = U(), { categories: n } =
|
|
456
|
+
const { getCategoryName: t } = U(), { categories: n } = W(), r = n.default_categories[o]?.replace(/&/g, "&") ?? t(o);
|
|
457
457
|
return /* @__PURE__ */ f(b, { alignItems: "center", direction: "row", justifyContent: "center", children: [
|
|
458
458
|
/* @__PURE__ */ e(
|
|
459
|
-
|
|
459
|
+
N,
|
|
460
460
|
{
|
|
461
461
|
"aria-label": Fe(n.category_icon_label_aria, r),
|
|
462
462
|
role: "img",
|
|
@@ -478,17 +478,17 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
478
478
|
t.push(r), n.setMonth(n.getMonth() + 1);
|
|
479
479
|
}
|
|
480
480
|
return t;
|
|
481
|
-
},
|
|
481
|
+
}, et = ({
|
|
482
482
|
monthlyCategoryTotals: o,
|
|
483
483
|
selectedDateRange: s,
|
|
484
484
|
selectedCategory: t,
|
|
485
485
|
onClickRow: n,
|
|
486
486
|
height: r = "100dvh",
|
|
487
|
-
sx:
|
|
487
|
+
sx: d = {}
|
|
488
488
|
}) => {
|
|
489
|
-
const { onEvent:
|
|
489
|
+
const { onEvent: u } = P(), g = J(/* @__PURE__ */ new Date(), z.MONTH_SHORT), [c, h] = l.useState([
|
|
490
490
|
{ field: g, sort: "desc" }
|
|
491
|
-
]), C =
|
|
491
|
+
]), C = l.useMemo(() => lo(s.start, s.end), [s]), p = [
|
|
492
492
|
{
|
|
493
493
|
field: "category",
|
|
494
494
|
flex: 1,
|
|
@@ -515,43 +515,43 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
515
515
|
sortComparator: xt
|
|
516
516
|
})
|
|
517
517
|
)
|
|
518
|
-
], _ =
|
|
518
|
+
], _ = l.useMemo(() => {
|
|
519
519
|
const m = o.filter(
|
|
520
520
|
(y) => !wt(y) && !Dt(y)
|
|
521
521
|
), T = (t ? m.filter(
|
|
522
522
|
(y) => y.category_guid === t || y.top_level_category_guid === t
|
|
523
523
|
) : m).reduce(
|
|
524
524
|
(y, L) => {
|
|
525
|
-
const { category_guid: x, top_level_category_guid:
|
|
526
|
-
y[
|
|
527
|
-
id:
|
|
528
|
-
category:
|
|
525
|
+
const { category_guid: x, top_level_category_guid: D, month: O, total: A, year: M } = L, R = t ? x : D;
|
|
526
|
+
y[R] || (y[R] = {
|
|
527
|
+
id: R,
|
|
528
|
+
category: R,
|
|
529
529
|
category_guid: x,
|
|
530
|
-
top_level_category_guid:
|
|
530
|
+
top_level_category_guid: D
|
|
531
531
|
});
|
|
532
|
-
const E = J(new Date(M,
|
|
533
|
-
return y[
|
|
532
|
+
const E = J(new Date(M, O - 1), z.MONTH_SHORT);
|
|
533
|
+
return y[R][E] || (y[R][E] = 0), y[R][E] = y[R][E] + Math.abs(A), y;
|
|
534
534
|
},
|
|
535
535
|
{}
|
|
536
536
|
);
|
|
537
537
|
return Object.values(T);
|
|
538
538
|
}, [o, t]);
|
|
539
|
-
return /* @__PURE__ */ e(
|
|
539
|
+
return /* @__PURE__ */ e(N, { sx: { height: r, width: "100%", overflowX: "auto", boxShadow: "none", ...d }, children: /* @__PURE__ */ e(
|
|
540
540
|
kt,
|
|
541
541
|
{
|
|
542
|
-
columns:
|
|
542
|
+
columns: p,
|
|
543
543
|
disableColumnFilter: !0,
|
|
544
544
|
disableColumnMenu: !0,
|
|
545
545
|
hideFooter: !0,
|
|
546
546
|
initialState: { sorting: { sortModel: c } },
|
|
547
547
|
onRowClick: (m) => {
|
|
548
|
-
n?.(m.row.category),
|
|
548
|
+
n?.(m.row.category), u(v.TRENDS_CLICK_LIST_ITEM, {
|
|
549
549
|
...G,
|
|
550
550
|
listItem: St[m.row.category]
|
|
551
551
|
});
|
|
552
552
|
},
|
|
553
553
|
onSortModelChange: (m) => {
|
|
554
|
-
|
|
554
|
+
h(m), u(v.TRENDS_CLICK_TABLE_SORT, G);
|
|
555
555
|
},
|
|
556
556
|
rows: _,
|
|
557
557
|
slotProps: { baseIconButton: { color: "secondary", sx: { ml: 8 } } },
|
|
@@ -567,89 +567,89 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
567
567
|
isOpen: t,
|
|
568
568
|
onClose: n
|
|
569
569
|
}) => {
|
|
570
|
-
const { onEvent: r } = P(), { selectedAccountGuids:
|
|
571
|
-
() => c.find((m) => m.guid ===
|
|
572
|
-
[
|
|
570
|
+
const { onEvent: r } = P(), { selectedAccountGuids: d } = me(), { common: u } = W(), { setFilter: g, sortedTransactions: c } = xe(), [h, C] = l.useState(""), p = l.useMemo(
|
|
571
|
+
() => c.find((m) => m.guid === h),
|
|
572
|
+
[h, c]
|
|
573
573
|
);
|
|
574
|
-
|
|
574
|
+
l.useEffect(() => {
|
|
575
575
|
g({
|
|
576
|
-
accounts:
|
|
576
|
+
accounts: d,
|
|
577
577
|
dateRange: s,
|
|
578
578
|
custom: (m) => o === "" || o === m.category_guid || o === m.top_level_category_guid,
|
|
579
579
|
showSplits: !!o
|
|
580
580
|
});
|
|
581
|
-
}, [
|
|
581
|
+
}, [d, o, s]), l.useEffect(() => r(v.TRENDS_VIEW_TRANSACTIONS), []);
|
|
582
582
|
const _ = () => {
|
|
583
583
|
C(""), n();
|
|
584
584
|
};
|
|
585
585
|
return /* @__PURE__ */ f(
|
|
586
586
|
ke,
|
|
587
587
|
{
|
|
588
|
-
ariaLabelClose:
|
|
588
|
+
ariaLabelClose: u.close_aria,
|
|
589
589
|
isOpen: t,
|
|
590
590
|
onClose: _,
|
|
591
591
|
title: uo.title,
|
|
592
592
|
children: [
|
|
593
|
-
|
|
594
|
-
!
|
|
593
|
+
p && /* @__PURE__ */ e(Ue, { transaction: p }),
|
|
594
|
+
!p && /* @__PURE__ */ e(Xe, { onClick: C })
|
|
595
595
|
]
|
|
596
596
|
}
|
|
597
597
|
);
|
|
598
|
-
}, go =
|
|
599
|
-
const { onEvent: t } = P(), { isDesktop: n, isTablet: r, isMobile:
|
|
600
|
-
|
|
601
|
-
const
|
|
602
|
-
return window.addEventListener("resize",
|
|
603
|
-
}, []),
|
|
604
|
-
y(
|
|
605
|
-
}, [
|
|
598
|
+
}, go = k(ho), mo = ({ onBackClick: o, sx: s }) => {
|
|
599
|
+
const { onEvent: t } = P(), { isDesktop: n, isTablet: r, isMobile: d } = ee(), { visibleAccounts: u } = ve(), { loadMonthlyCategoryTotals: g, monthlyCategoryTotals: c, getCategoryName: h } = U(), { sortedTransactions: C } = xe(), { selectedDateRange: p, setSelectedDateRange: _ } = pe(), { isCopyLoaded: m, isInitialized: i, selectedAccounts: T, setSelectedAccounts: y } = me(), { trends: L } = W(), [x, D] = l.useState(!1), [O, A] = l.useState(!1), [M, R] = l.useState("Chart"), [E, X] = l.useState(""), [ne, B] = l.useState(window.innerHeight), ae = ne - (d ? 315 : 345);
|
|
600
|
+
l.useEffect(() => {
|
|
601
|
+
const w = () => B(window.innerHeight);
|
|
602
|
+
return window.addEventListener("resize", w), () => window.removeEventListener("resize", w);
|
|
603
|
+
}, []), l.useEffect(() => {
|
|
604
|
+
y(u);
|
|
605
|
+
}, [u]), l.useEffect(() => {
|
|
606
606
|
i && g(
|
|
607
607
|
T,
|
|
608
|
-
|
|
609
|
-
|
|
608
|
+
p.start,
|
|
609
|
+
p.end
|
|
610
610
|
).finally(() => {
|
|
611
|
-
|
|
611
|
+
D(!0);
|
|
612
612
|
});
|
|
613
|
-
}, [i, T,
|
|
614
|
-
const Z =
|
|
613
|
+
}, [i, T, p]);
|
|
614
|
+
const Z = l.useMemo(() => {
|
|
615
615
|
if (!x) return { stackedDatasets: [], unstackedDatasets: [] };
|
|
616
|
-
const
|
|
616
|
+
const w = vt(
|
|
617
617
|
c,
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
), V = E.length ?
|
|
618
|
+
p.start,
|
|
619
|
+
p.end
|
|
620
|
+
), V = E.length ? w.filter(
|
|
621
621
|
(F) => F.top_level_category_guid === E || F.category_guid === E
|
|
622
|
-
) : It(
|
|
622
|
+
) : It(w);
|
|
623
623
|
return {
|
|
624
624
|
stackedDatasets: V.filter(Et),
|
|
625
625
|
unstackedDatasets: V.filter(Lt)
|
|
626
626
|
};
|
|
627
|
-
}, [c, E,
|
|
628
|
-
|
|
629
|
-
}, q = (
|
|
630
|
-
const V = $e(
|
|
631
|
-
_({ start: V, end: F }), t(
|
|
627
|
+
}, [c, E, p]), ie = (w, V) => {
|
|
628
|
+
R(V ?? M), t(v.TRENDS_CLICK_TOGGLE_VIEW);
|
|
629
|
+
}, q = (w) => {
|
|
630
|
+
const V = $e(w?.[0], 1), F = w?.[1], le = Ae(F, V);
|
|
631
|
+
_({ start: V, end: F }), t(v.TRENDS_CLICK_TIME_WINDOW, {
|
|
632
632
|
time_period: le + "M"
|
|
633
633
|
});
|
|
634
634
|
}, ce = () => {
|
|
635
|
-
t(
|
|
636
|
-
}, $ = (
|
|
637
|
-
X(
|
|
638
|
-
}, te = (
|
|
639
|
-
X(
|
|
640
|
-
}, se = (
|
|
641
|
-
t(
|
|
642
|
-
}, re = (
|
|
643
|
-
t(
|
|
644
|
-
}, j = (
|
|
645
|
-
t(
|
|
635
|
+
t(v.TRENDS_CLICK_FILTER);
|
|
636
|
+
}, $ = (w) => {
|
|
637
|
+
X(w);
|
|
638
|
+
}, te = (w) => {
|
|
639
|
+
X(w), t(v.TRENDS_CLICK_LEGEND, { category: h(w) });
|
|
640
|
+
}, se = (w) => {
|
|
641
|
+
t(v.TRENDS_HOVER_LEGEND, { category: h(w) });
|
|
642
|
+
}, re = (w) => {
|
|
643
|
+
t(v.TRENDS_HOVER_AREA, { category: w });
|
|
644
|
+
}, j = (w) => {
|
|
645
|
+
t(v.TRENDS_HOVER_POINT, { category: w });
|
|
646
646
|
};
|
|
647
647
|
return !m || !i || !x ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ f(
|
|
648
|
-
|
|
648
|
+
Ye,
|
|
649
649
|
{
|
|
650
|
-
accountOptions:
|
|
650
|
+
accountOptions: u,
|
|
651
651
|
calendarActions: { onRangeChanged: q },
|
|
652
|
-
dateRange:
|
|
652
|
+
dateRange: p,
|
|
653
653
|
dateRangeVariant: "timeframebuttons",
|
|
654
654
|
onAccountsFilterClick: ce,
|
|
655
655
|
onBackClick: o,
|
|
@@ -669,27 +669,27 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
669
669
|
{
|
|
670
670
|
flexDirection: "row",
|
|
671
671
|
justifyContent: "space-between",
|
|
672
|
-
sx: { pb:
|
|
672
|
+
sx: { pb: d ? 12 : 24, pt: d ? 24 : 48 },
|
|
673
673
|
children: [
|
|
674
674
|
/* @__PURE__ */ e(
|
|
675
|
-
|
|
675
|
+
Je,
|
|
676
676
|
{
|
|
677
677
|
selectedCategoryGuid: E,
|
|
678
|
-
selectedDateRange:
|
|
678
|
+
selectedDateRange: p
|
|
679
679
|
}
|
|
680
680
|
),
|
|
681
|
-
/* @__PURE__ */ e(
|
|
681
|
+
/* @__PURE__ */ e(Qe, { onTabChange: ie, selectedTab: M })
|
|
682
682
|
]
|
|
683
683
|
}
|
|
684
684
|
),
|
|
685
685
|
/* @__PURE__ */ f(b, { alignItems: "center", flexDirection: "row", width: "100%", children: [
|
|
686
|
-
/* @__PURE__ */ e(
|
|
686
|
+
/* @__PURE__ */ e(N, { flexGrow: 1, children: E && /* @__PURE__ */ f(_e, { onClick: () => X(""), sx: { p: 0, pr: 5 }, children: [
|
|
687
687
|
/* @__PURE__ */ e(fe, { name: "arrow_back" }),
|
|
688
688
|
L.all_categories
|
|
689
689
|
] }) }),
|
|
690
|
-
/* @__PURE__ */ e(_e, { onClick: () =>
|
|
690
|
+
/* @__PURE__ */ e(_e, { onClick: () => A(!0), sx: { px: 5 }, children: `${L.view_transactions} (${C.length})` })
|
|
691
691
|
] }),
|
|
692
|
-
/* @__PURE__ */ f(
|
|
692
|
+
/* @__PURE__ */ f(N, { children: [
|
|
693
693
|
M === "Chart" && /* @__PURE__ */ e(
|
|
694
694
|
ro,
|
|
695
695
|
{
|
|
@@ -703,12 +703,12 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
703
703
|
}
|
|
704
704
|
),
|
|
705
705
|
M === "Table" && /* @__PURE__ */ e(
|
|
706
|
-
|
|
706
|
+
et,
|
|
707
707
|
{
|
|
708
708
|
monthlyCategoryTotals: c,
|
|
709
709
|
onClickRow: $,
|
|
710
710
|
selectedCategory: E,
|
|
711
|
-
selectedDateRange:
|
|
711
|
+
selectedDateRange: p
|
|
712
712
|
}
|
|
713
713
|
)
|
|
714
714
|
] })
|
|
@@ -719,16 +719,16 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
719
719
|
go,
|
|
720
720
|
{
|
|
721
721
|
categoryGuid: E,
|
|
722
|
-
dateRange:
|
|
723
|
-
isOpen:
|
|
724
|
-
onClose: () =>
|
|
722
|
+
dateRange: p,
|
|
723
|
+
isOpen: O,
|
|
724
|
+
onClose: () => A(!1)
|
|
725
725
|
}
|
|
726
726
|
)
|
|
727
727
|
]
|
|
728
728
|
}
|
|
729
729
|
);
|
|
730
|
-
}, Rn =
|
|
731
|
-
const o = be(), { monthlyCategoryTotals: s } = U(), { trends: t } =
|
|
730
|
+
}, Rn = k(mo), po = () => {
|
|
731
|
+
const o = be(), { monthlyCategoryTotals: s } = U(), { trends: t } = W(), n = Mt(s);
|
|
732
732
|
return /* @__PURE__ */ e(
|
|
733
733
|
Ne,
|
|
734
734
|
{
|
|
@@ -745,35 +745,35 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
745
745
|
valueFormatterString: "0,0"
|
|
746
746
|
}
|
|
747
747
|
);
|
|
748
|
-
}, Co =
|
|
749
|
-
const { visibleAccounts: t } = ve(), { loadMonthlyCategoryTotals: n, monthlyTotalsLoaded: r } = U(), { isInitialized:
|
|
750
|
-
return
|
|
751
|
-
|
|
752
|
-
}, [t]),
|
|
753
|
-
|
|
754
|
-
}, [
|
|
748
|
+
}, Co = k(po), yo = ({ onPrimaryCtaClick: o, sx: s }) => {
|
|
749
|
+
const { visibleAccounts: t } = ve(), { loadMonthlyCategoryTotals: n, monthlyTotalsLoaded: r } = U(), { isInitialized: d } = He(), { trends: u } = W(), { isCopyLoaded: g, selectedAccounts: c, setSelectedAccounts: h } = me();
|
|
750
|
+
return l.useEffect(() => {
|
|
751
|
+
h(t);
|
|
752
|
+
}, [t]), l.useEffect(() => {
|
|
753
|
+
d && n(c).finally();
|
|
754
|
+
}, [d, c]), !g || !d ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ e(
|
|
755
755
|
Nt,
|
|
756
756
|
{
|
|
757
757
|
onPrimaryCtaClick: o,
|
|
758
|
-
primaryCtaLabel:
|
|
759
|
-
subTitle:
|
|
758
|
+
primaryCtaLabel: u.primary_cta,
|
|
759
|
+
subTitle: u.sub_title,
|
|
760
760
|
sx: s,
|
|
761
|
-
title:
|
|
761
|
+
title: u.mini_title,
|
|
762
762
|
children: r ? /* @__PURE__ */ e(Co, {}) : /* @__PURE__ */ e(ge, {})
|
|
763
763
|
}
|
|
764
764
|
);
|
|
765
|
-
}, kn =
|
|
765
|
+
}, kn = k(yo), fo = 70, Be = ({
|
|
766
766
|
title: o,
|
|
767
767
|
totalAmount: s,
|
|
768
768
|
transactionType: t,
|
|
769
769
|
percentage: n,
|
|
770
770
|
secondaryLabel: r,
|
|
771
|
-
shouldDisplayPercentage:
|
|
771
|
+
shouldDisplayPercentage: d
|
|
772
772
|
}) => {
|
|
773
|
-
const { availableWidth:
|
|
773
|
+
const { availableWidth: u } = gt(), g = l.useRef(null), c = l.useRef(null), h = bt(Number(Math.abs(n)), {
|
|
774
774
|
style: "percent",
|
|
775
775
|
minimumIntegerDigits: 1
|
|
776
|
-
}), C =
|
|
776
|
+
}), C = u === 288 && oe(s, "0,0.00").length > 10 ? oe(s, "0,0") : oe(s, "0,0.00"), p = t === "spending" ? n > 0 : n >= 0, _ = t === "spending" ? "error.main" : "success.main", m = t === "spending" ? "success.main" : "text.secondary", i = g?.current, T = c?.current, y = i && T ? i.scrollWidth > T.clientWidth - fo : !1;
|
|
777
777
|
return /* @__PURE__ */ f(
|
|
778
778
|
b,
|
|
779
779
|
{
|
|
@@ -797,17 +797,17 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
797
797
|
},
|
|
798
798
|
children: [
|
|
799
799
|
/* @__PURE__ */ e(he, { color: "text.secondary", variant: "caption", children: o }),
|
|
800
|
-
|
|
801
|
-
|
|
800
|
+
d && /* @__PURE__ */ f(b, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
|
|
801
|
+
p ? /* @__PURE__ */ e(Ot, { size: 20, sx: { color: _ } }) : /* @__PURE__ */ e(Gt, { size: 20, sx: { color: m } }),
|
|
802
802
|
/* @__PURE__ */ e(
|
|
803
803
|
he,
|
|
804
804
|
{
|
|
805
805
|
sx: {
|
|
806
|
-
color:
|
|
806
|
+
color: p ? _ : m,
|
|
807
807
|
fontWeight: 600
|
|
808
808
|
},
|
|
809
809
|
variant: "body2",
|
|
810
|
-
children:
|
|
810
|
+
children: h
|
|
811
811
|
}
|
|
812
812
|
)
|
|
813
813
|
] })
|
|
@@ -825,17 +825,17 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
825
825
|
},
|
|
826
826
|
children: [
|
|
827
827
|
/* @__PURE__ */ e(
|
|
828
|
-
|
|
828
|
+
N,
|
|
829
829
|
{
|
|
830
830
|
ref: g,
|
|
831
831
|
sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
|
|
832
832
|
children: /* @__PURE__ */ e(Pe, { children: C })
|
|
833
833
|
}
|
|
834
834
|
),
|
|
835
|
-
|
|
835
|
+
d && u >= 450 && !y && /* @__PURE__ */ e(
|
|
836
836
|
he,
|
|
837
837
|
{
|
|
838
|
-
color:
|
|
838
|
+
color: p ? _ : m,
|
|
839
839
|
variant: "caption",
|
|
840
840
|
children: r
|
|
841
841
|
}
|
|
@@ -846,8 +846,8 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
846
846
|
]
|
|
847
847
|
}
|
|
848
848
|
);
|
|
849
|
-
}, _o =
|
|
850
|
-
const { trends: o } =
|
|
849
|
+
}, _o = k(() => {
|
|
850
|
+
const { trends: o } = W();
|
|
851
851
|
return /* @__PURE__ */ f(b, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
|
|
852
852
|
/* @__PURE__ */ e(Bt, { size: 32 }),
|
|
853
853
|
/* @__PURE__ */ f(b, { children: [
|
|
@@ -855,40 +855,40 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
855
855
|
/* @__PURE__ */ e(he, { color: "text.secondary", variant: "subtitle2", children: o.zero_state_content_description })
|
|
856
856
|
] })
|
|
857
857
|
] });
|
|
858
|
-
}), Hn =
|
|
859
|
-
const { visibleAccounts: s } = ve(), { onEvent: t } = P(), { monthlyCategoryTotals: n, loadMonthlyCategoryTotals: r, monthlyTotalsLoaded:
|
|
858
|
+
}), Hn = k(({ onCtaClick: o }) => {
|
|
859
|
+
const { visibleAccounts: s } = ve(), { onEvent: t } = P(), { monthlyCategoryTotals: n, loadMonthlyCategoryTotals: r, monthlyTotalsLoaded: d } = U(), u = {
|
|
860
860
|
start: Wt(/* @__PURE__ */ new Date(), 1),
|
|
861
861
|
end: /* @__PURE__ */ new Date()
|
|
862
|
-
}, { trends: g } =
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
}, [s]),
|
|
866
|
-
C && r(c,
|
|
867
|
-
t(
|
|
862
|
+
}, { trends: g } = W(), { selectedAccounts: c, setSelectedAccounts: h, isInitialized: C } = me();
|
|
863
|
+
l.useEffect(() => {
|
|
864
|
+
h(s);
|
|
865
|
+
}, [s]), l.useEffect(() => {
|
|
866
|
+
C && r(c, u.start).then(() => {
|
|
867
|
+
t(v.TRENDS_LOAD_WIDGET, {
|
|
868
868
|
state: s?.length ? "default" : "zeroState"
|
|
869
869
|
});
|
|
870
870
|
});
|
|
871
871
|
}, [C, c]);
|
|
872
|
-
const { spendingData:
|
|
872
|
+
const { spendingData: p, incomeData: _ } = l.useMemo(
|
|
873
873
|
() => ({
|
|
874
|
-
spendingData:
|
|
875
|
-
incomeData:
|
|
874
|
+
spendingData: Ke(n, u),
|
|
875
|
+
incomeData: je(n, u)
|
|
876
876
|
}),
|
|
877
|
-
[n,
|
|
878
|
-
), [m, i] =
|
|
877
|
+
[n, u]
|
|
878
|
+
), [m, i] = p, [T, y] = _, L = Oe(i.y, m.y), x = Oe(y.y, T.y), D = C && !s?.length, O = () => {
|
|
879
879
|
t(
|
|
880
|
-
|
|
880
|
+
D ? v.TRENDS_CLICK_GET_STARTED : v.TRENDS_CLICK_VIEW_MORE
|
|
881
881
|
), o();
|
|
882
882
|
};
|
|
883
|
-
return !
|
|
883
|
+
return !d || !C ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ e(
|
|
884
884
|
$t,
|
|
885
885
|
{
|
|
886
886
|
className: "mx-trends-microwidget",
|
|
887
887
|
ctaLabel: g.micro_primary_cta_label,
|
|
888
|
-
onCTAClick:
|
|
889
|
-
subHeader:
|
|
888
|
+
onCTAClick: O,
|
|
889
|
+
subHeader: D ? void 0 : g.micro_subheader,
|
|
890
890
|
title: g.title,
|
|
891
|
-
children:
|
|
891
|
+
children: D ? /* @__PURE__ */ e(_o, {}) : /* @__PURE__ */ f(
|
|
892
892
|
b,
|
|
893
893
|
{
|
|
894
894
|
sx: {
|
|
@@ -924,9 +924,9 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
924
924
|
)
|
|
925
925
|
}
|
|
926
926
|
);
|
|
927
|
-
}), To =
|
|
927
|
+
}), To = k(
|
|
928
928
|
({ isExpanded: o, onClick: s }) => {
|
|
929
|
-
const t =
|
|
929
|
+
const t = Ze();
|
|
930
930
|
return /* @__PURE__ */ e(Kt, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(jt, { onClick: s, sx: { justifyContent: "center" }, children: /* @__PURE__ */ f(
|
|
931
931
|
b,
|
|
932
932
|
{
|
|
@@ -946,49 +946,49 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
946
946
|
}
|
|
947
947
|
) }) });
|
|
948
948
|
}
|
|
949
|
-
), Ve =
|
|
949
|
+
), Ve = k(
|
|
950
950
|
({
|
|
951
951
|
totalAmount: o,
|
|
952
952
|
guid: s,
|
|
953
953
|
name: t,
|
|
954
954
|
transactions: n,
|
|
955
955
|
onClick: r,
|
|
956
|
-
isLastItem:
|
|
957
|
-
showDivider:
|
|
956
|
+
isLastItem: d = !1,
|
|
957
|
+
showDivider: u = !0
|
|
958
958
|
}) => {
|
|
959
|
-
const { trends: g } =
|
|
960
|
-
r?.(), c(
|
|
959
|
+
const { trends: g } = W(), { onEvent: c } = P(), h = `${n.length} ${n.length === 1 ? g.transaction : g.transactions}`, C = () => {
|
|
960
|
+
r?.(), c(v.TRENDS_CLICK_LIST_ITEM, {
|
|
961
961
|
...G,
|
|
962
962
|
listItem: t
|
|
963
963
|
});
|
|
964
964
|
};
|
|
965
|
-
return /* @__PURE__ */ f(
|
|
965
|
+
return /* @__PURE__ */ f(l.Fragment, { children: [
|
|
966
966
|
/* @__PURE__ */ e(
|
|
967
|
-
|
|
967
|
+
ze,
|
|
968
968
|
{
|
|
969
969
|
leftIcon: s ? /* @__PURE__ */ e(Se, { categoryGuid: s }) : void 0,
|
|
970
970
|
onClick: C,
|
|
971
971
|
rightContent: oe(Math.abs(o), "0,0.00"),
|
|
972
|
-
rightIcon: r ? /* @__PURE__ */ e(
|
|
973
|
-
subtitle:
|
|
972
|
+
rightIcon: r ? /* @__PURE__ */ e(ct, {}) : void 0,
|
|
973
|
+
subtitle: h,
|
|
974
974
|
title: t
|
|
975
975
|
}
|
|
976
976
|
),
|
|
977
|
-
|
|
977
|
+
u && /* @__PURE__ */ e(Re, { sx: { ml: d ? 24 : 68 } })
|
|
978
978
|
] }, s);
|
|
979
979
|
}
|
|
980
|
-
), So =
|
|
980
|
+
), So = k(
|
|
981
981
|
({ availableHeight: o = 0, onCategoryClick: s }) => {
|
|
982
|
-
const { collapsedCategories: t, visibleCategories: n, setVisibleListLength: r } = pe(), { isLargeDesktop:
|
|
983
|
-
|
|
982
|
+
const { collapsedCategories: t, visibleCategories: n, setVisibleListLength: r } = pe(), { isLargeDesktop: d, isDesktop: u } = ee(), { trends: g } = W(), { onEvent: c } = P(), [h, C] = l.useState(!1), p = u || d;
|
|
983
|
+
l.useEffect(() => {
|
|
984
984
|
const i = Math.floor(o / 64) - 1, T = n.length + t.length;
|
|
985
|
-
i !== n.length && (r(
|
|
985
|
+
i !== n.length && (r(p ? Math.max(i, 5) : 5), C(i >= T));
|
|
986
986
|
}, [o]);
|
|
987
987
|
const _ = () => {
|
|
988
|
-
C(!
|
|
988
|
+
C(!h), c(v.TRENDS_CLICK_VIEW_MORE, {
|
|
989
989
|
...G
|
|
990
990
|
});
|
|
991
|
-
}, m = n.length + (
|
|
991
|
+
}, m = n.length + (h ? t.length : 0);
|
|
992
992
|
return /* @__PURE__ */ e(b, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ f(zt, { children: [
|
|
993
993
|
/* @__PURE__ */ e(b, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(Pe, { children: g.categories }) }),
|
|
994
994
|
n.map((i, T) => /* @__PURE__ */ e(
|
|
@@ -1004,7 +1004,7 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1004
1004
|
/* @__PURE__ */ e(
|
|
1005
1005
|
Ft,
|
|
1006
1006
|
{
|
|
1007
|
-
in:
|
|
1007
|
+
in: h,
|
|
1008
1008
|
sx: { "&.MuiCollapse-root .MuiListItemButton-root": { paddingLeft: 24 } },
|
|
1009
1009
|
children: t.map((i, T) => {
|
|
1010
1010
|
const y = n.length + T;
|
|
@@ -1021,36 +1021,35 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1021
1021
|
})
|
|
1022
1022
|
}
|
|
1023
1023
|
),
|
|
1024
|
-
t.length > 0 && /* @__PURE__ */ e(To, { isExpanded:
|
|
1024
|
+
t.length > 0 && /* @__PURE__ */ e(To, { isExpanded: h, onClick: _ })
|
|
1025
1025
|
] }) });
|
|
1026
1026
|
}
|
|
1027
1027
|
), bo = ({ beats: o, onInsightCardClick: s }) => {
|
|
1028
|
-
const
|
|
1029
|
-
s?.(
|
|
1030
|
-
},
|
|
1031
|
-
return /* @__PURE__ */ e(Tt, { sx: { height:
|
|
1028
|
+
const { onEvent: t } = P(), { isMobile: n, isDesktop: r, isLargeDesktop: d } = ee(), { beatStore: u, endpoint: g, sessionToken: c } = He(), h = r || d, C = h || n ? 1 : 2, p = () => null, _ = (x) => {
|
|
1029
|
+
s?.(x), t(v.TRENDS_CLICK_INSIGHT, G);
|
|
1030
|
+
}, m = h ? 200 : 170, i = h ? 170 : 124, T = h ? 56 : 0, y = o.length > 0 ? m + T : i, L = h && o.length > 0 ? m : void 0;
|
|
1031
|
+
return /* @__PURE__ */ e(Tt, { sx: { height: y }, children: /* @__PURE__ */ e(
|
|
1032
1032
|
Ht,
|
|
1033
1033
|
{
|
|
1034
|
-
areBeatsLoading:
|
|
1034
|
+
areBeatsLoading: u.isLoading,
|
|
1035
1035
|
beats: o,
|
|
1036
|
-
endpoint:
|
|
1037
|
-
heightOverrides:
|
|
1038
|
-
logOutUser:
|
|
1039
|
-
onCardClick:
|
|
1036
|
+
endpoint: g,
|
|
1037
|
+
heightOverrides: L,
|
|
1038
|
+
logOutUser: p,
|
|
1039
|
+
onCardClick: _,
|
|
1040
1040
|
showBorder: !0,
|
|
1041
1041
|
showCTAColocatedWithText: !1,
|
|
1042
1042
|
showCarouselControls: !0,
|
|
1043
|
-
showHeader:
|
|
1043
|
+
showHeader: h,
|
|
1044
1044
|
showIcon: !0,
|
|
1045
1045
|
showWithMargin: !1,
|
|
1046
|
-
token:
|
|
1047
|
-
useDarkMode: C,
|
|
1046
|
+
token: c,
|
|
1048
1047
|
userHasFullInsightFeedBeats: !1,
|
|
1049
1048
|
variant: "outlined",
|
|
1050
|
-
visibleCardsCount:
|
|
1049
|
+
visibleCardsCount: C
|
|
1051
1050
|
}
|
|
1052
1051
|
) });
|
|
1053
|
-
}, xo =
|
|
1052
|
+
}, xo = k(bo), vo = k(({ chartLabel: o, chartColor: s }) => {
|
|
1054
1053
|
const { onEvent: t } = P(), {
|
|
1055
1054
|
categoryDetailsChartData: { monthlyAmounts: n, tooltipLabels: r }
|
|
1056
1055
|
} = pe();
|
|
@@ -1068,7 +1067,7 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1068
1067
|
stroke: s
|
|
1069
1068
|
}),
|
|
1070
1069
|
onItemClick: () => {
|
|
1071
|
-
t(
|
|
1070
|
+
t(v.TRENDS_CLICK_CHART, G);
|
|
1072
1071
|
},
|
|
1073
1072
|
showArea: !0,
|
|
1074
1073
|
showAverage: !0,
|
|
@@ -1083,49 +1082,49 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1083
1082
|
valueFormatterString: "0,0"
|
|
1084
1083
|
}
|
|
1085
1084
|
) });
|
|
1086
|
-
}), wo =
|
|
1087
|
-
const s =
|
|
1088
|
-
if (!
|
|
1085
|
+
}), wo = k(({ onClose: o }) => {
|
|
1086
|
+
const s = Ze(), { onEvent: t } = P(), { common: n, trends: r } = W(), { selectedCategoryData: d, selectedDateRangeMonthRange: u } = pe(), { sortedTransactions: g } = xe(), [c, h] = l.useState(null);
|
|
1087
|
+
if (!d)
|
|
1089
1088
|
return null;
|
|
1090
|
-
const { guid: C, name:
|
|
1091
|
-
() => g.find((
|
|
1089
|
+
const { guid: C, name: p, is_income: _, totalAmount: m } = d, i = _ ? r.category_income : r.category_spending, T = Zt(C, s), y = _ ? r.income_label : r.spending_label, L = ` ${d.transactions.length === 1 ? r.transaction : r.transactions} (${d.transactions.length})`, x = l.useMemo(
|
|
1090
|
+
() => g.find((A) => A.guid === c),
|
|
1092
1091
|
[c, g]
|
|
1093
|
-
),
|
|
1094
|
-
o?.(), t(
|
|
1092
|
+
), D = (A) => A.category_guid === C || A.top_level_category_guid === C, O = () => {
|
|
1093
|
+
o?.(), t(v.TRENDS_CLICK_BACK, G);
|
|
1095
1094
|
};
|
|
1096
1095
|
return /* @__PURE__ */ f(
|
|
1097
1096
|
ke,
|
|
1098
1097
|
{
|
|
1099
1098
|
ariaLabelClose: r.close_category_details,
|
|
1100
1099
|
isOpen: !0,
|
|
1101
|
-
onClose:
|
|
1100
|
+
onClose: O,
|
|
1102
1101
|
shouldShowHeaderShadow: !0,
|
|
1103
1102
|
title: i,
|
|
1104
1103
|
children: [
|
|
1105
1104
|
/* @__PURE__ */ f(b, { sx: { alignItems: "center", height: "100%" }, children: [
|
|
1106
1105
|
/* @__PURE__ */ f(Xt, { sx: { borderRadius: 0, pb: 4, pt: 16, width: "100%" }, children: [
|
|
1107
1106
|
/* @__PURE__ */ e(
|
|
1108
|
-
|
|
1107
|
+
ze,
|
|
1109
1108
|
{
|
|
1110
1109
|
leftIcon: /* @__PURE__ */ e(Se, { categoryGuid: C }),
|
|
1111
1110
|
rightContent: oe(Math.abs(m), "0,0.00"),
|
|
1112
|
-
subtitle:
|
|
1113
|
-
title:
|
|
1111
|
+
subtitle: u,
|
|
1112
|
+
title: p
|
|
1114
1113
|
}
|
|
1115
1114
|
),
|
|
1116
1115
|
/* @__PURE__ */ e(vo, { chartColor: T, chartLabel: y }),
|
|
1117
1116
|
/* @__PURE__ */ f(b, { alignItems: "center", direction: "row", justifyContent: "space-between", sx: { mx: 24 }, children: [
|
|
1118
1117
|
/* @__PURE__ */ e(K, { bold: !0, variant: "body1", children: L }),
|
|
1119
|
-
/* @__PURE__ */ e(qt, { filter:
|
|
1118
|
+
/* @__PURE__ */ e(qt, { filter: D })
|
|
1120
1119
|
] })
|
|
1121
1120
|
] }),
|
|
1122
1121
|
/* @__PURE__ */ e(
|
|
1123
|
-
|
|
1122
|
+
Xe,
|
|
1124
1123
|
{
|
|
1125
1124
|
bgcolor: "transparent",
|
|
1126
|
-
filter:
|
|
1125
|
+
filter: D,
|
|
1127
1126
|
height: "calc(100vh - 475px)",
|
|
1128
|
-
onClick:
|
|
1127
|
+
onClick: h
|
|
1129
1128
|
}
|
|
1130
1129
|
)
|
|
1131
1130
|
] }),
|
|
@@ -1134,49 +1133,49 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1134
1133
|
{
|
|
1135
1134
|
ariaLabelClose: n.close_aria,
|
|
1136
1135
|
isOpen: !!x,
|
|
1137
|
-
onClose: () =>
|
|
1136
|
+
onClose: () => h(""),
|
|
1138
1137
|
title: r.transaction,
|
|
1139
|
-
children: x && /* @__PURE__ */ e(
|
|
1138
|
+
children: x && /* @__PURE__ */ e(Ue, { transaction: x })
|
|
1140
1139
|
}
|
|
1141
1140
|
)
|
|
1142
1141
|
]
|
|
1143
1142
|
}
|
|
1144
1143
|
);
|
|
1145
1144
|
}), Do = (o, s) => {
|
|
1146
|
-
const t =
|
|
1145
|
+
const t = je(o, s), n = Ke(o, s);
|
|
1147
1146
|
return [t, n].filter((r) => r.length > 0);
|
|
1148
1147
|
}, Io = (o, s) => {
|
|
1149
|
-
const [t, n] = o, r = t,
|
|
1148
|
+
const [t, n] = o, r = t, d = n ?? t, u = [];
|
|
1150
1149
|
if (r) {
|
|
1151
|
-
const g = r.reduce((c,
|
|
1152
|
-
|
|
1150
|
+
const g = r.reduce((c, h) => c + h.y, 0);
|
|
1151
|
+
u.push({ label: s.income_label, amount: g });
|
|
1153
1152
|
}
|
|
1154
|
-
if (
|
|
1155
|
-
const g =
|
|
1156
|
-
|
|
1153
|
+
if (d) {
|
|
1154
|
+
const g = d.reduce((c, h) => c + h.y, 0);
|
|
1155
|
+
u.push({ label: s.spending_label, amount: g });
|
|
1157
1156
|
}
|
|
1158
|
-
return
|
|
1157
|
+
return u;
|
|
1159
1158
|
}, Eo = ({
|
|
1160
1159
|
availableHeight: o = 0,
|
|
1161
1160
|
minHeight: s = 500,
|
|
1162
1161
|
selectedDateRange: t,
|
|
1163
1162
|
totals: n
|
|
1164
1163
|
}) => {
|
|
1165
|
-
const r = be(), { onEvent:
|
|
1166
|
-
return
|
|
1167
|
-
const
|
|
1168
|
-
T(
|
|
1164
|
+
const r = be(), { onEvent: d } = P(), { trends: u } = W(), { isSmallMobile: g, isMobile: c, isSmallTablet: h, isTablet: C } = ee(), p = [r.palette.chart?.chart1, r.palette.chart?.chart2], _ = Do(n, t), m = Io(_, u), [i, T] = l.useState(0), y = 458, L = 195, x = 56, D = c || g ? L : h || C ? y : i;
|
|
1165
|
+
return l.useEffect(() => {
|
|
1166
|
+
const A = Math.max(o - x, s);
|
|
1167
|
+
T(A);
|
|
1169
1168
|
}, [o]), /* @__PURE__ */ e(
|
|
1170
1169
|
Ne,
|
|
1171
1170
|
{
|
|
1172
1171
|
baseline: "min",
|
|
1173
|
-
colors:
|
|
1172
|
+
colors: p,
|
|
1174
1173
|
curveType: "bump",
|
|
1175
1174
|
datasets: _,
|
|
1176
|
-
height:
|
|
1175
|
+
height: D,
|
|
1177
1176
|
labels: m,
|
|
1178
1177
|
onItemClick: () => {
|
|
1179
|
-
|
|
1178
|
+
d(v.TRENDS_CLICK_CHART, G);
|
|
1180
1179
|
},
|
|
1181
1180
|
showArea: !0,
|
|
1182
1181
|
showAxisHighlight: !0,
|
|
@@ -1189,7 +1188,7 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1189
1188
|
valueFormatterString: "0.0a"
|
|
1190
1189
|
}
|
|
1191
1190
|
);
|
|
1192
|
-
}, Lo =
|
|
1191
|
+
}, Lo = k(Eo), Mo = [
|
|
1193
1192
|
"BillAmountNotStandard",
|
|
1194
1193
|
"CategorySpendingV2",
|
|
1195
1194
|
"CostOfLivingToIncome",
|
|
@@ -1224,83 +1223,83 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1224
1223
|
"WeeklyNoSpendDays",
|
|
1225
1224
|
"WeeklySmallPurchasesSummary"
|
|
1226
1225
|
], Ao = ({ onBackClick: o, onInsightCardClick: s, sx: t }) => {
|
|
1227
|
-
const { onEvent: n } = P(), { onLoad: r } =
|
|
1226
|
+
const { onEvent: n } = P(), { onLoad: r } = mt(), { config: d } = pt(), { isLargeDesktop: u, isDesktop: g, isMobile: c } = ee(), { visibleAccounts: h } = ve(), { loadDateRangeCategoryTotals: C, loadMonthlyCategoryTotals: p, monthlyCategoryTotals: _ } = U(), { setFilter: m } = xe(), { selectedDateRange: i, setSelectedCategoryData: T, setSelectedDateRange: y } = pe(), {
|
|
1228
1227
|
isCopyLoaded: L,
|
|
1229
1228
|
isInitialized: x,
|
|
1230
|
-
selectedAccounts:
|
|
1231
|
-
selectedAccountGuids:
|
|
1232
|
-
setSelectedAccounts:
|
|
1233
|
-
} = me(), { trends: M, connect:
|
|
1234
|
-
() =>
|
|
1235
|
-
[
|
|
1229
|
+
selectedAccounts: D,
|
|
1230
|
+
selectedAccountGuids: O,
|
|
1231
|
+
setSelectedAccounts: A
|
|
1232
|
+
} = me(), { trends: M, connect: R } = W(), { beatStore: E } = He(), ne = Qt() && d.show_insights_widget_in_master, B = g || u, [Ce, ae] = l.useState(!1), [Z, ie] = l.useState(!1), [q, ce] = l.useState("Chart"), [$, te] = l.useState(""), [se, re] = l.useState(!1), [j, w] = l.useState(window.innerHeight), V = B ? 56 : 0, F = j - 208, le = j - (ne ? 550 + V : 266), [we, ye] = l.useState(!1), a = d.show_connections_widget_in_master ? "buttons" : "no-buttons", S = l.useMemo(
|
|
1233
|
+
() => h && h.length === 0 || _.length === 0,
|
|
1234
|
+
[h, _]
|
|
1236
1235
|
);
|
|
1237
|
-
|
|
1236
|
+
l.useEffect(() => {
|
|
1238
1237
|
x && E.loadBeats().finally(() => ie(!0));
|
|
1239
1238
|
}, [x]);
|
|
1240
|
-
const I =
|
|
1241
|
-
|
|
1242
|
-
const
|
|
1243
|
-
return window.addEventListener("resize",
|
|
1244
|
-
}, []),
|
|
1245
|
-
|
|
1246
|
-
}, [
|
|
1247
|
-
x && C(
|
|
1248
|
-
|
|
1249
|
-
|
|
1239
|
+
const I = l.useMemo(() => Z ? E.getFilteredBeats({ templates: Mo }) : [], [Z]);
|
|
1240
|
+
l.useEffect(() => {
|
|
1241
|
+
const H = () => w(window.innerHeight);
|
|
1242
|
+
return window.addEventListener("resize", H), () => window.removeEventListener("resize", H);
|
|
1243
|
+
}, []), l.useEffect(() => {
|
|
1244
|
+
A(h);
|
|
1245
|
+
}, [h]), l.useEffect(() => {
|
|
1246
|
+
x && C(D, i.start, i.end).then(() => {
|
|
1247
|
+
p(
|
|
1248
|
+
D,
|
|
1250
1249
|
i.start,
|
|
1251
1250
|
i.end
|
|
1252
1251
|
);
|
|
1253
1252
|
}).finally(() => {
|
|
1254
|
-
ae(!0), n(
|
|
1253
|
+
ae(!0), n(v.TRENDS_LOAD_WIDGET, {
|
|
1255
1254
|
...G,
|
|
1256
1255
|
time_period: `${Ae(i.end, i.start)}M`
|
|
1257
1256
|
}), r?.("TrendsWidget");
|
|
1258
1257
|
});
|
|
1259
|
-
}, [x,
|
|
1258
|
+
}, [x, D, i]), l.useEffect(() => {
|
|
1260
1259
|
if (_.length !== 0) {
|
|
1261
|
-
const
|
|
1262
|
-
accounts:
|
|
1260
|
+
const H = {
|
|
1261
|
+
accounts: O,
|
|
1263
1262
|
dateRange: { start: i.start, end: i.end }
|
|
1264
1263
|
};
|
|
1265
1264
|
m({
|
|
1266
|
-
...
|
|
1265
|
+
...H,
|
|
1267
1266
|
custom: (Q) => !!_.find(
|
|
1268
1267
|
(ue) => ue.top_level_category_guid === Q.top_level_category_guid || ue.category_guid === Q.category_guid
|
|
1269
1268
|
)
|
|
1270
1269
|
});
|
|
1271
1270
|
}
|
|
1272
1271
|
}, [_]);
|
|
1273
|
-
const Y = (
|
|
1274
|
-
T(
|
|
1272
|
+
const Y = (H) => {
|
|
1273
|
+
T(H), re(!0);
|
|
1275
1274
|
}, De = () => {
|
|
1276
1275
|
T(null), re(!1);
|
|
1277
1276
|
}, Ie = () => {
|
|
1278
|
-
ye(!0), n(
|
|
1279
|
-
}, de = (
|
|
1280
|
-
ce(Q ?? q), n(
|
|
1277
|
+
ye(!0), n(v.TRENDS_CLICK_CONNECT_ACCOUNTS);
|
|
1278
|
+
}, de = (H, Q) => {
|
|
1279
|
+
ce(Q ?? q), n(v.TRENDS_CLICK_TOGGLE_VIEW, {
|
|
1281
1280
|
...G,
|
|
1282
1281
|
toggleView: Q
|
|
1283
1282
|
});
|
|
1284
|
-
}, Ee = (
|
|
1285
|
-
const Q = $e(
|
|
1286
|
-
y({ start: Q, end: ue }), n(
|
|
1283
|
+
}, Ee = (H) => {
|
|
1284
|
+
const Q = $e(H?.[0], 1), ue = H?.[1], nt = Ae(ue, Q);
|
|
1285
|
+
y({ start: Q, end: ue }), n(v.TRENDS_CLICK_TIME_WINDOW, {
|
|
1287
1286
|
...G,
|
|
1288
|
-
time_period:
|
|
1287
|
+
time_period: nt + "M"
|
|
1289
1288
|
});
|
|
1290
|
-
}, Le = (
|
|
1291
|
-
n(
|
|
1289
|
+
}, Le = (H) => {
|
|
1290
|
+
n(v.TRENDS_CLICK_FILTER, {
|
|
1292
1291
|
...G,
|
|
1293
|
-
filterValue:
|
|
1292
|
+
filterValue: H
|
|
1294
1293
|
});
|
|
1295
|
-
},
|
|
1296
|
-
te(
|
|
1297
|
-
},
|
|
1298
|
-
te(""), n(
|
|
1294
|
+
}, tt = (H) => {
|
|
1295
|
+
te(H);
|
|
1296
|
+
}, ot = () => {
|
|
1297
|
+
te(""), n(v.TRENDS_CLICK_ALL_CATEGORIES, G);
|
|
1299
1298
|
};
|
|
1300
1299
|
return !L || !Ce ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ f(
|
|
1301
|
-
|
|
1300
|
+
Ye,
|
|
1302
1301
|
{
|
|
1303
|
-
accountOptions:
|
|
1302
|
+
accountOptions: h,
|
|
1304
1303
|
calendarActions: { onRangeChanged: Ee },
|
|
1305
1304
|
dateRange: i,
|
|
1306
1305
|
dateRangeVariant: c ? "timeframetabs" : "timeframebuttons",
|
|
@@ -1336,23 +1335,23 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1336
1335
|
sx: { pb: c ? 12 : 24, pt: c ? 24 : 48 },
|
|
1337
1336
|
children: [
|
|
1338
1337
|
/* @__PURE__ */ e(
|
|
1339
|
-
|
|
1338
|
+
Je,
|
|
1340
1339
|
{
|
|
1341
1340
|
selectedCategoryGuid: $,
|
|
1342
1341
|
selectedDateRange: i
|
|
1343
1342
|
}
|
|
1344
1343
|
),
|
|
1345
|
-
/* @__PURE__ */ e(
|
|
1344
|
+
/* @__PURE__ */ e(Qe, { onTabChange: de, selectedTab: q })
|
|
1346
1345
|
]
|
|
1347
1346
|
}
|
|
1348
1347
|
),
|
|
1349
|
-
/* @__PURE__ */ e(b, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(
|
|
1348
|
+
/* @__PURE__ */ e(b, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(N, { flexGrow: 1, children: $ && /* @__PURE__ */ f(_e, { onClick: ot, sx: { p: 0, pr: 5 }, children: [
|
|
1350
1349
|
/* @__PURE__ */ e(fe, { name: "arrow_back" }),
|
|
1351
1350
|
M.all_categories
|
|
1352
1351
|
] }) }) }),
|
|
1353
1352
|
/* @__PURE__ */ f(b, { flexDirection: B ? "row" : "column", gap: B ? 48 : 16, children: [
|
|
1354
|
-
q === "Chart" && /* @__PURE__ */ f(
|
|
1355
|
-
/* @__PURE__ */ e(
|
|
1353
|
+
q === "Chart" && /* @__PURE__ */ f(st, { children: [
|
|
1354
|
+
/* @__PURE__ */ e(N, { sx: { width: B ? "68%" : "100%" }, children: /* @__PURE__ */ e(
|
|
1356
1355
|
Lo,
|
|
1357
1356
|
{
|
|
1358
1357
|
availableHeight: F,
|
|
@@ -1378,12 +1377,12 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1378
1377
|
)
|
|
1379
1378
|
] })
|
|
1380
1379
|
] }),
|
|
1381
|
-
q === "Table" && /* @__PURE__ */ e(
|
|
1382
|
-
|
|
1380
|
+
q === "Table" && /* @__PURE__ */ e(N, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
|
|
1381
|
+
et,
|
|
1383
1382
|
{
|
|
1384
1383
|
height: "unset",
|
|
1385
1384
|
monthlyCategoryTotals: _,
|
|
1386
|
-
onClickRow:
|
|
1385
|
+
onClickRow: tt,
|
|
1387
1386
|
selectedCategory: $,
|
|
1388
1387
|
selectedDateRange: i
|
|
1389
1388
|
}
|
|
@@ -1398,13 +1397,13 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
|
1398
1397
|
{
|
|
1399
1398
|
onClose: () => ye(!1),
|
|
1400
1399
|
showConnectWidget: we,
|
|
1401
|
-
title:
|
|
1400
|
+
title: R.mini_title
|
|
1402
1401
|
}
|
|
1403
1402
|
)
|
|
1404
1403
|
]
|
|
1405
1404
|
}
|
|
1406
1405
|
);
|
|
1407
|
-
}, Nn =
|
|
1406
|
+
}, Nn = k(Ao);
|
|
1408
1407
|
export {
|
|
1409
1408
|
Rn as TrendsFullWidget,
|
|
1410
1409
|
Hn as TrendsMicroWidget,
|