@mx-cartographer/experiences 7.1.0 → 7.1.1-alpha.al0
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 +4 -0
- package/dist/cashflow/index.es.js +357 -349
- package/package.json +1 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { jsxs as o, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { observer as
|
|
1
|
+
import { jsxs as o, Fragment as P, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import p, { useState as J } from "react";
|
|
3
|
+
import { observer as A } from "mobx-react-lite";
|
|
4
4
|
import { addMonths as qe } from "date-fns/addMonths";
|
|
5
|
-
import { startOfToday as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
5
|
+
import { startOfToday as $ } from "date-fns/startOfToday";
|
|
6
|
+
import _ from "@mui/material/Box";
|
|
7
|
+
import I from "@mui/material/Divider";
|
|
8
8
|
import s from "@mui/material/Stack";
|
|
9
9
|
import se from "@mui/material/styles/useTheme";
|
|
10
|
-
import { Text as
|
|
11
|
-
import { G as Ye, t as me, u as L, p as ce, d as Ne, b as
|
|
10
|
+
import { Text as h, P as O, Icon as M, InstitutionLogo as xe, H1 as de, H2 as Xe } from "@mxenabled/mxui";
|
|
11
|
+
import { G as Ye, t as me, u as L, p as ce, d as Ne, b as Y, j as q, g as Oe, o as ke, h as He, a as Qe } from "../hooks-CE2TKk4a.mjs";
|
|
12
12
|
import { C as R } from "../CurrencyText-kyC1aseI.mjs";
|
|
13
13
|
import { u as ue } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
14
14
|
import { L as te } from "../Loader-DUaFpDGv.mjs";
|
|
15
15
|
import { I as he } from "../CashflowStore-D9Dpuz7X.mjs";
|
|
16
16
|
import { C as Gn } from "../CashflowStore-D9Dpuz7X.mjs";
|
|
17
|
-
import { b as
|
|
17
|
+
import { b as j } from "../Localization-2MODESHW.mjs";
|
|
18
18
|
import { M as Ve } from "../MiniWidgetContainer-DTQdRK-3.mjs";
|
|
19
19
|
import { E as Ke } from "../EmptyState-DA_lfRBv.mjs";
|
|
20
20
|
import { R as Je } from "../RecurringSettings-1t4mROQZ.mjs";
|
|
21
21
|
import Ze from "@mui/material/Tabs";
|
|
22
22
|
import ye from "@mui/material/Tab";
|
|
23
|
-
import { getUnixTime as
|
|
23
|
+
import { getUnixTime as U } from "date-fns/getUnixTime";
|
|
24
24
|
import ee from "@mui/material/List";
|
|
25
25
|
import ne from "@mui/material/ListItem";
|
|
26
26
|
import { A as et } from "../AccountListItem-DbpLvx5I.mjs";
|
|
27
|
-
import { f as
|
|
27
|
+
import { f as Q, D as V } from "../Dialog-CWW597AF.mjs";
|
|
28
28
|
import tt from "@mui/material/ListSubheader";
|
|
29
29
|
import { f as Z } from "../NumberFormatting-Buh7u8Oi.mjs";
|
|
30
30
|
import { isAfter as Fe } from "date-fns/isAfter";
|
|
@@ -34,7 +34,7 @@ import { addDays as Ce } from "date-fns/addDays";
|
|
|
34
34
|
import { alpha as nt, keyframes as ot } from "@mui/material/styles";
|
|
35
35
|
import { DataGridPro as at } from "@mui/x-data-grid-pro";
|
|
36
36
|
import { T as Se } from "../TabContentContainer-j01JYR_7.mjs";
|
|
37
|
-
import
|
|
37
|
+
import W from "@mui/material/Button";
|
|
38
38
|
import { M as it, S as rt, i as st, d as we, c as ct } from "../ManageIncome-BXlzeXk6.mjs";
|
|
39
39
|
import { D as Me } from "../Drawer-kEE73B87.mjs";
|
|
40
40
|
import { formatISO as lt } from "date-fns/formatISO";
|
|
@@ -42,20 +42,20 @@ import { fromUnixTime as _e } from "date-fns/fromUnixTime";
|
|
|
42
42
|
import { startOfMonth as dt } from "date-fns/startOfMonth";
|
|
43
43
|
import { subDays as Ge } from "date-fns/subDays";
|
|
44
44
|
import { S as mt, b as ut } from "../TransactionDetails-B2Z5S7FM.mjs";
|
|
45
|
-
import { F as ht, R as Ie, e as
|
|
45
|
+
import { F as ht, R as Ie, e as De } from "../RecurringTransactions-ej39mgA6.mjs";
|
|
46
46
|
import { h as pt } from "../DateUtil-BcuH7ErC.mjs";
|
|
47
47
|
import { endOfToday as ft } from "date-fns/endOfToday";
|
|
48
|
-
import { W as
|
|
49
|
-
import { F as gt, A as
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
48
|
+
import { W as ve, A as Ae } from "../WidgetContainer-B8MRJ5Y1.mjs";
|
|
49
|
+
import { F as gt, A as B } from "../Fetch-87LIQbEA.mjs";
|
|
50
|
+
const K = () => {
|
|
51
|
+
if (!p.useContext(Ye))
|
|
52
52
|
throw new Error("useCashflowUiStore() must be used within the GlobalDataContext");
|
|
53
53
|
return me().uiStore;
|
|
54
54
|
}, bt = ({ remaining: a }) => {
|
|
55
55
|
const { cashflow: n } = L();
|
|
56
|
-
return /* @__PURE__ */ o(
|
|
56
|
+
return /* @__PURE__ */ o(P, { children: [
|
|
57
57
|
/* @__PURE__ */ e(
|
|
58
|
-
|
|
58
|
+
_,
|
|
59
59
|
{
|
|
60
60
|
sx: {
|
|
61
61
|
borderRadius: "1px",
|
|
@@ -65,38 +65,38 @@ const V = () => {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
),
|
|
68
|
-
/* @__PURE__ */ e(
|
|
68
|
+
/* @__PURE__ */ e(h, { bold: !0, sx: { flexGrow: 1, fontSize: 12 }, children: n.remaining_cash }),
|
|
69
69
|
/* @__PURE__ */ e(R, { amount: a, bold: !0, sx: { fontSize: 12 } })
|
|
70
70
|
] });
|
|
71
|
-
}, pe =
|
|
72
|
-
const a = se(), { availableWidth: n } = ce(), { isMobile: t } = ue(), { visibleCashAccounts:
|
|
73
|
-
daysUntilNextIncome:
|
|
74
|
-
expensesTilNextIncome:
|
|
75
|
-
selectedCashAccounts:
|
|
76
|
-
setNextIncome:
|
|
77
|
-
setSelectedCashAccounts:
|
|
78
|
-
setUpcomingExpenses:
|
|
79
|
-
} =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}, [
|
|
83
|
-
|
|
84
|
-
|
|
71
|
+
}, pe = A(bt), xt = () => {
|
|
72
|
+
const a = se(), { availableWidth: n } = ce(), { isMobile: t } = ue(), { visibleCashAccounts: i, visibleCashBalance: f } = Ne(), { selectedAccounts: y, selectedAccountGuids: c, setSelectedAccounts: b } = Y(), { cashflow: l } = L(), {
|
|
73
|
+
daysUntilNextIncome: r,
|
|
74
|
+
expensesTilNextIncome: m,
|
|
75
|
+
selectedCashAccounts: d,
|
|
76
|
+
setNextIncome: g,
|
|
77
|
+
setSelectedCashAccounts: S,
|
|
78
|
+
setUpcomingExpenses: w
|
|
79
|
+
} = K(), { isDataLoaded: E, nextIncomeRecurrence: T, upcomingExpenses: k } = q();
|
|
80
|
+
p.useEffect(() => {
|
|
81
|
+
b(i);
|
|
82
|
+
}, [i]), p.useEffect(() => {
|
|
83
|
+
S(
|
|
84
|
+
i.filter((x) => c.includes(x.guid))
|
|
85
85
|
);
|
|
86
|
-
}, [
|
|
87
|
-
|
|
88
|
-
}, [
|
|
89
|
-
const
|
|
90
|
-
() =>
|
|
91
|
-
[c,
|
|
92
|
-
),
|
|
93
|
-
() =>
|
|
94
|
-
[c,
|
|
95
|
-
),
|
|
96
|
-
() =>
|
|
97
|
-
[
|
|
86
|
+
}, [i, y]), p.useEffect(() => {
|
|
87
|
+
T && g(T), w(k);
|
|
88
|
+
}, [T, k]);
|
|
89
|
+
const H = p.useMemo(
|
|
90
|
+
() => i.filter((x) => c.includes(x.guid)).reduce((x, z) => x + (z?.balance || 0), 0),
|
|
91
|
+
[c, k]
|
|
92
|
+
), u = p.useMemo(
|
|
93
|
+
() => m.filter((x) => c.includes(x.accountGuid || "")).reduce((x, z) => x + z.amount, 0),
|
|
94
|
+
[c, m]
|
|
95
|
+
), N = p.useMemo(
|
|
96
|
+
() => H - u,
|
|
97
|
+
[H, u]
|
|
98
98
|
);
|
|
99
|
-
return
|
|
99
|
+
return E ? /* @__PURE__ */ e(_, { className: "mx-cashflow", pl: 16, pr: 16, pt: 16, children: n > 710 ? /* @__PURE__ */ o(
|
|
100
100
|
s,
|
|
101
101
|
{
|
|
102
102
|
border: `1px solid ${a.palette.border.light}`,
|
|
@@ -106,45 +106,45 @@ const V = () => {
|
|
|
106
106
|
px: 24,
|
|
107
107
|
children: [
|
|
108
108
|
/* @__PURE__ */ o(s, { pb: 14, pt: 12, children: [
|
|
109
|
-
/* @__PURE__ */ e(R, { amount:
|
|
110
|
-
/* @__PURE__ */ e(O, { variant: "XSmall", whiteSpace: "nowrap", children:
|
|
109
|
+
/* @__PURE__ */ e(R, { amount: H, variant: "H2" }),
|
|
110
|
+
/* @__PURE__ */ e(O, { variant: "XSmall", whiteSpace: "nowrap", children: j(
|
|
111
111
|
l.total_cash_accounts,
|
|
112
|
-
|
|
112
|
+
d.length
|
|
113
113
|
) })
|
|
114
114
|
] }),
|
|
115
|
-
/* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(
|
|
115
|
+
/* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(M, { name: "remove" }) }),
|
|
116
116
|
/* @__PURE__ */ o(s, { pb: 14, pt: 12, children: [
|
|
117
|
-
/* @__PURE__ */ e(R, { amount:
|
|
118
|
-
/* @__PURE__ */ e(O, { variant: "XSmall", whiteSpace: "nowrap", children:
|
|
117
|
+
/* @__PURE__ */ e(R, { amount: u, variant: "H2" }),
|
|
118
|
+
/* @__PURE__ */ e(O, { variant: "XSmall", whiteSpace: "nowrap", children: j(l.expenses_due, m.length) })
|
|
119
119
|
] }),
|
|
120
|
-
/* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(
|
|
120
|
+
/* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(M, { name: "equal" }) }),
|
|
121
121
|
/* @__PURE__ */ o(s, { pb: 14, pr: 24, pt: 12, children: [
|
|
122
|
-
/* @__PURE__ */ e(R, { amount:
|
|
122
|
+
/* @__PURE__ */ e(R, { amount: N, variant: "H2" }),
|
|
123
123
|
/* @__PURE__ */ o(s, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
124
124
|
/* @__PURE__ */ e(O, { variant: "XSmall", whiteSpace: "nowrap", children: l.available_to_spend }),
|
|
125
125
|
/* @__PURE__ */ e(he, { body: l.tooltip_body, title: l.tooltip_title })
|
|
126
126
|
] })
|
|
127
127
|
] }),
|
|
128
|
-
/* @__PURE__ */ e(s, { borderLeft: `1px solid ${a.palette.border.light}`, pb: 12, pl: 24, pt: 12, children: /* @__PURE__ */ o(
|
|
129
|
-
/* @__PURE__ */ e(
|
|
128
|
+
/* @__PURE__ */ e(s, { borderLeft: `1px solid ${a.palette.border.light}`, pb: 12, pl: 24, pt: 12, children: /* @__PURE__ */ o(P, { children: [
|
|
129
|
+
/* @__PURE__ */ e(h, { variant: "H2", children: j(l.days, r) }),
|
|
130
130
|
/* @__PURE__ */ e(O, { variant: "XSmall", whiteSpace: "nowrap", children: l.next_paycheck })
|
|
131
131
|
] }) })
|
|
132
132
|
]
|
|
133
133
|
}
|
|
134
134
|
) : /* @__PURE__ */ o(s, { border: `1px solid ${a.palette.border.light}`, borderRadius: 1, children: [
|
|
135
135
|
/* @__PURE__ */ o(s, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
136
|
-
/* @__PURE__ */ e(
|
|
136
|
+
/* @__PURE__ */ e(h, { variant: "Small", children: j(
|
|
137
137
|
l.total_cash_accounts,
|
|
138
|
-
|
|
138
|
+
d.length
|
|
139
139
|
) }),
|
|
140
|
-
/* @__PURE__ */ e(R, { amount:
|
|
140
|
+
/* @__PURE__ */ e(R, { amount: f, bold: !0, variant: "XSmall" })
|
|
141
141
|
] }),
|
|
142
|
-
/* @__PURE__ */ e(
|
|
142
|
+
/* @__PURE__ */ e(I, {}),
|
|
143
143
|
/* @__PURE__ */ o(s, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
144
|
-
/* @__PURE__ */ e(
|
|
145
|
-
/* @__PURE__ */ e(R, { amount:
|
|
144
|
+
/* @__PURE__ */ e(h, { variant: "Small", children: j(l.expenses_due, m.length) }),
|
|
145
|
+
/* @__PURE__ */ e(R, { amount: u, bold: !0, symbol: "-", variant: "XSmall" })
|
|
146
146
|
] }),
|
|
147
|
-
/* @__PURE__ */ e(
|
|
147
|
+
/* @__PURE__ */ e(I, {}),
|
|
148
148
|
/* @__PURE__ */ e(
|
|
149
149
|
s,
|
|
150
150
|
{
|
|
@@ -156,51 +156,51 @@ const V = () => {
|
|
|
156
156
|
justifyContent: "space-between",
|
|
157
157
|
px: 16,
|
|
158
158
|
sx: { borderBottomLeftRadius: 4, borderBottomRightRadius: 4 },
|
|
159
|
-
children: /* @__PURE__ */ e(pe, { remaining:
|
|
159
|
+
children: /* @__PURE__ */ e(pe, { remaining: N })
|
|
160
160
|
}
|
|
161
161
|
),
|
|
162
|
-
/* @__PURE__ */ e(
|
|
162
|
+
/* @__PURE__ */ e(I, {}),
|
|
163
163
|
/* @__PURE__ */ o(s, { direction: "row", justifyContent: "space-between", p: 16, children: [
|
|
164
|
-
/* @__PURE__ */ e(
|
|
165
|
-
/* @__PURE__ */ e(
|
|
164
|
+
/* @__PURE__ */ e(h, { variant: "Small", children: l.next_paycheck }),
|
|
165
|
+
/* @__PURE__ */ e(h, { bold: !0, variant: "XSmall", children: j(l.days, r) })
|
|
166
166
|
] })
|
|
167
167
|
] }) }) : /* @__PURE__ */ e(te, { height: t ? 210 : 120 });
|
|
168
|
-
}, yt =
|
|
168
|
+
}, yt = A(xt), Ct = ({
|
|
169
169
|
onPrimaryCtaClick: a,
|
|
170
170
|
onSecondaryCtaClick: n,
|
|
171
171
|
sx: t = {}
|
|
172
172
|
}) => {
|
|
173
|
-
const { cashflow:
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}, [
|
|
177
|
-
const
|
|
178
|
-
return
|
|
173
|
+
const { cashflow: i } = L(), { isCopyLoaded: f, isInitialized: y } = Y(), { loadRepeatingTransactions: c, income: b, isDataLoaded: l, setDateRange: r } = q();
|
|
174
|
+
p.useEffect(() => {
|
|
175
|
+
y && (r({ start: $(), end: qe($(), 1) }), c().finally());
|
|
176
|
+
}, [y]);
|
|
177
|
+
const m = l && !b.length;
|
|
178
|
+
return f ? /* @__PURE__ */ o(
|
|
179
179
|
Ve,
|
|
180
180
|
{
|
|
181
181
|
className: "mx-exp-cashflow-miniwidget",
|
|
182
182
|
onPrimaryCtaClick: a,
|
|
183
|
-
primaryCtaLabel:
|
|
184
|
-
subTitle:
|
|
183
|
+
primaryCtaLabel: i.primary_cta,
|
|
184
|
+
subTitle: m || !l ? void 0 : i.sub_title,
|
|
185
185
|
sx: t,
|
|
186
|
-
title:
|
|
186
|
+
title: i.title,
|
|
187
187
|
children: [
|
|
188
188
|
!l && /* @__PURE__ */ e(te, {}),
|
|
189
|
-
l && (
|
|
189
|
+
l && (m ? /* @__PURE__ */ e(
|
|
190
190
|
Ke,
|
|
191
191
|
{
|
|
192
|
-
header:
|
|
192
|
+
header: i.create,
|
|
193
193
|
icon: "local_atm",
|
|
194
194
|
onClick: n,
|
|
195
|
-
primaryButton:
|
|
195
|
+
primaryButton: i.add_income,
|
|
196
196
|
primaryButtonStartIcon: "add",
|
|
197
|
-
subText:
|
|
197
|
+
subText: i.create_description
|
|
198
198
|
}
|
|
199
199
|
) : /* @__PURE__ */ e(yt, {}))
|
|
200
200
|
]
|
|
201
201
|
}
|
|
202
202
|
) : /* @__PURE__ */ e(te, {});
|
|
203
|
-
}, Hn =
|
|
203
|
+
}, Hn = A(Ct), St = ({ remaining: a }) => /* @__PURE__ */ e(
|
|
204
204
|
ne,
|
|
205
205
|
{
|
|
206
206
|
sx: {
|
|
@@ -217,13 +217,13 @@ const V = () => {
|
|
|
217
217
|
}
|
|
218
218
|
);
|
|
219
219
|
var oe = /* @__PURE__ */ ((a) => (a.EXPENSE = "expense", a.INCOME = "income", a))(oe || {});
|
|
220
|
-
const wt = ({ recurrence: a }) => /* @__PURE__ */ o(
|
|
220
|
+
const wt = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
|
|
221
221
|
/* @__PURE__ */ o(ne, { sx: { display: "flex", alignItems: "center", gap: 16, px: 24, py: 12 }, children: [
|
|
222
222
|
/* @__PURE__ */ o(s, { alignItems: "center", height: 32, width: 32, children: [
|
|
223
|
-
/* @__PURE__ */ e(
|
|
224
|
-
/* @__PURE__ */ e(
|
|
223
|
+
/* @__PURE__ */ e(h, { bold: !0, sx: { fontSize: 11 }, children: Q(a.expectedDate, V.MONTH) }),
|
|
224
|
+
/* @__PURE__ */ e(h, { bold: !0, sx: { fontSize: 11 }, children: Q(a.expectedDate, V.DAY) })
|
|
225
225
|
] }),
|
|
226
|
-
/* @__PURE__ */ e(
|
|
226
|
+
/* @__PURE__ */ e(h, { sx: { flexGrow: 1, fontSize: 13 }, children: a.name }),
|
|
227
227
|
/* @__PURE__ */ e(
|
|
228
228
|
R,
|
|
229
229
|
{
|
|
@@ -233,10 +233,10 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
233
233
|
}
|
|
234
234
|
)
|
|
235
235
|
] }),
|
|
236
|
-
/* @__PURE__ */ e(
|
|
237
|
-
] }), Ee =
|
|
236
|
+
/* @__PURE__ */ e(I, {})
|
|
237
|
+
] }), Ee = A(wt), _t = ({ total: a, type: n }) => {
|
|
238
238
|
const { cashflow: t } = L();
|
|
239
|
-
return /* @__PURE__ */ o(
|
|
239
|
+
return /* @__PURE__ */ o(P, { children: [
|
|
240
240
|
/* @__PURE__ */ o(
|
|
241
241
|
tt,
|
|
242
242
|
{
|
|
@@ -250,36 +250,36 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
250
250
|
px: 24
|
|
251
251
|
},
|
|
252
252
|
children: [
|
|
253
|
-
/* @__PURE__ */ e(
|
|
254
|
-
/* @__PURE__ */ o(
|
|
253
|
+
/* @__PURE__ */ e(h, { bold: !0, sx: { fontSize: 12 }, children: n === oe.EXPENSE ? t.expenses : t.income }),
|
|
254
|
+
/* @__PURE__ */ o(h, { bold: !0, sx: { fontSize: 13 }, children: [
|
|
255
255
|
n === oe.EXPENSE ? "-" : "+",
|
|
256
256
|
Z(a, "0,0.00")
|
|
257
257
|
] })
|
|
258
258
|
]
|
|
259
259
|
}
|
|
260
260
|
),
|
|
261
|
-
/* @__PURE__ */ e(
|
|
261
|
+
/* @__PURE__ */ e(I, {})
|
|
262
262
|
] });
|
|
263
|
-
}, Te =
|
|
264
|
-
const { availableWidth: a } = ce(), { cashflow: n } = L(), { upcomingExpenses: t, upcomingIncome:
|
|
263
|
+
}, Te = A(_t), re = (a, n) => (t) => t.accountGuid === a.guid && ($e(t.expectedDate) || Fe(t.expectedDate, n.start)) && We(t.expectedDate, n.end), It = () => {
|
|
264
|
+
const { availableWidth: a } = ce(), { cashflow: n } = L(), { upcomingExpenses: t, upcomingIncome: i } = q(), { dateRange: f, selectedCashAccounts: y } = K();
|
|
265
265
|
return /* @__PURE__ */ o(s, { children: [
|
|
266
266
|
/* @__PURE__ */ o(s, { direction: a < 400 ? "column" : "row", justifyContent: "space-between", children: [
|
|
267
|
-
/* @__PURE__ */ e(
|
|
268
|
-
/* @__PURE__ */ o(
|
|
269
|
-
|
|
267
|
+
/* @__PURE__ */ e(h, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: n.accounts_breakdown }),
|
|
268
|
+
/* @__PURE__ */ o(h, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: [
|
|
269
|
+
Q(f.start, V.FULL_MONTH_DAY),
|
|
270
270
|
" -",
|
|
271
271
|
" ",
|
|
272
|
-
|
|
272
|
+
Q(f.end, V.FULL_MONTH_DAY)
|
|
273
273
|
] })
|
|
274
274
|
] }),
|
|
275
|
-
/* @__PURE__ */ e(s, { children:
|
|
276
|
-
const
|
|
277
|
-
re(c,
|
|
278
|
-
),
|
|
279
|
-
(
|
|
275
|
+
/* @__PURE__ */ e(s, { children: y.map((c) => {
|
|
276
|
+
const b = i.filter(re(c, f)).sort((d, g) => U(d.expectedDate) - U(g.expectedDate)), l = t.filter(
|
|
277
|
+
re(c, f)
|
|
278
|
+
), r = b.reduce(
|
|
279
|
+
(d, g) => d + g.amount,
|
|
280
280
|
0
|
|
281
|
-
),
|
|
282
|
-
(
|
|
281
|
+
), m = l.reduce(
|
|
282
|
+
(d, g) => d + g.amount,
|
|
283
283
|
0
|
|
284
284
|
);
|
|
285
285
|
return /* @__PURE__ */ o(
|
|
@@ -303,27 +303,27 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
),
|
|
306
|
-
/* @__PURE__ */ e(
|
|
307
|
-
|
|
306
|
+
/* @__PURE__ */ e(I, {}),
|
|
307
|
+
b.length > 0 && /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(
|
|
308
308
|
ee,
|
|
309
309
|
{
|
|
310
|
-
subheader: /* @__PURE__ */ e(Te, { total:
|
|
310
|
+
subheader: /* @__PURE__ */ e(Te, { total: r, type: oe.INCOME }),
|
|
311
311
|
sx: { width: "100%" },
|
|
312
|
-
children:
|
|
312
|
+
children: b.map((d) => /* @__PURE__ */ e(Ee, { recurrence: d }, d.repeatingTransactionGuid))
|
|
313
313
|
}
|
|
314
314
|
) }),
|
|
315
315
|
l.length > 0 && /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(
|
|
316
316
|
ee,
|
|
317
317
|
{
|
|
318
|
-
subheader: /* @__PURE__ */ e(Te, { total:
|
|
318
|
+
subheader: /* @__PURE__ */ e(Te, { total: m, type: oe.EXPENSE }),
|
|
319
319
|
sx: { width: "100%" },
|
|
320
|
-
children: l.map((
|
|
320
|
+
children: l.map((d) => /* @__PURE__ */ e(Ee, { recurrence: d }, d.repeatingTransactionGuid))
|
|
321
321
|
}
|
|
322
322
|
) }),
|
|
323
323
|
/* @__PURE__ */ e(
|
|
324
324
|
St,
|
|
325
325
|
{
|
|
326
|
-
remaining: (c.available_balance || c.balance || 0) +
|
|
326
|
+
remaining: (c.available_balance || c.balance || 0) + r - m
|
|
327
327
|
}
|
|
328
328
|
)
|
|
329
329
|
]
|
|
@@ -332,24 +332,24 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
332
332
|
);
|
|
333
333
|
}) })
|
|
334
334
|
] });
|
|
335
|
-
},
|
|
336
|
-
const { availableWidth: a } = ce(), n = se(), { cashflow: t } = L(), { upcomingExpenses:
|
|
335
|
+
}, Dt = A(It), vt = () => {
|
|
336
|
+
const { availableWidth: a } = ce(), n = se(), { cashflow: t } = L(), { upcomingExpenses: i, upcomingIncome: f } = q(), { dateRange: y, selectedCashAccounts: c } = K(), b = [
|
|
337
337
|
{
|
|
338
338
|
field: "account",
|
|
339
339
|
flex: 1.5,
|
|
340
340
|
headerName: t.accounts,
|
|
341
|
-
renderCell: ({ value: { name:
|
|
342
|
-
const
|
|
341
|
+
renderCell: ({ value: { name: r, nickname: m, institution_guid: d, account_number: g } }) => {
|
|
342
|
+
const S = m || r;
|
|
343
343
|
return /* @__PURE__ */ o(s, { alignItems: "center", flexDirection: "row", gap: 12, children: [
|
|
344
344
|
/* @__PURE__ */ e(
|
|
345
345
|
xe,
|
|
346
346
|
{
|
|
347
347
|
alt: t.institution_logo,
|
|
348
|
-
institutionGuid:
|
|
348
|
+
institutionGuid: d || "",
|
|
349
349
|
size: 16
|
|
350
350
|
}
|
|
351
351
|
),
|
|
352
|
-
/* @__PURE__ */ e(
|
|
352
|
+
/* @__PURE__ */ e(h, { variant: "body2", children: `${S} ${g ? `*${g}` : ""}` })
|
|
353
353
|
] });
|
|
354
354
|
}
|
|
355
355
|
},
|
|
@@ -358,56 +358,56 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
358
358
|
flex: 1,
|
|
359
359
|
headerName: t.balance,
|
|
360
360
|
type: "number",
|
|
361
|
-
renderCell: (
|
|
361
|
+
renderCell: (r) => /* @__PURE__ */ e(h, { color: n.palette.text.primary, variant: "Small", children: Z(r.value, "0,0.00") })
|
|
362
362
|
},
|
|
363
363
|
{
|
|
364
364
|
field: "income",
|
|
365
365
|
flex: 1,
|
|
366
366
|
headerName: t.projected_income,
|
|
367
367
|
type: "number",
|
|
368
|
-
renderCell: (
|
|
368
|
+
renderCell: (r) => /* @__PURE__ */ e(h, { color: n.palette.text.primary, variant: "Small", children: `+${Z(r.value, "0,0.00")}` })
|
|
369
369
|
},
|
|
370
370
|
{
|
|
371
371
|
field: "expenses",
|
|
372
372
|
flex: 1.1,
|
|
373
373
|
headerName: t.projected_expenses,
|
|
374
374
|
type: "number",
|
|
375
|
-
renderCell: (
|
|
375
|
+
renderCell: (r) => /* @__PURE__ */ e(h, { color: n.palette.text.primary, variant: "Small", children: `-${Z(r.value, "0,0.00")}` })
|
|
376
376
|
},
|
|
377
377
|
{
|
|
378
378
|
field: "remaining",
|
|
379
379
|
flex: 1,
|
|
380
380
|
headerName: t.remaining,
|
|
381
381
|
type: "number",
|
|
382
|
-
renderCell: (
|
|
383
|
-
const
|
|
382
|
+
renderCell: (r) => {
|
|
383
|
+
const m = r.row.balance + r.row.income - r.row.expenses;
|
|
384
384
|
return /* @__PURE__ */ e(
|
|
385
|
-
|
|
385
|
+
h,
|
|
386
386
|
{
|
|
387
|
-
color: Math.sign(
|
|
387
|
+
color: Math.sign(m) === -1 ? n.palette.error.main : n.palette.text.primary,
|
|
388
388
|
variant: "Small",
|
|
389
|
-
children: Z(
|
|
389
|
+
children: Z(m, "0,0.00")
|
|
390
390
|
}
|
|
391
391
|
);
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
], l =
|
|
395
|
-
const
|
|
396
|
-
re(
|
|
397
|
-
).reduce((
|
|
398
|
-
re(
|
|
399
|
-
).reduce((
|
|
394
|
+
], l = p.useMemo(() => c.map((r) => {
|
|
395
|
+
const m = i.filter(
|
|
396
|
+
re(r, { start: $(), end: Ce($(), 30) })
|
|
397
|
+
).reduce((S, w) => S + w.amount, 0), d = f.filter(
|
|
398
|
+
re(r, { start: $(), end: Ce($(), 30) })
|
|
399
|
+
).reduce((S, w) => S + w.amount, 0), g = (r.balance || 0) + d - m;
|
|
400
400
|
return {
|
|
401
|
-
account:
|
|
402
|
-
balance:
|
|
403
|
-
id:
|
|
404
|
-
income:
|
|
405
|
-
expenses:
|
|
406
|
-
remaining:
|
|
401
|
+
account: r,
|
|
402
|
+
balance: r.balance || 0,
|
|
403
|
+
id: r.guid,
|
|
404
|
+
income: d,
|
|
405
|
+
expenses: m,
|
|
406
|
+
remaining: g
|
|
407
407
|
};
|
|
408
|
-
}), [c,
|
|
408
|
+
}), [c, i, f]);
|
|
409
409
|
return /* @__PURE__ */ o(
|
|
410
|
-
|
|
410
|
+
_,
|
|
411
411
|
{
|
|
412
412
|
sx: {
|
|
413
413
|
width: "100%"
|
|
@@ -422,7 +422,7 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
422
422
|
children: [
|
|
423
423
|
/* @__PURE__ */ o(s, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
424
424
|
/* @__PURE__ */ e(
|
|
425
|
-
|
|
425
|
+
h,
|
|
426
426
|
{
|
|
427
427
|
bold: !0,
|
|
428
428
|
sx: {
|
|
@@ -440,11 +440,11 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
440
440
|
}
|
|
441
441
|
)
|
|
442
442
|
] }),
|
|
443
|
-
/* @__PURE__ */ o(
|
|
444
|
-
|
|
443
|
+
/* @__PURE__ */ o(h, { bold: !0, sx: { fontSize: 15, whiteSpace: "normal" }, children: [
|
|
444
|
+
Q(y.start, V.FULL_MONTH_DAY),
|
|
445
445
|
" -",
|
|
446
446
|
" ",
|
|
447
|
-
|
|
447
|
+
Q(y.end, V.FULL_MONTH_DAY)
|
|
448
448
|
] })
|
|
449
449
|
]
|
|
450
450
|
}
|
|
@@ -453,7 +453,7 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
453
453
|
at,
|
|
454
454
|
{
|
|
455
455
|
columnHeaderHeight: 48,
|
|
456
|
-
columns:
|
|
456
|
+
columns: b,
|
|
457
457
|
density: "standard",
|
|
458
458
|
disableColumnMenu: !0,
|
|
459
459
|
disableRowSelectionOnClick: !0,
|
|
@@ -479,8 +479,8 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
|
-
) : l.map((
|
|
483
|
-
const { name:
|
|
482
|
+
) : l.map((r) => {
|
|
483
|
+
const { name: m, nickname: d, institution_guid: g, account_number: S } = r.account, w = d || m;
|
|
484
484
|
return /* @__PURE__ */ e(
|
|
485
485
|
ee,
|
|
486
486
|
{
|
|
@@ -505,17 +505,17 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
505
505
|
xe,
|
|
506
506
|
{
|
|
507
507
|
alt: t.institution_logo,
|
|
508
|
-
institutionGuid:
|
|
508
|
+
institutionGuid: g || "",
|
|
509
509
|
size: 16
|
|
510
510
|
}
|
|
511
511
|
),
|
|
512
|
-
/* @__PURE__ */ e(
|
|
512
|
+
/* @__PURE__ */ e(h, { variant: "Small", children: `${w} ${S ? `*${S}` : ""}` })
|
|
513
513
|
] }),
|
|
514
|
-
/* @__PURE__ */ e(R, { amount:
|
|
514
|
+
/* @__PURE__ */ e(R, { amount: r.balance, bold: !0, variant: "Small" })
|
|
515
515
|
]
|
|
516
516
|
}
|
|
517
517
|
),
|
|
518
|
-
/* @__PURE__ */ e(
|
|
518
|
+
/* @__PURE__ */ e(I, { sx: { width: "100%" } }),
|
|
519
519
|
/* @__PURE__ */ o(
|
|
520
520
|
s,
|
|
521
521
|
{
|
|
@@ -525,12 +525,12 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
525
525
|
px: 16,
|
|
526
526
|
py: 12,
|
|
527
527
|
children: [
|
|
528
|
-
/* @__PURE__ */ e(
|
|
529
|
-
/* @__PURE__ */ e(R, { amount:
|
|
528
|
+
/* @__PURE__ */ e(h, { variant: "Small", children: t.projected_income }),
|
|
529
|
+
/* @__PURE__ */ e(R, { amount: r.income, bold: !0, symbol: "+", variant: "Small" })
|
|
530
530
|
]
|
|
531
531
|
}
|
|
532
532
|
),
|
|
533
|
-
/* @__PURE__ */ e(
|
|
533
|
+
/* @__PURE__ */ e(I, { sx: { width: "100%" } }),
|
|
534
534
|
/* @__PURE__ */ o(
|
|
535
535
|
s,
|
|
536
536
|
{
|
|
@@ -540,12 +540,12 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
540
540
|
px: 16,
|
|
541
541
|
py: 12,
|
|
542
542
|
children: [
|
|
543
|
-
/* @__PURE__ */ e(
|
|
544
|
-
/* @__PURE__ */ e(R, { amount:
|
|
543
|
+
/* @__PURE__ */ e(h, { variant: "Small", children: t.projected_expenses }),
|
|
544
|
+
/* @__PURE__ */ e(R, { amount: r.expenses, bold: !0, symbol: "-", variant: "Small" })
|
|
545
545
|
]
|
|
546
546
|
}
|
|
547
547
|
),
|
|
548
|
-
/* @__PURE__ */ e(
|
|
548
|
+
/* @__PURE__ */ e(I, { sx: { width: "100%" } }),
|
|
549
549
|
/* @__PURE__ */ e(
|
|
550
550
|
s,
|
|
551
551
|
{
|
|
@@ -557,32 +557,32 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
557
557
|
px: 16,
|
|
558
558
|
py: 12,
|
|
559
559
|
sx: { borderBottomLeftRadius: "4px", borderBottomRightRadius: "4px" },
|
|
560
|
-
children: /* @__PURE__ */ e(pe, { remaining:
|
|
560
|
+
children: /* @__PURE__ */ e(pe, { remaining: r.remaining })
|
|
561
561
|
}
|
|
562
562
|
)
|
|
563
563
|
] }) })
|
|
564
564
|
},
|
|
565
|
-
|
|
565
|
+
r.id
|
|
566
566
|
);
|
|
567
567
|
})
|
|
568
568
|
]
|
|
569
569
|
}
|
|
570
570
|
);
|
|
571
|
-
}, At =
|
|
572
|
-
const { cashflow: a } = L(), { isDesktop: n } = ue(), { onEvent: t } = Oe(), [
|
|
573
|
-
|
|
571
|
+
}, At = A(vt), Et = () => {
|
|
572
|
+
const { cashflow: a } = L(), { isDesktop: n } = ue(), { onEvent: t } = Oe(), [i, f] = p.useState(0), y = (c, b) => {
|
|
573
|
+
f(b);
|
|
574
574
|
};
|
|
575
|
-
return
|
|
576
|
-
t(
|
|
577
|
-
}, [
|
|
575
|
+
return p.useEffect(() => {
|
|
576
|
+
t(i === 0 ? "cash_flow_summary" : "cash_flow_details");
|
|
577
|
+
}, [i]), /* @__PURE__ */ o(_, { children: [
|
|
578
578
|
/* @__PURE__ */ o(
|
|
579
579
|
Ze,
|
|
580
580
|
{
|
|
581
581
|
"aria-label": a.cashflow_summary_and_details,
|
|
582
582
|
centered: !0,
|
|
583
|
-
onChange:
|
|
583
|
+
onChange: y,
|
|
584
584
|
textColor: "primary",
|
|
585
|
-
value:
|
|
585
|
+
value: i,
|
|
586
586
|
variant: "fullWidth",
|
|
587
587
|
children: [
|
|
588
588
|
/* @__PURE__ */ e(
|
|
@@ -610,17 +610,17 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
610
610
|
]
|
|
611
611
|
}
|
|
612
612
|
),
|
|
613
|
-
/* @__PURE__ */ e(
|
|
614
|
-
/* @__PURE__ */ e(Se, { index: 0, name: "cashflow", value:
|
|
615
|
-
/* @__PURE__ */ e(Se, { index: 1, name: "cashflow", value:
|
|
613
|
+
/* @__PURE__ */ e(_, { sx: { mb: 32 } }),
|
|
614
|
+
/* @__PURE__ */ e(Se, { index: 0, name: "cashflow", value: i, children: /* @__PURE__ */ e(_, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(At, {}) }) }),
|
|
615
|
+
/* @__PURE__ */ e(Se, { index: 1, name: "cashflow", value: i, children: /* @__PURE__ */ e(_, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(Dt, {}) }) })
|
|
616
616
|
] });
|
|
617
|
-
}, Tt =
|
|
617
|
+
}, Tt = A(Et), ie = ({
|
|
618
618
|
amount: a,
|
|
619
619
|
isMobile: n = !1,
|
|
620
620
|
isTotal: t = !1,
|
|
621
|
-
label:
|
|
622
|
-
symbol:
|
|
623
|
-
tooltip:
|
|
621
|
+
label: i,
|
|
622
|
+
symbol: f,
|
|
623
|
+
tooltip: y
|
|
624
624
|
}) => /* @__PURE__ */ o(
|
|
625
625
|
s,
|
|
626
626
|
{
|
|
@@ -632,80 +632,88 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
632
632
|
children: [
|
|
633
633
|
!n && /* @__PURE__ */ e(R, { amount: a, component: "h2", variant: "H2" }),
|
|
634
634
|
/* @__PURE__ */ o(s, { alignItems: "center", component: "span", direction: "row", gap: 8, mt: 2, children: [
|
|
635
|
-
/* @__PURE__ */ e(
|
|
636
|
-
|
|
635
|
+
/* @__PURE__ */ e(h, { bold: t, variant: "Small", children: i }),
|
|
636
|
+
y
|
|
637
637
|
] }),
|
|
638
|
-
n && /* @__PURE__ */ e(R, { amount: a, component: "h2", symbol:
|
|
638
|
+
n && /* @__PURE__ */ e(R, { amount: a, component: "h2", symbol: f, variant: "Small" })
|
|
639
639
|
]
|
|
640
640
|
}
|
|
641
641
|
), Re = (a, n) => (t) => t.accountGuid && a.includes(t.accountGuid) && ($e(t.expectedDate) || Fe(t.expectedDate, n.start)) && We(t.expectedDate, n.end), Rt = () => {
|
|
642
|
-
const { availableWidth: a } = ce(), { cashflow: n } = L(), {
|
|
643
|
-
() =>
|
|
644
|
-
[
|
|
645
|
-
),
|
|
646
|
-
() =>
|
|
647
|
-
[
|
|
648
|
-
),
|
|
649
|
-
() =>
|
|
650
|
-
[
|
|
651
|
-
),
|
|
652
|
-
return /* @__PURE__ */ o(s, { sx: { mx:
|
|
642
|
+
const { availableWidth: a } = ce(), { cashflow: n } = L(), { income: t, isDataLoaded: i, upcomingExpenses: f, upcomingIncome: y } = q(), { selectedAccountGuids: c } = Y(), { dateRange: b, selectedCashAccounts: l } = K(), { userProfile: r } = ke(), [m, d] = p.useState(!1), g = p.useMemo(
|
|
643
|
+
() => f.filter(Re(c, b)),
|
|
644
|
+
[b, c, f]
|
|
645
|
+
), S = p.useMemo(
|
|
646
|
+
() => y.filter(Re(c, b)),
|
|
647
|
+
[b, c, y]
|
|
648
|
+
), w = p.useMemo(
|
|
649
|
+
() => l.reduce((N, x) => N + (x?.balance || 0), 0),
|
|
650
|
+
[l]
|
|
651
|
+
), E = g.reduce((N, x) => N + x.amount, 0), T = S.reduce((N, x) => N + x.amount, 0), k = w - E + T, H = i && !t.length, u = a < 725;
|
|
652
|
+
return /* @__PURE__ */ o(s, { sx: { mx: u ? 16 : 0, my: u ? 24 : 42 }, children: [
|
|
653
653
|
/* @__PURE__ */ o(
|
|
654
654
|
s,
|
|
655
655
|
{
|
|
656
|
-
border:
|
|
656
|
+
border: u ? "1px solid" : "none",
|
|
657
657
|
borderColor: "border.light",
|
|
658
658
|
borderRadius: 2,
|
|
659
|
-
flexDirection:
|
|
660
|
-
gap:
|
|
659
|
+
flexDirection: u ? "column" : "row",
|
|
660
|
+
gap: u ? 0 : 24,
|
|
661
661
|
justifyContent: "center",
|
|
662
662
|
children: [
|
|
663
663
|
/* @__PURE__ */ e(
|
|
664
664
|
ie,
|
|
665
665
|
{
|
|
666
|
-
amount:
|
|
667
|
-
isMobile:
|
|
668
|
-
label:
|
|
666
|
+
amount: w,
|
|
667
|
+
isMobile: u,
|
|
668
|
+
label: j(n.cash_and_bank, l.length)
|
|
669
669
|
}
|
|
670
670
|
),
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
!
|
|
674
|
-
/* @__PURE__ */ e(
|
|
671
|
+
u && /* @__PURE__ */ e(I, {}),
|
|
672
|
+
r?.has_completed_cash_flow_onboarding ? /* @__PURE__ */ o(P, { children: [
|
|
673
|
+
!u && /* @__PURE__ */ e(h, { sx: { fontSize: 25, lineHeight: 1 }, children: "+" }),
|
|
674
|
+
i && (H ? /* @__PURE__ */ e(
|
|
675
|
+
W,
|
|
676
|
+
{
|
|
677
|
+
onClick: () => d(!0),
|
|
678
|
+
startIcon: /* @__PURE__ */ e(M, { name: "add" }),
|
|
679
|
+
sx: { fontSize: 13 },
|
|
680
|
+
children: n.add_income
|
|
681
|
+
}
|
|
682
|
+
) : /* @__PURE__ */ e(
|
|
675
683
|
ie,
|
|
676
684
|
{
|
|
677
|
-
amount:
|
|
678
|
-
isMobile:
|
|
685
|
+
amount: T,
|
|
686
|
+
isMobile: u,
|
|
679
687
|
label: n.to_be_received,
|
|
680
|
-
symbol:
|
|
688
|
+
symbol: u ? "+" : void 0
|
|
681
689
|
}
|
|
682
|
-
)
|
|
690
|
+
))
|
|
683
691
|
] }) : /* @__PURE__ */ e(
|
|
684
|
-
|
|
692
|
+
W,
|
|
685
693
|
{
|
|
686
|
-
onClick: () =>
|
|
687
|
-
startIcon: /* @__PURE__ */ e(
|
|
694
|
+
onClick: () => d(!0),
|
|
695
|
+
startIcon: /* @__PURE__ */ e(M, { name: "add" }),
|
|
688
696
|
sx: { fontSize: 13 },
|
|
689
697
|
children: n.add_income
|
|
690
698
|
}
|
|
691
699
|
),
|
|
692
|
-
|
|
700
|
+
u ? /* @__PURE__ */ e(I, {}) : /* @__PURE__ */ e(h, { sx: { fontSize: 25, lineHeight: 1 }, children: "-" }),
|
|
693
701
|
/* @__PURE__ */ e(
|
|
694
702
|
ie,
|
|
695
703
|
{
|
|
696
|
-
amount:
|
|
697
|
-
isMobile:
|
|
698
|
-
label:
|
|
699
|
-
symbol:
|
|
704
|
+
amount: E,
|
|
705
|
+
isMobile: u,
|
|
706
|
+
label: j(n.to_be_paid_out, g.length),
|
|
707
|
+
symbol: u ? "-" : void 0
|
|
700
708
|
}
|
|
701
709
|
),
|
|
702
|
-
|
|
710
|
+
u ? /* @__PURE__ */ e(I, {}) : /* @__PURE__ */ e(h, { sx: { fontSize: 25, lineHeight: 1 }, children: "=" }),
|
|
703
711
|
/* @__PURE__ */ e(
|
|
704
712
|
ie,
|
|
705
713
|
{
|
|
706
|
-
amount:
|
|
707
|
-
isMobile:
|
|
708
|
-
isTotal:
|
|
714
|
+
amount: k,
|
|
715
|
+
isMobile: u,
|
|
716
|
+
isTotal: u,
|
|
709
717
|
label: n.remaining_cash,
|
|
710
718
|
tooltip: /* @__PURE__ */ e(
|
|
711
719
|
he,
|
|
@@ -723,22 +731,22 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
723
731
|
Me,
|
|
724
732
|
{
|
|
725
733
|
ariaLabelClose: n.close_manage_income_aria,
|
|
726
|
-
isOpen:
|
|
727
|
-
onClose: () =>
|
|
734
|
+
isOpen: m,
|
|
735
|
+
onClose: () => d(!1),
|
|
728
736
|
shouldShowHeaderBorders: !1,
|
|
729
737
|
title: n.manage_income,
|
|
730
738
|
children: /* @__PURE__ */ e(it, {})
|
|
731
739
|
}
|
|
732
740
|
)
|
|
733
741
|
] });
|
|
734
|
-
}, Lt =
|
|
735
|
-
const { completeOnboarding: n } = me(), { cashflow: t } = L(),
|
|
742
|
+
}, Lt = A(Rt), Nt = ({ handleNextStep: a }) => {
|
|
743
|
+
const { completeOnboarding: n } = me(), { cashflow: t } = L(), i = se();
|
|
736
744
|
return /* @__PURE__ */ o(s, { children: [
|
|
737
745
|
/* @__PURE__ */ e(de, { pb: 12, children: t.welcome_title }),
|
|
738
746
|
/* @__PURE__ */ e(
|
|
739
747
|
Xe,
|
|
740
748
|
{
|
|
741
|
-
color:
|
|
749
|
+
color: i.palette.primary.light,
|
|
742
750
|
pb: 8,
|
|
743
751
|
sx: { wordBreak: "break-word", whiteSpace: "initial" },
|
|
744
752
|
variant: "H3",
|
|
@@ -749,69 +757,69 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
749
757
|
/* @__PURE__ */ o(s, { direction: "column", mb: 32, spacing: 32, children: [
|
|
750
758
|
/* @__PURE__ */ o(O, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
751
759
|
/* @__PURE__ */ e(
|
|
752
|
-
|
|
760
|
+
_,
|
|
753
761
|
{
|
|
754
|
-
bgcolor:
|
|
762
|
+
bgcolor: i.palette.primary.lighter,
|
|
755
763
|
borderRadius: 1,
|
|
756
764
|
component: "span",
|
|
757
765
|
height: 44,
|
|
758
766
|
mr: 24,
|
|
759
767
|
sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
|
|
760
768
|
width: 44,
|
|
761
|
-
children: /* @__PURE__ */ e(
|
|
769
|
+
children: /* @__PURE__ */ e(M, { color: "primary", name: "currency_exchange" })
|
|
762
770
|
}
|
|
763
771
|
),
|
|
764
772
|
t.bullet_one
|
|
765
773
|
] }),
|
|
766
774
|
/* @__PURE__ */ o(O, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
767
775
|
/* @__PURE__ */ e(
|
|
768
|
-
|
|
776
|
+
_,
|
|
769
777
|
{
|
|
770
|
-
bgcolor:
|
|
778
|
+
bgcolor: i.palette.primary.lighter,
|
|
771
779
|
borderRadius: 1,
|
|
772
780
|
component: "span",
|
|
773
781
|
height: 44,
|
|
774
782
|
mr: 24,
|
|
775
783
|
sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
|
|
776
784
|
width: 44,
|
|
777
|
-
children: /* @__PURE__ */ e(
|
|
785
|
+
children: /* @__PURE__ */ e(M, { color: "primary", name: "cardiology" })
|
|
778
786
|
}
|
|
779
787
|
),
|
|
780
788
|
t.bullet_two
|
|
781
789
|
] }),
|
|
782
790
|
/* @__PURE__ */ o(O, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
|
|
783
791
|
/* @__PURE__ */ e(
|
|
784
|
-
|
|
792
|
+
_,
|
|
785
793
|
{
|
|
786
|
-
bgcolor:
|
|
794
|
+
bgcolor: i.palette.primary.lighter,
|
|
787
795
|
borderRadius: 1,
|
|
788
796
|
component: "span",
|
|
789
797
|
height: 44,
|
|
790
798
|
mr: 24,
|
|
791
799
|
sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
|
|
792
800
|
width: 44,
|
|
793
|
-
children: /* @__PURE__ */ e(
|
|
801
|
+
children: /* @__PURE__ */ e(M, { color: "primary", name: "flare" })
|
|
794
802
|
}
|
|
795
803
|
),
|
|
796
804
|
t.bullet_three
|
|
797
805
|
] })
|
|
798
806
|
] }),
|
|
799
807
|
/* @__PURE__ */ o(s, { direction: "row", spacing: 16, children: [
|
|
800
|
-
/* @__PURE__ */ e(
|
|
801
|
-
/* @__PURE__ */ e(
|
|
808
|
+
/* @__PURE__ */ e(W, { onClick: a, variant: "contained", children: t.get_started_button }),
|
|
809
|
+
/* @__PURE__ */ e(W, { onClick: n, variant: "outlined", children: t.skip_button })
|
|
802
810
|
] })
|
|
803
811
|
] });
|
|
804
|
-
}, Ot =
|
|
812
|
+
}, Ot = A(Nt), Le = "https://content.moneydesktop.com/storage/MD_Assets/md/cashflow", je = {
|
|
805
813
|
CASHFLOW_ONBOARDING: `${Le}/cashflow-onboarding.png`,
|
|
806
814
|
CASHFLOW_LOADING_ANIMATION: `${Le}/loading-animation.gif`
|
|
807
815
|
}, kt = () => {
|
|
808
816
|
const { cashflow: a } = L();
|
|
809
|
-
return /* @__PURE__ */ o(
|
|
817
|
+
return /* @__PURE__ */ o(p.Fragment, { children: [
|
|
810
818
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("img", { alt: "Loading", src: je.CASHFLOW_LOADING_ANIMATION }) }),
|
|
811
819
|
/* @__PURE__ */ e(de, { pb: 12, children: a.loading_title }),
|
|
812
820
|
/* @__PURE__ */ e(O, { children: a.loading_description })
|
|
813
821
|
] });
|
|
814
|
-
}, Ht =
|
|
822
|
+
}, Ht = A(kt), Ft = ot`
|
|
815
823
|
from {
|
|
816
824
|
transform: rotate(0deg);
|
|
817
825
|
}
|
|
@@ -819,44 +827,44 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
819
827
|
transform: rotate(360deg);
|
|
820
828
|
}
|
|
821
829
|
`, Wt = () => {
|
|
822
|
-
const { addRepeatingTransaction: a, repeatingTransactions: n } =
|
|
823
|
-
() =>
|
|
824
|
-
[fe,
|
|
830
|
+
const { addRepeatingTransaction: a, repeatingTransactions: n } = q(), { cashflow: t, common: i } = L(), { completeOnboarding: f } = me(), { isDirty: y } = K(), { isMobile: c } = ue(), { isCopyLoaded: b, setDisplayedDate: l } = Y(), { filter: r, setFilter: m, transactions: d } = He(), g = se(), [S, w] = J(!0), [E, T] = p.useState(ht.EveryMonth), [k, H] = p.useState(1), [u, N] = p.useState(15), [x, z] = J(!1), [X, ae] = J(1), [D, G] = J([]), [fe, le] = J(""), F = p.useMemo(
|
|
831
|
+
() => d.find((C) => C.guid === fe),
|
|
832
|
+
[fe, d]
|
|
825
833
|
), ze = !!n.filter(
|
|
826
|
-
(
|
|
834
|
+
(C) => C.repeating_transaction_type === Ie.Income
|
|
827
835
|
).length, ge = async () => {
|
|
828
836
|
ae(2), l(
|
|
829
837
|
// Beginning of the month, 90 days before today
|
|
830
|
-
dt(Ge(
|
|
831
|
-
|
|
832
|
-
),
|
|
838
|
+
dt(Ge($(), 90)),
|
|
839
|
+
$()
|
|
840
|
+
), m({ ...r, custom: we }), ae(3);
|
|
833
841
|
}, Be = async () => {
|
|
834
|
-
if (!(
|
|
835
|
-
|
|
836
|
-
for (let
|
|
837
|
-
const
|
|
838
|
-
account_guid:
|
|
839
|
-
amount:
|
|
840
|
-
merchant_guid:
|
|
841
|
-
description:
|
|
842
|
+
if (!(D.length < 1)) {
|
|
843
|
+
z(!0);
|
|
844
|
+
for (let C = 0; C < D.length; C++) {
|
|
845
|
+
const v = D[C], be = De(E, _e(v.date)), Pe = {
|
|
846
|
+
account_guid: v.account_guid,
|
|
847
|
+
amount: v.amount,
|
|
848
|
+
merchant_guid: v.merchant_guid,
|
|
849
|
+
description: v.feed_description || v.description,
|
|
842
850
|
predicted_occurs_on: lt(be, { representation: "date" }),
|
|
843
851
|
recurrence_day: be.getDay(),
|
|
844
|
-
recurrence_type:
|
|
852
|
+
recurrence_type: E,
|
|
845
853
|
repeating_transaction_type: Ie.Income,
|
|
846
|
-
transaction_type:
|
|
854
|
+
transaction_type: v.transaction_type
|
|
847
855
|
};
|
|
848
|
-
await a(Pe,
|
|
856
|
+
await a(Pe, v);
|
|
849
857
|
}
|
|
850
|
-
await
|
|
858
|
+
await f();
|
|
851
859
|
}
|
|
852
|
-
}, Ue = !
|
|
853
|
-
return
|
|
854
|
-
|
|
860
|
+
}, Ue = !F && S || !F && D.length < 1;
|
|
861
|
+
return b ? /* @__PURE__ */ o(
|
|
862
|
+
_,
|
|
855
863
|
{
|
|
856
864
|
sx: {
|
|
857
865
|
display: "flex",
|
|
858
866
|
alignItems: c ? "flex-start" : "center",
|
|
859
|
-
backgroundColor:
|
|
867
|
+
backgroundColor: g.palette.background.paper,
|
|
860
868
|
backgroundImage: c ? null : `url(${je.CASHFLOW_ONBOARDING})`,
|
|
861
869
|
backgroundRepeat: "no-repeat",
|
|
862
870
|
backgroundPosition: "left 100px",
|
|
@@ -864,8 +872,8 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
864
872
|
py: 24
|
|
865
873
|
},
|
|
866
874
|
children: [
|
|
867
|
-
|
|
868
|
-
|
|
875
|
+
X === 1 && /* @__PURE__ */ e(
|
|
876
|
+
_,
|
|
869
877
|
{
|
|
870
878
|
sx: {
|
|
871
879
|
...c ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
@@ -873,8 +881,8 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
873
881
|
children: /* @__PURE__ */ e(Ot, { handleNextStep: ge })
|
|
874
882
|
}
|
|
875
883
|
),
|
|
876
|
-
|
|
877
|
-
|
|
884
|
+
X === 2 && /* @__PURE__ */ e(
|
|
885
|
+
_,
|
|
878
886
|
{
|
|
879
887
|
sx: {
|
|
880
888
|
...c ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
@@ -882,8 +890,8 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
882
890
|
children: /* @__PURE__ */ e(Ht, {})
|
|
883
891
|
}
|
|
884
892
|
),
|
|
885
|
-
|
|
886
|
-
|
|
893
|
+
X === 3 && /* @__PURE__ */ o(
|
|
894
|
+
_,
|
|
887
895
|
{
|
|
888
896
|
sx: {
|
|
889
897
|
...c ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
|
|
@@ -891,21 +899,21 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
891
899
|
children: [
|
|
892
900
|
/* @__PURE__ */ e(de, { pb: 12, children: t.add_income_title }),
|
|
893
901
|
/* @__PURE__ */ e(O, { mb: 24, children: t.add_income_description }),
|
|
894
|
-
|
|
895
|
-
/* @__PURE__ */ e(ee, { children:
|
|
902
|
+
D.length > 0 && !F && /* @__PURE__ */ o(P, { children: [
|
|
903
|
+
/* @__PURE__ */ e(ee, { children: D.map((C, v) => /* @__PURE__ */ o(p.Fragment, { children: [
|
|
896
904
|
/* @__PURE__ */ e(mt, { bgcolor: "background.paper", children: pt(
|
|
897
|
-
|
|
905
|
+
U(C.nextDate || C.date)
|
|
898
906
|
) }),
|
|
899
|
-
/* @__PURE__ */ e(ut, { transaction:
|
|
900
|
-
|
|
901
|
-
] },
|
|
907
|
+
/* @__PURE__ */ e(ut, { transaction: C }),
|
|
908
|
+
v !== D.length - 1 && /* @__PURE__ */ e(I, {})
|
|
909
|
+
] }, C.guid)) }),
|
|
902
910
|
/* @__PURE__ */ o(s, { alignItems: "center", direction: "row", children: [
|
|
903
|
-
/* @__PURE__ */ e(
|
|
911
|
+
/* @__PURE__ */ e(I, { sx: { flexGrow: 1 } }),
|
|
904
912
|
/* @__PURE__ */ e(
|
|
905
|
-
|
|
913
|
+
W,
|
|
906
914
|
{
|
|
907
|
-
onClick: () =>
|
|
908
|
-
startIcon: /* @__PURE__ */ e(
|
|
915
|
+
onClick: () => w(!0),
|
|
916
|
+
startIcon: /* @__PURE__ */ e(M, { name: "add", size: 20 }),
|
|
909
917
|
children: t.add_income
|
|
910
918
|
}
|
|
911
919
|
)
|
|
@@ -915,67 +923,67 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
915
923
|
rt,
|
|
916
924
|
{
|
|
917
925
|
bgcolor: "background.paper",
|
|
918
|
-
onSearch: (
|
|
919
|
-
...
|
|
920
|
-
custom: (
|
|
926
|
+
onSearch: (C) => m({
|
|
927
|
+
...r,
|
|
928
|
+
custom: (v) => C ? st(v, C) : we(v)
|
|
921
929
|
}),
|
|
922
|
-
onSelected: (
|
|
923
|
-
le(
|
|
930
|
+
onSelected: (C) => {
|
|
931
|
+
le(C), w(!1);
|
|
924
932
|
}
|
|
925
933
|
}
|
|
926
934
|
),
|
|
927
|
-
!ze &&
|
|
928
|
-
|
|
935
|
+
!ze && y && /* @__PURE__ */ e(O, { color: "error", mt: 16, children: t.confirm_error }),
|
|
936
|
+
F && /* @__PURE__ */ o(P, { children: [
|
|
929
937
|
/* @__PURE__ */ e(
|
|
930
938
|
ct,
|
|
931
939
|
{
|
|
932
940
|
bgcolor: "background.paper",
|
|
933
|
-
firstDay:
|
|
934
|
-
frequency:
|
|
935
|
-
onFirstDayChange:
|
|
936
|
-
onFrequencyChange:
|
|
937
|
-
onSecondDayChange:
|
|
938
|
-
secondDay:
|
|
939
|
-
transaction:
|
|
941
|
+
firstDay: k,
|
|
942
|
+
frequency: E,
|
|
943
|
+
onFirstDayChange: H,
|
|
944
|
+
onFrequencyChange: T,
|
|
945
|
+
onSecondDayChange: N,
|
|
946
|
+
secondDay: u,
|
|
947
|
+
transaction: F
|
|
940
948
|
}
|
|
941
949
|
),
|
|
942
950
|
/* @__PURE__ */ o(s, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
|
|
943
951
|
/* @__PURE__ */ e(
|
|
944
|
-
|
|
952
|
+
W,
|
|
945
953
|
{
|
|
946
|
-
"aria-disabled": !
|
|
954
|
+
"aria-disabled": !F,
|
|
947
955
|
onClick: () => {
|
|
948
|
-
const
|
|
949
|
-
|
|
950
|
-
...
|
|
951
|
-
nextDate:
|
|
952
|
-
frequency:
|
|
953
|
-
}),
|
|
956
|
+
const C = [...D];
|
|
957
|
+
C.push({
|
|
958
|
+
...F,
|
|
959
|
+
nextDate: De(E, _e(F.date)),
|
|
960
|
+
frequency: E
|
|
961
|
+
}), G(C), le("");
|
|
954
962
|
},
|
|
955
963
|
variant: "contained",
|
|
956
|
-
children:
|
|
964
|
+
children: i.confirm_button
|
|
957
965
|
}
|
|
958
966
|
),
|
|
959
967
|
/* @__PURE__ */ e(
|
|
960
|
-
|
|
968
|
+
W,
|
|
961
969
|
{
|
|
962
970
|
onClick: () => {
|
|
963
|
-
le(""),
|
|
971
|
+
le(""), w(!0), ge().finally();
|
|
964
972
|
},
|
|
965
973
|
variant: "outlined",
|
|
966
|
-
children:
|
|
974
|
+
children: i.cancel_button
|
|
967
975
|
}
|
|
968
976
|
)
|
|
969
977
|
] })
|
|
970
978
|
] }),
|
|
971
|
-
|
|
979
|
+
D.length > 0 && !F && /* @__PURE__ */ o(s, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
|
|
972
980
|
/* @__PURE__ */ e(
|
|
973
|
-
|
|
981
|
+
W,
|
|
974
982
|
{
|
|
975
|
-
"aria-disabled":
|
|
983
|
+
"aria-disabled": D.length < 1 || x,
|
|
976
984
|
onClick: Be,
|
|
977
|
-
startIcon:
|
|
978
|
-
|
|
985
|
+
startIcon: x ? /* @__PURE__ */ e(
|
|
986
|
+
M,
|
|
979
987
|
{
|
|
980
988
|
name: "progress_activity",
|
|
981
989
|
sx: {
|
|
@@ -987,7 +995,7 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
987
995
|
children: t.confirm_income_button
|
|
988
996
|
}
|
|
989
997
|
),
|
|
990
|
-
/* @__PURE__ */ e(
|
|
998
|
+
/* @__PURE__ */ e(W, { onClick: f, variant: "outlined", children: t.skip_button })
|
|
991
999
|
] })
|
|
992
1000
|
]
|
|
993
1001
|
}
|
|
@@ -995,96 +1003,96 @@ const wt = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
|
|
|
995
1003
|
]
|
|
996
1004
|
}
|
|
997
1005
|
) : /* @__PURE__ */ e(te, {});
|
|
998
|
-
}, $t =
|
|
1006
|
+
}, $t = A(Wt), Mt = ({ onBackClick: a, sx: n = {} }) => {
|
|
999
1007
|
const {
|
|
1000
1008
|
selectedAccounts: t,
|
|
1001
|
-
selectedAccountGuids:
|
|
1002
|
-
setSelectedAccounts:
|
|
1003
|
-
shouldDisableNextDate:
|
|
1009
|
+
selectedAccountGuids: i,
|
|
1010
|
+
setSelectedAccounts: f,
|
|
1011
|
+
shouldDisableNextDate: y,
|
|
1004
1012
|
shouldDisablePrevDate: c
|
|
1005
|
-
} =
|
|
1006
|
-
return
|
|
1007
|
-
|
|
1008
|
-
}, [
|
|
1009
|
-
|
|
1010
|
-
}, [
|
|
1011
|
-
const ae =
|
|
1012
|
-
(
|
|
1013
|
+
} = Y(), { onEvent: b } = Oe(), { clientConfig: l } = Qe(), { visibleCashAccounts: r } = Ne(), { setFilter: m } = He(), { userProfile: d } = ke(), { dateRange: g, setSelectedCashAccounts: S } = K(), { loadRepeatingTransactions: w, setDateRange: E } = q(), { cashflow: T, recurring: k } = L(), { isCopyLoaded: H, isInitialized: u } = Y(), x = l?.master?.deep_link_params?.view === "manage_income", [z, X] = p.useState(x);
|
|
1014
|
+
return p.useEffect(() => {
|
|
1015
|
+
u && (E(g), w().finally());
|
|
1016
|
+
}, [u]), p.useEffect(() => {
|
|
1017
|
+
f(r);
|
|
1018
|
+
}, [r]), p.useEffect(() => {
|
|
1019
|
+
const ae = r.map((G) => G.guid), D = t.filter(
|
|
1020
|
+
(G) => i.includes(G.guid) && ae.includes(G.guid)
|
|
1013
1021
|
);
|
|
1014
|
-
|
|
1015
|
-
dateRange: { start: Ge(
|
|
1016
|
-
accounts:
|
|
1022
|
+
S(D), m({
|
|
1023
|
+
dateRange: { start: Ge($(), 90), end: ft() },
|
|
1024
|
+
accounts: D.map((G) => G.guid)
|
|
1017
1025
|
});
|
|
1018
|
-
}, [
|
|
1019
|
-
|
|
1026
|
+
}, [r, t]), !H || !u ? /* @__PURE__ */ e(te, {}) : d?.has_completed_cash_flow_onboarding ? /* @__PURE__ */ o(
|
|
1027
|
+
ve,
|
|
1020
1028
|
{
|
|
1021
|
-
accountOptions:
|
|
1029
|
+
accountOptions: r,
|
|
1022
1030
|
actions: [
|
|
1023
1031
|
{
|
|
1024
|
-
label:
|
|
1032
|
+
label: k.action_title,
|
|
1025
1033
|
iconName: "credit_card_gear",
|
|
1026
1034
|
onClick: () => {
|
|
1027
|
-
|
|
1035
|
+
X(!0), b(Ae.CASH_FLOW_CLICK_SETTINGS);
|
|
1028
1036
|
}
|
|
1029
1037
|
}
|
|
1030
1038
|
],
|
|
1031
1039
|
calendarActions: {
|
|
1032
|
-
shouldDisableNext:
|
|
1040
|
+
shouldDisableNext: y,
|
|
1033
1041
|
shouldDisablePrevious: c,
|
|
1034
1042
|
shouldDisablePicker: !0,
|
|
1035
1043
|
onRangeChanged: () => {
|
|
1036
1044
|
}
|
|
1037
1045
|
},
|
|
1038
|
-
dateRange:
|
|
1046
|
+
dateRange: g,
|
|
1039
1047
|
dateRangeVariant: "readonly",
|
|
1040
|
-
onAccountsFilterClick: () =>
|
|
1048
|
+
onAccountsFilterClick: () => b(Ae.CASH_FLOW_CLICK_FILTER),
|
|
1041
1049
|
onBackClick: a,
|
|
1042
1050
|
sx: n,
|
|
1043
|
-
title:
|
|
1051
|
+
title: T.title,
|
|
1044
1052
|
children: [
|
|
1045
1053
|
/* @__PURE__ */ e(Lt, {}),
|
|
1046
1054
|
/* @__PURE__ */ e(Tt, {}),
|
|
1047
1055
|
/* @__PURE__ */ e(
|
|
1048
1056
|
Me,
|
|
1049
1057
|
{
|
|
1050
|
-
ariaLabelClose:
|
|
1051
|
-
isOpen:
|
|
1052
|
-
onClose: () =>
|
|
1058
|
+
ariaLabelClose: T.close_settings_aria,
|
|
1059
|
+
isOpen: z,
|
|
1060
|
+
onClose: () => X(!1),
|
|
1053
1061
|
shouldShowHeaderBorders: !1,
|
|
1054
|
-
title:
|
|
1055
|
-
children: /* @__PURE__ */ e(Je, { defaultSelectedTab:
|
|
1062
|
+
title: k.action_title,
|
|
1063
|
+
children: /* @__PURE__ */ e(Je, { defaultSelectedTab: x ? 1 : 0 })
|
|
1056
1064
|
}
|
|
1057
1065
|
)
|
|
1058
1066
|
]
|
|
1059
1067
|
}
|
|
1060
1068
|
) : /* @__PURE__ */ e(
|
|
1061
|
-
|
|
1069
|
+
ve,
|
|
1062
1070
|
{
|
|
1063
1071
|
onBackClick: a,
|
|
1064
1072
|
sx: { height: "100%", overflow: "auto" },
|
|
1065
|
-
title:
|
|
1073
|
+
title: T.title,
|
|
1066
1074
|
children: /* @__PURE__ */ e($t, {})
|
|
1067
1075
|
}
|
|
1068
1076
|
);
|
|
1069
|
-
}, Fn =
|
|
1077
|
+
}, Fn = A(Mt);
|
|
1070
1078
|
class Wn {
|
|
1071
1079
|
fetchInstance;
|
|
1072
|
-
constructor(n, t,
|
|
1073
|
-
this.fetchInstance = new gt(n, t, void 0,
|
|
1080
|
+
constructor(n, t, i) {
|
|
1081
|
+
this.fetchInstance = new gt(n, t, void 0, i);
|
|
1074
1082
|
}
|
|
1075
|
-
addCashflowEvent = async (n) => this.fetchInstance.post(
|
|
1076
|
-
addCashflowSequence = async (n) => this.fetchInstance.post(
|
|
1077
|
-
getCashflowSequences = async () => this.fetchInstance.get(
|
|
1083
|
+
addCashflowEvent = async (n) => this.fetchInstance.post(B.CASHFLOW_EVENTS, { ...n }).then((t) => t);
|
|
1084
|
+
addCashflowSequence = async (n) => this.fetchInstance.post(B.CASHFLOW_SEQUENCES, { ...n }).then((t) => t.cashflow_sequence);
|
|
1085
|
+
getCashflowSequences = async () => this.fetchInstance.get(B.CASHFLOW_SEQUENCES).then((n) => n.cashflow_sequences);
|
|
1078
1086
|
getCashflowEventsByDateRange = async (n, t) => this.fetchInstance.get(
|
|
1079
|
-
`${
|
|
1080
|
-
).then((
|
|
1081
|
-
deleteCashflowSequence = async (n) => this.fetchInstance.delete(`${
|
|
1087
|
+
`${B.CASHFLOW_EVENTS}/from/${U(n)}/to/${U(t)}`
|
|
1088
|
+
).then((i) => i.cashflow_events);
|
|
1089
|
+
deleteCashflowSequence = async (n) => this.fetchInstance.delete(`${B.CASHFLOW_SEQUENCES}/${n}`).then((t) => t);
|
|
1082
1090
|
getProjectedCashflowEvents = async (n, t) => this.fetchInstance.get(
|
|
1083
|
-
`${
|
|
1091
|
+
`${B.CASHFLOW_SEQUENCES}/projected_events/from/${U(
|
|
1084
1092
|
n
|
|
1085
|
-
)}/to/${
|
|
1086
|
-
).then((
|
|
1087
|
-
updateCashflowSequence = async (n) => this.fetchInstance.put(`${
|
|
1093
|
+
)}/to/${U(t)}`
|
|
1094
|
+
).then((i) => i.cashflow_events);
|
|
1095
|
+
updateCashflowSequence = async (n) => this.fetchInstance.put(`${B.CASHFLOW_SEQUENCES}/${n.guid}`, n).then((t) => t.cashflow_sequence);
|
|
1088
1096
|
}
|
|
1089
1097
|
export {
|
|
1090
1098
|
Wn as CashflowApi,
|