@mx-cartographer/experiences 8.1.7 → 8.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/goals/index.es.js +373 -372
- package/package.json +1 -1
package/dist/goals/index.es.js
CHANGED
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
import { jsxs as c, jsx as e, Fragment as
|
|
1
|
+
import { jsxs as c, jsx as e, Fragment as F } from "react/jsx-runtime";
|
|
2
2
|
import T from "react";
|
|
3
3
|
import { observer as D } from "mobx-react-lite";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import Pe from "@mui/material/Alert";
|
|
5
|
+
import je from "@mui/material/Snackbar";
|
|
6
6
|
import f from "@mui/material/Stack";
|
|
7
7
|
import re from "@mui/material/Tab";
|
|
8
|
-
import
|
|
9
|
-
import { Text as C, H3 as le, P as
|
|
8
|
+
import Fe from "@mui/material/Tabs";
|
|
9
|
+
import { Text as C, H3 as le, P as Y, Icon as $e, InstitutionLogo as X, H2 as Te } from "@mxenabled/mxui";
|
|
10
10
|
import me from "@mui/material/Button";
|
|
11
11
|
import Ce from "@mui/material/Card";
|
|
12
12
|
import xe from "@mui/material/CardActionArea";
|
|
13
13
|
import Re from "@mui/material/CardContent";
|
|
14
14
|
import ye from "@mui/material/Unstable_Grid2";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import { Payments as Se, NoteStack as Ee, Person as ve, ArrowUpwardAlt as
|
|
18
|
-
import { g as ue, a as
|
|
19
|
-
import { G as
|
|
20
|
-
import { u as R, k as
|
|
15
|
+
import te from "@mui/material/Avatar";
|
|
16
|
+
import He from "@mui/material/CardHeader";
|
|
17
|
+
import { Payments as Se, NoteStack as Ee, Person as ve, ArrowUpwardAlt as Ue, CheckCircle as Ye, ChevronRight as z, Icon as ge, ExpandLess as Ze, ExpandMore as qe, AddBox as Ie, Trophy as Je } from "@mxenabled/mx-icons";
|
|
18
|
+
import { g as ue, a as Qe, C as Ge, b as Xe } from "../GoalStore-DmqM1ZfW.mjs";
|
|
19
|
+
import { G as qn } from "../GoalStore-DmqM1ZfW.mjs";
|
|
20
|
+
import { u as R, k as N, b as _e, a as pe, d as j, o as Ne, g as ke } from "../hooks-HwStH7q_.mjs";
|
|
21
21
|
import { u as he } from "../useScreenSize-CeFhWTt_.mjs";
|
|
22
|
-
import { T as r, a as de, M as
|
|
23
|
-
import { f as
|
|
24
|
-
import { S as
|
|
25
|
-
import
|
|
22
|
+
import { T as r, a as de, M as U } from "../Goal-MFBpoOIC.mjs";
|
|
23
|
+
import { f as I } from "../NumberFormatting-CyrvFgfd.mjs";
|
|
24
|
+
import { S as et } from "../StatusBar-CPfSXe80.mjs";
|
|
25
|
+
import v from "@mui/material/Divider";
|
|
26
26
|
import O from "@mui/material/List";
|
|
27
|
-
import { L as
|
|
27
|
+
import { L as Z } from "../ListItemAction-Buv7tPLp.mjs";
|
|
28
28
|
import { C as we } from "../CurrencyInput-CSJ3zMgE.mjs";
|
|
29
|
-
import { fromUnixTime as
|
|
30
|
-
import
|
|
29
|
+
import { fromUnixTime as ee } from "date-fns/fromUnixTime";
|
|
30
|
+
import tt from "@mui/material/IconButton";
|
|
31
31
|
import k from "@mui/material/ListItem";
|
|
32
|
-
import
|
|
32
|
+
import P from "@mui/material/ListItemAvatar";
|
|
33
33
|
import L from "@mui/material/ListItemButton";
|
|
34
34
|
import w from "@mui/material/ListItemText";
|
|
35
35
|
import { b as W } from "../Localization-CkQ49EKr.mjs";
|
|
36
36
|
import { f as be, D as fe } from "../DateFormats-CaOj_4eI.mjs";
|
|
37
|
-
import { D as
|
|
37
|
+
import { D as q } from "../Drawer-XPaLYjiO.mjs";
|
|
38
38
|
import { g as De } from "../AccountDisplayName-CO7z3v99.mjs";
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
39
|
+
import nt from "@mui/material/Collapse";
|
|
40
|
+
import ot from "@mui/material/ListItemIcon";
|
|
41
|
+
import at from "@mui/material/Checkbox";
|
|
42
42
|
import { A as Ae } from "../Account-CMjOp7S2.mjs";
|
|
43
|
-
import { u as
|
|
43
|
+
import { u as it } from "../useAccountDisplayName-SrQA7K_6.mjs";
|
|
44
44
|
import Ke from "@mui/material/TextField";
|
|
45
|
-
import { M as
|
|
46
|
-
import { getUnixTime as
|
|
47
|
-
import { isValid as
|
|
48
|
-
import { AdapterDateFns as
|
|
49
|
-
import { DatePicker as
|
|
50
|
-
import { LocalizationProvider as
|
|
51
|
-
import { D as
|
|
45
|
+
import { M as rt, I as st, O as ct } from "../OriginalBalanceAction-6XAwp1UT.mjs";
|
|
46
|
+
import { getUnixTime as lt } from "date-fns/getUnixTime";
|
|
47
|
+
import { isValid as dt } from "date-fns/isValid";
|
|
48
|
+
import { AdapterDateFns as mt } from "@mui/x-date-pickers/AdapterDateFnsV3";
|
|
49
|
+
import { DatePicker as ut } from "@mui/x-date-pickers";
|
|
50
|
+
import { LocalizationProvider as _t } from "@mui/x-date-pickers/LocalizationProvider";
|
|
51
|
+
import { D as pt } from "../Dialog-iLlBR8TG.mjs";
|
|
52
52
|
import { u as Me } from "../useWidgetLoadTimer-wkBTL5xx.mjs";
|
|
53
|
-
import { A as
|
|
53
|
+
import { A as $ } from "../Analytics-CzGzz_sE.mjs";
|
|
54
54
|
import { L as Le } from "../Loader-CxeBwuPG.mjs";
|
|
55
|
-
import { W as
|
|
56
|
-
import { E as
|
|
57
|
-
import
|
|
58
|
-
import
|
|
59
|
-
import
|
|
60
|
-
import { S as
|
|
61
|
-
import { M as
|
|
55
|
+
import { W as ht } from "../WidgetContainer-_Fzy--dt.mjs";
|
|
56
|
+
import { E as bt } from "../EmptyState-DHAkGsjk.mjs";
|
|
57
|
+
import ft from "@mui/material/Stack/Stack";
|
|
58
|
+
import yt from "@mui/material/Box";
|
|
59
|
+
import gt from "@mui/material/styles/useTheme";
|
|
60
|
+
import { S as At } from "../SingleSegmentDonut-PsRQPkmV.mjs";
|
|
61
|
+
import { M as Tt } from "../MicroWidgetContainer-CEcwdfti.mjs";
|
|
62
62
|
function se({ title: t, subtitle: n }) {
|
|
63
63
|
return /* @__PURE__ */ c(f, { children: [
|
|
64
64
|
/* @__PURE__ */ e(C, { bold: !0, variant: "body1", children: t }),
|
|
65
65
|
/* @__PURE__ */ e(C, { sx: { fontWeight: 400 }, variant: "body1", children: n })
|
|
66
66
|
] });
|
|
67
67
|
}
|
|
68
|
-
const
|
|
68
|
+
const Ct = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
69
69
|
/(\d+)(?:\.0+|(\.\d*?[1-9])0*)([a-zA-Z]* ?\$?)/g,
|
|
70
70
|
"$1$2$3"
|
|
71
|
-
) :
|
|
71
|
+
) : I(t, "0,0.00"), Oe = D(
|
|
72
72
|
({ goal: t, isInDrawer: n = !1, onClick: u }) => {
|
|
73
|
-
const { goals:
|
|
73
|
+
const { goals: d } = R(), { isMobile: _, isTablet: i } = he(), m = _ || i, {
|
|
74
74
|
backgroundColor: p,
|
|
75
75
|
color: s,
|
|
76
|
-
percentage:
|
|
76
|
+
percentage: h,
|
|
77
77
|
percentageText: a,
|
|
78
78
|
projectedText: o
|
|
79
|
-
} = ue(
|
|
79
|
+
} = ue(d, t), b = t.track_type === r.DEBT_TRACK ? t.initial_amount : t.amount, l = [
|
|
80
80
|
{
|
|
81
81
|
color: p,
|
|
82
|
-
percentage: `${
|
|
82
|
+
percentage: `${h}`
|
|
83
83
|
}
|
|
84
84
|
];
|
|
85
85
|
let g = /* @__PURE__ */ e(Se, {});
|
|
@@ -95,20 +95,20 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
95
95
|
},
|
|
96
96
|
children: /* @__PURE__ */ c(xe, { disabled: !u, onClick: u, children: [
|
|
97
97
|
/* @__PURE__ */ e(
|
|
98
|
-
|
|
98
|
+
He,
|
|
99
99
|
{
|
|
100
|
-
avatar: /* @__PURE__ */ e(
|
|
100
|
+
avatar: /* @__PURE__ */ e(te, { sx: { bgcolor: p, color: s, height: 48, width: 48 }, variant: "rounded", children: g }),
|
|
101
101
|
subheader: /* @__PURE__ */ e(
|
|
102
102
|
C,
|
|
103
103
|
{
|
|
104
104
|
sx: {
|
|
105
105
|
fontWeight: 700,
|
|
106
|
-
fontSize: n ||
|
|
107
|
-
lineHeight: n ||
|
|
106
|
+
fontSize: n || m ? "18px" : "23px",
|
|
107
|
+
lineHeight: n || m ? "24px" : "32px"
|
|
108
108
|
},
|
|
109
|
-
children: `${
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
children: `${I(t.current_amount, m ? "0,0" : "0,0.00")} / ${Ct(
|
|
110
|
+
b,
|
|
111
|
+
m
|
|
112
112
|
)}`
|
|
113
113
|
}
|
|
114
114
|
),
|
|
@@ -131,7 +131,7 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
131
131
|
}
|
|
132
132
|
),
|
|
133
133
|
/* @__PURE__ */ e(Re, { sx: { pt: 0 }, children: /* @__PURE__ */ c(f, { gap: 6, children: [
|
|
134
|
-
/* @__PURE__ */ e(
|
|
134
|
+
/* @__PURE__ */ e(et, { data: l, height: 24 }),
|
|
135
135
|
/* @__PURE__ */ c(f, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
136
136
|
/* @__PURE__ */ e(C, { color: "text.secondary", variant: "caption", children: a }),
|
|
137
137
|
t.projected_to_complete_at && /* @__PURE__ */ e(C, { color: "text.secondary", variant: "caption", children: o })
|
|
@@ -141,45 +141,45 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
141
141
|
}
|
|
142
142
|
);
|
|
143
143
|
}
|
|
144
|
-
),
|
|
145
|
-
const { goals: n } = R(), { setAlert: u, monthlyCashFlowProfile:
|
|
144
|
+
), xt = D(({ trackType: t }) => {
|
|
145
|
+
const { goals: n } = R(), { setAlert: u, monthlyCashFlowProfile: d, updateMonthlyCashFlowProfile: _ } = N(), i = T.useMemo(() => {
|
|
146
146
|
let a = 0;
|
|
147
|
-
return t === r.SAVINGS_TRACK ? a =
|
|
148
|
-
}, [
|
|
147
|
+
return t === r.SAVINGS_TRACK ? a = d?.amount_allocated_for_savings_goals || 0 : t === r.DEBT_TRACK ? a = d?.amount_allocated_for_debt_goals || 0 : t === r.RETIREMENT_TRACK && (a = d?.amount_allocated_for_retirement_goals || 0), a;
|
|
148
|
+
}, [d]);
|
|
149
149
|
T.useEffect(() => {
|
|
150
150
|
p(i);
|
|
151
151
|
}, [i]);
|
|
152
|
-
const [
|
|
153
|
-
if (
|
|
154
|
-
const a = { ...
|
|
155
|
-
t === r.SAVINGS_TRACK ? a.amount_allocated_for_savings_goals =
|
|
152
|
+
const [m, p] = T.useState(i), s = m < 0 || m > 99999999, h = async () => {
|
|
153
|
+
if (d) {
|
|
154
|
+
const a = { ...d };
|
|
155
|
+
t === r.SAVINGS_TRACK ? a.amount_allocated_for_savings_goals = m : t === r.DEBT_TRACK ? a.amount_allocated_for_debt_goals = m : t === r.RETIREMENT_TRACK && (a.amount_allocated_for_retirement_goals = m), await _(a), u(n.alert_contribution_updated);
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
158
|
return /* @__PURE__ */ e(f, { bgcolor: "background.paper", children: /* @__PURE__ */ e(
|
|
159
|
-
|
|
159
|
+
Z,
|
|
160
160
|
{
|
|
161
|
-
isSaveDisabled: !
|
|
161
|
+
isSaveDisabled: !m || isNaN(m),
|
|
162
162
|
label: n.contribution_label,
|
|
163
163
|
onCancel: () => p(i),
|
|
164
|
-
onSave:
|
|
164
|
+
onSave: h,
|
|
165
165
|
primaryText: n.contribution_label,
|
|
166
|
-
secondaryText:
|
|
166
|
+
secondaryText: I(i, "0,0.00"),
|
|
167
167
|
children: /* @__PURE__ */ e(
|
|
168
168
|
we,
|
|
169
169
|
{
|
|
170
|
-
amount:
|
|
170
|
+
amount: m,
|
|
171
171
|
autoFocus: !0,
|
|
172
172
|
error: s,
|
|
173
173
|
fullWidth: !0,
|
|
174
174
|
minAmount: 0,
|
|
175
|
-
setAmount: (a) => p(isNaN(Number(a)) ?
|
|
175
|
+
setAmount: (a) => p(isNaN(Number(a)) ? m : Number(a)),
|
|
176
176
|
sx: { ".MuiTypography-body1": { p: 0 } }
|
|
177
177
|
}
|
|
178
178
|
)
|
|
179
179
|
}
|
|
180
180
|
) });
|
|
181
|
-
}),
|
|
182
|
-
const { goals:
|
|
181
|
+
}), Rt = ({ goal: t, index: n, onUpClick: u }) => {
|
|
182
|
+
const { goals: d } = R(), { percentage: _ } = ue(d, t), i = t.goal_type === de.KEEP_BALANCE_BELOW || t.has_been_spent ? d.goal_completed : W(d.goal_percentage_reached, `${_ * 100}`);
|
|
183
183
|
return /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(
|
|
184
184
|
L,
|
|
185
185
|
{
|
|
@@ -187,7 +187,7 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
187
187
|
sx: { ":hover": { backgroundColor: "unset" }, cursor: "default" },
|
|
188
188
|
children: [
|
|
189
189
|
t.track_type !== r.RETIREMENT_TRACK && /* @__PURE__ */ e(
|
|
190
|
-
|
|
190
|
+
P,
|
|
191
191
|
{
|
|
192
192
|
sx: {
|
|
193
193
|
alignItems: "center",
|
|
@@ -195,26 +195,26 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
195
195
|
justifyContent: "center",
|
|
196
196
|
".MuiAvatar-root": { height: "16px", width: "16px" }
|
|
197
197
|
},
|
|
198
|
-
children: t.track_type === r.SAVINGS_TRACK ? /* @__PURE__ */ e(
|
|
198
|
+
children: t.track_type === r.SAVINGS_TRACK ? /* @__PURE__ */ e(tt, { onClick: () => u?.(t), children: /* @__PURE__ */ e(Ue, { color: "primary", size: 24 }) }) : /* @__PURE__ */ e(te, { sx: { bgcolor: "text.primary", height: "16px", width: "16px" }, children: /* @__PURE__ */ e(C, { bold: !0, variant: "caption", children: n + 1 }) })
|
|
199
199
|
}
|
|
200
200
|
),
|
|
201
201
|
/* @__PURE__ */ e(w, { primaryTypographyProps: { variant: "body1" }, children: /* @__PURE__ */ c(f, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
202
202
|
/* @__PURE__ */ c(f, { sx: { maxWidth: "70%" }, children: [
|
|
203
203
|
/* @__PURE__ */ e(C, { bold: !0, variant: "body1", children: t.name }),
|
|
204
204
|
/* @__PURE__ */ e(C, { variant: "caption", children: t.is_complete ? i : W(
|
|
205
|
-
|
|
205
|
+
d.goal_projection,
|
|
206
206
|
be(
|
|
207
|
-
|
|
207
|
+
ee(t.projected_to_complete_at || 0),
|
|
208
208
|
fe.MONTH_SHORT_YEAR
|
|
209
209
|
)
|
|
210
210
|
) })
|
|
211
211
|
] }),
|
|
212
|
-
/* @__PURE__ */ e(C, { bold: !0, variant: "body1", children:
|
|
212
|
+
/* @__PURE__ */ e(C, { bold: !0, variant: "body1", children: I(t.amount, "0,0.00") })
|
|
213
213
|
] }) })
|
|
214
214
|
]
|
|
215
215
|
}
|
|
216
216
|
) });
|
|
217
|
-
},
|
|
217
|
+
}, St = ({ goal: t }) => {
|
|
218
218
|
const { goals: n } = R();
|
|
219
219
|
return /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(
|
|
220
220
|
L,
|
|
@@ -222,60 +222,60 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
222
222
|
disableRipple: !0,
|
|
223
223
|
sx: { ":hover": { backgroundColor: "unset" }, cursor: "default" },
|
|
224
224
|
children: [
|
|
225
|
-
/* @__PURE__ */ e(
|
|
225
|
+
/* @__PURE__ */ e(P, { sx: { alignItems: "center", display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ e(Ye, { color: "success", filled: !0, size: 20 }) }),
|
|
226
226
|
/* @__PURE__ */ e(w, { primaryTypographyProps: { variant: "body1" }, children: /* @__PURE__ */ c(f, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
227
227
|
/* @__PURE__ */ c(f, { children: [
|
|
228
228
|
/* @__PURE__ */ e(C, { bold: !0, variant: "body1", children: t.name }),
|
|
229
229
|
/* @__PURE__ */ e(C, { variant: "caption", children: W(
|
|
230
230
|
n.completed_label,
|
|
231
231
|
be(
|
|
232
|
-
|
|
232
|
+
ee(t.completed_at || 0),
|
|
233
233
|
fe.MONTH_SHORT_YEAR
|
|
234
234
|
)
|
|
235
235
|
) })
|
|
236
236
|
] }),
|
|
237
|
-
/* @__PURE__ */ e(C, { bold: !0, variant: "body1", children:
|
|
237
|
+
/* @__PURE__ */ e(C, { bold: !0, variant: "body1", children: I(t.amount, "0,0.00") })
|
|
238
238
|
] }) })
|
|
239
239
|
]
|
|
240
240
|
}
|
|
241
241
|
) }, t.guid);
|
|
242
|
-
},
|
|
243
|
-
const { goals: n, common: u } = R(), { loadGoals:
|
|
242
|
+
}, Et = ({ trackType: t }) => {
|
|
243
|
+
const { goals: n, common: u } = R(), { loadGoals: d, orderedGoals: _, reorderGoals: i } = N(), m = _.filter((y) => y.track_type === t), p = m.filter(
|
|
244
244
|
(y) => y.track_type === r.SAVINGS_TRACK && !y.has_been_spent || y.track_type !== r.SAVINGS_TRACK && !y.is_complete
|
|
245
|
-
), s =
|
|
245
|
+
), s = m.filter(
|
|
246
246
|
(y) => y.track_type === r.SAVINGS_TRACK && y.has_been_spent || y.track_type !== r.SAVINGS_TRACK && y.is_complete
|
|
247
|
-
), [
|
|
248
|
-
let o = n.manage_saving_goals,
|
|
249
|
-
t === r.DEBT_TRACK ? (o = n.manage_debt_goals,
|
|
247
|
+
), [h, a] = T.useState(!1);
|
|
248
|
+
let o = n.manage_saving_goals, b = n.manage_saving_drawer_title, l = n.manage_saving_title, g = n.manage_saving_description;
|
|
249
|
+
t === r.DEBT_TRACK ? (o = n.manage_debt_goals, b = n.manage_debt_drawer_title, l = n.manage_debt_title, g = n.manage_debt_description) : t === r.RETIREMENT_TRACK && (o = n.manage_retirement_goals, b = n.manage_retirement_drawer_title, l = n.manage_retirement_title, g = n.manage_retirement_description);
|
|
250
250
|
const S = async (y) => {
|
|
251
|
-
const A = [...p], x = A.findIndex((
|
|
252
|
-
let
|
|
253
|
-
|
|
254
|
-
for (let
|
|
255
|
-
A[
|
|
256
|
-
await i(A), await
|
|
251
|
+
const A = [...p], x = A.findIndex((K) => K.guid === y.guid);
|
|
252
|
+
let G = x - 1;
|
|
253
|
+
G < 0 && (G = A.length - 1), A.splice(G, 0, A.splice(x, 1)[0]);
|
|
254
|
+
for (let K = 0; K < A.length; K++)
|
|
255
|
+
A[K].position = K + 1;
|
|
256
|
+
await i(A), await d();
|
|
257
257
|
};
|
|
258
258
|
return /* @__PURE__ */ c(f, { children: [
|
|
259
|
-
/* @__PURE__ */ e(me, { endIcon: /* @__PURE__ */ e(
|
|
259
|
+
/* @__PURE__ */ e(me, { endIcon: /* @__PURE__ */ e(z, {}), onClick: () => a(!0), children: o }),
|
|
260
260
|
/* @__PURE__ */ e(
|
|
261
|
-
|
|
261
|
+
q,
|
|
262
262
|
{
|
|
263
263
|
ariaLabelClose: u.close_aria,
|
|
264
|
-
isOpen:
|
|
264
|
+
isOpen: h,
|
|
265
265
|
onClose: () => a(!1),
|
|
266
|
-
title:
|
|
266
|
+
title: b,
|
|
267
267
|
children: /* @__PURE__ */ c(f, { children: [
|
|
268
268
|
/* @__PURE__ */ c(f, { m: 24, children: [
|
|
269
|
-
/* @__PURE__ */ e(le, { children:
|
|
270
|
-
/* @__PURE__ */ e(
|
|
269
|
+
/* @__PURE__ */ e(le, { children: l }),
|
|
270
|
+
/* @__PURE__ */ e(Y, { color: "text.secondary", sx: { textWrap: "wrap" }, variant: "subtitle2", children: g })
|
|
271
271
|
] }),
|
|
272
|
-
/* @__PURE__ */ e(
|
|
272
|
+
/* @__PURE__ */ e(xt, { trackType: t }),
|
|
273
273
|
/* @__PURE__ */ e(C, { bold: !0, sx: { mb: 4, mx: 24, mt: 12 }, variant: "caption", children: n.goal_priority }),
|
|
274
274
|
/* @__PURE__ */ e(O, { sx: { bgcolor: "background.paper" }, children: p.map((y, A) => {
|
|
275
275
|
const x = A >= p.length - 1;
|
|
276
276
|
return /* @__PURE__ */ c(f, { children: [
|
|
277
|
-
/* @__PURE__ */ e(
|
|
278
|
-
/* @__PURE__ */ e(
|
|
277
|
+
/* @__PURE__ */ e(Rt, { goal: y, index: A, onUpClick: S }),
|
|
278
|
+
/* @__PURE__ */ e(v, { variant: x ? "fullWidth" : "inset" })
|
|
279
279
|
] }, `ongoing-${y.guid}`);
|
|
280
280
|
}) }),
|
|
281
281
|
t !== r.RETIREMENT_TRACK && s.length > 0 && /* @__PURE__ */ c(f, { children: [
|
|
@@ -283,8 +283,8 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
283
283
|
/* @__PURE__ */ e(O, { sx: { bgcolor: "background.paper" }, children: s.map((y, A) => {
|
|
284
284
|
const x = A > p.length - 1;
|
|
285
285
|
return /* @__PURE__ */ c(f, { children: [
|
|
286
|
-
/* @__PURE__ */ e(
|
|
287
|
-
/* @__PURE__ */ e(
|
|
286
|
+
/* @__PURE__ */ e(St, { goal: y }),
|
|
287
|
+
/* @__PURE__ */ e(v, { variant: x ? "fullWidth" : "inset" })
|
|
288
288
|
] }, `complete-${y.guid}`);
|
|
289
289
|
}) })
|
|
290
290
|
] })
|
|
@@ -293,21 +293,21 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
293
293
|
)
|
|
294
294
|
] });
|
|
295
295
|
}, ce = D(({ trackType: t, onAddGoals: n }) => {
|
|
296
|
-
const { isMobile: u } = he(), { goals:
|
|
296
|
+
const { isMobile: u } = he(), { goals: d } = R(), { selectedAccountGuids: _ } = _e(), { orderedGoals: i, setSelectedGoal: m } = N(), p = i.filter(
|
|
297
297
|
(o) => o.track_type === t && (o.track_type !== r.RETIREMENT_TRACK && _.includes(o.account_guid) || o.track_type === r.RETIREMENT_TRACK)
|
|
298
298
|
), s = p.filter(
|
|
299
299
|
(o) => o.track_type === r.SAVINGS_TRACK && !o.has_been_spent || o.track_type !== r.SAVINGS_TRACK && !o.is_complete
|
|
300
|
-
),
|
|
300
|
+
), h = p.filter(
|
|
301
301
|
(o) => o.track_type === r.SAVINGS_TRACK && o.has_been_spent || o.track_type !== r.SAVINGS_TRACK && o.is_complete
|
|
302
|
-
), a = t === r.DEBT_TRACK ?
|
|
302
|
+
), a = t === r.DEBT_TRACK ? d.zero_state_complete_debt : d.zero_state_complete_savings;
|
|
303
303
|
return /* @__PURE__ */ c(f, { mt: 16, mx: u ? 24 : 0, children: [
|
|
304
304
|
/* @__PURE__ */ c(f, { alignItems: "center", direction: "row", justifyContent: "space-between", mb: 8, children: [
|
|
305
|
-
/* @__PURE__ */ e(le, { color: "text.secondary", variant: "body2", children:
|
|
306
|
-
/* @__PURE__ */ e(
|
|
305
|
+
/* @__PURE__ */ e(le, { color: "text.secondary", variant: "body2", children: d.ongoing_title }),
|
|
306
|
+
/* @__PURE__ */ e(Et, { trackType: t })
|
|
307
307
|
] }),
|
|
308
|
-
s.length > 0 ? /* @__PURE__ */ e(ye, { container: !0, spacing: 24, children: s.map((o,
|
|
308
|
+
s.length > 0 ? /* @__PURE__ */ e(ye, { container: !0, spacing: 24, children: s.map((o, b, l) => (
|
|
309
309
|
// Goal should be full width in mobile or if it's the first goal (unless there are 2)
|
|
310
|
-
/* @__PURE__ */ e(ye, { xs: u ||
|
|
310
|
+
/* @__PURE__ */ e(ye, { xs: u || b === 0 && l.length !== 2 ? 12 : 6, children: /* @__PURE__ */ e(Oe, { goal: o, onClick: () => m(o) }, o.guid) }, b)
|
|
311
311
|
)) }) : /* @__PURE__ */ c(
|
|
312
312
|
f,
|
|
313
313
|
{
|
|
@@ -319,7 +319,7 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
319
319
|
py: 18,
|
|
320
320
|
children: [
|
|
321
321
|
/* @__PURE__ */ e(
|
|
322
|
-
|
|
322
|
+
Y,
|
|
323
323
|
{
|
|
324
324
|
sx: (o) => ({
|
|
325
325
|
color: "text.secondary",
|
|
@@ -329,17 +329,17 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
329
329
|
width: { sm: 381 }
|
|
330
330
|
}),
|
|
331
331
|
variant: "body2",
|
|
332
|
-
children:
|
|
332
|
+
children: Qe(t, d)
|
|
333
333
|
}
|
|
334
334
|
),
|
|
335
|
-
/* @__PURE__ */ e(me, { onClick: n, sx: { mt: 16, width: { sm: 224 } }, variant: "contained", children:
|
|
335
|
+
/* @__PURE__ */ e(me, { onClick: n, sx: { mt: 16, width: { sm: 224 } }, variant: "contained", children: d.add_goals_button })
|
|
336
336
|
]
|
|
337
337
|
}
|
|
338
338
|
),
|
|
339
339
|
t !== r.RETIREMENT_TRACK && /* @__PURE__ */ c(f, { gap: 16, mt: 48, children: [
|
|
340
|
-
/* @__PURE__ */ e(le, { color: "text.secondary", variant: "body2", children:
|
|
341
|
-
|
|
342
|
-
|
|
340
|
+
/* @__PURE__ */ e(le, { color: "text.secondary", variant: "body2", children: d.complete_title }),
|
|
341
|
+
h.length === 0 && /* @__PURE__ */ e(f, { alignItems: "center", bgcolor: "background.default", borderRadius: 2, py: 18, children: /* @__PURE__ */ e(
|
|
342
|
+
Y,
|
|
343
343
|
{
|
|
344
344
|
sx: (o) => ({
|
|
345
345
|
color: "text.secondary",
|
|
@@ -352,73 +352,73 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
352
352
|
children: a
|
|
353
353
|
}
|
|
354
354
|
) }),
|
|
355
|
-
|
|
355
|
+
h.map((o) => /* @__PURE__ */ e(Ce, { elevation: 2, children: /* @__PURE__ */ e(xe, { onClick: () => m(o), children: /* @__PURE__ */ e(Re, { sx: { ":last-child": { pb: 16 } }, children: /* @__PURE__ */ c(f, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
356
356
|
/* @__PURE__ */ c(f, { alignItems: "center", direction: "row", gap: 6, children: [
|
|
357
|
-
/* @__PURE__ */ e(
|
|
357
|
+
/* @__PURE__ */ e($e, { color: "success", fill: !0, name: "check_circle", size: 20 }),
|
|
358
358
|
/* @__PURE__ */ e(C, { color: "text.secondary", variant: "body1", children: o.name })
|
|
359
359
|
] }),
|
|
360
|
-
/* @__PURE__ */ e(C, { bold: !0, variant: "body1", children:
|
|
360
|
+
/* @__PURE__ */ e(C, { bold: !0, variant: "body1", children: I(o.amount, "0,0.00") })
|
|
361
361
|
] }) }) }) }, o.guid))
|
|
362
362
|
] })
|
|
363
363
|
] });
|
|
364
|
-
}),
|
|
365
|
-
const { goals: u } = R(), { bgcolor:
|
|
364
|
+
}), vt = ({ goalType: t, onClick: n }) => {
|
|
365
|
+
const { goals: u } = R(), { bgcolor: d, icon: _, label: i, description: m, subTypes: p, type: s } = t, [h, a] = T.useState(!1), o = p.length > 0;
|
|
366
366
|
return /* @__PURE__ */ e(f, { children: /* @__PURE__ */ c(O, { sx: { bgcolor: "background.paper" }, children: [
|
|
367
367
|
/* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(
|
|
368
368
|
L,
|
|
369
369
|
{
|
|
370
|
-
onClick: o ? () => a(!
|
|
370
|
+
onClick: o ? () => a(!h) : () => n(
|
|
371
371
|
s === r.RETIREMENT_TRACK ? u.retirement : "",
|
|
372
|
-
s === r.RETIREMENT_TRACK ?
|
|
372
|
+
s === r.RETIREMENT_TRACK ? U.RETIREMENT : U.OTHER,
|
|
373
373
|
s
|
|
374
374
|
),
|
|
375
375
|
children: [
|
|
376
|
-
/* @__PURE__ */ e(
|
|
377
|
-
/* @__PURE__ */ e(w, { primary: i, secondary:
|
|
378
|
-
!o && /* @__PURE__ */ e(
|
|
379
|
-
o && (
|
|
376
|
+
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(te, { sx: { bgcolor: d }, variant: "rounded", children: /* @__PURE__ */ e(ge, { name: _, sx: { color: "grey.900" } }) }) }),
|
|
377
|
+
/* @__PURE__ */ e(w, { primary: i, secondary: m, sx: { mr: 24 } }),
|
|
378
|
+
!o && /* @__PURE__ */ e(z, {}),
|
|
379
|
+
o && (h ? /* @__PURE__ */ e(Ze, {}) : /* @__PURE__ */ e(qe, {}))
|
|
380
380
|
]
|
|
381
381
|
}
|
|
382
382
|
) }),
|
|
383
|
-
/* @__PURE__ */ e(
|
|
384
|
-
o && /* @__PURE__ */ e(
|
|
385
|
-
/* @__PURE__ */ e(
|
|
383
|
+
/* @__PURE__ */ e(v, { variant: "inset" }),
|
|
384
|
+
o && /* @__PURE__ */ e(nt, { in: h, children: /* @__PURE__ */ e(O, { sx: { bgcolor: "background.default" }, children: p.map((b, l) => /* @__PURE__ */ e(k, { sx: { pl: 48 }, children: /* @__PURE__ */ c(L, { onClick: () => n(b.label, b.metaType, s), children: [
|
|
385
|
+
/* @__PURE__ */ e(ot, { sx: { mr: 8 }, children: /* @__PURE__ */ e(ge, { name: b.icon }) }),
|
|
386
386
|
/* @__PURE__ */ e(
|
|
387
387
|
w,
|
|
388
388
|
{
|
|
389
|
-
primary:
|
|
389
|
+
primary: b.label,
|
|
390
390
|
primaryTypographyProps: { variant: "body1" }
|
|
391
391
|
}
|
|
392
392
|
),
|
|
393
|
-
/* @__PURE__ */ e(
|
|
394
|
-
] }) },
|
|
393
|
+
/* @__PURE__ */ e(z, {})
|
|
394
|
+
] }) }, l)) }) })
|
|
395
395
|
] }) });
|
|
396
396
|
}, We = ({
|
|
397
397
|
accounts: t,
|
|
398
398
|
isOpen: n,
|
|
399
399
|
onClose: u,
|
|
400
|
-
onSave:
|
|
400
|
+
onSave: d,
|
|
401
401
|
title: _
|
|
402
402
|
}) => {
|
|
403
|
-
const { goals: i, common:
|
|
404
|
-
const
|
|
405
|
-
|
|
403
|
+
const { goals: i, common: m } = R(), { config: p } = pe(), [s, h] = T.useState([]), a = (o) => {
|
|
404
|
+
const b = s.findIndex((g) => g.guid === o.guid), l = [...s];
|
|
405
|
+
b >= 0 ? l.splice(b, 1) : l.push(o), h(l);
|
|
406
406
|
};
|
|
407
407
|
return /* @__PURE__ */ c(
|
|
408
|
-
|
|
408
|
+
q,
|
|
409
409
|
{
|
|
410
|
-
ariaLabelClose:
|
|
410
|
+
ariaLabelClose: m.close_aria,
|
|
411
411
|
isOpen: n,
|
|
412
412
|
onClose: u,
|
|
413
|
-
onPrimaryAction: () =>
|
|
413
|
+
onPrimaryAction: () => d(s),
|
|
414
414
|
title: _,
|
|
415
415
|
children: [
|
|
416
416
|
/* @__PURE__ */ c(O, { sx: { bgcolor: "background.white" }, children: [
|
|
417
|
-
/* @__PURE__ */ e(
|
|
418
|
-
t.map((o,
|
|
417
|
+
/* @__PURE__ */ e(v, { variant: "fullWidth" }),
|
|
418
|
+
t.map((o, b) => /* @__PURE__ */ c(T.Fragment, { children: [
|
|
419
419
|
/* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(L, { onClick: () => a(o), children: [
|
|
420
|
-
/* @__PURE__ */ e(
|
|
421
|
-
|
|
420
|
+
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
|
|
421
|
+
X,
|
|
422
422
|
{
|
|
423
423
|
alt: o?.name || "",
|
|
424
424
|
institutionGuid: o?.institution_guid || ""
|
|
@@ -430,12 +430,12 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
430
430
|
primary: De(o, {
|
|
431
431
|
allowNickname: p?.show_account_nicknames_in_master
|
|
432
432
|
}),
|
|
433
|
-
secondary:
|
|
433
|
+
secondary: I(o.balance || 0, "0,0.00")
|
|
434
434
|
}
|
|
435
435
|
),
|
|
436
|
-
/* @__PURE__ */ e(
|
|
436
|
+
/* @__PURE__ */ e(at, { checked: s.some((l) => l.guid === o.guid) })
|
|
437
437
|
] }) }),
|
|
438
|
-
/* @__PURE__ */ e(
|
|
438
|
+
/* @__PURE__ */ e(v, { variant: b < t.length - 1 ? "inset" : "fullWidth" })
|
|
439
439
|
] }, o.guid))
|
|
440
440
|
] }),
|
|
441
441
|
p.show_connections_widget_in_master && /* @__PURE__ */ e(
|
|
@@ -449,21 +449,21 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
449
449
|
]
|
|
450
450
|
}
|
|
451
451
|
);
|
|
452
|
-
},
|
|
453
|
-
const { goals: n } = R(), { addGoal: u, debtGoals:
|
|
454
|
-
S === r.DEBT_TRACK ?
|
|
452
|
+
}, It = ({ onClose: t }) => {
|
|
453
|
+
const { goals: n } = R(), { addGoal: u, debtGoals: d, setAlert: _, setSelectedGoal: i } = N(), { config: m } = pe(), { visibleDebtAccounts: p } = j(), [s, h] = T.useState(!1), a = Xe(n), o = (l, g, S) => {
|
|
454
|
+
S === r.DEBT_TRACK ? h(!0) : i({
|
|
455
455
|
amount: 0,
|
|
456
456
|
current_amount: 0,
|
|
457
457
|
goal_type: de.SAVE_AMOUNT,
|
|
458
458
|
initial_amount: 0,
|
|
459
459
|
meta_type: g,
|
|
460
|
-
name:
|
|
460
|
+
name: l,
|
|
461
461
|
track_type: S
|
|
462
462
|
});
|
|
463
|
-
},
|
|
464
|
-
for (const g of
|
|
465
|
-
let S =
|
|
466
|
-
g.account_type === Ae.LOAN ? S =
|
|
463
|
+
}, b = async (l) => {
|
|
464
|
+
for (const g of l) {
|
|
465
|
+
let S = U.CREDIT_CARD;
|
|
466
|
+
g.account_type === Ae.LOAN ? S = U.LOANS : g.account_type === Ae.LINE_OF_CREDIT && (S = U.LINE_OF_CREDIT), await u({
|
|
467
467
|
account_guid: g.guid,
|
|
468
468
|
amount: 0,
|
|
469
469
|
current_amount: 0,
|
|
@@ -473,31 +473,31 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
473
473
|
meta_type: S,
|
|
474
474
|
monthly_payment: g.minimum_payment || 0,
|
|
475
475
|
name: De(g, {
|
|
476
|
-
allowNickname:
|
|
476
|
+
allowNickname: m?.show_account_nicknames_in_master
|
|
477
477
|
}),
|
|
478
478
|
track_type: r.DEBT_TRACK
|
|
479
479
|
}), _(n.alert_goal_added);
|
|
480
480
|
}
|
|
481
|
-
|
|
481
|
+
h(!1), t?.(r.DEBT_TRACK);
|
|
482
482
|
};
|
|
483
483
|
return /* @__PURE__ */ c(f, { children: [
|
|
484
|
-
/* @__PURE__ */ e(O, { sx: { bgcolor: "background.paper" }, children: a.map((
|
|
484
|
+
/* @__PURE__ */ e(O, { sx: { bgcolor: "background.paper" }, children: a.map((l, g) => /* @__PURE__ */ e(vt, { goalType: l, onClick: o }, g)) }),
|
|
485
485
|
/* @__PURE__ */ e(
|
|
486
486
|
We,
|
|
487
487
|
{
|
|
488
|
-
accounts: p.filter((
|
|
488
|
+
accounts: p.filter((l) => !d.find((g) => g.account_guid === l.guid)),
|
|
489
489
|
isOpen: s,
|
|
490
|
-
onClose: () =>
|
|
491
|
-
onSave:
|
|
490
|
+
onClose: () => h(!1),
|
|
491
|
+
onSave: b,
|
|
492
492
|
title: n.select_debt_accounts_title
|
|
493
493
|
}
|
|
494
494
|
)
|
|
495
495
|
] });
|
|
496
496
|
}, Be = ({ account: t }) => {
|
|
497
|
-
const n =
|
|
497
|
+
const n = it(t);
|
|
498
498
|
return /* @__PURE__ */ c(k, { sx: { bgcolor: "background.paper", p: 24 }, children: [
|
|
499
|
-
/* @__PURE__ */ e(
|
|
500
|
-
|
|
499
|
+
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
|
|
500
|
+
X,
|
|
501
501
|
{
|
|
502
502
|
alt: t.name || "",
|
|
503
503
|
institutionGuid: t.institution_guid || ""
|
|
@@ -507,56 +507,56 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
507
507
|
w,
|
|
508
508
|
{
|
|
509
509
|
primary: n,
|
|
510
|
-
secondary:
|
|
510
|
+
secondary: I(t.balance || 0, "0,0.00")
|
|
511
511
|
}
|
|
512
512
|
)
|
|
513
513
|
] });
|
|
514
|
-
},
|
|
515
|
-
const { goals: n } = R(), { setAlert: u, setSelectedGoal:
|
|
516
|
-
const
|
|
517
|
-
t.amount =
|
|
518
|
-
},
|
|
514
|
+
}, Gt = D(({ goal: t }) => {
|
|
515
|
+
const { goals: n } = R(), { setAlert: u, setSelectedGoal: d, updateGoal: _, updateRetirementGoal: i } = N(), [m, p] = T.useState(t.amount), s = !t.guid, h = m < 0 || m > 9999999999e-2, a = t.track_type === r.SAVINGS_TRACK && t.has_been_spent || t.track_type !== r.SAVINGS_TRACK && t.is_complete, o = async () => {
|
|
516
|
+
const l = { ...t, amount: m };
|
|
517
|
+
t.amount = m, s ? d(l) : (t.track_type !== r.RETIREMENT_TRACK ? await _(l) : await i(l), u(n.alert_goal_updated_amount));
|
|
518
|
+
}, b = () => {
|
|
519
519
|
setTimeout(() => {
|
|
520
520
|
p(t.amount);
|
|
521
521
|
}, 250);
|
|
522
522
|
};
|
|
523
523
|
return /* @__PURE__ */ e(
|
|
524
|
-
|
|
524
|
+
Z,
|
|
525
525
|
{
|
|
526
526
|
isDisabled: a,
|
|
527
|
-
isSaveDisabled:
|
|
527
|
+
isSaveDisabled: h,
|
|
528
528
|
label: n.details_amount_to_save,
|
|
529
|
-
onCancel:
|
|
529
|
+
onCancel: b,
|
|
530
530
|
onSave: o,
|
|
531
531
|
primaryText: n.details_amount_to_save,
|
|
532
|
-
secondaryText:
|
|
532
|
+
secondaryText: I(t.amount, "0,0"),
|
|
533
533
|
zeroStateText: s && t.amount === 0 ? n.add_amount : void 0,
|
|
534
534
|
children: /* @__PURE__ */ e(
|
|
535
535
|
we,
|
|
536
536
|
{
|
|
537
|
-
amount:
|
|
537
|
+
amount: m,
|
|
538
538
|
autoFocus: !0,
|
|
539
|
-
error:
|
|
539
|
+
error: h,
|
|
540
540
|
fullWidth: !0,
|
|
541
541
|
minAmount: 0,
|
|
542
|
-
setAmount: (
|
|
542
|
+
setAmount: (l) => p(isNaN(Number(l)) ? m : Number(l)),
|
|
543
543
|
sx: { ".MuiTypography-body1": { p: 0 } }
|
|
544
544
|
}
|
|
545
545
|
)
|
|
546
546
|
}
|
|
547
547
|
);
|
|
548
|
-
}),
|
|
549
|
-
const { visibleCheckingAccounts: n, visibleSavingsAccounts: u } =
|
|
550
|
-
const S = { ...t, account_guid: g, current_amount:
|
|
551
|
-
|
|
548
|
+
}), Nt = ({ goal: t }) => {
|
|
549
|
+
const { visibleCheckingAccounts: n, visibleSavingsAccounts: u } = j(), { accounts: d, goals: _ } = R(), { config: i } = pe(), { setAlert: m, setSelectedGoal: p, updateGoal: s } = N(), h = !t.guid, [a, o] = T.useState(!1), b = async ({ balance: l, guid: g }) => {
|
|
550
|
+
const S = { ...t, account_guid: g, current_amount: l || 0 };
|
|
551
|
+
h ? p(S) : (await s(S), m(_.alert_account_changed)), o(!1);
|
|
552
552
|
};
|
|
553
553
|
return /* @__PURE__ */ c(f, { children: [
|
|
554
|
-
|
|
554
|
+
h && !t.account_guid ? /* @__PURE__ */ e(k, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ c(L, { onClick: () => o(!0), children: [
|
|
555
555
|
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ c(f, { alignItems: "center", color: "primary.main", direction: "row", gap: 8, children: [
|
|
556
556
|
/* @__PURE__ */ e(Ie, { filled: !0 }),
|
|
557
557
|
_.details_add_account
|
|
558
558
|
] }) }),
|
|
559
|
-
/* @__PURE__ */ e(
|
|
559
|
+
/* @__PURE__ */ e(z, { color: "primary" })
|
|
560
560
|
] }) }) : /* @__PURE__ */ c(f, { sx: { gap: 8, my: 24, mx: 24 }, children: [
|
|
561
561
|
/* @__PURE__ */ e(me, { onClick: () => o(!0), variant: "text", children: _.details_change_account }),
|
|
562
562
|
/* @__PURE__ */ e(
|
|
@@ -569,43 +569,43 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
569
569
|
}
|
|
570
570
|
)
|
|
571
571
|
] }),
|
|
572
|
-
/* @__PURE__ */ e(
|
|
573
|
-
n.length > 0 && /* @__PURE__ */ e(C, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children:
|
|
574
|
-
/* @__PURE__ */ e(O, { sx: { bgcolor: "background.paper" }, children: n.map((
|
|
575
|
-
/* @__PURE__ */ e(
|
|
576
|
-
|
|
572
|
+
/* @__PURE__ */ e(q, { isOpen: a, onClose: () => o(!1), title: _.details_change_account, children: /* @__PURE__ */ c(f, { children: [
|
|
573
|
+
n.length > 0 && /* @__PURE__ */ e(C, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: d.account_types[1] }),
|
|
574
|
+
/* @__PURE__ */ e(O, { sx: { bgcolor: "background.paper" }, children: n.map((l) => /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(L, { onClick: () => b(l), children: [
|
|
575
|
+
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
|
|
576
|
+
X,
|
|
577
577
|
{
|
|
578
|
-
alt:
|
|
579
|
-
institutionGuid:
|
|
578
|
+
alt: l?.name || "",
|
|
579
|
+
institutionGuid: l?.institution_guid || ""
|
|
580
580
|
}
|
|
581
581
|
) }),
|
|
582
582
|
/* @__PURE__ */ e(
|
|
583
583
|
w,
|
|
584
584
|
{
|
|
585
|
-
primary:
|
|
586
|
-
secondary:
|
|
585
|
+
primary: l?.name || l?.feed_name,
|
|
586
|
+
secondary: I(l?.balance || 0, "0,0.00")
|
|
587
587
|
}
|
|
588
588
|
),
|
|
589
|
-
/* @__PURE__ */ e(
|
|
590
|
-
] }) },
|
|
591
|
-
u.length > 0 && /* @__PURE__ */ e(C, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children:
|
|
592
|
-
/* @__PURE__ */ e(O, { sx: { bgcolor: "background.paper" }, children: u.map((
|
|
593
|
-
/* @__PURE__ */ e(
|
|
594
|
-
|
|
589
|
+
/* @__PURE__ */ e(z, {})
|
|
590
|
+
] }) }, l.guid)) }),
|
|
591
|
+
u.length > 0 && /* @__PURE__ */ e(C, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: d.account_types[2] }),
|
|
592
|
+
/* @__PURE__ */ e(O, { sx: { bgcolor: "background.paper" }, children: u.map((l) => /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(L, { onClick: () => b(l), children: [
|
|
593
|
+
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
|
|
594
|
+
X,
|
|
595
595
|
{
|
|
596
|
-
alt:
|
|
597
|
-
institutionGuid:
|
|
596
|
+
alt: l?.name || "",
|
|
597
|
+
institutionGuid: l?.institution_guid || ""
|
|
598
598
|
}
|
|
599
599
|
) }),
|
|
600
600
|
/* @__PURE__ */ e(
|
|
601
601
|
w,
|
|
602
602
|
{
|
|
603
|
-
primary:
|
|
604
|
-
secondary:
|
|
603
|
+
primary: l?.name || l?.feed_name,
|
|
604
|
+
secondary: I(l?.balance || 0, "0,0.00")
|
|
605
605
|
}
|
|
606
606
|
),
|
|
607
|
-
/* @__PURE__ */ e(
|
|
608
|
-
] }) },
|
|
607
|
+
/* @__PURE__ */ e(z, {})
|
|
608
|
+
] }) }, l.guid)) }),
|
|
609
609
|
i.show_connections_widget_in_master && /* @__PURE__ */ e(
|
|
610
610
|
Ge,
|
|
611
611
|
{
|
|
@@ -616,23 +616,23 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
616
616
|
)
|
|
617
617
|
] }) })
|
|
618
618
|
] });
|
|
619
|
-
},
|
|
620
|
-
const { goals: n } = R(), { setAlert: u, setSelectedGoal:
|
|
619
|
+
}, kt = D(({ goal: t }) => {
|
|
620
|
+
const { goals: n } = R(), { setAlert: u, setSelectedGoal: d, updateGoal: _ } = N(), [i, m] = T.useState(t.name), p = !t.guid, s = t.track_type === r.SAVINGS_TRACK && t.has_been_spent || t.track_type !== r.SAVINGS_TRACK && t.is_complete, h = async () => {
|
|
621
621
|
const o = { ...t, name: i };
|
|
622
|
-
t.name = i, p ?
|
|
622
|
+
t.name = i, p ? d(o) : (await _(o), u(n.alert_goal_updated_name));
|
|
623
623
|
}, a = () => {
|
|
624
624
|
setTimeout(() => {
|
|
625
|
-
|
|
625
|
+
m(t.name);
|
|
626
626
|
}, 250);
|
|
627
627
|
};
|
|
628
628
|
return /* @__PURE__ */ e(
|
|
629
|
-
|
|
629
|
+
Z,
|
|
630
630
|
{
|
|
631
631
|
isDisabled: s,
|
|
632
632
|
isSaveDisabled: !i,
|
|
633
633
|
label: n.details_goal_name,
|
|
634
634
|
onCancel: a,
|
|
635
|
-
onSave:
|
|
635
|
+
onSave: h,
|
|
636
636
|
primaryText: n.details_goal_name,
|
|
637
637
|
secondaryText: t.name,
|
|
638
638
|
children: /* @__PURE__ */ e(
|
|
@@ -641,30 +641,30 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
641
641
|
error: !i,
|
|
642
642
|
fullWidth: !0,
|
|
643
643
|
label: n.details_goal_name,
|
|
644
|
-
onChange: (o) =>
|
|
644
|
+
onChange: (o) => m(o.target.value),
|
|
645
645
|
value: i
|
|
646
646
|
}
|
|
647
647
|
)
|
|
648
648
|
}
|
|
649
649
|
);
|
|
650
|
-
}),
|
|
651
|
-
const { goals: n } = R(), { setAlert: u, setSelectedGoal:
|
|
650
|
+
}), wt = ({ goal: t }) => {
|
|
651
|
+
const { goals: n } = R(), { setAlert: u, setSelectedGoal: d, updateRetirementGoal: _ } = N(), [i, m] = T.useState(t.retirement_age || 65), p = !t.guid, s = async () => {
|
|
652
652
|
if (!isNaN(i)) {
|
|
653
653
|
const o = { ...t, retirement_age: i };
|
|
654
|
-
t.retirement_age = i, p ?
|
|
654
|
+
t.retirement_age = i, p ? d(o) : (await _(o), u(n.alert_goal_updated_retirement_age));
|
|
655
655
|
}
|
|
656
|
-
},
|
|
656
|
+
}, h = () => {
|
|
657
657
|
setTimeout(() => {
|
|
658
|
-
|
|
658
|
+
m(t.retirement_age || 65);
|
|
659
659
|
}, 250);
|
|
660
660
|
}, a = !i || isNaN(i) || i < 20 || i >= 100;
|
|
661
661
|
return /* @__PURE__ */ e(
|
|
662
|
-
|
|
662
|
+
Z,
|
|
663
663
|
{
|
|
664
664
|
isDisabled: t.is_complete,
|
|
665
665
|
isSaveDisabled: a,
|
|
666
666
|
label: n.details_retirement_age,
|
|
667
|
-
onCancel:
|
|
667
|
+
onCancel: h,
|
|
668
668
|
onSave: s,
|
|
669
669
|
primaryText: n.details_retirement_age,
|
|
670
670
|
secondaryText: `${t.retirement_age}`,
|
|
@@ -675,31 +675,31 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
675
675
|
error: a,
|
|
676
676
|
fullWidth: !0,
|
|
677
677
|
label: n.details_retirement_age,
|
|
678
|
-
onChange: (o) =>
|
|
678
|
+
onChange: (o) => m(Number(o.target.value)),
|
|
679
679
|
value: isNaN(i) ? "" : i
|
|
680
680
|
}
|
|
681
681
|
)
|
|
682
682
|
}
|
|
683
683
|
);
|
|
684
|
-
},
|
|
685
|
-
const { goals: n } = R(), { user: u, updateUser:
|
|
686
|
-
i &&
|
|
684
|
+
}, Dt = D(({ goal: t }) => {
|
|
685
|
+
const { goals: n } = R(), { user: u, updateUser: d } = Ne(), { setAlert: _ } = N(), [i, m] = T.useState(ee(u.birthday ?? 0)), [p, s] = T.useState(null), h = t.is_complete, a = async () => {
|
|
686
|
+
i && dt(i) && (await d({ ...u, birthday: lt(i) }), _(n.alert_goal_updated_birthday));
|
|
687
687
|
};
|
|
688
688
|
return /* @__PURE__ */ e(
|
|
689
|
-
|
|
689
|
+
Z,
|
|
690
690
|
{
|
|
691
|
-
isDisabled:
|
|
691
|
+
isDisabled: h,
|
|
692
692
|
isSaveDisabled: !!p,
|
|
693
693
|
label: n.details_birthday,
|
|
694
694
|
onSave: a,
|
|
695
695
|
primaryText: n.details_birthday,
|
|
696
|
-
secondaryText: `${be(
|
|
696
|
+
secondaryText: `${be(ee(u.birthday ?? 0), fe.MONTH_DAY_YEAR)}`,
|
|
697
697
|
zeroStateText: !t.guid && !u.birthday ? n.add_birthday : void 0,
|
|
698
|
-
children: /* @__PURE__ */ e(
|
|
699
|
-
|
|
698
|
+
children: /* @__PURE__ */ e(_t, { dateAdapter: mt, children: /* @__PURE__ */ e(
|
|
699
|
+
ut,
|
|
700
700
|
{
|
|
701
701
|
label: n.details_birthday,
|
|
702
|
-
onChange:
|
|
702
|
+
onChange: m,
|
|
703
703
|
onError: (o) => s(o),
|
|
704
704
|
sx: { width: "100%" },
|
|
705
705
|
value: i
|
|
@@ -707,17 +707,17 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
707
707
|
) })
|
|
708
708
|
}
|
|
709
709
|
);
|
|
710
|
-
}),
|
|
711
|
-
const { goals: n } = R(), { visibleRetirementAccounts: u } =
|
|
712
|
-
addRetirementGoalAccount:
|
|
710
|
+
}), Kt = ({ goal: t }) => {
|
|
711
|
+
const { goals: n } = R(), { visibleRetirementAccounts: u } = j(), {
|
|
712
|
+
addRetirementGoalAccount: d,
|
|
713
713
|
newRetirementGoalAccounts: _,
|
|
714
714
|
retirementGoalAccounts: i,
|
|
715
|
-
selectedGoal:
|
|
715
|
+
selectedGoal: m,
|
|
716
716
|
setAlert: p,
|
|
717
717
|
setNewRetirementGoalAccounts: s,
|
|
718
|
-
setSelectedGoal:
|
|
719
|
-
} =
|
|
720
|
-
(y) =>
|
|
718
|
+
setSelectedGoal: h
|
|
719
|
+
} = N(), [a, o] = T.useState(!1), b = !t.guid, l = u.filter(
|
|
720
|
+
(y) => b ? _.find((A) => A.account_guid === y.guid) : i.find((A) => A.account_guid === y.guid)
|
|
721
721
|
), g = u.filter(
|
|
722
722
|
(y) => !i.find((A) => A.account_guid === y.guid)
|
|
723
723
|
), S = async (y) => {
|
|
@@ -725,27 +725,27 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
725
725
|
account_guid: x.guid,
|
|
726
726
|
retirement_goal_guid: t.guid
|
|
727
727
|
}));
|
|
728
|
-
if (
|
|
728
|
+
if (b)
|
|
729
729
|
s(A);
|
|
730
730
|
else
|
|
731
731
|
for (const x of A)
|
|
732
|
-
await
|
|
733
|
-
|
|
734
|
-
...
|
|
735
|
-
current_amount: y.reduce((x,
|
|
732
|
+
await d(x), p(n.alert_account_added);
|
|
733
|
+
h({
|
|
734
|
+
...m,
|
|
735
|
+
current_amount: y.reduce((x, G) => x + (G.balance || 0), 0)
|
|
736
736
|
}), o(!1);
|
|
737
737
|
};
|
|
738
738
|
return /* @__PURE__ */ c(f, { children: [
|
|
739
|
-
|
|
739
|
+
l.map((y) => /* @__PURE__ */ c(f, { children: [
|
|
740
740
|
/* @__PURE__ */ e(Be, { account: y }),
|
|
741
|
-
/* @__PURE__ */ e(
|
|
741
|
+
/* @__PURE__ */ e(v, {})
|
|
742
742
|
] }, y.guid)),
|
|
743
743
|
/* @__PURE__ */ e(k, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ c(L, { onClick: () => o(!0), children: [
|
|
744
744
|
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ c(f, { alignItems: "center", color: "primary.main", direction: "row", gap: 8, children: [
|
|
745
745
|
/* @__PURE__ */ e(Ie, { filled: !0 }),
|
|
746
746
|
n.details_add_account
|
|
747
747
|
] }) }),
|
|
748
|
-
/* @__PURE__ */ e(
|
|
748
|
+
/* @__PURE__ */ e(z, { color: "primary" })
|
|
749
749
|
] }) }),
|
|
750
750
|
/* @__PURE__ */ e(
|
|
751
751
|
We,
|
|
@@ -758,9 +758,9 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
758
758
|
}
|
|
759
759
|
)
|
|
760
760
|
] });
|
|
761
|
-
},
|
|
762
|
-
const { goals: n } = R(), { visibleAccounts: u } =
|
|
763
|
-
() => u.find((
|
|
761
|
+
}, Mt = D(({ goal: t }) => {
|
|
762
|
+
const { goals: n } = R(), { visibleAccounts: u } = j(), d = T.useMemo(
|
|
763
|
+
() => u.find((m) => m.guid === t.account_guid),
|
|
764
764
|
[u, t]
|
|
765
765
|
), _ = t.track_type;
|
|
766
766
|
let i = n.details_save_title;
|
|
@@ -771,7 +771,7 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
771
771
|
/* @__PURE__ */ e(C, { color: "text.secondary", sx: { mb: 4, mt: 24 }, variant: "caption", children: n.details_title })
|
|
772
772
|
] }),
|
|
773
773
|
/* @__PURE__ */ c(O, { sx: { bgcolor: "background.paper" }, children: [
|
|
774
|
-
_ !== r.RETIREMENT_TRACK ? /* @__PURE__ */ e(
|
|
774
|
+
_ !== r.RETIREMENT_TRACK ? /* @__PURE__ */ e(kt, { goal: t }) : /* @__PURE__ */ e(k, { sx: { px: 24 }, children: /* @__PURE__ */ e(
|
|
775
775
|
w,
|
|
776
776
|
{
|
|
777
777
|
primary: /* @__PURE__ */ c(f, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
@@ -781,153 +781,154 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
781
781
|
primaryTypographyProps: { variant: "body1" }
|
|
782
782
|
}
|
|
783
783
|
) }),
|
|
784
|
-
/* @__PURE__ */ e(
|
|
785
|
-
(_ === r.SAVINGS_TRACK || _ === r.RETIREMENT_TRACK) && /* @__PURE__ */ c(
|
|
786
|
-
/* @__PURE__ */ e(
|
|
787
|
-
/* @__PURE__ */ e(
|
|
784
|
+
/* @__PURE__ */ e(v, { sx: { ml: 24 } }),
|
|
785
|
+
(_ === r.SAVINGS_TRACK || _ === r.RETIREMENT_TRACK) && /* @__PURE__ */ c(F, { children: [
|
|
786
|
+
/* @__PURE__ */ e(Gt, { goal: t }),
|
|
787
|
+
/* @__PURE__ */ e(v, { sx: { ml: _ === r.RETIREMENT_TRACK ? 24 : 0 } })
|
|
788
788
|
] }),
|
|
789
|
-
t.track_type === r.DEBT_TRACK && /* @__PURE__ */ c(
|
|
790
|
-
/* @__PURE__ */ e(it, { goal: t }),
|
|
791
|
-
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
789
|
+
t.track_type === r.DEBT_TRACK && /* @__PURE__ */ c(F, { children: [
|
|
792
790
|
/* @__PURE__ */ e(rt, { goal: t }),
|
|
793
|
-
/* @__PURE__ */ e(
|
|
791
|
+
/* @__PURE__ */ e(v, { sx: { ml: 24 } }),
|
|
794
792
|
/* @__PURE__ */ e(st, { goal: t }),
|
|
795
|
-
/* @__PURE__ */ e(
|
|
793
|
+
/* @__PURE__ */ e(v, { sx: { ml: 24 } }),
|
|
794
|
+
/* @__PURE__ */ e(ct, { goal: t }),
|
|
795
|
+
/* @__PURE__ */ e(v, { variant: "fullWidth" })
|
|
796
796
|
] }),
|
|
797
|
-
t.track_type === r.RETIREMENT_TRACK && /* @__PURE__ */ c(
|
|
798
|
-
/* @__PURE__ */ e(kt, { goal: t }),
|
|
799
|
-
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
797
|
+
t.track_type === r.RETIREMENT_TRACK && /* @__PURE__ */ c(F, { children: [
|
|
800
798
|
/* @__PURE__ */ e(wt, { goal: t }),
|
|
801
|
-
/* @__PURE__ */ e(
|
|
799
|
+
/* @__PURE__ */ e(v, { sx: { ml: 24 } }),
|
|
800
|
+
/* @__PURE__ */ e(Dt, { goal: t }),
|
|
801
|
+
/* @__PURE__ */ e(v, { variant: "fullWidth" })
|
|
802
802
|
] })
|
|
803
803
|
] }),
|
|
804
804
|
/* @__PURE__ */ e(C, { color: "text.secondary", sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: t.track_type === r.RETIREMENT_TRACK ? n.details_accounts : n.details_account }),
|
|
805
|
-
t.track_type !== r.RETIREMENT_TRACK &&
|
|
806
|
-
/* @__PURE__ */ e(Be, { account:
|
|
807
|
-
/* @__PURE__ */ e(
|
|
805
|
+
t.track_type !== r.RETIREMENT_TRACK && d && /* @__PURE__ */ c(F, { children: [
|
|
806
|
+
/* @__PURE__ */ e(Be, { account: d }),
|
|
807
|
+
/* @__PURE__ */ e(v, {})
|
|
808
808
|
] }),
|
|
809
|
-
t.track_type === r.RETIREMENT_TRACK && /* @__PURE__ */ c(
|
|
810
|
-
/* @__PURE__ */ e(
|
|
811
|
-
/* @__PURE__ */ e(
|
|
809
|
+
t.track_type === r.RETIREMENT_TRACK && /* @__PURE__ */ c(F, { children: [
|
|
810
|
+
/* @__PURE__ */ e(Kt, { goal: t }),
|
|
811
|
+
/* @__PURE__ */ e(v, {})
|
|
812
812
|
] }),
|
|
813
|
-
t.track_type === r.SAVINGS_TRACK && !t.is_complete && /* @__PURE__ */ e(
|
|
813
|
+
t.track_type === r.SAVINGS_TRACK && !t.is_complete && /* @__PURE__ */ e(Nt, { goal: t })
|
|
814
814
|
] });
|
|
815
|
-
}),
|
|
816
|
-
const { visibleRetirementAccounts: n } =
|
|
815
|
+
}), Lt = D(({ onClose: t }) => {
|
|
816
|
+
const { visibleRetirementAccounts: n } = j(), { goals: u, common: d } = R(), {
|
|
817
817
|
addGoal: _,
|
|
818
818
|
addRetirementGoal: i,
|
|
819
|
-
deleteGoal:
|
|
819
|
+
deleteGoal: m,
|
|
820
820
|
deleteRetirementGoal: p,
|
|
821
821
|
newRetirementGoalAccounts: s,
|
|
822
|
-
retirementGoalAccounts:
|
|
822
|
+
retirementGoalAccounts: h,
|
|
823
823
|
selectedGoal: a,
|
|
824
824
|
setAlert: o,
|
|
825
|
-
setSelectedGoal:
|
|
826
|
-
updateGoal:
|
|
827
|
-
} =
|
|
828
|
-
const
|
|
829
|
-
return n.filter((
|
|
830
|
-
}, [A, n, s,
|
|
825
|
+
setSelectedGoal: b,
|
|
826
|
+
updateGoal: l
|
|
827
|
+
} = N(), { user: g } = Ne(), [S, y] = T.useState(!1), A = !a?.guid, x = a?.track_type === r.SAVINGS_TRACK && a.is_complete && !a.has_been_spent, G = T.useMemo(() => {
|
|
828
|
+
const E = A ? s : h;
|
|
829
|
+
return n.filter((V) => E.some((M) => M.account_guid === V.guid));
|
|
830
|
+
}, [A, n, s, h]), K = T.useMemo(() => {
|
|
831
831
|
if (!a) return !1;
|
|
832
832
|
if (!A && !x) return !0;
|
|
833
|
-
const { account_guid:
|
|
834
|
-
return
|
|
835
|
-
}, [a,
|
|
836
|
-
let
|
|
837
|
-
A ? (
|
|
838
|
-
const
|
|
833
|
+
const { account_guid: E, track_type: V, name: M, amount: J, retirement_age: ie } = a;
|
|
834
|
+
return V === r.SAVINGS_TRACK ? E ? !!M && !!J : !1 : V === r.RETIREMENT_TRACK ? G.length ? !!M && !!J && !!ie && !!g.birthday : !1 : !0;
|
|
835
|
+
}, [a, G, g.birthday]);
|
|
836
|
+
let B = d.delete_button, H = () => y(!0);
|
|
837
|
+
A ? (H = () => ne(), B = d.save_button) : x && (H = () => ae(), B = u.mark_as_complete_button);
|
|
838
|
+
const ne = async () => {
|
|
839
839
|
if (a) {
|
|
840
|
-
const
|
|
841
|
-
|
|
840
|
+
const E = a.track_type;
|
|
841
|
+
E !== r.RETIREMENT_TRACK ? await _(a) : E === r.RETIREMENT_TRACK && await i({ ...a, target_amount: a.amount }), o(u.alert_goal_added), b(void 0), E && t?.(E);
|
|
842
842
|
}
|
|
843
|
+
}, oe = async () => {
|
|
844
|
+
a && (a.track_type !== r.RETIREMENT_TRACK ? await m(a.guid) : a.track_type === r.RETIREMENT_TRACK && await p(a), o(u.alert_goal_deleted), b(void 0));
|
|
843
845
|
}, ae = async () => {
|
|
844
|
-
|
|
845
|
-
}, B = async () => {
|
|
846
|
-
const I = {
|
|
846
|
+
const E = {
|
|
847
847
|
...a,
|
|
848
848
|
has_been_spent: !0
|
|
849
849
|
};
|
|
850
|
-
await
|
|
850
|
+
await l(E), o(u.alert_goal_completed), b(void 0);
|
|
851
851
|
};
|
|
852
852
|
return /* @__PURE__ */ c(f, { children: [
|
|
853
853
|
/* @__PURE__ */ e(
|
|
854
|
-
|
|
854
|
+
q,
|
|
855
855
|
{
|
|
856
|
-
ariaLabelClose:
|
|
856
|
+
ariaLabelClose: d.close_aria,
|
|
857
857
|
hasSecondaryAction: A,
|
|
858
858
|
isOpen: !!a,
|
|
859
|
-
isPrimaryDisabled: !
|
|
860
|
-
onClose: () =>
|
|
861
|
-
onPrimaryAction:
|
|
859
|
+
isPrimaryDisabled: !K,
|
|
860
|
+
onClose: () => b(void 0),
|
|
861
|
+
onPrimaryAction: H,
|
|
862
862
|
primaryColor: A || x ? "primary" : "error",
|
|
863
|
-
primaryText:
|
|
863
|
+
primaryText: B,
|
|
864
864
|
secondaryColor: "primary",
|
|
865
865
|
title: u.goal_details,
|
|
866
|
-
children: a && /* @__PURE__ */ e(
|
|
866
|
+
children: a && /* @__PURE__ */ e(Mt, { goal: a })
|
|
867
867
|
}
|
|
868
868
|
),
|
|
869
869
|
/* @__PURE__ */ e(
|
|
870
|
-
|
|
870
|
+
pt,
|
|
871
871
|
{
|
|
872
|
-
copy: { close_aria:
|
|
872
|
+
copy: { close_aria: d.close_aria, title: u.delete_goal },
|
|
873
873
|
isOpen: S,
|
|
874
874
|
maxWidth: "xs",
|
|
875
875
|
onClose: () => y(!1),
|
|
876
|
-
onPrimaryAction:
|
|
876
|
+
onPrimaryAction: oe,
|
|
877
877
|
primaryColor: "error",
|
|
878
|
-
primaryText:
|
|
878
|
+
primaryText: d.delete_button,
|
|
879
879
|
children: /* @__PURE__ */ e(C, { sx: { textWrap: "wrap" }, variant: "subtitle1", children: W(u.delete_description, a?.name || "") })
|
|
880
880
|
}
|
|
881
881
|
)
|
|
882
882
|
] });
|
|
883
|
-
}),
|
|
884
|
-
const { onEvent:
|
|
883
|
+
}), Hn = D(({ onBackClick: t, onMenuClick: n, sx: u }) => {
|
|
884
|
+
const { onEvent: d } = ke(), { isMobile: _ } = he(), { isAccountDataLoaded: i, loadAccountData: m } = j(), { isInitialized: p } = _e(), { goals: s, common: h } = R(), {
|
|
885
885
|
alert: a,
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
886
|
+
allGoals: o,
|
|
887
|
+
goals: b,
|
|
888
|
+
isAllGoalDataLoaded: l,
|
|
889
|
+
loadGoalData: g,
|
|
890
|
+
monthlyCashFlowProfile: S,
|
|
891
|
+
setAlert: y,
|
|
892
|
+
retirmentGoals: A
|
|
893
|
+
} = N(), [x, G] = T.useState(0), [K, B] = T.useState(!1), H = S?.amount_allocated_for_savings_goals || 0, ne = S?.amount_allocated_for_debt_goals || 0, oe = S?.amount_allocated_for_retirement_goals || 0;
|
|
893
894
|
Me({
|
|
894
895
|
widgetName: "GoalsWidget",
|
|
895
|
-
isLoaded:
|
|
896
|
+
isLoaded: l
|
|
896
897
|
}), T.useEffect(() => {
|
|
897
|
-
i ||
|
|
898
|
+
i || m().finally(), d($.GOALS_VIEW);
|
|
898
899
|
}, []), T.useEffect(() => {
|
|
899
|
-
p &&
|
|
900
|
+
p && g().finally();
|
|
900
901
|
}, [p]);
|
|
901
902
|
const ae = () => {
|
|
902
|
-
|
|
903
|
-
},
|
|
904
|
-
|
|
905
|
-
},
|
|
906
|
-
|
|
903
|
+
d($.GOALS_CLICK_FILTER);
|
|
904
|
+
}, E = () => {
|
|
905
|
+
B(!0), d($.GOALS_CLICK_ADD);
|
|
906
|
+
}, V = (Q) => {
|
|
907
|
+
B(!1), Q === r.SAVINGS_TRACK ? G(0) : Q === r.DEBT_TRACK ? G(1) : Q === r.RETIREMENT_TRACK && G(2);
|
|
907
908
|
}, M = T.useMemo(
|
|
908
|
-
() =>
|
|
909
|
-
[
|
|
909
|
+
() => l && o.length === 0,
|
|
910
|
+
[b, l, A]
|
|
910
911
|
);
|
|
911
|
-
if (!p || !
|
|
912
|
+
if (!p || !l)
|
|
912
913
|
return /* @__PURE__ */ e(Le, {});
|
|
913
|
-
const
|
|
914
|
+
const J = W(
|
|
914
915
|
_ ? s.tab_subtitle_mobile : s.tab_subtitle,
|
|
915
|
-
|
|
916
|
-
), X = W(
|
|
917
|
-
_ ? s.tab_subtitle_mobile : s.tab_subtitle,
|
|
918
|
-
v(Y, "0,0")
|
|
916
|
+
I(H, "0,0")
|
|
919
917
|
), ie = W(
|
|
920
918
|
_ ? s.tab_subtitle_mobile : s.tab_subtitle,
|
|
921
|
-
|
|
919
|
+
I(ne, "0,0")
|
|
920
|
+
), Ve = W(
|
|
921
|
+
_ ? s.tab_subtitle_mobile : s.tab_subtitle,
|
|
922
|
+
I(oe, "0,0")
|
|
922
923
|
);
|
|
923
924
|
return /* @__PURE__ */ c(
|
|
924
|
-
|
|
925
|
+
ht,
|
|
925
926
|
{
|
|
926
927
|
actions: [
|
|
927
928
|
{
|
|
928
929
|
iconName: "add",
|
|
929
930
|
label: s.add_title,
|
|
930
|
-
onClick:
|
|
931
|
+
onClick: E
|
|
931
932
|
}
|
|
932
933
|
],
|
|
933
934
|
onAccountsFilterClick: ae,
|
|
@@ -938,44 +939,44 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
938
939
|
children: [
|
|
939
940
|
/* @__PURE__ */ c(f, { mx: _ ? 0 : 48, my: 24, children: [
|
|
940
941
|
/* @__PURE__ */ c(
|
|
941
|
-
|
|
942
|
+
Fe,
|
|
942
943
|
{
|
|
943
|
-
onChange: (
|
|
944
|
+
onChange: (Q, ze) => G(ze),
|
|
944
945
|
sx: { bgcolor: "background.paper" },
|
|
945
946
|
textColor: "primary",
|
|
946
|
-
value: M ? !1 :
|
|
947
|
+
value: M ? !1 : x,
|
|
947
948
|
variant: "fullWidth",
|
|
948
949
|
children: [
|
|
949
950
|
/* @__PURE__ */ e(
|
|
950
951
|
re,
|
|
951
952
|
{
|
|
952
953
|
disabled: M,
|
|
953
|
-
label: /* @__PURE__ */ e(se, { subtitle:
|
|
954
|
+
label: /* @__PURE__ */ e(se, { subtitle: J, title: s.tab_saving_title })
|
|
954
955
|
}
|
|
955
956
|
),
|
|
956
957
|
/* @__PURE__ */ e(
|
|
957
958
|
re,
|
|
958
959
|
{
|
|
959
960
|
disabled: M,
|
|
960
|
-
label: /* @__PURE__ */ e(se, { subtitle:
|
|
961
|
+
label: /* @__PURE__ */ e(se, { subtitle: ie, title: s.tab_debt_title })
|
|
961
962
|
}
|
|
962
963
|
),
|
|
963
964
|
/* @__PURE__ */ e(
|
|
964
965
|
re,
|
|
965
966
|
{
|
|
966
967
|
disabled: M,
|
|
967
|
-
label: /* @__PURE__ */ e(se, { subtitle:
|
|
968
|
+
label: /* @__PURE__ */ e(se, { subtitle: Ve, title: s.tab_retirement_title })
|
|
968
969
|
}
|
|
969
970
|
)
|
|
970
971
|
]
|
|
971
972
|
}
|
|
972
973
|
),
|
|
973
974
|
M ? /* @__PURE__ */ e(
|
|
974
|
-
|
|
975
|
+
bt,
|
|
975
976
|
{
|
|
976
977
|
header: s.create_goals_header,
|
|
977
978
|
icon: "trophy",
|
|
978
|
-
onClick:
|
|
979
|
+
onClick: E,
|
|
979
980
|
primaryButton: s.add_goals_button,
|
|
980
981
|
subText: s.empty_state_subheader,
|
|
981
982
|
sx: {
|
|
@@ -985,54 +986,54 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
985
986
|
}
|
|
986
987
|
}
|
|
987
988
|
}
|
|
988
|
-
) : /* @__PURE__ */ c(
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
989
|
+
) : /* @__PURE__ */ c(F, { children: [
|
|
990
|
+
x === 0 && /* @__PURE__ */ e(ce, { onAddGoals: E, trackType: r.SAVINGS_TRACK }),
|
|
991
|
+
x === 1 && /* @__PURE__ */ e(ce, { onAddGoals: E, trackType: r.DEBT_TRACK }),
|
|
992
|
+
x === 2 && /* @__PURE__ */ e(ce, { onAddGoals: E, trackType: r.RETIREMENT_TRACK })
|
|
992
993
|
] })
|
|
993
994
|
] }),
|
|
994
|
-
/* @__PURE__ */ e(
|
|
995
|
+
/* @__PURE__ */ e(Lt, { onClose: V }),
|
|
995
996
|
/* @__PURE__ */ e(
|
|
996
|
-
|
|
997
|
+
q,
|
|
997
998
|
{
|
|
998
|
-
ariaLabelClose:
|
|
999
|
+
ariaLabelClose: h.close_aria,
|
|
999
1000
|
isOpen: K,
|
|
1000
|
-
onClose: () =>
|
|
1001
|
+
onClose: () => B(!1),
|
|
1001
1002
|
title: s.add_goal_title,
|
|
1002
|
-
children: /* @__PURE__ */ e(
|
|
1003
|
+
children: /* @__PURE__ */ e(It, { onClose: V })
|
|
1003
1004
|
}
|
|
1004
1005
|
),
|
|
1005
|
-
/* @__PURE__ */ e(
|
|
1006
|
+
/* @__PURE__ */ e(je, { onClose: () => y(""), open: !!a, children: /* @__PURE__ */ e(Pe, { onClose: () => y(""), severity: "success", variant: "filled", children: a }) })
|
|
1006
1007
|
]
|
|
1007
1008
|
}
|
|
1008
1009
|
);
|
|
1009
|
-
}),
|
|
1010
|
-
const { goals: n } = R(), u =
|
|
1011
|
-
backgroundColor:
|
|
1010
|
+
}), Ot = D(({ goal: t }) => {
|
|
1011
|
+
const { goals: n } = R(), u = gt(), {
|
|
1012
|
+
backgroundColor: d,
|
|
1012
1013
|
color: _,
|
|
1013
1014
|
percentage: i,
|
|
1014
|
-
projectedText:
|
|
1015
|
+
projectedText: m
|
|
1015
1016
|
} = ue(n, t), p = Math.round(i * 100);
|
|
1016
1017
|
let s = /* @__PURE__ */ e(Se, {});
|
|
1017
1018
|
return t.track_type === r.DEBT_TRACK ? s = /* @__PURE__ */ e(Ee, {}) : t.track_type === r.RETIREMENT_TRACK && (s = /* @__PURE__ */ e(ve, {})), /* @__PURE__ */ c(f, { alignItems: "center", direction: "row", spacing: 12, sx: { py: 12 }, children: [
|
|
1018
|
-
/* @__PURE__ */ e(
|
|
1019
|
-
/* @__PURE__ */ c(
|
|
1019
|
+
/* @__PURE__ */ e(te, { sx: { bgcolor: d, color: _, height: 32, width: 32 }, variant: "rounded", children: s }),
|
|
1020
|
+
/* @__PURE__ */ c(yt, { sx: { width: "100%" }, children: [
|
|
1020
1021
|
/* @__PURE__ */ e(Te, { fontSize: 15, fontWeight: 600, variant: "body1", children: t.name }),
|
|
1021
|
-
t.projected_to_complete_at && /* @__PURE__ */ e(C, { color: "text.secondary", variant: "caption", children:
|
|
1022
|
+
t.projected_to_complete_at && /* @__PURE__ */ e(C, { color: "text.secondary", variant: "caption", children: m })
|
|
1022
1023
|
] }),
|
|
1023
1024
|
/* @__PURE__ */ e(
|
|
1024
|
-
|
|
1025
|
+
At,
|
|
1025
1026
|
{
|
|
1026
1027
|
backgroundStrokeColor: u.palette.neutral.light,
|
|
1027
1028
|
color: u.palette.primary.main,
|
|
1028
1029
|
percent: p,
|
|
1029
1030
|
size: 40,
|
|
1030
1031
|
strokeWidth: 3,
|
|
1031
|
-
children: /* @__PURE__ */ e(
|
|
1032
|
+
children: /* @__PURE__ */ e(Y, { fontWeight: 700, variant: "caption", children: `${p}%` })
|
|
1032
1033
|
}
|
|
1033
1034
|
)
|
|
1034
1035
|
] });
|
|
1035
|
-
}),
|
|
1036
|
+
}), Wt = ({ header: t, subText: n, sx: u }) => /* @__PURE__ */ c(
|
|
1036
1037
|
f,
|
|
1037
1038
|
{
|
|
1038
1039
|
sx: {
|
|
@@ -1042,10 +1043,10 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
1042
1043
|
...u
|
|
1043
1044
|
},
|
|
1044
1045
|
children: [
|
|
1045
|
-
/* @__PURE__ */ e(
|
|
1046
|
+
/* @__PURE__ */ e(Je, { size: 32 }),
|
|
1046
1047
|
/* @__PURE__ */ e(Te, { fontSize: 15, fontWeight: 600, children: t }),
|
|
1047
1048
|
/* @__PURE__ */ e(
|
|
1048
|
-
|
|
1049
|
+
Y,
|
|
1049
1050
|
{
|
|
1050
1051
|
color: "text.secondary",
|
|
1051
1052
|
sx: { fontWeight: 400, maxWidth: { sm: 424 }, textAlign: "center" },
|
|
@@ -1055,48 +1056,48 @@ const Tt = (t, n) => n ? v(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
1055
1056
|
)
|
|
1056
1057
|
]
|
|
1057
1058
|
}
|
|
1058
|
-
),
|
|
1059
|
-
const { isAccountDataLoaded: n, loadAccountData: u, visibleAccounts:
|
|
1059
|
+
), Un = D(({ onCTAClick: t }) => {
|
|
1060
|
+
const { isAccountDataLoaded: n, loadAccountData: u, visibleAccounts: d } = j(), { onEvent: _ } = ke(), { goals: i } = R(), { isInitialized: m } = _e(), { ongoingGoalsForMicroWidget: p, isAllGoalDataLoaded: s, loadGoalData: h } = N();
|
|
1060
1061
|
Me({
|
|
1061
1062
|
widgetName: "GoalsMicroWidget",
|
|
1062
1063
|
isLoaded: s
|
|
1063
1064
|
}), T.useEffect(() => {
|
|
1064
1065
|
n || u().finally();
|
|
1065
1066
|
}, []), T.useEffect(() => {
|
|
1066
|
-
|
|
1067
|
-
state:
|
|
1067
|
+
m && (h().finally(), _($.GOALS_LOAD_WIDGET, {
|
|
1068
|
+
state: d?.length ? "default" : "zeroState"
|
|
1068
1069
|
}));
|
|
1069
|
-
}, [
|
|
1070
|
+
}, [m]);
|
|
1070
1071
|
const a = T.useMemo(
|
|
1071
1072
|
() => s && p.length === 0,
|
|
1072
1073
|
[p, s]
|
|
1073
1074
|
), o = () => {
|
|
1074
1075
|
_(
|
|
1075
|
-
a ?
|
|
1076
|
+
a ? $.GOALS_CLICK_GET_STARTED : $.GOALS_CLICK_VIEW_DETAILS
|
|
1076
1077
|
), t();
|
|
1077
1078
|
};
|
|
1078
|
-
return !
|
|
1079
|
-
|
|
1079
|
+
return !m || !s ? /* @__PURE__ */ e(Le, {}) : /* @__PURE__ */ e(
|
|
1080
|
+
Tt,
|
|
1080
1081
|
{
|
|
1081
1082
|
className: "mx-goals-microwidget",
|
|
1082
1083
|
ctaLabel: a ? i.get_started : i.view_details,
|
|
1083
1084
|
onCTAClick: o,
|
|
1084
1085
|
title: i.title,
|
|
1085
1086
|
children: a ? /* @__PURE__ */ e(
|
|
1086
|
-
|
|
1087
|
+
Wt,
|
|
1087
1088
|
{
|
|
1088
1089
|
header: i.create_goals_header,
|
|
1089
1090
|
subText: i.micro_zero_state_description
|
|
1090
1091
|
}
|
|
1091
|
-
) : /* @__PURE__ */ e(
|
|
1092
|
-
/* @__PURE__ */ e(
|
|
1093
|
-
|
|
1094
|
-
] },
|
|
1092
|
+
) : /* @__PURE__ */ e(ft, { sx: { justifyContent: "space-between" }, children: p.map((b, l) => /* @__PURE__ */ c(T.Fragment, { children: [
|
|
1093
|
+
/* @__PURE__ */ e(Ot, { goal: b }),
|
|
1094
|
+
l !== p.length - 1 && /* @__PURE__ */ e(v, {})
|
|
1095
|
+
] }, b.guid)) })
|
|
1095
1096
|
}
|
|
1096
1097
|
);
|
|
1097
1098
|
});
|
|
1098
1099
|
export {
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1100
|
+
qn as GoalStore,
|
|
1101
|
+
Un as GoalsMicroWidget,
|
|
1102
|
+
Hn as GoalsWidget
|
|
1102
1103
|
};
|