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