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