@mx-cartographer/experiences 9.0.2 → 9.1.0-alpha.bb1

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