@mx-cartographer/experiences 7.0.2-alpha.al0 → 7.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dist/ManageIncome-BtKRPjvO.mjs +574 -0
- package/dist/RecurringSettings-Dqn4pjZ0.mjs +81 -0
- package/dist/budgets/index.es.js +3 -3
- package/dist/cashflow/index.es.js +209 -209
- package/dist/common/types/localization/RecurringCopy.d.ts +6 -0
- package/dist/finstrong/index.es.js +1 -1
- package/dist/recurringtransactions/components/shared/recurringsettings/ManageIncome.d.ts +5 -1
- package/dist/recurringtransactions/components/shared/recurringsettings/RecurringSettingsZeroState.d.ts +7 -0
- package/dist/recurringtransactions/index.es.js +7 -7
- package/package.json +1 -1
- package/dist/ManageIncome-B6kmMN_z.mjs +0 -527
- package/dist/RecurringSettings-Be1dzkMz.mjs +0 -57
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsxs as o, Fragment as
|
|
1
|
+
import { jsxs as o, Fragment as U, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import f, { useState as K } from "react";
|
|
3
|
-
import { observer as
|
|
3
|
+
import { observer as R } from "mobx-react-lite";
|
|
4
4
|
import D from "@mui/material/Box";
|
|
5
|
-
import
|
|
5
|
+
import H from "@mui/material/Button";
|
|
6
6
|
import v from "@mui/material/Divider";
|
|
7
7
|
import r from "@mui/material/Stack";
|
|
8
8
|
import ie from "@mui/material/styles/useTheme";
|
|
9
|
-
import { Text as p, P as
|
|
10
|
-
import { G as Xe, t as le, u as
|
|
11
|
-
import { C as
|
|
9
|
+
import { Text as p, P as N, Icon as F, InstitutionLogo as xe, H1 as ce, H2 as qe } from "@mxenabled/mxui";
|
|
10
|
+
import { G as Xe, t as le, u as O, p as ae, c as Oe, a as X, o as de, h as P, e as Ne, f as ke } from "../hooks-02T565vf.mjs";
|
|
11
|
+
import { C as L } from "../CurrencyText-YUhH2caW.mjs";
|
|
12
12
|
import { u as me } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
13
13
|
import { L as re } from "../Loader-Dp1P2gNw.mjs";
|
|
14
14
|
import { I as ue } from "../CashflowStore-D9Dpuz7X.mjs";
|
|
15
15
|
import { C as Hn } from "../CashflowStore-D9Dpuz7X.mjs";
|
|
16
16
|
import { b as q } from "../Localization-2MODESHW.mjs";
|
|
17
17
|
import { M as Ye } from "../MiniWidgetContainer-DqKQNubH.mjs";
|
|
18
|
-
import { R as Qe } from "../RecurringSettings-
|
|
18
|
+
import { R as Qe } from "../RecurringSettings-Dqn4pjZ0.mjs";
|
|
19
19
|
import Ve from "@mui/material/Tabs";
|
|
20
20
|
import Ce from "@mui/material/Tab";
|
|
21
|
-
import { getUnixTime as
|
|
21
|
+
import { getUnixTime as z } from "date-fns/getUnixTime";
|
|
22
22
|
import Z from "@mui/material/List";
|
|
23
23
|
import ee from "@mui/material/ListItem";
|
|
24
24
|
import { A as Ke } from "../AccountListItem-C7JzYpqf.mjs";
|
|
@@ -28,12 +28,12 @@ import { f as J } from "../NumberFormatting-CtWHhyBX.mjs";
|
|
|
28
28
|
import { isAfter as He } from "date-fns/isAfter";
|
|
29
29
|
import { isBefore as Fe } from "date-fns/isBefore";
|
|
30
30
|
import { isToday as We } from "date-fns/isToday";
|
|
31
|
-
import { startOfToday as
|
|
32
|
-
import { addDays as
|
|
31
|
+
import { startOfToday as B } from "date-fns/startOfToday";
|
|
32
|
+
import { addDays as _e } from "date-fns/addDays";
|
|
33
33
|
import { alpha as Ze, keyframes as et } from "@mui/material/styles";
|
|
34
34
|
import { DataGridPro as tt } from "@mui/x-data-grid-pro";
|
|
35
|
-
import { T as
|
|
36
|
-
import { M as nt, S as ot, i as it,
|
|
35
|
+
import { T as we } from "../TabContentContainer-j01JYR_7.mjs";
|
|
36
|
+
import { M as nt, S as ot, i as it, d as Se, c as at } from "../ManageIncome-BtKRPjvO.mjs";
|
|
37
37
|
import { D as $e } from "../Drawer-kEE73B87.mjs";
|
|
38
38
|
import { formatISO as rt } from "date-fns/formatISO";
|
|
39
39
|
import { fromUnixTime as ye } from "date-fns/fromUnixTime";
|
|
@@ -44,14 +44,14 @@ import { F as dt, R as Ie, e as De } from "../RepeatingTransaction-BPWfaB3f.mjs"
|
|
|
44
44
|
import { h as mt } from "../DateUtil-BcuH7ErC.mjs";
|
|
45
45
|
import { endOfToday as ut } from "date-fns/endOfToday";
|
|
46
46
|
import { W as ve, A as Ae } from "../WidgetContainer-BG-fdDOf.mjs";
|
|
47
|
-
import { F as ht, A as
|
|
47
|
+
import { F as ht, A as j } from "../Fetch-CkFKy79O.mjs";
|
|
48
48
|
const V = () => {
|
|
49
49
|
if (!f.useContext(Xe))
|
|
50
50
|
throw new Error("useCashflowUiStore() must be used within the GlobalDataContext");
|
|
51
51
|
return le().uiStore;
|
|
52
52
|
}, pt = ({ remaining: i }) => {
|
|
53
|
-
const { cashflow: n } =
|
|
54
|
-
return /* @__PURE__ */ o(
|
|
53
|
+
const { cashflow: n } = O();
|
|
54
|
+
return /* @__PURE__ */ o(U, { children: [
|
|
55
55
|
/* @__PURE__ */ e(
|
|
56
56
|
D,
|
|
57
57
|
{
|
|
@@ -64,35 +64,35 @@ const V = () => {
|
|
|
64
64
|
}
|
|
65
65
|
),
|
|
66
66
|
/* @__PURE__ */ e(p, { bold: !0, sx: { flexGrow: 1, fontSize: 12 }, children: n.remaining_cash }),
|
|
67
|
-
/* @__PURE__ */ e(
|
|
67
|
+
/* @__PURE__ */ e(L, { amount: i, bold: !0, sx: { fontSize: 12 } })
|
|
68
68
|
] });
|
|
69
|
-
}, he =
|
|
70
|
-
const n = ie(), { availableWidth: t } = ae(), { isMobile: s } = me(), { visibleCashAccounts: d, visibleCashBalance: g } = Oe(), { selectedAccountGuids: m } = X(), { cashflow: c } =
|
|
69
|
+
}, he = R(pt), ft = ({ onAddIncomeClick: i }) => {
|
|
70
|
+
const n = ie(), { availableWidth: t } = ae(), { isMobile: s } = me(), { visibleCashAccounts: d, visibleCashBalance: g } = Oe(), { selectedAccountGuids: m } = X(), { cashflow: c } = O(), { userProfile: C } = de(), {
|
|
71
71
|
daysUntilNextIncome: a,
|
|
72
|
-
expensesTilNextIncome:
|
|
72
|
+
expensesTilNextIncome: h,
|
|
73
73
|
selectedCashAccounts: l,
|
|
74
74
|
setNextIncome: b,
|
|
75
75
|
setSelectedCashAccounts: _,
|
|
76
|
-
setUpcomingExpenses:
|
|
77
|
-
} = V(), { isDataLoaded:
|
|
76
|
+
setUpcomingExpenses: w
|
|
77
|
+
} = V(), { isDataLoaded: A, nextIncomeRecurrence: u, upcomingExpenses: E } = P();
|
|
78
78
|
f.useEffect(() => {
|
|
79
79
|
_(
|
|
80
|
-
d.filter((
|
|
80
|
+
d.filter((y) => m.includes(y.guid))
|
|
81
81
|
);
|
|
82
82
|
}, [d, m]), f.useEffect(() => {
|
|
83
|
-
|
|
84
|
-
}, [
|
|
85
|
-
const
|
|
86
|
-
() => d.filter((
|
|
87
|
-
[m,
|
|
88
|
-
),
|
|
89
|
-
() =>
|
|
90
|
-
[m,
|
|
91
|
-
),
|
|
92
|
-
() =>
|
|
93
|
-
[
|
|
94
|
-
),
|
|
95
|
-
return
|
|
83
|
+
u && b(u), w(E);
|
|
84
|
+
}, [u, E]);
|
|
85
|
+
const S = f.useMemo(
|
|
86
|
+
() => d.filter((y) => m.includes(y.guid)).reduce((y, I) => y + (I?.balance || 0), 0),
|
|
87
|
+
[m, E]
|
|
88
|
+
), $ = f.useMemo(
|
|
89
|
+
() => h.filter((y) => m.includes(y.accountGuid || "")).reduce((y, I) => y + I.amount, 0),
|
|
90
|
+
[m, h]
|
|
91
|
+
), G = f.useMemo(
|
|
92
|
+
() => S - $,
|
|
93
|
+
[S, $]
|
|
94
|
+
), M = C?.has_completed_cash_flow_onboarding && !!i;
|
|
95
|
+
return A ? /* @__PURE__ */ e(D, { className: "mx-cashflow", pl: 16, pr: 16, pt: 16, children: t > 610 ? /* @__PURE__ */ o(
|
|
96
96
|
r,
|
|
97
97
|
{
|
|
98
98
|
border: `1px solid ${n.palette.border.light}`,
|
|
@@ -102,33 +102,33 @@ const V = () => {
|
|
|
102
102
|
px: 24,
|
|
103
103
|
children: [
|
|
104
104
|
/* @__PURE__ */ o(r, { pb: 14, pt: 12, children: [
|
|
105
|
-
/* @__PURE__ */ e(
|
|
106
|
-
/* @__PURE__ */ e(
|
|
105
|
+
/* @__PURE__ */ e(L, { amount: S, variant: "H2" }),
|
|
106
|
+
/* @__PURE__ */ e(N, { variant: "XSmall", whiteSpace: "nowrap", children: q(
|
|
107
107
|
c.total_cash_accounts,
|
|
108
108
|
l.length
|
|
109
109
|
) })
|
|
110
110
|
] }),
|
|
111
|
-
/* @__PURE__ */ e(r, { pt: 18, children: /* @__PURE__ */ e(
|
|
111
|
+
/* @__PURE__ */ e(r, { pt: 18, children: /* @__PURE__ */ e(F, { name: "remove" }) }),
|
|
112
112
|
/* @__PURE__ */ o(r, { pb: 14, pt: 12, children: [
|
|
113
|
-
/* @__PURE__ */ e(
|
|
114
|
-
/* @__PURE__ */ e(
|
|
113
|
+
/* @__PURE__ */ e(L, { amount: $, variant: "H2" }),
|
|
114
|
+
/* @__PURE__ */ e(N, { variant: "XSmall", whiteSpace: "nowrap", children: q(c.expenses_due, h.length) })
|
|
115
115
|
] }),
|
|
116
|
-
/* @__PURE__ */ e(r, { pt: 18, children: /* @__PURE__ */ e(
|
|
116
|
+
/* @__PURE__ */ e(r, { pt: 18, children: /* @__PURE__ */ e(F, { name: "equal" }) }),
|
|
117
117
|
/* @__PURE__ */ o(r, { pb: 14, pr: 24, pt: 12, children: [
|
|
118
|
-
/* @__PURE__ */ e(
|
|
118
|
+
/* @__PURE__ */ e(L, { amount: G, variant: "H2" }),
|
|
119
119
|
/* @__PURE__ */ o(r, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
120
|
-
/* @__PURE__ */ e(
|
|
120
|
+
/* @__PURE__ */ e(N, { variant: "XSmall", whiteSpace: "nowrap", children: c.available_to_spend }),
|
|
121
121
|
/* @__PURE__ */ e(ue, { body: c.tooltip_body, title: c.tooltip_title })
|
|
122
122
|
] })
|
|
123
123
|
] }),
|
|
124
|
-
/* @__PURE__ */ e(r, { borderLeft: `1px solid ${n.palette.border.light}`, pb: 12, pl: 24, pt: 12, children:
|
|
124
|
+
/* @__PURE__ */ e(r, { borderLeft: `1px solid ${n.palette.border.light}`, pb: 12, pl: 24, pt: 12, children: M ? /* @__PURE__ */ o(U, { children: [
|
|
125
125
|
/* @__PURE__ */ e(p, { variant: "H2", children: q(c.days, a) }),
|
|
126
|
-
/* @__PURE__ */ e(
|
|
126
|
+
/* @__PURE__ */ e(N, { variant: "XSmall", whiteSpace: "nowrap", children: c.next_paycheck })
|
|
127
127
|
] }) : /* @__PURE__ */ e(
|
|
128
|
-
|
|
128
|
+
H,
|
|
129
129
|
{
|
|
130
130
|
onClick: i,
|
|
131
|
-
startIcon: /* @__PURE__ */ e(
|
|
131
|
+
startIcon: /* @__PURE__ */ e(F, { name: "add" }),
|
|
132
132
|
sx: { fontSize: 13, lineHeight: "initial" },
|
|
133
133
|
children: c.add_income
|
|
134
134
|
}
|
|
@@ -141,12 +141,12 @@ const V = () => {
|
|
|
141
141
|
c.total_cash_accounts,
|
|
142
142
|
l.length
|
|
143
143
|
) }),
|
|
144
|
-
/* @__PURE__ */ e(
|
|
144
|
+
/* @__PURE__ */ e(L, { amount: g, bold: !0, variant: "XSmall" })
|
|
145
145
|
] }),
|
|
146
146
|
/* @__PURE__ */ e(v, {}),
|
|
147
147
|
/* @__PURE__ */ o(r, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
148
|
-
/* @__PURE__ */ e(p, { variant: "Small", children: q(c.expenses_due,
|
|
149
|
-
/* @__PURE__ */ e(
|
|
148
|
+
/* @__PURE__ */ e(p, { variant: "Small", children: q(c.expenses_due, h.length) }),
|
|
149
|
+
/* @__PURE__ */ e(L, { amount: $, bold: !0, symbol: "-", variant: "XSmall" })
|
|
150
150
|
] }),
|
|
151
151
|
/* @__PURE__ */ e(v, {}),
|
|
152
152
|
/* @__PURE__ */ e(
|
|
@@ -160,11 +160,11 @@ const V = () => {
|
|
|
160
160
|
justifyContent: "space-between",
|
|
161
161
|
px: 16,
|
|
162
162
|
sx: { borderBottomLeftRadius: 4, borderBottomRightRadius: 4 },
|
|
163
|
-
children: /* @__PURE__ */ e(he, { remaining:
|
|
163
|
+
children: /* @__PURE__ */ e(he, { remaining: G })
|
|
164
164
|
}
|
|
165
165
|
),
|
|
166
166
|
/* @__PURE__ */ e(v, {}),
|
|
167
|
-
|
|
167
|
+
M ? /* @__PURE__ */ o(r, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
168
168
|
/* @__PURE__ */ e(p, { variant: "Small", children: c.next_paycheck }),
|
|
169
169
|
/* @__PURE__ */ e(p, { bold: !0, variant: "XSmall", children: q(c.days, a) })
|
|
170
170
|
] }) : /* @__PURE__ */ o(
|
|
@@ -179,10 +179,10 @@ const V = () => {
|
|
|
179
179
|
children: [
|
|
180
180
|
/* @__PURE__ */ e(p, { variant: "Small", children: c.next_paycheck }),
|
|
181
181
|
/* @__PURE__ */ e(
|
|
182
|
-
|
|
182
|
+
H,
|
|
183
183
|
{
|
|
184
184
|
onClick: i,
|
|
185
|
-
startIcon: /* @__PURE__ */ e(
|
|
185
|
+
startIcon: /* @__PURE__ */ e(F, { name: "add" }),
|
|
186
186
|
sx: { fontSize: 13 },
|
|
187
187
|
children: c.add_income
|
|
188
188
|
}
|
|
@@ -191,8 +191,8 @@ const V = () => {
|
|
|
191
191
|
}
|
|
192
192
|
)
|
|
193
193
|
] }) }) : /* @__PURE__ */ e(re, { height: s ? 210 : 120 });
|
|
194
|
-
}, gt =
|
|
195
|
-
const { cashflow: t } =
|
|
194
|
+
}, gt = R(ft), bt = ({ onPrimaryCtaClick: i, sx: n = {} }) => {
|
|
195
|
+
const { cashflow: t } = O(), { isCopyLoaded: s, isInitialized: d } = X(), { loadRepeatingTransactions: g } = P();
|
|
196
196
|
return f.useEffect(() => {
|
|
197
197
|
d && g().finally();
|
|
198
198
|
}, [d]), s ? /* @__PURE__ */ e(
|
|
@@ -207,7 +207,7 @@ const V = () => {
|
|
|
207
207
|
children: /* @__PURE__ */ e(gt, { onAddIncomeClick: i })
|
|
208
208
|
}
|
|
209
209
|
) : /* @__PURE__ */ e(re, {});
|
|
210
|
-
}, Rn =
|
|
210
|
+
}, Rn = R(bt), xt = ({ remaining: i }) => /* @__PURE__ */ e(
|
|
211
211
|
ee,
|
|
212
212
|
{
|
|
213
213
|
sx: {
|
|
@@ -224,7 +224,7 @@ const V = () => {
|
|
|
224
224
|
}
|
|
225
225
|
);
|
|
226
226
|
var te = /* @__PURE__ */ ((i) => (i.EXPENSE = "expense", i.INCOME = "income", i))(te || {});
|
|
227
|
-
const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(
|
|
227
|
+
const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(U, { children: [
|
|
228
228
|
/* @__PURE__ */ o(ee, { sx: { display: "flex", alignItems: "center", gap: 16, px: 24, py: 12 }, children: [
|
|
229
229
|
/* @__PURE__ */ o(r, { alignItems: "center", height: 32, width: 32, children: [
|
|
230
230
|
/* @__PURE__ */ e(p, { bold: !0, sx: { fontSize: 11 }, children: Y(i.expectedDate, Q.MONTH) }),
|
|
@@ -232,7 +232,7 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
232
232
|
] }),
|
|
233
233
|
/* @__PURE__ */ e(p, { sx: { flexGrow: 1, fontSize: 13 }, children: i.name }),
|
|
234
234
|
/* @__PURE__ */ e(
|
|
235
|
-
|
|
235
|
+
L,
|
|
236
236
|
{
|
|
237
237
|
amount: i.amount,
|
|
238
238
|
bold: !0,
|
|
@@ -241,9 +241,9 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
241
241
|
)
|
|
242
242
|
] }),
|
|
243
243
|
/* @__PURE__ */ e(v, {})
|
|
244
|
-
] }), Ee =
|
|
245
|
-
const { cashflow: t } =
|
|
246
|
-
return /* @__PURE__ */ o(
|
|
244
|
+
] }), Ee = R(Ct), _t = ({ total: i, type: n }) => {
|
|
245
|
+
const { cashflow: t } = O();
|
|
246
|
+
return /* @__PURE__ */ o(U, { children: [
|
|
247
247
|
/* @__PURE__ */ o(
|
|
248
248
|
Je,
|
|
249
249
|
{
|
|
@@ -267,8 +267,8 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
267
267
|
),
|
|
268
268
|
/* @__PURE__ */ e(v, {})
|
|
269
269
|
] });
|
|
270
|
-
}, Te =
|
|
271
|
-
const { availableWidth: i } = ae(), { cashflow: n } =
|
|
270
|
+
}, Te = R(_t), oe = (i, n) => (t) => t.accountGuid === i.guid && (We(t.expectedDate) || He(t.expectedDate, n.start)) && Fe(t.expectedDate, n.end), wt = () => {
|
|
271
|
+
const { availableWidth: i } = ae(), { cashflow: n } = O(), { upcomingExpenses: t, upcomingIncome: s } = P(), { dateRange: d, selectedCashAccounts: g } = V();
|
|
272
272
|
return /* @__PURE__ */ o(r, { children: [
|
|
273
273
|
/* @__PURE__ */ o(r, { direction: i < 400 ? "column" : "row", justifyContent: "space-between", children: [
|
|
274
274
|
/* @__PURE__ */ e(p, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: n.accounts_breakdown }),
|
|
@@ -280,12 +280,12 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
280
280
|
] })
|
|
281
281
|
] }),
|
|
282
282
|
/* @__PURE__ */ e(r, { children: g.map((m) => {
|
|
283
|
-
const c = s.filter(oe(m, d)).sort((l, b) =>
|
|
283
|
+
const c = s.filter(oe(m, d)).sort((l, b) => z(l.expectedDate) - z(b.expectedDate)), C = t.filter(
|
|
284
284
|
oe(m, d)
|
|
285
285
|
), a = c.reduce(
|
|
286
286
|
(l, b) => l + b.amount,
|
|
287
287
|
0
|
|
288
|
-
),
|
|
288
|
+
), h = C.reduce(
|
|
289
289
|
(l, b) => l + b.amount,
|
|
290
290
|
0
|
|
291
291
|
);
|
|
@@ -322,7 +322,7 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
322
322
|
C.length > 0 && /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(
|
|
323
323
|
Z,
|
|
324
324
|
{
|
|
325
|
-
subheader: /* @__PURE__ */ e(Te, { total:
|
|
325
|
+
subheader: /* @__PURE__ */ e(Te, { total: h, type: te.EXPENSE }),
|
|
326
326
|
sx: { width: "100%" },
|
|
327
327
|
children: C.map((l) => /* @__PURE__ */ e(Ee, { recurrence: l }, l.repeatingTransactionGuid))
|
|
328
328
|
}
|
|
@@ -330,7 +330,7 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
330
330
|
/* @__PURE__ */ e(
|
|
331
331
|
xt,
|
|
332
332
|
{
|
|
333
|
-
remaining: (m.available_balance || m.balance || 0) + a -
|
|
333
|
+
remaining: (m.available_balance || m.balance || 0) + a - h
|
|
334
334
|
}
|
|
335
335
|
)
|
|
336
336
|
]
|
|
@@ -339,14 +339,14 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
339
339
|
);
|
|
340
340
|
}) })
|
|
341
341
|
] });
|
|
342
|
-
}, St =
|
|
343
|
-
const { availableWidth: i } = ae(), n = ie(), { cashflow: t } =
|
|
342
|
+
}, St = R(wt), yt = () => {
|
|
343
|
+
const { availableWidth: i } = ae(), n = ie(), { cashflow: t } = O(), { upcomingExpenses: s, upcomingIncome: d } = P(), { dateRange: g, selectedCashAccounts: m } = V(), c = [
|
|
344
344
|
{
|
|
345
345
|
field: "account",
|
|
346
346
|
flex: 1.5,
|
|
347
347
|
headerName: t.accounts,
|
|
348
|
-
renderCell: ({ value: { name: a, nickname:
|
|
349
|
-
const _ =
|
|
348
|
+
renderCell: ({ value: { name: a, nickname: h, institution_guid: l, account_number: b } }) => {
|
|
349
|
+
const _ = h || a;
|
|
350
350
|
return /* @__PURE__ */ o(r, { alignItems: "center", flexDirection: "row", gap: 12, children: [
|
|
351
351
|
/* @__PURE__ */ e(
|
|
352
352
|
xe,
|
|
@@ -387,29 +387,29 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
387
387
|
headerName: t.remaining,
|
|
388
388
|
type: "number",
|
|
389
389
|
renderCell: (a) => {
|
|
390
|
-
const
|
|
390
|
+
const h = a.row.balance + a.row.income - a.row.expenses;
|
|
391
391
|
return /* @__PURE__ */ e(
|
|
392
392
|
p,
|
|
393
393
|
{
|
|
394
|
-
color: Math.sign(
|
|
394
|
+
color: Math.sign(h) === -1 ? n.palette.error.main : n.palette.text.primary,
|
|
395
395
|
variant: "Small",
|
|
396
|
-
children: J(
|
|
396
|
+
children: J(h, "0,0.00")
|
|
397
397
|
}
|
|
398
398
|
);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
], C = f.useMemo(() => m.map((a) => {
|
|
402
|
-
const
|
|
403
|
-
oe(a, { start:
|
|
404
|
-
).reduce((_,
|
|
405
|
-
oe(a, { start:
|
|
406
|
-
).reduce((_,
|
|
402
|
+
const h = s.filter(
|
|
403
|
+
oe(a, { start: B(), end: _e(B(), 30) })
|
|
404
|
+
).reduce((_, w) => _ + w.amount, 0), l = d.filter(
|
|
405
|
+
oe(a, { start: B(), end: _e(B(), 30) })
|
|
406
|
+
).reduce((_, w) => _ + w.amount, 0), b = (a.balance || 0) + l - h;
|
|
407
407
|
return {
|
|
408
408
|
account: a,
|
|
409
409
|
balance: a.balance || 0,
|
|
410
410
|
id: a.guid,
|
|
411
411
|
income: l,
|
|
412
|
-
expenses:
|
|
412
|
+
expenses: h,
|
|
413
413
|
remaining: b
|
|
414
414
|
};
|
|
415
415
|
}), [m, s, d]);
|
|
@@ -483,7 +483,7 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
485
|
) : C.map((a) => {
|
|
486
|
-
const { name:
|
|
486
|
+
const { name: h, nickname: l, institution_guid: b, account_number: _ } = a.account, w = l || h;
|
|
487
487
|
return /* @__PURE__ */ e(
|
|
488
488
|
Z,
|
|
489
489
|
{
|
|
@@ -512,9 +512,9 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
512
512
|
size: 16
|
|
513
513
|
}
|
|
514
514
|
),
|
|
515
|
-
/* @__PURE__ */ e(p, { variant: "Small", children: `${
|
|
515
|
+
/* @__PURE__ */ e(p, { variant: "Small", children: `${w} ${_ ? `*${_}` : ""}` })
|
|
516
516
|
] }),
|
|
517
|
-
/* @__PURE__ */ e(
|
|
517
|
+
/* @__PURE__ */ e(L, { amount: a.balance, bold: !0, variant: "Small" })
|
|
518
518
|
]
|
|
519
519
|
}
|
|
520
520
|
),
|
|
@@ -529,7 +529,7 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
529
529
|
py: 12,
|
|
530
530
|
children: [
|
|
531
531
|
/* @__PURE__ */ e(p, { variant: "Small", children: t.projected_income }),
|
|
532
|
-
/* @__PURE__ */ e(
|
|
532
|
+
/* @__PURE__ */ e(L, { amount: a.income, bold: !0, symbol: "+", variant: "Small" })
|
|
533
533
|
]
|
|
534
534
|
}
|
|
535
535
|
),
|
|
@@ -544,7 +544,7 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
544
544
|
py: 12,
|
|
545
545
|
children: [
|
|
546
546
|
/* @__PURE__ */ e(p, { variant: "Small", children: t.projected_expenses }),
|
|
547
|
-
/* @__PURE__ */ e(
|
|
547
|
+
/* @__PURE__ */ e(L, { amount: a.expenses, bold: !0, symbol: "-", variant: "Small" })
|
|
548
548
|
]
|
|
549
549
|
}
|
|
550
550
|
),
|
|
@@ -571,8 +571,8 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
571
571
|
]
|
|
572
572
|
}
|
|
573
573
|
);
|
|
574
|
-
}, It =
|
|
575
|
-
const { cashflow: i } =
|
|
574
|
+
}, It = R(yt), Dt = () => {
|
|
575
|
+
const { cashflow: i } = O(), { isDesktop: n } = me(), { onEvent: t } = Ne(), [s, d] = f.useState(0), g = (m, c) => {
|
|
576
576
|
d(c);
|
|
577
577
|
};
|
|
578
578
|
return f.useEffect(() => {
|
|
@@ -614,10 +614,10 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
614
614
|
}
|
|
615
615
|
),
|
|
616
616
|
/* @__PURE__ */ e(D, { sx: { mb: 32 } }),
|
|
617
|
-
/* @__PURE__ */ e(
|
|
618
|
-
/* @__PURE__ */ e(
|
|
617
|
+
/* @__PURE__ */ e(we, { index: 0, name: "cashflow", value: s, children: /* @__PURE__ */ e(D, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(It, {}) }) }),
|
|
618
|
+
/* @__PURE__ */ e(we, { index: 1, name: "cashflow", value: s, children: /* @__PURE__ */ e(D, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(St, {}) }) })
|
|
619
619
|
] });
|
|
620
|
-
}, vt =
|
|
620
|
+
}, vt = R(Dt), ne = ({
|
|
621
621
|
amount: i,
|
|
622
622
|
isMobile: n = !1,
|
|
623
623
|
isTotal: t = !1,
|
|
@@ -633,82 +633,82 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
633
633
|
padding: n ? "14px 16px" : 0,
|
|
634
634
|
sx: { borderBottomLeftRadius: 4, borderBottomRightRadius: 4 },
|
|
635
635
|
children: [
|
|
636
|
-
!n && /* @__PURE__ */ e(
|
|
636
|
+
!n && /* @__PURE__ */ e(L, { amount: i, component: "h2", variant: "H2" }),
|
|
637
637
|
/* @__PURE__ */ o(r, { alignItems: "center", component: "span", direction: "row", gap: 8, mt: 2, children: [
|
|
638
638
|
/* @__PURE__ */ e(p, { bold: t, variant: "Small", children: s }),
|
|
639
639
|
g
|
|
640
640
|
] }),
|
|
641
|
-
n && /* @__PURE__ */ e(
|
|
641
|
+
n && /* @__PURE__ */ e(L, { amount: i, component: "h2", symbol: d, variant: "Small" })
|
|
642
642
|
]
|
|
643
643
|
}
|
|
644
644
|
), Re = (i, n) => (t) => t.accountGuid && i.includes(t.accountGuid) && (We(t.expectedDate) || He(t.expectedDate, n.start)) && Fe(t.expectedDate, n.end), At = () => {
|
|
645
|
-
const { availableWidth: i } = ae(), { cashflow: n } =
|
|
645
|
+
const { availableWidth: i } = ae(), { cashflow: n } = O(), { upcomingExpenses: t, upcomingIncome: s } = P(), { selectedAccountGuids: d } = X(), { dateRange: g, selectedCashAccounts: m } = V(), { userProfile: c } = de(), [C, a] = f.useState(!1), h = f.useMemo(
|
|
646
646
|
() => t.filter(Re(d, g)),
|
|
647
647
|
[g, d, t]
|
|
648
648
|
), l = f.useMemo(
|
|
649
649
|
() => s.filter(Re(d, g)),
|
|
650
650
|
[g, d, s]
|
|
651
651
|
), b = f.useMemo(
|
|
652
|
-
() => m.reduce((
|
|
652
|
+
() => m.reduce((E, S) => E + (S?.balance || 0), 0),
|
|
653
653
|
[m]
|
|
654
|
-
), _ =
|
|
655
|
-
return /* @__PURE__ */ o(r, { sx: { mx:
|
|
654
|
+
), _ = h.reduce((E, S) => E + S.amount, 0), w = l.reduce((E, S) => E + S.amount, 0), A = b - _ + w, u = i < 725;
|
|
655
|
+
return /* @__PURE__ */ o(r, { sx: { mx: u ? 16 : 0, my: u ? 24 : 42 }, children: [
|
|
656
656
|
/* @__PURE__ */ o(
|
|
657
657
|
r,
|
|
658
658
|
{
|
|
659
|
-
border:
|
|
659
|
+
border: u ? "1px solid" : "none",
|
|
660
660
|
borderColor: "border.light",
|
|
661
661
|
borderRadius: 2,
|
|
662
|
-
flexDirection:
|
|
663
|
-
gap:
|
|
662
|
+
flexDirection: u ? "column" : "row",
|
|
663
|
+
gap: u ? 0 : 24,
|
|
664
664
|
justifyContent: "center",
|
|
665
665
|
children: [
|
|
666
666
|
/* @__PURE__ */ e(
|
|
667
667
|
ne,
|
|
668
668
|
{
|
|
669
669
|
amount: b,
|
|
670
|
-
isMobile:
|
|
670
|
+
isMobile: u,
|
|
671
671
|
label: n.cash_and_bank
|
|
672
672
|
}
|
|
673
673
|
),
|
|
674
|
-
|
|
675
|
-
c?.has_completed_cash_flow_onboarding ? /* @__PURE__ */ o(
|
|
676
|
-
!
|
|
674
|
+
u && /* @__PURE__ */ e(v, {}),
|
|
675
|
+
c?.has_completed_cash_flow_onboarding ? /* @__PURE__ */ o(U, { children: [
|
|
676
|
+
!u && /* @__PURE__ */ e(p, { sx: { fontSize: 25, lineHeight: 1 }, children: "+" }),
|
|
677
677
|
/* @__PURE__ */ e(
|
|
678
678
|
ne,
|
|
679
679
|
{
|
|
680
|
-
amount:
|
|
681
|
-
isMobile:
|
|
680
|
+
amount: w,
|
|
681
|
+
isMobile: u,
|
|
682
682
|
label: n.to_be_received,
|
|
683
|
-
symbol:
|
|
683
|
+
symbol: u ? "+" : void 0
|
|
684
684
|
}
|
|
685
685
|
)
|
|
686
686
|
] }) : /* @__PURE__ */ e(
|
|
687
|
-
|
|
687
|
+
H,
|
|
688
688
|
{
|
|
689
689
|
onClick: () => a(!0),
|
|
690
|
-
startIcon: /* @__PURE__ */ e(
|
|
690
|
+
startIcon: /* @__PURE__ */ e(F, { name: "add" }),
|
|
691
691
|
sx: { fontSize: 13 },
|
|
692
692
|
children: n.add_income
|
|
693
693
|
}
|
|
694
694
|
),
|
|
695
|
-
|
|
695
|
+
u ? /* @__PURE__ */ e(v, {}) : /* @__PURE__ */ e(p, { sx: { fontSize: 25, lineHeight: 1 }, children: "-" }),
|
|
696
696
|
/* @__PURE__ */ e(
|
|
697
697
|
ne,
|
|
698
698
|
{
|
|
699
699
|
amount: _,
|
|
700
|
-
isMobile:
|
|
700
|
+
isMobile: u,
|
|
701
701
|
label: n.to_be_paid_out,
|
|
702
|
-
symbol:
|
|
702
|
+
symbol: u ? "-" : void 0
|
|
703
703
|
}
|
|
704
704
|
),
|
|
705
|
-
|
|
705
|
+
u ? /* @__PURE__ */ e(v, {}) : /* @__PURE__ */ e(p, { sx: { fontSize: 25, lineHeight: 1 }, children: "=" }),
|
|
706
706
|
/* @__PURE__ */ e(
|
|
707
707
|
ne,
|
|
708
708
|
{
|
|
709
|
-
amount:
|
|
710
|
-
isMobile:
|
|
711
|
-
isTotal:
|
|
709
|
+
amount: A,
|
|
710
|
+
isMobile: u,
|
|
711
|
+
isTotal: u,
|
|
712
712
|
label: n.remaining_cash,
|
|
713
713
|
tooltip: /* @__PURE__ */ e(
|
|
714
714
|
ue,
|
|
@@ -734,8 +734,8 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
734
734
|
}
|
|
735
735
|
)
|
|
736
736
|
] });
|
|
737
|
-
}, Et =
|
|
738
|
-
const { completeOnboarding: n } = le(), { cashflow: t } =
|
|
737
|
+
}, Et = R(At), Tt = ({ handleNextStep: i }) => {
|
|
738
|
+
const { completeOnboarding: n } = le(), { cashflow: t } = O(), s = ie();
|
|
739
739
|
return /* @__PURE__ */ o(r, { children: [
|
|
740
740
|
/* @__PURE__ */ e(ce, { pb: 12, children: t.welcome_title }),
|
|
741
741
|
/* @__PURE__ */ e(
|
|
@@ -748,9 +748,9 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
748
748
|
children: t.welcome_sub_title
|
|
749
749
|
}
|
|
750
750
|
),
|
|
751
|
-
/* @__PURE__ */ e(
|
|
751
|
+
/* @__PURE__ */ e(N, { pb: 32, children: t.welcome_description }),
|
|
752
752
|
/* @__PURE__ */ o(r, { direction: "column", mb: 32, spacing: 32, children: [
|
|
753
|
-
/* @__PURE__ */ o(
|
|
753
|
+
/* @__PURE__ */ o(N, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
754
754
|
/* @__PURE__ */ e(
|
|
755
755
|
D,
|
|
756
756
|
{
|
|
@@ -761,12 +761,12 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
761
761
|
mr: 24,
|
|
762
762
|
sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
|
|
763
763
|
width: 44,
|
|
764
|
-
children: /* @__PURE__ */ e(
|
|
764
|
+
children: /* @__PURE__ */ e(F, { color: "primary", name: "currency_exchange" })
|
|
765
765
|
}
|
|
766
766
|
),
|
|
767
767
|
t.bullet_one
|
|
768
768
|
] }),
|
|
769
|
-
/* @__PURE__ */ o(
|
|
769
|
+
/* @__PURE__ */ o(N, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
770
770
|
/* @__PURE__ */ e(
|
|
771
771
|
D,
|
|
772
772
|
{
|
|
@@ -777,12 +777,12 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
777
777
|
mr: 24,
|
|
778
778
|
sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
|
|
779
779
|
width: 44,
|
|
780
|
-
children: /* @__PURE__ */ e(
|
|
780
|
+
children: /* @__PURE__ */ e(F, { color: "primary", name: "cardiology" })
|
|
781
781
|
}
|
|
782
782
|
),
|
|
783
783
|
t.bullet_two
|
|
784
784
|
] }),
|
|
785
|
-
/* @__PURE__ */ o(
|
|
785
|
+
/* @__PURE__ */ o(N, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
786
786
|
/* @__PURE__ */ e(
|
|
787
787
|
D,
|
|
788
788
|
{
|
|
@@ -793,28 +793,28 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
793
793
|
mr: 24,
|
|
794
794
|
sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
|
|
795
795
|
width: 44,
|
|
796
|
-
children: /* @__PURE__ */ e(
|
|
796
|
+
children: /* @__PURE__ */ e(F, { color: "primary", name: "flare" })
|
|
797
797
|
}
|
|
798
798
|
),
|
|
799
799
|
t.bullet_three
|
|
800
800
|
] })
|
|
801
801
|
] }),
|
|
802
802
|
/* @__PURE__ */ o(r, { direction: "row", spacing: 16, children: [
|
|
803
|
-
/* @__PURE__ */ e(
|
|
804
|
-
/* @__PURE__ */ e(
|
|
803
|
+
/* @__PURE__ */ e(H, { onClick: i, variant: "contained", children: t.get_started_button }),
|
|
804
|
+
/* @__PURE__ */ e(H, { onClick: n, variant: "outlined", children: t.skip_button })
|
|
805
805
|
] })
|
|
806
806
|
] });
|
|
807
|
-
}, Rt =
|
|
807
|
+
}, Rt = R(Tt), Le = "https://content.moneydesktop.com/storage/MD_Assets/md/cashflow", Me = {
|
|
808
808
|
CASHFLOW_ONBOARDING: `${Le}/cashflow-onboarding.png`,
|
|
809
809
|
CASHFLOW_LOADING_ANIMATION: `${Le}/loading-animation.gif`
|
|
810
810
|
}, Lt = () => {
|
|
811
|
-
const { cashflow: i } =
|
|
811
|
+
const { cashflow: i } = O();
|
|
812
812
|
return /* @__PURE__ */ o(f.Fragment, { children: [
|
|
813
813
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("img", { alt: "Loading", src: Me.CASHFLOW_LOADING_ANIMATION }) }),
|
|
814
814
|
/* @__PURE__ */ e(ce, { pb: 12, children: i.loading_title }),
|
|
815
|
-
/* @__PURE__ */ e(
|
|
815
|
+
/* @__PURE__ */ e(N, { children: i.loading_description })
|
|
816
816
|
] });
|
|
817
|
-
}, Ot =
|
|
817
|
+
}, Ot = R(Lt), Nt = et`
|
|
818
818
|
from {
|
|
819
819
|
transform: rotate(0deg);
|
|
820
820
|
}
|
|
@@ -822,7 +822,7 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
822
822
|
transform: rotate(360deg);
|
|
823
823
|
}
|
|
824
824
|
`, kt = () => {
|
|
825
|
-
const { addRepeatingTransaction: i, repeatingTransactions: n } =
|
|
825
|
+
const { addRepeatingTransaction: i, repeatingTransactions: n } = P(), { cashflow: t, common: s } = O(), { completeOnboarding: d } = le(), { isDirty: g } = V(), { isMobile: m } = me(), { isCopyLoaded: c, setDisplayedDate: C } = X(), { filter: a, setFilter: h, transactions: l } = ke(), b = ie(), [_, w] = K(!0), [A, u] = f.useState(dt.EveryMonth), [E, S] = f.useState(1), [$, G] = f.useState(15), [M, y] = K(!1), [I, pe] = K(1), [k, je] = K([]), [fe, se] = K(""), W = f.useMemo(
|
|
826
826
|
() => l.find((x) => x.guid === fe),
|
|
827
827
|
[fe, l]
|
|
828
828
|
), ze = !!n.filter(
|
|
@@ -830,29 +830,29 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
830
830
|
).length, ge = async () => {
|
|
831
831
|
pe(2), C(
|
|
832
832
|
// Beginning of the month, 90 days before today
|
|
833
|
-
st(Ge(
|
|
834
|
-
|
|
835
|
-
),
|
|
833
|
+
st(Ge(B(), 90)),
|
|
834
|
+
B()
|
|
835
|
+
), h({ ...a, custom: Se }), pe(3);
|
|
836
836
|
}, Be = async () => {
|
|
837
|
-
if (!(
|
|
838
|
-
|
|
839
|
-
for (let x = 0; x <
|
|
840
|
-
const
|
|
841
|
-
account_guid:
|
|
842
|
-
amount:
|
|
843
|
-
merchant_guid:
|
|
844
|
-
description:
|
|
837
|
+
if (!(k.length < 1)) {
|
|
838
|
+
y(!0);
|
|
839
|
+
for (let x = 0; x < k.length; x++) {
|
|
840
|
+
const T = k[x], be = De(A, ye(T.date)), Pe = {
|
|
841
|
+
account_guid: T.account_guid,
|
|
842
|
+
amount: T.amount,
|
|
843
|
+
merchant_guid: T.merchant_guid,
|
|
844
|
+
description: T.feed_description || T.description,
|
|
845
845
|
predicted_occurs_on: rt(be, { representation: "date" }),
|
|
846
846
|
recurrence_day: be.getDay(),
|
|
847
|
-
recurrence_type:
|
|
847
|
+
recurrence_type: A,
|
|
848
848
|
repeating_transaction_type: Ie.Income,
|
|
849
|
-
transaction_type:
|
|
849
|
+
transaction_type: T.transaction_type
|
|
850
850
|
};
|
|
851
|
-
await i(Pe,
|
|
851
|
+
await i(Pe, T);
|
|
852
852
|
}
|
|
853
853
|
await d();
|
|
854
854
|
}
|
|
855
|
-
}, Ue = !W && _ || !W &&
|
|
855
|
+
}, Ue = !W && _ || !W && k.length < 1;
|
|
856
856
|
return c ? /* @__PURE__ */ o(
|
|
857
857
|
D,
|
|
858
858
|
{
|
|
@@ -867,7 +867,7 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
867
867
|
py: 24
|
|
868
868
|
},
|
|
869
869
|
children: [
|
|
870
|
-
|
|
870
|
+
I === 1 && /* @__PURE__ */ e(
|
|
871
871
|
D,
|
|
872
872
|
{
|
|
873
873
|
sx: {
|
|
@@ -876,7 +876,7 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
876
876
|
children: /* @__PURE__ */ e(Rt, { handleNextStep: ge })
|
|
877
877
|
}
|
|
878
878
|
),
|
|
879
|
-
|
|
879
|
+
I === 2 && /* @__PURE__ */ e(
|
|
880
880
|
D,
|
|
881
881
|
{
|
|
882
882
|
sx: {
|
|
@@ -885,7 +885,7 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
885
885
|
children: /* @__PURE__ */ e(Ot, {})
|
|
886
886
|
}
|
|
887
887
|
),
|
|
888
|
-
|
|
888
|
+
I === 3 && /* @__PURE__ */ o(
|
|
889
889
|
D,
|
|
890
890
|
{
|
|
891
891
|
sx: {
|
|
@@ -893,22 +893,22 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
893
893
|
},
|
|
894
894
|
children: [
|
|
895
895
|
/* @__PURE__ */ e(ce, { pb: 12, children: t.add_income_title }),
|
|
896
|
-
/* @__PURE__ */ e(
|
|
897
|
-
|
|
898
|
-
/* @__PURE__ */ e(Z, { children:
|
|
896
|
+
/* @__PURE__ */ e(N, { mb: 24, children: t.add_income_description }),
|
|
897
|
+
k.length > 0 && !W && /* @__PURE__ */ o(U, { children: [
|
|
898
|
+
/* @__PURE__ */ e(Z, { children: k.map((x, T) => /* @__PURE__ */ o(f.Fragment, { children: [
|
|
899
899
|
/* @__PURE__ */ e(ct, { bgcolor: "background.paper", children: mt(
|
|
900
|
-
|
|
900
|
+
z(x.nextDate || x.date)
|
|
901
901
|
) }),
|
|
902
902
|
/* @__PURE__ */ e(lt, { transaction: x }),
|
|
903
|
-
|
|
903
|
+
T !== k.length - 1 && /* @__PURE__ */ e(v, {})
|
|
904
904
|
] }, x.guid)) }),
|
|
905
905
|
/* @__PURE__ */ o(r, { alignItems: "center", direction: "row", children: [
|
|
906
906
|
/* @__PURE__ */ e(v, { sx: { flexGrow: 1 } }),
|
|
907
907
|
/* @__PURE__ */ e(
|
|
908
|
-
|
|
908
|
+
H,
|
|
909
909
|
{
|
|
910
|
-
onClick: () =>
|
|
911
|
-
startIcon: /* @__PURE__ */ e(
|
|
910
|
+
onClick: () => w(!0),
|
|
911
|
+
startIcon: /* @__PURE__ */ e(F, { name: "add", size: 20 }),
|
|
912
912
|
children: t.add_income
|
|
913
913
|
}
|
|
914
914
|
)
|
|
@@ -918,41 +918,41 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
918
918
|
ot,
|
|
919
919
|
{
|
|
920
920
|
bgcolor: "background.paper",
|
|
921
|
-
onSearch: (x) =>
|
|
921
|
+
onSearch: (x) => h({
|
|
922
922
|
...a,
|
|
923
|
-
custom: (
|
|
923
|
+
custom: (T) => x ? it(T, x) : Se(T)
|
|
924
924
|
}),
|
|
925
925
|
onSelected: (x) => {
|
|
926
|
-
se(x),
|
|
926
|
+
se(x), w(!1);
|
|
927
927
|
}
|
|
928
928
|
}
|
|
929
929
|
),
|
|
930
|
-
!ze && g && /* @__PURE__ */ e(
|
|
931
|
-
W && /* @__PURE__ */ o(
|
|
930
|
+
!ze && g && /* @__PURE__ */ e(N, { color: "error", mt: 16, children: t.confirm_error }),
|
|
931
|
+
W && /* @__PURE__ */ o(U, { children: [
|
|
932
932
|
/* @__PURE__ */ e(
|
|
933
933
|
at,
|
|
934
934
|
{
|
|
935
935
|
bgcolor: "background.paper",
|
|
936
|
-
firstDay:
|
|
937
|
-
frequency:
|
|
938
|
-
onFirstDayChange:
|
|
939
|
-
onFrequencyChange:
|
|
940
|
-
onSecondDayChange:
|
|
941
|
-
secondDay:
|
|
936
|
+
firstDay: E,
|
|
937
|
+
frequency: A,
|
|
938
|
+
onFirstDayChange: S,
|
|
939
|
+
onFrequencyChange: u,
|
|
940
|
+
onSecondDayChange: G,
|
|
941
|
+
secondDay: $,
|
|
942
942
|
transaction: W
|
|
943
943
|
}
|
|
944
944
|
),
|
|
945
945
|
/* @__PURE__ */ o(r, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
|
|
946
946
|
/* @__PURE__ */ e(
|
|
947
|
-
|
|
947
|
+
H,
|
|
948
948
|
{
|
|
949
949
|
"aria-disabled": !W,
|
|
950
950
|
onClick: () => {
|
|
951
|
-
const x = [...
|
|
951
|
+
const x = [...k];
|
|
952
952
|
x.push({
|
|
953
953
|
...W,
|
|
954
|
-
nextDate: De(
|
|
955
|
-
frequency:
|
|
954
|
+
nextDate: De(A, ye(W.date)),
|
|
955
|
+
frequency: A
|
|
956
956
|
}), je(x), se("");
|
|
957
957
|
},
|
|
958
958
|
variant: "contained",
|
|
@@ -960,10 +960,10 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
960
960
|
}
|
|
961
961
|
),
|
|
962
962
|
/* @__PURE__ */ e(
|
|
963
|
-
|
|
963
|
+
H,
|
|
964
964
|
{
|
|
965
965
|
onClick: () => {
|
|
966
|
-
se(""),
|
|
966
|
+
se(""), w(!0), ge().finally();
|
|
967
967
|
},
|
|
968
968
|
variant: "outlined",
|
|
969
969
|
children: s.cancel_button
|
|
@@ -971,14 +971,14 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
971
971
|
)
|
|
972
972
|
] })
|
|
973
973
|
] }),
|
|
974
|
-
|
|
974
|
+
k.length > 0 && !W && /* @__PURE__ */ o(r, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
|
|
975
975
|
/* @__PURE__ */ e(
|
|
976
|
-
|
|
976
|
+
H,
|
|
977
977
|
{
|
|
978
|
-
"aria-disabled":
|
|
978
|
+
"aria-disabled": k.length < 1 || M,
|
|
979
979
|
onClick: Be,
|
|
980
|
-
startIcon:
|
|
981
|
-
|
|
980
|
+
startIcon: M ? /* @__PURE__ */ e(
|
|
981
|
+
F,
|
|
982
982
|
{
|
|
983
983
|
name: "progress_activity",
|
|
984
984
|
sx: {
|
|
@@ -990,7 +990,7 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
990
990
|
children: t.confirm_income_button
|
|
991
991
|
}
|
|
992
992
|
),
|
|
993
|
-
/* @__PURE__ */ e(
|
|
993
|
+
/* @__PURE__ */ e(H, { onClick: d, variant: "outlined", children: t.skip_button })
|
|
994
994
|
] })
|
|
995
995
|
]
|
|
996
996
|
}
|
|
@@ -998,36 +998,36 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
998
998
|
]
|
|
999
999
|
}
|
|
1000
1000
|
) : /* @__PURE__ */ e(re, {});
|
|
1001
|
-
}, Ht =
|
|
1001
|
+
}, Ht = R(kt), Ft = ({ onBackClick: i, sx: n = {} }) => {
|
|
1002
1002
|
const {
|
|
1003
1003
|
selectedAccounts: t,
|
|
1004
1004
|
selectedAccountGuids: s,
|
|
1005
1005
|
setSelectedAccounts: d,
|
|
1006
1006
|
shouldDisableNextDate: g,
|
|
1007
1007
|
shouldDisablePrevDate: m
|
|
1008
|
-
} = X(), { onEvent: c } = Ne(), { visibleCashAccounts: C } = Oe(), { setFilter: a } = ke(), { userProfile:
|
|
1008
|
+
} = X(), { onEvent: c } = Ne(), { visibleCashAccounts: C } = Oe(), { setFilter: a } = ke(), { userProfile: h } = de(), { dateRange: l, setSelectedCashAccounts: b } = V(), { loadRepeatingTransactions: _, setDateRange: w } = P(), { cashflow: A, recurring: u } = O(), { isCopyLoaded: E, isInitialized: S } = X(), [$, G] = f.useState(!1);
|
|
1009
1009
|
return f.useEffect(() => {
|
|
1010
|
-
|
|
1011
|
-
}, [
|
|
1010
|
+
S && (w(l), _().finally());
|
|
1011
|
+
}, [S]), f.useEffect(() => {
|
|
1012
1012
|
d(C);
|
|
1013
1013
|
}, [C]), f.useEffect(() => {
|
|
1014
|
-
const
|
|
1015
|
-
(
|
|
1014
|
+
const M = C.map((I) => I.guid), y = t.filter(
|
|
1015
|
+
(I) => s.includes(I.guid) && M.includes(I.guid)
|
|
1016
1016
|
);
|
|
1017
|
-
b(
|
|
1018
|
-
dateRange: { start: Ge(
|
|
1019
|
-
accounts:
|
|
1017
|
+
b(y), a({
|
|
1018
|
+
dateRange: { start: Ge(B(), 90), end: ut() },
|
|
1019
|
+
accounts: y.map((I) => I.guid)
|
|
1020
1020
|
});
|
|
1021
|
-
}, [C, t]), !
|
|
1021
|
+
}, [C, t]), !E || !S ? /* @__PURE__ */ e(re, {}) : h?.has_completed_cash_flow_onboarding ? /* @__PURE__ */ o(
|
|
1022
1022
|
ve,
|
|
1023
1023
|
{
|
|
1024
1024
|
accountOptions: C,
|
|
1025
1025
|
actions: [
|
|
1026
1026
|
{
|
|
1027
|
-
label:
|
|
1028
|
-
iconName: "
|
|
1027
|
+
label: u.action_title,
|
|
1028
|
+
iconName: "credit_card",
|
|
1029
1029
|
onClick: () => {
|
|
1030
|
-
|
|
1030
|
+
G(!0), c(Ae.CASH_FLOW_CLICK_SETTINGS);
|
|
1031
1031
|
}
|
|
1032
1032
|
}
|
|
1033
1033
|
],
|
|
@@ -1043,18 +1043,18 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
1043
1043
|
onAccountsFilterClick: () => c(Ae.CASH_FLOW_CLICK_FILTER),
|
|
1044
1044
|
onBackClick: i,
|
|
1045
1045
|
sx: n,
|
|
1046
|
-
title:
|
|
1046
|
+
title: A.title,
|
|
1047
1047
|
children: [
|
|
1048
1048
|
/* @__PURE__ */ e(Et, {}),
|
|
1049
1049
|
/* @__PURE__ */ e(vt, {}),
|
|
1050
1050
|
/* @__PURE__ */ e(
|
|
1051
1051
|
$e,
|
|
1052
1052
|
{
|
|
1053
|
-
ariaLabelClose:
|
|
1054
|
-
isOpen:
|
|
1055
|
-
onClose: () =>
|
|
1053
|
+
ariaLabelClose: A.close_settings_aria,
|
|
1054
|
+
isOpen: $,
|
|
1055
|
+
onClose: () => G(!1),
|
|
1056
1056
|
shouldShowHeaderBorders: !1,
|
|
1057
|
-
title:
|
|
1057
|
+
title: u.action_title,
|
|
1058
1058
|
children: /* @__PURE__ */ e(Qe, {})
|
|
1059
1059
|
}
|
|
1060
1060
|
)
|
|
@@ -1065,29 +1065,29 @@ const Ct = ({ recurrence: i }) => /* @__PURE__ */ o(B, { children: [
|
|
|
1065
1065
|
{
|
|
1066
1066
|
onBackClick: i,
|
|
1067
1067
|
sx: { height: "100%", overflow: "auto" },
|
|
1068
|
-
title:
|
|
1068
|
+
title: A.title,
|
|
1069
1069
|
children: /* @__PURE__ */ e(Ht, {})
|
|
1070
1070
|
}
|
|
1071
1071
|
);
|
|
1072
|
-
}, Ln =
|
|
1072
|
+
}, Ln = R(Ft);
|
|
1073
1073
|
class On {
|
|
1074
1074
|
fetchInstance;
|
|
1075
1075
|
constructor(n, t) {
|
|
1076
1076
|
this.fetchInstance = new ht(n, t);
|
|
1077
1077
|
}
|
|
1078
|
-
addCashflowEvent = async (n) => this.fetchInstance.post(
|
|
1079
|
-
addCashflowSequence = async (n) => this.fetchInstance.post(
|
|
1080
|
-
getCashflowSequences = async () => this.fetchInstance.get(
|
|
1078
|
+
addCashflowEvent = async (n) => this.fetchInstance.post(j.CASHFLOW_EVENTS, { ...n }).then((t) => t);
|
|
1079
|
+
addCashflowSequence = async (n) => this.fetchInstance.post(j.CASHFLOW_SEQUENCES, { ...n }).then((t) => t.cashflow_sequence);
|
|
1080
|
+
getCashflowSequences = async () => this.fetchInstance.get(j.CASHFLOW_SEQUENCES).then((n) => n.cashflow_sequences);
|
|
1081
1081
|
getCashflowEventsByDateRange = async (n, t) => this.fetchInstance.get(
|
|
1082
|
-
`${
|
|
1082
|
+
`${j.CASHFLOW_EVENTS}/from/${z(n)}/to/${z(t)}`
|
|
1083
1083
|
).then((s) => s.cashflow_events);
|
|
1084
|
-
deleteCashflowSequence = async (n) => this.fetchInstance.delete(`${
|
|
1084
|
+
deleteCashflowSequence = async (n) => this.fetchInstance.delete(`${j.CASHFLOW_SEQUENCES}/${n}`).then((t) => t);
|
|
1085
1085
|
getProjectedCashflowEvents = async (n, t) => this.fetchInstance.get(
|
|
1086
|
-
`${
|
|
1086
|
+
`${j.CASHFLOW_SEQUENCES}/projected_events/from/${z(
|
|
1087
1087
|
n
|
|
1088
|
-
)}/to/${
|
|
1088
|
+
)}/to/${z(t)}`
|
|
1089
1089
|
).then((s) => s.cashflow_events);
|
|
1090
|
-
updateCashflowSequence = async (n) => this.fetchInstance.put(`${
|
|
1090
|
+
updateCashflowSequence = async (n) => this.fetchInstance.put(`${j.CASHFLOW_SEQUENCES}/${n.guid}`, n).then((t) => t.cashflow_sequence);
|
|
1091
1091
|
}
|
|
1092
1092
|
export {
|
|
1093
1093
|
On as CashflowApi,
|