@mx-cartographer/experiences 7.1.4-ram1-alpha-finstrong-credit-score-graph-check → 7.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{Account-CpRTVIHg.mjs → Account-8IUM_CLv.mjs} +1 -1
  3. package/dist/{AccountDetailsContent-6aPMU6Hp.mjs → AccountDetailsContent-CuZSSAEc.mjs} +10 -10
  4. package/dist/{AccountDetailsHeader-BkUZYoV8.mjs → AccountDetailsHeader-BZBsIKdF.mjs} +8 -8
  5. package/dist/{AccountFields-DOLjKu5l.mjs → AccountFields-BD_0GT68.mjs} +5 -5
  6. package/dist/{AccountListItem-CTT5m4qx.mjs → AccountListItem-CllIBCao.mjs} +4 -4
  7. package/dist/{AccountStore-DTfpr3h0.mjs → AccountStore-BL0FE1QL.mjs} +15 -26
  8. package/dist/{Accounts-D0BmvNxn.mjs → Accounts-Bvc9TJaO.mjs} +1 -1
  9. package/dist/{BudgetUtil-D2Jcp-E-.mjs → BudgetUtil-psfk-Amb.mjs} +1 -1
  10. package/dist/{CategorySelectorDrawer-DomNyubP.mjs → CategorySelectorDrawer-BmenK5bu.mjs} +3 -3
  11. package/dist/{CategoryStore-C1IfDPCE.mjs → CategoryStore-BCcpI3oJ.mjs} +1 -1
  12. package/dist/{CategoryUtil-DUM8NuGO.mjs → CategoryUtil-BR3H5i6n.mjs} +1 -1
  13. package/dist/{ConnectDrawer--gJHyp-S.mjs → ConnectDrawer-CPTXh70j.mjs} +2 -2
  14. package/dist/{ConnectionsDrawer-DabiwV9L.mjs → ConnectionsDrawer-Dkb4vBmt.mjs} +3 -3
  15. package/dist/{CurrencyInput-CC5cwVit.mjs → CurrencyInput-C4xNRL2W.mjs} +1 -1
  16. package/dist/{DateUtil-CBdcsyuk.mjs → DateUtil-BcuH7ErC.mjs} +3 -3
  17. package/dist/{DebtsStore-9aR2sTJQ.mjs → DebtsStore-D4grpB4m.mjs} +1 -1
  18. package/dist/{Dialog-BPTr3qHE.mjs → Dialog-CWW597AF.mjs} +2 -2
  19. package/dist/Drawer-kEE73B87.mjs +113 -0
  20. package/dist/{ExportCsvAction-Um-CDa4C.mjs → ExportCsvAction-CBJAfyAw.mjs} +3 -3
  21. package/dist/FinstrongStore-F2c607dj.mjs +101 -0
  22. package/dist/{GoalStore-CiBKZvTg.mjs → GoalStore-B5MZzPLZ.mjs} +3 -3
  23. package/dist/{Help-BZ8pIkkR.mjs → Help-CzBAsKA2.mjs} +2 -2
  24. package/dist/LineChart-B35qvXik.mjs +541 -0
  25. package/dist/{ListItemAction-DGaxy7oz.mjs → ListItemAction-DSrYDGAP.mjs} +10 -10
  26. package/dist/{ManageIncome-BaNgfwr5.mjs → ManageIncome-DUuT-yMV.mjs} +32 -34
  27. package/dist/{MicroWidgetContainer-C3iV1FBR.mjs → MicroWidgetContainer-C4QQHfD7.mjs} +1 -1
  28. package/dist/{MiniWidgetContainer-LtXXgZ6H.mjs → MiniWidgetContainer-DTQdRK-3.mjs} +1 -1
  29. package/dist/{NetWorthStore-MnpP5KEc.mjs → NetWorthStore-Do1Gk8Te.mjs} +2 -2
  30. package/dist/{NotificationSettings-Ckx8tgQj.mjs → NotificationSettings-BuShgjn6.mjs} +5 -5
  31. package/dist/{OriginalBalanceAction-CGZDUsCc.mjs → OriginalBalanceAction-BsxcvNEF.mjs} +3 -3
  32. package/dist/{RecurringSettings-DE4T4yQy.mjs → RecurringSettings-BVOt46uV.mjs} +4 -4
  33. package/dist/{RecurringTransactions-CngsRZ3K.mjs → RecurringTransactions-ej39mgA6.mjs} +44 -45
  34. package/dist/{RecurringTransactionsStore-C4RVULF8.mjs → RecurringTransactionsStore-DrzS1LmF.mjs} +1 -1
  35. package/dist/{SpendingData-BuJ03S9d.mjs → SpendingData-D5vsfYKo.mjs} +16 -16
  36. package/dist/{TransactionDetails-DRlrltGq.mjs → TransactionDetails-_cXLXTd3.mjs} +8 -11
  37. package/dist/{TransactionStore-D8MKYDMb.mjs → TransactionStore-B-Tq_YFE.mjs} +3 -3
  38. package/dist/{TrendsStore-DL3Vuh71.mjs → TrendsStore-ZZ8X36lJ.mjs} +14 -14
  39. package/dist/{User-BthIKO4w.mjs → User-DaJAQ09j.mjs} +2 -2
  40. package/dist/{ViewMoreMicroCard-DTtQNV3D.mjs → ViewMoreMicroCard-664i7l19.mjs} +487 -533
  41. package/dist/{WidgetContainer-DJA1bxLn.mjs → WidgetContainer-DtPnPQZY.mjs} +4 -4
  42. package/dist/accounts/index.es.js +14 -14
  43. package/dist/accounts/stores/AccountStore.d.ts +0 -2
  44. package/dist/analytics/index.es.js +2 -2
  45. package/dist/budgets/index.es.js +12 -12
  46. package/dist/cashflow/index.es.js +11 -11
  47. package/dist/categories/index.es.js +2 -2
  48. package/dist/common/components/Select.d.ts +2 -4
  49. package/dist/common/components/charts/LineChart.d.ts +0 -2
  50. package/dist/common/components/charts/linechart/CustomMark.d.ts +0 -2
  51. package/dist/common/components/drawer/Drawer.d.ts +0 -3
  52. package/dist/common/index.es.js +33 -33
  53. package/dist/common/types/Finstrong.d.ts +0 -50
  54. package/dist/common/types/index.d.ts +1 -1
  55. package/dist/common/types/localization/FinstrongCopy.d.ts +1 -57
  56. package/dist/dashboard/index.es.js +2 -2
  57. package/dist/debts/index.es.js +11 -11
  58. package/dist/{exportTransactionsToCSV-XqdHNe2V.mjs → exportTransactionsToCSV-D8TTNrrE.mjs} +2 -2
  59. package/dist/finstrong/api/FinstrongApi.d.ts +0 -5
  60. package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +1 -2
  61. package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
  62. package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +1 -1
  63. package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
  64. package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
  65. package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +3 -4
  66. package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
  67. package/dist/finstrong/index.es.js +1010 -2892
  68. package/dist/finstrong/stores/FinstrongStore.d.ts +1 -9
  69. package/dist/finstrong/util/finstrongUtils.d.ts +1 -65
  70. package/dist/finstrong/utils/Finstrong.d.ts +6 -0
  71. package/dist/goals/index.es.js +14 -14
  72. package/dist/help/index.es.js +3 -3
  73. package/dist/{hooks-CBST3rkm.mjs → hooks-CE2TKk4a.mjs} +3 -3
  74. package/dist/investments/index.es.js +4 -4
  75. package/dist/merchants/index.es.js +1 -1
  76. package/dist/microinsights/components/beaticons/BeatIcon.d.ts +0 -2
  77. package/dist/microinsights/components/carouselheader/CarouselHeader.d.ts +1 -2
  78. package/dist/microinsights/components/microBeatCarousel/CarouselControls.d.ts +0 -2
  79. package/dist/microinsights/index.d.ts +1 -1
  80. package/dist/microinsights/index.es.js +1 -1
  81. package/dist/microinsights/interfaces.d.ts +0 -4
  82. package/dist/networth/index.es.js +34 -34
  83. package/dist/notifications/index.es.js +4 -4
  84. package/dist/recurringtransactions/index.es.js +13 -13
  85. package/dist/settings/index.es.js +8 -8
  86. package/dist/spending/index.es.js +373 -222
  87. package/dist/transactions/index.es.js +15 -15
  88. package/dist/trends/index.es.js +16 -16
  89. package/dist/{useAccountDisplayName-DH1CuQ9R.mjs → useAccountDisplayName-BXGkZN5B.mjs} +2 -2
  90. package/dist/{useInsightsEnabled-jdvS1ppf.mjs → useInsightsEnabled-DSnpkUq0.mjs} +1 -1
  91. package/package.json +1 -1
  92. package/dist/Drawer-BEtCk82g.mjs +0 -163
  93. package/dist/FinstrongStore-CC4SrBjA.mjs +0 -436
  94. package/dist/LineChart-CE3oLBQ0.mjs +0 -566
  95. package/dist/SpendingLegend-D24CEkL3.mjs +0 -170
  96. package/dist/accounts/components/AccountsListCompact.d.ts +0 -10
  97. package/dist/common/components/drawer/Footer.d.ts +0 -17
  98. package/dist/finstrong/components/CreditOverTimeGraph.d.ts +0 -1
  99. package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +0 -4
  100. package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +0 -4
  101. package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +0 -3
  102. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +0 -3
  103. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +0 -4
  104. package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +0 -3
  105. package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +0 -10
  106. package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +0 -6
  107. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +0 -4
  108. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +0 -4
  109. package/dist/finstrong/components/ProgressBar.d.ts +0 -15
  110. package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +0 -3
  111. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +0 -3
  112. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +0 -4
  113. package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +0 -3
  114. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +0 -3
  115. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +0 -4
  116. package/dist/finstrong/components/StatusChip.d.ts +0 -5
  117. package/dist/finstrong/components/onboarding/Onboarding.d.ts +0 -2
  118. package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +0 -11
  119. package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +0 -8
  120. package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +0 -8
  121. package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +0 -14
  122. package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +0 -8
  123. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +0 -4
  124. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +0 -4
  125. package/dist/finstrong/components/shared/Accounts.d.ts +0 -8
  126. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +0 -25
  127. package/dist/finstrong/components/shared/DoubleBarChart.d.ts +0 -28
  128. package/dist/finstrong/components/shared/LineGraph.d.ts +0 -7
  129. package/dist/finstrong/components/shared/TotalCard.d.ts +0 -8
  130. package/dist/finstrong/components/shared/TransactionList.d.ts +0 -15
  131. package/dist/finstrong/components/shared/Transactions.d.ts +0 -11
  132. package/dist/finstrong/constants/index.d.ts +0 -8
@@ -1,172 +1,280 @@
1
- import { jsxs as i, Fragment as E, jsx as e } from "react/jsx-runtime";
2
- import A from "@mui/material/Box";
3
- import u from "@mui/material/Stack";
4
- import { useTheme as H, alpha as pe } from "@mui/material/styles";
5
- import { PieChart as jt, BarPlot as Vt } from "@mui/x-charts";
6
- import { TrendingUp as st, ArrowRightAlt as Yt, TrendingDown as Xt, AccountBalance as ct, ChevronRight as Z, MultilineChart as lt, CreditCard as Le, CheckCircle as Ut, Cancel as qt, Savings as Zt, ContentCopy as Qt, Add as dt, Cardiology as Jt, Payments as en, CalendarMonth as tn, ExpandMore as nn } from "@mxenabled/mx-icons";
7
- import { P as w, H3 as Y, Text as T, InstitutionLogo as pt, H2 as Ae, MerchantLogo as on, Icon as rn } from "@mxenabled/mxui";
8
- import { g as an, a as sn, r as Ue, b as cn, c as We, d as ut, C as ge, e as ye, f as ln, h as dn, i as pn, j as ht, k as qe, l as un, m as Ze, n as hn, o as _t, p as _n, q as mt, s as ve, t as mn, u as gn, v as yn, w as bn, A as J, x as fn, P as xn } from "../FinstrongStore-CC4SrBjA.mjs";
9
- import { y as _i, F as mi } from "../FinstrongStore-CC4SrBjA.mjs";
10
- import * as Qe from "d3";
11
- import { observer as S } from "mobx-react-lite";
12
- import { u as C, b as X, o as Q, y as P, p as Sn, a as gt, d as fe, m as Ee, g as Cn, f as vn, j as kn, h as wn, i as yt } from "../hooks-CBST3rkm.mjs";
13
- import { L as te } from "../Loader-DUaFpDGv.mjs";
14
- import _ from "react";
15
- import L from "@mui/material/Button";
16
- import K from "@mui/material/Card";
17
- import { L as ze } from "../LineChart-CE3oLBQ0.mjs";
18
- import { l as ne, g as bt, A as Fe } from "../ConnectDrawer--gJHyp-S.mjs";
19
- import re from "@mui/material/Tab";
20
- import Ge from "@mui/material/Tabs";
21
- import ke from "@mui/material/TextField";
22
- import { u as He } from "../useScreenSize-B6JyS_Lj.mjs";
23
- import { D as An, f as Mn, a as In } from "../Dialog-BPTr3qHE.mjs";
24
- import { u as ft } from "../useDimensions-27p2evRx.mjs";
25
- import Dn from "@mui/material/Chip";
26
- import { D as ie } from "../Drawer-BEtCk82g.mjs";
27
- import ee from "@mui/material/Divider";
28
- import xt from "@mui/material/ListItem";
29
- import St from "@mui/material/ListItemAvatar";
30
- import Ct from "@mui/material/ListItemText";
31
- import { g as vt } from "../AccountFields-DOLjKu5l.mjs";
32
- import kt from "@mui/material/List";
33
- import Tn from "@mui/material/ListItemButton";
34
- import On from "@mui/material/ListSubheader";
35
- import { f as F } from "../NumberFormatting-Buh7u8Oi.mjs";
36
- import { S as Je, F as Pn } from "../RecurringTransactions-CngsRZ3K.mjs";
37
- import { Button as Bn } from "@mui/material";
38
- import { S as Rn } from "../StatusBar-BK_uYHAB.mjs";
39
- import { h as Ne } from "../DateUtil-CBdcsyuk.mjs";
40
- import { useVirtualizer as Fn } from "@tanstack/react-virtual";
41
- import { u as $n, s as $e, h as wt, S as At, b as Mt, Z as Ln } from "../TransactionDetails-DRlrltGq.mjs";
42
- import { A as Wn, W as En } from "../WidgetContainer-DJA1bxLn.mjs";
43
- import { T as ae } from "../TabContentContainer-j01JYR_7.mjs";
44
- import { b as V } from "../Localization-2MODESHW.mjs";
45
- import { E as we } from "../EmptyState-DA_lfRBv.mjs";
46
- import zn from "@mui/material/useMediaQuery";
47
- import { ChartsXAxis as Gn } from "@mui/x-charts/ChartsXAxis";
48
- import { ChartsYAxis as Hn } from "@mui/x-charts/ChartsYAxis";
49
- import { ResponsiveChartContainer as Nn } from "@mui/x-charts/ResponsiveChartContainer";
50
- import { useSpring as Kn, animated as et } from "@react-spring/web";
51
- import { startOfMonth as It } from "date-fns/startOfMonth";
52
- import { endOfMonth as Dt } from "date-fns/endOfMonth";
53
- import { g as jn, S as Vn, b as Yn } from "../SpendingLegend-D24CEkL3.mjs";
54
- import { startOfToday as tt } from "date-fns/startOfToday";
55
- import { subDays as Xn } from "date-fns/subDays";
56
- import { c as Un, d as nt, S as qn, i as Zn } from "../ManageIncome-BaNgfwr5.mjs";
57
- import { LocalizationProvider as Qn, DatePicker as Jn, StaticDatePicker as eo } from "@mui/x-date-pickers";
58
- import { AdapterDateFns as Tt } from "@mui/x-date-pickers/AdapterDateFnsV3";
59
- import { C as to } from "../ConnectionsDrawer-DabiwV9L.mjs";
60
- import { R as no } from "../RecurringSettings-DE4T4yQy.mjs";
61
- import { LocalizationProvider as oo } from "@mui/x-date-pickers/LocalizationProvider";
62
- import { format as ro } from "date-fns/format";
63
- import ao from "@mui/lab/Timeline";
64
- import io, { timelineItemClasses as so } from "@mui/lab/TimelineItem";
65
- import co from "@mui/lab/TimelineConnector";
66
- import lo from "@mui/lab/TimelineContent";
67
- import po from "@mui/lab/TimelineDot";
68
- import uo from "@mui/lab/TimelineSeparator";
69
- import ho from "@mui/material/Accordion";
70
- import _o from "@mui/material/AccordionDetails";
71
- import mo from "@mui/material/AccordionSummary";
72
- import go from "@mui/material/CardHeader";
73
- const yo = ({
74
- dialScoreData: t,
1
+ import { jsx as e, jsxs as u, Fragment as re } from "react/jsx-runtime";
2
+ import x from "@mui/material/Box";
3
+ import g from "@mui/material/Stack";
4
+ import { useTheme as G, alpha as te } from "@mui/material/styles";
5
+ import { PieChart as Oe } from "@mui/x-charts";
6
+ import { ChevronRight as j, Check as De, TrendingUp as Me, ArrowRightAlt as Te, TrendingDown as we, AccountBalance as me, ExpandMore as Re, Payments as Fe, CalendarMonth as Pe, CreditCard as ue, Savings as Ge, ContentCopy as Le, MultilineChart as Ee } from "@mxenabled/mx-icons";
7
+ import { Text as W, P as y, H3 as H, Icon as he } from "@mxenabled/mxui";
8
+ import { format as _e } from "date-fns/format";
9
+ import C from "react";
10
+ import We from "@mui/material/Avatar";
11
+ import ge from "@mui/material/Divider";
12
+ import Be from "@mui/material/List";
13
+ import He from "@mui/material/ListItem";
14
+ import ze from "@mui/material/ListItemAvatar";
15
+ import $e from "@mui/material/ListItemButton";
16
+ import Ne from "@mui/material/ListItemText";
17
+ import { b } from "../Localization-2MODESHW.mjs";
18
+ import * as ce from "d3";
19
+ import { observer as I } from "mobx-react-lite";
20
+ import { u as S, b as z, w as $, o as Y, d as fe, i as ye, m as Ke } from "../hooks-CE2TKk4a.mjs";
21
+ import { L as N } from "../Loader-DUaFpDGv.mjs";
22
+ import { F as No, a as Ko } from "../FinstrongStore-F2c607dj.mjs";
23
+ import q from "@mui/material/Button";
24
+ import J from "@mui/material/Card";
25
+ import { L as be } from "../LineChart-B35qvXik.mjs";
26
+ import { l as xe } from "../ConnectDrawer-CPTXh70j.mjs";
27
+ import Xe from "@mui/material/Accordion";
28
+ import je from "@mui/material/AccordionDetails";
29
+ import Ue from "@mui/material/AccordionSummary";
30
+ import Ve from "@mui/material/CardHeader";
31
+ import { u as Ye } from "../useDimensions-27p2evRx.mjs";
32
+ import { C as qe } from "../ConnectionsDrawer-Dkb4vBmt.mjs";
33
+ import { R as Je } from "../RecurringSettings-BVOt46uV.mjs";
34
+ import Qe from "@mui/material/TextField";
35
+ import { u as Ce } from "../useScreenSize-B6JyS_Lj.mjs";
36
+ import { a as Ze } from "../Dialog-CWW597AF.mjs";
37
+ import { AdapterDateFns as et } from "@mui/x-date-pickers/AdapterDateFnsV3";
38
+ import { StaticDatePicker as tt } from "@mui/x-date-pickers";
39
+ import { LocalizationProvider as ot } from "@mui/x-date-pickers/LocalizationProvider";
40
+ import { D as V } from "../Drawer-kEE73B87.mjs";
41
+ import oe from "@mui/material/Tab";
42
+ import nt from "@mui/material/Tabs";
43
+ import { f as rt } from "../NumberFormatting-Buh7u8Oi.mjs";
44
+ import { T as ne } from "../TabContentContainer-j01JYR_7.mjs";
45
+ import it from "@mui/lab/Timeline";
46
+ import st, { timelineItemClasses as at } from "@mui/lab/TimelineItem";
47
+ import ct from "@mui/lab/TimelineConnector";
48
+ import lt from "@mui/lab/TimelineContent";
49
+ import dt from "@mui/lab/TimelineDot";
50
+ import pt from "@mui/lab/TimelineSeparator";
51
+ import { W as mt } from "../WidgetContainer-DtPnPQZY.mjs";
52
+ var A = /* @__PURE__ */ ((n) => (n.Connections = "connections", n.CreditScore = "credit_score", n.DateOfBirth = "date_of_birth", n.MonthlyIncome = "monthly_income", n))(A || {});
53
+ const ut = ({ list: n, onClickItem: o }) => /* @__PURE__ */ e(x, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(
54
+ Be,
55
+ {
56
+ sx: {
57
+ "& .MuiListItemSecondaryAction-root": {
58
+ color: "text.primary",
59
+ pr: 24
60
+ }
61
+ },
62
+ children: n.map((t, i) => /* @__PURE__ */ u(C.Fragment, { children: [
63
+ /* @__PURE__ */ e(He, { secondaryAction: /* @__PURE__ */ e(j, {}), children: /* @__PURE__ */ u($e, { onClick: () => o(t.key), children: [
64
+ /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(
65
+ We,
66
+ {
67
+ sx: {
68
+ bgcolor: "primary.main",
69
+ ...!t.isComplete && {
70
+ bgcolor: "transparent",
71
+ borderColor: "action.active",
72
+ borderStyle: "solid",
73
+ borderWidth: 1,
74
+ color: "action.active"
75
+ }
76
+ },
77
+ children: t.icon
78
+ }
79
+ ) }),
80
+ /* @__PURE__ */ e(
81
+ Ne,
82
+ {
83
+ primary: /* @__PURE__ */ e(W, { sx: { color: "text.secondary" }, variant: "caption", children: t.primaryText }),
84
+ secondary: /* @__PURE__ */ e(W, { sx: { color: "text.primary", fontWeight: 600 }, variant: "body1", children: t.secondaryText })
85
+ }
86
+ )
87
+ ] }) }),
88
+ i < n.length - 1 && /* @__PURE__ */ e(ge, { sx: { color: "divider", ml: 68 } })
89
+ ] }, t.key))
90
+ }
91
+ ) }), ht = ut, le = (n) => n * (180 / Math.PI), ie = (n, o) => [
92
+ {
93
+ description: o.vulnerable_description,
94
+ max: 25,
95
+ scoreContent: o.accordion_details_text.vulnerable,
96
+ status: o.vulnerable
97
+ },
98
+ {
99
+ description: o.building_description,
100
+ max: 50,
101
+ scoreContent: o.accordion_details_text.building,
102
+ status: o.building
103
+ },
104
+ {
105
+ description: o.stable_description,
106
+ max: 75,
107
+ scoreContent: o.accordion_details_text.stable,
108
+ status: o.stable
109
+ },
110
+ {
111
+ description: o.strong_description,
112
+ max: 100,
113
+ scoreContent: o.accordion_details_text.strong,
114
+ status: o.strong
115
+ }
116
+ ].find((d) => n > 0 && n <= d.max) || { status: o.insufficient_data, description: "", scoreContent: "" }, D = {
117
+ POOR: "#8C0E0E",
118
+ FAIR: "#E32727",
119
+ GOOD: "#FFB70D",
120
+ VERY_GOOD: "#0EA26C",
121
+ EXCEPTIONAL: "#005C3D"
122
+ }, M = {
123
+ POOR: "#B21C1C",
124
+ FAIR: "#FF3232",
125
+ GOOD: "#FFC02C",
126
+ VERY_GOOD: "#29C76B",
127
+ EXCEPTIONAL: "#008A5A"
128
+ }, _t = (n, o, t) => n >= 300 && n < 580 ? {
129
+ status: t.poor,
130
+ color: o ? M.POOR : D.POOR
131
+ } : n >= 580 && n < 670 ? {
132
+ status: t.fair,
133
+ color: o ? M.FAIR : D.FAIR
134
+ } : n >= 670 && n < 740 ? {
135
+ status: t.good,
136
+ color: o ? M.GOOD : D.GOOD
137
+ } : n >= 740 && n < 800 ? {
138
+ status: t.very_good,
139
+ color: o ? M.VERY_GOOD : D.VERY_GOOD
140
+ } : n >= 800 && n <= 850 ? {
141
+ status: t.exceptional,
142
+ color: o ? M.EXCEPTIONAL : D.EXCEPTIONAL
143
+ } : { status: t.missing_data }, gt = (n, o, t, i) => {
144
+ const d = n.reduce((r, a) => r + a.value, 0);
145
+ let l = 0;
146
+ const s = n.map((r) => {
147
+ const a = r.value / d * o, c = t + l, p = c + a;
148
+ return l += a, {
149
+ ...r,
150
+ startAngle: c,
151
+ endAngle: p
152
+ };
153
+ });
154
+ return [s[i].startAngle, s[i].endAngle];
155
+ }, ft = (n, o, t, i, d) => {
156
+ let l = 0, s = 0;
157
+ const r = Math.floor(i), a = i - r;
158
+ return r > t ? (l = n, s = o) : r === t && a > 0 && (l = n, s = d), [l, s];
159
+ }, yt = (n, o, t = 0) => {
160
+ const i = n * Math.sin(o - t), d = -n * Math.cos(o - t);
161
+ return [i, d];
162
+ }, bt = ({
163
+ dynamicCopy: n,
164
+ fallbackLabel: o,
165
+ icon: t,
166
+ key: i,
167
+ label: d,
168
+ value: l
169
+ }) => {
170
+ const s = !!l, r = s ? xt(i, l) : n && b(n, o) || o;
171
+ return {
172
+ icon: s ? /* @__PURE__ */ e(De, {}) : t,
173
+ isComplete: s,
174
+ key: i,
175
+ primaryText: d,
176
+ secondaryText: r
177
+ };
178
+ }, xt = (n, o) => ({
179
+ [A.DateOfBirth]: (i) => _e(new Date(Number(i) * 1e3), "MMM d, yyyy"),
180
+ [A.MonthlyIncome]: (i) => `$${i}`
181
+ })[n]?.(o) ?? String(o), de = (n) => n !== null ? Math.round(n * 100) : null, Ct = ({
182
+ dialScoreData: n,
75
183
  dataIndex: o,
76
- arcColor: n,
77
- arcStartAngle: r,
78
- totalAngularSpan: l,
79
- centerX: s,
80
- centerY: a,
81
- arcRadius: d,
82
- innerArcRadius: c,
83
- outterArcRadius: p,
84
- progressEndAngle: h,
85
- unitsPerSegment: m,
86
- isFinacialStrengthGraph: g
184
+ arcColor: t,
185
+ arcStartAngle: i,
186
+ totalAngularSpan: d,
187
+ centerX: l,
188
+ centerY: s,
189
+ arcRadius: r,
190
+ innerArcRadius: a,
191
+ outterArcRadius: c,
192
+ progressEndAngle: p,
193
+ unitsPerSegment: h,
194
+ isFinacialStrengthGraph: m
87
195
  }) => {
88
- const x = H(), k = [
89
- { offset: "13.62%", color: x.palette.chartMono.chartMono2 },
90
- { offset: "36.67%", color: x.palette.chartMono.chartMono3 },
91
- { offset: "59.72%", color: x.palette.chartMono.chartMono4 },
92
- { offset: "83.46%", color: x.palette.chartMono.chartMono5 }
93
- ], [y, b] = an(
94
- t,
95
- l,
96
- r,
196
+ const _ = G(), R = [
197
+ { offset: "13.62%", color: _.palette.chartMono.chartMono2 },
198
+ { offset: "36.67%", color: _.palette.chartMono.chartMono3 },
199
+ { offset: "59.72%", color: _.palette.chartMono.chartMono4 },
200
+ { offset: "83.46%", color: _.palette.chartMono.chartMono5 }
201
+ ], [T, v] = gt(
202
+ n,
203
+ d,
204
+ i,
97
205
  o
98
- ), [f, v] = sn(
99
- y,
100
- b,
206
+ ), [L, E] = ft(
207
+ T,
208
+ v,
101
209
  o,
102
- m,
103
- h
104
- ), O = Qe.arc().innerRadius(c).outerRadius(p).startAngle(y).endAngle(b).padAngle(0.02).cornerRadius(8), M = Qe.arc().innerRadius(c).outerRadius(p).startAngle(f).endAngle(v).padAngle(0.02).cornerRadius(8);
105
- return /* @__PURE__ */ i(E, { children: [
210
+ h,
211
+ p
212
+ ), K = ce.arc().innerRadius(a).outerRadius(c).startAngle(T).endAngle(v).padAngle(0.02).cornerRadius(8), F = ce.arc().innerRadius(a).outerRadius(c).startAngle(L).endAngle(E).padAngle(0.02).cornerRadius(8);
213
+ return /* @__PURE__ */ u(re, { children: [
106
214
  /* @__PURE__ */ e(
107
215
  "path",
108
216
  {
109
- d: O({}),
110
- fill: g ? x.palette.divider : n
217
+ d: K({}),
218
+ fill: m ? _.palette.divider : t
111
219
  }
112
220
  ),
113
- g && /* @__PURE__ */ e("path", { d: M({}), fill: "url(#arcGradient)" }),
221
+ m && /* @__PURE__ */ e("path", { d: F({}), fill: "url(#arcGradient)" }),
114
222
  /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ e(
115
223
  "linearGradient",
116
224
  {
117
- gradientTransform: `rotate(5, ${s}, ${a})`,
225
+ gradientTransform: `rotate(5, ${l}, ${s})`,
118
226
  gradientUnits: "userSpaceOnUse",
119
227
  id: "arcGradient",
120
- x1: s + d * 0.8 * Math.cos(Math.PI / 1.35),
121
- x2: s - d * 0.8 * Math.cos(Math.PI / 1.35),
122
- y1: a + d * 0.8 * Math.sin(Math.PI / 1.35),
123
- y2: a - d * 0.8 * Math.sin(Math.PI / 1.35),
124
- children: k.map((N, z) => /* @__PURE__ */ e("stop", { offset: N.offset, stopColor: N.color }, z))
228
+ x1: l + r * 0.8 * Math.cos(Math.PI / 1.35),
229
+ x2: l - r * 0.8 * Math.cos(Math.PI / 1.35),
230
+ y1: s + r * 0.8 * Math.sin(Math.PI / 1.35),
231
+ y2: s - r * 0.8 * Math.sin(Math.PI / 1.35),
232
+ children: R.map((w, O) => /* @__PURE__ */ e("stop", { offset: w.offset, stopColor: w.color }, O))
125
233
  }
126
234
  ) })
127
235
  ] });
128
- }, Ot = ({
129
- arcRadius: t = 100,
236
+ }, Se = ({
237
+ arcRadius: n = 100,
130
238
  healthScore: o,
131
- size: n = "L",
132
- dialScoreData: r,
133
- minValue: l = 0,
134
- maxValue: s = 100,
135
- markerColor: a,
136
- healthScoreStatus: d,
137
- footerCenterContent: c,
138
- footerLeftContent: p,
139
- footerRightContent: h,
140
- isFinacialStrengthGraph: m = !1
239
+ size: t = "L",
240
+ dialScoreData: i,
241
+ minValue: d = 0,
242
+ maxValue: l = 100,
243
+ markerColor: s,
244
+ healthScoreStatus: r,
245
+ footerCenterContent: a,
246
+ footerLeftContent: c,
247
+ footerRightContent: p,
248
+ isFinacialStrengthGraph: h = !1
141
249
  }) => {
142
- const g = H(), x = -Math.PI / 1.35, k = Math.PI / 1.35, y = k - x, b = y / (s - l), f = (o - l) * b, v = x + f + 0.02, O = n !== "SM" ? 0.1 : 0.12, M = t, N = t * (1 - O), z = M * 2.5, G = z / 2, W = z / 2, ce = (N + M) / 2, j = o !== 25 && o !== 50 && o !== 75 && o !== 100 ? 0 : 0.12, [oe, le] = cn(ce, v, j), _e = o / 25, U = {
250
+ const m = G(), _ = -Math.PI / 1.35, R = Math.PI / 1.35, T = R - _, v = T / (l - d), L = (o - d) * v, E = _ + L + 0.02, K = t !== "SM" ? 0.1 : 0.12, F = n, w = n * (1 - K), O = F * 2.5, k = O / 2, P = O / 2, U = (w + F) / 2, Z = o !== 25 && o !== 50 && o !== 75 && o !== 100 ? 0 : 0.12, [ee, ke] = yt(U, E, Z), Ae = o / 25, se = {
143
251
  L: { markerSize: 12, healthScoreFontSize: 64 },
144
252
  M: { markerSize: 10, healthScoreFontSize: 48 },
145
253
  SM: { markerSize: 3, healthScoreFontSize: 14 }
146
- }, Oe = c === 0 ? Yt : Xt;
147
- return /* @__PURE__ */ i(
148
- u,
254
+ }, Ie = a === 0 ? Te : we;
255
+ return /* @__PURE__ */ u(
256
+ g,
149
257
  {
150
258
  sx: {
151
- width: z,
152
- height: z,
259
+ width: O,
260
+ height: O,
153
261
  position: "relative",
154
262
  alignSelf: "center"
155
263
  },
156
264
  children: [
157
265
  /* @__PURE__ */ e(
158
- jt,
266
+ Oe,
159
267
  {
160
- height: z,
268
+ height: O,
161
269
  margin: { top: 0, right: 0, bottom: 0, left: 0 },
162
270
  series: [
163
271
  {
164
- data: r,
165
- innerRadius: N,
166
- outerRadius: M,
167
- startAngle: Math.round(Ue(x)),
272
+ data: i,
273
+ innerRadius: w,
274
+ outerRadius: F,
275
+ startAngle: Math.round(le(_)),
168
276
  // Use Math.degrees to convert
169
- endAngle: Math.round(Ue(k))
277
+ endAngle: Math.round(le(R))
170
278
  // Use Math.degrees to convert
171
279
  }
172
280
  ],
@@ -175,22 +283,22 @@ const yo = ({
175
283
  legend: { hidden: !0 }
176
284
  },
177
285
  slots: {
178
- pieArc: (xe) => /* @__PURE__ */ e(
179
- yo,
286
+ pieArc: (ae) => /* @__PURE__ */ e(
287
+ Ct,
180
288
  {
181
- arcColor: xe.color,
182
- arcRadius: t,
183
- arcStartAngle: x,
184
- centerX: G,
185
- centerY: W,
186
- dataIndex: xe.dataIndex,
187
- dialScoreData: r,
188
- innerArcRadius: N,
189
- isFinacialStrengthGraph: m,
190
- outterArcRadius: M,
191
- progressEndAngle: v,
192
- totalAngularSpan: y,
193
- unitsPerSegment: _e
289
+ arcColor: ae.color,
290
+ arcRadius: n,
291
+ arcStartAngle: _,
292
+ centerX: k,
293
+ centerY: P,
294
+ dataIndex: ae.dataIndex,
295
+ dialScoreData: i,
296
+ innerArcRadius: w,
297
+ isFinacialStrengthGraph: h,
298
+ outterArcRadius: F,
299
+ progressEndAngle: E,
300
+ totalAngularSpan: T,
301
+ unitsPerSegment: Ae
194
302
  }
195
303
  )
196
304
  },
@@ -199,2843 +307,923 @@ const yo = ({
199
307
  stroke: "none"
200
308
  }
201
309
  },
202
- width: z,
203
- children: o >= l && o <= s && /* @__PURE__ */ e(
310
+ width: O,
311
+ children: o >= d && o <= l && /* @__PURE__ */ e(
204
312
  "circle",
205
313
  {
206
- cx: G + oe,
207
- cy: W + le,
208
- fill: g.palette.common.white,
209
- r: U[n].markerSize,
210
- stroke: m ? "url(#arcGradient)" : a,
211
- strokeWidth: n !== "SM" ? 3 : 1
314
+ cx: k + ee,
315
+ cy: P + ke,
316
+ fill: m.palette.common.white,
317
+ r: se[t].markerSize,
318
+ stroke: h ? "url(#arcGradient)" : s,
319
+ strokeWidth: t !== "SM" ? 3 : 1
212
320
  }
213
321
  )
214
322
  }
215
323
  ),
216
324
  /* @__PURE__ */ e(
217
- A,
325
+ x,
218
326
  {
219
327
  sx: {
220
328
  position: "absolute",
221
- top: `${W}px`,
222
- left: `${G}px`,
329
+ top: `${P}px`,
330
+ left: `${k}px`,
223
331
  transform: "translate(-50%, -50%)",
224
332
  textAlign: "center"
225
333
  },
226
- children: /* @__PURE__ */ i(
227
- u,
334
+ children: /* @__PURE__ */ u(
335
+ g,
228
336
  {
229
337
  spacing: 1,
230
- sx: { alignItems: "center", justifyContent: "center", gap: n !== "M" ? 10 : 3 },
338
+ sx: { alignItems: "center", justifyContent: "center", gap: t !== "M" ? 10 : 3 },
231
339
  children: [
232
340
  /* @__PURE__ */ e(
233
- w,
341
+ y,
234
342
  {
235
343
  sx: {
236
- fontSize: U[n].healthScoreFontSize,
237
- lineHeight: n !== "SM" ? "48px" : "100%"
344
+ fontSize: se[t].healthScoreFontSize,
345
+ lineHeight: t !== "SM" ? "48px" : "100%"
238
346
  },
239
347
  variant: "H1",
240
348
  children: o
241
349
  }
242
350
  ),
243
- n !== "SM" && /* @__PURE__ */ e(w, { sx: { fontWeight: 600 }, variant: n === "L" ? "body1" : "body2", children: d })
351
+ t !== "SM" && /* @__PURE__ */ e(y, { sx: { fontWeight: 600 }, variant: t === "L" ? "body1" : "body2", children: r })
244
352
  ]
245
353
  }
246
354
  )
247
355
  }
248
356
  ),
249
- c !== void 0 && /* @__PURE__ */ e(
250
- A,
357
+ a !== void 0 && /* @__PURE__ */ e(
358
+ x,
251
359
  {
252
360
  sx: {
253
361
  position: "absolute",
254
- top: `${W * 2 * 0.83}px`,
255
- left: `${G}px`,
362
+ top: `${P * 2 * 0.83}px`,
363
+ left: `${k}px`,
256
364
  transform: "translate(-50%, -50%)",
257
365
  textAlign: "center"
258
366
  },
259
- children: typeof c == "number" ? /* @__PURE__ */ i(u, { sx: { flexDirection: "row", alignItems: "center", gap: 4 }, children: [
260
- c > 0 ? /* @__PURE__ */ e(st, { size: 16, sx: { color: "success.main" } }) : /* @__PURE__ */ e(Oe, { size: 16, sx: { color: "text.secondary" } }),
367
+ children: typeof a == "number" ? /* @__PURE__ */ u(g, { sx: { flexDirection: "row", alignItems: "center", gap: 4 }, children: [
368
+ a > 0 ? /* @__PURE__ */ e(Me, { size: 16, sx: { color: "success.main" } }) : /* @__PURE__ */ e(Ie, { size: 16, sx: { color: "text.secondary" } }),
261
369
  /* @__PURE__ */ e(
262
- w,
370
+ y,
263
371
  {
264
372
  sx: {
265
373
  fontWeight: 600,
266
- color: c > 0 ? "success.main" : "text.secondary"
374
+ color: a > 0 ? "success.main" : "text.secondary"
267
375
  },
268
376
  variant: "body1",
269
- children: c
377
+ children: a
270
378
  }
271
379
  )
272
- ] }) : /* @__PURE__ */ e(w, { sx: { color: "text.secondary" }, variant: "subtitle2", children: c })
380
+ ] }) : /* @__PURE__ */ e(y, { sx: { color: "text.secondary" }, variant: "subtitle2", children: a })
273
381
  }
274
382
  ),
275
- p !== void 0 && /* @__PURE__ */ e(
276
- A,
383
+ c !== void 0 && /* @__PURE__ */ e(
384
+ x,
277
385
  {
278
386
  sx: {
279
387
  position: "absolute",
280
- top: `${W * 2 * 0.83}px`,
281
- left: `${G - G / 2}px`,
388
+ top: `${P * 2 * 0.83}px`,
389
+ left: `${k - k / 2}px`,
282
390
  // shift left from center
283
391
  transform: "translate(-50%, -50%)",
284
392
  textAlign: "left"
285
393
  },
286
- children: /* @__PURE__ */ e(w, { variant: "body1", children: p })
394
+ children: /* @__PURE__ */ e(y, { variant: "body1", children: c })
287
395
  }
288
396
  ),
289
- h !== void 0 && /* @__PURE__ */ e(
290
- A,
397
+ p !== void 0 && /* @__PURE__ */ e(
398
+ x,
291
399
  {
292
400
  sx: {
293
401
  position: "absolute",
294
- top: `${W * 2 * 0.83}px`,
295
- left: `${G + G / 2}px`,
402
+ top: `${P * 2 * 0.83}px`,
403
+ left: `${k + k / 2}px`,
296
404
  transform: "translate(-50%, -50%)",
297
405
  textAlign: "right"
298
406
  },
299
- children: /* @__PURE__ */ e(w, { variant: "body1", children: h })
407
+ children: /* @__PURE__ */ e(y, { variant: "body1", children: p })
300
408
  }
301
409
  )
302
410
  ]
303
411
  }
304
412
  );
305
- }, Pt = S(
306
- ({ arcRadius: t, size: o = "L", healthScore: n, footerCenterContent: r }) => {
307
- const l = [
413
+ }, ve = I(
414
+ ({ arcRadius: n, size: o = "L", healthScore: t, footerCenterContent: i }) => {
415
+ const d = [
308
416
  { id: 1, label: "Group A", value: 25 },
309
417
  { id: 2, label: "Group B", value: 25 },
310
418
  { id: 3, label: "Group C", value: 25 },
311
419
  { id: 4, label: "Group D", value: 25 }
312
- ], { finstrong: s } = C(), a = We(n, s);
420
+ ], { finstrong: l } = S(), s = ie(t, l);
313
421
  return /* @__PURE__ */ e(
314
- Ot,
422
+ Se,
315
423
  {
316
- arcRadius: t,
317
- dialScoreData: l,
318
- footerCenterContent: o === "L" ? s.footer_center_content_updated_just_now : r,
319
- healthScore: n,
320
- healthScoreStatus: a.status,
424
+ arcRadius: n,
425
+ dialScoreData: d,
426
+ footerCenterContent: o === "L" ? l.footer_center_content_updated_just_now : i,
427
+ healthScore: t,
428
+ healthScoreStatus: s.status,
321
429
  isFinacialStrengthGraph: !0,
322
430
  size: o
323
431
  }
324
432
  );
325
433
  }
326
- ), bo = S(
434
+ ), Bo = I(
327
435
  ({
328
- arcRadius: t,
436
+ arcRadius: n,
329
437
  size: o = "L",
330
- healthScore: n,
331
- maxValue: r = 850,
332
- minValue: l = 300,
333
- footerCenterContent: s
438
+ healthScore: t,
439
+ maxValue: i = 850,
440
+ minValue: d = 300,
441
+ footerCenterContent: l
334
442
  }) => {
335
- const d = H().palette.mode === "dark", c = [
443
+ const r = G().palette.mode === "dark", a = [
336
444
  {
337
445
  id: 1,
338
446
  label: "Poor",
339
- value: 29,
340
- color: d ? ge.POOR : ye.POOR
447
+ value: 279,
448
+ color: r ? M.POOR : D.POOR
341
449
  },
342
450
  {
343
451
  id: 2,
344
452
  label: "Fair",
345
- value: 25,
346
- color: d ? ge.FAIR : ye.FAIR
453
+ value: 89,
454
+ color: r ? M.FAIR : D.FAIR
347
455
  },
348
456
  {
349
457
  id: 3,
350
458
  label: "Good",
351
- value: 17,
352
- color: d ? ge.GOOD : ye.GOOD
459
+ value: 69,
460
+ color: r ? M.GOOD : D.GOOD
353
461
  },
354
462
  {
355
463
  id: 4,
356
464
  label: "Very Good",
357
- value: 17,
358
- color: d ? ge.VERY_GOOD : ye.VERY_GOOD
465
+ value: 59,
466
+ color: r ? M.VERY_GOOD : D.VERY_GOOD
359
467
  },
360
468
  {
361
469
  id: 5,
362
470
  label: "Exceptional",
363
- value: 12,
364
- color: d ? ge.EXCEPTIONAL : ye.EXCEPTIONAL
471
+ value: 50,
472
+ color: r ? M.EXCEPTIONAL : D.EXCEPTIONAL
365
473
  }
366
- ], { finstrong: p } = C(), { isCopyLoaded: h } = X();
367
- if (!h) return /* @__PURE__ */ e(te, {});
368
- const { status: m, color: g = "none" } = ut(
369
- n,
370
- d,
371
- p.credit_score_status
474
+ ], { finstrong: c } = S(), { isCopyLoaded: p } = z();
475
+ if (!p) return /* @__PURE__ */ e(N, {});
476
+ const { status: h, color: m = "none" } = _t(
477
+ t,
478
+ r,
479
+ c.credit_score_status
372
480
  );
373
481
  return /* @__PURE__ */ e(
374
- Ot,
482
+ Se,
375
483
  {
376
- arcRadius: t,
377
- dialScoreData: c,
378
- footerCenterContent: s,
379
- footerLeftContent: l,
380
- footerRightContent: r,
381
- healthScore: n,
382
- healthScoreStatus: m,
383
- markerColor: g,
384
- maxValue: r,
385
- minValue: l,
484
+ arcRadius: n,
485
+ dialScoreData: a,
486
+ footerCenterContent: l,
487
+ footerLeftContent: d,
488
+ footerRightContent: i,
489
+ healthScore: t,
490
+ healthScoreStatus: h,
491
+ markerColor: m,
492
+ maxValue: i,
493
+ minValue: d,
386
494
  size: o
387
495
  }
388
496
  );
389
497
  }
390
- ), Me = ({
391
- isDashboard: t = !1,
498
+ ), Q = ({
499
+ isDashboard: n = !1,
392
500
  hasIcon: o = !0,
393
- buttonText: n,
394
- title: r,
395
- titleDrawer: l,
396
- description: s,
397
- sx: a
501
+ buttonText: t,
502
+ title: i,
503
+ description: d,
504
+ sx: l
398
505
  }) => {
399
- const [d, c] = _.useState(!1), { connect: p, finstrong: h } = C();
400
- return /* @__PURE__ */ i(
401
- K,
506
+ const [s, r] = C.useState(!1), { connect: a, finstrong: c } = S();
507
+ return /* @__PURE__ */ u(
508
+ J,
402
509
  {
403
510
  sx: {
404
511
  pb: 24,
405
512
  pt: 18,
406
513
  px: 24,
407
514
  width: "100%",
408
- ...a
515
+ ...l
409
516
  },
410
517
  children: [
411
- /* @__PURE__ */ i(
412
- u,
518
+ /* @__PURE__ */ u(
519
+ g,
413
520
  {
414
521
  sx: {
415
522
  gap: 8,
416
- ...t && { flexDirection: "row", alignItems: "center" }
523
+ ...n && { flexDirection: "row", alignItems: "center" }
417
524
  },
418
525
  children: [
419
- o && /* @__PURE__ */ e(ct, { sx: { height: 20, width: 20 } }),
420
- /* @__PURE__ */ e(Y, { className: "connect-more-accounts-title", sx: { ...t && { fontSize: 15 } }, children: r || h.connect_more_accounts_title })
526
+ o && /* @__PURE__ */ e(me, { sx: { height: 20, width: 20 } }),
527
+ /* @__PURE__ */ e(H, { className: "connect-more-accounts-title", sx: { ...n && { fontSize: 15 } }, children: i || c.connect_more_accounts_title })
421
528
  ]
422
529
  }
423
530
  ),
424
531
  /* @__PURE__ */ e(
425
- w,
532
+ y,
426
533
  {
427
534
  className: "connect-more-accounts-description",
428
535
  sx: { color: "text.secondary", mt: 8 },
429
536
  variant: "subtitle1",
430
- children: s || h.connect_more_accounts_description
537
+ children: d || c.connect_more_accounts_description
431
538
  }
432
539
  ),
433
540
  /* @__PURE__ */ e(
434
- L,
541
+ q,
435
542
  {
436
- endIcon: /* @__PURE__ */ e(Z, {}),
437
- onClick: () => c(!0),
543
+ endIcon: /* @__PURE__ */ e(j, {}),
544
+ onClick: () => r(!0),
438
545
  size: "small",
439
546
  sx: { p: 0, mt: 8, "&:hover": { backgroundColor: "transparent" } },
440
- children: /* @__PURE__ */ e(T, { sx: { fontWeight: 600 }, variant: "body2", children: n || h.connect_more_accounts_button })
547
+ children: /* @__PURE__ */ e(W, { sx: { fontWeight: 600 }, variant: "body2", children: t || c.connect_more_accounts_button })
441
548
  }
442
549
  ),
443
550
  /* @__PURE__ */ e(
444
- ne,
551
+ xe,
445
552
  {
446
- onClose: () => c(!1),
447
- showConnectWidget: d,
448
- title: l || p.mini_title
553
+ onClose: () => r(!1),
554
+ showConnectWidget: s,
555
+ title: a.mini_title
449
556
  }
450
557
  )
451
558
  ]
452
559
  }
453
560
  );
454
- };
455
- var se = /* @__PURE__ */ ((t) => (t.SpendLessThanYouMake = "spendLessThanYouMake", t.PayBillsOnTime = "payBillsOnTime", t.SaveEnoughToLiveOn = "saveEnoughToLiveOn", t.MaintainEmergencySavings = "maintainEmergencySavings", t.HaveManageableDebt = "haveManageableDebt", t.HaveAGoodCreditScore = "haveAGoodCreditScore", t))(se || {});
456
- const fo = ({ isOpen: t, onClose: o }) => {
457
- const { common: n, finstrong: r } = C(), { isMobile: l } = He(), { updateUser: s, user: a } = Q(), [d, c] = _.useState(a.credit_score || 0), p = !isNaN(d), h = () => {
458
- o(), setTimeout(() => c(a.credit_score || 0), 300);
459
- }, m = () => {
460
- !d || d === a.credit_score || s({ ...a, credit_score: d });
561
+ }, St = I(() => {
562
+ const n = G(), [o, { width: t }] = Ye(), { finstrong: i } = S(), { isCopyLoaded: d, isInitialized: l } = z(), { healthScore: s, healthScoreChange: r } = $(), a = n.palette.mode === "dark", c = ie(s?.health_score, i);
563
+ return !d || !l ? /* @__PURE__ */ e(N, {}) : /* @__PURE__ */ u(J, { ref: o, sx: { p: 16 }, children: [
564
+ /* @__PURE__ */ e(
565
+ Ve,
566
+ {
567
+ action: /* @__PURE__ */ e(
568
+ q,
569
+ {
570
+ endIcon: /* @__PURE__ */ e(j, {}),
571
+ sx: {
572
+ fontSize: 13,
573
+ lineHeight: "16px",
574
+ fontWeight: 600,
575
+ color: "primary.main"
576
+ },
577
+ variant: "text",
578
+ children: i.financial_strength_header_action
579
+ }
580
+ ),
581
+ subheader: /* @__PURE__ */ e(H, { color: "text.primary", children: i.financial_strength_header }),
582
+ sx: {
583
+ p: 0,
584
+ "& .MuiCardHeader-content": {
585
+ overflow: "hidden"
586
+ }
587
+ }
588
+ }
589
+ ),
590
+ /* @__PURE__ */ e(g, { sx: { justifyContent: "center", alignItems: "center" }, children: /* @__PURE__ */ e(
591
+ ve,
592
+ {
593
+ arcRadius: t <= 323 ? 73 : 154,
594
+ footerCenterContent: r,
595
+ healthScore: s?.health_score || 0,
596
+ size: t <= 323 ? "M" : "L"
597
+ }
598
+ ) }),
599
+ s?.health_score ? /* @__PURE__ */ u(
600
+ Xe,
601
+ {
602
+ sx: {
603
+ px: 16,
604
+ backgroundColor: a ? "grey.800" : "grey.50",
605
+ //TODO: Need to change the background color to palette (supporting both darkmode and lightmode)
606
+ "&.Mui-expanded": {
607
+ m: 0
608
+ },
609
+ "&::before": {
610
+ display: "none"
611
+ }
612
+ },
613
+ children: [
614
+ /* @__PURE__ */ e(
615
+ Ue,
616
+ {
617
+ expandIcon: /* @__PURE__ */ e(Re, { size: 20 }),
618
+ sx: {
619
+ height: 52,
620
+ p: 0,
621
+ "&.Mui-expanded": {
622
+ minHeight: 0
623
+ }
624
+ },
625
+ children: /* @__PURE__ */ e(y, { sx: { fontWeight: 600 }, variant: "body1", children: i.accordion_title_text })
626
+ }
627
+ ),
628
+ /* @__PURE__ */ e(je, { sx: { "&.MuiAccordionDetails-root": { padding: 0, pb: 16 } }, children: /* @__PURE__ */ e(y, { variant: "subtitle1", children: c.scoreContent }) })
629
+ ]
630
+ }
631
+ ) : /* @__PURE__ */ e(
632
+ Q,
633
+ {
634
+ buttonText: i.connect_more_accounts_title,
635
+ description: i.health_score_zero_description,
636
+ hasIcon: !1,
637
+ isDashboard: !0,
638
+ sx: {
639
+ backgroundColor: a ? "grey.800" : "grey.50",
640
+ //TODO: Need to change the background color to palette (supporting both darkmode and lightmode)
641
+ ".connect-more-accounts-title": {
642
+ fontWeight: 600,
643
+ lineHeight: "20px",
644
+ color: "text.primary"
645
+ },
646
+ ".connect-more-accounts-description": { color: "text.primary" }
647
+ },
648
+ title: i.health_score_zero_title
649
+ }
650
+ )
651
+ ] });
652
+ }), vt = ({ isOpen: n, onClose: o }) => {
653
+ const { common: t, finstrong: i } = S(), { isMobile: d } = Ce(), { updateUser: l, user: s } = Y(), [r, a] = C.useState(s.credit_score || 0), c = !isNaN(r), p = () => {
654
+ o(), setTimeout(() => a(s.credit_score || 0), 300);
655
+ }, h = () => {
656
+ !r || r === s.credit_score || l({ ...s, credit_score: r });
461
657
  };
462
658
  return /* @__PURE__ */ e(
463
- An,
659
+ Ze,
464
660
  {
465
- copy: { close_aria: n.close_aria, title: r.edit_credit_score },
466
- disablePrimaryButton: !d || !p,
467
- isOpen: t,
661
+ copy: { close_aria: t.close_aria, title: i.edit_credit_score },
662
+ disablePrimaryButton: !r || !c,
663
+ isOpen: n,
468
664
  maxWidth: "xs",
469
- onClose: h,
470
- onPrimaryAction: m,
665
+ onClose: p,
666
+ onPrimaryAction: h,
471
667
  primaryColor: "primary",
472
- primaryText: n.save_button,
668
+ primaryText: t.save_button,
473
669
  sx: {
474
670
  "& .MuiDialog-paper": {
475
- minWidth: l ? "100%" : 400
671
+ minWidth: d ? "100%" : 400
476
672
  }
477
673
  },
478
674
  children: /* @__PURE__ */ e(
479
- "form",
675
+ Qe,
480
676
  {
481
- onSubmit: (g) => {
482
- g.preventDefault(), m(), h();
677
+ error: !c,
678
+ fullWidth: !0,
679
+ inputMode: "numeric",
680
+ inputProps: {
681
+ noValidate: !0,
682
+ pattern: "[0-9]*"
483
683
  },
484
- children: /* @__PURE__ */ e(
485
- ke,
486
- {
487
- error: !p,
488
- fullWidth: !0,
489
- inputMode: "numeric",
490
- inputProps: {
491
- noValidate: !0,
492
- pattern: "[0-9]*"
493
- },
494
- onChange: (g) => c(Number(g.target.value)),
495
- value: p ? d : ""
496
- }
497
- )
684
+ onChange: (m) => a(Number(m.target.value)),
685
+ value: c ? r : ""
498
686
  }
499
687
  )
500
688
  }
501
689
  );
502
- }, Bt = S(fo), Pe = {
503
- credit_over_time_title: "Your Credit Over Time",
504
- credit_over_time_zero_state_desc: "Add your credit score to start building a full picture of your credit health."
505
- }, xo = ({ chartFor: t }) => {
506
- const o = H(), n = o.palette.mode === "dark", { monthlySummaries: r } = P(), { user: l } = Q(), { finstrong: s } = C(), [a, { width: d }] = ft(), c = {
507
- savingsOverTime: {
508
- icon: /* @__PURE__ */ e(st, { size: 48, style: { marginBottom: 8 } }),
509
- title: s.key_indicators_save.zero_state_title,
510
- description: s.key_indicators_save.zero_state_description
690
+ }, kt = I(vt), At = ({ isOpen: n, onClose: o }) => {
691
+ const { finstrong: t } = S(), i = G(), { updateUser: d, user: l } = Y(), [s, r] = C.useState(l.birthday), a = (p) => {
692
+ r(Math.floor(new Date(p).getTime() / 1e3));
693
+ };
694
+ return /* @__PURE__ */ e(
695
+ V,
696
+ {
697
+ isOpen: n,
698
+ onClose: o,
699
+ onPrimaryAction: () => {
700
+ !s || s === l.birthday || (d({ ...l, birthday: s }), o());
701
+ },
702
+ onSecondaryAction: o,
703
+ title: t.date_of_birth,
704
+ children: /* @__PURE__ */ e(ot, { dateAdapter: et, children: /* @__PURE__ */ e(
705
+ tt,
706
+ {
707
+ disableFuture: !0,
708
+ onChange: a,
709
+ slotProps: {
710
+ nextIconButton: {
711
+ sx: {
712
+ color: "primary.main",
713
+ "&:hover": { bgcolor: te(i.palette.primary.light, 0.1) }
714
+ }
715
+ },
716
+ previousIconButton: {
717
+ sx: {
718
+ color: "primary.main",
719
+ "&:hover": { bgcolor: te(i.palette.primary.light, 0.1) }
720
+ }
721
+ }
722
+ },
723
+ slots: {
724
+ actionBar: () => null,
725
+ toolbar: () => null
726
+ },
727
+ sx: {
728
+ width: "100%",
729
+ "& .MuiIconButton-edgeEnd": {
730
+ color: "primary.main",
731
+ "&:hover": { bgcolor: te(i.palette.primary.light, 0.1) }
732
+ }
733
+ },
734
+ value: s ? new Date(s * 1e3) : /* @__PURE__ */ new Date()
735
+ }
736
+ ) })
737
+ }
738
+ );
739
+ }, It = I(At), Ot = ({ value: n, completeCopy: o }) => /* @__PURE__ */ u(g, { sx: { gap: 8 }, children: [
740
+ /* @__PURE__ */ e(g, { sx: { flexDirection: "row", gap: 4 }, children: Array.from({ length: 4 }).map((t, i) => /* @__PURE__ */ e(
741
+ x,
742
+ {
743
+ sx: {
744
+ bgcolor: i < n ? "primary.main" : "neutral.light",
745
+ borderRadius: "24px",
746
+ height: 4,
747
+ width: "100%"
748
+ }
511
749
  },
512
- debtOverTime: {
513
- icon: /* @__PURE__ */ e(lt, { size: 48, style: { marginBottom: 8 } }),
514
- title: "",
515
- description: ""
750
+ i
751
+ )) }),
752
+ /* @__PURE__ */ u(W, { sx: { color: "text.secondary" }, variant: "body2", children: [
753
+ n / 4 * 100,
754
+ "% ",
755
+ o
756
+ ] })
757
+ ] }), Dt = ({ isOpen: n, onClose: o }) => {
758
+ const { visibleFinstrongAccounts: t } = fe(), { incomeBudget: i } = ye(), {
759
+ accounts: d,
760
+ common: l,
761
+ finstrong: s
762
+ } = S(), { user: r } = Y(), [a, c] = C.useState(null), h = [
763
+ {
764
+ dynamicCopy: s.add_profile_item,
765
+ fallbackLabel: s.monthly_income,
766
+ icon: /* @__PURE__ */ e(Fe, {}),
767
+ key: A.MonthlyIncome,
768
+ label: s.monthly_income,
769
+ value: i
516
770
  },
517
- creditOverTime: {
518
- icon: /* @__PURE__ */ e(Le, { size: 48, style: { marginBottom: 8 } }),
519
- title: Pe.credit_over_time_title,
520
- description: Pe.credit_over_time_zero_state_desc
521
- }
522
- }[t], h = {
523
- savingsOverTime: {
524
- title: s.key_indicators_save.savings_over_time,
525
- valueKey: "available_cash"
771
+ {
772
+ dynamicCopy: s.add_profile_item,
773
+ fallbackLabel: s.date_of_birth,
774
+ icon: /* @__PURE__ */ e(Pe, {}),
775
+ key: A.DateOfBirth,
776
+ label: s.date_of_birth,
777
+ value: r.birthday
526
778
  },
527
- debtOverTime: {
528
- title: s.key_indicators_borrow.have_manageable_debt.debt_over_time,
529
- valueKey: "debt_balance"
779
+ {
780
+ dynamicCopy: s.add_profile_item,
781
+ fallbackLabel: s.credit_score,
782
+ icon: /* @__PURE__ */ e(ue, {}),
783
+ key: A.CreditScore,
784
+ label: s.credit_score,
785
+ value: r.credit_score
530
786
  },
531
- creditOverTime: {
532
- title: Pe.credit_over_time_title,
533
- valueKey: "credit_score"
787
+ {
788
+ fallbackLabel: s.connect_your_accounts,
789
+ icon: /* @__PURE__ */ e(me, {}),
790
+ key: A.Connections,
791
+ label: s.connections,
792
+ value: t.length > 0 ? b(
793
+ s.connected_account,
794
+ String(t.length),
795
+ t.length > 1 ? s.accounts : s.account
796
+ ) : void 0
534
797
  }
535
- }[t], m = ln(r, h.valueKey), g = Math.max(...r.map((v) => v[h.valueKey])), x = () => g >= 1e6 ? { formatter: "0.000a", leftMargin: 55 } : g >= 1e3 ? { formatter: "0a", leftMargin: 35 } : { formatter: "0a", leftMargin: 30 }, { formatter: k, leftMargin: y } = x(), b = h.title, { color: f = "none" } = ut(
536
- l?.credit_score ?? 0,
537
- n,
538
- s.credit_score_status
539
- );
540
- return /* @__PURE__ */ e(K, { ref: a, sx: { backgroundColor: "background.paper" }, children: m.length >= 1 ? /* @__PURE__ */ i(u, { gap: 8, sx: { pl: 18 }, children: [
541
- /* @__PURE__ */ e(w, { sx: { pb: 8, pt: 16 }, variant: "h3", children: b }),
542
- /* @__PURE__ */ e(
543
- ze,
798
+ ].map((m) => bt(m));
799
+ return /* @__PURE__ */ u(V, { isOpen: n, onClose: o, title: s.financial_profile, children: [
800
+ /* @__PURE__ */ u(g, { sx: { gap: 20, p: 24 }, children: [
801
+ /* @__PURE__ */ u(g, { sx: { gap: 8 }, children: [
802
+ /* @__PURE__ */ e(H, { children: s.your_financial_profile }),
803
+ /* @__PURE__ */ e(y, { children: s.financial_profile_description })
804
+ ] }),
805
+ /* @__PURE__ */ e(
806
+ Ot,
807
+ {
808
+ completeCopy: s.complete,
809
+ value: h.reduce((m, _) => m + (_.isComplete ? 1 : 0), 0)
810
+ }
811
+ )
812
+ ] }),
813
+ /* @__PURE__ */ e(ht, { list: h, onClickItem: c }),
814
+ /* @__PURE__ */ e(x, { sx: { p: 24 }, children: /* @__PURE__ */ e(
815
+ Q,
544
816
  {
545
- areaColor: f,
546
- axisColor: o.palette.divider,
547
- baseline: "min",
548
- chartFor: t,
549
- colors: [o.palette.primary.main],
550
- curveType: "linear",
551
- datasets: m ? [m] : [],
552
- height: 244,
553
- labels: [s.key_indicators_label],
554
- margin: { left: y, top: 15, right: 20 },
555
- showArea: !0,
556
- showAverage: t !== "creditOverTime",
557
- showXAxis: !0,
558
- labelFontColor: t === "creditOverTime" ? "text.primary" : "",
559
- labelFontSize: t === "creditOverTime" ? 13 : void 0,
560
- markStyles: (v) => t === "creditOverTime" ? {
561
- marginLeft: 16,
562
- transform: v === m.length - 1 ? "translateX(-16px)" : "translateX(16px)",
563
- fontWeight: 600
564
- } : {},
565
- showYAxis: t === "creditOverTime",
566
- showYAxisTicks: t === "creditOverTime",
567
- showMarkLabel: t === "creditOverTime",
568
- useCustomMark: !0,
569
- valueFormatterString: t !== "creditOverTime" ? k : void 0,
570
- width: d < 342 ? d - 48 : 342
817
+ description: s.connect_more_accounts_to_view_more_accurate_financial_picture,
818
+ isDashboard: !0,
819
+ title: s.dont_see_all_your_accounts
571
820
  }
572
- )
573
- ] }) : /* @__PURE__ */ i(u, { gap: 8, sx: { alignItems: "center", p: 24, pb: 48 }, children: [
574
- c.icon,
575
- /* @__PURE__ */ e(w, { fontWeight: 600, variant: "body1", children: c.title }),
576
- /* @__PURE__ */ e(w, { align: "center", variant: "subtitle1", children: c.description })
577
- ] }) });
578
- }, Ke = S(xo), So = {
579
- updated_score: "Updated Score"
580
- }, Co = () => {
581
- const { healthScoreChange: t } = P(), { user: o } = Q(), { availableWidth: n } = Sn(), { isSmallMobile: r } = He(n), [l, s] = _.useState(!1);
582
- return /* @__PURE__ */ i(u, { sx: { gap: 28 }, children: [
821
+ ) }),
583
822
  /* @__PURE__ */ e(
584
- bo,
823
+ V,
585
824
  {
586
- arcRadius: r ? 124 : 154,
587
- footerCenterContent: t,
588
- healthScore: o.credit_score ?? 0,
589
- size: r ? "M" : "L"
825
+ isOpen: a === A.MonthlyIncome,
826
+ onClose: () => c(null),
827
+ title: l.settings,
828
+ children: /* @__PURE__ */ e(Je, {})
590
829
  }
591
830
  ),
592
- /* @__PURE__ */ e(L, { onClick: () => s(!0), variant: "contained", children: So.updated_score }),
593
- /* @__PURE__ */ e(Bt, { isOpen: l, onClose: () => s(!1) }),
594
- /* @__PURE__ */ e(Ke, { chartFor: "creditOverTime" })
831
+ /* @__PURE__ */ e(It, { isOpen: a === A.DateOfBirth, onClose: () => c(null) }),
832
+ /* @__PURE__ */ e(kt, { isOpen: a === A.CreditScore, onClose: () => c(null) }),
833
+ /* @__PURE__ */ e(
834
+ qe,
835
+ {
836
+ onClose: () => c(null),
837
+ showConnectionsWidget: a === A.Connections,
838
+ title: d.manage_connections
839
+ }
840
+ )
595
841
  ] });
596
- }, vo = S(Co), Ie = ({ status: t }) => {
597
- const { finstrong: o } = C(), n = dn(pn[t]), r = {
598
- GOOD: o.key_indicators_good,
599
- FAIR: o.key_indicators_fair,
600
- OFF_TRACK: o.key_indicators_off_track,
601
- MISSING: o.key_indicators_missing
842
+ }, Mt = I(Dt), X = {
843
+ creditScore: {
844
+ poor: 600,
845
+ good: 720
846
+ },
847
+ daysOfCashOnHand: {
848
+ poor: 30,
849
+ good: 90
850
+ },
851
+ debtToIncomeRatio: {
852
+ poor: 40,
853
+ good: 30
854
+ },
855
+ emergencySavings: {
856
+ poor: 750,
857
+ good: 1e3
858
+ },
859
+ spendToIncomeRatio: {
860
+ poor: 110,
861
+ good: 100
862
+ }
863
+ }, f = {
864
+ GOOD: "Good",
865
+ FAIR: "Fair",
866
+ OFF_TRACK: "Off Track",
867
+ MISSING: "Missing"
868
+ }, B = ({
869
+ title: n,
870
+ description: o,
871
+ cardState: t = f.MISSING,
872
+ stateTitle: i
873
+ }) => {
874
+ const d = {
875
+ [f.GOOD]: { backgroundColor: "success.lighter", color: "success.main" },
876
+ [f.FAIR]: { backgroundColor: "warning.lighter", color: "warning.main" },
877
+ [f.OFF_TRACK]: { backgroundColor: "error.lighter", color: "error.main" },
878
+ [f.MISSING]: { backgroundColor: "divider", color: "text.secondary" }
602
879
  }[t];
603
- return /* @__PURE__ */ e(
604
- Dn,
880
+ return /* @__PURE__ */ u(
881
+ g,
605
882
  {
606
- label: /* @__PURE__ */ e(
607
- w,
608
- {
609
- fontWeight: 700,
610
- sx: { color: n.color, minHeight: 12 },
611
- uppercase: !0,
612
- variant: "tiny",
613
- children: r
614
- }
615
- ),
616
- size: "small",
883
+ alignItems: "center",
884
+ flexDirection: "row",
885
+ gap: 12,
886
+ justifyContent: "space-between",
617
887
  sx: {
618
- bgcolor: n.backgroundColor,
619
- height: 16
888
+ p: 16,
889
+ border: "1px solid",
890
+ borderColor: "divider",
891
+ borderRadius: 2
620
892
  },
621
- variant: "filled"
893
+ children: [
894
+ /* @__PURE__ */ u(x, { sx: { minHeight: 48 }, children: [
895
+ /* @__PURE__ */ u(g, { flexDirection: "row", gap: 4, children: [
896
+ /* @__PURE__ */ e(y, { fontWeight: 600, sx: { mb: 8 }, truncate: !0, variant: "body1", children: n }),
897
+ /* @__PURE__ */ e(
898
+ x,
899
+ {
900
+ sx: {
901
+ borderRadius: 3,
902
+ backgroundColor: d.backgroundColor,
903
+ px: 8,
904
+ py: 2,
905
+ height: 16
906
+ },
907
+ children: /* @__PURE__ */ e(y, { fontWeight: 700, sx: { minHeight: 12 }, uppercase: !0, variant: "tiny", children: i })
908
+ }
909
+ )
910
+ ] }),
911
+ /* @__PURE__ */ e(y, { color: "secondary", variant: "subtitle2", children: o })
912
+ ] }),
913
+ /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(he, { color: "secondary", name: "chevron_right", size: 24 }) })
914
+ ]
622
915
  }
623
916
  );
624
- }, ko = {
625
- keep_strong_credit_score: "Keep a Strong Credit Score"
626
- }, wo = () => {
627
- const { user: t } = Q(), o = ht(t.credit_score ?? null);
628
- return /* @__PURE__ */ i(u, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: [
629
- /* @__PURE__ */ e(Y, { children: ko.keep_strong_credit_score }),
630
- /* @__PURE__ */ e(Ie, { status: o })
631
- ] });
632
- }, Ao = S(wo), Mo = ({
633
- additionalContent: t,
634
- children: o,
635
- description: n,
636
- drawerTitle: r,
637
- isOpen: l,
638
- loadConnectAccountsCard: s = !0,
639
- onClose: a,
640
- stickyComponent: d,
641
- title: c
642
- }) => {
643
- const { finstrong: p } = C(), { isCopyLoaded: h } = X();
644
- return h ? /* @__PURE__ */ i(ie, { isOpen: l, onClose: a, title: r || p.key_indicators, children: [
645
- (c || n) && /* @__PURE__ */ i(
646
- u,
917
+ }, Tt = () => {
918
+ const { healthScore: n } = $(), { finstrong: o } = S(), { key_indicators_spend: t } = o, i = (r) => {
919
+ const { good: a, poor: c } = X.spendToIncomeRatio;
920
+ let p = f.MISSING, h = t.ratio_missing_description, m = o.key_indicators_missing;
921
+ return r !== null && (r < a ? (p = f.GOOD, h = b(t.ratio_good_description, r), m = o.key_indicators_good) : r >= a && r < c ? (p = f.FAIR, h = b(t.ratio_fair_description, r), m = o.key_indicators_fair) : r >= c && (p = f.OFF_TRACK, h = b(t.ratio_off_track_description, r), m = o.key_indicators_off_track)), {
922
+ cardState: p,
923
+ description: h,
924
+ title: t.ratio_card_title,
925
+ stateTitle: m
926
+ };
927
+ }, d = (r) => {
928
+ let a = f.MISSING, c = t.count_missing_description, p = o.key_indicators_missing;
929
+ return r !== null && (r === 0 ? (a = f.GOOD, c = t.count_good_description, p = o.key_indicators_good) : r >= 1 && (a = f.OFF_TRACK, c = t.count_off_track_description, p = o.key_indicators_off_track)), {
930
+ cardState: a,
931
+ description: c,
932
+ title: t.count_card_title,
933
+ stateTitle: p
934
+ };
935
+ }, { spendToIncomeRatio: l, spendFeeCount: s } = C.useMemo(() => {
936
+ const r = n.spend_to_income_ratio !== null ? Math.round(n.spend_to_income_ratio * 100) : null, a = i(r), c = d(n.spending_fee_transaction_count);
937
+ return { spendToIncomeRatio: a, spendFeeCount: c };
938
+ }, [
939
+ n.spend_to_income_ratio,
940
+ n.spending_fee_transaction_count,
941
+ t,
942
+ o
943
+ ]);
944
+ return /* @__PURE__ */ u(g, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
945
+ /* @__PURE__ */ e(
946
+ B,
647
947
  {
648
- sx: {
649
- backgroundColor: "background.paper",
650
- gap: 8,
651
- p: 24
652
- },
653
- children: [
654
- c && typeof c == "string" ? /* @__PURE__ */ e(Y, { children: c }) : c,
655
- n && /* @__PURE__ */ e(w, { children: n })
656
- ]
948
+ cardState: l.cardState,
949
+ description: l.description,
950
+ stateTitle: l.stateTitle,
951
+ title: l.title
657
952
  }
658
953
  ),
659
- d && /* @__PURE__ */ e(
660
- A,
954
+ /* @__PURE__ */ e(
955
+ B,
661
956
  {
662
- sx: {
663
- position: "sticky",
664
- top: 0,
665
- zIndex: 1
666
- },
667
- children: d
957
+ cardState: s.cardState,
958
+ description: s.description,
959
+ stateTitle: s.stateTitle,
960
+ title: s.title
961
+ }
962
+ )
963
+ ] });
964
+ }, wt = () => {
965
+ const { healthScore: n } = $(), { finstrong: o } = S(), { key_indicators_save: t } = o, i = (r) => {
966
+ const { good: a, poor: c } = X.daysOfCashOnHand;
967
+ let p = f.MISSING, h = t.days_of_cash_missing_description, m = o.key_indicators_missing;
968
+ return r !== null && (r >= a ? (p = f.GOOD, h = b(t.days_of_cash_good_description, r), m = o.key_indicators_good) : r < a && r >= c ? (p = f.FAIR, h = b(t.days_of_cash_fair_description, r), m = o.key_indicators_fair) : r < c && (p = f.OFF_TRACK, h = b(t.days_of_cash_off_track_description, r), m = o.key_indicators_off_track)), {
969
+ cardState: p,
970
+ description: h,
971
+ title: t.days_of_cash_title,
972
+ stateTitle: m
973
+ };
974
+ }, d = (r) => {
975
+ const { good: a, poor: c } = X.emergencySavings;
976
+ let p = f.MISSING, h = t.emergency_savings_missing_description, m = o.key_indicators_missing;
977
+ return r !== null && (r >= a ? (p = f.GOOD, h = t.emergency_savings_good_description, m = o.key_indicators_good) : r < a && r >= c ? (p = f.FAIR, h = b(
978
+ t.emergency_savings_fair_description,
979
+ rt(r, "0,0.00")
980
+ ), m = o.key_indicators_fair) : r < c && (p = f.OFF_TRACK, h = t.emergency_savings_off_track_description, m = o.key_indicators_off_track)), {
981
+ cardState: p,
982
+ description: h,
983
+ title: t.emergency_savings_title,
984
+ stateTitle: m
985
+ };
986
+ }, { daysOfCashOnHand: l, emergencySavings: s } = C.useMemo(() => {
987
+ const r = n.months_of_cash_on_hand !== null ? Math.round(n.months_of_cash_on_hand * 30) : null, a = i(r), c = n.emergency_savings_on_hand !== null ? Math.round(n.emergency_savings_on_hand) : null, p = d(c);
988
+ return { daysOfCashOnHand: a, emergencySavings: p };
989
+ }, [
990
+ n.months_of_cash_on_hand,
991
+ n.emergency_savings_on_hand,
992
+ t,
993
+ o
994
+ ]);
995
+ return /* @__PURE__ */ u(g, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
996
+ /* @__PURE__ */ e(
997
+ B,
998
+ {
999
+ cardState: l.cardState,
1000
+ description: l.description,
1001
+ stateTitle: l.stateTitle,
1002
+ title: l.title
668
1003
  }
669
1004
  ),
670
- t && /* @__PURE__ */ e(A, { children: t }),
671
- /* @__PURE__ */ i(u, { sx: { p: 24, gap: 24 }, children: [
672
- o,
673
- s && /* @__PURE__ */ e(
674
- Me,
675
- {
676
- isDashboard: !0,
677
- sx: { backgroundColor: "background.paper" }
678
- }
679
- )
680
- ] })
681
- ] }) : /* @__PURE__ */ e(te, {});
682
- }, Rt = S(Mo), Io = ({
683
- onClick: t,
684
- shouldShowBalance: o = !0,
685
- loadAccounts: n
686
- }) => {
687
- const { config: r } = gt(), { accounts: l } = C(), { selectedAccounts: s } = X(), a = _.useCallback(
688
- (c) => {
689
- t?.(c);
690
- },
691
- [t]
692
- ), d = _.useMemo(
693
- () => Array.from(new Set(s.map((c) => c.account_type))).filter(
694
- (c) => n ? n.includes(c) : !0
695
- ),
696
- [s, n]
697
- );
698
- return s.length ? /* @__PURE__ */ e(_.Fragment, { children: d.map((c) => {
699
- const { accountsForType: p, totalBalanceForType: h } = s.reduce(
700
- (m, g) => (g.account_type === c && (m.accountsForType.push(g), m.totalBalanceForType += g.balance || 0), m),
701
- { accountsForType: [], totalBalanceForType: 0 }
702
- );
703
- return /* @__PURE__ */ i(
704
- kt,
705
- {
706
- subheader: /* @__PURE__ */ e(On, { sx: { pb: 4, position: "static", pt: 12, px: 24 }, children: /* @__PURE__ */ i(u, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: [
707
- /* @__PURE__ */ e(T, { bold: !0, variant: "caption", children: l.account_types[c] }),
708
- o && /* @__PURE__ */ e(T, { bold: !0, variant: "caption", children: F(h, "0,0.00") })
709
- ] }) }),
710
- sx: { bgcolor: "background.paper" },
711
- children: [
712
- p.map((m, g) => {
713
- const { firstValue: x } = vt(m, l), k = bt(m, {
714
- allowNickname: r?.show_account_nicknames_in_master
715
- }), y = /* @__PURE__ */ i(E, { children: [
716
- /* @__PURE__ */ e(St, { children: /* @__PURE__ */ e(pt, { alt: "MX", institutionGuid: m.institution_guid ?? "" }) }),
717
- /* @__PURE__ */ e(
718
- Ct,
719
- {
720
- primary: `${k}${m.account_number ? ` *${m.account_number}` : ""}`,
721
- primaryTypographyProps: { noWrap: !0, pr: 4, variant: "body1" }
722
- }
723
- ),
724
- o && /* @__PURE__ */ e(w, { bold: !0, variant: "body2", children: F(x ?? 0, "0,0.00") })
725
- ] });
726
- return /* @__PURE__ */ i(_.Fragment, { children: [
727
- /* @__PURE__ */ e(xt, { sx: { px: t ? 0 : 24 }, children: t ? /* @__PURE__ */ e(Tn, { onClick: () => a(m), children: y }) : y }),
728
- g !== p.length - 1 && /* @__PURE__ */ e(ee, { variant: "inset" })
729
- ] }, m.guid);
730
- }),
731
- /* @__PURE__ */ e(ee, {})
732
- ]
733
- },
734
- c
735
- );
736
- }) }) : null;
737
- }, Ft = S(Io), Do = ({ loadAccounts: t, loadMoreLabel: o }) => {
738
- const n = H(), { config: r } = gt(), { connect: l, finstrong: s } = C(), { accounts: a } = C(), { selectedAccounts: d } = X(), [c, p] = _.useState(!1), [h, m] = _.useState(!1), g = _.useMemo(
739
- () => d.filter(
740
- (y) => t ? t.includes(y.account_type) : !0
741
- ),
742
- [d, t]
743
- ), x = _.useMemo(() => g.slice(0, 3), [g]), k = (y) => {
744
- const { firstValue: b } = vt(y, a);
745
- return b;
746
- };
747
- return g.length >= 1 ? /* @__PURE__ */ i(E, { children: [
748
- /* @__PURE__ */ e(A, { sx: { border: `1px solid ${n.palette.divider}`, borderRadius: 2 }, children: x.map((y, b) => /* @__PURE__ */ i(_.Fragment, { children: [
749
- /* @__PURE__ */ i(xt, { sx: { px: 24 }, children: [
750
- /* @__PURE__ */ e(St, { children: /* @__PURE__ */ e(pt, { alt: "MX", institutionGuid: y.institution_guid ?? "" }) }),
751
- /* @__PURE__ */ e(
752
- Ct,
753
- {
754
- primary: `${bt(y, {
755
- allowNickname: r?.show_account_nicknames_in_master
756
- })}
757
- ${y.account_number ? ` *${y.account_number}` : ""}`,
758
- primaryTypographyProps: { noWrap: !0, pr: 4, variant: "body1" }
759
- }
760
- ),
761
- /* @__PURE__ */ e(w, { bold: !0, variant: "body2", children: F(k(y), "0,0.00") })
762
- ] }),
763
- b < x.length - 1 && /* @__PURE__ */ e(ee, { variant: "inset" })
764
- ] }, y.guid)) }),
765
- g.length > 3 && /* @__PURE__ */ i(E, { children: [
766
- /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
767
- L,
768
- {
769
- endIcon: /* @__PURE__ */ e(Z, {}),
770
- onClick: () => p(!0),
771
- size: "small",
772
- sx: { my: 0, px: 16, py: 12, width: "100%" },
773
- children: /* @__PURE__ */ i(T, { bold: !0, variant: "body1", children: [
774
- g.length - 3,
775
- " ",
776
- o
777
- ] })
778
- }
779
- ) }),
780
- /* @__PURE__ */ e(ie, { isOpen: c, onClose: () => p(!1), title: s.accounts, children: /* @__PURE__ */ e(Ft, { loadAccounts: t }) })
781
- ] })
782
- ] }) : /* @__PURE__ */ i(E, { children: [
783
- /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
784
- L,
785
- {
786
- onClick: () => m(!0),
787
- size: "small",
788
- sx: { my: 0, px: 16, py: 12, width: "100%" },
789
- variant: "contained",
790
- children: /* @__PURE__ */ e(T, { bold: !0, variant: "body1", children: s.connect_more_accounts_button })
791
- }
792
- ) }),
793
- /* @__PURE__ */ e(
794
- ne,
795
- {
796
- onClose: () => m(!1),
797
- showConnectWidget: h,
798
- title: l.mini_title
799
- }
800
- )
801
- ] });
802
- }, $t = S(Do), he = ({ balance: t, title: o, sx: n }) => /* @__PURE__ */ i(
803
- u,
804
- {
805
- sx: {
806
- alignItems: "center",
807
- backgroundColor: "background.default",
808
- borderRadius: 2,
809
- height: 72,
810
- justifyContent: "center",
811
- p: 12,
812
- ...n
813
- },
814
- children: [
815
- typeof t == "number" ? /* @__PURE__ */ e(w, { variant: "h2", children: F(t, "0,0.00") }) : t,
816
- /* @__PURE__ */ e(w, { color: "text.secondary", fontWeight: "400", variant: "subtitle2", children: o })
817
- ]
818
- }
819
- );
820
- var D = /* @__PURE__ */ ((t) => (t[t.ConnectAccounts = 1] = "ConnectAccounts", t[t.MonthlyIncome = 2] = "MonthlyIncome", t[t.Birthday = 3] = "Birthday", t[t.CreditScore = 4] = "CreditScore", t))(D || {}), be = /* @__PURE__ */ ((t) => (t[t.Months = 1] = "Months", t[t.Years = 2] = "Years", t[t.Days = 3] = "Days", t))(be || {}), q = /* @__PURE__ */ ((t) => (t[t.Monthly = 1] = "Monthly", t[t.BiWeekly = 2] = "BiWeekly", t[t.Weekly = 3] = "Weekly", t[t.Daily = 4] = "Daily", t))(q || {});
821
- const R = {
822
- bi_weekly: "Bi-Weekly",
823
- calculate: "Calculate",
824
- daily: "Daily",
825
- day: "day",
826
- days: "Days",
827
- estimated_contribution: "Estimated Contribution",
828
- estimated_period_bi_weekly: "bi-weekly",
829
- estimated_period_daily: "day",
830
- estimated_period_monthly: "month",
831
- estimated_period_weekly: "week",
832
- how_often_contribute: "How often will you contribute?",
833
- meet_your_goal_within: "Meet your goal within",
834
- months: "Months",
835
- monthly: "Monthly",
836
- savings_goal: "Savings Goal",
837
- suggested_goal: "Suggested Goal: $25,000",
838
- weekly: "Weekly",
839
- years: "Years"
840
- }, To = [
841
- { id: q.Monthly, label: R.monthly },
842
- { id: q.BiWeekly, label: R.bi_weekly },
843
- { id: q.Weekly, label: R.weekly },
844
- { id: q.Daily, label: R.daily }
845
- ], Oo = {
846
- [q.Monthly]: R.estimated_period_monthly,
847
- [q.BiWeekly]: R.estimated_period_bi_weekly,
848
- [q.Weekly]: R.estimated_period_weekly,
849
- [q.Daily]: R.estimated_period_daily
850
- }, Po = [
851
- { id: be.Months, label: R.months },
852
- { id: be.Years, label: R.years },
853
- { id: be.Days, label: R.days }
854
- ], Bo = ({ total: t }) => {
855
- const o = Math.ceil((t + 1) / 1e3) * 1e3, [n, r] = _.useState(0), [l, s] = _.useState(qe(t)), [a, d] = _.useState(
856
- qe(t)
857
- ), [c, p] = _.useState(o), [h, m] = _.useState(un(t)), [g, x] = _.useState(be.Months);
858
- _.useEffect(() => {
859
- r(
860
- Ze({
861
- contribution: a,
862
- goalAmount: c,
863
- goalPeriod: h,
864
- targetPeriod: g,
865
- totalSaved: t
866
- })
867
- ), s(a);
868
- }, []);
869
- const k = (y) => {
870
- y.preventDefault(), r(
871
- Ze({
872
- contribution: a,
873
- goalAmount: c,
874
- goalPeriod: h,
875
- targetPeriod: g,
876
- totalSaved: t
877
- })
878
- ), s(a);
879
- };
880
- return /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e("form", { onSubmit: k, children: /* @__PURE__ */ i(u, { sx: { gap: 24, pb: 24, pt: 16, px: 16 }, children: [
881
- /* @__PURE__ */ e(
882
- he,
883
- {
884
- balance: /* @__PURE__ */ i(u, { sx: { flexDirection: "row", height: 32 }, children: [
885
- /* @__PURE__ */ e(T, { variant: "h2", children: F(n, "0,0") }),
886
- /* @__PURE__ */ i(T, { sx: { alignSelf: "end", height: 24 }, variant: "subtitle2", children: [
887
- "/",
888
- Oo[l]
889
- ] })
890
- ] }),
891
- title: R.estimated_contribution
892
- }
893
- ),
894
- /* @__PURE__ */ e(
895
- ke,
896
- {
897
- "aria-label": R.savings_goal,
898
- helperText: R.suggested_goal,
899
- inputProps: {
900
- noValidate: !0,
901
- pattern: "[0-9]*"
902
- },
903
- label: R.savings_goal,
904
- onChange: (y) => {
905
- y.target.value && p(Number(y.target.value.replace(/[^0-9]/g, "")));
906
- },
907
- value: c ? F(c, "0,0") : ""
908
- }
909
- ),
910
- /* @__PURE__ */ e(
911
- Je,
912
- {
913
- label: R.how_often_contribute,
914
- onChange: d,
915
- options: To,
916
- required: !0,
917
- value: a
918
- }
919
- ),
920
- /* @__PURE__ */ i(u, { sx: { flexDirection: "row" }, children: [
921
- /* @__PURE__ */ e(
922
- ke,
923
- {
924
- "aria-label": R.meet_your_goal_within,
925
- fullWidth: !0,
926
- inputProps: {
927
- noValidate: !0,
928
- pattern: "[0-9]*"
929
- },
930
- label: R.meet_your_goal_within,
931
- onChange: (y) => m(Number(y.target.value)),
932
- sx: {
933
- "& .MuiInputBase-root": {
934
- borderBottomRightRadius: 0,
935
- borderTopRightRadius: 0,
936
- fieldset: {
937
- borderRightWidth: 0.5
938
- }
939
- }
940
- },
941
- value: h
942
- }
943
- ),
944
- /* @__PURE__ */ e(
945
- A,
946
- {
947
- sx: {
948
- "& .MuiInputBase-root": {
949
- borderBottomLeftRadius: 0,
950
- borderTopLeftRadius: 0,
951
- fieldset: {
952
- borderLeftWidth: 0.5
953
- }
954
- }
955
- },
956
- children: /* @__PURE__ */ e(Je, { label: "", onChange: x, options: Po, value: g })
957
- }
958
- )
959
- ] }),
960
- /* @__PURE__ */ e(L, { fullWidth: !0, onClick: k, type: "submit", variant: "contained", children: R.calculate })
961
- ] }) }) });
962
- }, Ro = S(Bo), Ce = {
963
- connect_accounts: "Connect Accounts",
964
- more_accounts: "More Accounts",
965
- your_savings: "Your Savings"
966
- }, Fo = () => {
967
- const { savingsAccounts: t } = fe(), [o, n] = _.useState(!1), r = _.useMemo(
968
- () => t.reduce((l, s) => l + (s.balance ?? 0), 0),
969
- [t]
970
- );
971
- return /* @__PURE__ */ i(u, { sx: { gap: 24 }, children: [
972
- /* @__PURE__ */ e(K, { sx: { bgcolor: "background.paper", p: 16 }, children: /* @__PURE__ */ i(u, { sx: { gap: 16 }, children: [
973
- /* @__PURE__ */ e(he, { balance: r, title: Ce.your_savings }),
974
- t.length ? /* @__PURE__ */ e($t, { loadAccounts: [Fe.SAVINGS], loadMoreLabel: Ce.connect_accounts }) : /* @__PURE__ */ e(Bn, { onClick: () => n(!0), variant: "contained", children: Ce.connect_accounts })
975
- ] }) }),
976
- /* @__PURE__ */ e(Ro, { total: r }),
977
- /* @__PURE__ */ e(
978
- ne,
979
- {
980
- onClose: () => n(!1),
981
- showConnectWidget: o,
982
- title: Ce.connect_accounts
983
- }
984
- )
985
- ] });
986
- }, $o = S(Fo), De = S(
987
- ({ label: t, value: o, status: n, bottomComponent: r, statusBarData: l = [] }) => {
988
- const { finstrong: s } = C(), a = {
989
- GOOD: {
990
- backgroundColor: "success.lighter",
991
- color: "success.main",
992
- progressBarColor: "primary.main",
993
- label: s?.key_indicators_good
994
- },
995
- FAIR: {
996
- backgroundColor: "warning.lighter",
997
- color: "warning.main",
998
- progressBarColor: "warning.main",
999
- label: s?.key_indicators_fair
1000
- },
1001
- OFF_TRACK: {
1002
- backgroundColor: "error.lighter",
1003
- color: "error.main",
1004
- progressBarColor: "error.main",
1005
- label: s?.key_indicators_off_track
1006
- },
1007
- MISSING: {
1008
- backgroundColor: "divider",
1009
- color: "text.secondary",
1010
- progressBarColor: "text.secondary",
1011
- label: s?.key_indicators_missing
1012
- }
1013
- }[n], d = l.map((c, p) => l.length === 2 ? {
1014
- color: p === 0 ? "primary.main" : c.color || a?.progressBarColor,
1015
- percentage: c.percentage
1016
- } : {
1017
- color: c.color || a?.progressBarColor,
1018
- percentage: c.percentage
1019
- });
1020
- return /* @__PURE__ */ i(
1021
- u,
1022
- {
1023
- sx: {
1024
- backgroundColor: "background.paper",
1025
- gap: 8,
1026
- p: 24,
1027
- pt: 0,
1028
- borderBottom: "1px solid",
1029
- borderColor: "divider"
1030
- },
1031
- children: [
1032
- /* @__PURE__ */ i(u, { sx: { gap: 2 }, children: [
1033
- /* @__PURE__ */ e(T, { variant: "body2", children: t }),
1034
- /* @__PURE__ */ i(
1035
- u,
1036
- {
1037
- sx: {
1038
- alignItems: "center",
1039
- flexDirection: "row",
1040
- gap: 12,
1041
- justifyContent: "space-between"
1042
- },
1043
- children: [
1044
- /* @__PURE__ */ e(Ae, { children: o }),
1045
- /* @__PURE__ */ e(Ie, { status: n })
1046
- ]
1047
- }
1048
- )
1049
- ] }),
1050
- /* @__PURE__ */ i(u, { children: [
1051
- /* @__PURE__ */ e(Rn, { data: d, height: 16 }),
1052
- r
1053
- ] })
1054
- ]
1055
- }
1056
- );
1057
- }
1058
- ), Lo = {
1059
- sticky_label: "You have saved"
1060
- }, Wo = ["$0", "$250", "$500", "$750", "$1k"], Eo = () => {
1061
- const { healthScore: t } = P(), o = Math.round(t.emergency_savings_on_hand ?? NaN) || null, n = hn(o), r = _t(o);
1062
- return /* @__PURE__ */ e(
1063
- De,
1064
- {
1065
- bottomComponent: /* @__PURE__ */ e(u, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: Wo.map((l) => /* @__PURE__ */ i(u, { sx: { alignItems: "center", height: 24, width: 30 }, children: [
1066
- /* @__PURE__ */ e(
1067
- ee,
1068
- {
1069
- orientation: "vertical",
1070
- sx: {
1071
- borderWidth: 0.5,
1072
- height: 8,
1073
- mt: 2
1074
- }
1075
- }
1076
- ),
1077
- /* @__PURE__ */ e(T, { variant: "caption", children: l })
1078
- ] }, l)) }),
1079
- label: Lo.sticky_label,
1080
- status: r,
1081
- statusBarData: [
1082
- {
1083
- percentage: n
1084
- }
1085
- ],
1086
- value: F(o ?? 0, "0,0.00")
1087
- }
1088
- );
1089
- }, zo = S(Eo), ot = 65, rt = 34, Go = ({
1090
- transactions: t,
1091
- bgcolor: o,
1092
- height: n = "calc(100dvh - 36px)",
1093
- loader: r = /* @__PURE__ */ e(te, { label: "Loading", size: 40 }),
1094
- onClick: l,
1095
- showInsights: s = !1,
1096
- showLoader: a = !1,
1097
- width: d = "100%",
1098
- zeroState: c = /* @__PURE__ */ e(Ln, {})
1099
- }) => {
1100
- const { getCategoryName: p } = Ee(), { onEvent: h } = Cn(), { categories: m } = C(), { clearExpandedSplits: g, setShowInsights: x, toggleSplit: k } = $n(), y = (v) => {
1101
- const O = t.find((M) => M.guid === v);
1102
- if (O?.has_been_split) {
1103
- k(O.guid);
1104
- return;
1105
- }
1106
- h(Wn.ACCOUNT_DETAILS_CLICK_TRANSACTION, {
1107
- account_guid: O?.account_guid,
1108
- transaction_guid: v
1109
- }), l?.(v);
1110
- }, b = _.useRef(null), f = Fn({
1111
- count: t.length,
1112
- getScrollElement: () => b.current,
1113
- estimateSize: (v) => ot + ($e(v, t) ? rt : 0),
1114
- overscan: 5
1115
- });
1116
- return _.useEffect(() => f.measure(), [t]), _.useEffect(() => x(s), [s]), _.useEffect(() => () => g(), []), /* @__PURE__ */ e(kt, { sx: { width: d }, children: /* @__PURE__ */ e(A, { height: n, overflow: "auto", ref: b, width: d, children: /* @__PURE__ */ i(
1117
- A,
1118
- {
1119
- height: (
1120
- // set the height to auto when there are no transactions so the zero state isn't set to 0
1121
- f.getVirtualItems().length === 0 ? "auto" : f.getTotalSize()
1122
- ),
1123
- position: "relative",
1124
- width: "100%",
1125
- children: [
1126
- a && r,
1127
- !a && f.getVirtualItems().length === 0 && c,
1128
- !a && f.getVirtualItems().length > 0 && f.getVirtualItems().map((v) => {
1129
- const O = t[v.index], M = $e(v.index, t), N = wt(v.index, t), z = ot + (M ? rt : 0);
1130
- return /* @__PURE__ */ i(
1131
- A,
1132
- {
1133
- sx: {
1134
- height: z,
1135
- position: "absolute",
1136
- transform: `translateY(${v.start}px)`,
1137
- width: "100%"
1138
- },
1139
- children: [
1140
- M && /* @__PURE__ */ e(At, { bgcolor: o, children: Ne(O.date) }),
1141
- /* @__PURE__ */ e(
1142
- Mt,
1143
- {
1144
- ...l && { onClick: y },
1145
- transaction: {
1146
- ...O,
1147
- category: m.default_categories[O.top_level_category_guid]?.replace(
1148
- /&amp;/g,
1149
- "&"
1150
- ) ?? p(O.top_level_category_guid)
1151
- }
1152
- }
1153
- ),
1154
- /* @__PURE__ */ e(ee, { sx: { ml: N ? 24 : 0 } })
1155
- ]
1156
- },
1157
- O.guid
1158
- );
1159
- })
1160
- ]
1161
- }
1162
- ) }) });
1163
- }, Ho = S(Go), Te = ({
1164
- transactions: t = [],
1165
- amountColor: o = "success.main",
1166
- amountPosition: n = "center",
1167
- formatDate: r = Ne,
1168
- secondaryIcon: l
1169
- }) => {
1170
- const s = H(), { connect: a, finstrong: d } = C(), [c, p] = _.useState(!1), [h, m] = _.useState(!1), g = 3, x = t.length > g, k = t.length - g;
1171
- return !t || t.length === 0 ? /* @__PURE__ */ i(E, { children: [
1172
- /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
1173
- L,
1174
- {
1175
- onClick: () => m(!0),
1176
- size: "small",
1177
- sx: { my: 0, px: 16, py: 12, width: "100%" },
1178
- variant: "contained",
1179
- children: /* @__PURE__ */ e(T, { bold: !0, variant: "body1", children: d.connect_more_accounts_button })
1180
- }
1181
- ) }),
1182
- /* @__PURE__ */ e(
1183
- ne,
1184
- {
1185
- onClose: () => m(!1),
1186
- showConnectWidget: h,
1187
- title: a.mini_title
1188
- }
1189
- )
1190
- ] }) : /* @__PURE__ */ i(u, { sx: { gap: 8 }, children: [
1191
- /* @__PURE__ */ e(A, { sx: { border: `1px solid ${s.palette.divider}`, borderRadius: 2 }, children: t.slice(0, g).map((y, b) => /* @__PURE__ */ i(
1192
- u,
1193
- {
1194
- sx: {
1195
- alignItems: "center",
1196
- flexDirection: "row",
1197
- gap: 16,
1198
- pl: 24,
1199
- pt: 14
1200
- },
1201
- children: [
1202
- /* @__PURE__ */ e(u, { sx: { pb: 14 }, children: /* @__PURE__ */ e(
1203
- on,
1204
- {
1205
- categoryGuid: y.top_level_category_guid || "",
1206
- merchantGuid: y.merchant_guid || "",
1207
- size: 32
1208
- }
1209
- ) }),
1210
- /* @__PURE__ */ i(
1211
- u,
1212
- {
1213
- sx: {
1214
- alignItems: n,
1215
- flexDirection: "row",
1216
- gap: 12,
1217
- justifyContent: "space-between",
1218
- ...b < Math.min(t.length, g) - 1 && {
1219
- borderBottom: `1px solid ${s.palette.divider}`
1220
- },
1221
- pb: 14,
1222
- pr: 24,
1223
- width: "100%"
1224
- },
1225
- children: [
1226
- /* @__PURE__ */ i(u, { sx: { gap: 4 }, children: [
1227
- /* @__PURE__ */ e(w, { bold: !0, variant: "body1", children: y.description }),
1228
- /* @__PURE__ */ i(u, { sx: { flexDirection: "row", alignItems: "center", gap: 4 }, children: [
1229
- !!l && l,
1230
- /* @__PURE__ */ e(T, { variant: "caption", children: r(y.date) })
1231
- ] })
1232
- ] }),
1233
- /* @__PURE__ */ e(w, { bold: !0, sx: { color: o, flexShrink: 0 }, variant: "body1", children: F(y.amount, "0,0.00") })
1234
- ]
1235
- },
1236
- y.guid || b
1237
- )
1238
- ]
1239
- },
1240
- b
1241
- )) }),
1242
- x && /* @__PURE__ */ i(E, { children: [
1243
- /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
1244
- L,
1245
- {
1246
- endIcon: /* @__PURE__ */ e(Z, {}),
1247
- onClick: () => p(!0),
1248
- size: "small",
1249
- sx: { my: 0, px: 16, py: 12, width: "100%" },
1250
- children: /* @__PURE__ */ i(T, { bold: !0, variant: "body1", children: [
1251
- k,
1252
- " ",
1253
- d.key_indicators_borrow.have_manageable_debt.have_manageable_debt_more_transactions
1254
- ] })
1255
- }
1256
- ) }),
1257
- /* @__PURE__ */ e(
1258
- ie,
1259
- {
1260
- isOpen: c,
1261
- onClose: () => p(!1),
1262
- title: d.key_indicators_borrow.have_manageable_debt.have_manageable_debt_transactions,
1263
- children: /* @__PURE__ */ e(Ho, { transactions: t })
1264
- }
1265
- )
1266
- ] })
1267
- ] });
1268
- }, No = () => {
1269
- const {
1270
- finstrong: {
1271
- key_indicators_spend: { pay_bills_on_time_drawer: t }
1272
- }
1273
- } = C(), { getSpendingFeeTransactions: o, allTransactions: n } = P();
1274
- return _.useEffect(() => {
1275
- o().finally();
1276
- }, []), /* @__PURE__ */ e(E, { children: n.spendingFee.length === 0 ? /* @__PURE__ */ i(
1277
- K,
1278
- {
1279
- sx: {
1280
- backgroundColor: "background.paper",
1281
- pb: 48,
1282
- pt: 32,
1283
- px: 24,
1284
- textAlign: "center",
1285
- width: "100%"
1286
- },
1287
- children: [
1288
- /* @__PURE__ */ e(Ut, { filled: !0, size: 48, sx: { color: "success.main" } }),
1289
- /* @__PURE__ */ i(u, { sx: { alignItems: "center", gap: 4, pt: 24 }, children: [
1290
- /* @__PURE__ */ e(Y, { children: t.pay_bills_on_time_zero_fees_title }),
1291
- /* @__PURE__ */ e(w, { variant: "subtitle1", children: t.pay_bills_on_time_zero_fees_description })
1292
- ] })
1293
- ]
1294
- }
1295
- ) : /* @__PURE__ */ i(
1296
- K,
1297
- {
1298
- sx: {
1299
- px: 16,
1300
- pt: 16,
1301
- width: "100%",
1302
- backgroundColor: "background.paper"
1303
- },
1304
- children: [
1305
- /* @__PURE__ */ e(Y, { sx: { textAlign: "left", pb: 8 }, children: t.pay_bills_on_time_sticky_fee_count }),
1306
- /* @__PURE__ */ e(
1307
- Te,
1308
- {
1309
- transactions: n.spendingFee,
1310
- amountPosition: "flex-start",
1311
- amountColor: "text.primary",
1312
- formatDate: (r) => Mn(new Date(r * 1e3), In.MONTH_DAY),
1313
- secondaryIcon: /* @__PURE__ */ e(qt, { color: "error", filled: !0, size: 12 })
1314
- }
1315
- )
1316
- ]
1317
- }
1318
- ) });
1319
- }, Ko = S(No), jo = () => {
1320
- const { healthScore: t } = P(), { finstrong: o } = C(), { key_indicators_spend: n } = o, { pay_bills_on_time_drawer: r } = n, l = _n(t.spending_fee_transaction_count);
1321
- return /* @__PURE__ */ i(
1322
- u,
1323
- {
1324
- sx: {
1325
- p: 24,
1326
- backgroundColor: "background.paper",
1327
- borderBottom: "1px solid",
1328
- borderColor: "divider"
1329
- },
1330
- children: [
1331
- /* @__PURE__ */ e(w, { variant: "body2", children: r.pay_bills_on_time_sticky_description }),
1332
- /* @__PURE__ */ i(u, { direction: "row", sx: { alignItems: "center", justifyContent: "space-between" }, children: [
1333
- /* @__PURE__ */ i(Ae, { children: [
1334
- t.spending_fee_transaction_count,
1335
- " ",
1336
- r.pay_bills_on_time_sticky_fee_count
1337
- ] }),
1338
- /* @__PURE__ */ e(Ie, { status: l })
1339
- ] })
1340
- ]
1341
- }
1342
- );
1343
- }, Vo = S(jo), Yo = () => {
1344
- const { savingsAndCheckingAccountsBalance: t } = fe(), { finstrong: o } = C();
1345
- return /* @__PURE__ */ i(u, { gap: 16, sx: { p: 16 }, children: [
1346
- /* @__PURE__ */ e(
1347
- he,
1348
- {
1349
- balance: t,
1350
- title: o.key_indicators_save.drawer_available_balance
1351
- }
1352
- ),
1353
- /* @__PURE__ */ e(
1354
- $t,
1355
- {
1356
- loadAccounts: [Fe.SAVINGS, Fe.CHECKING],
1357
- loadMoreLabel: o.more_accounts
1358
- }
1359
- )
1360
- ] });
1361
- }, Xo = S(Yo), Uo = () => {
1362
- const { finstrong: t } = C(), { healthScore: o, allTransactions: n, loadSpendTransactions: r, loadDebtSpend: l } = P(), { isInitialized: s } = X();
1363
- _.useEffect(() => {
1364
- s && (r().finally(), l().finally());
1365
- }, [s]);
1366
- const a = _.useMemo(() => {
1367
- const d = n.spend.map((p) => p.transaction), c = n.debtSpend.map((p) => p.transaction);
1368
- return [...d, ...c];
1369
- }, [n.spend, n.debtSpend]);
1370
- return s ? /* @__PURE__ */ i(u, { gap: 16, sx: { p: 16 }, children: [
1371
- /* @__PURE__ */ e(
1372
- he,
1373
- {
1374
- balance: o.ninety_day_spend / 90,
1375
- title: t.key_indicators_save.drawer_daily_spend
1376
- }
1377
- ),
1378
- /* @__PURE__ */ e(Te, { amountColor: "text.primary", transactions: a })
1379
- ] }) : /* @__PURE__ */ e(te, {});
1380
- }, qo = S(Uo), Zo = () => {
1381
- const [t, o] = _.useState(0), { finstrong: n } = C();
1382
- return /* @__PURE__ */ i(E, { children: [
1383
- /* @__PURE__ */ i(K, { children: [
1384
- /* @__PURE__ */ i(
1385
- Ge,
1386
- {
1387
- "aria-label": n.key_indicators_save.drawer_title,
1388
- centered: !0,
1389
- onChange: (r, l) => o(l),
1390
- sx: { mb: 0 },
1391
- value: t,
1392
- variant: "fullWidth",
1393
- children: [
1394
- /* @__PURE__ */ e(
1395
- re,
1396
- {
1397
- "aria-controls": "available-details-tabpanel-0",
1398
- label: n.key_indicators_save.drawer_available,
1399
- sx: { minHeight: 44 }
1400
- }
1401
- ),
1402
- /* @__PURE__ */ e(
1403
- re,
1404
- {
1405
- "aria-controls": "spending-details-tabpanel-1",
1406
- label: n.key_indicators_save.drawer_spending,
1407
- sx: { minHeight: 44 }
1408
- }
1409
- )
1410
- ]
1411
- }
1412
- ),
1413
- /* @__PURE__ */ e(ae, { index: 0, name: "available-details", value: t, children: /* @__PURE__ */ e(Xo, {}) }),
1414
- /* @__PURE__ */ e(ae, { index: 1, name: "spending-details", value: t, children: /* @__PURE__ */ e(qo, {}) })
1415
- ] }),
1416
- /* @__PURE__ */ e(Ke, { chartFor: "savingsOverTime" })
1417
- ] });
1418
- }, Qo = S(Zo), Jo = () => {
1419
- const { finstrong: t } = C(), { healthScore: o } = P(), n = o.months_of_cash_on_hand, r = mt(n ? n * 30 : null), l = 183 / 6, s = Math.floor(n), a = Math.round((n - s) * l), d = n / 6 * 100;
1420
- return /* @__PURE__ */ e(
1421
- De,
1422
- {
1423
- bottomComponent: /* @__PURE__ */ e(
1424
- u,
1425
- {
1426
- sx: {
1427
- flexDirection: "row",
1428
- height: 24,
1429
- justifyContent: "space-between",
1430
- mt: 2,
1431
- px: 1
1432
- },
1433
- children: ["0 Mo", "1 Mo", "2 Mo", "3 Mo", "4 Mo", "5 Mo", "6 Mo"].map((p) => /* @__PURE__ */ i(
1434
- u,
1435
- {
1436
- sx: {
1437
- alignItems: "center",
1438
- height: 24
1439
- },
1440
- children: [
1441
- /* @__PURE__ */ e(
1442
- ee,
1443
- {
1444
- orientation: "vertical",
1445
- sx: {
1446
- borderWidth: 1,
1447
- height: 8
1448
- }
1449
- }
1450
- ),
1451
- /* @__PURE__ */ e(T, { variant: "XSmall", children: p })
1452
- ]
1453
- },
1454
- p
1455
- ))
1456
- }
1457
- ),
1458
- label: t.key_indicators_save.drawer_progress_bar_label,
1459
- status: r,
1460
- statusBarData: [
1461
- {
1462
- percentage: `${d}%`
1463
- }
1464
- ],
1465
- value: V(t.key_indicators_save.drawer_progress_bar_value, s, a)
1466
- }
1467
- );
1468
- }, er = S(Jo), tr = () => {
1469
- const { healthScore: t } = P(), { finstrong: o } = C(), n = ve(t.debt_to_income_ratio) ?? 0, r = Object.keys(t).length === 0, s = ((a) => r ? "MISSING" : a <= 30 ? "GOOD" : a >= 31 && a <= 39 ? "FAIR" : a >= 40 ? "OFF_TRACK" : "MISSING")(n);
1470
- return /* @__PURE__ */ e(
1471
- De,
1472
- {
1473
- bottomComponent: /* @__PURE__ */ i(
1474
- u,
1475
- {
1476
- sx: {
1477
- alignItems: "flex-end",
1478
- flexDirection: "row",
1479
- height: 24,
1480
- justifyContent: "space-between",
1481
- mt: 2,
1482
- position: "relative"
1483
- },
1484
- children: [
1485
- /* @__PURE__ */ e(
1486
- A,
1487
- {
1488
- sx: {
1489
- left: "30%",
1490
- position: "absolute",
1491
- transform: "translateX(-50%)"
1492
- },
1493
- children: /* @__PURE__ */ i(
1494
- u,
1495
- {
1496
- sx: {
1497
- alignItems: "center",
1498
- flexDirection: "column",
1499
- height: 24,
1500
- justifyContent: "flex-end"
1501
- },
1502
- children: [
1503
- /* @__PURE__ */ e(
1504
- ee,
1505
- {
1506
- orientation: "vertical",
1507
- sx: {
1508
- borderWidth: 1,
1509
- height: 8
1510
- }
1511
- }
1512
- ),
1513
- /* @__PURE__ */ e(T, { sx: { color: "text.primary" }, variant: "XSmall", children: "30%" })
1514
- ]
1515
- }
1516
- )
1517
- }
1518
- ),
1519
- /* @__PURE__ */ e(
1520
- A,
1521
- {
1522
- sx: {
1523
- display: "flex",
1524
- flexDirection: "column",
1525
- height: 24,
1526
- justifyContent: "center",
1527
- marginLeft: "auto"
1528
- },
1529
- children: /* @__PURE__ */ e(T, { variant: "Small", children: V(
1530
- o.key_indicators_borrow.have_manageable_debt.have_manageable_debt_sticky_description,
1531
- n
1532
- ) })
1533
- }
1534
- )
1535
- ]
1536
- }
1537
- ),
1538
- label: o.key_indicators_borrow.have_manageable_debt.have_manageable_debt_sticky_title,
1539
- status: s,
1540
- statusBarData: [
1541
- {
1542
- percentage: `${n}%`
1543
- }
1544
- ],
1545
- value: F(t.ninety_day_debt_spend, "0,0.00")
1546
- }
1547
- );
1548
- }, nr = S(tr), or = () => {
1549
- const { healthScore: t, allTransactions: o } = P(), { connect: n, finstrong: r } = C(), [l, s] = _.useState(!1);
1550
- return /* @__PURE__ */ i(u, { gap: 16, sx: { p: 16 }, children: [
1551
- /* @__PURE__ */ e(
1552
- he,
1553
- {
1554
- balance: t.ninety_day_income,
1555
- sx: { flexDirection: "column-reverse" },
1556
- title: r.key_indicators_borrow.have_manageable_debt.have_manageable_debt_income
1557
- }
1558
- ),
1559
- o.income.length ? (
1560
- // TODO: Need to add More Transactions functionality
1561
- /* @__PURE__ */ e(Te, { transactions: o.income.map((a) => a.transaction) })
1562
- ) : /* @__PURE__ */ e(
1563
- L,
1564
- {
1565
- onClick: () => {
1566
- s(!0);
1567
- },
1568
- variant: "contained",
1569
- children: r.connect_more_accounts_button
1570
- }
1571
- ),
1572
- /* @__PURE__ */ e(
1573
- ne,
1574
- {
1575
- onClose: () => s(!1),
1576
- showConnectWidget: l,
1577
- title: n.mini_title
1578
- }
1579
- )
1580
- ] });
1581
- }, rr = S(or), ar = () => {
1582
- const { allTransactions: t, healthScore: o } = P(), { connect: n, finstrong: r } = C(), [l, s] = _.useState(!1);
1583
- return /* @__PURE__ */ i(u, { gap: 16, sx: { p: 16 }, children: [
1584
- /* @__PURE__ */ e(
1585
- he,
1586
- {
1587
- balance: o.ninety_day_debt_spend,
1588
- sx: { flexDirection: "column-reverse" },
1589
- title: r.key_indicators_borrow.have_manageable_debt.have_manageable_debt_payments
1590
- }
1591
- ),
1592
- t.debtSpend.length ? (
1593
- //TODO: Need to add More Transactions functionality
1594
- /* @__PURE__ */ e(
1595
- Te,
1596
- {
1597
- amountColor: "text.primary",
1598
- transactions: t.debtSpend.map((a) => a.transaction)
1599
- }
1600
- )
1601
- ) : /* @__PURE__ */ e(
1602
- L,
1603
- {
1604
- onClick: () => {
1605
- s(!0);
1606
- },
1607
- variant: "contained",
1608
- children: r.connect_more_accounts_button
1609
- }
1610
- ),
1611
- /* @__PURE__ */ e(
1612
- ne,
1613
- {
1614
- onClose: () => s(!1),
1615
- showConnectWidget: l,
1616
- title: n.mini_title
1617
- }
1618
- )
1619
- ] });
1620
- }, ir = S(ar), sr = ({
1621
- color: t,
1622
- data: o,
1623
- series: n,
1624
- style: r,
1625
- ...l
1626
- }) => {
1627
- const s = H(), a = _.useRef(null), { width: d } = Kn({
1628
- width: r.width
1629
- });
1630
- _.useLayoutEffect(() => {
1631
- const m = new ResizeObserver(() => {
1632
- window.requestAnimationFrame(() => {
1633
- if (a.current) {
1634
- const { width: g } = a.current.getBoundingClientRect(), x = g / 2, k = a.current.querySelector("text");
1635
- k && k.setAttribute("transform", `translate(${x}, -8)`);
1636
- }
1637
- });
1638
- });
1639
- return a.current && m.observe(a.current), () => {
1640
- a.current && m.unobserve(a.current);
1641
- };
1642
- }, []);
1643
- const { formattedComparison: c, formattedMain: p } = o[n.index], h = n.type === 0 ? p : c;
1644
- return /* @__PURE__ */ i("g", { children: [
1645
- /* @__PURE__ */ e(et.rect, { ...l, fill: t, ref: a, rx: 2, style: r }),
1646
- /* @__PURE__ */ e(
1647
- et.text,
1648
- {
1649
- fill: s.palette.text.secondary,
1650
- fontSize: 9,
1651
- fontWeight: 400,
1652
- textAnchor: "middle",
1653
- transform: d.to((m) => `translate(${m / 2}, -5)`),
1654
- x: r.x,
1655
- y: r.y,
1656
- children: h
1657
- }
1658
- )
1659
- ] });
1660
- }, Lt = ({
1661
- chartFor: t,
1662
- data: o,
1663
- title: n,
1664
- buttonLabel: r,
1665
- onClick: l,
1666
- legendLabelMain: s,
1667
- legendLabelComparison: a,
1668
- totalComparison: d,
1669
- totalMain: c
1670
- }) => {
1671
- const p = H(), h = zn(p.breakpoints.down("xs")), m = _.useMemo(
1672
- () => o.sort((f, v) => f.month - v.month).map((f) => {
1673
- const v = mn(f.month), O = {
1674
- spending_vs_income: {
1675
- main: f.standard_spend,
1676
- comparison: f.income,
1677
- formattedMain: F(f.standard_spend, "0.0a"),
1678
- formattedComparison: F(f.income, "0.0a")
1679
- },
1680
- debt_payment_vs_income: {
1681
- main: f.income,
1682
- comparison: f.debt_spend,
1683
- formattedMain: F(f.income, "0.0a"),
1684
- formattedComparison: F(f.debt_spend, "0.0a")
1685
- }
1686
- };
1687
- return {
1688
- label: v,
1689
- ...O[t]
1690
- };
1691
- }),
1692
- [o, t]
1693
- ), g = {
1694
- dataKey: "label",
1695
- scaleType: "band"
1696
- }, x = Math.max(...m.map((f) => Math.max(f.main, f.comparison))), k = Math.ceil(x * 1.2 / 1e3) * 1e3, y = k / 3, b = {
1697
- scaleType: "linear",
1698
- min: 0,
1699
- max: k,
1700
- tickNumber: 4,
1701
- tickMinStep: y,
1702
- valueFormatter: (f) => f === 0 ? "$0" : `$${(f / 1e3).toFixed(0)}K`
1703
- };
1704
- return /* @__PURE__ */ i(
1705
- K,
1706
- {
1707
- sx: {
1708
- px: 16,
1709
- py: 24
1710
- },
1711
- children: [
1712
- /* @__PURE__ */ i(
1713
- u,
1714
- {
1715
- sx: {
1716
- alignItems: "center",
1717
- flexDirection: "row",
1718
- justifyContent: "space-between",
1719
- gap: 12,
1720
- pb: 8
1721
- },
1722
- children: [
1723
- /* @__PURE__ */ e(Y, { children: n }),
1724
- r && /* @__PURE__ */ e(
1725
- L,
1726
- {
1727
- endIcon: /* @__PURE__ */ e(Z, {}),
1728
- onClick: l,
1729
- size: "small",
1730
- sx: {
1731
- pl: 8,
1732
- height: 24
1733
- },
1734
- variant: "text",
1735
- children: r
1736
- }
1737
- )
1738
- ]
1739
- }
1740
- ),
1741
- /* @__PURE__ */ i(u, { sx: { alignItems: "center", flexDirection: "row", gap: 24, py: 4 }, children: [
1742
- /* @__PURE__ */ i(u, { sx: { gap: 8, alignItems: "center", flexDirection: "row" }, children: [
1743
- /* @__PURE__ */ e(
1744
- A,
1745
- {
1746
- sx: {
1747
- width: 10,
1748
- height: 10,
1749
- backgroundColor: "chart.chart3",
1750
- borderRadius: "2px"
1751
- }
1752
- }
1753
- ),
1754
- /* @__PURE__ */ i(u, { sx: { alignItems: "center", flexDirection: "row" }, children: [
1755
- /* @__PURE__ */ i(T, { variant: "subtitle2", children: [
1756
- s,
1757
- " "
1758
- ] }),
1759
- !h && c && /* @__PURE__ */ e(T, { bold: !0, variant: "subtitle2", children: c })
1760
- ] })
1761
- ] }),
1762
- /* @__PURE__ */ i(u, { alignItems: "center", direction: "row", spacing: 8, children: [
1763
- /* @__PURE__ */ e(
1764
- A,
1765
- {
1766
- sx: {
1767
- width: 10,
1768
- height: 10,
1769
- backgroundColor: "chart.chart5",
1770
- borderRadius: "2px"
1771
- }
1772
- }
1773
- ),
1774
- /* @__PURE__ */ i(u, { sx: { alignItems: "center", flexDirection: "row" }, children: [
1775
- /* @__PURE__ */ i(T, { variant: "subtitle2", children: [
1776
- a,
1777
- " "
1778
- ] }),
1779
- !h && d && /* @__PURE__ */ e(T, { bold: !0, variant: "subtitle2", children: d })
1780
- ] })
1781
- ] })
1782
- ] }),
1783
- /* @__PURE__ */ i(
1784
- Nn,
1785
- {
1786
- colors: [`${p.palette.chart.chart3}`, `${p.palette.chart.chart5}`],
1787
- dataset: m,
1788
- height: 240,
1789
- margin: { top: 20, bottom: 30, right: 10 },
1790
- series: [
1791
- { dataKey: "main", type: "bar" },
1792
- { dataKey: "comparison", type: "bar" }
1793
- ],
1794
- xAxis: [g],
1795
- yAxis: [b],
1796
- children: [
1797
- /* @__PURE__ */ e(
1798
- Vt,
1799
- {
1800
- slots: {
1801
- bar: (f) => {
1802
- const { ownerState: v, style: O, ...M } = f;
1803
- return /* @__PURE__ */ e(
1804
- sr,
1805
- {
1806
- ...M,
1807
- color: v.color,
1808
- data: m,
1809
- series: {
1810
- index: v.dataIndex,
1811
- type: Number(v.id.toString().split("-").pop())
1812
- },
1813
- style: O
1814
- }
1815
- );
1816
- }
1817
- }
1818
- }
1819
- ),
1820
- /* @__PURE__ */ e(
1821
- Gn,
1822
- {
1823
- sx: () => ({
1824
- ".MuiChartsAxis-line": {
1825
- stroke: p.palette.divider
1826
- },
1827
- ".MuiChartsAxis-tick": {
1828
- stroke: p.palette.divider
1829
- },
1830
- ".MuiChartsAxis-tickLabel": {
1831
- transform: "translateY(10px)"
1832
- }
1833
- }),
1834
- tickLabelStyle: {
1835
- fontSize: 11,
1836
- fill: "text.secondary"
1837
- }
1838
- }
1839
- ),
1840
- /* @__PURE__ */ e(
1841
- Hn,
1842
- {
1843
- sx: () => ({
1844
- ".MuiChartsAxis-line": {
1845
- stroke: p.palette.divider
1846
- },
1847
- ".MuiChartsAxis-tick": {
1848
- stroke: p.palette.divider
1849
- },
1850
- ".MuiChartsAxis-tickLabel": {
1851
- transform: "translateX(-8px)"
1852
- }
1853
- }),
1854
- tickLabelStyle: {
1855
- fontSize: 11,
1856
- fill: "text.secondary"
1857
- }
1858
- }
1859
- )
1860
- ]
1861
- }
1862
- )
1863
- ]
1864
- }
1865
- );
1866
- }, cr = () => {
1867
- const { loadDebtSpend: t, loadIncome: o, monthlySummaries: n } = P(), { isInitialized: r } = X(), [l, s] = _.useState(0), { finstrong: a } = C();
1868
- return _.useEffect(() => {
1869
- r && (t().finally(), o().finally());
1870
- }, [r]), /* @__PURE__ */ i(E, { children: [
1871
- /* @__PURE__ */ i(K, { children: [
1872
- /* @__PURE__ */ i(
1873
- Ge,
1874
- {
1875
- "aria-label": a.key_indicators_save.drawer_title,
1876
- centered: !0,
1877
- onChange: (d, c) => s(c),
1878
- sx: { mb: 0 },
1879
- value: l,
1880
- variant: "fullWidth",
1881
- children: [
1882
- /* @__PURE__ */ e(
1883
- re,
1884
- {
1885
- "aria-controls": "income-details-tabpanel-0",
1886
- id: "income-details-tab-0",
1887
- label: a.key_indicators_borrow.have_manageable_debt.income,
1888
- sx: { minHeight: 44 }
1889
- }
1890
- ),
1891
- /* @__PURE__ */ e(
1892
- re,
1893
- {
1894
- "aria-controls": "debt-payment-details-tabpanel-1",
1895
- id: "debt-payment-details-tab-1",
1896
- label: a.key_indicators_borrow.have_manageable_debt.debt_payment,
1897
- sx: { minHeight: 44 }
1898
- }
1899
- )
1900
- ]
1901
- }
1902
- ),
1903
- /* @__PURE__ */ e(
1904
- ae,
1905
- {
1906
- "aria-labelledby": "income-details-tab-0",
1907
- index: 0,
1908
- name: "income-details",
1909
- value: l,
1910
- children: /* @__PURE__ */ e(rr, {})
1911
- }
1912
- ),
1913
- /* @__PURE__ */ e(
1914
- ae,
1915
- {
1916
- "aria-labelledby": "debt-payment-details-tab-1",
1917
- index: 1,
1918
- name: "debt-payment-details",
1919
- value: l,
1920
- children: /* @__PURE__ */ e(ir, {})
1921
- }
1922
- )
1923
- ] }),
1924
- n.length ? /* @__PURE__ */ i(E, { children: [
1925
- /* @__PURE__ */ e(
1926
- Lt,
1927
- {
1928
- chartFor: "debt_payment_vs_income",
1929
- data: n,
1930
- legendLabelComparison: a.key_indicators_borrow.have_manageable_debt.debt_payment,
1931
- legendLabelMain: a.key_indicators_borrow.have_manageable_debt.income,
1932
- title: a.key_indicators_borrow.have_manageable_debt.debt_payment
1933
- }
1934
- ),
1935
- /* @__PURE__ */ e(Ke, { chartFor: "debtOverTime" })
1936
- ] }) : /* @__PURE__ */ i(E, { children: [
1937
- /* @__PURE__ */ e(
1938
- we,
1939
- {
1940
- header: a.key_indicators_borrow.have_manageable_debt.have_manageable_debt_double_bar_chart_empty_state_header,
1941
- icon: "multiline_chart",
1942
- subText: a.key_indicators_borrow.have_manageable_debt.have_manageable_debt_double_bar_chart_empty_state_description,
1943
- sx: {
1944
- backgroundColor: "background.paper",
1945
- borderRadius: "8px",
1946
- boxShadow: 1,
1947
- p: 24,
1948
- pb: 48
1949
- },
1950
- variant: "no-buttons"
1951
- }
1952
- ),
1953
- /* @__PURE__ */ e(
1954
- we,
1955
- {
1956
- header: a.key_indicators_borrow.have_manageable_debt.have_manageable_debt_line_chart_empty_state_header,
1957
- icon: "multiline_chart",
1958
- subText: a.key_indicators_borrow.have_manageable_debt.have_manageable_debt_line_chart_empty_state_description,
1959
- sx: {
1960
- backgroundColor: "background.paper",
1961
- borderRadius: "8px",
1962
- boxShadow: 1,
1963
- p: 24,
1964
- pb: 48
1965
- },
1966
- variant: "no-buttons"
1967
- }
1968
- )
1969
- ] })
1970
- ] });
1971
- }, lr = S(cr), dr = () => {
1972
- const { healthScore: t } = P(), { finstrong: o } = C(), n = ve(t.spend_to_income_ratio) ?? 0, r = Object.keys(t).length === 0, s = ((d) => r ? "MISSING" : d < 100 ? "GOOD" : d >= 100 && d <= 109 ? "FAIR" : d >= 110 ? "OFF_TRACK" : "MISSING")(n), a = {
1973
- GOOD: [{ percentage: `${n}%` }],
1974
- FAIR: [{ percentage: "100%" }, { percentage: `${n - 100}%` }],
1975
- OFF_TRACK: [{ percentage: "100%" }, { percentage: `${n - 100}%` }],
1976
- MISSING: [{ percentage: "0%" }]
1977
- }[s];
1978
- return /* @__PURE__ */ e(
1979
- De,
1980
- {
1981
- bottomComponent: /* @__PURE__ */ i(
1982
- u,
1983
- {
1984
- sx: {
1985
- flexDirection: "row",
1986
- justifyContent: "space-between",
1987
- alignItems: "center",
1988
- mt: 8
1989
- },
1990
- children: [
1991
- /* @__PURE__ */ i(T, { variant: "body2", children: [
1992
- r ? "-" : F(t.ninety_day_income, "0,0.00"),
1993
- " ",
1994
- o?.key_indicators_spend.spend_less_than_you_make_drawer.income
1995
- ] }),
1996
- /* @__PURE__ */ i(T, { variant: "body2", children: [
1997
- r ? "-%" : `${n}%`,
1998
- o?.key_indicators_spend.spend_less_than_you_make_drawer.spent
1999
- ] })
2000
- ]
2001
- }
2002
- ),
2003
- label: o?.key_indicators_spend.spend_less_than_you_make_drawer.spend_less_than_you_make_sticky_description,
2004
- status: s,
2005
- statusBarData: a,
2006
- value: r ? "$0" : F(t.ninety_day_spend, "0,0.00")
2007
- }
2008
- );
2009
- }, pr = S(dr), ur = () => {
2010
- const t = H(), { monthlySummaries: o } = P(), { finstrong: n, goals: r, spending: l } = C(), { selectedAccounts: s } = X(), { categories: a, dateRangeCategoryTotals: d, loadDateRangeCategoryTotals: c } = Ee(), { appDataStore: p } = vn(), [h, m] = _.useState("");
2011
- _.useEffect(() => {
2012
- c(
2013
- s,
2014
- It(/* @__PURE__ */ new Date()),
2015
- Dt(/* @__PURE__ */ new Date())
2016
- ).finally();
2017
- }, [s]);
2018
- const g = _.useMemo(
2019
- () => jn(a, r, t, d),
2020
- [a, d]
2021
- ), x = (b) => {
2022
- m(h === b ? "" : b);
2023
- }, { totalSpending: k, totalIncome: y } = _.useMemo(() => o.reduce(
2024
- (b, { standard_spend: f = 0, income: v = 0 }) => ({
2025
- totalSpending: b.totalSpending + f,
2026
- totalIncome: b.totalIncome + v
2027
- }),
2028
- { totalSpending: 0, totalIncome: 0 }
2029
- ), [o]);
2030
- return /* @__PURE__ */ i(u, { sx: { gap: 24 }, children: [
2031
- o.length ? /* @__PURE__ */ e(
2032
- Lt,
2033
- {
2034
- ...p.appData.client_profile?.allow_trends_widget && {
2035
- buttonLabel: n.key_indicators_spend.spend_less_than_you_make_drawer.view_more
2036
- },
2037
- chartFor: "spending_vs_income",
2038
- data: o,
2039
- legendLabelComparison: n.key_indicators_spend.spend_less_than_you_make_drawer.income,
2040
- legendLabelMain: n.key_indicators_spend.spend_less_than_you_make_drawer.spending,
2041
- title: n.key_indicators_spend.spend_less_than_you_make_drawer.trends,
2042
- totalComparison: F(y, "0,0.00"),
2043
- totalMain: F(k, "0,0.00")
2044
- }
2045
- ) : /* @__PURE__ */ e(
2046
- we,
2047
- {
2048
- header: n.key_indicators_spend.spend_less_than_you_make_drawer.trends_zero_state_title,
2049
- icon: "multiline_chart",
2050
- subText: n.key_indicators_spend.spend_less_than_you_make_drawer.trends_zero_state_description,
2051
- sx: {
2052
- backgroundColor: "background.paper",
2053
- borderRadius: "8px",
2054
- boxShadow: 1,
2055
- p: 24,
2056
- pb: 48
2057
- },
2058
- variant: "no-buttons"
2059
- }
2060
- ),
2061
- g ? /* @__PURE__ */ i(
2062
- K,
2063
- {
2064
- sx: {
2065
- px: 16,
2066
- py: 24
2067
- },
2068
- children: [
2069
- /* @__PURE__ */ i(
2070
- u,
2071
- {
2072
- sx: {
2073
- alignItems: "center",
2074
- flexDirection: "row",
2075
- justifyContent: "space-between",
2076
- gap: 12,
2077
- pb: 8
2078
- },
2079
- children: [
2080
- /* @__PURE__ */ e(Y, { children: n.key_indicators_spend.spend_less_than_you_make_drawer.spending }),
2081
- p.appData.client_profile?.allow_spending_widget && /* @__PURE__ */ e(
2082
- L,
2083
- {
2084
- endIcon: /* @__PURE__ */ e(Z, {}),
2085
- size: "small",
2086
- sx: {
2087
- pl: 8,
2088
- height: 24
2089
- },
2090
- variant: "text",
2091
- children: n.key_indicators_spend.spend_less_than_you_make_drawer.view_more
2092
- }
2093
- )
2094
- ]
2095
- }
2096
- ),
2097
- /* @__PURE__ */ i(u, { sx: { gap: 12, py: 16, flexDirection: "row", justifyContent: "center" }, children: [
2098
- /* @__PURE__ */ e(
2099
- Vn,
2100
- {
2101
- data: g,
2102
- onSelected: x,
2103
- selectedId: h,
2104
- totalLabel: l.total_spending
2105
- }
2106
- ),
2107
- /* @__PURE__ */ e(
2108
- Yn,
2109
- {
2110
- data: g,
2111
- onSelected: x,
2112
- selectedId: h
2113
- }
2114
- )
2115
- ] })
2116
- ]
2117
- }
2118
- ) : /* @__PURE__ */ e(
2119
- we,
2120
- {
2121
- header: n.key_indicators_spend.spend_less_than_you_make_drawer.spending_zero_state_title,
2122
- icon: "donut_small",
2123
- subText: n.key_indicators_spend.spend_less_than_you_make_drawer.spending_zero_state_description,
2124
- sx: {
2125
- backgroundColor: "background.paper",
2126
- borderRadius: "8px",
2127
- boxShadow: 1,
2128
- p: 24,
2129
- pb: 48
2130
- },
2131
- variant: "no-buttons"
2132
- }
2133
- )
2134
- ] });
2135
- }, hr = S(ur), Be = {
2136
- credit_score_description: "Credit scores usually go from 300 to 850. Think of 700+ as good, 800+ as awesome, and below 600 as needing work. You can often check yours for free with your bank or credit card company.",
2137
- maintain_emergency_savings_description: "With at least $1,000 saved, you're ready for surprises, freeing you to save for major goals.",
2138
- maintain_emergency_savings_title: "Maintain Emergency Savings"
2139
- }, _r = ({
2140
- drawerFor: t,
2141
- isOpen: o,
2142
- onClose: n
2143
- }) => {
2144
- const { finstrong: r } = C(), s = {
2145
- spendLessThanYouMake: {
2146
- title: r.key_indicators_spend.spend_less_than_you_make_drawer.spend_less_than_you_make_title,
2147
- description: r.key_indicators_spend.spend_less_than_you_make_drawer.spend_less_than_you_make_description,
2148
- stickyComponent: /* @__PURE__ */ e(pr, {}),
2149
- content: /* @__PURE__ */ e(hr, {})
2150
- },
2151
- payBillsOnTime: {
2152
- title: r.key_indicators_spend.pay_bills_on_time_drawer.pay_bills_on_time_title,
2153
- description: r.key_indicators_spend.pay_bills_on_time_drawer.pay_bills_on_time_description,
2154
- stickyComponent: /* @__PURE__ */ e(Vo, {}),
2155
- content: /* @__PURE__ */ e(Ko, {})
2156
- },
2157
- maintainEmergencySavings: {
2158
- content: /* @__PURE__ */ e($o, {}),
2159
- description: Be.maintain_emergency_savings_description,
2160
- stickyComponent: /* @__PURE__ */ e(zo, {}),
2161
- title: Be.maintain_emergency_savings_title
2162
- },
2163
- haveManageableDebt: {
2164
- title: r.key_indicators_borrow.have_manageable_debt.have_manageable_debt_title,
2165
- description: r.key_indicators_borrow.have_manageable_debt.have_manageable_debt_description,
2166
- stickyComponent: /* @__PURE__ */ e(nr, {}),
2167
- content: /* @__PURE__ */ e(lr, {})
2168
- },
2169
- haveAGoodCreditScore: {
2170
- title: /* @__PURE__ */ e(Ao, {}),
2171
- description: Be.credit_score_description,
2172
- stickyComponent: null,
2173
- content: /* @__PURE__ */ e(vo, {})
2174
- },
2175
- saveEnoughToLiveOn: {
2176
- title: r.key_indicators_save.drawer_title,
2177
- description: r.key_indicators_save.drawer_description,
2178
- stickyComponent: /* @__PURE__ */ e(er, {}),
2179
- content: /* @__PURE__ */ e(Qo, {})
2180
- }
2181
- }[t];
2182
- return /* @__PURE__ */ e(
2183
- Rt,
2184
- {
2185
- description: s?.description,
2186
- drawerTitle: r.key_indicators,
2187
- isOpen: o,
2188
- loadConnectAccountsCard: !0,
2189
- onClose: n,
2190
- stickyComponent: s.stickyComponent,
2191
- title: s.title,
2192
- children: /* @__PURE__ */ e(u, { sx: { gap: 16 }, children: s.content })
2193
- }
2194
- );
2195
- }, mr = S(_r), ue = ({
2196
- drawerFor: t,
2197
- title: o,
2198
- description: n,
2199
- cardState: r = "MISSING"
2200
- }) => {
2201
- const [l, s] = _.useState(!1);
2202
- return /* @__PURE__ */ i(E, { children: [
2203
- /* @__PURE__ */ i(
2204
- u,
2205
- {
2206
- onClick: () => s(!0),
2207
- sx: {
2208
- alignItems: "center",
2209
- flexDirection: "row",
2210
- justifyContent: "space-between",
2211
- gap: 12,
2212
- p: 16,
2213
- border: "1px solid",
2214
- borderColor: "divider",
2215
- borderRadius: 2,
2216
- cursor: "pointer"
2217
- },
2218
- children: [
2219
- /* @__PURE__ */ i(u, { sx: { gap: 4 }, children: [
2220
- /* @__PURE__ */ i(u, { sx: { alignItems: "center", flexDirection: "row", gap: 8 }, children: [
2221
- /* @__PURE__ */ e(w, { sx: { fontWeight: 600 }, variant: "body1", children: o }),
2222
- /* @__PURE__ */ e(Ie, { status: r })
2223
- ] }),
2224
- /* @__PURE__ */ e(w, { color: "secondary", variant: "subtitle2", children: n })
2225
- ] }),
2226
- /* @__PURE__ */ e(Z, { color: "secondary", size: 24 })
2227
- ]
2228
- }
2229
- ),
2230
- /* @__PURE__ */ e(
2231
- mr,
2232
- {
2233
- drawerFor: t,
2234
- isOpen: l,
2235
- onClose: () => s(!1)
2236
- }
2237
- )
2238
- ] });
2239
- }, gr = () => {
2240
- const { finstrong: t } = C(), { key_indicators_spend: o } = t, { healthScore: n } = P(), r = (a) => {
2241
- const d = yn(a), c = {
2242
- GOOD: o.ratio_good_description,
2243
- FAIR: o.ratio_fair_description,
2244
- OFF_TRACK: o.ratio_off_track_description,
2245
- MISSING: o.ratio_missing_description
2246
- }, p = d === "MISSING" ? c[d] : V(c[d], a);
2247
- return {
2248
- cardState: d,
2249
- description: p,
2250
- title: o.ratio_card_title
2251
- };
2252
- }, { spendToIncomeRatio: l, spendFeeCount: s } = _.useMemo(() => {
2253
- const a = n.spend_to_income_ratio !== null ? Math.round(n.spend_to_income_ratio * 100) : null, d = r(a), c = gn(
2254
- n.spending_fee_transaction_count,
2255
- o
2256
- );
2257
- return { spendToIncomeRatio: d, spendFeeCount: c };
2258
- }, [
2259
- n.spend_to_income_ratio,
2260
- n.spending_fee_transaction_count,
2261
- o,
2262
- t
2263
- ]);
2264
- return /* @__PURE__ */ i(u, { sx: { gap: 24, p: 8, pt: 24 }, children: [
2265
- /* @__PURE__ */ e(
2266
- ue,
2267
- {
2268
- cardState: l.cardState,
2269
- description: l.description,
2270
- drawerFor: se.SpendLessThanYouMake,
2271
- title: l.title
2272
- }
2273
- ),
2274
- /* @__PURE__ */ e(
2275
- ue,
2276
- {
2277
- cardState: s.cardState,
2278
- description: s.description,
2279
- drawerFor: se.PayBillsOnTime,
2280
- title: s.title
2281
- }
2282
- )
2283
- ] });
2284
- }, yr = S(gr), br = () => {
2285
- const { healthScore: t } = P(), { finstrong: o } = C(), { key_indicators_save: n } = o, r = (d) => {
2286
- const c = mt(d), p = {
2287
- GOOD: n.days_of_cash_good_description,
2288
- FAIR: n.days_of_cash_fair_description,
2289
- OFF_TRACK: n.days_of_cash_off_track_description,
2290
- MISSING: n.days_of_cash_missing_description
2291
- }, h = c === "MISSING" ? p[c] : V(p[c], d);
2292
- return {
2293
- cardState: c,
2294
- description: h,
2295
- title: n.days_of_cash_title
2296
- };
2297
- }, l = (d) => {
2298
- const c = _t(d), p = {
2299
- GOOD: n.emergency_savings_good_description,
2300
- FAIR: n.emergency_savings_fair_description,
2301
- OFF_TRACK: n.emergency_savings_off_track_description,
2302
- MISSING: n.emergency_savings_missing_description
2303
- };
2304
- let h;
2305
- return c === "FAIR" && d !== null ? h = V(
2306
- p[c],
2307
- F(d, "0,0.00")
2308
- ) : h = p[c], {
2309
- cardState: c,
2310
- description: h,
2311
- title: n.emergency_savings_title
2312
- };
2313
- }, { daysOfCashOnHand: s, emergencySavings: a } = _.useMemo(() => {
2314
- const d = t.months_of_cash_on_hand !== null ? Math.round(t.months_of_cash_on_hand * 30) : null, c = r(d), p = t.emergency_savings_on_hand !== null ? Math.round(t.emergency_savings_on_hand) : null, h = l(p);
2315
- return { daysOfCashOnHand: c, emergencySavings: h };
2316
- }, [
2317
- t.months_of_cash_on_hand,
2318
- t.emergency_savings_on_hand,
2319
- n,
2320
- o
2321
- ]);
2322
- return /* @__PURE__ */ i(u, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
2323
- /* @__PURE__ */ e(
2324
- ue,
1005
+ /* @__PURE__ */ e(
1006
+ B,
2325
1007
  {
2326
1008
  cardState: s.cardState,
2327
1009
  description: s.description,
2328
- drawerFor: se.SaveEnoughToLiveOn,
1010
+ stateTitle: s.stateTitle,
2329
1011
  title: s.title
2330
1012
  }
2331
- ),
2332
- /* @__PURE__ */ e(
2333
- ue,
2334
- {
2335
- cardState: a.cardState,
2336
- description: a.description,
2337
- drawerFor: se.MaintainEmergencySavings,
2338
- title: a.title
2339
- }
2340
1013
  )
2341
1014
  ] });
2342
- }, fr = S(br), xr = () => {
2343
- const { healthScore: t } = P(), { finstrong: o } = C(), { key_indicators_borrow: n } = o, { user: r } = Q(), l = (c) => {
2344
- const p = bn(c), h = {
2345
- GOOD: n.manage_debit_good_description,
2346
- FAIR: n.manage_debit_fair_description,
2347
- OFF_TRACK: n.manage_debit_off_track_description,
2348
- MISSING: n.manage_debit_missing_description
2349
- }, m = p === "FAIR" || p === "OFF_TRACK" ? V(h[p], c) : h[p];
2350
- return {
2351
- cardState: p,
1015
+ }, Rt = () => {
1016
+ const { healthScore: n } = $(), { finstrong: o } = S(), { key_indicators_borrow: t } = o, { user: i } = Y(), d = (a) => {
1017
+ const { good: c, poor: p } = X.debtToIncomeRatio;
1018
+ let h = f.MISSING, m = t.manage_debit_missing_description, _ = o.key_indicators_missing;
1019
+ return a != null && (a <= c ? (h = f.GOOD, m = t.manage_debit_good_description, _ = o.key_indicators_good) : a > c && a <= p ? (h = f.FAIR, m = b(t.manage_debit_fair_description, a), _ = o.key_indicators_fair) : a > p && (h = f.OFF_TRACK, m = b(
1020
+ t.manage_debit_off_track_description,
1021
+ a
1022
+ ), _ = o.key_indicators_off_track)), {
1023
+ cardState: h,
2352
1024
  description: m,
2353
- title: n.manage_debit_title
1025
+ title: t.manage_debit_title,
1026
+ stateTitle: _
2354
1027
  };
2355
- }, s = (c) => {
2356
- const p = ht(c), h = {
2357
- GOOD: n.credit_score_good_description,
2358
- FAIR: n.credit_score_fair_description,
2359
- OFF_TRACK: n.credit_score_off_track_description,
2360
- MISSING: n.credit_score_missing_description
2361
- }, m = p === "MISSING" ? h[p] : V(h[p], c);
2362
- return {
2363
- cardState: p,
1028
+ }, l = (a) => {
1029
+ const { good: c, poor: p } = X.creditScore;
1030
+ let h = f.MISSING, m = t.credit_score_missing_description, _ = o.key_indicators_missing;
1031
+ return a !== null && (a >= c ? (h = f.GOOD, m = b(t.credit_score_good_description, a), _ = o.key_indicators_good) : a < c && a >= p ? (h = f.FAIR, m = b(t.credit_score_fair_description, a), _ = o.key_indicators_fair) : a < p && (h = f.OFF_TRACK, m = b(
1032
+ t.credit_score_off_track_description,
1033
+ a
1034
+ ), _ = o.key_indicators_off_track)), {
1035
+ cardState: h,
2364
1036
  description: m,
2365
- title: n.credit_score_title
1037
+ title: t.credit_score_title,
1038
+ stateTitle: _
2366
1039
  };
2367
- }, { manageDebtStatus: a, creditScoreStatus: d } = _.useMemo(() => {
2368
- const c = t.debt_to_income_ratio !== null ? Math.round(t.debt_to_income_ratio * 100) : null, p = l(c), h = s(r.credit_score || null);
1040
+ }, { manageDebtStatus: s, creditScoreStatus: r } = C.useMemo(() => {
1041
+ const a = n.debt_to_income_ratio !== null ? Math.round(n.debt_to_income_ratio * 100) : null, c = d(a), p = l(i.credit_score || null);
2369
1042
  return {
2370
- manageDebtStatus: p,
2371
- creditScoreStatus: h
1043
+ manageDebtStatus: c,
1044
+ creditScoreStatus: p
2372
1045
  };
2373
- }, [t.debt_to_income_ratio, r.credit_score, n, o]);
2374
- return /* @__PURE__ */ i(u, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
1046
+ }, [n.debt_to_income_ratio, i.credit_score, t, o]);
1047
+ return /* @__PURE__ */ u(g, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
2375
1048
  /* @__PURE__ */ e(
2376
- ue,
1049
+ B,
2377
1050
  {
2378
- cardState: a.cardState,
2379
- description: a.description,
2380
- drawerFor: se.HaveManageableDebt,
2381
- title: a.title
1051
+ cardState: s.cardState,
1052
+ description: s.description,
1053
+ stateTitle: s.stateTitle,
1054
+ title: s.title
2382
1055
  }
2383
1056
  ),
2384
1057
  /* @__PURE__ */ e(
2385
- ue,
1058
+ B,
2386
1059
  {
2387
- cardState: d.cardState,
2388
- description: d.description,
2389
- drawerFor: se.HaveAGoodCreditScore,
2390
- title: d.title
1060
+ cardState: r.cardState,
1061
+ description: r.description,
1062
+ stateTitle: r.stateTitle,
1063
+ title: r.title
2391
1064
  }
2392
1065
  )
2393
1066
  ] });
2394
- }, Sr = S(xr), Cr = () => {
2395
- const [t, o] = _.useState(0), { finstrong: n } = C();
2396
- return /* @__PURE__ */ i(E, { children: [
2397
- /* @__PURE__ */ i(
2398
- Ge,
1067
+ }, Ft = () => {
1068
+ const [n, o] = C.useState(0), { finstrong: t } = S();
1069
+ return /* @__PURE__ */ u(re, { children: [
1070
+ /* @__PURE__ */ u(
1071
+ nt,
2399
1072
  {
2400
1073
  "aria-label": "Key Indicators",
2401
1074
  centered: !0,
2402
- onChange: (r, l) => o(l),
2403
- sx: {
2404
- mb: 0,
2405
- "& .MuiTab-root": {
2406
- minWidth: 0
2407
- }
2408
- },
1075
+ onChange: (i, d) => o(d),
1076
+ sx: { mb: 0 },
2409
1077
  textColor: "primary",
2410
- value: t,
1078
+ value: n,
2411
1079
  variant: "fullWidth",
2412
1080
  children: [
2413
1081
  /* @__PURE__ */ e(
2414
- re,
1082
+ oe,
2415
1083
  {
2416
1084
  "aria-controls": "spend-details-tabpanel-0",
2417
- icon: /* @__PURE__ */ e(Le, { sx: { mr: 8 } }),
1085
+ icon: /* @__PURE__ */ e(ue, { sx: { mr: 8 } }),
2418
1086
  iconPosition: "start",
2419
1087
  id: "spend-details-tab-0",
2420
- label: n.key_indicators_spend.title,
1088
+ label: t.key_indicators_spend.title,
2421
1089
  sx: { minHeight: 44 }
2422
1090
  }
2423
1091
  ),
2424
1092
  /* @__PURE__ */ e(
2425
- re,
1093
+ oe,
2426
1094
  {
2427
1095
  "aria-controls": "save-details-tabpanel-1",
2428
- icon: /* @__PURE__ */ e(Zt, { sx: { mr: 8 } }),
1096
+ icon: /* @__PURE__ */ e(Ge, { sx: { mr: 8 } }),
2429
1097
  iconPosition: "start",
2430
1098
  id: "save-details-tab-1",
2431
- label: n.key_indicators_save.title,
1099
+ label: t.key_indicators_save.title,
2432
1100
  sx: { minHeight: 44 }
2433
1101
  }
2434
1102
  ),
2435
1103
  /* @__PURE__ */ e(
2436
- re,
1104
+ oe,
2437
1105
  {
2438
1106
  "aria-controls": "borrow-details-tabpanel-2",
2439
- icon: /* @__PURE__ */ e(Qt, { sx: { mr: 8 } }),
1107
+ icon: /* @__PURE__ */ e(Le, { sx: { mr: 8 } }),
2440
1108
  iconPosition: "start",
2441
1109
  id: "borrow-details-tab-2",
2442
- label: n.key_indicators_borrow.title,
1110
+ label: t.key_indicators_borrow.title,
2443
1111
  sx: { minHeight: 44 }
2444
1112
  }
2445
1113
  )
2446
1114
  ]
2447
1115
  }
2448
1116
  ),
2449
- /* @__PURE__ */ e(ae, { index: 0, name: "spend-details", value: t, children: /* @__PURE__ */ e(yr, {}) }),
2450
- /* @__PURE__ */ e(ae, { index: 1, name: "save-details", value: t, children: /* @__PURE__ */ e(fr, {}) }),
2451
- /* @__PURE__ */ e(ae, { index: 2, name: "borrow-details", value: t, children: /* @__PURE__ */ e(Sr, {}) })
1117
+ /* @__PURE__ */ e(ne, { index: 0, name: "spend-details", value: n, children: /* @__PURE__ */ e(Tt, {}) }),
1118
+ /* @__PURE__ */ e(ne, { index: 1, name: "save-details", value: n, children: /* @__PURE__ */ e(wt, {}) }),
1119
+ /* @__PURE__ */ e(ne, { index: 2, name: "borrow-details", value: n, children: /* @__PURE__ */ e(Rt, {}) })
2452
1120
  ] });
2453
- }, vr = S(Cr), kr = ({ onClick: t }) => {
2454
- const { finstrong: o } = C(), { isCopyLoaded: n } = X();
2455
- return n ? /* @__PURE__ */ i(u, { sx: { alignItems: "center", gap: 12, pt: 12, pb: 32 }, children: [
2456
- /* @__PURE__ */ e(lt, { size: 48 }),
2457
- /* @__PURE__ */ i(u, { sx: { alignItems: "center", gap: 4, textAlign: "center" }, children: [
2458
- /* @__PURE__ */ e(Y, { children: o.missing_data_title }),
2459
- /* @__PURE__ */ e(w, { sx: { width: { sm: 348 } }, variant: "subtitle1", children: o.missing_data_description })
1121
+ }, Pt = ({
1122
+ additionalContent: n,
1123
+ children: o,
1124
+ description: t,
1125
+ drawerTitle: i,
1126
+ isOpen: d,
1127
+ loadConnectAccountsCard: l = !0,
1128
+ onClose: s,
1129
+ stickyComponent: r,
1130
+ title: a
1131
+ }) => {
1132
+ const { finstrong: c } = S(), { isCopyLoaded: p } = z();
1133
+ return p ? /* @__PURE__ */ u(V, { isOpen: d, onClose: s, title: i || c.key_indicators, children: [
1134
+ (a || t) && /* @__PURE__ */ u(g, { sx: { p: 24, pb: 0, gap: 8, backgroundColor: "background.paper" }, children: [
1135
+ a && /* @__PURE__ */ e(H, { children: a }),
1136
+ t && /* @__PURE__ */ e(y, { children: t })
2460
1137
  ] }),
2461
- /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
2462
- L,
2463
- {
2464
- endIcon: /* @__PURE__ */ e(Z, {}),
2465
- onClick: t,
2466
- size: "small",
2467
- sx: {
2468
- fontSize: 13,
2469
- ":hover": {
2470
- bgcolor: "transparent"
2471
- }
2472
- },
2473
- variant: "text",
2474
- children: o.connect_more_accounts_button
2475
- }
2476
- ) })
2477
- ] }) : /* @__PURE__ */ e(te, {});
2478
- }, wr = S(kr), Ar = {
2479
- add_more_income: "Add More Income"
2480
- }, Mr = ({
2481
- incomeTransactions: t,
2482
- setCurrentStep: o,
2483
- transaction: n
2484
- }) => /* @__PURE__ */ i(_.Fragment, { children: [
2485
- /* @__PURE__ */ i(u, { children: [
2486
- !!t.length && /* @__PURE__ */ e(A, { sx: { pb: 24 }, children: t.reduce((r, l, s) => {
2487
- if (l.guid === n.guid) return r;
2488
- const a = $e(s, t), d = wt(s, t);
2489
- return r.push(
2490
- /* @__PURE__ */ i(_.Fragment, { children: [
2491
- a && /* @__PURE__ */ e(At, { children: Ne(l.date) }),
2492
- /* @__PURE__ */ e(Mt, { transaction: l }),
2493
- /* @__PURE__ */ e(ee, { sx: { ml: d ? 44 : 0 } })
2494
- ] }, l.guid)
2495
- ), r;
2496
- }, []) }),
2497
- /* @__PURE__ */ e(
2498
- Un,
2499
- {
2500
- firstDay: 1,
2501
- frequency: Pn.EveryMonth,
2502
- onFirstDayChange: () => {
2503
- },
2504
- onFrequencyChange: () => {
2505
- },
2506
- onSecondDayChange: () => {
2507
- },
2508
- secondDay: 15,
2509
- transaction: n
2510
- }
2511
- )
2512
- ] }),
2513
- /* @__PURE__ */ e(A, { sx: { px: 24 }, children: /* @__PURE__ */ e(
2514
- L,
2515
- {
2516
- fullWidth: !0,
2517
- onClick: () => o({ step: D.MonthlyIncome, type: "main" }),
2518
- startIcon: /* @__PURE__ */ e(dt, {}),
2519
- children: Ar.add_more_income
2520
- }
2521
- ) })
2522
- ] }), Ir = S(Mr), Dr = {
2523
- select_date: "Select Date"
2524
- }, Tr = ({ selectedDate: t, setSelectedDate: o }) => {
2525
- const n = H(), r = (l) => {
2526
- o(Math.floor(new Date(l).getTime() / 1e3));
2527
- };
2528
- return /* @__PURE__ */ e(A, { sx: { p: 24 }, children: /* @__PURE__ */ e(Qn, { dateAdapter: Tt, children: /* @__PURE__ */ e(
2529
- Jn,
2530
- {
2531
- disableFuture: !0,
2532
- label: Dr.select_date,
2533
- onChange: r,
2534
- slotProps: {
2535
- nextIconButton: {
2536
- sx: {
2537
- color: "primary.main",
2538
- "&:hover": { bgcolor: pe(n.palette.primary.light, 0.1) }
2539
- }
2540
- },
2541
- previousIconButton: {
2542
- sx: {
2543
- color: "primary.main",
2544
- "&:hover": { bgcolor: pe(n.palette.primary.light, 0.1) }
2545
- }
2546
- }
2547
- },
2548
- sx: {
2549
- width: "100%",
2550
- "& .MuiIconButton-edgeEnd": {
2551
- color: "primary.main",
2552
- "&:hover": { bgcolor: pe(n.palette.primary.light, 0.1) }
2553
- }
2554
- },
2555
- value: t ? new Date(t * 1e3) : null
2556
- }
2557
- ) }) });
2558
- }, Or = S(Tr), Pr = {
2559
- credit_score: "Credit Score"
2560
- }, Br = ({ creditScore: t, setCreditScore: o }) => {
2561
- const n = !isNaN(t);
2562
- return /* @__PURE__ */ e(A, { sx: { p: 24 }, children: /* @__PURE__ */ e(
2563
- ke,
2564
- {
2565
- error: !n,
2566
- fullWidth: !0,
2567
- inputMode: "numeric",
2568
- inputProps: {
2569
- noValidate: !0,
2570
- pattern: "[0-9]*"
2571
- },
2572
- label: Pr.credit_score,
2573
- onChange: (r) => o(Number(r.target.value)),
2574
- value: n ? t : ""
2575
- }
2576
- ) });
2577
- }, Rr = S(Br), Wt = ({ value: t, completeCopy: o }) => /* @__PURE__ */ i(u, { sx: { gap: 8 }, children: [
2578
- /* @__PURE__ */ e(u, { sx: { flexDirection: "row", gap: 4 }, children: Array.from({ length: 4 }).map((n, r) => /* @__PURE__ */ e(
2579
- A,
2580
- {
2581
- sx: {
2582
- bgcolor: r < t ? "primary.main" : "neutral.light",
2583
- borderRadius: "24px",
2584
- height: 4,
2585
- width: "100%"
2586
- }
2587
- },
2588
- r
2589
- )) }),
2590
- /* @__PURE__ */ i(T, { sx: { color: "text.secondary" }, variant: "body2", children: [
2591
- t / 4 * 100,
2592
- "% ",
2593
- o
2594
- ] })
2595
- ] }), Fr = ({
2596
- completeCopy: t,
2597
- primaryText: o,
2598
- secondaryText: n,
2599
- value: r
2600
- }) => /* @__PURE__ */ i(u, { sx: { gap: 20, p: 24 }, children: [
2601
- /* @__PURE__ */ i(u, { sx: { gap: 8 }, children: [
2602
- /* @__PURE__ */ e(Y, { children: o }),
2603
- /* @__PURE__ */ e(w, { variant: "subtitle1", children: n })
2604
- ] }),
2605
- /* @__PURE__ */ e(Wt, { completeCopy: t, value: r })
2606
- ] }), at = {
2607
- step: D.ConnectAccounts,
2608
- type: "main"
2609
- }, B = {
2610
- add_accounts: "Add Accounts",
2611
- add_income_primary: "What is your monthly income?",
2612
- add_income_secondary: "Add your income so that we can accurately measure your financial strength.",
2613
- add_more_income: "Add More Income",
2614
- back: "Back",
2615
- birthday_primary: "When is your birthday?",
2616
- birthday_secondary: "Get the most helpful tips and see how you’re doing compared to others your age.",
2617
- calculate_primary: "Calculating now ...",
2618
- calculate_secondary: "We’re analyzing your financial data to calculate your FinStrong score. Hold tight!",
2619
- confirm_income: "Confirm Income",
2620
- connect_accounts: "Connect Accounts",
2621
- connect_your_accounts_primary: "Connect Your Accounts",
2622
- connect_your_accounts_secondary: "Connect all of your accounts to get the most accurate FinStrong score.",
2623
- credit_score_primary: "What is your credit score?",
2624
- credit_score_secondary: "Your ability to borrow money is a key part of your financial strength score.",
2625
- do_it_later: "Do It Later",
2626
- next: "Next"
2627
- }, $r = ({ isOpen: t, onClose: o }) => {
2628
- const { visibleAccounts: n } = fe(), { calculateHealthScore: r } = P(), { finstrong: l } = C(), { setSelectedAccounts: s } = X(), { setDateRange: a } = kn(), { filter: d, setFilter: c, transactions: p } = wn(), { user: h, userProfile: m, updateUser: g, updateUserProfile: x } = Q(), [k, y] = _.useState(h.credit_score || 0), [b, f] = _.useState(
2629
- at
2630
- ), [v, O] = _.useState([]), [M, N] = _.useState(!1), [z, G] = _.useState(!1), [W, ce] = _.useState(h.birthday), [j, oe] = _.useState("");
2631
- _.useEffect(() => {
2632
- a({ start: It(tt()), end: Dt(tt()) });
2633
- }, []), _.useEffect(() => {
2634
- c({
2635
- accounts: n.map((I) => I.guid),
2636
- dateRange: {
2637
- start: Xn(/* @__PURE__ */ new Date(), 90),
2638
- end: /* @__PURE__ */ new Date()
2639
- },
2640
- custom: nt
2641
- }), s(n);
2642
- }, [n]);
2643
- const le = _.useMemo(
2644
- () => p.find((I) => I.guid === j),
2645
- [j, p]
2646
- ), _e = _.useMemo(() => ({
2647
- [D.ConnectAccounts]: !0,
2648
- [D.MonthlyIncome]: !!j,
2649
- [D.Birthday]: !!h.birthday || !!W,
2650
- [D.CreditScore]: !!h.credit_score || !!k
2651
- })[b.step], [k, b, W, j, h]), U = n.length > 0, Oe = _.useMemo(() => {
2652
- const { step: I } = b;
2653
- let $ = 0;
2654
- return I >= D.MonthlyIncome && U && $++, I >= D.Birthday && v.length && $++, I >= D.CreditScore && (h.birthday || h.credit_score) && $++, $;
2655
- }, [b.step, U, v.length, h.birthday, h.credit_score]), xe = (I) => {
2656
- c({
2657
- ...d,
2658
- custom: ($) => I ? Zn($, I) : nt($)
2659
- });
2660
- }, Et = {
2661
- [D.ConnectAccounts]: {
2662
- main: U ? /* @__PURE__ */ e(Ft, { shouldShowBalance: !1 }) : null,
2663
- mainActionContent: U ? B.next : B.add_accounts,
2664
- primaryText: B.connect_your_accounts_primary,
2665
- secondaryText: B.connect_your_accounts_secondary
2666
- },
2667
- [D.MonthlyIncome]: {
2668
- detail: /* @__PURE__ */ e(
2669
- Ir,
2670
- {
2671
- incomeTransactions: v,
2672
- setCurrentStep: (I) => {
2673
- f(I), O(($) => {
2674
- if ($.some((me) => me.guid === j)) return $.filter((me) => me.guid !== j);
2675
- const Xe = p.find((me) => me.guid === j);
2676
- return Xe ? [...$, Xe] : $;
2677
- });
2678
- },
2679
- transaction: le
2680
- }
2681
- ),
2682
- detailActionContent: B.confirm_income,
2683
- main: /* @__PURE__ */ e(
2684
- qn,
2685
- {
2686
- onSearch: xe,
2687
- onSelected: (I) => {
2688
- f({ step: D.MonthlyIncome, type: "detail" }), oe(I);
2689
- }
2690
- }
2691
- ),
2692
- mainActionContent: B.confirm_income,
2693
- primaryText: B.add_income_primary,
2694
- secondaryText: B.add_income_secondary
2695
- },
2696
- [D.Birthday]: {
2697
- main: /* @__PURE__ */ e(Or, { selectedDate: W, setSelectedDate: ce }),
2698
- mainActionContent: B.next,
2699
- primaryText: B.birthday_primary,
2700
- secondaryText: B.birthday_secondary
2701
- },
2702
- [D.CreditScore]: {
2703
- main: /* @__PURE__ */ e(Rr, { creditScore: k, setCreditScore: y }),
2704
- mainActionContent: B.next,
2705
- primaryText: B.credit_score_primary,
2706
- secondaryText: B.credit_score_secondary
2707
- }
2708
- }, je = () => {
2709
- f(at), N(!1), oe(""), o();
2710
- }, Ve = async () => {
2711
- N(!0), await r(), await x({ ...m, has_completed_finstrong_onboarding: !0 }), je();
2712
- }, zt = () => {
2713
- if (b.step === D.CreditScore) {
2714
- Ve();
2715
- return;
2716
- }
2717
- f({ step: b.step + 1, type: "main" });
2718
- }, Gt = () => {
2719
- const { step: I } = b, $ = I + 1;
2720
- switch (I) {
2721
- case D.Birthday:
2722
- W && W !== h.birthday && g({ ...h, birthday: W });
2723
- break;
2724
- case D.CreditScore:
2725
- k && k !== h.credit_score && g({ ...h, credit_score: k }), Ve();
2726
- return;
2727
- case D.MonthlyIncome:
2728
- j && v.length === 0 && O((Ye) => [...Ye, le]);
2729
- break;
2730
- case D.ConnectAccounts:
2731
- if (!U) {
2732
- G(!0);
2733
- return;
2734
- }
2735
- break;
2736
- }
2737
- $ in D && f({ step: $, type: "main" });
2738
- }, Ht = () => {
2739
- const { step: I, type: $ } = b;
2740
- if ($ === "detail") {
2741
- f({ step: I, type: "main" });
2742
- return;
2743
- }
2744
- if (I === D.Birthday && v.length) {
2745
- f({ step: I - 1, type: "detail" });
2746
- return;
2747
- }
2748
- I > D.ConnectAccounts && f({ step: I - 1, type: "main" });
2749
- }, de = Et[b.step], Se = b.step === D.ConnectAccounts, Nt = {
2750
- fullWidth: !0,
2751
- ...Se && !U && { startIcon: /* @__PURE__ */ e(dt, {}) }
2752
- }, Kt = !Se || Se && !U;
2753
- return /* @__PURE__ */ i(_.Fragment, { children: [
2754
- /* @__PURE__ */ i(
2755
- ie,
2756
- {
2757
- footerStyles: { px: 24, py: 16 },
2758
- hasSecondaryAction: !Se,
2759
- isOpen: t,
2760
- isPrimaryDisabled: !_e,
2761
- onClose: je,
2762
- onSecondaryAction: Ht,
2763
- primaryButtonProps: Nt,
2764
- primaryText: de?.mainActionContent,
2765
- secondaryColor: "primary",
2766
- secondaryText: B.back,
2767
- title: l.title,
2768
- ...!M && { onPrimaryAction: Gt },
2769
- children: [
2770
- M && /* @__PURE__ */ i(u, { sx: { alignItems: "center", gap: 24, position: "relative", px: 16, top: 126 }, children: [
2771
- /* @__PURE__ */ e(Ae, { children: B.calculate_primary }),
2772
- /* @__PURE__ */ e(w, { sx: { textAlign: "center" }, variant: "subtitle1", children: B.calculate_secondary })
2773
- ] }),
2774
- de && !M && /* @__PURE__ */ i(_.Fragment, { children: [
2775
- /* @__PURE__ */ e(
2776
- Fr,
2777
- {
2778
- completeCopy: l.complete,
2779
- primaryText: de.primaryText,
2780
- secondaryText: de.secondaryText,
2781
- value: Oe
2782
- }
2783
- ),
2784
- b.type === "main" && /* @__PURE__ */ i(A, { children: [
2785
- de.main,
2786
- Kt && /* @__PURE__ */ e(u, { sx: { alignItems: "center", px: 24, py: 12 }, children: /* @__PURE__ */ e(L, { fullWidth: !0, onClick: zt, children: B.do_it_later }) })
2787
- ] }),
2788
- b.type === "detail" && de.detail
2789
- ] })
2790
- ]
2791
- }
2792
- ),
2793
- /* @__PURE__ */ e(
2794
- ne,
2795
- {
2796
- onClose: () => G(!1),
2797
- showConnectWidget: z,
2798
- title: B.connect_accounts
2799
- }
2800
- )
2801
- ] });
2802
- }, Lr = S($r), Re = {
2803
- onboarding_title: "Financial Strength Starts Here",
2804
- onboarding_subtitle: "By analyzing your spending and saving, FinStrong provides a score and guidance to help you improve your financial habits.",
2805
- get_started: "Get Started"
2806
- }, Wr = () => {
2807
- const [t, o] = _.useState(!1);
2808
- return /* @__PURE__ */ i(_.Fragment, { children: [
2809
- /* @__PURE__ */ i(
2810
- u,
1138
+ r && /* @__PURE__ */ e(
1139
+ x,
2811
1140
  {
2812
1141
  sx: {
2813
- alignItems: "center",
2814
- gap: 48,
2815
- pb: 24,
2816
- pt: 72,
2817
- px: 16
1142
+ position: "sticky",
1143
+ top: 0,
1144
+ zIndex: 1
2818
1145
  },
2819
- children: [
2820
- /* @__PURE__ */ i(u, { sx: { alignItems: { sm: "center" }, gap: 24, width: "100%" }, children: [
2821
- /* @__PURE__ */ e(A, { sx: { textAlign: "center" }, children: /* @__PURE__ */ e(Jt, { size: 72 }) }),
2822
- /* @__PURE__ */ i(u, { sx: { gap: 4, textAlign: "center", width: { sm: 400 } }, children: [
2823
- /* @__PURE__ */ e(Ae, { children: Re.onboarding_title }),
2824
- /* @__PURE__ */ e(w, { sx: { color: "text.secondary" }, variant: "subtitle1", children: Re.onboarding_subtitle })
2825
- ] })
2826
- ] }),
2827
- /* @__PURE__ */ e(L, { onClick: () => o(!0), variant: "contained", children: Re.get_started })
2828
- ]
2829
- }
2830
- ),
2831
- /* @__PURE__ */ e(Lr, { isOpen: t, onClose: () => o(!1) })
2832
- ] });
2833
- }, Er = ({ isOpen: t, onClose: o }) => {
2834
- const { finstrong: n } = C(), r = H(), { updateUser: l, user: s } = Q(), [a, d] = _.useState(s.birthday), c = (h) => {
2835
- d(Math.floor(new Date(h).getTime() / 1e3));
2836
- };
2837
- return /* @__PURE__ */ e(
2838
- ie,
2839
- {
2840
- isOpen: t,
2841
- onClose: o,
2842
- onPrimaryAction: () => {
2843
- !a || a === s.birthday || (l({ ...s, birthday: a }), o());
2844
- },
2845
- onSecondaryAction: o,
2846
- title: n.date_of_birth,
2847
- children: /* @__PURE__ */ e(oo, { dateAdapter: Tt, children: /* @__PURE__ */ e(
2848
- eo,
2849
- {
2850
- disableFuture: !0,
2851
- onChange: c,
2852
- slotProps: {
2853
- nextIconButton: {
2854
- sx: {
2855
- color: "primary.main",
2856
- "&:hover": { bgcolor: pe(r.palette.primary.light, 0.1) }
2857
- }
2858
- },
2859
- previousIconButton: {
2860
- sx: {
2861
- color: "primary.main",
2862
- "&:hover": { bgcolor: pe(r.palette.primary.light, 0.1) }
2863
- }
2864
- }
2865
- },
2866
- slots: {
2867
- actionBar: () => null,
2868
- toolbar: () => null
2869
- },
2870
- sx: {
2871
- width: "100%",
2872
- "& .MuiIconButton-edgeEnd": {
2873
- color: "primary.main",
2874
- "&:hover": { bgcolor: pe(r.palette.primary.light, 0.1) }
2875
- }
2876
- },
2877
- value: a ? new Date(a * 1e3) : /* @__PURE__ */ new Date()
2878
- }
2879
- ) })
2880
- }
2881
- );
2882
- }, zr = S(Er), Gr = ({ isOpen: t, onClose: o }) => {
2883
- const { visibleFinstrongAccounts: n } = fe(), { incomeBudget: r } = yt(), {
2884
- accounts: l,
2885
- common: s,
2886
- finstrong: a
2887
- } = C(), { user: d } = Q(), [c, p] = _.useState(null), m = [
2888
- {
2889
- dynamicCopy: a.add_profile_item,
2890
- fallbackLabel: a.monthly_income,
2891
- icon: /* @__PURE__ */ e(en, {}),
2892
- key: J.MonthlyIncome,
2893
- label: a.monthly_income,
2894
- value: r
2895
- },
2896
- {
2897
- dynamicCopy: a.add_profile_item,
2898
- fallbackLabel: a.date_of_birth,
2899
- icon: /* @__PURE__ */ e(tn, {}),
2900
- key: J.DateOfBirth,
2901
- label: a.date_of_birth,
2902
- value: d.birthday
2903
- },
2904
- {
2905
- dynamicCopy: a.add_profile_item,
2906
- fallbackLabel: a.credit_score,
2907
- icon: /* @__PURE__ */ e(Le, {}),
2908
- key: J.CreditScore,
2909
- label: a.credit_score,
2910
- value: d.credit_score
2911
- },
2912
- {
2913
- fallbackLabel: a.connect_your_accounts,
2914
- icon: /* @__PURE__ */ e(ct, {}),
2915
- key: J.Connections,
2916
- label: a.connections,
2917
- value: n.length > 0 ? V(
2918
- a.connected_account,
2919
- String(n.length),
2920
- n.length > 1 ? a.accounts : a.account
2921
- ) : void 0
2922
- }
2923
- ].map((g) => fn(g));
2924
- return /* @__PURE__ */ i(ie, { isOpen: t, onClose: o, title: a.financial_profile, children: [
2925
- /* @__PURE__ */ i(u, { sx: { gap: 20, p: 24 }, children: [
2926
- /* @__PURE__ */ i(u, { sx: { gap: 8 }, children: [
2927
- /* @__PURE__ */ e(Y, { children: a.your_financial_profile }),
2928
- /* @__PURE__ */ e(w, { children: a.financial_profile_description })
2929
- ] }),
2930
- /* @__PURE__ */ e(
2931
- Wt,
2932
- {
2933
- completeCopy: a.complete,
2934
- value: m.reduce((g, x) => g + (x.isComplete ? 1 : 0), 0)
2935
- }
2936
- )
2937
- ] }),
2938
- /* @__PURE__ */ e(xn, { list: m, onClickItem: p }),
2939
- /* @__PURE__ */ e(A, { sx: { p: 24 }, children: /* @__PURE__ */ e(
2940
- Me,
2941
- {
2942
- description: a.connect_more_accounts_to_view_more_accurate_financial_picture,
2943
- isDashboard: !0,
2944
- title: a.dont_see_all_your_accounts,
2945
- titleDrawer: s.add_accounts
2946
- }
2947
- ) }),
2948
- /* @__PURE__ */ e(
2949
- ie,
2950
- {
2951
- isOpen: c === J.MonthlyIncome,
2952
- onClose: () => p(null),
2953
- title: s.settings,
2954
- children: /* @__PURE__ */ e(no, {})
1146
+ children: r
2955
1147
  }
2956
1148
  ),
2957
- /* @__PURE__ */ e(zr, { isOpen: c === J.DateOfBirth, onClose: () => p(null) }),
2958
- /* @__PURE__ */ e(Bt, { isOpen: c === J.CreditScore, onClose: () => p(null) }),
2959
- /* @__PURE__ */ e(
2960
- to,
2961
- {
2962
- onClose: () => p(null),
2963
- showConnectionsWidget: c === J.Connections,
2964
- title: l.manage_connections
2965
- }
2966
- )
2967
- ] });
2968
- }, Hr = S(Gr), it = ({
2969
- content: t,
1149
+ n && /* @__PURE__ */ e(x, { children: n }),
1150
+ /* @__PURE__ */ e(ge, {}),
1151
+ /* @__PURE__ */ u(g, { sx: { p: 24, gap: 24 }, children: [
1152
+ o,
1153
+ l && /* @__PURE__ */ e(Q, { isDashboard: !0 })
1154
+ ] })
1155
+ ] }) : /* @__PURE__ */ e(N, {});
1156
+ }, Gt = I(Pt), pe = ({
1157
+ content: n,
2970
1158
  islast: o = !1
2971
- }) => /* @__PURE__ */ i(io, { sx: { minHeight: 0 }, children: [
2972
- /* @__PURE__ */ i(uo, { children: [
2973
- /* @__PURE__ */ e(po, { sx: { bgcolor: "divider", borderWidth: 1, p: 3 } }),
2974
- !o && /* @__PURE__ */ e(co, { sx: { bgcolor: "divider", width: 0.1 } })
1159
+ }) => /* @__PURE__ */ u(st, { sx: { minHeight: 0 }, children: [
1160
+ /* @__PURE__ */ u(pt, { children: [
1161
+ /* @__PURE__ */ e(dt, { sx: { bgcolor: "divider", borderWidth: 1, p: 3 } }),
1162
+ !o && /* @__PURE__ */ e(ct, { sx: { bgcolor: "divider", width: 0.1 } })
2975
1163
  ] }),
2976
- /* @__PURE__ */ e(lo, { sx: { pb: 16, pl: 12, pr: 0, pt: 5 }, children: /* @__PURE__ */ e(w, { fontSize: 13, fontWeight: 400, variant: "subtitle2", children: t }) })
2977
- ] }), Nr = ({ report: t }) => {
2978
- const { finstrong: o } = C(), { score_history_drawer_timeline: n } = o, {
2979
- health_score_point_difference: r,
2980
- newer_credit_score: l,
2981
- older_credit_score: s,
2982
- older_spend_to_income_ratio: a,
2983
- newer_spend_to_income_ratio: d,
2984
- older_health_score: c,
2985
- newer_health_score: p,
2986
- newer_score_calculated_at: h
2987
- } = t, m = ro(new Date(h), "MMM d"), g = () => r === 0 ? "info.lighter" : r > 0 ? "success.lighter" : "error.lighter", x = () => r === 0 ? V(n.stayed_at, c) : r > 0 ? n.less_spending : n.more_spending, k = () => {
2988
- if (r === 0) return null;
2989
- const y = r > 0 ? n.up_from : n.down_from, b = V(y, c, p);
2990
- return /* @__PURE__ */ i(E, { children: [
1164
+ /* @__PURE__ */ e(lt, { sx: { pb: 16, pl: 12, pr: 0, pt: 5 }, children: /* @__PURE__ */ e(y, { fontSize: 13, fontWeight: 400, variant: "subtitle2", children: n }) })
1165
+ ] }), Lt = ({ report: n }) => {
1166
+ const { finstrong: o } = S(), { score_history_drawer_timeline: t } = o, {
1167
+ health_score_point_difference: i,
1168
+ newer_credit_score: d,
1169
+ older_credit_score: l,
1170
+ older_spend_to_income_ratio: s,
1171
+ newer_spend_to_income_ratio: r,
1172
+ older_health_score: a,
1173
+ newer_health_score: c,
1174
+ newer_score_calculated_at: p
1175
+ } = n, h = _e(new Date(p), "MMM d"), m = () => i === 0 ? "info.lighter" : i > 0 ? "success.lighter" : "error.lighter", _ = () => i === 0 ? b(t.stayed_at, a) : i > 0 ? t.less_spending : t.more_spending, R = () => {
1176
+ if (i === 0) return null;
1177
+ const T = i > 0 ? t.up_from : t.down_from, v = b(T, a, c);
1178
+ return /* @__PURE__ */ u(re, { children: [
2991
1179
  /* @__PURE__ */ e(
2992
- rn,
1180
+ he,
2993
1181
  {
2994
1182
  fill: !0,
2995
1183
  name: "circle",
2996
1184
  sx: { color: "text.secondary", fontSize: 8, mx: 4, p: 1 }
2997
1185
  }
2998
1186
  ),
2999
- b
1187
+ v
3000
1188
  ] });
3001
1189
  };
3002
- return /* @__PURE__ */ e(K, { children: /* @__PURE__ */ i(u, { sx: { backgroundColor: "background.paper" }, children: [
3003
- /* @__PURE__ */ e(A, { sx: { borderBottom: "1px solid", borderBottomColor: "divider", p: 16 }, children: /* @__PURE__ */ i(
3004
- u,
1190
+ return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ u(g, { sx: { backgroundColor: "background.paper" }, children: [
1191
+ /* @__PURE__ */ e(x, { sx: { borderBottom: "1px solid", borderBottomColor: "divider", p: 16 }, children: /* @__PURE__ */ u(
1192
+ g,
3005
1193
  {
3006
1194
  flexDirection: "row",
3007
1195
  sx: { alignItems: "center", gap: 16, height: 48, width: "100%" },
3008
1196
  children: [
3009
1197
  /* @__PURE__ */ e(
3010
- u,
1198
+ g,
3011
1199
  {
3012
1200
  sx: {
3013
1201
  alignItems: "center",
3014
- backgroundColor: g(),
1202
+ backgroundColor: m(),
3015
1203
  borderRadius: 999,
3016
1204
  height: 48,
3017
1205
  justifyContent: "center",
3018
1206
  minWidth: 48
3019
1207
  },
3020
- children: /* @__PURE__ */ e(w, { sx: { fontWeight: 600 }, variant: "Body", children: r > 0 ? `+${r}` : r })
1208
+ children: /* @__PURE__ */ e(y, { sx: { fontWeight: 600 }, variant: "Body", children: i > 0 ? `+${i}` : i })
3021
1209
  }
3022
1210
  ),
3023
- /* @__PURE__ */ i(u, { sx: { gap: 2, width: "80%" }, children: [
3024
- /* @__PURE__ */ e(T, { fontWeight: 600, variant: "Body", children: x() }),
3025
- /* @__PURE__ */ i(T, { sx: { color: "text.secondary" }, variant: "subtitle2", children: [
3026
- m,
1211
+ /* @__PURE__ */ u(g, { sx: { gap: 2, width: "80%" }, children: [
1212
+ /* @__PURE__ */ e(W, { fontWeight: 600, variant: "Body", children: _() }),
1213
+ /* @__PURE__ */ u(W, { sx: { color: "text.secondary" }, variant: "subtitle2", children: [
1214
+ h,
3027
1215
  " ",
3028
- k()
1216
+ R()
3029
1217
  ] })
3030
1218
  ] })
3031
1219
  ]
3032
1220
  }
3033
1221
  ) }),
3034
- r !== 0 && /* @__PURE__ */ e(A, { sx: { color: "text.secondary", pb: 8, pl: 32, pr: 16, pt: 12 }, children: /* @__PURE__ */ i(
3035
- ao,
1222
+ i !== 0 && /* @__PURE__ */ e(x, { sx: { color: "text.secondary", pb: 8, pl: 32, pr: 16, pt: 12 }, children: /* @__PURE__ */ u(
1223
+ it,
3036
1224
  {
3037
1225
  sx: {
3038
- [`& .${so.root}:before`]: {
1226
+ [`& .${at.root}:before`]: {
3039
1227
  flex: 0,
3040
1228
  padding: 0
3041
1229
  },
@@ -3044,22 +1232,22 @@ const R = {
3044
1232
  },
3045
1233
  children: [
3046
1234
  /* @__PURE__ */ e(
3047
- it,
1235
+ pe,
3048
1236
  {
3049
- content: V(
3050
- n.spend_to_income_description,
3051
- ve(a),
3052
- ve(d)
1237
+ content: b(
1238
+ t.spend_to_income_description,
1239
+ de(s),
1240
+ de(r)
3053
1241
  )
3054
1242
  }
3055
1243
  ),
3056
1244
  /* @__PURE__ */ e(
3057
- it,
1245
+ pe,
3058
1246
  {
3059
- content: V(
3060
- n.credit_score_description,
3061
- s,
3062
- l
1247
+ content: b(
1248
+ t.credit_score_description,
1249
+ l,
1250
+ d
3063
1251
  ),
3064
1252
  islast: !0
3065
1253
  }
@@ -3068,275 +1256,205 @@ const R = {
3068
1256
  }
3069
1257
  ) })
3070
1258
  ] }) });
3071
- }, Kr = S(Nr), jr = ({ isOpen: t, onClose: o }) => {
3072
- const n = H(), { finstrong: r } = C(), { isCopyLoaded: l, isInitialized: s } = X(), { healthScore: a, healthScoreChangeReports: d, augmentedChartData: c } = P();
3073
- if (!l || !s) return /* @__PURE__ */ e(te, {});
3074
- const p = We(a.health_score || 0, r), h = d.slice().reverse();
1259
+ }, Et = I(Lt), Wt = ({ isOpen: n, onClose: o }) => {
1260
+ const t = G(), { finstrong: i } = S(), { isCopyLoaded: d, isInitialized: l } = z(), { healthScore: s, healthScoreChangeReports: r, augmentedChartData: a } = $();
1261
+ if (!d || !l) return /* @__PURE__ */ e(N, {});
1262
+ const c = ie(s.health_score || 0, i), p = r.slice().reverse();
3075
1263
  return /* @__PURE__ */ e(
3076
- Rt,
1264
+ Gt,
3077
1265
  {
3078
- additionalContent: /* @__PURE__ */ e(u, { sx: { pl: 18, backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(
3079
- ze,
1266
+ additionalContent: /* @__PURE__ */ e(g, { sx: { pl: 18, backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(
1267
+ be,
3080
1268
  {
3081
- axisColor: n.palette.divider,
1269
+ axisColor: t.palette.divider,
3082
1270
  baseline: "min",
3083
- colors: [n.palette.primary.main],
1271
+ colors: [t.palette.primary.main],
3084
1272
  curveType: "natural",
3085
- datasets: [c],
1273
+ datasets: [a],
3086
1274
  height: 160,
3087
- labels: [r.key_indicators_label],
1275
+ labels: [i.key_indicators_label],
3088
1276
  margin: { top: 12, left: 24 },
3089
1277
  showArea: !0,
3090
1278
  showAverage: !0,
3091
- title: r.peer_average,
1279
+ title: i.peer_average,
3092
1280
  useCustomMark: !0
3093
1281
  }
3094
1282
  ) }),
3095
- drawerTitle: r.score_history,
3096
- isOpen: t,
1283
+ drawerTitle: i.score_history,
1284
+ isOpen: n,
3097
1285
  loadConnectAccountsCard: !1,
3098
1286
  onClose: o,
3099
- stickyComponent: /* @__PURE__ */ i(
3100
- u,
1287
+ stickyComponent: /* @__PURE__ */ u(
1288
+ g,
3101
1289
  {
3102
1290
  direction: "row",
3103
1291
  sx: { backgroundColor: "background.paper", gap: 16, pb: 12, pt: 8, px: 24 },
3104
1292
  children: [
3105
- /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
3106
- Pt,
1293
+ /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(
1294
+ ve,
3107
1295
  {
3108
1296
  arcRadius: 20,
3109
- healthScore: a?.health_score,
1297
+ healthScore: s?.health_score,
3110
1298
  size: "SM"
3111
1299
  }
3112
1300
  ) }),
3113
- /* @__PURE__ */ i(A, { children: [
3114
- /* @__PURE__ */ e(w, { fontSize: 18, fontWeight: 700, sx: { mb: 4 }, variant: "subtitle1", children: p.status }),
3115
- /* @__PURE__ */ e(w, { variant: "caption", children: p.description })
1301
+ /* @__PURE__ */ u(x, { children: [
1302
+ /* @__PURE__ */ e(y, { fontSize: 18, fontWeight: 700, sx: { mb: 4 }, variant: "subtitle1", children: c.status }),
1303
+ /* @__PURE__ */ e(y, { variant: "caption", children: c.description })
3116
1304
  ] })
3117
1305
  ]
3118
1306
  }
3119
1307
  ),
3120
- children: /* @__PURE__ */ e(u, { sx: { gap: 16 }, children: h.map((m, g) => /* @__PURE__ */ e(Kr, { report: m }, g)) })
1308
+ children: /* @__PURE__ */ e(g, { sx: { gap: 16 }, children: p.map((h, m) => /* @__PURE__ */ e(Et, { report: h }, m)) })
3121
1309
  }
3122
1310
  );
3123
- }, Vr = S(jr), Yr = S(() => {
3124
- const t = H(), [o, { width: n }] = ft(), { finstrong: r } = C(), { isCopyLoaded: l, isInitialized: s } = X(), { healthScore: a, healthScoreChange: d } = P(), c = t.palette.mode === "dark", p = We(a?.health_score, r);
3125
- return !l || !s ? /* @__PURE__ */ e(te, {}) : /* @__PURE__ */ i(K, { ref: o, sx: { p: 16 }, children: [
3126
- /* @__PURE__ */ e(
3127
- go,
3128
- {
3129
- action: /* @__PURE__ */ e(
3130
- L,
3131
- {
3132
- endIcon: /* @__PURE__ */ e(Z, {}),
3133
- sx: {
3134
- fontSize: 13,
3135
- lineHeight: "16px",
3136
- fontWeight: 600,
3137
- color: "primary.main"
3138
- },
3139
- variant: "text",
3140
- children: r.financial_strength_header_action
3141
- }
3142
- ),
3143
- subheader: /* @__PURE__ */ e(Y, { color: "text.primary", children: r.financial_strength_header }),
3144
- sx: {
3145
- p: 0,
3146
- "& .MuiCardHeader-content": {
3147
- overflow: "hidden"
3148
- }
3149
- }
3150
- }
3151
- ),
3152
- /* @__PURE__ */ e(u, { sx: { justifyContent: "center", alignItems: "center" }, children: /* @__PURE__ */ e(
3153
- Pt,
3154
- {
3155
- arcRadius: n <= 323 ? 73 : 154,
3156
- footerCenterContent: d,
3157
- healthScore: a?.health_score || 0,
3158
- size: n <= 323 ? "M" : "L"
3159
- }
3160
- ) }),
3161
- a?.health_score ? /* @__PURE__ */ i(
3162
- ho,
1311
+ }, Bt = I(Wt), Ht = ({ onClick: n }) => {
1312
+ const { finstrong: o } = S(), { isCopyLoaded: t } = z();
1313
+ return t ? /* @__PURE__ */ u(g, { sx: { alignItems: "center", gap: 12, pt: 12, pb: 32 }, children: [
1314
+ /* @__PURE__ */ e(Ee, { size: 48 }),
1315
+ /* @__PURE__ */ u(g, { sx: { alignItems: "center", gap: 4, textAlign: "center" }, children: [
1316
+ /* @__PURE__ */ e(H, { children: o.missing_data_title }),
1317
+ /* @__PURE__ */ e(y, { sx: { width: { sm: 348 } }, variant: "subtitle1", children: o.missing_data_description })
1318
+ ] }),
1319
+ /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(
1320
+ q,
3163
1321
  {
1322
+ endIcon: /* @__PURE__ */ e(j, {}),
1323
+ onClick: n,
1324
+ size: "small",
3164
1325
  sx: {
3165
- px: 16,
3166
- backgroundColor: c ? "grey.800" : "grey.50",
3167
- //TODO: Need to change the background color to palette (supporting both darkmode and lightmode)
3168
- "&.Mui-expanded": {
3169
- m: 0
3170
- },
3171
- "&::before": {
3172
- display: "none"
1326
+ fontSize: 13,
1327
+ ":hover": {
1328
+ bgcolor: "transparent"
3173
1329
  }
3174
1330
  },
3175
- children: [
3176
- /* @__PURE__ */ e(
3177
- mo,
3178
- {
3179
- expandIcon: /* @__PURE__ */ e(nn, { size: 20 }),
3180
- sx: {
3181
- height: 52,
3182
- p: 0,
3183
- "&.Mui-expanded": {
3184
- minHeight: 0
3185
- }
3186
- },
3187
- children: /* @__PURE__ */ e(w, { sx: { fontWeight: 600 }, variant: "body1", children: r.accordion_title_text })
3188
- }
3189
- ),
3190
- /* @__PURE__ */ e(_o, { sx: { "&.MuiAccordionDetails-root": { padding: 0, pb: 16 } }, children: /* @__PURE__ */ e(w, { variant: "subtitle1", children: p.scoreContent }) })
3191
- ]
3192
- }
3193
- ) : /* @__PURE__ */ e(
3194
- Me,
3195
- {
3196
- buttonText: r.connect_more_accounts_title,
3197
- description: r.health_score_zero_description,
3198
- hasIcon: !1,
3199
- isDashboard: !0,
3200
- sx: {
3201
- backgroundColor: c ? "grey.800" : "grey.50",
3202
- //TODO: Need to change the background color to palette (supporting both darkmode and lightmode)
3203
- ".connect-more-accounts-title": {
3204
- fontWeight: 600,
3205
- lineHeight: "20px",
3206
- color: "text.primary"
3207
- },
3208
- ".connect-more-accounts-description": { color: "text.primary" }
3209
- },
3210
- title: r.health_score_zero_title
1331
+ variant: "text",
1332
+ children: o.connect_more_accounts_button
3211
1333
  }
3212
- )
3213
- ] });
3214
- }), Xr = ({ onBackClick: t, sx: o }) => {
3215
- const { visibleAccounts: n } = fe(), { dateRange: r, isDataLoaded: l, loadBudgetData: s, setTheme: a } = yt(), { reloadCategoryTotals: d } = Ee(), {
3216
- augmentedChartData: c,
3217
- calculateHealthScore: p,
3218
- healthScore: h,
3219
- loadAugmentedChartData: m,
3220
- loadMonthlySummaries: g
3221
- } = P(), { finstrong: x, connect: k } = C(), { isCopyLoaded: y, isInitialized: b, selectedAccounts: f, setSelectedAccounts: v } = X(), { isMobile: O } = He(), M = H(), { userProfile: N } = Q(), [z, G] = _.useState(!1), [W, ce] = _.useState(!1), [j, oe] = _.useState(!1);
3222
- if (_.useEffect(() => {
3223
- a(M);
3224
- }, []), _.useEffect(() => v(n), [n]), _.useEffect(() => {
3225
- b && (p().finally(), m().finally(), g().finally());
3226
- }, [b]), _.useEffect(() => {
3227
- b && (d(f, r.start, r.end), l || s());
3228
- }, [r, l, b, f]), !y || !b) return /* @__PURE__ */ e(te, {});
3229
- const le = () => {
3230
- }, _e = () => G(!0);
3231
- return /* @__PURE__ */ i(
3232
- En,
1334
+ ) })
1335
+ ] }) : /* @__PURE__ */ e(N, {});
1336
+ }, zt = I(Ht), $t = ({ onBackClick: n, sx: o }) => {
1337
+ const t = G(), { visibleAccounts: i } = fe(), { dateRange: d, isDataLoaded: l, loadBudgetData: s, setTheme: r } = ye(), { reloadCategoryTotals: a } = Ke(), { augmentedChartData: c, calculateHealthScore: p, healthScore: h, loadAugmentedChartData: m } = $(), { finstrong: _, connect: R } = S(), { isCopyLoaded: T, isInitialized: v, selectedAccounts: L, setSelectedAccounts: E } = z(), { isMobile: K } = Ce(), [F, w] = C.useState(!1);
1338
+ C.useEffect(() => {
1339
+ r(t);
1340
+ }, []), C.useEffect(() => E(i), [i]), C.useEffect(() => {
1341
+ v && (p().finally(), m().finally());
1342
+ }, [v]), C.useEffect(() => {
1343
+ v && (a(L, d.start, d.end), l || s());
1344
+ }, [d, l, v, L]);
1345
+ const [O, k] = C.useState(!1), [P, U] = C.useState(!1);
1346
+ if (!T || !v) return /* @__PURE__ */ e(N, {});
1347
+ const Z = () => {
1348
+ }, ee = () => k(!0);
1349
+ return /* @__PURE__ */ u(
1350
+ mt,
3233
1351
  {
3234
- accountOptions: n,
1352
+ accountOptions: i,
3235
1353
  actions: [
3236
1354
  {
3237
1355
  iconName: "person",
3238
- label: x.profile,
3239
- onClick: _e
1356
+ label: _.profile,
1357
+ onClick: ee
3240
1358
  }
3241
1359
  ],
3242
1360
  hasDivider: !0,
3243
- onAccountsFilterClick: le,
3244
- onBackClick: t,
1361
+ onAccountsFilterClick: Z,
1362
+ onBackClick: n,
3245
1363
  sx: o,
3246
- title: x.title,
1364
+ title: _.title,
3247
1365
  children: [
3248
- N.has_completed_finstrong_onboarding ? /* @__PURE__ */ i(
3249
- u,
1366
+ /* @__PURE__ */ u(
1367
+ g,
3250
1368
  {
3251
1369
  sx: {
3252
1370
  flexDirection: { md: "row" },
3253
1371
  gap: 24,
3254
1372
  justifyContent: "center",
3255
- pt: O ? 24 : 16,
1373
+ pt: K ? 24 : 16,
3256
1374
  px: 24
3257
1375
  },
3258
1376
  children: [
3259
- /* @__PURE__ */ i(u, { sx: { gap: 24, width: { md: 432 } }, children: [
3260
- /* @__PURE__ */ e(Yr, {}),
1377
+ /* @__PURE__ */ u(g, { sx: { gap: 24, width: { md: 432 } }, children: [
1378
+ /* @__PURE__ */ e(St, {}),
3261
1379
  /* @__PURE__ */ e(
3262
- Me,
1380
+ Q,
3263
1381
  {
3264
- description: x.connect_more_accounts_description,
3265
- title: x.connect_more_accounts_title
1382
+ description: _.connect_more_accounts_description,
1383
+ title: _.connect_more_accounts_title
3266
1384
  }
3267
1385
  )
3268
1386
  ] }),
3269
- /* @__PURE__ */ e(u, { sx: { maxWidth: 848, minWidth: 288, width: { md: 720 } }, children: /* @__PURE__ */ i(K, { sx: { background: M.palette.background.paper, p: 16 }, children: [
3270
- /* @__PURE__ */ i(u, { direction: "row", sx: { alignItems: "center", justifyContent: "space-between" }, children: [
3271
- /* @__PURE__ */ e(Y, { children: x.key_indicators }),
1387
+ /* @__PURE__ */ e(g, { sx: { maxWidth: 848, minWidth: 288, width: { md: 720 } }, children: /* @__PURE__ */ u(J, { sx: { background: t.palette.background.paper, p: 16 }, children: [
1388
+ /* @__PURE__ */ u(g, { direction: "row", sx: { alignItems: "center", justifyContent: "space-between" }, children: [
1389
+ /* @__PURE__ */ e(H, { children: _.key_indicators }),
3272
1390
  /* @__PURE__ */ e(
3273
- L,
1391
+ q,
3274
1392
  {
3275
- endIcon: /* @__PURE__ */ e(Z, {}),
3276
- onClick: () => ce(!0),
1393
+ endIcon: /* @__PURE__ */ e(j, {}),
1394
+ onClick: () => U(!0),
3277
1395
  sx: {
3278
1396
  fontSize: 13
3279
1397
  },
3280
1398
  variant: "text",
3281
- children: x.whats_changed
1399
+ children: _.whats_changed
3282
1400
  }
3283
1401
  )
3284
1402
  ] }),
3285
1403
  c.length ? /* @__PURE__ */ e(
3286
- ze,
1404
+ be,
3287
1405
  {
3288
- axisColor: M.palette.divider,
1406
+ axisColor: t.palette.divider,
3289
1407
  baseline: "min",
3290
- colors: [M.palette.primary.main],
1408
+ colors: [t.palette.primary.main],
3291
1409
  curveType: "natural",
3292
1410
  customLegendVariant: "XSmall",
3293
1411
  datasets: [c],
3294
1412
  height: 300,
3295
1413
  isGraphClippingXAxis: !0,
3296
- labelBackgroundColor: M.palette.border.dark,
3297
- labelFontColor: M.palette.common.white,
3298
- labelFontSize: typeof M.typography.XSmall?.fontSize == "string" ? parseFloat(M.typography.XSmall.fontSize) : M.typography.XSmall?.fontSize,
3299
- labels: [x.key_indicators_label],
1414
+ labelBackgroundColor: t.palette.border.dark,
1415
+ labelFontColor: t.palette.common.white,
1416
+ labelFontSize: typeof t.typography.XSmall?.fontSize == "string" ? parseFloat(t.typography.XSmall.fontSize) : t.typography.XSmall?.fontSize,
1417
+ labels: [_.key_indicators_label],
3300
1418
  margin: { right: 20, left: 25 },
3301
1419
  showArea: !0,
3302
1420
  showAverage: !0,
3303
1421
  showLegend: !0,
3304
1422
  showMarkLabel: !0,
3305
1423
  showXAxis: !0,
3306
- title: x.peer_average,
1424
+ title: _.peer_average,
3307
1425
  useCustomMark: !0
3308
1426
  }
3309
- ) : /* @__PURE__ */ e(wr, { onClick: () => oe(!0) }),
3310
- h.health_score !== null && /* @__PURE__ */ e(vr, {})
1427
+ ) : /* @__PURE__ */ e(zt, { onClick: () => w(!0) }),
1428
+ h.health_score !== null && /* @__PURE__ */ e(Ft, {})
3311
1429
  ] }) })
3312
1430
  ]
3313
1431
  }
3314
- ) : /* @__PURE__ */ e(Wr, {}),
3315
- /* @__PURE__ */ e(Hr, { isOpen: z, onClose: () => G(!1) }),
1432
+ ),
1433
+ /* @__PURE__ */ e(Mt, { isOpen: O, onClose: () => k(!1) }),
3316
1434
  /* @__PURE__ */ e(
3317
- ne,
1435
+ xe,
3318
1436
  {
3319
- onClose: () => oe(!1),
3320
- showConnectWidget: j,
3321
- title: k.mini_title
1437
+ onClose: () => w(!1),
1438
+ showConnectWidget: F,
1439
+ title: R.mini_title
3322
1440
  }
3323
1441
  ),
3324
1442
  /* @__PURE__ */ e(
3325
- Vr,
1443
+ Bt,
3326
1444
  {
3327
- isOpen: W,
3328
- onClose: () => ce(!1)
1445
+ isOpen: P,
1446
+ onClose: () => U(!1)
3329
1447
  }
3330
1448
  )
3331
1449
  ]
3332
1450
  }
3333
1451
  );
3334
- }, pi = S(Xr);
1452
+ }, Ho = I($t);
3335
1453
  export {
3336
- bo as CreditScoreGraph,
3337
- Ot as DialScoreCard,
3338
- Pt as FinancialStrengthGraph,
3339
- _i as FinstrongApi,
3340
- mi as FinstrongStore,
3341
- pi as FinstrongWidget
1454
+ Bo as CreditScoreGraph,
1455
+ Se as DialScoreCard,
1456
+ ve as FinancialStrengthGraph,
1457
+ No as FinstrongApi,
1458
+ Ko as FinstrongStore,
1459
+ Ho as FinstrongWidget
3342
1460
  };