@mx-cartographer/experiences 7.0.23-alpha.al14 → 7.0.23-alpha.al15
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.
|
@@ -42,7 +42,7 @@ class N {
|
|
|
42
42
|
accounts: t,
|
|
43
43
|
institutions: e
|
|
44
44
|
} = {}) => {
|
|
45
|
-
await Promise.all([this.loadAccounts(t), this.loadInstitutions(e)]);
|
|
45
|
+
console.log("inside account store load account data"), await Promise.all([this.loadAccounts(t), this.loadInstitutions(e)]);
|
|
46
46
|
};
|
|
47
47
|
get cashAccounts() {
|
|
48
48
|
return this.accounts.filter(
|
|
@@ -118,22 +118,22 @@ class N {
|
|
|
118
118
|
n,
|
|
119
119
|
"MD_EXCLUDE_EXTERNAL_ACCOUNTS"
|
|
120
120
|
);
|
|
121
|
-
for (const
|
|
122
|
-
if (c &&
|
|
123
|
-
const
|
|
124
|
-
if (!
|
|
121
|
+
for (const o of t) {
|
|
122
|
+
if (c && o.member_is_managed_by_user) continue;
|
|
123
|
+
const r = this.members.find((m) => m.guid === o.member_guid);
|
|
124
|
+
if (!r) continue;
|
|
125
125
|
let u = h.Connected;
|
|
126
|
-
p.includes(
|
|
126
|
+
p.includes(r.connection_status) ? u = h.Error : y.includes(r.connection_status) ? u = h.Processing : I.includes(r.connection_status) && (u = h.RequiresMfa);
|
|
127
127
|
const A = [
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
o.user_name || o.feed_name || "",
|
|
129
|
+
o.account_number ? `*${o.account_number}` : ""
|
|
130
130
|
].join(" ").trim();
|
|
131
131
|
e.push({
|
|
132
|
-
...
|
|
132
|
+
...o,
|
|
133
133
|
connectionStatus: u,
|
|
134
134
|
institutionName: A,
|
|
135
|
-
memberName:
|
|
136
|
-
}),
|
|
135
|
+
memberName: r.name
|
|
136
|
+
}), r.connectionStatus = u;
|
|
137
137
|
}
|
|
138
138
|
return e;
|
|
139
139
|
};
|
|
@@ -172,10 +172,10 @@ class N {
|
|
|
172
172
|
try {
|
|
173
173
|
const e = await this.api.mergeAccounts(t), n = e[Object.keys(e)[0]];
|
|
174
174
|
a(() => {
|
|
175
|
-
const c = this.accounts.findIndex((
|
|
175
|
+
const c = this.accounts.findIndex((r) => r.guid === t[1]);
|
|
176
176
|
this.accounts.splice(c, 1);
|
|
177
|
-
const
|
|
178
|
-
this.accounts.splice(
|
|
177
|
+
const o = this.accounts.findIndex((r) => r.guid === t[0]);
|
|
178
|
+
this.accounts.splice(o, 1, n);
|
|
179
179
|
});
|
|
180
180
|
} catch (e) {
|
|
181
181
|
console.error(`Error occurred while merging accounts: ${e}`);
|
|
@@ -217,13 +217,13 @@ class N {
|
|
|
217
217
|
};
|
|
218
218
|
updateAccountFiltering = async (t, e) => {
|
|
219
219
|
for (const n of t) {
|
|
220
|
-
const c = this.accounts.find((
|
|
220
|
+
const c = this.accounts.find((o) => o.guid === n);
|
|
221
221
|
if (c) {
|
|
222
222
|
c.is_excluded_from_accounts = e, c.is_excluded_from_budgets = e, c.is_excluded_from_cash_flow = e, c.is_excluded_from_debts = e, c.is_excluded_from_goals = e, c.is_excluded_from_investments = e, c.is_excluded_from_net_worth = e, c.is_excluded_from_spending = e, c.is_excluded_from_transactions = e, c.is_excluded_from_trends = e;
|
|
223
223
|
try {
|
|
224
224
|
this.updateAccount(c);
|
|
225
|
-
} catch (
|
|
226
|
-
console.error(`Failed to update account ${n} (added):`,
|
|
225
|
+
} catch (o) {
|
|
226
|
+
console.error(`Failed to update account ${n} (added):`, o);
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
}
|
|
@@ -24,7 +24,7 @@ import X from "@mui/material/ListItem";
|
|
|
24
24
|
import { M as U } from "../MiniWidgetContainer-CTyjmE1h.mjs";
|
|
25
25
|
import e1 from "@mui/material/Stack";
|
|
26
26
|
import { g as U1, a as j1 } from "../AccountFields-CIz-r3gP.mjs";
|
|
27
|
-
import { A as G1, a as K1 } from "../AccountStore-
|
|
27
|
+
import { A as G1, a as K1 } from "../AccountStore-DPcxg9Kh.mjs";
|
|
28
28
|
const t1 = () => {
|
|
29
29
|
const [c, L] = d.useState(""), { accounts: o } = g(), { selectedAccounts: l } = y(), { setSelectedAccount: u, setSelectedMember: r } = K(), { members: s } = O(), { onEvent: p } = N(), a = [...new Set(l.map((t) => t.account_type))], H = l.find((t) => c === t.guid), h = d.useMemo(
|
|
30
30
|
() => l.filter((t) => t.is_hidden),
|
package/dist/common/index.es.js
CHANGED
|
@@ -53,7 +53,7 @@ import { S as hr, T as gr } from "../RecurringTransactionsStore-D62XJtdL.mjs";
|
|
|
53
53
|
import { G as mr, A as _r, B as yr, W as fr, c as Sr, m as br, g as wr, t as xr, k as Cr, x as Dr, e as vr, w as Ar, u as Er, l as Tr, a as Br, j as Ir, y as Nr, s as Fr, b as Mr, q as $r, n as Rr, z as Ur, h as kr, r as Lr, f as Or, v as Gr, o as Hr, p as Pr } from "../hooks-DkUqN6JE.mjs";
|
|
54
54
|
import { u as Wr } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
55
55
|
import { makeAutoObservable as m, runInAction as p, reaction as _t } from "mobx";
|
|
56
|
-
import { a as yt } from "../AccountStore-
|
|
56
|
+
import { a as yt } from "../AccountStore-DPcxg9Kh.mjs";
|
|
57
57
|
import ft from "posthog-js";
|
|
58
58
|
import { B as St } from "../BeatStore-By4aGoRM.mjs";
|
|
59
59
|
import { endOfMonth as Z } from "date-fns/endOfMonth";
|
|
@@ -1240,12 +1240,12 @@ class Ve {
|
|
|
1240
1240
|
transactions: i,
|
|
1241
1241
|
userFeatures: n
|
|
1242
1242
|
} = {}) => {
|
|
1243
|
-
await Promise.all([
|
|
1243
|
+
console.log("🔄 GlobalStore: Starting loadData"), await Promise.all([
|
|
1244
1244
|
// Load copy, config and quser data
|
|
1245
1245
|
this.copyStore.loadCopy(),
|
|
1246
1246
|
this.appDataStore.loadAppData(e),
|
|
1247
1247
|
this.userStore.loadUserFeatures(n)
|
|
1248
|
-
]), await Promise.all([
|
|
1248
|
+
]), console.log("✅ GlobalStore: Phase 1 complete (copy, config, user)"), await Promise.all([
|
|
1249
1249
|
this.accountStore.loadAccountData({ accounts: t, institutions: o }),
|
|
1250
1250
|
this.categoryStore.loadCategories(r),
|
|
1251
1251
|
this.transactionStore.loadTransactionData({
|
|
@@ -1253,7 +1253,7 @@ class Ve {
|
|
|
1253
1253
|
transactionRules: d,
|
|
1254
1254
|
transactions: i
|
|
1255
1255
|
})
|
|
1256
|
-
]), this.globalUiStore.setInitialized(!0);
|
|
1256
|
+
]), console.log("✅ GlobalStore: Phase 2 complete"), this.globalUiStore.setInitialized(!0), console.log("✅ GlobalStore: Fully initialized");
|
|
1257
1257
|
};
|
|
1258
1258
|
}
|
|
1259
1259
|
export {
|
package/dist/trends/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as f, Fragment as Pe } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import i from "react";
|
|
3
3
|
import { observer as M } from "mobx-react-lite";
|
|
4
4
|
import { Icon as re, Text as X, CategoryIcon as Te, P as Y, H3 as De, ChevronRightIcon as Ke } from "@mxenabled/mxui";
|
|
5
5
|
import O from "@mui/material/Box";
|
|
@@ -12,11 +12,11 @@ import { T as to } from "../TrendsStore-WrHxzdbQ.mjs";
|
|
|
12
12
|
import { i as Xe, c as Ze, d as Qe, e as qe, f as Je, h as et, b as Le, g as xe, j as _e } from "../SpendingData-D5vsfYKo.mjs";
|
|
13
13
|
import tt from "@mui/material/ToggleButton";
|
|
14
14
|
import nt from "@mui/material/ToggleButtonGroup";
|
|
15
|
-
import { u as R, k as F, e as H, a as P, f as
|
|
15
|
+
import { u as R, k as F, e as H, a as P, f as ae, c as ie, v as q, l as ve, p as ot, m as st } from "../hooks-DkUqN6JE.mjs";
|
|
16
16
|
import { u as K } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
17
17
|
import { f as Z, D as B } from "../Dialog-CWW597AF.mjs";
|
|
18
|
-
import { DataGridPro as
|
|
19
|
-
import { C as
|
|
18
|
+
import { DataGridPro as rt } from "@mui/x-data-grid-pro";
|
|
19
|
+
import { C as at } from "../CurrencyText-YUhH2caW.mjs";
|
|
20
20
|
import { c as Me } from "../Category-CevNQ03n.mjs";
|
|
21
21
|
import { b as it } from "../Localization-2MODESHW.mjs";
|
|
22
22
|
import { H as be } from "../HeaderCell-DjuifqHJ.mjs";
|
|
@@ -55,15 +55,15 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
55
55
|
children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(tt, { color: "primary", sx: { width: 56 }, value: t, children: t === "Chart" ? /* @__PURE__ */ e(re, { name: "table_chart_view" }) : /* @__PURE__ */ e(re, { name: "format_list_bulleted" }) }, t))
|
|
56
56
|
}
|
|
57
57
|
), Oe = ({ selectedDateRange: n, selectedCategoryGuid: o }) => {
|
|
58
|
-
const { trends: t } = R(), { isMobile: s, isDesktop:
|
|
59
|
-
const
|
|
58
|
+
const { trends: t } = R(), { isMobile: s, isDesktop: a } = K(), { getCategoryName: h } = F(), l = i.useMemo(() => {
|
|
59
|
+
const c = Z(
|
|
60
60
|
n.start,
|
|
61
61
|
s ? B.MONTH_SHORT_YEAR : B.MONTH_YEAR
|
|
62
|
-
),
|
|
62
|
+
), d = Z(
|
|
63
63
|
n.end,
|
|
64
64
|
s ? B.MONTH_SHORT_YEAR : B.MONTH_YEAR
|
|
65
65
|
);
|
|
66
|
-
return `${
|
|
66
|
+
return `${c} - ${d}`;
|
|
67
67
|
}, [n, s]);
|
|
68
68
|
return /* @__PURE__ */ f(O, { sx: { mr: 10, minWidth: "60%" }, children: [
|
|
69
69
|
/* @__PURE__ */ e(
|
|
@@ -76,15 +76,15 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
76
76
|
overflow: "visible",
|
|
77
77
|
textOverflow: "unset"
|
|
78
78
|
},
|
|
79
|
-
variant:
|
|
79
|
+
variant: a ? "H3" : "Body",
|
|
80
80
|
children: h(o) || t.sub_title
|
|
81
81
|
}
|
|
82
82
|
),
|
|
83
|
-
/* @__PURE__ */ e(X, { variant:
|
|
83
|
+
/* @__PURE__ */ e(X, { variant: a ? "Body" : "Small", children: l })
|
|
84
84
|
] });
|
|
85
85
|
}, At = (n) => {
|
|
86
86
|
const o = n.row[n.field];
|
|
87
|
-
return /* @__PURE__ */ e(_, { alignItems: "flex-end", tabIndex: n.tabIndex, children: /* @__PURE__ */ e(
|
|
87
|
+
return /* @__PURE__ */ e(_, { alignItems: "flex-end", tabIndex: n.tabIndex, children: /* @__PURE__ */ e(at, { amount: o, variant: "Small" }) });
|
|
88
88
|
}, Rt = ({ categoryGuid: n, topLevelCategoryGuid: o }) => {
|
|
89
89
|
const { categories: t } = R(), s = t.default_categories[n]?.replace(/&/g, "&") ?? Me[n];
|
|
90
90
|
return /* @__PURE__ */ f(_, { alignItems: "center", direction: "row", justifyContent: "center", children: [
|
|
@@ -107,8 +107,8 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
107
107
|
) }), Ht = (n, o) => {
|
|
108
108
|
const t = [], s = new Date(n);
|
|
109
109
|
for (; s <= o; ) {
|
|
110
|
-
const
|
|
111
|
-
t.push(
|
|
110
|
+
const a = Z(s, B.MONTH);
|
|
111
|
+
t.push(a), s.setMonth(s.getMonth() + 1);
|
|
112
112
|
}
|
|
113
113
|
return t;
|
|
114
114
|
}, Ve = ({
|
|
@@ -116,12 +116,12 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
116
116
|
selectedDateRange: o,
|
|
117
117
|
selectedCategory: t,
|
|
118
118
|
onClickRow: s,
|
|
119
|
-
height:
|
|
119
|
+
height: a = "100dvh",
|
|
120
120
|
sx: h = {}
|
|
121
121
|
}) => {
|
|
122
|
-
const { onEvent:
|
|
123
|
-
{ field:
|
|
124
|
-
]), C =
|
|
122
|
+
const { onEvent: l } = H(), c = Z(/* @__PURE__ */ new Date(), B.MONTH_SHORT), [d, m] = i.useState([
|
|
123
|
+
{ field: c, sort: "desc" }
|
|
124
|
+
]), C = i.useMemo(() => Ht(o.start, o.end), [o]), u = [
|
|
125
125
|
{
|
|
126
126
|
field: "category",
|
|
127
127
|
flex: 1,
|
|
@@ -133,10 +133,10 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
133
133
|
type: "string"
|
|
134
134
|
},
|
|
135
135
|
...C.map(
|
|
136
|
-
(
|
|
137
|
-
field:
|
|
136
|
+
(r) => ({
|
|
137
|
+
field: r,
|
|
138
138
|
flex: 1,
|
|
139
|
-
headerName:
|
|
139
|
+
headerName: r,
|
|
140
140
|
minWidth: 100,
|
|
141
141
|
renderHeader: be,
|
|
142
142
|
renderCell: At,
|
|
@@ -148,47 +148,47 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
148
148
|
sortComparator: $e
|
|
149
149
|
})
|
|
150
150
|
)
|
|
151
|
-
], b =
|
|
152
|
-
const
|
|
151
|
+
], b = i.useMemo(() => {
|
|
152
|
+
const r = n.filter(
|
|
153
153
|
(p) => !Xe(p) && !Ze(p)
|
|
154
|
-
), T = (t ?
|
|
154
|
+
), T = (t ? r.filter(
|
|
155
155
|
(p) => p.category_guid === t || p.top_level_category_guid === t
|
|
156
|
-
) :
|
|
157
|
-
(p,
|
|
158
|
-
const { category_guid: w, top_level_category_guid:
|
|
159
|
-
p[
|
|
160
|
-
id:
|
|
161
|
-
category:
|
|
156
|
+
) : r).reduce(
|
|
157
|
+
(p, E) => {
|
|
158
|
+
const { category_guid: w, top_level_category_guid: I, month: k, total: D, year: N } = E, L = t ? w : I;
|
|
159
|
+
p[L] || (p[L] = {
|
|
160
|
+
id: L,
|
|
161
|
+
category: L,
|
|
162
162
|
category_guid: w,
|
|
163
|
-
top_level_category_guid:
|
|
163
|
+
top_level_category_guid: I
|
|
164
164
|
});
|
|
165
|
-
const
|
|
166
|
-
return p[
|
|
165
|
+
const x = Z(new Date(N, k - 1), B.MONTH_SHORT);
|
|
166
|
+
return p[L][x] || (p[L][x] = 0), p[L][x] = p[L][x] + Math.abs(D), p;
|
|
167
167
|
},
|
|
168
168
|
{}
|
|
169
169
|
);
|
|
170
170
|
return Object.values(T);
|
|
171
171
|
}, [n, t]);
|
|
172
|
-
return /* @__PURE__ */ e(O, { sx: { height:
|
|
173
|
-
|
|
172
|
+
return /* @__PURE__ */ e(O, { sx: { height: a, width: "100%", overflowX: "auto", boxShadow: "none", ...h }, children: /* @__PURE__ */ e(
|
|
173
|
+
rt,
|
|
174
174
|
{
|
|
175
175
|
columns: u,
|
|
176
176
|
disableColumnFilter: !0,
|
|
177
177
|
disableColumnMenu: !0,
|
|
178
178
|
hideFooter: !0,
|
|
179
|
-
initialState: { sorting: { sortModel:
|
|
180
|
-
onRowClick: (
|
|
181
|
-
s?.(
|
|
179
|
+
initialState: { sorting: { sortModel: d } },
|
|
180
|
+
onRowClick: (r) => {
|
|
181
|
+
s?.(r.row.category), l(y.TRENDS_CLICK_LIST_ITEM, {
|
|
182
182
|
...A,
|
|
183
|
-
listItem: Me[
|
|
183
|
+
listItem: Me[r.row.category]
|
|
184
184
|
});
|
|
185
185
|
},
|
|
186
|
-
onSortModelChange: (
|
|
187
|
-
m(
|
|
186
|
+
onSortModelChange: (r) => {
|
|
187
|
+
m(r), l(y.TRENDS_CLICK_TABLE_SORT, A);
|
|
188
188
|
},
|
|
189
189
|
rows: b,
|
|
190
190
|
slotProps: { baseIconButton: { color: "secondary", sx: { ml: 8 } } },
|
|
191
|
-
sortModel:
|
|
191
|
+
sortModel: d,
|
|
192
192
|
sortingOrder: ["asc", "desc"]
|
|
193
193
|
}
|
|
194
194
|
) });
|
|
@@ -200,25 +200,25 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
200
200
|
isOpen: t,
|
|
201
201
|
onClose: s
|
|
202
202
|
}) => {
|
|
203
|
-
const { onEvent:
|
|
204
|
-
() =>
|
|
205
|
-
[m,
|
|
203
|
+
const { onEvent: a } = H(), { selectedAccountGuids: h } = P(), { common: l } = R(), { setFilter: c, sortedTransactions: d } = ae(), [m, C] = i.useState(""), u = i.useMemo(
|
|
204
|
+
() => d.find((r) => r.guid === m),
|
|
205
|
+
[m, d]
|
|
206
206
|
);
|
|
207
|
-
|
|
208
|
-
|
|
207
|
+
i.useEffect(() => {
|
|
208
|
+
c({
|
|
209
209
|
accounts: h,
|
|
210
210
|
dateRange: o,
|
|
211
|
-
custom: (
|
|
211
|
+
custom: (r) => n === "" || n === r.category_guid || n === r.top_level_category_guid,
|
|
212
212
|
showSplits: !!n
|
|
213
213
|
});
|
|
214
|
-
}, [h, n, o]),
|
|
214
|
+
}, [h, n, o]), i.useEffect(() => a(y.TRENDS_VIEW_TRANSACTIONS), []);
|
|
215
215
|
const b = () => {
|
|
216
216
|
C(""), s();
|
|
217
217
|
};
|
|
218
218
|
return /* @__PURE__ */ f(
|
|
219
219
|
fe,
|
|
220
220
|
{
|
|
221
|
-
ariaLabelClose:
|
|
221
|
+
ariaLabelClose: l.close_aria,
|
|
222
222
|
isOpen: t,
|
|
223
223
|
onClose: b,
|
|
224
224
|
title: Nt.title,
|
|
@@ -229,72 +229,72 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
229
229
|
}
|
|
230
230
|
);
|
|
231
231
|
}, Ot = M(Wt), Vt = ({ onBackClick: n, sx: o }) => {
|
|
232
|
-
const { onEvent: t } = H(), { isDesktop: s, isTablet:
|
|
233
|
-
|
|
234
|
-
const S = () =>
|
|
232
|
+
const { onEvent: t } = H(), { isDesktop: s, isTablet: a, isMobile: h } = K(), { visibleAccounts: l } = ie(), { loadMonthlyCategoryTotals: c, monthlyCategoryTotals: d, getCategoryName: m } = F(), { sortedTransactions: C } = ae(), { selectedDateRange: u, setSelectedDateRange: b } = q(), { isCopyLoaded: r, isInitialized: g, selectedAccounts: T, setSelectedAccounts: p } = P(), { trends: E } = R(), [w, I] = i.useState(!1), [k, D] = i.useState(!1), [N, L] = i.useState("Chart"), [x, $] = i.useState(""), [z, ce] = i.useState(window.innerHeight), ee = z - (h ? 315 : 345);
|
|
233
|
+
i.useEffect(() => {
|
|
234
|
+
const S = () => ce(window.innerHeight);
|
|
235
235
|
return window.addEventListener("resize", S), () => window.removeEventListener("resize", S);
|
|
236
|
-
}, []),
|
|
237
|
-
p(
|
|
238
|
-
}, [
|
|
239
|
-
g &&
|
|
236
|
+
}, []), i.useEffect(() => {
|
|
237
|
+
p(l);
|
|
238
|
+
}, [l]), i.useEffect(() => {
|
|
239
|
+
g && c(
|
|
240
240
|
T,
|
|
241
241
|
u.start,
|
|
242
242
|
u.end
|
|
243
243
|
).finally(() => {
|
|
244
|
-
|
|
244
|
+
I(!0);
|
|
245
245
|
});
|
|
246
246
|
}, [g, T, u]);
|
|
247
|
-
const te =
|
|
247
|
+
const te = i.useMemo(() => {
|
|
248
248
|
if (!w) return { stackedDatasets: [], unstackedDatasets: [] };
|
|
249
249
|
const S = je(
|
|
250
|
-
|
|
250
|
+
d,
|
|
251
251
|
u.start,
|
|
252
252
|
u.end
|
|
253
|
-
), W =
|
|
254
|
-
(G) => G.top_level_category_guid ===
|
|
253
|
+
), W = x.length ? S.filter(
|
|
254
|
+
(G) => G.top_level_category_guid === x || G.category_guid === x
|
|
255
255
|
) : Qe(S);
|
|
256
256
|
return {
|
|
257
257
|
stackedDatasets: W.filter(qe),
|
|
258
258
|
unstackedDatasets: W.filter(Je)
|
|
259
259
|
};
|
|
260
|
-
}, [
|
|
261
|
-
|
|
262
|
-
},
|
|
260
|
+
}, [d, x, u]), ne = (S, W) => {
|
|
261
|
+
L(W ?? N), t(y.TRENDS_CLICK_TOGGLE_VIEW);
|
|
262
|
+
}, le = (S) => {
|
|
263
263
|
const W = Ie(S?.[0], 1), G = S?.[1], ge = Ce(G, W);
|
|
264
264
|
b({ start: W, end: G }), t(y.TRENDS_CLICK_TIME_WINDOW, {
|
|
265
265
|
time_period: ge + "M"
|
|
266
266
|
});
|
|
267
267
|
}, de = () => {
|
|
268
268
|
t(y.TRENDS_CLICK_FILTER);
|
|
269
|
-
},
|
|
269
|
+
}, oe = (S) => {
|
|
270
270
|
$(S);
|
|
271
271
|
}, he = (S) => {
|
|
272
272
|
$(S), t(y.TRENDS_CLICK_LEGEND, { category: m(S) });
|
|
273
|
-
},
|
|
273
|
+
}, se = (S) => {
|
|
274
274
|
t(y.TRENDS_HOVER_LEGEND, { category: m(S) });
|
|
275
275
|
}, ue = (S) => {
|
|
276
276
|
t(y.TRENDS_HOVER_AREA, { category: S });
|
|
277
277
|
}, me = (S) => {
|
|
278
278
|
t(y.TRENDS_HOVER_POINT, { category: S });
|
|
279
279
|
};
|
|
280
|
-
return !
|
|
280
|
+
return !r || !g || !w ? /* @__PURE__ */ e(Q, {}) : /* @__PURE__ */ f(
|
|
281
281
|
Ae,
|
|
282
282
|
{
|
|
283
|
-
accountOptions:
|
|
284
|
-
calendarActions: { onRangeChanged:
|
|
283
|
+
accountOptions: l,
|
|
284
|
+
calendarActions: { onRangeChanged: le },
|
|
285
285
|
dateRange: u,
|
|
286
286
|
dateRangeVariant: "timeframebuttons",
|
|
287
287
|
onAccountsFilterClick: de,
|
|
288
288
|
onBackClick: n,
|
|
289
289
|
sx: o,
|
|
290
|
-
title:
|
|
290
|
+
title: E.title,
|
|
291
291
|
children: [
|
|
292
292
|
/* @__PURE__ */ f(
|
|
293
293
|
_,
|
|
294
294
|
{
|
|
295
295
|
sx: {
|
|
296
296
|
// eslint-disable-next-line no-nested-ternary
|
|
297
|
-
px: s ? 48 :
|
|
297
|
+
px: s ? 48 : a ? 24 : 12
|
|
298
298
|
},
|
|
299
299
|
children: [
|
|
300
300
|
/* @__PURE__ */ f(
|
|
@@ -307,7 +307,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
307
307
|
/* @__PURE__ */ e(
|
|
308
308
|
Oe,
|
|
309
309
|
{
|
|
310
|
-
selectedCategoryGuid:
|
|
310
|
+
selectedCategoryGuid: x,
|
|
311
311
|
selectedDateRange: u
|
|
312
312
|
}
|
|
313
313
|
),
|
|
@@ -316,11 +316,11 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
316
316
|
}
|
|
317
317
|
),
|
|
318
318
|
/* @__PURE__ */ f(_, { alignItems: "center", flexDirection: "row", width: "100%", children: [
|
|
319
|
-
/* @__PURE__ */ e(O, { flexGrow: 1, children:
|
|
319
|
+
/* @__PURE__ */ e(O, { flexGrow: 1, children: x && /* @__PURE__ */ f(pe, { onClick: () => $(""), sx: { p: 0, pr: 5 }, children: [
|
|
320
320
|
/* @__PURE__ */ e(re, { name: "arrow_back" }),
|
|
321
|
-
|
|
321
|
+
E.all_categories
|
|
322
322
|
] }) }),
|
|
323
|
-
/* @__PURE__ */ e(pe, { onClick: () => D(!0), sx: { px: 5 }, children: `${
|
|
323
|
+
/* @__PURE__ */ e(pe, { onClick: () => D(!0), sx: { px: 5 }, children: `${E.view_transactions} (${C.length})` })
|
|
324
324
|
] }),
|
|
325
325
|
/* @__PURE__ */ f(O, { children: [
|
|
326
326
|
N === "Chart" && /* @__PURE__ */ e(
|
|
@@ -329,7 +329,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
329
329
|
availableHeight: ee,
|
|
330
330
|
onClickLegend: he,
|
|
331
331
|
onHoverArea: ue,
|
|
332
|
-
onHoverLegend:
|
|
332
|
+
onHoverLegend: se,
|
|
333
333
|
onHoverPoint: me,
|
|
334
334
|
stackedDatasets: te.stackedDatasets,
|
|
335
335
|
unstackedDatasets: te.unstackedDatasets
|
|
@@ -338,9 +338,9 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
338
338
|
N === "Table" && /* @__PURE__ */ e(
|
|
339
339
|
Ve,
|
|
340
340
|
{
|
|
341
|
-
monthlyCategoryTotals:
|
|
342
|
-
onClickRow:
|
|
343
|
-
selectedCategory:
|
|
341
|
+
monthlyCategoryTotals: d,
|
|
342
|
+
onClickRow: oe,
|
|
343
|
+
selectedCategory: x,
|
|
344
344
|
selectedDateRange: u
|
|
345
345
|
}
|
|
346
346
|
)
|
|
@@ -351,7 +351,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
351
351
|
/* @__PURE__ */ e(
|
|
352
352
|
Ot,
|
|
353
353
|
{
|
|
354
|
-
categoryGuid:
|
|
354
|
+
categoryGuid: x,
|
|
355
355
|
dateRange: u,
|
|
356
356
|
isOpen: k,
|
|
357
357
|
onClose: () => D(!1)
|
|
@@ -379,20 +379,20 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
379
379
|
}
|
|
380
380
|
);
|
|
381
381
|
}, Bt = M(Gt), zt = ({ onPrimaryCtaClick: n, sx: o }) => {
|
|
382
|
-
const { visibleAccounts: t } =
|
|
383
|
-
return
|
|
382
|
+
const { visibleAccounts: t } = ie(), { loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: a } = F(), { isInitialized: h } = ve(), { trends: l } = R(), { isCopyLoaded: c, selectedAccounts: d, setSelectedAccounts: m } = P();
|
|
383
|
+
return i.useEffect(() => {
|
|
384
384
|
m(t);
|
|
385
|
-
}, [t]),
|
|
386
|
-
h && s(
|
|
387
|
-
}, [h,
|
|
385
|
+
}, [t]), i.useEffect(() => {
|
|
386
|
+
h && s(d).finally();
|
|
387
|
+
}, [h, d]), !c || !h ? /* @__PURE__ */ e(Q, {}) : /* @__PURE__ */ e(
|
|
388
388
|
lt,
|
|
389
389
|
{
|
|
390
390
|
onPrimaryCtaClick: n,
|
|
391
|
-
primaryCtaLabel:
|
|
392
|
-
subTitle:
|
|
391
|
+
primaryCtaLabel: l.primary_cta,
|
|
392
|
+
subTitle: l.sub_title,
|
|
393
393
|
sx: o,
|
|
394
|
-
title:
|
|
395
|
-
children:
|
|
394
|
+
title: l.mini_title,
|
|
395
|
+
children: a ? /* @__PURE__ */ e(Bt, {}) : /* @__PURE__ */ e(Q, {})
|
|
396
396
|
}
|
|
397
397
|
);
|
|
398
398
|
}, Zn = M(zt), Ft = 70, Se = ({
|
|
@@ -400,13 +400,13 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
400
400
|
totalAmount: o,
|
|
401
401
|
transactionType: t,
|
|
402
402
|
percentage: s,
|
|
403
|
-
secondaryLabel:
|
|
403
|
+
secondaryLabel: a,
|
|
404
404
|
shouldDisplayPercentage: h
|
|
405
405
|
}) => {
|
|
406
|
-
const { availableWidth:
|
|
406
|
+
const { availableWidth: l } = ot(), c = i.useRef(null), d = i.useRef(null), m = Ct(Number(Math.abs(s)), {
|
|
407
407
|
style: "percent",
|
|
408
408
|
minimumIntegerDigits: 1
|
|
409
|
-
}), C =
|
|
409
|
+
}), C = l === 288 && U(o, "0,0.00").length > 10 ? U(o, "0,0") : U(o, "0,0.00"), u = t === "spending" ? s > 0 : s >= 0, b = t === "spending" ? "error.main" : "success.main", r = t === "spending" ? "success.main" : "text.secondary", g = c?.current, T = d?.current, p = g && T ? g.scrollWidth > T.clientWidth - Ft : !1;
|
|
410
410
|
return /* @__PURE__ */ f(
|
|
411
411
|
_,
|
|
412
412
|
{
|
|
@@ -431,12 +431,12 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
431
431
|
children: [
|
|
432
432
|
/* @__PURE__ */ e(Y, { color: "text.secondary", variant: "caption", children: n }),
|
|
433
433
|
h && /* @__PURE__ */ f(_, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
|
|
434
|
-
u ? /* @__PURE__ */ e(ht, { size: 20, sx: { color: b } }) : /* @__PURE__ */ e(ut, { size: 20, sx: { color:
|
|
434
|
+
u ? /* @__PURE__ */ e(ht, { size: 20, sx: { color: b } }) : /* @__PURE__ */ e(ut, { size: 20, sx: { color: r } }),
|
|
435
435
|
/* @__PURE__ */ e(
|
|
436
436
|
Y,
|
|
437
437
|
{
|
|
438
438
|
sx: {
|
|
439
|
-
color: u ? b :
|
|
439
|
+
color: u ? b : r,
|
|
440
440
|
fontWeight: 600
|
|
441
441
|
},
|
|
442
442
|
variant: "body2",
|
|
@@ -450,7 +450,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
450
450
|
/* @__PURE__ */ f(
|
|
451
451
|
_,
|
|
452
452
|
{
|
|
453
|
-
ref:
|
|
453
|
+
ref: d,
|
|
454
454
|
sx: {
|
|
455
455
|
alignItems: "center",
|
|
456
456
|
flexDirection: "row",
|
|
@@ -460,17 +460,17 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
460
460
|
/* @__PURE__ */ e(
|
|
461
461
|
O,
|
|
462
462
|
{
|
|
463
|
-
ref:
|
|
463
|
+
ref: c,
|
|
464
464
|
sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
|
|
465
465
|
children: /* @__PURE__ */ e(De, { children: C })
|
|
466
466
|
}
|
|
467
467
|
),
|
|
468
|
-
h &&
|
|
468
|
+
h && l >= 450 && !p && /* @__PURE__ */ e(
|
|
469
469
|
Y,
|
|
470
470
|
{
|
|
471
|
-
color: u ? b :
|
|
471
|
+
color: u ? b : r,
|
|
472
472
|
variant: "caption",
|
|
473
|
-
children:
|
|
473
|
+
children: a
|
|
474
474
|
}
|
|
475
475
|
)
|
|
476
476
|
]
|
|
@@ -489,39 +489,39 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
489
489
|
] })
|
|
490
490
|
] });
|
|
491
491
|
}), Qn = M(({ onCtaClick: n }) => {
|
|
492
|
-
const { visibleAccounts: o } =
|
|
492
|
+
const { visibleAccounts: o } = ie(), { onEvent: t } = H(), { monthlyCategoryTotals: s, loadMonthlyCategoryTotals: a, monthlyTotalsLoaded: h } = F(), l = {
|
|
493
493
|
start: dt(/* @__PURE__ */ new Date(), 1),
|
|
494
494
|
end: /* @__PURE__ */ new Date()
|
|
495
|
-
}, { trends:
|
|
496
|
-
|
|
495
|
+
}, { trends: c } = R(), { selectedAccounts: d, setSelectedAccounts: m, isInitialized: C } = P();
|
|
496
|
+
i.useEffect(() => {
|
|
497
497
|
m(o);
|
|
498
|
-
}, [o]),
|
|
499
|
-
C &&
|
|
498
|
+
}, [o]), i.useEffect(() => {
|
|
499
|
+
C && a(d, l.start).then(() => {
|
|
500
500
|
t(y.TRENDS_LOAD_WIDGET, {
|
|
501
501
|
state: o?.length ? "default" : "zeroState"
|
|
502
502
|
});
|
|
503
503
|
});
|
|
504
|
-
}, [C,
|
|
505
|
-
const { spendingData: u, incomeData: b } =
|
|
504
|
+
}, [C, d]);
|
|
505
|
+
const { spendingData: u, incomeData: b } = i.useMemo(
|
|
506
506
|
() => ({
|
|
507
|
-
spendingData: Le(s,
|
|
508
|
-
incomeData: xe(s,
|
|
507
|
+
spendingData: Le(s, l),
|
|
508
|
+
incomeData: xe(s, l)
|
|
509
509
|
}),
|
|
510
|
-
[s,
|
|
511
|
-
), [
|
|
510
|
+
[s, l]
|
|
511
|
+
), [r, g] = u, [T, p] = b, E = _e(g.y, r.y), w = _e(p.y, T.y), I = C && !o?.length, k = () => {
|
|
512
512
|
t(
|
|
513
|
-
|
|
513
|
+
I ? y.TRENDS_CLICK_GET_STARTED : y.TRENDS_CLICK_VIEW_MORE
|
|
514
514
|
), n();
|
|
515
515
|
};
|
|
516
516
|
return !h || !C ? /* @__PURE__ */ e(Q, {}) : /* @__PURE__ */ e(
|
|
517
517
|
ft,
|
|
518
518
|
{
|
|
519
519
|
className: "mx-trends-microwidget",
|
|
520
|
-
ctaLabel:
|
|
520
|
+
ctaLabel: c.micro_primary_cta_label,
|
|
521
521
|
onCTAClick: k,
|
|
522
|
-
subHeader:
|
|
523
|
-
title:
|
|
524
|
-
children:
|
|
522
|
+
subHeader: I ? void 0 : c.micro_subheader,
|
|
523
|
+
title: c.title,
|
|
524
|
+
children: I ? /* @__PURE__ */ e(Pt, {}) : /* @__PURE__ */ f(
|
|
525
525
|
_,
|
|
526
526
|
{
|
|
527
527
|
sx: {
|
|
@@ -533,10 +533,10 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
533
533
|
/* @__PURE__ */ e(
|
|
534
534
|
Se,
|
|
535
535
|
{
|
|
536
|
-
percentage:
|
|
537
|
-
secondaryLabel:
|
|
538
|
-
shouldDisplayPercentage: g.y !== 0 &&
|
|
539
|
-
title:
|
|
536
|
+
percentage: E,
|
|
537
|
+
secondaryLabel: c.micro_secondary_label,
|
|
538
|
+
shouldDisplayPercentage: g.y !== 0 && r.y !== 0,
|
|
539
|
+
title: c.spending_label,
|
|
540
540
|
totalAmount: g.y,
|
|
541
541
|
transactionType: "spending"
|
|
542
542
|
}
|
|
@@ -545,9 +545,9 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
545
545
|
Se,
|
|
546
546
|
{
|
|
547
547
|
percentage: w,
|
|
548
|
-
secondaryLabel:
|
|
548
|
+
secondaryLabel: c.micro_secondary_label,
|
|
549
549
|
shouldDisplayPercentage: p.y !== 0 && T.y !== 0,
|
|
550
|
-
title:
|
|
550
|
+
title: c.income_label,
|
|
551
551
|
totalAmount: p.y,
|
|
552
552
|
transactionType: "income"
|
|
553
553
|
}
|
|
@@ -585,50 +585,50 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
585
585
|
guid: o,
|
|
586
586
|
name: t,
|
|
587
587
|
transactions: s,
|
|
588
|
-
onClick:
|
|
588
|
+
onClick: a,
|
|
589
589
|
isLastItem: h = !1,
|
|
590
|
-
showDivider:
|
|
590
|
+
showDivider: l = !0
|
|
591
591
|
}) => {
|
|
592
|
-
const { trends:
|
|
593
|
-
|
|
592
|
+
const { trends: c } = R(), { onEvent: d } = H(), m = `${s.length} ${s.length === 1 ? c.transaction : c.transactions}`, C = () => {
|
|
593
|
+
a?.(), d(y.TRENDS_CLICK_LIST_ITEM, {
|
|
594
594
|
...A,
|
|
595
595
|
listItem: t
|
|
596
596
|
});
|
|
597
597
|
};
|
|
598
|
-
return /* @__PURE__ */ f(
|
|
598
|
+
return /* @__PURE__ */ f(i.Fragment, { children: [
|
|
599
599
|
/* @__PURE__ */ e(
|
|
600
600
|
Ee,
|
|
601
601
|
{
|
|
602
602
|
leftIcon: o ? /* @__PURE__ */ e(Te, { categoryGuid: o }) : void 0,
|
|
603
603
|
onClick: C,
|
|
604
604
|
rightContent: U(Math.abs(n), "0,0.00"),
|
|
605
|
-
rightIcon:
|
|
605
|
+
rightIcon: a ? /* @__PURE__ */ e(Ke, {}) : void 0,
|
|
606
606
|
subtitle: m,
|
|
607
607
|
title: t
|
|
608
608
|
}
|
|
609
609
|
),
|
|
610
|
-
|
|
610
|
+
l && /* @__PURE__ */ e(Dt, { sx: { ml: h ? 24 : 68 } })
|
|
611
611
|
] }, o);
|
|
612
612
|
}
|
|
613
613
|
), $t = M(
|
|
614
614
|
({ availableHeight: n = 0, onCategoryClick: o }) => {
|
|
615
|
-
const { collapsedCategories: t, visibleCategories: s, setVisibleListLength:
|
|
616
|
-
|
|
615
|
+
const { collapsedCategories: t, visibleCategories: s, setVisibleListLength: a } = q(), { isLargeDesktop: h, isDesktop: l } = K(), { trends: c } = R(), { onEvent: d } = H(), [m, C] = i.useState(!1), u = l || h;
|
|
616
|
+
i.useEffect(() => {
|
|
617
617
|
const g = Math.floor(n / 64) - 1, T = s.length + t.length;
|
|
618
|
-
g !== s.length && (
|
|
618
|
+
g !== s.length && (a(u ? Math.max(g, 5) : 5), C(g >= T));
|
|
619
619
|
}, [n]);
|
|
620
620
|
const b = () => {
|
|
621
|
-
C(!m),
|
|
621
|
+
C(!m), d(y.TRENDS_CLICK_VIEW_MORE, {
|
|
622
622
|
...A
|
|
623
623
|
});
|
|
624
|
-
},
|
|
624
|
+
}, r = s.length + (m ? t.length : 0);
|
|
625
625
|
return /* @__PURE__ */ e(_, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ f(yt, { children: [
|
|
626
|
-
/* @__PURE__ */ e(_, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(De, { children:
|
|
626
|
+
/* @__PURE__ */ e(_, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(De, { children: c.categories }) }),
|
|
627
627
|
s.map((g, T) => /* @__PURE__ */ e(
|
|
628
628
|
we,
|
|
629
629
|
{
|
|
630
630
|
...g,
|
|
631
|
-
isLastItem: T ===
|
|
631
|
+
isLastItem: T === r - 1,
|
|
632
632
|
onClick: g.transactions.length > 0 ? () => o(g) : void 0,
|
|
633
633
|
showDivider: !0
|
|
634
634
|
},
|
|
@@ -645,7 +645,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
645
645
|
we,
|
|
646
646
|
{
|
|
647
647
|
...g,
|
|
648
|
-
isLastItem: p ===
|
|
648
|
+
isLastItem: p === r - 1,
|
|
649
649
|
onClick: g.transactions.length > 0 ? () => o(g) : void 0,
|
|
650
650
|
showDivider: !0
|
|
651
651
|
},
|
|
@@ -692,28 +692,28 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
692
692
|
"WeeklyNoSpendDays",
|
|
693
693
|
"WeeklySmallPurchasesSummary"
|
|
694
694
|
], Yt = ({ onInsightCardClick: n }) => {
|
|
695
|
-
const o = It(), { onEvent: t } = H(), { isMobile: s, isDesktop:
|
|
696
|
-
|
|
697
|
-
m &&
|
|
695
|
+
const o = It(), { onEvent: t } = H(), { isMobile: s, isDesktop: a, isLargeDesktop: h } = K(), { beatStore: l, endpoint: c, sessionToken: d } = ve(), { isInitialized: m } = P(), [C, u] = i.useState(!1), b = o.palette.mode === "dark", r = a || h, g = r || s ? 1 : 2;
|
|
696
|
+
i.useEffect(() => {
|
|
697
|
+
m && l.loadBeats().finally(() => u(!0));
|
|
698
698
|
}, [m]);
|
|
699
|
-
const T =
|
|
699
|
+
const T = i.useMemo(() => C ? l.getFilteredBeats({ templates: jt }) : [], [C]), p = () => null, E = (D) => {
|
|
700
700
|
n?.(D), t(y.TRENDS_CLICK_INSIGHT, A);
|
|
701
|
-
}, w =
|
|
701
|
+
}, w = r ? 200 : 170, I = r ? 170 : 124, k = T.length > 0 ? w : I;
|
|
702
702
|
return /* @__PURE__ */ e(Et, { sx: { height: k }, children: /* @__PURE__ */ e(
|
|
703
703
|
ct,
|
|
704
704
|
{
|
|
705
|
-
areBeatsLoading:
|
|
705
|
+
areBeatsLoading: l.isLoading,
|
|
706
706
|
beats: T,
|
|
707
|
-
endpoint:
|
|
707
|
+
endpoint: c,
|
|
708
708
|
logOutUser: p,
|
|
709
|
-
onCardClick:
|
|
709
|
+
onCardClick: E,
|
|
710
710
|
showBorder: !0,
|
|
711
711
|
showCTAColocatedWithText: !1,
|
|
712
712
|
showCarouselControls: !0,
|
|
713
|
-
showHeader:
|
|
713
|
+
showHeader: r,
|
|
714
714
|
showIcon: !0,
|
|
715
715
|
showWithMargin: !1,
|
|
716
|
-
token:
|
|
716
|
+
token: d,
|
|
717
717
|
useDarkMode: b,
|
|
718
718
|
userHasFullInsightFeedBeats: !1,
|
|
719
719
|
variant: "outlined",
|
|
@@ -722,7 +722,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
722
722
|
) });
|
|
723
723
|
}, Ut = M(Yt), Xt = M(({ chartLabel: n, chartColor: o }) => {
|
|
724
724
|
const { onEvent: t } = H(), {
|
|
725
|
-
categoryDetailsChartData: { monthlyAmounts: s, tooltipLabels:
|
|
725
|
+
categoryDetailsChartData: { monthlyAmounts: s, tooltipLabels: a }
|
|
726
726
|
} = q();
|
|
727
727
|
return /* @__PURE__ */ e(_, { sx: { pt: 12, width: "100%" }, children: /* @__PURE__ */ e(
|
|
728
728
|
ye,
|
|
@@ -730,7 +730,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
730
730
|
baseline: "min",
|
|
731
731
|
colors: [o],
|
|
732
732
|
curveType: "bump",
|
|
733
|
-
customTooltipLabels:
|
|
733
|
+
customTooltipLabels: a,
|
|
734
734
|
datasets: [s],
|
|
735
735
|
height: 265,
|
|
736
736
|
labels: [n],
|
|
@@ -754,19 +754,19 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
754
754
|
}
|
|
755
755
|
) });
|
|
756
756
|
}), Zt = M(({ onClose: n }) => {
|
|
757
|
-
const o = Ne(), { onEvent: t } = H(), { common: s, trends:
|
|
757
|
+
const o = Ne(), { onEvent: t } = H(), { common: s, trends: a } = R(), { selectedCategoryData: h, selectedDateRangeMonthRange: l } = q(), { sortedTransactions: c } = ae(), [d, m] = i.useState(null);
|
|
758
758
|
if (!h)
|
|
759
759
|
return null;
|
|
760
|
-
const { guid: C, name: u, is_income: b, totalAmount:
|
|
761
|
-
() =>
|
|
762
|
-
[
|
|
763
|
-
),
|
|
760
|
+
const { guid: C, name: u, is_income: b, totalAmount: r } = h, g = b ? a.category_income : a.category_spending, T = xt(C, o), p = b ? a.income_label : a.spending_label, E = ` ${h.transactions.length === 1 ? a.transaction : a.transactions} (${h.transactions.length})`, w = i.useMemo(
|
|
761
|
+
() => c.find((D) => D.guid === d),
|
|
762
|
+
[d, c]
|
|
763
|
+
), I = (D) => D.category_guid === C || D.top_level_category_guid === C, k = () => {
|
|
764
764
|
n?.(), t(y.TRENDS_CLICK_BACK, A);
|
|
765
765
|
};
|
|
766
766
|
return /* @__PURE__ */ f(
|
|
767
767
|
fe,
|
|
768
768
|
{
|
|
769
|
-
ariaLabelClose:
|
|
769
|
+
ariaLabelClose: a.close_category_details,
|
|
770
770
|
isOpen: !0,
|
|
771
771
|
onClose: k,
|
|
772
772
|
shouldShowHeaderShadow: !0,
|
|
@@ -778,22 +778,22 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
778
778
|
Ee,
|
|
779
779
|
{
|
|
780
780
|
leftIcon: /* @__PURE__ */ e(Te, { categoryGuid: C }),
|
|
781
|
-
rightContent: U(Math.abs(
|
|
782
|
-
subtitle:
|
|
781
|
+
rightContent: U(Math.abs(r), "0,0.00"),
|
|
782
|
+
subtitle: l,
|
|
783
783
|
title: u
|
|
784
784
|
}
|
|
785
785
|
),
|
|
786
786
|
/* @__PURE__ */ e(Xt, { chartColor: T, chartLabel: p }),
|
|
787
787
|
/* @__PURE__ */ f(_, { alignItems: "center", direction: "row", justifyContent: "space-between", sx: { mx: 24 }, children: [
|
|
788
|
-
/* @__PURE__ */ e(X, { bold: !0, variant: "body1", children:
|
|
789
|
-
/* @__PURE__ */ e(vt, { filter:
|
|
788
|
+
/* @__PURE__ */ e(X, { bold: !0, variant: "body1", children: E }),
|
|
789
|
+
/* @__PURE__ */ e(vt, { filter: I })
|
|
790
790
|
] })
|
|
791
791
|
] }),
|
|
792
792
|
/* @__PURE__ */ e(
|
|
793
793
|
ke,
|
|
794
794
|
{
|
|
795
795
|
bgcolor: "transparent",
|
|
796
|
-
filter:
|
|
796
|
+
filter: I,
|
|
797
797
|
height: "calc(100vh - 475px)",
|
|
798
798
|
onClick: m
|
|
799
799
|
}
|
|
@@ -805,7 +805,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
805
805
|
ariaLabelClose: s.close_aria,
|
|
806
806
|
isOpen: !!w,
|
|
807
807
|
onClose: () => m(""),
|
|
808
|
-
title:
|
|
808
|
+
title: a.transaction,
|
|
809
809
|
children: w && /* @__PURE__ */ e(Re, { transaction: w })
|
|
810
810
|
}
|
|
811
811
|
)
|
|
@@ -814,26 +814,26 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
814
814
|
);
|
|
815
815
|
}), Qt = (n, o) => {
|
|
816
816
|
const t = xe(n, o), s = Le(n, o);
|
|
817
|
-
return [t, s].filter((
|
|
817
|
+
return [t, s].filter((a) => a.length > 0);
|
|
818
818
|
}, qt = (n, o) => {
|
|
819
|
-
const [t, s] = n,
|
|
820
|
-
if (
|
|
821
|
-
const
|
|
822
|
-
|
|
819
|
+
const [t, s] = n, a = t, h = s ?? t, l = [];
|
|
820
|
+
if (a) {
|
|
821
|
+
const c = a.reduce((d, m) => d + m.y, 0);
|
|
822
|
+
l.push({ label: o.income_label, amount: c });
|
|
823
823
|
}
|
|
824
824
|
if (h) {
|
|
825
|
-
const
|
|
826
|
-
|
|
825
|
+
const c = h.reduce((d, m) => d + m.y, 0);
|
|
826
|
+
l.push({ label: o.spending_label, amount: c });
|
|
827
827
|
}
|
|
828
|
-
return
|
|
828
|
+
return l;
|
|
829
829
|
}, Jt = ({
|
|
830
830
|
availableHeight: n = 0,
|
|
831
831
|
minHeight: o = 500,
|
|
832
832
|
selectedDateRange: t,
|
|
833
833
|
totals: s
|
|
834
834
|
}) => {
|
|
835
|
-
const
|
|
836
|
-
return
|
|
835
|
+
const a = He(), { onEvent: h } = H(), { trends: l } = R(), { isSmallMobile: c, isMobile: d, isSmallTablet: m, isTablet: C } = K(), u = [a.palette.chart?.chart1, a.palette.chart?.chart2], b = Qt(s, t), r = qt(b, l), [g, T] = i.useState(0), p = 458, E = 195, w = 56, I = d || c ? E : m || C ? p : g;
|
|
836
|
+
return i.useEffect(() => {
|
|
837
837
|
const D = Math.max(n - w, o);
|
|
838
838
|
T(D);
|
|
839
839
|
}, [n]), /* @__PURE__ */ e(
|
|
@@ -843,8 +843,8 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
843
843
|
colors: u,
|
|
844
844
|
curveType: "bump",
|
|
845
845
|
datasets: b,
|
|
846
|
-
height:
|
|
847
|
-
labels:
|
|
846
|
+
height: I,
|
|
847
|
+
labels: r,
|
|
848
848
|
onItemClick: () => {
|
|
849
849
|
h(y.TRENDS_CLICK_CHART, A);
|
|
850
850
|
},
|
|
@@ -860,38 +860,36 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
860
860
|
}
|
|
861
861
|
);
|
|
862
862
|
}, en = M(Jt), tn = ({ onBackClick: n, onInsightCardClick: o, sx: t }) => {
|
|
863
|
-
const { onEvent: s } = H(), { config:
|
|
863
|
+
const { onEvent: s } = H(), { config: a } = st(), { isLargeDesktop: h, isDesktop: l, isMobile: c } = K(), { visibleAccounts: d } = ie(), { loadDateRangeCategoryTotals: m, loadMonthlyCategoryTotals: C, monthlyCategoryTotals: u } = F(), { setFilter: b } = ae(), { selectedDateRange: r, setSelectedCategoryData: g, setSelectedDateRange: T } = q(), {
|
|
864
864
|
isCopyLoaded: p,
|
|
865
|
-
isInitialized:
|
|
865
|
+
isInitialized: E,
|
|
866
866
|
selectedAccounts: w,
|
|
867
|
-
selectedAccountGuids:
|
|
867
|
+
selectedAccountGuids: I,
|
|
868
868
|
setSelectedAccounts: k
|
|
869
|
-
} = P(), { trends: D } = R(), N = Ue(),
|
|
870
|
-
|
|
869
|
+
} = P(), { trends: D } = R(), N = Ue(), L = l || h, [x, $] = i.useState(!1), [z, ce] = i.useState("Chart"), [J, ee] = i.useState(""), [te, ne] = i.useState(!1), [le, de] = i.useState(!0), [oe, he] = i.useState(window.innerHeight), se = oe - 208, ue = oe - (N ? 494 : 266);
|
|
870
|
+
i.useEffect(() => {
|
|
871
871
|
const v = () => he(window.innerHeight);
|
|
872
872
|
return window.addEventListener("resize", v), () => window.removeEventListener("resize", v);
|
|
873
|
-
}, []),
|
|
874
|
-
k(
|
|
875
|
-
}, [
|
|
876
|
-
|
|
873
|
+
}, []), i.useEffect(() => {
|
|
874
|
+
k(d), de(!0);
|
|
875
|
+
}, [d]), i.useEffect(() => {
|
|
876
|
+
E && m(w, r.start, r.end).then(() => {
|
|
877
877
|
C(
|
|
878
878
|
w,
|
|
879
|
-
|
|
880
|
-
|
|
879
|
+
r.start,
|
|
880
|
+
r.end
|
|
881
881
|
);
|
|
882
882
|
}).finally(() => {
|
|
883
883
|
$(!0), s(y.TRENDS_LOAD_WIDGET, {
|
|
884
884
|
...A,
|
|
885
|
-
time_period: `${Ce(
|
|
885
|
+
time_period: `${Ce(r.end, r.start)}M`
|
|
886
886
|
});
|
|
887
887
|
});
|
|
888
|
-
}, [
|
|
889
|
-
console.log("inside new use effect"), console.log(I && (c?.length ?? 0) > 0), I && (c?.length ?? 0) > 0 && de(!1);
|
|
890
|
-
}, [I, c]), r.useEffect(() => {
|
|
888
|
+
}, [E, w, r]), i.useEffect(() => {
|
|
891
889
|
if (u.length !== 0) {
|
|
892
890
|
const v = {
|
|
893
|
-
accounts:
|
|
894
|
-
dateRange: { start:
|
|
891
|
+
accounts: I,
|
|
892
|
+
dateRange: { start: r.start, end: r.end }
|
|
895
893
|
};
|
|
896
894
|
b({
|
|
897
895
|
...v,
|
|
@@ -906,7 +904,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
906
904
|
}, S = () => {
|
|
907
905
|
g(null), ne(!1);
|
|
908
906
|
}, W = (v, V) => {
|
|
909
|
-
|
|
907
|
+
ce(V ?? z), s(y.TRENDS_CLICK_TOGGLE_VIEW, {
|
|
910
908
|
...A,
|
|
911
909
|
toggleView: V
|
|
912
910
|
});
|
|
@@ -925,99 +923,96 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
925
923
|
ee(v);
|
|
926
924
|
}, Be = () => {
|
|
927
925
|
ee(""), s(y.TRENDS_CLICK_ALL_CATEGORIES, A);
|
|
928
|
-
}, ze =
|
|
929
|
-
return !p || !
|
|
926
|
+
}, ze = a.show_connections_widget_in_master ? "buttons" : "no-buttons";
|
|
927
|
+
return !p || !x ? /* @__PURE__ */ e(Q, {}) : /* @__PURE__ */ e(
|
|
930
928
|
Ae,
|
|
931
929
|
{
|
|
932
|
-
accountOptions:
|
|
930
|
+
accountOptions: d,
|
|
933
931
|
calendarActions: { onRangeChanged: G },
|
|
934
|
-
dateRange:
|
|
935
|
-
dateRangeVariant:
|
|
932
|
+
dateRange: r,
|
|
933
|
+
dateRangeVariant: c ? "timeframetabs" : "timeframebuttons",
|
|
936
934
|
onAccountsFilterClick: ge,
|
|
937
935
|
onBackClick: n,
|
|
938
936
|
sx: t,
|
|
939
937
|
title: D.title,
|
|
940
|
-
children:
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
/* @__PURE__ */ e(
|
|
969
|
-
Oe,
|
|
970
|
-
{
|
|
971
|
-
selectedCategoryGuid: J,
|
|
972
|
-
selectedDateRange: a
|
|
973
|
-
}
|
|
974
|
-
),
|
|
975
|
-
/* @__PURE__ */ e(We, { onTabChange: W, selectedTab: z })
|
|
976
|
-
]
|
|
977
|
-
}
|
|
978
|
-
),
|
|
979
|
-
/* @__PURE__ */ e(_, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(O, { flexGrow: 1, children: J && /* @__PURE__ */ f(pe, { onClick: Be, sx: { p: 0, pr: 5 }, children: [
|
|
980
|
-
/* @__PURE__ */ e(re, { name: "arrow_back" }),
|
|
981
|
-
D.all_categories
|
|
982
|
-
] }) }) }),
|
|
983
|
-
/* @__PURE__ */ f(_, { flexDirection: x ? "row" : "column", gap: x ? 48 : 16, children: [
|
|
984
|
-
z === "Chart" && /* @__PURE__ */ f(Pe, { children: [
|
|
985
|
-
/* @__PURE__ */ e(O, { sx: { width: x ? "68%" : "100%" }, children: /* @__PURE__ */ e(
|
|
986
|
-
en,
|
|
938
|
+
children: le ? /* @__PURE__ */ e(
|
|
939
|
+
Mt,
|
|
940
|
+
{
|
|
941
|
+
header: D.zero_state_content_header,
|
|
942
|
+
icon: "",
|
|
943
|
+
onClick: () => {
|
|
944
|
+
},
|
|
945
|
+
primaryButton: D.empty_state_primary,
|
|
946
|
+
subText: D.empty_state_sub_text,
|
|
947
|
+
sx: { height: se },
|
|
948
|
+
variant: ze
|
|
949
|
+
}
|
|
950
|
+
) : /* @__PURE__ */ f(
|
|
951
|
+
_,
|
|
952
|
+
{
|
|
953
|
+
sx: {
|
|
954
|
+
px: c ? 0 : 48
|
|
955
|
+
},
|
|
956
|
+
children: [
|
|
957
|
+
/* @__PURE__ */ f(
|
|
958
|
+
_,
|
|
959
|
+
{
|
|
960
|
+
flexDirection: "row",
|
|
961
|
+
justifyContent: "space-between",
|
|
962
|
+
sx: { pb: c ? 12 : 24, pt: c ? 24 : 48 },
|
|
963
|
+
children: [
|
|
964
|
+
/* @__PURE__ */ e(
|
|
965
|
+
Oe,
|
|
987
966
|
{
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
selectedDateRange: a,
|
|
991
|
-
totals: u
|
|
967
|
+
selectedCategoryGuid: J,
|
|
968
|
+
selectedDateRange: r
|
|
992
969
|
}
|
|
993
|
-
)
|
|
994
|
-
/* @__PURE__ */
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
Ve,
|
|
970
|
+
),
|
|
971
|
+
/* @__PURE__ */ e(We, { onTabChange: W, selectedTab: z })
|
|
972
|
+
]
|
|
973
|
+
}
|
|
974
|
+
),
|
|
975
|
+
/* @__PURE__ */ e(_, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(O, { flexGrow: 1, children: J && /* @__PURE__ */ f(pe, { onClick: Be, sx: { p: 0, pr: 5 }, children: [
|
|
976
|
+
/* @__PURE__ */ e(re, { name: "arrow_back" }),
|
|
977
|
+
D.all_categories
|
|
978
|
+
] }) }) }),
|
|
979
|
+
/* @__PURE__ */ f(_, { flexDirection: L ? "row" : "column", gap: L ? 48 : 16, children: [
|
|
980
|
+
z === "Chart" && /* @__PURE__ */ f(Pe, { children: [
|
|
981
|
+
/* @__PURE__ */ e(O, { sx: { width: L ? "68%" : "100%" }, children: /* @__PURE__ */ e(
|
|
982
|
+
en,
|
|
1007
983
|
{
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
selectedDateRange: a
|
|
984
|
+
availableHeight: se,
|
|
985
|
+
minHeight: 450,
|
|
986
|
+
selectedDateRange: r,
|
|
987
|
+
totals: u
|
|
1013
988
|
}
|
|
1014
|
-
) })
|
|
989
|
+
) }),
|
|
990
|
+
/* @__PURE__ */ f(_, { gap: 16, sx: { width: L ? "32%" : "100%" }, children: [
|
|
991
|
+
N && /* @__PURE__ */ e(Ut, { onInsightCardClick: o }),
|
|
992
|
+
/* @__PURE__ */ e(
|
|
993
|
+
$t,
|
|
994
|
+
{
|
|
995
|
+
availableHeight: ue,
|
|
996
|
+
onCategoryClick: me
|
|
997
|
+
}
|
|
998
|
+
)
|
|
999
|
+
] })
|
|
1015
1000
|
] }),
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1001
|
+
z === "Table" && /* @__PURE__ */ e(O, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
|
|
1002
|
+
Ve,
|
|
1003
|
+
{
|
|
1004
|
+
height: "unset",
|
|
1005
|
+
monthlyCategoryTotals: u,
|
|
1006
|
+
onClickRow: Ge,
|
|
1007
|
+
selectedCategory: J,
|
|
1008
|
+
selectedDateRange: r
|
|
1009
|
+
}
|
|
1010
|
+
) })
|
|
1011
|
+
] }),
|
|
1012
|
+
te && /* @__PURE__ */ e(Zt, { onClose: S })
|
|
1013
|
+
]
|
|
1014
|
+
}
|
|
1015
|
+
)
|
|
1021
1016
|
}
|
|
1022
1017
|
);
|
|
1023
1018
|
}, qn = M(tn);
|