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