@mx-cartographer/experiences 9.7.123 → 9.7.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +7 -0
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.d.ts +2 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +66 -62
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +86 -85
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +5 -3
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +137 -107
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.d.ts +4 -2
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.es.js +17 -13
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js +7 -7
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +6 -3
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js +31 -31
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js.map +1 -1
- package/package.json +1 -1
package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map
CHANGED
|
@@ -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 { 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 const dynamicCtaVariant = getDynamicCtaBasedOnTriggers(\n actionDrawer,\n insights_payload?.primary_cta,\n insights_payload?.secondary_cta,\n insights_payload?.in_description_cta,\n )?.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(beat, { slotData, beatTransactions: resolveBeatTransactions })\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 ?? '0,0.00',\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,IAAqB,GAEvB,IAAoB,GACxB,GACA,GAAkB,aAClB,GAAkB,eAClB,GAAkB,kBACpB,GAAG,SAEG,EACJ,KAAA,GACA,YAAA,GACA,QAAA,GACA,QAAA,GACA,gBAAA,GACA,YAAA,GACA,kBAAA,GACA,UAAA,GACA,kBAAkB,GAClB,gBAAA,GACA,eAAA,GACA,SAAA,EAAA,IACE,GAAmB,KAAqB,EAAE,GAExC,EACJ,kBAAA,GACA,kBAAA,GACA,oBAAA,GACA,iBAAA,GACA,cAAA,GACA,oBAAA,GACA,kBAAA,GAAA,IACE,GAAsB,GAAM;AAAA,IAAE,UAAA;AAAA,IAAU,kBAAkB;AAAA,EAAw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AAA;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 { 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 ?? '0,0.00',\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,YAAA,GACA,kBAAA,GACA,UAAA,GACA,kBAAkB,GAClB,gBAAA,GACA,iBAAA,GACA,eAAA,GACA,SAAA,GAAA,IACE,GAAmB,KAAqB,EAAE,GAExC,EACJ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AAE,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,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Theme } from '@mui/material/styles';
|
|
3
|
-
import { Beat, InsightsFeedCopy, Subtitle, Transaction } from '../../../core';
|
|
3
|
+
import { Beat, DrilldownData, InsightsFeedCopy, Subtitle, Transaction } from '../../../core';
|
|
4
4
|
import { TransactionFilter } from '../../../core/stores/TransactionStore';
|
|
5
5
|
import { DataSet } from '../../../core/types/InsightsInstanceSlotData';
|
|
6
6
|
import { ChartDataSeriesItem } from '../../blocks/ChartBlocks/BarchartBlock/utils';
|
|
@@ -25,7 +25,7 @@ export declare const DRILLDOWN_VARIANTS: {
|
|
|
25
25
|
readonly UPCOMING_BILL: "upcoming_bill";
|
|
26
26
|
readonly SPEND_TO_INCOME: "monthly_spend_to_income";
|
|
27
27
|
readonly SAVINGS_TO_INCOME: "monthly_savings_to_income";
|
|
28
|
-
readonly DEBT_TO_INCOME: "
|
|
28
|
+
readonly DEBT_TO_INCOME: "debt_to_income";
|
|
29
29
|
readonly COST_OF_LIVING: "cost_living_to_income";
|
|
30
30
|
readonly NON_ESSENTIAL_CATEGORY: "non_essential_category_summary";
|
|
31
31
|
readonly DEPOSIT_SUMMARY: "monthly_deposit_summary";
|
|
@@ -69,17 +69,19 @@ export interface DrillDownVariantConfig {
|
|
|
69
69
|
subTabs?: SubTabsKind;
|
|
70
70
|
slotData?: SlotDataResolver;
|
|
71
71
|
beatTransactions?: BeatTransactionsResolver;
|
|
72
|
-
fetchMissingTransactions?: (beat: Beat) => unknown;
|
|
72
|
+
fetchMissingTransactions?: (beat: Beat, ctaDrilldownData?: DrilldownData) => unknown;
|
|
73
73
|
tipSection?: (setCloseTipSection: (flag: boolean) => void, copy: InsightsFeedCopy, merchantName?: string, slotData?: DrillDownSlotData) => TipSectionProps | undefined;
|
|
74
74
|
scope: 'store' | 'beat';
|
|
75
75
|
filterMode: 'store' | 'local';
|
|
76
76
|
subTabAriaLabels?: (copy: InsightsFeedCopy) => (string | undefined)[];
|
|
77
77
|
hideListHeader?: boolean;
|
|
78
|
+
tipAboveSubTabs?: boolean;
|
|
78
79
|
averageFormat?: string;
|
|
79
80
|
}
|
|
80
81
|
export declare const resolveUpcomingBillSlotData: SlotDataResolver;
|
|
81
82
|
export declare const resolveSavingsContributionsSlotData: SlotDataResolver;
|
|
82
83
|
export declare const resolveDepositSummarySlotData: SlotDataResolver;
|
|
84
|
+
export declare const resolveDebtToIncomeSlotData: SlotDataResolver;
|
|
83
85
|
export declare const resolveUpcomingBillTransactions: BeatTransactionsResolver;
|
|
84
86
|
export declare const layout: Partial<Record<DrillDownVariant, DrillDownVariantConfig>>;
|
|
85
87
|
export declare const FALLBACK: DrillDownVariantConfig;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { buildDynamicCopy as
|
|
2
|
-
import { DATE_FORMATS_INTL as
|
|
3
|
-
import { TransactionStatus as
|
|
4
|
-
import { fromUnixUTC as
|
|
5
|
-
import { getCategoryColor as
|
|
6
|
-
import { buildDataSeries as
|
|
7
|
-
import { getLayoutConfig as
|
|
8
|
-
import { buildProjectedBillTransaction as w, calendarDateOf as
|
|
9
|
-
import { MerchantLogo as
|
|
10
|
-
import { Icon as
|
|
11
|
-
import { jsx as
|
|
12
|
-
import { endOfMonth as
|
|
13
|
-
var
|
|
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 { getCategoryColor as P } from "../../../core/utils/CategoryUtil.es.js";
|
|
6
|
+
import { buildDataSeries as M } from "../../blocks/ChartBlocks/BarchartBlock/utils.es.js";
|
|
7
|
+
import { getLayoutConfig as I } from "../../blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js";
|
|
8
|
+
import { buildProjectedBillTransaction as w, calendarDateOf as H, finiteNumberOf as m, guidListOf as N, nonEmptyStringOf as b } from "./utils.es.js";
|
|
9
|
+
import { MerchantLogo as Y } from "@mxenabled/mxui";
|
|
10
|
+
import { Icon as F } from "@mxenabled/mx-icons";
|
|
11
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
12
|
+
import { endOfMonth as C, fromUnixTime as x, isValid as L, parseISO as p, startOfMonth as B } from "date-fns";
|
|
13
|
+
var i = {
|
|
14
14
|
TRANSACTION: "not_standard_amount",
|
|
15
15
|
CATEGORY_SPEND: "category_spend",
|
|
16
16
|
MONTHLY_SPEND: "monthly_spend_comparison",
|
|
@@ -18,134 +18,150 @@ var n = {
|
|
|
18
18
|
UPCOMING_BILL: "upcoming_bill",
|
|
19
19
|
SPEND_TO_INCOME: "monthly_spend_to_income",
|
|
20
20
|
SAVINGS_TO_INCOME: "monthly_savings_to_income",
|
|
21
|
-
DEBT_TO_INCOME: "
|
|
21
|
+
DEBT_TO_INCOME: "debt_to_income",
|
|
22
22
|
COST_OF_LIVING: "cost_living_to_income",
|
|
23
23
|
NON_ESSENTIAL_CATEGORY: "non_essential_category_summary",
|
|
24
24
|
DEPOSIT_SUMMARY: "monthly_deposit_summary",
|
|
25
25
|
LOW_BALANCE: "low_balance",
|
|
26
26
|
SUBSCRIPTION_AGGREGATE: "monthly_subscription_aggregate"
|
|
27
|
-
},
|
|
28
|
-
start:
|
|
29
|
-
end:
|
|
30
|
-
}),
|
|
27
|
+
}, d = (t, e) => e && P(e, t) || t.palette.primary.main, T = (t) => typeof t == "string" ? p(t) : new Date(t ?? NaN), S = (t) => ({
|
|
28
|
+
start: B(T(t)),
|
|
29
|
+
end: C(T(t))
|
|
30
|
+
}), G = (t) => t?.length ? { accounts: t } : {}, V = ({ beat: t }) => {
|
|
31
31
|
const { account_guid: e, from_date: a, to_date: r } = t.insights_payload?.drilldown_data ?? {};
|
|
32
32
|
return typeof e != "string" || typeof a != "number" || typeof r != "number" || !Number.isFinite(a) || !Number.isFinite(r) || r <= a ? {
|
|
33
33
|
accounts: [],
|
|
34
34
|
custom: () => !1
|
|
35
35
|
} : {
|
|
36
36
|
accounts: [e],
|
|
37
|
-
custom: (o) => !o.is_hidden && o.feed_status !==
|
|
37
|
+
custom: (o) => !o.is_hidden && o.feed_status !== U.PENDING,
|
|
38
38
|
showSplits: !0,
|
|
39
39
|
dateRange: {
|
|
40
|
-
start:
|
|
41
|
-
end:
|
|
40
|
+
start: A(a),
|
|
41
|
+
end: A(r - 1)
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
}, W = (t) => {
|
|
45
45
|
const e = t?.drilldown_data ?? {};
|
|
46
46
|
return {
|
|
47
47
|
transaction_guids: N(e.transaction_guids),
|
|
48
|
-
date:
|
|
49
|
-
amount:
|
|
48
|
+
date: H(e.due_date),
|
|
49
|
+
amount: m(e.amount),
|
|
50
50
|
category_guid: b(e.category_guid),
|
|
51
|
-
average_amount:
|
|
51
|
+
average_amount: m(e.average_amount),
|
|
52
52
|
merchant_name: b(e.merchant_name)
|
|
53
53
|
};
|
|
54
|
-
},
|
|
54
|
+
}, _ = (t) => {
|
|
55
55
|
const e = t;
|
|
56
56
|
return Array.isArray(e?.names) && Array.isArray(e?.data) ? e : void 0;
|
|
57
57
|
}, j = (t) => {
|
|
58
58
|
const e = t?.drilldown_data ?? {};
|
|
59
59
|
return {
|
|
60
60
|
account_guids: N(e.account_guids),
|
|
61
|
-
data_series:
|
|
62
|
-
average_amount:
|
|
61
|
+
data_series: _(e.data_series),
|
|
62
|
+
average_amount: m(e.average_amount)
|
|
63
63
|
};
|
|
64
|
-
},
|
|
64
|
+
}, R = ["income", "other"], k = (t) => {
|
|
65
65
|
const e = t?.drilldown_data ?? {}, a = t?.instance_slot?.data?.legends?.map(({ label: r }) => r);
|
|
66
66
|
return {
|
|
67
|
-
data_series:
|
|
68
|
-
average_amount:
|
|
67
|
+
data_series: _(e.data_series),
|
|
68
|
+
average_amount: m(e.average_amount),
|
|
69
69
|
income_transaction_guids: N(e.income_transaction_guids),
|
|
70
|
-
sub_tab_labels: a?.length ===
|
|
70
|
+
sub_tab_labels: a?.length === R.length ? a : void 0
|
|
71
71
|
};
|
|
72
|
-
},
|
|
72
|
+
}, z = 2, K = (t, e) => {
|
|
73
|
+
const a = e ?? {}, r = _(a.series), o = Array.isArray(a.labels) ? a.labels.map(b) : [];
|
|
74
|
+
return !r || o.length !== z || !o.every((s) => !!s) ? {} : {
|
|
75
|
+
data_series: r,
|
|
76
|
+
legends: o.map((s) => ({
|
|
77
|
+
label: s,
|
|
78
|
+
value: 0
|
|
79
|
+
}))
|
|
80
|
+
};
|
|
81
|
+
}, $ = (t, e) => M(_(e?.series)).flatMap((a) => a.aggregated_guids ?? []), q = (t, e) => {
|
|
82
|
+
const a = e.transaction_history_block?.monthly_debt_to_income_tip_message, r = e.transaction_history_block?.monthly_debt_to_income_tip_limit;
|
|
83
|
+
if (!(!a || !r))
|
|
84
|
+
return {
|
|
85
|
+
message: h(a, /* @__PURE__ */ c("strong", { children: e.general.tip_section_title }), /* @__PURE__ */ c("strong", { children: r })),
|
|
86
|
+
onDismiss: () => t(!0)
|
|
87
|
+
};
|
|
88
|
+
}, J = (t) => M(_(t.insights_payload?.drilldown_data?.data_series)).flatMap((e) => e.aggregated_guids ?? []), Q = (t, e) => {
|
|
73
89
|
const a = w(t, e);
|
|
74
90
|
return a ? [...t, a] : t;
|
|
75
|
-
},
|
|
91
|
+
}, X = (t, e, a, r) => {
|
|
76
92
|
const o = r?.merchant_name, s = r?.date;
|
|
77
93
|
if (!o || !s) return;
|
|
78
|
-
const
|
|
79
|
-
if (
|
|
94
|
+
const n = e.transaction_history_block?.upcoming_bill_tip_message;
|
|
95
|
+
if (n)
|
|
80
96
|
return {
|
|
81
|
-
message:
|
|
97
|
+
message: h(n, /* @__PURE__ */ c("strong", { children: e.general.tip_section_title }), o, E(p(s), D.FULL_MONTH_DAY)),
|
|
82
98
|
onDismiss: () => t(!0)
|
|
83
99
|
};
|
|
84
|
-
},
|
|
85
|
-
const r = e[a], o = r?.guid, s = t.find((
|
|
100
|
+
}, v = ({ beatTransactions: t, dataSeries: e, selectedIndex: a }) => {
|
|
101
|
+
const r = e[a], o = r?.guid, s = t.find((n) => n.guid === o)?.has_been_split;
|
|
86
102
|
return {
|
|
87
|
-
custom: (
|
|
88
|
-
dateRange:
|
|
103
|
+
custom: (n) => n.guid === o,
|
|
104
|
+
dateRange: S(r?.date),
|
|
89
105
|
showSplits: !s
|
|
90
106
|
};
|
|
91
|
-
},
|
|
107
|
+
}, Z = ({ dataSeries: t, selectedIndex: e, instanceSlotData: a }) => {
|
|
92
108
|
const r = t[e], o = a.category_guid ?? r?.guid;
|
|
93
109
|
return {
|
|
94
110
|
custom: (s) => s.category_guid === o || s.top_level_category_guid === o,
|
|
95
|
-
dateRange:
|
|
111
|
+
dateRange: S(r?.date)
|
|
96
112
|
};
|
|
97
|
-
},
|
|
113
|
+
}, tt = ({ dataSeries: t, selectedIndex: e, spendCategoryGuids: a, instanceSlotData: r }) => {
|
|
98
114
|
const o = t[e];
|
|
99
115
|
return {
|
|
100
116
|
custom: (s) => !!s.top_level_category_guid && a.includes(s.top_level_category_guid),
|
|
101
|
-
dateRange:
|
|
102
|
-
...
|
|
117
|
+
dateRange: S(o?.date),
|
|
118
|
+
...G(r.account_guids)
|
|
103
119
|
};
|
|
104
|
-
},
|
|
105
|
-
const s = e[a], { start:
|
|
106
|
-
start:
|
|
107
|
-
end: r &&
|
|
120
|
+
}, et = (t) => typeof t == "number" ? x(t) : p(t ?? ""), at = ({ beat: t, dataSeries: e, selectedIndex: a, isLastTab: r, instanceSlotData: o }) => {
|
|
121
|
+
const s = e[a], { start: n, end: g } = S(s?.date), l = et(t.created_at), u = o.account_guids, O = {
|
|
122
|
+
start: n,
|
|
123
|
+
end: r && L(l) && l < g ? l : g
|
|
108
124
|
};
|
|
109
|
-
return
|
|
110
|
-
dateRange:
|
|
111
|
-
accounts:
|
|
125
|
+
return u?.length ? {
|
|
126
|
+
dateRange: O,
|
|
127
|
+
accounts: u
|
|
112
128
|
} : {
|
|
113
|
-
dateRange:
|
|
129
|
+
dateRange: O,
|
|
114
130
|
accounts: [],
|
|
115
131
|
custom: () => !1
|
|
116
132
|
};
|
|
117
|
-
},
|
|
118
|
-
const r = new Set(t), o =
|
|
119
|
-
return !r.size || !
|
|
133
|
+
}, f = (t, e, a) => {
|
|
134
|
+
const r = new Set(t), o = p(e ?? "");
|
|
135
|
+
return !r.size || !L(o) ? {
|
|
120
136
|
accounts: [],
|
|
121
137
|
custom: () => !1
|
|
122
138
|
} : {
|
|
123
139
|
custom: (s) => r.has(s.guid),
|
|
124
140
|
dateRange: {
|
|
125
|
-
start:
|
|
126
|
-
end:
|
|
141
|
+
start: B(o),
|
|
142
|
+
end: C(o)
|
|
127
143
|
},
|
|
128
|
-
...
|
|
144
|
+
...G(a)
|
|
129
145
|
};
|
|
130
|
-
},
|
|
146
|
+
}, 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: r }) => {
|
|
131
147
|
const o = e[a];
|
|
132
|
-
return
|
|
133
|
-
},
|
|
134
|
-
const { dataSeries: e, selectedIndex: a, subIndex: r, instanceSlotData: o } = t, s = e[a],
|
|
135
|
-
return
|
|
136
|
-
},
|
|
137
|
-
[
|
|
148
|
+
return f(r === 1 ? o?.comparisonGuids : o?.mainGuids, o?.date, t.account_guids);
|
|
149
|
+
}, ot = ({ beat: t, dataSeries: e, subIndex: a }) => f(e[a]?.aggregated_guids, e[a]?.date, t.account_guids), st = (t) => {
|
|
150
|
+
const { dataSeries: e, selectedIndex: a, subIndex: r, instanceSlotData: o } = t, s = e[a], n = new Set(o.income_transaction_guids), g = R[r] === "income", l = o.sub_tab_labels ? s?.aggregated_guids?.filter((u) => n.has(u) === g) : s?.aggregated_guids;
|
|
151
|
+
return f(l, s?.date);
|
|
152
|
+
}, yt = {
|
|
153
|
+
[i.TRANSACTION]: {
|
|
138
154
|
top: "singleBar",
|
|
139
155
|
scope: "store",
|
|
140
156
|
filterMode: "store",
|
|
141
|
-
filterStrategy:
|
|
142
|
-
colors: (t, e) => [
|
|
157
|
+
filterStrategy: v,
|
|
158
|
+
colors: (t, e) => [d(t, e)],
|
|
143
159
|
header: (t) => {
|
|
144
160
|
const { title: e, subHeader: a } = t;
|
|
145
161
|
return {
|
|
146
162
|
heading: e,
|
|
147
163
|
subHeadingText: a?.text || void 0,
|
|
148
|
-
icon: /* @__PURE__ */
|
|
164
|
+
icon: /* @__PURE__ */ c(Y, {
|
|
149
165
|
alt: a?.text,
|
|
150
166
|
categoryGuid: a?.logo?.category_guid || "",
|
|
151
167
|
merchantGuid: a?.logo?.merchant_guid || "",
|
|
@@ -154,64 +170,64 @@ var n = {
|
|
|
154
170
|
};
|
|
155
171
|
},
|
|
156
172
|
tipSection: (t, e, a = "") => ({
|
|
157
|
-
message:
|
|
173
|
+
message: h(e.general.tip_section_message, /* @__PURE__ */ c("strong", { children: e.general.tip_section_title }), /* @__PURE__ */ c("strong", { children: a })),
|
|
158
174
|
onDismiss: () => t(!0)
|
|
159
175
|
})
|
|
160
176
|
},
|
|
161
|
-
[
|
|
177
|
+
[i.CATEGORY_SPEND]: {
|
|
162
178
|
top: "singleBar",
|
|
163
179
|
averageFormat: "0,0",
|
|
164
|
-
filterStrategy:
|
|
180
|
+
filterStrategy: Z,
|
|
165
181
|
scope: "store",
|
|
166
182
|
filterMode: "store",
|
|
167
|
-
colors: (t, e) => [
|
|
183
|
+
colors: (t, e) => [d(t, e)],
|
|
168
184
|
header: (t) => ({
|
|
169
185
|
heading: t.categoryName,
|
|
170
|
-
subHeadingText: t.selectedDate &&
|
|
171
|
-
icon: /* @__PURE__ */
|
|
186
|
+
subHeadingText: t.selectedDate && E(T(t.selectedDate), D.MONTH_LONG) || "",
|
|
187
|
+
icon: /* @__PURE__ */ c(F, {
|
|
172
188
|
color: "primary",
|
|
173
189
|
name: "calendar_month",
|
|
174
190
|
size: 16
|
|
175
191
|
})
|
|
176
192
|
})
|
|
177
193
|
},
|
|
178
|
-
[
|
|
194
|
+
[i.MONTHLY_SPEND]: {
|
|
179
195
|
top: "singleBar",
|
|
180
|
-
filterStrategy:
|
|
196
|
+
filterStrategy: tt,
|
|
181
197
|
scope: "store",
|
|
182
198
|
filterMode: "store",
|
|
183
199
|
colors: (t) => [t.palette.chart.chart2 ?? t.palette.primary.main]
|
|
184
200
|
},
|
|
185
|
-
[
|
|
201
|
+
[i.ACCOUNT_BALANCE]: {
|
|
186
202
|
top: "singleBar",
|
|
187
|
-
filterStrategy:
|
|
203
|
+
filterStrategy: at,
|
|
188
204
|
slotData: j,
|
|
189
205
|
scope: "store",
|
|
190
206
|
filterMode: "store",
|
|
191
207
|
colors: (t) => [t.palette.success.main]
|
|
192
208
|
},
|
|
193
|
-
[
|
|
209
|
+
[i.UPCOMING_BILL]: {
|
|
194
210
|
top: "upcomingBill",
|
|
195
|
-
filterStrategy:
|
|
211
|
+
filterStrategy: v,
|
|
196
212
|
scope: "beat",
|
|
197
213
|
filterMode: "local",
|
|
198
|
-
colors: (t, e) => [
|
|
214
|
+
colors: (t, e) => [d(t, e)],
|
|
199
215
|
slotData: W,
|
|
200
|
-
beatTransactions:
|
|
216
|
+
beatTransactions: Q,
|
|
201
217
|
fetchMissingTransactions: (t) => t.insights_payload?.drilldown_data?.transaction_guids,
|
|
202
|
-
tipSection:
|
|
218
|
+
tipSection: X
|
|
203
219
|
},
|
|
204
|
-
[
|
|
220
|
+
[i.DEPOSIT_SUMMARY]: {
|
|
205
221
|
top: "singleBar",
|
|
206
|
-
filterStrategy:
|
|
222
|
+
filterStrategy: st,
|
|
207
223
|
scope: "store",
|
|
208
224
|
filterMode: "store",
|
|
209
225
|
colors: (t) => [t.palette.success.main],
|
|
210
|
-
slotData:
|
|
211
|
-
fetchMissingTransactions:
|
|
226
|
+
slotData: k,
|
|
227
|
+
fetchMissingTransactions: J,
|
|
212
228
|
subTabs: ({ instanceSlotData: t }) => t.sub_tab_labels ?? []
|
|
213
229
|
},
|
|
214
|
-
[
|
|
230
|
+
[i.LOW_BALANCE]: {
|
|
215
231
|
top: "list",
|
|
216
232
|
filterStrategy: V,
|
|
217
233
|
scope: "store",
|
|
@@ -219,51 +235,65 @@ var n = {
|
|
|
219
235
|
colors: (t) => [t.palette.primary.main],
|
|
220
236
|
hideListHeader: !0
|
|
221
237
|
},
|
|
222
|
-
[
|
|
238
|
+
[i.SUBSCRIPTION_AGGREGATE]: {
|
|
223
239
|
top: "monthTabs",
|
|
224
|
-
filterStrategy:
|
|
240
|
+
filterStrategy: rt,
|
|
225
241
|
scope: "store",
|
|
226
242
|
filterMode: "store",
|
|
227
243
|
colors: (t) => [t.palette.primary.main]
|
|
228
244
|
},
|
|
229
|
-
[
|
|
245
|
+
[i.SPEND_TO_INCOME]: {
|
|
230
246
|
top: "doubleBar",
|
|
231
|
-
filterStrategy:
|
|
247
|
+
filterStrategy: y,
|
|
232
248
|
scope: "store",
|
|
233
249
|
filterMode: "store",
|
|
234
|
-
colors: (t) =>
|
|
250
|
+
colors: (t) => I(t, "spend_to_income")?.color ?? [],
|
|
235
251
|
subTabAriaLabels: (t) => [t.general.spend_transactions, t.general.income_transactions]
|
|
236
252
|
},
|
|
237
|
-
[
|
|
253
|
+
[i.COST_OF_LIVING]: {
|
|
238
254
|
top: "doubleBar",
|
|
239
|
-
filterStrategy:
|
|
255
|
+
filterStrategy: y,
|
|
240
256
|
scope: "store",
|
|
241
257
|
filterMode: "store",
|
|
242
|
-
colors: (t, e) => [
|
|
258
|
+
colors: (t, e) => [d(t, e), t.palette.chart.chart4 ?? t.palette.primary.main],
|
|
243
259
|
subTabAriaLabels: (t) => [void 0, t.general.income_transactions]
|
|
244
260
|
},
|
|
245
|
-
[
|
|
261
|
+
[i.DEBT_TO_INCOME]: {
|
|
262
|
+
top: "doubleBar",
|
|
263
|
+
filterStrategy: y,
|
|
264
|
+
scope: "store",
|
|
265
|
+
filterMode: "store",
|
|
266
|
+
colors: (t) => I(t, "debt_to_income")?.color ?? [],
|
|
267
|
+
subTabAriaLabels: (t) => [void 0, t.general.income_transactions],
|
|
268
|
+
slotData: K,
|
|
269
|
+
fetchMissingTransactions: $,
|
|
270
|
+
tipSection: q,
|
|
271
|
+
tipAboveSubTabs: !0,
|
|
272
|
+
hideListHeader: !0
|
|
273
|
+
},
|
|
274
|
+
[i.NON_ESSENTIAL_CATEGORY]: {
|
|
246
275
|
top: "tabsOnly",
|
|
247
|
-
filterStrategy:
|
|
276
|
+
filterStrategy: ot,
|
|
248
277
|
scope: "store",
|
|
249
278
|
filterMode: "store",
|
|
250
279
|
colors: (t) => [t.palette.primary.main]
|
|
251
280
|
}
|
|
252
|
-
},
|
|
281
|
+
}, bt = {
|
|
253
282
|
top: "singleBar",
|
|
254
|
-
filterStrategy:
|
|
283
|
+
filterStrategy: v,
|
|
255
284
|
scope: "store",
|
|
256
285
|
filterMode: "store",
|
|
257
|
-
colors: (t, e) => [
|
|
286
|
+
colors: (t, e) => [d(t, e)]
|
|
258
287
|
};
|
|
259
288
|
export {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
289
|
+
i as DRILLDOWN_VARIANTS,
|
|
290
|
+
bt as FALLBACK,
|
|
291
|
+
yt as layout,
|
|
292
|
+
K as resolveDebtToIncomeSlotData,
|
|
293
|
+
k as resolveDepositSummarySlotData,
|
|
264
294
|
j as resolveSavingsContributionsSlotData,
|
|
265
295
|
W as resolveUpcomingBillSlotData,
|
|
266
|
-
|
|
296
|
+
Q as resolveUpcomingBillTransactions
|
|
267
297
|
};
|
|
268
298
|
|
|
269
299
|
//# sourceMappingURL=layout.es.js.map
|