@mx-cartographer/experiences 7.7.2 → 7.8.0-alpha-ram-goal-bug

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