@mx-cartographer/experiences 7.5.6 → 7.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/LineChart-BF4QA-Lx.mjs +580 -0
- package/dist/accounts/index.es.js +1 -1
- package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
- package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
- package/dist/debts/index.es.js +198 -200
- package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +2 -3
- package/dist/finstrong/index.es.js +550 -543
- package/dist/networth/index.es.js +2 -2
- package/dist/trends/index.es.js +437 -432
- package/package.json +2 -2
- package/dist/LineChart-BQRxZF3p.mjs +0 -581
package/dist/debts/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s, Fragment as H } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import x from "react";
|
|
3
3
|
import { observer as D } from "mobx-react-lite";
|
|
4
4
|
import w from "@mui/material/Stack";
|
|
5
5
|
import { useTheme as X, Card as be, Stack as _, Box as G } from "@mui/material";
|
|
@@ -20,9 +20,9 @@ import { A as ke, u as Ne } from "../AccountDetailsHeader-B21Y8_ED.mjs";
|
|
|
20
20
|
import Fe from "@mui/material/Card";
|
|
21
21
|
import Re from "@mui/material/CardContent";
|
|
22
22
|
import Le from "@mui/material/CardHeader";
|
|
23
|
-
import { LineChart as $e } from "@mui/x-charts";
|
|
24
23
|
import re from "@mui/material/Box";
|
|
25
|
-
import { useTheme as
|
|
24
|
+
import { useTheme as $e } from "@mui/material/styles";
|
|
25
|
+
import { LineChart as He } from "@mui/x-charts/LineChart";
|
|
26
26
|
import { A as T, W as Oe } from "../WidgetContainer-DyotIGdv.mjs";
|
|
27
27
|
import de from "@mui/material/Tab";
|
|
28
28
|
import We from "@mui/material/Tabs";
|
|
@@ -46,17 +46,17 @@ import qe from "@mui/material/ListItem";
|
|
|
46
46
|
import Ze from "@mui/material/Popover";
|
|
47
47
|
import { u as Je } from "../useWidgetLoadTimer-hIOioiKx.mjs";
|
|
48
48
|
import { L as Qe } from "../Loader-DUaFpDGv.mjs";
|
|
49
|
-
const et = (a,
|
|
49
|
+
const et = (a, o = 0, r = 0) => {
|
|
50
50
|
if (r === 0) return 0;
|
|
51
|
-
const t =
|
|
51
|
+
const t = o / (Ee * Ie);
|
|
52
52
|
return Math.ceil(
|
|
53
53
|
t === 0 ? a / r : -Math.log(1 - t * a / r) / Math.log(1 + t)
|
|
54
54
|
);
|
|
55
|
-
}, tt = (a,
|
|
55
|
+
}, tt = (a, o, r, t, n) => {
|
|
56
56
|
const i = [];
|
|
57
57
|
if (r === 0) {
|
|
58
58
|
for (let c = 0; c < a; c++) {
|
|
59
|
-
const d =
|
|
59
|
+
const d = o - t * (c + 1), m = o - t * c, b = d >= 0 ? t : m;
|
|
60
60
|
i.push({
|
|
61
61
|
balance: d >= 0 ? d : 0,
|
|
62
62
|
interest: r,
|
|
@@ -64,7 +64,7 @@ const et = (a, n = 0, r = 0) => {
|
|
|
64
64
|
principal: b,
|
|
65
65
|
timestamp: ce(
|
|
66
66
|
le(
|
|
67
|
-
se(
|
|
67
|
+
se(n),
|
|
68
68
|
// convert seconds → Date
|
|
69
69
|
c + 1
|
|
70
70
|
// add (index + 1) months
|
|
@@ -76,7 +76,7 @@ const et = (a, n = 0, r = 0) => {
|
|
|
76
76
|
}
|
|
77
77
|
const p = r / 1200;
|
|
78
78
|
for (let c = 0; c < a; c++) {
|
|
79
|
-
const d = ce(le(se(
|
|
79
|
+
const d = ce(le(se(n), c + 1)), m = Math.pow(1 + p, c), b = o * m - t * ((m - 1) / p), f = Math.pow(1 + p, c + 1), u = o * f - t * ((f - 1) / p), v = t + Math.min(u, 0), M = b * p;
|
|
80
80
|
i.push({
|
|
81
81
|
balance: Math.max(0, u),
|
|
82
82
|
interest: M,
|
|
@@ -87,47 +87,47 @@ const et = (a, n = 0, r = 0) => {
|
|
|
87
87
|
}
|
|
88
88
|
return i;
|
|
89
89
|
}, rt = (a) => (a[a.length - 1] || {}).timestamp, at = (a) => {
|
|
90
|
-
const { monthly_payment:
|
|
90
|
+
const { monthly_payment: o, interest_rate: r, balance: t, payment_due_date: n } = a, i = et(t, r ?? 0, o ?? 0), p = tt(
|
|
91
91
|
i,
|
|
92
92
|
t,
|
|
93
93
|
r ?? 0,
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
o ?? 0,
|
|
95
|
+
n
|
|
96
96
|
), c = rt(p);
|
|
97
97
|
return {
|
|
98
98
|
...a,
|
|
99
99
|
minimumFinalPayment: c,
|
|
100
100
|
minimumPayments: p
|
|
101
101
|
};
|
|
102
|
-
},
|
|
102
|
+
}, ge = (a, o) => {
|
|
103
103
|
const [r, t] = a.reduce(
|
|
104
|
-
([
|
|
104
|
+
([n, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : n.push(at(p)), [n, i]),
|
|
105
105
|
[[], []]
|
|
106
106
|
);
|
|
107
|
-
switch (
|
|
107
|
+
switch (o) {
|
|
108
108
|
case P.FASTEST_PAYOFF_FIRST:
|
|
109
|
-
r.sort((
|
|
109
|
+
r.sort((n, i) => (n.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
|
|
110
110
|
break;
|
|
111
111
|
case P.HIGHEST_INTEREST:
|
|
112
|
-
r.sort((
|
|
112
|
+
r.sort((n, i) => (i.interest_rate ?? 0) - (n.interest_rate ?? 0));
|
|
113
113
|
break;
|
|
114
114
|
case P.LOWEST_BALANCE:
|
|
115
|
-
r.sort((
|
|
115
|
+
r.sort((n, i) => n.balance - i.balance);
|
|
116
116
|
break;
|
|
117
117
|
case P.HIGHEST_BALANCE:
|
|
118
|
-
r.sort((
|
|
118
|
+
r.sort((n, i) => i.balance - n.balance);
|
|
119
119
|
break;
|
|
120
120
|
default:
|
|
121
|
-
r.sort((
|
|
121
|
+
r.sort((n, i) => n.balance - i.balance);
|
|
122
122
|
}
|
|
123
123
|
a.splice(0, a.length, ...r, ...t);
|
|
124
124
|
};
|
|
125
|
-
function
|
|
125
|
+
function ot(a, o, r = 0) {
|
|
126
126
|
const t = a.map((b) => ({ ...b })).filter(
|
|
127
127
|
(b) => b.interest_rate !== void 0 && b.monthly_payment !== void 0 && !b.is_paid_off
|
|
128
128
|
);
|
|
129
|
-
|
|
130
|
-
let
|
|
129
|
+
ge(t, o);
|
|
130
|
+
let n = 0, i = 0;
|
|
131
131
|
const p = /* @__PURE__ */ new Date(), c = /* @__PURE__ */ new Date();
|
|
132
132
|
for (; t.some((b) => b.balance >= 0.01 && !b.is_impossible); ) {
|
|
133
133
|
let b = !1;
|
|
@@ -141,32 +141,32 @@ function nt(a, n, r = 0) {
|
|
|
141
141
|
u.is_impossible = !0;
|
|
142
142
|
continue;
|
|
143
143
|
}
|
|
144
|
-
u.balance -= B, u.balance = u.balance < 0.01 ? 0 : u.balance,
|
|
144
|
+
u.balance -= B, u.balance = u.balance < 0.01 ? 0 : u.balance, n += I, u.balance <= 0 && (i += C), B > 0 && (b = !0);
|
|
145
145
|
}
|
|
146
146
|
b && c.setMonth(c.getMonth() + 1);
|
|
147
147
|
}
|
|
148
148
|
const d = t.some((b) => b.is_impossible && b.balance > 0), m = Te({ start: p, end: c });
|
|
149
149
|
return {
|
|
150
|
-
payoffSavings: d ? "N/A" : k(
|
|
150
|
+
payoffSavings: d ? "N/A" : k(n, "0,0.00"),
|
|
151
151
|
payoffDate: d ? "Never" : K(c, U.MONTH_YEAR),
|
|
152
152
|
payoffDuration: d ? "Stagnant" : Ae(m, { format: ["years", "months"] }) || "0 months"
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
const $ = () => {
|
|
156
|
-
if (!
|
|
156
|
+
if (!x.useContext(Me))
|
|
157
157
|
throw new Error("useCateUiStore() must be used within the GlobalDataContext");
|
|
158
158
|
return q().uiStore;
|
|
159
|
-
},
|
|
160
|
-
const t = X(), { isMobile:
|
|
159
|
+
}, nt = ({ debts: a, onClickCta: o, sx: r }) => {
|
|
160
|
+
const t = X(), { isMobile: n } = Y(), { debts: i } = S(), { selectedDebtPriority: p } = $(), { monthlyCashFlowProfile: c } = V(), { payoffDate: d, payoffSavings: m, payoffDuration: b } = x.useMemo(() => {
|
|
161
161
|
const f = c?.extra_payment ?? 0;
|
|
162
|
-
return
|
|
162
|
+
return ot(a, p, f);
|
|
163
163
|
}, [a, p, c]);
|
|
164
164
|
return /* @__PURE__ */ e(
|
|
165
165
|
be,
|
|
166
166
|
{
|
|
167
167
|
sx: {
|
|
168
168
|
boxShadow: t.shadows[2],
|
|
169
|
-
width:
|
|
169
|
+
width: n ? "100%" : "186px",
|
|
170
170
|
minWidth: "186px",
|
|
171
171
|
...r
|
|
172
172
|
},
|
|
@@ -174,7 +174,7 @@ const $ = () => {
|
|
|
174
174
|
/* @__PURE__ */ s(
|
|
175
175
|
_,
|
|
176
176
|
{
|
|
177
|
-
gap:
|
|
177
|
+
gap: n ? "4px" : "0",
|
|
178
178
|
sx: {
|
|
179
179
|
borderBottom: "1px solid",
|
|
180
180
|
borderBottomColor: t.palette.grey[300],
|
|
@@ -186,11 +186,11 @@ const $ = () => {
|
|
|
186
186
|
]
|
|
187
187
|
}
|
|
188
188
|
),
|
|
189
|
-
/* @__PURE__ */ s(_, { gap:
|
|
189
|
+
/* @__PURE__ */ s(_, { gap: n ? "4px" : "0", children: [
|
|
190
190
|
/* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: m }),
|
|
191
191
|
/* @__PURE__ */ e(l, { sx: { whiteSpace: "normal" }, variant: "XSmall", children: i.snowball_card_amount_description })
|
|
192
192
|
] }),
|
|
193
|
-
/* @__PURE__ */ s(_, { gap:
|
|
193
|
+
/* @__PURE__ */ s(_, { gap: n ? "4px" : "0", children: [
|
|
194
194
|
/* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: b }),
|
|
195
195
|
/* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_duration_description })
|
|
196
196
|
] }),
|
|
@@ -199,7 +199,7 @@ const $ = () => {
|
|
|
199
199
|
{
|
|
200
200
|
bold: !0,
|
|
201
201
|
color: t.palette.primary.main,
|
|
202
|
-
onClick:
|
|
202
|
+
onClick: o,
|
|
203
203
|
sx: { cursor: "pointer" },
|
|
204
204
|
variant: "Small",
|
|
205
205
|
children: i.snowball_card_cta
|
|
@@ -208,14 +208,14 @@ const $ = () => {
|
|
|
208
208
|
] })
|
|
209
209
|
}
|
|
210
210
|
);
|
|
211
|
-
}, it = D(
|
|
212
|
-
const r = X(), { debts: t } = S(), [
|
|
211
|
+
}, it = D(nt), lt = ({ isOpen: a, onClose: o }) => {
|
|
212
|
+
const r = X(), { debts: t } = S(), [n, i] = x.useState(!1);
|
|
213
213
|
return /* @__PURE__ */ e(
|
|
214
214
|
te,
|
|
215
215
|
{
|
|
216
216
|
ariaLabelClose: "",
|
|
217
217
|
isOpen: a,
|
|
218
|
-
onClose:
|
|
218
|
+
onClose: o,
|
|
219
219
|
title: t.snowball_drawer_title,
|
|
220
220
|
children: /* @__PURE__ */ s(_, { bgcolor: r.palette.background.default, height: "100%", children: [
|
|
221
221
|
/* @__PURE__ */ s(_, { alignItems: "center", px: 24, py: 24, children: [
|
|
@@ -232,7 +232,7 @@ const $ = () => {
|
|
|
232
232
|
{
|
|
233
233
|
color: r.palette.secondary.main,
|
|
234
234
|
mb: 8,
|
|
235
|
-
sx: { whiteSpace:
|
|
235
|
+
sx: { whiteSpace: n ? "normal" : "nowrap" },
|
|
236
236
|
variant: "ParagraphSmall",
|
|
237
237
|
children: t.snowball_drawer_answer
|
|
238
238
|
}
|
|
@@ -242,10 +242,10 @@ const $ = () => {
|
|
|
242
242
|
{
|
|
243
243
|
bold: !0,
|
|
244
244
|
color: r.palette.primary.main,
|
|
245
|
-
onClick: () => i(!
|
|
245
|
+
onClick: () => i(!n),
|
|
246
246
|
sx: { cursor: "pointer" },
|
|
247
247
|
variant: "Small",
|
|
248
|
-
children:
|
|
248
|
+
children: n ? t.snowball_drawer_less : t.snowball_drawer_more
|
|
249
249
|
}
|
|
250
250
|
)
|
|
251
251
|
] })
|
|
@@ -570,45 +570,45 @@ const $ = () => {
|
|
|
570
570
|
}
|
|
571
571
|
);
|
|
572
572
|
}, st = D(lt), ct = "#FF7B08";
|
|
573
|
-
function dt(a,
|
|
574
|
-
const [r, t,
|
|
575
|
-
Math.max(0, Math.min(255, Math.round(r *
|
|
576
|
-
Math.max(0, Math.min(255, Math.round(t *
|
|
577
|
-
Math.max(0, Math.min(255, Math.round(
|
|
573
|
+
function dt(a, o) {
|
|
574
|
+
const [r, t, n] = a.replace(/^#/, "").match(/.{1,2}/g).map((p) => parseInt(p, 16)), i = [
|
|
575
|
+
Math.max(0, Math.min(255, Math.round(r * o))),
|
|
576
|
+
Math.max(0, Math.min(255, Math.round(t * o))),
|
|
577
|
+
Math.max(0, Math.min(255, Math.round(n * o)))
|
|
578
578
|
];
|
|
579
579
|
return `rgb(${i[0]}, ${i[1]}, ${i[2]})`;
|
|
580
580
|
}
|
|
581
|
-
const
|
|
581
|
+
const xe = ({
|
|
582
582
|
sx: a,
|
|
583
|
-
height:
|
|
583
|
+
height: o = 500,
|
|
584
584
|
width: r,
|
|
585
585
|
debts: t,
|
|
586
|
-
hoveredDebtGuid:
|
|
586
|
+
hoveredDebtGuid: n,
|
|
587
587
|
onClickArea: i,
|
|
588
588
|
onHoverArea: p
|
|
589
589
|
}) => {
|
|
590
|
-
const c =
|
|
590
|
+
const c = $e(), { onEvent: d } = F(), m = t.filter((h) => !h.is_impossible), b = [
|
|
591
591
|
...new Set(
|
|
592
|
-
m.flatMap((h) => h.dataset.map((
|
|
592
|
+
m.flatMap((h) => h.dataset.map((g) => new Date(g.x).getTime()))
|
|
593
593
|
)
|
|
594
|
-
].sort((h,
|
|
595
|
-
const
|
|
596
|
-
let A =
|
|
594
|
+
].sort((h, g) => h - g).map((h) => new Date(h)), f = m.map((h) => {
|
|
595
|
+
const g = new Map(h.dataset.map((L) => [new Date(L.x).getTime(), L.y]));
|
|
596
|
+
let A = g.get(b[0].getTime()) ?? 0;
|
|
597
597
|
const R = b.map((L) => {
|
|
598
|
-
const O =
|
|
598
|
+
const O = g.get(L.getTime()) ?? A;
|
|
599
599
|
return A = O, { x: L, y: O };
|
|
600
600
|
});
|
|
601
601
|
return { ...h, dataset: R };
|
|
602
602
|
}), u = f.reduce(
|
|
603
|
-
(h,
|
|
603
|
+
(h, g) => h + (g.dataset[0]?.y ?? 0),
|
|
604
604
|
0
|
|
605
|
-
), v = b.map((h,
|
|
606
|
-
const A =
|
|
605
|
+
), v = b.map((h, g) => {
|
|
606
|
+
const A = g / (b.length - 1), R = u * (1 - A);
|
|
607
607
|
return { x: h, y: R };
|
|
608
|
-
}), M = Math.ceil(u / 100) * 100, I = b, C = f.map((h,
|
|
609
|
-
const A = 1 -
|
|
608
|
+
}), M = Math.ceil(u / 100) * 100, I = b, C = f.map((h, g) => {
|
|
609
|
+
const A = 1 - g / f.length * 0.5, R = dt(ct, A);
|
|
610
610
|
return {
|
|
611
|
-
id: `debt-${
|
|
611
|
+
id: `debt-${g}`,
|
|
612
612
|
guid: h.guid,
|
|
613
613
|
label: h.name,
|
|
614
614
|
data: h.dataset.map((L) => L.y),
|
|
@@ -631,7 +631,7 @@ const ge = ({
|
|
|
631
631
|
showMark: !1,
|
|
632
632
|
disableHighlight: !0
|
|
633
633
|
});
|
|
634
|
-
const B = (h) => C.findIndex((
|
|
634
|
+
const B = (h) => C.findIndex((g) => g?.guid === h);
|
|
635
635
|
return /* @__PURE__ */ e(
|
|
636
636
|
re,
|
|
637
637
|
{
|
|
@@ -648,27 +648,25 @@ const ge = ({
|
|
|
648
648
|
}
|
|
649
649
|
},
|
|
650
650
|
children: /* @__PURE__ */ e(
|
|
651
|
-
|
|
651
|
+
He,
|
|
652
652
|
{
|
|
653
653
|
axisHighlight: { x: "none" },
|
|
654
654
|
disableLineItemHighlight: !0,
|
|
655
|
-
height:
|
|
656
|
-
|
|
655
|
+
height: o,
|
|
656
|
+
hideLegend: !0,
|
|
657
|
+
margin: { bottom: 24, left: 32, right: 72, top: 48 },
|
|
658
|
+
onAreaClick: (h, g) => {
|
|
657
659
|
i?.();
|
|
658
|
-
const A = C.find((R) => R.id ===
|
|
660
|
+
const A = C.find((R) => R.id === g.seriesId);
|
|
659
661
|
d(T.DEBTS_CLICK_CHART_AREA, { account_guid: A?.guid });
|
|
660
662
|
},
|
|
661
663
|
onHighlightChange: (h) => {
|
|
662
|
-
const
|
|
663
|
-
p?.(
|
|
664
|
+
const g = C.find((A) => A.id === h?.seriesId)?.guid;
|
|
665
|
+
p?.(g ?? "");
|
|
664
666
|
},
|
|
665
667
|
series: C,
|
|
666
668
|
skipAnimation: !0,
|
|
667
|
-
slotProps: {
|
|
668
|
-
legend: {
|
|
669
|
-
hidden: !0
|
|
670
|
-
}
|
|
671
|
-
},
|
|
669
|
+
slotProps: { tooltip: { trigger: "none" } },
|
|
672
670
|
sx: {
|
|
673
671
|
p: 4,
|
|
674
672
|
"& .MuiBarLabel-root": {
|
|
@@ -686,10 +684,10 @@ const ge = ({
|
|
|
686
684
|
strokeDasharray: "10 5",
|
|
687
685
|
strokeWidth: 1
|
|
688
686
|
},
|
|
689
|
-
[`& .MuiLineElement-series-debt-${B(
|
|
687
|
+
[`& .MuiLineElement-series-debt-${B(n ?? "0")}`]: {
|
|
690
688
|
opacity: 1
|
|
691
689
|
},
|
|
692
|
-
[`& .MuiAreaElement-series-debt-${B(
|
|
690
|
+
[`& .MuiAreaElement-series-debt-${B(n ?? "0")}`]: {
|
|
693
691
|
opacity: 1
|
|
694
692
|
},
|
|
695
693
|
"& .MuiChartsAxis-tickLabel > tspan": {
|
|
@@ -697,14 +695,14 @@ const ge = ({
|
|
|
697
695
|
},
|
|
698
696
|
...a
|
|
699
697
|
},
|
|
700
|
-
tooltip: { trigger: "none" },
|
|
701
698
|
width: r,
|
|
702
699
|
xAxis: [
|
|
703
700
|
{
|
|
704
701
|
data: I,
|
|
705
|
-
scaleType: "time",
|
|
706
|
-
min: b[0],
|
|
707
702
|
disableTicks: !0,
|
|
703
|
+
min: b[0],
|
|
704
|
+
scaleType: "time",
|
|
705
|
+
tickLabelMinGap: 24,
|
|
708
706
|
valueFormatter: (h) => K(h, U.MONTH_SHORT_YEAR)
|
|
709
707
|
}
|
|
710
708
|
],
|
|
@@ -721,7 +719,7 @@ const ge = ({
|
|
|
721
719
|
}
|
|
722
720
|
);
|
|
723
721
|
}, pt = () => {
|
|
724
|
-
const a = X(), { debts:
|
|
722
|
+
const a = X(), { debts: o } = S(), { selectedDebtChartData: r } = $();
|
|
725
723
|
return /* @__PURE__ */ s(H, { children: [
|
|
726
724
|
/* @__PURE__ */ s(
|
|
727
725
|
Fe,
|
|
@@ -732,8 +730,8 @@ const ge = ({
|
|
|
732
730
|
}
|
|
733
731
|
},
|
|
734
732
|
children: [
|
|
735
|
-
/* @__PURE__ */ e(Le, { sx: { pb: 0 }, title: /* @__PURE__ */ e(ve, { sx: { pb: 4 }, children:
|
|
736
|
-
/* @__PURE__ */ e(Re, { sx: { p: 0 }, children: /* @__PURE__ */ e(
|
|
733
|
+
/* @__PURE__ */ e(Le, { sx: { pb: 0 }, title: /* @__PURE__ */ e(ve, { sx: { pb: 4 }, children: o.details_chart_title }) }),
|
|
734
|
+
/* @__PURE__ */ e(Re, { sx: { p: 0 }, children: /* @__PURE__ */ e(xe, { debts: [r], height: 250 }) })
|
|
737
735
|
]
|
|
738
736
|
}
|
|
739
737
|
),
|
|
@@ -743,13 +741,13 @@ const ge = ({
|
|
|
743
741
|
color: a.palette.text.secondary,
|
|
744
742
|
sx: { whiteSpace: "normal", textAlign: "center", px: 8, py: 12 },
|
|
745
743
|
variant: "Small",
|
|
746
|
-
children:
|
|
744
|
+
children: o.details_chart_description
|
|
747
745
|
}
|
|
748
746
|
)
|
|
749
747
|
] });
|
|
750
748
|
}, mt = D(pt), ht = () => {
|
|
751
|
-
const a = X(), { onEvent:
|
|
752
|
-
return
|
|
749
|
+
const a = X(), { onEvent: o } = F(), { debts: r } = S(), { selectedDebtChartData: t, showCompleted: n, showError: i } = $();
|
|
750
|
+
return x.useEffect(() => o(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(_e, { children: i || n ? /* @__PURE__ */ e(
|
|
753
751
|
l,
|
|
754
752
|
{
|
|
755
753
|
color: a.palette.secondary.main,
|
|
@@ -812,8 +810,8 @@ const ge = ({
|
|
|
812
810
|
) })
|
|
813
811
|
] }) });
|
|
814
812
|
}, ut = D(ht), bt = D(({ debt: a }) => {
|
|
815
|
-
const { debts:
|
|
816
|
-
await r({ ...a.account, interest_rate:
|
|
813
|
+
const { debts: o } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [n, i] = x.useState(a.interest_rate ?? 0), p = n < 0, c = async () => {
|
|
814
|
+
await r({ ...a.account, interest_rate: n }), a.interest_rate = n, t(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
|
|
817
815
|
}, d = () => {
|
|
818
816
|
setTimeout(() => {
|
|
819
817
|
i(a.interest_rate ?? 0);
|
|
@@ -823,12 +821,12 @@ const ge = ({
|
|
|
823
821
|
J,
|
|
824
822
|
{
|
|
825
823
|
isSaveDisabled: p,
|
|
826
|
-
label: `${
|
|
824
|
+
label: `${o.details_interest_rate} (%)`,
|
|
827
825
|
onCancel: d,
|
|
828
826
|
onSave: c,
|
|
829
|
-
primaryText:
|
|
827
|
+
primaryText: o.details_interest_rate,
|
|
830
828
|
secondaryText: Be(Number(a.interest_rate) / 100),
|
|
831
|
-
zeroStateText: a.interest_rate ? void 0 :
|
|
829
|
+
zeroStateText: a.interest_rate ? void 0 : o.add_interest_rate,
|
|
832
830
|
children: /* @__PURE__ */ e(
|
|
833
831
|
Xe,
|
|
834
832
|
{
|
|
@@ -836,14 +834,14 @@ const ge = ({
|
|
|
836
834
|
fullWidth: !0,
|
|
837
835
|
onChange: (m) => i(isNaN(parseFloat(m.target.value)) ? 0 : parseFloat(m.target.value)),
|
|
838
836
|
type: "number",
|
|
839
|
-
value:
|
|
837
|
+
value: n
|
|
840
838
|
}
|
|
841
839
|
)
|
|
842
840
|
}
|
|
843
841
|
);
|
|
844
842
|
}), _t = D(({ debt: a }) => {
|
|
845
|
-
const { debts:
|
|
846
|
-
await r({ ...a.account, minimum_payment:
|
|
843
|
+
const { debts: o } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [n, i] = x.useState(a.monthly_payment ?? 0), p = n < 0 || n > 9999999999e-2, c = async () => {
|
|
844
|
+
await r({ ...a.account, minimum_payment: n }), a.monthly_payment = n, t(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
|
|
847
845
|
}, d = () => {
|
|
848
846
|
setTimeout(() => {
|
|
849
847
|
i(a.monthly_payment ?? 0);
|
|
@@ -853,29 +851,29 @@ const ge = ({
|
|
|
853
851
|
J,
|
|
854
852
|
{
|
|
855
853
|
isSaveDisabled: p,
|
|
856
|
-
label:
|
|
854
|
+
label: o.details_monthly_payment,
|
|
857
855
|
onCancel: d,
|
|
858
856
|
onSave: c,
|
|
859
|
-
primaryText:
|
|
857
|
+
primaryText: o.details_monthly_payment,
|
|
860
858
|
secondaryText: k(a.monthly_payment, "0,0"),
|
|
861
|
-
zeroStateText: a.monthly_payment ? void 0 :
|
|
859
|
+
zeroStateText: a.monthly_payment ? void 0 : o.add_monthly_payment,
|
|
862
860
|
children: /* @__PURE__ */ e(
|
|
863
861
|
ae,
|
|
864
862
|
{
|
|
865
|
-
amount:
|
|
863
|
+
amount: n,
|
|
866
864
|
autoFocus: !0,
|
|
867
865
|
error: p,
|
|
868
866
|
fullWidth: !0,
|
|
869
867
|
minAmount: 0,
|
|
870
|
-
setAmount: (m) => i(isNaN(Number(m)) ?
|
|
868
|
+
setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
|
|
871
869
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
872
870
|
}
|
|
873
871
|
)
|
|
874
872
|
}
|
|
875
873
|
);
|
|
876
874
|
}), yt = D(({ debt: a }) => {
|
|
877
|
-
const { debts:
|
|
878
|
-
await r({ ...a.account, original_balance:
|
|
875
|
+
const { debts: o } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [n, i] = x.useState(a.original_balance ?? 0), p = n < 0 || n > 9999999999e-2, c = async () => {
|
|
876
|
+
await r({ ...a.account, original_balance: n }), a.original_balance = n, t(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
|
|
879
877
|
}, d = () => {
|
|
880
878
|
setTimeout(() => {
|
|
881
879
|
i(a.original_balance ?? 0);
|
|
@@ -885,52 +883,52 @@ const ge = ({
|
|
|
885
883
|
J,
|
|
886
884
|
{
|
|
887
885
|
isSaveDisabled: p,
|
|
888
|
-
label:
|
|
886
|
+
label: o.details_original_balance,
|
|
889
887
|
onCancel: d,
|
|
890
888
|
onSave: c,
|
|
891
|
-
primaryText:
|
|
889
|
+
primaryText: o.details_original_balance,
|
|
892
890
|
secondaryText: k(a.original_balance, "0,0"),
|
|
893
|
-
zeroStateText: a.original_balance ? void 0 :
|
|
891
|
+
zeroStateText: a.original_balance ? void 0 : o.add_original_balance,
|
|
894
892
|
children: /* @__PURE__ */ e(
|
|
895
893
|
ae,
|
|
896
894
|
{
|
|
897
|
-
amount:
|
|
895
|
+
amount: n,
|
|
898
896
|
autoFocus: !0,
|
|
899
897
|
error: p,
|
|
900
898
|
fullWidth: !0,
|
|
901
899
|
minAmount: 0,
|
|
902
|
-
setAmount: (m) => i(isNaN(Number(m)) ?
|
|
900
|
+
setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
|
|
903
901
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
904
902
|
}
|
|
905
903
|
)
|
|
906
904
|
}
|
|
907
905
|
);
|
|
908
906
|
}), ft = () => {
|
|
909
|
-
const { onEvent: a } = F(), { selectedDebtChartData:
|
|
910
|
-
return
|
|
911
|
-
|
|
912
|
-
/* @__PURE__ */ e(Ge, { goal:
|
|
907
|
+
const { onEvent: a } = F(), { selectedDebtChartData: o } = $();
|
|
908
|
+
return x.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(w, { bgcolor: "background.paper", children: [
|
|
909
|
+
o?.goal && /* @__PURE__ */ s(H, { children: [
|
|
910
|
+
/* @__PURE__ */ e(Ge, { goal: o.goal }),
|
|
913
911
|
/* @__PURE__ */ e(j, {}),
|
|
914
|
-
/* @__PURE__ */ e(je, { goal:
|
|
912
|
+
/* @__PURE__ */ e(je, { goal: o.goal }),
|
|
915
913
|
/* @__PURE__ */ e(j, {}),
|
|
916
|
-
/* @__PURE__ */ e(ze, { goal:
|
|
914
|
+
/* @__PURE__ */ e(ze, { goal: o.goal }),
|
|
917
915
|
/* @__PURE__ */ e(j, {})
|
|
918
916
|
] }),
|
|
919
|
-
!
|
|
920
|
-
/* @__PURE__ */ e(_t, { debt:
|
|
917
|
+
!o?.goal && o?.account && /* @__PURE__ */ s(H, { children: [
|
|
918
|
+
/* @__PURE__ */ e(_t, { debt: o }),
|
|
921
919
|
/* @__PURE__ */ e(j, {}),
|
|
922
|
-
/* @__PURE__ */ e(bt, { debt:
|
|
920
|
+
/* @__PURE__ */ e(bt, { debt: o }),
|
|
923
921
|
/* @__PURE__ */ e(j, {}),
|
|
924
|
-
/* @__PURE__ */ e(yt, { debt:
|
|
922
|
+
/* @__PURE__ */ e(yt, { debt: o }),
|
|
925
923
|
/* @__PURE__ */ e(j, {})
|
|
926
924
|
] })
|
|
927
925
|
] });
|
|
928
|
-
},
|
|
929
|
-
const { debts: r } = S(), { showError: t, showCompleted:
|
|
930
|
-
return
|
|
926
|
+
}, gt = D(ft), xt = ({ setTabValue: a, sx: o }) => {
|
|
927
|
+
const { debts: r } = S(), { showError: t, showCompleted: n } = $();
|
|
928
|
+
return x.useEffect(() => {
|
|
931
929
|
t && a(1);
|
|
932
|
-
}, [t]), !t && !
|
|
933
|
-
/* @__PURE__ */ e(he, { sx: { my: 16, mx: 24, ...
|
|
930
|
+
}, [t]), !t && !n ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ s(w, { gap: 16, children: [
|
|
931
|
+
/* @__PURE__ */ e(he, { sx: { my: 16, mx: 24, ...o }, children: /* @__PURE__ */ s(
|
|
934
932
|
pe,
|
|
935
933
|
{
|
|
936
934
|
icon: t ? /* @__PURE__ */ e(Ve, { filled: !0 }) : /* @__PURE__ */ e(ye, { color: "success", filled: !0 }),
|
|
@@ -951,7 +949,7 @@ const ge = ({
|
|
|
951
949
|
]
|
|
952
950
|
}
|
|
953
951
|
) }),
|
|
954
|
-
t && /* @__PURE__ */ e(he, { sx: { mb: 16, mt: 100, mx: 24, ...
|
|
952
|
+
t && /* @__PURE__ */ e(he, { sx: { mb: 16, mt: 100, mx: 24, ...o }, children: /* @__PURE__ */ s(
|
|
955
953
|
pe,
|
|
956
954
|
{
|
|
957
955
|
icon: /* @__PURE__ */ e(H, {}),
|
|
@@ -970,16 +968,16 @@ const ge = ({
|
|
|
970
968
|
}
|
|
971
969
|
) })
|
|
972
970
|
] });
|
|
973
|
-
}, wt = D(
|
|
974
|
-
const { debts: a } = S(), { showError:
|
|
971
|
+
}, wt = D(xt), Ct = () => {
|
|
972
|
+
const { debts: a } = S(), { showError: o, showCompleted: r } = $(), [t, n] = x.useState(0);
|
|
975
973
|
return /* @__PURE__ */ s(H, { children: [
|
|
976
|
-
(
|
|
974
|
+
(o || r) && /* @__PURE__ */ e(wt, { setTabValue: n, sx: { mt: -24 } }),
|
|
977
975
|
/* @__PURE__ */ s(
|
|
978
976
|
We,
|
|
979
977
|
{
|
|
980
978
|
"aria-label": a.details_tabs_aria_label,
|
|
981
979
|
centered: !0,
|
|
982
|
-
onChange: (i, p) =>
|
|
980
|
+
onChange: (i, p) => n(p),
|
|
983
981
|
textColor: "primary",
|
|
984
982
|
value: t,
|
|
985
983
|
variant: "fullWidth",
|
|
@@ -1004,16 +1002,16 @@ const ge = ({
|
|
|
1004
1002
|
}
|
|
1005
1003
|
),
|
|
1006
1004
|
/* @__PURE__ */ e(ue, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(ut, {}) }),
|
|
1007
|
-
/* @__PURE__ */ e(ue, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(
|
|
1005
|
+
/* @__PURE__ */ e(ue, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(gt, {}) })
|
|
1008
1006
|
] });
|
|
1009
|
-
}, St = D(Ct), vt = ({ isOpen: a, onClose:
|
|
1010
|
-
const { debts: r } = S(), { showError: t, showCompleted:
|
|
1007
|
+
}, St = D(Ct), vt = ({ isOpen: a, onClose: o }) => {
|
|
1008
|
+
const { debts: r } = S(), { showError: t, showCompleted: n } = $(), i = t || n ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ e(mt, {});
|
|
1011
1009
|
return /* @__PURE__ */ e(
|
|
1012
1010
|
te,
|
|
1013
1011
|
{
|
|
1014
1012
|
ariaLabelClose: r.details_close_aria,
|
|
1015
1013
|
isOpen: a,
|
|
1016
|
-
onClose:
|
|
1014
|
+
onClose: o,
|
|
1017
1015
|
title: r.details_title,
|
|
1018
1016
|
children: /* @__PURE__ */ s(w, { bgcolor: "background.default", children: [
|
|
1019
1017
|
/* @__PURE__ */ e(ke, { customDetailsChart: i }),
|
|
@@ -1022,13 +1020,13 @@ const ge = ({
|
|
|
1022
1020
|
}
|
|
1023
1021
|
);
|
|
1024
1022
|
}, Dt = D(() => {
|
|
1025
|
-
const { debts: a } = S(), { monthlyCashFlowProfile:
|
|
1026
|
-
|
|
1027
|
-
user_guid:
|
|
1023
|
+
const { debts: a } = S(), { monthlyCashFlowProfile: o, updateMonthlyCashFlowProfile: r } = V(), { onEvent: t } = F(), [n, i] = x.useState(o?.extra_payment ?? 0), p = n < 0 || n > 9999999999e-2, c = async () => {
|
|
1024
|
+
o && (await r({ ...o, extra_payment: n }), o.extra_payment = n, t(T.DEBTS_SAVE_PAYDOWN_ACTION, {
|
|
1025
|
+
user_guid: o?.user_guid
|
|
1028
1026
|
}));
|
|
1029
1027
|
}, d = () => {
|
|
1030
1028
|
setTimeout(() => {
|
|
1031
|
-
i(
|
|
1029
|
+
i(o?.extra_payment ?? 0);
|
|
1032
1030
|
}, 250);
|
|
1033
1031
|
};
|
|
1034
1032
|
return /* @__PURE__ */ e(
|
|
@@ -1039,29 +1037,29 @@ const ge = ({
|
|
|
1039
1037
|
onCancel: d,
|
|
1040
1038
|
onSave: c,
|
|
1041
1039
|
primaryText: a.paydown_drawer_extra_payment,
|
|
1042
|
-
secondaryText: k(
|
|
1043
|
-
zeroStateText:
|
|
1040
|
+
secondaryText: k(o?.extra_payment, "0,0"),
|
|
1041
|
+
zeroStateText: o?.extra_payment ? void 0 : a.add_extra_payment,
|
|
1044
1042
|
children: /* @__PURE__ */ e(
|
|
1045
1043
|
ae,
|
|
1046
1044
|
{
|
|
1047
|
-
amount:
|
|
1045
|
+
amount: n,
|
|
1048
1046
|
autoFocus: !0,
|
|
1049
1047
|
error: p,
|
|
1050
1048
|
fullWidth: !0,
|
|
1051
1049
|
minAmount: 0,
|
|
1052
|
-
setAmount: (m) => i(isNaN(Number(m)) ?
|
|
1050
|
+
setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
|
|
1053
1051
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
1054
1052
|
}
|
|
1055
1053
|
)
|
|
1056
1054
|
}
|
|
1057
1055
|
);
|
|
1058
1056
|
}), Tt = () => {
|
|
1059
|
-
const { debts: a } = S(), { totalMonthlyPayments:
|
|
1057
|
+
const { debts: a } = S(), { totalMonthlyPayments: o } = q(), { monthlyCashFlowProfile: r } = V(), t = o + Number(r?.extra_payment);
|
|
1060
1058
|
return /* @__PURE__ */ s(w, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
|
|
1061
1059
|
/* @__PURE__ */ s(w, { p: 24, children: [
|
|
1062
1060
|
/* @__PURE__ */ s(w, { alignItems: "center", gap: 4, mb: 24, children: [
|
|
1063
1061
|
/* @__PURE__ */ e(l, { variant: "Body", children: a.paydown_drawer_mimimum_label }),
|
|
1064
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "H1", children: k(
|
|
1062
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "H1", children: k(o, "0,0") }),
|
|
1065
1063
|
/* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "Small", width: 208, children: a.paydown_drawer_minimum_info })
|
|
1066
1064
|
] }),
|
|
1067
1065
|
/* @__PURE__ */ s(w, { children: [
|
|
@@ -1075,38 +1073,38 @@ const ge = ({
|
|
|
1075
1073
|
/* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: k(t, "0,0") })
|
|
1076
1074
|
] }) })
|
|
1077
1075
|
] });
|
|
1078
|
-
}, At = D(Tt), Et = ({ isOpen: a, onClose:
|
|
1076
|
+
}, At = D(Tt), Et = ({ isOpen: a, onClose: o }) => {
|
|
1079
1077
|
const { debts: r } = S();
|
|
1080
1078
|
return /* @__PURE__ */ e(
|
|
1081
1079
|
te,
|
|
1082
1080
|
{
|
|
1083
1081
|
ariaLabelClose: r.paydown_drawer_close_aria,
|
|
1084
1082
|
isOpen: a,
|
|
1085
|
-
onClose:
|
|
1083
|
+
onClose: o,
|
|
1086
1084
|
title: r.paydown_drawer_title,
|
|
1087
1085
|
children: /* @__PURE__ */ e(At, {})
|
|
1088
1086
|
}
|
|
1089
1087
|
);
|
|
1090
1088
|
};
|
|
1091
|
-
function It(a,
|
|
1089
|
+
function It(a, o) {
|
|
1092
1090
|
const r = (t) => {
|
|
1093
1091
|
if (typeof t == "number") return t;
|
|
1094
1092
|
if (t === "!" || t === "✓") return 1 / 0;
|
|
1095
1093
|
throw new Error("Unsupported value");
|
|
1096
1094
|
};
|
|
1097
|
-
return r(a) - r(
|
|
1095
|
+
return r(a) - r(o);
|
|
1098
1096
|
}
|
|
1099
1097
|
function Bt(a) {
|
|
1100
1098
|
return a.is_paid_off ? "✓" : a.priority === void 0 || a.is_impossible ? "!" : a.priority;
|
|
1101
1099
|
}
|
|
1102
1100
|
const Mt = (a) => {
|
|
1103
|
-
const
|
|
1101
|
+
const o = {
|
|
1104
1102
|
text: "#121417",
|
|
1105
1103
|
background: "#FFB252"
|
|
1106
1104
|
};
|
|
1107
|
-
return a === "!" && (
|
|
1105
|
+
return a === "!" && (o.text = "#FFFFFF", o.background = "#DF320C"), a === "✓" && (o.text = "#FFFFFF", o.background = "#09A57F"), o;
|
|
1108
1106
|
}, Pt = (a) => {
|
|
1109
|
-
const
|
|
1107
|
+
const o = String(a.formattedValue), r = Mt(o);
|
|
1110
1108
|
return /* @__PURE__ */ e(
|
|
1111
1109
|
re,
|
|
1112
1110
|
{
|
|
@@ -1121,32 +1119,32 @@ const Mt = (a) => {
|
|
|
1121
1119
|
backgroundColor: r.background,
|
|
1122
1120
|
marginLeft: "10px"
|
|
1123
1121
|
},
|
|
1124
|
-
children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children:
|
|
1122
|
+
children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: o })
|
|
1125
1123
|
}
|
|
1126
1124
|
);
|
|
1127
1125
|
}, kt = (a) => {
|
|
1128
|
-
const
|
|
1126
|
+
const o = a.row.account, r = Ke[o.account_type];
|
|
1129
1127
|
return /* @__PURE__ */ s(w, { alignItems: "center", flexDirection: "row", children: [
|
|
1130
1128
|
/* @__PURE__ */ e(
|
|
1131
1129
|
De,
|
|
1132
1130
|
{
|
|
1133
|
-
alt: `${
|
|
1134
|
-
institutionGuid:
|
|
1131
|
+
alt: `${o.institutionName}`,
|
|
1132
|
+
institutionGuid: o.institution_guid || ""
|
|
1135
1133
|
}
|
|
1136
1134
|
),
|
|
1137
1135
|
/* @__PURE__ */ s(w, { ml: 12, children: [
|
|
1138
|
-
/* @__PURE__ */ e(l, { variant: "Small", children:
|
|
1136
|
+
/* @__PURE__ */ e(l, { variant: "Small", children: o.name }),
|
|
1139
1137
|
/* @__PURE__ */ e(l, { variant: "XSmall", children: r })
|
|
1140
1138
|
] })
|
|
1141
1139
|
] });
|
|
1142
1140
|
}, Nt = ({
|
|
1143
1141
|
sx: a = {},
|
|
1144
|
-
debts:
|
|
1142
|
+
debts: o,
|
|
1145
1143
|
hoveredDebtGuid: r,
|
|
1146
1144
|
onHoverRow: t,
|
|
1147
|
-
onClickRow:
|
|
1145
|
+
onClickRow: n
|
|
1148
1146
|
}) => {
|
|
1149
|
-
const i = X(), { onEvent: p } = F(), { isMobile: c } = Y(), { debts: d } = S(), [m, b] =
|
|
1147
|
+
const i = X(), { onEvent: p } = F(), { isMobile: c } = Y(), { debts: d } = S(), [m, b] = x.useState([
|
|
1150
1148
|
{ field: "priority", sort: "asc" }
|
|
1151
1149
|
]), f = [
|
|
1152
1150
|
{
|
|
@@ -1241,12 +1239,12 @@ const Mt = (a) => {
|
|
|
1241
1239
|
headerAlign: "right",
|
|
1242
1240
|
width: 20
|
|
1243
1241
|
}
|
|
1244
|
-
], v =
|
|
1242
|
+
], v = x.useMemo(() => o.map((y, N) => ({
|
|
1245
1243
|
...y,
|
|
1246
1244
|
id: N,
|
|
1247
1245
|
priority: Bt(y)
|
|
1248
|
-
})), [
|
|
1249
|
-
const
|
|
1246
|
+
})), [o]), M = (y) => {
|
|
1247
|
+
const g = y.target.closest("[data-id]")?.getAttribute("data-id"), A = o[Number(g)];
|
|
1250
1248
|
t?.(A?.guid ?? "");
|
|
1251
1249
|
}, I = (y) => {
|
|
1252
1250
|
c || M(y);
|
|
@@ -1273,7 +1271,7 @@ const Mt = (a) => {
|
|
|
1273
1271
|
hideFooter: !0,
|
|
1274
1272
|
initialState: { sorting: { sortModel: m } },
|
|
1275
1273
|
onRowClick: (y) => {
|
|
1276
|
-
|
|
1274
|
+
n(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: y.row.guid });
|
|
1277
1275
|
},
|
|
1278
1276
|
onSortModelChange: (y) => {
|
|
1279
1277
|
b(y), p(T.DEBTS_CLICK_TABLE_SORT);
|
|
@@ -1300,9 +1298,9 @@ const Mt = (a) => {
|
|
|
1300
1298
|
)
|
|
1301
1299
|
}
|
|
1302
1300
|
);
|
|
1303
|
-
}, Ft = ({ buttonText: a, isOpen:
|
|
1304
|
-
const { isDesktop: t, isTablet:
|
|
1305
|
-
return t ||
|
|
1301
|
+
}, Ft = ({ buttonText: a, isOpen: o, onClick: r }) => {
|
|
1302
|
+
const { isDesktop: t, isTablet: n } = Y(), i = o ? "unfold_less" : "unfold_more";
|
|
1303
|
+
return t || n ? /* @__PURE__ */ e(
|
|
1306
1304
|
fe,
|
|
1307
1305
|
{
|
|
1308
1306
|
"aria-controls": "prioritize-debts",
|
|
@@ -1325,8 +1323,8 @@ const Mt = (a) => {
|
|
|
1325
1323
|
children: /* @__PURE__ */ e(ee, { name: i })
|
|
1326
1324
|
}
|
|
1327
1325
|
);
|
|
1328
|
-
}, Rt = D(({ buttonEl: a, onClose:
|
|
1329
|
-
const { onEvent: r } = F(), { debts: t } = S(), { selectedDebtPriority:
|
|
1326
|
+
}, Rt = D(({ buttonEl: a, onClose: o }) => {
|
|
1327
|
+
const { onEvent: r } = F(), { debts: t } = S(), { selectedDebtPriority: n, setSelectedDebtPriority: i } = $(), p = !!a, c = [
|
|
1330
1328
|
{
|
|
1331
1329
|
priority: P.FASTEST_PAYOFF_FIRST,
|
|
1332
1330
|
text: t.priority_sort_fastest_payoff
|
|
@@ -1355,7 +1353,7 @@ const Mt = (a) => {
|
|
|
1355
1353
|
horizontal: "left"
|
|
1356
1354
|
},
|
|
1357
1355
|
id: "prioritize-debts",
|
|
1358
|
-
onClose:
|
|
1356
|
+
onClose: o,
|
|
1359
1357
|
open: p,
|
|
1360
1358
|
transformOrigin: {
|
|
1361
1359
|
vertical: "top",
|
|
@@ -1366,8 +1364,8 @@ const Mt = (a) => {
|
|
|
1366
1364
|
{
|
|
1367
1365
|
onClick: () => d(m),
|
|
1368
1366
|
sx: {
|
|
1369
|
-
bgcolor:
|
|
1370
|
-
color:
|
|
1367
|
+
bgcolor: n === m ? "primary.main" : void 0,
|
|
1368
|
+
color: n === m ? "#fff" : void 0,
|
|
1371
1369
|
justifyContent: "space-between",
|
|
1372
1370
|
minHeight: 44,
|
|
1373
1371
|
minWidth: 268,
|
|
@@ -1381,7 +1379,7 @@ const Mt = (a) => {
|
|
|
1381
1379
|
},
|
|
1382
1380
|
children: [
|
|
1383
1381
|
/* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: b }),
|
|
1384
|
-
|
|
1382
|
+
n === m && /* @__PURE__ */ e(ye, { color: "inherit", filled: !0, fontSize: "small" })
|
|
1385
1383
|
]
|
|
1386
1384
|
},
|
|
1387
1385
|
m
|
|
@@ -1389,30 +1387,30 @@ const Mt = (a) => {
|
|
|
1389
1387
|
}
|
|
1390
1388
|
);
|
|
1391
1389
|
}), Lt = D(() => {
|
|
1392
|
-
const { onEvent: a } = F(), { debts:
|
|
1393
|
-
|
|
1390
|
+
const { onEvent: a } = F(), { debts: o } = S(), { selectedDebtPriority: r } = $(), [t, n] = x.useState(null), i = (m) => {
|
|
1391
|
+
n(m.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
|
|
1394
1392
|
}, p = () => {
|
|
1395
|
-
|
|
1396
|
-
}, c = !!t, d =
|
|
1397
|
-
[P.FASTEST_PAYOFF_FIRST]:
|
|
1398
|
-
[P.HIGHEST_INTEREST]:
|
|
1399
|
-
[P.HIGHEST_BALANCE]:
|
|
1400
|
-
[P.LOWEST_BALANCE]:
|
|
1401
|
-
})[r] ??
|
|
1393
|
+
n(null);
|
|
1394
|
+
}, c = !!t, d = x.useMemo(() => ({
|
|
1395
|
+
[P.FASTEST_PAYOFF_FIRST]: o.priority_sort_fastest_payoff,
|
|
1396
|
+
[P.HIGHEST_INTEREST]: o.priority_sort_highest_interest,
|
|
1397
|
+
[P.HIGHEST_BALANCE]: o.priority_sort_highest_balance,
|
|
1398
|
+
[P.LOWEST_BALANCE]: o.priority_sort_lowest_balance
|
|
1399
|
+
})[r] ?? o.priority_sort_lowest_balance, [r]);
|
|
1402
1400
|
return /* @__PURE__ */ s(_, { children: [
|
|
1403
1401
|
/* @__PURE__ */ e(Ft, { buttonText: d, isOpen: c, onClick: i }),
|
|
1404
1402
|
/* @__PURE__ */ e(Rt, { buttonEl: t, onClose: p })
|
|
1405
1403
|
] });
|
|
1406
|
-
}), $t = (a,
|
|
1404
|
+
}), $t = (a, o, r = 0) => {
|
|
1407
1405
|
const t = a.map((d) => ({ ...d }));
|
|
1408
|
-
|
|
1409
|
-
const
|
|
1406
|
+
ge(t, o);
|
|
1407
|
+
const n = /* @__PURE__ */ new Date(), i = [];
|
|
1410
1408
|
let p = 0, c = 1;
|
|
1411
1409
|
for (const d of t)
|
|
1412
1410
|
i.push({
|
|
1413
1411
|
...d,
|
|
1414
1412
|
// Start with the initial balance
|
|
1415
|
-
dataset: [{ x: new Date(
|
|
1413
|
+
dataset: [{ x: new Date(n), y: d.balance }]
|
|
1416
1414
|
});
|
|
1417
1415
|
for (; t.some((d) => d.balance >= 0.01 && !d.is_impossible); ) {
|
|
1418
1416
|
let d = !1, m = !1, b = !1;
|
|
@@ -1423,17 +1421,17 @@ const Mt = (a) => {
|
|
|
1423
1421
|
!b && r > 0 && (y += r, b = !0), !m && p > 0 && (N = p, m = !0), u.balance += C;
|
|
1424
1422
|
const h = Math.min(u.balance, y + N);
|
|
1425
1423
|
if (h <= C) {
|
|
1426
|
-
u.is_impossible = !0, i[f].is_impossible = !0, i[f].priority = void 0, v.push({ x: new Date(
|
|
1424
|
+
u.is_impossible = !0, i[f].is_impossible = !0, i[f].priority = void 0, v.push({ x: new Date(n), y: u.balance });
|
|
1427
1425
|
continue;
|
|
1428
1426
|
}
|
|
1429
1427
|
u.balance -= h, u.balance = u.balance < 0.01 ? 0 : u.balance, v.push({
|
|
1430
|
-
x: new Date(
|
|
1428
|
+
x: new Date(n),
|
|
1431
1429
|
y: Math.max(0, u.balance),
|
|
1432
1430
|
payment: h,
|
|
1433
1431
|
extra: N
|
|
1434
|
-
}), u.balance <= 0 && (p += B, i[f].projected_payoff_date = new Date(
|
|
1432
|
+
}), u.balance <= 0 && (p += B, i[f].projected_payoff_date = new Date(n)), h > 0 && (d = !0);
|
|
1435
1433
|
}
|
|
1436
|
-
d &&
|
|
1434
|
+
d && n.setMonth(n.getMonth() + 1);
|
|
1437
1435
|
}
|
|
1438
1436
|
return i.forEach((d) => {
|
|
1439
1437
|
(d.interest_rate === void 0 || d.monthly_payment === void 0) && (d.projected_payoff_date = void 0);
|
|
@@ -1441,7 +1439,7 @@ const Mt = (a) => {
|
|
|
1441
1439
|
d.priority = !d.is_paid_off && !d.is_impossible ? c++ : void 0;
|
|
1442
1440
|
}), i;
|
|
1443
1441
|
}, Ht = D(({ onClick: a }) => {
|
|
1444
|
-
const { debts:
|
|
1442
|
+
const { debts: o } = S(), { isDesktop: r } = Y(), { totalMonthlyPayments: t } = q(), { monthlyCashFlowProfile: n } = V(), i = t + Number(n?.extra_payment), p = r ? o.paydown_button_long : o.paydown_button_short;
|
|
1445
1443
|
return /* @__PURE__ */ e(
|
|
1446
1444
|
fe,
|
|
1447
1445
|
{
|
|
@@ -1454,24 +1452,24 @@ const Mt = (a) => {
|
|
|
1454
1452
|
children: E(p, k(i, "0,0"))
|
|
1455
1453
|
}
|
|
1456
1454
|
);
|
|
1457
|
-
}), Ot = ({ onBackClick: a, sx:
|
|
1458
|
-
const [r, t] =
|
|
1455
|
+
}), Ot = ({ onBackClick: a, sx: o }) => {
|
|
1456
|
+
const [r, t] = x.useState(!1), [n, i] = x.useState(!1), [p, c] = x.useState(!1), [d, m] = x.useState(""), { isDesktop: b, isMobile: f } = Y(), { debts: u } = S(), { onEvent: v } = F(), { isCopyLoaded: M, isInitialized: I, setSelectedAccounts: C } = Pe(), { setSelectedAccount: B } = Ne(), { selectedDebtPriority: y, setSelectedDebtChartData: N } = $(), { visibleDebtAccounts: h } = Z(), { goalsLoaded: g, loadGoals: A, monthlyCashFlowProfile: R } = V(), { debts: L } = q();
|
|
1459
1457
|
Je({
|
|
1460
1458
|
widgetName: "DebtsWidget",
|
|
1461
|
-
isLoaded:
|
|
1459
|
+
isLoaded: g
|
|
1462
1460
|
});
|
|
1463
|
-
const O =
|
|
1461
|
+
const O = x.useMemo(() => {
|
|
1464
1462
|
const W = R?.extra_payment ?? 0;
|
|
1465
1463
|
return $t(L, y, W);
|
|
1466
1464
|
}, [L, y, R]);
|
|
1467
|
-
|
|
1465
|
+
x.useEffect(() => {
|
|
1468
1466
|
C(h), v(T.DEBTS_VIEW);
|
|
1469
|
-
}, []),
|
|
1467
|
+
}, []), x.useEffect(() => {
|
|
1470
1468
|
C(h);
|
|
1471
|
-
}, [h]),
|
|
1469
|
+
}, [h]), x.useEffect(() => {
|
|
1472
1470
|
I && A().finally();
|
|
1473
1471
|
}, [I]);
|
|
1474
|
-
const
|
|
1472
|
+
const oe = (W) => m(W), ne = () => {
|
|
1475
1473
|
const W = h.find((Q) => Q.guid === d), ie = O.find((Q) => Q.guid === d);
|
|
1476
1474
|
W && B(W), ie && N(ie), t(!0);
|
|
1477
1475
|
}, we = () => v(T.DEBTS_CLICK_FILTER), Ce = () => {
|
|
@@ -1479,7 +1477,7 @@ const Mt = (a) => {
|
|
|
1479
1477
|
}, Se = () => {
|
|
1480
1478
|
i(!0), v(T.DEBTS_CLICK_PAYDOWN);
|
|
1481
1479
|
};
|
|
1482
|
-
return !
|
|
1480
|
+
return !g || !M || !I ? /* @__PURE__ */ e(Qe, {}) : /* @__PURE__ */ s(
|
|
1483
1481
|
Oe,
|
|
1484
1482
|
{
|
|
1485
1483
|
accountOptions: h,
|
|
@@ -1489,7 +1487,7 @@ const Mt = (a) => {
|
|
|
1489
1487
|
],
|
|
1490
1488
|
onAccountsFilterClick: we,
|
|
1491
1489
|
onBackClick: a,
|
|
1492
|
-
sx:
|
|
1490
|
+
sx: o,
|
|
1493
1491
|
title: u.title,
|
|
1494
1492
|
children: [
|
|
1495
1493
|
/* @__PURE__ */ s(w, { sx: { px: b ? "48px" : "24px" }, children: [
|
|
@@ -1503,13 +1501,13 @@ const Mt = (a) => {
|
|
|
1503
1501
|
},
|
|
1504
1502
|
children: [
|
|
1505
1503
|
/* @__PURE__ */ e(
|
|
1506
|
-
|
|
1504
|
+
xe,
|
|
1507
1505
|
{
|
|
1508
1506
|
debts: O,
|
|
1509
1507
|
height: f ? 250 : void 0,
|
|
1510
1508
|
hoveredDebtGuid: d,
|
|
1511
|
-
onClickArea:
|
|
1512
|
-
onHoverArea:
|
|
1509
|
+
onClickArea: ne,
|
|
1510
|
+
onHoverArea: oe,
|
|
1513
1511
|
sx: { mr: f ? "4px" : "-48px" }
|
|
1514
1512
|
}
|
|
1515
1513
|
),
|
|
@@ -1529,8 +1527,8 @@ const Mt = (a) => {
|
|
|
1529
1527
|
{
|
|
1530
1528
|
debts: O,
|
|
1531
1529
|
hoveredDebtGuid: d,
|
|
1532
|
-
onClickRow:
|
|
1533
|
-
onHoverRow:
|
|
1530
|
+
onClickRow: ne,
|
|
1531
|
+
onHoverRow: oe
|
|
1534
1532
|
}
|
|
1535
1533
|
) })
|
|
1536
1534
|
] }),
|
|
@@ -1542,13 +1540,13 @@ const Mt = (a) => {
|
|
|
1542
1540
|
}
|
|
1543
1541
|
),
|
|
1544
1542
|
/* @__PURE__ */ e(vt, { isOpen: r, onClose: () => t(!1) }),
|
|
1545
|
-
/* @__PURE__ */ e(Et, { isOpen:
|
|
1543
|
+
/* @__PURE__ */ e(Et, { isOpen: n, onClose: () => i(!1) })
|
|
1546
1544
|
]
|
|
1547
1545
|
}
|
|
1548
1546
|
);
|
|
1549
1547
|
}, Nr = D(Ot);
|
|
1550
1548
|
export {
|
|
1551
|
-
|
|
1549
|
+
xe as DebtsChart,
|
|
1552
1550
|
Lr as DebtsStore,
|
|
1553
1551
|
Nt as DebtsTable,
|
|
1554
1552
|
Nr as DebtsWidget
|