@mx-cartographer/experiences 9.0.3 → 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 (121) hide show
  1. package/CHANGELOG.md +0 -4
  2. package/dist/Analytics-BKzTPees.mjs +61 -0
  3. package/dist/GlobalCopyApi-BeXzaDH9.mjs +487 -0
  4. package/dist/HeaderCell-EhCUSjvj.mjs +10 -0
  5. package/dist/Loader-BlVzRtUd.mjs +73 -0
  6. package/dist/MiniWidgetContainer-COwnjfy7.mjs +110 -0
  7. package/dist/OriginalBalanceAction-sbiqaxok.mjs +110 -0
  8. package/dist/SpendingLegend-D15ixlQ1.mjs +222 -0
  9. package/dist/accounts/index.es.js +12 -1598
  10. package/dist/accounts-DkyAiLpg.mjs +15632 -0
  11. package/dist/analytics/index.es.js +155 -139
  12. package/dist/budgets/index.es.js +1317 -1266
  13. package/dist/cashflow/index.es.js +1047 -942
  14. package/dist/categories/index.es.js +4 -4
  15. package/dist/common/index.es.js +101 -310
  16. package/dist/core/index.es.js +80 -104
  17. package/dist/core-BexP5oiV.mjs +4047 -0
  18. package/dist/dashboard/index.es.js +185 -141
  19. package/dist/debts/index.es.js +1384 -1272
  20. package/dist/finstrong/index.es.js +3366 -3471
  21. package/dist/goals/index.es.js +1103 -984
  22. package/dist/help/index.es.js +3 -25
  23. package/dist/help-CctDYrAH.mjs +2308 -0
  24. package/dist/insights/index.es.js +93 -4843
  25. package/dist/investments/index.es.js +1533 -1522
  26. package/dist/merchants/index.es.js +75 -64
  27. package/dist/microinsights/index.es.js +15 -824
  28. package/dist/microinsights-CRf3ChsJ.mjs +1814 -0
  29. package/dist/networth/index.es.js +550 -503
  30. package/dist/notifications/index.es.js +169 -161
  31. package/dist/recurringtransactions/index.es.js +10 -962
  32. package/dist/recurringtransactions-gbJ_NA8u.mjs +1564 -0
  33. package/dist/settings/index.es.js +13 -880
  34. package/dist/settings-ZMHe439l.mjs +1526 -0
  35. package/dist/spending/index.es.js +400 -456
  36. package/dist/transactions/index.es.js +10 -603
  37. package/dist/trends/index.es.js +1268 -1407
  38. package/package.json +28 -28
  39. package/dist/Account-BaJmiJAG.mjs +0 -118
  40. package/dist/Account-BxHMlV9R.mjs +0 -30
  41. package/dist/AccountDetailsHeader-DIysk_4w.mjs +0 -95
  42. package/dist/AccountDisplayName-CO7z3v99.mjs +0 -11
  43. package/dist/AccountFields-mwJ8NXsX.mjs +0 -141
  44. package/dist/AccountListItem-BDXHs4tV.mjs +0 -94
  45. package/dist/AccountUtils-T5_Odvos.mjs +0 -27
  46. package/dist/Accounts-CseLC3lL.mjs +0 -5
  47. package/dist/Analytics-CkYXKvco.mjs +0 -53
  48. package/dist/Analytics-CzGzz_sE.mjs +0 -136
  49. package/dist/ApiEndpoints-DXwIYNUV.mjs +0 -49
  50. package/dist/BudgetUtil-Bg2AQJpQ.mjs +0 -74
  51. package/dist/Category-DEKZGLYe.mjs +0 -301
  52. package/dist/CategorySelectorDrawer-8soGrhB8.mjs +0 -430
  53. package/dist/Connect-Dk6GZEsA.mjs +0 -39
  54. package/dist/ConnectCard-CCep7Zqe.mjs +0 -54
  55. package/dist/ConnectDrawer-Cnjr3Ddg.mjs +0 -58
  56. package/dist/ConnectionsDrawer-CtfPXk0M.mjs +0 -54
  57. package/dist/CurrencyDialog-DumQCTPO.mjs +0 -373
  58. package/dist/CurrencyInput-adTIRtL3.mjs +0 -87
  59. package/dist/CurrencyText-CCbE6MmF.mjs +0 -20
  60. package/dist/DateFormats-HudZ3Bjs.mjs +0 -64
  61. package/dist/DateUtil-Bhq59ZVg.mjs +0 -58
  62. package/dist/DebtUtils-DD3186U-.mjs +0 -153
  63. package/dist/Dialog-Bvd2n8hz.mjs +0 -66
  64. package/dist/Donut-SzzfZDHF.mjs +0 -88
  65. package/dist/Drawer-BXqqBMxg.mjs +0 -174
  66. package/dist/EmbeddedCard-DPwJjqMH.mjs +0 -856
  67. package/dist/EmptyState-CJUDc3kD.mjs +0 -84
  68. package/dist/Error-Dogaw2jO.mjs +0 -84
  69. package/dist/ErrorBoundary-CsdOcnJ9.mjs +0 -23
  70. package/dist/ExportCsvAction-Bw02ZJEj.mjs +0 -24
  71. package/dist/GlobalAccountFilter-7Cg2-9A5.mjs +0 -237
  72. package/dist/GlobalCopyApi-wcnDUzMV.mjs +0 -128
  73. package/dist/GoalsUtil-C9EnLWvC.mjs +0 -107
  74. package/dist/HeaderCell-P8w6CmfO.mjs +0 -6
  75. package/dist/Help-CkQTjORd.mjs +0 -299
  76. package/dist/Help-DJ8PrVHX.mjs +0 -3209
  77. package/dist/IconBacking-DgT8DCeh.mjs +0 -39
  78. package/dist/InformationTooltip-4su8bn1e.mjs +0 -41
  79. package/dist/InvestmentUtil-BItV7uEs.mjs +0 -134
  80. package/dist/LineChart-CejWS_rh.mjs +0 -612
  81. package/dist/ListItemAction-CzZ8s39Z.mjs +0 -69
  82. package/dist/ListItemRow-kH1rn8Xu.mjs +0 -67
  83. package/dist/ListItemWrapper-B5r-YQQ_.mjs +0 -42
  84. package/dist/Loader-CxeBwuPG.mjs +0 -21
  85. package/dist/Localization-DnoVyBNK.mjs +0 -38
  86. package/dist/ManageIncome-D1yBODQi.mjs +0 -595
  87. package/dist/MicroWidgetContainer-CfKdQfhi.mjs +0 -45
  88. package/dist/MiniWidgetContainer-BdPiUU-u.mjs +0 -66
  89. package/dist/NetWorthUtils-DilGN1nW.mjs +0 -95
  90. package/dist/Notification-DTNYSd8P.mjs +0 -7
  91. package/dist/NotificationSettings-B4JA5IKE.mjs +0 -677
  92. package/dist/NotificationUtils-BRGFTePr.mjs +0 -23
  93. package/dist/NumberFormatting--XMeeBfr.mjs +0 -49
  94. package/dist/OriginalBalanceAction-BybTXDtO.mjs +0 -114
  95. package/dist/RecurringSettings-D2xbNb67.mjs +0 -88
  96. package/dist/RecurringTransactionsUtil-B3rLEx_g.mjs +0 -253
  97. package/dist/ResponsiveButton-CC9F_Ezk.mjs +0 -45
  98. package/dist/SearchBox-Cpgu_gdO.mjs +0 -50
  99. package/dist/Select-BFt-HD-L.mjs +0 -55
  100. package/dist/SelectionBox-B4xELRgp.mjs +0 -48
  101. package/dist/SingleSegmentDonut-7Uy6VEld.mjs +0 -69
  102. package/dist/Sizes-DISGrlUg.mjs +0 -6
  103. package/dist/SkeletonLoader-BaNboJjD.mjs +0 -38
  104. package/dist/SpendingData-Fii_xATx.mjs +0 -53
  105. package/dist/SpendingLegend-5Ct_FZ8o.mjs +0 -193
  106. package/dist/StatusBar-CPfSXe80.mjs +0 -30
  107. package/dist/TabContentContainer-CnMXkVqr.mjs +0 -21
  108. package/dist/ToggleListItem-Dl1lXNwj.mjs +0 -91
  109. package/dist/TransactionDetails-DctXr07p.mjs +0 -1714
  110. package/dist/TransactionUtils-BphBJBbU.mjs +0 -234
  111. package/dist/TrendsUtil-D9z3kIj_.mjs +0 -69
  112. package/dist/UserStore-CRpKQjpP.mjs +0 -3002
  113. package/dist/ViewMoreMicroCard-BD_MNc2z.mjs +0 -1295
  114. package/dist/WidgetContainer-CmbU4CBH.mjs +0 -482
  115. package/dist/hooks-BaO_gOI6.mjs +0 -77
  116. package/dist/useAccountDisplayName-CFa_MrS6.mjs +0 -15
  117. package/dist/useAriaLive-MkYebyUR.mjs +0 -35
  118. package/dist/useDimensions-CeDR9V8N.mjs +0 -36
  119. package/dist/useInsightsEnabled-DaNLPmUU.mjs +0 -11
  120. package/dist/useScreenSize-mWpmnh5w.mjs +0 -36
  121. package/dist/useWidgetLoadTimer-CJb-RELP.mjs +0 -19
@@ -1,541 +1,618 @@
1
- import { jsx as e, jsxs as l, Fragment as R } from "react/jsx-runtime";
2
- import f from "react";
3
- import { observer as C } from "mobx-react-lite";
1
+ import { s as S } from "../GlobalCopyApi-BeXzaDH9.mjs";
2
+ import { B as Be, Ft as Pe, J as A, Pt as H, R as Re, V as L, X as Le, ln as Z, un as Q, z as Fe } from "../core-BexP5oiV.mjs";
3
+ import { An as $e, Bn as oe, Gn as Oe, Hn as We, In as be, a as Ge, bn as He, kn as ee, lr as ie, mr as le, sr as C } from "../accounts-DkyAiLpg.mjs";
4
+ import { n as ze } from "../Analytics-BKzTPees.mjs";
5
+ import { M as je, d as E, g as z, h as Ve, i as Ye, l as te, n as re, p as w, t as Ke } from "../Loader-BlVzRtUd.mjs";
6
+ import { n as Ue, r as Xe, t as qe } from "../OriginalBalanceAction-sbiqaxok.mjs";
7
+ import { t as O } from "../HeaderCell-EhCUSjvj.mjs";
8
+ import g from "react";
9
+ import { observer as v } from "mobx-react-lite";
4
10
  import y from "@mui/material/Stack";
5
- import { useTheme as j, Card as ge, Stack as u, Box as W } from "@mui/material";
6
- import { Text as i, P as xe, H3 as Be, InstitutionLogo as Pe, Icon as ne } from "@mxenabled/mxui";
7
- import { intervalToDuration as Re, formatDuration as Le } from "date-fns";
8
- import { s as Fe, D as F, t as $e, b as Oe } from "../DebtUtils-DD3186U-.mjs";
9
- import { f as I, a as We } from "../NumberFormatting--XMeeBfr.mjs";
10
- import { f as J, D as Q } from "../DateFormats-HudZ3Bjs.mjs";
11
- import { G as Ge, q as ee, u as w, k as V, g as k, d as te, a as He, b as ze } from "../hooks-BaO_gOI6.mjs";
12
- import { u as ae } from "../useScreenSize-mWpmnh5w.mjs";
13
- import { b as T } from "../Localization-DnoVyBNK.mjs";
14
- import { D as ie } from "../Drawer-BXqqBMxg.mjs";
15
- import { A as je, u as Ve } from "../AccountDetailsHeader-DIysk_4w.mjs";
16
- import Ye from "@mui/material/Card";
17
- import Ke from "@mui/material/CardContent";
18
- import Ue from "@mui/material/CardHeader";
19
- import le from "@mui/material/Box";
20
- import { useTheme as qe } from "@mui/material/styles";
21
- import { LineChart as Xe } from "@mui/x-charts/LineChart";
22
- import { A as S } from "../Analytics-CzGzz_sE.mjs";
23
- import be from "@mui/material/Tab";
24
- import Ze from "@mui/material/Tabs";
25
- import we from "@mui/material/List";
11
+ import { H3 as Je, Icon as ne, InstitutionLogo as Ze, P as ge, Text as i } from "@mxenabled/mxui";
12
+ import xe from "@mui/material/Button";
13
+ import me from "@mui/material/Paper";
14
+ import { CheckCircle as we, Error as Qe } from "@mxenabled/mx-icons";
15
+ import { Fragment as B, jsx as e, jsxs as l } from "react/jsx-runtime";
16
+ import { useTheme as et } from "@mui/material/styles";
17
+ import se from "@mui/material/Box";
18
+ import _e from "@mui/material/Tab";
19
+ import tt from "@mui/material/Tabs";
20
+ import rt from "@mui/material/IconButton";
21
+ import { formatDuration as at, intervalToDuration as nt } from "date-fns";
22
+ import { Box as W, Card as ve, Stack as u, useTheme as j } from "@mui/material";
23
+ import ot from "@mui/material/Card";
24
+ import it from "@mui/material/CardContent";
25
+ import lt from "@mui/material/CardHeader";
26
26
  import G from "@mui/material/Divider";
27
- import { M as Je, I as Qe, O as et } from "../OriginalBalanceAction-BybTXDtO.mjs";
28
- import tt from "@mui/material/TextField";
29
- import { L as re } from "../ListItemAction-CzZ8s39Z.mjs";
30
- import { C as se } from "../CurrencyInput-adTIRtL3.mjs";
31
- import me from "@mui/material/Alert";
32
- import _e from "@mui/material/AlertTitle";
33
- import ye from "@mui/material/Paper";
34
- import { Error as rt, CheckCircle as Ce } from "@mxenabled/mx-icons";
35
- import { T as fe } from "../TabContentContainer-CnMXkVqr.mjs";
36
- import { DataGridPro as ot } from "@mui/x-data-grid-pro";
37
- import { H } from "../HeaderCell-P8w6CmfO.mjs";
38
- import { c as nt, A as z } from "../Account-BaJmiJAG.mjs";
39
- import ve from "@mui/material/Button";
40
- import at from "@mui/material/IconButton";
41
- import it from "@mui/material/ListItem";
42
- import lt from "@mui/material/Popover";
43
- import { u as st } from "../useWidgetLoadTimer-CJb-RELP.mjs";
44
- import { L as ct } from "../Loader-CxeBwuPG.mjs";
45
- import { W as dt } from "../WidgetContainer-CmbU4CBH.mjs";
46
- import { E as pt } from "../EmptyState-CJUDc3kD.mjs";
47
- import { C as ut } from "../ConnectDrawer-Cnjr3Ddg.mjs";
48
- function ht(r, n, o = 0) {
49
- const t = r.map((b) => ({ ...b })).filter(
50
- (b) => b.interest_rate !== void 0 && b.monthly_payment !== void 0 && !b.is_paid_off
51
- );
27
+ import st from "@mui/material/Popover";
28
+ import Ce from "@mui/material/List";
29
+ import ct from "@mui/material/ListItem";
30
+ import dt from "@mui/material/TextField";
31
+ import { LineChart as pt } from "@mui/x-charts/LineChart";
32
+ import ye from "@mui/material/Alert";
33
+ import fe from "@mui/material/AlertTitle";
34
+ import { DataGridPro as ut } from "@mui/x-data-grid-pro";
35
+ function ht(a, n, r = 0) {
36
+ const t = a.map((b) => ({ ...b })).filter((b) => b.interest_rate !== void 0 && b.monthly_payment !== void 0 && !b.is_paid_off);
52
37
  Fe(t, n);
53
- let a = 0, s = 0;
54
- const d = /* @__PURE__ */ new Date(), c = /* @__PURE__ */ new Date();
38
+ let o = 0, s = 0;
39
+ const p = /* @__PURE__ */ new Date(), c = /* @__PURE__ */ new Date();
55
40
  for (; t.some((b) => b.balance >= 0.01 && !b.is_impossible); ) {
56
41
  let b = !1;
57
- for (const [v, x] of t.entries()) {
42
+ for (const [I, x] of t.entries()) {
58
43
  if (x.balance <= 0.01 || x.is_impossible) continue;
59
- const L = (x.interest_rate ?? 0) / 100 / 12, N = x.balance * L;
60
- let A = x.monthly_payment ?? 0;
61
- v === 0 && o && (A += o), x.balance += N;
62
- const E = Math.min(x.balance, A + s);
63
- if (E <= N) {
44
+ const F = (x.interest_rate ?? 0) / 100 / 12, k = x.balance * F;
45
+ let N = x.monthly_payment ?? 0;
46
+ I === 0 && r && (N += r), x.balance += k;
47
+ const D = Math.min(x.balance, N + s);
48
+ if (D <= k) {
64
49
  x.is_impossible = !0;
65
50
  continue;
66
51
  }
67
- x.balance -= E, x.balance = x.balance < 0.01 ? 0 : x.balance, a += N, x.balance <= 0 && (s += A), E > 0 && (b = !0);
52
+ x.balance -= D, x.balance = x.balance < 0.01 ? 0 : x.balance, o += k, x.balance <= 0 && (s += N), D > 0 && (b = !0);
68
53
  }
69
54
  b && c.setMonth(c.getMonth() + 1);
70
55
  }
71
- const m = t.some((b) => b.is_impossible && b.balance > 0), h = Re({ start: d, end: c });
56
+ const m = t.some((b) => b.is_impossible && b.balance > 0), h = nt({
57
+ start: p,
58
+ end: c
59
+ });
72
60
  return {
73
- payoffSavings: m ? "N/A" : I(a, "0,0.00"),
74
- payoffDate: m ? "Never" : J(c, Q.MONTH_YEAR),
75
- payoffDuration: m ? "Stagnant" : Le(h, { format: ["years", "months"] }) || "0 months"
61
+ payoffSavings: m ? "N/A" : A(o, "0,0.00"),
62
+ payoffDate: m ? "Never" : Q(c, Z.MONTH_YEAR),
63
+ payoffDuration: m ? "Stagnant" : at(h, { format: ["years", "months"] }) || "0 months"
76
64
  };
77
65
  }
78
- const P = () => {
79
- if (!f.useContext(Ge))
80
- throw new Error("useCateUiStore() must be used within the GlobalDataContext");
81
- return ee().uiStore;
82
- }, bt = ({ debts: r, onClickCta: n, sx: o }) => {
83
- const t = j(), { isMobile: a } = ae(), { debts: s } = w(), { selectedDebtPriority: d } = P(), { monthlyCashFlowProfile: c } = V(), { payoffDate: m, payoffSavings: h, payoffDuration: b } = f.useMemo(() => {
84
- const v = c?.extra_payment ?? 0;
85
- return ht(r, d, v);
86
- }, [r, d, c]);
87
- return /* @__PURE__ */ e(
88
- ge,
89
- {
66
+ var M = () => {
67
+ if (!g.useContext(je)) throw new Error("useCateUiStore() must be used within the GlobalDataContext");
68
+ return te().uiStore;
69
+ }, bt = ({ debts: a, onClickCta: n, sx: r }) => {
70
+ const t = j(), { isMobile: o } = le(), { debts: s } = w(), { selectedDebtPriority: p } = M(), { monthlyCashFlowProfile: c } = z(), { payoffDate: m, payoffSavings: h, payoffDuration: b } = g.useMemo(() => ht(a, p, c?.extra_payment ?? 0), [
71
+ a,
72
+ p,
73
+ c
74
+ ]);
75
+ return /* @__PURE__ */ e(ve, {
76
+ sx: {
77
+ boxShadow: t.shadows[2],
78
+ width: o ? "100%" : "186px",
79
+ minWidth: "186px",
80
+ ...r
81
+ },
82
+ children: /* @__PURE__ */ l(u, {
90
83
  sx: {
91
- boxShadow: t.shadows[2],
92
- width: a ? "100%" : "186px",
93
- minWidth: "186px",
94
- ...o
84
+ gap: "12px",
85
+ p: "16px"
95
86
  },
96
- children: /* @__PURE__ */ l(u, { sx: { gap: "12px", p: "16px" }, children: [
97
- /* @__PURE__ */ l(
98
- u,
99
- {
100
- gap: a ? "4px" : "0",
101
- sx: {
102
- borderBottom: "1px solid",
103
- borderBottomColor: t.palette.grey[300],
104
- pb: "8px"
105
- },
106
- children: [
107
- /* @__PURE__ */ e(i, { variant: "caption", children: s.snowball_card_date_description }),
108
- /* @__PURE__ */ e(i, { bold: !0, color: t.palette.primary.main, variant: "body2", children: m })
109
- ]
110
- }
111
- ),
112
- /* @__PURE__ */ l(u, { gap: a ? "4px" : "0", children: [
113
- /* @__PURE__ */ e(i, { bold: !0, variant: "body2", children: h }),
114
- /* @__PURE__ */ e(i, { variant: "caption", children: s.snowball_card_amount_description })
115
- ] }),
116
- /* @__PURE__ */ l(u, { gap: a ? "4px" : "0", children: [
117
- /* @__PURE__ */ e(i, { bold: !0, variant: "body2", children: b }),
118
- /* @__PURE__ */ e(i, { variant: "caption", children: s.snowball_card_duration_description })
119
- ] }),
120
- /* @__PURE__ */ e(
121
- i,
122
- {
87
+ children: [
88
+ /* @__PURE__ */ l(u, {
89
+ gap: o ? "4px" : "0",
90
+ sx: {
91
+ borderBottom: "1px solid",
92
+ borderBottomColor: t.palette.grey[300],
93
+ pb: "8px"
94
+ },
95
+ children: [/* @__PURE__ */ e(i, {
96
+ variant: "caption",
97
+ children: s.snowball_card_date_description
98
+ }), /* @__PURE__ */ e(i, {
123
99
  bold: !0,
124
100
  color: t.palette.primary.main,
125
- onClick: n,
126
- sx: { cursor: "pointer" },
127
101
  variant: "body2",
128
- children: s.snowball_card_cta
129
- }
130
- )
131
- ] })
132
- }
133
- );
134
- }, mt = C(bt), _t = ({ isOpen: r, onClose: n }) => {
135
- const o = j(), { debts: t } = w(), [a, s] = f.useState(!1);
136
- return /* @__PURE__ */ e(
137
- ie,
138
- {
139
- ariaLabelClose: "",
140
- isOpen: r,
141
- onClose: n,
142
- title: t.snowball_drawer_title,
143
- children: /* @__PURE__ */ l(u, { bgcolor: o.palette.background.default, height: "100%", children: [
144
- /* @__PURE__ */ l(u, { alignItems: "center", px: 24, py: 24, children: [
145
- /* @__PURE__ */ l(u, { alignItems: "center", pb: 24, children: [
146
- /* @__PURE__ */ e(i, { mb: 12, truncate: !0, variant: "h3", children: t.snowball_drawer_subtitle }),
147
- /* @__PURE__ */ e(i, { color: o.palette.secondary.main, variant: "body2", children: t.snowball_drawer_amount_description }),
148
- /* @__PURE__ */ e(xe, { variant: "h1", children: t.snowball_drawer_savings }),
149
- /* @__PURE__ */ e(i, { color: o.palette.secondary.main, variant: "body2", children: t.snowball_drawer_duration_description })
150
- ] }),
151
- /* @__PURE__ */ l(ge, { sx: { display: "grid", py: 16, px: 24 }, children: [
152
- /* @__PURE__ */ e(i, { mb: 4, truncate: !0, variant: "h3", children: t.snowball_drawer_question }),
153
- /* @__PURE__ */ e(
154
- i,
155
- {
156
- color: o.palette.secondary.main,
157
- mb: 8,
158
- truncate: !a,
159
- variant: "subtitle2",
160
- children: t.snowball_drawer_answer
161
- }
162
- ),
163
- /* @__PURE__ */ e(
164
- i,
165
- {
166
- bold: !0,
167
- color: o.palette.primary.main,
168
- onClick: () => s(!a),
169
- sx: { cursor: "pointer" },
170
- variant: "body2",
171
- children: a ? t.snowball_drawer_less : t.snowball_drawer_more
172
- }
173
- )
174
- ] })
175
- ] }),
176
- /* @__PURE__ */ l(u, { children: [
177
- /* @__PURE__ */ e(
178
- i,
179
- {
180
- color: o.palette.secondary.main,
181
- px: 24,
182
- sx: { textAlign: "center" },
102
+ children: m
103
+ })]
104
+ }),
105
+ /* @__PURE__ */ l(u, {
106
+ gap: o ? "4px" : "0",
107
+ children: [/* @__PURE__ */ e(i, {
108
+ bold: !0,
109
+ variant: "body2",
110
+ children: h
111
+ }), /* @__PURE__ */ e(i, {
112
+ variant: "caption",
113
+ children: s.snowball_card_amount_description
114
+ })]
115
+ }),
116
+ /* @__PURE__ */ l(u, {
117
+ gap: o ? "4px" : "0",
118
+ children: [/* @__PURE__ */ e(i, {
119
+ bold: !0,
120
+ variant: "body2",
121
+ children: b
122
+ }), /* @__PURE__ */ e(i, {
123
+ variant: "caption",
124
+ children: s.snowball_card_duration_description
125
+ })]
126
+ }),
127
+ /* @__PURE__ */ e(i, {
128
+ bold: !0,
129
+ color: t.palette.primary.main,
130
+ onClick: n,
131
+ sx: { cursor: "pointer" },
132
+ variant: "body2",
133
+ children: s.snowball_card_cta
134
+ })
135
+ ]
136
+ })
137
+ });
138
+ }, mt = v(bt), _t = ({ isOpen: a, onClose: n }) => {
139
+ const r = j(), { debts: t } = w(), [o, s] = g.useState(!1);
140
+ return /* @__PURE__ */ e(ie, {
141
+ ariaLabelClose: "",
142
+ isOpen: a,
143
+ onClose: n,
144
+ title: t.snowball_drawer_title,
145
+ children: /* @__PURE__ */ l(u, {
146
+ bgcolor: r.palette.background.default,
147
+ height: "100%",
148
+ children: [/* @__PURE__ */ l(u, {
149
+ alignItems: "center",
150
+ px: 24,
151
+ py: 24,
152
+ children: [/* @__PURE__ */ l(u, {
153
+ alignItems: "center",
154
+ pb: 24,
155
+ children: [
156
+ /* @__PURE__ */ e(i, {
157
+ mb: 12,
158
+ truncate: !0,
159
+ variant: "h3",
160
+ children: t.snowball_drawer_subtitle
161
+ }),
162
+ /* @__PURE__ */ e(i, {
163
+ color: r.palette.secondary.main,
164
+ variant: "body2",
165
+ children: t.snowball_drawer_amount_description
166
+ }),
167
+ /* @__PURE__ */ e(ge, {
168
+ variant: "h1",
169
+ children: t.snowball_drawer_savings
170
+ }),
171
+ /* @__PURE__ */ e(i, {
172
+ color: r.palette.secondary.main,
173
+ variant: "body2",
174
+ children: t.snowball_drawer_duration_description
175
+ })
176
+ ]
177
+ }), /* @__PURE__ */ l(ve, {
178
+ sx: {
179
+ display: "grid",
180
+ py: 16,
181
+ px: 24
182
+ },
183
+ children: [
184
+ /* @__PURE__ */ e(i, {
185
+ mb: 4,
186
+ truncate: !0,
187
+ variant: "h3",
188
+ children: t.snowball_drawer_question
189
+ }),
190
+ /* @__PURE__ */ e(i, {
191
+ color: r.palette.secondary.main,
192
+ mb: 8,
193
+ truncate: !o,
194
+ variant: "subtitle2",
195
+ children: t.snowball_drawer_answer
196
+ }),
197
+ /* @__PURE__ */ e(i, {
198
+ bold: !0,
199
+ color: r.palette.primary.main,
200
+ onClick: () => s(!o),
201
+ sx: { cursor: "pointer" },
183
202
  variant: "body2",
184
- children: t.snowball_drawer_disclaimer
185
- }
186
- ),
187
- /* @__PURE__ */ l(u, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
188
- /* @__PURE__ */ e(i, { bold: !0, variant: "caption", children: T(t.snowball_drawer_month_header, 1) }),
189
- /* @__PURE__ */ e(i, { bold: !0, variant: "caption", children: t.snowball_drawer_payment_header })
190
- ] }),
191
- /* @__PURE__ */ l(u, { bgcolor: o.palette.background.paper, mb: 24, children: [
192
- /* @__PURE__ */ l(u, { alignItems: "center", flexDirection: "row", pl: 24, children: [
193
- /* @__PURE__ */ e(
194
- W,
195
- {
196
- sx: {
197
- display: "flex",
198
- alignItems: "center",
199
- justifyContent: "center",
200
- width: 20,
201
- height: 20,
202
- borderRadius: "50%",
203
- backgroundColor: o.palette.success.main,
204
- marginRight: 12
205
- },
206
- children: /* @__PURE__ */ e(i, { color: "white", fontWeight: 700, variant: "body2", children: "✓" })
207
- }
208
- ),
209
- /* @__PURE__ */ l(
210
- u,
211
- {
212
- sx: {
213
- borderBottom: `1px solid ${o.palette.neutral.light}`,
214
- flexDirection: "row",
215
- flexGrow: 1,
216
- py: 14,
217
- pr: 24
218
- },
219
- children: [
220
- /* @__PURE__ */ l(u, { flexGrow: 1, children: [
221
- /* @__PURE__ */ e(i, { variant: "body1", children: T(t.snowball_drawer_debt_label, "A") }),
222
- /* @__PURE__ */ l(i, { color: o.palette.secondary.main, variant: "caption", children: [
223
- T(
224
- t.snowball_drawer_rollover_explainer_pt1,
225
- "$100"
226
- ),
227
- /* @__PURE__ */ e("strong", { children: T(t.snowball_drawer_debt_label, "B") }),
228
- t.snowball_drawer_rollover_explainer_pt2
229
- ] })
230
- ] }),
231
- /* @__PURE__ */ l(u, { children: [
232
- /* @__PURE__ */ e(i, { variant: "body1", children: "$100.00" }),
233
- /* @__PURE__ */ e(
234
- i,
235
- {
236
- bold: !0,
237
- color: o.palette.success.main,
238
- textAlign: "end",
239
- variant: "tiny",
240
- children: t.snowball_drawer_paid_label
241
- }
242
- )
243
- ] })
244
- ]
245
- }
246
- )
247
- ] }),
248
- /* @__PURE__ */ l(u, { alignItems: "center", flexDirection: "row", pl: 24, children: [
249
- /* @__PURE__ */ e(
250
- W,
251
- {
252
- sx: {
253
- width: 20,
254
- height: 20,
255
- marginRight: 12,
256
- borderRadius: "50%",
257
- border: `3px solid ${o.palette.neutral.main}`
258
- }
259
- }
260
- ),
261
- /* @__PURE__ */ l(
262
- u,
263
- {
264
- sx: {
265
- borderBottom: `1px solid ${o.palette.neutral.light}`,
266
- flexDirection: "row",
267
- flexGrow: 1,
268
- py: 14,
269
- pr: 24
270
- },
271
- children: [
272
- /* @__PURE__ */ e(i, { flexGrow: 1, variant: "body1", children: T(t.snowball_drawer_debt_label, "B") }),
273
- /* @__PURE__ */ e(i, { variant: "body1", children: "$400.00" })
274
- ]
275
- }
276
- )
277
- ] }),
278
- /* @__PURE__ */ l(u, { alignItems: "center", flexDirection: "row", pl: 24, py: 14, children: [
279
- /* @__PURE__ */ e(
280
- W,
281
- {
282
- sx: {
283
- width: 20,
284
- height: 20,
285
- marginRight: 12,
286
- borderRadius: "50%",
287
- border: `3px solid ${o.palette.neutral.main}`
288
- }
289
- }
290
- ),
291
- /* @__PURE__ */ l(u, { flexDirection: "row", flexGrow: 1, pr: 24, children: [
292
- /* @__PURE__ */ e(i, { flexGrow: 1, variant: "body1", children: T(t.snowball_drawer_debt_label, "C") }),
293
- /* @__PURE__ */ e(i, { variant: "body1", children: "$1,000.00" })
294
- ] })
295
- ] }),
296
- /* @__PURE__ */ l(
297
- u,
298
- {
203
+ children: o ? t.snowball_drawer_less : t.snowball_drawer_more
204
+ })
205
+ ]
206
+ })]
207
+ }), /* @__PURE__ */ l(u, { children: [
208
+ /* @__PURE__ */ e(i, {
209
+ color: r.palette.secondary.main,
210
+ px: 24,
211
+ sx: { textAlign: "center" },
212
+ variant: "body2",
213
+ children: t.snowball_drawer_disclaimer
214
+ }),
215
+ /* @__PURE__ */ l(u, {
216
+ flexDirection: "row",
217
+ justifyContent: "space-between",
218
+ sx: {
219
+ pt: 12,
220
+ px: 24,
221
+ pb: 8
222
+ },
223
+ children: [/* @__PURE__ */ e(i, {
224
+ bold: !0,
225
+ variant: "caption",
226
+ children: S(t.snowball_drawer_month_header, 1)
227
+ }), /* @__PURE__ */ e(i, {
228
+ bold: !0,
229
+ variant: "caption",
230
+ children: t.snowball_drawer_payment_header
231
+ })]
232
+ }),
233
+ /* @__PURE__ */ l(u, {
234
+ bgcolor: r.palette.background.paper,
235
+ mb: 24,
236
+ children: [
237
+ /* @__PURE__ */ l(u, {
238
+ alignItems: "center",
239
+ flexDirection: "row",
240
+ pl: 24,
241
+ children: [/* @__PURE__ */ e(W, {
242
+ sx: {
243
+ display: "flex",
244
+ alignItems: "center",
245
+ justifyContent: "center",
246
+ width: 20,
247
+ height: 20,
248
+ borderRadius: "50%",
249
+ backgroundColor: r.palette.success.main,
250
+ marginRight: 12
251
+ },
252
+ children: /* @__PURE__ */ e(i, {
253
+ color: "white",
254
+ fontWeight: 700,
255
+ variant: "body2",
256
+ children: "✓"
257
+ })
258
+ }), /* @__PURE__ */ l(u, {
259
+ sx: {
260
+ borderBottom: `1px solid ${r.palette.neutral.light}`,
261
+ flexDirection: "row",
262
+ flexGrow: 1,
263
+ py: 14,
264
+ pr: 24
265
+ },
266
+ children: [/* @__PURE__ */ l(u, {
267
+ flexGrow: 1,
268
+ children: [/* @__PURE__ */ e(i, {
269
+ variant: "body1",
270
+ children: S(t.snowball_drawer_debt_label, "A")
271
+ }), /* @__PURE__ */ l(i, {
272
+ color: r.palette.secondary.main,
273
+ variant: "caption",
274
+ children: [
275
+ S(t.snowball_drawer_rollover_explainer_pt1, "$100"),
276
+ /* @__PURE__ */ e("strong", { children: S(t.snowball_drawer_debt_label, "B") }),
277
+ t.snowball_drawer_rollover_explainer_pt2
278
+ ]
279
+ })]
280
+ }), /* @__PURE__ */ l(u, { children: [/* @__PURE__ */ e(i, {
281
+ variant: "body1",
282
+ children: "$100.00"
283
+ }), /* @__PURE__ */ e(i, {
284
+ bold: !0,
285
+ color: r.palette.success.main,
286
+ textAlign: "end",
287
+ variant: "tiny",
288
+ children: t.snowball_drawer_paid_label
289
+ })] })]
290
+ })]
291
+ }),
292
+ /* @__PURE__ */ l(u, {
293
+ alignItems: "center",
294
+ flexDirection: "row",
295
+ pl: 24,
296
+ children: [/* @__PURE__ */ e(W, { sx: {
297
+ width: 20,
298
+ height: 20,
299
+ marginRight: 12,
300
+ borderRadius: "50%",
301
+ border: `3px solid ${r.palette.neutral.main}`
302
+ } }), /* @__PURE__ */ l(u, {
299
303
  sx: {
300
- py: 8,
301
- px: 24,
304
+ borderBottom: `1px solid ${r.palette.neutral.light}`,
302
305
  flexDirection: "row",
303
- justifyContent: "space-between",
304
- borderTop: `1px solid ${o.palette.neutral.light}`,
305
- borderBottom: `1px solid ${o.palette.neutral.light}`
306
+ flexGrow: 1,
307
+ py: 14,
308
+ pr: 24
309
+ },
310
+ children: [/* @__PURE__ */ e(i, {
311
+ flexGrow: 1,
312
+ variant: "body1",
313
+ children: S(t.snowball_drawer_debt_label, "B")
314
+ }), /* @__PURE__ */ e(i, {
315
+ variant: "body1",
316
+ children: "$400.00"
317
+ })]
318
+ })]
319
+ }),
320
+ /* @__PURE__ */ l(u, {
321
+ alignItems: "center",
322
+ flexDirection: "row",
323
+ pl: 24,
324
+ py: 14,
325
+ children: [/* @__PURE__ */ e(W, { sx: {
326
+ width: 20,
327
+ height: 20,
328
+ marginRight: 12,
329
+ borderRadius: "50%",
330
+ border: `3px solid ${r.palette.neutral.main}`
331
+ } }), /* @__PURE__ */ l(u, {
332
+ flexDirection: "row",
333
+ flexGrow: 1,
334
+ pr: 24,
335
+ children: [/* @__PURE__ */ e(i, {
336
+ flexGrow: 1,
337
+ variant: "body1",
338
+ children: S(t.snowball_drawer_debt_label, "C")
339
+ }), /* @__PURE__ */ e(i, {
340
+ variant: "body1",
341
+ children: "$1,000.00"
342
+ })]
343
+ })]
344
+ }),
345
+ /* @__PURE__ */ l(u, {
346
+ sx: {
347
+ py: 8,
348
+ px: 24,
349
+ flexDirection: "row",
350
+ justifyContent: "space-between",
351
+ borderTop: `1px solid ${r.palette.neutral.light}`,
352
+ borderBottom: `1px solid ${r.palette.neutral.light}`
353
+ },
354
+ children: [/* @__PURE__ */ e(i, {
355
+ bold: !0,
356
+ variant: "body1",
357
+ children: t.snowball_drawer_total_label
358
+ }), /* @__PURE__ */ e(i, {
359
+ bold: !0,
360
+ variant: "body1",
361
+ children: "$1,500.00"
362
+ })]
363
+ })
364
+ ]
365
+ }),
366
+ /* @__PURE__ */ l(u, {
367
+ flexDirection: "row",
368
+ justifyContent: "space-between",
369
+ sx: {
370
+ pt: 12,
371
+ px: 24,
372
+ pb: 8
373
+ },
374
+ children: [/* @__PURE__ */ e(i, {
375
+ bold: !0,
376
+ variant: "caption",
377
+ children: S(t.snowball_drawer_month_header, 2)
378
+ }), /* @__PURE__ */ e(i, {
379
+ bold: !0,
380
+ variant: "caption",
381
+ children: t.snowball_drawer_payment_header
382
+ })]
383
+ }),
384
+ /* @__PURE__ */ l(u, {
385
+ bgcolor: r.palette.background.paper,
386
+ mb: 24,
387
+ children: [
388
+ /* @__PURE__ */ l(u, {
389
+ alignItems: "center",
390
+ flexDirection: "row",
391
+ pl: 24,
392
+ children: [/* @__PURE__ */ e(W, {
393
+ sx: {
394
+ display: "flex",
395
+ alignItems: "center",
396
+ justifyContent: "center",
397
+ width: 20,
398
+ height: 20,
399
+ borderRadius: "50%",
400
+ backgroundColor: r.palette.success.main,
401
+ marginRight: 12
306
402
  },
307
- children: [
308
- /* @__PURE__ */ e(i, { bold: !0, variant: "body1", children: t.snowball_drawer_total_label }),
309
- /* @__PURE__ */ e(i, { bold: !0, variant: "body1", children: "$1,500.00" })
310
- ]
311
- }
312
- )
313
- ] }),
314
- /* @__PURE__ */ l(u, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
315
- /* @__PURE__ */ e(i, { bold: !0, variant: "caption", children: T(t.snowball_drawer_month_header, 2) }),
316
- /* @__PURE__ */ e(i, { bold: !0, variant: "caption", children: t.snowball_drawer_payment_header })
317
- ] }),
318
- /* @__PURE__ */ l(u, { bgcolor: o.palette.background.paper, mb: 24, children: [
319
- /* @__PURE__ */ l(u, { alignItems: "center", flexDirection: "row", pl: 24, children: [
320
- /* @__PURE__ */ e(
321
- W,
322
- {
323
- sx: {
324
- display: "flex",
325
- alignItems: "center",
326
- justifyContent: "center",
327
- width: 20,
328
- height: 20,
329
- borderRadius: "50%",
330
- backgroundColor: o.palette.success.main,
331
- marginRight: 12
332
- },
333
- children: /* @__PURE__ */ e(i, { color: "white", fontWeight: 700, variant: "body2", children: "✓" })
334
- }
335
- ),
336
- /* @__PURE__ */ l(
337
- u,
338
- {
339
- sx: {
340
- borderBottom: `1px solid ${o.palette.neutral.light}`,
341
- flexDirection: "row",
342
- flexGrow: 1,
343
- py: 14,
344
- pr: 24
345
- },
346
- children: [
347
- /* @__PURE__ */ l(u, { flexGrow: 1, children: [
348
- /* @__PURE__ */ e(i, { variant: "body1", children: T(t.snowball_drawer_debt_label, "B") }),
349
- /* @__PURE__ */ l(i, { color: o.palette.secondary.main, variant: "caption", children: [
350
- T(
351
- t.snowball_drawer_rollover_explainer_pt1,
352
- "$500"
353
- ),
354
- /* @__PURE__ */ e("strong", { children: T(t.snowball_drawer_debt_label, "C") }),
355
- t.snowball_drawer_rollover_explainer_pt2
356
- ] })
357
- ] }),
358
- /* @__PURE__ */ l(u, { children: [
359
- /* @__PURE__ */ e(i, { variant: "body1", children: "$500.00" }),
360
- /* @__PURE__ */ e(
361
- i,
362
- {
363
- bold: !0,
364
- color: o.palette.success.main,
365
- textAlign: "end",
366
- variant: "tiny",
367
- children: t.snowball_drawer_paid_label
368
- }
369
- )
370
- ] })
371
- ]
372
- }
373
- )
374
- ] }),
375
- /* @__PURE__ */ l(u, { alignItems: "center", flexDirection: "row", pl: 24, children: [
376
- /* @__PURE__ */ e(
377
- W,
378
- {
379
- sx: {
380
- width: 20,
381
- height: 20,
382
- marginRight: 12,
383
- borderRadius: "50%",
384
- border: `3px solid ${o.palette.neutral.main}`
385
- }
386
- }
387
- ),
388
- /* @__PURE__ */ l(
389
- u,
390
- {
391
- sx: {
392
- flexDirection: "row",
393
- flexGrow: 1,
394
- py: 14,
395
- pr: 24
396
- },
397
- children: [
398
- /* @__PURE__ */ e(i, { flexGrow: 1, variant: "body1", children: T(t.snowball_drawer_debt_label, "C") }),
399
- /* @__PURE__ */ e(i, { variant: "body1", children: "$1,000.00" })
400
- ]
401
- }
402
- )
403
- ] }),
404
- /* @__PURE__ */ l(
405
- u,
406
- {
403
+ children: /* @__PURE__ */ e(i, {
404
+ color: "white",
405
+ fontWeight: 700,
406
+ variant: "body2",
407
+ children: "✓"
408
+ })
409
+ }), /* @__PURE__ */ l(u, {
407
410
  sx: {
408
- py: 8,
409
- px: 24,
411
+ borderBottom: `1px solid ${r.palette.neutral.light}`,
410
412
  flexDirection: "row",
411
- justifyContent: "space-between",
412
- borderTop: `1px solid ${o.palette.neutral.light}`,
413
- borderBottom: `1px solid ${o.palette.neutral.light}`
413
+ flexGrow: 1,
414
+ py: 14,
415
+ pr: 24
414
416
  },
415
- children: [
416
- /* @__PURE__ */ e(i, { bold: !0, variant: "body1", children: t.snowball_drawer_total_label }),
417
- /* @__PURE__ */ e(i, { bold: !0, variant: "body1", children: "$1,500.00" })
418
- ]
419
- }
420
- )
421
- ] }),
422
- /* @__PURE__ */ l(u, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
423
- /* @__PURE__ */ e(i, { bold: !0, variant: "caption", children: T(t.snowball_drawer_month_header, 3) }),
424
- /* @__PURE__ */ e(i, { bold: !0, variant: "caption", children: t.snowball_drawer_payment_header })
425
- ] }),
426
- /* @__PURE__ */ l(u, { bgcolor: o.palette.background.paper, mb: 24, children: [
427
- /* @__PURE__ */ l(u, { alignItems: "center", flexDirection: "row", pl: 24, children: [
428
- /* @__PURE__ */ e(
429
- W,
430
- {
431
- sx: {
432
- display: "flex",
433
- alignItems: "center",
434
- justifyContent: "center",
435
- width: 20,
436
- height: 20,
437
- borderRadius: "50%",
438
- backgroundColor: o.palette.success.main,
439
- marginRight: 12
440
- },
441
- children: /* @__PURE__ */ e(i, { color: "white", fontWeight: 700, variant: "body2", children: "✓" })
442
- }
443
- ),
444
- /* @__PURE__ */ l(
445
- u,
446
- {
447
- sx: {
448
- alignItems: "center",
449
- flexDirection: "row",
450
- flexGrow: 1,
451
- py: 14,
452
- pr: 24
453
- },
454
- children: [
455
- /* @__PURE__ */ e(u, { flexGrow: 1, children: /* @__PURE__ */ e(i, { variant: "body1", children: T(t.snowball_drawer_debt_label, "C") }) }),
456
- /* @__PURE__ */ l(u, { children: [
457
- /* @__PURE__ */ e(i, { variant: "body1", children: "$1,500.00" }),
458
- /* @__PURE__ */ e(
459
- i,
460
- {
461
- bold: !0,
462
- color: o.palette.success.main,
463
- textAlign: "end",
464
- variant: "tiny",
465
- children: t.snowball_drawer_paid_label
466
- }
467
- )
468
- ] })
469
- ]
470
- }
471
- )
472
- ] }),
473
- /* @__PURE__ */ l(
474
- u,
475
- {
417
+ children: [/* @__PURE__ */ l(u, {
418
+ flexGrow: 1,
419
+ children: [/* @__PURE__ */ e(i, {
420
+ variant: "body1",
421
+ children: S(t.snowball_drawer_debt_label, "B")
422
+ }), /* @__PURE__ */ l(i, {
423
+ color: r.palette.secondary.main,
424
+ variant: "caption",
425
+ children: [
426
+ S(t.snowball_drawer_rollover_explainer_pt1, "$500"),
427
+ /* @__PURE__ */ e("strong", { children: S(t.snowball_drawer_debt_label, "C") }),
428
+ t.snowball_drawer_rollover_explainer_pt2
429
+ ]
430
+ })]
431
+ }), /* @__PURE__ */ l(u, { children: [/* @__PURE__ */ e(i, {
432
+ variant: "body1",
433
+ children: "$500.00"
434
+ }), /* @__PURE__ */ e(i, {
435
+ bold: !0,
436
+ color: r.palette.success.main,
437
+ textAlign: "end",
438
+ variant: "tiny",
439
+ children: t.snowball_drawer_paid_label
440
+ })] })]
441
+ })]
442
+ }),
443
+ /* @__PURE__ */ l(u, {
444
+ alignItems: "center",
445
+ flexDirection: "row",
446
+ pl: 24,
447
+ children: [/* @__PURE__ */ e(W, { sx: {
448
+ width: 20,
449
+ height: 20,
450
+ marginRight: 12,
451
+ borderRadius: "50%",
452
+ border: `3px solid ${r.palette.neutral.main}`
453
+ } }), /* @__PURE__ */ l(u, {
476
454
  sx: {
477
- py: 8,
478
- px: 24,
479
455
  flexDirection: "row",
480
- justifyContent: "space-between",
481
- borderTop: `1px solid ${o.palette.neutral.light}`,
482
- borderBottom: `1px solid ${o.palette.neutral.light}`
456
+ flexGrow: 1,
457
+ py: 14,
458
+ pr: 24
483
459
  },
484
- children: [
485
- /* @__PURE__ */ e(i, { bold: !0, variant: "body1", children: t.snowball_drawer_total_label }),
486
- /* @__PURE__ */ e(i, { bold: !0, variant: "body1", children: "$1,500.00" })
487
- ]
488
- }
489
- )
490
- ] })
491
- ] })
492
- ] })
493
- }
494
- );
495
- }, yt = C(_t), ft = "#FF7B08";
496
- function gt(r, n) {
497
- const [o, t, a] = r.replace(/^#/, "").match(/.{1,2}/g).map((d) => parseInt(d, 16)), s = [
498
- Math.max(0, Math.min(255, Math.round(o * n))),
460
+ children: [/* @__PURE__ */ e(i, {
461
+ flexGrow: 1,
462
+ variant: "body1",
463
+ children: S(t.snowball_drawer_debt_label, "C")
464
+ }), /* @__PURE__ */ e(i, {
465
+ variant: "body1",
466
+ children: "$1,000.00"
467
+ })]
468
+ })]
469
+ }),
470
+ /* @__PURE__ */ l(u, {
471
+ sx: {
472
+ py: 8,
473
+ px: 24,
474
+ flexDirection: "row",
475
+ justifyContent: "space-between",
476
+ borderTop: `1px solid ${r.palette.neutral.light}`,
477
+ borderBottom: `1px solid ${r.palette.neutral.light}`
478
+ },
479
+ children: [/* @__PURE__ */ e(i, {
480
+ bold: !0,
481
+ variant: "body1",
482
+ children: t.snowball_drawer_total_label
483
+ }), /* @__PURE__ */ e(i, {
484
+ bold: !0,
485
+ variant: "body1",
486
+ children: "$1,500.00"
487
+ })]
488
+ })
489
+ ]
490
+ }),
491
+ /* @__PURE__ */ l(u, {
492
+ flexDirection: "row",
493
+ justifyContent: "space-between",
494
+ sx: {
495
+ pt: 12,
496
+ px: 24,
497
+ pb: 8
498
+ },
499
+ children: [/* @__PURE__ */ e(i, {
500
+ bold: !0,
501
+ variant: "caption",
502
+ children: S(t.snowball_drawer_month_header, 3)
503
+ }), /* @__PURE__ */ e(i, {
504
+ bold: !0,
505
+ variant: "caption",
506
+ children: t.snowball_drawer_payment_header
507
+ })]
508
+ }),
509
+ /* @__PURE__ */ l(u, {
510
+ bgcolor: r.palette.background.paper,
511
+ mb: 24,
512
+ children: [/* @__PURE__ */ l(u, {
513
+ alignItems: "center",
514
+ flexDirection: "row",
515
+ pl: 24,
516
+ children: [/* @__PURE__ */ e(W, {
517
+ sx: {
518
+ display: "flex",
519
+ alignItems: "center",
520
+ justifyContent: "center",
521
+ width: 20,
522
+ height: 20,
523
+ borderRadius: "50%",
524
+ backgroundColor: r.palette.success.main,
525
+ marginRight: 12
526
+ },
527
+ children: /* @__PURE__ */ e(i, {
528
+ color: "white",
529
+ fontWeight: 700,
530
+ variant: "body2",
531
+ children: "✓"
532
+ })
533
+ }), /* @__PURE__ */ l(u, {
534
+ sx: {
535
+ alignItems: "center",
536
+ flexDirection: "row",
537
+ flexGrow: 1,
538
+ py: 14,
539
+ pr: 24
540
+ },
541
+ children: [/* @__PURE__ */ e(u, {
542
+ flexGrow: 1,
543
+ children: /* @__PURE__ */ e(i, {
544
+ variant: "body1",
545
+ children: S(t.snowball_drawer_debt_label, "C")
546
+ })
547
+ }), /* @__PURE__ */ l(u, { children: [/* @__PURE__ */ e(i, {
548
+ variant: "body1",
549
+ children: "$1,500.00"
550
+ }), /* @__PURE__ */ e(i, {
551
+ bold: !0,
552
+ color: r.palette.success.main,
553
+ textAlign: "end",
554
+ variant: "tiny",
555
+ children: t.snowball_drawer_paid_label
556
+ })] })]
557
+ })]
558
+ }), /* @__PURE__ */ l(u, {
559
+ sx: {
560
+ py: 8,
561
+ px: 24,
562
+ flexDirection: "row",
563
+ justifyContent: "space-between",
564
+ borderTop: `1px solid ${r.palette.neutral.light}`,
565
+ borderBottom: `1px solid ${r.palette.neutral.light}`
566
+ },
567
+ children: [/* @__PURE__ */ e(i, {
568
+ bold: !0,
569
+ variant: "body1",
570
+ children: t.snowball_drawer_total_label
571
+ }), /* @__PURE__ */ e(i, {
572
+ bold: !0,
573
+ variant: "body1",
574
+ children: "$1,500.00"
575
+ })]
576
+ })]
577
+ })
578
+ ] })]
579
+ })
580
+ });
581
+ }, yt = v(_t), ft = "#FF7B08";
582
+ function gt(a, n) {
583
+ const [r, t, o] = a.replace(/^#/, "").match(/.{1,2}/g).map((p) => parseInt(p, 16)), s = [
584
+ Math.max(0, Math.min(255, Math.round(r * n))),
499
585
  Math.max(0, Math.min(255, Math.round(t * n))),
500
- Math.max(0, Math.min(255, Math.round(a * n)))
586
+ Math.max(0, Math.min(255, Math.round(o * n)))
501
587
  ];
502
588
  return `rgb(${s[0]}, ${s[1]}, ${s[2]})`;
503
589
  }
504
- const De = ({
505
- sx: r,
506
- height: n = 500,
507
- width: o,
508
- debts: t,
509
- hoveredDebtGuid: a,
510
- onClickArea: s,
511
- onHoverArea: d
512
- }) => {
513
- const c = qe(), { onEvent: m } = k(), h = t.filter((p) => !p.is_impossible), b = [
514
- ...new Set(
515
- h.flatMap((p) => p.dataset.map((g) => new Date(g.x).getTime()))
516
- )
517
- ].sort((p, g) => p - g).map((p) => new Date(p)), v = h.map((p) => {
518
- const g = new Map(p.dataset.map((B) => [new Date(B.x).getTime(), B.y]));
519
- let D = g.get(b[0].getTime()) ?? 0;
520
- const M = b.map((B) => {
521
- const K = g.get(B.getTime()) ?? D;
522
- return D = K, { x: B, y: K };
590
+ var De = ({ sx: a, height: n = 500, width: r, debts: t, hoveredDebtGuid: o, onClickArea: s, onHoverArea: p }) => {
591
+ const c = et(), { onEvent: m } = E(), h = t.filter((d) => !d.is_impossible), b = [...new Set(h.flatMap((d) => d.dataset.map((f) => new Date(f.x).getTime())))].sort((d, f) => d - f).map((d) => new Date(d)), I = h.map((d) => {
592
+ const f = new Map(d.dataset.map((R) => [new Date(R.x).getTime(), R.y]));
593
+ let T = f.get(b[0].getTime()) ?? 0;
594
+ const $ = b.map((R) => {
595
+ const Y = f.get(R.getTime()) ?? T;
596
+ return T = Y, {
597
+ x: R,
598
+ y: Y
599
+ };
523
600
  });
524
- return { ...p, dataset: M };
525
- }), x = v.reduce(
526
- (p, g) => p + (g.dataset[0]?.y ?? 0),
527
- 0
528
- ), $ = b.map((p, g) => {
529
- const D = g / (b.length - 1), M = x * (1 - D);
530
- return { x: p, y: M };
531
- }), L = Math.ceil(x / 100) * 100, N = b, A = v.map((p, g) => {
532
- const D = 1 - g / v.length * 0.5, M = gt(ft, D);
533
601
  return {
534
- id: `debt-${g}`,
535
- guid: p.guid,
536
- label: p.name,
537
- data: p.dataset.map((B) => B.y),
538
- color: M,
602
+ ...d,
603
+ dataset: $
604
+ };
605
+ }), x = I.reduce((d, f) => d + (f.dataset[0]?.y ?? 0), 0), F = b.map((d, f) => ({
606
+ x: d,
607
+ y: x * (1 - f / (b.length - 1))
608
+ })), k = Math.ceil(x / 100) * 100, N = b, D = I.map((d, f) => {
609
+ const T = gt(ft, 1 - f / I.length * 0.5);
610
+ return {
611
+ id: `debt-${f}`,
612
+ guid: d.guid,
613
+ label: d.name,
614
+ data: d.dataset.map(($) => $.y),
615
+ color: T,
539
616
  curve: "linear",
540
617
  type: "line",
541
618
  area: !0,
@@ -543,10 +620,10 @@ const De = ({
543
620
  showMark: !1
544
621
  };
545
622
  });
546
- A.push({
623
+ D.push({
547
624
  id: "payoff-line",
548
625
  label: "Payoff Line",
549
- data: $.map((p) => p.y),
626
+ data: F.map((d) => d.y),
550
627
  color: c.palette.grey[700],
551
628
  curve: "linear",
552
629
  type: "line",
@@ -554,170 +631,177 @@ const De = ({
554
631
  showMark: !1,
555
632
  disableHighlight: !0
556
633
  });
557
- const E = (p) => A.findIndex((g) => g?.guid === p);
558
- return /* @__PURE__ */ e(
559
- le,
560
- {
561
- sx: {
562
- width: "100%",
563
- height: "100%",
634
+ const P = (d) => D.findIndex((f) => f?.guid === d);
635
+ return /* @__PURE__ */ e(se, {
636
+ sx: {
637
+ width: "100%",
638
+ height: "100%",
639
+ touchAction: "pan-y",
640
+ "& svg": {
564
641
  touchAction: "pan-y",
565
- "& svg": {
566
- touchAction: "pan-y",
567
- userSelect: "none"
642
+ userSelect: "none"
643
+ },
644
+ "& .recharts-wrapper": { touchAction: "pan-y" }
645
+ },
646
+ children: /* @__PURE__ */ e(pt, {
647
+ axisHighlight: { x: "none" },
648
+ disableLineItemHighlight: !0,
649
+ height: n,
650
+ hideLegend: !0,
651
+ margin: {
652
+ bottom: 24,
653
+ left: 32,
654
+ right: 72,
655
+ top: 48
656
+ },
657
+ onAreaClick: (d, f) => {
658
+ s?.();
659
+ const T = D.find(($) => $.id === f.seriesId);
660
+ m(C.DEBTS_CLICK_CHART_AREA, { account_guid: T?.guid });
661
+ },
662
+ onHighlightChange: (d) => {
663
+ const f = D.find((T) => T.id === d?.seriesId)?.guid;
664
+ p?.(f ?? "");
665
+ },
666
+ series: D,
667
+ skipAnimation: !0,
668
+ slotProps: { tooltip: { trigger: "none" } },
669
+ sx: {
670
+ p: 4,
671
+ "& .MuiBarLabel-root": {
672
+ fontSize: 10,
673
+ fontWeight: 600
568
674
  },
569
- "& .recharts-wrapper": {
570
- touchAction: "pan-y"
571
- }
675
+ "& .MuiAreaElement-root": {
676
+ opacity: 0.4,
677
+ transition: "opacity 0.3s ease"
678
+ },
679
+ "& .MuiAreaElement-root:hover": { opacity: 1 },
680
+ "& .MuiLineElement-series-payoff-line": {
681
+ strokeDasharray: "10 5",
682
+ strokeWidth: 1
683
+ },
684
+ [`& .MuiLineElement-series-debt-${P(o ?? "0")}`]: { opacity: 1 },
685
+ [`& .MuiAreaElement-series-debt-${P(o ?? "0")}`]: { opacity: 1 },
686
+ "& .MuiChartsAxis-tickLabel > tspan": { fontFamily: c.typography.body2.fontFamily },
687
+ ...a
572
688
  },
573
- children: /* @__PURE__ */ e(
574
- Xe,
575
- {
576
- axisHighlight: { x: "none" },
577
- disableLineItemHighlight: !0,
578
- height: n,
579
- hideLegend: !0,
580
- margin: { bottom: 24, left: 32, right: 72, top: 48 },
581
- onAreaClick: (p, g) => {
582
- s?.();
583
- const D = A.find((M) => M.id === g.seriesId);
584
- m(S.DEBTS_CLICK_CHART_AREA, { account_guid: D?.guid });
585
- },
586
- onHighlightChange: (p) => {
587
- const g = A.find((D) => D.id === p?.seriesId)?.guid;
588
- d?.(g ?? "");
589
- },
590
- series: A,
591
- skipAnimation: !0,
592
- slotProps: { tooltip: { trigger: "none" } },
689
+ width: r,
690
+ xAxis: [{
691
+ data: N,
692
+ disableTicks: !0,
693
+ min: b[0],
694
+ scaleType: "time",
695
+ tickLabelMinGap: 24,
696
+ valueFormatter: (d) => Q(d, Z.MONTH_SHORT_YEAR)
697
+ }],
698
+ yAxis: [{
699
+ min: 0,
700
+ max: k,
701
+ disableTicks: !0,
702
+ valueFormatter: (d) => A(d, "0a")
703
+ }]
704
+ })
705
+ });
706
+ }, xt = () => {
707
+ const a = j(), { debts: n } = w(), { selectedDebtChartData: r } = M();
708
+ return /* @__PURE__ */ l(B, { children: [/* @__PURE__ */ l(ot, {
709
+ sx: { "& .MuiCardContent-root:last-child": { pb: 0 } },
710
+ children: [/* @__PURE__ */ e(lt, {
711
+ sx: { pb: 0 },
712
+ title: /* @__PURE__ */ e(Je, {
713
+ sx: { pb: 4 },
714
+ children: n.details_chart_title
715
+ })
716
+ }), /* @__PURE__ */ e(it, {
717
+ sx: { p: 0 },
718
+ children: /* @__PURE__ */ e(De, {
719
+ debts: [r],
720
+ height: 250
721
+ })
722
+ })]
723
+ }), /* @__PURE__ */ e(i, {
724
+ color: a.palette.text.secondary,
725
+ sx: {
726
+ textAlign: "center",
727
+ px: 8,
728
+ py: 12
729
+ },
730
+ variant: "body2",
731
+ children: n.details_chart_description
732
+ })] });
733
+ }, wt = v(xt), vt = () => {
734
+ const a = j(), { onEvent: n } = E(), { debts: r } = w(), { selectedDebtChartData: t, showCompleted: o, showError: s } = M();
735
+ return g.useEffect(() => n(C.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(Ce, { children: s || o ? /* @__PURE__ */ e(i, {
736
+ color: a.palette.secondary.main,
737
+ component: "div",
738
+ sx: {
739
+ p: 32,
740
+ textAlign: "center"
741
+ },
742
+ variant: "body2",
743
+ children: s ? r.schedule_error_message : r.schedule_complete_message
744
+ }) : /* @__PURE__ */ l(B, { children: [
745
+ /* @__PURE__ */ l(y, {
746
+ flexDirection: "row",
747
+ justifyContent: "space-between",
748
+ sx: {
749
+ pt: 12,
750
+ px: 24,
751
+ pb: 8
752
+ },
753
+ children: [/* @__PURE__ */ e(i, {
754
+ bold: !0,
755
+ variant: "caption",
756
+ children: r.schedule_month_heading
757
+ }), /* @__PURE__ */ e(i, {
758
+ bold: !0,
759
+ variant: "caption",
760
+ children: r.schedule_amount_heading
761
+ })]
762
+ }),
763
+ t.dataset.slice(1).map(({ x: p, y: c, payment: m }) => /* @__PURE__ */ e(y, {
764
+ bgcolor: a.palette.background.paper,
765
+ children: /* @__PURE__ */ e(y, {
766
+ alignItems: "center",
767
+ flexDirection: "row",
768
+ pl: 24,
769
+ children: /* @__PURE__ */ l(y, {
593
770
  sx: {
594
- p: 4,
595
- "& .MuiBarLabel-root": {
596
- fontSize: 10,
597
- fontWeight: 600
598
- },
599
- "& .MuiAreaElement-root": {
600
- opacity: 0.4,
601
- transition: "opacity 0.3s ease"
602
- },
603
- "& .MuiAreaElement-root:hover": {
604
- opacity: 1
605
- },
606
- "& .MuiLineElement-series-payoff-line": {
607
- strokeDasharray: "10 5",
608
- strokeWidth: 1
609
- },
610
- [`& .MuiLineElement-series-debt-${E(a ?? "0")}`]: {
611
- opacity: 1
612
- },
613
- [`& .MuiAreaElement-series-debt-${E(a ?? "0")}`]: {
614
- opacity: 1
615
- },
616
- "& .MuiChartsAxis-tickLabel > tspan": {
617
- fontFamily: c.typography.body2.fontFamily
618
- },
619
- ...r
771
+ borderBottom: `1px solid ${a.palette.divider}`,
772
+ flexDirection: "row",
773
+ flexGrow: 1,
774
+ py: 14,
775
+ pr: 24
620
776
  },
621
- width: o,
622
- xAxis: [
623
- {
624
- data: N,
625
- disableTicks: !0,
626
- min: b[0],
627
- scaleType: "time",
628
- tickLabelMinGap: 24,
629
- valueFormatter: (p) => J(p, Q.MONTH_SHORT_YEAR)
630
- }
631
- ],
632
- yAxis: [
633
- {
634
- min: 0,
635
- max: L,
636
- disableTicks: !0,
637
- valueFormatter: (p) => I(p, "0a")
638
- }
639
- ]
640
- }
641
- )
642
- }
643
- );
644
- }, xt = () => {
645
- const r = j(), { debts: n } = w(), { selectedDebtChartData: o } = P();
646
- return /* @__PURE__ */ l(R, { children: [
647
- /* @__PURE__ */ l(
648
- Ye,
649
- {
650
- sx: {
651
- "& .MuiCardContent-root:last-child": {
652
- pb: 0
653
- }
654
- },
655
- children: [
656
- /* @__PURE__ */ e(Ue, { sx: { pb: 0 }, title: /* @__PURE__ */ e(Be, { sx: { pb: 4 }, children: n.details_chart_title }) }),
657
- /* @__PURE__ */ e(Ke, { sx: { p: 0 }, children: /* @__PURE__ */ e(De, { debts: [o], height: 250 }) })
658
- ]
659
- }
660
- ),
661
- /* @__PURE__ */ e(
662
- i,
663
- {
664
- color: r.palette.text.secondary,
665
- sx: { textAlign: "center", px: 8, py: 12 },
666
- variant: "body2",
667
- children: n.details_chart_description
668
- }
669
- )
670
- ] });
671
- }, wt = C(xt), Ct = () => {
672
- const r = j(), { onEvent: n } = k(), { debts: o } = w(), { selectedDebtChartData: t, showCompleted: a, showError: s } = P();
673
- return f.useEffect(() => n(S.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(we, { children: s || a ? /* @__PURE__ */ e(
674
- i,
675
- {
676
- color: r.palette.secondary.main,
677
- component: "div",
678
- sx: { p: 32, textAlign: "center" },
679
- variant: "body2",
680
- children: s ? o.schedule_error_message : o.schedule_complete_message
681
- }
682
- ) : /* @__PURE__ */ l(R, { children: [
683
- /* @__PURE__ */ l(y, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
684
- /* @__PURE__ */ e(i, { bold: !0, variant: "caption", children: o.schedule_month_heading }),
685
- /* @__PURE__ */ e(i, { bold: !0, variant: "caption", children: o.schedule_amount_heading })
686
- ] }),
687
- t.dataset.slice(1).map(({ x: d, y: c, payment: m }) => /* @__PURE__ */ e(y, { bgcolor: r.palette.background.paper, children: /* @__PURE__ */ e(y, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ l(
688
- y,
689
- {
690
- sx: {
691
- borderBottom: `1px solid ${r.palette.divider}`,
692
- flexDirection: "row",
693
- flexGrow: 1,
694
- py: 14,
695
- pr: 24
696
- },
697
- children: [
698
- /* @__PURE__ */ l(y, { flexGrow: 1, children: [
699
- /* @__PURE__ */ e(i, { bold: !0, variant: "body1", children: J(d, Q.MONTH_YEAR) }),
700
- /* @__PURE__ */ e(i, { color: r.palette.secondary.main, variant: "caption", children: o.schedule_month_label })
701
- ] }),
702
- /* @__PURE__ */ l(y, { children: [
703
- /* @__PURE__ */ e(i, { bold: !0, variant: "body1", children: I(c, "0,0.00") }),
704
- /* @__PURE__ */ e(
705
- i,
706
- {
707
- bold: !0,
708
- color: r.palette.success.main,
709
- textAlign: "end",
710
- variant: "tiny",
711
- children: `+${I(m, "0,0")}`
712
- }
713
- )
714
- ] })
715
- ]
716
- }
717
- ) }) }, String(d))),
718
- /* @__PURE__ */ e(y, { bgcolor: "background.paper", children: /* @__PURE__ */ l(
719
- y,
720
- {
777
+ children: [/* @__PURE__ */ l(y, {
778
+ flexGrow: 1,
779
+ children: [/* @__PURE__ */ e(i, {
780
+ bold: !0,
781
+ variant: "body1",
782
+ children: Q(p, Z.MONTH_YEAR)
783
+ }), /* @__PURE__ */ e(i, {
784
+ color: a.palette.secondary.main,
785
+ variant: "caption",
786
+ children: r.schedule_month_label
787
+ })]
788
+ }), /* @__PURE__ */ l(y, { children: [/* @__PURE__ */ e(i, {
789
+ bold: !0,
790
+ variant: "body1",
791
+ children: A(c, "0,0.00")
792
+ }), /* @__PURE__ */ e(i, {
793
+ bold: !0,
794
+ color: a.palette.success.main,
795
+ textAlign: "end",
796
+ variant: "tiny",
797
+ children: `+${A(m, "0,0")}`
798
+ })] })]
799
+ })
800
+ })
801
+ }, String(p))),
802
+ /* @__PURE__ */ e(y, {
803
+ bgcolor: "background.paper",
804
+ children: /* @__PURE__ */ l(y, {
721
805
  sx: {
722
806
  alignItems: "center",
723
807
  flexDirection: "row",
@@ -725,136 +809,139 @@ const De = ({
725
809
  py: 14,
726
810
  px: 24
727
811
  },
728
- children: [
729
- /* @__PURE__ */ e(i, { flexGrow: 1, variant: "body1", children: o.schedule_payoff_label }),
730
- /* @__PURE__ */ e(i, { variant: "body1", children: "-" })
731
- ]
732
- }
733
- ) })
812
+ children: [/* @__PURE__ */ e(i, {
813
+ flexGrow: 1,
814
+ variant: "body1",
815
+ children: r.schedule_payoff_label
816
+ }), /* @__PURE__ */ e(i, {
817
+ variant: "body1",
818
+ children: "-"
819
+ })]
820
+ })
821
+ })
734
822
  ] }) });
735
- }, vt = C(Ct), Dt = C(({ debt: r }) => {
736
- const { debts: n } = w(), { updateAccount: o } = te(), { onEvent: t } = k(), [a, s] = f.useState(r.interest_rate ?? 0), d = a < 0, c = async () => {
737
- await o({ ...r.account, interest_rate: a }), r.interest_rate = a, t(S.DEBTS_SAVE_RATE_ACTION, { account_guid: r.guid });
823
+ }, Ct = v(vt), Dt = v(({ debt: a }) => {
824
+ const { debts: n } = w(), { updateAccount: r } = re(), { onEvent: t } = E(), [o, s] = g.useState(a.interest_rate ?? 0), p = o < 0, c = async () => {
825
+ await r({
826
+ ...a.account,
827
+ interest_rate: o
828
+ }), a.interest_rate = o, t(C.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
738
829
  }, m = () => {
739
830
  setTimeout(() => {
740
- s(r.interest_rate ?? 0);
831
+ s(a.interest_rate ?? 0);
741
832
  }, 250);
742
833
  };
743
- return /* @__PURE__ */ e(
744
- re,
745
- {
746
- isSaveDisabled: d,
747
- label: `${n.details_interest_rate} (%)`,
748
- onCancel: m,
749
- onSave: c,
750
- primaryText: n.details_interest_rate,
751
- secondaryText: We(Number(r.interest_rate) / 100),
752
- zeroStateText: r.interest_rate ? void 0 : n.add_interest_rate,
753
- children: /* @__PURE__ */ e(
754
- tt,
755
- {
756
- error: d,
757
- fullWidth: !0,
758
- onChange: (h) => s(isNaN(parseFloat(h.target.value)) ? 0 : parseFloat(h.target.value)),
759
- type: "number",
760
- value: a
761
- }
762
- )
763
- }
764
- );
765
- }), St = C(({ debt: r }) => {
766
- const { debts: n } = w(), { updateAccount: o } = te(), { onEvent: t } = k(), [a, s] = f.useState(r.monthly_payment ?? 0), d = a < 0 || a > 9999999999e-2, c = async () => {
767
- await o({ ...r.account, minimum_payment: a }), r.monthly_payment = a, t(S.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: r.guid });
834
+ return /* @__PURE__ */ e(ee, {
835
+ isSaveDisabled: p,
836
+ label: `${n.details_interest_rate} (%)`,
837
+ onCancel: m,
838
+ onSave: c,
839
+ primaryText: n.details_interest_rate,
840
+ secondaryText: Le(Number(a.interest_rate) / 100),
841
+ zeroStateText: a.interest_rate ? void 0 : n.add_interest_rate,
842
+ children: /* @__PURE__ */ e(dt, {
843
+ error: p,
844
+ fullWidth: !0,
845
+ onChange: (h) => s(isNaN(parseFloat(h.target.value)) ? 0 : parseFloat(h.target.value)),
846
+ type: "number",
847
+ value: o
848
+ })
849
+ });
850
+ }), St = v(({ debt: a }) => {
851
+ const { debts: n } = w(), { updateAccount: r } = re(), { onEvent: t } = E(), [o, s] = g.useState(a.monthly_payment ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
852
+ await r({
853
+ ...a.account,
854
+ minimum_payment: o
855
+ }), a.monthly_payment = o, t(C.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
768
856
  }, m = () => {
769
857
  setTimeout(() => {
770
- s(r.monthly_payment ?? 0);
858
+ s(a.monthly_payment ?? 0);
771
859
  }, 250);
772
860
  };
773
- return /* @__PURE__ */ e(
774
- re,
775
- {
776
- isSaveDisabled: d,
777
- label: n.details_monthly_payment,
778
- onCancel: m,
779
- onSave: c,
780
- primaryText: n.details_monthly_payment,
781
- secondaryText: I(r.monthly_payment, "0,0"),
782
- zeroStateText: r.monthly_payment ? void 0 : n.add_monthly_payment,
783
- children: /* @__PURE__ */ e(
784
- se,
785
- {
786
- amount: a,
787
- autoFocus: !0,
788
- error: d,
789
- fullWidth: !0,
790
- minAmount: 0,
791
- setAmount: (h) => s(isNaN(Number(h)) ? a : Number(h)),
792
- sx: { ".MuiTypography-body1": { p: 0 } }
793
- }
794
- )
795
- }
796
- );
797
- }), At = C(({ debt: r }) => {
798
- const { debts: n } = w(), { updateAccount: o } = te(), { onEvent: t } = k(), [a, s] = f.useState(r.original_balance ?? 0), d = a < 0 || a > 9999999999e-2, c = async () => {
799
- await o({ ...r.account, original_balance: a }), r.original_balance = a, t(S.DEBTS_SAVE_BALANCE_ACTION, { account_guid: r.guid });
861
+ return /* @__PURE__ */ e(ee, {
862
+ isSaveDisabled: p,
863
+ label: n.details_monthly_payment,
864
+ onCancel: m,
865
+ onSave: c,
866
+ primaryText: n.details_monthly_payment,
867
+ secondaryText: A(a.monthly_payment, "0,0"),
868
+ zeroStateText: a.monthly_payment ? void 0 : n.add_monthly_payment,
869
+ children: /* @__PURE__ */ e(oe, {
870
+ amount: o,
871
+ autoFocus: !0,
872
+ error: p,
873
+ fullWidth: !0,
874
+ minAmount: 0,
875
+ setAmount: (h) => s(isNaN(Number(h)) ? o : Number(h)),
876
+ sx: { ".MuiTypography-body1": { p: 0 } }
877
+ })
878
+ });
879
+ }), At = v(({ debt: a }) => {
880
+ const { debts: n } = w(), { updateAccount: r } = re(), { onEvent: t } = E(), [o, s] = g.useState(a.original_balance ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
881
+ await r({
882
+ ...a.account,
883
+ original_balance: o
884
+ }), a.original_balance = o, t(C.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
800
885
  }, m = () => {
801
886
  setTimeout(() => {
802
- s(r.original_balance ?? 0);
887
+ s(a.original_balance ?? 0);
803
888
  }, 250);
804
889
  };
805
- return /* @__PURE__ */ e(
806
- re,
807
- {
808
- isSaveDisabled: d,
809
- label: n.details_original_balance,
810
- onCancel: m,
811
- onSave: c,
812
- primaryText: n.details_original_balance,
813
- secondaryText: I(r.original_balance, "0,0"),
814
- zeroStateText: r.original_balance ? void 0 : n.add_original_balance,
815
- children: /* @__PURE__ */ e(
816
- se,
817
- {
818
- amount: a,
819
- autoFocus: !0,
820
- error: d,
821
- fullWidth: !0,
822
- minAmount: 0,
823
- setAmount: (h) => s(isNaN(Number(h)) ? a : Number(h)),
824
- sx: { ".MuiTypography-body1": { p: 0 } }
825
- }
826
- )
827
- }
828
- );
890
+ return /* @__PURE__ */ e(ee, {
891
+ isSaveDisabled: p,
892
+ label: n.details_original_balance,
893
+ onCancel: m,
894
+ onSave: c,
895
+ primaryText: n.details_original_balance,
896
+ secondaryText: A(a.original_balance, "0,0"),
897
+ zeroStateText: a.original_balance ? void 0 : n.add_original_balance,
898
+ children: /* @__PURE__ */ e(oe, {
899
+ amount: o,
900
+ autoFocus: !0,
901
+ error: p,
902
+ fullWidth: !0,
903
+ minAmount: 0,
904
+ setAmount: (h) => s(isNaN(Number(h)) ? o : Number(h)),
905
+ sx: { ".MuiTypography-body1": { p: 0 } }
906
+ })
907
+ });
829
908
  }), Tt = () => {
830
- const { onEvent: r } = k(), { selectedDebtChartData: n } = P();
831
- return f.useEffect(() => r(S.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ l(y, { bgcolor: "background.paper", children: [
832
- n?.goal && /* @__PURE__ */ l(R, { children: [
833
- /* @__PURE__ */ e(Je, { goal: n.goal }),
909
+ const { onEvent: a } = E(), { selectedDebtChartData: n } = M();
910
+ return g.useEffect(() => a(C.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ l(y, {
911
+ bgcolor: "background.paper",
912
+ children: [n?.goal && /* @__PURE__ */ l(B, { children: [
913
+ /* @__PURE__ */ e(Ue, { goal: n.goal }),
834
914
  /* @__PURE__ */ e(G, {}),
835
- /* @__PURE__ */ e(Qe, { goal: n.goal }),
915
+ /* @__PURE__ */ e(Xe, { goal: n.goal }),
836
916
  /* @__PURE__ */ e(G, {}),
837
- /* @__PURE__ */ e(et, { goal: n.goal }),
917
+ /* @__PURE__ */ e(qe, { goal: n.goal }),
838
918
  /* @__PURE__ */ e(G, {})
839
- ] }),
840
- !n?.goal && n?.account && /* @__PURE__ */ l(R, { children: [
919
+ ] }), !n?.goal && n?.account && /* @__PURE__ */ l(B, { children: [
841
920
  /* @__PURE__ */ e(St, { debt: n }),
842
921
  /* @__PURE__ */ e(G, {}),
843
922
  /* @__PURE__ */ e(Dt, { debt: n }),
844
923
  /* @__PURE__ */ e(G, {}),
845
924
  /* @__PURE__ */ e(At, { debt: n }),
846
925
  /* @__PURE__ */ e(G, {})
847
- ] })
848
- ] });
849
- }, Et = C(Tt), It = ({ setTabValue: r, sx: n }) => {
850
- const { debts: o } = w(), { showError: t, showCompleted: a } = P();
851
- return f.useEffect(() => {
852
- t && r(1);
853
- }, [t]), !t && !a ? /* @__PURE__ */ e(R, {}) : /* @__PURE__ */ l(y, { gap: 16, children: [
854
- /* @__PURE__ */ e(ye, { sx: { my: 16, mx: 24, ...n }, children: /* @__PURE__ */ l(
855
- me,
856
- {
857
- icon: t ? /* @__PURE__ */ e(rt, { filled: !0 }) : /* @__PURE__ */ e(Ce, { color: "success", filled: !0 }),
926
+ ] })]
927
+ });
928
+ }, Et = v(Tt), It = ({ setTabValue: a, sx: n }) => {
929
+ const { debts: r } = w(), { showError: t, showCompleted: o } = M();
930
+ return g.useEffect(() => {
931
+ t && a(1);
932
+ }, [t]), !t && !o ? /* @__PURE__ */ e(B, {}) : /* @__PURE__ */ l(y, {
933
+ gap: 16,
934
+ children: [/* @__PURE__ */ e(me, {
935
+ sx: {
936
+ my: 16,
937
+ mx: 24,
938
+ ...n
939
+ },
940
+ children: /* @__PURE__ */ l(ye, {
941
+ icon: t ? /* @__PURE__ */ e(Qe, { filled: !0 }) : /* @__PURE__ */ e(we, {
942
+ color: "success",
943
+ filled: !0
944
+ }),
858
945
  severity: "error",
859
946
  sx: {
860
947
  alignItems: "start",
@@ -862,218 +949,268 @@ const De = ({
862
949
  borderRadius: 1,
863
950
  borderColor: t ? "error.main" : "success.main",
864
951
  color: "text.primary",
865
- "&.MuiPaper-root": {
866
- backgroundColor: "background.paper"
867
- }
952
+ "&.MuiPaper-root": { backgroundColor: "background.paper" }
868
953
  },
869
- children: [
870
- /* @__PURE__ */ e(_e, { sx: { fontWeight: 600, marginTop: 2 }, variant: "body1", children: t ? o.status_error_title : o.status_complete_title }),
871
- /* @__PURE__ */ e(i, { component: "p", variant: "subtitle2", children: t ? o.status_error_description : o.status_complete_description })
872
- ]
873
- }
874
- ) }),
875
- t && /* @__PURE__ */ e(ye, { sx: { mb: 16, mt: 100, mx: 24, ...n }, children: /* @__PURE__ */ l(
876
- me,
877
- {
878
- icon: /* @__PURE__ */ e(R, {}),
954
+ children: [/* @__PURE__ */ e(fe, {
955
+ sx: {
956
+ fontWeight: 600,
957
+ marginTop: 2
958
+ },
959
+ variant: "body1",
960
+ children: t ? r.status_error_title : r.status_complete_title
961
+ }), /* @__PURE__ */ e(i, {
962
+ component: "p",
963
+ variant: "subtitle2",
964
+ children: t ? r.status_error_description : r.status_complete_description
965
+ })]
966
+ })
967
+ }), t && /* @__PURE__ */ e(me, {
968
+ sx: {
969
+ mb: 16,
970
+ mt: 100,
971
+ mx: 24,
972
+ ...n
973
+ },
974
+ children: /* @__PURE__ */ l(ye, {
975
+ icon: /* @__PURE__ */ e(B, {}),
879
976
  severity: "error",
880
977
  sx: {
881
978
  borderRadius: 2,
882
979
  color: "text.primary",
883
- "&.MuiPaper-root": {
884
- backgroundColor: "background.paper"
885
- }
980
+ "&.MuiPaper-root": { backgroundColor: "background.paper" }
886
981
  },
887
- children: [
888
- /* @__PURE__ */ e(_e, { sx: { fontWeight: 600, marginTop: 2 }, variant: "body1", children: o.status_info_title }),
889
- /* @__PURE__ */ e(i, { component: "p", variant: "subtitle2", children: o.status_info_description })
890
- ]
891
- }
892
- ) })
893
- ] });
894
- }, Mt = C(It), kt = () => {
895
- const { debts: r } = w(), { showError: n, showCompleted: o } = P(), [t, a] = f.useState(0);
896
- return /* @__PURE__ */ l(R, { children: [
897
- (n || o) && /* @__PURE__ */ e(Mt, { setTabValue: a, sx: { mt: -24 } }),
898
- /* @__PURE__ */ l(
899
- Ze,
900
- {
901
- "aria-label": r.details_tabs_aria_label,
902
- centered: !0,
903
- onChange: (s, d) => a(d),
904
- textColor: "primary",
905
- value: t,
906
- variant: "fullWidth",
907
- children: [
908
- /* @__PURE__ */ e(
909
- be,
910
- {
911
- "aria-controls": "debt-schedule-tabpanel-0",
912
- id: "debt-schedule-tab-0",
913
- label: r.schedule_tab_label
914
- }
915
- ),
916
- /* @__PURE__ */ e(
917
- be,
918
- {
919
- "aria-controls": "debt-details-tabpanel-1",
920
- id: "debt-details-tab-1",
921
- label: r.details_tab_label
922
- }
923
- )
924
- ]
925
- }
926
- ),
927
- /* @__PURE__ */ e(fe, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(vt, {}) }),
928
- /* @__PURE__ */ e(fe, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(Et, {}) })
982
+ children: [/* @__PURE__ */ e(fe, {
983
+ sx: {
984
+ fontWeight: 600,
985
+ marginTop: 2
986
+ },
987
+ variant: "body1",
988
+ children: r.status_info_title
989
+ }), /* @__PURE__ */ e(i, {
990
+ component: "p",
991
+ variant: "subtitle2",
992
+ children: r.status_info_description
993
+ })]
994
+ })
995
+ })]
996
+ });
997
+ }, kt = v(It), Nt = () => {
998
+ const { debts: a } = w(), { showError: n, showCompleted: r } = M(), [t, o] = g.useState(0);
999
+ return /* @__PURE__ */ l(B, { children: [
1000
+ (n || r) && /* @__PURE__ */ e(kt, {
1001
+ setTabValue: o,
1002
+ sx: { mt: -24 }
1003
+ }),
1004
+ /* @__PURE__ */ l(tt, {
1005
+ "aria-label": a.details_tabs_aria_label,
1006
+ centered: !0,
1007
+ onChange: (s, p) => o(p),
1008
+ textColor: "primary",
1009
+ value: t,
1010
+ variant: "fullWidth",
1011
+ children: [/* @__PURE__ */ e(_e, {
1012
+ "aria-controls": "debt-schedule-tabpanel-0",
1013
+ id: "debt-schedule-tab-0",
1014
+ label: a.schedule_tab_label
1015
+ }), /* @__PURE__ */ e(_e, {
1016
+ "aria-controls": "debt-details-tabpanel-1",
1017
+ id: "debt-details-tab-1",
1018
+ label: a.details_tab_label
1019
+ })]
1020
+ }),
1021
+ /* @__PURE__ */ e(be, {
1022
+ index: 0,
1023
+ name: "debt-schedule",
1024
+ value: t,
1025
+ children: /* @__PURE__ */ e(Ct, {})
1026
+ }),
1027
+ /* @__PURE__ */ e(be, {
1028
+ index: 1,
1029
+ name: "debt-details",
1030
+ value: t,
1031
+ children: /* @__PURE__ */ e(Et, {})
1032
+ })
929
1033
  ] });
930
- }, Nt = C(kt), Bt = ({ isOpen: r, onClose: n }) => {
931
- const { debts: o } = w(), { showError: t, showCompleted: a } = P(), s = t || a ? /* @__PURE__ */ e(R, {}) : /* @__PURE__ */ e(wt, {});
932
- return /* @__PURE__ */ e(
933
- ie,
934
- {
935
- ariaLabelClose: o.details_close_aria,
936
- isOpen: r,
937
- onClose: n,
938
- title: o.details_title,
939
- children: /* @__PURE__ */ l(y, { bgcolor: "background.default", children: [
940
- /* @__PURE__ */ e(je, { customDetailsChart: s }),
941
- /* @__PURE__ */ e(Nt, {})
942
- ] })
943
- }
944
- );
945
- }, Pt = C(() => {
946
- const { debts: r } = w(), { monthlyCashFlowProfile: n, updateMonthlyCashFlowProfile: o } = V(), { onEvent: t } = k(), [a, s] = f.useState(n?.extra_payment ?? 0), d = a < 0 || a > 9999999999e-2, c = async () => {
947
- n && (await o({ ...n, extra_payment: a }), n.extra_payment = a, t(S.DEBTS_SAVE_PAYDOWN_ACTION, {
948
- user_guid: n?.user_guid
949
- }));
1034
+ }, Mt = v(Nt), Bt = ({ isOpen: a, onClose: n }) => {
1035
+ const { debts: r } = w(), { showError: t, showCompleted: o } = M(), s = t || o ? /* @__PURE__ */ e(B, {}) : /* @__PURE__ */ e(wt, {});
1036
+ return /* @__PURE__ */ e(ie, {
1037
+ ariaLabelClose: r.details_close_aria,
1038
+ isOpen: a,
1039
+ onClose: n,
1040
+ title: r.details_title,
1041
+ children: /* @__PURE__ */ l(y, {
1042
+ bgcolor: "background.default",
1043
+ children: [/* @__PURE__ */ e(Ge, { customDetailsChart: s }), /* @__PURE__ */ e(Mt, {})]
1044
+ })
1045
+ });
1046
+ }, Pt = v(() => {
1047
+ const { debts: a } = w(), { monthlyCashFlowProfile: n, updateMonthlyCashFlowProfile: r } = z(), { onEvent: t } = E(), [o, s] = g.useState(n?.extra_payment ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
1048
+ n && (await r({
1049
+ ...n,
1050
+ extra_payment: o
1051
+ }), n.extra_payment = o, t(C.DEBTS_SAVE_PAYDOWN_ACTION, { user_guid: n?.user_guid }));
950
1052
  }, m = () => {
951
1053
  setTimeout(() => {
952
1054
  s(n?.extra_payment ?? 0);
953
1055
  }, 250);
954
1056
  };
955
- return /* @__PURE__ */ e(
956
- re,
957
- {
958
- isSaveDisabled: d,
959
- label: r.paydown_drawer_extra_payment,
960
- onCancel: m,
961
- onSave: c,
962
- primaryText: r.paydown_drawer_extra_payment,
963
- secondaryText: I(n?.extra_payment, "0,0"),
964
- zeroStateText: n?.extra_payment ? void 0 : r.add_extra_payment,
965
- children: /* @__PURE__ */ e(
966
- se,
967
- {
968
- amount: a,
969
- autoFocus: !0,
970
- error: d,
971
- fullWidth: !0,
972
- minAmount: 0,
973
- setAmount: (h) => s(isNaN(Number(h)) ? a : Number(h)),
974
- sx: { ".MuiTypography-body1": { p: 0 } }
975
- }
976
- )
977
- }
978
- );
1057
+ return /* @__PURE__ */ e(ee, {
1058
+ isSaveDisabled: p,
1059
+ label: a.paydown_drawer_extra_payment,
1060
+ onCancel: m,
1061
+ onSave: c,
1062
+ primaryText: a.paydown_drawer_extra_payment,
1063
+ secondaryText: A(n?.extra_payment, "0,0"),
1064
+ zeroStateText: n?.extra_payment ? void 0 : a.add_extra_payment,
1065
+ children: /* @__PURE__ */ e(oe, {
1066
+ amount: o,
1067
+ autoFocus: !0,
1068
+ error: p,
1069
+ fullWidth: !0,
1070
+ minAmount: 0,
1071
+ setAmount: (h) => s(isNaN(Number(h)) ? o : Number(h)),
1072
+ sx: { ".MuiTypography-body1": { p: 0 } }
1073
+ })
1074
+ });
979
1075
  }), Rt = () => {
980
- const { debts: r } = w(), { totalMonthlyPayments: n } = ee(), { monthlyCashFlowProfile: o } = V(), t = n + Number(o?.extra_payment);
981
- return /* @__PURE__ */ l(y, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
982
- /* @__PURE__ */ l(y, { p: 24, children: [
983
- /* @__PURE__ */ l(y, { alignItems: "center", gap: 4, mb: 24, children: [
984
- /* @__PURE__ */ e(i, { variant: "body1", children: r.paydown_drawer_mimimum_label }),
985
- /* @__PURE__ */ e(xe, { bold: !0, variant: "h1", children: I(n, "0,0") }),
986
- /* @__PURE__ */ e(i, { textAlign: "center", truncate: !1, variant: "body2", width: 208, children: r.paydown_drawer_minimum_info })
987
- ] }),
988
- /* @__PURE__ */ l(y, { children: [
989
- /* @__PURE__ */ e(i, { variant: "h3", children: r.paydown_drawer_subtitle }),
990
- /* @__PURE__ */ e(i, { truncate: !1, variant: "subtitle2", children: r.paydown_drawer_description })
991
- ] })
992
- ] }),
993
- /* @__PURE__ */ e(y, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(Pt, {}) }),
994
- /* @__PURE__ */ e(y, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ l(y, { gap: 4, children: [
995
- /* @__PURE__ */ e(i, { variant: "body2", children: r.paydown_drawer_total_payment }),
996
- /* @__PURE__ */ e(i, { bold: !0, textAlign: "right", variant: "body1", children: I(t, "0,0") })
997
- ] }) })
998
- ] });
999
- }, Lt = C(Rt), Ft = ({ isOpen: r, onClose: n }) => {
1000
- const { debts: o } = w();
1001
- return /* @__PURE__ */ e(
1002
- ie,
1003
- {
1004
- ariaLabelClose: o.paydown_drawer_close_aria,
1005
- isOpen: r,
1006
- onClose: n,
1007
- title: o.paydown_drawer_title,
1008
- children: /* @__PURE__ */ e(Lt, {})
1009
- }
1010
- );
1076
+ const { debts: a } = w(), { totalMonthlyPayments: n } = te(), { monthlyCashFlowProfile: r } = z(), t = n + Number(r?.extra_payment);
1077
+ return /* @__PURE__ */ l(y, {
1078
+ sx: {
1079
+ backgroundColor: "background.default",
1080
+ height: "100%"
1081
+ },
1082
+ children: [
1083
+ /* @__PURE__ */ l(y, {
1084
+ p: 24,
1085
+ children: [/* @__PURE__ */ l(y, {
1086
+ alignItems: "center",
1087
+ gap: 4,
1088
+ mb: 24,
1089
+ children: [
1090
+ /* @__PURE__ */ e(i, {
1091
+ variant: "body1",
1092
+ children: a.paydown_drawer_mimimum_label
1093
+ }),
1094
+ /* @__PURE__ */ e(ge, {
1095
+ bold: !0,
1096
+ variant: "h1",
1097
+ children: A(n, "0,0")
1098
+ }),
1099
+ /* @__PURE__ */ e(i, {
1100
+ textAlign: "center",
1101
+ truncate: !1,
1102
+ variant: "body2",
1103
+ width: 208,
1104
+ children: a.paydown_drawer_minimum_info
1105
+ })
1106
+ ]
1107
+ }), /* @__PURE__ */ l(y, { children: [/* @__PURE__ */ e(i, {
1108
+ variant: "h3",
1109
+ children: a.paydown_drawer_subtitle
1110
+ }), /* @__PURE__ */ e(i, {
1111
+ truncate: !1,
1112
+ variant: "subtitle2",
1113
+ children: a.paydown_drawer_description
1114
+ })] })]
1115
+ }),
1116
+ /* @__PURE__ */ e(y, {
1117
+ sx: { backgroundColor: "background.paper" },
1118
+ children: /* @__PURE__ */ e(Pt, {})
1119
+ }),
1120
+ /* @__PURE__ */ e(y, {
1121
+ flexDirection: "row-reverse",
1122
+ px: 24,
1123
+ py: 12,
1124
+ children: /* @__PURE__ */ l(y, {
1125
+ gap: 4,
1126
+ children: [/* @__PURE__ */ e(i, {
1127
+ variant: "body2",
1128
+ children: a.paydown_drawer_total_payment
1129
+ }), /* @__PURE__ */ e(i, {
1130
+ bold: !0,
1131
+ textAlign: "right",
1132
+ variant: "body1",
1133
+ children: A(t, "0,0")
1134
+ })]
1135
+ })
1136
+ })
1137
+ ]
1138
+ });
1139
+ }, Lt = v(Rt), Ft = ({ isOpen: a, onClose: n }) => {
1140
+ const { debts: r } = w();
1141
+ return /* @__PURE__ */ e(ie, {
1142
+ ariaLabelClose: r.paydown_drawer_close_aria,
1143
+ isOpen: a,
1144
+ onClose: n,
1145
+ title: r.paydown_drawer_title,
1146
+ children: /* @__PURE__ */ e(Lt, {})
1147
+ });
1011
1148
  };
1012
- function $t(r, n) {
1013
- const o = (t) => {
1149
+ function $t(a, n) {
1150
+ const r = (t) => {
1014
1151
  if (typeof t == "number") return t;
1015
1152
  if (t === "!" || t === "✓") return 1 / 0;
1016
1153
  throw new Error("Unsupported value");
1017
1154
  };
1018
- return o(r) - o(n);
1155
+ return r(a) - r(n);
1019
1156
  }
1020
- function Ot(r) {
1021
- return r.is_paid_off ? "✓" : r.priority === void 0 || r.is_impossible ? "!" : r.priority;
1157
+ function Ot(a) {
1158
+ return a.is_paid_off ? "✓" : a.priority === void 0 || a.is_impossible ? "!" : a.priority;
1022
1159
  }
1023
- const Wt = (r) => {
1160
+ var Wt = (a) => {
1024
1161
  const n = {
1025
1162
  text: "#121417",
1026
1163
  background: "#FFB252"
1027
1164
  };
1028
- return r === "!" && (n.text = "#FFFFFF", n.background = "#DF320C"), r === "✓" && (n.text = "#FFFFFF", n.background = "#09A57F"), n;
1029
- }, Gt = (r) => {
1030
- const n = String(r.formattedValue), o = Wt(n);
1031
- return /* @__PURE__ */ e(
1032
- le,
1033
- {
1034
- sx: {
1035
- display: "flex",
1036
- alignItems: "center",
1037
- justifyContent: "center",
1038
- width: 20,
1039
- // Adjust the size as needed
1040
- height: 20,
1041
- borderRadius: "50%",
1042
- backgroundColor: o.background,
1043
- marginLeft: "10px"
1044
- },
1045
- children: /* @__PURE__ */ e(i, { color: o.text, fontWeight: 700, variant: "body2", children: n })
1046
- }
1047
- );
1048
- }, Ht = (r) => {
1049
- const n = r.row.account, o = nt[n.account_type];
1050
- return /* @__PURE__ */ l(y, { alignItems: "center", flexDirection: "row", children: [
1051
- /* @__PURE__ */ e(
1052
- Pe,
1053
- {
1054
- alt: `${n.institutionName}`,
1055
- institutionGuid: n.institution_guid || ""
1056
- }
1057
- ),
1058
- /* @__PURE__ */ l(y, { ml: 12, children: [
1059
- /* @__PURE__ */ e(i, { variant: "body2", children: n.name }),
1060
- /* @__PURE__ */ e(i, { variant: "caption", children: o })
1061
- ] })
1062
- ] });
1063
- }, zt = ({
1064
- sx: r = {},
1065
- debts: n,
1066
- hoveredDebtGuid: o,
1067
- onHoverRow: t,
1068
- onClickRow: a
1069
- }) => {
1070
- const s = j(), { onEvent: d } = k(), { isMobile: c } = ae(), { debts: m, common: h } = w(), [b, v] = f.useState([
1071
- { field: "priority", sort: "asc" }
1072
- ]), x = [
1165
+ return a === "!" && (n.text = "#FFFFFF", n.background = "#DF320C"), a === "✓" && (n.text = "#FFFFFF", n.background = "#09A57F"), n;
1166
+ }, Gt = (a) => {
1167
+ const n = String(a.formattedValue), r = Wt(n);
1168
+ return /* @__PURE__ */ e(se, {
1169
+ sx: {
1170
+ display: "flex",
1171
+ alignItems: "center",
1172
+ justifyContent: "center",
1173
+ width: 20,
1174
+ height: 20,
1175
+ borderRadius: "50%",
1176
+ backgroundColor: r.background,
1177
+ marginLeft: "10px"
1178
+ },
1179
+ children: /* @__PURE__ */ e(i, {
1180
+ color: r.text,
1181
+ fontWeight: 700,
1182
+ variant: "body2",
1183
+ children: n
1184
+ })
1185
+ });
1186
+ }, Ht = (a) => {
1187
+ const n = a.row.account, r = Pe[n.account_type];
1188
+ return /* @__PURE__ */ l(y, {
1189
+ alignItems: "center",
1190
+ flexDirection: "row",
1191
+ children: [/* @__PURE__ */ e(Ze, {
1192
+ alt: `${n.institutionName}`,
1193
+ institutionGuid: n.institution_guid || ""
1194
+ }), /* @__PURE__ */ l(y, {
1195
+ ml: 12,
1196
+ children: [/* @__PURE__ */ e(i, {
1197
+ variant: "body2",
1198
+ children: n.name
1199
+ }), /* @__PURE__ */ e(i, {
1200
+ variant: "caption",
1201
+ children: r
1202
+ })]
1203
+ })]
1204
+ });
1205
+ }, zt = ({ sx: a = {}, debts: n, hoveredDebtGuid: r, onHoverRow: t, onClickRow: o }) => {
1206
+ const s = j(), { onEvent: p } = E(), { isMobile: c } = le(), { debts: m, common: h } = w(), [b, I] = g.useState([{
1207
+ field: "priority",
1208
+ sort: "asc"
1209
+ }]), x = [
1073
1210
  {
1074
1211
  field: "priority",
1075
1212
  headerName: m.table_column_priority,
1076
- renderHeader: H,
1213
+ renderHeader: O,
1077
1214
  renderCell: Gt,
1078
1215
  sortComparator: $t,
1079
1216
  sortable: !0,
@@ -1087,7 +1224,7 @@ const Wt = (r) => {
1087
1224
  {
1088
1225
  field: "account",
1089
1226
  headerName: m.table_column_account,
1090
- renderHeader: H,
1227
+ renderHeader: O,
1091
1228
  renderCell: Ht,
1092
1229
  sortable: !1,
1093
1230
  type: "custom",
@@ -1099,8 +1236,12 @@ const Wt = (r) => {
1099
1236
  {
1100
1237
  field: "balance",
1101
1238
  headerName: m.table_column_balance,
1102
- renderHeader: H,
1103
- renderCell: (_) => /* @__PURE__ */ e(i, { color: s.palette.text.primary, variant: "body2", children: I(_.value, "0,0") }),
1239
+ renderHeader: O,
1240
+ renderCell: (_) => /* @__PURE__ */ e(i, {
1241
+ color: s.palette.text.primary,
1242
+ variant: "body2",
1243
+ children: A(_.value, "0,0")
1244
+ }),
1104
1245
  sortable: !0,
1105
1246
  hideSortIcons: c,
1106
1247
  type: "number",
@@ -1112,8 +1253,12 @@ const Wt = (r) => {
1112
1253
  {
1113
1254
  field: "interest_rate",
1114
1255
  headerName: m.table_column_interest_rate,
1115
- renderHeader: H,
1116
- renderCell: (_) => /* @__PURE__ */ e(i, { color: s.palette.text.primary, variant: "body2", children: isNaN(_.value) ? "---" : `${Number(_.value).toFixed(2)}%` }),
1256
+ renderHeader: O,
1257
+ renderCell: (_) => /* @__PURE__ */ e(i, {
1258
+ color: s.palette.text.primary,
1259
+ variant: "body2",
1260
+ children: isNaN(_.value) ? "---" : `${Number(_.value).toFixed(2)}%`
1261
+ }),
1117
1262
  sortable: !0,
1118
1263
  hideSortIcons: c,
1119
1264
  type: "number",
@@ -1125,8 +1270,12 @@ const Wt = (r) => {
1125
1270
  {
1126
1271
  field: "projected_payoff_date",
1127
1272
  headerName: m.table_column_payoff_date,
1128
- renderHeader: H,
1129
- renderCell: (_) => /* @__PURE__ */ e(i, { color: s.palette.text.primary, variant: "body2", children: _.value ? J(_.value, Q.MONTH_SHORT_YEAR) : "---" }),
1273
+ renderHeader: O,
1274
+ renderCell: (_) => /* @__PURE__ */ e(i, {
1275
+ color: s.palette.text.primary,
1276
+ variant: "body2",
1277
+ children: _.value ? Q(_.value, Z.MONTH_SHORT_YEAR) : "---"
1278
+ }),
1130
1279
  sortable: !0,
1131
1280
  hideSortIcons: c,
1132
1281
  type: "number",
@@ -1138,8 +1287,12 @@ const Wt = (r) => {
1138
1287
  {
1139
1288
  field: "monthly_payment",
1140
1289
  headerName: m.table_column_amount_due,
1141
- renderHeader: H,
1142
- renderCell: (_) => /* @__PURE__ */ e(i, { color: s.palette.text.primary, variant: "body2", children: typeof _.value == "number" ? I(_.value, "0,0") : "---" }),
1290
+ renderHeader: O,
1291
+ renderCell: (_) => /* @__PURE__ */ e(i, {
1292
+ color: s.palette.text.primary,
1293
+ variant: "body2",
1294
+ children: typeof _.value == "number" ? A(_.value, "0,0") : "---"
1295
+ }),
1143
1296
  sortable: !0,
1144
1297
  hideSortIcons: c,
1145
1298
  type: "number",
@@ -1148,350 +1301,309 @@ const Wt = (r) => {
1148
1301
  minWidth: 122,
1149
1302
  flex: 0.6
1150
1303
  }
1151
- ], $ = [
1152
- ...x.slice(0, 3),
1153
- {
1154
- field: "chevron",
1155
- headerClassName: "chevron-header",
1156
- headerName: "",
1157
- renderCell: () => /* @__PURE__ */ e(u, { "aria-label": h.see_details, role: "button", children: /* @__PURE__ */ e(ne, { name: "chevron_right" }) }),
1158
- sortable: !1,
1159
- hideSortIcons: !0,
1160
- type: "custom",
1161
- align: "right",
1162
- headerAlign: "right",
1163
- width: 20
1164
- }
1165
- ], L = f.useMemo(() => n.map((_, p) => ({
1304
+ ], F = [...x.slice(0, 3), {
1305
+ field: "chevron",
1306
+ headerClassName: "chevron-header",
1307
+ headerName: "",
1308
+ renderCell: () => /* @__PURE__ */ e(u, {
1309
+ "aria-label": h.see_details,
1310
+ role: "button",
1311
+ children: /* @__PURE__ */ e(ne, { name: "chevron_right" })
1312
+ }),
1313
+ sortable: !1,
1314
+ hideSortIcons: !0,
1315
+ type: "custom",
1316
+ align: "right",
1317
+ headerAlign: "right",
1318
+ width: 20
1319
+ }], k = g.useMemo(() => n.map((_, d) => ({
1166
1320
  ..._,
1167
- id: p,
1321
+ id: d,
1168
1322
  priority: Ot(_)
1169
1323
  })), [n]), N = (_) => {
1170
- const D = _.target.closest("[data-id]")?.getAttribute("data-id"), M = n[Number(D)];
1171
- t?.(M?.guid ?? "");
1172
- }, A = (_) => {
1324
+ const d = _.target.closest("[data-id]")?.getAttribute("data-id"), f = n[Number(d)];
1325
+ t?.(f?.guid ?? "");
1326
+ }, D = (_) => {
1173
1327
  c || N(_);
1174
- }, E = (_) => {
1328
+ }, P = (_) => {
1175
1329
  c && N(_);
1176
- }, Y = (_) => L.find((p) => p.guid === _)?.id;
1177
- return /* @__PURE__ */ e(
1178
- le,
1179
- {
1180
- sx: {
1181
- height: "auto",
1182
- width: "100%",
1183
- mt: "15px",
1184
- overflowX: "auto",
1185
- overflowY: "visible",
1186
- boxShadow: "none",
1187
- ...r
1330
+ }, V = (_) => k.find((d) => d.guid === _)?.id;
1331
+ return /* @__PURE__ */ e(se, {
1332
+ sx: {
1333
+ height: "auto",
1334
+ width: "100%",
1335
+ mt: "15px",
1336
+ overflowX: "auto",
1337
+ overflowY: "visible",
1338
+ boxShadow: "none",
1339
+ ...a
1340
+ },
1341
+ children: /* @__PURE__ */ e(ut, {
1342
+ columns: c ? F : x,
1343
+ disableColumnFilter: !0,
1344
+ disableColumnMenu: !0,
1345
+ hideFooter: !0,
1346
+ initialState: { sorting: { sortModel: b } },
1347
+ onRowClick: (_) => {
1348
+ o(), p(C.DEBTS_CLICK_TABLE_ROW, { account_guid: _.row.guid });
1188
1349
  },
1189
- children: /* @__PURE__ */ e(
1190
- ot,
1191
- {
1192
- columns: c ? $ : x,
1193
- disableColumnFilter: !0,
1194
- disableColumnMenu: !0,
1195
- hideFooter: !0,
1196
- initialState: { sorting: { sortModel: b } },
1197
- onRowClick: (_) => {
1198
- a(), d(S.DEBTS_CLICK_TABLE_ROW, { account_guid: _.row.guid });
1199
- },
1200
- onSortModelChange: (_) => {
1201
- v(_), d(S.DEBTS_CLICK_TABLE_SORT);
1202
- },
1203
- rows: L,
1204
- slotProps: {
1205
- baseIconButton: { color: "secondary", sx: { ml: 8 } },
1206
- row: {
1207
- onMouseEnter: A,
1208
- onMouseLeave: () => !c && t?.(""),
1209
- onTouchStart: E,
1210
- onClick: c ? E : void 0
1211
- }
1212
- },
1213
- sortModel: b,
1214
- sortingOrder: ["asc", "desc"],
1215
- sx: {
1216
- "& .chevron-header": { display: "none" },
1217
- [`& .MuiDataGrid-row[data-id="${Y(o)}"]`]: {
1218
- backgroundColor: s.palette.mode === "light" ? "#f8f9fb" : "#1f2329",
1219
- filter: "brightness(98%)"
1220
- }
1221
- }
1350
+ onSortModelChange: (_) => {
1351
+ I(_), p(C.DEBTS_CLICK_TABLE_SORT);
1352
+ },
1353
+ rows: k,
1354
+ slotProps: {
1355
+ baseIconButton: {
1356
+ color: "secondary",
1357
+ sx: { ml: 8 }
1358
+ },
1359
+ row: {
1360
+ onMouseEnter: D,
1361
+ onMouseLeave: () => !c && t?.(""),
1362
+ onTouchStart: P,
1363
+ onClick: c ? P : void 0
1222
1364
  }
1223
- )
1224
- }
1225
- );
1226
- }, jt = ({
1227
- buttonText: r,
1228
- disabled: n,
1229
- isDesktop: o = !1,
1230
- isOpen: t,
1231
- onClick: a
1232
- }) => {
1365
+ },
1366
+ sortModel: b,
1367
+ sortingOrder: ["asc", "desc"],
1368
+ sx: {
1369
+ "& .chevron-header": { display: "none" },
1370
+ [`& .MuiDataGrid-row[data-id="${V(r)}"]`]: {
1371
+ backgroundColor: s.palette.mode === "light" ? "#f8f9fb" : "#1f2329",
1372
+ filter: "brightness(98%)"
1373
+ }
1374
+ }
1375
+ })
1376
+ });
1377
+ }, jt = ({ buttonText: a, disabled: n, isDesktop: r = !1, isOpen: t, onClick: o }) => {
1233
1378
  const s = t ? "unfold_less" : "unfold_more";
1234
- return o ? /* @__PURE__ */ e(
1235
- ve,
1236
- {
1237
- "aria-controls": "prioritize-debts",
1238
- "aria-describedby": "prioritize-debts",
1239
- "aria-haspopup": !0,
1240
- "aria-label": "prioritize-debts",
1241
- disabled: n,
1242
- onClick: a,
1243
- startIcon: /* @__PURE__ */ e(ne, { name: s }),
1244
- sx: { justifyContent: "start" },
1245
- children: r
1246
- }
1247
- ) : /* @__PURE__ */ e(
1248
- at,
1249
- {
1250
- "aria-controls": "prioritize-debts",
1251
- "aria-describedby": "prioritize-debts",
1252
- "aria-haspopup": !0,
1253
- "aria-label": "prioritize-debts",
1254
- disabled: n,
1255
- onClick: a,
1256
- children: /* @__PURE__ */ e(ne, { name: s })
1257
- }
1258
- );
1259
- }, Vt = C(({ buttonEl: r, onClose: n }) => {
1260
- const { onEvent: o } = k(), { debts: t } = w(), { selectedDebtPriority: a, setSelectedDebtPriority: s } = P(), d = !!r, c = [
1379
+ return r ? /* @__PURE__ */ e(xe, {
1380
+ "aria-controls": "prioritize-debts",
1381
+ "aria-describedby": "prioritize-debts",
1382
+ "aria-haspopup": !0,
1383
+ "aria-label": "prioritize-debts",
1384
+ disabled: n,
1385
+ onClick: o,
1386
+ startIcon: /* @__PURE__ */ e(ne, { name: s }),
1387
+ sx: { justifyContent: "start" },
1388
+ children: a
1389
+ }) : /* @__PURE__ */ e(rt, {
1390
+ "aria-controls": "prioritize-debts",
1391
+ "aria-describedby": "prioritize-debts",
1392
+ "aria-haspopup": !0,
1393
+ "aria-label": "prioritize-debts",
1394
+ disabled: n,
1395
+ onClick: o,
1396
+ children: /* @__PURE__ */ e(ne, { name: s })
1397
+ });
1398
+ }, Vt = v(({ buttonEl: a, onClose: n }) => {
1399
+ const { onEvent: r } = E(), { debts: t } = w(), { selectedDebtPriority: o, setSelectedDebtPriority: s } = M(), p = !!a, c = [
1261
1400
  {
1262
- priority: F.FASTEST_PAYOFF_FIRST,
1401
+ priority: L.FASTEST_PAYOFF_FIRST,
1263
1402
  text: t.priority_sort_fastest_payoff
1264
1403
  },
1265
1404
  {
1266
- priority: F.HIGHEST_INTEREST,
1405
+ priority: L.HIGHEST_INTEREST,
1267
1406
  text: t.priority_sort_highest_interest
1268
1407
  },
1269
1408
  {
1270
- priority: F.LOWEST_BALANCE,
1409
+ priority: L.LOWEST_BALANCE,
1271
1410
  text: t.priority_sort_lowest_balance
1272
1411
  },
1273
1412
  {
1274
- priority: F.HIGHEST_BALANCE,
1413
+ priority: L.HIGHEST_BALANCE,
1275
1414
  text: t.priority_sort_highest_balance
1276
1415
  }
1277
1416
  ], m = (h) => {
1278
- s(h), o(S.DEBTS_CLICK_PRIORITY, { debts_priority: h });
1417
+ s(h), r(C.DEBTS_CLICK_PRIORITY, { debts_priority: h });
1279
1418
  };
1280
- return /* @__PURE__ */ e(
1281
- lt,
1282
- {
1283
- anchorEl: r,
1284
- anchorOrigin: {
1285
- vertical: "bottom",
1286
- horizontal: "left"
1287
- },
1288
- id: "prioritize-debts",
1289
- onClose: n,
1290
- open: d,
1291
- transformOrigin: {
1292
- vertical: "top",
1293
- horizontal: "left"
1419
+ return /* @__PURE__ */ e(st, {
1420
+ anchorEl: a,
1421
+ anchorOrigin: {
1422
+ vertical: "bottom",
1423
+ horizontal: "left"
1424
+ },
1425
+ id: "prioritize-debts",
1426
+ onClose: n,
1427
+ open: p,
1428
+ transformOrigin: {
1429
+ vertical: "top",
1430
+ horizontal: "left"
1431
+ },
1432
+ children: /* @__PURE__ */ e(Ce, { children: c.map(({ priority: h, text: b }) => /* @__PURE__ */ l(ct, {
1433
+ onClick: () => m(h),
1434
+ sx: {
1435
+ bgcolor: o === h ? "primary.main" : void 0,
1436
+ color: o === h ? "#fff" : void 0,
1437
+ justifyContent: "space-between",
1438
+ minHeight: 44,
1439
+ minWidth: 268,
1440
+ px: 24,
1441
+ py: 12,
1442
+ "&:hover": {
1443
+ bgcolor: "background.highlight",
1444
+ cursor: "pointer",
1445
+ color: "text.primary"
1446
+ }
1294
1447
  },
1295
- children: /* @__PURE__ */ e(we, { children: c.map(({ priority: h, text: b }) => /* @__PURE__ */ l(
1296
- it,
1297
- {
1298
- onClick: () => m(h),
1299
- sx: {
1300
- bgcolor: a === h ? "primary.main" : void 0,
1301
- color: a === h ? "#fff" : void 0,
1302
- justifyContent: "space-between",
1303
- minHeight: 44,
1304
- minWidth: 268,
1305
- px: 24,
1306
- py: 12,
1307
- "&:hover": {
1308
- bgcolor: "background.highlight",
1309
- cursor: "pointer",
1310
- color: "text.primary"
1311
- }
1312
- },
1313
- children: [
1314
- /* @__PURE__ */ e(i, { color: "inherit", variant: "body2", children: b }),
1315
- a === h && /* @__PURE__ */ e(Ce, { color: "inherit", filled: !0, fontSize: "small" })
1316
- ]
1317
- },
1318
- h
1319
- )) })
1320
- }
1321
- );
1322
- }), Yt = C(({ disabled: r, isDesktop: n }) => {
1323
- const { onEvent: o } = k(), { debts: t } = w(), { selectedDebtPriority: a } = P(), [s, d] = f.useState(null), c = (v) => {
1324
- d(v.currentTarget), o(S.DEBTS_CLICK_PRIORITIZE);
1448
+ children: [/* @__PURE__ */ e(i, {
1449
+ color: "inherit",
1450
+ variant: "body2",
1451
+ children: b
1452
+ }), o === h && /* @__PURE__ */ e(we, {
1453
+ color: "inherit",
1454
+ filled: !0,
1455
+ fontSize: "small"
1456
+ })]
1457
+ }, h)) })
1458
+ });
1459
+ }), Yt = v(({ disabled: a, isDesktop: n }) => {
1460
+ const { onEvent: r } = E(), { debts: t } = w(), { selectedDebtPriority: o } = M(), [s, p] = g.useState(null), c = (b) => {
1461
+ p(b.currentTarget), r(C.DEBTS_CLICK_PRIORITIZE);
1325
1462
  }, m = () => {
1326
- d(null);
1327
- }, h = !!s, b = f.useMemo(() => ({
1328
- [F.FASTEST_PAYOFF_FIRST]: t.priority_sort_fastest_payoff,
1329
- [F.HIGHEST_INTEREST]: t.priority_sort_highest_interest,
1330
- [F.HIGHEST_BALANCE]: t.priority_sort_highest_balance,
1331
- [F.LOWEST_BALANCE]: t.priority_sort_lowest_balance
1332
- })[a] ?? t.priority_sort_lowest_balance, [a]);
1333
- return /* @__PURE__ */ l(u, { children: [
1334
- /* @__PURE__ */ e(
1335
- jt,
1336
- {
1337
- buttonText: b,
1338
- disabled: r,
1339
- isDesktop: n,
1340
- isOpen: h,
1341
- onClick: c
1342
- }
1343
- ),
1344
- /* @__PURE__ */ e(Vt, { buttonEl: s, onClose: m })
1345
- ] });
1346
- }), Kt = C(({ disabled: r, onClick: n }) => {
1347
- const { debts: o } = w(), { totalMonthlyPayments: t } = ee(), { monthlyCashFlowProfile: a } = V(), s = t + Number(a?.extra_payment), d = o.paydown_button_long;
1348
- return /* @__PURE__ */ e(y, { alignItems: "center", sx: { flex: 1, flexShrink: 0 }, children: /* @__PURE__ */ e(
1349
- ve,
1350
- {
1463
+ p(null);
1464
+ }, h = !!s;
1465
+ return /* @__PURE__ */ l(u, { children: [/* @__PURE__ */ e(jt, {
1466
+ buttonText: g.useMemo(() => ({
1467
+ [L.FASTEST_PAYOFF_FIRST]: t.priority_sort_fastest_payoff,
1468
+ [L.HIGHEST_INTEREST]: t.priority_sort_highest_interest,
1469
+ [L.HIGHEST_BALANCE]: t.priority_sort_highest_balance,
1470
+ [L.LOWEST_BALANCE]: t.priority_sort_lowest_balance
1471
+ })[o] ?? t.priority_sort_lowest_balance, [o]),
1472
+ disabled: a,
1473
+ isDesktop: n,
1474
+ isOpen: h,
1475
+ onClick: c
1476
+ }), /* @__PURE__ */ e(Vt, {
1477
+ buttonEl: s,
1478
+ onClose: m
1479
+ })] });
1480
+ }), Kt = v(({ disabled: a, onClick: n }) => {
1481
+ const { debts: r } = w(), { totalMonthlyPayments: t } = te(), { monthlyCashFlowProfile: o } = z(), s = t + Number(o?.extra_payment), p = r.paydown_button_long;
1482
+ return /* @__PURE__ */ e(y, {
1483
+ alignItems: "center",
1484
+ sx: {
1485
+ flex: 1,
1486
+ flexShrink: 0
1487
+ },
1488
+ children: /* @__PURE__ */ e(xe, {
1351
1489
  "aria-controls": "extra-paydown",
1352
1490
  "aria-describedby": "extra-paydown",
1353
1491
  "aria-haspopup": !0,
1354
1492
  "aria-label": "extra-paydown",
1355
- disabled: r,
1493
+ disabled: a,
1356
1494
  onClick: n,
1357
1495
  sx: { justifyContent: "start" },
1358
- children: T(d, I(s, "0,0"))
1359
- }
1360
- ) });
1361
- }), Ut = ({ onBackClick: r, onMenuClick: n, sx: o }) => {
1362
- const { isDesktop: t, isMobile: a } = ae(), { connect: s, debts: d } = w(), { onEvent: c } = k(), {
1363
- config: { show_connections_widget_in_master: m }
1364
- } = He(), { isInitialized: h } = ze(), { setSelectedAccount: b } = Ve(), { selectedDebtPriority: v, setSelectedDebtChartData: x } = P(), {
1365
- isAccountDataLoaded: $,
1366
- loadAccountData: L,
1367
- detailedAccounts: N,
1368
- visibleDebtAccounts: A
1369
- } = te(), { isAllGoalDataLoaded: E, loadGoalData: Y, monthlyCashFlowProfile: _ } = V(), { debts: p } = ee(), [g, D] = f.useState(!1), [M, B] = f.useState(!1), [K, ce] = f.useState(!1), [U, Se] = f.useState(""), [Ae, de] = f.useState(!1);
1370
- st({
1496
+ children: S(p, A(s, "0,0"))
1497
+ })
1498
+ });
1499
+ }), Ut = ({ onBackClick: a, onMenuClick: n, sx: r }) => {
1500
+ const { isDesktop: t, isMobile: o } = le(), { connect: s, debts: p } = w(), { onEvent: c } = E(), { config: { show_connections_widget_in_master: m } } = Ye(), { isInitialized: h } = Ve(), { setSelectedAccount: b } = He(), { selectedDebtPriority: I, setSelectedDebtChartData: x } = M(), { isAccountDataLoaded: F, loadAccountData: k, detailedAccounts: N, visibleDebtAccounts: D } = re(), { isAllGoalDataLoaded: P, loadGoalData: V, monthlyCashFlowProfile: _ } = z(), { debts: d } = te(), [f, T] = g.useState(!1), [$, R] = g.useState(!1), [Y, ce] = g.useState(!1), [K, Se] = g.useState(""), [Ae, de] = g.useState(!1);
1501
+ ze({
1371
1502
  widgetName: "DebtsWidget",
1372
- isLoaded: E
1503
+ isLoaded: P
1373
1504
  });
1374
- const q = f.useMemo(() => {
1375
- const O = _?.extra_payment ?? 0;
1376
- return $e(p, v, O);
1377
- }, [p, v, _]);
1378
- f.useEffect(() => {
1379
- $ || L().finally(), c(S.DEBTS_VIEW);
1380
- }, []), f.useEffect(() => {
1381
- h && Y().finally();
1505
+ const U = g.useMemo(() => Be(d, I, _?.extra_payment ?? 0), [
1506
+ d,
1507
+ I,
1508
+ _
1509
+ ]);
1510
+ g.useEffect(() => {
1511
+ F || k().finally(), c(C.DEBTS_VIEW);
1512
+ }, []), g.useEffect(() => {
1513
+ h && V().finally();
1382
1514
  }, [h]);
1383
- const pe = (O) => Se(O), ue = () => {
1384
- const O = A.find((oe) => oe.guid === U), he = q.find((oe) => oe.guid === U);
1385
- O && b(O), he && x(he), D(!0);
1386
- }, Te = () => c(S.DEBTS_CLICK_FILTER), Ee = () => {
1387
- ce(!0), c(S.DEBTS_CLICK_SNOWBALL_CTA);
1515
+ const pe = (J) => Se(J), ue = () => {
1516
+ const J = D.find((ae) => ae.guid === K), he = U.find((ae) => ae.guid === K);
1517
+ J && b(J), he && x(he), T(!0);
1518
+ }, Te = () => c(C.DEBTS_CLICK_FILTER), Ee = () => {
1519
+ ce(!0), c(C.DEBTS_CLICK_SNOWBALL_CTA);
1388
1520
  }, Ie = () => {
1389
- B(!0), c(S.DEBTS_CLICK_PAYDOWN);
1521
+ R(!0), c(C.DEBTS_CLICK_PAYDOWN);
1390
1522
  };
1391
- if (!h || !E)
1392
- return /* @__PURE__ */ e(ct, {});
1393
- const Me = N.length === 0, ke = A.length === 0, Ne = p.length === 0, X = Me || ke || Ne, Z = Oe(
1394
- d,
1395
- m,
1396
- () => de(!0)
1397
- );
1398
- return /* @__PURE__ */ l(
1399
- dt,
1400
- {
1401
- actions: [/* @__PURE__ */ e(Yt, { disabled: X }, "prioritize-debts")],
1402
- allowedAccountTypes: [
1403
- z.CREDIT_CARD,
1404
- z.LOAN,
1405
- z.MORTGAGE,
1406
- z.LINE_OF_CREDIT,
1407
- z.CHECKING_LINE_OF_CREDIT
1408
- ],
1409
- hasDivider: !0,
1410
- onAccountsFilterClick: Te,
1411
- onBackClick: r,
1412
- onMenuClick: n,
1413
- slotComponent: /* @__PURE__ */ e(Kt, { disabled: X, onClick: Ie }, "extra-paydown"),
1414
- sx: o,
1415
- title: d.title,
1416
- children: [
1417
- /* @__PURE__ */ l(y, { sx: { pt: 48, px: t ? "48px" : "24px" }, children: [
1418
- X && /* @__PURE__ */ e(
1419
- pt,
1420
- {
1421
- header: Z.header,
1422
- icon: "note_stack",
1423
- onClick: Z.onClickHandler,
1424
- primaryButton: Z.primaryButton,
1425
- subText: Z.description,
1426
- sx: { maxWidth: 400 }
1427
- }
1428
- ),
1429
- !X && /* @__PURE__ */ l(R, { children: [
1430
- /* @__PURE__ */ l(
1431
- y,
1432
- {
1433
- sx: {
1434
- alignItems: a ? "flex-start" : "flex-end",
1435
- flexDirection: a ? "column" : "row",
1436
- mx: a ? "-12px" : 0
1437
- },
1438
- children: [
1439
- /* @__PURE__ */ e(
1440
- De,
1441
- {
1442
- debts: q,
1443
- height: a ? 250 : void 0,
1444
- hoveredDebtGuid: U,
1445
- onClickArea: ue,
1446
- onHoverArea: pe,
1447
- sx: { mr: a ? "4px" : "-48px" }
1448
- }
1449
- ),
1450
- /* @__PURE__ */ e(
1451
- mt,
1452
- {
1453
- debts: q,
1454
- onClickCta: Ee,
1455
- sx: { mb: a ? "0px" : "64px" }
1456
- }
1457
- )
1458
- ]
1459
- }
1460
- ),
1461
- /* @__PURE__ */ e(y, { sx: { mx: a ? "-24px" : 0 }, children: /* @__PURE__ */ e(
1462
- zt,
1463
- {
1464
- debts: q,
1465
- hoveredDebtGuid: U,
1466
- onClickRow: ue,
1467
- onHoverRow: pe
1468
- }
1469
- ) })
1470
- ] })
1471
- ] }),
1472
- /* @__PURE__ */ e(
1473
- yt,
1474
- {
1475
- isOpen: K,
1476
- onClose: () => ce(!1)
1477
- }
1478
- ),
1479
- /* @__PURE__ */ e(Bt, { isOpen: g, onClose: () => D(!1) }),
1480
- /* @__PURE__ */ e(Ft, { isOpen: M, onClose: () => B(!1) }),
1481
- /* @__PURE__ */ e(
1482
- ut,
1483
- {
1484
- onClose: () => de(!1),
1485
- showConnectWidget: Ae,
1486
- title: s.mini_title
1487
- }
1488
- )
1489
- ]
1490
- }
1491
- );
1492
- }, Hr = C(Ut);
1523
+ if (!h || !P) return /* @__PURE__ */ e(Ke, {});
1524
+ const ke = N.length === 0, Ne = D.length === 0, Me = d.length === 0, X = ke || Ne || Me, q = Re(p, m, () => de(!0));
1525
+ return /* @__PURE__ */ l(Oe, {
1526
+ actions: [/* @__PURE__ */ e(Yt, { disabled: X }, "prioritize-debts")],
1527
+ allowedAccountTypes: [
1528
+ H.CREDIT_CARD,
1529
+ H.LOAN,
1530
+ H.MORTGAGE,
1531
+ H.LINE_OF_CREDIT,
1532
+ H.CHECKING_LINE_OF_CREDIT
1533
+ ],
1534
+ hasDivider: !0,
1535
+ onAccountsFilterClick: Te,
1536
+ onBackClick: a,
1537
+ onMenuClick: n,
1538
+ slotComponent: /* @__PURE__ */ e(Kt, {
1539
+ disabled: X,
1540
+ onClick: Ie
1541
+ }, "extra-paydown"),
1542
+ sx: r,
1543
+ title: p.title,
1544
+ children: [
1545
+ /* @__PURE__ */ l(y, {
1546
+ sx: {
1547
+ pt: 48,
1548
+ px: t ? "48px" : "24px"
1549
+ },
1550
+ children: [X && /* @__PURE__ */ e($e, {
1551
+ header: q.header,
1552
+ icon: "note_stack",
1553
+ onClick: q.onClickHandler,
1554
+ primaryButton: q.primaryButton,
1555
+ subText: q.description,
1556
+ sx: { maxWidth: 400 }
1557
+ }), !X && /* @__PURE__ */ l(B, { children: [/* @__PURE__ */ l(y, {
1558
+ sx: {
1559
+ alignItems: o ? "flex-start" : "flex-end",
1560
+ flexDirection: o ? "column" : "row",
1561
+ mx: o ? "-12px" : 0
1562
+ },
1563
+ children: [/* @__PURE__ */ e(De, {
1564
+ debts: U,
1565
+ height: o ? 250 : void 0,
1566
+ hoveredDebtGuid: K,
1567
+ onClickArea: ue,
1568
+ onHoverArea: pe,
1569
+ sx: { mr: o ? "4px" : "-48px" }
1570
+ }), /* @__PURE__ */ e(mt, {
1571
+ debts: U,
1572
+ onClickCta: Ee,
1573
+ sx: { mb: o ? "0px" : "64px" }
1574
+ })]
1575
+ }), /* @__PURE__ */ e(y, {
1576
+ sx: { mx: o ? "-24px" : 0 },
1577
+ children: /* @__PURE__ */ e(zt, {
1578
+ debts: U,
1579
+ hoveredDebtGuid: K,
1580
+ onClickRow: ue,
1581
+ onHoverRow: pe
1582
+ })
1583
+ })] })]
1584
+ }),
1585
+ /* @__PURE__ */ e(yt, {
1586
+ isOpen: Y,
1587
+ onClose: () => ce(!1)
1588
+ }),
1589
+ /* @__PURE__ */ e(Bt, {
1590
+ isOpen: f,
1591
+ onClose: () => T(!1)
1592
+ }),
1593
+ /* @__PURE__ */ e(Ft, {
1594
+ isOpen: $,
1595
+ onClose: () => R(!1)
1596
+ }),
1597
+ /* @__PURE__ */ e(We, {
1598
+ onClose: () => de(!1),
1599
+ showConnectWidget: Ae,
1600
+ title: s.mini_title
1601
+ })
1602
+ ]
1603
+ });
1604
+ }, Ir = v(Ut);
1493
1605
  export {
1494
1606
  De as DebtsChart,
1495
1607
  zt as DebtsTable,
1496
- Hr as DebtsWidget
1608
+ Ir as DebtsWidget
1497
1609
  };