@mx-cartographer/experiences 8.1.12 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/{Account-CMjOp7S2.mjs → Account-BaJmiJAG.mjs} +4 -4
- package/dist/{Account-BIKn4XEZ.mjs → Account-BxHMlV9R.mjs} +1 -1
- package/dist/{AccountDetailsHeader-CzefHTWU.mjs → AccountDetailsHeader-CfdnKyJK.mjs} +21 -21
- package/dist/{AccountFields-BWmpVsS3.mjs → AccountFields-CAy0x_4i.mjs} +6 -6
- package/dist/{AccountListItem-DRDxaRBe.mjs → AccountListItem-BYyeeCf6.mjs} +7 -7
- package/dist/{Accounts-DX3xJE97.mjs → AccountUtils-T5_Odvos.mjs} +1 -1
- package/dist/{Analytics-CxK7O19c.mjs → Analytics-CkYXKvco.mjs} +1 -1
- package/dist/ApiEndpoints-DXwIYNUV.mjs +49 -0
- package/dist/BudgetUtil-Bg2AQJpQ.mjs +74 -0
- package/dist/{Category-Ccoew_sA.mjs → Category-DEKZGLYe.mjs} +3 -3
- package/dist/{CategorySelectorDrawer-hhDdSFHO.mjs → CategorySelectorDrawer-Cu1ohxeM.mjs} +2 -2
- package/dist/{Connect-CBBTL1HJ.mjs → Connect-Dk6GZEsA.mjs} +1 -1
- package/dist/ConnectCard-Dix8BoV_.mjs +54 -0
- package/dist/{ConnectDrawer-DNnuF80E.mjs → ConnectDrawer-DgfsTpyW.mjs} +2 -2
- package/dist/{ConnectionsDrawer-DX6d7uwJ.mjs → ConnectionsDrawer-D7IXAza2.mjs} +2 -2
- package/dist/CurrencyDialog-d4dL7vA5.mjs +371 -0
- package/dist/{CurrencyInput-BMbUVSvz.mjs → CurrencyInput-B59ugxPN.mjs} +15 -16
- package/dist/{CurrencyText-oqd6cX3M.mjs → CurrencyText-CCbE6MmF.mjs} +1 -1
- package/dist/{DateFormats-CaOj_4eI.mjs → DateFormats-HudZ3Bjs.mjs} +6 -7
- package/dist/{DateUtil-D0TO0DaZ.mjs → DateUtil-Bhq59ZVg.mjs} +1 -1
- package/dist/DebtUtils-DD3186U-.mjs +153 -0
- package/dist/EmbeddedCard-BNl3quCs.mjs +856 -0
- package/dist/Error-Dogaw2jO.mjs +84 -0
- package/dist/ErrorBoundary-CsdOcnJ9.mjs +23 -0
- package/dist/{ExportCsvAction-BDFu6YIe.mjs → ExportCsvAction-hDprC41l.mjs} +6 -5
- package/dist/{GlobalAccountFilter-jkFxqPg6.mjs → GlobalAccountFilter-DrhtwPqh.mjs} +1 -1
- package/dist/GlobalCopyApi-wcnDUzMV.mjs +128 -0
- package/dist/GoalsUtil-C9EnLWvC.mjs +107 -0
- package/dist/{Help-C_CM4gpK.mjs → Help-BSQm9o29.mjs} +68 -67
- package/dist/{Help-CgpJK03Q.mjs → Help-CkQTjORd.mjs} +6 -27
- package/dist/InformationTooltip-4su8bn1e.mjs +41 -0
- package/dist/{LineChart-CeZnCZ7j.mjs → LineChart-CejWS_rh.mjs} +2 -2
- package/dist/{ListItemAction-CNpknVvo.mjs → ListItemAction-DGjHxNDJ.mjs} +1 -1
- package/dist/ListItemRow-kH1rn8Xu.mjs +67 -0
- package/dist/ListItemWrapper-B5r-YQQ_.mjs +42 -0
- package/dist/Localization-DnoVyBNK.mjs +38 -0
- package/dist/{ManageIncome-BX2IqW57.mjs → ManageIncome-DwylSiWs.mjs} +51 -51
- package/dist/{MicroWidgetContainer-DAesImQ6.mjs → MicroWidgetContainer-CfKdQfhi.mjs} +1 -1
- package/dist/{MiniWidgetContainer-BOv3n4iw.mjs → MiniWidgetContainer-BdPiUU-u.mjs} +1 -1
- package/dist/NetWorthUtils-DilGN1nW.mjs +95 -0
- package/dist/{NotificationSettings-DatCL2Ej.mjs → NotificationSettings-CCg-Tml2.mjs} +13 -13
- package/dist/NotificationUtils-BRGFTePr.mjs +23 -0
- package/dist/{NumberFormatting-CyrvFgfd.mjs → NumberFormatting--XMeeBfr.mjs} +2 -1
- package/dist/{OriginalBalanceAction-CWQ0CK-T.mjs → OriginalBalanceAction-CvDx0K6k.mjs} +4 -4
- package/dist/{RecurringSettings-DCplGEv_.mjs → RecurringSettings-CPXLW6AR.mjs} +9 -9
- package/dist/RecurringTransactionsUtil-B3rLEx_g.mjs +253 -0
- package/dist/Select-BZRUpOib.mjs +51 -0
- package/dist/SelectionBox-Bx2a5rh4.mjs +48 -0
- package/dist/Sizes-DISGrlUg.mjs +6 -0
- package/dist/{SpendingData-Dj85XEUp.mjs → SpendingData-PKlh8caU.mjs} +6 -6
- package/dist/{SpendingLegend-BS8mHUbu.mjs → SpendingLegend-BmkEr9Nh.mjs} +4 -4
- package/dist/{TransactionDetails-C_skrQk8.mjs → TransactionDetails-CbBSxdOi.mjs} +33 -33
- package/dist/TransactionUtils-BphBJBbU.mjs +234 -0
- package/dist/TrendsUtil-D9z3kIj_.mjs +69 -0
- package/dist/UserStore-CRpKQjpP.mjs +3002 -0
- package/dist/{ViewMoreMicroCard-D1j0w64K.mjs → ViewMoreMicroCard-K69RRs_b.mjs} +28 -30
- package/dist/{WidgetContainer-BPJoDkhL.mjs → WidgetContainer-DalWyz5A.mjs} +3 -3
- package/dist/accounts/hooks/useUiStore.d.ts +6 -1
- package/dist/accounts/index.d.ts +0 -1
- package/dist/accounts/index.es.js +62 -64
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/index.es.js +18 -18
- package/dist/cashflow/context/hooks.d.ts +15 -1
- package/dist/cashflow/index.d.ts +0 -1
- package/dist/cashflow/index.es.js +28 -31
- package/dist/categories/context/hooks.d.ts +19 -1
- package/dist/categories/index.d.ts +0 -1
- package/dist/categories/index.es.js +4 -6
- package/dist/common/constants/ScheduledPayment.d.ts +1 -1
- package/dist/common/constants/index.d.ts +0 -3
- package/dist/common/context/GlobalDataProvider.d.ts +1 -1
- package/dist/common/context/hooks.d.ts +20 -20
- package/dist/common/index.d.ts +3 -1
- package/dist/common/index.es.js +215 -961
- package/dist/common/utils/AccountFilter.d.ts +1 -1
- package/dist/common/utils/index.d.ts +0 -4
- package/dist/{common → core}/constants/DefaultConfig.d.ts +1 -1
- package/dist/core/constants/Transaction.d.ts +10 -0
- package/dist/core/constants/index.d.ts +2 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.es.js +94 -79
- package/dist/{accounts → core}/stores/AccountStore.d.ts +14 -4
- package/dist/{analytics → core}/stores/AnalyticsStore.d.ts +1 -1
- package/dist/{common → core}/stores/AppDataStore.d.ts +4 -5
- package/dist/{insights/store → core/stores}/BeatStore.d.ts +3 -3
- package/dist/{budgets/store → core/stores}/BudgetsStore.d.ts +3 -4
- package/dist/{cashflow/stores/UiStore.d.ts → core/stores/CashflowStore.d.ts} +10 -2
- package/dist/{categories → core}/stores/CategoryStore.d.ts +24 -4
- package/dist/{common → core}/stores/ConnectStore.d.ts +2 -2
- package/dist/core/stores/DebtsStore.d.ts +22 -0
- package/dist/{finstrong → core}/stores/FinstrongStore.d.ts +4 -4
- package/dist/{common → core}/stores/GlobalCopyStore.d.ts +2 -2
- package/dist/{common → core}/stores/GlobalStore.d.ts +2 -25
- package/dist/{common → core}/stores/GlobalUiStore.d.ts +3 -3
- package/dist/{goals → core}/stores/GoalStore.d.ts +3 -3
- package/dist/{help/store → core/stores}/HelpStore.d.ts +4 -6
- package/dist/{investments → core}/stores/HoldingStore.d.ts +4 -4
- package/dist/{merchants → core}/stores/MerchantStore.d.ts +3 -3
- package/dist/{networth → core}/stores/NetWorthStore.d.ts +3 -4
- package/dist/{notifications → core}/stores/NotificationStore.d.ts +3 -3
- package/dist/{recurringtransactions → core}/stores/RecurringTransactionsStore.d.ts +3 -3
- package/dist/{settings → core}/stores/SettingsStore.d.ts +4 -5
- package/dist/{transactions → core}/stores/TransactionStore.d.ts +27 -6
- package/dist/{trends → core}/stores/TrendsStore.d.ts +11 -5
- package/dist/{common → core}/stores/UserStore.d.ts +2 -2
- package/dist/core/stores/index.d.ts +24 -0
- package/dist/{networth → core}/types/NetWorth.d.ts +1 -10
- package/dist/core/types/Offer.d.ts +32 -0
- package/dist/core/types/index.d.ts +3 -1
- package/dist/{accounts/utils/Accounts.d.ts → core/utils/AccountUtils.d.ts} +1 -1
- package/dist/{microinsights/utils/beatUtils.d.ts → core/utils/BeatUtils.d.ts} +1 -1
- package/dist/{budgets → core}/utils/BudgetUtil.d.ts +2 -2
- package/dist/{categories/util → core/utils}/CategoryUtil.d.ts +6 -1
- package/dist/core/utils/DebtUtils.d.ts +31 -0
- package/dist/core/utils/FinstrongUtils.d.ts +7 -0
- package/dist/{goals/util → core/utils}/GoalsUtil.d.ts +1 -1
- package/dist/core/utils/HelpUtil.d.ts +3 -0
- package/dist/{investments/util → core/utils}/InvestmentUtil.d.ts +2 -2
- package/dist/core/utils/Localization.d.ts +3 -0
- package/dist/{networth → core}/utils/NetWorthUtils.d.ts +1 -2
- package/dist/{notifications → core}/utils/NotificationUtils.d.ts +1 -1
- package/dist/{common → core}/utils/NumberFormatting.d.ts +1 -1
- package/dist/{recurringtransactions/util/RecurringTransactions.d.ts → core/utils/RecurringTransactionsUtil.d.ts} +1 -1
- package/dist/{settings/util/Notifications.d.ts → core/utils/SettingsUtil.d.ts} +1 -1
- package/dist/{transactions/utils/buildDetailedTransactions.d.ts → core/utils/TransactionUtils.d.ts} +12 -2
- package/dist/{trends/utils/TrendsData.d.ts → core/utils/TrendsUtil.d.ts} +1 -1
- package/dist/{common/utils/User.d.ts → core/utils/UserUtils.d.ts} +1 -1
- package/dist/core/utils/index.d.ts +1 -1
- package/dist/dashboard/index.es.js +4 -4
- package/dist/debts/components/DebtsChart.d.ts +1 -1
- package/dist/debts/components/DebtsTable.d.ts +1 -1
- package/dist/debts/components/SnowballCard.d.ts +1 -1
- package/dist/debts/components/actions/InterestRateAction.d.ts +1 -1
- package/dist/debts/components/actions/MonthlyPaymentAction.d.ts +1 -1
- package/dist/debts/components/actions/OriginalBalanceAction.d.ts +1 -1
- package/dist/debts/hooks/useDebtsUiStore.d.ts +1 -1
- package/dist/debts/index.d.ts +0 -1
- package/dist/debts/index.es.js +568 -691
- package/dist/debts/utils/DebtsTable.d.ts +1 -1
- package/dist/debts/utils/SnowballCard.d.ts +2 -2
- package/dist/finstrong/index.d.ts +0 -1
- package/dist/finstrong/index.es.js +1565 -1342
- package/dist/finstrong/util/finstrongUtils.d.ts +1 -7
- package/dist/goals/components/addgoal/AddGoalListItem.d.ts +1 -1
- package/dist/goals/index.d.ts +0 -1
- package/dist/goals/index.es.js +71 -73
- package/dist/help/index.es.js +4 -4
- package/dist/help/utils/index.d.ts +0 -1
- package/dist/{hooks-RzCoiTd0.mjs → hooks-BaO_gOI6.mjs} +17 -17
- package/dist/insights/index.d.ts +0 -1
- package/dist/insights/index.es.js +52 -54
- package/dist/investments/components/AnalysisDetails.d.ts +1 -1
- package/dist/investments/index.es.js +6 -6
- package/dist/merchants/index.d.ts +0 -1
- package/dist/merchants/index.es.js +12 -14
- package/dist/microinsights/index.es.js +1 -1
- package/dist/microinsights/interfaces.d.ts +1 -33
- package/dist/networth/components/AssetsLiabilitiesDetail.d.ts +1 -1
- package/dist/networth/components/GainsLossesDetail.d.ts +1 -1
- package/dist/networth/components/NetWorthChange.d.ts +1 -1
- package/dist/networth/components/NetWorthListItem.d.ts +1 -1
- package/dist/networth/components/NetWorthSummary.d.ts +1 -1
- package/dist/networth/index.d.ts +0 -4
- package/dist/networth/index.es.js +232 -237
- package/dist/notifications/index.d.ts +0 -2
- package/dist/notifications/index.es.js +23 -26
- package/dist/recurringtransactions/index.d.ts +0 -1
- package/dist/recurringtransactions/index.es.js +92 -96
- package/dist/settings/index.d.ts +0 -1
- package/dist/settings/index.es.js +11 -13
- package/dist/spending/index.es.js +10 -10
- package/dist/transactions/context/hooks.d.ts +1 -1
- package/dist/transactions/index.d.ts +0 -4
- package/dist/transactions/index.es.js +102 -109
- package/dist/trends/index.d.ts +0 -1
- package/dist/trends/index.es.js +67 -68
- package/dist/trends/utils/shared.d.ts +1 -1
- package/dist/{useAccountDisplayName-pliH6hz0.mjs → useAccountDisplayName-CFa_MrS6.mjs} +1 -1
- package/dist/{useInsightsEnabled-CzJoG8xi.mjs → useInsightsEnabled-DaNLPmUU.mjs} +1 -1
- package/dist/{useWidgetLoadTimer-BZjr-BiE.mjs → useWidgetLoadTimer-CJb-RELP.mjs} +1 -1
- package/package.json +1 -1
- package/dist/AccountApi-WEM2M9tg.mjs +0 -19
- package/dist/AccountStore-CGrjC2Oe.mjs +0 -253
- package/dist/ApiEndpoints-C5IA97i7.mjs +0 -118
- package/dist/BeatApi-C6pBa0Rb.mjs +0 -21
- package/dist/BeatStore-C7-PIhpB.mjs +0 -163
- package/dist/BudgetUtil-H9igoNVm.mjs +0 -479
- package/dist/CashflowStore-BEi92kJg.mjs +0 -91
- package/dist/CategoryApi-CogDFScz.mjs +0 -29
- package/dist/CategoryStore-CA4NTaKH.mjs +0 -160
- package/dist/CategoryUtil-BJOHgYKS.mjs +0 -80
- package/dist/DebtsStore-BJlC2-yO.mjs +0 -63
- package/dist/EmbeddedCard-B9JoBaan.mjs +0 -811
- package/dist/FinstrongApi-FpmsS_sy.mjs +0 -19
- package/dist/FinstrongStore-DYawCv1d.mjs +0 -435
- package/dist/GlobalCopyApi-DkS-2Zf_.mjs +0 -41
- package/dist/Goal-MFBpoOIC.mjs +0 -29
- package/dist/GoalStore-BBAEbf43.mjs +0 -395
- package/dist/Localization-C_HZg9tJ.mjs +0 -15
- package/dist/Localization-CkQ49EKr.mjs +0 -26
- package/dist/MerchantApi-D8ahYxiG.mjs +0 -15
- package/dist/MerchantStore-CyZTv-BM.mjs +0 -26
- package/dist/NetWorthStore-BY-B_hxy.mjs +0 -168
- package/dist/NotificationApi-DF0obHoR.mjs +0 -20
- package/dist/NotificationStore-DlAM5Ue0.mjs +0 -69
- package/dist/RecurringTransactions-DCt94TN4.mjs +0 -297
- package/dist/RecurringTransactionsStore-CFJYC7lI.mjs +0 -264
- package/dist/RepeatingTransaction-D2gmBTd0.mjs +0 -7
- package/dist/RepeatingTransactionsApi-BNZgZPLs.mjs +0 -17
- package/dist/SettingsApi-D9d7SLhB.mjs +0 -22
- package/dist/SettingsStore-BcbuKfFO.mjs +0 -250
- package/dist/Transaction-Cn5_iFm0.mjs +0 -5
- package/dist/TransactionApi-CLG2eSNe.mjs +0 -86
- package/dist/TransactionStore-amPYxHnA.mjs +0 -710
- package/dist/TrendsStore-bYjIGqyR.mjs +0 -183
- package/dist/WidgetApi-C0BA2cFX.mjs +0 -102
- package/dist/accounts/stores/UiStore.d.ts +0 -10
- package/dist/accounts/utils/index.d.ts +0 -1
- package/dist/cashflow/stores/CashflowStore.d.ts +0 -8
- package/dist/categories/stores/UiStore.d.ts +0 -20
- package/dist/common/stores/index.d.ts +0 -3
- package/dist/common/utils/Categories.d.ts +0 -6
- package/dist/common/utils/Localization.d.ts +0 -3
- package/dist/debts/store/DebtsStore.d.ts +0 -10
- package/dist/debts/store/DebtsUiStore.d.ts +0 -13
- package/dist/debts/utils/DebtStore.d.ts +0 -4
- package/dist/debts/utils/DebtsWidget.d.ts +0 -20
- package/dist/debts/utils/shared.d.ts +0 -12
- package/dist/exportTransactionsToCSV-CSvbZrvL.mjs +0 -133
- package/dist/help/constants/index.d.ts +0 -1
- package/dist/help/utils/getAccessibleHelpCategories.d.ts +0 -3
- package/dist/transactions/analytics.d.ts +0 -3
- package/dist/transactions/constants/Transaction.d.ts +0 -2
- package/dist/transactions/constants/TransactionsTable.d.ts +0 -17
- package/dist/transactions/stores/UiStore.d.ts +0 -25
- package/dist/transactions/utils/exportTransactionsToCSV.d.ts +0 -9
- package/dist/transactions/utils/sortAndFilterTransactions.d.ts +0 -3
- /package/dist/{common → core}/constants/Category.d.ts +0 -0
- /package/dist/{common → core}/constants/DateFormats.d.ts +0 -0
- /package/dist/{debts/constants/index.d.ts → core/constants/Debts.d.ts} +0 -0
- /package/dist/{help → core}/constants/Help.d.ts +0 -0
- /package/dist/{investments/constants/index.d.ts → core/constants/Investments.d.ts} +0 -0
- /package/dist/{common → core}/constants/Numbers.d.ts +0 -0
- /package/dist/{common → core}/constants/Table.d.ts +0 -0
- /package/dist/{common → core}/utils/DateUtil.d.ts +0 -0
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import { makeAutoObservable as c } from "mobx";
|
|
2
|
-
import { getUnixTime as i } from "date-fns/getUnixTime";
|
|
3
|
-
import { subMonths as n } from "date-fns/subMonths";
|
|
4
|
-
import { startOfMonth as y } from "date-fns/startOfMonth";
|
|
5
|
-
import { endOfMonth as g } from "date-fns/endOfMonth";
|
|
6
|
-
import { C as d } from "./CategoryApi-CogDFScz.mjs";
|
|
7
|
-
import { a as u, g as C } from "./CategoryUtil-BJOHgYKS.mjs";
|
|
8
|
-
import { b as l, c as T } from "./Category-Ccoew_sA.mjs";
|
|
9
|
-
class m {
|
|
10
|
-
expandedGuid = null;
|
|
11
|
-
selectedGuid = null;
|
|
12
|
-
searchValue = "";
|
|
13
|
-
showSelected = !0;
|
|
14
|
-
shouldDisableDrawerScroll = !1;
|
|
15
|
-
unselectable = [];
|
|
16
|
-
unselectableText = "";
|
|
17
|
-
savedOnSelect;
|
|
18
|
-
// todo
|
|
19
|
-
constructor() {
|
|
20
|
-
c(this);
|
|
21
|
-
}
|
|
22
|
-
setExpandedGuid = (e) => this.expandedGuid = e;
|
|
23
|
-
setSelectedGuid = (e) => this.selectedGuid = e;
|
|
24
|
-
setSearchValue = (e) => this.searchValue = e;
|
|
25
|
-
setShouldDisableDrawerScroll = (e) => this.shouldDisableDrawerScroll = e;
|
|
26
|
-
setShowSelected = (e) => this.showSelected = e;
|
|
27
|
-
setUnselectable = (e) => this.unselectable = e;
|
|
28
|
-
setUnselectableText = (e) => this.unselectableText = e;
|
|
29
|
-
onSelect = (e) => this.savedOnSelect(e);
|
|
30
|
-
setOnSelect = (e) => this.savedOnSelect = e;
|
|
31
|
-
}
|
|
32
|
-
class E {
|
|
33
|
-
globalStore;
|
|
34
|
-
uiStore;
|
|
35
|
-
api = new d("/", "");
|
|
36
|
-
categories = [];
|
|
37
|
-
categoriesLoaded = !1;
|
|
38
|
-
categoriesLoading = !1;
|
|
39
|
-
dateRangeCategoryTotals = [];
|
|
40
|
-
monthlyCategoryTotals = [];
|
|
41
|
-
dateRangeTotalsLoaded = !1;
|
|
42
|
-
dateRangeTotalsLoading = !1;
|
|
43
|
-
monthlyTotalsLoaded = !1;
|
|
44
|
-
monthlyTotalsLoading = !1;
|
|
45
|
-
constructor(e) {
|
|
46
|
-
this.globalStore = e, this.uiStore = new m(), this.api = new d(e.endpoint, e.sessionToken, e.onError), c(this);
|
|
47
|
-
}
|
|
48
|
-
get detailedCategories() {
|
|
49
|
-
return this.globalStore.isInitialized ? u(
|
|
50
|
-
this.categories,
|
|
51
|
-
this.globalStore.copyStore.copy.categories,
|
|
52
|
-
this.dateRangeCategoryTotals,
|
|
53
|
-
this.monthlyCategoryTotals
|
|
54
|
-
) : [];
|
|
55
|
-
}
|
|
56
|
-
get detailedCategoriesWithTransactions() {
|
|
57
|
-
return C(
|
|
58
|
-
this.detailedCategories,
|
|
59
|
-
this.globalStore.transactionStore.sortedTransactions
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
get incomeCategories() {
|
|
63
|
-
return this.detailedCategories.filter((e) => e.is_income);
|
|
64
|
-
}
|
|
65
|
-
get spendCategories() {
|
|
66
|
-
return this.detailedCategories.filter(
|
|
67
|
-
(e) => !e.is_income && !e.isTransfer && e.guid !== l.INVESTMENTS
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
get transferCategories() {
|
|
71
|
-
return this.detailedCategories.filter((e) => e.isTransfer);
|
|
72
|
-
}
|
|
73
|
-
setCategories = (e) => {
|
|
74
|
-
this.categories = e, this.categoriesLoading = !1, this.categoriesLoaded = !0;
|
|
75
|
-
};
|
|
76
|
-
setMonthlyCategoryTotals = (e) => {
|
|
77
|
-
this.monthlyCategoryTotals = e, this.monthlyTotalsLoading = !1, this.monthlyTotalsLoaded = !0;
|
|
78
|
-
};
|
|
79
|
-
setDateRangeCategoryTotals = (e) => {
|
|
80
|
-
this.dateRangeCategoryTotals = e, this.dateRangeTotalsLoading = !1, this.dateRangeTotalsLoaded = !0;
|
|
81
|
-
};
|
|
82
|
-
get trendsCategories() {
|
|
83
|
-
return this.detailedCategories.filter((e) => e.totalAmount !== 0).filter((e) => e.guid !== l.INVESTMENTS && e.guid !== l.TRANSFER);
|
|
84
|
-
}
|
|
85
|
-
addCategory = async (e, t) => {
|
|
86
|
-
const o = { name: e, parent_guid: t };
|
|
87
|
-
try {
|
|
88
|
-
await this.api.addCategory(o), await this.loadCategories();
|
|
89
|
-
} catch (a) {
|
|
90
|
-
console.error(`Error occurred while adding category: ${a}`);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
loadCategories = async () => {
|
|
94
|
-
if (!this.categoriesLoading) {
|
|
95
|
-
this.categoriesLoading = !0;
|
|
96
|
-
try {
|
|
97
|
-
const e = await this.api.getCategories();
|
|
98
|
-
this.setCategories(e);
|
|
99
|
-
} catch (e) {
|
|
100
|
-
console.error(`Error occurred while getting categories: ${e}`);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
loadDateRangeCategoryTotals = async (e, t, o) => {
|
|
105
|
-
if (!this.dateRangeTotalsLoading) {
|
|
106
|
-
this.dateRangeTotalsLoading = !0;
|
|
107
|
-
try {
|
|
108
|
-
const a = await this.api.getDateRangeCategoryTotals(
|
|
109
|
-
i(t),
|
|
110
|
-
i(o),
|
|
111
|
-
e
|
|
112
|
-
);
|
|
113
|
-
this.setDateRangeCategoryTotals(a);
|
|
114
|
-
} catch (a) {
|
|
115
|
-
console.error(`Error occurred while getting date range category totals: ${a}`);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
loadMonthlyCategoryTotals = async (e = this.globalStore.globalUiStore.selectedAccounts, t, o) => {
|
|
120
|
-
if (this.monthlyTotalsLoading) return;
|
|
121
|
-
this.monthlyTotalsLoading = !0;
|
|
122
|
-
const a = i(y(t ?? n(/* @__PURE__ */ new Date(), 11))), s = i(g(o ?? /* @__PURE__ */ new Date()));
|
|
123
|
-
try {
|
|
124
|
-
const r = await this.api.getMonthlyCategoryTotals(a, s, e);
|
|
125
|
-
this.setMonthlyCategoryTotals(r);
|
|
126
|
-
} catch (r) {
|
|
127
|
-
console.error(`Error occurred while getting monthly category totals: ${r}`);
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
reloadCategoryTotals = async (e, t, o) => {
|
|
131
|
-
const a = t ?? n(/* @__PURE__ */ new Date(), 11), s = o ?? g(/* @__PURE__ */ new Date());
|
|
132
|
-
try {
|
|
133
|
-
await Promise.all([
|
|
134
|
-
this.loadMonthlyCategoryTotals(e, a, s),
|
|
135
|
-
this.loadDateRangeCategoryTotals(e, a, s)
|
|
136
|
-
]);
|
|
137
|
-
} catch (r) {
|
|
138
|
-
console.error(`Error occurred while getting category totals: ${r}`);
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
removeCategory = async (e) => {
|
|
142
|
-
try {
|
|
143
|
-
await this.api.removeCategory(e), await this.loadCategories();
|
|
144
|
-
} catch (t) {
|
|
145
|
-
console.error(`Error occurred while removing category: ${t}`);
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
updateCategory = async (e) => {
|
|
149
|
-
try {
|
|
150
|
-
await this.api.updateCategory(e), await this.loadCategories();
|
|
151
|
-
} catch (t) {
|
|
152
|
-
console.error(`Error occurred while updating category: ${t}`);
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
// TODO: Remove this after refactoring Trends components to use detailedCategories
|
|
156
|
-
getCategoryName = (e) => this.categories.find((o) => o.guid === e)?.name ?? T[e];
|
|
157
|
-
}
|
|
158
|
-
export {
|
|
159
|
-
E as C
|
|
160
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { format as d } from "date-fns/format";
|
|
2
|
-
import { startOfMonth as T } from "date-fns/startOfMonth";
|
|
3
|
-
import { startOfToday as C } from "date-fns/startOfToday";
|
|
4
|
-
import { subMonths as N } from "date-fns/subMonths";
|
|
5
|
-
import { CategoryIconList as O } from "@mxenabled/mxui";
|
|
6
|
-
import { C as b, a as D, b as E } from "./Category-Ccoew_sA.mjs";
|
|
7
|
-
import { f as R, D as v } from "./DateFormats-CaOj_4eI.mjs";
|
|
8
|
-
const H = 3, f = 12, k = (t, o, e, r) => t.filter((n) => !n.parent_guid).map(
|
|
9
|
-
(n) => p(
|
|
10
|
-
n,
|
|
11
|
-
o,
|
|
12
|
-
e,
|
|
13
|
-
r,
|
|
14
|
-
t.filter((s) => s.parent_guid === n.guid)
|
|
15
|
-
)
|
|
16
|
-
), z = (t, o) => {
|
|
17
|
-
const e = O.find((r) => r.guid === t);
|
|
18
|
-
return e ? o.palette.categories[e.colorName] || "" : o.palette.categories.uncategorized || "";
|
|
19
|
-
}, p = (t, o, e, r, n = []) => {
|
|
20
|
-
const s = t.guid, i = t.parent_guid || s, u = s === i, c = e.find((a) => a.category_guid === s)?.total || 0, m = y(
|
|
21
|
-
r.filter((a) => a.category_guid === s)
|
|
22
|
-
), g = y(
|
|
23
|
-
r.filter(
|
|
24
|
-
(a) => a.category_guid === s || a.top_level_category_guid === s
|
|
25
|
-
)
|
|
26
|
-
), l = n.map(
|
|
27
|
-
(a) => p(a, o, e, r)
|
|
28
|
-
), A = l.reduce(
|
|
29
|
-
(a, M) => a + M.currentAmount,
|
|
30
|
-
c
|
|
31
|
-
), h = o.default_categories[t.guid] ? o.default_categories[t.guid].replace(/&/g, "&") : t.name;
|
|
32
|
-
return {
|
|
33
|
-
...t,
|
|
34
|
-
currentAmount: c,
|
|
35
|
-
averageAmount: _(m),
|
|
36
|
-
color: D[i],
|
|
37
|
-
icon: b[i],
|
|
38
|
-
isTransfer: i === E.TRANSFER,
|
|
39
|
-
monthlyAmounts: m,
|
|
40
|
-
name: h,
|
|
41
|
-
subCategories: l,
|
|
42
|
-
totalAmount: u ? A : 0,
|
|
43
|
-
totalAverageAmount: _(g),
|
|
44
|
-
totalMonthlyAmounts: u ? g : []
|
|
45
|
-
};
|
|
46
|
-
}, B = (t, o) => t.map((e) => {
|
|
47
|
-
const r = o.filter(
|
|
48
|
-
(n) => n.category_guid === e.guid || n.top_level_category_guid === e.guid
|
|
49
|
-
);
|
|
50
|
-
return {
|
|
51
|
-
...e,
|
|
52
|
-
transactions: r
|
|
53
|
-
};
|
|
54
|
-
}), _ = (t, o = H) => {
|
|
55
|
-
const e = o > history.length ? history.length : o;
|
|
56
|
-
return Math.ceil(
|
|
57
|
-
Math.max(
|
|
58
|
-
0,
|
|
59
|
-
t.slice(-e).reduce((r, n) => r + n.amount, 0) / e
|
|
60
|
-
)
|
|
61
|
-
);
|
|
62
|
-
}, y = (t) => {
|
|
63
|
-
const o = [], e = C();
|
|
64
|
-
for (let r = 0; r <= f; r++) {
|
|
65
|
-
const n = T(N(e, f - r)), i = t.filter(
|
|
66
|
-
(u) => u.year_month === Number(d(n, "yyyyMM"))
|
|
67
|
-
).reduce((u, c) => u + c.total, 0);
|
|
68
|
-
o.push({
|
|
69
|
-
amount: i,
|
|
70
|
-
isoDate: d(n, "yyyy-MM-dd"),
|
|
71
|
-
label: R(n, v.MONTH_YEAR)
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
return o;
|
|
75
|
-
};
|
|
76
|
-
export {
|
|
77
|
-
k as a,
|
|
78
|
-
z as b,
|
|
79
|
-
B as g
|
|
80
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { makeAutoObservable as d } from "mobx";
|
|
2
|
-
import { getDate as r, fromUnixTime as _, startOfMonth as m } from "date-fns";
|
|
3
|
-
import { A as b } from "./Account-CMjOp7S2.mjs";
|
|
4
|
-
const E = 12, T = 100;
|
|
5
|
-
var c = /* @__PURE__ */ ((a) => (a[a.FASTEST_PAYOFF_FIRST = 1] = "FASTEST_PAYOFF_FIRST", a[a.HIGHEST_INTEREST = 2] = "HIGHEST_INTEREST", a[a.LOWEST_BALANCE = 3] = "LOWEST_BALANCE", a[a.HIGHEST_BALANCE = 4] = "HIGHEST_BALANCE", a))(c || {});
|
|
6
|
-
const p = {
|
|
7
|
-
unnamed_label: "Unnamed Debt"
|
|
8
|
-
};
|
|
9
|
-
function y(a, e) {
|
|
10
|
-
const t = a.filter((n) => n.account_type === b.CHECKING_LINE_OF_CREDIT ? Number(n.balance) <= 0 : n.is_excluded_from_debts !== !0), s = e.filter((n) => t.some((i) => i.guid === n.account_guid)).map(
|
|
11
|
-
(n) => l(t.find((i) => i.guid === n.account_guid), n)
|
|
12
|
-
), o = t.filter((n) => !s.some((i) => i.account.guid === n.guid)).map((n) => l(n));
|
|
13
|
-
return [...s, ...o];
|
|
14
|
-
}
|
|
15
|
-
function l(a, e) {
|
|
16
|
-
const t = { account: a, goal: e, guid: a.guid };
|
|
17
|
-
if (e) {
|
|
18
|
-
const s = e.payment_due_at ? r(_(e.payment_due_at)) : 1, o = m(/* @__PURE__ */ new Date()).setDate(s);
|
|
19
|
-
t.balance = Math.abs(e.amount - e.current_amount), t.interest_rate = e.interest_rate, t.is_paid_off = e.is_complete, t.monthly_payment = e.monthly_payment, t.name = e.name, t.original_balance = e.initial_amount, t.payment_due_date = o;
|
|
20
|
-
} else {
|
|
21
|
-
const s = a.payment_due_at ? r(_(a.payment_due_at)) : 1, o = m(/* @__PURE__ */ new Date()).setDate(s), n = a.balance ?? 0, i = a.minimum_payment ?? void 0, u = a.interest_rate ?? a.apr ?? a.apy;
|
|
22
|
-
t.balance = Math.max(n, 0), t.interest_rate = u, t.is_paid_off = n === 0, t.monthly_payment = i, t.name = a?.name ?? p.unnamed_label, t.original_balance = a.original_balance, t.payment_due_date = o;
|
|
23
|
-
}
|
|
24
|
-
return t.is_impossible = !1, t.priority = void 0, t.projected_payoff_date = void 0, t;
|
|
25
|
-
}
|
|
26
|
-
class h {
|
|
27
|
-
isLoading = !1;
|
|
28
|
-
selectedDebtChartData = {};
|
|
29
|
-
selectedDebtPriority = c.LOWEST_BALANCE;
|
|
30
|
-
constructor() {
|
|
31
|
-
d(this);
|
|
32
|
-
}
|
|
33
|
-
get showError() {
|
|
34
|
-
const { interest_rate: e, monthly_payment: t } = this.selectedDebtChartData;
|
|
35
|
-
return e === void 0 || t === void 0;
|
|
36
|
-
}
|
|
37
|
-
get showCompleted() {
|
|
38
|
-
return this.selectedDebtChartData.is_paid_off;
|
|
39
|
-
}
|
|
40
|
-
setIsLoading = (e) => this.isLoading = e;
|
|
41
|
-
setSelectedDebtChartData = (e) => this.selectedDebtChartData = e;
|
|
42
|
-
setSelectedDebtPriority = (e) => this.selectedDebtPriority = e;
|
|
43
|
-
}
|
|
44
|
-
class A {
|
|
45
|
-
globalStore;
|
|
46
|
-
uiStore;
|
|
47
|
-
constructor(e) {
|
|
48
|
-
this.globalStore = e, this.uiStore = new h(), d(this);
|
|
49
|
-
}
|
|
50
|
-
get debts() {
|
|
51
|
-
const { visibleDebtAccounts: e } = this.globalStore.accountStore, { selectedAccountGuids: t } = this.globalStore.globalUiStore, { debtGoals: s } = this.globalStore.goalStore, o = t.length ? e.filter((n) => t.includes(n.guid)) : e;
|
|
52
|
-
return y(o, s);
|
|
53
|
-
}
|
|
54
|
-
get totalMonthlyPayments() {
|
|
55
|
-
return this.debts.map((t) => Number(t.monthly_payment)).filter((t) => !isNaN(t)).reduce((t, s) => t + s, 0);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
export {
|
|
59
|
-
A as D,
|
|
60
|
-
T as I,
|
|
61
|
-
E as M,
|
|
62
|
-
c as a
|
|
63
|
-
};
|