@mx-cartographer/experiences 7.0.41 → 7.0.43
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-B5HMpGeJ.mjs → AccountDetailsContent-BkxDh8cY.mjs} +36 -36
- package/dist/{AccountDetailsHeader-Bt8O2raZ.mjs → AccountDetailsHeader-B3DiwvB7.mjs} +1 -1
- package/dist/{LineChart-CbOmpTDP.mjs → LineChart-CHTf3RcN.mjs} +137 -130
- package/dist/accounts/index.es.js +3 -3
- package/dist/cashflow/index.es.js +218 -214
- package/dist/common/index.es.js +1 -1
- package/dist/debts/index.es.js +243 -240
- package/dist/finstrong/index.es.js +1 -1
- package/dist/goals/index.es.js +2 -2
- package/dist/networth/index.es.js +1 -1
- package/dist/recurringtransactions/index.es.js +40 -39
- package/dist/trends/index.es.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as o, Fragment as P, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import u, { useState as J } from "react";
|
|
3
3
|
import { observer as T } from "mobx-react-lite";
|
|
4
4
|
import { addMonths as qe } from "date-fns/addMonths";
|
|
5
5
|
import { startOfToday as M } from "date-fns/startOfToday";
|
|
@@ -7,8 +7,8 @@ import I from "@mui/material/Box";
|
|
|
7
7
|
import H from "@mui/material/Button";
|
|
8
8
|
import D from "@mui/material/Divider";
|
|
9
9
|
import r from "@mui/material/Stack";
|
|
10
|
-
import
|
|
11
|
-
import { Text as
|
|
10
|
+
import ie from "@mui/material/styles/useTheme";
|
|
11
|
+
import { Text as d, P as k, Icon as F, InstitutionLogo as xe, H1 as le, H2 as Xe } from "@mxenabled/mxui";
|
|
12
12
|
import { G as Ye, t as de, u as O, p as re, c as Oe, a as Y, o as me, i as q, f as Ne, g as ke } from "../hooks-BAAimqdq.mjs";
|
|
13
13
|
import { C as L } from "../CurrencyText-YUhH2caW.mjs";
|
|
14
14
|
import { u as ue } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
@@ -19,7 +19,7 @@ import { b as X } from "../Localization-2MODESHW.mjs";
|
|
|
19
19
|
import { M as Qe } from "../MiniWidgetContainer-BhHaL8eb.mjs";
|
|
20
20
|
import { R as Ve } from "../RecurringSettings-RduF8gt3.mjs";
|
|
21
21
|
import Ke from "@mui/material/Tabs";
|
|
22
|
-
import
|
|
22
|
+
import ye from "@mui/material/Tab";
|
|
23
23
|
import { getUnixTime as U } from "date-fns/getUnixTime";
|
|
24
24
|
import ee from "@mui/material/List";
|
|
25
25
|
import te from "@mui/material/ListItem";
|
|
@@ -30,14 +30,14 @@ import { f as Z } from "../NumberFormatting-CtWHhyBX.mjs";
|
|
|
30
30
|
import { isAfter as He } from "date-fns/isAfter";
|
|
31
31
|
import { isBefore as Fe } from "date-fns/isBefore";
|
|
32
32
|
import { isToday as We } from "date-fns/isToday";
|
|
33
|
-
import { addDays as
|
|
33
|
+
import { addDays as Ce } from "date-fns/addDays";
|
|
34
34
|
import { alpha as et, keyframes as tt } from "@mui/material/styles";
|
|
35
35
|
import { DataGridPro as nt } from "@mui/x-data-grid-pro";
|
|
36
|
-
import { T as
|
|
37
|
-
import { M as ot, S as
|
|
36
|
+
import { T as Se } from "../TabContentContainer-j01JYR_7.mjs";
|
|
37
|
+
import { M as ot, S as at, i as it, d as _e, c as rt } from "../ManageIncome-4_bSdxXr.mjs";
|
|
38
38
|
import { D as $e } from "../Drawer-kEE73B87.mjs";
|
|
39
39
|
import { formatISO as st } from "date-fns/formatISO";
|
|
40
|
-
import { fromUnixTime as
|
|
40
|
+
import { fromUnixTime as we } from "date-fns/fromUnixTime";
|
|
41
41
|
import { startOfMonth as ct } from "date-fns/startOfMonth";
|
|
42
42
|
import { subDays as Me } from "date-fns/subDays";
|
|
43
43
|
import { S as lt, b as dt } from "../TransactionDetails-C-2UEbmQ.mjs";
|
|
@@ -47,10 +47,10 @@ import { endOfToday as ht } from "date-fns/endOfToday";
|
|
|
47
47
|
import { W as ve, A as Ae } from "../WidgetContainer-ztkGgdIH.mjs";
|
|
48
48
|
import { F as pt, A as B } from "../Fetch-87LIQbEA.mjs";
|
|
49
49
|
const K = () => {
|
|
50
|
-
if (!
|
|
50
|
+
if (!u.useContext(Ye))
|
|
51
51
|
throw new Error("useCashflowUiStore() must be used within the GlobalDataContext");
|
|
52
52
|
return de().uiStore;
|
|
53
|
-
}, ft = ({ remaining:
|
|
53
|
+
}, ft = ({ remaining: a }) => {
|
|
54
54
|
const { cashflow: n } = O();
|
|
55
55
|
return /* @__PURE__ */ o(P, { children: [
|
|
56
56
|
/* @__PURE__ */ e(
|
|
@@ -58,44 +58,44 @@ const K = () => {
|
|
|
58
58
|
{
|
|
59
59
|
sx: {
|
|
60
60
|
borderRadius: "1px",
|
|
61
|
-
backgroundColor:
|
|
61
|
+
backgroundColor: a < 0 ? "error.main" : a > 0 ? "success.main" : "warning.main",
|
|
62
62
|
height: 6,
|
|
63
63
|
width: 6
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
),
|
|
67
|
-
/* @__PURE__ */ e(
|
|
68
|
-
/* @__PURE__ */ e(L, { amount:
|
|
67
|
+
/* @__PURE__ */ e(d, { bold: !0, sx: { flexGrow: 1, fontSize: 12 }, children: n.remaining_cash }),
|
|
68
|
+
/* @__PURE__ */ e(L, { amount: a, bold: !0, sx: { fontSize: 12 } })
|
|
69
69
|
] });
|
|
70
|
-
}, pe = T(ft), gt = ({ onAddIncomeClick:
|
|
71
|
-
const n =
|
|
70
|
+
}, pe = T(ft), gt = ({ onAddIncomeClick: a }) => {
|
|
71
|
+
const n = ie(), { availableWidth: t } = re(), { isMobile: s } = ue(), { visibleCashAccounts: c, visibleCashBalance: f } = Oe(), { selectedAccounts: m, selectedAccountGuids: b, setSelectedAccounts: y } = Y(), { cashflow: i } = O(), { userProfile: g } = me(), {
|
|
72
72
|
daysUntilNextIncome: l,
|
|
73
|
-
expensesTilNextIncome:
|
|
74
|
-
selectedCashAccounts:
|
|
75
|
-
setNextIncome:
|
|
73
|
+
expensesTilNextIncome: h,
|
|
74
|
+
selectedCashAccounts: C,
|
|
75
|
+
setNextIncome: S,
|
|
76
76
|
setSelectedCashAccounts: v,
|
|
77
77
|
setUpcomingExpenses: p
|
|
78
|
-
} = K(), { isDataLoaded: N, nextIncomeRecurrence:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}, [c]),
|
|
78
|
+
} = K(), { isDataLoaded: N, nextIncomeRecurrence: _, upcomingExpenses: z } = q();
|
|
79
|
+
u.useEffect(() => {
|
|
80
|
+
y(c);
|
|
81
|
+
}, [c]), u.useEffect(() => {
|
|
82
82
|
v(
|
|
83
83
|
c.filter((R) => b.includes(R.guid))
|
|
84
84
|
);
|
|
85
|
-
}, [c,
|
|
86
|
-
|
|
87
|
-
}, [
|
|
88
|
-
const G =
|
|
89
|
-
() => c.filter((R) => b.includes(R.guid)).reduce((R,
|
|
90
|
-
[b,
|
|
91
|
-
), W =
|
|
92
|
-
() =>
|
|
93
|
-
[b,
|
|
94
|
-
),
|
|
85
|
+
}, [c, m]), u.useEffect(() => {
|
|
86
|
+
_ && S(_), p(z);
|
|
87
|
+
}, [_, z]);
|
|
88
|
+
const G = u.useMemo(
|
|
89
|
+
() => c.filter((R) => b.includes(R.guid)).reduce((R, w) => R + (w?.balance || 0), 0),
|
|
90
|
+
[b, z]
|
|
91
|
+
), W = u.useMemo(
|
|
92
|
+
() => h.filter((R) => b.includes(R.accountGuid || "")).reduce((R, w) => R + w.amount, 0),
|
|
93
|
+
[b, h]
|
|
94
|
+
), j = u.useMemo(
|
|
95
95
|
() => G - W,
|
|
96
96
|
[G, W]
|
|
97
|
-
), A = g?.has_completed_cash_flow_onboarding && !!
|
|
98
|
-
return N ? /* @__PURE__ */ e(I, { className: "mx-cashflow", pl: 16, pr: 16, pt: 16, children: t >
|
|
97
|
+
), A = g?.has_completed_cash_flow_onboarding && !!a;
|
|
98
|
+
return N ? /* @__PURE__ */ e(I, { className: "mx-cashflow", pl: 16, pr: 16, pt: 16, children: t > 710 ? /* @__PURE__ */ o(
|
|
99
99
|
r,
|
|
100
100
|
{
|
|
101
101
|
border: `1px solid ${n.palette.border.light}`,
|
|
@@ -107,48 +107,48 @@ const K = () => {
|
|
|
107
107
|
/* @__PURE__ */ o(r, { pb: 14, pt: 12, children: [
|
|
108
108
|
/* @__PURE__ */ e(L, { amount: G, variant: "H2" }),
|
|
109
109
|
/* @__PURE__ */ e(k, { variant: "XSmall", whiteSpace: "nowrap", children: X(
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
i.total_cash_accounts,
|
|
111
|
+
C.length
|
|
112
112
|
) })
|
|
113
113
|
] }),
|
|
114
114
|
/* @__PURE__ */ e(r, { pt: 18, children: /* @__PURE__ */ e(F, { name: "remove" }) }),
|
|
115
115
|
/* @__PURE__ */ o(r, { pb: 14, pt: 12, children: [
|
|
116
116
|
/* @__PURE__ */ e(L, { amount: W, variant: "H2" }),
|
|
117
|
-
/* @__PURE__ */ e(k, { variant: "XSmall", whiteSpace: "nowrap", children: X(
|
|
117
|
+
/* @__PURE__ */ e(k, { variant: "XSmall", whiteSpace: "nowrap", children: X(i.expenses_due, h.length) })
|
|
118
118
|
] }),
|
|
119
119
|
/* @__PURE__ */ e(r, { pt: 18, children: /* @__PURE__ */ e(F, { name: "equal" }) }),
|
|
120
120
|
/* @__PURE__ */ o(r, { pb: 14, pr: 24, pt: 12, children: [
|
|
121
|
-
/* @__PURE__ */ e(L, { amount:
|
|
121
|
+
/* @__PURE__ */ e(L, { amount: j, variant: "H2" }),
|
|
122
122
|
/* @__PURE__ */ o(r, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
123
|
-
/* @__PURE__ */ e(k, { variant: "XSmall", whiteSpace: "nowrap", children:
|
|
124
|
-
/* @__PURE__ */ e(he, { body:
|
|
123
|
+
/* @__PURE__ */ e(k, { variant: "XSmall", whiteSpace: "nowrap", children: i.available_to_spend }),
|
|
124
|
+
/* @__PURE__ */ e(he, { body: i.tooltip_body, title: i.tooltip_title })
|
|
125
125
|
] })
|
|
126
126
|
] }),
|
|
127
127
|
/* @__PURE__ */ e(r, { borderLeft: `1px solid ${n.palette.border.light}`, pb: 12, pl: 24, pt: 12, children: A ? /* @__PURE__ */ o(P, { children: [
|
|
128
|
-
/* @__PURE__ */ e(
|
|
129
|
-
/* @__PURE__ */ e(k, { variant: "XSmall", whiteSpace: "nowrap", children:
|
|
128
|
+
/* @__PURE__ */ e(d, { variant: "H2", children: X(i.days, l) }),
|
|
129
|
+
/* @__PURE__ */ e(k, { variant: "XSmall", whiteSpace: "nowrap", children: i.next_paycheck })
|
|
130
130
|
] }) : /* @__PURE__ */ e(
|
|
131
131
|
H,
|
|
132
132
|
{
|
|
133
|
-
onClick:
|
|
133
|
+
onClick: a,
|
|
134
134
|
startIcon: /* @__PURE__ */ e(F, { name: "add" }),
|
|
135
135
|
sx: { fontSize: 13, lineHeight: "initial" },
|
|
136
|
-
children:
|
|
136
|
+
children: i.add_income
|
|
137
137
|
}
|
|
138
138
|
) })
|
|
139
139
|
]
|
|
140
140
|
}
|
|
141
141
|
) : /* @__PURE__ */ o(r, { border: `1px solid ${n.palette.border.light}`, borderRadius: 1, children: [
|
|
142
142
|
/* @__PURE__ */ o(r, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
143
|
-
/* @__PURE__ */ e(
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
/* @__PURE__ */ e(d, { variant: "Small", children: X(
|
|
144
|
+
i.total_cash_accounts,
|
|
145
|
+
C.length
|
|
146
146
|
) }),
|
|
147
147
|
/* @__PURE__ */ e(L, { amount: f, bold: !0, variant: "XSmall" })
|
|
148
148
|
] }),
|
|
149
149
|
/* @__PURE__ */ e(D, {}),
|
|
150
150
|
/* @__PURE__ */ o(r, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
151
|
-
/* @__PURE__ */ e(
|
|
151
|
+
/* @__PURE__ */ e(d, { variant: "Small", children: X(i.expenses_due, h.length) }),
|
|
152
152
|
/* @__PURE__ */ e(L, { amount: W, bold: !0, symbol: "-", variant: "XSmall" })
|
|
153
153
|
] }),
|
|
154
154
|
/* @__PURE__ */ e(D, {}),
|
|
@@ -163,13 +163,13 @@ const K = () => {
|
|
|
163
163
|
justifyContent: "space-between",
|
|
164
164
|
px: 16,
|
|
165
165
|
sx: { borderBottomLeftRadius: 4, borderBottomRightRadius: 4 },
|
|
166
|
-
children: /* @__PURE__ */ e(pe, { remaining:
|
|
166
|
+
children: /* @__PURE__ */ e(pe, { remaining: j })
|
|
167
167
|
}
|
|
168
168
|
),
|
|
169
169
|
/* @__PURE__ */ e(D, {}),
|
|
170
170
|
A ? /* @__PURE__ */ o(r, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
171
|
-
/* @__PURE__ */ e(
|
|
172
|
-
/* @__PURE__ */ e(
|
|
171
|
+
/* @__PURE__ */ e(d, { variant: "Small", children: i.next_paycheck }),
|
|
172
|
+
/* @__PURE__ */ e(d, { bold: !0, variant: "XSmall", children: X(i.days, l) })
|
|
173
173
|
] }) : /* @__PURE__ */ o(
|
|
174
174
|
r,
|
|
175
175
|
{
|
|
@@ -180,37 +180,37 @@ const K = () => {
|
|
|
180
180
|
pr: 2,
|
|
181
181
|
py: 2,
|
|
182
182
|
children: [
|
|
183
|
-
/* @__PURE__ */ e(
|
|
183
|
+
/* @__PURE__ */ e(d, { variant: "Small", children: i.next_paycheck }),
|
|
184
184
|
/* @__PURE__ */ e(
|
|
185
185
|
H,
|
|
186
186
|
{
|
|
187
|
-
onClick:
|
|
187
|
+
onClick: a,
|
|
188
188
|
startIcon: /* @__PURE__ */ e(F, { name: "add" }),
|
|
189
189
|
sx: { fontSize: 13 },
|
|
190
|
-
children:
|
|
190
|
+
children: i.add_income
|
|
191
191
|
}
|
|
192
192
|
)
|
|
193
193
|
]
|
|
194
194
|
}
|
|
195
195
|
)
|
|
196
196
|
] }) }) : /* @__PURE__ */ e(se, { height: s ? 210 : 120 });
|
|
197
|
-
}, bt = T(gt), xt = ({ onPrimaryCtaClick:
|
|
198
|
-
const { cashflow: t } = O(), { isCopyLoaded: s, isInitialized: c } = Y(), { loadRepeatingTransactions: f, setDateRange:
|
|
199
|
-
return
|
|
200
|
-
c && (
|
|
197
|
+
}, bt = T(gt), xt = ({ onPrimaryCtaClick: a, sx: n = {} }) => {
|
|
198
|
+
const { cashflow: t } = O(), { isCopyLoaded: s, isInitialized: c } = Y(), { loadRepeatingTransactions: f, setDateRange: m } = q();
|
|
199
|
+
return u.useEffect(() => {
|
|
200
|
+
c && (m({ start: M(), end: qe(M(), 1) }), f().finally());
|
|
201
201
|
}, [c]), s ? /* @__PURE__ */ e(
|
|
202
202
|
Qe,
|
|
203
203
|
{
|
|
204
204
|
className: "mx-exp-cashflow-miniwidget",
|
|
205
|
-
onPrimaryCtaClick:
|
|
205
|
+
onPrimaryCtaClick: a,
|
|
206
206
|
primaryCtaLabel: t.primary_cta,
|
|
207
207
|
subTitle: t.sub_title,
|
|
208
208
|
sx: n,
|
|
209
209
|
title: t.title,
|
|
210
|
-
children: /* @__PURE__ */ e(bt, { onAddIncomeClick:
|
|
210
|
+
children: /* @__PURE__ */ e(bt, { onAddIncomeClick: a })
|
|
211
211
|
}
|
|
212
212
|
) : /* @__PURE__ */ e(se, {});
|
|
213
|
-
}, On = T(xt),
|
|
213
|
+
}, On = T(xt), yt = ({ remaining: a }) => /* @__PURE__ */ e(
|
|
214
214
|
te,
|
|
215
215
|
{
|
|
216
216
|
sx: {
|
|
@@ -223,28 +223,28 @@ const K = () => {
|
|
|
223
223
|
borderBottomRightRadius: "3px",
|
|
224
224
|
minHeight: "auto"
|
|
225
225
|
},
|
|
226
|
-
children: /* @__PURE__ */ e(pe, { remaining:
|
|
226
|
+
children: /* @__PURE__ */ e(pe, { remaining: a })
|
|
227
227
|
}
|
|
228
228
|
);
|
|
229
|
-
var ne = /* @__PURE__ */ ((
|
|
230
|
-
const
|
|
229
|
+
var ne = /* @__PURE__ */ ((a) => (a.EXPENSE = "expense", a.INCOME = "income", a))(ne || {});
|
|
230
|
+
const Ct = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
231
231
|
/* @__PURE__ */ o(te, { sx: { display: "flex", alignItems: "center", gap: 16, px: 24, py: 12 }, children: [
|
|
232
232
|
/* @__PURE__ */ o(r, { alignItems: "center", height: 32, width: 32, children: [
|
|
233
|
-
/* @__PURE__ */ e(
|
|
234
|
-
/* @__PURE__ */ e(
|
|
233
|
+
/* @__PURE__ */ e(d, { bold: !0, sx: { fontSize: 11 }, children: Q(a.expectedDate, V.MONTH) }),
|
|
234
|
+
/* @__PURE__ */ e(d, { bold: !0, sx: { fontSize: 11 }, children: Q(a.expectedDate, V.DAY) })
|
|
235
235
|
] }),
|
|
236
|
-
/* @__PURE__ */ e(
|
|
236
|
+
/* @__PURE__ */ e(d, { sx: { flexGrow: 1, fontSize: 13 }, children: a.name }),
|
|
237
237
|
/* @__PURE__ */ e(
|
|
238
238
|
L,
|
|
239
239
|
{
|
|
240
|
-
amount:
|
|
240
|
+
amount: a.amount,
|
|
241
241
|
bold: !0,
|
|
242
242
|
sx: { textAlign: "right", fontSize: 13 }
|
|
243
243
|
}
|
|
244
244
|
)
|
|
245
245
|
] }),
|
|
246
246
|
/* @__PURE__ */ e(D, {})
|
|
247
|
-
] }), Ee = T(
|
|
247
|
+
] }), Ee = T(Ct), St = ({ total: a, type: n }) => {
|
|
248
248
|
const { cashflow: t } = O();
|
|
249
249
|
return /* @__PURE__ */ o(P, { children: [
|
|
250
250
|
/* @__PURE__ */ o(
|
|
@@ -260,36 +260,36 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
260
260
|
px: 24
|
|
261
261
|
},
|
|
262
262
|
children: [
|
|
263
|
-
/* @__PURE__ */ e(
|
|
264
|
-
/* @__PURE__ */ o(
|
|
263
|
+
/* @__PURE__ */ e(d, { bold: !0, sx: { fontSize: 12 }, children: n === ne.EXPENSE ? t.expenses : t.income }),
|
|
264
|
+
/* @__PURE__ */ o(d, { bold: !0, sx: { fontSize: 13 }, children: [
|
|
265
265
|
n === ne.EXPENSE ? "-" : "+",
|
|
266
|
-
Z(
|
|
266
|
+
Z(a, "0,0.00")
|
|
267
267
|
] })
|
|
268
268
|
]
|
|
269
269
|
}
|
|
270
270
|
),
|
|
271
271
|
/* @__PURE__ */ e(D, {})
|
|
272
272
|
] });
|
|
273
|
-
}, Te = T(
|
|
274
|
-
const { availableWidth:
|
|
273
|
+
}, Te = T(St), ae = (a, n) => (t) => t.accountGuid === a.guid && (We(t.expectedDate) || He(t.expectedDate, n.start)) && Fe(t.expectedDate, n.end), _t = () => {
|
|
274
|
+
const { availableWidth: a } = re(), { cashflow: n } = O(), { upcomingExpenses: t, upcomingIncome: s } = q(), { dateRange: c, selectedCashAccounts: f } = K();
|
|
275
275
|
return /* @__PURE__ */ o(r, { children: [
|
|
276
|
-
/* @__PURE__ */ o(r, { direction:
|
|
277
|
-
/* @__PURE__ */ e(
|
|
278
|
-
/* @__PURE__ */ o(
|
|
276
|
+
/* @__PURE__ */ o(r, { direction: a < 400 ? "column" : "row", justifyContent: "space-between", children: [
|
|
277
|
+
/* @__PURE__ */ e(d, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: n.accounts_breakdown }),
|
|
278
|
+
/* @__PURE__ */ o(d, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: [
|
|
279
279
|
Q(c.start, V.FULL_MONTH_DAY),
|
|
280
280
|
" -",
|
|
281
281
|
" ",
|
|
282
282
|
Q(c.end, V.FULL_MONTH_DAY)
|
|
283
283
|
] })
|
|
284
284
|
] }),
|
|
285
|
-
/* @__PURE__ */ e(r, { children: f.map((
|
|
286
|
-
const b = s.filter(
|
|
287
|
-
|
|
288
|
-
),
|
|
289
|
-
(l,
|
|
285
|
+
/* @__PURE__ */ e(r, { children: f.map((m) => {
|
|
286
|
+
const b = s.filter(ae(m, c)).sort((l, h) => U(l.expectedDate) - U(h.expectedDate)), y = t.filter(
|
|
287
|
+
ae(m, c)
|
|
288
|
+
), i = b.reduce(
|
|
289
|
+
(l, h) => l + h.amount,
|
|
290
290
|
0
|
|
291
|
-
), g =
|
|
292
|
-
(l,
|
|
291
|
+
), g = y.reduce(
|
|
292
|
+
(l, h) => l + h.amount,
|
|
293
293
|
0
|
|
294
294
|
);
|
|
295
295
|
return /* @__PURE__ */ o(
|
|
@@ -305,7 +305,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
305
305
|
/* @__PURE__ */ e(
|
|
306
306
|
Je,
|
|
307
307
|
{
|
|
308
|
-
account:
|
|
308
|
+
account: m,
|
|
309
309
|
listItemProps: {
|
|
310
310
|
disableGutters: !1,
|
|
311
311
|
disablePadding: !1,
|
|
@@ -317,39 +317,39 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
317
317
|
b.length > 0 && /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(
|
|
318
318
|
ee,
|
|
319
319
|
{
|
|
320
|
-
subheader: /* @__PURE__ */ e(Te, { total:
|
|
320
|
+
subheader: /* @__PURE__ */ e(Te, { total: i, type: ne.INCOME }),
|
|
321
321
|
sx: { width: "100%" },
|
|
322
322
|
children: b.map((l) => /* @__PURE__ */ e(Ee, { recurrence: l }, l.repeatingTransactionGuid))
|
|
323
323
|
}
|
|
324
324
|
) }),
|
|
325
|
-
|
|
325
|
+
y.length > 0 && /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(
|
|
326
326
|
ee,
|
|
327
327
|
{
|
|
328
328
|
subheader: /* @__PURE__ */ e(Te, { total: g, type: ne.EXPENSE }),
|
|
329
329
|
sx: { width: "100%" },
|
|
330
|
-
children:
|
|
330
|
+
children: y.map((l) => /* @__PURE__ */ e(Ee, { recurrence: l }, l.repeatingTransactionGuid))
|
|
331
331
|
}
|
|
332
332
|
) }),
|
|
333
333
|
/* @__PURE__ */ e(
|
|
334
|
-
|
|
334
|
+
yt,
|
|
335
335
|
{
|
|
336
|
-
remaining: (
|
|
336
|
+
remaining: (m.available_balance || m.balance || 0) + i - g
|
|
337
337
|
}
|
|
338
338
|
)
|
|
339
339
|
]
|
|
340
340
|
},
|
|
341
|
-
|
|
341
|
+
m.guid
|
|
342
342
|
);
|
|
343
343
|
}) })
|
|
344
344
|
] });
|
|
345
|
-
},
|
|
346
|
-
const { availableWidth:
|
|
345
|
+
}, wt = T(_t), It = () => {
|
|
346
|
+
const { availableWidth: a } = re(), n = ie(), { cashflow: t } = O(), { upcomingExpenses: s, upcomingIncome: c } = q(), { dateRange: f, selectedCashAccounts: m } = K(), b = [
|
|
347
347
|
{
|
|
348
348
|
field: "account",
|
|
349
349
|
flex: 1.5,
|
|
350
350
|
headerName: t.accounts,
|
|
351
|
-
renderCell: ({ value: { name:
|
|
352
|
-
const
|
|
351
|
+
renderCell: ({ value: { name: i, nickname: g, institution_guid: l, account_number: h } }) => {
|
|
352
|
+
const C = g || i;
|
|
353
353
|
return /* @__PURE__ */ o(r, { alignItems: "center", flexDirection: "row", gap: 12, children: [
|
|
354
354
|
/* @__PURE__ */ e(
|
|
355
355
|
xe,
|
|
@@ -359,7 +359,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
359
359
|
size: 16
|
|
360
360
|
}
|
|
361
361
|
),
|
|
362
|
-
`${
|
|
362
|
+
/* @__PURE__ */ e(d, { variant: "body2", children: `${C} ${h ? `*${h}` : ""}` })
|
|
363
363
|
] });
|
|
364
364
|
}
|
|
365
365
|
},
|
|
@@ -368,31 +368,31 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
368
368
|
flex: 1,
|
|
369
369
|
headerName: t.balance,
|
|
370
370
|
type: "number",
|
|
371
|
-
renderCell: (
|
|
371
|
+
renderCell: (i) => /* @__PURE__ */ e(d, { color: n.palette.text.primary, variant: "Small", children: Z(i.value, "0,0.00") })
|
|
372
372
|
},
|
|
373
373
|
{
|
|
374
374
|
field: "income",
|
|
375
375
|
flex: 1,
|
|
376
376
|
headerName: t.projected_income,
|
|
377
377
|
type: "number",
|
|
378
|
-
renderCell: (
|
|
378
|
+
renderCell: (i) => /* @__PURE__ */ e(d, { color: n.palette.text.primary, variant: "Small", children: `+${Z(i.value, "0,0.00")}` })
|
|
379
379
|
},
|
|
380
380
|
{
|
|
381
381
|
field: "expenses",
|
|
382
382
|
flex: 1.1,
|
|
383
383
|
headerName: t.projected_expenses,
|
|
384
384
|
type: "number",
|
|
385
|
-
renderCell: (
|
|
385
|
+
renderCell: (i) => /* @__PURE__ */ e(d, { color: n.palette.text.primary, variant: "Small", children: `-${Z(i.value, "0,0.00")}` })
|
|
386
386
|
},
|
|
387
387
|
{
|
|
388
388
|
field: "remaining",
|
|
389
389
|
flex: 1,
|
|
390
390
|
headerName: t.remaining,
|
|
391
391
|
type: "number",
|
|
392
|
-
renderCell: (
|
|
393
|
-
const g =
|
|
392
|
+
renderCell: (i) => {
|
|
393
|
+
const g = i.row.balance + i.row.income - i.row.expenses;
|
|
394
394
|
return /* @__PURE__ */ e(
|
|
395
|
-
|
|
395
|
+
d,
|
|
396
396
|
{
|
|
397
397
|
color: Math.sign(g) === -1 ? n.palette.error.main : n.palette.text.primary,
|
|
398
398
|
variant: "Small",
|
|
@@ -401,21 +401,21 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
401
401
|
);
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
|
-
],
|
|
404
|
+
], y = u.useMemo(() => m.map((i) => {
|
|
405
405
|
const g = s.filter(
|
|
406
|
-
|
|
407
|
-
).reduce((
|
|
408
|
-
|
|
409
|
-
).reduce((
|
|
406
|
+
ae(i, { start: M(), end: Ce(M(), 30) })
|
|
407
|
+
).reduce((C, S) => C + S.amount, 0), l = c.filter(
|
|
408
|
+
ae(i, { start: M(), end: Ce(M(), 30) })
|
|
409
|
+
).reduce((C, S) => C + S.amount, 0), h = (i.balance || 0) + l - g;
|
|
410
410
|
return {
|
|
411
|
-
account:
|
|
412
|
-
balance:
|
|
413
|
-
id:
|
|
411
|
+
account: i,
|
|
412
|
+
balance: i.balance || 0,
|
|
413
|
+
id: i.guid,
|
|
414
414
|
income: l,
|
|
415
415
|
expenses: g,
|
|
416
|
-
remaining:
|
|
416
|
+
remaining: h
|
|
417
417
|
};
|
|
418
|
-
}), [
|
|
418
|
+
}), [m, s, c]);
|
|
419
419
|
return /* @__PURE__ */ o(
|
|
420
420
|
I,
|
|
421
421
|
{
|
|
@@ -426,13 +426,13 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
426
426
|
/* @__PURE__ */ o(
|
|
427
427
|
r,
|
|
428
428
|
{
|
|
429
|
-
direction:
|
|
429
|
+
direction: a < 540 ? "column" : "row",
|
|
430
430
|
justifyContent: "space-between",
|
|
431
431
|
mb: 12,
|
|
432
432
|
children: [
|
|
433
433
|
/* @__PURE__ */ o(r, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
434
434
|
/* @__PURE__ */ e(
|
|
435
|
-
|
|
435
|
+
d,
|
|
436
436
|
{
|
|
437
437
|
bold: !0,
|
|
438
438
|
sx: {
|
|
@@ -450,7 +450,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
450
450
|
}
|
|
451
451
|
)
|
|
452
452
|
] }),
|
|
453
|
-
/* @__PURE__ */ o(
|
|
453
|
+
/* @__PURE__ */ o(d, { bold: !0, sx: { fontSize: 15, whiteSpace: "normal" }, children: [
|
|
454
454
|
Q(f.start, V.FULL_MONTH_DAY),
|
|
455
455
|
" -",
|
|
456
456
|
" ",
|
|
@@ -459,7 +459,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
459
459
|
]
|
|
460
460
|
}
|
|
461
461
|
),
|
|
462
|
-
|
|
462
|
+
a > 650 ? /* @__PURE__ */ e(
|
|
463
463
|
nt,
|
|
464
464
|
{
|
|
465
465
|
columnHeaderHeight: 48,
|
|
@@ -469,7 +469,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
469
469
|
disableRowSelectionOnClick: !0,
|
|
470
470
|
hideFooter: !0,
|
|
471
471
|
rowHeight: 48,
|
|
472
|
-
rows:
|
|
472
|
+
rows: y,
|
|
473
473
|
sx: {
|
|
474
474
|
border: "1px solid",
|
|
475
475
|
borderColor: "border.light",
|
|
@@ -480,13 +480,17 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
480
480
|
backgroundColor: et(n.palette.primary.main, 0.1)
|
|
481
481
|
}
|
|
482
482
|
},
|
|
483
|
+
"& .MuiDataGrid-columnHeaderTitle": {
|
|
484
|
+
fontFamily: n.typography.h3.fontFamily,
|
|
485
|
+
fontSize: n.typography.body2.fontSize
|
|
486
|
+
},
|
|
483
487
|
"& .MuiDataGrid-sortIcon": {
|
|
484
488
|
color: n.palette.primary.main
|
|
485
489
|
}
|
|
486
490
|
}
|
|
487
491
|
}
|
|
488
|
-
) :
|
|
489
|
-
const { name: g, nickname: l, institution_guid:
|
|
492
|
+
) : y.map((i) => {
|
|
493
|
+
const { name: g, nickname: l, institution_guid: h, account_number: C } = i.account, S = l || g;
|
|
490
494
|
return /* @__PURE__ */ e(
|
|
491
495
|
ee,
|
|
492
496
|
{
|
|
@@ -511,13 +515,13 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
511
515
|
xe,
|
|
512
516
|
{
|
|
513
517
|
alt: t.institution_logo,
|
|
514
|
-
institutionGuid:
|
|
518
|
+
institutionGuid: h || "",
|
|
515
519
|
size: 16
|
|
516
520
|
}
|
|
517
521
|
),
|
|
518
|
-
/* @__PURE__ */ e(
|
|
522
|
+
/* @__PURE__ */ e(d, { variant: "Small", children: `${S} ${C ? `*${C}` : ""}` })
|
|
519
523
|
] }),
|
|
520
|
-
/* @__PURE__ */ e(L, { amount:
|
|
524
|
+
/* @__PURE__ */ e(L, { amount: i.balance, bold: !0, variant: "Small" })
|
|
521
525
|
]
|
|
522
526
|
}
|
|
523
527
|
),
|
|
@@ -531,8 +535,8 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
531
535
|
px: 16,
|
|
532
536
|
py: 12,
|
|
533
537
|
children: [
|
|
534
|
-
/* @__PURE__ */ e(
|
|
535
|
-
/* @__PURE__ */ e(L, { amount:
|
|
538
|
+
/* @__PURE__ */ e(d, { variant: "Small", children: t.projected_income }),
|
|
539
|
+
/* @__PURE__ */ e(L, { amount: i.income, bold: !0, symbol: "+", variant: "Small" })
|
|
536
540
|
]
|
|
537
541
|
}
|
|
538
542
|
),
|
|
@@ -546,8 +550,8 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
546
550
|
px: 16,
|
|
547
551
|
py: 12,
|
|
548
552
|
children: [
|
|
549
|
-
/* @__PURE__ */ e(
|
|
550
|
-
/* @__PURE__ */ e(L, { amount:
|
|
553
|
+
/* @__PURE__ */ e(d, { variant: "Small", children: t.projected_expenses }),
|
|
554
|
+
/* @__PURE__ */ e(L, { amount: i.expenses, bold: !0, symbol: "-", variant: "Small" })
|
|
551
555
|
]
|
|
552
556
|
}
|
|
553
557
|
),
|
|
@@ -563,28 +567,28 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
563
567
|
px: 16,
|
|
564
568
|
py: 12,
|
|
565
569
|
sx: { borderBottomLeftRadius: "4px", borderBottomRightRadius: "4px" },
|
|
566
|
-
children: /* @__PURE__ */ e(pe, { remaining:
|
|
570
|
+
children: /* @__PURE__ */ e(pe, { remaining: i.remaining })
|
|
567
571
|
}
|
|
568
572
|
)
|
|
569
573
|
] }) })
|
|
570
574
|
},
|
|
571
|
-
|
|
575
|
+
i.id
|
|
572
576
|
);
|
|
573
577
|
})
|
|
574
578
|
]
|
|
575
579
|
}
|
|
576
580
|
);
|
|
577
581
|
}, Dt = T(It), vt = () => {
|
|
578
|
-
const { cashflow:
|
|
582
|
+
const { cashflow: a } = O(), { isDesktop: n } = ue(), { onEvent: t } = Ne(), [s, c] = u.useState(0), f = (m, b) => {
|
|
579
583
|
c(b);
|
|
580
584
|
};
|
|
581
|
-
return
|
|
585
|
+
return u.useEffect(() => {
|
|
582
586
|
t(s === 0 ? "cash_flow_summary" : "cash_flow_details");
|
|
583
587
|
}, [s]), /* @__PURE__ */ o(I, { children: [
|
|
584
588
|
/* @__PURE__ */ o(
|
|
585
589
|
Ke,
|
|
586
590
|
{
|
|
587
|
-
"aria-label":
|
|
591
|
+
"aria-label": a.cashflow_summary_and_details,
|
|
588
592
|
centered: !0,
|
|
589
593
|
onChange: f,
|
|
590
594
|
textColor: "primary",
|
|
@@ -592,22 +596,22 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
592
596
|
variant: "fullWidth",
|
|
593
597
|
children: [
|
|
594
598
|
/* @__PURE__ */ e(
|
|
595
|
-
|
|
599
|
+
ye,
|
|
596
600
|
{
|
|
597
601
|
"aria-controls": "cashflow-tabpanel-0",
|
|
598
602
|
id: "cashflow-tab-0",
|
|
599
|
-
label:
|
|
603
|
+
label: a.summary,
|
|
600
604
|
sx: {
|
|
601
605
|
textTransform: "none"
|
|
602
606
|
}
|
|
603
607
|
}
|
|
604
608
|
),
|
|
605
609
|
/* @__PURE__ */ e(
|
|
606
|
-
|
|
610
|
+
ye,
|
|
607
611
|
{
|
|
608
612
|
"aria-controls": "cashflow-tabpanel-1",
|
|
609
613
|
id: "cashflow-tab-1",
|
|
610
|
-
label:
|
|
614
|
+
label: a.details,
|
|
611
615
|
sx: {
|
|
612
616
|
textTransform: "none"
|
|
613
617
|
}
|
|
@@ -617,11 +621,11 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
617
621
|
}
|
|
618
622
|
),
|
|
619
623
|
/* @__PURE__ */ e(I, { sx: { mb: 32 } }),
|
|
620
|
-
/* @__PURE__ */ e(
|
|
621
|
-
/* @__PURE__ */ e(
|
|
624
|
+
/* @__PURE__ */ e(Se, { index: 0, name: "cashflow", value: s, children: /* @__PURE__ */ e(I, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(Dt, {}) }) }),
|
|
625
|
+
/* @__PURE__ */ e(Se, { index: 1, name: "cashflow", value: s, children: /* @__PURE__ */ e(I, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(wt, {}) }) })
|
|
622
626
|
] });
|
|
623
627
|
}, At = T(vt), oe = ({
|
|
624
|
-
amount:
|
|
628
|
+
amount: a,
|
|
625
629
|
isMobile: n = !1,
|
|
626
630
|
isTotal: t = !1,
|
|
627
631
|
label: s,
|
|
@@ -636,25 +640,25 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
636
640
|
padding: n ? "14px 16px" : 0,
|
|
637
641
|
sx: { borderBottomLeftRadius: 4, borderBottomRightRadius: 4 },
|
|
638
642
|
children: [
|
|
639
|
-
!n && /* @__PURE__ */ e(L, { amount:
|
|
643
|
+
!n && /* @__PURE__ */ e(L, { amount: a, component: "h2", variant: "H2" }),
|
|
640
644
|
/* @__PURE__ */ o(r, { alignItems: "center", component: "span", direction: "row", gap: 8, mt: 2, children: [
|
|
641
|
-
/* @__PURE__ */ e(
|
|
645
|
+
/* @__PURE__ */ e(d, { bold: t, variant: "Small", children: s }),
|
|
642
646
|
f
|
|
643
647
|
] }),
|
|
644
|
-
n && /* @__PURE__ */ e(L, { amount:
|
|
648
|
+
n && /* @__PURE__ */ e(L, { amount: a, component: "h2", symbol: c, variant: "Small" })
|
|
645
649
|
]
|
|
646
650
|
}
|
|
647
|
-
), Re = (
|
|
648
|
-
const { availableWidth:
|
|
651
|
+
), Re = (a, n) => (t) => t.accountGuid && a.includes(t.accountGuid) && (We(t.expectedDate) || He(t.expectedDate, n.start)) && Fe(t.expectedDate, n.end), Et = () => {
|
|
652
|
+
const { availableWidth: a } = re(), { cashflow: n } = O(), { upcomingExpenses: t, upcomingIncome: s } = q(), { selectedAccountGuids: c } = Y(), { dateRange: f, selectedCashAccounts: m } = K(), { userProfile: b } = me(), [y, i] = u.useState(!1), g = u.useMemo(
|
|
649
653
|
() => t.filter(Re(c, f)),
|
|
650
654
|
[f, c, t]
|
|
651
|
-
), l =
|
|
655
|
+
), l = u.useMemo(
|
|
652
656
|
() => s.filter(Re(c, f)),
|
|
653
657
|
[f, c, s]
|
|
654
|
-
),
|
|
655
|
-
() =>
|
|
656
|
-
[
|
|
657
|
-
),
|
|
658
|
+
), h = u.useMemo(
|
|
659
|
+
() => m.reduce((N, _) => N + (_?.balance || 0), 0),
|
|
660
|
+
[m]
|
|
661
|
+
), C = g.reduce((N, _) => N + _.amount, 0), S = l.reduce((N, _) => N + _.amount, 0), v = h - C + S, p = a < 725;
|
|
658
662
|
return /* @__PURE__ */ o(r, { sx: { mx: p ? 16 : 0, my: p ? 24 : 42 }, children: [
|
|
659
663
|
/* @__PURE__ */ o(
|
|
660
664
|
r,
|
|
@@ -669,18 +673,18 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
669
673
|
/* @__PURE__ */ e(
|
|
670
674
|
oe,
|
|
671
675
|
{
|
|
672
|
-
amount:
|
|
676
|
+
amount: h,
|
|
673
677
|
isMobile: p,
|
|
674
678
|
label: n.cash_and_bank
|
|
675
679
|
}
|
|
676
680
|
),
|
|
677
681
|
p && /* @__PURE__ */ e(D, {}),
|
|
678
682
|
b?.has_completed_cash_flow_onboarding ? /* @__PURE__ */ o(P, { children: [
|
|
679
|
-
!p && /* @__PURE__ */ e(
|
|
683
|
+
!p && /* @__PURE__ */ e(d, { sx: { fontSize: 25, lineHeight: 1 }, children: "+" }),
|
|
680
684
|
/* @__PURE__ */ e(
|
|
681
685
|
oe,
|
|
682
686
|
{
|
|
683
|
-
amount:
|
|
687
|
+
amount: S,
|
|
684
688
|
isMobile: p,
|
|
685
689
|
label: n.to_be_received,
|
|
686
690
|
symbol: p ? "+" : void 0
|
|
@@ -689,23 +693,23 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
689
693
|
] }) : /* @__PURE__ */ e(
|
|
690
694
|
H,
|
|
691
695
|
{
|
|
692
|
-
onClick: () =>
|
|
696
|
+
onClick: () => i(!0),
|
|
693
697
|
startIcon: /* @__PURE__ */ e(F, { name: "add" }),
|
|
694
698
|
sx: { fontSize: 13 },
|
|
695
699
|
children: n.add_income
|
|
696
700
|
}
|
|
697
701
|
),
|
|
698
|
-
p ? /* @__PURE__ */ e(D, {}) : /* @__PURE__ */ e(
|
|
702
|
+
p ? /* @__PURE__ */ e(D, {}) : /* @__PURE__ */ e(d, { sx: { fontSize: 25, lineHeight: 1 }, children: "-" }),
|
|
699
703
|
/* @__PURE__ */ e(
|
|
700
704
|
oe,
|
|
701
705
|
{
|
|
702
|
-
amount:
|
|
706
|
+
amount: C,
|
|
703
707
|
isMobile: p,
|
|
704
708
|
label: n.to_be_paid_out,
|
|
705
709
|
symbol: p ? "-" : void 0
|
|
706
710
|
}
|
|
707
711
|
),
|
|
708
|
-
p ? /* @__PURE__ */ e(D, {}) : /* @__PURE__ */ e(
|
|
712
|
+
p ? /* @__PURE__ */ e(D, {}) : /* @__PURE__ */ e(d, { sx: { fontSize: 25, lineHeight: 1 }, children: "=" }),
|
|
709
713
|
/* @__PURE__ */ e(
|
|
710
714
|
oe,
|
|
711
715
|
{
|
|
@@ -729,16 +733,16 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
729
733
|
$e,
|
|
730
734
|
{
|
|
731
735
|
ariaLabelClose: n.close_manage_income_aria,
|
|
732
|
-
isOpen:
|
|
733
|
-
onClose: () =>
|
|
736
|
+
isOpen: y,
|
|
737
|
+
onClose: () => i(!1),
|
|
734
738
|
shouldShowHeaderBorders: !1,
|
|
735
739
|
title: n.manage_income,
|
|
736
740
|
children: /* @__PURE__ */ e(ot, {})
|
|
737
741
|
}
|
|
738
742
|
)
|
|
739
743
|
] });
|
|
740
|
-
}, Tt = T(Et), Rt = ({ handleNextStep:
|
|
741
|
-
const { completeOnboarding: n } = de(), { cashflow: t } = O(), s =
|
|
744
|
+
}, Tt = T(Et), Rt = ({ handleNextStep: a }) => {
|
|
745
|
+
const { completeOnboarding: n } = de(), { cashflow: t } = O(), s = ie();
|
|
742
746
|
return /* @__PURE__ */ o(r, { children: [
|
|
743
747
|
/* @__PURE__ */ e(le, { pb: 12, children: t.welcome_title }),
|
|
744
748
|
/* @__PURE__ */ e(
|
|
@@ -803,7 +807,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
803
807
|
] })
|
|
804
808
|
] }),
|
|
805
809
|
/* @__PURE__ */ o(r, { direction: "row", spacing: 16, children: [
|
|
806
|
-
/* @__PURE__ */ e(H, { onClick:
|
|
810
|
+
/* @__PURE__ */ e(H, { onClick: a, variant: "contained", children: t.get_started_button }),
|
|
807
811
|
/* @__PURE__ */ e(H, { onClick: n, variant: "outlined", children: t.skip_button })
|
|
808
812
|
] })
|
|
809
813
|
] });
|
|
@@ -811,11 +815,11 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
811
815
|
CASHFLOW_ONBOARDING: `${Le}/cashflow-onboarding.png`,
|
|
812
816
|
CASHFLOW_LOADING_ANIMATION: `${Le}/loading-animation.gif`
|
|
813
817
|
}, Ot = () => {
|
|
814
|
-
const { cashflow:
|
|
815
|
-
return /* @__PURE__ */ o(
|
|
818
|
+
const { cashflow: a } = O();
|
|
819
|
+
return /* @__PURE__ */ o(u.Fragment, { children: [
|
|
816
820
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("img", { alt: "Loading", src: Ge.CASHFLOW_LOADING_ANIMATION }) }),
|
|
817
|
-
/* @__PURE__ */ e(le, { pb: 12, children:
|
|
818
|
-
/* @__PURE__ */ e(k, { children:
|
|
821
|
+
/* @__PURE__ */ e(le, { pb: 12, children: a.loading_title }),
|
|
822
|
+
/* @__PURE__ */ e(k, { children: a.loading_description })
|
|
819
823
|
] });
|
|
820
824
|
}, Nt = T(Ot), kt = tt`
|
|
821
825
|
from {
|
|
@@ -825,22 +829,22 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
825
829
|
transform: rotate(360deg);
|
|
826
830
|
}
|
|
827
831
|
`, Ht = () => {
|
|
828
|
-
const { addRepeatingTransaction:
|
|
832
|
+
const { addRepeatingTransaction: a, repeatingTransactions: n } = q(), { cashflow: t, common: s } = O(), { completeOnboarding: c } = de(), { isDirty: f } = K(), { isMobile: m } = ue(), { isCopyLoaded: b, setDisplayedDate: y } = Y(), { filter: i, setFilter: g, transactions: l } = ke(), h = ie(), [C, S] = J(!0), [v, p] = u.useState(mt.EveryMonth), [N, _] = u.useState(1), [z, G] = u.useState(15), [W, j] = J(!1), [A, R] = J(1), [w, ze] = J([]), [fe, ce] = J(""), $ = u.useMemo(
|
|
829
833
|
() => l.find((x) => x.guid === fe),
|
|
830
834
|
[fe, l]
|
|
831
|
-
),
|
|
835
|
+
), je = !!n.filter(
|
|
832
836
|
(x) => x.repeating_transaction_type === Ie.Income
|
|
833
837
|
).length, ge = async () => {
|
|
834
|
-
R(2),
|
|
838
|
+
R(2), y(
|
|
835
839
|
// Beginning of the month, 90 days before today
|
|
836
840
|
ct(Me(M(), 90)),
|
|
837
841
|
M()
|
|
838
|
-
), g({ ...
|
|
842
|
+
), g({ ...i, custom: _e }), R(3);
|
|
839
843
|
}, Be = async () => {
|
|
840
|
-
if (!(
|
|
841
|
-
|
|
842
|
-
for (let x = 0; x <
|
|
843
|
-
const E =
|
|
844
|
+
if (!(w.length < 1)) {
|
|
845
|
+
j(!0);
|
|
846
|
+
for (let x = 0; x < w.length; x++) {
|
|
847
|
+
const E = w[x], be = De(v, we(E.date)), Pe = {
|
|
844
848
|
account_guid: E.account_guid,
|
|
845
849
|
amount: E.amount,
|
|
846
850
|
merchant_guid: E.merchant_guid,
|
|
@@ -851,19 +855,19 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
851
855
|
repeating_transaction_type: Ie.Income,
|
|
852
856
|
transaction_type: E.transaction_type
|
|
853
857
|
};
|
|
854
|
-
await
|
|
858
|
+
await a(Pe, E);
|
|
855
859
|
}
|
|
856
860
|
await c();
|
|
857
861
|
}
|
|
858
|
-
}, Ue = !$ &&
|
|
862
|
+
}, Ue = !$ && C || !$ && w.length < 1;
|
|
859
863
|
return b ? /* @__PURE__ */ o(
|
|
860
864
|
I,
|
|
861
865
|
{
|
|
862
866
|
sx: {
|
|
863
867
|
display: "flex",
|
|
864
|
-
alignItems:
|
|
865
|
-
backgroundColor:
|
|
866
|
-
backgroundImage:
|
|
868
|
+
alignItems: m ? "flex-start" : "center",
|
|
869
|
+
backgroundColor: h.palette.background.paper,
|
|
870
|
+
backgroundImage: m ? null : `url(${Ge.CASHFLOW_ONBOARDING})`,
|
|
867
871
|
backgroundRepeat: "no-repeat",
|
|
868
872
|
backgroundPosition: "left 100px",
|
|
869
873
|
backgroundSize: "35%",
|
|
@@ -874,7 +878,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
874
878
|
I,
|
|
875
879
|
{
|
|
876
880
|
sx: {
|
|
877
|
-
...
|
|
881
|
+
...m ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
878
882
|
},
|
|
879
883
|
children: /* @__PURE__ */ e(Lt, { handleNextStep: ge })
|
|
880
884
|
}
|
|
@@ -883,7 +887,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
883
887
|
I,
|
|
884
888
|
{
|
|
885
889
|
sx: {
|
|
886
|
-
...
|
|
890
|
+
...m ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
887
891
|
},
|
|
888
892
|
children: /* @__PURE__ */ e(Nt, {})
|
|
889
893
|
}
|
|
@@ -892,25 +896,25 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
892
896
|
I,
|
|
893
897
|
{
|
|
894
898
|
sx: {
|
|
895
|
-
...
|
|
899
|
+
...m ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
896
900
|
},
|
|
897
901
|
children: [
|
|
898
902
|
/* @__PURE__ */ e(le, { pb: 12, children: t.add_income_title }),
|
|
899
903
|
/* @__PURE__ */ e(k, { mb: 24, children: t.add_income_description }),
|
|
900
|
-
|
|
901
|
-
/* @__PURE__ */ e(ee, { children:
|
|
904
|
+
w.length > 0 && !$ && /* @__PURE__ */ o(P, { children: [
|
|
905
|
+
/* @__PURE__ */ e(ee, { children: w.map((x, E) => /* @__PURE__ */ o(u.Fragment, { children: [
|
|
902
906
|
/* @__PURE__ */ e(lt, { bgcolor: "background.paper", children: ut(
|
|
903
907
|
U(x.nextDate || x.date)
|
|
904
908
|
) }),
|
|
905
909
|
/* @__PURE__ */ e(dt, { transaction: x }),
|
|
906
|
-
E !==
|
|
910
|
+
E !== w.length - 1 && /* @__PURE__ */ e(D, {})
|
|
907
911
|
] }, x.guid)) }),
|
|
908
912
|
/* @__PURE__ */ o(r, { alignItems: "center", direction: "row", children: [
|
|
909
913
|
/* @__PURE__ */ e(D, { sx: { flexGrow: 1 } }),
|
|
910
914
|
/* @__PURE__ */ e(
|
|
911
915
|
H,
|
|
912
916
|
{
|
|
913
|
-
onClick: () =>
|
|
917
|
+
onClick: () => S(!0),
|
|
914
918
|
startIcon: /* @__PURE__ */ e(F, { name: "add", size: 20 }),
|
|
915
919
|
children: t.add_income
|
|
916
920
|
}
|
|
@@ -918,19 +922,19 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
918
922
|
] })
|
|
919
923
|
] }),
|
|
920
924
|
Ue && /* @__PURE__ */ e(
|
|
921
|
-
|
|
925
|
+
at,
|
|
922
926
|
{
|
|
923
927
|
bgcolor: "background.paper",
|
|
924
928
|
onSearch: (x) => g({
|
|
925
|
-
...
|
|
926
|
-
custom: (E) => x ?
|
|
929
|
+
...i,
|
|
930
|
+
custom: (E) => x ? it(E, x) : _e(E)
|
|
927
931
|
}),
|
|
928
932
|
onSelected: (x) => {
|
|
929
|
-
ce(x),
|
|
933
|
+
ce(x), S(!1);
|
|
930
934
|
}
|
|
931
935
|
}
|
|
932
936
|
),
|
|
933
|
-
!
|
|
937
|
+
!je && f && /* @__PURE__ */ e(k, { color: "error", mt: 16, children: t.confirm_error }),
|
|
934
938
|
$ && /* @__PURE__ */ o(P, { children: [
|
|
935
939
|
/* @__PURE__ */ e(
|
|
936
940
|
rt,
|
|
@@ -938,10 +942,10 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
938
942
|
bgcolor: "background.paper",
|
|
939
943
|
firstDay: N,
|
|
940
944
|
frequency: v,
|
|
941
|
-
onFirstDayChange:
|
|
945
|
+
onFirstDayChange: _,
|
|
942
946
|
onFrequencyChange: p,
|
|
943
947
|
onSecondDayChange: G,
|
|
944
|
-
secondDay:
|
|
948
|
+
secondDay: z,
|
|
945
949
|
transaction: $
|
|
946
950
|
}
|
|
947
951
|
),
|
|
@@ -951,12 +955,12 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
951
955
|
{
|
|
952
956
|
"aria-disabled": !$,
|
|
953
957
|
onClick: () => {
|
|
954
|
-
const x = [...
|
|
958
|
+
const x = [...w];
|
|
955
959
|
x.push({
|
|
956
960
|
...$,
|
|
957
|
-
nextDate: De(v,
|
|
961
|
+
nextDate: De(v, we($.date)),
|
|
958
962
|
frequency: v
|
|
959
|
-
}),
|
|
963
|
+
}), ze(x), ce("");
|
|
960
964
|
},
|
|
961
965
|
variant: "contained",
|
|
962
966
|
children: s.confirm_button
|
|
@@ -966,7 +970,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
966
970
|
H,
|
|
967
971
|
{
|
|
968
972
|
onClick: () => {
|
|
969
|
-
ce(""),
|
|
973
|
+
ce(""), S(!0), ge().finally();
|
|
970
974
|
},
|
|
971
975
|
variant: "outlined",
|
|
972
976
|
children: s.cancel_button
|
|
@@ -974,11 +978,11 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
974
978
|
)
|
|
975
979
|
] })
|
|
976
980
|
] }),
|
|
977
|
-
|
|
981
|
+
w.length > 0 && !$ && /* @__PURE__ */ o(r, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
|
|
978
982
|
/* @__PURE__ */ e(
|
|
979
983
|
H,
|
|
980
984
|
{
|
|
981
|
-
"aria-disabled":
|
|
985
|
+
"aria-disabled": w.length < 1 || W,
|
|
982
986
|
onClick: Be,
|
|
983
987
|
startIcon: W ? /* @__PURE__ */ e(
|
|
984
988
|
F,
|
|
@@ -1001,30 +1005,30 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
1001
1005
|
]
|
|
1002
1006
|
}
|
|
1003
1007
|
) : /* @__PURE__ */ e(se, {});
|
|
1004
|
-
}, Ft = T(Ht), Wt = ({ onBackClick:
|
|
1008
|
+
}, Ft = T(Ht), Wt = ({ onBackClick: a, sx: n = {} }) => {
|
|
1005
1009
|
const {
|
|
1006
1010
|
selectedAccounts: t,
|
|
1007
1011
|
selectedAccountGuids: s,
|
|
1008
1012
|
setSelectedAccounts: c,
|
|
1009
1013
|
shouldDisableNextDate: f,
|
|
1010
|
-
shouldDisablePrevDate:
|
|
1011
|
-
} = Y(), { onEvent: b } = Ne(), { visibleCashAccounts:
|
|
1012
|
-
return
|
|
1013
|
-
|
|
1014
|
-
}, [
|
|
1015
|
-
c(
|
|
1016
|
-
}, [
|
|
1017
|
-
const W =
|
|
1014
|
+
shouldDisablePrevDate: m
|
|
1015
|
+
} = Y(), { onEvent: b } = Ne(), { visibleCashAccounts: y } = Oe(), { setFilter: i } = ke(), { userProfile: g } = me(), { dateRange: l, setSelectedCashAccounts: h } = K(), { loadRepeatingTransactions: C, setDateRange: S } = q(), { cashflow: v, recurring: p } = O(), { isCopyLoaded: N, isInitialized: _ } = Y(), [z, G] = u.useState(!1);
|
|
1016
|
+
return u.useEffect(() => {
|
|
1017
|
+
_ && (S(l), C().finally());
|
|
1018
|
+
}, [_]), u.useEffect(() => {
|
|
1019
|
+
c(y);
|
|
1020
|
+
}, [y]), u.useEffect(() => {
|
|
1021
|
+
const W = y.map((A) => A.guid), j = t.filter(
|
|
1018
1022
|
(A) => s.includes(A.guid) && W.includes(A.guid)
|
|
1019
1023
|
);
|
|
1020
|
-
|
|
1024
|
+
h(j), i({
|
|
1021
1025
|
dateRange: { start: Me(M(), 90), end: ht() },
|
|
1022
|
-
accounts:
|
|
1026
|
+
accounts: j.map((A) => A.guid)
|
|
1023
1027
|
});
|
|
1024
|
-
}, [
|
|
1028
|
+
}, [y, t]), !N || !_ ? /* @__PURE__ */ e(se, {}) : g?.has_completed_cash_flow_onboarding ? /* @__PURE__ */ o(
|
|
1025
1029
|
ve,
|
|
1026
1030
|
{
|
|
1027
|
-
accountOptions:
|
|
1031
|
+
accountOptions: y,
|
|
1028
1032
|
actions: [
|
|
1029
1033
|
{
|
|
1030
1034
|
label: p.action_title,
|
|
@@ -1036,7 +1040,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
1036
1040
|
],
|
|
1037
1041
|
calendarActions: {
|
|
1038
1042
|
shouldDisableNext: f,
|
|
1039
|
-
shouldDisablePrevious:
|
|
1043
|
+
shouldDisablePrevious: m,
|
|
1040
1044
|
shouldDisablePicker: !0,
|
|
1041
1045
|
onRangeChanged: () => {
|
|
1042
1046
|
}
|
|
@@ -1044,7 +1048,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
1044
1048
|
dateRange: l,
|
|
1045
1049
|
dateRangeVariant: "readonly",
|
|
1046
1050
|
onAccountsFilterClick: () => b(Ae.CASH_FLOW_CLICK_FILTER),
|
|
1047
|
-
onBackClick:
|
|
1051
|
+
onBackClick: a,
|
|
1048
1052
|
sx: n,
|
|
1049
1053
|
title: v.title,
|
|
1050
1054
|
children: [
|
|
@@ -1054,7 +1058,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
1054
1058
|
$e,
|
|
1055
1059
|
{
|
|
1056
1060
|
ariaLabelClose: v.close_settings_aria,
|
|
1057
|
-
isOpen:
|
|
1061
|
+
isOpen: z,
|
|
1058
1062
|
onClose: () => G(!1),
|
|
1059
1063
|
shouldShowHeaderBorders: !1,
|
|
1060
1064
|
title: p.action_title,
|
|
@@ -1066,7 +1070,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
1066
1070
|
) : /* @__PURE__ */ e(
|
|
1067
1071
|
ve,
|
|
1068
1072
|
{
|
|
1069
|
-
onBackClick:
|
|
1073
|
+
onBackClick: a,
|
|
1070
1074
|
sx: { height: "100%", overflow: "auto" },
|
|
1071
1075
|
title: v.title,
|
|
1072
1076
|
children: /* @__PURE__ */ e(Ft, {})
|