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