@mx-cartographer/experiences 8.0.0-alpha.bb3 → 8.0.0-alpha.mega1
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 +178 -1
- package/dist/{Account-Bxw0_4FU.mjs → Account-CvR2-dSR.mjs} +1 -1
- package/dist/{AccountDetailsContent-CAM9y39M.mjs → AccountDetailsContent-CitErkuS.mjs} +89 -82
- package/dist/AccountDetailsHeader-BkG3MNYo.mjs +87 -0
- package/dist/{AccountFields-C9FlatNb.mjs → AccountFields-zCMqet85.mjs} +6 -6
- package/dist/{AccountListItem-JFMZROh7.mjs → AccountListItem-DHrz8Mml.mjs} +9 -9
- package/dist/{AccountStore-BgNOyMdp.mjs → AccountStore-LgfBcYMe.mjs} +112 -75
- package/dist/Accounts-Bzy1_REQ.mjs +9 -0
- package/dist/{BeatApi-DhJpgCLz.mjs → BeatApi-De2IaqH2.mjs} +1 -1
- package/dist/{BeatStore-IBnXd4YK.mjs → BeatStore-D_NYuBSz.mjs} +1 -1
- package/dist/{BudgetUtil-B2ZXyw-g.mjs → BudgetUtil-BmZXkL0C.mjs} +2 -2
- package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-B-I3kajA.mjs} +23 -21
- package/dist/CategoryStore-CA3tS1BO.mjs +186 -0
- package/dist/CategoryUtil-DUM8NuGO.mjs +78 -0
- package/dist/{ConnectDrawer-BQNs-hjk.mjs → ConnectDrawer-BkvlItWx.mjs} +11 -11
- package/dist/{ConnectionsDrawer-ByGQE7D5.mjs → ConnectionsDrawer-VmuVFHbL.mjs} +5 -5
- package/dist/{CurrencyInput-DUsQbkXb.mjs → CurrencyInput-itK0R3wV.mjs} +2 -2
- package/dist/{CurrencyText-kyC1aseI.mjs → CurrencyText-Dr0EZ7bp.mjs} +1 -1
- package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CBdcsyuk.mjs} +3 -3
- package/dist/{DebtsStore-C9bblOgW.mjs → DebtsStore-Bq-aPy-5.mjs} +1 -1
- package/dist/{Dialog-CWW597AF.mjs → Dialog-BPTr3qHE.mjs} +2 -2
- package/dist/{Donut-oaQFlbit.mjs → Donut-Dmy3JTWd.mjs} +12 -12
- package/dist/Drawer-By9V-B5L.mjs +178 -0
- package/dist/{EmptyState-DA_lfRBv.mjs → EmptyState-DoxNUae-.mjs} +24 -22
- package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-Cglo8Mca.mjs} +3 -3
- package/dist/{Fetch-87LIQbEA.mjs → Fetch-DecPFeGU.mjs} +24 -22
- package/dist/FinstrongStore-BIrX0Xg2.mjs +451 -0
- package/dist/{GoalStore-D-aB35SY.mjs → GoalStore-1P19goZ7.mjs} +112 -152
- package/dist/{Help-B6dIcujh.mjs → Help-Ea3BlXQp.mjs} +2 -2
- package/dist/LineChart-KpPw1phO.mjs +580 -0
- package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-BxTkF6Tz.mjs} +10 -10
- package/dist/{ManageIncome-1s_q5W4X.mjs → ManageIncome-CaoQl609.mjs} +91 -88
- package/dist/{MerchantStore-DrFvsUyy.mjs → MerchantStore-WvZ4gnQe.mjs} +1 -1
- package/dist/MicroWidgetContainer-r6mtxRer.mjs +52 -0
- package/dist/MiniWidgetContainer-Bg02sF1Y.mjs +71 -0
- package/dist/{NetWorthStore-DCsTZpuS.mjs → NetWorthStore-rC0q7P7t.mjs} +2 -2
- package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-uzM8tCoH.mjs} +236 -231
- package/dist/{NotificationStore-BxP_P2dA.mjs → NotificationStore-CDX_kqHa.mjs} +7 -15
- package/dist/{NumberFormatting-Buh7u8Oi.mjs → NumberFormatting-DjTD0t3W.mjs} +9 -9
- package/dist/{OriginalBalanceAction-CWuVvRq9.mjs → OriginalBalanceAction-C6jdS4ws.mjs} +4 -4
- package/dist/{RecurringSettings-A_rAGCTP.mjs → RecurringSettings-B4ybrS0B.mjs} +4 -4
- package/dist/{RecurringTransactions-DK8dWldr.mjs → RecurringTransactions-BqijW_8S.mjs} +49 -48
- package/dist/{RecurringTransactionsStore-C4YOD7_D.mjs → RecurringTransactionsStore-BhBUVm9a.mjs} +26 -29
- package/dist/{SettingsStore-BcgS_Ohv.mjs → SettingsStore-krIRNwHK.mjs} +3 -3
- package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-DQ1b9uqq.mjs} +11 -13
- package/dist/SpendingLegend-CDO060GT.mjs +193 -0
- package/dist/{ToggleListItem-r0Kx56wF.mjs → ToggleListItem-ciFTiqRS.mjs} +19 -14
- package/dist/TransactionApi-CjBoLleL.mjs +86 -0
- package/dist/TransactionDetails-m5PddMQn.mjs +1380 -0
- package/dist/TransactionStore-PRlwE-TF.mjs +677 -0
- package/dist/TrendsStore-yO7qYv97.mjs +186 -0
- package/dist/{User-BQUxBeZV.mjs → User-Cnlegl1N.mjs} +2 -2
- package/dist/{ViewMoreMicroCard-SCn2wt4i.mjs → ViewMoreMicroCard-DwR0v_ll.mjs} +711 -728
- package/dist/{WidgetContainer-BHWANqT4.mjs → WidgetContainer-CoFDmQRE.mjs} +4 -4
- package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +4 -1
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +2 -1
- package/dist/accounts/index.es.js +245 -235
- package/dist/accounts/stores/AccountStore.d.ts +24 -25
- package/dist/accounts/utils/Accounts.d.ts +1 -2
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/components/AddBudgets.d.ts +2 -1
- package/dist/budgets/index.es.js +611 -580
- package/dist/budgets/store/BudgetsStore.d.ts +0 -1
- package/dist/cashflow/index.es.js +187 -180
- package/dist/categories/index.es.js +2 -2
- package/dist/categories/stores/CategoryStore.d.ts +2 -5
- package/dist/categories/util/CategoryUtil.d.ts +2 -3
- package/dist/common/components/Select.d.ts +4 -2
- package/dist/common/components/charts/LineChart.d.ts +12 -2
- package/dist/common/components/charts/index.d.ts +0 -3
- package/dist/common/components/charts/linechart/CustomLegend.d.ts +3 -1
- package/dist/common/components/charts/linechart/CustomMark.d.ts +4 -0
- package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
- package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
- package/dist/common/components/drawer/Drawer.d.ts +3 -0
- package/dist/common/components/drawer/Footer.d.ts +17 -0
- package/dist/common/hooks/index.d.ts +1 -0
- package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
- package/dist/common/index.es.js +397 -387
- package/dist/common/stores/AppDataStore.d.ts +1 -3
- package/dist/common/stores/GlobalCopyStore.d.ts +1 -0
- package/dist/common/stores/GlobalStore.d.ts +10 -4
- package/dist/common/stores/GlobalUiStore.d.ts +2 -3
- package/dist/common/stores/UserStore.d.ts +2 -3
- package/dist/common/types/Account.d.ts +6 -9
- package/dist/common/types/Finstrong.d.ts +54 -0
- package/dist/common/types/Global.d.ts +1 -0
- package/dist/common/types/Widgets.d.ts +1 -0
- package/dist/common/types/index.d.ts +1 -1
- package/dist/common/types/localization/FinstrongCopy.d.ts +105 -2
- package/dist/common/types/localization/GoalsCopy.d.ts +1 -0
- package/dist/common/types/localization/TransactionsCopy.d.ts +1 -0
- package/dist/dashboard/index.es.js +90 -88
- package/dist/debts/index.es.js +458 -448
- package/dist/exportTransactionsToCSV-DuAaI5XA.mjs +48 -0
- package/dist/finstrong/FinstrongWidget.d.ts +1 -1
- package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
- package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
- package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
- package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
- package/dist/finstrong/components/FinancialStrengthGraph.d.ts +7 -1
- package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
- package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
- package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
- package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
- package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
- package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
- package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
- package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
- package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
- package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
- package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
- package/dist/finstrong/components/ProgressBar.d.ts +15 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
- package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
- package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
- package/dist/finstrong/components/StatusChip.d.ts +5 -0
- package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
- package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +17 -0
- package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
- package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
- package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
- package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
- package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
- package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
- package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
- package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +24 -0
- package/dist/finstrong/components/shared/DialScoreCard.d.ts +7 -1
- package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
- package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
- package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
- package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
- package/dist/finstrong/constants/index.d.ts +9 -0
- package/dist/finstrong/index.es.js +3190 -1073
- package/dist/finstrong/stores/FinstrongStore.d.ts +25 -2
- package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
- package/dist/goals/index.es.js +302 -291
- package/dist/goals/stores/GoalStore.d.ts +4 -17
- package/dist/help/index.es.js +13 -9
- package/dist/{hooks-D6XlXHf4.mjs → hooks-ZMp65DFz.mjs} +12 -12
- package/dist/insights/index.es.js +1 -1
- package/dist/investments/index.es.js +108 -104
- package/dist/investments/stores/HoldingStore.d.ts +0 -1
- package/dist/merchants/index.es.js +2 -2
- package/dist/microinsights/MicroCardTemplate.d.ts +16 -0
- package/dist/microinsights/beaticons/BeatIcon.d.ts +2 -9
- package/dist/microinsights/beaticons/BeatMerchantLogo.d.ts +3 -2
- package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +2 -1
- package/dist/microinsights/cards/{MicroInsightCard.d.ts → BaseCard.d.ts} +1 -8
- package/dist/microinsights/cards/{BeatCard.d.ts → InsightCard.d.ts} +2 -2
- package/dist/microinsights/cards/NoRelevantInsightsCard.d.ts +2 -5
- package/dist/microinsights/cards/ZeroStateCard.d.ts +2 -5
- package/dist/microinsights/carousel/BeatList.d.ts +10 -0
- package/dist/microinsights/carousel/CarouselControls.d.ts +1 -3
- package/dist/microinsights/carousel/CarouselHeader.d.ts +1 -2
- package/dist/microinsights/constants/App.d.ts +0 -1
- package/dist/microinsights/index.d.ts +4 -3
- package/dist/microinsights/index.es.js +101 -14
- package/dist/microinsights/interfaces.d.ts +0 -6
- package/dist/networth/index.es.js +197 -190
- package/dist/notifications/index.es.js +25 -25
- package/dist/notifications/stores/NotificationStore.d.ts +1 -3
- package/dist/recurringtransactions/index.es.js +395 -351
- package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +2 -3
- package/dist/settings/index.es.js +307 -298
- package/dist/spending/index.es.js +299 -438
- package/dist/spending/utils/SpendingData.d.ts +2 -1
- package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -0
- package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
- package/dist/transactions/index.es.js +115 -112
- package/dist/transactions/stores/TransactionStore.d.ts +77 -21
- package/dist/trends/components/TrendsTable.d.ts +0 -2
- package/dist/trends/index.es.js +1025 -604
- package/dist/trends/utils/TrendsData.d.ts +1 -0
- package/dist/{useAccountDisplayName-BUAApBIb.mjs → useAccountDisplayName-B7iXTNM8.mjs} +2 -2
- package/dist/{useCombineEvents-BUDIR1ba.mjs → useCombineEvents-CRwX-qWE.mjs} +1 -1
- package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-B7dxpDrX.mjs} +1 -1
- package/dist/useWidgetLoadTimer-hIOioiKx.mjs +19 -0
- package/package.json +4 -4
- package/dist/AccountDetailsHeader-JtSX6Uf9.mjs +0 -120
- package/dist/Accounts-BRf_YeTf.mjs +0 -27
- package/dist/CategoryStore-yHI0hWmK.mjs +0 -174
- package/dist/CategoryUtil-pZRIYOgN.mjs +0 -80
- package/dist/Drawer-kEE73B87.mjs +0 -113
- package/dist/FinstrongStore-F2c607dj.mjs +0 -101
- package/dist/LineChart-D4GI7nVh.mjs +0 -541
- package/dist/MicroWidgetContainer-DpeqN9n3.mjs +0 -45
- package/dist/MiniWidgetContainer-D0gfmbaF.mjs +0 -56
- package/dist/TransactionApi-B3Tksf7L.mjs +0 -86
- package/dist/TransactionDetails-oP1eSuiS.mjs +0 -1334
- package/dist/TransactionStore-ai3uII_r.mjs +0 -690
- package/dist/TrendsStore-DCYbpXPO.mjs +0 -559
- package/dist/common/components/SkeletonLoader.d.ts +0 -7
- package/dist/exportTransactionsToCSV-7bVS7KXf.mjs +0 -47
- package/dist/finstrong/utils/Finstrong.d.ts +0 -6
- package/dist/useAriaLive-B3_pRUio.mjs +0 -35
package/dist/debts/index.es.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { jsx as e, jsxs as s, Fragment as
|
|
1
|
+
import { jsx as e, jsxs as s, Fragment as H } from "react/jsx-runtime";
|
|
2
2
|
import x from "react";
|
|
3
3
|
import { observer as D } from "mobx-react-lite";
|
|
4
|
-
import
|
|
5
|
-
import { useTheme as X, Card as be, Stack as
|
|
4
|
+
import w from "@mui/material/Stack";
|
|
5
|
+
import { useTheme as X, Card as be, Stack as _, Box as G } from "@mui/material";
|
|
6
6
|
import { Text as l, H3 as ve, InstitutionLogo as De, Icon as ee } from "@mxenabled/mxui";
|
|
7
7
|
import { intervalToDuration as Te, formatDuration as Ae } from "date-fns";
|
|
8
8
|
import { addMonths as le } from "date-fns/addMonths";
|
|
9
9
|
import { fromUnixTime as se } from "date-fns/fromUnixTime";
|
|
10
10
|
import { getUnixTime as ce } from "date-fns/getUnixTime";
|
|
11
|
-
import { D as
|
|
12
|
-
import { a as
|
|
13
|
-
import { f as
|
|
14
|
-
import { f as K,
|
|
15
|
-
import { G as Me,
|
|
11
|
+
import { D as P, M as Ee, I as Ie } from "../DebtsStore-Bq-aPy-5.mjs";
|
|
12
|
+
import { a as Lr } from "../DebtsStore-Bq-aPy-5.mjs";
|
|
13
|
+
import { f as k, a as Be } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
14
|
+
import { f as K, a as U } from "../Dialog-BPTr3qHE.mjs";
|
|
15
|
+
import { G as Me, w as q, u as S, l as V, g as F, d as Z, b as Pe } from "../hooks-ZMp65DFz.mjs";
|
|
16
16
|
import { u as Y } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
17
|
-
import { D as te } from "../Drawer-
|
|
18
|
-
import { b as
|
|
19
|
-
import { A as ke, u as Ne } from "../AccountDetailsHeader-
|
|
17
|
+
import { D as te } from "../Drawer-By9V-B5L.mjs";
|
|
18
|
+
import { b as E } from "../Localization-2MODESHW.mjs";
|
|
19
|
+
import { A as ke, u as Ne } from "../AccountDetailsHeader-BkG3MNYo.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
|
|
26
|
-
import {
|
|
24
|
+
import { useTheme as $e } from "@mui/material/styles";
|
|
25
|
+
import { LineChart as He } from "@mui/x-charts/LineChart";
|
|
26
|
+
import { A as T, W as Oe } from "../WidgetContainer-CoFDmQRE.mjs";
|
|
27
27
|
import de from "@mui/material/Tab";
|
|
28
28
|
import We from "@mui/material/Tabs";
|
|
29
29
|
import _e from "@mui/material/List";
|
|
30
30
|
import j from "@mui/material/Divider";
|
|
31
|
-
import { M as Ge, I as je, O as ze } from "../OriginalBalanceAction-
|
|
31
|
+
import { M as Ge, I as je, O as ze } from "../OriginalBalanceAction-C6jdS4ws.mjs";
|
|
32
32
|
import Xe from "@mui/material/TextField";
|
|
33
|
-
import { L as J } from "../ListItemAction-
|
|
34
|
-
import { C as ae } from "../CurrencyInput-
|
|
33
|
+
import { L as J } from "../ListItemAction-BxTkF6Tz.mjs";
|
|
34
|
+
import { C as ae } from "../CurrencyInput-itK0R3wV.mjs";
|
|
35
35
|
import pe from "@mui/material/Alert";
|
|
36
36
|
import me from "@mui/material/AlertTitle";
|
|
37
37
|
import he from "@mui/material/Paper";
|
|
@@ -39,33 +39,34 @@ import { Error as Ve, CheckCircle as ye } from "@mxenabled/mx-icons";
|
|
|
39
39
|
import { T as ue } from "../TabContentContainer-j01JYR_7.mjs";
|
|
40
40
|
import { DataGridPro as Ye } from "@mui/x-data-grid-pro";
|
|
41
41
|
import { H as z } from "../HeaderCell-DjuifqHJ.mjs";
|
|
42
|
-
import {
|
|
42
|
+
import { f as Ke } from "../ConnectDrawer-BkvlItWx.mjs";
|
|
43
43
|
import fe from "@mui/material/Button";
|
|
44
44
|
import Ue from "@mui/material/IconButton";
|
|
45
45
|
import qe from "@mui/material/ListItem";
|
|
46
46
|
import Ze from "@mui/material/Popover";
|
|
47
|
-
import {
|
|
48
|
-
|
|
47
|
+
import { u as Je } from "../useWidgetLoadTimer-hIOioiKx.mjs";
|
|
48
|
+
import { L as Qe } from "../Loader-DUaFpDGv.mjs";
|
|
49
|
+
const et = (a, o = 0, r = 0) => {
|
|
49
50
|
if (r === 0) return 0;
|
|
50
|
-
const t =
|
|
51
|
+
const t = o / (Ee * Ie);
|
|
51
52
|
return Math.ceil(
|
|
52
53
|
t === 0 ? a / r : -Math.log(1 - t * a / r) / Math.log(1 + t)
|
|
53
54
|
);
|
|
54
|
-
},
|
|
55
|
+
}, tt = (a, o, r, t, n) => {
|
|
55
56
|
const i = [];
|
|
56
57
|
if (r === 0) {
|
|
57
|
-
for (let
|
|
58
|
-
const
|
|
58
|
+
for (let c = 0; c < a; c++) {
|
|
59
|
+
const d = o - t * (c + 1), m = o - t * c, b = d >= 0 ? t : m;
|
|
59
60
|
i.push({
|
|
60
|
-
balance:
|
|
61
|
+
balance: d >= 0 ? d : 0,
|
|
61
62
|
interest: r,
|
|
62
63
|
payment: b,
|
|
63
64
|
principal: b,
|
|
64
65
|
timestamp: ce(
|
|
65
66
|
le(
|
|
66
|
-
se(
|
|
67
|
+
se(n),
|
|
67
68
|
// convert seconds → Date
|
|
68
|
-
|
|
69
|
+
c + 1
|
|
69
70
|
// add (index + 1) months
|
|
70
71
|
)
|
|
71
72
|
)
|
|
@@ -74,106 +75,106 @@ const Qe = (a, n = 0, r = 0) => {
|
|
|
74
75
|
return i;
|
|
75
76
|
}
|
|
76
77
|
const p = r / 1200;
|
|
77
|
-
for (let
|
|
78
|
-
const
|
|
78
|
+
for (let c = 0; c < a; c++) {
|
|
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;
|
|
79
80
|
i.push({
|
|
80
81
|
balance: Math.max(0, u),
|
|
81
|
-
interest:
|
|
82
|
-
payment:
|
|
83
|
-
principal:
|
|
84
|
-
timestamp:
|
|
82
|
+
interest: M,
|
|
83
|
+
payment: v,
|
|
84
|
+
principal: v - M,
|
|
85
|
+
timestamp: d
|
|
85
86
|
});
|
|
86
87
|
}
|
|
87
88
|
return i;
|
|
88
|
-
},
|
|
89
|
-
const { monthly_payment:
|
|
89
|
+
}, rt = (a) => (a[a.length - 1] || {}).timestamp, at = (a) => {
|
|
90
|
+
const { monthly_payment: o, interest_rate: r, balance: t, payment_due_date: n } = a, i = et(t, r ?? 0, o ?? 0), p = tt(
|
|
90
91
|
i,
|
|
91
92
|
t,
|
|
92
93
|
r ?? 0,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
),
|
|
94
|
+
o ?? 0,
|
|
95
|
+
n
|
|
96
|
+
), c = rt(p);
|
|
96
97
|
return {
|
|
97
98
|
...a,
|
|
98
|
-
minimumFinalPayment:
|
|
99
|
+
minimumFinalPayment: c,
|
|
99
100
|
minimumPayments: p
|
|
100
101
|
};
|
|
101
|
-
},
|
|
102
|
+
}, ge = (a, o) => {
|
|
102
103
|
const [r, t] = a.reduce(
|
|
103
|
-
([
|
|
104
|
+
([n, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : n.push(at(p)), [n, i]),
|
|
104
105
|
[[], []]
|
|
105
106
|
);
|
|
106
|
-
switch (
|
|
107
|
-
case
|
|
108
|
-
r.sort((
|
|
107
|
+
switch (o) {
|
|
108
|
+
case P.FASTEST_PAYOFF_FIRST:
|
|
109
|
+
r.sort((n, i) => (n.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
|
|
109
110
|
break;
|
|
110
|
-
case
|
|
111
|
-
r.sort((
|
|
111
|
+
case P.HIGHEST_INTEREST:
|
|
112
|
+
r.sort((n, i) => (i.interest_rate ?? 0) - (n.interest_rate ?? 0));
|
|
112
113
|
break;
|
|
113
|
-
case
|
|
114
|
-
r.sort((
|
|
114
|
+
case P.LOWEST_BALANCE:
|
|
115
|
+
r.sort((n, i) => n.balance - i.balance);
|
|
115
116
|
break;
|
|
116
|
-
case
|
|
117
|
-
r.sort((
|
|
117
|
+
case P.HIGHEST_BALANCE:
|
|
118
|
+
r.sort((n, i) => i.balance - n.balance);
|
|
118
119
|
break;
|
|
119
120
|
default:
|
|
120
|
-
r.sort((
|
|
121
|
+
r.sort((n, i) => n.balance - i.balance);
|
|
121
122
|
}
|
|
122
123
|
a.splice(0, a.length, ...r, ...t);
|
|
123
124
|
};
|
|
124
|
-
function
|
|
125
|
+
function ot(a, o, r = 0) {
|
|
125
126
|
const t = a.map((b) => ({ ...b })).filter(
|
|
126
127
|
(b) => b.interest_rate !== void 0 && b.monthly_payment !== void 0 && !b.is_paid_off
|
|
127
128
|
);
|
|
128
|
-
|
|
129
|
-
let
|
|
130
|
-
const p = /* @__PURE__ */ new Date(),
|
|
129
|
+
ge(t, o);
|
|
130
|
+
let n = 0, i = 0;
|
|
131
|
+
const p = /* @__PURE__ */ new Date(), c = /* @__PURE__ */ new Date();
|
|
131
132
|
for (; t.some((b) => b.balance >= 0.01 && !b.is_impossible); ) {
|
|
132
133
|
let b = !1;
|
|
133
134
|
for (const [f, u] of t.entries()) {
|
|
134
135
|
if (u.balance <= 0.01 || u.is_impossible) continue;
|
|
135
|
-
const
|
|
136
|
-
let
|
|
137
|
-
f === 0 && r && (
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
136
|
+
const M = (u.interest_rate ?? 0) / 100 / 12, I = u.balance * M;
|
|
137
|
+
let C = u.monthly_payment ?? 0;
|
|
138
|
+
f === 0 && r && (C += r), u.balance += I;
|
|
139
|
+
const B = Math.min(u.balance, C + i);
|
|
140
|
+
if (B <= I) {
|
|
140
141
|
u.is_impossible = !0;
|
|
141
142
|
continue;
|
|
142
143
|
}
|
|
143
|
-
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);
|
|
144
145
|
}
|
|
145
|
-
b &&
|
|
146
|
+
b && c.setMonth(c.getMonth() + 1);
|
|
146
147
|
}
|
|
147
|
-
const
|
|
148
|
+
const d = t.some((b) => b.is_impossible && b.balance > 0), m = Te({ start: p, end: c });
|
|
148
149
|
return {
|
|
149
|
-
payoffSavings:
|
|
150
|
-
payoffDate:
|
|
151
|
-
payoffDuration:
|
|
150
|
+
payoffSavings: d ? "N/A" : k(n, "0,0.00"),
|
|
151
|
+
payoffDate: d ? "Never" : K(c, U.MONTH_YEAR),
|
|
152
|
+
payoffDuration: d ? "Stagnant" : Ae(m, { format: ["years", "months"] }) || "0 months"
|
|
152
153
|
};
|
|
153
154
|
}
|
|
154
|
-
const
|
|
155
|
+
const $ = () => {
|
|
155
156
|
if (!x.useContext(Me))
|
|
156
157
|
throw new Error("useCateUiStore() must be used within the GlobalDataContext");
|
|
157
158
|
return q().uiStore;
|
|
158
|
-
}, nt = ({ debts: a, onClickCta:
|
|
159
|
-
const t = X(), { isMobile:
|
|
160
|
-
const f =
|
|
161
|
-
return
|
|
162
|
-
}, [a, p,
|
|
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
|
+
const f = c?.extra_payment ?? 0;
|
|
162
|
+
return ot(a, p, f);
|
|
163
|
+
}, [a, p, c]);
|
|
163
164
|
return /* @__PURE__ */ e(
|
|
164
165
|
be,
|
|
165
166
|
{
|
|
166
167
|
sx: {
|
|
167
168
|
boxShadow: t.shadows[2],
|
|
168
|
-
width:
|
|
169
|
+
width: n ? "100%" : "186px",
|
|
169
170
|
minWidth: "186px",
|
|
170
171
|
...r
|
|
171
172
|
},
|
|
172
|
-
children: /* @__PURE__ */ s(
|
|
173
|
+
children: /* @__PURE__ */ s(_, { sx: { gap: "12px", p: "16px" }, children: [
|
|
173
174
|
/* @__PURE__ */ s(
|
|
174
|
-
|
|
175
|
+
_,
|
|
175
176
|
{
|
|
176
|
-
gap:
|
|
177
|
+
gap: n ? "4px" : "0",
|
|
177
178
|
sx: {
|
|
178
179
|
borderBottom: "1px solid",
|
|
179
180
|
borderBottomColor: t.palette.grey[300],
|
|
@@ -181,15 +182,15 @@ const R = () => {
|
|
|
181
182
|
},
|
|
182
183
|
children: [
|
|
183
184
|
/* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_date_description }),
|
|
184
|
-
/* @__PURE__ */ e(l, { bold: !0, color: t.palette.primary.main, variant: "Small", children:
|
|
185
|
+
/* @__PURE__ */ e(l, { bold: !0, color: t.palette.primary.main, variant: "Small", children: d })
|
|
185
186
|
]
|
|
186
187
|
}
|
|
187
188
|
),
|
|
188
|
-
/* @__PURE__ */ s(
|
|
189
|
+
/* @__PURE__ */ s(_, { gap: n ? "4px" : "0", children: [
|
|
189
190
|
/* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: m }),
|
|
190
191
|
/* @__PURE__ */ e(l, { sx: { whiteSpace: "normal" }, variant: "XSmall", children: i.snowball_card_amount_description })
|
|
191
192
|
] }),
|
|
192
|
-
/* @__PURE__ */ s(
|
|
193
|
+
/* @__PURE__ */ s(_, { gap: n ? "4px" : "0", children: [
|
|
193
194
|
/* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: b }),
|
|
194
195
|
/* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_duration_description })
|
|
195
196
|
] }),
|
|
@@ -198,7 +199,7 @@ const R = () => {
|
|
|
198
199
|
{
|
|
199
200
|
bold: !0,
|
|
200
201
|
color: t.palette.primary.main,
|
|
201
|
-
onClick:
|
|
202
|
+
onClick: o,
|
|
202
203
|
sx: { cursor: "pointer" },
|
|
203
204
|
variant: "Small",
|
|
204
205
|
children: i.snowball_card_cta
|
|
@@ -207,18 +208,18 @@ const R = () => {
|
|
|
207
208
|
] })
|
|
208
209
|
}
|
|
209
210
|
);
|
|
210
|
-
},
|
|
211
|
-
const r = X(), { debts: t } =
|
|
211
|
+
}, it = D(nt), lt = ({ isOpen: a, onClose: o }) => {
|
|
212
|
+
const r = X(), { debts: t } = S(), [n, i] = x.useState(!1);
|
|
212
213
|
return /* @__PURE__ */ e(
|
|
213
214
|
te,
|
|
214
215
|
{
|
|
215
216
|
ariaLabelClose: "",
|
|
216
217
|
isOpen: a,
|
|
217
|
-
onClose:
|
|
218
|
+
onClose: o,
|
|
218
219
|
title: t.snowball_drawer_title,
|
|
219
|
-
children: /* @__PURE__ */ s(
|
|
220
|
-
/* @__PURE__ */ s(
|
|
221
|
-
/* @__PURE__ */ s(
|
|
220
|
+
children: /* @__PURE__ */ s(_, { bgcolor: r.palette.background.default, height: "100%", children: [
|
|
221
|
+
/* @__PURE__ */ s(_, { alignItems: "center", px: 24, py: 24, children: [
|
|
222
|
+
/* @__PURE__ */ s(_, { alignItems: "center", pb: 24, children: [
|
|
222
223
|
/* @__PURE__ */ e(l, { mb: 12, variant: "H3", children: t.snowball_drawer_subtitle }),
|
|
223
224
|
/* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "Small", children: t.snowball_drawer_amount_description }),
|
|
224
225
|
/* @__PURE__ */ e(l, { variant: "H1", children: t.snowball_drawer_savings }),
|
|
@@ -231,7 +232,7 @@ const R = () => {
|
|
|
231
232
|
{
|
|
232
233
|
color: r.palette.secondary.main,
|
|
233
234
|
mb: 8,
|
|
234
|
-
sx: { whiteSpace:
|
|
235
|
+
sx: { whiteSpace: n ? "normal" : "nowrap" },
|
|
235
236
|
variant: "ParagraphSmall",
|
|
236
237
|
children: t.snowball_drawer_answer
|
|
237
238
|
}
|
|
@@ -241,15 +242,15 @@ const R = () => {
|
|
|
241
242
|
{
|
|
242
243
|
bold: !0,
|
|
243
244
|
color: r.palette.primary.main,
|
|
244
|
-
onClick: () => i(!
|
|
245
|
+
onClick: () => i(!n),
|
|
245
246
|
sx: { cursor: "pointer" },
|
|
246
247
|
variant: "Small",
|
|
247
|
-
children:
|
|
248
|
+
children: n ? t.snowball_drawer_less : t.snowball_drawer_more
|
|
248
249
|
}
|
|
249
250
|
)
|
|
250
251
|
] })
|
|
251
252
|
] }),
|
|
252
|
-
/* @__PURE__ */ s(
|
|
253
|
+
/* @__PURE__ */ s(_, { children: [
|
|
253
254
|
/* @__PURE__ */ e(
|
|
254
255
|
l,
|
|
255
256
|
{
|
|
@@ -260,12 +261,12 @@ const R = () => {
|
|
|
260
261
|
children: t.snowball_drawer_disclaimer
|
|
261
262
|
}
|
|
262
263
|
),
|
|
263
|
-
/* @__PURE__ */ s(
|
|
264
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children:
|
|
264
|
+
/* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
265
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: E(t.snowball_drawer_month_header, 1) }),
|
|
265
266
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
|
|
266
267
|
] }),
|
|
267
|
-
/* @__PURE__ */ s(
|
|
268
|
-
/* @__PURE__ */ s(
|
|
268
|
+
/* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
269
|
+
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
269
270
|
/* @__PURE__ */ e(
|
|
270
271
|
G,
|
|
271
272
|
{
|
|
@@ -283,7 +284,7 @@ const R = () => {
|
|
|
283
284
|
}
|
|
284
285
|
),
|
|
285
286
|
/* @__PURE__ */ s(
|
|
286
|
-
|
|
287
|
+
_,
|
|
287
288
|
{
|
|
288
289
|
sx: {
|
|
289
290
|
borderBottom: `1px solid ${r.palette.border.light}`,
|
|
@@ -293,18 +294,18 @@ const R = () => {
|
|
|
293
294
|
pr: 24
|
|
294
295
|
},
|
|
295
296
|
children: [
|
|
296
|
-
/* @__PURE__ */ s(
|
|
297
|
-
/* @__PURE__ */ e(l, { variant: "Body", children:
|
|
297
|
+
/* @__PURE__ */ s(_, { flexGrow: 1, children: [
|
|
298
|
+
/* @__PURE__ */ e(l, { variant: "Body", children: E(t.snowball_drawer_debt_label, "A") }),
|
|
298
299
|
/* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "XSmall", children: [
|
|
299
|
-
|
|
300
|
+
E(
|
|
300
301
|
t.snowball_drawer_rollover_explainer_pt1,
|
|
301
302
|
"$100"
|
|
302
303
|
),
|
|
303
|
-
/* @__PURE__ */ e("strong", { children:
|
|
304
|
+
/* @__PURE__ */ e("strong", { children: E(t.snowball_drawer_debt_label, "B") }),
|
|
304
305
|
t.snowball_drawer_rollover_explainer_pt2
|
|
305
306
|
] })
|
|
306
307
|
] }),
|
|
307
|
-
/* @__PURE__ */ s(
|
|
308
|
+
/* @__PURE__ */ s(_, { children: [
|
|
308
309
|
/* @__PURE__ */ e(l, { variant: "Body", children: "$100.00" }),
|
|
309
310
|
/* @__PURE__ */ e(
|
|
310
311
|
l,
|
|
@@ -321,7 +322,7 @@ const R = () => {
|
|
|
321
322
|
}
|
|
322
323
|
)
|
|
323
324
|
] }),
|
|
324
|
-
/* @__PURE__ */ s(
|
|
325
|
+
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
325
326
|
/* @__PURE__ */ e(
|
|
326
327
|
G,
|
|
327
328
|
{
|
|
@@ -335,7 +336,7 @@ const R = () => {
|
|
|
335
336
|
}
|
|
336
337
|
),
|
|
337
338
|
/* @__PURE__ */ s(
|
|
338
|
-
|
|
339
|
+
_,
|
|
339
340
|
{
|
|
340
341
|
sx: {
|
|
341
342
|
borderBottom: `1px solid ${r.palette.border.light}`,
|
|
@@ -345,13 +346,13 @@ const R = () => {
|
|
|
345
346
|
pr: 24
|
|
346
347
|
},
|
|
347
348
|
children: [
|
|
348
|
-
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children:
|
|
349
|
+
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: E(t.snowball_drawer_debt_label, "B") }),
|
|
349
350
|
/* @__PURE__ */ e(l, { variant: "Body", children: "$400.00" })
|
|
350
351
|
]
|
|
351
352
|
}
|
|
352
353
|
)
|
|
353
354
|
] }),
|
|
354
|
-
/* @__PURE__ */ s(
|
|
355
|
+
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, py: 14, children: [
|
|
355
356
|
/* @__PURE__ */ e(
|
|
356
357
|
G,
|
|
357
358
|
{
|
|
@@ -364,13 +365,13 @@ const R = () => {
|
|
|
364
365
|
}
|
|
365
366
|
}
|
|
366
367
|
),
|
|
367
|
-
/* @__PURE__ */ s(
|
|
368
|
-
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children:
|
|
368
|
+
/* @__PURE__ */ s(_, { flexDirection: "row", flexGrow: 1, pr: 24, children: [
|
|
369
|
+
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: E(t.snowball_drawer_debt_label, "C") }),
|
|
369
370
|
/* @__PURE__ */ e(l, { variant: "Body", children: "$1,000.00" })
|
|
370
371
|
] })
|
|
371
372
|
] }),
|
|
372
373
|
/* @__PURE__ */ s(
|
|
373
|
-
|
|
374
|
+
_,
|
|
374
375
|
{
|
|
375
376
|
sx: {
|
|
376
377
|
py: 8,
|
|
@@ -387,12 +388,12 @@ const R = () => {
|
|
|
387
388
|
}
|
|
388
389
|
)
|
|
389
390
|
] }),
|
|
390
|
-
/* @__PURE__ */ s(
|
|
391
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children:
|
|
391
|
+
/* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
392
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: E(t.snowball_drawer_month_header, 2) }),
|
|
392
393
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
|
|
393
394
|
] }),
|
|
394
|
-
/* @__PURE__ */ s(
|
|
395
|
-
/* @__PURE__ */ s(
|
|
395
|
+
/* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
396
|
+
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
396
397
|
/* @__PURE__ */ e(
|
|
397
398
|
G,
|
|
398
399
|
{
|
|
@@ -410,7 +411,7 @@ const R = () => {
|
|
|
410
411
|
}
|
|
411
412
|
),
|
|
412
413
|
/* @__PURE__ */ s(
|
|
413
|
-
|
|
414
|
+
_,
|
|
414
415
|
{
|
|
415
416
|
sx: {
|
|
416
417
|
borderBottom: `1px solid ${r.palette.border.light}`,
|
|
@@ -420,18 +421,18 @@ const R = () => {
|
|
|
420
421
|
pr: 24
|
|
421
422
|
},
|
|
422
423
|
children: [
|
|
423
|
-
/* @__PURE__ */ s(
|
|
424
|
-
/* @__PURE__ */ e(l, { variant: "Body", children:
|
|
424
|
+
/* @__PURE__ */ s(_, { flexGrow: 1, children: [
|
|
425
|
+
/* @__PURE__ */ e(l, { variant: "Body", children: E(t.snowball_drawer_debt_label, "B") }),
|
|
425
426
|
/* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "XSmall", children: [
|
|
426
|
-
|
|
427
|
+
E(
|
|
427
428
|
t.snowball_drawer_rollover_explainer_pt1,
|
|
428
429
|
"$500"
|
|
429
430
|
),
|
|
430
|
-
/* @__PURE__ */ e("strong", { children:
|
|
431
|
+
/* @__PURE__ */ e("strong", { children: E(t.snowball_drawer_debt_label, "C") }),
|
|
431
432
|
t.snowball_drawer_rollover_explainer_pt2
|
|
432
433
|
] })
|
|
433
434
|
] }),
|
|
434
|
-
/* @__PURE__ */ s(
|
|
435
|
+
/* @__PURE__ */ s(_, { children: [
|
|
435
436
|
/* @__PURE__ */ e(l, { variant: "Body", children: "$500.00" }),
|
|
436
437
|
/* @__PURE__ */ e(
|
|
437
438
|
l,
|
|
@@ -448,7 +449,7 @@ const R = () => {
|
|
|
448
449
|
}
|
|
449
450
|
)
|
|
450
451
|
] }),
|
|
451
|
-
/* @__PURE__ */ s(
|
|
452
|
+
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
452
453
|
/* @__PURE__ */ e(
|
|
453
454
|
G,
|
|
454
455
|
{
|
|
@@ -462,7 +463,7 @@ const R = () => {
|
|
|
462
463
|
}
|
|
463
464
|
),
|
|
464
465
|
/* @__PURE__ */ s(
|
|
465
|
-
|
|
466
|
+
_,
|
|
466
467
|
{
|
|
467
468
|
sx: {
|
|
468
469
|
flexDirection: "row",
|
|
@@ -471,14 +472,14 @@ const R = () => {
|
|
|
471
472
|
pr: 24
|
|
472
473
|
},
|
|
473
474
|
children: [
|
|
474
|
-
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children:
|
|
475
|
+
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: E(t.snowball_drawer_debt_label, "C") }),
|
|
475
476
|
/* @__PURE__ */ e(l, { variant: "Body", children: "$1,000.00" })
|
|
476
477
|
]
|
|
477
478
|
}
|
|
478
479
|
)
|
|
479
480
|
] }),
|
|
480
481
|
/* @__PURE__ */ s(
|
|
481
|
-
|
|
482
|
+
_,
|
|
482
483
|
{
|
|
483
484
|
sx: {
|
|
484
485
|
py: 8,
|
|
@@ -495,12 +496,12 @@ const R = () => {
|
|
|
495
496
|
}
|
|
496
497
|
)
|
|
497
498
|
] }),
|
|
498
|
-
/* @__PURE__ */ s(
|
|
499
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children:
|
|
499
|
+
/* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
500
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: E(t.snowball_drawer_month_header, 3) }),
|
|
500
501
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
|
|
501
502
|
] }),
|
|
502
|
-
/* @__PURE__ */ s(
|
|
503
|
-
/* @__PURE__ */ s(
|
|
503
|
+
/* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
|
|
504
|
+
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
504
505
|
/* @__PURE__ */ e(
|
|
505
506
|
G,
|
|
506
507
|
{
|
|
@@ -518,7 +519,7 @@ const R = () => {
|
|
|
518
519
|
}
|
|
519
520
|
),
|
|
520
521
|
/* @__PURE__ */ s(
|
|
521
|
-
|
|
522
|
+
_,
|
|
522
523
|
{
|
|
523
524
|
sx: {
|
|
524
525
|
alignItems: "center",
|
|
@@ -528,8 +529,8 @@ const R = () => {
|
|
|
528
529
|
pr: 24
|
|
529
530
|
},
|
|
530
531
|
children: [
|
|
531
|
-
/* @__PURE__ */ e(
|
|
532
|
-
/* @__PURE__ */ s(
|
|
532
|
+
/* @__PURE__ */ e(_, { flexGrow: 1, children: /* @__PURE__ */ e(l, { variant: "Body", children: E(t.snowball_drawer_debt_label, "C") }) }),
|
|
533
|
+
/* @__PURE__ */ s(_, { children: [
|
|
533
534
|
/* @__PURE__ */ e(l, { variant: "Body", children: "$1,500.00" }),
|
|
534
535
|
/* @__PURE__ */ e(
|
|
535
536
|
l,
|
|
@@ -547,7 +548,7 @@ const R = () => {
|
|
|
547
548
|
)
|
|
548
549
|
] }),
|
|
549
550
|
/* @__PURE__ */ s(
|
|
550
|
-
|
|
551
|
+
_,
|
|
551
552
|
{
|
|
552
553
|
sx: {
|
|
553
554
|
py: 8,
|
|
@@ -568,50 +569,50 @@ const R = () => {
|
|
|
568
569
|
] })
|
|
569
570
|
}
|
|
570
571
|
);
|
|
571
|
-
},
|
|
572
|
-
function
|
|
573
|
-
const [r, t,
|
|
574
|
-
Math.max(0, Math.min(255, Math.round(r *
|
|
575
|
-
Math.max(0, Math.min(255, Math.round(t *
|
|
576
|
-
Math.max(0, Math.min(255, Math.round(
|
|
572
|
+
}, st = D(lt), ct = "#FF7B08";
|
|
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)))
|
|
577
578
|
];
|
|
578
579
|
return `rgb(${i[0]}, ${i[1]}, ${i[2]})`;
|
|
579
580
|
}
|
|
580
|
-
const
|
|
581
|
+
const xe = ({
|
|
581
582
|
sx: a,
|
|
582
|
-
height:
|
|
583
|
+
height: o = 500,
|
|
583
584
|
width: r,
|
|
584
585
|
debts: t,
|
|
585
|
-
hoveredDebtGuid:
|
|
586
|
+
hoveredDebtGuid: n,
|
|
586
587
|
onClickArea: i,
|
|
587
588
|
onHoverArea: p
|
|
588
589
|
}) => {
|
|
589
|
-
const
|
|
590
|
+
const c = $e(), { onEvent: d } = F(), m = t.filter((h) => !h.is_impossible), b = [
|
|
590
591
|
...new Set(
|
|
591
|
-
m.flatMap((h) => h.dataset.map((
|
|
592
|
+
m.flatMap((h) => h.dataset.map((g) => new Date(g.x).getTime()))
|
|
592
593
|
)
|
|
593
|
-
].sort((h,
|
|
594
|
-
const
|
|
595
|
-
let
|
|
596
|
-
const
|
|
597
|
-
const O =
|
|
598
|
-
return
|
|
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
|
+
const R = b.map((L) => {
|
|
598
|
+
const O = g.get(L.getTime()) ?? A;
|
|
599
|
+
return A = O, { x: L, y: O };
|
|
599
600
|
});
|
|
600
|
-
return { ...h, dataset:
|
|
601
|
+
return { ...h, dataset: R };
|
|
601
602
|
}), u = f.reduce(
|
|
602
|
-
(h,
|
|
603
|
+
(h, g) => h + (g.dataset[0]?.y ?? 0),
|
|
603
604
|
0
|
|
604
|
-
),
|
|
605
|
-
const
|
|
606
|
-
return { x: h, y:
|
|
607
|
-
}),
|
|
608
|
-
const
|
|
605
|
+
), v = b.map((h, g) => {
|
|
606
|
+
const A = g / (b.length - 1), R = u * (1 - A);
|
|
607
|
+
return { x: h, y: R };
|
|
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);
|
|
609
610
|
return {
|
|
610
|
-
id: `debt-${
|
|
611
|
+
id: `debt-${g}`,
|
|
611
612
|
guid: h.guid,
|
|
612
613
|
label: h.name,
|
|
613
|
-
data: h.dataset.map((
|
|
614
|
-
color:
|
|
614
|
+
data: h.dataset.map((L) => L.y),
|
|
615
|
+
color: R,
|
|
615
616
|
curve: "linear",
|
|
616
617
|
type: "line",
|
|
617
618
|
area: !0,
|
|
@@ -619,18 +620,18 @@ const ge = ({
|
|
|
619
620
|
showMark: !1
|
|
620
621
|
};
|
|
621
622
|
});
|
|
622
|
-
|
|
623
|
+
C.push({
|
|
623
624
|
id: "payoff-line",
|
|
624
625
|
label: "Payoff Line",
|
|
625
|
-
data:
|
|
626
|
-
color:
|
|
626
|
+
data: v.map((h) => h.y),
|
|
627
|
+
color: c.palette.grey[700],
|
|
627
628
|
curve: "linear",
|
|
628
629
|
type: "line",
|
|
629
630
|
stack: void 0,
|
|
630
631
|
showMark: !1,
|
|
631
632
|
disableHighlight: !0
|
|
632
633
|
});
|
|
633
|
-
const
|
|
634
|
+
const B = (h) => C.findIndex((g) => g?.guid === h);
|
|
634
635
|
return /* @__PURE__ */ e(
|
|
635
636
|
re,
|
|
636
637
|
{
|
|
@@ -647,27 +648,25 @@ const ge = ({
|
|
|
647
648
|
}
|
|
648
649
|
},
|
|
649
650
|
children: /* @__PURE__ */ e(
|
|
650
|
-
|
|
651
|
+
He,
|
|
651
652
|
{
|
|
652
653
|
axisHighlight: { x: "none" },
|
|
653
654
|
disableLineItemHighlight: !0,
|
|
654
|
-
height:
|
|
655
|
-
|
|
655
|
+
height: o,
|
|
656
|
+
hideLegend: !0,
|
|
657
|
+
margin: { bottom: 24, left: 32, right: 72, top: 48 },
|
|
658
|
+
onAreaClick: (h, g) => {
|
|
656
659
|
i?.();
|
|
657
|
-
const
|
|
658
|
-
|
|
660
|
+
const A = C.find((R) => R.id === g.seriesId);
|
|
661
|
+
d(T.DEBTS_CLICK_CHART_AREA, { account_guid: A?.guid });
|
|
659
662
|
},
|
|
660
663
|
onHighlightChange: (h) => {
|
|
661
|
-
const
|
|
662
|
-
p?.(
|
|
664
|
+
const g = C.find((A) => A.id === h?.seriesId)?.guid;
|
|
665
|
+
p?.(g ?? "");
|
|
663
666
|
},
|
|
664
|
-
series:
|
|
667
|
+
series: C,
|
|
665
668
|
skipAnimation: !0,
|
|
666
|
-
slotProps: {
|
|
667
|
-
legend: {
|
|
668
|
-
hidden: !0
|
|
669
|
-
}
|
|
670
|
-
},
|
|
669
|
+
slotProps: { tooltip: { trigger: "none" } },
|
|
671
670
|
sx: {
|
|
672
671
|
p: 4,
|
|
673
672
|
"& .MuiBarLabel-root": {
|
|
@@ -685,43 +684,43 @@ const ge = ({
|
|
|
685
684
|
strokeDasharray: "10 5",
|
|
686
685
|
strokeWidth: 1
|
|
687
686
|
},
|
|
688
|
-
[`& .MuiLineElement-series-debt-${
|
|
687
|
+
[`& .MuiLineElement-series-debt-${B(n ?? "0")}`]: {
|
|
689
688
|
opacity: 1
|
|
690
689
|
},
|
|
691
|
-
[`& .MuiAreaElement-series-debt-${
|
|
690
|
+
[`& .MuiAreaElement-series-debt-${B(n ?? "0")}`]: {
|
|
692
691
|
opacity: 1
|
|
693
692
|
},
|
|
694
693
|
"& .MuiChartsAxis-tickLabel > tspan": {
|
|
695
|
-
fontFamily:
|
|
694
|
+
fontFamily: c.typography.Small.fontFamily
|
|
696
695
|
},
|
|
697
696
|
...a
|
|
698
697
|
},
|
|
699
|
-
tooltip: { trigger: "none" },
|
|
700
698
|
width: r,
|
|
701
699
|
xAxis: [
|
|
702
700
|
{
|
|
703
|
-
data:
|
|
704
|
-
scaleType: "time",
|
|
705
|
-
min: b[0],
|
|
701
|
+
data: I,
|
|
706
702
|
disableTicks: !0,
|
|
703
|
+
min: b[0],
|
|
704
|
+
scaleType: "time",
|
|
705
|
+
tickLabelMinGap: 24,
|
|
707
706
|
valueFormatter: (h) => K(h, U.MONTH_SHORT_YEAR)
|
|
708
707
|
}
|
|
709
708
|
],
|
|
710
709
|
yAxis: [
|
|
711
710
|
{
|
|
712
711
|
min: 0,
|
|
713
|
-
max:
|
|
712
|
+
max: M,
|
|
714
713
|
disableTicks: !0,
|
|
715
|
-
valueFormatter: (h) =>
|
|
714
|
+
valueFormatter: (h) => k(h, "0a")
|
|
716
715
|
}
|
|
717
716
|
]
|
|
718
717
|
}
|
|
719
718
|
)
|
|
720
719
|
}
|
|
721
720
|
);
|
|
722
|
-
},
|
|
723
|
-
const a = X(), { debts:
|
|
724
|
-
return /* @__PURE__ */ s(
|
|
721
|
+
}, pt = () => {
|
|
722
|
+
const a = X(), { debts: o } = S(), { selectedDebtChartData: r } = $();
|
|
723
|
+
return /* @__PURE__ */ s(H, { children: [
|
|
725
724
|
/* @__PURE__ */ s(
|
|
726
725
|
Fe,
|
|
727
726
|
{
|
|
@@ -731,8 +730,8 @@ const ge = ({
|
|
|
731
730
|
}
|
|
732
731
|
},
|
|
733
732
|
children: [
|
|
734
|
-
/* @__PURE__ */ e(Le, { sx: { pb: 0 }, title: /* @__PURE__ */ e(ve, { sx: { pb: 4 }, children:
|
|
735
|
-
/* @__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 }) })
|
|
736
735
|
]
|
|
737
736
|
}
|
|
738
737
|
),
|
|
@@ -742,13 +741,13 @@ const ge = ({
|
|
|
742
741
|
color: a.palette.text.secondary,
|
|
743
742
|
sx: { whiteSpace: "normal", textAlign: "center", px: 8, py: 12 },
|
|
744
743
|
variant: "Small",
|
|
745
|
-
children:
|
|
744
|
+
children: o.details_chart_description
|
|
746
745
|
}
|
|
747
746
|
)
|
|
748
747
|
] });
|
|
749
|
-
},
|
|
750
|
-
const a = X(), { onEvent:
|
|
751
|
-
return x.useEffect(() =>
|
|
748
|
+
}, mt = D(pt), ht = () => {
|
|
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(
|
|
752
751
|
l,
|
|
753
752
|
{
|
|
754
753
|
color: a.palette.secondary.main,
|
|
@@ -757,13 +756,13 @@ const ge = ({
|
|
|
757
756
|
variant: "Small",
|
|
758
757
|
children: i ? r.schedule_error_message : r.schedule_complete_message
|
|
759
758
|
}
|
|
760
|
-
) : /* @__PURE__ */ s(
|
|
761
|
-
/* @__PURE__ */ s(
|
|
759
|
+
) : /* @__PURE__ */ s(H, { children: [
|
|
760
|
+
/* @__PURE__ */ s(w, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
762
761
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_month_heading }),
|
|
763
762
|
/* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_amount_heading })
|
|
764
763
|
] }),
|
|
765
|
-
t.dataset.slice(1).map(({ x: p, y:
|
|
766
|
-
|
|
764
|
+
t.dataset.slice(1).map(({ x: p, y: c, payment: d }) => /* @__PURE__ */ e(w, { bgcolor: a.palette.background.paper, children: /* @__PURE__ */ e(w, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
|
|
765
|
+
w,
|
|
767
766
|
{
|
|
768
767
|
sx: {
|
|
769
768
|
borderBottom: `1px solid ${a.palette.border.light}`,
|
|
@@ -773,12 +772,12 @@ const ge = ({
|
|
|
773
772
|
pr: 24
|
|
774
773
|
},
|
|
775
774
|
children: [
|
|
776
|
-
/* @__PURE__ */ s(
|
|
775
|
+
/* @__PURE__ */ s(w, { flexGrow: 1, children: [
|
|
777
776
|
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: K(p, U.MONTH_YEAR) }),
|
|
778
777
|
/* @__PURE__ */ e(l, { color: a.palette.secondary.main, variant: "XSmall", children: r.schedule_month_label })
|
|
779
778
|
] }),
|
|
780
|
-
/* @__PURE__ */ s(
|
|
781
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children:
|
|
779
|
+
/* @__PURE__ */ s(w, { children: [
|
|
780
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: k(c, "0,0.00") }),
|
|
782
781
|
/* @__PURE__ */ e(
|
|
783
782
|
l,
|
|
784
783
|
{
|
|
@@ -786,15 +785,15 @@ const ge = ({
|
|
|
786
785
|
color: a.palette.success.main,
|
|
787
786
|
textAlign: "end",
|
|
788
787
|
variant: "Tiny",
|
|
789
|
-
children: `+${
|
|
788
|
+
children: `+${k(d, "0,0")}`
|
|
790
789
|
}
|
|
791
790
|
)
|
|
792
791
|
] })
|
|
793
792
|
]
|
|
794
793
|
}
|
|
795
794
|
) }) }, String(p))),
|
|
796
|
-
/* @__PURE__ */ e(
|
|
797
|
-
|
|
795
|
+
/* @__PURE__ */ e(w, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
|
|
796
|
+
w,
|
|
798
797
|
{
|
|
799
798
|
sx: {
|
|
800
799
|
alignItems: "center",
|
|
@@ -810,10 +809,10 @@ const ge = ({
|
|
|
810
809
|
}
|
|
811
810
|
) })
|
|
812
811
|
] }) });
|
|
813
|
-
},
|
|
814
|
-
const { debts:
|
|
815
|
-
await r({ ...a.account, interest_rate:
|
|
816
|
-
},
|
|
812
|
+
}, ut = D(ht), bt = D(({ debt: a }) => {
|
|
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 });
|
|
815
|
+
}, d = () => {
|
|
817
816
|
setTimeout(() => {
|
|
818
817
|
i(a.interest_rate ?? 0);
|
|
819
818
|
}, 250);
|
|
@@ -822,12 +821,12 @@ const ge = ({
|
|
|
822
821
|
J,
|
|
823
822
|
{
|
|
824
823
|
isSaveDisabled: p,
|
|
825
|
-
label: `${
|
|
826
|
-
onCancel:
|
|
827
|
-
onSave:
|
|
828
|
-
primaryText:
|
|
824
|
+
label: `${o.details_interest_rate} (%)`,
|
|
825
|
+
onCancel: d,
|
|
826
|
+
onSave: c,
|
|
827
|
+
primaryText: o.details_interest_rate,
|
|
829
828
|
secondaryText: Be(Number(a.interest_rate) / 100),
|
|
830
|
-
zeroStateText: a.interest_rate ? void 0 :
|
|
829
|
+
zeroStateText: a.interest_rate ? void 0 : o.add_interest_rate,
|
|
831
830
|
children: /* @__PURE__ */ e(
|
|
832
831
|
Xe,
|
|
833
832
|
{
|
|
@@ -835,15 +834,15 @@ const ge = ({
|
|
|
835
834
|
fullWidth: !0,
|
|
836
835
|
onChange: (m) => i(isNaN(parseFloat(m.target.value)) ? 0 : parseFloat(m.target.value)),
|
|
837
836
|
type: "number",
|
|
838
|
-
value:
|
|
837
|
+
value: n
|
|
839
838
|
}
|
|
840
839
|
)
|
|
841
840
|
}
|
|
842
841
|
);
|
|
843
|
-
}),
|
|
844
|
-
const { debts:
|
|
845
|
-
await r({ ...a.account, minimum_payment:
|
|
846
|
-
},
|
|
842
|
+
}), _t = D(({ debt: a }) => {
|
|
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 });
|
|
845
|
+
}, d = () => {
|
|
847
846
|
setTimeout(() => {
|
|
848
847
|
i(a.monthly_payment ?? 0);
|
|
849
848
|
}, 250);
|
|
@@ -852,30 +851,30 @@ const ge = ({
|
|
|
852
851
|
J,
|
|
853
852
|
{
|
|
854
853
|
isSaveDisabled: p,
|
|
855
|
-
label:
|
|
856
|
-
onCancel:
|
|
857
|
-
onSave:
|
|
858
|
-
primaryText:
|
|
859
|
-
secondaryText:
|
|
860
|
-
zeroStateText: a.monthly_payment ? void 0 :
|
|
854
|
+
label: o.details_monthly_payment,
|
|
855
|
+
onCancel: d,
|
|
856
|
+
onSave: c,
|
|
857
|
+
primaryText: o.details_monthly_payment,
|
|
858
|
+
secondaryText: k(a.monthly_payment, "0,0"),
|
|
859
|
+
zeroStateText: a.monthly_payment ? void 0 : o.add_monthly_payment,
|
|
861
860
|
children: /* @__PURE__ */ e(
|
|
862
861
|
ae,
|
|
863
862
|
{
|
|
864
|
-
amount:
|
|
863
|
+
amount: n,
|
|
865
864
|
autoFocus: !0,
|
|
866
865
|
error: p,
|
|
867
866
|
fullWidth: !0,
|
|
868
867
|
minAmount: 0,
|
|
869
|
-
setAmount: (m) => i(isNaN(Number(m)) ?
|
|
868
|
+
setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
|
|
870
869
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
871
870
|
}
|
|
872
871
|
)
|
|
873
872
|
}
|
|
874
873
|
);
|
|
875
|
-
}),
|
|
876
|
-
const { debts:
|
|
877
|
-
await r({ ...a.account, original_balance:
|
|
878
|
-
},
|
|
874
|
+
}), yt = D(({ debt: a }) => {
|
|
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 });
|
|
877
|
+
}, d = () => {
|
|
879
878
|
setTimeout(() => {
|
|
880
879
|
i(a.original_balance ?? 0);
|
|
881
880
|
}, 250);
|
|
@@ -884,52 +883,52 @@ const ge = ({
|
|
|
884
883
|
J,
|
|
885
884
|
{
|
|
886
885
|
isSaveDisabled: p,
|
|
887
|
-
label:
|
|
888
|
-
onCancel:
|
|
889
|
-
onSave:
|
|
890
|
-
primaryText:
|
|
891
|
-
secondaryText:
|
|
892
|
-
zeroStateText: a.original_balance ? void 0 :
|
|
886
|
+
label: o.details_original_balance,
|
|
887
|
+
onCancel: d,
|
|
888
|
+
onSave: c,
|
|
889
|
+
primaryText: o.details_original_balance,
|
|
890
|
+
secondaryText: k(a.original_balance, "0,0"),
|
|
891
|
+
zeroStateText: a.original_balance ? void 0 : o.add_original_balance,
|
|
893
892
|
children: /* @__PURE__ */ e(
|
|
894
893
|
ae,
|
|
895
894
|
{
|
|
896
|
-
amount:
|
|
895
|
+
amount: n,
|
|
897
896
|
autoFocus: !0,
|
|
898
897
|
error: p,
|
|
899
898
|
fullWidth: !0,
|
|
900
899
|
minAmount: 0,
|
|
901
|
-
setAmount: (m) => i(isNaN(Number(m)) ?
|
|
900
|
+
setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
|
|
902
901
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
903
902
|
}
|
|
904
903
|
)
|
|
905
904
|
}
|
|
906
905
|
);
|
|
907
|
-
}),
|
|
908
|
-
const { onEvent: a } =
|
|
909
|
-
return x.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(
|
|
910
|
-
|
|
911
|
-
/* @__PURE__ */ e(Ge, { goal:
|
|
906
|
+
}), ft = () => {
|
|
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 }),
|
|
912
911
|
/* @__PURE__ */ e(j, {}),
|
|
913
|
-
/* @__PURE__ */ e(je, { goal:
|
|
912
|
+
/* @__PURE__ */ e(je, { goal: o.goal }),
|
|
914
913
|
/* @__PURE__ */ e(j, {}),
|
|
915
|
-
/* @__PURE__ */ e(ze, { goal:
|
|
914
|
+
/* @__PURE__ */ e(ze, { goal: o.goal }),
|
|
916
915
|
/* @__PURE__ */ e(j, {})
|
|
917
916
|
] }),
|
|
918
|
-
!
|
|
919
|
-
/* @__PURE__ */ e(
|
|
917
|
+
!o?.goal && o?.account && /* @__PURE__ */ s(H, { children: [
|
|
918
|
+
/* @__PURE__ */ e(_t, { debt: o }),
|
|
920
919
|
/* @__PURE__ */ e(j, {}),
|
|
921
|
-
/* @__PURE__ */ e(
|
|
920
|
+
/* @__PURE__ */ e(bt, { debt: o }),
|
|
922
921
|
/* @__PURE__ */ e(j, {}),
|
|
923
|
-
/* @__PURE__ */ e(
|
|
922
|
+
/* @__PURE__ */ e(yt, { debt: o }),
|
|
924
923
|
/* @__PURE__ */ e(j, {})
|
|
925
924
|
] })
|
|
926
925
|
] });
|
|
927
|
-
},
|
|
928
|
-
const { debts: r } =
|
|
926
|
+
}, gt = D(ft), xt = ({ setTabValue: a, sx: o }) => {
|
|
927
|
+
const { debts: r } = S(), { showError: t, showCompleted: n } = $();
|
|
929
928
|
return x.useEffect(() => {
|
|
930
929
|
t && a(1);
|
|
931
|
-
}, [t]), !t && !
|
|
932
|
-
/* @__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(
|
|
933
932
|
pe,
|
|
934
933
|
{
|
|
935
934
|
icon: t ? /* @__PURE__ */ e(Ve, { filled: !0 }) : /* @__PURE__ */ e(ye, { color: "success", filled: !0 }),
|
|
@@ -950,10 +949,10 @@ const ge = ({
|
|
|
950
949
|
]
|
|
951
950
|
}
|
|
952
951
|
) }),
|
|
953
|
-
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(
|
|
954
953
|
pe,
|
|
955
954
|
{
|
|
956
|
-
icon: /* @__PURE__ */ e(
|
|
955
|
+
icon: /* @__PURE__ */ e(H, {}),
|
|
957
956
|
severity: "error",
|
|
958
957
|
sx: {
|
|
959
958
|
borderRadius: 2,
|
|
@@ -969,16 +968,16 @@ const ge = ({
|
|
|
969
968
|
}
|
|
970
969
|
) })
|
|
971
970
|
] });
|
|
972
|
-
},
|
|
973
|
-
const { debts: a } =
|
|
974
|
-
return /* @__PURE__ */ s(
|
|
975
|
-
(
|
|
971
|
+
}, wt = D(xt), Ct = () => {
|
|
972
|
+
const { debts: a } = S(), { showError: o, showCompleted: r } = $(), [t, n] = x.useState(0);
|
|
973
|
+
return /* @__PURE__ */ s(H, { children: [
|
|
974
|
+
(o || r) && /* @__PURE__ */ e(wt, { setTabValue: n, sx: { mt: -24 } }),
|
|
976
975
|
/* @__PURE__ */ s(
|
|
977
976
|
We,
|
|
978
977
|
{
|
|
979
978
|
"aria-label": a.details_tabs_aria_label,
|
|
980
979
|
centered: !0,
|
|
981
|
-
onChange: (i, p) =>
|
|
980
|
+
onChange: (i, p) => n(p),
|
|
982
981
|
textColor: "primary",
|
|
983
982
|
value: t,
|
|
984
983
|
variant: "fullWidth",
|
|
@@ -1002,32 +1001,32 @@ const ge = ({
|
|
|
1002
1001
|
]
|
|
1003
1002
|
}
|
|
1004
1003
|
),
|
|
1005
|
-
/* @__PURE__ */ e(ue, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(
|
|
1006
|
-
/* @__PURE__ */ e(ue, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(
|
|
1004
|
+
/* @__PURE__ */ e(ue, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(ut, {}) }),
|
|
1005
|
+
/* @__PURE__ */ e(ue, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(gt, {}) })
|
|
1007
1006
|
] });
|
|
1008
|
-
},
|
|
1009
|
-
const { debts: r } =
|
|
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, {});
|
|
1010
1009
|
return /* @__PURE__ */ e(
|
|
1011
1010
|
te,
|
|
1012
1011
|
{
|
|
1013
1012
|
ariaLabelClose: r.details_close_aria,
|
|
1014
1013
|
isOpen: a,
|
|
1015
|
-
onClose:
|
|
1014
|
+
onClose: o,
|
|
1016
1015
|
title: r.details_title,
|
|
1017
|
-
children: /* @__PURE__ */ s(
|
|
1016
|
+
children: /* @__PURE__ */ s(w, { bgcolor: "background.default", children: [
|
|
1018
1017
|
/* @__PURE__ */ e(ke, { customDetailsChart: i }),
|
|
1019
|
-
/* @__PURE__ */ e(
|
|
1018
|
+
/* @__PURE__ */ e(St, {})
|
|
1020
1019
|
] })
|
|
1021
1020
|
}
|
|
1022
1021
|
);
|
|
1023
|
-
},
|
|
1024
|
-
const { debts: a } =
|
|
1025
|
-
|
|
1026
|
-
user_guid:
|
|
1022
|
+
}, Dt = D(() => {
|
|
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
|
|
1027
1026
|
}));
|
|
1028
|
-
},
|
|
1027
|
+
}, d = () => {
|
|
1029
1028
|
setTimeout(() => {
|
|
1030
|
-
i(
|
|
1029
|
+
i(o?.extra_payment ?? 0);
|
|
1031
1030
|
}, 250);
|
|
1032
1031
|
};
|
|
1033
1032
|
return /* @__PURE__ */ e(
|
|
@@ -1035,77 +1034,77 @@ const ge = ({
|
|
|
1035
1034
|
{
|
|
1036
1035
|
isSaveDisabled: p,
|
|
1037
1036
|
label: a.paydown_drawer_extra_payment,
|
|
1038
|
-
onCancel:
|
|
1039
|
-
onSave:
|
|
1037
|
+
onCancel: d,
|
|
1038
|
+
onSave: c,
|
|
1040
1039
|
primaryText: a.paydown_drawer_extra_payment,
|
|
1041
|
-
secondaryText:
|
|
1042
|
-
zeroStateText:
|
|
1040
|
+
secondaryText: k(o?.extra_payment, "0,0"),
|
|
1041
|
+
zeroStateText: o?.extra_payment ? void 0 : a.add_extra_payment,
|
|
1043
1042
|
children: /* @__PURE__ */ e(
|
|
1044
1043
|
ae,
|
|
1045
1044
|
{
|
|
1046
|
-
amount:
|
|
1045
|
+
amount: n,
|
|
1047
1046
|
autoFocus: !0,
|
|
1048
1047
|
error: p,
|
|
1049
1048
|
fullWidth: !0,
|
|
1050
1049
|
minAmount: 0,
|
|
1051
|
-
setAmount: (m) => i(isNaN(Number(m)) ?
|
|
1050
|
+
setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
|
|
1052
1051
|
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
1053
1052
|
}
|
|
1054
1053
|
)
|
|
1055
1054
|
}
|
|
1056
1055
|
);
|
|
1057
|
-
}),
|
|
1058
|
-
const { debts: a } =
|
|
1059
|
-
return /* @__PURE__ */ s(
|
|
1060
|
-
/* @__PURE__ */ s(
|
|
1061
|
-
/* @__PURE__ */ s(
|
|
1056
|
+
}), Tt = () => {
|
|
1057
|
+
const { debts: a } = S(), { totalMonthlyPayments: o } = q(), { monthlyCashFlowProfile: r } = V(), t = o + Number(r?.extra_payment);
|
|
1058
|
+
return /* @__PURE__ */ s(w, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
|
|
1059
|
+
/* @__PURE__ */ s(w, { p: 24, children: [
|
|
1060
|
+
/* @__PURE__ */ s(w, { alignItems: "center", gap: 4, mb: 24, children: [
|
|
1062
1061
|
/* @__PURE__ */ e(l, { variant: "Body", children: a.paydown_drawer_mimimum_label }),
|
|
1063
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "H1", children:
|
|
1062
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "H1", children: k(o, "0,0") }),
|
|
1064
1063
|
/* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "Small", width: 208, children: a.paydown_drawer_minimum_info })
|
|
1065
1064
|
] }),
|
|
1066
|
-
/* @__PURE__ */ s(
|
|
1065
|
+
/* @__PURE__ */ s(w, { children: [
|
|
1067
1066
|
/* @__PURE__ */ e(l, { variant: "H3", children: a.paydown_drawer_subtitle }),
|
|
1068
1067
|
/* @__PURE__ */ e(l, { truncate: !1, variant: "ParagraphSmall", children: a.paydown_drawer_description })
|
|
1069
1068
|
] })
|
|
1070
1069
|
] }),
|
|
1071
|
-
/* @__PURE__ */ e(
|
|
1072
|
-
/* @__PURE__ */ e(
|
|
1070
|
+
/* @__PURE__ */ e(w, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(Dt, {}) }),
|
|
1071
|
+
/* @__PURE__ */ e(w, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(w, { gap: 4, children: [
|
|
1073
1072
|
/* @__PURE__ */ e(l, { variant: "Small", children: a.paydown_drawer_total_payment }),
|
|
1074
|
-
/* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children:
|
|
1073
|
+
/* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: k(t, "0,0") })
|
|
1075
1074
|
] }) })
|
|
1076
1075
|
] });
|
|
1077
|
-
},
|
|
1078
|
-
const { debts: r } =
|
|
1076
|
+
}, At = D(Tt), Et = ({ isOpen: a, onClose: o }) => {
|
|
1077
|
+
const { debts: r } = S();
|
|
1079
1078
|
return /* @__PURE__ */ e(
|
|
1080
1079
|
te,
|
|
1081
1080
|
{
|
|
1082
1081
|
ariaLabelClose: r.paydown_drawer_close_aria,
|
|
1083
1082
|
isOpen: a,
|
|
1084
|
-
onClose:
|
|
1083
|
+
onClose: o,
|
|
1085
1084
|
title: r.paydown_drawer_title,
|
|
1086
|
-
children: /* @__PURE__ */ e(
|
|
1085
|
+
children: /* @__PURE__ */ e(At, {})
|
|
1087
1086
|
}
|
|
1088
1087
|
);
|
|
1089
1088
|
};
|
|
1090
|
-
function
|
|
1089
|
+
function It(a, o) {
|
|
1091
1090
|
const r = (t) => {
|
|
1092
1091
|
if (typeof t == "number") return t;
|
|
1093
1092
|
if (t === "!" || t === "✓") return 1 / 0;
|
|
1094
1093
|
throw new Error("Unsupported value");
|
|
1095
1094
|
};
|
|
1096
|
-
return r(a) - r(
|
|
1095
|
+
return r(a) - r(o);
|
|
1097
1096
|
}
|
|
1098
|
-
function
|
|
1097
|
+
function Bt(a) {
|
|
1099
1098
|
return a.is_paid_off ? "✓" : a.priority === void 0 || a.is_impossible ? "!" : a.priority;
|
|
1100
1099
|
}
|
|
1101
|
-
const
|
|
1102
|
-
const
|
|
1100
|
+
const Mt = (a) => {
|
|
1101
|
+
const o = {
|
|
1103
1102
|
text: "#121417",
|
|
1104
1103
|
background: "#FFB252"
|
|
1105
1104
|
};
|
|
1106
|
-
return a === "!" && (
|
|
1107
|
-
},
|
|
1108
|
-
const
|
|
1105
|
+
return a === "!" && (o.text = "#FFFFFF", o.background = "#DF320C"), a === "✓" && (o.text = "#FFFFFF", o.background = "#09A57F"), o;
|
|
1106
|
+
}, Pt = (a) => {
|
|
1107
|
+
const o = String(a.formattedValue), r = Mt(o);
|
|
1109
1108
|
return /* @__PURE__ */ e(
|
|
1110
1109
|
re,
|
|
1111
1110
|
{
|
|
@@ -1120,80 +1119,80 @@ const Bt = (a) => {
|
|
|
1120
1119
|
backgroundColor: r.background,
|
|
1121
1120
|
marginLeft: "10px"
|
|
1122
1121
|
},
|
|
1123
|
-
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 })
|
|
1124
1123
|
}
|
|
1125
1124
|
);
|
|
1126
|
-
},
|
|
1127
|
-
const
|
|
1128
|
-
return /* @__PURE__ */ s(
|
|
1125
|
+
}, kt = (a) => {
|
|
1126
|
+
const o = a.row.account, r = Ke[o.account_type];
|
|
1127
|
+
return /* @__PURE__ */ s(w, { alignItems: "center", flexDirection: "row", children: [
|
|
1129
1128
|
/* @__PURE__ */ e(
|
|
1130
1129
|
De,
|
|
1131
1130
|
{
|
|
1132
|
-
alt: `${
|
|
1133
|
-
institutionGuid:
|
|
1131
|
+
alt: `${o.institutionName}`,
|
|
1132
|
+
institutionGuid: o.institution_guid || ""
|
|
1134
1133
|
}
|
|
1135
1134
|
),
|
|
1136
|
-
/* @__PURE__ */ s(
|
|
1137
|
-
/* @__PURE__ */ e(l, { variant: "Small", children:
|
|
1135
|
+
/* @__PURE__ */ s(w, { ml: 12, children: [
|
|
1136
|
+
/* @__PURE__ */ e(l, { variant: "Small", children: o.name }),
|
|
1138
1137
|
/* @__PURE__ */ e(l, { variant: "XSmall", children: r })
|
|
1139
1138
|
] })
|
|
1140
1139
|
] });
|
|
1141
|
-
},
|
|
1140
|
+
}, Nt = ({
|
|
1142
1141
|
sx: a = {},
|
|
1143
|
-
debts:
|
|
1142
|
+
debts: o,
|
|
1144
1143
|
hoveredDebtGuid: r,
|
|
1145
1144
|
onHoverRow: t,
|
|
1146
|
-
onClickRow:
|
|
1145
|
+
onClickRow: n
|
|
1147
1146
|
}) => {
|
|
1148
|
-
const i = X(), { onEvent: p } =
|
|
1147
|
+
const i = X(), { onEvent: p } = F(), { isMobile: c } = Y(), { debts: d } = S(), [m, b] = x.useState([
|
|
1149
1148
|
{ field: "priority", sort: "asc" }
|
|
1150
1149
|
]), f = [
|
|
1151
1150
|
{
|
|
1152
1151
|
field: "priority",
|
|
1153
|
-
headerName:
|
|
1152
|
+
headerName: d.table_column_priority,
|
|
1154
1153
|
renderHeader: z,
|
|
1155
|
-
renderCell:
|
|
1156
|
-
sortComparator:
|
|
1154
|
+
renderCell: Pt,
|
|
1155
|
+
sortComparator: It,
|
|
1157
1156
|
sortable: !0,
|
|
1158
1157
|
hideSortIcons: !0,
|
|
1159
1158
|
type: "custom",
|
|
1160
1159
|
align: "left",
|
|
1161
1160
|
headerAlign: "left",
|
|
1162
|
-
minWidth:
|
|
1163
|
-
flex:
|
|
1161
|
+
minWidth: c ? 67 : 72,
|
|
1162
|
+
flex: c ? 0.2 : 0.4
|
|
1164
1163
|
},
|
|
1165
1164
|
{
|
|
1166
1165
|
field: "account",
|
|
1167
|
-
headerName:
|
|
1166
|
+
headerName: d.table_column_account,
|
|
1168
1167
|
renderHeader: z,
|
|
1169
|
-
renderCell:
|
|
1168
|
+
renderCell: kt,
|
|
1170
1169
|
sortable: !1,
|
|
1171
1170
|
type: "custom",
|
|
1172
1171
|
align: "left",
|
|
1173
1172
|
headerAlign: "left",
|
|
1174
|
-
minWidth:
|
|
1173
|
+
minWidth: c ? 180 : 225,
|
|
1175
1174
|
flex: 1
|
|
1176
1175
|
},
|
|
1177
1176
|
{
|
|
1178
1177
|
field: "balance",
|
|
1179
|
-
headerName:
|
|
1178
|
+
headerName: d.table_column_balance,
|
|
1180
1179
|
renderHeader: z,
|
|
1181
|
-
renderCell: (
|
|
1180
|
+
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: k(y.value, "0,0") }),
|
|
1182
1181
|
sortable: !0,
|
|
1183
|
-
hideSortIcons:
|
|
1182
|
+
hideSortIcons: c,
|
|
1184
1183
|
type: "number",
|
|
1185
|
-
align:
|
|
1186
|
-
headerAlign:
|
|
1187
|
-
minWidth:
|
|
1188
|
-
flex:
|
|
1184
|
+
align: c ? "right" : "left",
|
|
1185
|
+
headerAlign: c ? "right" : "left",
|
|
1186
|
+
minWidth: c ? 70 : 122,
|
|
1187
|
+
flex: c ? 0.4 : 0.6
|
|
1189
1188
|
},
|
|
1190
1189
|
{
|
|
1191
1190
|
field: "interest_rate",
|
|
1192
|
-
headerName:
|
|
1191
|
+
headerName: d.table_column_interest_rate,
|
|
1193
1192
|
renderHeader: z,
|
|
1194
|
-
renderCell: (
|
|
1193
|
+
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: isNaN(y.value) ? "---" : `${Number(y.value).toFixed(2)}%` }),
|
|
1195
1194
|
sortable: !0,
|
|
1196
|
-
hideSortIcons:
|
|
1195
|
+
hideSortIcons: c,
|
|
1197
1196
|
type: "number",
|
|
1198
1197
|
align: "left",
|
|
1199
1198
|
headerAlign: "left",
|
|
@@ -1202,11 +1201,11 @@ const Bt = (a) => {
|
|
|
1202
1201
|
},
|
|
1203
1202
|
{
|
|
1204
1203
|
field: "projected_payoff_date",
|
|
1205
|
-
headerName:
|
|
1204
|
+
headerName: d.table_column_payoff_date,
|
|
1206
1205
|
renderHeader: z,
|
|
1207
|
-
renderCell: (
|
|
1206
|
+
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: y.value ? K(y.value, U.MONTH_SHORT_YEAR) : "---" }),
|
|
1208
1207
|
sortable: !0,
|
|
1209
|
-
hideSortIcons:
|
|
1208
|
+
hideSortIcons: c,
|
|
1210
1209
|
type: "number",
|
|
1211
1210
|
align: "left",
|
|
1212
1211
|
headerAlign: "left",
|
|
@@ -1215,11 +1214,11 @@ const Bt = (a) => {
|
|
|
1215
1214
|
},
|
|
1216
1215
|
{
|
|
1217
1216
|
field: "monthly_payment",
|
|
1218
|
-
headerName:
|
|
1217
|
+
headerName: d.table_column_amount_due,
|
|
1219
1218
|
renderHeader: z,
|
|
1220
|
-
renderCell: (
|
|
1219
|
+
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: typeof y.value == "number" ? k(y.value, "0,0") : "---" }),
|
|
1221
1220
|
sortable: !0,
|
|
1222
|
-
hideSortIcons:
|
|
1221
|
+
hideSortIcons: c,
|
|
1223
1222
|
type: "number",
|
|
1224
1223
|
align: "left",
|
|
1225
1224
|
headerAlign: "left",
|
|
@@ -1240,14 +1239,18 @@ const Bt = (a) => {
|
|
|
1240
1239
|
headerAlign: "right",
|
|
1241
1240
|
width: 20
|
|
1242
1241
|
}
|
|
1243
|
-
],
|
|
1244
|
-
...
|
|
1245
|
-
id:
|
|
1246
|
-
priority:
|
|
1247
|
-
})), [
|
|
1248
|
-
const
|
|
1249
|
-
t?.(
|
|
1250
|
-
},
|
|
1242
|
+
], v = x.useMemo(() => o.map((y, N) => ({
|
|
1243
|
+
...y,
|
|
1244
|
+
id: N,
|
|
1245
|
+
priority: Bt(y)
|
|
1246
|
+
})), [o]), M = (y) => {
|
|
1247
|
+
const g = y.target.closest("[data-id]")?.getAttribute("data-id"), A = o[Number(g)];
|
|
1248
|
+
t?.(A?.guid ?? "");
|
|
1249
|
+
}, I = (y) => {
|
|
1250
|
+
c || M(y);
|
|
1251
|
+
}, C = (y) => {
|
|
1252
|
+
c && M(y);
|
|
1253
|
+
}, B = (y) => v.find((N) => N.guid === y)?.id;
|
|
1251
1254
|
return /* @__PURE__ */ e(
|
|
1252
1255
|
re,
|
|
1253
1256
|
{
|
|
@@ -1262,29 +1265,31 @@ const Bt = (a) => {
|
|
|
1262
1265
|
children: /* @__PURE__ */ e(
|
|
1263
1266
|
Ye,
|
|
1264
1267
|
{
|
|
1265
|
-
columns:
|
|
1268
|
+
columns: c ? u : f,
|
|
1266
1269
|
disableColumnFilter: !0,
|
|
1267
1270
|
disableColumnMenu: !0,
|
|
1268
1271
|
hideFooter: !0,
|
|
1269
1272
|
initialState: { sorting: { sortModel: m } },
|
|
1270
|
-
onRowClick: (
|
|
1271
|
-
|
|
1273
|
+
onRowClick: (y) => {
|
|
1274
|
+
n(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: y.row.guid });
|
|
1272
1275
|
},
|
|
1273
|
-
onSortModelChange: (
|
|
1274
|
-
b(
|
|
1276
|
+
onSortModelChange: (y) => {
|
|
1277
|
+
b(y), p(T.DEBTS_CLICK_TABLE_SORT);
|
|
1275
1278
|
},
|
|
1276
|
-
rows:
|
|
1279
|
+
rows: v,
|
|
1277
1280
|
slotProps: {
|
|
1278
1281
|
baseIconButton: { color: "secondary", sx: { ml: 8 } },
|
|
1279
1282
|
row: {
|
|
1280
|
-
onMouseEnter:
|
|
1281
|
-
onMouseLeave: () => t?.("")
|
|
1283
|
+
onMouseEnter: I,
|
|
1284
|
+
onMouseLeave: () => !c && t?.(""),
|
|
1285
|
+
onTouchStart: C,
|
|
1286
|
+
onClick: c ? C : void 0
|
|
1282
1287
|
}
|
|
1283
1288
|
},
|
|
1284
1289
|
sortModel: m,
|
|
1285
1290
|
sortingOrder: ["asc", "desc"],
|
|
1286
1291
|
sx: {
|
|
1287
|
-
[`& .MuiDataGrid-row[data-id="${
|
|
1292
|
+
[`& .MuiDataGrid-row[data-id="${B(r)}"]`]: {
|
|
1288
1293
|
backgroundColor: i.palette.mode === "light" ? "#f8f9fb" : "#1f2329",
|
|
1289
1294
|
filter: "brightness(98%)"
|
|
1290
1295
|
}
|
|
@@ -1293,9 +1298,9 @@ const Bt = (a) => {
|
|
|
1293
1298
|
)
|
|
1294
1299
|
}
|
|
1295
1300
|
);
|
|
1296
|
-
},
|
|
1297
|
-
const { isDesktop: t, isTablet:
|
|
1298
|
-
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(
|
|
1299
1304
|
fe,
|
|
1300
1305
|
{
|
|
1301
1306
|
"aria-controls": "prioritize-debts",
|
|
@@ -1318,25 +1323,25 @@ const Bt = (a) => {
|
|
|
1318
1323
|
children: /* @__PURE__ */ e(ee, { name: i })
|
|
1319
1324
|
}
|
|
1320
1325
|
);
|
|
1321
|
-
},
|
|
1322
|
-
const { onEvent: r } =
|
|
1326
|
+
}, Rt = D(({ buttonEl: a, onClose: o }) => {
|
|
1327
|
+
const { onEvent: r } = F(), { debts: t } = S(), { selectedDebtPriority: n, setSelectedDebtPriority: i } = $(), p = !!a, c = [
|
|
1323
1328
|
{
|
|
1324
|
-
priority:
|
|
1329
|
+
priority: P.FASTEST_PAYOFF_FIRST,
|
|
1325
1330
|
text: t.priority_sort_fastest_payoff
|
|
1326
1331
|
},
|
|
1327
1332
|
{
|
|
1328
|
-
priority:
|
|
1333
|
+
priority: P.HIGHEST_INTEREST,
|
|
1329
1334
|
text: t.priority_sort_highest_interest
|
|
1330
1335
|
},
|
|
1331
1336
|
{
|
|
1332
|
-
priority:
|
|
1337
|
+
priority: P.LOWEST_BALANCE,
|
|
1333
1338
|
text: t.priority_sort_lowest_balance
|
|
1334
1339
|
},
|
|
1335
1340
|
{
|
|
1336
|
-
priority:
|
|
1341
|
+
priority: P.HIGHEST_BALANCE,
|
|
1337
1342
|
text: t.priority_sort_highest_balance
|
|
1338
1343
|
}
|
|
1339
|
-
],
|
|
1344
|
+
], d = (m) => {
|
|
1340
1345
|
i(m), r(T.DEBTS_CLICK_PRIORITY, { debts_priority: m });
|
|
1341
1346
|
};
|
|
1342
1347
|
return /* @__PURE__ */ e(
|
|
@@ -1348,19 +1353,19 @@ const Bt = (a) => {
|
|
|
1348
1353
|
horizontal: "left"
|
|
1349
1354
|
},
|
|
1350
1355
|
id: "prioritize-debts",
|
|
1351
|
-
onClose:
|
|
1356
|
+
onClose: o,
|
|
1352
1357
|
open: p,
|
|
1353
1358
|
transformOrigin: {
|
|
1354
1359
|
vertical: "top",
|
|
1355
1360
|
horizontal: "left"
|
|
1356
1361
|
},
|
|
1357
|
-
children: /* @__PURE__ */ e(_e, { children:
|
|
1362
|
+
children: /* @__PURE__ */ e(_e, { children: c.map(({ priority: m, text: b }) => /* @__PURE__ */ s(
|
|
1358
1363
|
qe,
|
|
1359
1364
|
{
|
|
1360
|
-
onClick: () =>
|
|
1365
|
+
onClick: () => d(m),
|
|
1361
1366
|
sx: {
|
|
1362
|
-
bgcolor:
|
|
1363
|
-
color:
|
|
1367
|
+
bgcolor: n === m ? "primary.main" : void 0,
|
|
1368
|
+
color: n === m ? "#fff" : void 0,
|
|
1364
1369
|
justifyContent: "space-between",
|
|
1365
1370
|
minHeight: 44,
|
|
1366
1371
|
minWidth: 268,
|
|
@@ -1374,67 +1379,67 @@ const Bt = (a) => {
|
|
|
1374
1379
|
},
|
|
1375
1380
|
children: [
|
|
1376
1381
|
/* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: b }),
|
|
1377
|
-
|
|
1382
|
+
n === m && /* @__PURE__ */ e(ye, { color: "inherit", filled: !0, fontSize: "small" })
|
|
1378
1383
|
]
|
|
1379
1384
|
},
|
|
1380
1385
|
m
|
|
1381
1386
|
)) })
|
|
1382
1387
|
}
|
|
1383
1388
|
);
|
|
1384
|
-
}),
|
|
1385
|
-
const { onEvent: a } =
|
|
1386
|
-
|
|
1389
|
+
}), Lt = D(() => {
|
|
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);
|
|
1387
1392
|
}, p = () => {
|
|
1388
|
-
|
|
1389
|
-
},
|
|
1390
|
-
[
|
|
1391
|
-
[
|
|
1392
|
-
[
|
|
1393
|
-
[
|
|
1394
|
-
})[r] ??
|
|
1395
|
-
return /* @__PURE__ */ s(
|
|
1396
|
-
/* @__PURE__ */ e(
|
|
1397
|
-
/* @__PURE__ */ e(
|
|
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]);
|
|
1400
|
+
return /* @__PURE__ */ s(_, { children: [
|
|
1401
|
+
/* @__PURE__ */ e(Ft, { buttonText: d, isOpen: c, onClick: i }),
|
|
1402
|
+
/* @__PURE__ */ e(Rt, { buttonEl: t, onClose: p })
|
|
1398
1403
|
] });
|
|
1399
|
-
}),
|
|
1400
|
-
const t = a.map((
|
|
1401
|
-
|
|
1402
|
-
const
|
|
1403
|
-
let p = 0,
|
|
1404
|
-
for (const
|
|
1404
|
+
}), $t = (a, o, r = 0) => {
|
|
1405
|
+
const t = a.map((d) => ({ ...d }));
|
|
1406
|
+
ge(t, o);
|
|
1407
|
+
const n = /* @__PURE__ */ new Date(), i = [];
|
|
1408
|
+
let p = 0, c = 1;
|
|
1409
|
+
for (const d of t)
|
|
1405
1410
|
i.push({
|
|
1406
|
-
...
|
|
1411
|
+
...d,
|
|
1407
1412
|
// Start with the initial balance
|
|
1408
|
-
dataset: [{ x: new Date(
|
|
1413
|
+
dataset: [{ x: new Date(n), y: d.balance }]
|
|
1409
1414
|
});
|
|
1410
|
-
for (; t.some((
|
|
1411
|
-
let
|
|
1415
|
+
for (; t.some((d) => d.balance >= 0.01 && !d.is_impossible); ) {
|
|
1416
|
+
let d = !1, m = !1, b = !1;
|
|
1412
1417
|
for (const [f, u] of t.entries()) {
|
|
1413
1418
|
if (u.balance <= 0.01) continue;
|
|
1414
|
-
const
|
|
1415
|
-
let
|
|
1416
|
-
!b && r > 0 && (
|
|
1417
|
-
const h = Math.min(u.balance,
|
|
1418
|
-
if (h <=
|
|
1419
|
-
u.is_impossible = !0, i[f].is_impossible = !0, i[f].priority = void 0,
|
|
1419
|
+
const v = i[f].dataset, I = (u.interest_rate ?? 0) / 100 / 12, C = u.balance * I, B = u.monthly_payment ?? 0;
|
|
1420
|
+
let y = B, N = 0;
|
|
1421
|
+
!b && r > 0 && (y += r, b = !0), !m && p > 0 && (N = p, m = !0), u.balance += C;
|
|
1422
|
+
const h = Math.min(u.balance, y + N);
|
|
1423
|
+
if (h <= C) {
|
|
1424
|
+
u.is_impossible = !0, i[f].is_impossible = !0, i[f].priority = void 0, v.push({ x: new Date(n), y: u.balance });
|
|
1420
1425
|
continue;
|
|
1421
1426
|
}
|
|
1422
|
-
u.balance -= h, u.balance = u.balance < 0.01 ? 0 : u.balance,
|
|
1423
|
-
x: new Date(
|
|
1427
|
+
u.balance -= h, u.balance = u.balance < 0.01 ? 0 : u.balance, v.push({
|
|
1428
|
+
x: new Date(n),
|
|
1424
1429
|
y: Math.max(0, u.balance),
|
|
1425
1430
|
payment: h,
|
|
1426
|
-
extra:
|
|
1427
|
-
}), u.balance <= 0 && (p +=
|
|
1431
|
+
extra: N
|
|
1432
|
+
}), u.balance <= 0 && (p += B, i[f].projected_payoff_date = new Date(n)), h > 0 && (d = !0);
|
|
1428
1433
|
}
|
|
1429
|
-
|
|
1434
|
+
d && n.setMonth(n.getMonth() + 1);
|
|
1430
1435
|
}
|
|
1431
|
-
return i.forEach((
|
|
1432
|
-
(
|
|
1433
|
-
}), i.forEach((
|
|
1434
|
-
|
|
1436
|
+
return i.forEach((d) => {
|
|
1437
|
+
(d.interest_rate === void 0 || d.monthly_payment === void 0) && (d.projected_payoff_date = void 0);
|
|
1438
|
+
}), i.forEach((d) => {
|
|
1439
|
+
d.priority = !d.is_paid_off && !d.is_impossible ? c++ : void 0;
|
|
1435
1440
|
}), i;
|
|
1436
|
-
},
|
|
1437
|
-
const { debts:
|
|
1441
|
+
}, Ht = D(({ onClick: a }) => {
|
|
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;
|
|
1438
1443
|
return /* @__PURE__ */ e(
|
|
1439
1444
|
fe,
|
|
1440
1445
|
{
|
|
@@ -1444,45 +1449,50 @@ const Bt = (a) => {
|
|
|
1444
1449
|
"aria-label": "extra-paydown",
|
|
1445
1450
|
onClick: a,
|
|
1446
1451
|
sx: { justifyContent: "start", minWidth: 100, mx: 4 },
|
|
1447
|
-
children:
|
|
1452
|
+
children: E(p, k(i, "0,0"))
|
|
1448
1453
|
}
|
|
1449
1454
|
);
|
|
1450
|
-
}),
|
|
1451
|
-
const [r, t] = x.useState(!1), [
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
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();
|
|
1457
|
+
Je({
|
|
1458
|
+
widgetName: "DebtsWidget",
|
|
1459
|
+
isLoaded: g
|
|
1460
|
+
});
|
|
1461
|
+
const O = x.useMemo(() => {
|
|
1462
|
+
const W = R?.extra_payment ?? 0;
|
|
1463
|
+
return $t(L, y, W);
|
|
1464
|
+
}, [L, y, R]);
|
|
1455
1465
|
x.useEffect(() => {
|
|
1456
|
-
|
|
1466
|
+
C(h), v(T.DEBTS_VIEW);
|
|
1457
1467
|
}, []), x.useEffect(() => {
|
|
1458
|
-
|
|
1468
|
+
C(h);
|
|
1459
1469
|
}, [h]), x.useEffect(() => {
|
|
1460
|
-
|
|
1461
|
-
}, [
|
|
1462
|
-
const
|
|
1463
|
-
const W = h.find((Q) => Q.guid ===
|
|
1464
|
-
W &&
|
|
1465
|
-
}, we = () =>
|
|
1466
|
-
|
|
1470
|
+
I && A().finally();
|
|
1471
|
+
}, [I]);
|
|
1472
|
+
const oe = (W) => m(W), ne = () => {
|
|
1473
|
+
const W = h.find((Q) => Q.guid === d), ie = O.find((Q) => Q.guid === d);
|
|
1474
|
+
W && B(W), ie && N(ie), t(!0);
|
|
1475
|
+
}, we = () => v(T.DEBTS_CLICK_FILTER), Ce = () => {
|
|
1476
|
+
c(!0), v(T.DEBTS_CLICK_SNOWBALL_CTA);
|
|
1467
1477
|
}, Se = () => {
|
|
1468
|
-
i(!0),
|
|
1478
|
+
i(!0), v(T.DEBTS_CLICK_PAYDOWN);
|
|
1469
1479
|
};
|
|
1470
|
-
return !
|
|
1480
|
+
return !g || !M || !I ? /* @__PURE__ */ e(Qe, {}) : /* @__PURE__ */ s(
|
|
1471
1481
|
Oe,
|
|
1472
1482
|
{
|
|
1473
1483
|
accountOptions: h,
|
|
1474
1484
|
actions: [
|
|
1475
|
-
/* @__PURE__ */ e(
|
|
1476
|
-
/* @__PURE__ */ e(
|
|
1485
|
+
/* @__PURE__ */ e(Lt, {}, "prioritize-debts"),
|
|
1486
|
+
/* @__PURE__ */ e(Ht, { onClick: Se }, "extra-paydown")
|
|
1477
1487
|
],
|
|
1478
1488
|
onAccountsFilterClick: we,
|
|
1479
1489
|
onBackClick: a,
|
|
1480
|
-
sx:
|
|
1490
|
+
sx: o,
|
|
1481
1491
|
title: u.title,
|
|
1482
1492
|
children: [
|
|
1483
|
-
/* @__PURE__ */ s(
|
|
1493
|
+
/* @__PURE__ */ s(w, { sx: { px: b ? "48px" : "24px" }, children: [
|
|
1484
1494
|
/* @__PURE__ */ s(
|
|
1485
|
-
|
|
1495
|
+
w,
|
|
1486
1496
|
{
|
|
1487
1497
|
sx: {
|
|
1488
1498
|
alignItems: f ? "flex-start" : "flex-end",
|
|
@@ -1491,18 +1501,18 @@ const Bt = (a) => {
|
|
|
1491
1501
|
},
|
|
1492
1502
|
children: [
|
|
1493
1503
|
/* @__PURE__ */ e(
|
|
1494
|
-
|
|
1504
|
+
xe,
|
|
1495
1505
|
{
|
|
1496
1506
|
debts: O,
|
|
1497
1507
|
height: f ? 250 : void 0,
|
|
1498
|
-
hoveredDebtGuid:
|
|
1499
|
-
onClickArea:
|
|
1500
|
-
onHoverArea:
|
|
1508
|
+
hoveredDebtGuid: d,
|
|
1509
|
+
onClickArea: ne,
|
|
1510
|
+
onHoverArea: oe,
|
|
1501
1511
|
sx: { mr: f ? "4px" : "-48px" }
|
|
1502
1512
|
}
|
|
1503
1513
|
),
|
|
1504
1514
|
/* @__PURE__ */ e(
|
|
1505
|
-
|
|
1515
|
+
it,
|
|
1506
1516
|
{
|
|
1507
1517
|
debts: O,
|
|
1508
1518
|
onClickCta: Ce,
|
|
@@ -1512,32 +1522,32 @@ const Bt = (a) => {
|
|
|
1512
1522
|
]
|
|
1513
1523
|
}
|
|
1514
1524
|
),
|
|
1515
|
-
/* @__PURE__ */ e(
|
|
1516
|
-
|
|
1525
|
+
/* @__PURE__ */ e(w, { sx: { mx: f ? "-24px" : 0 }, children: /* @__PURE__ */ e(
|
|
1526
|
+
Nt,
|
|
1517
1527
|
{
|
|
1518
1528
|
debts: O,
|
|
1519
|
-
hoveredDebtGuid:
|
|
1520
|
-
onClickRow:
|
|
1521
|
-
onHoverRow:
|
|
1529
|
+
hoveredDebtGuid: d,
|
|
1530
|
+
onClickRow: ne,
|
|
1531
|
+
onHoverRow: oe
|
|
1522
1532
|
}
|
|
1523
1533
|
) })
|
|
1524
1534
|
] }),
|
|
1525
1535
|
/* @__PURE__ */ e(
|
|
1526
|
-
|
|
1536
|
+
st,
|
|
1527
1537
|
{
|
|
1528
1538
|
isOpen: p,
|
|
1529
|
-
onClose: () =>
|
|
1539
|
+
onClose: () => c(!1)
|
|
1530
1540
|
}
|
|
1531
1541
|
),
|
|
1532
|
-
/* @__PURE__ */ e(
|
|
1533
|
-
/* @__PURE__ */ e(
|
|
1542
|
+
/* @__PURE__ */ e(vt, { isOpen: r, onClose: () => t(!1) }),
|
|
1543
|
+
/* @__PURE__ */ e(Et, { isOpen: n, onClose: () => i(!1) })
|
|
1534
1544
|
]
|
|
1535
1545
|
}
|
|
1536
1546
|
);
|
|
1537
|
-
},
|
|
1547
|
+
}, Nr = D(Ot);
|
|
1538
1548
|
export {
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1549
|
+
xe as DebtsChart,
|
|
1550
|
+
Lr as DebtsStore,
|
|
1551
|
+
Nt as DebtsTable,
|
|
1552
|
+
Nr as DebtsWidget
|
|
1543
1553
|
};
|