@mx-cartographer/experiences 8.0.0-alpha.bb2 → 8.0.0-alpha.bb4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +128 -1
- package/dist/{Account-Bxw0_4FU.mjs → Account-B4CDD-zq.mjs} +1 -1
- package/dist/AccountDetailsContent-adZTkM52.mjs +683 -0
- package/dist/AccountDetailsHeader-DRjFuyJT.mjs +87 -0
- package/dist/{AccountFields-C9FlatNb.mjs → AccountFields-Cl4KHoSj.mjs} +14 -12
- package/dist/AccountListItem-wgmlex-_.mjs +90 -0
- package/dist/{AccountStore-BgNOyMdp.mjs → AccountStore-HbVblv86.mjs} +19 -8
- package/dist/{Accounts-BRf_YeTf.mjs → Accounts-CRUehOiy.mjs} +1 -1
- package/dist/{BeatApi-DhJpgCLz.mjs → BeatApi-De2IaqH2.mjs} +1 -1
- package/dist/{BeatStore-IBnXd4YK.mjs → BeatStore-D_NYuBSz.mjs} +1 -1
- package/dist/{BudgetUtil-B2ZXyw-g.mjs → BudgetUtil-Jv8h9H9l.mjs} +33 -33
- package/dist/{CashflowStore-D9Dpuz7X.mjs → CashflowStore-CA190BPF.mjs} +18 -25
- package/dist/{Category-CevNQ03n.mjs → Category-Ccoew_sA.mjs} +2 -2
- package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-Dl006GKy.mjs} +43 -41
- package/dist/{CategoryStore-yHI0hWmK.mjs → CategoryStore-MUwRWH9e.mjs} +13 -11
- package/dist/{CategoryUtil-pZRIYOgN.mjs → CategoryUtil-DfVKKkRf.mjs} +4 -4
- package/dist/{ConnectDrawer-BQNs-hjk.mjs → ConnectDrawer-DVp54lUH.mjs} +49 -48
- package/dist/{ConnectionsDrawer-ByGQE7D5.mjs → ConnectionsDrawer-Dsc04-4Z.mjs} +3 -3
- package/dist/CurrencyInput-D1cjbdCI.mjs +85 -0
- package/dist/{CurrencyText-kyC1aseI.mjs → CurrencyText-Dr0EZ7bp.mjs} +1 -1
- package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CDPZw_-m.mjs} +3 -3
- package/dist/{DebtsStore-C9bblOgW.mjs → DebtsStore-pL63fmdT.mjs} +3 -3
- package/dist/{Dialog-CWW597AF.mjs → Dialog-CDV0kKxj.mjs} +24 -24
- package/dist/{Donut-oaQFlbit.mjs → Donut-Dmy3JTWd.mjs} +12 -12
- package/dist/Drawer-BF40nbsH.mjs +163 -0
- package/dist/{EmptyState-DA_lfRBv.mjs → EmptyState-DoxNUae-.mjs} +24 -22
- package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-QhQK4_FU.mjs} +4 -4
- package/dist/{Fetch-87LIQbEA.mjs → Fetch-DecPFeGU.mjs} +24 -22
- package/dist/FinstrongStore-BGf36b0z.mjs +451 -0
- package/dist/{GoalStore-D-aB35SY.mjs → GoalStore-C1-w3Y1E.mjs} +7 -7
- package/dist/HeaderCell-P8w6CmfO.mjs +6 -0
- package/dist/{Help-B6dIcujh.mjs → Help-DBfsTkAi.mjs} +125 -146
- package/dist/{Help-DhcC-C05.mjs → Help-c-zHlDbv.mjs} +8 -8
- package/dist/{IconBacking-B9oC6uL2.mjs → IconBacking-DgT8DCeh.mjs} +11 -11
- package/dist/LineChart-C1PxNf7P.mjs +581 -0
- package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-BNCWQAN_.mjs} +10 -10
- package/dist/Loader-Ckqi9Rx6.mjs +21 -0
- package/dist/{ManageIncome-1s_q5W4X.mjs → ManageIncome-8EsStyIQ.mjs} +195 -192
- package/dist/{MerchantStore-DrFvsUyy.mjs → MerchantStore-WvZ4gnQe.mjs} +1 -1
- package/dist/MicroWidgetContainer-BGpNl5ZS.mjs +45 -0
- package/dist/MiniWidgetContainer-CKzf_Ira.mjs +56 -0
- package/dist/{NetWorthStore-DCsTZpuS.mjs → NetWorthStore-Bti6u-d9.mjs} +4 -4
- package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-B74rQVYC.mjs} +276 -273
- package/dist/{NotificationStore-BxP_P2dA.mjs → NotificationStore-Ck2KdNmT.mjs} +10 -10
- package/dist/{NumberFormatting-Buh7u8Oi.mjs → NumberFormatting-DjTD0t3W.mjs} +9 -9
- package/dist/{OriginalBalanceAction-CWuVvRq9.mjs → OriginalBalanceAction-2Y_3U_mg.mjs} +10 -10
- package/dist/{RecurringSettings-A_rAGCTP.mjs → RecurringSettings-DAncu--R.mjs} +17 -17
- package/dist/{RecurringTransactions-DK8dWldr.mjs → RecurringTransactions-CxcSL1dY.mjs} +106 -105
- package/dist/{RecurringTransactionsStore-C4YOD7_D.mjs → RecurringTransactionsStore-CNFxyGB6.mjs} +80 -73
- package/dist/{ResponsiveButton-DZFp78fJ.mjs → ResponsiveButton-Cn6-R7ue.mjs} +10 -10
- package/dist/SearchBox-B7km148n.mjs +39 -0
- package/dist/{SettingsStore-BcgS_Ohv.mjs → SettingsStore-BASMQSIp.mjs} +3 -3
- package/dist/{SingleSegmentDonut-BgbLgwHi.mjs → SingleSegmentDonut-7Uy6VEld.mjs} +6 -6
- package/dist/SkeletonLoader-BaNboJjD.mjs +38 -0
- package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-DPQ96k3x.mjs} +19 -19
- package/dist/SpendingLegend-6FqtMcBV.mjs +193 -0
- package/dist/{StatusBar-BK_uYHAB.mjs → StatusBar-CPfSXe80.mjs} +6 -6
- package/dist/{TabContentContainer-j01JYR_7.mjs → TabContentContainer-CnMXkVqr.mjs} +8 -8
- package/dist/{ToggleListItem-r0Kx56wF.mjs → ToggleListItem-ciFTiqRS.mjs} +19 -14
- package/dist/TransactionApi-CjBoLleL.mjs +86 -0
- package/dist/TransactionDetails-Bn0qY5Hw.mjs +1336 -0
- package/dist/{TransactionStore-ai3uII_r.mjs → TransactionStore-DbwAutwC.mjs} +146 -165
- package/dist/TrendsStore-_mRaFUdf.mjs +182 -0
- package/dist/{User-BQUxBeZV.mjs → User-BklmOUSd.mjs} +107 -107
- package/dist/{ViewMoreMicroCard-SCn2wt4i.mjs → ViewMoreMicroCard-DAkyNRlD.mjs} +706 -729
- package/dist/{WidgetContainer-BHWANqT4.mjs → WidgetContainer-CDh9fjpR.mjs} +36 -36
- package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +4 -1
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +2 -1
- package/dist/accounts/index.es.js +228 -199
- package/dist/accounts/stores/AccountStore.d.ts +2 -0
- package/dist/analytics/index.es.js +27 -27
- package/dist/budgets/index.es.js +459 -462
- package/dist/cashflow/index.es.js +419 -428
- package/dist/categories/index.es.js +2 -2
- package/dist/categories/stores/CategoryStore.d.ts +1 -1
- package/dist/common/components/ErrorBoundary.d.ts +1 -1
- package/dist/common/components/Loader.d.ts +1 -2
- package/dist/common/components/Select.d.ts +4 -2
- package/dist/common/components/SkeletonLoader.d.ts +7 -0
- package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +1 -1
- package/dist/common/components/charts/LineChart.d.ts +12 -2
- package/dist/common/components/charts/index.d.ts +0 -3
- package/dist/common/components/charts/linechart/CustomLegend.d.ts +3 -1
- package/dist/common/components/charts/linechart/CustomMark.d.ts +5 -1
- package/dist/common/components/drawer/Drawer.d.ts +3 -0
- package/dist/common/components/drawer/Footer.d.ts +17 -0
- package/dist/common/components/index.d.ts +0 -1
- package/dist/common/hooks/index.d.ts +0 -1
- package/dist/common/hooks/useAriaLive.d.ts +1 -1
- package/dist/common/index.es.js +413 -674
- package/dist/common/stores/GlobalStore.d.ts +7 -1
- package/dist/common/stores/GlobalUiStore.d.ts +3 -2
- package/dist/common/types/Finstrong.d.ts +54 -0
- package/dist/common/types/Global.d.ts +1 -0
- package/dist/common/types/Widgets.d.ts +1 -0
- package/dist/common/types/index.d.ts +1 -1
- package/dist/common/types/localization/FinstrongCopy.d.ts +105 -2
- package/dist/common/types/localization/GoalsCopy.d.ts +1 -0
- package/dist/common/utils/Theme.d.ts +1 -3
- package/dist/dashboard/index.es.js +21 -21
- package/dist/debts/components/DebtsChart.d.ts +1 -2
- package/dist/debts/index.es.js +673 -665
- package/dist/exportTransactionsToCSV-BgV_wTLT.mjs +48 -0
- package/dist/finstrong/FinstrongWidget.d.ts +1 -1
- package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
- package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
- package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
- package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
- package/dist/finstrong/components/FinancialStrengthGraph.d.ts +7 -1
- package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
- package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
- package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
- package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
- package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
- package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
- package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
- package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
- package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
- package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
- package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
- package/dist/finstrong/components/ProgressBar.d.ts +15 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
- package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
- package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
- package/dist/finstrong/components/StatusChip.d.ts +5 -0
- package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
- package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +17 -0
- package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
- package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
- package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
- package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
- package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
- package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
- package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
- package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +25 -0
- package/dist/finstrong/components/shared/DialScoreCard.d.ts +7 -1
- package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
- package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
- package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
- package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
- package/dist/finstrong/constants/index.d.ts +9 -0
- package/dist/finstrong/index.es.js +3175 -1067
- package/dist/finstrong/stores/FinstrongStore.d.ts +25 -2
- package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
- package/dist/goals/index.es.js +580 -570
- package/dist/help/components/content/BottomImageContent.d.ts +1 -1
- package/dist/help/components/content/LeftImageContent.d.ts +1 -1
- package/dist/help/components/content/RightImageContent.d.ts +1 -1
- package/dist/help/components/content/TopImageContent.d.ts +1 -1
- package/dist/help/index.es.js +6 -6
- package/dist/{hooks-D6XlXHf4.mjs → hooks-C41HAxM5.mjs} +3 -3
- package/dist/insights/index.es.js +1 -1
- package/dist/investments/index.es.js +537 -536
- package/dist/merchants/index.es.js +9 -9
- package/dist/microinsights/beaticons/BeatIcon.d.ts +2 -9
- package/dist/microinsights/beaticons/BeatMerchantLogo.d.ts +3 -2
- package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +2 -1
- package/dist/microinsights/cards/{MicroInsightCard.d.ts → BaseCard.d.ts} +1 -8
- package/dist/microinsights/cards/{BeatCard.d.ts → InsightCard.d.ts} +2 -2
- package/dist/microinsights/cards/NoRelevantInsightsCard.d.ts +2 -5
- package/dist/microinsights/cards/ZeroStateCard.d.ts +2 -5
- package/dist/microinsights/carousel/BeatList.d.ts +10 -0
- package/dist/microinsights/carousel/CarouselControls.d.ts +1 -3
- package/dist/microinsights/carousel/CarouselHeader.d.ts +1 -2
- package/dist/microinsights/constants/App.d.ts +0 -1
- package/dist/microinsights/index.d.ts +3 -3
- package/dist/microinsights/index.es.js +7 -7
- package/dist/microinsights/interfaces.d.ts +0 -6
- package/dist/networth/components/NetWorthChange.d.ts +3 -1
- package/dist/networth/index.es.js +262 -254
- package/dist/notifications/index.es.js +90 -91
- package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +3 -0
- package/dist/recurringtransactions/index.es.js +586 -562
- package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +1 -0
- package/dist/settings/index.es.js +371 -365
- package/dist/spending/index.es.js +267 -419
- package/dist/spending/utils/SpendingData.d.ts +2 -1
- package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -0
- package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
- package/dist/transactions/index.es.js +231 -226
- package/dist/transactions/stores/TransactionStore.d.ts +1 -1
- package/dist/transactions/stores/UiStore.d.ts +0 -2
- package/dist/trends/index.es.js +988 -612
- package/dist/{useAccountDisplayName-BUAApBIb.mjs → useAccountDisplayName-CcIp09Xc.mjs} +2 -2
- package/dist/{useCombineEvents-BUDIR1ba.mjs → useCombineEvents-kNzLTWCp.mjs} +3 -3
- package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-CNjP5cfR.mjs} +1 -1
- package/dist/{useScreenSize-B6JyS_Lj.mjs → useScreenSize-B5afALev.mjs} +1 -1
- package/package.json +51 -56
- package/dist/AccountDetailsContent-CAM9y39M.mjs +0 -679
- package/dist/AccountDetailsHeader-JtSX6Uf9.mjs +0 -120
- package/dist/AccountListItem-JFMZROh7.mjs +0 -90
- package/dist/CurrencyInput-DUsQbkXb.mjs +0 -85
- package/dist/Drawer-kEE73B87.mjs +0 -113
- package/dist/FinstrongStore-F2c607dj.mjs +0 -101
- package/dist/HeaderCell-DjuifqHJ.mjs +0 -6
- package/dist/LineChart-D4GI7nVh.mjs +0 -541
- package/dist/Loader-DUaFpDGv.mjs +0 -24
- package/dist/MicroWidgetContainer-DpeqN9n3.mjs +0 -45
- package/dist/MiniWidgetContainer-D0gfmbaF.mjs +0 -56
- package/dist/SearchBox-B2_zLv8-.mjs +0 -42
- package/dist/TransactionApi-B3Tksf7L.mjs +0 -86
- package/dist/TransactionDetails-oP1eSuiS.mjs +0 -1334
- package/dist/TrendsStore-DCYbpXPO.mjs +0 -559
- package/dist/accounts/components/AccountsWidgetContent.d.ts +0 -3
- package/dist/common/components/barchart/Bar.d.ts +0 -25
- package/dist/common/components/barchart/BarChart.d.ts +0 -34
- package/dist/common/components/barchart/BarColumn.d.ts +0 -37
- package/dist/common/components/barchart/Legend.d.ts +0 -8
- package/dist/common/components/barchart/Util.d.ts +0 -42
- package/dist/common/components/barchart/index.d.ts +0 -1
- package/dist/common/hooks/usePrevious.d.ts +0 -2
- package/dist/exportTransactionsToCSV-7bVS7KXf.mjs +0 -47
- package/dist/finstrong/utils/Finstrong.d.ts +0 -6
- package/dist/transactions/components/shared/transactionlist/DateRow.d.ts +0 -7
- package/dist/useAriaLive-B3_pRUio.mjs +0 -35
package/dist/budgets/index.es.js
CHANGED
|
@@ -1,106 +1,105 @@
|
|
|
1
|
-
import { jsxs as g, jsx as e, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { observer as
|
|
4
|
-
import { endOfMonth as
|
|
5
|
-
import { startOfMonth as
|
|
6
|
-
import
|
|
1
|
+
import { jsxs as g, jsx as e, Fragment as Pe } from "react/jsx-runtime";
|
|
2
|
+
import c from "react";
|
|
3
|
+
import { observer as E } from "mobx-react-lite";
|
|
4
|
+
import { endOfMonth as me } from "date-fns/endOfMonth";
|
|
5
|
+
import { startOfMonth as Q } from "date-fns/startOfMonth";
|
|
6
|
+
import F from "@mui/material/Box";
|
|
7
7
|
import B from "@mui/material/Stack";
|
|
8
|
-
import
|
|
9
|
-
import { Text as y, CategoryIcon as W, Icon as
|
|
8
|
+
import { useTheme as H } from "@mui/material/styles";
|
|
9
|
+
import { Text as y, CategoryIcon as W, Icon as G, H1 as je, H3 as Ae } from "@mxenabled/mxui";
|
|
10
10
|
import K from "@mui/material/List";
|
|
11
|
-
import { u as w, i as D, j as te, m as
|
|
12
|
-
import { f as T } from "../NumberFormatting-
|
|
11
|
+
import { u as w, i as D, j as te, m as V, q as ne, g as Y, b as oe, d as pe, h as ae, a as ze, n as Ue } from "../hooks-C41HAxM5.mjs";
|
|
12
|
+
import { f as T } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
13
13
|
import Te from "@mui/material/Button";
|
|
14
14
|
import re from "@mui/material/Divider";
|
|
15
|
-
import
|
|
15
|
+
import X from "@mui/material/ListItem";
|
|
16
16
|
import se from "@mui/material/ListItemAvatar";
|
|
17
|
-
import
|
|
18
|
-
import
|
|
17
|
+
import Z from "@mui/material/ListItemButton";
|
|
18
|
+
import q from "@mui/material/ListItemText";
|
|
19
19
|
import { b as R } from "../Localization-2MODESHW.mjs";
|
|
20
|
-
import { D as
|
|
20
|
+
import { D as L } from "../Drawer-BF40nbsH.mjs";
|
|
21
21
|
import Fe from "@mui/material/ListItemSecondaryAction";
|
|
22
|
-
import { C as He } from "../CurrencyInput-
|
|
23
|
-
import {
|
|
24
|
-
import { C as We } from "../ConnectionsDrawer-
|
|
22
|
+
import { C as He } from "../CurrencyInput-D1cjbdCI.mjs";
|
|
23
|
+
import { D as j } from "../Dialog-CDV0kKxj.mjs";
|
|
24
|
+
import { C as We } from "../ConnectionsDrawer-Dsc04-4Z.mjs";
|
|
25
25
|
import * as O from "d3";
|
|
26
26
|
import Ke from "@mui/material/Tooltip";
|
|
27
|
-
import {
|
|
28
|
-
import { u as ie } from "../useScreenSize-
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import
|
|
36
|
-
import Je from "@mui/material/
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import et from "
|
|
40
|
-
import {
|
|
41
|
-
import
|
|
42
|
-
import he from "@mui/material/Card";
|
|
27
|
+
import { L as he } from "../Loader-Ckqi9Rx6.mjs";
|
|
28
|
+
import { u as ie } from "../useScreenSize-B5afALev.mjs";
|
|
29
|
+
import { E as de } from "../EmptyState-DoxNUae-.mjs";
|
|
30
|
+
import { A as k, W as Ve } from "../WidgetContainer-CDh9fjpR.mjs";
|
|
31
|
+
import { u as Ye } from "../BudgetUtil-Jv8h9H9l.mjs";
|
|
32
|
+
import { M as Xe } from "../MiniWidgetContainer-CKzf_Ira.mjs";
|
|
33
|
+
import { isAfter as Ze } from "date-fns/isAfter";
|
|
34
|
+
import { startOfToday as J } from "date-fns/startOfToday";
|
|
35
|
+
import qe from "@mui/material/Alert";
|
|
36
|
+
import Je from "@mui/material/Snackbar";
|
|
37
|
+
import Ce from "@mui/material/Tab";
|
|
38
|
+
import Qe from "@mui/material/Tabs";
|
|
39
|
+
import { e as et } from "../exportTransactionsToCSV-BgV_wTLT.mjs";
|
|
40
|
+
import { T as we, a as tt } from "../TransactionDetails-Bn0qY5Hw.mjs";
|
|
41
|
+
import be from "@mui/material/Card";
|
|
43
42
|
import fe from "@mui/material/CardContent";
|
|
44
|
-
import { S as
|
|
45
|
-
import { S as De } from "../SingleSegmentDonut-
|
|
46
|
-
import { u as
|
|
47
|
-
import
|
|
48
|
-
import { subDays as
|
|
49
|
-
import
|
|
50
|
-
import { M as
|
|
51
|
-
const
|
|
43
|
+
import { S as ge } from "../StatusBar-CPfSXe80.mjs";
|
|
44
|
+
import { S as De } from "../SingleSegmentDonut-7Uy6VEld.mjs";
|
|
45
|
+
import { u as nt, b as ot } from "../CategorySelectorDrawer-Dl006GKy.mjs";
|
|
46
|
+
import Ee from "@mui/material/CardHeader";
|
|
47
|
+
import { subDays as at } from "date-fns/subDays";
|
|
48
|
+
import rt from "@mui/material/IconButton";
|
|
49
|
+
import { M as st } from "../ManageIncome-8EsStyIQ.mjs";
|
|
50
|
+
const it = E(() => {
|
|
52
51
|
const { budgets: t } = w(), { totalBudgeted: o } = D(), { incomeTotal: i } = te(), s = i - o;
|
|
53
52
|
return /* @__PURE__ */ g(B, { direction: "row", justifyContent: "center", my: 16, spacing: 20, children: [
|
|
54
53
|
/* @__PURE__ */ g(B, { alignItems: "center", children: [
|
|
55
|
-
/* @__PURE__ */ e(y, { bold: !0, variant: "
|
|
56
|
-
/* @__PURE__ */ e(y, { color: "secondary", variant: "
|
|
54
|
+
/* @__PURE__ */ e(y, { bold: !0, variant: "body1", children: T(i, "0,0") }),
|
|
55
|
+
/* @__PURE__ */ e(y, { color: "secondary", variant: "body2", children: t.projected_income })
|
|
57
56
|
] }),
|
|
58
|
-
/* @__PURE__ */ e(y, { bold: !0, justifyContent: "center", variant: "
|
|
57
|
+
/* @__PURE__ */ e(y, { bold: !0, justifyContent: "center", variant: "body1", children: "-" }),
|
|
59
58
|
/* @__PURE__ */ g(B, { alignItems: "center", children: [
|
|
60
|
-
/* @__PURE__ */ e(y, { bold: !0, variant: "
|
|
61
|
-
/* @__PURE__ */ e(y, { color: "secondary", variant: "
|
|
59
|
+
/* @__PURE__ */ e(y, { bold: !0, variant: "body1", children: T(o, "0,0") }),
|
|
60
|
+
/* @__PURE__ */ e(y, { color: "secondary", variant: "body2", children: t.budgeted })
|
|
62
61
|
] }),
|
|
63
|
-
/* @__PURE__ */ e(y, { bold: !0, justifyContent: "center", variant: "
|
|
62
|
+
/* @__PURE__ */ e(y, { bold: !0, justifyContent: "center", variant: "body1", children: "=" }),
|
|
64
63
|
/* @__PURE__ */ g(B, { alignItems: "center", children: [
|
|
65
|
-
/* @__PURE__ */ e(y, { bold: !0, variant: "
|
|
66
|
-
/* @__PURE__ */ e(y, { color: "secondary", variant: "
|
|
64
|
+
/* @__PURE__ */ e(y, { bold: !0, variant: "body1", children: T(s, "0,0") }),
|
|
65
|
+
/* @__PURE__ */ e(y, { color: "secondary", variant: "body2", children: t.remaining })
|
|
67
66
|
] })
|
|
68
67
|
] });
|
|
69
|
-
}),
|
|
68
|
+
}), ct = E(
|
|
70
69
|
({ category: t }) => {
|
|
71
|
-
const { budgets: o } = w(), { budgets: i } = D(), s =
|
|
72
|
-
const a = i.find((
|
|
70
|
+
const { budgets: o } = w(), { budgets: i } = D(), s = c.useMemo(() => {
|
|
71
|
+
const a = i.find((l) => l.category_guid === t.guid), n = T(t.totalAverageAmount, "0,0"), r = a ? R(o.recalculate_previous_budget, T(a.amount, "0,0")) : o.recalculate_new_budget;
|
|
73
72
|
return `${n} - ${r}`;
|
|
74
73
|
}, [o, i]);
|
|
75
|
-
return /* @__PURE__ */ g(
|
|
76
|
-
/* @__PURE__ */ e(
|
|
74
|
+
return /* @__PURE__ */ g(c.Fragment, { children: [
|
|
75
|
+
/* @__PURE__ */ e(X, { children: /* @__PURE__ */ g(Z, { children: [
|
|
77
76
|
/* @__PURE__ */ e(se, { children: /* @__PURE__ */ e(W, { categoryGuid: t.guid, variant: "filled" }) }),
|
|
78
|
-
/* @__PURE__ */ e(
|
|
77
|
+
/* @__PURE__ */ e(q, { primary: t.name, secondary: s })
|
|
79
78
|
] }) }),
|
|
80
79
|
/* @__PURE__ */ e(re, {})
|
|
81
80
|
] }, t.guid);
|
|
82
81
|
}
|
|
83
|
-
),
|
|
84
|
-
const { budgets: o, common: i } = w(), { spendCategories: s } =
|
|
85
|
-
await a(d),
|
|
82
|
+
), lt = ({ onRecalculateBudgets: t }) => {
|
|
83
|
+
const { budgets: o, common: i } = w(), { spendCategories: s } = V(), { recalculateBudgets: a, setAlert: n } = D(), [r, l] = c.useState(!1), d = s.filter((u) => u.totalAverageAmount > 0), m = async () => {
|
|
84
|
+
await a(d), l(!1), n(o.alert_recalculated_budgets), t?.();
|
|
86
85
|
};
|
|
87
|
-
return /* @__PURE__ */ g(
|
|
88
|
-
/* @__PURE__ */ e(Te, { onClick: () =>
|
|
89
|
-
/* @__PURE__ */ e(y, { sx: { mx: 24, my: 16, textAlign: "center", whiteSpace: "wrap" }, variant: "
|
|
86
|
+
return /* @__PURE__ */ g(c.Fragment, { children: [
|
|
87
|
+
/* @__PURE__ */ e(Te, { onClick: () => l(!0), sx: { mt: 24, mx: 24 }, variant: "text", children: o.recalculate_button }),
|
|
88
|
+
/* @__PURE__ */ e(y, { sx: { mx: 24, my: 16, textAlign: "center", whiteSpace: "wrap" }, variant: "subtitle1", children: o.recalculate_help }),
|
|
90
89
|
/* @__PURE__ */ e(
|
|
91
|
-
|
|
90
|
+
L,
|
|
92
91
|
{
|
|
93
92
|
ariaLabelClose: i.close_aria,
|
|
94
93
|
isOpen: r,
|
|
95
|
-
onClose: () =>
|
|
94
|
+
onClose: () => l(!1),
|
|
96
95
|
onPrimaryAction: m,
|
|
97
96
|
title: o.recalculate_title,
|
|
98
97
|
children: /* @__PURE__ */ g(B, { children: [
|
|
99
98
|
/* @__PURE__ */ g(B, { mx: 24, my: 16, children: [
|
|
100
|
-
/* @__PURE__ */ e(y, { bold: !0, variant: "
|
|
101
|
-
/* @__PURE__ */ e(y, { variant: "
|
|
99
|
+
/* @__PURE__ */ e(y, { bold: !0, variant: "body1", children: o.recalculate_description_top }),
|
|
100
|
+
/* @__PURE__ */ e(y, { variant: "subtitle2", children: o.recalculate_description_bottom })
|
|
102
101
|
] }),
|
|
103
|
-
/* @__PURE__ */ e(
|
|
102
|
+
/* @__PURE__ */ e(F, { bgcolor: "background.paper", children: /* @__PURE__ */ e(K, { children: d.map((u) => /* @__PURE__ */ e(ct, { category: u }, u.guid)) }) })
|
|
104
103
|
] })
|
|
105
104
|
}
|
|
106
105
|
)
|
|
@@ -127,25 +126,25 @@ const ct = I(() => {
|
|
|
127
126
|
label: s.add_label,
|
|
128
127
|
minAmount: 0,
|
|
129
128
|
setAmount: i,
|
|
130
|
-
sx: { ".MuiTypography-
|
|
129
|
+
sx: { ".MuiTypography-body1": { p: 0 } }
|
|
131
130
|
}
|
|
132
131
|
)
|
|
133
132
|
] });
|
|
134
|
-
},
|
|
135
|
-
const { budgets: i, common: s } = w(), [a, n] =
|
|
133
|
+
}, dt = E(({ category: t, onAddBudget: o }) => {
|
|
134
|
+
const { budgets: i, common: s } = w(), [a, n] = c.useState(!1), [r, l] = c.useState(
|
|
136
135
|
`${t.totalAmount === 0 ? "" : t.totalAmount}`
|
|
137
136
|
);
|
|
138
|
-
return /* @__PURE__ */ g(
|
|
139
|
-
/* @__PURE__ */ e(
|
|
137
|
+
return /* @__PURE__ */ g(c.Fragment, { children: [
|
|
138
|
+
/* @__PURE__ */ e(X, { children: /* @__PURE__ */ g(Z, { onClick: () => n(!0), children: [
|
|
140
139
|
/* @__PURE__ */ e(se, { children: /* @__PURE__ */ e(W, { categoryGuid: t.guid }) }),
|
|
141
140
|
/* @__PURE__ */ e(
|
|
142
|
-
|
|
141
|
+
q,
|
|
143
142
|
{
|
|
144
143
|
primary: t.name,
|
|
145
144
|
secondary: T(t.totalAmount, "0,0")
|
|
146
145
|
}
|
|
147
146
|
),
|
|
148
|
-
/* @__PURE__ */ e(Fe, { children: /* @__PURE__ */ e(
|
|
147
|
+
/* @__PURE__ */ e(Fe, { children: /* @__PURE__ */ e(G, { name: "add", size: 20 }) })
|
|
149
148
|
] }) }, t.guid),
|
|
150
149
|
/* @__PURE__ */ e(
|
|
151
150
|
j,
|
|
@@ -156,27 +155,27 @@ const ct = I(() => {
|
|
|
156
155
|
onClose: () => n(!1),
|
|
157
156
|
onPrimaryAction: () => o(t, Number(r)),
|
|
158
157
|
primaryText: i.add_save_button,
|
|
159
|
-
children: /* @__PURE__ */ e(ce, { amount: r, categoryName: t.name, onAmountChanged:
|
|
158
|
+
children: /* @__PURE__ */ e(ce, { amount: r, categoryName: t.name, onAmountChanged: l })
|
|
160
159
|
}
|
|
161
160
|
)
|
|
162
161
|
] });
|
|
163
|
-
}),
|
|
164
|
-
const { budgets: o } = w(), { addBudget: i, setAlert: s, unbudgetedCategories: a } = D(), n = async (r,
|
|
165
|
-
await i(r,
|
|
162
|
+
}), Ie = E(({ onRecalculateBudgets: t }) => {
|
|
163
|
+
const { budgets: o } = w(), { addBudget: i, setAlert: s, unbudgetedCategories: a } = D(), n = async (r, l) => {
|
|
164
|
+
await i(r, l), s(R(o.alert_budget_created, r.name));
|
|
166
165
|
};
|
|
167
166
|
return /* @__PURE__ */ g(B, { children: [
|
|
168
|
-
/* @__PURE__ */ e(
|
|
169
|
-
/* @__PURE__ */ e(
|
|
170
|
-
|
|
167
|
+
/* @__PURE__ */ e(it, {}),
|
|
168
|
+
/* @__PURE__ */ e(F, { bgcolor: "background.paper", children: /* @__PURE__ */ e(K, { children: a.map((r) => /* @__PURE__ */ e(
|
|
169
|
+
dt,
|
|
171
170
|
{
|
|
172
171
|
category: r,
|
|
173
172
|
onAddBudget: n
|
|
174
173
|
},
|
|
175
174
|
r.guid
|
|
176
175
|
)) }) }),
|
|
177
|
-
/* @__PURE__ */ e(
|
|
176
|
+
/* @__PURE__ */ e(lt, { onRecalculateBudgets: t })
|
|
178
177
|
] });
|
|
179
|
-
}),
|
|
178
|
+
}), Be = 5, Oe = 100, ee = 25, ut = (t) => {
|
|
180
179
|
const o = (a) => {
|
|
181
180
|
a.active || t.alphaTarget(0.3).restart(), a.subject.fx = a.subject.x, a.subject.fy = a.subject.y;
|
|
182
181
|
}, i = (a) => {
|
|
@@ -185,14 +184,14 @@ const ct = I(() => {
|
|
|
185
184
|
a.active || t.alphaTarget(0), a.subject.fx = null, a.subject.fy = null;
|
|
186
185
|
};
|
|
187
186
|
return O.drag().on("start", o).on("drag", i).on("end", s);
|
|
188
|
-
},
|
|
187
|
+
}, mt = (t) => {
|
|
189
188
|
let o = t.transaction_total / t.amount;
|
|
190
189
|
o < 0 ? o = 0 : o > 1 && (o = 1);
|
|
191
|
-
const i = o * 2 * Math.PI, s = O.interpolate(0, i), a = O.arc().cornerRadius(5).innerRadius(t.radius -
|
|
190
|
+
const i = o * 2 * Math.PI, s = O.interpolate(0, i), a = O.arc().cornerRadius(5).innerRadius(t.radius - Be * 2).outerRadius(t.radius - Be).startAngle(0).endAngle(0);
|
|
192
191
|
return (n) => (a.endAngle(s(n)), a(t) || "");
|
|
193
|
-
},
|
|
194
|
-
O.selectAll(".bubble").call(
|
|
195
|
-
},
|
|
192
|
+
}, gt = (t) => {
|
|
193
|
+
O.selectAll(".bubble").call(ut(t));
|
|
194
|
+
}, Se = (t, o, i) => Math.min(Math.max(t, o), i), pt = (t, o, i) => {
|
|
196
195
|
t.alpha(1).restart().force(
|
|
197
196
|
"x",
|
|
198
197
|
O.forceX().x(i / 2).strength(0.01)
|
|
@@ -202,17 +201,17 @@ const ct = I(() => {
|
|
|
202
201
|
).on("tick", () => {
|
|
203
202
|
const s = t.nodes();
|
|
204
203
|
s.forEach((a) => {
|
|
205
|
-
const n = a.radius ??
|
|
206
|
-
a.x =
|
|
204
|
+
const n = a.radius ?? ee;
|
|
205
|
+
a.x = Se(a.x ?? 0, n, i - n), a.y = Se(a.y ?? 0, n, o - n);
|
|
207
206
|
}), O.selectAll(".bubble").data(s).attr("transform", (a) => `translate(${a.x},${a.y})`);
|
|
208
207
|
});
|
|
209
|
-
}, Me = (t, o) => O.scaleLinear().domain([t, o]).range([
|
|
208
|
+
}, Me = (t, o) => O.scaleLinear().domain([t, o]).range([ee, Oe]), ht = (t) => {
|
|
210
209
|
const o = t.reduce((n, r) => {
|
|
211
|
-
const
|
|
212
|
-
return
|
|
210
|
+
const l = Math.max(r.transaction_total, r.amount);
|
|
211
|
+
return l > n ? l : n;
|
|
213
212
|
}, 0), i = t.reduce((n, r) => {
|
|
214
|
-
const
|
|
215
|
-
return
|
|
213
|
+
const l = Math.max(r.transaction_total, r.amount);
|
|
214
|
+
return l < n ? l : n;
|
|
216
215
|
}, o), s = Me(i, o), a = t.map((n) => {
|
|
217
216
|
const r = s(Math.max(n.transaction_total, n.amount)) || 25;
|
|
218
217
|
return {
|
|
@@ -222,45 +221,45 @@ const ct = I(() => {
|
|
|
222
221
|
});
|
|
223
222
|
return O.forceSimulation(a).velocityDecay(0.05).force("collide", O.forceCollide((n) => n.radius + 2).strength(0.7));
|
|
224
223
|
}, bt = (t, o, i) => {
|
|
225
|
-
const a = Math.PI *
|
|
226
|
-
let u =
|
|
224
|
+
const a = Math.PI * ee ** 2 * t, n = i < 400 || o < 300, r = n ? 40 : 20, l = Math.max(100, i - r), d = Math.max(100, o - r), m = l * d;
|
|
225
|
+
let u = ee;
|
|
227
226
|
if (a < m) {
|
|
228
|
-
const
|
|
229
|
-
u = Math.min(Oe,
|
|
227
|
+
const h = Math.sqrt(m / (t * Math.PI)), p = Math.min(l, d) / 4;
|
|
228
|
+
u = Math.min(Oe, h, p);
|
|
230
229
|
}
|
|
231
230
|
return n && t <= 3 && (u = Math.min(u, 45)), { minRadius: Math.max(20, u * 0.6), maxRadius: u };
|
|
232
|
-
},
|
|
231
|
+
}, ft = (t, o, i, s, a) => {
|
|
233
232
|
const { maxRadius: n, minRadius: r } = bt(t, o, a);
|
|
234
233
|
return O.scaleLinear().domain([s, i]).range([r, n]);
|
|
235
|
-
},
|
|
236
|
-
const n = o.map((m) => Math.max(m.transaction_total, m.amount)), r = Math.min(...n),
|
|
234
|
+
}, yt = (t, o, i = !1, s, a) => {
|
|
235
|
+
const n = o.map((m) => Math.max(m.transaction_total, m.amount)), r = Math.min(...n), l = Math.max(...n), d = i ? ft(t.length, s, l, r, a) : Me(r, l);
|
|
237
236
|
return t.map((m) => ({
|
|
238
237
|
...m,
|
|
239
238
|
radius: d(Math.max(m.transaction_total, m.amount))
|
|
240
239
|
}));
|
|
241
|
-
},
|
|
242
|
-
const o =
|
|
240
|
+
}, xe = 5, _t = 2e3, Ct = ({ bubble: t }) => {
|
|
241
|
+
const o = H(), {
|
|
243
242
|
amount: i,
|
|
244
243
|
guid: s,
|
|
245
244
|
budgetColors: { mercury: a },
|
|
246
245
|
radius: n,
|
|
247
246
|
transaction_total: r
|
|
248
|
-
} = t,
|
|
249
|
-
|
|
250
|
-
O.select(`.${
|
|
247
|
+
} = t, l = `mercury-${s}`;
|
|
248
|
+
c.useEffect(() => {
|
|
249
|
+
O.select(`.${l}`).selectAll(".status").remove(), O.select(`.${l}`).append("path").transition().duration(_t).delay(0).attr("class", "status").attr("style", `fill: ${a}; fill-opacity: 1;`).attrTween("d", () => mt(t));
|
|
251
250
|
}, [i, n, r]);
|
|
252
|
-
const d = O.arc().innerRadius((m) => m - 2 *
|
|
253
|
-
return /* @__PURE__ */ e("g", { className:
|
|
251
|
+
const d = O.arc().innerRadius((m) => m - 2 * xe).outerRadius((m) => m - xe).startAngle(0).endAngle(2 * Math.PI);
|
|
252
|
+
return /* @__PURE__ */ e("g", { className: l, children: /* @__PURE__ */ e(
|
|
254
253
|
"path",
|
|
255
254
|
{
|
|
256
255
|
d: d(n) || "",
|
|
257
256
|
style: { fill: o.palette.common.white, fillOpacity: 0.35 }
|
|
258
257
|
}
|
|
259
258
|
) });
|
|
260
|
-
},
|
|
261
|
-
function
|
|
259
|
+
}, Bt = c.memo(Ct), P = 75, ue = 50;
|
|
260
|
+
function St({ bubble: t, isDraggable: o, onClick: i = () => {
|
|
262
261
|
} }) {
|
|
263
|
-
const [s, a] =
|
|
262
|
+
const [s, a] = c.useState(!1), n = H(), { availableWidth: r } = ne(), l = c.useMemo(() => {
|
|
264
263
|
if (t)
|
|
265
264
|
return {
|
|
266
265
|
amount: t.amount,
|
|
@@ -273,40 +272,40 @@ function xt({ bubble: t, isDraggable: o, onClick: i = () => {
|
|
|
273
272
|
if (!t) return;
|
|
274
273
|
const {
|
|
275
274
|
budgetColors: { background: d, text: m },
|
|
276
|
-
category: { icon: u, name:
|
|
277
|
-
guid:
|
|
278
|
-
description:
|
|
279
|
-
radius:
|
|
275
|
+
category: { icon: u, name: C },
|
|
276
|
+
guid: h,
|
|
277
|
+
description: p,
|
|
278
|
+
radius: b,
|
|
280
279
|
x: S,
|
|
281
|
-
y:
|
|
282
|
-
} = t,
|
|
283
|
-
let
|
|
284
|
-
|
|
280
|
+
y: _
|
|
281
|
+
} = t, f = r < 400 ? -8 : -12;
|
|
282
|
+
let A = f, v = f;
|
|
283
|
+
b > P ? (A = -14, v = -45) : b > ue && (v = -32);
|
|
285
284
|
let x = 32;
|
|
286
|
-
|
|
287
|
-
const
|
|
285
|
+
b <= P && (x = r < 400 ? 16 : 24);
|
|
286
|
+
const I = `${t.category.name}: ${p}`, M = {
|
|
288
287
|
modifiers: [
|
|
289
288
|
{
|
|
290
289
|
name: "offset",
|
|
291
290
|
options: { offset: [0, 15] }
|
|
292
291
|
}
|
|
293
292
|
]
|
|
294
|
-
}, N = (
|
|
295
|
-
(
|
|
296
|
-
},
|
|
293
|
+
}, N = (U) => {
|
|
294
|
+
(U.key === "Enter" || U.key === " ") && (U.preventDefault(), i(t));
|
|
295
|
+
}, z = () => {
|
|
297
296
|
a(!0);
|
|
298
|
-
},
|
|
297
|
+
}, $ = () => {
|
|
299
298
|
a(!1);
|
|
300
299
|
};
|
|
301
300
|
return /* @__PURE__ */ g(
|
|
302
301
|
"g",
|
|
303
302
|
{
|
|
304
|
-
"aria-label": `${
|
|
303
|
+
"aria-label": `${C} - ${p}`,
|
|
305
304
|
className: "bubble",
|
|
306
|
-
id: `bubble-${
|
|
307
|
-
onBlur:
|
|
305
|
+
id: `bubble-${h}`,
|
|
306
|
+
onBlur: $,
|
|
308
307
|
onClick: () => i(t),
|
|
309
|
-
onFocus:
|
|
308
|
+
onFocus: z,
|
|
310
309
|
onKeyDown: N,
|
|
311
310
|
onMouseEnter: () => a(!0),
|
|
312
311
|
onMouseLeave: () => a(!1),
|
|
@@ -315,7 +314,7 @@ function xt({ bubble: t, isDraggable: o, onClick: i = () => {
|
|
|
315
314
|
tabIndex: 0,
|
|
316
315
|
textAnchor: "middle",
|
|
317
316
|
x: S,
|
|
318
|
-
y:
|
|
317
|
+
y: _,
|
|
319
318
|
children: [
|
|
320
319
|
/* @__PURE__ */ e("style", { children: `
|
|
321
320
|
.bubble:focus,
|
|
@@ -329,111 +328,102 @@ function xt({ bubble: t, isDraggable: o, onClick: i = () => {
|
|
|
329
328
|
stroke-opacity: 0.8;
|
|
330
329
|
}
|
|
331
330
|
` }),
|
|
332
|
-
/* @__PURE__ */ e(
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
followCursor: !0,
|
|
336
|
-
open: s,
|
|
337
|
-
slotProps: { popper: M },
|
|
338
|
-
title: E,
|
|
339
|
-
children: /* @__PURE__ */ e("circle", { fill: d, id: `circle-${f}`, r: p })
|
|
340
|
-
}
|
|
341
|
-
),
|
|
342
|
-
/* @__PURE__ */ e("svg", { x: v, y: A, children: /* @__PURE__ */ e(P, { name: u, size: x, sx: { fill: m } }) }),
|
|
343
|
-
p > G && /* @__PURE__ */ e(
|
|
331
|
+
/* @__PURE__ */ e(Ke, { open: s, slotProps: { popper: M }, title: I, children: /* @__PURE__ */ e("circle", { fill: d, id: `circle-${h}`, r: b }) }),
|
|
332
|
+
/* @__PURE__ */ e("svg", { x: A, y: v, children: /* @__PURE__ */ e(G, { name: u, size: x, sx: { fill: m } }) }),
|
|
333
|
+
b > P && /* @__PURE__ */ e(
|
|
344
334
|
y,
|
|
345
335
|
{
|
|
346
336
|
bold: !0,
|
|
347
337
|
component: "text",
|
|
348
|
-
id: `budget-category-${
|
|
338
|
+
id: `budget-category-${h}`,
|
|
349
339
|
sx: { fill: m },
|
|
350
|
-
variant: "
|
|
340
|
+
variant: "body2",
|
|
351
341
|
y: 4,
|
|
352
|
-
children:
|
|
342
|
+
children: C
|
|
353
343
|
}
|
|
354
344
|
),
|
|
355
|
-
|
|
345
|
+
b > ue && /* @__PURE__ */ e(
|
|
356
346
|
y,
|
|
357
347
|
{
|
|
358
348
|
bold: !0,
|
|
359
349
|
component: "text",
|
|
360
|
-
id: `budget-description-${
|
|
350
|
+
id: `budget-description-${h}-1`,
|
|
361
351
|
sx: { fill: m },
|
|
362
|
-
variant: "
|
|
363
|
-
y:
|
|
364
|
-
children:
|
|
352
|
+
variant: "body1",
|
|
353
|
+
y: b <= P ? 12 : 24,
|
|
354
|
+
children: b <= P ? p.split(" ")[0] : p
|
|
365
355
|
}
|
|
366
356
|
),
|
|
367
|
-
|
|
357
|
+
b <= P && b > ue && /* @__PURE__ */ e(
|
|
368
358
|
y,
|
|
369
359
|
{
|
|
370
360
|
component: "text",
|
|
371
|
-
id: `budget-description-${
|
|
361
|
+
id: `budget-description-${h}-2`,
|
|
372
362
|
sx: { fill: m },
|
|
373
|
-
variant: "
|
|
363
|
+
variant: "caption",
|
|
374
364
|
y: 28,
|
|
375
|
-
children:
|
|
365
|
+
children: p.split(" ")[1]
|
|
376
366
|
}
|
|
377
367
|
),
|
|
378
|
-
/* @__PURE__ */ e(
|
|
368
|
+
/* @__PURE__ */ e(Bt, { bubble: l })
|
|
379
369
|
]
|
|
380
370
|
},
|
|
381
|
-
|
|
371
|
+
h
|
|
382
372
|
);
|
|
383
373
|
}
|
|
384
|
-
const
|
|
374
|
+
const xt = ({
|
|
385
375
|
height: t,
|
|
386
376
|
width: o,
|
|
387
377
|
isDraggable: i = !1,
|
|
388
378
|
onClick: s = () => {
|
|
389
379
|
}
|
|
390
380
|
}) => {
|
|
391
|
-
const [a, n] =
|
|
392
|
-
const u = r.current,
|
|
381
|
+
const [a, n] = c.useState([]), r = c.useRef(null), l = c.useRef(!1), { detailedBudgets: d } = D(), m = c.useCallback(() => {
|
|
382
|
+
const u = r.current, C = ht(d), h = C.nodes();
|
|
393
383
|
if (u) {
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
const
|
|
397
|
-
|
|
398
|
-
vx:
|
|
399
|
-
vy:
|
|
400
|
-
x:
|
|
401
|
-
y:
|
|
384
|
+
const p = u.nodes(), b = new Map(p.map((S) => [S.guid, S]));
|
|
385
|
+
h.forEach((S) => {
|
|
386
|
+
const _ = b.get(S.guid);
|
|
387
|
+
_ && Object.assign(S, {
|
|
388
|
+
vx: _.vx,
|
|
389
|
+
vy: _.vy,
|
|
390
|
+
x: _.x,
|
|
391
|
+
y: _.y
|
|
402
392
|
});
|
|
403
393
|
});
|
|
404
394
|
}
|
|
405
|
-
r.current =
|
|
395
|
+
r.current = C, l.current = !1, n(h);
|
|
406
396
|
}, [d]);
|
|
407
|
-
return
|
|
397
|
+
return c.useEffect(() => {
|
|
408
398
|
m();
|
|
409
|
-
}, [m]),
|
|
399
|
+
}, [m]), c.useEffect(() => () => {
|
|
410
400
|
r.current && (r.current.stop(), r.current = null);
|
|
411
|
-
}, []),
|
|
401
|
+
}, []), c.useEffect(() => {
|
|
412
402
|
const u = r.current;
|
|
413
403
|
if (!u) return;
|
|
414
|
-
const
|
|
415
|
-
u.nodes(
|
|
416
|
-
|
|
417
|
-
}, 0), n([...
|
|
418
|
-
}, [t, o, i, d]), /* @__PURE__ */ e("svg", { height: t, style: { overflow: "visible" }, width: Math.abs(o), children: a.map((u) => /* @__PURE__ */ e(
|
|
419
|
-
},
|
|
404
|
+
const C = u.nodes(), h = o > 0 && o < 450 || t > 0 && t < 300, p = yt(C, d, h, t, o);
|
|
405
|
+
u.nodes(p), pt(u, t, o), i && setTimeout(() => {
|
|
406
|
+
gt(u);
|
|
407
|
+
}, 0), n([...p]);
|
|
408
|
+
}, [t, o, i, d]), /* @__PURE__ */ e("svg", { height: t, style: { overflow: "visible" }, width: Math.abs(o), children: a.map((u) => /* @__PURE__ */ e(St, { bubble: u, isDraggable: i, onClick: s }, u.guid)) });
|
|
409
|
+
}, vt = E(xt), At = ({
|
|
420
410
|
isMiniWidget: t = !1,
|
|
421
411
|
onConnectAccountsClick: o,
|
|
422
412
|
createBudgetOnClick: i
|
|
423
413
|
}) => {
|
|
424
|
-
const { recalculateBudgets: s } = D(), { spendCategories: a } =
|
|
425
|
-
|
|
426
|
-
const { data:
|
|
427
|
-
|
|
414
|
+
const { recalculateBudgets: s } = D(), { spendCategories: a } = V(), { budgets: n } = w(), { availableWidth: r } = ne(), { isMobile: l } = ie(r), d = t && l, [m, u] = c.useState(!1), [C, h] = c.useState(!1), [p, b] = c.useState(!1), S = c.useMemo(() => [...a.filter((f) => f.totalAverageAmount > 0)], [a]), _ = async () => {
|
|
415
|
+
b(!0);
|
|
416
|
+
const { data: f, isSuccess: A } = await s(S);
|
|
417
|
+
b(!1), A ? (f.length === 0 && h(!0), u(!1)) : u(!0);
|
|
428
418
|
};
|
|
429
|
-
return
|
|
430
|
-
|
|
419
|
+
return p ? /* @__PURE__ */ e(he, {}) : m ? /* @__PURE__ */ e(
|
|
420
|
+
de,
|
|
431
421
|
{
|
|
432
422
|
header: n.autogenerate_budgets_error_header,
|
|
433
423
|
icon: "error",
|
|
434
424
|
iconColor: "#4D4D4D",
|
|
435
|
-
onClick: (
|
|
436
|
-
|
|
425
|
+
onClick: (f) => {
|
|
426
|
+
f === "primary" ? _() : i();
|
|
437
427
|
},
|
|
438
428
|
primaryButton: n.autogenerate_budgets_error_primary_button,
|
|
439
429
|
secondaryButton: n.zero_state_generate_budgets_secondary_button,
|
|
@@ -447,14 +437,14 @@ const vt = ({
|
|
|
447
437
|
...d && { justifyContent: "center", mt: 0, svg: { height: 32, width: 32 } }
|
|
448
438
|
}
|
|
449
439
|
}
|
|
450
|
-
) : /* @__PURE__ */ e(
|
|
451
|
-
|
|
440
|
+
) : /* @__PURE__ */ e(Pe, { children: C ? /* @__PURE__ */ e(
|
|
441
|
+
de,
|
|
452
442
|
{
|
|
453
443
|
header: n.zero_state_generate_budgets_header,
|
|
454
444
|
icon: "error",
|
|
455
445
|
iconColor: "#4D4D4D",
|
|
456
|
-
onClick: (
|
|
457
|
-
|
|
446
|
+
onClick: (f) => {
|
|
447
|
+
f === "primary" ? o() : i();
|
|
458
448
|
},
|
|
459
449
|
primaryButton: n.zero_state_generate_budgets_primary_button,
|
|
460
450
|
secondaryButton: n.zero_state_generate_budgets_secondary_button,
|
|
@@ -473,13 +463,13 @@ const vt = ({
|
|
|
473
463
|
}
|
|
474
464
|
}
|
|
475
465
|
) : /* @__PURE__ */ e(
|
|
476
|
-
|
|
466
|
+
de,
|
|
477
467
|
{
|
|
478
468
|
header: n.create_budgets_title,
|
|
479
469
|
icon: "bubble_chart",
|
|
480
470
|
iconColor: "#1A1A1A",
|
|
481
|
-
onClick: (
|
|
482
|
-
|
|
471
|
+
onClick: (f) => {
|
|
472
|
+
f === "primary" ? _() : i();
|
|
483
473
|
},
|
|
484
474
|
primaryButton: n.empty_state_primary_button,
|
|
485
475
|
secondaryButton: t ? void 0 : n.empty_state_secondary_button,
|
|
@@ -498,7 +488,7 @@ const vt = ({
|
|
|
498
488
|
}
|
|
499
489
|
}
|
|
500
490
|
) });
|
|
501
|
-
}, Re =
|
|
491
|
+
}, Re = E(
|
|
502
492
|
({
|
|
503
493
|
createBudgetOnClick: t = () => {
|
|
504
494
|
},
|
|
@@ -508,34 +498,34 @@ const vt = ({
|
|
|
508
498
|
shouldShowZeroState: a,
|
|
509
499
|
unavailableWidth: n = 24
|
|
510
500
|
}) => {
|
|
511
|
-
const { onEvent: r } =
|
|
512
|
-
|
|
513
|
-
budget_category:
|
|
501
|
+
const { onEvent: r } = Y(), { setSelectedBudget: l } = D(), { isInitialized: d } = oe(), { accounts: m } = w(), { availableWidth: u } = ne(), { isMobile: C } = ie(), [h, p] = c.useState(!1), b = c.useMemo(() => u - n, [u]), S = (f) => {
|
|
502
|
+
l(f), r(k.BUDGETS_CLICK_BUDGET_CATEGORY, {
|
|
503
|
+
budget_category: f.category.name,
|
|
514
504
|
click_type: "bubble"
|
|
515
505
|
});
|
|
516
|
-
},
|
|
506
|
+
}, _ = () => {
|
|
517
507
|
p(!0), r(k.ACCOUNTS_CLICK_CONNECT);
|
|
518
508
|
};
|
|
519
|
-
return
|
|
520
|
-
|
|
509
|
+
return /* @__PURE__ */ g(
|
|
510
|
+
F,
|
|
521
511
|
{
|
|
522
|
-
ml: a ||
|
|
512
|
+
ml: a || C ? 0 : 24,
|
|
523
513
|
sx: { alignSelf: "center", ...s && { height: "100%" } },
|
|
524
514
|
children: [
|
|
525
|
-
a || !
|
|
526
|
-
|
|
515
|
+
a || !d ? /* @__PURE__ */ e(
|
|
516
|
+
At,
|
|
527
517
|
{
|
|
528
518
|
createBudgetOnClick: t,
|
|
529
519
|
isMiniWidget: s,
|
|
530
|
-
onConnectAccountsClick:
|
|
520
|
+
onConnectAccountsClick: _
|
|
531
521
|
}
|
|
532
522
|
) : /* @__PURE__ */ e(
|
|
533
|
-
|
|
523
|
+
vt,
|
|
534
524
|
{
|
|
535
525
|
height: o,
|
|
536
526
|
isDraggable: i,
|
|
537
|
-
onClick:
|
|
538
|
-
width:
|
|
527
|
+
onClick: S,
|
|
528
|
+
width: b
|
|
539
529
|
}
|
|
540
530
|
),
|
|
541
531
|
/* @__PURE__ */ e(
|
|
@@ -543,26 +533,26 @@ const vt = ({
|
|
|
543
533
|
{
|
|
544
534
|
onClose: () => p(!1),
|
|
545
535
|
showConnectionsWidget: h,
|
|
546
|
-
title:
|
|
536
|
+
title: m.manage_connections
|
|
547
537
|
}
|
|
548
538
|
)
|
|
549
539
|
]
|
|
550
540
|
}
|
|
551
541
|
);
|
|
552
542
|
}
|
|
553
|
-
),
|
|
543
|
+
), Tt = ({
|
|
554
544
|
budgetsCopy: t,
|
|
555
545
|
difference: o,
|
|
556
546
|
handleAddClick: i,
|
|
557
547
|
shouldShowZeroState: s
|
|
558
548
|
}) => {
|
|
559
|
-
const { availableHeight: a = 0 } = ne(), n =
|
|
560
|
-
|
|
549
|
+
const { availableHeight: a = 0 } = ne(), n = c.useRef(null);
|
|
550
|
+
c.useEffect(() => {
|
|
561
551
|
a > 0 && n.current === null && (n.current = a);
|
|
562
552
|
}, [a]);
|
|
563
|
-
const r =
|
|
564
|
-
const
|
|
565
|
-
return
|
|
553
|
+
const r = c.useMemo(() => {
|
|
554
|
+
const l = n.current ?? a;
|
|
555
|
+
return l > 0 ? Math.round(Math.max(120, Math.min(450, l * 0.8))) - 40 : 450;
|
|
566
556
|
}, [a]);
|
|
567
557
|
return /* @__PURE__ */ g(B, { sx: { height: "100%", justifyContent: "space-between" }, children: [
|
|
568
558
|
/* @__PURE__ */ e(
|
|
@@ -574,55 +564,61 @@ const vt = ({
|
|
|
574
564
|
shouldShowZeroState: s
|
|
575
565
|
}
|
|
576
566
|
),
|
|
577
|
-
!s && /* @__PURE__ */ g(
|
|
567
|
+
!s && /* @__PURE__ */ g(F, { ml: 16, children: [
|
|
578
568
|
/* @__PURE__ */ e(y, { bold: !0, color: o < 0 ? "error.main" : "success.main", children: T(Math.abs(o), "0,0") }),
|
|
579
569
|
/* @__PURE__ */ e(y, { children: o < 0 ? t.overspent_in_budgets : t.left_in_budgets })
|
|
580
570
|
] })
|
|
581
571
|
] });
|
|
582
|
-
},
|
|
583
|
-
const o =
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
}, [o]),
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
572
|
+
}, wt = (t) => {
|
|
573
|
+
const o = H(), { onEvent: i } = Y(), { visibleAccounts: s } = pe(), { detailedBudgets: a, isDataLoaded: n, loadBudgetData: r, setTheme: l } = D(), { budgets: d, common: m } = w(), { isInitialized: u, selectedAccounts: C, setSelectedAccounts: h } = oe(), { reloadCategoryTotals: p } = V(), b = Ye(), S = a.length === 0, [_, f] = c.useState(!1);
|
|
574
|
+
c.useEffect(() => {
|
|
575
|
+
n || r().finally();
|
|
576
|
+
}, []), c.useEffect(() => {
|
|
577
|
+
l(o);
|
|
578
|
+
}, [o]), c.useEffect(() => {
|
|
579
|
+
h(s);
|
|
580
|
+
}, [s]), c.useEffect(() => {
|
|
581
|
+
u && !n && p(
|
|
582
|
+
C,
|
|
583
|
+
Q(/* @__PURE__ */ new Date()),
|
|
584
|
+
me(/* @__PURE__ */ new Date())
|
|
585
|
+
).finally();
|
|
586
|
+
}, [u, C]);
|
|
587
|
+
const A = () => {
|
|
588
|
+
f(!0), i(k.BUDGETS_CLICK_ADD);
|
|
589
|
+
}, v = () => f(!1);
|
|
590
|
+
return !u || !n ? /* @__PURE__ */ e(he, {}) : /* @__PURE__ */ g(
|
|
591
|
+
Xe,
|
|
596
592
|
{
|
|
597
593
|
contentStyles: { height: "calc(100% - 66px)", ":last-child": { pb: 0 } },
|
|
598
|
-
primaryCtaLabel:
|
|
594
|
+
primaryCtaLabel: S ? d.get_started_cta : d.details_cta,
|
|
599
595
|
sx: { height: "100%" },
|
|
600
|
-
title:
|
|
596
|
+
title: d.budgets_title,
|
|
601
597
|
...t,
|
|
602
598
|
children: [
|
|
603
|
-
|
|
604
|
-
|
|
599
|
+
/* @__PURE__ */ e(
|
|
600
|
+
Tt,
|
|
605
601
|
{
|
|
606
|
-
budgetsCopy:
|
|
607
|
-
difference:
|
|
608
|
-
handleAddClick:
|
|
609
|
-
shouldShowZeroState:
|
|
602
|
+
budgetsCopy: d,
|
|
603
|
+
difference: b,
|
|
604
|
+
handleAddClick: A,
|
|
605
|
+
shouldShowZeroState: S
|
|
610
606
|
}
|
|
611
|
-
)
|
|
607
|
+
),
|
|
612
608
|
/* @__PURE__ */ e(
|
|
613
|
-
|
|
609
|
+
L,
|
|
614
610
|
{
|
|
615
|
-
ariaLabelClose:
|
|
616
|
-
isOpen:
|
|
617
|
-
onClose: () =>
|
|
618
|
-
title:
|
|
619
|
-
children: /* @__PURE__ */ e(
|
|
611
|
+
ariaLabelClose: m.close_aria,
|
|
612
|
+
isOpen: _,
|
|
613
|
+
onClose: () => f(!1),
|
|
614
|
+
title: d.add_new_title,
|
|
615
|
+
children: /* @__PURE__ */ e(Ie, { onRecalculateBudgets: v })
|
|
620
616
|
}
|
|
621
617
|
)
|
|
622
618
|
]
|
|
623
619
|
}
|
|
624
|
-
)
|
|
625
|
-
},
|
|
620
|
+
);
|
|
621
|
+
}, Mn = E(wt), ke = ({ budget: t }) => {
|
|
626
622
|
const {
|
|
627
623
|
amount: o,
|
|
628
624
|
budgetColors: { background: i },
|
|
@@ -630,26 +626,26 @@ const vt = ({
|
|
|
630
626
|
category_guid: a,
|
|
631
627
|
percentage: n,
|
|
632
628
|
transaction_total: r
|
|
633
|
-
} = t,
|
|
629
|
+
} = t, l = [
|
|
634
630
|
{
|
|
635
631
|
color: i,
|
|
636
632
|
percentage: `${n}%`
|
|
637
633
|
}
|
|
638
634
|
];
|
|
639
|
-
return /* @__PURE__ */ e(
|
|
635
|
+
return /* @__PURE__ */ e(be, { sx: { mt: 24, mx: 24 }, children: /* @__PURE__ */ e(fe, { children: /* @__PURE__ */ g(B, { alignItems: "center", gap: 16, children: [
|
|
640
636
|
/* @__PURE__ */ e(W, { categoryGuid: a, size: 56 }),
|
|
641
|
-
/* @__PURE__ */ e(
|
|
642
|
-
/* @__PURE__ */ e(y, { bold: !0, variant: "
|
|
643
|
-
/* @__PURE__ */ e(
|
|
637
|
+
/* @__PURE__ */ e(je, { children: `${T(r, "0,0")} / ${T(o, "0,0")}` }),
|
|
638
|
+
/* @__PURE__ */ e(y, { bold: !0, variant: "caption", children: s }),
|
|
639
|
+
/* @__PURE__ */ e(ge, { data: l, height: 10 })
|
|
644
640
|
] }) }) });
|
|
645
|
-
},
|
|
641
|
+
}, Dt = E(() => {
|
|
646
642
|
const { budgets: t } = w();
|
|
647
643
|
return /* @__PURE__ */ g(B, { alignItems: "center", gap: 12, height: "auto", mb: 24, mt: 24, children: [
|
|
648
|
-
/* @__PURE__ */ e(
|
|
649
|
-
/* @__PURE__ */ e(y, { bold: !0, color: "secondary", variant: "
|
|
650
|
-
/* @__PURE__ */ e(y, { color: "text.secondary", variant: "
|
|
644
|
+
/* @__PURE__ */ e(G, { color: "secondary", name: "bubble_chart", sx: { fontSize: 32 } }),
|
|
645
|
+
/* @__PURE__ */ e(y, { bold: !0, color: "secondary", variant: "body2", children: t.zero_state_no_sub_budgets }),
|
|
646
|
+
/* @__PURE__ */ e(y, { color: "text.secondary", variant: "caption", children: t.zero_state_no_sub_budgets_description })
|
|
651
647
|
] });
|
|
652
|
-
}), Et =
|
|
648
|
+
}), Et = E(({ budget: t }) => {
|
|
653
649
|
const {
|
|
654
650
|
amount: o,
|
|
655
651
|
budgetColors: { background: i },
|
|
@@ -657,133 +653,133 @@ const vt = ({
|
|
|
657
653
|
percentage: a,
|
|
658
654
|
transaction_total: n
|
|
659
655
|
} = t, { setSelectedSubBudget: r } = D();
|
|
660
|
-
return /* @__PURE__ */ e(
|
|
656
|
+
return /* @__PURE__ */ e(X, { children: /* @__PURE__ */ g(Z, { onClick: () => r(t), children: [
|
|
661
657
|
/* @__PURE__ */ e(se, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(De, { color: i, percent: a, size: 40, children: /* @__PURE__ */ e(W, { categoryGuid: s.parent_guid, variant: "basic" }) }) }),
|
|
662
658
|
/* @__PURE__ */ e(
|
|
663
|
-
|
|
659
|
+
q,
|
|
664
660
|
{
|
|
665
|
-
primary: /* @__PURE__ */ e(B, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(y, { bold: !0, variant: "
|
|
666
|
-
secondary: /* @__PURE__ */ e(B, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(y, { fontWeight: 400, variant: "
|
|
661
|
+
primary: /* @__PURE__ */ e(B, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(y, { bold: !0, variant: "body1", children: t.category.name }) }),
|
|
662
|
+
secondary: /* @__PURE__ */ e(B, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(y, { fontWeight: 400, variant: "body1", children: `
|
|
667
663
|
${T(n, "0,0")} /
|
|
668
664
|
${T(o, "0,0")}
|
|
669
665
|
` }) })
|
|
670
666
|
}
|
|
671
667
|
)
|
|
672
668
|
] }) });
|
|
673
|
-
}),
|
|
674
|
-
const { budgets: i, common: s } = w(), { setExpandedGuid: a, setOnSelect: n } =
|
|
675
|
-
|
|
676
|
-
n((
|
|
677
|
-
const
|
|
678
|
-
|
|
669
|
+
}), It = E(({ category: t, parentBudget: o }) => {
|
|
670
|
+
const { budgets: i, common: s } = w(), { setExpandedGuid: a, setOnSelect: n } = nt(), { addBudget: r } = D(), [l, d] = c.useState(!1), [m, u] = c.useState(!1), [C, h] = c.useState(""), [p, b] = c.useState(void 0);
|
|
671
|
+
c.useEffect(() => {
|
|
672
|
+
n((f) => {
|
|
673
|
+
const A = t.subCategories.find((v) => v.guid === f);
|
|
674
|
+
A && (b(A), h(`${A.currentAmount === 0 ? "" : A.currentAmount}`), u(!0));
|
|
679
675
|
});
|
|
680
676
|
}, []);
|
|
681
677
|
const S = () => {
|
|
682
678
|
a(t.guid), d(!0);
|
|
683
|
-
},
|
|
684
|
-
|
|
679
|
+
}, _ = async () => {
|
|
680
|
+
p && Number(C) > 0 && (await r(p, Number(C), o.guid), u(!1), d(!1), b(void 0));
|
|
685
681
|
};
|
|
686
|
-
return /* @__PURE__ */ g(
|
|
687
|
-
/* @__PURE__ */ e(
|
|
682
|
+
return /* @__PURE__ */ g(F, { children: [
|
|
683
|
+
/* @__PURE__ */ e(X, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(Z, { onClick: S, children: /* @__PURE__ */ e(q, { children: /* @__PURE__ */ g(B, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
688
684
|
/* @__PURE__ */ g(B, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
689
|
-
/* @__PURE__ */ e(
|
|
690
|
-
/* @__PURE__ */ e(y, { bold: !0, sx: { color: "primary.light" }, variant: "
|
|
685
|
+
/* @__PURE__ */ e(G, { fill: !0, name: "add_box", size: 24, sx: { color: "primary.light" } }),
|
|
686
|
+
/* @__PURE__ */ e(y, { bold: !0, sx: { color: "primary.light" }, variant: "body1", children: i.add_sub_budget_button })
|
|
691
687
|
] }),
|
|
692
|
-
/* @__PURE__ */ e(
|
|
688
|
+
/* @__PURE__ */ e(G, { name: "chevron_right", size: 24, sx: { color: "primary.light" } })
|
|
693
689
|
] }) }) }) }),
|
|
694
690
|
/* @__PURE__ */ e(re, {}),
|
|
695
691
|
/* @__PURE__ */ e(
|
|
696
|
-
|
|
692
|
+
L,
|
|
697
693
|
{
|
|
698
694
|
ariaLabelClose: s.close_aria,
|
|
699
|
-
isOpen:
|
|
695
|
+
isOpen: l,
|
|
700
696
|
onClose: () => d(!1),
|
|
701
697
|
title: i.add_sub_budget_title,
|
|
702
|
-
children: /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(
|
|
698
|
+
children: /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(ot, { category: t, subCategories: t.subCategories }) })
|
|
703
699
|
}
|
|
704
700
|
),
|
|
705
701
|
/* @__PURE__ */ e(
|
|
706
702
|
j,
|
|
707
703
|
{
|
|
708
704
|
copy: { close_aria: s.close_aria, title: i.add_title },
|
|
709
|
-
disablePrimaryButton: Number(
|
|
705
|
+
disablePrimaryButton: Number(C) <= 0,
|
|
710
706
|
isOpen: m,
|
|
711
707
|
onClose: () => u(!1),
|
|
712
|
-
onPrimaryAction:
|
|
708
|
+
onPrimaryAction: _,
|
|
713
709
|
primaryText: i.add_save_button,
|
|
714
710
|
children: /* @__PURE__ */ e(
|
|
715
711
|
ce,
|
|
716
712
|
{
|
|
717
|
-
amount:
|
|
718
|
-
categoryName:
|
|
719
|
-
onAmountChanged:
|
|
713
|
+
amount: C,
|
|
714
|
+
categoryName: p?.name || "",
|
|
715
|
+
onAmountChanged: h
|
|
720
716
|
}
|
|
721
717
|
)
|
|
722
718
|
}
|
|
723
719
|
)
|
|
724
720
|
] });
|
|
725
|
-
}),
|
|
726
|
-
const { category: o, subBudgets: i } = t, { budgets: s, common: a } = w(), { deleteBudget: n, selectedSubBudget: r, setSelectedSubBudget:
|
|
727
|
-
|
|
728
|
-
r && (
|
|
721
|
+
}), Ot = E(({ budget: t }) => {
|
|
722
|
+
const { category: o, subBudgets: i } = t, { budgets: s, common: a } = w(), { deleteBudget: n, selectedSubBudget: r, setSelectedSubBudget: l, updateBudget: d } = D(), { filter: m, setFilter: u } = ae(), [C, h] = c.useState(!1), [p, b] = c.useState(!1), [S, _] = c.useState("");
|
|
723
|
+
c.useEffect(() => {
|
|
724
|
+
r && (_(`${r.amount}`), u({
|
|
729
725
|
...m,
|
|
730
726
|
custom: (x) => x.category_guid === r.category_guid
|
|
731
727
|
}));
|
|
732
728
|
}, [r]);
|
|
733
|
-
const
|
|
729
|
+
const f = async () => {
|
|
734
730
|
r && await d({
|
|
735
731
|
...r,
|
|
736
732
|
amount: Number(S)
|
|
737
733
|
});
|
|
738
|
-
},
|
|
739
|
-
r && await n(r.guid),
|
|
740
|
-
},
|
|
734
|
+
}, A = async () => {
|
|
735
|
+
r && await n(r.guid), b(!1), v();
|
|
736
|
+
}, v = () => {
|
|
741
737
|
u({
|
|
742
738
|
...m,
|
|
743
739
|
custom: (x) => x.category_guid === t.category_guid || x.top_level_category_guid === t.category_guid
|
|
744
|
-
}),
|
|
740
|
+
}), l(void 0);
|
|
745
741
|
};
|
|
746
|
-
return /* @__PURE__ */ g(
|
|
742
|
+
return /* @__PURE__ */ g(c.Fragment, { children: [
|
|
747
743
|
/* @__PURE__ */ g(K, { sx: { bgcolor: "background.paper" }, children: [
|
|
748
|
-
i.length === 0 ? /* @__PURE__ */ e(
|
|
744
|
+
i.length === 0 ? /* @__PURE__ */ e(Dt, {}) : i.map((x) => /* @__PURE__ */ g(c.Fragment, { children: [
|
|
749
745
|
/* @__PURE__ */ e(Et, { budget: x }),
|
|
750
746
|
/* @__PURE__ */ e(re, {})
|
|
751
747
|
] }, x.guid)),
|
|
752
|
-
/* @__PURE__ */ e(
|
|
748
|
+
/* @__PURE__ */ e(It, { category: o, parentBudget: t })
|
|
753
749
|
] }),
|
|
754
750
|
/* @__PURE__ */ e(
|
|
755
|
-
|
|
751
|
+
L,
|
|
756
752
|
{
|
|
757
753
|
ariaLabelClose: a.close_aria,
|
|
758
754
|
isOpen: !!r,
|
|
759
|
-
onClose:
|
|
760
|
-
onPrimaryAction: () =>
|
|
761
|
-
onSecondaryAction: () =>
|
|
755
|
+
onClose: v,
|
|
756
|
+
onPrimaryAction: () => h(!0),
|
|
757
|
+
onSecondaryAction: () => b(!0),
|
|
762
758
|
primaryText: s.details_edit_button,
|
|
763
759
|
secondaryText: s.details_delete_button,
|
|
764
760
|
title: s.details_title,
|
|
765
761
|
children: r && /* @__PURE__ */ g(B, { gap: 24, children: [
|
|
766
|
-
/* @__PURE__ */ e(
|
|
762
|
+
/* @__PURE__ */ e(ke, { budget: r }),
|
|
767
763
|
/* @__PURE__ */ e(we, { height: "100%" })
|
|
768
764
|
] })
|
|
769
765
|
}
|
|
770
766
|
),
|
|
771
|
-
r && /* @__PURE__ */ g(
|
|
767
|
+
r && /* @__PURE__ */ g(c.Fragment, { children: [
|
|
772
768
|
/* @__PURE__ */ e(
|
|
773
769
|
j,
|
|
774
770
|
{
|
|
775
771
|
copy: { close_aria: a.close_aria, title: s.details_edit_title },
|
|
776
772
|
disablePrimaryButton: Number(S) <= 0,
|
|
777
|
-
isOpen:
|
|
778
|
-
onClose: () =>
|
|
779
|
-
onPrimaryAction:
|
|
773
|
+
isOpen: C,
|
|
774
|
+
onClose: () => h(!1),
|
|
775
|
+
onPrimaryAction: f,
|
|
780
776
|
primaryText: s.edit_save_button,
|
|
781
777
|
children: /* @__PURE__ */ e(
|
|
782
778
|
ce,
|
|
783
779
|
{
|
|
784
780
|
amount: S,
|
|
785
781
|
categoryName: r.category.name,
|
|
786
|
-
onAmountChanged:
|
|
782
|
+
onAmountChanged: _
|
|
787
783
|
}
|
|
788
784
|
)
|
|
789
785
|
}
|
|
@@ -792,135 +788,135 @@ const vt = ({
|
|
|
792
788
|
j,
|
|
793
789
|
{
|
|
794
790
|
copy: { close_aria: a.close_aria, title: s.delete_title },
|
|
795
|
-
isOpen:
|
|
796
|
-
onClose: () =>
|
|
797
|
-
onPrimaryAction:
|
|
791
|
+
isOpen: p,
|
|
792
|
+
onClose: () => b(!1),
|
|
793
|
+
onPrimaryAction: A,
|
|
798
794
|
primaryColor: "error",
|
|
799
795
|
primaryText: "Delete",
|
|
800
796
|
secondaryColor: "secondary",
|
|
801
|
-
children: /* @__PURE__ */ e(y, { variant: "
|
|
797
|
+
children: /* @__PURE__ */ e(y, { variant: "subtitle1", children: R(s.delete_description, r.category.name) })
|
|
802
798
|
}
|
|
803
799
|
)
|
|
804
800
|
] })
|
|
805
801
|
] });
|
|
806
|
-
}),
|
|
807
|
-
const { is_mobile_webview: o } =
|
|
802
|
+
}), Mt = E(({ budget: t }) => {
|
|
803
|
+
const { is_mobile_webview: o } = ze(), { setAlert: i } = D(), { budgets: s, common: a, transactions: n } = w(), { isDesktop: r, isSmallTablet: l, isTablet: d } = ie(), {
|
|
808
804
|
sortedTransactions: m,
|
|
809
805
|
sortedTransactionsWithSplits: u,
|
|
810
|
-
tags:
|
|
811
|
-
} = ae(), [
|
|
812
|
-
() => m.find((x) => x.guid ===
|
|
813
|
-
[
|
|
814
|
-
),
|
|
815
|
-
|
|
816
|
-
},
|
|
817
|
-
|
|
818
|
-
},
|
|
806
|
+
tags: C
|
|
807
|
+
} = ae(), [h, p] = c.useState(0), [b, S] = c.useState(""), _ = c.useMemo(
|
|
808
|
+
() => m.find((x) => x.guid === b),
|
|
809
|
+
[b, m]
|
|
810
|
+
), f = (x, I) => {
|
|
811
|
+
p(I);
|
|
812
|
+
}, A = () => {
|
|
813
|
+
et(u, C), i(s.alert_csv_downloaded);
|
|
814
|
+
}, v = m.length > 0 && !o && (r || d && !l);
|
|
819
815
|
return /* @__PURE__ */ g(B, { gap: 24, children: [
|
|
820
|
-
/* @__PURE__ */ e(
|
|
816
|
+
/* @__PURE__ */ e(ke, { budget: t }),
|
|
821
817
|
/* @__PURE__ */ g(B, { children: [
|
|
822
818
|
/* @__PURE__ */ g(
|
|
823
|
-
|
|
819
|
+
Qe,
|
|
824
820
|
{
|
|
825
|
-
onChange:
|
|
821
|
+
onChange: f,
|
|
826
822
|
sx: { width: "100%" },
|
|
827
823
|
textColor: "primary",
|
|
828
|
-
value:
|
|
824
|
+
value: h,
|
|
829
825
|
variant: "fullWidth",
|
|
830
826
|
children: [
|
|
831
|
-
/* @__PURE__ */ e(
|
|
832
|
-
/* @__PURE__ */ e(
|
|
827
|
+
/* @__PURE__ */ e(Ce, { label: s.details_transactions_tab }),
|
|
828
|
+
/* @__PURE__ */ e(Ce, { label: s.details_subbudgets_tab })
|
|
833
829
|
]
|
|
834
830
|
}
|
|
835
831
|
),
|
|
836
|
-
|
|
837
|
-
|
|
832
|
+
h === 0 && /* @__PURE__ */ g(B, { children: [
|
|
833
|
+
v && /* @__PURE__ */ e(B, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ e(
|
|
838
834
|
Te,
|
|
839
835
|
{
|
|
840
|
-
onClick:
|
|
841
|
-
startIcon: /* @__PURE__ */ e(
|
|
836
|
+
onClick: A,
|
|
837
|
+
startIcon: /* @__PURE__ */ e(G, { name: "ios_share" }),
|
|
842
838
|
variant: "text",
|
|
843
839
|
children: n.export_csv_btn
|
|
844
840
|
}
|
|
845
841
|
) }),
|
|
846
842
|
/* @__PURE__ */ e(we, { height: "100%", onClick: S })
|
|
847
843
|
] }),
|
|
848
|
-
|
|
844
|
+
h === 1 && /* @__PURE__ */ e(Ot, { budget: t }),
|
|
849
845
|
/* @__PURE__ */ e(
|
|
850
|
-
|
|
846
|
+
L,
|
|
851
847
|
{
|
|
852
848
|
ariaLabelClose: a.close_aria,
|
|
853
|
-
isOpen: !!
|
|
849
|
+
isOpen: !!_,
|
|
854
850
|
onClose: () => S(""),
|
|
855
851
|
title: s.details_transaction_drawer,
|
|
856
|
-
children:
|
|
852
|
+
children: _ && /* @__PURE__ */ e(tt, { transaction: _ })
|
|
857
853
|
}
|
|
858
854
|
)
|
|
859
855
|
] })
|
|
860
856
|
] });
|
|
861
|
-
}),
|
|
857
|
+
}), Rt = E(() => {
|
|
862
858
|
const { selectedAccountGuids: t } = oe(), { budgets: o, common: i } = w(), {
|
|
863
859
|
dateRange: s,
|
|
864
860
|
deleteBudget: a,
|
|
865
861
|
selectedBudget: n,
|
|
866
862
|
selectedSubBudget: r,
|
|
867
|
-
setAlert:
|
|
863
|
+
setAlert: l,
|
|
868
864
|
setSelectedBudget: d,
|
|
869
865
|
updateBudget: m
|
|
870
|
-
} = D(), { setFilter: u } = ae(), [
|
|
871
|
-
|
|
872
|
-
n && !r && (
|
|
866
|
+
} = D(), { setFilter: u } = ae(), [C, h] = c.useState(!1), [p, b] = c.useState(!1), [S, _] = c.useState(!1), [f, A] = c.useState("");
|
|
867
|
+
c.useEffect(() => {
|
|
868
|
+
n && !r && (A(`${n.amount}`), h(!0), u({
|
|
873
869
|
accounts: t,
|
|
874
870
|
dateRange: s,
|
|
875
871
|
custom: (M) => M.category_guid === n.category_guid || M.top_level_category_guid === n.category_guid,
|
|
876
872
|
showSplits: !0
|
|
877
873
|
}));
|
|
878
874
|
}, [n]);
|
|
879
|
-
const
|
|
875
|
+
const v = async () => {
|
|
880
876
|
n && (await m({
|
|
881
877
|
...n,
|
|
882
|
-
amount: Number(
|
|
883
|
-
percentage: n.category.totalAmount / Number(
|
|
884
|
-
}),
|
|
878
|
+
amount: Number(f),
|
|
879
|
+
percentage: n.category.totalAmount / Number(f) * 100
|
|
880
|
+
}), l(R(o.alert_budget_updated, n.category.name)));
|
|
885
881
|
}, x = async () => {
|
|
886
|
-
n && (await a(n.guid),
|
|
887
|
-
},
|
|
888
|
-
|
|
882
|
+
n && (await a(n.guid), l(R(o.alert_budget_deleted, n.category.name))), _(!1), I();
|
|
883
|
+
}, I = () => {
|
|
884
|
+
h(!1), setTimeout(() => {
|
|
889
885
|
d(void 0);
|
|
890
886
|
}, 250);
|
|
891
887
|
};
|
|
892
888
|
if (n)
|
|
893
|
-
return /* @__PURE__ */ g(
|
|
889
|
+
return /* @__PURE__ */ g(c.Fragment, { children: [
|
|
894
890
|
/* @__PURE__ */ e(
|
|
895
|
-
|
|
891
|
+
L,
|
|
896
892
|
{
|
|
897
893
|
ariaLabelClose: i.close_aria,
|
|
898
|
-
isOpen:
|
|
899
|
-
onClose:
|
|
900
|
-
onPrimaryAction: () =>
|
|
901
|
-
onSecondaryAction: () =>
|
|
894
|
+
isOpen: C,
|
|
895
|
+
onClose: I,
|
|
896
|
+
onPrimaryAction: () => b(!0),
|
|
897
|
+
onSecondaryAction: () => _(!0),
|
|
902
898
|
primaryText: o.details_edit_button,
|
|
903
899
|
secondaryColor: "error",
|
|
904
900
|
secondaryText: o.details_delete_button,
|
|
905
901
|
title: o.details_title,
|
|
906
|
-
children: /* @__PURE__ */ e(
|
|
902
|
+
children: /* @__PURE__ */ e(Mt, { budget: n })
|
|
907
903
|
}
|
|
908
904
|
),
|
|
909
905
|
/* @__PURE__ */ e(
|
|
910
906
|
j,
|
|
911
907
|
{
|
|
912
908
|
copy: { close_aria: i.close_aria, title: o.details_edit_title },
|
|
913
|
-
disablePrimaryButton: Number(
|
|
914
|
-
isOpen:
|
|
915
|
-
onClose: () =>
|
|
916
|
-
onPrimaryAction:
|
|
909
|
+
disablePrimaryButton: Number(f) <= 0,
|
|
910
|
+
isOpen: p,
|
|
911
|
+
onClose: () => b(!1),
|
|
912
|
+
onPrimaryAction: v,
|
|
917
913
|
primaryText: o.edit_save_button,
|
|
918
914
|
children: /* @__PURE__ */ e(
|
|
919
915
|
ce,
|
|
920
916
|
{
|
|
921
|
-
amount:
|
|
917
|
+
amount: f,
|
|
922
918
|
categoryName: n.category.name,
|
|
923
|
-
onAmountChanged:
|
|
919
|
+
onAmountChanged: A
|
|
924
920
|
}
|
|
925
921
|
)
|
|
926
922
|
}
|
|
@@ -930,12 +926,12 @@ const vt = ({
|
|
|
930
926
|
{
|
|
931
927
|
copy: { close_aria: i.close_aria, title: o.delete_title },
|
|
932
928
|
isOpen: S,
|
|
933
|
-
onClose: () =>
|
|
929
|
+
onClose: () => _(!1),
|
|
934
930
|
onPrimaryAction: x,
|
|
935
931
|
primaryColor: "error",
|
|
936
932
|
primaryText: o.details_delete_button,
|
|
937
933
|
secondaryColor: "secondary",
|
|
938
|
-
children: /* @__PURE__ */ e(y, { variant: "
|
|
934
|
+
children: /* @__PURE__ */ e(y, { variant: "subtitle1", children: R(o.delete_description, n.category.name) })
|
|
939
935
|
}
|
|
940
936
|
)
|
|
941
937
|
] });
|
|
@@ -945,235 +941,236 @@ const vt = ({
|
|
|
945
941
|
budgetColors: { background: s, description: a },
|
|
946
942
|
category_guid: n,
|
|
947
943
|
description: r,
|
|
948
|
-
percentage:
|
|
944
|
+
percentage: l,
|
|
949
945
|
subBudgets: d,
|
|
950
946
|
transaction_total: m
|
|
951
947
|
} = t;
|
|
952
|
-
return /* @__PURE__ */ e(
|
|
953
|
-
/* @__PURE__ */ e(se, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(De, { color: s, percent:
|
|
948
|
+
return /* @__PURE__ */ e(X, { children: /* @__PURE__ */ g(Z, { onClick: () => o?.(t), children: [
|
|
949
|
+
/* @__PURE__ */ e(se, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(De, { color: s, percent: l, size: 40, children: /* @__PURE__ */ e(W, { categoryGuid: n, variant: "basic" }) }) }),
|
|
954
950
|
/* @__PURE__ */ e(
|
|
955
|
-
|
|
951
|
+
q,
|
|
956
952
|
{
|
|
957
953
|
primary: /* @__PURE__ */ g(B, { component: "span", direction: "row", justifyContent: "space-between", children: [
|
|
958
|
-
/* @__PURE__ */ e(y, { bold: !0, variant: "
|
|
959
|
-
/* @__PURE__ */ e(y, { fontWeight: 400, variant: "
|
|
954
|
+
/* @__PURE__ */ e(y, { bold: !0, variant: "body1", children: t.category.name }),
|
|
955
|
+
/* @__PURE__ */ e(y, { fontWeight: 400, variant: "body1", children: `
|
|
960
956
|
${T(m, "0,0")} /
|
|
961
957
|
${T(i, "0,0")}
|
|
962
958
|
` })
|
|
963
959
|
] }),
|
|
964
960
|
secondary: /* @__PURE__ */ g(B, { component: "span", direction: "row", justifyContent: "space-between", children: [
|
|
965
|
-
/* @__PURE__ */ e(y, { variant: "
|
|
966
|
-
/* @__PURE__ */ e(y, { bold:
|
|
961
|
+
/* @__PURE__ */ e(y, { variant: "caption", children: `${d.length} Sub-budgets` }),
|
|
962
|
+
/* @__PURE__ */ e(y, { bold: l > 100, color: a, variant: "caption", children: r })
|
|
967
963
|
] })
|
|
968
964
|
}
|
|
969
965
|
)
|
|
970
966
|
] }) });
|
|
971
|
-
},
|
|
972
|
-
const { onEvent: t } =
|
|
967
|
+
}, Lt = E(() => {
|
|
968
|
+
const { onEvent: t } = Y(), { budgets: o } = w(), { detailedBudgets: i, setSelectedBudget: s } = D(), a = (n) => {
|
|
973
969
|
s(n), t(k.BUDGETS_CLICK_BUDGET_CATEGORY, {
|
|
974
970
|
budget_category: n.category.name,
|
|
975
971
|
click_type: "list"
|
|
976
972
|
});
|
|
977
973
|
};
|
|
978
|
-
return /* @__PURE__ */ g(
|
|
979
|
-
/* @__PURE__ */ e(
|
|
980
|
-
/* @__PURE__ */ e(fe, { sx: { p: 0, ":last-child": { p: 0 } }, children: /* @__PURE__ */ e(K, { children: i.map((n) => /* @__PURE__ */ g(
|
|
974
|
+
return /* @__PURE__ */ g(be, { elevation: 2, children: [
|
|
975
|
+
/* @__PURE__ */ e(Ee, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(Ae, { children: o.budget_categories_title }) }),
|
|
976
|
+
/* @__PURE__ */ e(fe, { sx: { p: 0, ":last-child": { p: 0 } }, children: /* @__PURE__ */ e(K, { children: i.map((n) => /* @__PURE__ */ g(c.Fragment, { children: [
|
|
981
977
|
/* @__PURE__ */ e(kt, { budget: n, onClick: a }),
|
|
982
978
|
/* @__PURE__ */ e(re, {})
|
|
983
979
|
] }, n.guid)) }) })
|
|
984
980
|
] });
|
|
985
|
-
}), Nt =
|
|
986
|
-
const t =
|
|
987
|
-
const
|
|
988
|
-
let x =
|
|
981
|
+
}), Nt = E(() => {
|
|
982
|
+
const t = H(), { onEvent: o } = Y(), { visibleAccounts: i } = pe(), { budgets: s, common: a, recurring: n } = w(), { incomeCategories: r, spendCategories: l } = V(), { detailedBudgets: d, totalBudgeted: m } = D(), { incomeTotal: u } = te(), { setFilter: C } = ae(), [h, p] = c.useState(!1), [b, S] = c.useMemo(() => {
|
|
983
|
+
const v = l.reduce((N, z) => N + z.totalAmount, 0);
|
|
984
|
+
let x = v / m;
|
|
989
985
|
x > 1 && (x = 1);
|
|
990
|
-
let
|
|
991
|
-
x > 0.8 && x < 1 ?
|
|
986
|
+
let I = t.palette.success.main;
|
|
987
|
+
x > 0.8 && x < 1 ? I = t.palette.warning.main : x >= 1 && (I = t.palette.error.main);
|
|
992
988
|
const M = [
|
|
993
989
|
{
|
|
994
|
-
color:
|
|
990
|
+
color: I,
|
|
995
991
|
percentage: `${x}`
|
|
996
992
|
}
|
|
997
993
|
];
|
|
998
|
-
return [
|
|
999
|
-
}, [d,
|
|
1000
|
-
const
|
|
994
|
+
return [v, M];
|
|
995
|
+
}, [d, l]), [_, f] = c.useMemo(() => {
|
|
996
|
+
const v = Math.abs(
|
|
1001
997
|
r.reduce((M, N) => M + N.totalAmount, 0)
|
|
1002
998
|
);
|
|
1003
|
-
let x =
|
|
999
|
+
let x = v / u;
|
|
1004
1000
|
x > 1 && (x = 1);
|
|
1005
|
-
const
|
|
1001
|
+
const I = [
|
|
1006
1002
|
{
|
|
1007
1003
|
color: t.palette.secondary.main,
|
|
1008
1004
|
percentage: `${x}`
|
|
1009
1005
|
}
|
|
1010
1006
|
];
|
|
1011
|
-
return [
|
|
1012
|
-
}, [r, u]),
|
|
1013
|
-
|
|
1014
|
-
accounts: i.map((
|
|
1007
|
+
return [v, I];
|
|
1008
|
+
}, [r, u]), A = () => {
|
|
1009
|
+
C({
|
|
1010
|
+
accounts: i.map((v) => v.guid),
|
|
1015
1011
|
dateRange: {
|
|
1016
|
-
start:
|
|
1012
|
+
start: at(/* @__PURE__ */ new Date(), 90),
|
|
1017
1013
|
end: /* @__PURE__ */ new Date()
|
|
1018
1014
|
}
|
|
1019
|
-
}),
|
|
1015
|
+
}), p(!0), o(k.BUDGETS_CLICK_EDIT_INCOME);
|
|
1020
1016
|
};
|
|
1021
|
-
return /* @__PURE__ */ g(
|
|
1022
|
-
/* @__PURE__ */ e(
|
|
1017
|
+
return /* @__PURE__ */ g(be, { elevation: 2, sx: { overflow: "visible" }, children: [
|
|
1018
|
+
/* @__PURE__ */ e(Ee, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(Ae, { children: s.overview_title }) }),
|
|
1023
1019
|
/* @__PURE__ */ e(fe, { sx: { pt: 12, px: 24 }, children: /* @__PURE__ */ g(B, { gap: 24, children: [
|
|
1024
1020
|
/* @__PURE__ */ g(B, { gap: 8, children: [
|
|
1025
|
-
/* @__PURE__ */ e(y, { bold: !0, sx: { mb: 8 }, variant: "
|
|
1026
|
-
/* @__PURE__ */ e(
|
|
1027
|
-
/* @__PURE__ */ e(y, { variant: "
|
|
1021
|
+
/* @__PURE__ */ e(y, { bold: !0, sx: { mb: 8 }, variant: "body1", children: s.spending_title }),
|
|
1022
|
+
/* @__PURE__ */ e(ge, { data: S, height: 16 }),
|
|
1023
|
+
/* @__PURE__ */ e(y, { variant: "body2", children: R(
|
|
1028
1024
|
s.spending_description,
|
|
1029
|
-
T(
|
|
1025
|
+
T(b, "0,0"),
|
|
1030
1026
|
T(m, "0,0")
|
|
1031
1027
|
) })
|
|
1032
1028
|
] }),
|
|
1033
1029
|
/* @__PURE__ */ g(B, { gap: 8, children: [
|
|
1034
1030
|
/* @__PURE__ */ g(B, { alignItems: "center", direction: "row", gap: 4, mb: -4, children: [
|
|
1035
|
-
/* @__PURE__ */ e(y, { bold: !0, variant: "
|
|
1031
|
+
/* @__PURE__ */ e(y, { bold: !0, variant: "body1", children: s.income_title }),
|
|
1036
1032
|
/* @__PURE__ */ e(
|
|
1037
|
-
|
|
1033
|
+
rt,
|
|
1038
1034
|
{
|
|
1039
1035
|
"aria-label": n.manage_income,
|
|
1040
|
-
onClick:
|
|
1036
|
+
onClick: A,
|
|
1041
1037
|
sx: { p: 0 },
|
|
1042
|
-
children: /* @__PURE__ */ e(
|
|
1038
|
+
children: /* @__PURE__ */ e(G, { color: "primary", name: "edit" })
|
|
1043
1039
|
}
|
|
1044
1040
|
)
|
|
1045
1041
|
] }),
|
|
1046
|
-
/* @__PURE__ */ e(
|
|
1047
|
-
/* @__PURE__ */ e(y, { variant: "
|
|
1042
|
+
/* @__PURE__ */ e(ge, { data: f, height: 16 }),
|
|
1043
|
+
/* @__PURE__ */ e(y, { variant: "body2", children: R(
|
|
1048
1044
|
s.income_description,
|
|
1049
|
-
T(
|
|
1045
|
+
T(_, "0,0"),
|
|
1050
1046
|
T(u, "0,0")
|
|
1051
1047
|
) })
|
|
1052
1048
|
] })
|
|
1053
1049
|
] }) }),
|
|
1054
1050
|
/* @__PURE__ */ e(
|
|
1055
|
-
|
|
1051
|
+
L,
|
|
1056
1052
|
{
|
|
1057
1053
|
ariaLabelClose: a.close_aria,
|
|
1058
|
-
isOpen:
|
|
1059
|
-
onClose: () =>
|
|
1054
|
+
isOpen: h,
|
|
1055
|
+
onClose: () => p(!1),
|
|
1060
1056
|
title: n.manage_income,
|
|
1061
|
-
children: /* @__PURE__ */ e(
|
|
1057
|
+
children: /* @__PURE__ */ e(st, { forOverview: !0 })
|
|
1062
1058
|
}
|
|
1063
1059
|
)
|
|
1064
1060
|
] });
|
|
1065
|
-
}),
|
|
1066
|
-
const i =
|
|
1067
|
-
alert:
|
|
1068
|
-
dateRange:
|
|
1069
|
-
isDataLoaded:
|
|
1061
|
+
}), ve = 480, Rn = E(({ onBackClick: t, sx: o }) => {
|
|
1062
|
+
const i = H(), { onEvent: s } = Y(), { onLoad: a } = Ue(), { visibleAccounts: n } = pe(), { budgets: r, common: l } = w(), { isInitialized: d, selectedAccounts: m, setDisplayedDate: u, setSelectedAccounts: C } = oe(), {
|
|
1063
|
+
alert: h,
|
|
1064
|
+
dateRange: p,
|
|
1065
|
+
isDataLoaded: b,
|
|
1070
1066
|
loadBudgetData: S,
|
|
1071
|
-
setDateRange:
|
|
1072
|
-
setAlert:
|
|
1073
|
-
setTheme:
|
|
1074
|
-
detailedBudgets:
|
|
1075
|
-
} = D(), {
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
}, [
|
|
1081
|
-
|
|
1082
|
-
}, [
|
|
1083
|
-
|
|
1084
|
-
|
|
1067
|
+
setDateRange: _,
|
|
1068
|
+
setAlert: f,
|
|
1069
|
+
setTheme: A,
|
|
1070
|
+
detailedBudgets: v
|
|
1071
|
+
} = D(), { setDateRange: x } = te(), { reloadCategoryTotals: I } = V(), { isSmallTablet: M, isMobile: N, isSmallMobile: z } = ie(), $ = M || N || z, [U, le] = c.useState(!1);
|
|
1072
|
+
c.useEffect(() => {
|
|
1073
|
+
A(i), S().finally(() => {
|
|
1074
|
+
s(k.BUDGETS_VIEW), a?.("BubbleBudgetsWidget");
|
|
1075
|
+
});
|
|
1076
|
+
}, []), c.useEffect(() => (C(n), _({ start: Q(J()), end: me(J()) }), () => {
|
|
1077
|
+
_({ start: Q(J()), end: me(J()) });
|
|
1078
|
+
}), [n]), c.useEffect(() => {
|
|
1079
|
+
d && (u(p.start, p.end), I(m, p.start, p.end).finally(), x(p));
|
|
1080
|
+
}, [d, m, p]);
|
|
1081
|
+
const Le = (_e) => {
|
|
1082
|
+
_({ start: _e[0] || /* @__PURE__ */ new Date(), end: _e[1] || /* @__PURE__ */ new Date() });
|
|
1085
1083
|
}, Ne = () => {
|
|
1086
1084
|
s(k.BUDGETS_CLICK_FILTER);
|
|
1087
|
-
},
|
|
1088
|
-
|
|
1089
|
-
},
|
|
1090
|
-
|
|
1091
|
-
}, Ge =
|
|
1092
|
-
return !
|
|
1085
|
+
}, ye = () => {
|
|
1086
|
+
le(!0), s(k.BUDGETS_CLICK_ADD);
|
|
1087
|
+
}, $e = () => {
|
|
1088
|
+
le(!1);
|
|
1089
|
+
}, Ge = Ze(p.end, Q(/* @__PURE__ */ new Date()));
|
|
1090
|
+
return !d || !b ? /* @__PURE__ */ e(he, {}) : /* @__PURE__ */ g(
|
|
1093
1091
|
Ve,
|
|
1094
1092
|
{
|
|
1095
|
-
accountOptions:
|
|
1093
|
+
accountOptions: n,
|
|
1096
1094
|
actions: [
|
|
1097
1095
|
{
|
|
1098
1096
|
iconName: "add",
|
|
1099
|
-
label:
|
|
1100
|
-
onClick:
|
|
1097
|
+
label: r.add_title,
|
|
1098
|
+
onClick: ye
|
|
1101
1099
|
}
|
|
1102
1100
|
],
|
|
1103
1101
|
calendarActions: {
|
|
1104
|
-
onRangeChanged:
|
|
1102
|
+
onRangeChanged: Le,
|
|
1105
1103
|
shouldDisableNext: Ge,
|
|
1106
1104
|
shouldDisablePicker: !0
|
|
1107
1105
|
},
|
|
1108
1106
|
onAccountsFilterClick: Ne,
|
|
1109
1107
|
onBackClick: t,
|
|
1110
1108
|
sx: o,
|
|
1111
|
-
title:
|
|
1109
|
+
title: r.budgets_title,
|
|
1112
1110
|
children: [
|
|
1113
|
-
|
|
1114
|
-
d && p && /* @__PURE__ */ g(
|
|
1111
|
+
/* @__PURE__ */ g(
|
|
1115
1112
|
B,
|
|
1116
1113
|
{
|
|
1117
|
-
direction:
|
|
1114
|
+
direction: $ ? "column" : "row",
|
|
1118
1115
|
height: "100%",
|
|
1119
1116
|
sx: { justifyContent: "center" },
|
|
1120
1117
|
width: "100%",
|
|
1121
1118
|
children: [
|
|
1122
|
-
/* @__PURE__ */ e(B, { height:
|
|
1119
|
+
/* @__PURE__ */ e(B, { height: $ ? 450 : "calc(100dvh - 150px)", children: /* @__PURE__ */ e(
|
|
1123
1120
|
Re,
|
|
1124
1121
|
{
|
|
1125
|
-
createBudgetOnClick:
|
|
1126
|
-
height:
|
|
1122
|
+
createBudgetOnClick: ye,
|
|
1123
|
+
height: $ ? 450 : 800,
|
|
1127
1124
|
isDraggable: !0,
|
|
1128
|
-
shouldShowZeroState:
|
|
1129
|
-
unavailableWidth:
|
|
1125
|
+
shouldShowZeroState: v.length === 0,
|
|
1126
|
+
unavailableWidth: $ ? 0 : ve
|
|
1130
1127
|
}
|
|
1131
1128
|
) }),
|
|
1132
|
-
|
|
1129
|
+
v.length !== 0 && /* @__PURE__ */ g(
|
|
1133
1130
|
B,
|
|
1134
1131
|
{
|
|
1135
1132
|
gap: 24,
|
|
1136
1133
|
height: "100%",
|
|
1137
1134
|
sx: { mr: 24, mt: 48 },
|
|
1138
|
-
width:
|
|
1135
|
+
width: $ ? "100%" : ve,
|
|
1139
1136
|
children: [
|
|
1140
1137
|
/* @__PURE__ */ e(Nt, {}),
|
|
1141
|
-
/* @__PURE__ */ e(
|
|
1138
|
+
/* @__PURE__ */ e(Lt, {})
|
|
1142
1139
|
]
|
|
1143
1140
|
}
|
|
1144
1141
|
)
|
|
1145
1142
|
]
|
|
1146
1143
|
}
|
|
1147
1144
|
),
|
|
1148
|
-
/* @__PURE__ */ e(
|
|
1145
|
+
/* @__PURE__ */ e(Rt, {}),
|
|
1149
1146
|
/* @__PURE__ */ e(
|
|
1150
|
-
|
|
1147
|
+
L,
|
|
1151
1148
|
{
|
|
1152
|
-
ariaLabelClose:
|
|
1153
|
-
isOpen:
|
|
1154
|
-
onClose: () =>
|
|
1155
|
-
title:
|
|
1156
|
-
children: /* @__PURE__ */ e(
|
|
1149
|
+
ariaLabelClose: l.close_aria,
|
|
1150
|
+
isOpen: U,
|
|
1151
|
+
onClose: () => le(!1),
|
|
1152
|
+
title: r.add_new_title,
|
|
1153
|
+
children: /* @__PURE__ */ e(Ie, { onRecalculateBudgets: $e })
|
|
1157
1154
|
}
|
|
1158
1155
|
),
|
|
1159
1156
|
/* @__PURE__ */ e(
|
|
1160
|
-
|
|
1157
|
+
Je,
|
|
1161
1158
|
{
|
|
1162
1159
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
1163
1160
|
autoHideDuration: 3500,
|
|
1164
1161
|
onClose: () => {
|
|
1165
|
-
|
|
1162
|
+
f("");
|
|
1166
1163
|
},
|
|
1167
|
-
open: !!
|
|
1164
|
+
open: !!h,
|
|
1168
1165
|
children: /* @__PURE__ */ e(
|
|
1169
|
-
|
|
1166
|
+
qe,
|
|
1170
1167
|
{
|
|
1171
1168
|
onClose: () => {
|
|
1172
|
-
|
|
1169
|
+
f("");
|
|
1173
1170
|
},
|
|
1174
1171
|
severity: "success",
|
|
1175
1172
|
variant: "filled",
|
|
1176
|
-
children:
|
|
1173
|
+
children: h
|
|
1177
1174
|
}
|
|
1178
1175
|
)
|
|
1179
1176
|
}
|
|
@@ -1183,6 +1180,6 @@ const vt = ({
|
|
|
1183
1180
|
);
|
|
1184
1181
|
});
|
|
1185
1182
|
export {
|
|
1186
|
-
|
|
1187
|
-
|
|
1183
|
+
Mn as BubbleBudgetsMiniWidget,
|
|
1184
|
+
Rn as BubbleBudgetsWidget
|
|
1188
1185
|
};
|