@mx-cartographer/experiences 8.0.0-alpha.bb3 → 8.0.0-alpha.mega1

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