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