@mx-cartographer/experiences 9.7.134 → 9.7.136

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.
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionHistoryBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.tsx"],"sourcesContent":["import { useLayoutEffect, useState } from 'react'\n\nimport { useTheme } from '@mui/material/styles'\nimport { observer } from 'mobx-react-lite'\n\nimport type { Beat, DataSeries, Transaction } from '../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { ANALYTICS_EVENTS_CONFIG, useAnalyticsEvent } from '../../analytics'\nimport { BarChartV2 } from '../../components/chartblocks/BarchartV2'\nimport { DoubleBarChart } from '../../components/chartblocks/DoubleBarChart'\nimport { EmptyBarChart } from '../../components/chartblocks/EmptyBarChart'\nimport { BAR_ARIA_LABEL } from '../../blocks/ChartBlocks/BarchartBlock/utils'\nimport {\n COMPARISON_BAR_ARIA_LABEL,\n toLegendItems,\n} from '../../blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils'\n\nimport { TransactionDrillDown } from './TransactionDrillDown'\nimport { useTransactionHistory } from './useTransactionHistory'\nimport {\n getDefaultSelection,\n getDrillDownConfig,\n getFlattenedDataSeries,\n resolveDrillDownSubHeader,\n splitProjectedTransaction,\n toStoreFilter,\n} from './utils'\nimport {\n Drawer,\n useInsightsV2Store,\n useGlobalCopyStore,\n useGlobalUiStore,\n Loader,\n} from '../../../common'\nimport { TransactionDetailsBlock } from '../TransactionDetailsBlock'\nimport { getDynamicCtaBasedOnTriggers } from '../util'\n\ninterface TransactionHistoryProp {\n beat: Beat\n}\n\nexport const TransactionHistoryBlock = observer(({ beat }: TransactionHistoryProp) => {\n const theme = useTheme()\n\n const { actionDrawer, setActionContext } = useInsightsV2Store()\n\n const { insights_payload } = beat\n\n // The CTA that opened the drawer: its variant picks the view, and its drilldown_data feeds a\n // variant that reads its facts from the opener (Monthly Debt to Income). Only drilldown_data is passed\n // on: it is the payload's own object, stable across renders, while the opener may be rebuilt per call.\n const openedCta = getDynamicCtaBasedOnTriggers(\n actionDrawer,\n insights_payload?.primary_cta,\n insights_payload?.secondary_cta,\n insights_payload?.in_description_cta,\n )\n const dynamicCtaVariant = openedCta?.variant\n\n const {\n top,\n filterMode,\n header,\n colors,\n filterStrategy,\n tipSection,\n subTabAriaLabels,\n slotData,\n beatTransactions: resolveBeatTransactions,\n hideListHeader,\n tipAboveSubTabs,\n averageFormat,\n subTabs,\n } = getDrillDownConfig(dynamicCtaVariant ?? '')\n\n const {\n instanceSlotData,\n beatTransactions,\n spendCategoryGuids,\n allAccountGuids,\n categoryName,\n displayedDateRange,\n transactionStore,\n } = useTransactionHistory(\n beat,\n { slotData, beatTransactions: resolveBeatTransactions },\n openedCta?.drilldown_data,\n )\n\n const { common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n\n const { isCopyLoaded } = useGlobalUiStore()\n\n const [isTransactionDetailsOpen, setIsTransactionDetailsOpen] = useState(false)\n\n const [closeTipSection, setCloseTipSection] = useState(false)\n\n const fireAnalyticsEvent = useAnalyticsEvent()\n\n // `getFlattenedDataSeries` runs ahead of the copy-loaded guard below, hence the literal fallback.\n const { dataSeries, chartData, comparisonBars } = getFlattenedDataSeries({\n data: instanceSlotData?.data_series as DataSeries,\n ariaLabel:\n top === 'doubleBar'\n ? (insightsCopy?.general?.in_month_you_had_a_category_of_amount ??\n COMPARISON_BAR_ARIA_LABEL)\n : BAR_ARIA_LABEL,\n top,\n beatTransactions,\n })\n\n const isDoubleBar = top === 'doubleBar'\n const isTabsOnly = top === 'tabsOnly'\n // The drawer's columns (and tabs): the double bar's month pairs, or the single bar's bars.\n const bars = isDoubleBar ? comparisonBars : chartData\n\n const { chartBarIndex, subTabIndex } = getDefaultSelection({\n chartTabCount: chartData.length,\n comparisonTabCount: comparisonBars.length,\n actionDrawer,\n beatGuid: beat.guid,\n })\n\n const [selectedIndex, setSelectedIndex] = useState(chartBarIndex)\n // The double-bar drawer's series tab (0 = main, e.g. Spend; 1 = comparison, e.g. Income).\n const [subIndex, setSubIndex] = useState(subTabIndex)\n\n // Bars built from the transaction store (Upcoming Bill's paid bills) can arrive after the drawer\n // opens: re-select the default when the bar count changes. Payload-built bars never change count.\n const [defaultedTabCount, setDefaultedTabCount] = useState(bars.length)\n if (bars.length !== defaultedTabCount) {\n setDefaultedTabCount(bars.length)\n setSelectedIndex(chartBarIndex)\n }\n\n const resolveFilter = (index: number) =>\n filterStrategy({\n beat,\n beatTransactions,\n dataSeries,\n comparisonBars,\n selectedIndex: index,\n subIndex,\n isLastTab: index === bars.length - 1,\n instanceSlotData,\n spendCategoryGuids,\n displayedDateRange,\n })\n\n // Content keys for the effect deps: these arrays get a new identity every render (MEW-3732).\n const beatTransactionGuidsKey = beatTransactions.map((transaction) => transaction.guid).join(',')\n const spendCategoryGuidsKey = spendCategoryGuids.join(',')\n const allAccountGuidsKey = allAccountGuids.join(',')\n\n // Re-applied on selection change and when the nested details drawer closes: AddMerchantBudgetAction\n // overwrites transactionStore.filter and never restores it. Chartless tops filter with no bars.\n const canApplyFilter =\n top === 'list' || top === 'tabsOnly' || top === 'monthTabs' || dataSeries.length > 0\n const applyCurrentSelectionFilter = () => {\n if (filterMode !== 'store') return\n // A chart drawer with no bars can name no rows: fail closed rather than keep the store's default\n // (every account) or a previous drawer's filter.\n const filter = canApplyFilter\n ? resolveFilter(selectedIndex)\n : { accounts: [], custom: () => false }\n transactionStore.setFilter(toStoreFilter(filter, { allAccountGuids, displayedDateRange }))\n }\n\n // store variants route the selection through the shared store filter; local (upcomingBill) variants\n // filter beatTransactions directly, so there's nothing to push to the store for them.\n useLayoutEffect(() => {\n applyCurrentSelectionFilter()\n }, [\n beat.guid,\n selectedIndex,\n subIndex,\n filterMode,\n dataSeries.length,\n instanceSlotData,\n displayedDateRange,\n spendCategoryGuidsKey,\n allAccountGuidsKey,\n beatTransactionGuidsKey,\n top,\n ])\n\n const subHeader = resolveDrillDownSubHeader(insights_payload)\n\n const headerContent = header?.({\n title: insights_payload?.title,\n subHeader,\n categoryName,\n selectedDate: chartData[selectedIndex]?.date ?? undefined,\n })\n\n const barColors = colors(theme, instanceSlotData?.category_guid)\n\n if (!isCopyLoaded) return <Loader />\n\n // `legends` is the block's additional_data ([0] main, [1] second series), as BarchartBlock reads it.\n const [mainLegend, comparisonLegend] = instanceSlotData?.legends ?? []\n\n const transactionFilter =\n filterMode === 'local'\n ? (index: number) => resolveFilter(index).custom ?? (() => true)\n : undefined\n\n // Upcoming Bill appends a synthesized projected bill: it draws the last bar and its own labelled\n // row, but is never a plain list row or a CSV line.\n const { transactions: listTransactions, projectedTransaction } =\n splitProjectedTransaction(beatTransactions)\n\n const baseTransactions: Transaction[] | undefined =\n filterMode === 'local' ? listTransactions : undefined\n\n const projectedHeading = insightsCopy.general.projected_amount\n const projectedRow =\n projectedTransaction &&\n projectedHeading &&\n resolveFilter(selectedIndex).custom?.(projectedTransaction)\n ? { heading: projectedHeading, transaction: projectedTransaction }\n : undefined\n\n // A chart bar click selects its column (and, on the double bar, its series); a month tab change\n // selects the month. MUI Tabs only fires onChange on real user selection, not on mount. The\n // series (Spend / Income) tab fires its own analytics via the shared SubTabs component.\n const selectBar = (index: number, seriesIndex?: number) => {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.DRAWER_CHART_BAR_CLICKED)\n setSelectedIndex(index)\n if (seriesIndex !== undefined) setSubIndex(seriesIndex)\n }\n const selectMonth = (index: number) => {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.TAB_SELECTED)\n setSelectedIndex(index)\n }\n\n // Double bar: the Spend / Income labels come from copy (additional_data); the legend carries the\n // selected month's two totals, and its labels name the series tabs.\n const doubleBarLegends = isDoubleBar\n ? toLegendItems([\n { ...mainLegend, value: comparisonBars[selectedIndex]?.main },\n { ...comparisonLegend, value: comparisonBars[selectedIndex]?.comparison },\n ])\n : undefined\n\n // Legacy pulse named these tabs \"Spend transactions\" / \"Income transactions\" for screen readers.\n const seriesAriaLabels = subTabAriaLabels?.(insightsCopy) ?? []\n\n // The second tab row: the double bar's series, a tabs-only drawer's sides, or the variant's `subTabs`.\n const sideTabs = isDoubleBar\n ? (doubleBarLegends ?? []).map((legend, index) => ({\n label: legend.label,\n ariaLabel: seriesAriaLabels[index],\n }))\n : isTabsOnly\n ? dataSeries.flatMap((row) => (row.localized_label ? [{ label: row.localized_label }] : []))\n : (subTabs?.({ instanceSlotData, copy: insightsCopy }).map((label) => ({ label })) ?? [])\n\n const renderChart = () => {\n if (!bars.length) return <EmptyBarChart />\n\n return isDoubleBar ? (\n <DoubleBarChart\n bars={comparisonBars}\n colors={barColors}\n legendPosition=\"top\"\n legends={doubleBarLegends}\n onBarClick={selectBar}\n selectedIndex={selectedIndex}\n />\n ) : (\n <BarChartV2\n amounts={{\n average: instanceSlotData?.average_amount,\n formattedAverage: formatCurrency(\n instanceSlotData?.average_amount ?? 0,\n averageFormat ?? CURRENCY_FORMAT.cents,\n ),\n }}\n color={barColors[0] ?? theme.palette.primary.main}\n data={chartData}\n legendPosition=\"top\"\n // Figma's chart drawer: 172px of bars under the 24px legend, 200px in all.\n heightOverride={172}\n margin={{\n bottom: 8,\n top: 24,\n left: 24,\n right: 24,\n }}\n // TODO: Temporary fallback while the backend doesn't always send `legends` on every\n // beat/variant. Remove this once the backend guarantees `legends` on the payload.\n monthlyAmountLabel={mainLegend?.label ?? insightsCopy.general.monthly_amount}\n onBarClick={selectBar}\n selectedTabIndex={selectedIndex}\n trendAmountLabel={comparisonLegend?.label ?? insightsCopy.general.trend}\n />\n )\n }\n\n // `list` (Low Account Balance), `tabsOnly` (Non-Essential Category Summary) and `monthTabs`\n // (Monthly Subscription Aggregate) drawers have no chart above their transaction list.\n const chartTop =\n isDoubleBar || top === 'singleBar' || top === 'upcomingBill' ? renderChart() : null\n\n return (\n <>\n <TransactionDrillDown\n baseTransactions={baseTransactions}\n hideListHeader={hideListHeader}\n tipAboveSubTabs={tipAboveSubTabs}\n projectedRow={projectedRow}\n heading={headerContent?.heading}\n icon={headerContent?.icon}\n onSelectionChange={selectMonth}\n selectedIndex={selectedIndex}\n subHeadingText={headerContent?.subHeadingText}\n tabs={bars}\n top={chartTop}\n {...(sideTabs.length > 0 && {\n subTabs: { tabs: sideTabs, selectedIndex: subIndex, onChange: setSubIndex },\n })}\n {...(tipSection && {\n tipSection:\n !closeTipSection &&\n (tipSection(setCloseTipSection, insightsCopy, subHeader?.text, instanceSlotData) ??\n false),\n })}\n transactionFilter={transactionFilter}\n onEachRowClick={(guid) => {\n setActionContext({ transaction_guid: guid })\n setIsTransactionDetailsOpen(true)\n }}\n />\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isTransactionDetailsOpen}\n onClose={() => {\n setIsTransactionDetailsOpen(false)\n // Clear only the key this nested drawer owns — setActionContext merges, so an\n // explicit `{}` would be a no-op and leave transaction_guid stuck in the shared\n // context, and the outer drawer's own context (e.g. chartBarIndex) must survive.\n setActionContext({ transaction_guid: undefined })\n // Re-apply this block's own filter: a further-nested AddMerchantBudgetAction drawer may\n // have overwritten transactionStore.filter (merchant_guid-only) without restoring it.\n applyCurrentSelectionFilter()\n }}\n title={insightsCopy.general.transaction_details_title}\n >\n <TransactionDetailsBlock beat={beat} />\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyCA,IAAa,KAA0B,GAAA,CAAU,EAAE,MAAA,EAAA,MAAmC;AACpF,QAAM,IAAQ,GAAS,GAEjB,EAAE,cAAA,GAAc,kBAAA,EAAA,IAAqB,GAAmB,GAExD,EAAE,kBAAA,EAAA,IAAqB,GAKvB,IAAY,GAChB,GACA,GAAkB,aAClB,GAAkB,eAClB,GAAkB,kBACpB,GACM,IAAoB,GAAW,SAE/B,EACJ,KAAA,GACA,YAAA,GACA,QAAA,GACA,QAAA,GACA,gBAAA,GACA,YA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AA,GACD,gBAAA,EAAC,IAAD;AAAA,IACE,gBAAgB,GAAW;AAAA,IAC3B,QAAQ;AAAA,IACR,SAAA,MAAe;AACb,MAAA,EAA4B,EAAK,GAIjC,EAAiB,EAAE,kBAAkB,OAAU,CAAC,GAGhD,EAA4B;AAAA,IAC9B;AAAA,IACA,OAAO,EAAa,QAAQ;AAAA,IAE5B,UAAA,gBAAA,EAAC,IAAD,EAA+B,MAAA,EAAO,CAAA;AAAA,EAChC,CAAA,CACR,EAAA,CAAA;AAEN,CAAC"}
1
+ {"version":3,"file":"TransactionHistoryBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.tsx"],"sourcesContent":["import { useLayoutEffect, useState } from 'react'\n\nimport { useTheme } from '@mui/material/styles'\nimport { observer } from 'mobx-react-lite'\n\nimport type { Beat, DataSeries, Transaction } from '../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { ANALYTICS_EVENTS_CONFIG, useAnalyticsEvent } from '../../analytics'\nimport { BarChartV2 } from '../../components/chartblocks/BarchartV2'\nimport { DoubleBarChart } from '../../components/chartblocks/DoubleBarChart'\nimport { EmptyBarChart } from '../../components/chartblocks/EmptyBarChart'\nimport { BAR_ARIA_LABEL } from '../../blocks/ChartBlocks/BarchartBlock/utils'\nimport {\n COMPARISON_BAR_ARIA_LABEL,\n toLegendItems,\n} from '../../blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils'\n\nimport { TransactionDrillDown } from './TransactionDrillDown'\nimport { useTransactionHistory } from './useTransactionHistory'\nimport {\n getDefaultSelection,\n getDrillDownConfig,\n getFlattenedDataSeries,\n resolveDrillDownSubHeader,\n splitProjectedTransaction,\n toStoreFilter,\n} from './utils'\nimport {\n Drawer,\n useInsightsV2Store,\n useGlobalCopyStore,\n useGlobalUiStore,\n Loader,\n} from '../../../common'\nimport { TransactionDetailsBlock } from '../TransactionDetailsBlock'\nimport { getDynamicCtaBasedOnTriggers } from '../util'\n\ninterface TransactionHistoryProp {\n beat: Beat\n}\n\nexport const TransactionHistoryBlock = observer(({ beat }: TransactionHistoryProp) => {\n const theme = useTheme()\n\n const { actionDrawer, setActionContext } = useInsightsV2Store()\n\n const { insights_payload } = beat\n\n // The CTA that opened the drawer: its variant picks the view, and its drilldown_data feeds a\n // variant that reads its facts from the opener (Monthly Debt to Income). Only drilldown_data is passed\n // on: it is the payload's own object, stable across renders, while the opener may be rebuilt per call.\n const openedCta = getDynamicCtaBasedOnTriggers(\n actionDrawer,\n insights_payload?.primary_cta,\n insights_payload?.secondary_cta,\n insights_payload?.in_description_cta,\n )\n const dynamicCtaVariant = openedCta?.variant\n\n const {\n top,\n filterMode,\n header,\n colors,\n filterStrategy,\n tipSection,\n subTabAriaLabels,\n slotData,\n beatTransactions: resolveBeatTransactions,\n hideListHeader,\n averageFormat,\n subTabs,\n } = getDrillDownConfig(dynamicCtaVariant ?? '')\n\n const {\n instanceSlotData,\n beatTransactions,\n spendCategoryGuids,\n allAccountGuids,\n categoryName,\n displayedDateRange,\n transactionStore,\n } = useTransactionHistory(\n beat,\n { slotData, beatTransactions: resolveBeatTransactions },\n openedCta?.drilldown_data,\n )\n\n const { common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n\n const { isCopyLoaded } = useGlobalUiStore()\n\n const [isTransactionDetailsOpen, setIsTransactionDetailsOpen] = useState(false)\n\n const [closeTipSection, setCloseTipSection] = useState(false)\n\n const fireAnalyticsEvent = useAnalyticsEvent()\n\n // `getFlattenedDataSeries` runs ahead of the copy-loaded guard below, hence the literal fallback.\n const { dataSeries, chartData, comparisonBars } = getFlattenedDataSeries({\n data: instanceSlotData?.data_series as DataSeries,\n ariaLabel:\n top === 'doubleBar'\n ? (insightsCopy?.general?.in_month_you_had_a_category_of_amount ??\n COMPARISON_BAR_ARIA_LABEL)\n : BAR_ARIA_LABEL,\n top,\n beatTransactions,\n })\n\n const isDoubleBar = top === 'doubleBar'\n const isTabsOnly = top === 'tabsOnly'\n // The drawer's columns (and tabs): the double bar's month pairs, or the single bar's bars.\n const bars = isDoubleBar ? comparisonBars : chartData\n\n const { chartBarIndex, subTabIndex } = getDefaultSelection({\n chartTabCount: chartData.length,\n comparisonTabCount: comparisonBars.length,\n actionDrawer,\n beatGuid: beat.guid,\n })\n\n const [selectedIndex, setSelectedIndex] = useState(chartBarIndex)\n // The double-bar drawer's series tab (0 = main, e.g. Spend; 1 = comparison, e.g. Income).\n const [subIndex, setSubIndex] = useState(subTabIndex)\n\n // Bars built from the transaction store (Upcoming Bill's paid bills) can arrive after the drawer\n // opens: re-select the default when the bar count changes. Payload-built bars never change count.\n const [defaultedTabCount, setDefaultedTabCount] = useState(bars.length)\n if (bars.length !== defaultedTabCount) {\n setDefaultedTabCount(bars.length)\n setSelectedIndex(chartBarIndex)\n }\n\n const resolveFilter = (index: number) =>\n filterStrategy({\n beat,\n beatTransactions,\n dataSeries,\n comparisonBars,\n selectedIndex: index,\n subIndex,\n isLastTab: index === bars.length - 1,\n instanceSlotData,\n spendCategoryGuids,\n displayedDateRange,\n })\n\n // Content keys for the effect deps: these arrays get a new identity every render (MEW-3732).\n const beatTransactionGuidsKey = beatTransactions.map((transaction) => transaction.guid).join(',')\n const spendCategoryGuidsKey = spendCategoryGuids.join(',')\n const allAccountGuidsKey = allAccountGuids.join(',')\n\n // Re-applied on selection change and when the nested details drawer closes: AddMerchantBudgetAction\n // overwrites transactionStore.filter and never restores it. Chartless tops filter with no bars.\n const canApplyFilter =\n top === 'list' || top === 'tabsOnly' || top === 'monthTabs' || dataSeries.length > 0\n const applyCurrentSelectionFilter = () => {\n if (filterMode !== 'store') return\n // A chart drawer with no bars can name no rows: fail closed rather than keep the store's default\n // (every account) or a previous drawer's filter.\n const filter = canApplyFilter\n ? resolveFilter(selectedIndex)\n : { accounts: [], custom: () => false }\n transactionStore.setFilter(toStoreFilter(filter, { allAccountGuids, displayedDateRange }))\n }\n\n // store variants route the selection through the shared store filter; local (upcomingBill) variants\n // filter beatTransactions directly, so there's nothing to push to the store for them.\n useLayoutEffect(() => {\n applyCurrentSelectionFilter()\n }, [\n beat.guid,\n selectedIndex,\n subIndex,\n filterMode,\n dataSeries.length,\n instanceSlotData,\n displayedDateRange,\n spendCategoryGuidsKey,\n allAccountGuidsKey,\n beatTransactionGuidsKey,\n top,\n ])\n\n const subHeader = resolveDrillDownSubHeader(insights_payload)\n\n const headerContent = header?.({\n title: insights_payload?.title,\n subHeader,\n categoryName,\n selectedDate: chartData[selectedIndex]?.date ?? undefined,\n })\n\n const barColors = colors(theme, instanceSlotData?.category_guid)\n\n if (!isCopyLoaded) return <Loader />\n\n // `legends` is the block's additional_data ([0] main, [1] second series), as BarchartBlock reads it.\n const [mainLegend, comparisonLegend] = instanceSlotData?.legends ?? []\n\n const transactionFilter =\n filterMode === 'local'\n ? (index: number) => resolveFilter(index).custom ?? (() => true)\n : undefined\n\n // Upcoming Bill appends a synthesized projected bill: it draws the last bar and its own labelled\n // row, but is never a plain list row or a CSV line.\n const { transactions: listTransactions, projectedTransaction } =\n splitProjectedTransaction(beatTransactions)\n\n const baseTransactions: Transaction[] | undefined =\n filterMode === 'local' ? listTransactions : undefined\n\n const projectedHeading = insightsCopy.general.projected_amount\n const projectedRow =\n projectedTransaction &&\n projectedHeading &&\n resolveFilter(selectedIndex).custom?.(projectedTransaction)\n ? { heading: projectedHeading, transaction: projectedTransaction }\n : undefined\n\n // A chart bar click selects its column (and, on the double bar, its series); a month tab change\n // selects the month. MUI Tabs only fires onChange on real user selection, not on mount. The\n // series (Spend / Income) tab fires its own analytics via the shared SubTabs component.\n const selectBar = (index: number, seriesIndex?: number) => {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.DRAWER_CHART_BAR_CLICKED)\n setSelectedIndex(index)\n if (seriesIndex !== undefined) setSubIndex(seriesIndex)\n }\n const selectMonth = (index: number) => {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.TAB_SELECTED)\n setSelectedIndex(index)\n }\n\n // Double bar: the Spend / Income labels come from copy (additional_data); the legend carries the\n // selected month's two totals, and its labels name the series tabs.\n const doubleBarLegends = isDoubleBar\n ? toLegendItems([\n { ...mainLegend, value: comparisonBars[selectedIndex]?.main },\n { ...comparisonLegend, value: comparisonBars[selectedIndex]?.comparison },\n ])\n : undefined\n\n // Legacy pulse named these tabs \"Spend transactions\" / \"Income transactions\" for screen readers.\n const seriesAriaLabels = subTabAriaLabels?.(insightsCopy) ?? []\n\n // The second tab row: the double bar's series, a tabs-only drawer's sides, or the variant's `subTabs`.\n const sideTabs = isDoubleBar\n ? (doubleBarLegends ?? []).map((legend, index) => ({\n label: legend.label,\n ariaLabel: seriesAriaLabels[index],\n }))\n : isTabsOnly\n ? dataSeries.flatMap((row) => (row.localized_label ? [{ label: row.localized_label }] : []))\n : (subTabs?.({ instanceSlotData, copy: insightsCopy }).map((label) => ({ label })) ?? [])\n\n const renderChart = () => {\n if (!bars.length) return <EmptyBarChart />\n\n return isDoubleBar ? (\n <DoubleBarChart\n bars={comparisonBars}\n colors={barColors}\n legendPosition=\"top\"\n legends={doubleBarLegends}\n onBarClick={selectBar}\n selectedIndex={selectedIndex}\n />\n ) : (\n <BarChartV2\n amounts={{\n average: instanceSlotData?.average_amount,\n formattedAverage: formatCurrency(\n instanceSlotData?.average_amount ?? 0,\n averageFormat ?? CURRENCY_FORMAT.cents,\n ),\n }}\n color={barColors[0] ?? theme.palette.primary.main}\n data={chartData}\n legendPosition=\"top\"\n // Figma's chart drawer: 172px of bars under the 24px legend, 200px in all.\n heightOverride={172}\n margin={{\n bottom: 8,\n top: 24,\n left: 24,\n right: 24,\n }}\n // TODO: Temporary fallback while the backend doesn't always send `legends` on every\n // beat/variant. Remove this once the backend guarantees `legends` on the payload.\n monthlyAmountLabel={mainLegend?.label ?? insightsCopy.general.monthly_amount}\n onBarClick={selectBar}\n selectedTabIndex={selectedIndex}\n trendAmountLabel={comparisonLegend?.label ?? insightsCopy.general.trend}\n />\n )\n }\n\n // `list` (Low Account Balance), `tabsOnly` (Non-Essential Category Summary) and `monthTabs`\n // (Monthly Subscription Aggregate) drawers have no chart above their transaction list.\n const chartTop =\n isDoubleBar || top === 'singleBar' || top === 'upcomingBill' ? renderChart() : null\n\n return (\n <>\n <TransactionDrillDown\n baseTransactions={baseTransactions}\n hideListHeader={hideListHeader}\n projectedRow={projectedRow}\n heading={headerContent?.heading}\n icon={headerContent?.icon}\n onSelectionChange={selectMonth}\n selectedIndex={selectedIndex}\n subHeadingText={headerContent?.subHeadingText}\n tabs={bars}\n top={chartTop}\n {...(sideTabs.length > 0 && {\n subTabs: { tabs: sideTabs, selectedIndex: subIndex, onChange: setSubIndex },\n })}\n {...(tipSection && {\n tipSection:\n !closeTipSection &&\n (tipSection(setCloseTipSection, insightsCopy, subHeader?.text, instanceSlotData) ??\n false),\n })}\n transactionFilter={transactionFilter}\n onEachRowClick={(guid) => {\n setActionContext({ transaction_guid: guid })\n setIsTransactionDetailsOpen(true)\n }}\n />\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isTransactionDetailsOpen}\n onClose={() => {\n setIsTransactionDetailsOpen(false)\n // Clear only the key this nested drawer owns — setActionContext merges, so an\n // explicit `{}` would be a no-op and leave transaction_guid stuck in the shared\n // context, and the outer drawer's own context (e.g. chartBarIndex) must survive.\n setActionContext({ transaction_guid: undefined })\n // Re-apply this block's own filter: a further-nested AddMerchantBudgetAction drawer may\n // have overwritten transactionStore.filter (merchant_guid-only) without restoring it.\n applyCurrentSelectionFilter()\n }}\n title={insightsCopy.general.transaction_details_title}\n >\n <TransactionDetailsBlock beat={beat} />\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyCA,IAAa,KAA0B,GAAA,CAAU,EAAE,MAAA,EAAA,MAAmC;AACpF,QAAM,IAAQ,GAAS,GAEjB,EAAE,cAAA,GAAc,kBAAA,EAAA,IAAqB,GAAmB,GAExD,EAAE,kBAAA,EAAA,IA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AAA;AAAA,IACnB,gBAAA,CAAiB,MAAS;AACxB,MAAA,EAAiB,EAAE,kBAAkB,EAAK,CAAC,GAC3C,EAA4B,EAAI;AAAA,IAClC;AAAA,EACD,CAAA,GACD,gBAAA,EAAC,IAAD;AAAA,IACE,gBAAgB,GAAW;AAAA,IAC3B,QAAQ;AAAA,IACR,SAAA,MAAe;AACb,MAAA,EAA4B,EAAK,GAIjC,EAAiB,EAAE,kBAAkB,OAAU,CAAC,GAGhD,EAA4B;AAAA,IAC9B;AAAA,IACA,OAAO,EAAa,QAAQ;AAAA,IAE5B,UAAA,gBAAA,EAAC,IAAD,EAA+B,MAAA,EAAO,CAAA;AAAA,EAChC,CAAA,CACR,EAAA,CAAA;AAEN,CAAC"}
@@ -25,7 +25,7 @@ export declare const DRILLDOWN_VARIANTS: {
25
25
  readonly ACCOUNT_BALANCE: "account_balance";
26
26
  readonly UPCOMING_BILL: "upcoming_bill";
27
27
  readonly SPEND_TO_INCOME: "monthly_spend_to_income";
28
- readonly SAVINGS_TO_INCOME: "monthly_savings_to_income";
28
+ readonly SAVINGS_TO_INCOME: "savings_to_income";
29
29
  readonly DEBT_TO_INCOME: "debt_to_income";
30
30
  readonly COST_OF_LIVING: "cost_living_to_income";
31
31
  readonly NON_ESSENTIAL_CATEGORY: "non_essential_category_summary";
@@ -76,7 +76,6 @@ export interface DrillDownVariantConfig {
76
76
  filterMode: 'store' | 'local';
77
77
  subTabAriaLabels?: (copy: InsightsFeedCopy) => (string | undefined)[];
78
78
  hideListHeader?: boolean;
79
- tipAboveSubTabs?: boolean;
80
79
  averageFormat?: CurrencyFormat;
81
80
  }
82
81
  export declare const resolveUpcomingBillSlotData: SlotDataResolver;
@@ -1,169 +1,179 @@
1
- import { buildDynamicCopy as h } from "../../../core/utils/Localization.es.js";
2
- import { DATE_FORMATS_INTL as D, formatDate as E } from "../../../core/constants/DateFormats.es.js";
3
- import { TransactionStatus as U } from "../../../core/types/Transaction.es.js";
4
- import { fromUnixUTC as A } from "../../../core/utils/DateUtil.es.js";
5
- import { CURRENCY_FORMAT as P } from "../../../core/utils/NumberFormatting.es.js";
6
- import { getCategoryColor as w } from "../../../core/utils/CategoryUtil.es.js";
7
- import { buildDataSeries as M } from "../../blocks/ChartBlocks/BarchartBlock/utils.es.js";
8
- import { asGuidList as N, asNonEmptyText as b, asNumber as u } from "../../blocks/slotReaders.es.js";
9
- import { getLayoutConfig as I } from "../../blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js";
10
- import Y from "../../components/LogoMark.es.js";
11
- import { buildProjectedBillTransaction as F, calendarDateOf as H } from "./utils.es.js";
12
- import { Icon as x } from "@mxenabled/mx-icons";
1
+ import { buildDynamicCopy as S } from "../../../core/utils/Localization.es.js";
2
+ import { DATE_FORMATS_INTL as M, formatDate as C } from "../../../core/constants/DateFormats.es.js";
3
+ import { TransactionStatus as P } from "../../../core/types/Transaction.es.js";
4
+ import { fromUnixUTC as D } from "../../../core/utils/DateUtil.es.js";
5
+ import { CURRENCY_FORMAT as Y } from "../../../core/utils/NumberFormatting.es.js";
6
+ import { getCategoryColor as F } from "../../../core/utils/CategoryUtil.es.js";
7
+ import { buildDataSeries as E } from "../../blocks/ChartBlocks/BarchartBlock/utils.es.js";
8
+ import { asGuidList as O, asNonEmptyText as v, asNumber as p } from "../../blocks/slotReaders.es.js";
9
+ import { getLayoutConfig as T } from "../../blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js";
10
+ import H from "../../components/LogoMark.es.js";
11
+ import { buildProjectedBillTransaction as x, calendarDateOf as k, toDrillDownSlotData as V } from "./utils.es.js";
12
+ import { Icon as W } from "@mxenabled/mx-icons";
13
13
  import { jsx as c } from "react/jsx-runtime";
14
- import { endOfMonth as C, fromUnixTime as V, isValid as L, parseISO as p, startOfMonth as B } from "date-fns";
15
- var i = {
14
+ import { endOfMonth as L, fromUnixTime as j, isValid as B, parseISO as f, startOfMonth as G } from "date-fns";
15
+ var n = {
16
16
  TRANSACTION: "not_standard_amount",
17
17
  CATEGORY_SPEND: "category_spend",
18
18
  MONTHLY_SPEND: "monthly_spend_comparison",
19
19
  ACCOUNT_BALANCE: "account_balance",
20
20
  UPCOMING_BILL: "upcoming_bill",
21
21
  SPEND_TO_INCOME: "monthly_spend_to_income",
22
- SAVINGS_TO_INCOME: "monthly_savings_to_income",
22
+ SAVINGS_TO_INCOME: "savings_to_income",
23
23
  DEBT_TO_INCOME: "debt_to_income",
24
24
  COST_OF_LIVING: "cost_living_to_income",
25
25
  NON_ESSENTIAL_CATEGORY: "non_essential_category_summary",
26
26
  DEPOSIT_SUMMARY: "monthly_deposit_summary",
27
27
  LOW_BALANCE: "low_balance",
28
28
  SUBSCRIPTION_AGGREGATE: "monthly_subscription_aggregate"
29
- }, d = (t, e) => e && w(e, t) || t.palette.primary.main, T = (t) => typeof t == "string" ? p(t) : new Date(t ?? NaN), S = (t) => ({
30
- start: B(T(t)),
31
- end: C(T(t))
32
- }), G = (t) => t?.length ? { accounts: t } : {}, W = ({ beat: t }) => {
29
+ }, _ = (t, e) => e && F(e, t) || t.palette.primary.main, h = (t) => typeof t == "string" ? f(t) : new Date(t ?? NaN), y = (t) => ({
30
+ start: G(h(t)),
31
+ end: L(h(t))
32
+ }), R = (t) => t?.length ? { accounts: t } : {}, z = ({ beat: t }) => {
33
33
  const { account_guid: e, from_date: a, to_date: o } = t.insights_payload?.drilldown_data ?? {};
34
34
  return typeof e != "string" || typeof a != "number" || typeof o != "number" || !Number.isFinite(a) || !Number.isFinite(o) || o <= a ? {
35
35
  accounts: [],
36
36
  custom: () => !1
37
37
  } : {
38
38
  accounts: [e],
39
- custom: (r) => !r.is_hidden && r.feed_status !== U.PENDING,
39
+ custom: (r) => !r.is_hidden && r.feed_status !== P.PENDING,
40
40
  showSplits: !0,
41
41
  dateRange: {
42
- start: A(a),
43
- end: A(o - 1)
42
+ start: D(a),
43
+ end: D(o - 1)
44
44
  }
45
45
  };
46
- }, k = (t) => {
46
+ }, K = (t) => {
47
47
  const e = t?.drilldown_data ?? {};
48
48
  return {
49
- transaction_guids: N(e.transaction_guids),
50
- date: H(e.due_date),
51
- amount: u(e.amount),
52
- category_guid: b(e.category_guid),
53
- average_amount: u(e.average_amount),
54
- merchant_name: b(e.merchant_name)
49
+ transaction_guids: O(e.transaction_guids),
50
+ date: k(e.due_date),
51
+ amount: p(e.amount),
52
+ category_guid: v(e.category_guid),
53
+ average_amount: p(e.average_amount),
54
+ merchant_name: v(e.merchant_name)
55
55
  };
56
- }, _ = (t) => {
56
+ }, g = (t) => {
57
57
  const e = t;
58
58
  return Array.isArray(e?.names) && Array.isArray(e?.data) ? e : void 0;
59
- }, j = (t) => {
59
+ }, q = (t) => {
60
60
  const e = t?.drilldown_data ?? {};
61
61
  return {
62
- account_guids: N(e.account_guids),
63
- data_series: _(e.data_series),
64
- average_amount: u(e.average_amount)
62
+ account_guids: O(e.account_guids),
63
+ data_series: g(e.data_series),
64
+ average_amount: p(e.average_amount)
65
65
  };
66
- }, R = ["income", "other"], z = (t) => {
66
+ }, U = ["income", "other"], J = (t) => {
67
67
  const e = t?.drilldown_data ?? {}, a = t?.instance_slot?.data?.legends?.map(({ label: o }) => o);
68
68
  return {
69
- data_series: _(e.data_series),
70
- average_amount: u(e.average_amount),
71
- income_transaction_guids: N(e.income_transaction_guids),
72
- sub_tab_labels: a?.length === R.length ? a : void 0
69
+ data_series: g(e.data_series),
70
+ average_amount: p(e.average_amount),
71
+ income_transaction_guids: O(e.income_transaction_guids),
72
+ sub_tab_labels: a?.length === U.length ? a : void 0
73
73
  };
74
- }, K = 2, q = (t, e) => {
75
- const a = e ?? {}, o = _(a.series), r = Array.isArray(a.labels) ? a.labels.map(b) : [];
76
- return !o || r.length !== K || !r.every((s) => !!s) ? {} : {
74
+ }, Q = 2, w = (t, e) => {
75
+ const a = e ?? {}, o = g(a.series), r = Array.isArray(a.labels) ? a.labels.map(v) : [];
76
+ return !o || r.length !== Q || !r.every((s) => !!s) ? {} : {
77
77
  data_series: o,
78
78
  legends: r.map((s) => ({
79
79
  label: s,
80
80
  value: 0
81
81
  }))
82
82
  };
83
- }, J = (t, e) => M(_(e?.series)).flatMap((a) => a.aggregated_guids ?? []), Q = (t, e) => {
83
+ }, I = (t, e) => E(g(e?.series)).flatMap((a) => a.aggregated_guids ?? []), X = (t, e) => {
84
84
  const a = e.transaction_history_block?.monthly_debt_to_income_tip_message, o = e.transaction_history_block?.monthly_debt_to_income_tip_limit;
85
85
  if (!(!a || !o))
86
86
  return {
87
- message: h(a, /* @__PURE__ */ c("strong", { children: e.general.tip_section_title }), /* @__PURE__ */ c("strong", { children: o })),
87
+ message: S(a, /* @__PURE__ */ c("strong", { children: e.general.tip_section_title }), /* @__PURE__ */ c("strong", { children: o })),
88
88
  onDismiss: () => t(!0)
89
89
  };
90
- }, X = (t) => M(_(t.insights_payload?.drilldown_data?.data_series)).flatMap((e) => e.aggregated_guids ?? []), Z = (t, e) => {
91
- const a = F(t, e);
90
+ }, Z = (t, e) => {
91
+ const a = w(t, e);
92
+ return a.data_series ? a : V(t?.instance_slot?.data ?? {});
93
+ }, $ = (t, e) => {
94
+ const a = e.transaction_history_block?.savings_to_income_tip_message, o = e.transaction_history_block?.savings_to_income_tip_percentage;
95
+ if (!(!a || !o))
96
+ return {
97
+ message: S(a, /* @__PURE__ */ c("strong", { children: e.general.tip_section_title }), /* @__PURE__ */ c("strong", { children: o })),
98
+ onDismiss: () => t(!0)
99
+ };
100
+ }, tt = (t) => E(g(t.insights_payload?.drilldown_data?.data_series)).flatMap((e) => e.aggregated_guids ?? []), et = (t, e) => {
101
+ const a = x(t, e);
92
102
  return a ? [...t, a] : t;
93
- }, $ = (t, e, a, o) => {
103
+ }, at = (t, e, a, o) => {
94
104
  const r = o?.merchant_name, s = o?.date;
95
105
  if (!r || !s) return;
96
- const n = e.transaction_history_block?.upcoming_bill_tip_message;
97
- if (n)
106
+ const i = e.transaction_history_block?.upcoming_bill_tip_message;
107
+ if (i)
98
108
  return {
99
- message: h(n, /* @__PURE__ */ c("strong", { children: e.general.tip_section_title }), r, E(p(s), D.FULL_MONTH_DAY)),
109
+ message: S(i, /* @__PURE__ */ c("strong", { children: e.general.tip_section_title }), r, C(f(s), M.FULL_MONTH_DAY)),
100
110
  onDismiss: () => t(!0)
101
111
  };
102
- }, v = ({ beatTransactions: t, dataSeries: e, selectedIndex: a }) => {
103
- const o = e[a], r = o?.guid, s = t.find((n) => n.guid === r)?.has_been_split;
112
+ }, N = ({ beatTransactions: t, dataSeries: e, selectedIndex: a }) => {
113
+ const o = e[a], r = o?.guid, s = t.find((i) => i.guid === r)?.has_been_split;
104
114
  return {
105
- custom: (n) => n.guid === r,
106
- dateRange: S(o?.date),
115
+ custom: (i) => i.guid === r,
116
+ dateRange: y(o?.date),
107
117
  showSplits: !s
108
118
  };
109
- }, tt = ({ dataSeries: t, selectedIndex: e, instanceSlotData: a }) => {
119
+ }, ot = ({ dataSeries: t, selectedIndex: e, instanceSlotData: a }) => {
110
120
  const o = t[e], r = a.category_guid ?? o?.guid;
111
121
  return {
112
122
  custom: (s) => s.category_guid === r || s.top_level_category_guid === r,
113
- dateRange: S(o?.date)
123
+ dateRange: y(o?.date)
114
124
  };
115
- }, et = ({ dataSeries: t, selectedIndex: e, spendCategoryGuids: a, instanceSlotData: o }) => {
125
+ }, rt = ({ dataSeries: t, selectedIndex: e, spendCategoryGuids: a, instanceSlotData: o }) => {
116
126
  const r = t[e];
117
127
  return {
118
128
  custom: (s) => !!s.top_level_category_guid && a.includes(s.top_level_category_guid),
119
- dateRange: S(r?.date),
120
- ...G(o.account_guids)
129
+ dateRange: y(r?.date),
130
+ ...R(o.account_guids)
121
131
  };
122
- }, at = (t) => typeof t == "number" ? V(t) : p(t ?? ""), ot = ({ beat: t, dataSeries: e, selectedIndex: a, isLastTab: o, instanceSlotData: r }) => {
123
- const s = e[a], { start: n, end: g } = S(s?.date), l = at(t.created_at), m = r.account_guids, O = {
124
- start: n,
125
- end: o && L(l) && l < g ? l : g
132
+ }, st = (t) => typeof t == "number" ? j(t) : f(t ?? ""), nt = ({ beat: t, dataSeries: e, selectedIndex: a, isLastTab: o, instanceSlotData: r }) => {
133
+ const s = e[a], { start: i, end: d } = y(s?.date), l = st(t.created_at), m = r.account_guids, A = {
134
+ start: i,
135
+ end: o && B(l) && l < d ? l : d
126
136
  };
127
137
  return m?.length ? {
128
- dateRange: O,
138
+ dateRange: A,
129
139
  accounts: m
130
140
  } : {
131
- dateRange: O,
141
+ dateRange: A,
132
142
  accounts: [],
133
143
  custom: () => !1
134
144
  };
135
- }, f = (t, e, a) => {
136
- const o = new Set(t), r = p(e ?? "");
137
- return !o.size || !L(r) ? {
145
+ }, b = (t, e, a) => {
146
+ const o = new Set(t), r = f(e ?? "");
147
+ return !o.size || !B(r) ? {
138
148
  accounts: [],
139
149
  custom: () => !1
140
150
  } : {
141
151
  custom: (s) => o.has(s.guid),
142
152
  dateRange: {
143
- start: B(r),
144
- end: C(r)
153
+ start: G(r),
154
+ end: L(r)
145
155
  },
146
- ...G(a)
156
+ ...R(a)
147
157
  };
148
- }, rt = ({ beat: t, dataSeries: e, selectedIndex: a }) => f(e[a]?.aggregated_guids, e[a]?.date, t.account_guids), y = ({ beat: t, comparisonBars: e, selectedIndex: a, subIndex: o }) => {
158
+ }, it = ({ beat: t, dataSeries: e, selectedIndex: a }) => b(e[a]?.aggregated_guids, e[a]?.date, t.account_guids), u = ({ beat: t, comparisonBars: e, selectedIndex: a, subIndex: o }) => {
149
159
  const r = e[a];
150
- return f(o === 1 ? r?.comparisonGuids : r?.mainGuids, r?.date, t.account_guids);
151
- }, st = ({ beat: t, dataSeries: e, subIndex: a }) => f(e[a]?.aggregated_guids, e[a]?.date, t.account_guids), it = (t) => {
152
- const { dataSeries: e, selectedIndex: a, subIndex: o, instanceSlotData: r } = t, s = e[a], n = new Set(r.income_transaction_guids), g = R[o] === "income", l = r.sub_tab_labels ? s?.aggregated_guids?.filter((m) => n.has(m) === g) : s?.aggregated_guids;
153
- return f(l, s?.date);
154
- }, vt = {
155
- [i.TRANSACTION]: {
160
+ return b(o === 1 ? r?.comparisonGuids : r?.mainGuids, r?.date, t.account_guids);
161
+ }, ct = ({ beat: t, dataSeries: e, subIndex: a }) => b(e[a]?.aggregated_guids, e[a]?.date, t.account_guids), lt = (t) => {
162
+ const { dataSeries: e, selectedIndex: a, subIndex: o, instanceSlotData: r } = t, s = e[a], i = new Set(r.income_transaction_guids), d = U[o] === "income", l = r.sub_tab_labels ? s?.aggregated_guids?.filter((m) => i.has(m) === d) : s?.aggregated_guids;
163
+ return b(l, s?.date);
164
+ }, Ot = {
165
+ [n.TRANSACTION]: {
156
166
  top: "singleBar",
157
167
  scope: "store",
158
168
  filterMode: "store",
159
- filterStrategy: v,
160
- colors: (t, e) => [d(t, e)],
169
+ filterStrategy: N,
170
+ colors: (t, e) => [_(t, e)],
161
171
  header: (t) => {
162
172
  const { title: e, subHeader: a } = t;
163
173
  return {
164
174
  heading: e,
165
175
  subHeadingText: a?.text || void 0,
166
- icon: /* @__PURE__ */ c(Y, {
176
+ icon: /* @__PURE__ */ c(H, {
167
177
  logo: {
168
178
  ...a?.logo,
169
179
  merchant_name: a?.text ?? a?.logo?.merchant_name
@@ -173,130 +183,139 @@ var i = {
173
183
  };
174
184
  },
175
185
  tipSection: (t, e, a = "") => ({
176
- message: h(e.general.tip_section_message, /* @__PURE__ */ c("strong", { children: e.general.tip_section_title }), /* @__PURE__ */ c("strong", { children: a })),
186
+ message: S(e.general.tip_section_message, /* @__PURE__ */ c("strong", { children: e.general.tip_section_title }), /* @__PURE__ */ c("strong", { children: a })),
177
187
  onDismiss: () => t(!0)
178
188
  })
179
189
  },
180
- [i.CATEGORY_SPEND]: {
190
+ [n.CATEGORY_SPEND]: {
181
191
  top: "singleBar",
182
- averageFormat: P.whole,
183
- filterStrategy: tt,
192
+ averageFormat: Y.whole,
193
+ filterStrategy: ot,
184
194
  scope: "store",
185
195
  filterMode: "store",
186
- colors: (t, e) => [d(t, e)],
196
+ colors: (t, e) => [_(t, e)],
187
197
  header: (t) => ({
188
198
  heading: t.categoryName,
189
- subHeadingText: t.selectedDate && E(T(t.selectedDate), D.MONTH_LONG) || "",
190
- icon: /* @__PURE__ */ c(x, {
199
+ subHeadingText: t.selectedDate && C(h(t.selectedDate), M.MONTH_LONG) || "",
200
+ icon: /* @__PURE__ */ c(W, {
191
201
  color: "primary",
192
202
  name: "calendar_month",
193
203
  size: 16
194
204
  })
195
205
  })
196
206
  },
197
- [i.MONTHLY_SPEND]: {
207
+ [n.MONTHLY_SPEND]: {
198
208
  top: "singleBar",
199
- filterStrategy: et,
209
+ filterStrategy: rt,
200
210
  scope: "store",
201
211
  filterMode: "store",
202
212
  colors: (t) => [t.palette.chart.chart2 ?? t.palette.primary.main]
203
213
  },
204
- [i.ACCOUNT_BALANCE]: {
214
+ [n.ACCOUNT_BALANCE]: {
205
215
  top: "singleBar",
206
- filterStrategy: ot,
207
- slotData: j,
216
+ filterStrategy: nt,
217
+ slotData: q,
208
218
  scope: "store",
209
219
  filterMode: "store",
210
220
  colors: (t) => [t.palette.success.main]
211
221
  },
212
- [i.UPCOMING_BILL]: {
222
+ [n.UPCOMING_BILL]: {
213
223
  top: "upcomingBill",
214
- filterStrategy: v,
224
+ filterStrategy: N,
215
225
  scope: "beat",
216
226
  filterMode: "local",
217
- colors: (t, e) => [d(t, e)],
218
- slotData: k,
219
- beatTransactions: Z,
227
+ colors: (t, e) => [_(t, e)],
228
+ slotData: K,
229
+ beatTransactions: et,
220
230
  fetchMissingTransactions: (t) => t.insights_payload?.drilldown_data?.transaction_guids,
221
- tipSection: $
231
+ tipSection: at
222
232
  },
223
- [i.DEPOSIT_SUMMARY]: {
233
+ [n.DEPOSIT_SUMMARY]: {
224
234
  top: "singleBar",
225
- filterStrategy: it,
235
+ filterStrategy: lt,
226
236
  scope: "store",
227
237
  filterMode: "store",
228
238
  colors: (t) => [t.palette.success.main],
229
- slotData: z,
230
- fetchMissingTransactions: X,
239
+ slotData: J,
240
+ fetchMissingTransactions: tt,
231
241
  subTabs: ({ instanceSlotData: t }) => t.sub_tab_labels ?? []
232
242
  },
233
- [i.LOW_BALANCE]: {
243
+ [n.LOW_BALANCE]: {
234
244
  top: "list",
235
- filterStrategy: W,
245
+ filterStrategy: z,
236
246
  scope: "store",
237
247
  filterMode: "store",
238
248
  colors: (t) => [t.palette.primary.main],
239
249
  hideListHeader: !0
240
250
  },
241
- [i.SUBSCRIPTION_AGGREGATE]: {
251
+ [n.SUBSCRIPTION_AGGREGATE]: {
242
252
  top: "monthTabs",
243
- filterStrategy: rt,
253
+ filterStrategy: it,
244
254
  scope: "store",
245
255
  filterMode: "store",
246
256
  colors: (t) => [t.palette.primary.main]
247
257
  },
248
- [i.SPEND_TO_INCOME]: {
258
+ [n.SPEND_TO_INCOME]: {
249
259
  top: "doubleBar",
250
- filterStrategy: y,
260
+ filterStrategy: u,
251
261
  scope: "store",
252
262
  filterMode: "store",
253
- colors: (t) => I(t, "spend_to_income")?.color ?? [],
263
+ colors: (t) => T(t, "spend_to_income")?.color ?? [],
254
264
  subTabAriaLabels: (t) => [t.general.spend_transactions, t.general.income_transactions]
255
265
  },
256
- [i.COST_OF_LIVING]: {
266
+ [n.COST_OF_LIVING]: {
257
267
  top: "doubleBar",
258
- filterStrategy: y,
268
+ filterStrategy: u,
259
269
  scope: "store",
260
270
  filterMode: "store",
261
- colors: (t, e) => [d(t, e), t.palette.chart.chart4 ?? t.palette.primary.main],
271
+ colors: (t, e) => [_(t, e), t.palette.chart.chart4 ?? t.palette.primary.main],
262
272
  subTabAriaLabels: (t) => [void 0, t.general.income_transactions]
263
273
  },
264
- [i.DEBT_TO_INCOME]: {
274
+ [n.DEBT_TO_INCOME]: {
265
275
  top: "doubleBar",
266
- filterStrategy: y,
276
+ filterStrategy: u,
267
277
  scope: "store",
268
278
  filterMode: "store",
269
- colors: (t) => I(t, "debt_to_income")?.color ?? [],
279
+ colors: (t) => T(t, "debt_to_income")?.color ?? [],
270
280
  subTabAriaLabels: (t) => [void 0, t.general.income_transactions],
271
- slotData: q,
272
- fetchMissingTransactions: J,
273
- tipSection: Q,
274
- tipAboveSubTabs: !0,
275
- hideListHeader: !0
281
+ slotData: w,
282
+ fetchMissingTransactions: I,
283
+ tipSection: X
284
+ },
285
+ [n.SAVINGS_TO_INCOME]: {
286
+ top: "doubleBar",
287
+ filterStrategy: u,
288
+ scope: "store",
289
+ filterMode: "store",
290
+ colors: (t) => T(t, "savings_to_income")?.color ?? [],
291
+ subTabAriaLabels: (t) => [t.general.savings_transactions, t.general.income_transactions],
292
+ slotData: Z,
293
+ fetchMissingTransactions: I,
294
+ tipSection: $
276
295
  },
277
- [i.NON_ESSENTIAL_CATEGORY]: {
296
+ [n.NON_ESSENTIAL_CATEGORY]: {
278
297
  top: "tabsOnly",
279
- filterStrategy: st,
298
+ filterStrategy: ct,
280
299
  scope: "store",
281
300
  filterMode: "store",
282
301
  colors: (t) => [t.palette.primary.main]
283
302
  }
284
- }, ht = {
303
+ }, At = {
285
304
  top: "singleBar",
286
- filterStrategy: v,
305
+ filterStrategy: N,
287
306
  scope: "store",
288
307
  filterMode: "store",
289
- colors: (t, e) => [d(t, e)]
308
+ colors: (t, e) => [_(t, e)]
290
309
  };
291
310
  export {
292
- i as DRILLDOWN_VARIANTS,
293
- ht as FALLBACK,
294
- vt as layout,
295
- q as resolveDebtToIncomeSlotData,
296
- z as resolveDepositSummarySlotData,
297
- j as resolveSavingsContributionsSlotData,
298
- k as resolveUpcomingBillSlotData,
299
- Z as resolveUpcomingBillTransactions
311
+ n as DRILLDOWN_VARIANTS,
312
+ At as FALLBACK,
313
+ Ot as layout,
314
+ w as resolveDebtToIncomeSlotData,
315
+ J as resolveDepositSummarySlotData,
316
+ q as resolveSavingsContributionsSlotData,
317
+ K as resolveUpcomingBillSlotData,
318
+ et as resolveUpcomingBillTransactions
300
319
  };
301
320
 
302
321
  //# sourceMappingURL=layout.es.js.map