@mx-cartographer/experiences 7.4.6-alpha.mm2 → 7.4.7-alpha.mega1
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 +12 -0
- package/dist/{Account-BQE_ANvF.mjs → Account-01wOyrH1.mjs} +1 -1
- package/dist/{AccountDetailsContent-C6LkHJuy.mjs → AccountDetailsContent-COMjOzwr.mjs} +8 -8
- package/dist/{AccountDetailsHeader-CCkHHK_n.mjs → AccountDetailsHeader-Cbi5G6fJ.mjs} +4 -4
- package/dist/{AccountFields-DdOw6d6w.mjs → AccountFields-Cd_nOWmf.mjs} +2 -2
- package/dist/{AccountListItem-CZhCiU7q.mjs → AccountListItem-DxY4cCF1.mjs} +4 -4
- package/dist/{AccountStore-kxFbaz-K.mjs → AccountStore-C1zMBzHq.mjs} +2 -2
- package/dist/{Accounts-D_768tYo.mjs → Accounts-D7QljYas.mjs} +1 -1
- package/dist/{BudgetUtil-C5fTz_GJ.mjs → BudgetUtil-Df2nII9u.mjs} +1 -1
- package/dist/{CategorySelectorDrawer-l3tOyiqD.mjs → CategorySelectorDrawer-DqJK_rrL.mjs} +1 -1
- package/dist/{ConnectDrawer-g2IXvoSS.mjs → ConnectDrawer-CuUj16NH.mjs} +1 -1
- package/dist/{ConnectionsDrawer-vSEOHrUC.mjs → ConnectionsDrawer-Bz4uwdFE.mjs} +6 -6
- package/dist/{CurrencyInput-BnaVaZBU.mjs → CurrencyInput-BFKcs-_K.mjs} +6 -6
- package/dist/{DebtsStore-CFk9t-Ky.mjs → DebtsStore-Bu8rRRSL.mjs} +1 -1
- package/dist/{Donut-oaQFlbit.mjs → Donut-Dmy3JTWd.mjs} +12 -12
- package/dist/{ExportCsvAction-DSi2a4NQ.mjs → ExportCsvAction-DzTrtPzk.mjs} +3 -3
- package/dist/{GoalStore-DxFUJRd4.mjs → GoalStore-CrNhjvNc.mjs} +2 -2
- package/dist/{Help-D1I72J-F.mjs → Help-BnPXM_N2.mjs} +1 -1
- package/dist/{LineChart-B7MftxPX.mjs → LineChart-bc1D9xBE.mjs} +1 -1
- package/dist/{ListItemAction-Dob72eoG.mjs → ListItemAction-uobBrm_a.mjs} +10 -10
- package/dist/{ManageIncome-DlAUFShc.mjs → ManageIncome-A69EUO5u.mjs} +4 -4
- package/dist/{MicroWidgetContainer-4zS7jJrn.mjs → MicroWidgetContainer-DEiRnYVa.mjs} +1 -1
- package/dist/{MiniWidgetContainer-Csioy5P7.mjs → MiniWidgetContainer-CmXpTylX.mjs} +1 -1
- package/dist/{NetWorthStore-B6sG1eiD.mjs → NetWorthStore-CpL_kqvx.mjs} +2 -2
- package/dist/{NotificationSettings-ByORHzRI.mjs → NotificationSettings-CNmJWVeI.mjs} +3 -3
- package/dist/{OriginalBalanceAction-BmSYWwSx.mjs → OriginalBalanceAction-DK8_LkPz.mjs} +3 -3
- package/dist/{RecurringSettings-CZvd4Wuv.mjs → RecurringSettings-B0uObPlD.mjs} +12 -12
- package/dist/{SpendingLegend-CbNAMdPH.mjs → SpendingLegend-Bf-wbJvb.mjs} +11 -11
- package/dist/{TransactionDetails-DnLXfvDL.mjs → TransactionDetails-COH0OKNG.mjs} +5 -5
- package/dist/{TransactionStore-BOiv_pDO.mjs → TransactionStore-Dz-G8Wd0.mjs} +2 -2
- package/dist/{User-BmdvAL7I.mjs → User-wXzDI4M8.mjs} +1 -1
- package/dist/{WidgetContainer-DR_iRKNU.mjs → WidgetContainer-6dsjtOVg.mjs} +2 -2
- package/dist/accounts/index.es.js +119 -121
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/index.es.js +10 -10
- package/dist/cashflow/index.es.js +8 -8
- package/dist/categories/index.es.js +1 -1
- package/dist/common/components/charts/index.d.ts +0 -1
- package/dist/common/hooks/index.d.ts +0 -1
- package/dist/common/index.es.js +96 -100
- package/dist/dashboard/index.es.js +88 -90
- package/dist/debts/index.es.js +9 -9
- package/dist/{exportTransactionsToCSV-DoKUltKJ.mjs → exportTransactionsToCSV-Cz2t0lmA.mjs} +1 -1
- package/dist/finstrong/index.es.js +10 -10
- package/dist/goals/index.es.js +251 -249
- package/dist/help/index.es.js +5 -5
- package/dist/{hooks-DtrRa6Lb.mjs → hooks-C41HAxM5.mjs} +10 -10
- package/dist/investments/index.es.js +4 -4
- package/dist/merchants/index.es.js +1 -1
- package/dist/networth/index.es.js +173 -173
- package/dist/notifications/index.es.js +2 -2
- package/dist/recurringtransactions/index.es.js +8 -8
- package/dist/settings/index.es.js +6 -6
- package/dist/spending/index.es.js +7 -7
- package/dist/spending/utils/SpendingData.d.ts +2 -1
- package/dist/transactions/index.es.js +13 -13
- package/dist/trends/index.es.js +171 -170
- package/dist/useAccountDisplayName-CMMlIOXF.mjs +15 -0
- package/dist/{useInsightsEnabled-v_GGt72p.mjs → useInsightsEnabled-CNjP5cfR.mjs} +1 -1
- package/package.json +1 -1
- package/dist/common/hooks/useWidgetLoadTimer.d.ts +0 -24
- package/dist/useAccountDisplayName-BUtYhbqe.mjs +0 -15
- package/dist/useWidgetLoadTimer-CY26D0n1.mjs +0 -23
package/dist/goals/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as _e, T as
|
|
2
|
-
import { c as qn, d as Jn } from "../GoalStore-
|
|
1
|
+
import { g as _e, T as u, G as ue, a as Pe, M as q, C as Te, b as Ve } from "../GoalStore-CrNhjvNc.mjs";
|
|
2
|
+
import { c as qn, d as Jn } from "../GoalStore-CrNhjvNc.mjs";
|
|
3
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";
|
|
@@ -10,21 +10,21 @@ import ce from "@mui/material/Tab";
|
|
|
10
10
|
import ze from "@mui/material/Tabs";
|
|
11
11
|
import { Text as A, H2 as pe, P, H3 as He, Icon as $e, InstitutionLogo as oe } from "@mxenabled/mxui";
|
|
12
12
|
import he from "@mui/material/Button";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
13
|
+
import Ce from "@mui/material/Card";
|
|
14
|
+
import Se from "@mui/material/CardActionArea";
|
|
15
|
+
import Re from "@mui/material/CardContent";
|
|
16
|
+
import fe from "@mui/material/Unstable_Grid2";
|
|
17
17
|
import ae from "@mui/material/Avatar";
|
|
18
18
|
import Xe from "@mui/material/CardHeader";
|
|
19
|
-
import { Payments as
|
|
20
|
-
import {
|
|
21
|
-
import { u as
|
|
19
|
+
import { Payments as Ee, NoteStack as xe, Person as ve, ChevronRight as M, DragHandle as Ue, CheckCircle as Ye, Icon as ye, ExpandLess as Ze, ExpandMore as qe, AddBox as Ie, Trophy as Je } from "@mxenabled/mx-icons";
|
|
20
|
+
import { u as C, l as I, b as ge, a as Ge, d as j, p as Ne, g as ke, n as Qe } from "../hooks-C41HAxM5.mjs";
|
|
21
|
+
import { u as be } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
22
22
|
import { f as x } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
23
23
|
import { S as et } from "../StatusBar-BK_uYHAB.mjs";
|
|
24
24
|
import E from "@mui/material/Divider";
|
|
25
25
|
import B from "@mui/material/List";
|
|
26
|
-
import { L as Q } from "../ListItemAction-
|
|
27
|
-
import { C as we } from "../CurrencyInput-
|
|
26
|
+
import { L as Q } from "../ListItemAction-uobBrm_a.mjs";
|
|
27
|
+
import { C as we } from "../CurrencyInput-BFKcs-_K.mjs";
|
|
28
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";
|
|
@@ -34,28 +34,28 @@ import { D as F } from "../Drawer-BEtCk82g.mjs";
|
|
|
34
34
|
import { b as L } from "../Localization-2MODESHW.mjs";
|
|
35
35
|
import { f as re, a as ie, D as nt } from "../Dialog-BPTr3qHE.mjs";
|
|
36
36
|
import V from "@mui/material/ListItemAvatar";
|
|
37
|
-
import { g as De, A as
|
|
37
|
+
import { g as De, A as Ae } from "../ConnectDrawer-CuUj16NH.mjs";
|
|
38
38
|
import ot from "@mui/material/Collapse";
|
|
39
39
|
import at from "@mui/material/ListItemIcon";
|
|
40
40
|
import rt from "@mui/material/Checkbox";
|
|
41
|
-
import { u as it, A as st } from "../AccountDetailsHeader-
|
|
42
|
-
import { A as lt } from "../AccountDetailsContent-
|
|
43
|
-
import { u as ct } from "../useAccountDisplayName-
|
|
41
|
+
import { u as it, A as st } from "../AccountDetailsHeader-Cbi5G6fJ.mjs";
|
|
42
|
+
import { A as lt } from "../AccountDetailsContent-COMjOzwr.mjs";
|
|
43
|
+
import { u as ct } from "../useAccountDisplayName-CMMlIOXF.mjs";
|
|
44
44
|
import Ke from "@mui/material/TextField";
|
|
45
|
-
import { M as dt, I as mt, O as ut } from "../OriginalBalanceAction-
|
|
45
|
+
import { M as dt, I as mt, O as ut } from "../OriginalBalanceAction-DK8_LkPz.mjs";
|
|
46
46
|
import { getUnixTime as _t } from "date-fns/getUnixTime";
|
|
47
47
|
import { isValid as pt } from "date-fns/isValid";
|
|
48
48
|
import { AdapterDateFns as ht } from "@mui/x-date-pickers/AdapterDateFnsV3";
|
|
49
49
|
import { DatePicker as gt } from "@mui/x-date-pickers";
|
|
50
50
|
import { LocalizationProvider as bt } from "@mui/x-date-pickers/LocalizationProvider";
|
|
51
|
-
import { A as Y, W as ft } from "../WidgetContainer-
|
|
51
|
+
import { A as Y, W as ft } from "../WidgetContainer-6dsjtOVg.mjs";
|
|
52
52
|
import { L as Me } from "../Loader-DUaFpDGv.mjs";
|
|
53
53
|
import { E as yt } from "../EmptyState-DoxNUae-.mjs";
|
|
54
54
|
import At from "@mui/material/Stack/Stack";
|
|
55
55
|
import Tt from "@mui/material/Box";
|
|
56
56
|
import Ct from "@mui/material/styles/useTheme";
|
|
57
57
|
import { S as St } from "../SingleSegmentDonut-BgbLgwHi.mjs";
|
|
58
|
-
import { M as Rt } from "../MicroWidgetContainer-
|
|
58
|
+
import { M as Rt } from "../MicroWidgetContainer-DEiRnYVa.mjs";
|
|
59
59
|
function de({ title: t, subtitle: n }) {
|
|
60
60
|
return /* @__PURE__ */ i(b, { children: [
|
|
61
61
|
/* @__PURE__ */ e(A, { bold: !0, variant: "Body", children: t }),
|
|
@@ -67,54 +67,54 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
67
67
|
"$1$2$3"
|
|
68
68
|
) : x(t, "0,0.00"), Le = D(
|
|
69
69
|
({ goal: t, isInDrawer: n = !1, onClick: s }) => {
|
|
70
|
-
const { goals:
|
|
70
|
+
const { goals: c } = C(), { isMobile: p, isTablet: a } = be(), _ = p || a, {
|
|
71
71
|
backgroundColor: h,
|
|
72
72
|
color: g,
|
|
73
73
|
percentage: r,
|
|
74
|
-
percentageText:
|
|
75
|
-
projectedText:
|
|
76
|
-
} = _e(
|
|
74
|
+
percentageText: m,
|
|
75
|
+
projectedText: o
|
|
76
|
+
} = _e(c, t), d = t.track_type === u.DEBT_TRACK ? t.initial_amount : t.amount, l = [
|
|
77
77
|
{
|
|
78
78
|
color: h,
|
|
79
79
|
percentage: `${r}`
|
|
80
80
|
}
|
|
81
81
|
];
|
|
82
|
-
let f = /* @__PURE__ */ e(
|
|
83
|
-
return t.track_type ===
|
|
82
|
+
let f = /* @__PURE__ */ e(Ee, {});
|
|
83
|
+
return t.track_type === u.DEBT_TRACK ? f = /* @__PURE__ */ e(xe, {}) : t.track_type === u.RETIREMENT_TRACK && (f = /* @__PURE__ */ e(ve, {})), /* @__PURE__ */ e(Ce, { elevation: 2, children: /* @__PURE__ */ i(Se, { disabled: !s, onClick: s, children: [
|
|
84
84
|
/* @__PURE__ */ e(
|
|
85
85
|
Xe,
|
|
86
86
|
{
|
|
87
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 ||
|
|
88
|
+
subheader: /* @__PURE__ */ e(A, { variant: n || _ ? "H3" : "H2", children: `${x(t.current_amount, _ ? "0,0" : "0,0.00")} / ${Et(
|
|
89
89
|
d,
|
|
90
|
-
|
|
90
|
+
_
|
|
91
91
|
)}` }),
|
|
92
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(et, { data:
|
|
95
|
+
/* @__PURE__ */ e(Re, { sx: { pt: 0 }, children: /* @__PURE__ */ i(b, { gap: 6, children: [
|
|
96
|
+
/* @__PURE__ */ e(et, { data: l, height: 24 }),
|
|
97
97
|
/* @__PURE__ */ i(b, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
98
|
-
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "XSmall", children:
|
|
99
|
-
t.projected_to_complete_at && /* @__PURE__ */ e(A, { color: "text.secondary", variant: "XSmall", children:
|
|
98
|
+
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "XSmall", children: m }),
|
|
99
|
+
t.projected_to_complete_at && /* @__PURE__ */ e(A, { color: "text.secondary", variant: "XSmall", children: o })
|
|
100
100
|
] })
|
|
101
101
|
] }) })
|
|
102
102
|
] }) });
|
|
103
103
|
}
|
|
104
104
|
), xt = D(({ trackType: t }) => {
|
|
105
|
-
const { goals: n } = C(), { setAlert: s, monthlyCashFlowProfile:
|
|
105
|
+
const { goals: n } = C(), { setAlert: s, monthlyCashFlowProfile: c, updateMonthlyCashFlowProfile: p } = I(), a = y.useMemo(() => {
|
|
106
106
|
let r = 0;
|
|
107
|
-
return t ===
|
|
108
|
-
}, [
|
|
109
|
-
if (
|
|
110
|
-
const r = { ...
|
|
111
|
-
t ===
|
|
107
|
+
return t === u.SAVINGS_TRACK ? r = c?.amount_allocated_for_savings_goals || 0 : t === u.DEBT_TRACK ? r = c?.amount_allocated_for_debt_goals || 0 : t === u.RETIREMENT_TRACK && (r = c?.amount_allocated_for_retirement_goals || 0), r;
|
|
108
|
+
}, [c]), [_, h] = y.useState(a), g = async () => {
|
|
109
|
+
if (c) {
|
|
110
|
+
const r = { ...c };
|
|
111
|
+
t === u.SAVINGS_TRACK ? r.amount_allocated_for_savings_goals = _ : t === u.DEBT_TRACK ? r.amount_allocated_for_debt_goals = _ : t === u.RETIREMENT_TRACK && (r.amount_allocated_for_retirement_goals = _), await p(r), s(n.alert_contribution_updated);
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
114
|
return /* @__PURE__ */ e(b, { bgcolor: "background.paper", children: /* @__PURE__ */ e(
|
|
115
115
|
Q,
|
|
116
116
|
{
|
|
117
|
-
isSaveDisabled: !
|
|
117
|
+
isSaveDisabled: !_ || isNaN(_),
|
|
118
118
|
label: n.contribution_label,
|
|
119
119
|
onCancel: () => h(a),
|
|
120
120
|
onSave: g,
|
|
@@ -123,28 +123,28 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
123
123
|
children: /* @__PURE__ */ e(
|
|
124
124
|
we,
|
|
125
125
|
{
|
|
126
|
-
amount:
|
|
126
|
+
amount: _,
|
|
127
127
|
autoFocus: !0,
|
|
128
|
-
error: !
|
|
128
|
+
error: !_ || isNaN(_),
|
|
129
129
|
fullWidth: !0,
|
|
130
130
|
minAmount: 0,
|
|
131
|
-
setAmount: (r) => h(isNaN(Number(r)) ?
|
|
131
|
+
setAmount: (r) => h(isNaN(Number(r)) ? _ : Number(r)),
|
|
132
132
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
133
133
|
}
|
|
134
134
|
)
|
|
135
135
|
}
|
|
136
136
|
) });
|
|
137
137
|
}), vt = ({ goals: t }) => {
|
|
138
|
-
const { goals: n, common: s } = C(), { reorderGoals:
|
|
138
|
+
const { goals: n, common: s } = C(), { reorderGoals: c, setAlert: p } = I(), [a, _] = y.useState(!1), [h, g] = y.useState(t.map((l) => ({ ...l })));
|
|
139
139
|
y.useEffect(() => {
|
|
140
|
-
a && g(t.map((
|
|
140
|
+
a && g(t.map((l) => ({ ...l })));
|
|
141
141
|
}, [a]);
|
|
142
142
|
const r = [
|
|
143
143
|
{
|
|
144
144
|
field: "name",
|
|
145
145
|
flex: 1,
|
|
146
|
-
renderCell: (
|
|
147
|
-
const f =
|
|
146
|
+
renderCell: (l) => {
|
|
147
|
+
const f = l.row;
|
|
148
148
|
return /* @__PURE__ */ i(b, { children: [
|
|
149
149
|
/* @__PURE__ */ e(A, { bold: !0, variant: "Body", children: f.name }),
|
|
150
150
|
/* @__PURE__ */ e(A, { variant: "XSmall", children: L(
|
|
@@ -162,28 +162,28 @@ const Et = (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 f =
|
|
165
|
+
renderCell: (l) => {
|
|
166
|
+
const f = l.row;
|
|
167
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
|
-
],
|
|
172
|
-
id:
|
|
171
|
+
], m = h.map((l) => ({
|
|
172
|
+
id: l.guid,
|
|
173
173
|
isHovering: !1,
|
|
174
|
-
__reorder__:
|
|
175
|
-
...
|
|
176
|
-
})),
|
|
174
|
+
__reorder__: l.name,
|
|
175
|
+
...l
|
|
176
|
+
})), o = ({ oldIndex: l, targetIndex: f }) => {
|
|
177
177
|
const T = [...h];
|
|
178
|
-
T.splice(f, 0, T.splice(
|
|
178
|
+
T.splice(f, 0, T.splice(l, 1)[0]);
|
|
179
179
|
for (let S = 0; S < T.length; S += 1)
|
|
180
180
|
T[S].position = S + 1;
|
|
181
181
|
g(T);
|
|
182
182
|
}, d = async () => {
|
|
183
|
-
await
|
|
183
|
+
await c(h), p(n.alert_goals_reordered), _(!1);
|
|
184
184
|
};
|
|
185
185
|
return /* @__PURE__ */ i(b, { children: [
|
|
186
|
-
/* @__PURE__ */ e(N, { children: /* @__PURE__ */ e(k, { onClick: () =>
|
|
186
|
+
/* @__PURE__ */ e(N, { children: /* @__PURE__ */ e(k, { onClick: () => _(!0), children: /* @__PURE__ */ e(w, { children: /* @__PURE__ */ i(
|
|
187
187
|
b,
|
|
188
188
|
{
|
|
189
189
|
alignItems: "center",
|
|
@@ -201,7 +201,7 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
201
201
|
{
|
|
202
202
|
ariaLabelClose: s.close_aria,
|
|
203
203
|
isOpen: a,
|
|
204
|
-
onClose: () =>
|
|
204
|
+
onClose: () => _(!1),
|
|
205
205
|
onPrimaryAction: d,
|
|
206
206
|
title: n.reorder_goals_title,
|
|
207
207
|
children: /* @__PURE__ */ i(b, { children: [
|
|
@@ -214,9 +214,9 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
214
214
|
disableColumnFilter: !0,
|
|
215
215
|
disableColumnMenu: !0,
|
|
216
216
|
hideFooter: !0,
|
|
217
|
-
onRowOrderChange:
|
|
217
|
+
onRowOrderChange: o,
|
|
218
218
|
rowReordering: !0,
|
|
219
|
-
rows:
|
|
219
|
+
rows: m,
|
|
220
220
|
slots: {
|
|
221
221
|
rowReorderIcon: () => /* @__PURE__ */ e(Ue, { sx: { ml: 12 } })
|
|
222
222
|
//TODO: Add to mx-icons
|
|
@@ -233,9 +233,9 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
233
233
|
)
|
|
234
234
|
] });
|
|
235
235
|
}, It = ({ goal: t, index: n }) => {
|
|
236
|
-
const { goals: s } = C(), { percentage:
|
|
236
|
+
const { goals: s } = C(), { percentage: c } = _e(s, t), p = t.goal_type === ue.KEEP_BALANCE_BELOW || t.has_been_spent ? s.goal_completed : L(s.goal_percentage_reached, `${c * 100}`);
|
|
237
237
|
return /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { children: [
|
|
238
|
-
t.track_type !==
|
|
238
|
+
t.track_type !== u.RETIREMENT_TRACK && /* @__PURE__ */ e(
|
|
239
239
|
V,
|
|
240
240
|
{
|
|
241
241
|
sx: {
|
|
@@ -280,13 +280,13 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
280
280
|
] }) })
|
|
281
281
|
] }) }, t.guid);
|
|
282
282
|
}, Nt = ({ trackType: t }) => {
|
|
283
|
-
const { goals: n, common: s } = C(), { orderedGoals:
|
|
284
|
-
(
|
|
285
|
-
),
|
|
286
|
-
(
|
|
283
|
+
const { goals: n, common: s } = C(), { orderedGoals: c } = I(), p = c.filter((l) => l.track_type === t), a = p.filter(
|
|
284
|
+
(l) => l.track_type === u.SAVINGS_TRACK && !l.has_been_spent || l.track_type !== u.SAVINGS_TRACK && !l.is_complete
|
|
285
|
+
), _ = p.filter(
|
|
286
|
+
(l) => l.track_type === u.SAVINGS_TRACK && l.has_been_spent || l.track_type !== u.SAVINGS_TRACK && l.is_complete
|
|
287
287
|
), [h, g] = y.useState(!1);
|
|
288
|
-
let r = n.manage_saving_goals,
|
|
289
|
-
return t ===
|
|
288
|
+
let r = n.manage_saving_goals, m = n.manage_saving_drawer_title, o = n.manage_saving_title, d = n.manage_saving_description;
|
|
289
|
+
return t === u.DEBT_TRACK ? (r = n.manage_debt_goals, m = n.manage_debt_drawer_title, o = n.manage_debt_title, d = n.manage_debt_description) : t === u.RETIREMENT_TRACK && (r = n.manage_retirement_goals, m = n.manage_retirement_drawer_title, o = n.manage_retirement_title, d = n.manage_retirement_description), /* @__PURE__ */ i(b, { children: [
|
|
290
290
|
/* @__PURE__ */ e(he, { endIcon: /* @__PURE__ */ e(M, {}), onClick: () => g(!0), children: r }),
|
|
291
291
|
/* @__PURE__ */ e(
|
|
292
292
|
F,
|
|
@@ -294,40 +294,40 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
294
294
|
ariaLabelClose: s.close_aria,
|
|
295
295
|
isOpen: h,
|
|
296
296
|
onClose: () => g(!1),
|
|
297
|
-
title:
|
|
297
|
+
title: m,
|
|
298
298
|
children: /* @__PURE__ */ i(b, { children: [
|
|
299
299
|
/* @__PURE__ */ i(b, { m: 24, children: [
|
|
300
|
-
/* @__PURE__ */ e(He, { children:
|
|
300
|
+
/* @__PURE__ */ e(He, { children: o }),
|
|
301
301
|
/* @__PURE__ */ e(P, { color: "text.secondary", sx: { textWrap: "wrap" }, variant: "ParagraphSmall", children: d })
|
|
302
302
|
] }),
|
|
303
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
305
|
/* @__PURE__ */ i(B, { sx: { bgcolor: "background.paper" }, children: [
|
|
306
|
-
a.map((
|
|
306
|
+
a.map((l, f) => {
|
|
307
307
|
const T = f >= a.length - 1;
|
|
308
308
|
return /* @__PURE__ */ i(b, { children: [
|
|
309
|
-
/* @__PURE__ */ e(It, { goal:
|
|
309
|
+
/* @__PURE__ */ e(It, { goal: l, index: f }),
|
|
310
310
|
/* @__PURE__ */ e(
|
|
311
311
|
E,
|
|
312
312
|
{
|
|
313
|
-
variant: T && t ===
|
|
313
|
+
variant: T && t === u.RETIREMENT_TRACK ? "fullWidth" : "inset"
|
|
314
314
|
}
|
|
315
315
|
)
|
|
316
|
-
] }, `ongoing-${
|
|
316
|
+
] }, `ongoing-${l.guid}`);
|
|
317
317
|
}),
|
|
318
|
-
t !==
|
|
318
|
+
t !== u.RETIREMENT_TRACK && /* @__PURE__ */ i(b, { children: [
|
|
319
319
|
/* @__PURE__ */ e(vt, { goals: a }),
|
|
320
320
|
/* @__PURE__ */ e(E, {})
|
|
321
321
|
] })
|
|
322
322
|
] }),
|
|
323
|
-
t !==
|
|
323
|
+
t !== u.RETIREMENT_TRACK && _.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(B, { sx: { bgcolor: "background.paper" }, children:
|
|
325
|
+
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children: _.map((l, f) => {
|
|
326
326
|
const T = f > a.length - 1;
|
|
327
327
|
return /* @__PURE__ */ i(b, { children: [
|
|
328
|
-
/* @__PURE__ */ e(Gt, { goal:
|
|
328
|
+
/* @__PURE__ */ e(Gt, { goal: l }),
|
|
329
329
|
/* @__PURE__ */ e(E, { variant: T ? "fullWidth" : "inset" })
|
|
330
|
-
] }, `complete-${
|
|
330
|
+
] }, `complete-${l.guid}`);
|
|
331
331
|
}) })
|
|
332
332
|
] })
|
|
333
333
|
] })
|
|
@@ -335,19 +335,21 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
335
335
|
)
|
|
336
336
|
] });
|
|
337
337
|
}, me = D(({ trackType: t, onAddGoals: n }) => {
|
|
338
|
-
const { isMobile: s } =
|
|
339
|
-
(o) => o.track_type ===
|
|
340
|
-
), g =
|
|
341
|
-
(o) => o.track_type ===
|
|
342
|
-
), r =
|
|
338
|
+
const { isMobile: s } = be(), { goals: c } = C(), { selectedAccountGuids: p } = ge(), { orderedGoals: a, setSelectedGoal: _ } = I(), h = a.filter(
|
|
339
|
+
(o) => o.track_type === t && p.includes(o.account_guid)
|
|
340
|
+
), g = h.filter(
|
|
341
|
+
(o) => o.track_type === u.SAVINGS_TRACK && !o.has_been_spent || o.track_type !== u.SAVINGS_TRACK && !o.is_complete
|
|
342
|
+
), r = h.filter(
|
|
343
|
+
(o) => o.track_type === u.SAVINGS_TRACK && o.has_been_spent || o.track_type !== u.SAVINGS_TRACK && o.is_complete
|
|
344
|
+
), m = t === u.DEBT_TRACK ? c.zero_state_complete_debt : c.zero_state_complete_savings;
|
|
343
345
|
return /* @__PURE__ */ i(b, { mt: 16, mx: s ? 24 : 0, children: [
|
|
344
346
|
/* @__PURE__ */ i(b, { alignItems: "center", direction: "row", justifyContent: "space-between", mb: 8, children: [
|
|
345
|
-
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Small", children:
|
|
347
|
+
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Small", children: c.ongoing_title }),
|
|
346
348
|
/* @__PURE__ */ e(Nt, { trackType: t })
|
|
347
349
|
] }),
|
|
348
|
-
|
|
350
|
+
g.length > 0 ? /* @__PURE__ */ e(fe, { container: !0, spacing: 24, children: g.map((o, d, l) => (
|
|
349
351
|
// Goal should be full width in mobile or if it's the first goal (unless there are 2)
|
|
350
|
-
/* @__PURE__ */ e(
|
|
352
|
+
/* @__PURE__ */ e(fe, { xs: s || d === 0 && l.length !== 2 ? 12 : 6, children: /* @__PURE__ */ e(Le, { goal: o, onClick: () => _(o) }, o.guid) }, d)
|
|
351
353
|
)) }) : /* @__PURE__ */ i(
|
|
352
354
|
b,
|
|
353
355
|
{
|
|
@@ -369,16 +371,16 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
369
371
|
width: { sm: 381 }
|
|
370
372
|
}),
|
|
371
373
|
variant: "Small",
|
|
372
|
-
children: Pe(t,
|
|
374
|
+
children: Pe(t, c)
|
|
373
375
|
}
|
|
374
376
|
),
|
|
375
|
-
/* @__PURE__ */ e(he, { onClick: n, sx: { mt: 16, width: { sm: 224 } }, variant: "contained", children:
|
|
377
|
+
/* @__PURE__ */ e(he, { onClick: n, sx: { mt: 16, width: { sm: 224 } }, variant: "contained", children: c.add_goals_button })
|
|
376
378
|
]
|
|
377
379
|
}
|
|
378
380
|
),
|
|
379
|
-
t !==
|
|
380
|
-
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Small", children:
|
|
381
|
-
|
|
381
|
+
t !== u.RETIREMENT_TRACK && /* @__PURE__ */ i(b, { gap: 16, mt: 48, children: [
|
|
382
|
+
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Small", children: c.complete_title }),
|
|
383
|
+
r.length === 0 && /* @__PURE__ */ e(b, { alignItems: "center", bgcolor: "background.default", borderRadius: 2, py: 18, children: /* @__PURE__ */ e(
|
|
382
384
|
P,
|
|
383
385
|
{
|
|
384
386
|
sx: (o) => ({
|
|
@@ -389,10 +391,10 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
389
391
|
}
|
|
390
392
|
}),
|
|
391
393
|
variant: "Small",
|
|
392
|
-
children:
|
|
394
|
+
children: m
|
|
393
395
|
}
|
|
394
396
|
) }),
|
|
395
|
-
|
|
397
|
+
r.map((o) => /* @__PURE__ */ e(Ce, { elevation: 2, children: /* @__PURE__ */ e(Se, { onClick: () => _(o), children: /* @__PURE__ */ e(Re, { sx: { ":last-child": { pb: 16 } }, children: /* @__PURE__ */ i(b, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
396
398
|
/* @__PURE__ */ i(b, { alignItems: "center", direction: "row", gap: 6, children: [
|
|
397
399
|
/* @__PURE__ */ e($e, { color: "success", fill: !0, name: "check_circle", size: 20 }),
|
|
398
400
|
/* @__PURE__ */ e(A, { color: "text.secondary", variant: "Body", children: o.name })
|
|
@@ -402,27 +404,27 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
402
404
|
] })
|
|
403
405
|
] });
|
|
404
406
|
}), kt = ({ goalType: t, onClick: n }) => {
|
|
405
|
-
const { goals: s } = C(), { bgcolor:
|
|
407
|
+
const { goals: s } = C(), { bgcolor: c, icon: p, label: a, description: _, subTypes: h, type: g } = t, [r, m] = y.useState(!1), o = h.length > 0;
|
|
406
408
|
return /* @__PURE__ */ e(b, { children: /* @__PURE__ */ i(B, { sx: { bgcolor: "background.paper" }, children: [
|
|
407
409
|
/* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(
|
|
408
410
|
k,
|
|
409
411
|
{
|
|
410
|
-
onClick:
|
|
411
|
-
g ===
|
|
412
|
-
g ===
|
|
412
|
+
onClick: o ? () => m(!r) : () => n(
|
|
413
|
+
g === u.RETIREMENT_TRACK ? s.retirement : "",
|
|
414
|
+
g === u.RETIREMENT_TRACK ? q.RETIREMENT : q.OTHER,
|
|
413
415
|
g
|
|
414
416
|
),
|
|
415
417
|
children: [
|
|
416
|
-
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(ae, { sx: { bgcolor:
|
|
417
|
-
/* @__PURE__ */ e(w, { primary: a, secondary:
|
|
418
|
-
!
|
|
419
|
-
|
|
418
|
+
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(ae, { sx: { bgcolor: c }, variant: "rounded", children: /* @__PURE__ */ e(ye, { name: p, sx: { color: "grey.900" } }) }) }),
|
|
419
|
+
/* @__PURE__ */ e(w, { primary: a, secondary: _, sx: { mr: 24 } }),
|
|
420
|
+
!o && /* @__PURE__ */ e(M, {}),
|
|
421
|
+
o && (r ? /* @__PURE__ */ e(Ze, {}) : /* @__PURE__ */ e(qe, {}))
|
|
420
422
|
]
|
|
421
423
|
}
|
|
422
424
|
) }),
|
|
423
425
|
/* @__PURE__ */ e(E, { variant: "inset" }),
|
|
424
|
-
|
|
425
|
-
/* @__PURE__ */ e(at, { sx: { mr: 8 }, children: /* @__PURE__ */ e(
|
|
426
|
+
o && /* @__PURE__ */ e(ot, { in: r, children: /* @__PURE__ */ e(B, { sx: { bgcolor: "background.default" }, children: h.map((d, l) => /* @__PURE__ */ e(N, { sx: { pl: 48 }, children: /* @__PURE__ */ i(k, { onClick: () => n(d.label, d.metaType, g), children: [
|
|
427
|
+
/* @__PURE__ */ e(at, { sx: { mr: 8 }, children: /* @__PURE__ */ e(ye, { name: d.icon }) }),
|
|
426
428
|
/* @__PURE__ */ e(
|
|
427
429
|
w,
|
|
428
430
|
{
|
|
@@ -431,56 +433,56 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
431
433
|
}
|
|
432
434
|
),
|
|
433
435
|
/* @__PURE__ */ e(M, {})
|
|
434
|
-
] }) },
|
|
436
|
+
] }) }, l)) }) })
|
|
435
437
|
] }) });
|
|
436
438
|
}, Be = ({
|
|
437
439
|
accounts: t,
|
|
438
440
|
isOpen: n,
|
|
439
441
|
onClose: s,
|
|
440
|
-
onSave:
|
|
442
|
+
onSave: c,
|
|
441
443
|
title: p
|
|
442
444
|
}) => {
|
|
443
|
-
const { goals: a, common:
|
|
444
|
-
const d = g.findIndex((f) => f.guid ===
|
|
445
|
-
d >= 0 ?
|
|
445
|
+
const { goals: a, common: _ } = C(), { config: h } = Ge(), [g, r] = y.useState([]), m = (o) => {
|
|
446
|
+
const d = g.findIndex((f) => f.guid === o.guid), l = [...g];
|
|
447
|
+
d >= 0 ? l.splice(d, 1) : l.push(o), r(l);
|
|
446
448
|
};
|
|
447
449
|
return /* @__PURE__ */ i(
|
|
448
450
|
F,
|
|
449
451
|
{
|
|
450
|
-
ariaLabelClose:
|
|
452
|
+
ariaLabelClose: _.close_aria,
|
|
451
453
|
isOpen: n,
|
|
452
454
|
onClose: s,
|
|
453
|
-
onPrimaryAction: () =>
|
|
455
|
+
onPrimaryAction: () => c(g),
|
|
454
456
|
title: p,
|
|
455
457
|
children: [
|
|
456
458
|
/* @__PURE__ */ e(P, { color: "text.secondary", sx: { mx: 24, my: 12 }, children: a.select_debt_accounts_description }),
|
|
457
459
|
/* @__PURE__ */ i(B, { sx: { bgcolor: "background.white" }, children: [
|
|
458
460
|
/* @__PURE__ */ e(E, { variant: "fullWidth" }),
|
|
459
|
-
t.map((
|
|
460
|
-
/* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () => o
|
|
461
|
+
t.map((o, d) => /* @__PURE__ */ i(y.Fragment, { children: [
|
|
462
|
+
/* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () => m(o), children: [
|
|
461
463
|
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(
|
|
462
464
|
oe,
|
|
463
465
|
{
|
|
464
|
-
alt:
|
|
465
|
-
institutionGuid:
|
|
466
|
+
alt: o?.name || "",
|
|
467
|
+
institutionGuid: o?.institution_guid || ""
|
|
466
468
|
}
|
|
467
469
|
) }),
|
|
468
470
|
/* @__PURE__ */ e(
|
|
469
471
|
w,
|
|
470
472
|
{
|
|
471
|
-
primary: De(
|
|
473
|
+
primary: De(o, {
|
|
472
474
|
allowNickname: h?.show_account_nicknames_in_master
|
|
473
475
|
}),
|
|
474
|
-
secondary: x(
|
|
476
|
+
secondary: x(o.balance || 0, "0,0.00")
|
|
475
477
|
}
|
|
476
478
|
),
|
|
477
|
-
/* @__PURE__ */ e(rt, { checked: g.some((
|
|
479
|
+
/* @__PURE__ */ e(rt, { checked: g.some((l) => l.guid === o.guid) })
|
|
478
480
|
] }) }),
|
|
479
481
|
/* @__PURE__ */ e(E, { variant: d < t.length - 1 ? "inset" : "fullWidth" })
|
|
480
|
-
] },
|
|
482
|
+
] }, o.guid))
|
|
481
483
|
] }),
|
|
482
484
|
/* @__PURE__ */ e(
|
|
483
|
-
|
|
485
|
+
Te,
|
|
484
486
|
{
|
|
485
487
|
description: a.connect_description,
|
|
486
488
|
label: a.connect_button,
|
|
@@ -491,20 +493,20 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
491
493
|
}
|
|
492
494
|
);
|
|
493
495
|
}, wt = ({ onClose: t }) => {
|
|
494
|
-
const { goals: n } = C(), { addGoal: s, debtGoals:
|
|
495
|
-
T ===
|
|
496
|
+
const { goals: n } = C(), { addGoal: s, debtGoals: c, setAlert: p, setSelectedGoal: a } = I(), { config: _ } = Ge(), { visibleDebtAccounts: h } = j(), [g, r] = y.useState(!1), m = Ve(n), o = (l, f, T) => {
|
|
497
|
+
T === u.DEBT_TRACK ? r(!0) : a({
|
|
496
498
|
amount: 0,
|
|
497
499
|
current_amount: 0,
|
|
498
500
|
goal_type: ue.SAVE_AMOUNT,
|
|
499
501
|
initial_amount: 0,
|
|
500
502
|
meta_type: f,
|
|
501
|
-
name:
|
|
503
|
+
name: l,
|
|
502
504
|
track_type: T
|
|
503
505
|
});
|
|
504
|
-
}, d = async (
|
|
505
|
-
for (const f of
|
|
506
|
+
}, d = async (l) => {
|
|
507
|
+
for (const f of l) {
|
|
506
508
|
let T = q.CREDIT_CARD;
|
|
507
|
-
f.account_type ===
|
|
509
|
+
f.account_type === Ae.LOAN ? T = q.LOANS : f.account_type === Ae.LINE_OF_CREDIT && (T = q.LINE_OF_CREDIT), await s({
|
|
508
510
|
account_guid: f.guid,
|
|
509
511
|
amount: 0,
|
|
510
512
|
current_amount: 0,
|
|
@@ -514,19 +516,19 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
514
516
|
meta_type: T,
|
|
515
517
|
monthly_payment: f.minimum_payment || 0,
|
|
516
518
|
name: De(f, {
|
|
517
|
-
allowNickname:
|
|
519
|
+
allowNickname: _?.show_account_nicknames_in_master
|
|
518
520
|
}),
|
|
519
|
-
track_type:
|
|
521
|
+
track_type: u.DEBT_TRACK
|
|
520
522
|
}), p(n.alert_goal_added);
|
|
521
523
|
}
|
|
522
|
-
r(!1), t?.(
|
|
524
|
+
r(!1), t?.(u.DEBT_TRACK);
|
|
523
525
|
};
|
|
524
526
|
return /* @__PURE__ */ i(b, { children: [
|
|
525
|
-
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children:
|
|
527
|
+
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children: m.map((l, f) => /* @__PURE__ */ e(kt, { goalType: l, onClick: o }, f)) }),
|
|
526
528
|
/* @__PURE__ */ e(
|
|
527
529
|
Be,
|
|
528
530
|
{
|
|
529
|
-
accounts: h.filter((
|
|
531
|
+
accounts: h.filter((l) => !c.find((f) => f.account_guid === l.guid)),
|
|
530
532
|
isOpen: g,
|
|
531
533
|
onClose: () => r(!1),
|
|
532
534
|
onSave: d,
|
|
@@ -535,10 +537,10 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
535
537
|
)
|
|
536
538
|
] });
|
|
537
539
|
}, Oe = ({ account: t }) => {
|
|
538
|
-
const { accounts: n } = C(), s = ct(t), { setSelectedAccount:
|
|
540
|
+
const { accounts: n } = C(), s = ct(t), { setSelectedAccount: c } = it(), [p, a] = y.useState(!1);
|
|
539
541
|
return /* @__PURE__ */ i(N, { sx: { bgcolor: "background.paper" }, children: [
|
|
540
542
|
/* @__PURE__ */ i(k, { onClick: () => {
|
|
541
|
-
|
|
543
|
+
c(t), a(!0);
|
|
542
544
|
}, children: [
|
|
543
545
|
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(
|
|
544
546
|
oe,
|
|
@@ -562,12 +564,12 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
562
564
|
] }) })
|
|
563
565
|
] });
|
|
564
566
|
}, Dt = D(({ goal: t }) => {
|
|
565
|
-
const { goals: n } = C(), { setAlert: s, setSelectedGoal:
|
|
567
|
+
const { goals: n } = C(), { setAlert: s, setSelectedGoal: c, updateGoal: p } = I(), [a, _] = y.useState(t.amount), h = !t.guid, g = a < 0 || a > 9999999999e-2, r = t.track_type === u.SAVINGS_TRACK && t.has_been_spent || t.track_type !== u.SAVINGS_TRACK && t.is_complete, m = async () => {
|
|
566
568
|
const d = { ...t, amount: a };
|
|
567
|
-
t.amount = a, h ?
|
|
568
|
-
},
|
|
569
|
+
t.amount = a, h ? c(d) : (await p(d), s(n.alert_goal_updated_amount));
|
|
570
|
+
}, o = () => {
|
|
569
571
|
setTimeout(() => {
|
|
570
|
-
|
|
572
|
+
_(t.amount);
|
|
571
573
|
}, 250);
|
|
572
574
|
};
|
|
573
575
|
return /* @__PURE__ */ e(
|
|
@@ -576,8 +578,8 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
576
578
|
isDisabled: r,
|
|
577
579
|
isSaveDisabled: g,
|
|
578
580
|
label: n.details_amount_to_save,
|
|
579
|
-
onCancel:
|
|
580
|
-
onSave:
|
|
581
|
+
onCancel: o,
|
|
582
|
+
onSave: m,
|
|
581
583
|
primaryText: n.details_amount_to_save,
|
|
582
584
|
secondaryText: x(t.amount, "0,0"),
|
|
583
585
|
zeroStateText: h && t.amount === 0 ? n.add_amount : void 0,
|
|
@@ -589,26 +591,26 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
589
591
|
error: g,
|
|
590
592
|
fullWidth: !0,
|
|
591
593
|
minAmount: 0,
|
|
592
|
-
setAmount: (d) =>
|
|
594
|
+
setAmount: (d) => _(isNaN(Number(d)) ? a : Number(d)),
|
|
593
595
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
594
596
|
}
|
|
595
597
|
)
|
|
596
598
|
}
|
|
597
599
|
);
|
|
598
600
|
}), Kt = ({ goal: t }) => {
|
|
599
|
-
const { visibleCheckingAccounts: n, visibleSavingsAccounts: s } = j(), { accounts:
|
|
600
|
-
const f = { ...t, account_guid:
|
|
601
|
-
g ?
|
|
601
|
+
const { visibleCheckingAccounts: n, visibleSavingsAccounts: s } = j(), { accounts: c, goals: p } = C(), { setAlert: a, setSelectedGoal: _, updateGoal: h } = I(), g = !t.guid, [r, m] = y.useState(!1), o = async ({ balance: d, guid: l }) => {
|
|
602
|
+
const f = { ...t, account_guid: l, current_amount: d || 0 };
|
|
603
|
+
g ? _(f) : (await h(f), a(p.alert_account_changed)), m(!1);
|
|
602
604
|
};
|
|
603
605
|
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: () =>
|
|
606
|
+
g && !t.account_guid ? /* @__PURE__ */ e(N, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ i(k, { onClick: () => m(!0), children: [
|
|
605
607
|
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ i(b, { alignItems: "center", color: "primary.main", direction: "row", gap: 8, children: [
|
|
606
|
-
/* @__PURE__ */ e(
|
|
608
|
+
/* @__PURE__ */ e(Ie, { filled: !0 }),
|
|
607
609
|
p.details_add_account
|
|
608
610
|
] }) }),
|
|
609
611
|
/* @__PURE__ */ e(M, { color: "primary" })
|
|
610
612
|
] }) }) : /* @__PURE__ */ i(b, { sx: { gap: 8, my: 24, mx: 24 }, children: [
|
|
611
|
-
/* @__PURE__ */ e(he, { onClick: () =>
|
|
613
|
+
/* @__PURE__ */ e(he, { onClick: () => m(!0), variant: "text", children: p.details_change_account }),
|
|
612
614
|
/* @__PURE__ */ e(
|
|
613
615
|
A,
|
|
614
616
|
{
|
|
@@ -619,9 +621,9 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
619
621
|
}
|
|
620
622
|
)
|
|
621
623
|
] }),
|
|
622
|
-
/* @__PURE__ */ e(F, { isOpen: r, onClose: () =>
|
|
623
|
-
n.length > 0 && /* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children:
|
|
624
|
-
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children: n.map((d) => /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () =>
|
|
624
|
+
/* @__PURE__ */ e(F, { isOpen: r, onClose: () => m(!1), title: p.details_change_account, children: /* @__PURE__ */ i(b, { children: [
|
|
625
|
+
n.length > 0 && /* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: c.account_types[1] }),
|
|
626
|
+
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children: n.map((d) => /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () => o(d), children: [
|
|
625
627
|
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(
|
|
626
628
|
oe,
|
|
627
629
|
{
|
|
@@ -638,8 +640,8 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
638
640
|
),
|
|
639
641
|
/* @__PURE__ */ e(M, {})
|
|
640
642
|
] }) }, d.guid)) }),
|
|
641
|
-
s.length > 0 && /* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children:
|
|
642
|
-
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children: s.map((d) => /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () =>
|
|
643
|
+
s.length > 0 && /* @__PURE__ */ e(A, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: c.account_types[2] }),
|
|
644
|
+
/* @__PURE__ */ e(B, { sx: { bgcolor: "background.paper" }, children: s.map((d) => /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(k, { onClick: () => o(d), children: [
|
|
643
645
|
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(
|
|
644
646
|
oe,
|
|
645
647
|
{
|
|
@@ -657,7 +659,7 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
657
659
|
/* @__PURE__ */ e(M, {})
|
|
658
660
|
] }) }, d.guid)) }),
|
|
659
661
|
/* @__PURE__ */ e(
|
|
660
|
-
|
|
662
|
+
Te,
|
|
661
663
|
{
|
|
662
664
|
description: p.connect_description,
|
|
663
665
|
label: p.connect_button,
|
|
@@ -667,12 +669,12 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
667
669
|
] }) })
|
|
668
670
|
] });
|
|
669
671
|
}, Mt = D(({ goal: t }) => {
|
|
670
|
-
const { goals: n } = C(), { setAlert: s, setSelectedGoal:
|
|
671
|
-
const
|
|
672
|
-
t.name = a, h ?
|
|
673
|
-
},
|
|
672
|
+
const { goals: n } = C(), { setAlert: s, setSelectedGoal: c, updateGoal: p } = I(), [a, _] = y.useState(t.name), h = !t.guid, g = t.track_type === u.SAVINGS_TRACK && t.has_been_spent || t.track_type !== u.SAVINGS_TRACK && t.is_complete, r = async () => {
|
|
673
|
+
const o = { ...t, name: a };
|
|
674
|
+
t.name = a, h ? c(o) : (await p(o), s(n.alert_goal_updated_name));
|
|
675
|
+
}, m = () => {
|
|
674
676
|
setTimeout(() => {
|
|
675
|
-
|
|
677
|
+
_(t.name);
|
|
676
678
|
}, 250);
|
|
677
679
|
};
|
|
678
680
|
return /* @__PURE__ */ e(
|
|
@@ -681,7 +683,7 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
681
683
|
isDisabled: g,
|
|
682
684
|
isSaveDisabled: !a,
|
|
683
685
|
label: n.details_goal_name,
|
|
684
|
-
onCancel:
|
|
686
|
+
onCancel: m,
|
|
685
687
|
onSave: r,
|
|
686
688
|
primaryText: n.details_goal_name,
|
|
687
689
|
secondaryText: t.name,
|
|
@@ -691,28 +693,28 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
691
693
|
error: !a,
|
|
692
694
|
fullWidth: !0,
|
|
693
695
|
label: n.details_goal_name,
|
|
694
|
-
onChange: (
|
|
696
|
+
onChange: (o) => _(o.target.value),
|
|
695
697
|
value: a
|
|
696
698
|
}
|
|
697
699
|
)
|
|
698
700
|
}
|
|
699
701
|
);
|
|
700
702
|
}), Lt = ({ goal: t }) => {
|
|
701
|
-
const { goals: n } = C(), { setAlert: s, setSelectedGoal:
|
|
703
|
+
const { goals: n } = C(), { setAlert: s, setSelectedGoal: c, updateGoal: p } = I(), [a, _] = y.useState(t.retirement_age || 65), h = !t.guid, g = async () => {
|
|
702
704
|
if (!isNaN(a)) {
|
|
703
|
-
const
|
|
704
|
-
t.retirement_age = a, h ?
|
|
705
|
+
const o = { ...t, retirement_age: a };
|
|
706
|
+
t.retirement_age = a, h ? c(o) : (await p(o), s(n.alert_goal_updated_retirement_age));
|
|
705
707
|
}
|
|
706
708
|
}, r = () => {
|
|
707
709
|
setTimeout(() => {
|
|
708
|
-
|
|
710
|
+
_(t.retirement_age || 65);
|
|
709
711
|
}, 250);
|
|
710
|
-
},
|
|
712
|
+
}, m = !a || isNaN(a) || a < 20 || a >= 100;
|
|
711
713
|
return /* @__PURE__ */ e(
|
|
712
714
|
Q,
|
|
713
715
|
{
|
|
714
716
|
isDisabled: t.is_complete,
|
|
715
|
-
isSaveDisabled:
|
|
717
|
+
isSaveDisabled: m,
|
|
716
718
|
label: n.details_retirement_age,
|
|
717
719
|
onCancel: r,
|
|
718
720
|
onSave: g,
|
|
@@ -722,18 +724,18 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
722
724
|
children: /* @__PURE__ */ e(
|
|
723
725
|
Ke,
|
|
724
726
|
{
|
|
725
|
-
error:
|
|
727
|
+
error: m,
|
|
726
728
|
fullWidth: !0,
|
|
727
729
|
label: n.details_retirement_age,
|
|
728
|
-
onChange: (
|
|
730
|
+
onChange: (o) => _(Number(o.target.value)),
|
|
729
731
|
value: isNaN(a) ? "" : a
|
|
730
732
|
}
|
|
731
733
|
)
|
|
732
734
|
}
|
|
733
735
|
);
|
|
734
736
|
}, Bt = D(({ goal: t }) => {
|
|
735
|
-
const { goals: n } = C(), { user: s, updateUser:
|
|
736
|
-
a && pt(a) && (await
|
|
737
|
+
const { goals: n } = C(), { user: s, updateUser: c } = Ne(), { setAlert: p } = I(), [a, _] = y.useState(J(s.birthday ?? 0)), [h, g] = y.useState(null), r = t.is_complete, m = async () => {
|
|
738
|
+
a && pt(a) && (await c({ ...s, birthday: _t(a) }), p(n.alert_goal_updated_birthday));
|
|
737
739
|
};
|
|
738
740
|
return /* @__PURE__ */ e(
|
|
739
741
|
Q,
|
|
@@ -741,7 +743,7 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
741
743
|
isDisabled: r,
|
|
742
744
|
isSaveDisabled: !!h,
|
|
743
745
|
label: n.details_birthday,
|
|
744
|
-
onSave:
|
|
746
|
+
onSave: m,
|
|
745
747
|
primaryText: n.details_birthday,
|
|
746
748
|
secondaryText: `${re(J(s.birthday ?? 0), ie.MONTH_DAY_YEAR)}`,
|
|
747
749
|
zeroStateText: !t.guid && !s.birthday ? n.add_birthday : void 0,
|
|
@@ -749,8 +751,8 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
749
751
|
gt,
|
|
750
752
|
{
|
|
751
753
|
label: n.details_birthday,
|
|
752
|
-
onChange:
|
|
753
|
-
onError: (
|
|
754
|
+
onChange: _,
|
|
755
|
+
onError: (o) => g(o),
|
|
754
756
|
sx: { width: "100%" },
|
|
755
757
|
value: a
|
|
756
758
|
}
|
|
@@ -759,14 +761,14 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
759
761
|
);
|
|
760
762
|
}), Ot = ({ goal: t }) => {
|
|
761
763
|
const { goals: n } = C(), { visibleRetirementAccounts: s } = j(), {
|
|
762
|
-
addRetirementGoalAccount:
|
|
764
|
+
addRetirementGoalAccount: c,
|
|
763
765
|
newRetirementGoalAccounts: p,
|
|
764
766
|
retirementGoalAccounts: a,
|
|
765
|
-
selectedGoal:
|
|
767
|
+
selectedGoal: _,
|
|
766
768
|
setAlert: h,
|
|
767
769
|
setNewRetirementGoalAccounts: g,
|
|
768
770
|
setSelectedGoal: r
|
|
769
|
-
} = I(), [
|
|
771
|
+
} = I(), [m, o] = y.useState(!1), d = !t.guid, l = s.filter(
|
|
770
772
|
(S) => d ? p.find((R) => R.account_guid === S.guid) : a.find((R) => R.account_guid === S.guid)
|
|
771
773
|
), f = s.filter(
|
|
772
774
|
(S) => !a.find((R) => R.account_guid === S.guid)
|
|
@@ -779,20 +781,20 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
779
781
|
g(R);
|
|
780
782
|
else
|
|
781
783
|
for (const v of R)
|
|
782
|
-
await
|
|
784
|
+
await c(v), h(n.alert_account_added);
|
|
783
785
|
r({
|
|
784
|
-
...
|
|
786
|
+
..._,
|
|
785
787
|
current_amount: S.reduce((v, K) => v + (K.balance || 0), 0)
|
|
786
|
-
}),
|
|
788
|
+
}), o(!1);
|
|
787
789
|
};
|
|
788
790
|
return /* @__PURE__ */ i(b, { children: [
|
|
789
|
-
|
|
791
|
+
l.map((S) => /* @__PURE__ */ i(b, { children: [
|
|
790
792
|
/* @__PURE__ */ e(Oe, { account: S }),
|
|
791
793
|
/* @__PURE__ */ e(E, {})
|
|
792
794
|
] }, S.guid)),
|
|
793
|
-
/* @__PURE__ */ e(N, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ i(k, { onClick: () =>
|
|
795
|
+
/* @__PURE__ */ e(N, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ i(k, { onClick: () => o(!0), children: [
|
|
794
796
|
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ i(b, { alignItems: "center", color: "primary.main", direction: "row", gap: 8, children: [
|
|
795
|
-
/* @__PURE__ */ e(
|
|
797
|
+
/* @__PURE__ */ e(Ie, { filled: !0 }),
|
|
796
798
|
n.details_add_account
|
|
797
799
|
] }) }),
|
|
798
800
|
/* @__PURE__ */ e(M, { color: "primary" })
|
|
@@ -801,20 +803,20 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
801
803
|
Be,
|
|
802
804
|
{
|
|
803
805
|
accounts: f,
|
|
804
|
-
isOpen:
|
|
805
|
-
onClose: () =>
|
|
806
|
+
isOpen: m,
|
|
807
|
+
onClose: () => o(!1),
|
|
806
808
|
onSave: T,
|
|
807
809
|
title: n.add_select_accounts
|
|
808
810
|
}
|
|
809
811
|
)
|
|
810
812
|
] });
|
|
811
813
|
}, Wt = D(({ goal: t }) => {
|
|
812
|
-
const { goals: n } = C(), { visibleAccounts: s } = j(),
|
|
813
|
-
() => s.find((
|
|
814
|
+
const { goals: n } = C(), { visibleAccounts: s } = j(), c = y.useMemo(
|
|
815
|
+
() => s.find((_) => _.guid === t.account_guid),
|
|
814
816
|
[s, t]
|
|
815
817
|
), p = t.track_type;
|
|
816
818
|
let a = n.details_save_title;
|
|
817
|
-
return t.track_type ===
|
|
819
|
+
return t.track_type === u.DEBT_TRACK ? a = n.details_debt_title : t.track_type === u.RETIREMENT_TRACK && (a = n.details_retirement_title), /* @__PURE__ */ i(b, { children: [
|
|
818
820
|
/* @__PURE__ */ i(b, { mx: 24, children: [
|
|
819
821
|
/* @__PURE__ */ e(A, { color: "text.secondary", sx: { mb: 4, mt: 24 }, variant: "XSmall", children: a }),
|
|
820
822
|
/* @__PURE__ */ e(Le, { goal: t, isInDrawer: !0 }),
|
|
@@ -823,11 +825,11 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
823
825
|
/* @__PURE__ */ i(B, { sx: { bgcolor: "background.paper" }, children: [
|
|
824
826
|
/* @__PURE__ */ e(Mt, { goal: t }),
|
|
825
827
|
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
826
|
-
(p ===
|
|
828
|
+
(p === u.SAVINGS_TRACK || p === u.RETIREMENT_TRACK) && /* @__PURE__ */ i(U, { children: [
|
|
827
829
|
/* @__PURE__ */ e(Dt, { goal: t }),
|
|
828
|
-
/* @__PURE__ */ e(E, { sx: { ml: p ===
|
|
830
|
+
/* @__PURE__ */ e(E, { sx: { ml: p === u.RETIREMENT_TRACK ? 24 : 0 } })
|
|
829
831
|
] }),
|
|
830
|
-
t.track_type ===
|
|
832
|
+
t.track_type === u.DEBT_TRACK && /* @__PURE__ */ i(U, { children: [
|
|
831
833
|
/* @__PURE__ */ e(dt, { goal: t }),
|
|
832
834
|
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
833
835
|
/* @__PURE__ */ e(mt, { goal: t }),
|
|
@@ -835,68 +837,68 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
835
837
|
/* @__PURE__ */ e(ut, { goal: t }),
|
|
836
838
|
/* @__PURE__ */ e(E, { variant: "fullWidth" })
|
|
837
839
|
] }),
|
|
838
|
-
t.track_type ===
|
|
840
|
+
t.track_type === u.RETIREMENT_TRACK && /* @__PURE__ */ i(U, { children: [
|
|
839
841
|
/* @__PURE__ */ e(Lt, { goal: t }),
|
|
840
842
|
/* @__PURE__ */ e(E, { sx: { ml: 24 } }),
|
|
841
843
|
/* @__PURE__ */ e(Bt, { goal: t }),
|
|
842
844
|
/* @__PURE__ */ e(E, { variant: "fullWidth" })
|
|
843
845
|
] })
|
|
844
846
|
] }),
|
|
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(Oe, { account:
|
|
847
|
+
/* @__PURE__ */ e(A, { color: "text.secondary", sx: { mb: 4, ml: 24, mt: 12 }, variant: "XSmall", children: t.track_type === u.RETIREMENT_TRACK ? n.details_accounts : n.details_account }),
|
|
848
|
+
t.track_type !== u.RETIREMENT_TRACK && c && /* @__PURE__ */ i(U, { children: [
|
|
849
|
+
/* @__PURE__ */ e(Oe, { account: c }),
|
|
848
850
|
/* @__PURE__ */ e(E, {})
|
|
849
851
|
] }),
|
|
850
|
-
t.track_type ===
|
|
852
|
+
t.track_type === u.RETIREMENT_TRACK && /* @__PURE__ */ i(U, { children: [
|
|
851
853
|
/* @__PURE__ */ e(Ot, { goal: t }),
|
|
852
854
|
/* @__PURE__ */ e(E, {})
|
|
853
855
|
] }),
|
|
854
|
-
t.track_type ===
|
|
856
|
+
t.track_type === u.SAVINGS_TRACK && !t.is_complete && /* @__PURE__ */ e(Kt, { goal: t })
|
|
855
857
|
] });
|
|
856
858
|
}), Pt = D(({ onClose: t }) => {
|
|
857
|
-
const { visibleRetirementAccounts: n } = j(), { goals: s, common:
|
|
859
|
+
const { visibleRetirementAccounts: n } = j(), { goals: s, common: c } = C(), {
|
|
858
860
|
addGoal: p,
|
|
859
861
|
addRetirementGoal: a,
|
|
860
|
-
deleteGoal:
|
|
862
|
+
deleteGoal: _,
|
|
861
863
|
deleteRetirementGoal: h,
|
|
862
864
|
newRetirementGoalAccounts: g,
|
|
863
865
|
retirementGoalAccounts: r,
|
|
864
|
-
selectedGoal:
|
|
865
|
-
setAlert:
|
|
866
|
+
selectedGoal: m,
|
|
867
|
+
setAlert: o,
|
|
866
868
|
setSelectedGoal: d,
|
|
867
|
-
updateGoal:
|
|
868
|
-
} = I(), { user: f } =
|
|
869
|
+
updateGoal: l
|
|
870
|
+
} = I(), { user: f } = Ne(), [T, S] = y.useState(!1), R = !m?.guid, v = m?.track_type === u.SAVINGS_TRACK && m.is_complete && !m.has_been_spent, K = y.useMemo(() => {
|
|
869
871
|
const G = R ? g : r;
|
|
870
872
|
return n.filter((H) => G.some(($) => $.account_guid === H.guid));
|
|
871
873
|
}, [R, n, g, r]), se = y.useMemo(() => {
|
|
872
|
-
if (!
|
|
874
|
+
if (!m) return !1;
|
|
873
875
|
if (!R && !v) return !0;
|
|
874
|
-
const { account_guid: G, track_type: H, name: $, amount: O, retirement_age: ne } =
|
|
875
|
-
return H ===
|
|
876
|
-
}, [
|
|
877
|
-
let W =
|
|
878
|
-
R ? (z = () => ee(), W =
|
|
876
|
+
const { account_guid: G, track_type: H, name: $, amount: O, retirement_age: ne } = m;
|
|
877
|
+
return H === u.SAVINGS_TRACK ? G ? !!$ && !!O : !1 : H === u.RETIREMENT_TRACK ? K.length ? !!$ && !!O && !!ne && !!f.birthday : !1 : !0;
|
|
878
|
+
}, [m, K, f.birthday]);
|
|
879
|
+
let W = c.delete_button, z = () => S(!0);
|
|
880
|
+
R ? (z = () => ee(), W = c.save_button) : v && (z = () => le(), W = s.mark_as_complete_button);
|
|
879
881
|
const ee = async () => {
|
|
880
|
-
if (
|
|
881
|
-
const G =
|
|
882
|
-
G !==
|
|
882
|
+
if (m) {
|
|
883
|
+
const G = m.track_type;
|
|
884
|
+
G !== u.RETIREMENT_TRACK ? await p(m) : G === u.RETIREMENT_TRACK && await a({ ...m, target_amount: m.amount }), o(s.alert_goal_added), d(void 0), G && t?.(G);
|
|
883
885
|
}
|
|
884
886
|
}, te = async () => {
|
|
885
|
-
|
|
887
|
+
m && (m.track_type !== u.RETIREMENT_TRACK ? await _(m.guid) : m.track_type === u.RETIREMENT_TRACK && await h(m), o(s.alert_goal_deleted), d(void 0));
|
|
886
888
|
}, le = async () => {
|
|
887
889
|
const G = {
|
|
888
|
-
...
|
|
890
|
+
...m,
|
|
889
891
|
has_been_spent: !0
|
|
890
892
|
};
|
|
891
|
-
await
|
|
893
|
+
await l(G), o(s.alert_goal_completed), d(void 0);
|
|
892
894
|
};
|
|
893
895
|
return /* @__PURE__ */ i(b, { children: [
|
|
894
896
|
/* @__PURE__ */ e(
|
|
895
897
|
F,
|
|
896
898
|
{
|
|
897
|
-
ariaLabelClose:
|
|
899
|
+
ariaLabelClose: c.close_aria,
|
|
898
900
|
hasSecondaryAction: R,
|
|
899
|
-
isOpen: !!
|
|
901
|
+
isOpen: !!m,
|
|
900
902
|
isPrimaryDisabled: !se,
|
|
901
903
|
onClose: () => d(void 0),
|
|
902
904
|
onPrimaryAction: z,
|
|
@@ -904,39 +906,39 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
904
906
|
primaryText: W,
|
|
905
907
|
secondaryColor: "primary",
|
|
906
908
|
title: s.goal_details,
|
|
907
|
-
children:
|
|
909
|
+
children: m && /* @__PURE__ */ e(Wt, { goal: m })
|
|
908
910
|
}
|
|
909
911
|
),
|
|
910
912
|
/* @__PURE__ */ e(
|
|
911
913
|
nt,
|
|
912
914
|
{
|
|
913
|
-
copy: { close_aria:
|
|
915
|
+
copy: { close_aria: c.close_aria, title: s.delete_goal },
|
|
914
916
|
isOpen: T,
|
|
915
917
|
maxWidth: "xs",
|
|
916
918
|
onClose: () => S(!1),
|
|
917
919
|
onPrimaryAction: te,
|
|
918
920
|
primaryColor: "error",
|
|
919
|
-
primaryText:
|
|
920
|
-
children: /* @__PURE__ */ e(A, { sx: { textWrap: "wrap" }, variant: "Paragraph", children: L(s.delete_description,
|
|
921
|
+
primaryText: c.delete_button,
|
|
922
|
+
children: /* @__PURE__ */ e(A, { sx: { textWrap: "wrap" }, variant: "Paragraph", children: L(s.delete_description, m?.name || "") })
|
|
921
923
|
}
|
|
922
924
|
)
|
|
923
925
|
] });
|
|
924
926
|
}), Xn = D(({ onBackClick: t, sx: n }) => {
|
|
925
|
-
const { onEvent: s } =
|
|
927
|
+
const { onEvent: s } = ke(), { onLoad: c } = Qe(), { isMobile: p } = be(), { visibleAccounts: a } = j(), { isCopyLoaded: _, isInitialized: h, setSelectedAccounts: g } = ge(), { goals: r, common: m } = C(), { alert: o, goals: d, goalsLoaded: l, 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 = _ ? L(
|
|
926
928
|
p ? r.tab_subtitle_mobile : r.tab_subtitle,
|
|
927
929
|
x(z, "0,0")
|
|
928
|
-
) : "", G =
|
|
930
|
+
) : "", G = _ ? L(
|
|
929
931
|
p ? r.tab_subtitle_mobile : r.tab_subtitle,
|
|
930
932
|
x(ee, "0,0")
|
|
931
|
-
) : "", H =
|
|
933
|
+
) : "", H = _ ? L(
|
|
932
934
|
p ? r.tab_subtitle_mobile : r.tab_subtitle,
|
|
933
935
|
x(te, "0,0")
|
|
934
936
|
) : "";
|
|
935
937
|
y.useEffect(() => {
|
|
936
938
|
g(a), s(Y.GOALS_VIEW);
|
|
937
|
-
}, []), y.useEffect(() => {
|
|
939
|
+
}, [a]), y.useEffect(() => {
|
|
938
940
|
h && f().finally(() => {
|
|
939
|
-
|
|
941
|
+
c?.("GoalsWidget");
|
|
940
942
|
});
|
|
941
943
|
}, [h, z, ee, te]);
|
|
942
944
|
const $ = () => {
|
|
@@ -944,12 +946,12 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
944
946
|
}, O = () => {
|
|
945
947
|
W(!0), s(Y.GOALS_CLICK_ADD);
|
|
946
948
|
}, ne = (X) => {
|
|
947
|
-
W(!1), X ===
|
|
949
|
+
W(!1), X === u.SAVINGS_TRACK ? K(0) : X === u.DEBT_TRACK ? K(1) : X === u.RETIREMENT_TRACK && K(2);
|
|
948
950
|
}, Z = y.useMemo(
|
|
949
|
-
() =>
|
|
950
|
-
[d,
|
|
951
|
+
() => l && (d.length === 0 || d.every(({ track_type: X }) => !X) && R.length === 0),
|
|
952
|
+
[d, l, R]
|
|
951
953
|
);
|
|
952
|
-
return !
|
|
954
|
+
return !l || !_ || !h ? /* @__PURE__ */ e(Me, {}) : /* @__PURE__ */ i(
|
|
953
955
|
ft,
|
|
954
956
|
{
|
|
955
957
|
accountOptions: a,
|
|
@@ -1015,39 +1017,39 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
1015
1017
|
}
|
|
1016
1018
|
}
|
|
1017
1019
|
) : /* @__PURE__ */ i(U, { children: [
|
|
1018
|
-
v === 0 && /* @__PURE__ */ e(me, { onAddGoals: O, trackType:
|
|
1019
|
-
v === 1 && /* @__PURE__ */ e(me, { onAddGoals: O, trackType:
|
|
1020
|
-
v === 2 && /* @__PURE__ */ e(me, { onAddGoals: O, trackType:
|
|
1020
|
+
v === 0 && /* @__PURE__ */ e(me, { onAddGoals: O, trackType: u.SAVINGS_TRACK }),
|
|
1021
|
+
v === 1 && /* @__PURE__ */ e(me, { onAddGoals: O, trackType: u.DEBT_TRACK }),
|
|
1022
|
+
v === 2 && /* @__PURE__ */ e(me, { onAddGoals: O, trackType: u.RETIREMENT_TRACK })
|
|
1021
1023
|
] })
|
|
1022
1024
|
] }),
|
|
1023
1025
|
/* @__PURE__ */ e(Pt, { onClose: ne }),
|
|
1024
1026
|
/* @__PURE__ */ e(
|
|
1025
1027
|
F,
|
|
1026
1028
|
{
|
|
1027
|
-
ariaLabelClose:
|
|
1029
|
+
ariaLabelClose: m.close_aria,
|
|
1028
1030
|
isOpen: se,
|
|
1029
1031
|
onClose: () => W(!1),
|
|
1030
1032
|
title: r.add_goal_title,
|
|
1031
1033
|
children: /* @__PURE__ */ e(wt, { onClose: ne })
|
|
1032
1034
|
}
|
|
1033
1035
|
),
|
|
1034
|
-
/* @__PURE__ */ e(Fe, { onClose: () => S(""), open: !!
|
|
1036
|
+
/* @__PURE__ */ e(Fe, { onClose: () => S(""), open: !!o, children: /* @__PURE__ */ e(je, { onClose: () => S(""), severity: "success", variant: "filled", children: o }) })
|
|
1035
1037
|
]
|
|
1036
1038
|
}
|
|
1037
1039
|
);
|
|
1038
1040
|
}), Vt = D(({ goal: t }) => {
|
|
1039
1041
|
const { goals: n } = C(), s = Ct(), {
|
|
1040
|
-
backgroundColor:
|
|
1042
|
+
backgroundColor: c,
|
|
1041
1043
|
color: p,
|
|
1042
1044
|
percentage: a,
|
|
1043
|
-
projectedText:
|
|
1045
|
+
projectedText: _
|
|
1044
1046
|
} = _e(n, t), h = Math.round(a * 100);
|
|
1045
|
-
let g = /* @__PURE__ */ e(
|
|
1046
|
-
return t.track_type ===
|
|
1047
|
-
/* @__PURE__ */ e(ae, { sx: { bgcolor:
|
|
1047
|
+
let g = /* @__PURE__ */ e(Ee, {});
|
|
1048
|
+
return t.track_type === u.DEBT_TRACK ? g = /* @__PURE__ */ e(xe, {}) : t.track_type === u.RETIREMENT_TRACK && (g = /* @__PURE__ */ e(ve, {})), /* @__PURE__ */ i(b, { alignItems: "center", direction: "row", spacing: 12, sx: { py: 12 }, children: [
|
|
1049
|
+
/* @__PURE__ */ e(ae, { sx: { bgcolor: c, color: p, height: 32, width: 32 }, variant: "rounded", children: g }),
|
|
1048
1050
|
/* @__PURE__ */ i(Tt, { sx: { width: "100%" }, children: [
|
|
1049
1051
|
/* @__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:
|
|
1052
|
+
t.projected_to_complete_at && /* @__PURE__ */ e(A, { color: "text.secondary", variant: "XSmall", children: _ })
|
|
1051
1053
|
] }),
|
|
1052
1054
|
/* @__PURE__ */ e(
|
|
1053
1055
|
St,
|
|
@@ -1085,7 +1087,7 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
1085
1087
|
]
|
|
1086
1088
|
}
|
|
1087
1089
|
), Un = D(({ onCTAClick: t }) => {
|
|
1088
|
-
const { visibleAccounts: n } = j(), { onEvent: s } =
|
|
1090
|
+
const { visibleAccounts: n } = j(), { onEvent: s } = ke(), { goals: c } = C(), { isInitialized: p, setSelectedAccounts: a, isCopyLoaded: _ } = ge(), { ongoingGoalsForMicroWidget: h, loadGoals: g, goalsLoaded: r } = I();
|
|
1089
1091
|
y.useEffect(() => {
|
|
1090
1092
|
a(n);
|
|
1091
1093
|
}, []), y.useEffect(() => {
|
|
@@ -1093,30 +1095,30 @@ const Et = (t, n) => n ? x(t, t < 1e3 ? "0" : "0.00a").replace(
|
|
|
1093
1095
|
state: n?.length ? "default" : "zeroState"
|
|
1094
1096
|
}));
|
|
1095
1097
|
}, [p]);
|
|
1096
|
-
const
|
|
1098
|
+
const m = y.useMemo(
|
|
1097
1099
|
() => r && h.length === 0,
|
|
1098
1100
|
[h, r]
|
|
1099
|
-
),
|
|
1101
|
+
), o = () => {
|
|
1100
1102
|
s(
|
|
1101
|
-
|
|
1103
|
+
m ? Y.GOALS_CLICK_GET_STARTED : Y.GOALS_CLICK_VIEW_DETAILS
|
|
1102
1104
|
), t();
|
|
1103
1105
|
};
|
|
1104
|
-
return !r || !
|
|
1106
|
+
return !r || !_ || !p ? /* @__PURE__ */ e(Me, {}) : /* @__PURE__ */ e(
|
|
1105
1107
|
Rt,
|
|
1106
1108
|
{
|
|
1107
1109
|
className: "mx-goals-microwidget",
|
|
1108
|
-
ctaLabel:
|
|
1109
|
-
onCTAClick:
|
|
1110
|
-
title:
|
|
1111
|
-
children:
|
|
1110
|
+
ctaLabel: m ? c.get_started : c.view_details,
|
|
1111
|
+
onCTAClick: o,
|
|
1112
|
+
title: c.title,
|
|
1113
|
+
children: m ? /* @__PURE__ */ e(
|
|
1112
1114
|
jt,
|
|
1113
1115
|
{
|
|
1114
|
-
header:
|
|
1115
|
-
subText:
|
|
1116
|
+
header: c.create_goals_header,
|
|
1117
|
+
subText: c.micro_zero_state_description
|
|
1116
1118
|
}
|
|
1117
|
-
) : /* @__PURE__ */ e(At, { sx: { justifyContent: "space-between" }, children: h.map((d,
|
|
1119
|
+
) : /* @__PURE__ */ e(At, { sx: { justifyContent: "space-between" }, children: h.map((d, l) => /* @__PURE__ */ i(y.Fragment, { children: [
|
|
1118
1120
|
/* @__PURE__ */ e(Vt, { goal: d }),
|
|
1119
|
-
|
|
1121
|
+
l !== h.length - 1 && /* @__PURE__ */ e(E, {})
|
|
1120
1122
|
] }, d.guid)) })
|
|
1121
1123
|
}
|
|
1122
1124
|
);
|