@mx-cartographer/experiences 9.2.1 → 9.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,60 +1,62 @@
1
- import { jsxs as n, Fragment as M, jsx as e } from "react/jsx-runtime";
2
- import w, { useState as U } from "react";
1
+ import { jsxs as n, Fragment as z, jsx as e } from "react/jsx-runtime";
2
+ import S, { useState as K } from "react";
3
3
  import { observer as T } from "mobx-react-lite";
4
- import D from "@mui/material/Box";
5
- import I from "@mui/material/Divider";
4
+ import v from "@mui/material/Box";
5
+ import D from "@mui/material/Divider";
6
6
  import c from "@mui/material/Stack";
7
- import { useTheme as oe, alpha as Ye, keyframes as qe } from "@mui/material/styles";
8
- import { Text as m, P as E, Icon as H, InstitutionLogo as ye, H2 as le, H3 as Ke } from "@mxenabled/mxui";
7
+ import { useTheme as ae, alpha as Ye, keyframes as qe } from "@mui/material/styles";
8
+ import { Text as m, P as k, Icon as F, InstitutionLogo as ye, H2 as de, H3 as Ke } from "@mxenabled/mxui";
9
9
  import { b as G } from "../Localization-DnoVyBNK.mjs";
10
- import { G as Ve, p as de, u as R, D as ie, a as j, h as Q, i as me, f as Le, c as Xe, g as ke, C as Je } from "../hooks-97sNJ_lf.mjs";
10
+ import { G as Ve, p as me, u as R, D as re, a as $, h as te, i as pe, f as Ee, c as Xe, g as Le, C as Je } from "../hooks-97sNJ_lf.mjs";
11
11
  import { C as A } from "../CurrencyText-CCbE6MmF.mjs";
12
- import { u as pe } from "../useScreenSize-mWpmnh5w.mjs";
13
- import { L as V } from "../Loader-CxeBwuPG.mjs";
14
- import { I as ue } from "../InformationTooltip-4su8bn1e.mjs";
12
+ import { u as ue } from "../useScreenSize-mWpmnh5w.mjs";
13
+ import { L as Q } from "../Loader-CxeBwuPG.mjs";
14
+ import { I as he } from "../InformationTooltip-4su8bn1e.mjs";
15
15
  import { u as Ne } from "../useWidgetLoadTimer-B0tB-yzL.mjs";
16
16
  import { M as Qe } from "../MiniWidgetContainer-Bmv_WeUd.mjs";
17
17
  import { E as Ze } from "../EmptyState-CJUDc3kD.mjs";
18
- import { R as et } from "../RecurringSettings-CcS5b1xA.mjs";
19
- import tt from "@mui/material/Tabs";
18
+ import et from "@mui/material/Alert";
19
+ import tt from "@mui/material/Snackbar";
20
+ import { R as nt } from "../RecurringSettings-CcS5b1xA.mjs";
21
+ import ot from "@mui/material/Tabs";
20
22
  import _e from "@mui/material/Tab";
21
- import { getUnixTime as ce } from "date-fns/getUnixTime";
22
- import K from "@mui/material/List";
23
- import X from "@mui/material/ListItem";
24
- import { A as nt } from "../AccountDetailsDrawer-utXjRHSW.mjs";
25
- import { f as $, D as P } from "../DateFormats-HudZ3Bjs.mjs";
26
- import ot from "@mui/material/ListSubheader";
27
- import { f as q } from "../NumberFormatting--XMeeBfr.mjs";
23
+ import { getUnixTime as se } from "date-fns/getUnixTime";
24
+ import J from "@mui/material/List";
25
+ import Z from "@mui/material/ListItem";
26
+ import { A as it } from "../AccountDetailsDrawer-utXjRHSW.mjs";
27
+ import { f as P, D as U } from "../DateFormats-HudZ3Bjs.mjs";
28
+ import at from "@mui/material/ListSubheader";
29
+ import { f as X } from "../NumberFormatting--XMeeBfr.mjs";
28
30
  import { isAfter as Oe } from "date-fns/isAfter";
29
31
  import { isBefore as Ge } from "date-fns/isBefore";
30
- import { isToday as Fe } from "date-fns/isToday";
31
- import { g as He } from "../AccountUtils-Cbh8r9cP.mjs";
32
- import { DataGridPro as it } from "@mui/x-data-grid-pro";
32
+ import { isToday as He } from "date-fns/isToday";
33
+ import { g as Fe } from "../AccountUtils-Cbh8r9cP.mjs";
34
+ import { DataGridPro as rt } from "@mui/x-data-grid-pro";
33
35
  import { T as Ce } from "../TabContentContainer-B0eYJP5p.mjs";
34
- import F from "@mui/material/Button";
35
- import { M as at, S as rt, i as ct, b as we, c as st } from "../ManageIncome-Czs7daKV.mjs";
36
+ import H from "@mui/material/Button";
37
+ import { M as ct, S as st, i as lt, b as we, c as dt } from "../ManageIncome-Czs7daKV.mjs";
36
38
  import { D as We } from "../Drawer-DsnW2o0v.mjs";
37
39
  import { subDays as Me } from "date-fns/subDays";
38
- import { startOfToday as se } from "date-fns/startOfToday";
39
- import { endOfToday as lt } from "date-fns/endOfToday";
40
- import { W as dt } from "../WidgetContainer-CjdCY4sj.mjs";
41
- import { c as Y } from "../Account-DR7Plrqy.mjs";
40
+ import { startOfToday as le } from "date-fns/startOfToday";
41
+ import { endOfToday as mt } from "date-fns/endOfToday";
42
+ import { W as pt } from "../WidgetContainer-CoHQ75sR.mjs";
43
+ import { c as V } from "../Account-DR7Plrqy.mjs";
42
44
  import { A as Se } from "../Analytics-D-jdcL72.mjs";
43
- import { formatISO as mt } from "date-fns/formatISO";
44
- import { fromUnixTime as De } from "date-fns/fromUnixTime";
45
- import { startOfMonth as pt } from "date-fns/startOfMonth";
46
- import { S as ut, a as ht } from "../EmbeddedCard-CQEnrozC.mjs";
47
- import { F as ft, R as Ie, d as ve } from "../RecurringTransactionsUtil-CfWviBh1.mjs";
48
- import { k as gt } from "../DateUtil-Bl7d7C1W.mjs";
49
- const z = () => {
50
- if (!w.useContext(Ve))
45
+ import { formatISO as ut } from "date-fns/formatISO";
46
+ import { fromUnixTime as ve } from "date-fns/fromUnixTime";
47
+ import { startOfMonth as ht } from "date-fns/startOfMonth";
48
+ import { S as ft, a as gt } from "../EmbeddedCard-CQEnrozC.mjs";
49
+ import { F as bt, R as De, d as Ie } from "../RecurringTransactionsUtil-CfWviBh1.mjs";
50
+ import { k as xt } from "../DateUtil-Bl7d7C1W.mjs";
51
+ const B = () => {
52
+ if (!S.useContext(Ve))
51
53
  throw new Error("useCashflowUiStore() must be used within the GlobalDataContext");
52
- return de().uiStore;
53
- }, bt = ({ remaining: i }) => {
54
+ return me().uiStore;
55
+ }, yt = ({ remaining: i }) => {
54
56
  const { cashflow: o } = R();
55
- return /* @__PURE__ */ n(M, { children: [
57
+ return /* @__PURE__ */ n(z, { children: [
56
58
  /* @__PURE__ */ e(
57
- D,
59
+ v,
58
60
  {
59
61
  sx: {
60
62
  borderRadius: "1px",
@@ -67,9 +69,9 @@ const z = () => {
67
69
  /* @__PURE__ */ e(m, { bold: !0, sx: { flexGrow: 1, fontSize: 12 }, children: o.remaining_cash }),
68
70
  /* @__PURE__ */ e(A, { amount: i, bold: !0, sx: { fontSize: 12 } })
69
71
  ] });
70
- }, he = T(bt), xt = () => {
71
- const i = oe(), { availableWidth: o } = ie(), { isMobile: t } = pe(), { selectedAccountGuids: a } = j(), { cashflow: s } = R(), { daysUntilNextIncome: u, expensesTilNextIncome: y, selectedCashAccounts: l, selectedCashBalance: x } = z(), { isDataLoaded: _ } = Q(), r = y.filter((h) => a.includes(h.accountGuid || "")).reduce((h, d) => h + d.amount, 0), p = x - r;
72
- return _ ? /* @__PURE__ */ e(D, { className: "mx-cashflow", pl: 16, pr: 16, pt: 16, children: o > 710 ? /* @__PURE__ */ n(
72
+ }, fe = T(yt), _t = () => {
73
+ const i = ae(), { availableWidth: o } = re(), { isMobile: t } = ue(), { selectedAccountGuids: a } = $(), { cashflow: s } = R(), { daysUntilNextIncome: h, expensesTilNextIncome: y, selectedCashAccounts: l, selectedCashBalance: x } = B(), { isDataLoaded: _ } = te(), r = y.filter((p) => a.includes(p.accountGuid || "")).reduce((p, d) => p + d.amount, 0), u = x - r;
74
+ return _ ? /* @__PURE__ */ e(v, { className: "mx-cashflow", pl: 16, pr: 16, pt: 16, children: o > 710 ? /* @__PURE__ */ n(
73
75
  c,
74
76
  {
75
77
  border: `1px solid ${i.palette.divider}`,
@@ -80,27 +82,27 @@ const z = () => {
80
82
  children: [
81
83
  /* @__PURE__ */ n(c, { pb: 14, pt: 12, children: [
82
84
  /* @__PURE__ */ e(A, { amount: x, variant: "h2" }),
83
- /* @__PURE__ */ e(E, { variant: "caption", whiteSpace: "nowrap", children: G(
85
+ /* @__PURE__ */ e(k, { variant: "caption", whiteSpace: "nowrap", children: G(
84
86
  s.total_cash_accounts,
85
87
  l.length
86
88
  ) })
87
89
  ] }),
88
- /* @__PURE__ */ e(c, { pt: 18, children: /* @__PURE__ */ e(H, { name: "remove" }) }),
90
+ /* @__PURE__ */ e(c, { pt: 18, children: /* @__PURE__ */ e(F, { name: "remove" }) }),
89
91
  /* @__PURE__ */ n(c, { pb: 14, pt: 12, children: [
90
92
  /* @__PURE__ */ e(A, { amount: r, variant: "h2" }),
91
- /* @__PURE__ */ e(E, { variant: "caption", whiteSpace: "nowrap", children: G(s.expenses_due, y.length) })
93
+ /* @__PURE__ */ e(k, { variant: "caption", whiteSpace: "nowrap", children: G(s.expenses_due, y.length) })
92
94
  ] }),
93
- /* @__PURE__ */ e(c, { pt: 18, children: /* @__PURE__ */ e(H, { name: "equal" }) }),
95
+ /* @__PURE__ */ e(c, { pt: 18, children: /* @__PURE__ */ e(F, { name: "equal" }) }),
94
96
  /* @__PURE__ */ n(c, { pb: 14, pr: 24, pt: 12, children: [
95
- /* @__PURE__ */ e(A, { amount: p, variant: "h2" }),
97
+ /* @__PURE__ */ e(A, { amount: u, variant: "h2" }),
96
98
  /* @__PURE__ */ n(c, { alignItems: "center", direction: "row", gap: 8, children: [
97
- /* @__PURE__ */ e(E, { variant: "caption", whiteSpace: "nowrap", children: s.available_to_spend }),
98
- /* @__PURE__ */ e(ue, { body: s.tooltip_body, title: s.tooltip_title })
99
+ /* @__PURE__ */ e(k, { variant: "caption", whiteSpace: "nowrap", children: s.available_to_spend }),
100
+ /* @__PURE__ */ e(he, { body: s.tooltip_body, title: s.tooltip_title })
99
101
  ] })
100
102
  ] }),
101
- /* @__PURE__ */ e(c, { borderLeft: `1px solid ${i.palette.divider}`, pb: 12, pl: 24, pt: 12, children: /* @__PURE__ */ n(M, { children: [
102
- /* @__PURE__ */ e(m, { variant: "h2", children: G(s.days, u) }),
103
- /* @__PURE__ */ e(E, { variant: "caption", whiteSpace: "nowrap", children: s.next_paycheck })
103
+ /* @__PURE__ */ e(c, { borderLeft: `1px solid ${i.palette.divider}`, pb: 12, pl: 24, pt: 12, children: /* @__PURE__ */ n(z, { children: [
104
+ /* @__PURE__ */ e(m, { variant: "h2", children: G(s.days, h) }),
105
+ /* @__PURE__ */ e(k, { variant: "caption", whiteSpace: "nowrap", children: s.next_paycheck })
104
106
  ] }) })
105
107
  ]
106
108
  }
@@ -112,12 +114,12 @@ const z = () => {
112
114
  ) }),
113
115
  /* @__PURE__ */ e(A, { amount: x, bold: !0, variant: "caption" })
114
116
  ] }),
115
- /* @__PURE__ */ e(I, {}),
117
+ /* @__PURE__ */ e(D, {}),
116
118
  /* @__PURE__ */ n(c, { direction: "row", justifyContent: "space-between", p: 16, children: [
117
119
  /* @__PURE__ */ e(m, { variant: "body2", children: G(s.expenses_due, y.length) }),
118
120
  /* @__PURE__ */ e(A, { amount: r, bold: !0, symbol: "-", variant: "caption" })
119
121
  ] }),
120
- /* @__PURE__ */ e(I, {}),
122
+ /* @__PURE__ */ e(D, {}),
121
123
  /* @__PURE__ */ e(
122
124
  c,
123
125
  {
@@ -129,28 +131,28 @@ const z = () => {
129
131
  justifyContent: "space-between",
130
132
  px: 16,
131
133
  sx: { borderBottomLeftRadius: 4, borderBottomRightRadius: 4 },
132
- children: /* @__PURE__ */ e(he, { remaining: p })
134
+ children: /* @__PURE__ */ e(fe, { remaining: u })
133
135
  }
134
136
  ),
135
- /* @__PURE__ */ e(I, {}),
137
+ /* @__PURE__ */ e(D, {}),
136
138
  /* @__PURE__ */ n(c, { direction: "row", justifyContent: "space-between", p: 16, children: [
137
139
  /* @__PURE__ */ e(m, { variant: "body2", children: s.next_paycheck }),
138
- /* @__PURE__ */ e(m, { bold: !0, variant: "caption", children: G(s.days, u) })
140
+ /* @__PURE__ */ e(m, { bold: !0, variant: "caption", children: G(s.days, h) })
139
141
  ] })
140
- ] }) }) : /* @__PURE__ */ e(V, { height: t ? 210 : 120 });
141
- }, yt = T(xt), _t = ({
142
+ ] }) }) : /* @__PURE__ */ e(Q, { height: t ? 210 : 120 });
143
+ }, Ct = T(_t), wt = ({
142
144
  onPrimaryCtaClick: i,
143
145
  onSecondaryCtaClick: o,
144
146
  sx: t = {}
145
147
  }) => {
146
- const { cashflow: a } = R(), { isInitialized: s } = j(), { income: u } = z(), { loadRepeatingTransactionData: y, isDataLoaded: l } = Q();
147
- w.useEffect(() => {
148
+ const { cashflow: a } = R(), { isInitialized: s } = $(), { income: h } = B(), { loadRepeatingTransactionData: y, isDataLoaded: l } = te();
149
+ S.useEffect(() => {
148
150
  l || y().finally();
149
151
  }, []), Ne({
150
152
  widgetName: "CashflowMiniWidget",
151
153
  isLoaded: l
152
154
  });
153
- const x = l && !u.length;
155
+ const x = l && !h.length;
154
156
  return s ? /* @__PURE__ */ n(
155
157
  Qe,
156
158
  {
@@ -162,7 +164,7 @@ const z = () => {
162
164
  sx: { height: "100%", ...t },
163
165
  title: a.title,
164
166
  children: [
165
- !l && /* @__PURE__ */ e(V, {}),
167
+ !l && /* @__PURE__ */ e(Q, {}),
166
168
  l && (x ? /* @__PURE__ */ e(
167
169
  Ze,
168
170
  {
@@ -173,12 +175,12 @@ const z = () => {
173
175
  primaryButtonStartIcon: "add",
174
176
  subText: a.create_description
175
177
  }
176
- ) : /* @__PURE__ */ e(yt, {}))
178
+ ) : /* @__PURE__ */ e(Ct, {}))
177
179
  ]
178
180
  }
179
- ) : /* @__PURE__ */ e(V, {});
180
- }, On = T(_t), Ct = ({ remaining: i }) => /* @__PURE__ */ e(
181
- X,
181
+ ) : /* @__PURE__ */ e(Q, {});
182
+ }, Wn = T(wt), St = ({ remaining: i }) => /* @__PURE__ */ e(
183
+ Z,
182
184
  {
183
185
  sx: {
184
186
  alignItems: "center",
@@ -190,15 +192,15 @@ const z = () => {
190
192
  borderBottomRightRadius: "3px",
191
193
  minHeight: "auto"
192
194
  },
193
- children: /* @__PURE__ */ e(he, { remaining: i })
195
+ children: /* @__PURE__ */ e(fe, { remaining: i })
194
196
  }
195
197
  );
196
- var J = /* @__PURE__ */ ((i) => (i.EXPENSE = "expense", i.INCOME = "income", i))(J || {});
197
- const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
198
- /* @__PURE__ */ n(X, { sx: { display: "flex", alignItems: "center", gap: 16, px: 24, py: 12 }, children: [
198
+ var ee = /* @__PURE__ */ ((i) => (i.EXPENSE = "expense", i.INCOME = "income", i))(ee || {});
199
+ const vt = ({ recurrence: i }) => /* @__PURE__ */ n(z, { children: [
200
+ /* @__PURE__ */ n(Z, { sx: { display: "flex", alignItems: "center", gap: 16, px: 24, py: 12 }, children: [
199
201
  /* @__PURE__ */ n(c, { alignItems: "center", height: 32, width: 32, children: [
200
- /* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 11 }, children: $(i.expectedDate, P.MONTH) }),
201
- /* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 11 }, children: $(i.expectedDate, P.DAY) })
202
+ /* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 11 }, children: P(i.expectedDate, U.MONTH) }),
203
+ /* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 11 }, children: P(i.expectedDate, U.DAY) })
202
204
  ] }),
203
205
  /* @__PURE__ */ e(m, { sx: { flexGrow: 1, fontSize: 13 }, children: i.name }),
204
206
  /* @__PURE__ */ e(
@@ -210,12 +212,12 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
210
212
  }
211
213
  )
212
214
  ] }),
213
- /* @__PURE__ */ e(I, {})
214
- ] }), Te = T(wt), St = ({ total: i, type: o }) => {
215
+ /* @__PURE__ */ e(D, {})
216
+ ] }), Te = T(vt), Dt = ({ total: i, type: o }) => {
215
217
  const { cashflow: t } = R();
216
- return /* @__PURE__ */ n(M, { children: [
218
+ return /* @__PURE__ */ n(z, { children: [
217
219
  /* @__PURE__ */ n(
218
- ot,
220
+ at,
219
221
  {
220
222
  sx: {
221
223
  alignItems: "center",
@@ -227,42 +229,42 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
227
229
  px: 24
228
230
  },
229
231
  children: [
230
- /* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 12 }, children: o === J.EXPENSE ? t.expenses : t.income }),
232
+ /* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 12 }, children: o === ee.EXPENSE ? t.expenses : t.income }),
231
233
  /* @__PURE__ */ n(m, { bold: !0, sx: { fontSize: 13 }, children: [
232
- o === J.EXPENSE ? "-" : "+",
233
- q(i, "0,0.00")
234
+ o === ee.EXPENSE ? "-" : "+",
235
+ X(i, "0,0.00")
234
236
  ] })
235
237
  ]
236
238
  }
237
239
  ),
238
- /* @__PURE__ */ e(I, {})
240
+ /* @__PURE__ */ e(D, {})
239
241
  ] });
240
- }, Ae = T(St), ne = (i, o) => (t) => t.accountGuid === i.guid && (Fe(t.expectedDate) || Oe(t.expectedDate, o.start)) && Ge(t.expectedDate, o.end), Dt = () => {
241
- const { availableWidth: i } = ie(), { cashflow: o } = R(), {
242
+ }, Ae = T(Dt), ie = (i, o) => (t) => t.accountGuid === i.guid && (He(t.expectedDate) || Oe(t.expectedDate, o.start)) && Ge(t.expectedDate, o.end), It = () => {
243
+ const { availableWidth: i } = re(), { cashflow: o } = R(), {
242
244
  config: { display_available_balance_in_accounts: t }
243
- } = me(), { dateRange: a, selectedCashAccounts: s, upcomingExpenses: u, upcomingIncome: y } = z();
245
+ } = pe(), { dateRange: a, selectedCashAccounts: s, upcomingExpenses: h, upcomingIncome: y } = B();
244
246
  return /* @__PURE__ */ n(c, { children: [
245
247
  /* @__PURE__ */ n(c, { direction: i < 400 ? "column" : "row", justifyContent: "space-between", children: [
246
248
  /* @__PURE__ */ e(m, { bold: !0, sx: { fontSize: 15, mb: 12 }, children: o.accounts_breakdown }),
247
249
  /* @__PURE__ */ n(m, { bold: !0, sx: { fontSize: 15, mb: 12 }, children: [
248
- $(a.start, P.FULL_MONTH_DAY),
250
+ P(a.start, U.FULL_MONTH_DAY),
249
251
  " -",
250
252
  " ",
251
- $(a.end, P.FULL_MONTH_DAY)
253
+ P(a.end, U.FULL_MONTH_DAY)
252
254
  ] })
253
255
  ] }),
254
256
  /* @__PURE__ */ e(c, { children: s.map((l) => {
255
- const x = y.filter(ne(l, a)).sort((d, f) => ce(d.expectedDate) - ce(f.expectedDate)), _ = u.filter(
256
- ne(l, a)
257
+ const x = y.filter(ie(l, a)).sort((d, f) => se(d.expectedDate) - se(f.expectedDate)), _ = h.filter(
258
+ ie(l, a)
257
259
  ), r = x.reduce(
258
260
  (d, f) => d + f.amount,
259
261
  0
260
- ), p = _.reduce(
262
+ ), u = _.reduce(
261
263
  (d, f) => d + f.amount,
262
264
  0
263
- ), h = He(l, t) + r - p;
265
+ ), p = Fe(l, t) + r - u;
264
266
  return /* @__PURE__ */ n(
265
- K,
267
+ J,
266
268
  {
267
269
  sx: {
268
270
  border: "1px solid",
@@ -272,7 +274,7 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
272
274
  },
273
275
  children: [
274
276
  /* @__PURE__ */ e(
275
- nt,
277
+ it,
276
278
  {
277
279
  account: l,
278
280
  listItemProps: {
@@ -282,46 +284,46 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
282
284
  }
283
285
  }
284
286
  ),
285
- /* @__PURE__ */ e(I, {}),
286
- x.length > 0 && /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(
287
- K,
287
+ /* @__PURE__ */ e(D, {}),
288
+ x.length > 0 && /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(
289
+ J,
288
290
  {
289
- subheader: /* @__PURE__ */ e(Ae, { total: r, type: J.INCOME }),
291
+ subheader: /* @__PURE__ */ e(Ae, { total: r, type: ee.INCOME }),
290
292
  sx: { width: "100%" },
291
293
  children: x.map((d) => /* @__PURE__ */ e(Te, { recurrence: d }, d.repeatingTransactionGuid))
292
294
  }
293
295
  ) }),
294
- _.length > 0 && /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(
295
- K,
296
+ _.length > 0 && /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(
297
+ J,
296
298
  {
297
- subheader: /* @__PURE__ */ e(Ae, { total: p, type: J.EXPENSE }),
299
+ subheader: /* @__PURE__ */ e(Ae, { total: u, type: ee.EXPENSE }),
298
300
  sx: { width: "100%" },
299
301
  children: _.map((d) => /* @__PURE__ */ e(Te, { recurrence: d }, d.repeatingTransactionGuid))
300
302
  }
301
303
  ) }),
302
- /* @__PURE__ */ e(Ct, { remaining: h })
304
+ /* @__PURE__ */ e(St, { remaining: p })
303
305
  ]
304
306
  },
305
307
  l.guid
306
308
  );
307
309
  }) })
308
310
  ] });
309
- }, It = T(Dt), vt = () => {
310
- const { availableWidth: i } = ie(), o = oe(), { cashflow: t } = R(), {
311
+ }, Tt = T(It), At = () => {
312
+ const { availableWidth: i } = re(), o = ae(), { cashflow: t } = R(), {
311
313
  config: { display_available_balance_in_accounts: a }
312
- } = me(), { dateRange: s, selectedCashAccounts: u, upcomingExpenses: y, upcomingIncome: l } = z(), x = [
314
+ } = pe(), { dateRange: s, selectedCashAccounts: h, upcomingExpenses: y, upcomingIncome: l } = B(), x = [
313
315
  {
314
316
  field: "account",
315
317
  flex: 1.5,
316
318
  headerName: t.accounts,
317
- renderCell: ({ value: { name: r, nickname: p, institution_guid: h, account_number: d } }) => {
318
- const f = p || r;
319
+ renderCell: ({ value: { name: r, nickname: u, institution_guid: p, account_number: d } }) => {
320
+ const f = u || r;
319
321
  return /* @__PURE__ */ n(c, { alignItems: "center", flexDirection: "row", gap: 12, children: [
320
322
  /* @__PURE__ */ e(
321
323
  ye,
322
324
  {
323
325
  alt: t.institution_logo,
324
- institutionGuid: h || "",
326
+ institutionGuid: p || "",
325
327
  size: 16
326
328
  }
327
329
  ),
@@ -334,21 +336,21 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
334
336
  flex: 1,
335
337
  headerName: t.balance,
336
338
  type: "number",
337
- renderCell: (r) => /* @__PURE__ */ e(m, { color: o.palette.text.primary, variant: "body2", children: q(r.value, "0,0.00") })
339
+ renderCell: (r) => /* @__PURE__ */ e(m, { color: o.palette.text.primary, variant: "body2", children: X(r.value, "0,0.00") })
338
340
  },
339
341
  {
340
342
  field: "income",
341
343
  flex: 1,
342
344
  headerName: t.projected_income,
343
345
  type: "number",
344
- renderCell: (r) => /* @__PURE__ */ e(m, { color: o.palette.text.primary, variant: "body2", children: `+${q(r.value, "0,0.00")}` })
346
+ renderCell: (r) => /* @__PURE__ */ e(m, { color: o.palette.text.primary, variant: "body2", children: `+${X(r.value, "0,0.00")}` })
345
347
  },
346
348
  {
347
349
  field: "expenses",
348
350
  flex: 1.1,
349
351
  headerName: t.projected_expenses,
350
352
  type: "number",
351
- renderCell: (r) => /* @__PURE__ */ e(m, { color: o.palette.text.primary, variant: "body2", children: `-${q(r.value, "0,0.00")}` })
353
+ renderCell: (r) => /* @__PURE__ */ e(m, { color: o.palette.text.primary, variant: "body2", children: `-${X(r.value, "0,0.00")}` })
352
354
  },
353
355
  {
354
356
  field: "remaining",
@@ -356,30 +358,30 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
356
358
  headerName: t.remaining,
357
359
  type: "number",
358
360
  renderCell: (r) => {
359
- const p = r.row.balance + r.row.income - r.row.expenses;
361
+ const u = r.row.balance + r.row.income - r.row.expenses;
360
362
  return /* @__PURE__ */ e(
361
363
  m,
362
364
  {
363
- color: Math.sign(p) === -1 ? o.palette.error.main : o.palette.text.primary,
365
+ color: Math.sign(u) === -1 ? o.palette.error.main : o.palette.text.primary,
364
366
  variant: "body2",
365
- children: q(p, "0,0.00")
367
+ children: X(u, "0,0.00")
366
368
  }
367
369
  );
368
370
  }
369
371
  }
370
- ], _ = w.useMemo(() => u.map((r) => {
371
- const p = y.filter(ne(r, s)).reduce((C, S) => C + S.amount, 0), h = l.filter(ne(r, s)).reduce((C, S) => C + S.amount, 0), d = He(r, a), f = d + h - p;
372
+ ], _ = S.useMemo(() => h.map((r) => {
373
+ const u = y.filter(ie(r, s)).reduce((C, w) => C + w.amount, 0), p = l.filter(ie(r, s)).reduce((C, w) => C + w.amount, 0), d = Fe(r, a), f = d + p - u;
372
374
  return {
373
375
  account: r,
374
376
  balance: d,
375
377
  id: r.guid,
376
- income: h,
377
- expenses: p,
378
+ income: p,
379
+ expenses: u,
378
380
  remaining: f
379
381
  };
380
- }), [u, y, l, a, s]);
382
+ }), [h, y, l, a, s]);
381
383
  return /* @__PURE__ */ n(
382
- D,
384
+ v,
383
385
  {
384
386
  sx: {
385
387
  width: "100%"
@@ -404,7 +406,7 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
404
406
  }
405
407
  ),
406
408
  /* @__PURE__ */ e(
407
- ue,
409
+ he,
408
410
  {
409
411
  body: t.table_tooltip_body,
410
412
  title: t.table_tooltip_title
@@ -412,16 +414,16 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
412
414
  )
413
415
  ] }),
414
416
  /* @__PURE__ */ n(m, { bold: !0, sx: { fontSize: 15 }, children: [
415
- $(s.start, P.FULL_MONTH_DAY),
417
+ P(s.start, U.FULL_MONTH_DAY),
416
418
  " -",
417
419
  " ",
418
- $(s.end, P.FULL_MONTH_DAY)
420
+ P(s.end, U.FULL_MONTH_DAY)
419
421
  ] })
420
422
  ]
421
423
  }
422
424
  ),
423
425
  i > 650 ? /* @__PURE__ */ e(
424
- it,
426
+ rt,
425
427
  {
426
428
  columnHeaderHeight: 48,
427
429
  columns: x,
@@ -451,9 +453,9 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
451
453
  }
452
454
  }
453
455
  ) : _.map((r) => {
454
- const { name: p, nickname: h, institution_guid: d, account_number: f } = r.account, C = h || p;
456
+ const { name: u, nickname: p, institution_guid: d, account_number: f } = r.account, C = p || u;
455
457
  return /* @__PURE__ */ e(
456
- K,
458
+ J,
457
459
  {
458
460
  sx: {
459
461
  border: "1px solid",
@@ -461,7 +463,7 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
461
463
  borderRadius: 1,
462
464
  marginBottom: 24
463
465
  },
464
- children: /* @__PURE__ */ e(X, { sx: { minHeight: "auto" }, children: /* @__PURE__ */ n(c, { width: "100%", children: [
466
+ children: /* @__PURE__ */ e(Z, { sx: { minHeight: "auto" }, children: /* @__PURE__ */ n(c, { width: "100%", children: [
465
467
  /* @__PURE__ */ n(
466
468
  c,
467
469
  {
@@ -486,7 +488,7 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
486
488
  ]
487
489
  }
488
490
  ),
489
- /* @__PURE__ */ e(I, { sx: { width: "100%" } }),
491
+ /* @__PURE__ */ e(D, { sx: { width: "100%" } }),
490
492
  /* @__PURE__ */ n(
491
493
  c,
492
494
  {
@@ -501,7 +503,7 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
501
503
  ]
502
504
  }
503
505
  ),
504
- /* @__PURE__ */ e(I, { sx: { width: "100%" } }),
506
+ /* @__PURE__ */ e(D, { sx: { width: "100%" } }),
505
507
  /* @__PURE__ */ n(
506
508
  c,
507
509
  {
@@ -516,7 +518,7 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
516
518
  ]
517
519
  }
518
520
  ),
519
- /* @__PURE__ */ e(I, { sx: { width: "100%" } }),
521
+ /* @__PURE__ */ e(D, { sx: { width: "100%" } }),
520
522
  /* @__PURE__ */ e(
521
523
  c,
522
524
  {
@@ -528,7 +530,7 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
528
530
  px: 16,
529
531
  py: 12,
530
532
  sx: { borderBottomLeftRadius: "4px", borderBottomRightRadius: "4px" },
531
- children: /* @__PURE__ */ e(he, { remaining: r.remaining })
533
+ children: /* @__PURE__ */ e(fe, { remaining: r.remaining })
532
534
  }
533
535
  )
534
536
  ] }) })
@@ -539,19 +541,19 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
539
541
  ]
540
542
  }
541
543
  );
542
- }, Tt = T(vt), At = () => {
543
- const { cashflow: i } = R(), { isDesktop: o } = pe(), { onEvent: t } = Le(), [a, s] = w.useState(0), u = (y, l) => {
544
+ }, Rt = T(At), kt = () => {
545
+ const { cashflow: i } = R(), { isDesktop: o } = ue(), { onEvent: t } = Ee(), [a, s] = S.useState(0), h = (y, l) => {
544
546
  s(l);
545
547
  };
546
- return w.useEffect(() => {
548
+ return S.useEffect(() => {
547
549
  t(a === 0 ? "cash_flow_summary" : "cash_flow_details");
548
- }, [a]), /* @__PURE__ */ n(D, { children: [
550
+ }, [a]), /* @__PURE__ */ n(v, { children: [
549
551
  /* @__PURE__ */ n(
550
- tt,
552
+ ot,
551
553
  {
552
554
  "aria-label": i.cashflow_summary_and_details,
553
555
  centered: !0,
554
- onChange: u,
556
+ onChange: h,
555
557
  textColor: "primary",
556
558
  value: a,
557
559
  variant: "fullWidth",
@@ -581,17 +583,17 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
581
583
  ]
582
584
  }
583
585
  ),
584
- /* @__PURE__ */ e(D, { sx: { mb: 32 } }),
585
- /* @__PURE__ */ e(Ce, { index: 0, name: "cashflow", value: a, children: /* @__PURE__ */ e(D, { sx: { m: o ? 48 : 16 }, children: /* @__PURE__ */ e(Tt, {}) }) }),
586
- /* @__PURE__ */ e(Ce, { index: 1, name: "cashflow", value: a, children: /* @__PURE__ */ e(D, { sx: { m: o ? 48 : 16 }, children: /* @__PURE__ */ e(It, {}) }) })
586
+ /* @__PURE__ */ e(v, { sx: { mb: 32 } }),
587
+ /* @__PURE__ */ e(Ce, { index: 0, name: "cashflow", value: a, children: /* @__PURE__ */ e(v, { sx: { m: o ? 48 : 16 }, children: /* @__PURE__ */ e(Rt, {}) }) }),
588
+ /* @__PURE__ */ e(Ce, { index: 1, name: "cashflow", value: a, children: /* @__PURE__ */ e(v, { sx: { m: o ? 48 : 16 }, children: /* @__PURE__ */ e(Tt, {}) }) })
587
589
  ] });
588
- }, Rt = T(At), te = ({
590
+ }, Et = T(kt), oe = ({
589
591
  amount: i,
590
592
  isMobile: o = !1,
591
593
  isTotal: t = !1,
592
594
  label: a,
593
595
  symbol: s,
594
- tooltip: u
596
+ tooltip: h
595
597
  }) => /* @__PURE__ */ n(
596
598
  c,
597
599
  {
@@ -604,84 +606,84 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
604
606
  !o && /* @__PURE__ */ e(A, { amount: i, component: "h2", variant: "h2" }),
605
607
  /* @__PURE__ */ n(c, { alignItems: "center", component: "span", direction: "row", gap: 8, mt: 2, children: [
606
608
  /* @__PURE__ */ e(m, { bold: t, variant: "body2", children: a }),
607
- u
609
+ h
608
610
  ] }),
609
611
  o && /* @__PURE__ */ e(A, { amount: i, component: "h2", symbol: s, variant: "body2" })
610
612
  ]
611
613
  }
612
- ), Re = (i, o) => (t) => t.accountGuid && i.includes(t.accountGuid) && (Fe(t.expectedDate) || Oe(t.expectedDate, o.start)) && Ge(t.expectedDate, o.end), Et = () => {
613
- const { availableWidth: i } = ie(), { cashflow: o } = R(), { isDataLoaded: t } = Q(), { selectedAccountGuids: a } = j(), {
614
+ ), Re = (i, o) => (t) => t.accountGuid && i.includes(t.accountGuid) && (He(t.expectedDate) || Oe(t.expectedDate, o.start)) && Ge(t.expectedDate, o.end), Lt = () => {
615
+ const { availableWidth: i } = re(), { cashflow: o } = R(), { isDataLoaded: t } = te(), { selectedAccountGuids: a } = $(), {
614
616
  dateRange: s,
615
- income: u,
617
+ income: h,
616
618
  selectedCashAccounts: y,
617
619
  selectedCashBalance: l,
618
620
  upcomingExpenses: x,
619
621
  upcomingIncome: _
620
- } = z(), [r, p] = w.useState(!1), h = x.filter(
622
+ } = B(), [r, u] = S.useState(!1), p = x.filter(
621
623
  Re(a, s)
622
624
  ), d = _.filter(
623
625
  Re(a, s)
624
- ), f = l, C = h.reduce((k, W) => k + W.amount, 0), S = d.reduce((k, W) => k + W.amount, 0), Z = f - C + S, B = t && u.length > 0, g = i < 725;
625
- return /* @__PURE__ */ n(c, { sx: { mx: g ? 16 : 0, my: g ? 24 : 42 }, children: [
626
+ ), f = l, C = p.reduce((L, W) => L + W.amount, 0), w = d.reduce((L, W) => L + W.amount, 0), j = f - C + w, Y = t && h.length > 0, b = i < 725;
627
+ return /* @__PURE__ */ n(c, { sx: { mx: b ? 16 : 0, my: b ? 24 : 42 }, children: [
626
628
  /* @__PURE__ */ n(
627
629
  c,
628
630
  {
629
- border: g ? "1px solid" : "none",
631
+ border: b ? "1px solid" : "none",
630
632
  borderColor: "neutral.light",
631
633
  borderRadius: 2,
632
- flexDirection: g ? "column" : "row",
633
- gap: g ? 0 : 24,
634
+ flexDirection: b ? "column" : "row",
635
+ gap: b ? 0 : 24,
634
636
  justifyContent: "center",
635
637
  children: [
636
638
  /* @__PURE__ */ e(
637
- te,
639
+ oe,
638
640
  {
639
641
  amount: f,
640
- isMobile: g,
642
+ isMobile: b,
641
643
  label: G(o.cash_and_bank, y.length)
642
644
  }
643
645
  ),
644
- g && /* @__PURE__ */ e(I, {}),
645
- B ? /* @__PURE__ */ n(M, { children: [
646
- !g && /* @__PURE__ */ e(m, { sx: { fontSize: 25, lineHeight: 1 }, children: "+" }),
646
+ b && /* @__PURE__ */ e(D, {}),
647
+ Y ? /* @__PURE__ */ n(z, { children: [
648
+ !b && /* @__PURE__ */ e(m, { sx: { fontSize: 25, lineHeight: 1 }, children: "+" }),
647
649
  /* @__PURE__ */ e(
648
- te,
650
+ oe,
649
651
  {
650
- amount: S,
651
- isMobile: g,
652
+ amount: w,
653
+ isMobile: b,
652
654
  label: o.to_be_received,
653
- symbol: g ? "+" : void 0
655
+ symbol: b ? "+" : void 0
654
656
  }
655
657
  )
656
658
  ] }) : /* @__PURE__ */ e(
657
- F,
659
+ H,
658
660
  {
659
- onClick: () => p(!0),
660
- startIcon: /* @__PURE__ */ e(H, { name: "add" }),
661
+ onClick: () => u(!0),
662
+ startIcon: /* @__PURE__ */ e(F, { name: "add" }),
661
663
  sx: { fontSize: 13 },
662
664
  children: o.add_income
663
665
  }
664
666
  ),
665
- g ? /* @__PURE__ */ e(I, {}) : /* @__PURE__ */ e(m, { sx: { fontSize: 25, lineHeight: 1 }, children: "-" }),
667
+ b ? /* @__PURE__ */ e(D, {}) : /* @__PURE__ */ e(m, { sx: { fontSize: 25, lineHeight: 1 }, children: "-" }),
666
668
  /* @__PURE__ */ e(
667
- te,
669
+ oe,
668
670
  {
669
671
  amount: C,
670
- isMobile: g,
671
- label: G(o.to_be_paid_out, h.length),
672
- symbol: g ? "-" : void 0
672
+ isMobile: b,
673
+ label: G(o.to_be_paid_out, p.length),
674
+ symbol: b ? "-" : void 0
673
675
  }
674
676
  ),
675
- g ? /* @__PURE__ */ e(I, {}) : /* @__PURE__ */ e(m, { sx: { fontSize: 25, lineHeight: 1 }, children: "=" }),
677
+ b ? /* @__PURE__ */ e(D, {}) : /* @__PURE__ */ e(m, { sx: { fontSize: 25, lineHeight: 1 }, children: "=" }),
676
678
  /* @__PURE__ */ e(
677
- te,
679
+ oe,
678
680
  {
679
- amount: Z,
680
- isMobile: g,
681
- isTotal: g,
681
+ amount: j,
682
+ isMobile: b,
683
+ isTotal: b,
682
684
  label: o.remaining_cash,
683
685
  tooltip: /* @__PURE__ */ e(
684
- ue,
686
+ he,
685
687
  {
686
688
  body: o.remaining_income_tooltip_body,
687
689
  title: o.remaining_income_tooltip_title
@@ -697,89 +699,109 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
697
699
  {
698
700
  ariaLabelClose: o.close_manage_income_aria,
699
701
  isOpen: r,
700
- onClose: () => p(!1),
702
+ onClose: () => u(!1),
701
703
  shouldShowHeaderBorders: !1,
702
704
  title: o.manage_income,
703
- children: /* @__PURE__ */ e(at, {})
705
+ children: /* @__PURE__ */ e(ct, {})
704
706
  }
705
707
  )
706
708
  ] });
707
- }, Lt = T(Et), kt = ({ onBackClick: i, onMenuClick: o, sx: t = {} }) => {
708
- const { selectedAccounts: a, selectedAccountGuids: s, shouldDisableNextDate: u, shouldDisablePrevDate: y } = j(), { onEvent: l } = Le(), { clientConfig: x } = me(), { visibleCashAccounts: _ } = Xe(), { setFilter: r } = ke(), { dateRange: p } = z(), { loadRepeatingTransactionData: h, isDataLoaded: d } = Q(), { cashflow: f, recurring: C } = R(), { isInitialized: S } = j(), B = x?.master?.deep_link_params?.view === "manage_income", [g, k] = w.useState(B);
709
- return w.useEffect(() => {
710
- d || h().finally();
711
- }, []), w.useEffect(() => {
712
- const W = _.map((O) => O.guid), ee = a.filter(
713
- (O) => s.includes(O.guid) && W.includes(O.guid)
709
+ }, Nt = T(Lt), Ot = ({ onBackClick: i, onMenuClick: o, sx: t = {} }) => {
710
+ const { selectedAccounts: a, selectedAccountGuids: s, shouldDisableNextDate: h, shouldDisablePrevDate: y } = $(), { onEvent: l } = Ee(), { clientConfig: x } = pe(), { visibleCashAccounts: _ } = Xe(), { setFilter: r } = Le(), { dateRange: u } = B(), { alert: p, loadRepeatingTransactionData: d, isDataLoaded: f, setAlert: C } = te(), { cashflow: w, recurring: j } = R(), { isInitialized: Y } = $(), L = x?.master?.deep_link_params?.view === "manage_income", [W, q] = S.useState(L);
711
+ return S.useEffect(() => {
712
+ f || d().finally();
713
+ }, []), S.useEffect(() => {
714
+ const ne = _.map((N) => N.guid), M = a.filter(
715
+ (N) => s.includes(N.guid) && ne.includes(N.guid)
714
716
  );
715
717
  r({
716
- dateRange: { start: Me(se(), 90), end: lt() },
717
- accounts: ee.map((O) => O.guid)
718
+ dateRange: { start: Me(le(), 90), end: mt() },
719
+ accounts: M.map((N) => N.guid)
718
720
  });
719
721
  }, [_, a]), Ne({
720
722
  widgetName: "CashflowWidget",
721
- isLoaded: d
722
- }), S ? /* @__PURE__ */ n(
723
- dt,
723
+ isLoaded: f
724
+ }), Y ? /* @__PURE__ */ n(
725
+ pt,
724
726
  {
725
727
  actions: [
726
728
  {
727
- label: C.action_title,
729
+ label: j.action_title,
728
730
  iconName: "credit_card_gear",
729
731
  onClick: () => {
730
- k(!0), l(Se.CASH_FLOW_CLICK_SETTINGS);
732
+ q(!0), l(Se.CASH_FLOW_CLICK_SETTINGS);
731
733
  }
732
734
  }
733
735
  ],
734
736
  allowedAccountTypes: [
735
- Y.CASH,
736
- Y.CHECKING,
737
- Y.PREPAID,
738
- Y.SAVINGS,
739
- Y.CHECKING_LINE_OF_CREDIT
737
+ V.CASH,
738
+ V.CHECKING,
739
+ V.PREPAID,
740
+ V.SAVINGS,
741
+ V.CHECKING_LINE_OF_CREDIT
740
742
  ],
741
743
  calendarActions: {
742
- shouldDisableNext: u,
744
+ shouldDisableNext: h,
743
745
  shouldDisablePrevious: y,
744
746
  shouldDisablePicker: !0,
745
747
  onRangeChanged: () => {
746
748
  }
747
749
  },
748
- dateRange: p,
750
+ dateRange: u,
749
751
  dateRangeVariant: "readonly",
750
752
  hasDivider: !0,
751
753
  onAccountsFilterClick: () => l(Se.CASH_FLOW_CLICK_FILTER),
752
754
  onBackClick: i,
753
755
  onMenuClick: o,
754
756
  sx: t,
755
- title: f.title,
757
+ title: w.title,
756
758
  children: [
757
- /* @__PURE__ */ e(Lt, {}),
758
- /* @__PURE__ */ e(Rt, {}),
759
+ /* @__PURE__ */ e(Nt, {}),
760
+ /* @__PURE__ */ e(Et, {}),
759
761
  /* @__PURE__ */ e(
760
762
  We,
761
763
  {
762
- ariaLabelClose: f.close_settings_aria,
763
- isOpen: g,
764
- onClose: () => k(!1),
764
+ ariaLabelClose: w.close_settings_aria,
765
+ isOpen: W,
766
+ onClose: () => q(!1),
765
767
  shouldShowHeaderBorders: !1,
766
- title: C.action_title,
767
- children: /* @__PURE__ */ e(et, { defaultSelectedTab: B ? 1 : 0 })
768
+ title: j.action_title,
769
+ children: /* @__PURE__ */ e(nt, { defaultSelectedTab: L ? 1 : 0 })
770
+ }
771
+ ),
772
+ /* @__PURE__ */ e(
773
+ tt,
774
+ {
775
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
776
+ autoHideDuration: 3500,
777
+ onClose: (ne, M) => {
778
+ M !== "clickaway" && C("", p.severity);
779
+ },
780
+ open: !!p.message,
781
+ children: /* @__PURE__ */ e(
782
+ et,
783
+ {
784
+ onClose: () => C("", p.severity),
785
+ severity: p.severity,
786
+ variant: "filled",
787
+ children: p.message
788
+ }
789
+ )
768
790
  }
769
791
  )
770
792
  ]
771
793
  }
772
- ) : /* @__PURE__ */ e(V, {});
773
- }, Gn = T(kt), Nt = ({ handleNextStep: i }) => {
774
- const { completeOnboarding: o } = de(), { cashflow: t } = R(), a = oe();
794
+ ) : /* @__PURE__ */ e(Q, {});
795
+ }, Mn = T(Ot), Gt = ({ handleNextStep: i }) => {
796
+ const { completeOnboarding: o } = me(), { cashflow: t } = R(), a = ae();
775
797
  return /* @__PURE__ */ n(c, { children: [
776
- /* @__PURE__ */ e(le, { pb: 12, variant: "h1", children: t.welcome_title }),
798
+ /* @__PURE__ */ e(de, { pb: 12, variant: "h1", children: t.welcome_title }),
777
799
  /* @__PURE__ */ e(Ke, { color: a.palette.primary.light, pb: 8, children: t.welcome_sub_title }),
778
- /* @__PURE__ */ e(E, { pb: 32, children: t.welcome_description }),
800
+ /* @__PURE__ */ e(k, { pb: 32, children: t.welcome_description }),
779
801
  /* @__PURE__ */ n(c, { direction: "column", mb: 32, spacing: 32, children: [
780
- /* @__PURE__ */ n(E, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
802
+ /* @__PURE__ */ n(k, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
781
803
  /* @__PURE__ */ e(
782
- D,
804
+ v,
783
805
  {
784
806
  bgcolor: a.palette.primary.lighter,
785
807
  borderRadius: 1,
@@ -788,14 +810,14 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
788
810
  mr: 24,
789
811
  sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
790
812
  width: 44,
791
- children: /* @__PURE__ */ e(H, { color: "primary", name: "currency_exchange" })
813
+ children: /* @__PURE__ */ e(F, { color: "primary", name: "currency_exchange" })
792
814
  }
793
815
  ),
794
816
  t.bullet_one
795
817
  ] }),
796
- /* @__PURE__ */ n(E, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
818
+ /* @__PURE__ */ n(k, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
797
819
  /* @__PURE__ */ e(
798
- D,
820
+ v,
799
821
  {
800
822
  bgcolor: a.palette.primary.lighter,
801
823
  borderRadius: 1,
@@ -804,14 +826,14 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
804
826
  mr: 24,
805
827
  sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
806
828
  width: 44,
807
- children: /* @__PURE__ */ e(H, { color: "primary", name: "cardiology" })
829
+ children: /* @__PURE__ */ e(F, { color: "primary", name: "cardiology" })
808
830
  }
809
831
  ),
810
832
  t.bullet_two
811
833
  ] }),
812
- /* @__PURE__ */ n(E, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
834
+ /* @__PURE__ */ n(k, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
813
835
  /* @__PURE__ */ e(
814
- D,
836
+ v,
815
837
  {
816
838
  bgcolor: a.palette.primary.lighter,
817
839
  borderRadius: 1,
@@ -820,72 +842,72 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
820
842
  mr: 24,
821
843
  sx: { display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
822
844
  width: 44,
823
- children: /* @__PURE__ */ e(H, { color: "primary", name: "flare" })
845
+ children: /* @__PURE__ */ e(F, { color: "primary", name: "flare" })
824
846
  }
825
847
  ),
826
848
  t.bullet_three
827
849
  ] })
828
850
  ] }),
829
851
  /* @__PURE__ */ n(c, { direction: "row", spacing: 16, children: [
830
- /* @__PURE__ */ e(F, { onClick: i, variant: "contained", children: t.get_started_button }),
831
- /* @__PURE__ */ e(F, { onClick: o, variant: "outlined", children: t.skip_button })
852
+ /* @__PURE__ */ e(H, { onClick: i, variant: "contained", children: t.get_started_button }),
853
+ /* @__PURE__ */ e(H, { onClick: o, variant: "outlined", children: t.skip_button })
832
854
  ] })
833
855
  ] });
834
- }, Ot = T(Nt), Ee = "https://content.moneydesktop.com/storage/MD_Assets/md/cashflow", ze = {
835
- CASHFLOW_ONBOARDING: `${Ee}/cashflow-onboarding.png`,
836
- CASHFLOW_LOADING_ANIMATION: `${Ee}/loading-animation.gif`
837
- }, Gt = () => {
856
+ }, Ht = T(Gt), ke = "https://content.moneydesktop.com/storage/MD_Assets/md/cashflow", ze = {
857
+ CASHFLOW_ONBOARDING: `${ke}/cashflow-onboarding.png`,
858
+ CASHFLOW_LOADING_ANIMATION: `${ke}/loading-animation.gif`
859
+ }, Ft = () => {
838
860
  const { cashflow: i } = R();
839
- return /* @__PURE__ */ n(w.Fragment, { children: [
861
+ return /* @__PURE__ */ n(S.Fragment, { children: [
840
862
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("img", { alt: "Loading", src: ze.CASHFLOW_LOADING_ANIMATION }) }),
841
- /* @__PURE__ */ e(le, { pb: 12, variant: "h1", children: i.loading_title }),
842
- /* @__PURE__ */ e(E, { children: i.loading_description })
863
+ /* @__PURE__ */ e(de, { pb: 12, variant: "h1", children: i.loading_title }),
864
+ /* @__PURE__ */ e(k, { children: i.loading_description })
843
865
  ] });
844
- }, Ft = T(Gt), Ht = qe`
866
+ }, Wt = T(Ft), Mt = qe`
845
867
  from {
846
868
  transform: rotate(0deg);
847
869
  }
848
870
  to {
849
871
  transform: rotate(360deg);
850
872
  }
851
- `, Wt = () => {
852
- const { addRepeatingTransaction: i, repeatingTransactions: o } = Q(), { cashflow: t, common: a } = R(), { user: s } = Je(), { completeOnboarding: u } = de(), { isDirty: y } = z(), { isMobile: l } = pe(), { isCopyLoaded: x, setDisplayedDate: _ } = j(), { filter: r, setFilter: p, transactions: h } = ke(), d = oe(), [f, C] = U(!0), [S, Z] = w.useState(ft.EveryMonth), [B, g] = w.useState(1), [k, W] = w.useState(15), [ee, O] = U(!1), [ae, fe] = U(1), [L, Be] = U([]), [ge, re] = U(""), N = w.useMemo(
853
- () => h.find((b) => b.guid === ge),
854
- [ge, h]
873
+ `, zt = () => {
874
+ const { addRepeatingTransaction: i, repeatingTransactions: o } = te(), { cashflow: t, common: a } = R(), { user: s } = Je(), { completeOnboarding: h } = me(), { isDirty: y } = B(), { isMobile: l } = ue(), { isCopyLoaded: x, setDisplayedDate: _ } = $(), { filter: r, setFilter: u, transactions: p } = Le(), d = ae(), [f, C] = K(!0), [w, j] = S.useState(bt.EveryMonth), [Y, b] = S.useState(1), [L, W] = S.useState(15), [q, ne] = K(!1), [M, N] = K(1), [E, Be] = K([]), [ge, ce] = K(""), O = S.useMemo(
875
+ () => p.find((g) => g.guid === ge),
876
+ [ge, p]
855
877
  ), je = !!o.filter(
856
- (b) => b.repeating_transaction_type === Ie.Income
878
+ (g) => g.repeating_transaction_type === De.Income
857
879
  ).length, be = async () => {
858
- fe(2), _(
880
+ N(2), _(
859
881
  // Beginning of the month, 90 days before today
860
- pt(Me(se(), 90)),
861
- se()
862
- ), p({ ...r, custom: we }), fe(3);
882
+ ht(Me(le(), 90)),
883
+ le()
884
+ ), u({ ...r, custom: we }), N(3);
863
885
  }, $e = async () => {
864
- if (!(L.length < 1)) {
865
- O(!0);
866
- for (let b = 0; b < L.length; b++) {
867
- const v = L[b], xe = ve(S, De(v.date)), Ue = {
868
- account_guid: v.account_guid,
869
- amount: v.amount,
886
+ if (!(E.length < 1)) {
887
+ ne(!0);
888
+ for (let g = 0; g < E.length; g++) {
889
+ const I = E[g], xe = Ie(w, ve(I.date)), Ue = {
890
+ account_guid: I.account_guid,
891
+ amount: I.amount,
870
892
  created_by: 0,
871
893
  //user
872
- merchant_guid: v.merchant_guid,
873
- description: v.feed_description || v.description,
874
- predicted_occurs_on: mt(xe, { representation: "date" }),
894
+ merchant_guid: I.merchant_guid,
895
+ description: I.feed_description || I.description,
896
+ predicted_occurs_on: ut(xe, { representation: "date" }),
875
897
  recurrence_day: xe.getDay(),
876
- recurrence_type: S,
877
- repeating_transaction_type: Ie.Income,
878
- second_recurrence_day: k,
879
- transaction_type: v.transaction_type,
898
+ recurrence_type: w,
899
+ repeating_transaction_type: De.Income,
900
+ second_recurrence_day: L,
901
+ transaction_type: I.transaction_type,
880
902
  user_guid: s.guid
881
903
  };
882
- await i(Ue, v);
904
+ await i(Ue, I);
883
905
  }
884
- await u();
906
+ await h();
885
907
  }
886
- }, Pe = !N && f || !N && L.length < 1;
908
+ }, Pe = !O && f || !O && E.length < 1;
887
909
  return x ? /* @__PURE__ */ n(
888
- D,
910
+ v,
889
911
  {
890
912
  sx: {
891
913
  display: "flex",
@@ -898,103 +920,103 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
898
920
  py: 24
899
921
  },
900
922
  children: [
901
- ae === 1 && /* @__PURE__ */ e(
902
- D,
923
+ M === 1 && /* @__PURE__ */ e(
924
+ v,
903
925
  {
904
926
  sx: {
905
927
  ...l ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
906
928
  },
907
- children: /* @__PURE__ */ e(Ot, { handleNextStep: be })
929
+ children: /* @__PURE__ */ e(Ht, { handleNextStep: be })
908
930
  }
909
931
  ),
910
- ae === 2 && /* @__PURE__ */ e(
911
- D,
932
+ M === 2 && /* @__PURE__ */ e(
933
+ v,
912
934
  {
913
935
  sx: {
914
936
  ...l ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
915
937
  },
916
- children: /* @__PURE__ */ e(Ft, {})
938
+ children: /* @__PURE__ */ e(Wt, {})
917
939
  }
918
940
  ),
919
- ae === 3 && /* @__PURE__ */ n(
920
- D,
941
+ M === 3 && /* @__PURE__ */ n(
942
+ v,
921
943
  {
922
944
  sx: {
923
945
  ...l ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
924
946
  },
925
947
  children: [
926
- /* @__PURE__ */ e(le, { pb: 12, variant: "h1", children: t.add_income_title }),
927
- /* @__PURE__ */ e(E, { mb: 24, children: t.add_income_description }),
928
- L.length > 0 && !N && /* @__PURE__ */ n(M, { children: [
929
- /* @__PURE__ */ e(K, { children: L.map((b, v) => /* @__PURE__ */ n(w.Fragment, { children: [
930
- /* @__PURE__ */ e(ut, { bgcolor: "background.paper", children: gt(
931
- ce(b.nextDate || b.date)
948
+ /* @__PURE__ */ e(de, { pb: 12, variant: "h1", children: t.add_income_title }),
949
+ /* @__PURE__ */ e(k, { mb: 24, children: t.add_income_description }),
950
+ E.length > 0 && !O && /* @__PURE__ */ n(z, { children: [
951
+ /* @__PURE__ */ e(J, { children: E.map((g, I) => /* @__PURE__ */ n(S.Fragment, { children: [
952
+ /* @__PURE__ */ e(ft, { bgcolor: "background.paper", children: xt(
953
+ se(g.nextDate || g.date)
932
954
  ) }),
933
- /* @__PURE__ */ e(ht, { transaction: b }),
934
- v !== L.length - 1 && /* @__PURE__ */ e(I, {})
935
- ] }, b.guid)) }),
955
+ /* @__PURE__ */ e(gt, { transaction: g }),
956
+ I !== E.length - 1 && /* @__PURE__ */ e(D, {})
957
+ ] }, g.guid)) }),
936
958
  /* @__PURE__ */ n(c, { alignItems: "center", direction: "row", children: [
937
- /* @__PURE__ */ e(I, { sx: { flexGrow: 1 } }),
959
+ /* @__PURE__ */ e(D, { sx: { flexGrow: 1 } }),
938
960
  /* @__PURE__ */ e(
939
- F,
961
+ H,
940
962
  {
941
963
  onClick: () => C(!0),
942
- startIcon: /* @__PURE__ */ e(H, { name: "add", size: 20 }),
964
+ startIcon: /* @__PURE__ */ e(F, { name: "add", size: 20 }),
943
965
  children: t.add_income
944
966
  }
945
967
  )
946
968
  ] })
947
969
  ] }),
948
970
  Pe && /* @__PURE__ */ e(
949
- rt,
971
+ st,
950
972
  {
951
973
  bgcolor: "background.paper",
952
- onSearch: (b) => p({
974
+ onSearch: (g) => u({
953
975
  ...r,
954
- custom: (v) => b ? ct(v, b) : we(v)
976
+ custom: (I) => g ? lt(I, g) : we(I)
955
977
  }),
956
- onSelected: (b) => {
957
- re(b), C(!1);
978
+ onSelected: (g) => {
979
+ ce(g), C(!1);
958
980
  }
959
981
  }
960
982
  ),
961
- !je && y && /* @__PURE__ */ e(E, { color: "error", mt: 16, children: t.confirm_error }),
962
- N && /* @__PURE__ */ n(M, { children: [
983
+ !je && y && /* @__PURE__ */ e(k, { color: "error", mt: 16, children: t.confirm_error }),
984
+ O && /* @__PURE__ */ n(z, { children: [
963
985
  /* @__PURE__ */ e(
964
- st,
986
+ dt,
965
987
  {
966
988
  bgcolor: "background.paper",
967
- firstDay: B,
968
- frequency: S,
969
- onFirstDayChange: g,
970
- onFrequencyChange: Z,
989
+ firstDay: Y,
990
+ frequency: w,
991
+ onFirstDayChange: b,
992
+ onFrequencyChange: j,
971
993
  onSecondDayChange: W,
972
- secondDay: k,
973
- transaction: N
994
+ secondDay: L,
995
+ transaction: O
974
996
  }
975
997
  ),
976
998
  /* @__PURE__ */ n(c, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
977
999
  /* @__PURE__ */ e(
978
- F,
1000
+ H,
979
1001
  {
980
- "aria-disabled": !N,
1002
+ "aria-disabled": !O,
981
1003
  onClick: () => {
982
- const b = [...L];
983
- b.push({
984
- ...N,
985
- nextDate: ve(S, De(N.date)),
986
- frequency: S
987
- }), Be(b), re("");
1004
+ const g = [...E];
1005
+ g.push({
1006
+ ...O,
1007
+ nextDate: Ie(w, ve(O.date)),
1008
+ frequency: w
1009
+ }), Be(g), ce("");
988
1010
  },
989
1011
  variant: "contained",
990
1012
  children: a.confirm_button
991
1013
  }
992
1014
  ),
993
1015
  /* @__PURE__ */ e(
994
- F,
1016
+ H,
995
1017
  {
996
1018
  onClick: () => {
997
- re(""), C(!0), be().finally();
1019
+ ce(""), C(!0), be().finally();
998
1020
  },
999
1021
  variant: "outlined",
1000
1022
  children: a.cancel_button
@@ -1002,18 +1024,18 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
1002
1024
  )
1003
1025
  ] })
1004
1026
  ] }),
1005
- L.length > 0 && !N && /* @__PURE__ */ n(c, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
1027
+ E.length > 0 && !O && /* @__PURE__ */ n(c, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
1006
1028
  /* @__PURE__ */ e(
1007
- F,
1029
+ H,
1008
1030
  {
1009
- "aria-disabled": L.length < 1 || ee,
1031
+ "aria-disabled": E.length < 1 || q,
1010
1032
  onClick: $e,
1011
- startIcon: ee ? /* @__PURE__ */ e(
1012
- H,
1033
+ startIcon: q ? /* @__PURE__ */ e(
1034
+ F,
1013
1035
  {
1014
1036
  name: "progress_activity",
1015
1037
  sx: {
1016
- animation: `${Ht} 2s linear infinite`
1038
+ animation: `${Mt} 2s linear infinite`
1017
1039
  }
1018
1040
  }
1019
1041
  ) : null,
@@ -1021,18 +1043,18 @@ const wt = ({ recurrence: i }) => /* @__PURE__ */ n(M, { children: [
1021
1043
  children: t.confirm_income_button
1022
1044
  }
1023
1045
  ),
1024
- /* @__PURE__ */ e(F, { onClick: u, variant: "outlined", children: t.skip_button })
1046
+ /* @__PURE__ */ e(H, { onClick: h, variant: "outlined", children: t.skip_button })
1025
1047
  ] })
1026
1048
  ]
1027
1049
  }
1028
1050
  )
1029
1051
  ]
1030
1052
  }
1031
- ) : /* @__PURE__ */ e(V, {});
1032
- }, Fn = T(Wt);
1053
+ ) : /* @__PURE__ */ e(Q, {});
1054
+ }, zn = T(zt);
1033
1055
  export {
1034
- On as CashflowMiniWidget,
1035
- Fn as CashflowOnboarding,
1036
- Gn as CashflowWidget
1056
+ Wn as CashflowMiniWidget,
1057
+ zn as CashflowOnboarding,
1058
+ Mn as CashflowWidget
1037
1059
  };
1038
1060
  //# sourceMappingURL=index.es.js.map