@mx-cartographer/experiences 9.7.25 → 9.7.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/common/components/MiniWidgetContainer.es.js +35 -45
  3. package/dist/common/components/MiniWidgetContainer.es.js.map +1 -1
  4. package/dist/common/components/charts/LineChart.es.js +86 -85
  5. package/dist/common/components/charts/LineChart.es.js.map +1 -1
  6. package/dist/common/constants/Styles.d.ts +2 -0
  7. package/dist/common/constants/Styles.es.js +17 -0
  8. package/dist/common/constants/Styles.es.js.map +1 -0
  9. package/dist/common/constants/index.d.ts +1 -0
  10. package/dist/common/hooks/useAriaLive.es.js +12 -22
  11. package/dist/common/hooks/useAriaLive.es.js.map +1 -1
  12. package/dist/common/index.es.js +111 -109
  13. package/dist/core/stores/TrendsStore.d.ts +5 -0
  14. package/dist/core/types/Insights.d.ts +3 -0
  15. package/dist/core/types/Insights.es.js.map +1 -1
  16. package/dist/core/types/localization/InsightsFeedCopy.d.ts +2 -0
  17. package/dist/core/utils/DateUtil.d.ts +2 -0
  18. package/dist/core/utils/DateUtil.es.js +37 -35
  19. package/dist/core/utils/DateUtil.es.js.map +1 -1
  20. package/dist/core/utils/NumberFormatting.d.ts +1 -0
  21. package/dist/core/utils/NumberFormatting.es.js +14 -13
  22. package/dist/core/utils/NumberFormatting.es.js.map +1 -1
  23. package/dist/core/utils/TrendsUtil.d.ts +5 -0
  24. package/dist/core/utils/TrendsUtil.es.js +67 -59
  25. package/dist/core/utils/TrendsUtil.es.js.map +1 -1
  26. package/dist/insights-v2/blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendDaysBlock.d.ts +3 -0
  27. package/dist/insights-v2/blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendDaysBlock.es.js +101 -0
  28. package/dist/insights-v2/blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendDaysBlock.es.js.map +1 -0
  29. package/dist/insights-v2/blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendGraphic.d.ts +5 -0
  30. package/dist/insights-v2/blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendGraphic.es.js +108 -0
  31. package/dist/insights-v2/blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendGraphic.es.js.map +1 -0
  32. package/dist/insights-v2/blocks/ComponentBlocks/NoSpendDaysBlock/index.d.ts +1 -0
  33. package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +1 -0
  34. package/dist/insights-v2/index.es.js +87 -85
  35. package/dist/insights-v2/mappings/blocks.es.js +44 -42
  36. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  37. package/dist/transactions/components/shared/TransactionList.d.ts +4 -0
  38. package/dist/transactions/components/shared/TransactionList.es.js +138 -84
  39. package/dist/transactions/components/shared/TransactionList.es.js.map +1 -1
  40. package/dist/trends/components/CategoryDetailChart.d.ts +2 -1
  41. package/dist/trends/components/CategoryDetailChart.es.js +55 -35
  42. package/dist/trends/components/CategoryDetailChart.es.js.map +1 -1
  43. package/dist/trends/components/CategoryDetails.es.js +68 -71
  44. package/dist/trends/components/CategoryDetails.es.js.map +1 -1
  45. package/dist/trends/utils/TrendsTable.es.js +25 -25
  46. package/dist/trends/utils/TrendsTable.es.js.map +1 -1
  47. package/package.json +1 -1
@@ -1,34 +1,24 @@
1
+ import { VISUALLY_HIDDEN_SX as u } from "../constants/Styles.es.js";
1
2
  import e from "react";
2
- import { jsx as n } from "react/jsx-runtime";
3
- import l from "@mui/material/Box";
4
- var d = (r = "polite") => {
5
- const [i, s] = e.useState(""), [t, o] = e.useState(r);
3
+ import { jsx as l } from "react/jsx-runtime";
4
+ import c from "@mui/material/Box";
5
+ var L = (a = "polite") => {
6
+ const [r, o] = e.useState(""), [t, i] = e.useState(a);
6
7
  return {
7
- announce: e.useCallback((p, a) => {
8
- a && o(a), s(p);
8
+ announce: e.useCallback((m, s) => {
9
+ s && i(s), o(m);
9
10
  }, []),
10
- ariaLive: e.useMemo(() => /* @__PURE__ */ n(l, {
11
+ ariaLive: e.useMemo(() => /* @__PURE__ */ l(c, {
11
12
  "aria-atomic": "true",
12
13
  "aria-live": t,
13
14
  role: t === "assertive" ? "alert" : "status",
14
- sx: {
15
- position: "absolute",
16
- width: "1px",
17
- height: "1px",
18
- padding: 0,
19
- margin: "-1px",
20
- overflow: "hidden",
21
- clip: "rect(0 0 0 0)",
22
- clipPath: "inset(50%)",
23
- whiteSpace: "nowrap",
24
- border: 0
25
- },
26
- children: i
27
- }), [i, t])
15
+ sx: u,
16
+ children: r
17
+ }), [r, t])
28
18
  };
29
19
  };
30
20
  export {
31
- d as useAriaLive
21
+ L as useAriaLive
32
22
  };
33
23
 
34
24
  //# sourceMappingURL=useAriaLive.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAriaLive.es.js","names":[],"sources":["../../../src/common/hooks/useAriaLive.tsx"],"sourcesContent":["import React from 'react'\nimport Box from '@mui/material/Box'\n\nexport type AriaLivePoliteness = 'polite' | 'assertive'\n\ninterface UseAriaLiveResult {\n announce: (message: string, politeness?: AriaLivePoliteness) => void\n ariaLive: React.ReactElement | null\n}\n\nexport const useAriaLive = (\n initialPoliteness: AriaLivePoliteness = 'polite',\n): UseAriaLiveResult => {\n const [message, setMessage] = React.useState('')\n const [politeness, setPoliteness] = React.useState<AriaLivePoliteness>(initialPoliteness)\n\n const announce = React.useCallback((next: string, nextPoliteness?: AriaLivePoliteness) => {\n if (nextPoliteness) setPoliteness(nextPoliteness)\n setMessage(next)\n }, [])\n\n const ariaLive = React.useMemo(\n () => (\n <Box\n aria-atomic=\"true\"\n aria-live={politeness}\n role={politeness === 'assertive' ? 'alert' : 'status'}\n sx={{\n position: 'absolute',\n width: '1px',\n height: '1px',\n padding: 0,\n margin: '-1px',\n overflow: 'hidden',\n clip: 'rect(0 0 0 0)',\n clipPath: 'inset(50%)',\n whiteSpace: 'nowrap',\n border: 0,\n }}\n >\n {message}\n </Box>\n ),\n [message, politeness],\n )\n\n return { announce, ariaLive }\n}\n"],"mappings":";;;AAUA,IAAa,IAAA,CACX,IAAwC,aAClB;AACtB,QAAM,CAAC,GAAS,CAAA,IAAc,EAAM,SAAS,EAAE,GACzC,CAAC,GAAY,CAAA,IAAiB,EAAM,SAA6B,CAAiB;AAgCxF,SAAO;AAAA,IAAE,UA9BQ,EAAM,YAAA,CAAa,GAAc,MAAwC;AACxF,MAAI,KAAgB,EAAc,CAAc,GAChD,EAAW,CAAI;AAAA,IACjB,GAAG,CAAC,CA2BK;AAAA,IAAU,UAzBF,EAAM,QAAA,MAEnB,gBAAA,EAAC,GAAD;AAAA,MACE,eAAY;AAAA,MACZ,aAAW;AAAA,MACX,MAAM,MAAe,cAAc,UAAU;AAAA,MAC7C,IAAI;AAAA,QACF,UAAU;AAAA,QACV,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,MAAM;AAAA,QACN,UAAU;AAAA,QACV,YAAY;AAAA,QACZ,QAAQ;AAAA,MACV;AAAA,MAEC,UAAA;AAAA,IACE,CAAA,GAEP,CAAC,GAAS,CAAU,CAGH;AAAA,EAAS;AAC9B"}
1
+ {"version":3,"file":"useAriaLive.es.js","names":[],"sources":["../../../src/common/hooks/useAriaLive.tsx"],"sourcesContent":["import React from 'react'\nimport Box from '@mui/material/Box'\n\nimport { VISUALLY_HIDDEN_SX } from '../constants/Styles'\n\nexport type AriaLivePoliteness = 'polite' | 'assertive'\n\ninterface UseAriaLiveResult {\n announce: (message: string, politeness?: AriaLivePoliteness) => void\n ariaLive: React.ReactElement | null\n}\n\nexport const useAriaLive = (\n initialPoliteness: AriaLivePoliteness = 'polite',\n): UseAriaLiveResult => {\n const [message, setMessage] = React.useState('')\n const [politeness, setPoliteness] = React.useState<AriaLivePoliteness>(initialPoliteness)\n\n const announce = React.useCallback((next: string, nextPoliteness?: AriaLivePoliteness) => {\n if (nextPoliteness) setPoliteness(nextPoliteness)\n setMessage(next)\n }, [])\n\n const ariaLive = React.useMemo(\n () => (\n <Box\n aria-atomic=\"true\"\n aria-live={politeness}\n role={politeness === 'assertive' ? 'alert' : 'status'}\n sx={VISUALLY_HIDDEN_SX}\n >\n {message}\n </Box>\n ),\n [message, politeness],\n )\n\n return { announce, ariaLive }\n}\n"],"mappings":";;;;AAYA,IAAa,IAAA,CACX,IAAwC,aAClB;AACtB,QAAM,CAAC,GAAS,CAAA,IAAc,EAAM,SAAS,EAAE,GACzC,CAAC,GAAY,CAAA,IAAiB,EAAM,SAA6B,CAAiB;AAqBxF,SAAO;AAAA,IAAE,UAnBQ,EAAM,YAAA,CAAa,GAAc,MAAwC;AACxF,MAAI,KAAgB,EAAc,CAAc,GAChD,EAAW,CAAI;AAAA,IACjB,GAAG,CAAC,CAgBK;AAAA,IAAU,UAdF,EAAM,QAAA,MAEnB,gBAAA,EAAC,GAAD;AAAA,MACE,eAAY;AAAA,MACZ,aAAW;AAAA,MACX,MAAM,MAAe,cAAc,UAAU;AAAA,MAC7C,IAAI;AAAA,MAEH,UAAA;AAAA,IACE,CAAA,GAEP,CAAC,GAAS,CAAU,CAGH;AAAA,EAAS;AAC9B"}
@@ -2,133 +2,135 @@ import { buildDynamicCopy as r, buildPluralCopy as t } from "../core/utils/Local
2
2
  import i, { CalendarSelectionTypes as m } from "./components/calendar/Calendar.es.js";
3
3
  import a from "./components/charts/StatusBar.es.js";
4
4
  import p from "./components/charts/Donut.es.js";
5
- import f from "./hooks/useAccountDisplayName.es.js";
5
+ import u from "./hooks/useAccountDisplayName.es.js";
6
6
  import { useCombineEvents as C, useCombinePageviews as S } from "./hooks/useCombineEvents.es.js";
7
7
  import { GlobalDataContext as c, GlobalDataProvider as T } from "./context/GlobalDataProvider.es.js";
8
8
  import { WidgetContainerContext as d, WidgetContainerProvider as D } from "./context/WidgetContainerProvider.es.js";
9
- import { useAccountStore as I, useActionContext as N, useAgreementStore as P, useAppConfig as A, useBudgetsStore as y, useCashflowStore as O, useCategoryStore as b, useDebtStore as W, useError as G, useEvent as L, useFinstrongStore as R, useGlobalCopyStore as U, useGlobalStore as v, useGlobalUiStore as B, useGoalStore as h, useHelpStore as w, useHoldingStore as x, useHostMessage as M, useInsightsV2Store as Y, useLoad as H, useMerchantStore as F, useNetWorthStore as z, useNotificationStore as V, usePageView as Z, useRecurringTransactionsStore as K, useSettingsStore as k, useTransactionStore as q, useTrendsStore as j, useUserStore as J, useWidgetContainerProvider as Q } from "./context/hooks.es.js";
9
+ import { useAccountStore as I, useActionContext as N, useAgreementStore as P, useAppConfig as A, useBudgetsStore as y, useCashflowStore as O, useCategoryStore as b, useDebtStore as W, useError as L, useEvent as G, useFinstrongStore as R, useGlobalCopyStore as U, useGlobalStore as v, useGlobalUiStore as B, useGoalStore as h, useHelpStore as w, useHoldingStore as x, useHostMessage as M, useInsightsV2Store as Y, useLoad as H, useMerchantStore as F, useNetWorthStore as V, useNotificationStore as z, usePageView as Z, useRecurringTransactionsStore as K, useSettingsStore as k, useTransactionStore as q, useTrendsStore as X, useUserStore as j, useWidgetContainerProvider as J } from "./context/hooks.es.js";
10
10
  import { useInsightsEnabled as $ } from "./hooks/useInsightsEnabled.es.js";
11
11
  import { useScreenSize as ro } from "./hooks/useScreenSize.es.js";
12
12
  import eo from "./hooks/usePrevious.es.js";
13
- import { formatCurrency as mo, formatOrdinal as no, formatPercentage as ao, generateEqualIntervals as so, getCurrencyCodes as po, getPluralRules as uo } from "../core/utils/NumberFormatting.es.js";
13
+ import { formatCurrency as mo, formatOrdinal as no, formatPercentage as ao, generateEqualIntervals as so, getCurrencyCodes as po, getPluralRules as fo } from "../core/utils/NumberFormatting.es.js";
14
14
  import { useRepeatingTransactionEligibility as lo } from "./hooks/useRepeatingTransactionEligibility.es.js";
15
15
  import { useWidgetHeaderStyles as So } from "./hooks/useWidgetHeaderStyles.es.js";
16
16
  import { useWidgetLoadTimer as co } from "./hooks/useWidgetLoadTimer.es.js";
17
- import Eo from "./components/dialog/Dialog.es.js";
18
- import _o from "./components/drawer/Drawer.es.js";
19
- import No from "./components/daterangeselector/DateRangeSelector.es.js";
20
- import { ANALYTICS_EVENTS as Ao } from "./constants/Analytics.es.js";
21
- import { CONNECTIONS_WIDGET_ID as Oo, CONNECT_WIDGET_ID as bo, CONNECT_WIDGET_SOURCES as Wo, DEEP_LINK_TYPE as Go, MemberConnectionStatus as Lo } from "./constants/Connect.es.js";
22
- import { GlobalStore as Uo } from "../core/stores/GlobalStore.es.js";
23
- import { INCOME_ACCOUNT_TYPES as Bo, PAYMENT_ACCOUNT_TYPES as ho, SPENDING_ACCOUNT_TYPES as wo } from "./constants/Account.es.js";
24
- import { RECURRENCE_COPY as Mo } from "./constants/ScheduledPayment.es.js";
25
- import { LOADING_STATUS as Ho } from "./constants/SpendingPlan.es.js";
26
- import { DEFAULT_DONUT_SIZE as zo, DEFAULT_STROKE_WIDTH as Vo } from "./constants/Donut.es.js";
27
- import { Sizes as Ko, TOUCH_TARGET as ko } from "./constants/Sizes.es.js";
28
- import jo from "./components/donuts/MultiSegmentDonut.es.js";
29
- import Qo from "./components/donuts/SingleSegmentDonut.es.js";
30
- import $o from "./components/ErrorBoundary.es.js";
31
- import rr from "./components/Error.es.js";
32
- import er from "./components/MicroWidgetContainer.es.js";
33
- import mr from "./components/MiniWidgetContainer.es.js";
34
- import { GlobalAccountFilter as ar } from "./components/GlobalAccountFilter.es.js";
35
- import pr from "./components/Loader.es.js";
36
- import { WidgetContainer as fr } from "./components/WidgetContainer.es.js";
37
- import Cr from "./components/ConnectWidgetPanel.es.js";
38
- import gr from "./components/ConnectDrawer.es.js";
39
- import Tr from "./components/CurrencyDialog.es.js";
40
- import dr from "./components/CurrencyInput.es.js";
41
- import _r from "./components/ResponsiveButton.es.js";
42
- import Nr from "./components/SearchBox.es.js";
43
- import Ar from "./components/SelectionBox.es.js";
44
- import Or from "./components/TabContentContainer.es.js";
45
- import Wr from "./components/IconBacking.es.js";
46
- import Lr from "./components/DataRow.es.js";
47
- import Ur from "./components/ZeroState.es.js";
48
- import Br from "./components/InformationTooltip.es.js";
49
- import { ConnectCard as wr } from "./components/ConnectCard.es.js";
50
- import { CurrencyText as Mr } from "./components/CurrencyText.es.js";
51
- import { EmptyState as Hr } from "./components/EmptyState.es.js";
52
- import { ListItemAction as zr } from "./components/ListItemAction.es.js";
53
- import { ListItemRow as Zr } from "./components/ListItemRow.es.js";
54
- import { ListItemWrapper as kr } from "./components/ListItemWrapper.es.js";
55
- import { Select as jr } from "./components/Select.es.js";
56
- import { ToggleButtonListItem as Qr } from "./components/listitems/ToggleButtonListItem.es.js";
57
- import { ToggleListItem as $r } from "./components/listitems/ToggleListItem.es.js";
58
- import { analyticsSession as rt } from "./utils/Analytics.es.js";
59
- import { getClientComponentOverrides as et, getClientCustomizations as it, getClientPaletteOptions as mt, getClientTheme as nt } from "./utils/Theme.es.js";
17
+ import { VISUALLY_HIDDEN_SX as Eo } from "./constants/Styles.es.js";
18
+ import _o from "./components/dialog/Dialog.es.js";
19
+ import No from "./components/drawer/Drawer.es.js";
20
+ import Ao from "./components/daterangeselector/DateRangeSelector.es.js";
21
+ import { ANALYTICS_EVENTS as Oo } from "./constants/Analytics.es.js";
22
+ import { CONNECTIONS_WIDGET_ID as Wo, CONNECT_WIDGET_ID as Lo, CONNECT_WIDGET_SOURCES as Go, DEEP_LINK_TYPE as Ro, MemberConnectionStatus as Uo } from "./constants/Connect.es.js";
23
+ import { GlobalStore as Bo } from "../core/stores/GlobalStore.es.js";
24
+ import { INCOME_ACCOUNT_TYPES as wo, PAYMENT_ACCOUNT_TYPES as xo, SPENDING_ACCOUNT_TYPES as Mo } from "./constants/Account.es.js";
25
+ import { RECURRENCE_COPY as Ho } from "./constants/ScheduledPayment.es.js";
26
+ import { LOADING_STATUS as Vo } from "./constants/SpendingPlan.es.js";
27
+ import { DEFAULT_DONUT_SIZE as Zo, DEFAULT_STROKE_WIDTH as Ko } from "./constants/Donut.es.js";
28
+ import { Sizes as qo, TOUCH_TARGET as Xo } from "./constants/Sizes.es.js";
29
+ import Jo from "./components/donuts/MultiSegmentDonut.es.js";
30
+ import $o from "./components/donuts/SingleSegmentDonut.es.js";
31
+ import rr from "./components/ErrorBoundary.es.js";
32
+ import er from "./components/Error.es.js";
33
+ import mr from "./components/MicroWidgetContainer.es.js";
34
+ import ar from "./components/MiniWidgetContainer.es.js";
35
+ import { GlobalAccountFilter as pr } from "./components/GlobalAccountFilter.es.js";
36
+ import ur from "./components/Loader.es.js";
37
+ import { WidgetContainer as Cr } from "./components/WidgetContainer.es.js";
38
+ import gr from "./components/ConnectWidgetPanel.es.js";
39
+ import Tr from "./components/ConnectDrawer.es.js";
40
+ import dr from "./components/CurrencyDialog.es.js";
41
+ import _r from "./components/CurrencyInput.es.js";
42
+ import Nr from "./components/ResponsiveButton.es.js";
43
+ import Ar from "./components/SearchBox.es.js";
44
+ import Or from "./components/SelectionBox.es.js";
45
+ import Wr from "./components/TabContentContainer.es.js";
46
+ import Gr from "./components/IconBacking.es.js";
47
+ import Ur from "./components/DataRow.es.js";
48
+ import Br from "./components/ZeroState.es.js";
49
+ import wr from "./components/InformationTooltip.es.js";
50
+ import { ConnectCard as Mr } from "./components/ConnectCard.es.js";
51
+ import { CurrencyText as Hr } from "./components/CurrencyText.es.js";
52
+ import { EmptyState as Vr } from "./components/EmptyState.es.js";
53
+ import { ListItemAction as Zr } from "./components/ListItemAction.es.js";
54
+ import { ListItemRow as kr } from "./components/ListItemRow.es.js";
55
+ import { ListItemWrapper as Xr } from "./components/ListItemWrapper.es.js";
56
+ import { Select as Jr } from "./components/Select.es.js";
57
+ import { ToggleButtonListItem as $r } from "./components/listitems/ToggleButtonListItem.es.js";
58
+ import { ToggleListItem as rt } from "./components/listitems/ToggleListItem.es.js";
59
+ import { analyticsSession as et } from "./utils/Analytics.es.js";
60
+ import { getClientComponentOverrides as mt, getClientCustomizations as nt, getClientPaletteOptions as at, getClientTheme as st } from "./utils/Theme.es.js";
60
61
  export {
61
- Ao as ANALYTICS_EVENTS,
62
- Oo as CONNECTIONS_WIDGET_ID,
63
- bo as CONNECT_WIDGET_ID,
64
- Wo as CONNECT_WIDGET_SOURCES,
62
+ Oo as ANALYTICS_EVENTS,
63
+ Wo as CONNECTIONS_WIDGET_ID,
64
+ Lo as CONNECT_WIDGET_ID,
65
+ Go as CONNECT_WIDGET_SOURCES,
65
66
  i as Calendar,
66
67
  m as CalendarSelectionTypes,
67
- wr as ConnectCard,
68
- gr as ConnectDrawer,
69
- Cr as ConnectWidgetPanel,
70
- Tr as CurrencyDialog,
71
- dr as CurrencyInput,
72
- Mr as CurrencyText,
73
- Go as DEEP_LINK_TYPE,
74
- zo as DEFAULT_DONUT_SIZE,
75
- Vo as DEFAULT_STROKE_WIDTH,
76
- Lr as DataRow,
77
- No as DateRangeSelector,
78
- Eo as Dialog,
68
+ Mr as ConnectCard,
69
+ Tr as ConnectDrawer,
70
+ gr as ConnectWidgetPanel,
71
+ dr as CurrencyDialog,
72
+ _r as CurrencyInput,
73
+ Hr as CurrencyText,
74
+ Ro as DEEP_LINK_TYPE,
75
+ Zo as DEFAULT_DONUT_SIZE,
76
+ Ko as DEFAULT_STROKE_WIDTH,
77
+ Ur as DataRow,
78
+ Ao as DateRangeSelector,
79
+ _o as Dialog,
79
80
  p as Donut,
80
- _o as Drawer,
81
- Hr as EmptyState,
82
- rr as Error,
83
- $o as ErrorBoundary,
84
- ar as GlobalAccountFilter,
81
+ No as Drawer,
82
+ Vr as EmptyState,
83
+ er as Error,
84
+ rr as ErrorBoundary,
85
+ pr as GlobalAccountFilter,
85
86
  c as GlobalDataContext,
86
87
  T as GlobalDataProvider,
87
- Uo as GlobalStore,
88
- Bo as INCOME_ACCOUNT_TYPES,
89
- Wr as IconBacking,
90
- Br as InformationTooltip,
91
- Ho as LOADING_STATUS,
92
- zr as ListItemAction,
93
- Zr as ListItemRow,
94
- kr as ListItemWrapper,
95
- pr as Loader,
96
- Lo as MemberConnectionStatus,
97
- er as MicroWidgetContainer,
98
- mr as MiniWidgetContainer,
99
- jo as MultiSegmentDonut,
100
- ho as PAYMENT_ACCOUNT_TYPES,
101
- Mo as RECURRENCE_COPY,
102
- _r as ResponsiveButton,
103
- wo as SPENDING_ACCOUNT_TYPES,
104
- Nr as SearchBox,
105
- jr as Select,
106
- Ar as SelectionBox,
107
- Qo as SingleSegmentDonut,
108
- Ko as Sizes,
88
+ Bo as GlobalStore,
89
+ wo as INCOME_ACCOUNT_TYPES,
90
+ Gr as IconBacking,
91
+ wr as InformationTooltip,
92
+ Vo as LOADING_STATUS,
93
+ Zr as ListItemAction,
94
+ kr as ListItemRow,
95
+ Xr as ListItemWrapper,
96
+ ur as Loader,
97
+ Uo as MemberConnectionStatus,
98
+ mr as MicroWidgetContainer,
99
+ ar as MiniWidgetContainer,
100
+ Jo as MultiSegmentDonut,
101
+ xo as PAYMENT_ACCOUNT_TYPES,
102
+ Ho as RECURRENCE_COPY,
103
+ Nr as ResponsiveButton,
104
+ Mo as SPENDING_ACCOUNT_TYPES,
105
+ Ar as SearchBox,
106
+ Jr as Select,
107
+ Or as SelectionBox,
108
+ $o as SingleSegmentDonut,
109
+ qo as Sizes,
109
110
  a as StatusBar,
110
- ko as TOUCH_TARGET,
111
- Or as TabContentContainer,
112
- Qr as ToggleButtonListItem,
113
- $r as ToggleListItem,
114
- fr as WidgetContainer,
111
+ Xo as TOUCH_TARGET,
112
+ Wr as TabContentContainer,
113
+ $r as ToggleButtonListItem,
114
+ rt as ToggleListItem,
115
+ Eo as VISUALLY_HIDDEN_SX,
116
+ Cr as WidgetContainer,
115
117
  d as WidgetContainerContext,
116
118
  D as WidgetContainerProvider,
117
- Ur as ZeroState,
118
- rt as analyticsSession,
119
+ Br as ZeroState,
120
+ et as analyticsSession,
119
121
  r as buildDynamicCopy,
120
122
  t as buildPluralCopy,
121
123
  mo as formatCurrency,
122
124
  no as formatOrdinal,
123
125
  ao as formatPercentage,
124
126
  so as generateEqualIntervals,
125
- et as getClientComponentOverrides,
126
- it as getClientCustomizations,
127
- mt as getClientPaletteOptions,
128
- nt as getClientTheme,
127
+ mt as getClientComponentOverrides,
128
+ nt as getClientCustomizations,
129
+ at as getClientPaletteOptions,
130
+ st as getClientTheme,
129
131
  po as getCurrencyCodes,
130
- uo as getPluralRules,
131
- f as useAccountDisplayName,
132
+ fo as getPluralRules,
133
+ u as useAccountDisplayName,
132
134
  I as useAccountStore,
133
135
  N as useActionContext,
134
136
  P as useAgreementStore,
@@ -139,8 +141,8 @@ export {
139
141
  C as useCombineEvents,
140
142
  S as useCombinePageviews,
141
143
  W as useDebtStore,
142
- G as useError,
143
- L as useEvent,
144
+ L as useError,
145
+ G as useEvent,
144
146
  R as useFinstrongStore,
145
147
  U as useGlobalCopyStore,
146
148
  v as useGlobalStore,
@@ -153,8 +155,8 @@ export {
153
155
  Y as useInsightsV2Store,
154
156
  H as useLoad,
155
157
  F as useMerchantStore,
156
- z as useNetWorthStore,
157
- V as useNotificationStore,
158
+ V as useNetWorthStore,
159
+ z as useNotificationStore,
158
160
  Z as usePageView,
159
161
  eo as usePrevious,
160
162
  K as useRecurringTransactionsStore,
@@ -162,9 +164,9 @@ export {
162
164
  ro as useScreenSize,
163
165
  k as useSettingsStore,
164
166
  q as useTransactionStore,
165
- j as useTrendsStore,
166
- J as useUserStore,
167
- Q as useWidgetContainerProvider,
167
+ X as useTrendsStore,
168
+ j as useUserStore,
169
+ J as useWidgetContainerProvider,
168
170
  So as useWidgetHeaderStyles,
169
171
  co as useWidgetLoadTimer
170
172
  };
@@ -31,10 +31,15 @@ export declare class TrendsStore {
31
31
  get visibleCategories(): DetailedCategoryWithTransactions[];
32
32
  get collapsedCategories(): DetailedCategoryWithTransactions[];
33
33
  get categoryDetailsChartData(): {
34
+ average: number;
34
35
  monthlyAmounts: {
35
36
  x: string;
36
37
  y: number;
37
38
  }[];
39
+ monthlyTotals: {
40
+ label: string;
41
+ amount: number;
42
+ }[];
38
43
  tooltipLabels: {
39
44
  label: string;
40
45
  amount: number;
@@ -252,6 +252,7 @@ export declare const BlockType: {
252
252
  readonly DoubleBarChartBlock: "double_bar_chart_block";
253
253
  readonly DoubleProgressBarBlock: "double_progress_bar_block";
254
254
  readonly DebtsBlock: "debts_block";
255
+ readonly NoSpendDaysBlock: "no_spend_days_block";
255
256
  readonly RepeatingTransactionBlock: "repeating_transaction_block";
256
257
  readonly SaveExtraBlock: "save_extra_block";
257
258
  readonly SavingsOpportunityBlock: "savings_opportunity_block";
@@ -352,4 +353,6 @@ export interface InstanceSlot {
352
353
  monthly_payment?: number;
353
354
  /** Annual interest rate as a percentage (e.g. `19.99`); the block formats it as a percent. */
354
355
  interest_rate?: number;
356
+ start_date?: string;
357
+ no_spend_days?: string[];
355
358
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Insights.es.js","names":[],"sources":["../../../src/core/types/Insights.ts"],"sourcesContent":["// ============ Core InsightsV2 Types ============\n\nimport { InsightsInstanceSlotData } from './InsightsInstanceSlotData'\n\nexport interface ThemedSVGImageProps {\n divProps?: React.HTMLAttributes<HTMLDivElement>\n image: React.ComponentType<React.SVGProps<SVGSVGElement>>\n isMini?: boolean\n}\n\n/**\n * Emitted by a block when the user drills into a specific datum (e.g. clicks a\n * chart bar). Named fields rather than positional args so blocks with differing\n * shapes can extend this without the call sites transposing values.\n */\nexport interface DrilldownPayload {\n chartBarIndex: number\n tabIndex?: number\n transaction_guid?: string\n block?: string\n}\n\n/**\n * Which envelope a beat was fetched with. `embedded` (the transaction-row pill + details-drawer\n * card) and `notification` are V2 additions; a surface asks for one with `widget_type=` on the fetch.\n */\nexport type WidgetType = 'full' | 'mini' | 'micro' | 'embedded' | 'notification'\n\n/**\n * V2: the transaction-row tag, its own small section of the `embedded` envelope (the same grammar\n * as `description` / `footer`, with room for a tone or an icon later). Omitted for an insight that\n * tags no transaction row. It deliberately is *not* `short_title`, which stays a per-variant\n * attribute with a second consumer (the bank-holiday sub-header).\n */\nexport interface Pill {\n text: string\n}\n\n/**\n * V2: facts a drilldown shows that the card does not (e.g. the account number for the Transaction\n * Details drawer), or the guid list a list drawer shows (`transaction_guids`). Scalars or string\n * lists, shared by every CTA of the card, omitted when the insight has none. Never carries copy or\n * user actions (memo, tags, hide, flag come from the transaction store). Values come from the\n * server, so a reader still checks each value's runtime shape.\n */\nexport type DrilldownData = Record<string, string | number | boolean | null | string[]>\n\nexport interface InsightsPayload {\n widget_type: WidgetType\n instance_slot: InstanceSlot\n /**\n * V1 only. The v2 contract carries everything a block needs on `instance_slot.data`,\n * and omits this key entirely (see the LargeTransactionV2 payload). Blocks that still require it\n * get it as a required field through `BlockProps`, which re-declares it.\n */\n instance_slot_data?: InsightsInstanceSlotData\n description: Description\n primary_cta?: PrimaryCTA\n secondary_cta?: SecondaryCTA\n title?: string\n sub_title?: Subtitle\n /**\n * V2 rename of `sub_title`: a flat string, with the logo promoted to the payload-level `logo`\n * field below. `sub_title` wins when both are present.\n */\n subtitle?: string\n /** V2: header logo paired with the flat `subtitle`: an entity guid or a status icon (`LogoRef`). */\n logo?: LogoRef\n /** V2: which design branch the backend picked (e.g. `no_merchant`). */\n variant?: string\n /** V2, `embedded` envelope only: the transaction-row pill. */\n pill?: Pill\n /**\n * V2: drilldown-only facts, e.g. `{ account_number: 'XXXXXXXX043' }`, or the guid list a list\n * drawer shows (`{ transaction_guids: [...] }`).\n */\n drilldown_data?: DrilldownData\n footer?: Footer\n /**\n * V2: the link inside the description: on the full card a drawer of its own (Low Account\n * Balance's \"Transactions ›\"); on mini and micro the card's action, sent instead of `primary_cta`.\n * Absent when the beat has no link.\n */\n in_description_cta?: InDescriptionCTA\n guid: string\n user_guid: string\n client_guid?: string\n /** Template name, e.g. `LargeTransactionV2`. */\n template?: string\n revision?: number\n /** Unix seconds. */\n created_at?: number\n /** Unix seconds. */\n updated_at?: number\n /** Unix seconds. */\n active_at?: number\n displayed_at?: number | null\n dismissed_at: number | null\n cta_clicked_at?: number | null\n has_been_displayed?: boolean\n is_dismissed: boolean\n is_deleted?: boolean\n is_hidden_by_system?: boolean\n is_obsolete?: boolean\n is_refreshable?: boolean\n is_sampled?: boolean\n is_zero_state?: boolean\n status?: string | null\n /**\n * V2 (LargeTransactionV2 onward): the entities the beat is about, carried on the payload so\n * action blocks do not have to reach back out to the beat envelope.\n */\n primary_account_guid?: string | null\n primary_transaction_guid?: string | null\n primary_category_guid?: string | null\n primary_merchant_guid?: string | null\n /**\n * V2: the repeating transaction a subscription beat is about (Upcoming Subscription, Subscription\n * Price Increase). Read by `recurring_transaction_block`, see\n * `actionBlocks/RecurringTransactionBlock/subscriptionBeats.ts`.\n */\n primary_repeating_transaction_guid?: string | null\n}\n\nexport interface Legends {\n label: string\n value: number\n additional_value?: number\n additional_value_type?: string\n value_type?: string\n}\n\nexport interface Logo {\n category_guid?: string\n category_name?: string\n institution_guid?: string\n institution_name?: string\n logo_color?: string\n /** Draw the `logo_name` icon filled (V2 `ICO-` logos). */\n logo_fill?: boolean\n logo_name?: string\n merchant_guid?: string\n merchant_name?: string\n}\n\nexport interface Subtitle {\n logo?: Logo\n text: string\n}\n\n/**\n * A V2 logo, shared by the header (`InsightsPayload.logo`) and every instance-slot row. It takes\n * one of two shapes:\n *\n * - **Entity**: `guid`, whose prefix (`INS-` / `MCH-` / `CAT-`) picks the logo component, plus an\n * optional `fallback_guid` for when that component's asset cannot load. Today that is the\n * category behind an `MCH-` guid, which `MerchantLogo` shows as a tile when the merchant image\n * is missing.\n * - **Status icon**: `icon` (an mx-icons name, e.g. `warning`) and `color` (a theme palette path,\n * e.g. `error.main`), for subheaders that show a state rather than an entity (V1's\n * `logo_name` / `logo_color`).\n *\n * `alt` is the accessible name for either shape. A logo sends one shape; if it sends both, `icon`\n * wins, as `logo_name` does in V1's `SubHeader`.\n */\nexport interface LogoRef {\n alt?: string\n color?: string\n fallback_guid?: string\n guid?: string\n icon?: string\n}\n\nexport interface CategoryLogo {\n category_guid: string\n category_name: string\n}\n\nexport interface MerchantLogo {\n merchant_guid: string\n merchant_name: string\n}\n\nexport interface InstitutionLogo {\n institution_guid: string\n institution_name: string\n}\n\nexport interface Description {\n text: string\n html_text: string\n}\n\n/**\n * Post message a CTA press sends to the host, resolved by the backend for the beat's current\n * state. Absent/null = the backend has not described one: the frontend uses the template's\n * interim `ctaPostMessages` entry if there is one, else sends no message. `payload` carries only\n * beat-specific extras; the frontend always adds `beat_guid`, `beat_template`, `user_guid` and\n * `action_string`.\n */\nexport interface CtaPostMessageMetadata {\n /** Post message event; defaults to `beat/cta`. */\n event?: string | null\n /** Operation the host should perform, e.g. `op_1`, `op_2`, `op_3`. Defaults to `op_1`. */\n action?: string | null\n /** Beat-specific fields merged into the message metadata (account ids, amounts, ...). */\n payload?: Record<string, unknown> | null\n}\n\nexport interface PrimaryCTA {\n label: string\n block: string\n variant?: string | null\n /**\n * What pressing the CTA does beyond opening its block, named by the backend (ditto\n * `primary_cta_action`, passed through by tupac). Looked up in `insights-v2/ctaActions`;\n * null / absent / unknown means the CTA only opens its block or posts its message.\n */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n}\n\nexport interface SecondaryCTA {\n label: string\n /**\n * Drawer block to open. `null` when the CTA opens nothing (ditto `secondary_cta_block: null`,\n * e.g. Fee Detected's \"Contact Support\"): the press posts its message to the host instead.\n */\n block: string | null\n variant?: string | null\n /** See `PrimaryCTA.action_key` (ditto `secondary_cta_action`). */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n}\n\n/**\n * The description link: its label, the action block it opens and, like a CTA's, the variant that\n * tells that block what to show (ditto's `in_description_cta_variant`, e.g. `low_balance`). On mini\n * and micro it words the card's action; `block` is empty when that action opens no drawer.\n */\nexport interface InDescriptionCTA {\n label: string\n block?: string\n variant?: string | null\n action_key?: string | null\n}\n\nexport interface Footer {\n /** V1: a pre-formatted date string. */\n date?: string\n /**\n * The account label, on both V1 and V2. The backend resolves the plurality: one account sends\n * its name (e.g. `Epic Bank`), several send a localized count (e.g. `2 Accounts`), none sends\n * `null` (tupac's `footer_account_label` returns nil for a beat with no accounts, as Payday Cash\n * Left Over Status does). There is deliberately no separate `accounts` key.\n */\n account?: string | null\n /**\n * V2 (LargeTransactionV2 onward): unix seconds, formatted by `Footer` for display.\n * Replaces `date`; `date` wins when a beat somehow sends both.\n */\n timestamp?: number\n}\n\n// ============ Instance Slot Types ============\n// Values are the snake_case block names the backend sends on a beat's instance slot; the PascalCase\n// keys stay as friendly references (e.g. BlockType.BarChartBlock === 'bar_chart_block').\nexport const BlockType = {\n AccountBlock: 'account_block',\n AccountSwitchBlock: 'account_switch_block',\n BarChartBlock: 'bar_chart_block',\n BudgetBlock: 'budget_block',\n DirectDepositBlock: 'direct_deposit_block',\n ImageBlock: 'image_block',\n TransactionBlock: 'transaction_block',\n DonutChartBlock: 'donut_chart_block',\n DoubleBarChartBlock: 'double_bar_chart_block',\n DoubleProgressBarBlock: 'double_progress_bar_block',\n DebtsBlock: 'debts_block',\n RepeatingTransactionBlock: 'repeating_transaction_block',\n SaveExtraBlock: 'save_extra_block',\n SavingsOpportunityBlock: 'savings_opportunity_block',\n StepChartBlock: 'step_chart_block',\n SVGImageBlock: 'svg_image_block',\n UpcomingBillBlock: 'upcoming_bill_block',\n UpcomingSubscriptionBlock: 'upcoming_subscription_block',\n WithdrawalBlock: 'withdrawal_block',\n} as const\n\nexport type BlockType = (typeof BlockType)[keyof typeof BlockType]\n\n/**\n * A pre-localized row on a V2 instance slot. The backend resolves the copy and formatting; the\n * logo is a `LogoRef` (an entity guid or a status icon, see `logoFromRef`).\n */\nexport interface InstanceSlotRow {\n amount?: number\n logo?: LogoRef\n primary_text?: string\n secondary_text?: string\n}\n\n/**\n * V2: the slots a block's variant filled, keyed by slot name; ditto owns the names and omits any\n * slot it has no value for (`lib/ditto/blocks/<block>.yml`). Read with `slot()`, which names the\n * kind the caller expects.\n */\nexport interface InstanceSlotData {\n [slot: string]: unknown\n}\n\n/**\n * Reads one slot off a block's `data`; undefined when ditto did not fill it.\n *\n * The caller names the kind, because the slot's kind lives in the block's ditto schema and not\n * here — a block fills slots with whatever its card needs, so no fixed list of kinds would hold\n * (`account_switch_block` alone carries a boolean and `budget_block` a nested object).\n */\nexport const slot = <T = unknown>(\n data: InstanceSlotData | undefined,\n name: string,\n): T | undefined => data?.[name] as T | undefined\n\n/**\n * V2: which block renders this beat's content, and what it renders.\n *\n * `block` is optional: a beat whose template has no ditto config arrives as an empty `{}` and the\n * card renders its copy and CTAs alone, so a reader cannot assume a block is named. One interface\n * with `block` optional rather than a union with `Record<string, never>`, which TypeScript absorbs\n * — that union left `block` reading as required and typed a promise it did not keep.\n *\n * `variant` is optional for the same reason — the empty `{}` carries neither. Every ditto beat\n * file that names a block also names a variant, so a *filled* slot always has one; ditto drops a\n * nil variant rather than sending null, which is why the type is `string | null | undefined`.\n */\nexport interface InstanceSlot {\n block?: BlockType\n variant?: string | null\n /** The slots this block's variant declares in ditto. */\n data?: InstanceSlotData\n // Direct Deposit block (Set Up Direct Deposit, Switch Direct Deposit, Missing\n // Interest Rate): account facts carried flat on the slot, beside `data`.\n /** Primary line on the hero card, e.g. \"Epic Bank Checking, *1234\". */\n account_name?: string\n /** Secondary line beneath the name, e.g. \"Checking Account\" / \"Credit Card\". */\n account_type?: string\n /** Status pill label, e.g. \"Direct Deposit Not Set Up\" / \"Interest Rate: 19.99% APR\". */\n status_text?: string\n institution_guid?: string\n institution_name?: string\n // Shared across multiple V2 component blocks:\n // `amount` — UpcomingBillBlock (projected bill), SavingsOpportunityBlock (coupon),\n // UpcomingSubscriptionBlock (price per cadence).\n // `merchant_guid` / `merchant_name` — UpcomingBillBlock (bill row logo + name),\n // UpcomingSubscriptionBlock (hero logo + name).\n /** Dollar amount (unformatted); the block formats it as currency. */\n amount?: number\n // Withdrawal block (Emergency Fund Withdrawal): one row flat on the slot - `amount` above is the\n // withdrawal, shown with its date line \"{amount_label} {withdrawal_date}\" over the balance row.\n /** Pre-localized lead-in for the date line, e.g. \"Withdrawn on\". */\n amount_label?: string\n /** The withdrawal's calendar day, `YYYY-MM-DD` (e.g. `2026-10-20`); the card formats it. */\n withdrawal_date?: string\n /** Account balance after the withdrawal (unformatted); the card formats it as currency. */\n balance?: number\n /** Pre-localized label for the balance row, e.g. \"Balance\". */\n balance_label?: string\n /** Merchant guid used to render the inline / hero logo via `LogoFromGuid` (`MCH-...`). */\n merchant_guid?: string\n /** Merchant display name — shown as logo alt text and as the merchant/hero label. */\n merchant_name?: string\n // Upcoming Bill block (Projected Bill Payment): the block derives the Sun→Sat week strip\n // around `due_date` at render time.\n /** Due date of the projected bill in ISO form (e.g. `2025-10-30`). */\n due_date?: string\n // Savings Opportunity block (Save An Extra, Potential Savings, Embedded): purely data-driven\n // coupon card. Backend sends the caption and the amount, plus `slot` to toggle the green\n // gradient background when the card is embedded in a parent surface that supplies its own.\n /** Caption shown above the amount, e.g. `Save an extra` or `Potential savings`. */\n label?: string\n /**\n * Whether to render the green gradient slot behind the coupon. Defaults to true. Backend sends\n * `false` when the coupon is embedded in a parent surface that supplies its own background.\n */\n slot?: boolean\n // Upcoming Subscription block: billing cadence for the price pill (`${amount} / ${cadence}`).\n /** Billing cadence word that trails the price, e.g. `month` or `year`. */\n cadence?: string\n // Account block (status on/off-track, deposit, payoff variants): card content carried flat on\n // the slot (the V2 contract drops `instance_slot_data`). `amount`, `label`, `merchant_guid`,\n // `merchant_name`, `institution_guid`, `institution_name` are shared fields declared above.\n /** Secondary line beneath the amount on the standard card, e.g. \"Remaining after expenses\". */\n sub_text?: string\n /** Header bar text (standard card) or the colored category strip label (deposit cards). */\n header_text?: string\n /** Generic-tile icon name used when no merchant/institution logo is available. */\n icon_name?: string\n /** Category guid used to render the deposit-card logo fallback. */\n category_guid?: string\n // Debts block: `amount` is the current balance; the shared account/institution fields above.\n /** Projected payoff date in ISO form (e.g. `2027-03-01`); the block formats it as month + year. */\n payoff_date?: string\n /** Monthly payment toward the debt (unformatted); the block formats it as currency. */\n monthly_payment?: number\n /** Annual interest rate as a percentage (e.g. `19.99`); the block formats it as a percent. */\n interest_rate?: number\n}\n"],"mappings":"AA8TA,IAAa,IAAA,CACX,GACA,MACkB,IAAO,CAAA"}
1
+ {"version":3,"file":"Insights.es.js","names":[],"sources":["../../../src/core/types/Insights.ts"],"sourcesContent":["// ============ Core InsightsV2 Types ============\n\nimport { InsightsInstanceSlotData } from './InsightsInstanceSlotData'\n\nexport interface ThemedSVGImageProps {\n divProps?: React.HTMLAttributes<HTMLDivElement>\n image: React.ComponentType<React.SVGProps<SVGSVGElement>>\n isMini?: boolean\n}\n\n/**\n * Emitted by a block when the user drills into a specific datum (e.g. clicks a\n * chart bar). Named fields rather than positional args so blocks with differing\n * shapes can extend this without the call sites transposing values.\n */\nexport interface DrilldownPayload {\n chartBarIndex: number\n tabIndex?: number\n transaction_guid?: string\n block?: string\n}\n\n/**\n * Which envelope a beat was fetched with. `embedded` (the transaction-row pill + details-drawer\n * card) and `notification` are V2 additions; a surface asks for one with `widget_type=` on the fetch.\n */\nexport type WidgetType = 'full' | 'mini' | 'micro' | 'embedded' | 'notification'\n\n/**\n * V2: the transaction-row tag, its own small section of the `embedded` envelope (the same grammar\n * as `description` / `footer`, with room for a tone or an icon later). Omitted for an insight that\n * tags no transaction row. It deliberately is *not* `short_title`, which stays a per-variant\n * attribute with a second consumer (the bank-holiday sub-header).\n */\nexport interface Pill {\n text: string\n}\n\n/**\n * V2: facts a drilldown shows that the card does not (e.g. the account number for the Transaction\n * Details drawer), or the guid list a list drawer shows (`transaction_guids`). Scalars or string\n * lists, shared by every CTA of the card, omitted when the insight has none. Never carries copy or\n * user actions (memo, tags, hide, flag come from the transaction store). Values come from the\n * server, so a reader still checks each value's runtime shape.\n */\nexport type DrilldownData = Record<string, string | number | boolean | null | string[]>\n\nexport interface InsightsPayload {\n widget_type: WidgetType\n instance_slot: InstanceSlot\n /**\n * V1 only. The v2 contract carries everything a block needs on `instance_slot.data`,\n * and omits this key entirely (see the LargeTransactionV2 payload). Blocks that still require it\n * get it as a required field through `BlockProps`, which re-declares it.\n */\n instance_slot_data?: InsightsInstanceSlotData\n description: Description\n primary_cta?: PrimaryCTA\n secondary_cta?: SecondaryCTA\n title?: string\n sub_title?: Subtitle\n /**\n * V2 rename of `sub_title`: a flat string, with the logo promoted to the payload-level `logo`\n * field below. `sub_title` wins when both are present.\n */\n subtitle?: string\n /** V2: header logo paired with the flat `subtitle`: an entity guid or a status icon (`LogoRef`). */\n logo?: LogoRef\n /** V2: which design branch the backend picked (e.g. `no_merchant`). */\n variant?: string\n /** V2, `embedded` envelope only: the transaction-row pill. */\n pill?: Pill\n /**\n * V2: drilldown-only facts, e.g. `{ account_number: 'XXXXXXXX043' }`, or the guid list a list\n * drawer shows (`{ transaction_guids: [...] }`).\n */\n drilldown_data?: DrilldownData\n footer?: Footer\n /**\n * V2: the link inside the description: on the full card a drawer of its own (Low Account\n * Balance's \"Transactions ›\"); on mini and micro the card's action, sent instead of `primary_cta`.\n * Absent when the beat has no link.\n */\n in_description_cta?: InDescriptionCTA\n guid: string\n user_guid: string\n client_guid?: string\n /** Template name, e.g. `LargeTransactionV2`. */\n template?: string\n revision?: number\n /** Unix seconds. */\n created_at?: number\n /** Unix seconds. */\n updated_at?: number\n /** Unix seconds. */\n active_at?: number\n displayed_at?: number | null\n dismissed_at: number | null\n cta_clicked_at?: number | null\n has_been_displayed?: boolean\n is_dismissed: boolean\n is_deleted?: boolean\n is_hidden_by_system?: boolean\n is_obsolete?: boolean\n is_refreshable?: boolean\n is_sampled?: boolean\n is_zero_state?: boolean\n status?: string | null\n /**\n * V2 (LargeTransactionV2 onward): the entities the beat is about, carried on the payload so\n * action blocks do not have to reach back out to the beat envelope.\n */\n primary_account_guid?: string | null\n primary_transaction_guid?: string | null\n primary_category_guid?: string | null\n primary_merchant_guid?: string | null\n /**\n * V2: the repeating transaction a subscription beat is about (Upcoming Subscription, Subscription\n * Price Increase). Read by `recurring_transaction_block`, see\n * `actionBlocks/RecurringTransactionBlock/subscriptionBeats.ts`.\n */\n primary_repeating_transaction_guid?: string | null\n}\n\nexport interface Legends {\n label: string\n value: number\n additional_value?: number\n additional_value_type?: string\n value_type?: string\n}\n\nexport interface Logo {\n category_guid?: string\n category_name?: string\n institution_guid?: string\n institution_name?: string\n logo_color?: string\n /** Draw the `logo_name` icon filled (V2 `ICO-` logos). */\n logo_fill?: boolean\n logo_name?: string\n merchant_guid?: string\n merchant_name?: string\n}\n\nexport interface Subtitle {\n logo?: Logo\n text: string\n}\n\n/**\n * A V2 logo, shared by the header (`InsightsPayload.logo`) and every instance-slot row. It takes\n * one of two shapes:\n *\n * - **Entity**: `guid`, whose prefix (`INS-` / `MCH-` / `CAT-`) picks the logo component, plus an\n * optional `fallback_guid` for when that component's asset cannot load. Today that is the\n * category behind an `MCH-` guid, which `MerchantLogo` shows as a tile when the merchant image\n * is missing.\n * - **Status icon**: `icon` (an mx-icons name, e.g. `warning`) and `color` (a theme palette path,\n * e.g. `error.main`), for subheaders that show a state rather than an entity (V1's\n * `logo_name` / `logo_color`).\n *\n * `alt` is the accessible name for either shape. A logo sends one shape; if it sends both, `icon`\n * wins, as `logo_name` does in V1's `SubHeader`.\n */\nexport interface LogoRef {\n alt?: string\n color?: string\n fallback_guid?: string\n guid?: string\n icon?: string\n}\n\nexport interface CategoryLogo {\n category_guid: string\n category_name: string\n}\n\nexport interface MerchantLogo {\n merchant_guid: string\n merchant_name: string\n}\n\nexport interface InstitutionLogo {\n institution_guid: string\n institution_name: string\n}\n\nexport interface Description {\n text: string\n html_text: string\n}\n\n/**\n * Post message a CTA press sends to the host, resolved by the backend for the beat's current\n * state. Absent/null = the backend has not described one: the frontend uses the template's\n * interim `ctaPostMessages` entry if there is one, else sends no message. `payload` carries only\n * beat-specific extras; the frontend always adds `beat_guid`, `beat_template`, `user_guid` and\n * `action_string`.\n */\nexport interface CtaPostMessageMetadata {\n /** Post message event; defaults to `beat/cta`. */\n event?: string | null\n /** Operation the host should perform, e.g. `op_1`, `op_2`, `op_3`. Defaults to `op_1`. */\n action?: string | null\n /** Beat-specific fields merged into the message metadata (account ids, amounts, ...). */\n payload?: Record<string, unknown> | null\n}\n\nexport interface PrimaryCTA {\n label: string\n block: string\n variant?: string | null\n /**\n * What pressing the CTA does beyond opening its block, named by the backend (ditto\n * `primary_cta_action`, passed through by tupac). Looked up in `insights-v2/ctaActions`;\n * null / absent / unknown means the CTA only opens its block or posts its message.\n */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n}\n\nexport interface SecondaryCTA {\n label: string\n /**\n * Drawer block to open. `null` when the CTA opens nothing (ditto `secondary_cta_block: null`,\n * e.g. Fee Detected's \"Contact Support\"): the press posts its message to the host instead.\n */\n block: string | null\n variant?: string | null\n /** See `PrimaryCTA.action_key` (ditto `secondary_cta_action`). */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n}\n\n/**\n * The description link: its label, the action block it opens and, like a CTA's, the variant that\n * tells that block what to show (ditto's `in_description_cta_variant`, e.g. `low_balance`). On mini\n * and micro it words the card's action; `block` is empty when that action opens no drawer.\n */\nexport interface InDescriptionCTA {\n label: string\n block?: string\n variant?: string | null\n action_key?: string | null\n}\n\nexport interface Footer {\n /** V1: a pre-formatted date string. */\n date?: string\n /**\n * The account label, on both V1 and V2. The backend resolves the plurality: one account sends\n * its name (e.g. `Epic Bank`), several send a localized count (e.g. `2 Accounts`), none sends\n * `null` (tupac's `footer_account_label` returns nil for a beat with no accounts, as Payday Cash\n * Left Over Status does). There is deliberately no separate `accounts` key.\n */\n account?: string | null\n /**\n * V2 (LargeTransactionV2 onward): unix seconds, formatted by `Footer` for display.\n * Replaces `date`; `date` wins when a beat somehow sends both.\n */\n timestamp?: number\n}\n\n// ============ Instance Slot Types ============\n// Values are the snake_case block names the backend sends on a beat's instance slot; the PascalCase\n// keys stay as friendly references (e.g. BlockType.BarChartBlock === 'bar_chart_block').\nexport const BlockType = {\n AccountBlock: 'account_block',\n AccountSwitchBlock: 'account_switch_block',\n BarChartBlock: 'bar_chart_block',\n BudgetBlock: 'budget_block',\n DirectDepositBlock: 'direct_deposit_block',\n ImageBlock: 'image_block',\n TransactionBlock: 'transaction_block',\n DonutChartBlock: 'donut_chart_block',\n DoubleBarChartBlock: 'double_bar_chart_block',\n DoubleProgressBarBlock: 'double_progress_bar_block',\n DebtsBlock: 'debts_block',\n NoSpendDaysBlock: 'no_spend_days_block',\n RepeatingTransactionBlock: 'repeating_transaction_block',\n SaveExtraBlock: 'save_extra_block',\n SavingsOpportunityBlock: 'savings_opportunity_block',\n StepChartBlock: 'step_chart_block',\n SVGImageBlock: 'svg_image_block',\n UpcomingBillBlock: 'upcoming_bill_block',\n UpcomingSubscriptionBlock: 'upcoming_subscription_block',\n WithdrawalBlock: 'withdrawal_block',\n} as const\n\nexport type BlockType = (typeof BlockType)[keyof typeof BlockType]\n\n/**\n * A pre-localized row on a V2 instance slot. The backend resolves the copy and formatting; the\n * logo is a `LogoRef` (an entity guid or a status icon, see `logoFromRef`).\n */\nexport interface InstanceSlotRow {\n amount?: number\n logo?: LogoRef\n primary_text?: string\n secondary_text?: string\n}\n\n/**\n * V2: the slots a block's variant filled, keyed by slot name; ditto owns the names and omits any\n * slot it has no value for (`lib/ditto/blocks/<block>.yml`). Read with `slot()`, which names the\n * kind the caller expects.\n */\nexport interface InstanceSlotData {\n [slot: string]: unknown\n}\n\n/**\n * Reads one slot off a block's `data`; undefined when ditto did not fill it.\n *\n * The caller names the kind, because the slot's kind lives in the block's ditto schema and not\n * here — a block fills slots with whatever its card needs, so no fixed list of kinds would hold\n * (`account_switch_block` alone carries a boolean and `budget_block` a nested object).\n */\nexport const slot = <T = unknown>(\n data: InstanceSlotData | undefined,\n name: string,\n): T | undefined => data?.[name] as T | undefined\n\n/**\n * V2: which block renders this beat's content, and what it renders.\n *\n * `block` is optional: a beat whose template has no ditto config arrives as an empty `{}` and the\n * card renders its copy and CTAs alone, so a reader cannot assume a block is named. One interface\n * with `block` optional rather than a union with `Record<string, never>`, which TypeScript absorbs\n * — that union left `block` reading as required and typed a promise it did not keep.\n *\n * `variant` is optional for the same reason — the empty `{}` carries neither. Every ditto beat\n * file that names a block also names a variant, so a *filled* slot always has one; ditto drops a\n * nil variant rather than sending null, which is why the type is `string | null | undefined`.\n */\nexport interface InstanceSlot {\n block?: BlockType\n variant?: string | null\n /** The slots this block's variant declares in ditto. */\n data?: InstanceSlotData\n // Direct Deposit block (Set Up Direct Deposit, Switch Direct Deposit, Missing\n // Interest Rate): account facts carried flat on the slot, beside `data`.\n /** Primary line on the hero card, e.g. \"Epic Bank Checking, *1234\". */\n account_name?: string\n /** Secondary line beneath the name, e.g. \"Checking Account\" / \"Credit Card\". */\n account_type?: string\n /** Status pill label, e.g. \"Direct Deposit Not Set Up\" / \"Interest Rate: 19.99% APR\". */\n status_text?: string\n institution_guid?: string\n institution_name?: string\n // Shared across multiple V2 component blocks:\n // `amount` — UpcomingBillBlock (projected bill), SavingsOpportunityBlock (coupon),\n // UpcomingSubscriptionBlock (price per cadence).\n // `merchant_guid` / `merchant_name` — UpcomingBillBlock (bill row logo + name),\n // UpcomingSubscriptionBlock (hero logo + name).\n /** Dollar amount (unformatted); the block formats it as currency. */\n amount?: number\n // Withdrawal block (Emergency Fund Withdrawal): one row flat on the slot - `amount` above is the\n // withdrawal, shown with its date line \"{amount_label} {withdrawal_date}\" over the balance row.\n /** Pre-localized lead-in for the date line, e.g. \"Withdrawn on\". */\n amount_label?: string\n /** The withdrawal's calendar day, `YYYY-MM-DD` (e.g. `2026-10-20`); the card formats it. */\n withdrawal_date?: string\n /** Account balance after the withdrawal (unformatted); the card formats it as currency. */\n balance?: number\n /** Pre-localized label for the balance row, e.g. \"Balance\". */\n balance_label?: string\n /** Merchant guid used to render the inline / hero logo via `LogoFromGuid` (`MCH-...`). */\n merchant_guid?: string\n /** Merchant display name — shown as logo alt text and as the merchant/hero label. */\n merchant_name?: string\n // Upcoming Bill block (Projected Bill Payment): the block derives the Sun→Sat week strip\n // around `due_date` at render time.\n /** Due date of the projected bill in ISO form (e.g. `2025-10-30`). */\n due_date?: string\n // Savings Opportunity block (Save An Extra, Potential Savings, Embedded): purely data-driven\n // coupon card. Backend sends the caption and the amount, plus `slot` to toggle the green\n // gradient background when the card is embedded in a parent surface that supplies its own.\n /** Caption shown above the amount, e.g. `Save an extra` or `Potential savings`. */\n label?: string\n /**\n * Whether to render the green gradient slot behind the coupon. Defaults to true. Backend sends\n * `false` when the coupon is embedded in a parent surface that supplies its own background.\n */\n slot?: boolean\n // Upcoming Subscription block: billing cadence for the price pill (`${amount} / ${cadence}`).\n /** Billing cadence word that trails the price, e.g. `month` or `year`. */\n cadence?: string\n // Account block (status on/off-track, deposit, payoff variants): card content carried flat on\n // the slot (the V2 contract drops `instance_slot_data`). `amount`, `label`, `merchant_guid`,\n // `merchant_name`, `institution_guid`, `institution_name` are shared fields declared above.\n /** Secondary line beneath the amount on the standard card, e.g. \"Remaining after expenses\". */\n sub_text?: string\n /** Header bar text (standard card) or the colored category strip label (deposit cards). */\n header_text?: string\n /** Generic-tile icon name used when no merchant/institution logo is available. */\n icon_name?: string\n /** Category guid used to render the deposit-card logo fallback. */\n category_guid?: string\n // Debts block: `amount` is the current balance; the shared account/institution fields above.\n /** Projected payoff date in ISO form (e.g. `2027-03-01`); the block formats it as month + year. */\n payoff_date?: string\n /** Monthly payment toward the debt (unformatted); the block formats it as currency. */\n monthly_payment?: number\n /** Annual interest rate as a percentage (e.g. `19.99`); the block formats it as a percent. */\n interest_rate?: number\n start_date?: string\n no_spend_days?: string[]\n}\n"],"mappings":"AA+TA,IAAa,IAAA,CACX,GACA,MACkB,IAAO,CAAA"}
@@ -22,6 +22,8 @@ interface GeneralInsightsFeedCopy {
22
22
  try_again: string;
23
23
  update: string;
24
24
  updating: string;
25
+ dollar_bill?: string;
26
+ weekly_no_spending_component_alt_text?: DynamicKeyValue;
25
27
  }
26
28
  interface SettingsMenuCopy {
27
29
  close: string;
@@ -1,3 +1,4 @@
1
+ import { formatDate } from '../constants';
1
2
  export declare const getNextWeeklyDate: (date: Date) => Date;
2
3
  export declare const getNextBiWeeklyDate: (date: Date) => Date;
3
4
  export declare const getTwiceMonthlyDates: (day1: number, day2: number) => Date[];
@@ -14,3 +15,4 @@ export declare const endOfUtcDay: (date: Date) => number;
14
15
  export declare const fromUnixToDayOfWeekAndDate: (date: number) => string;
15
16
  export declare const fromUnixUTCToDayOfWeekAndDate: (date: number) => string;
16
17
  export declare const fromTimestampToMonthYear: (timestamp?: number) => string;
18
+ export declare const formatIsoDate: (isoDate: string, dFormat: Parameters<typeof formatDate>[1]) => string;
@@ -1,37 +1,38 @@
1
- import { DATE_FORMATS_INTL as s, formatDate as T } from "../constants/DateFormats.es.js";
1
+ import { DATE_FORMATS_INTL as T, formatDate as g } from "../constants/DateFormats.es.js";
2
2
  import { addMonths as i } from "date-fns/addMonths";
3
3
  import { endOfMonth as h } from "date-fns/endOfMonth";
4
4
  import { isBefore as n } from "date-fns/isBefore";
5
5
  import { startOfToday as a } from "date-fns/startOfToday";
6
- import { addYears as M } from "date-fns/addYears";
7
- import { addQuarters as g } from "date-fns/addQuarters";
6
+ import { addYears as v } from "date-fns/addYears";
7
+ import { addQuarters as s } from "date-fns/addQuarters";
8
8
  import { addWeeks as y } from "date-fns/addWeeks";
9
9
  import { fromUnixTime as x } from "date-fns/fromUnixTime";
10
- import { nextDay as v } from "date-fns/nextDay";
10
+ import { nextDay as M } from "date-fns/nextDay";
11
+ import { parseISO as U } from "date-fns/parseISO";
11
12
  import { setDate as u } from "date-fns/setDate";
12
- import { getDay as U } from "date-fns/getDay";
13
- var B = (t) => {
14
- const e = U(t);
15
- let r = v(t, e);
13
+ import { getDay as p } from "date-fns/getDay";
14
+ var I = (t) => {
15
+ const e = p(t);
16
+ let r = M(t, e);
16
17
  for (; n(r, a()); ) r = y(r, 1);
17
18
  return r;
18
- }, H = (t) => {
19
+ }, Q = (t) => {
19
20
  let e = t;
20
21
  for (; n(e, a()); ) e = y(e, 2);
21
22
  return e;
22
23
  }, c = (t, e) => {
23
- const r = a(), [o, l] = [t, e].sort((m, f) => m - f), D = (m, f) => f >= 28 ? h(m) : u(m, f);
24
+ const r = a(), [o, m] = [t, e].sort((f, l) => f - l), D = (f, l) => l >= 28 ? h(f) : u(f, l);
24
25
  return [
25
26
  D(r, o),
26
- D(r, l),
27
+ D(r, m),
27
28
  D(i(r, 1), o),
28
- D(i(r, 1), l),
29
+ D(i(r, 1), m),
29
30
  D(i(r, 2), o),
30
- D(i(r, 2), l)
31
+ D(i(r, 2), m)
31
32
  ];
32
- }, Q = (t, e) => {
33
+ }, S = (t, e) => {
33
34
  const r = a(), o = c(t, e);
34
- return o.find((l) => !n(l, r)) ?? o[o.length - 1];
35
+ return o.find((m) => !n(m, r)) ?? o[o.length - 1];
35
36
  }, K = (t) => {
36
37
  let e = u(a(), t.getDate());
37
38
  for (; n(e, a()); ) e = i(e, 1);
@@ -40,35 +41,36 @@ var B = (t) => {
40
41
  let e = t;
41
42
  for (; n(e, a()); ) e = i(e, 2);
42
43
  return e;
43
- }, S = (t) => {
44
- let e = g(t, 1);
45
- for (; n(e, a()); ) e = g(e, 1);
44
+ }, L = (t) => {
45
+ let e = s(t, 1);
46
+ for (; n(e, a()); ) e = s(e, 1);
46
47
  return e;
47
- }, I = (t) => {
48
+ }, b = (t) => {
48
49
  let e = t;
49
- for (; n(e, a()); ) e = g(e, 2);
50
+ for (; n(e, a()); ) e = s(e, 2);
50
51
  return e;
51
- }, L = (t) => M(t, 1), p = (t) => {
52
+ }, j = (t) => v(t, 1), O = (t) => {
52
53
  const e = x(t);
53
54
  return new Date(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate());
54
- }, b = (t) => Math.floor(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds()) / 1e3), j = (t) => Date.UTC(t.getFullYear(), t.getMonth(), t.getDate()) / 1e3, q = (t) => Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), 23, 59, 59) / 1e3, z = (t) => T(x(t), s.DAY_OF_WEEK_MONTH_DAY), G = (t) => T(p(t), s.DAY_OF_WEEK_MONTH_DAY), J = (t) => t ? T(x(t), s.MONTH_YEAR) : "";
55
+ }, q = (t) => Math.floor(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds()) / 1e3), z = (t) => Date.UTC(t.getFullYear(), t.getMonth(), t.getDate()) / 1e3, G = (t) => Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), 23, 59, 59) / 1e3, J = (t) => g(x(t), T.DAY_OF_WEEK_MONTH_DAY), P = (t) => g(O(t), T.DAY_OF_WEEK_MONTH_DAY), V = (t) => t ? g(x(t), T.MONTH_YEAR) : "", X = (t, e) => g(U(t), e);
55
56
  export {
56
- q as endOfUtcDay,
57
- J as fromTimestampToMonthYear,
58
- z as fromUnixToDayOfWeekAndDate,
59
- p as fromUnixUTC,
60
- G as fromUnixUTCToDayOfWeekAndDate,
57
+ G as endOfUtcDay,
58
+ X as formatIsoDate,
59
+ V as fromTimestampToMonthYear,
60
+ J as fromUnixToDayOfWeekAndDate,
61
+ O as fromUnixUTC,
62
+ P as fromUnixUTCToDayOfWeekAndDate,
61
63
  R as getNextBiMonthlyDate,
62
- I as getNextBiQuarterlyDate,
63
- H as getNextBiWeeklyDate,
64
+ b as getNextBiQuarterlyDate,
65
+ Q as getNextBiWeeklyDate,
64
66
  K as getNextMonthlyDate,
65
- S as getNextQuarterlyDate,
66
- Q as getNextTwiceMonthlyDate,
67
- B as getNextWeeklyDate,
68
- L as getNextYearlyDate,
67
+ L as getNextQuarterlyDate,
68
+ S as getNextTwiceMonthlyDate,
69
+ I as getNextWeeklyDate,
70
+ j as getNextYearlyDate,
69
71
  c as getTwiceMonthlyDates,
70
- j as startOfUtcDay,
71
- b as toUnixUTC
72
+ z as startOfUtcDay,
73
+ q as toUnixUTC
72
74
  };
73
75
 
74
76
  //# sourceMappingURL=DateUtil.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateUtil.es.js","names":[],"sources":["../../../src/core/utils/DateUtil.ts"],"sourcesContent":["import { addMonths } from 'date-fns/addMonths'\nimport { addQuarters } from 'date-fns/addQuarters'\nimport { addWeeks } from 'date-fns/addWeeks'\nimport { addYears } from 'date-fns/addYears'\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { getDay } from 'date-fns/getDay'\nimport { isBefore } from 'date-fns/isBefore'\nimport { nextDay } from 'date-fns/nextDay'\nimport { setDate } from 'date-fns/setDate'\nimport { startOfToday } from 'date-fns/startOfToday'\nimport { fromUnixTime } from 'date-fns/fromUnixTime'\nimport { type Day } from 'date-fns'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../constants'\n\nexport const getNextWeeklyDate = (date: Date): Date => {\n const dayOfWeek = getDay(date)\n let nextDate = nextDay(date, dayOfWeek as Day)\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addWeeks(nextDate, 1)\n }\n return nextDate\n}\n\nexport const getNextBiWeeklyDate = (date: Date): Date => {\n let nextDate = date\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addWeeks(nextDate, 2)\n }\n return nextDate\n}\n\nexport const getTwiceMonthlyDates = (day1: number, day2: number): Date[] => {\n const today = startOfToday()\n const [firstDay, secondDay] = [day1, day2].sort((a, b) => a - b)\n const makeDateForDay = (month: Date, day: number) =>\n day >= 28 ? endOfMonth(month) : setDate(month, day)\n\n return [\n makeDateForDay(today, firstDay),\n makeDateForDay(today, secondDay),\n makeDateForDay(addMonths(today, 1), firstDay),\n makeDateForDay(addMonths(today, 1), secondDay),\n makeDateForDay(addMonths(today, 2), firstDay),\n makeDateForDay(addMonths(today, 2), secondDay),\n ]\n}\n\nexport const getNextTwiceMonthlyDate = (day1: number, day2: number): Date => {\n const today = startOfToday()\n const candidates = getTwiceMonthlyDates(day1, day2)\n return candidates.find((c) => !isBefore(c, today)) ?? candidates[candidates.length - 1]\n}\n\nexport const getNextMonthlyDate = (date: Date): Date => {\n let nextDate = setDate(startOfToday(), date.getDate())\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addMonths(nextDate, 1)\n }\n return nextDate\n}\n\nexport const getNextBiMonthlyDate = (date: Date): Date => {\n let nextDate = date\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addMonths(nextDate, 2)\n }\n return nextDate\n}\n\nexport const getNextQuarterlyDate = (date: Date): Date => {\n let nextDate = addQuarters(date, 1)\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addQuarters(nextDate, 1)\n }\n return nextDate\n}\n\nexport const getNextBiQuarterlyDate = (date: Date): Date => {\n let nextDate = date\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addQuarters(nextDate, 2)\n }\n return nextDate\n}\n\nexport const getNextYearlyDate = (date: Date): Date => {\n return addYears(date, 1)\n}\n\nexport const fromUnixUTC = (utcTime: number) => {\n const date = fromUnixTime(utcTime)\n return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate())\n}\n\n// Inverse of fromUnixUTC: emits unix seconds for the Date's wall-clock time read\n// at UTC, so a local-midnight boundary serializes to UTC midnight instead of\n// being shifted by the viewer's timezone offset.\nexport const toUnixUTC = (date: Date) =>\n Math.floor(\n Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n ) / 1000,\n )\n\n// Unix-second bounds of the Date's calendar day read as a UTC day. Ignores the\n// wall-clock time, so a DST zone whose local midnight does not exist (startOfDay\n// returns 01:00) still yields the UTC-midnight bound. (MEW-4191)\nexport const startOfUtcDay = (date: Date) =>\n Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) / 1000\n\nexport const endOfUtcDay = (date: Date) =>\n Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59) / 1000\n\nexport const fromUnixToDayOfWeekAndDate = (date: number) =>\n formatDate(fromUnixTime(date), DATE_FORMATS_INTL.DAY_OF_WEEK_MONTH_DAY)\n\n// UTC variant for post dates, which are absolute calendar dates that must not\n// shift across the day boundary when localized.\nexport const fromUnixUTCToDayOfWeekAndDate = (date: number) =>\n formatDate(fromUnixUTC(date), DATE_FORMATS_INTL.DAY_OF_WEEK_MONTH_DAY)\n\nexport const fromTimestampToMonthYear = (timestamp?: number) =>\n timestamp ? formatDate(fromUnixTime(timestamp), DATE_FORMATS_INTL.MONTH_YEAR) : ''\n"],"mappings":"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"}
1
+ {"version":3,"file":"DateUtil.es.js","names":[],"sources":["../../../src/core/utils/DateUtil.ts"],"sourcesContent":["import { addMonths } from 'date-fns/addMonths'\nimport { addQuarters } from 'date-fns/addQuarters'\nimport { addWeeks } from 'date-fns/addWeeks'\nimport { addYears } from 'date-fns/addYears'\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { getDay } from 'date-fns/getDay'\nimport { isBefore } from 'date-fns/isBefore'\nimport { nextDay } from 'date-fns/nextDay'\nimport { setDate } from 'date-fns/setDate'\nimport { startOfToday } from 'date-fns/startOfToday'\nimport { fromUnixTime } from 'date-fns/fromUnixTime'\nimport { parseISO } from 'date-fns/parseISO'\nimport { type Day } from 'date-fns'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../constants'\n\nexport const getNextWeeklyDate = (date: Date): Date => {\n const dayOfWeek = getDay(date)\n let nextDate = nextDay(date, dayOfWeek as Day)\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addWeeks(nextDate, 1)\n }\n return nextDate\n}\n\nexport const getNextBiWeeklyDate = (date: Date): Date => {\n let nextDate = date\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addWeeks(nextDate, 2)\n }\n return nextDate\n}\n\nexport const getTwiceMonthlyDates = (day1: number, day2: number): Date[] => {\n const today = startOfToday()\n const [firstDay, secondDay] = [day1, day2].sort((a, b) => a - b)\n const makeDateForDay = (month: Date, day: number) =>\n day >= 28 ? endOfMonth(month) : setDate(month, day)\n\n return [\n makeDateForDay(today, firstDay),\n makeDateForDay(today, secondDay),\n makeDateForDay(addMonths(today, 1), firstDay),\n makeDateForDay(addMonths(today, 1), secondDay),\n makeDateForDay(addMonths(today, 2), firstDay),\n makeDateForDay(addMonths(today, 2), secondDay),\n ]\n}\n\nexport const getNextTwiceMonthlyDate = (day1: number, day2: number): Date => {\n const today = startOfToday()\n const candidates = getTwiceMonthlyDates(day1, day2)\n return candidates.find((c) => !isBefore(c, today)) ?? candidates[candidates.length - 1]\n}\n\nexport const getNextMonthlyDate = (date: Date): Date => {\n let nextDate = setDate(startOfToday(), date.getDate())\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addMonths(nextDate, 1)\n }\n return nextDate\n}\n\nexport const getNextBiMonthlyDate = (date: Date): Date => {\n let nextDate = date\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addMonths(nextDate, 2)\n }\n return nextDate\n}\n\nexport const getNextQuarterlyDate = (date: Date): Date => {\n let nextDate = addQuarters(date, 1)\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addQuarters(nextDate, 1)\n }\n return nextDate\n}\n\nexport const getNextBiQuarterlyDate = (date: Date): Date => {\n let nextDate = date\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addQuarters(nextDate, 2)\n }\n return nextDate\n}\n\nexport const getNextYearlyDate = (date: Date): Date => {\n return addYears(date, 1)\n}\n\nexport const fromUnixUTC = (utcTime: number) => {\n const date = fromUnixTime(utcTime)\n return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate())\n}\n\n// Inverse of fromUnixUTC: emits unix seconds for the Date's wall-clock time read\n// at UTC, so a local-midnight boundary serializes to UTC midnight instead of\n// being shifted by the viewer's timezone offset.\nexport const toUnixUTC = (date: Date) =>\n Math.floor(\n Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n ) / 1000,\n )\n\n// Unix-second bounds of the Date's calendar day read as a UTC day. Ignores the\n// wall-clock time, so a DST zone whose local midnight does not exist (startOfDay\n// returns 01:00) still yields the UTC-midnight bound. (MEW-4191)\nexport const startOfUtcDay = (date: Date) =>\n Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) / 1000\n\nexport const endOfUtcDay = (date: Date) =>\n Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59) / 1000\n\nexport const fromUnixToDayOfWeekAndDate = (date: number) =>\n formatDate(fromUnixTime(date), DATE_FORMATS_INTL.DAY_OF_WEEK_MONTH_DAY)\n\n// UTC variant for post dates, which are absolute calendar dates that must not\n// shift across the day boundary when localized.\nexport const fromUnixUTCToDayOfWeekAndDate = (date: number) =>\n formatDate(fromUnixUTC(date), DATE_FORMATS_INTL.DAY_OF_WEEK_MONTH_DAY)\n\nexport const fromTimestampToMonthYear = (timestamp?: number) =>\n timestamp ? formatDate(fromUnixTime(timestamp), DATE_FORMATS_INTL.MONTH_YEAR) : ''\n\n// Use parseISO, not new Date(): new Date(\"2026-10-01\") is UTC midnight, which is still Sept 30\n// in US time zones, so October would be labeled September.\nexport const formatIsoDate = (isoDate: string, dFormat: Parameters<typeof formatDate>[1]) =>\n formatDate(parseISO(isoDate), dFormat)\n"],"mappings":"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"}