@mx-cartographer/experiences 7.2.16 → 7.2.17

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