@mx-cartographer/experiences 9.7.141 → 9.7.143-alpha-harini-msa-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/core/types/Insights.d.ts +9 -5
  3. package/dist/core/types/Insights.es.js.map +1 -1
  4. package/dist/core/types/localization/InsightsFeedCopy.d.ts +39 -1
  5. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlock.es.js +11 -12
  6. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlock.es.js.map +1 -1
  7. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js +13 -12
  8. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js.map +1 -1
  9. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.es.js +2 -1
  10. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.es.js.map +1 -1
  11. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.d.ts +5 -5
  12. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.es.js +25 -26
  13. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.es.js.map +1 -1
  14. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.d.ts +9 -0
  15. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js +42 -0
  16. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js.map +1 -0
  17. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.d.ts +13 -0
  18. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.es.js +339 -0
  19. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.es.js.map +1 -0
  20. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/index.d.ts +2 -0
  21. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/layout.d.ts +41 -0
  22. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/layout.es.js +61 -0
  23. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/layout.es.js.map +1 -0
  24. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/usePayoffStrategiesPrepare.d.ts +2 -0
  25. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/usePayoffStrategiesPrepare.es.js +14 -0
  26. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/usePayoffStrategiesPrepare.es.js.map +1 -0
  27. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +33 -36
  28. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
  29. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +60 -58
  30. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
  31. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +4 -0
  32. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +173 -131
  33. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
  34. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +1 -0
  35. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
  36. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js +91 -54
  37. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js.map +1 -1
  38. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSubscriptionHeader.d.ts +12 -0
  39. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSubscriptionHeader.es.js +76 -0
  40. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSubscriptionHeader.es.js.map +1 -0
  41. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.d.ts +14 -0
  42. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js +76 -37
  43. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js.map +1 -1
  44. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js +17 -16
  45. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js.map +1 -1
  46. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.d.ts +1 -0
  47. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js +18 -9
  48. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js.map +1 -1
  49. package/dist/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js +34 -31
  50. package/dist/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js.map +1 -1
  51. package/dist/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/layout.d.ts +11 -0
  52. package/dist/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/layout.es.js +13 -0
  53. package/dist/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/layout.es.js.map +1 -0
  54. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/images/UpcomingTaxDeadlineAlert.es.js +47 -9
  55. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/images/UpcomingTaxDeadlineAlert.es.js.map +1 -1
  56. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.d.ts +1 -1
  57. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.es.js +1 -1
  58. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.es.js.map +1 -1
  59. package/dist/insights-v2/components/CompactInsightCard.es.js +135 -111
  60. package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -1
  61. package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.d.ts +3 -1
  62. package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.es.js +5 -4
  63. package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.es.js.map +1 -1
  64. package/dist/insights-v2/components/chartblocks/ChartLegend.d.ts +3 -1
  65. package/dist/insights-v2/components/chartblocks/ChartLegend.es.js +13 -9
  66. package/dist/insights-v2/components/chartblocks/ChartLegend.es.js.map +1 -1
  67. package/dist/insights-v2/components/chartblocks/DoubleBarChart.d.ts +2 -1
  68. package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js +36 -35
  69. package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js.map +1 -1
  70. package/dist/insights-v2/components/drawerTip.d.ts +2 -0
  71. package/dist/insights-v2/components/drawerTip.es.js +10 -0
  72. package/dist/insights-v2/components/drawerTip.es.js.map +1 -0
  73. package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -0
  74. package/dist/insights-v2/mappings/actionBlocksKey.es.js +1 -0
  75. package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
  76. package/dist/insights-v2/mappings/blocks.es.js +47 -40
  77. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  78. package/dist/settings/NotificationSettingsWidget.es.js +23 -16
  79. package/dist/settings/NotificationSettingsWidget.es.js.map +1 -1
  80. package/dist/transactions/components/shared/TransactionList.d.ts +2 -0
  81. package/dist/transactions/components/shared/TransactionList.es.js +48 -47
  82. package/dist/transactions/components/shared/TransactionList.es.js.map +1 -1
  83. package/dist/transactions/components/shared/transactionlist/TransactionRow.d.ts +2 -0
  84. package/dist/transactions/components/shared/transactionlist/TransactionRow.es.js +50 -45
  85. package/dist/transactions/components/shared/transactionlist/TransactionRow.es.js.map +1 -1
  86. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,41 @@
1
+ ## [9.7.149] - 11-13-2026
2
+
3
+ - **FIXED** - `SVGImageBlock` keys the Upcoming Tax Deadline Alert illustration under `reminder` (was `remainder`), the variant ditto emits, so the card shows its own art instead of the savings illustration; this reverses the key named in 9.7.33 (WEC-2044, WEC-2067)
4
+ - **FIXED** - The Upcoming Tax Deadline Alert illustration follows the brand theme: its colored nodes carry `brand300` / `brand200` / `brand100`, white fills and the CIBC art are unchanged (WEC-2140)
5
+
6
+ ## [9.7.148] - 11-13-2026
7
+
8
+ - **FIXED** - Monthly Spend to Income Comparison V2: Spend draws in `chart2` (was `categories.billsUtilities`) on the card and its drawer, per Figma (WEC-2101)
9
+ - **CHANGED** - Monthly Spend / Debt / Savings to Income: the legend label ("Spend:", "Debt:", "Savings:", "Income:") is bold, the amount regular, on the full card, the mini card and the drawer (WEC-2101)
10
+
11
+ ## [9.7.147] - 11-12-2026
12
+
13
+ - **FIXED** - Notification settings scroll and back button label on mobile when opened from a deep link (WELL-169, WELL-171)
14
+
15
+ ## [9.7.146] - 11-12-2026
16
+
17
+ - **CHANGED** - Save Enough to Live On (Insights 2.0): `SavingsSummaryBlock` shows the calendar art from ditto's layout variant (`with_illustration` on full, `no_illustration` on mini) instead of the widget type (WEC-2273)
18
+ - **FIXED** - The Make a Transfer drawer reads its facts and variant from the CTA that opened it (including a micro card's in-place link), so Save Enough to Live On's "View Details" drawer shows the balance, spend and duration instead of $0 (WEC-2273)
19
+ - **FIXED** - Save Enough to Live On spacing matches Figma: the duration banner is 52px tall on the card and in the drawer (no inline-SVG gap), and the drawer's totals footer has 14px top and bottom padding (WEC-2273)
20
+ - **ADDED** - Storybook: Save Enough to Live On QA page (full, mini, micro, drill down; default and zero state) (WEC-2273)
21
+
22
+ ## [9.7.145] - 11-12-2026
23
+
24
+ - **ADDED** - Insights 2.0 Merchant Budget: Spending History drawer with six months of merchant spend and the selected month's purchases (WEC-2275)
25
+ - **CHANGED** - A `DrilldownData` value may be a `DataSeries`; widen any type guard on `drilldown_data` (WEC-2275)
26
+
27
+ ## [9.7.144] - 11-12-2026
28
+
29
+ - **ADDED** - Debt Payoff Strategies action block on Insights 2.0 with Avalanche and Snowball tabs, each with its strategy, pros, cons, steps and the beat's debt accounts in payoff order, a tapped account opening Account Details (WEC-2276)
30
+
31
+ ## [9.7.143] - 11-12-2026
32
+
33
+ - **ADDED** - Subscription Price Increase V2 embedded card shows the previous and new amounts as two bars (WEC-2290)
34
+
35
+ ## [9.7.142] - 11-12-2026
36
+
37
+ - **CHANGED** - Storybook: the standalone deposit QA pages move to their Insights 2.0 V+1 template names (bucket 2): `InsightsV2/Insights/PayrollDepositV2`, `GovernmentDepositV2`, `MerchantCreditReceivedV2`, `CheckDepositV2`, `TaxDepositV2`, `LargeDepositV2` and `PayrollAdvanceV2`; their mock beats carry the V2 template names (WEC-2296)
38
+
1
39
  ## [9.7.141] - 11-12-2026
2
40
 
3
41
  - **FIXED** - An Insights 2.0 notification row whose logo is an icon (`ICO-…`) draws it in a tinted tile, as Figma does, instead of a bare glyph. Newman keeps no colour, so the tint comes from the glyph: `error` red (Low Account Balance), `check_circle` green, `warning` amber, any other primary (Monthly Spend Comparison's trendline) (WEC-2299)
@@ -1,3 +1,4 @@
1
+ import { DataSeries } from './Beat';
1
2
  import { InsightsInstanceSlotData } from './InsightsInstanceSlotData';
2
3
  export interface ThemedSVGImageProps {
3
4
  divProps?: React.HTMLAttributes<HTMLDivElement>;
@@ -29,16 +30,19 @@ export type WidgetType = 'full' | 'mini' | 'micro' | 'embedded' | 'notification'
29
30
  export interface Pill {
30
31
  text: string;
31
32
  }
33
+ /** A row in a drilldown list fact (e.g. the Subscriptions drawer's per-transaction schedule). */
34
+ export type DrilldownRow = Record<string, string | number | boolean | null>;
32
35
  /**
33
36
  * V2: facts a drilldown shows that the card does not. On the payload: what every CTA of the card
34
37
  * shares (e.g. the account number for the Transaction Details drawer, or the guid list a list drawer
35
38
  * shows, `transaction_guids`). On a CTA: the figures that CTA's own drilldown renders (the Transaction
36
- * List summary header's `amount`, `start_date` / `end_date` and `count`, see `readSummary`). Scalars
37
- * or string lists, omitted when the insight has none. Never carries copy or user actions (memo,
38
- * tags, hide, flag come from the transaction store). Values come from the server, so a reader still
39
- * checks each value's runtime shape.
39
+ * List summary header's `amount`, `start_date` / `end_date` and `count`, see `readSummary`). Scalars,
40
+ * string lists, a `data_series` (the months a history drawer charts), or rows of scalars
41
+ * (`transaction_frequencies`), omitted when the insight has none. Never carries copy or user actions
42
+ * (memo, tags, hide, flag come from the transaction store). Values come from the server, so a reader
43
+ * still checks each value's runtime shape.
40
44
  */
41
- export type DrilldownData = Record<string, string | number | boolean | null | string[]>;
45
+ export type DrilldownData = Record<string, string | number | boolean | null | string[] | DataSeries | DrilldownRow[]>;
42
46
  export interface InsightsPayload {
43
47
  widget_type: WidgetType;
44
48
  instance_slot: InstanceSlot;
@@ -1 +1 @@
1
- {"version":3,"file":"Insights.es.js","names":[],"sources":["../../../src/core/types/Insights.ts"],"sourcesContent":["// ============ Core InsightsV2 Types ============\n\nimport { InsightsInstanceSlotData } from './InsightsInstanceSlotData'\n\nexport interface ThemedSVGImageProps {\n divProps?: React.HTMLAttributes<HTMLDivElement>\n image: React.ComponentType<React.SVGProps<SVGSVGElement>>\n isMini?: boolean\n}\n\n/**\n * Emitted by a block when the user drills into a specific datum (e.g. clicks a\n * chart bar). Named fields rather than positional args so blocks with differing\n * shapes can extend this without the call sites transposing values.\n */\nexport interface DrilldownPayload {\n chartBarIndex: number\n tabIndex?: number\n transaction_guid?: string\n block?: string\n}\n\n/**\n * Which envelope a beat was fetched with. `embedded` (the transaction-row pill + details-drawer\n * card) and `notification` are V2 additions; a surface asks for one with `widget_type=` on the fetch.\n */\nexport type WidgetType = 'full' | 'mini' | 'micro' | 'embedded' | 'notification'\n\n/**\n * V2: the transaction-row tag, its own small section of the `embedded` envelope (the same grammar\n * as `description` / `footer`, with room for a tone or an icon later). Omitted for an insight that\n * tags no transaction row. It deliberately is *not* `short_title`, which stays a per-variant\n * attribute with a second consumer (the bank-holiday sub-header).\n */\nexport interface Pill {\n text: string\n}\n\n/**\n * V2: facts a drilldown shows that the card does not. On the payload: what every CTA of the card\n * shares (e.g. the account number for the Transaction Details drawer, or the guid list a list drawer\n * shows, `transaction_guids`). On a CTA: the figures that CTA's own drilldown renders (the Transaction\n * List summary header's `amount`, `start_date` / `end_date` and `count`, see `readSummary`). Scalars\n * or string lists, omitted when the insight has none. Never carries copy or user actions (memo,\n * tags, hide, flag come from the transaction store). Values come from the server, so a reader still\n * checks each value's runtime shape.\n */\nexport type DrilldownData = Record<string, string | number | boolean | null | string[]>\n\nexport interface InsightsPayload {\n widget_type: WidgetType\n instance_slot: InstanceSlot\n /**\n * V1 only. The v2 contract carries everything a block needs on `instance_slot.data`,\n * and omits this key entirely (see the LargeTransactionV2 payload). Blocks that still require it\n * get it as a required field through `BlockProps`, which re-declares it.\n */\n instance_slot_data?: InsightsInstanceSlotData\n description: Description\n primary_cta?: PrimaryCTA\n secondary_cta?: SecondaryCTA\n title?: string\n sub_title?: Subtitle\n /**\n * V2 rename of `sub_title`: a flat string, with the logo promoted to the payload-level `logo`\n * field below. `sub_title` wins when both are present.\n */\n subtitle?: string\n /** V2: header logo paired with the flat `subtitle`: an entity guid or a status icon (`LogoRef`). */\n logo?: LogoRef\n /** V2: which design branch the backend picked (e.g. `no_merchant`). */\n variant?: string\n /** V2, `embedded` envelope only: the transaction-row pill. */\n pill?: Pill\n /**\n * V2: drilldown-only facts, e.g. `{ account_number: 'XXXXXXXX043' }`, or the guid list a list\n * drawer shows (`{ transaction_guids: [...] }`).\n */\n drilldown_data?: DrilldownData\n footer?: Footer\n /**\n * V2: the link inside the description: on the full card a drawer of its own (Low Account\n * Balance's \"Transactions ›\"); on mini and micro the card's action, sent instead of `primary_cta`.\n * Absent when the beat has no link.\n */\n in_description_cta?: InDescriptionCTA\n guid: string\n user_guid: string\n client_guid?: string\n /** Template name, e.g. `LargeTransactionV2`. */\n template?: string\n revision?: number\n /** Unix seconds. */\n created_at?: number\n /** Unix seconds. */\n updated_at?: number\n /** Unix seconds. */\n active_at?: number\n displayed_at?: number | null\n dismissed_at: number | null\n cta_clicked_at?: number | null\n has_been_displayed?: boolean\n is_dismissed: boolean\n is_deleted?: boolean\n is_hidden_by_system?: boolean\n is_obsolete?: boolean\n is_refreshable?: boolean\n is_sampled?: boolean\n is_zero_state?: boolean\n status?: string | null\n /**\n * V2 (LargeTransactionV2 onward): the entities the beat is about, carried on the payload so\n * action blocks do not have to reach back out to the beat envelope.\n */\n primary_account_guid?: string | null\n primary_transaction_guid?: string | null\n primary_category_guid?: string | null\n primary_merchant_guid?: string | null\n /**\n * V2: the repeating transaction a subscription beat is about (Upcoming Subscription, Subscription\n * Price Increase). Read by `recurring_transaction_block`, see\n * `actionBlocks/RecurringTransactionBlock/subscriptionBeats.ts`.\n */\n primary_repeating_transaction_guid?: string | null\n}\n\nexport interface Legends {\n label: string\n value: number\n additional_value?: number\n additional_value_type?: string\n value_type?: string\n}\n\nexport interface Logo {\n category_guid?: string\n category_name?: string\n institution_guid?: string\n institution_name?: string\n logo_color?: string\n /** Draw the `logo_name` icon filled (V2 `ICO-` logos). */\n logo_fill?: boolean\n logo_name?: string\n merchant_guid?: string\n merchant_name?: string\n}\n\nexport interface Subtitle {\n logo?: Logo\n text: string\n}\n\n/**\n * A V2 logo, shared by the header (`InsightsPayload.logo`) and every instance-slot row. It takes\n * one of two shapes:\n *\n * - **Entity**: `guid`, whose prefix (`INS-` / `MCH-` / `CAT-`) picks the logo component, plus an\n * optional `fallback_guid` for when that component's asset cannot load. Today that is the\n * category behind an `MCH-` guid, which `MerchantLogo` shows as a tile when the merchant image\n * is missing.\n * - **Status icon**: `icon` (an mx-icons name, e.g. `warning`) and `color` (a theme palette path,\n * e.g. `error.main`), for subheaders that show a state rather than an entity (V1's\n * `logo_name` / `logo_color`).\n *\n * `alt` is the accessible name for either shape. A logo sends one shape; if it sends both, `icon`\n * wins, as `logo_name` does in V1's `SubHeader`.\n */\nexport interface LogoRef {\n alt?: string\n color?: string\n fallback_guid?: string\n guid?: string\n icon?: string\n}\n\nexport interface CategoryLogo {\n category_guid: string\n category_name: string\n}\n\nexport interface MerchantLogo {\n merchant_guid: string\n merchant_name: string\n}\n\nexport interface InstitutionLogo {\n institution_guid: string\n institution_name: string\n}\n\nexport interface Description {\n text: string\n html_text: string\n}\n\n/**\n * Post message a CTA press sends to the host, resolved by the backend for the beat's current\n * state. Absent/null = the backend has not described one: the frontend uses the template's\n * interim `ctaPostMessages` entry if there is one, else sends no message. `payload` carries only\n * beat-specific extras; the frontend always adds `beat_guid`, `beat_template`, `user_guid` and\n * `action_string`.\n */\nexport interface CtaPostMessageMetadata {\n /** Post message event; defaults to `beat/cta`. */\n event?: string | null\n /** Operation the host should perform, e.g. `op_1`, `op_2`, `op_3`. Defaults to `op_1`. */\n action?: string | null\n /** Beat-specific fields merged into the message metadata (account ids, amounts, ...). */\n payload?: Record<string, unknown> | null\n}\n\nexport interface PrimaryCTA {\n label: string\n block: string\n variant?: string | null\n /**\n * What pressing the CTA does beyond opening its block, named by the backend (ditto\n * `primary_cta_action`, passed through by tupac). Looked up in `insights-v2/ctaActions`;\n * null / absent / unknown means the CTA only opens its block or posts its message.\n */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\nexport interface SecondaryCTA {\n label: string\n /**\n * Drawer block to open. `null` when the CTA opens nothing (ditto `secondary_cta_block: null`,\n * e.g. Fee Detected's \"Contact Support\"): the press posts its message to the host instead.\n */\n block: string | null\n variant?: string | null\n /** See `PrimaryCTA.action_key` (ditto `secondary_cta_action`). */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\n/**\n * The description link: its label, the action block it opens and, like a CTA's, the variant that\n * tells that block what to show (ditto's `in_description_cta_variant`, e.g. `low_balance`). On mini\n * and micro it words the card's action; `block` is empty when that action opens no drawer.\n */\nexport interface InDescriptionCTA {\n label: string\n block?: string\n variant?: string | null\n action_key?: string | null\n /** tupac's flat host message for the link (`action` plus fields), e.g. Switch's op_1. */\n post_message_metadata?: ({ action?: string | null } & Record<string, unknown>) | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\nexport interface Footer {\n /** V1: a pre-formatted date string. */\n date?: string\n /**\n * The account label, on both V1 and V2. The backend resolves the plurality: one account sends\n * its name (e.g. `Epic Bank`), several send a localized count (e.g. `2 Accounts`), none sends\n * `null` (tupac's `footer_account_label` returns nil for a beat with no accounts, as Payday Cash\n * Left Over Status does). There is deliberately no separate `accounts` key.\n */\n account?: string | null\n /**\n * V2 (LargeTransactionV2 onward): unix seconds, formatted by `Footer` for display.\n * Replaces `date`; `date` wins when a beat somehow sends both.\n */\n timestamp?: number\n}\n\n// ============ Instance Slot Types ============\n// Values are the snake_case block names the backend sends on a beat's instance slot; the PascalCase\n// keys stay as friendly references (e.g. BlockType.BarChartBlock === 'bar_chart_block').\nexport const BlockType = {\n AccountBlock: 'account_block',\n AccountSwitchBlock: 'account_switch_block',\n BarChartBlock: 'bar_chart_block',\n BudgetBlock: 'budget_block',\n DirectDepositBlock: 'direct_deposit_block',\n ImageBlock: 'image_block',\n MerchantBlock: 'merchant_block',\n TransactionBlock: 'transaction_block',\n DonutChartBlock: 'donut_chart_block',\n DoubleBarChartBlock: 'double_bar_chart_block',\n DoubleProgressBarBlock: 'double_progress_bar_block',\n DebtsBlock: 'debts_block',\n GasPurchaseBlock: 'gas_purchase_block',\n GoalsBlock: 'goals_block',\n NoSpendDaysBlock: 'no_spend_days_block',\n QuizBlock: 'quiz_block',\n RepeatingTransactionBlock: 'repeating_transaction_block',\n SaveExtraBlock: 'save_extra_block',\n SavingsAmountBlock: 'savings_amount_block',\n SavingsSummaryBlock: 'savings_summary_block',\n StepChartBlock: 'step_chart_block',\n SVGImageBlock: 'svg_image_block',\n UpcomingBillBlock: 'upcoming_bill_block',\n UpcomingSubscriptionBlock: 'upcoming_subscription_block',\n WeeklySmallPurchasesBlock: 'weekly_small_purchases_block',\n WithdrawalBlock: 'withdrawal_block',\n} as const\n\nexport type BlockType = (typeof BlockType)[keyof typeof BlockType]\n\n/**\n * A pre-localized row on a V2 instance slot. The backend resolves the copy and formatting; the\n * logo is a `LogoRef` (an entity guid or a status icon, see `logoFromRef`).\n */\nexport interface InstanceSlotRow {\n amount?: number\n logo?: LogoRef\n primary_text?: string\n secondary_text?: string\n}\n\n/**\n * V2: the slots a block's variant filled, keyed by slot name; ditto owns the names and omits any\n * slot it has no value for (`lib/ditto/blocks/<block>.yml`). Read with `slot()`, which names the\n * kind the caller expects.\n */\nexport interface InstanceSlotData {\n [slot: string]: unknown\n}\n\n/**\n * Reads one slot off a block's `data`; undefined when ditto did not fill it.\n *\n * The caller names the kind, because the slot's kind lives in the block's ditto schema and not\n * here — a block fills slots with whatever its card needs, so no fixed list of kinds would hold\n * (`account_switch_block` alone carries a boolean and `budget_block` a nested object).\n */\nexport const slot = <T = unknown>(\n data: InstanceSlotData | undefined,\n name: string,\n): T | undefined => data?.[name] as T | undefined\n\n/**\n * V2: which block renders this beat's content, and what it renders.\n *\n * `block` is optional: a beat whose template has no ditto config arrives as an empty `{}` and the\n * card renders its copy and CTAs alone, so a reader cannot assume a block is named. One interface\n * with `block` optional rather than a union with `Record<string, never>`, which TypeScript absorbs\n * — that union left `block` reading as required and typed a promise it did not keep.\n *\n * `variant` is optional for the same reason — the empty `{}` carries neither. Every ditto beat\n * file that names a block also names a variant, so a *filled* slot always has one; ditto drops a\n * nil variant rather than sending null, which is why the type is `string | null | undefined`.\n */\nexport interface InstanceSlot {\n block?: BlockType\n variant?: string | null\n /** The slots this block's variant declares in ditto. */\n data?: InstanceSlotData\n // Direct Deposit block (Set Up Direct Deposit, Switch Direct Deposit, Missing\n // Interest Rate): account facts carried flat on the slot, beside `data`.\n /** Primary line on the hero card, e.g. \"Epic Bank Checking, *1234\". */\n account_name?: string\n /** Secondary line beneath the name, e.g. \"Checking Account\" / \"Credit Card\". */\n account_type?: string\n /** Status pill label, e.g. \"Direct Deposit Not Set Up\" / \"Interest Rate: 19.99% APR\". */\n status_text?: string\n institution_guid?: string\n institution_name?: string\n // Shared across multiple V2 component blocks:\n // `amount` — UpcomingBillBlock (projected bill), UpcomingSubscriptionBlock (price per cadence).\n // (SavingsOpportunityBlock now reads `amount` off `instance_slot.data`, not this flat field.)\n // `merchant_guid` / `merchant_name` — UpcomingBillBlock (bill row logo + name),\n // UpcomingSubscriptionBlock (hero logo + name).\n /** Dollar amount (unformatted); the block formats it as currency. */\n amount?: number\n // Withdrawal block (Emergency Fund Withdrawal): one row flat on the slot - `amount` above is the\n // withdrawal, shown with its date line \"{amount_label} {withdrawal_date}\" over the balance row.\n /** Pre-localized lead-in for the date line, e.g. \"Withdrawn on\". */\n amount_label?: string\n /** The withdrawal's calendar day, `YYYY-MM-DD` (e.g. `2026-10-20`); the card formats it. */\n withdrawal_date?: string\n /** Account balance after the withdrawal (unformatted); the card formats it as currency. */\n balance?: number\n /** Pre-localized label for the balance row, e.g. \"Balance\". */\n balance_label?: string\n /** Merchant guid used to render the inline / hero logo via `LogoFromGuid` (`MCH-...`). */\n merchant_guid?: string\n /** Merchant display name — shown as logo alt text and as the merchant/hero label. */\n merchant_name?: string\n // Upcoming Bill block (Projected Bill Payment): the block derives the Sun→Sat week strip\n // around `due_date` at render time.\n /** Due date of the projected bill in ISO form (e.g. `2025-10-30`). */\n due_date?: string\n // Account block (confetti tile): V1 flat fallback for the label line when `instance_slot.data` is\n // absent — `AccountBlock` reads `data.sub_text` first, then this. (The Savings Opportunity coupon\n // now reads `primary_text`/`amount` off `data`, so it no longer reads this flat field.)\n /** Caption/label line for the confetti tile (V1 fallback). */\n label?: string\n // Upcoming Subscription block: billing cadence for the price pill (`${amount} / ${cadence}`).\n /** Billing cadence word that trails the price, e.g. `month` or `year`. */\n cadence?: string\n // Account block (status on/off-track, deposit, payoff variants): card content carried flat on\n // the slot (the V2 contract drops `instance_slot_data`). `amount`, `label`, `merchant_guid`,\n // `merchant_name`, `institution_guid`, `institution_name` are shared fields declared above.\n /** Secondary line beneath the amount on the standard card, e.g. \"Remaining after expenses\". */\n sub_text?: string\n /** Header bar text (standard card) or the colored category strip label (deposit cards). */\n header_text?: string\n /** Generic-tile icon name used when no merchant/institution logo is available. */\n icon_name?: string\n /** Category guid used to render the deposit-card logo fallback. */\n category_guid?: string\n // Debts block: `amount` is the current balance; the shared account/institution fields above.\n /** Projected payoff date in ISO form (e.g. `2027-03-01`); the block formats it as month + year. */\n payoff_date?: string\n /** Monthly payment toward the debt (unformatted); the block formats it as currency. */\n monthly_payment?: number\n /** Annual interest rate as a percentage (e.g. `19.99`); the block formats it as a percent. */\n interest_rate?: number\n start_date?: string\n no_spend_days?: string[]\n /** First day of the month a monthly summary covers, in ISO form (e.g. `2026-09-01`). */\n date?: string\n /** Number of gas station visits in the month. */\n total_fill_up_visits?: number\n /** Amount spent at gas stations in the month, unformatted. */\n total_spend?: number\n /** V1 name for `total_spend`, read when `total_spend` is absent. */\n total_debt_for_fill_up_visits_in_prev_month?: number\n /** Total available balance across the user's accounts, unformatted. */\n available_balance?: number\n /** Average monthly spend, unformatted. */\n avg_monthly_spend?: number\n /** How long the balance lasts, e.g. \"2 months, 11 days\". */\n time_period?: string\n /** One row per unique merchant in the period, in the order sent. */\n data_series?: InstanceSlotRow[]\n}\n"],"mappings":"AA+UA,IAAa,IAAA,CACX,GACA,MACkB,IAAO,CAAA"}
1
+ {"version":3,"file":"Insights.es.js","names":[],"sources":["../../../src/core/types/Insights.ts"],"sourcesContent":["// ============ Core InsightsV2 Types ============\n\nimport type { DataSeries } from './Beat'\nimport { InsightsInstanceSlotData } from './InsightsInstanceSlotData'\n\nexport interface ThemedSVGImageProps {\n divProps?: React.HTMLAttributes<HTMLDivElement>\n image: React.ComponentType<React.SVGProps<SVGSVGElement>>\n isMini?: boolean\n}\n\n/**\n * Emitted by a block when the user drills into a specific datum (e.g. clicks a\n * chart bar). Named fields rather than positional args so blocks with differing\n * shapes can extend this without the call sites transposing values.\n */\nexport interface DrilldownPayload {\n chartBarIndex: number\n tabIndex?: number\n transaction_guid?: string\n block?: string\n}\n\n/**\n * Which envelope a beat was fetched with. `embedded` (the transaction-row pill + details-drawer\n * card) and `notification` are V2 additions; a surface asks for one with `widget_type=` on the fetch.\n */\nexport type WidgetType = 'full' | 'mini' | 'micro' | 'embedded' | 'notification'\n\n/**\n * V2: the transaction-row tag, its own small section of the `embedded` envelope (the same grammar\n * as `description` / `footer`, with room for a tone or an icon later). Omitted for an insight that\n * tags no transaction row. It deliberately is *not* `short_title`, which stays a per-variant\n * attribute with a second consumer (the bank-holiday sub-header).\n */\nexport interface Pill {\n text: string\n}\n\n/** A row in a drilldown list fact (e.g. the Subscriptions drawer's per-transaction schedule). */\nexport type DrilldownRow = Record<string, string | number | boolean | null>\n\n/**\n * V2: facts a drilldown shows that the card does not. On the payload: what every CTA of the card\n * shares (e.g. the account number for the Transaction Details drawer, or the guid list a list drawer\n * shows, `transaction_guids`). On a CTA: the figures that CTA's own drilldown renders (the Transaction\n * List summary header's `amount`, `start_date` / `end_date` and `count`, see `readSummary`). Scalars,\n * string lists, a `data_series` (the months a history drawer charts), or rows of scalars\n * (`transaction_frequencies`), omitted when the insight has none. Never carries copy or user actions\n * (memo, tags, hide, flag come from the transaction store). Values come from the server, so a reader\n * still checks each value's runtime shape.\n */\nexport type DrilldownData = Record<\n string,\n string | number | boolean | null | string[] | DataSeries | DrilldownRow[]\n>\n\nexport interface InsightsPayload {\n widget_type: WidgetType\n instance_slot: InstanceSlot\n /**\n * V1 only. The v2 contract carries everything a block needs on `instance_slot.data`,\n * and omits this key entirely (see the LargeTransactionV2 payload). Blocks that still require it\n * get it as a required field through `BlockProps`, which re-declares it.\n */\n instance_slot_data?: InsightsInstanceSlotData\n description: Description\n primary_cta?: PrimaryCTA\n secondary_cta?: SecondaryCTA\n title?: string\n sub_title?: Subtitle\n /**\n * V2 rename of `sub_title`: a flat string, with the logo promoted to the payload-level `logo`\n * field below. `sub_title` wins when both are present.\n */\n subtitle?: string\n /** V2: header logo paired with the flat `subtitle`: an entity guid or a status icon (`LogoRef`). */\n logo?: LogoRef\n /** V2: which design branch the backend picked (e.g. `no_merchant`). */\n variant?: string\n /** V2, `embedded` envelope only: the transaction-row pill. */\n pill?: Pill\n /**\n * V2: drilldown-only facts, e.g. `{ account_number: 'XXXXXXXX043' }`, or the guid list a list\n * drawer shows (`{ transaction_guids: [...] }`).\n */\n drilldown_data?: DrilldownData\n footer?: Footer\n /**\n * V2: the link inside the description: on the full card a drawer of its own (Low Account\n * Balance's \"Transactions ›\"); on mini and micro the card's action, sent instead of `primary_cta`.\n * Absent when the beat has no link.\n */\n in_description_cta?: InDescriptionCTA\n guid: string\n user_guid: string\n client_guid?: string\n /** Template name, e.g. `LargeTransactionV2`. */\n template?: string\n revision?: number\n /** Unix seconds. */\n created_at?: number\n /** Unix seconds. */\n updated_at?: number\n /** Unix seconds. */\n active_at?: number\n displayed_at?: number | null\n dismissed_at: number | null\n cta_clicked_at?: number | null\n has_been_displayed?: boolean\n is_dismissed: boolean\n is_deleted?: boolean\n is_hidden_by_system?: boolean\n is_obsolete?: boolean\n is_refreshable?: boolean\n is_sampled?: boolean\n is_zero_state?: boolean\n status?: string | null\n /**\n * V2 (LargeTransactionV2 onward): the entities the beat is about, carried on the payload so\n * action blocks do not have to reach back out to the beat envelope.\n */\n primary_account_guid?: string | null\n primary_transaction_guid?: string | null\n primary_category_guid?: string | null\n primary_merchant_guid?: string | null\n /**\n * V2: the repeating transaction a subscription beat is about (Upcoming Subscription, Subscription\n * Price Increase). Read by `recurring_transaction_block`, see\n * `actionBlocks/RecurringTransactionBlock/subscriptionBeats.ts`.\n */\n primary_repeating_transaction_guid?: string | null\n}\n\nexport interface Legends {\n label: string\n value: number\n additional_value?: number\n additional_value_type?: string\n value_type?: string\n}\n\nexport interface Logo {\n category_guid?: string\n category_name?: string\n institution_guid?: string\n institution_name?: string\n logo_color?: string\n /** Draw the `logo_name` icon filled (V2 `ICO-` logos). */\n logo_fill?: boolean\n logo_name?: string\n merchant_guid?: string\n merchant_name?: string\n}\n\nexport interface Subtitle {\n logo?: Logo\n text: string\n}\n\n/**\n * A V2 logo, shared by the header (`InsightsPayload.logo`) and every instance-slot row. It takes\n * one of two shapes:\n *\n * - **Entity**: `guid`, whose prefix (`INS-` / `MCH-` / `CAT-`) picks the logo component, plus an\n * optional `fallback_guid` for when that component's asset cannot load. Today that is the\n * category behind an `MCH-` guid, which `MerchantLogo` shows as a tile when the merchant image\n * is missing.\n * - **Status icon**: `icon` (an mx-icons name, e.g. `warning`) and `color` (a theme palette path,\n * e.g. `error.main`), for subheaders that show a state rather than an entity (V1's\n * `logo_name` / `logo_color`).\n *\n * `alt` is the accessible name for either shape. A logo sends one shape; if it sends both, `icon`\n * wins, as `logo_name` does in V1's `SubHeader`.\n */\nexport interface LogoRef {\n alt?: string\n color?: string\n fallback_guid?: string\n guid?: string\n icon?: string\n}\n\nexport interface CategoryLogo {\n category_guid: string\n category_name: string\n}\n\nexport interface MerchantLogo {\n merchant_guid: string\n merchant_name: string\n}\n\nexport interface InstitutionLogo {\n institution_guid: string\n institution_name: string\n}\n\nexport interface Description {\n text: string\n html_text: string\n}\n\n/**\n * Post message a CTA press sends to the host, resolved by the backend for the beat's current\n * state. Absent/null = the backend has not described one: the frontend uses the template's\n * interim `ctaPostMessages` entry if there is one, else sends no message. `payload` carries only\n * beat-specific extras; the frontend always adds `beat_guid`, `beat_template`, `user_guid` and\n * `action_string`.\n */\nexport interface CtaPostMessageMetadata {\n /** Post message event; defaults to `beat/cta`. */\n event?: string | null\n /** Operation the host should perform, e.g. `op_1`, `op_2`, `op_3`. Defaults to `op_1`. */\n action?: string | null\n /** Beat-specific fields merged into the message metadata (account ids, amounts, ...). */\n payload?: Record<string, unknown> | null\n}\n\nexport interface PrimaryCTA {\n label: string\n block: string\n variant?: string | null\n /**\n * What pressing the CTA does beyond opening its block, named by the backend (ditto\n * `primary_cta_action`, passed through by tupac). Looked up in `insights-v2/ctaActions`;\n * null / absent / unknown means the CTA only opens its block or posts its message.\n */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\nexport interface SecondaryCTA {\n label: string\n /**\n * Drawer block to open. `null` when the CTA opens nothing (ditto `secondary_cta_block: null`,\n * e.g. Fee Detected's \"Contact Support\"): the press posts its message to the host instead.\n */\n block: string | null\n variant?: string | null\n /** See `PrimaryCTA.action_key` (ditto `secondary_cta_action`). */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\n/**\n * The description link: its label, the action block it opens and, like a CTA's, the variant that\n * tells that block what to show (ditto's `in_description_cta_variant`, e.g. `low_balance`). On mini\n * and micro it words the card's action; `block` is empty when that action opens no drawer.\n */\nexport interface InDescriptionCTA {\n label: string\n block?: string\n variant?: string | null\n action_key?: string | null\n /** tupac's flat host message for the link (`action` plus fields), e.g. Switch's op_1. */\n post_message_metadata?: ({ action?: string | null } & Record<string, unknown>) | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\nexport interface Footer {\n /** V1: a pre-formatted date string. */\n date?: string\n /**\n * The account label, on both V1 and V2. The backend resolves the plurality: one account sends\n * its name (e.g. `Epic Bank`), several send a localized count (e.g. `2 Accounts`), none sends\n * `null` (tupac's `footer_account_label` returns nil for a beat with no accounts, as Payday Cash\n * Left Over Status does). There is deliberately no separate `accounts` key.\n */\n account?: string | null\n /**\n * V2 (LargeTransactionV2 onward): unix seconds, formatted by `Footer` for display.\n * Replaces `date`; `date` wins when a beat somehow sends both.\n */\n timestamp?: number\n}\n\n// ============ Instance Slot Types ============\n// Values are the snake_case block names the backend sends on a beat's instance slot; the PascalCase\n// keys stay as friendly references (e.g. BlockType.BarChartBlock === 'bar_chart_block').\nexport const BlockType = {\n AccountBlock: 'account_block',\n AccountSwitchBlock: 'account_switch_block',\n BarChartBlock: 'bar_chart_block',\n BudgetBlock: 'budget_block',\n DirectDepositBlock: 'direct_deposit_block',\n ImageBlock: 'image_block',\n MerchantBlock: 'merchant_block',\n TransactionBlock: 'transaction_block',\n DonutChartBlock: 'donut_chart_block',\n DoubleBarChartBlock: 'double_bar_chart_block',\n DoubleProgressBarBlock: 'double_progress_bar_block',\n DebtsBlock: 'debts_block',\n GasPurchaseBlock: 'gas_purchase_block',\n GoalsBlock: 'goals_block',\n NoSpendDaysBlock: 'no_spend_days_block',\n QuizBlock: 'quiz_block',\n RepeatingTransactionBlock: 'repeating_transaction_block',\n SaveExtraBlock: 'save_extra_block',\n SavingsAmountBlock: 'savings_amount_block',\n SavingsSummaryBlock: 'savings_summary_block',\n StepChartBlock: 'step_chart_block',\n SVGImageBlock: 'svg_image_block',\n UpcomingBillBlock: 'upcoming_bill_block',\n UpcomingSubscriptionBlock: 'upcoming_subscription_block',\n WeeklySmallPurchasesBlock: 'weekly_small_purchases_block',\n WithdrawalBlock: 'withdrawal_block',\n} as const\n\nexport type BlockType = (typeof BlockType)[keyof typeof BlockType]\n\n/**\n * A pre-localized row on a V2 instance slot. The backend resolves the copy and formatting; the\n * logo is a `LogoRef` (an entity guid or a status icon, see `logoFromRef`).\n */\nexport interface InstanceSlotRow {\n amount?: number\n logo?: LogoRef\n primary_text?: string\n secondary_text?: string\n}\n\n/**\n * V2: the slots a block's variant filled, keyed by slot name; ditto owns the names and omits any\n * slot it has no value for (`lib/ditto/blocks/<block>.yml`). Read with `slot()`, which names the\n * kind the caller expects.\n */\nexport interface InstanceSlotData {\n [slot: string]: unknown\n}\n\n/**\n * Reads one slot off a block's `data`; undefined when ditto did not fill it.\n *\n * The caller names the kind, because the slot's kind lives in the block's ditto schema and not\n * here — a block fills slots with whatever its card needs, so no fixed list of kinds would hold\n * (`account_switch_block` alone carries a boolean and `budget_block` a nested object).\n */\nexport const slot = <T = unknown>(\n data: InstanceSlotData | undefined,\n name: string,\n): T | undefined => data?.[name] as T | undefined\n\n/**\n * V2: which block renders this beat's content, and what it renders.\n *\n * `block` is optional: a beat whose template has no ditto config arrives as an empty `{}` and the\n * card renders its copy and CTAs alone, so a reader cannot assume a block is named. One interface\n * with `block` optional rather than a union with `Record<string, never>`, which TypeScript absorbs\n * — that union left `block` reading as required and typed a promise it did not keep.\n *\n * `variant` is optional for the same reason — the empty `{}` carries neither. Every ditto beat\n * file that names a block also names a variant, so a *filled* slot always has one; ditto drops a\n * nil variant rather than sending null, which is why the type is `string | null | undefined`.\n */\nexport interface InstanceSlot {\n block?: BlockType\n variant?: string | null\n /** The slots this block's variant declares in ditto. */\n data?: InstanceSlotData\n // Direct Deposit block (Set Up Direct Deposit, Switch Direct Deposit, Missing\n // Interest Rate): account facts carried flat on the slot, beside `data`.\n /** Primary line on the hero card, e.g. \"Epic Bank Checking, *1234\". */\n account_name?: string\n /** Secondary line beneath the name, e.g. \"Checking Account\" / \"Credit Card\". */\n account_type?: string\n /** Status pill label, e.g. \"Direct Deposit Not Set Up\" / \"Interest Rate: 19.99% APR\". */\n status_text?: string\n institution_guid?: string\n institution_name?: string\n // Shared across multiple V2 component blocks:\n // `amount` — UpcomingBillBlock (projected bill), UpcomingSubscriptionBlock (price per cadence).\n // (SavingsOpportunityBlock now reads `amount` off `instance_slot.data`, not this flat field.)\n // `merchant_guid` / `merchant_name` — UpcomingBillBlock (bill row logo + name),\n // UpcomingSubscriptionBlock (hero logo + name).\n /** Dollar amount (unformatted); the block formats it as currency. */\n amount?: number\n // Withdrawal block (Emergency Fund Withdrawal): one row flat on the slot - `amount` above is the\n // withdrawal, shown with its date line \"{amount_label} {withdrawal_date}\" over the balance row.\n /** Pre-localized lead-in for the date line, e.g. \"Withdrawn on\". */\n amount_label?: string\n /** The withdrawal's calendar day, `YYYY-MM-DD` (e.g. `2026-10-20`); the card formats it. */\n withdrawal_date?: string\n /** Account balance after the withdrawal (unformatted); the card formats it as currency. */\n balance?: number\n /** Pre-localized label for the balance row, e.g. \"Balance\". */\n balance_label?: string\n /** Merchant guid used to render the inline / hero logo via `LogoFromGuid` (`MCH-...`). */\n merchant_guid?: string\n /** Merchant display name — shown as logo alt text and as the merchant/hero label. */\n merchant_name?: string\n // Upcoming Bill block (Projected Bill Payment): the block derives the Sun→Sat week strip\n // around `due_date` at render time.\n /** Due date of the projected bill in ISO form (e.g. `2025-10-30`). */\n due_date?: string\n // Account block (confetti tile): V1 flat fallback for the label line when `instance_slot.data` is\n // absent — `AccountBlock` reads `data.sub_text` first, then this. (The Savings Opportunity coupon\n // now reads `primary_text`/`amount` off `data`, so it no longer reads this flat field.)\n /** Caption/label line for the confetti tile (V1 fallback). */\n label?: string\n // Upcoming Subscription block: billing cadence for the price pill (`${amount} / ${cadence}`).\n /** Billing cadence word that trails the price, e.g. `month` or `year`. */\n cadence?: string\n // Account block (status on/off-track, deposit, payoff variants): card content carried flat on\n // the slot (the V2 contract drops `instance_slot_data`). `amount`, `label`, `merchant_guid`,\n // `merchant_name`, `institution_guid`, `institution_name` are shared fields declared above.\n /** Secondary line beneath the amount on the standard card, e.g. \"Remaining after expenses\". */\n sub_text?: string\n /** Header bar text (standard card) or the colored category strip label (deposit cards). */\n header_text?: string\n /** Generic-tile icon name used when no merchant/institution logo is available. */\n icon_name?: string\n /** Category guid used to render the deposit-card logo fallback. */\n category_guid?: string\n // Debts block: `amount` is the current balance; the shared account/institution fields above.\n /** Projected payoff date in ISO form (e.g. `2027-03-01`); the block formats it as month + year. */\n payoff_date?: string\n /** Monthly payment toward the debt (unformatted); the block formats it as currency. */\n monthly_payment?: number\n /** Annual interest rate as a percentage (e.g. `19.99`); the block formats it as a percent. */\n interest_rate?: number\n start_date?: string\n no_spend_days?: string[]\n /** First day of the month a monthly summary covers, in ISO form (e.g. `2026-09-01`). */\n date?: string\n /** Number of gas station visits in the month. */\n total_fill_up_visits?: number\n /** Amount spent at gas stations in the month, unformatted. */\n total_spend?: number\n /** V1 name for `total_spend`, read when `total_spend` is absent. */\n total_debt_for_fill_up_visits_in_prev_month?: number\n /** Total available balance across the user's accounts, unformatted. */\n available_balance?: number\n /** Average monthly spend, unformatted. */\n avg_monthly_spend?: number\n /** How long the balance lasts, e.g. \"2 months, 11 days\". */\n time_period?: string\n /** One row per unique merchant in the period, in the order sent. */\n data_series?: InstanceSlotRow[]\n}\n"],"mappings":"AAuVA,IAAa,IAAA,CACX,GACA,MACkB,IAAO,CAAA"}
@@ -2,7 +2,7 @@
2
2
  interface DynamicKeyValue {
3
3
  [key: string]: string;
4
4
  }
5
- interface GeneralInsightsFeedCopy {
5
+ export interface GeneralInsightsFeedCopy {
6
6
  decreased_text: string;
7
7
  dismiss: string;
8
8
  embedded_description: string;
@@ -51,6 +51,36 @@ interface GeneralInsightsFeedCopy {
51
51
  subscribed?: string;
52
52
  not_subscribed?: string;
53
53
  undo?: string;
54
+ /** Debt Payoff Strategies drawer words (the pulse drawer's keys); optional until mrs_content ships them to every host. */
55
+ avalanche?: string;
56
+ snowball?: string;
57
+ debt_payoff_strategies?: string;
58
+ the_strategy?: string;
59
+ pros?: string;
60
+ cons?: string;
61
+ pay_off_debts_with_high_interest_rates_first?: string;
62
+ pay_off_debts_with_low_balances_first?: string;
63
+ fastest_way_to_eliminate_debt?: string;
64
+ costs_less_in_interest?: string;
65
+ takes_time_to_see_results?: string;
66
+ requires_patience_and_discipline?: string;
67
+ provides_small_wins_quickly?: string;
68
+ builds_momentum_to_pay_off_debts?: string;
69
+ takes_longer_to_pay_off_all_debts?: string;
70
+ may_cost_more_in_interest?: string;
71
+ how_to_get_started?: string;
72
+ step_one?: string;
73
+ step_two?: string;
74
+ step_three?: string;
75
+ make_minimum_monthly_payments_on_all_debt_accounts?: string;
76
+ when_possible_pay_extra_on_the_account_with_the_highest_interest_rate?: string;
77
+ when_possible_pay_extra_on_the_account_with_the_lowest_balance?: string;
78
+ when_paid_off_move_to_the_next_debt_with_the_highest?: string;
79
+ when_paid_off_move_to_the_next_debt_with_the_lowest?: string;
80
+ highest_to_lowest_rate?: string;
81
+ lowest_to_highest_balance?: string;
82
+ balance?: string;
83
+ interest_rate?: string;
54
84
  }
55
85
  interface SettingsMenuCopy {
56
86
  close: string;
@@ -124,6 +154,8 @@ export interface TransactionHistoryBlock {
124
154
  non_essential_category_summary_drawer_title: string;
125
155
  monthly_deposit_summary_drawer_title: string;
126
156
  monthly_subscription_aggregate_drawer_title: string;
157
+ /** Merchant Budget's Spending History drawer; optional until the localized-content service ships it. */
158
+ merchant_budget_drawer_title?: string;
127
159
  /** Upcoming Bill tip: `_1{tip}`, `_2{merchant}`, `_3{date}`; optional, no tip without it. */
128
160
  upcoming_bill_tip_message?: string;
129
161
  /**
@@ -142,6 +174,12 @@ export interface TransactionHistoryBlock {
142
174
  }
143
175
  export interface TransactionListBlockCopy {
144
176
  deposit_history_drawer_title?: string;
177
+ /** The Subscriptions drawer's title (Monthly Subscription Aggregate V2). */
178
+ subscriptions_drawer_title?: string;
179
+ /** `_1{month}`: the count tile's caption, e.g. "Subscriptions in October". */
180
+ subscriptions_in_month?: string;
181
+ /** `_1{tip}`: the tip under the count tile; `_1` is the bold `general.tip_section_title`. No tip without it. */
182
+ subscriptions_tip_message?: string;
145
183
  }
146
184
  export interface HiddenConfirmationCopy {
147
185
  title: string;
@@ -107,9 +107,8 @@ var W = ({ copy: o, leading: t }) => /* @__PURE__ */ r(a, {
107
107
  })
108
108
  }), L = ({ availableBalances: o, date: t, copy: n }) => /* @__PURE__ */ r(a, {
109
109
  sx: {
110
- pt: 6,
111
- pb: 14,
112
110
  px: 24,
111
+ py: 14,
113
112
  textAlign: "right",
114
113
  gap: 4
115
114
  },
@@ -127,9 +126,9 @@ var W = ({ copy: o, leading: t }) => /* @__PURE__ */ r(a, {
127
126
  children: C(n.your_available_balances_text, t)
128
127
  })]
129
128
  }), B = ({ bodyContent: o, bodyDescription: t, monthsTable: n, deltaAmount: c, initialAmount: s, seedAmount: l, copy: m }) => {
130
- const [p, g] = f.useState(s ?? l ?? 0);
129
+ const [g, p] = f.useState(s ?? l ?? 0);
131
130
  f.useEffect(() => {
132
- s == null && l != null && g(l);
131
+ s == null && l != null && p(l);
133
132
  }, [s, l]);
134
133
  const b = n.length - 1;
135
134
  return /* @__PURE__ */ r(_, { children: [/* @__PURE__ */ r(a, {
@@ -143,10 +142,10 @@ var W = ({ copy: o, leading: t }) => /* @__PURE__ */ r(a, {
143
142
  variant: "body1",
144
143
  children: o
145
144
  }), /* @__PURE__ */ e(w, {
146
- amount: h(p, d.cents),
145
+ amount: h(g, d.cents),
147
146
  copy: m,
148
- onDecrement: () => g((x) => Math.max(0, x - c)),
149
- onIncrement: () => g((x) => x + c)
147
+ onDecrement: () => p((x) => Math.max(0, x - c)),
148
+ onIncrement: () => p((x) => x + c)
150
149
  })]
151
150
  }), /* @__PURE__ */ r(a, {
152
151
  sx: { gap: 8 },
@@ -189,7 +188,7 @@ var W = ({ copy: o, leading: t }) => /* @__PURE__ */ r(a, {
189
188
  sx: { fontWeight: 600 },
190
189
  truncate: !1,
191
190
  variant: "body1",
192
- children: h(v * p, d.whole)
191
+ children: h(v * g, d.whole)
193
192
  })]
194
193
  })
195
194
  })
@@ -200,7 +199,7 @@ var W = ({ copy: o, leading: t }) => /* @__PURE__ */ r(a, {
200
199
  })]
201
200
  })] });
202
201
  }, $ = ({ variant: o, slotData: t, copy: n }) => {
203
- const c = o === R.SAVE_ENOUGH_TO_LIVE_ON, s = S[o], l = t?.available_balance, m = u(t?.avg_monthly_spend), p = u(t?.upcoming_expenses), g = u(t?.total_remaining), b = t?.time_period, x = t?.date;
202
+ const c = o === R.SAVE_ENOUGH_TO_LIVE_ON, s = S[o], l = t?.available_balance, m = u(t?.avg_monthly_spend), g = u(t?.upcoming_expenses), p = u(t?.total_remaining), b = t?.time_period, x = t?.date;
204
203
  return /* @__PURE__ */ r(_, { children: [
205
204
  /* @__PURE__ */ e(W, {
206
205
  copy: n,
@@ -216,11 +215,11 @@ var W = ({ copy: o, leading: t }) => /* @__PURE__ */ r(a, {
216
215
  }
217
216
  }) : null
218
217
  }),
219
- !c && l != null && p != null && /* @__PURE__ */ e(k, {
218
+ !c && l != null && g != null && /* @__PURE__ */ e(k, {
220
219
  availableBalances: l,
221
220
  copy: n,
222
- expenses: p,
223
- totalRemaining: g
221
+ expenses: g,
222
+ totalRemaining: p
224
223
  }),
225
224
  /* @__PURE__ */ e(B, {
226
225
  bodyContent: n[s.contentKey],
@@ -1 +1 @@
1
- {"version":3,"file":"MakeTransferActionBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlock.tsx"],"sourcesContent":["import React, { type ReactNode } from 'react'\nimport { Card, Divider, List, ListItem, Stack } from '@mui/material'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { buildDynamicCopy, type MakeTransferCopy } from '../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\n\nimport { BalanceStepper } from './BalanceStepper'\nimport SaveEnoughToLiveOnBottomSection from './SaveEnoughToLiveOnBottomSection'\nimport {\n PROJECTIONS,\n toNumber,\n variants,\n type MakeTransferVariant,\n type MakeTransferVariantProps,\n type MonthRow,\n} from './layout'\n\n// ============================================================================\n// Section building blocks (block-local)\n// ============================================================================\n\n/** Bordered title + description, with an optional `leading` slot. */\nconst Header = ({ copy, leading }: { copy: MakeTransferCopy; leading?: ReactNode }) => (\n <Stack\n sx={{ bgcolor: 'background.paper', p: 24, borderBottom: '1px solid', borderColor: 'divider' }}\n >\n {leading}\n <Stack sx={{ gap: 8 }}>\n <Text variant=\"h3\">{copy.header_content}</Text>\n <Text sx={{ lineHeight: '24px' }} truncate={false} variant=\"body1\">\n {copy.description}\n </Text>\n </Stack>\n </Stack>\n)\n\n/** Save-extra only: available − expenses = total remaining. */\nconst RemainingCard = ({\n availableBalances,\n expenses,\n totalRemaining,\n copy,\n}: {\n availableBalances: number\n expenses: number\n totalRemaining?: number\n copy: MakeTransferCopy\n}) => (\n <Stack sx={{ pt: 24, px: 24 }}>\n <Card sx={{ px: 16, pt: 16, pb: 12 }}>\n <Stack\n sx={{\n border: 1,\n borderColor: 'divider',\n borderRadius: '4px',\n gap: 12,\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n p: 8,\n mb: 12,\n }}\n >\n <Stack sx={{ width: 155, textAlign: 'center' }}>\n <Text sx={{ fontWeight: 600 }} variant=\"body1\">\n {formatCurrency(availableBalances, CURRENCY_FORMAT.cents)}\n </Text>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n {copy.available_text}\n </Text>\n </Stack>\n <Icon name=\"remove\" size={20} />\n <Stack sx={{ width: 155, textAlign: 'center' }}>\n <Text sx={{ fontWeight: 600 }} variant=\"body1\">\n {formatCurrency(expenses, CURRENCY_FORMAT.cents)}\n </Text>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n {copy.expenses_text}\n </Text>\n </Stack>\n </Stack>\n <Stack\n sx={{\n textAlign: 'center',\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n gap: 4,\n }}\n >\n <Text sx={{ color: 'text.secondary' }} variant=\"body2\">\n {copy.total_remaining_text}:\n </Text>\n <Text sx={{ fontWeight: 600 }} variant=\"body2\">\n {formatCurrency(totalRemaining, CURRENCY_FORMAT.cents)}\n </Text>\n </Stack>\n </Card>\n </Stack>\n)\n\n/** Save-enough only: total available balances as of a date. */\nconst TotalsFooter = ({\n availableBalances,\n date,\n copy,\n}: {\n availableBalances: number\n date?: string\n copy: MakeTransferCopy\n}) => (\n <Stack sx={{ pt: 6, pb: 14, px: 24, textAlign: 'right', gap: 4 }}>\n <Text truncate={false} variant=\"h3\">\n {formatCurrency(availableBalances, CURRENCY_FORMAT.cents)}\n </Text>\n {date && (\n <Text sx={{ color: 'text.secondary', fontWeight: 400 }} truncate={false} variant=\"subtitle2\">\n {buildDynamicCopy(copy.your_available_balances_text, date) as string}\n </Text>\n )}\n </Stack>\n)\n\n/** Stepper + projected-savings table. Owns the amount state so both stay in sync. */\nconst SavingsProjection = ({\n bodyContent,\n bodyDescription,\n monthsTable,\n deltaAmount,\n initialAmount,\n seedAmount,\n copy,\n}: {\n bodyContent: string\n bodyDescription: string\n monthsTable: readonly MonthRow[]\n deltaAmount: number\n /** Fixed starting amount; when null, seeds from `seedAmount` once it resolves. */\n initialAmount: number | null\n seedAmount?: number\n copy: MakeTransferCopy\n}) => {\n const [amount, setAmount] = React.useState(initialAmount ?? seedAmount ?? 0)\n\n React.useEffect(() => {\n if (initialAmount == null && seedAmount != null) {\n setAmount(seedAmount)\n }\n }, [initialAmount, seedAmount])\n\n const lastRowIndex = monthsTable.length - 1\n\n return (\n <>\n <Stack sx={{ p: 24, gap: 8 }}>\n <Text sx={{ fontWeight: 600 }} truncate={false} variant=\"body1\">\n {bodyContent}\n </Text>\n <BalanceStepper\n amount={formatCurrency(amount, CURRENCY_FORMAT.cents)}\n copy={copy}\n onDecrement={() => setAmount((prev) => Math.max(0, prev - deltaAmount))}\n onIncrement={() => setAmount((prev) => prev + deltaAmount)}\n />\n </Stack>\n <Stack sx={{ gap: 8 }}>\n <Text sx={{ fontWeight: 600, mx: 24 }} truncate={false} variant=\"body1\">\n {bodyDescription}\n </Text>\n <List sx={{ bgcolor: 'background.paper', width: '100%' }}>\n {monthsTable.map(({ label, value }, index) => (\n <React.Fragment key={value}>\n <ListItem\n disableGutters={true}\n disablePadding={true}\n sx={{ minHeight: 52, bgcolor: 'background.paper' }}\n >\n <Stack sx={{ width: '100%' }}>\n <Stack\n sx={{\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n width: '100%',\n px: 24,\n py: 8,\n }}\n >\n <Text truncate={false} variant=\"body1\">\n {label}\n </Text>\n <Text sx={{ fontWeight: 600 }} truncate={false} variant=\"body1\">\n {formatCurrency(value * amount, CURRENCY_FORMAT.whole)}\n </Text>\n </Stack>\n </Stack>\n </ListItem>\n <Divider component=\"li\" sx={{ ml: index === lastRowIndex ? 0 : 24 }} />\n </React.Fragment>\n ))}\n </List>\n </Stack>\n </>\n )\n}\n\n// ============================================================================\n// Block — both variants share the header and the stepper/table (settings from\n// PROJECTIONS in layout.ts); only the sections around them differ.\n// ============================================================================\n\nexport const MakeTransferActionBlock = ({\n variant,\n slotData,\n copy,\n}: MakeTransferVariantProps & { variant: MakeTransferVariant }) => {\n const isSaveEnough = variant === variants.SAVE_ENOUGH_TO_LIVE_ON\n const projection = PROJECTIONS[variant]\n\n const availableBalances = slotData?.available_balance\n const averageMonthlySpend = toNumber(slotData?.avg_monthly_spend)\n const expenses = toNumber(slotData?.upcoming_expenses)\n const totalRemaining = toNumber(slotData?.total_remaining)\n const svgDateContent = slotData?.time_period\n const date = slotData?.date\n\n return (\n <>\n <Header\n copy={copy}\n leading={\n isSaveEnough &&\n availableBalances != null &&\n averageMonthlySpend != null &&\n svgDateContent ? (\n <SaveEnoughToLiveOnBottomSection\n content={svgDateContent}\n leftLabel={copy.available_balances_text}\n leftValue={formatCurrency(availableBalances, CURRENCY_FORMAT.cents)}\n rightLabel={copy.average_monthly_spend_text}\n rightValue={formatCurrency(averageMonthlySpend, CURRENCY_FORMAT.cents)}\n sx={{ width: '100%', mb: 24 }}\n />\n ) : null\n }\n />\n\n {!isSaveEnough && availableBalances != null && expenses != null && (\n <RemainingCard\n availableBalances={availableBalances}\n copy={copy}\n expenses={expenses}\n totalRemaining={totalRemaining}\n />\n )}\n\n <SavingsProjection\n bodyContent={copy[projection.contentKey]}\n bodyDescription={copy[projection.descriptionKey]}\n copy={copy}\n deltaAmount={projection.deltaAmount}\n initialAmount={projection.initialAmount}\n monthsTable={projection.months}\n seedAmount={projection.initialAmount == null ? averageMonthlySpend : undefined}\n />\n\n {isSaveEnough && availableBalances != null && (\n <TotalsFooter availableBalances={availableBalances} copy={copy} date={date} />\n )}\n </>\n )\n}\n"],"mappings":";;;;;;;;;;AAyBA,IAAM,IAAA,CAAU,EAAE,MAAA,GAAM,SAAA,EAAA,MACtB,gBAAA,EAAC,GAAD;AAAA,EACE,IAAI;AAAA,IAAE,SAAS;AAAA,IAAoB,GAAG;AAAA,IAAI,cAAc;AAAA,IAAa,aAAa;AAAA,EAAU;AAAA,EAD9F,UAAA,CAGG,GACD,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,KAAK,EAAE;AAAA,IAApB,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MAAM,SAAQ;AAAA,MAAM,UAAA,EAAK;AAAA,IAAqB,CAAA,GAC9C,gBAAA,EAAC,GAAD;AAAA,MAAM,IAAI,EAAE,YAAY,OAAO;AAAA,MAAG,UAAU;AAAA,MAAO,SAAQ;AAAA,MACxD,UAAA,EAAK;AAAA,IACF,CAAA,CACD;AAAA,EACF,CAAA,CAAA;IAIH,IAAA,CAAiB,EACrB,mBAAA,GACA,UAAA,GACA,gBAAA,GACA,MAAA,EAAA,MAOA,gBAAA,EAAC,GAAD;AAAA,EAAO,IAAI;AAAA,IAAE,IAAI;AAAA,IAAI,IAAI;AAAA,EAAG;AAAA,EAC1B,UAAA,gBAAA,EAAC,GAAD;AAAA,IAAM,IAAI;AAAA,MAAE,IAAI;AAAA,MAAI,IAAI;AAAA,MAAI,IAAI;AAAA,IAAG;AAAA,IAAnC,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,QAAQ;AAAA,QACR,aAAa;AAAA,QACb,cAAc;AAAA,QACd,KAAK;AAAA,QACL,eAAe;AAAA,QACf,gBAAgB;AAAA,QAChB,YAAY;AAAA,QACZ,GAAG;AAAA,QACH,IAAI;AAAA,MACN;AAAA,MAXF,UAAA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ACzD,gBAAA,EAAC,GAAD;AAAA,MACqB,mBAAA;AAAA,MACb,MAAA;AAAA,MACI,UAAA;AAAA,MACM,gBAAA;AAAA,IACjB,CAAA;AAAA,IAGH,gBAAA,EAAC,GAAD;AAAA,MACE,aAAa,EAAK,EAAW,UAAA;AAAA,MAC7B,iBAAiB,EAAK,EAAW,cAAA;AAAA,MAC3B,MAAA;AAAA,MACN,aAAa,EAAW;AAAA,MACxB,eAAe,EAAW;AAAA,MAC1B,aAAa,EAAW;AAAA,MACxB,YAAY,EAAW,iBAAiB,OAAO,IAAsB;AAAA,IACtE,CAAA;AAAA,IAEA,KAAgB,KAAqB,QACpC,gBAAA,EAAC,GAAD;AAAA,MAAiC,mBAAA;AAAA,MAAyB,MAAA;AAAA,MAAY,MAAA;AAAA,IAAO,CAAA;AAAA,EAE/E,EAAA,CAAA;AAEN"}
1
+ {"version":3,"file":"MakeTransferActionBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlock.tsx"],"sourcesContent":["import React, { type ReactNode } from 'react'\nimport { Card, Divider, List, ListItem, Stack } from '@mui/material'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { buildDynamicCopy, type MakeTransferCopy } from '../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\n\nimport { BalanceStepper } from './BalanceStepper'\nimport SaveEnoughToLiveOnBottomSection from './SaveEnoughToLiveOnBottomSection'\nimport {\n PROJECTIONS,\n toNumber,\n variants,\n type MakeTransferVariant,\n type MakeTransferVariantProps,\n type MonthRow,\n} from './layout'\n\n// ============================================================================\n// Section building blocks (block-local)\n// ============================================================================\n\n/** Bordered title + description, with an optional `leading` slot. */\nconst Header = ({ copy, leading }: { copy: MakeTransferCopy; leading?: ReactNode }) => (\n <Stack\n sx={{ bgcolor: 'background.paper', p: 24, borderBottom: '1px solid', borderColor: 'divider' }}\n >\n {leading}\n <Stack sx={{ gap: 8 }}>\n <Text variant=\"h3\">{copy.header_content}</Text>\n <Text sx={{ lineHeight: '24px' }} truncate={false} variant=\"body1\">\n {copy.description}\n </Text>\n </Stack>\n </Stack>\n)\n\n/** Save-extra only: available − expenses = total remaining. */\nconst RemainingCard = ({\n availableBalances,\n expenses,\n totalRemaining,\n copy,\n}: {\n availableBalances: number\n expenses: number\n totalRemaining?: number\n copy: MakeTransferCopy\n}) => (\n <Stack sx={{ pt: 24, px: 24 }}>\n <Card sx={{ px: 16, pt: 16, pb: 12 }}>\n <Stack\n sx={{\n border: 1,\n borderColor: 'divider',\n borderRadius: '4px',\n gap: 12,\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n p: 8,\n mb: 12,\n }}\n >\n <Stack sx={{ width: 155, textAlign: 'center' }}>\n <Text sx={{ fontWeight: 600 }} variant=\"body1\">\n {formatCurrency(availableBalances, CURRENCY_FORMAT.cents)}\n </Text>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n {copy.available_text}\n </Text>\n </Stack>\n <Icon name=\"remove\" size={20} />\n <Stack sx={{ width: 155, textAlign: 'center' }}>\n <Text sx={{ fontWeight: 600 }} variant=\"body1\">\n {formatCurrency(expenses, CURRENCY_FORMAT.cents)}\n </Text>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n {copy.expenses_text}\n </Text>\n </Stack>\n </Stack>\n <Stack\n sx={{\n textAlign: 'center',\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n gap: 4,\n }}\n >\n <Text sx={{ color: 'text.secondary' }} variant=\"body2\">\n {copy.total_remaining_text}:\n </Text>\n <Text sx={{ fontWeight: 600 }} variant=\"body2\">\n {formatCurrency(totalRemaining, CURRENCY_FORMAT.cents)}\n </Text>\n </Stack>\n </Card>\n </Stack>\n)\n\n/** Save-enough only: total available balances as of a date. */\nconst TotalsFooter = ({\n availableBalances,\n date,\n copy,\n}: {\n availableBalances: number\n date?: string\n copy: MakeTransferCopy\n}) => (\n <Stack sx={{ px: 24, py: 14, textAlign: 'right', gap: 4 }}>\n <Text truncate={false} variant=\"h3\">\n {formatCurrency(availableBalances, CURRENCY_FORMAT.cents)}\n </Text>\n {date && (\n <Text sx={{ color: 'text.secondary', fontWeight: 400 }} truncate={false} variant=\"subtitle2\">\n {buildDynamicCopy(copy.your_available_balances_text, date) as string}\n </Text>\n )}\n </Stack>\n)\n\n/** Stepper + projected-savings table. Owns the amount state so both stay in sync. */\nconst SavingsProjection = ({\n bodyContent,\n bodyDescription,\n monthsTable,\n deltaAmount,\n initialAmount,\n seedAmount,\n copy,\n}: {\n bodyContent: string\n bodyDescription: string\n monthsTable: readonly MonthRow[]\n deltaAmount: number\n /** Fixed starting amount; when null, seeds from `seedAmount` once it resolves. */\n initialAmount: number | null\n seedAmount?: number\n copy: MakeTransferCopy\n}) => {\n const [amount, setAmount] = React.useState(initialAmount ?? seedAmount ?? 0)\n\n React.useEffect(() => {\n if (initialAmount == null && seedAmount != null) {\n setAmount(seedAmount)\n }\n }, [initialAmount, seedAmount])\n\n const lastRowIndex = monthsTable.length - 1\n\n return (\n <>\n <Stack sx={{ p: 24, gap: 8 }}>\n <Text sx={{ fontWeight: 600 }} truncate={false} variant=\"body1\">\n {bodyContent}\n </Text>\n <BalanceStepper\n amount={formatCurrency(amount, CURRENCY_FORMAT.cents)}\n copy={copy}\n onDecrement={() => setAmount((prev) => Math.max(0, prev - deltaAmount))}\n onIncrement={() => setAmount((prev) => prev + deltaAmount)}\n />\n </Stack>\n <Stack sx={{ gap: 8 }}>\n <Text sx={{ fontWeight: 600, mx: 24 }} truncate={false} variant=\"body1\">\n {bodyDescription}\n </Text>\n <List sx={{ bgcolor: 'background.paper', width: '100%' }}>\n {monthsTable.map(({ label, value }, index) => (\n <React.Fragment key={value}>\n <ListItem\n disableGutters={true}\n disablePadding={true}\n sx={{ minHeight: 52, bgcolor: 'background.paper' }}\n >\n <Stack sx={{ width: '100%' }}>\n <Stack\n sx={{\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n width: '100%',\n px: 24,\n py: 8,\n }}\n >\n <Text truncate={false} variant=\"body1\">\n {label}\n </Text>\n <Text sx={{ fontWeight: 600 }} truncate={false} variant=\"body1\">\n {formatCurrency(value * amount, CURRENCY_FORMAT.whole)}\n </Text>\n </Stack>\n </Stack>\n </ListItem>\n <Divider component=\"li\" sx={{ ml: index === lastRowIndex ? 0 : 24 }} />\n </React.Fragment>\n ))}\n </List>\n </Stack>\n </>\n )\n}\n\n// ============================================================================\n// Block — both variants share the header and the stepper/table (settings from\n// PROJECTIONS in layout.ts); only the sections around them differ.\n// ============================================================================\n\nexport const MakeTransferActionBlock = ({\n variant,\n slotData,\n copy,\n}: MakeTransferVariantProps & { variant: MakeTransferVariant }) => {\n const isSaveEnough = variant === variants.SAVE_ENOUGH_TO_LIVE_ON\n const projection = PROJECTIONS[variant]\n\n const availableBalances = slotData?.available_balance\n const averageMonthlySpend = toNumber(slotData?.avg_monthly_spend)\n const expenses = toNumber(slotData?.upcoming_expenses)\n const totalRemaining = toNumber(slotData?.total_remaining)\n const svgDateContent = slotData?.time_period\n const date = slotData?.date\n\n return (\n <>\n <Header\n copy={copy}\n leading={\n isSaveEnough &&\n availableBalances != null &&\n averageMonthlySpend != null &&\n svgDateContent ? (\n <SaveEnoughToLiveOnBottomSection\n content={svgDateContent}\n leftLabel={copy.available_balances_text}\n leftValue={formatCurrency(availableBalances, CURRENCY_FORMAT.cents)}\n rightLabel={copy.average_monthly_spend_text}\n rightValue={formatCurrency(averageMonthlySpend, CURRENCY_FORMAT.cents)}\n sx={{ width: '100%', mb: 24 }}\n />\n ) : null\n }\n />\n\n {!isSaveEnough && availableBalances != null && expenses != null && (\n <RemainingCard\n availableBalances={availableBalances}\n copy={copy}\n expenses={expenses}\n totalRemaining={totalRemaining}\n />\n )}\n\n <SavingsProjection\n bodyContent={copy[projection.contentKey]}\n bodyDescription={copy[projection.descriptionKey]}\n copy={copy}\n deltaAmount={projection.deltaAmount}\n initialAmount={projection.initialAmount}\n monthsTable={projection.months}\n seedAmount={projection.initialAmount == null ? averageMonthlySpend : undefined}\n />\n\n {isSaveEnough && availableBalances != null && (\n <TotalsFooter availableBalances={availableBalances} copy={copy} date={date} />\n )}\n </>\n )\n}\n"],"mappings":";;;;;;;;;;AAyBA,IAAM,IAAA,CAAU,EAAE,MAAA,GAAM,SAAA,EAAA,MACtB,gBAAA,EAAC,GAAD;AAAA,EACE,IAAI;AAAA,IAAE,SAAS;AAAA,IAAoB,GAAG;AAAA,IAAI,cAAc;AAAA,IAAa,aAAa;AAAA,EAAU;AAAA,EAD9F,UAAA,CAGG,GACD,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,KAAK,EAAE;AAAA,IAApB,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MAAM,SAAQ;AAAA,MAAM,UAAA,EAAK;AAAA,IAAqB,CAAA,GAC9C,gBAAA,EAAC,GAAD;AAAA,MAAM,IAAI,EAAE,YAAY,OAAO;AAAA,MAAG,UAAU;AAAA,MAAO,SAAQ;AAAA,MACxD,UAAA,EAAK;AAAA,IACF,CAAA,CACD;AAAA,EACF,CAAA,CAAA;IAIH,IAAA,CAAiB,EACrB,mBAAA,GACA,UAAA,GACA,gBAAA,GACA,MAAA,EAAA,MAOA,gBAAA,EAAC,GAAD;AAAA,EAAO,IAAI;AAAA,IAAE,IAAI;AAAA,IAAI,IAAI;AAAA,EAAG;AAAA,EAC1B,UAAA,gBAAA,EAAC,GAAD;AAAA,IAAM,IAAI;AAAA,MAAE,IAAI;AAAA,MAAI,IAAI;AAAA,MAAI,IAAI;AAAA,IAAG;AAAA,IAAnC,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,QAAQ;AAAA,QACR,aAAa;AAAA,QACb,cAAc;AAAA,QACd,KAAK;AAAA,QACL,eAAe;AAAA,QACf,gBAAgB;AAAA,QAChB,YAAY;AAAA,QACZ,GAAG;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AgB,KAAqB,QAAQ,KAAY,QACzD,gBAAA,EAAC,GAAD;AAAA,MACqB,mBAAA;AAAA,MACb,MAAA;AAAA,MACI,UAAA;AAAA,MACM,gBAAA;AAAA,IACjB,CAAA;AAAA,IAGH,gBAAA,EAAC,GAAD;AAAA,MACE,aAAa,EAAK,EAAW,UAAA;AAAA,MAC7B,iBAAiB,EAAK,EAAW,cAAA;AAAA,MAC3B,MAAA;AAAA,MACN,aAAa,EAAW;AAAA,MACxB,eAAe,EAAW;AAAA,MAC1B,aAAa,EAAW;AAAA,MACxB,YAAY,EAAW,iBAAiB,OAAO,IAAsB;AAAA,IACtE,CAAA;AAAA,IAEA,KAAgB,KAAqB,QACpC,gBAAA,EAAC,GAAD;AAAA,MAAiC,mBAAA;AAAA,MAAyB,MAAA;AAAA,MAAY,MAAA;AAAA,IAAO,CAAA;AAAA,EAE/E,EAAA,CAAA;AAEN"}
@@ -1,18 +1,19 @@
1
- import { useGlobalCopyStore as s, useInsightsV2Store as n } from "../../../common/context/hooks.es.js";
2
- import { resolveMakeTransferSlotData as i, resolveMakeTransferVariant as c } from "./layout.es.js";
3
- import { MakeTransferActionBlock as f } from "./MakeTransferActionBlock.es.js";
4
- import { observer as m } from "mobx-react-lite";
5
- import { jsx as p } from "react/jsx-runtime";
6
- var M = m(function({ beat: a }) {
7
- const { actionDrawer: o } = n(), { insights_feed: t } = s(), r = a.insights_payload, e = o.trigger === "secondaryCta" ? r?.secondary_cta : r?.primary_cta;
8
- return /* @__PURE__ */ p(f, {
9
- copy: t.make_transfer,
10
- slotData: i(r),
11
- variant: c(e?.variant)
1
+ import { useGlobalCopyStore as f, useInsightsV2Store as l } from "../../../common/context/hooks.es.js";
2
+ import { getDynamicCtaBasedOnTriggers as p } from "../util.es.js";
3
+ import { resolveMakeTransferSlotData as a, resolveMakeTransferVariant as d } from "./layout.es.js";
4
+ import { MakeTransferActionBlock as k } from "./MakeTransferActionBlock.es.js";
5
+ import { observer as y } from "mobx-react-lite";
6
+ import { jsx as _ } from "react/jsx-runtime";
7
+ var D = y(function({ beat: o }) {
8
+ const { actionDrawer: t } = l(), { insights_feed: e } = f(), { primary_cta: n, secondary_cta: s, in_description_cta: i, drilldown_data: c } = o.insights_payload ?? {}, r = p(t, n, s, i), m = a(r?.drilldown_data) ?? a(c);
9
+ return /* @__PURE__ */ _(k, {
10
+ copy: e.make_transfer,
11
+ slotData: m,
12
+ variant: d(r?.variant)
12
13
  });
13
14
  });
14
15
  export {
15
- M as MakeTransferActionBlockLayer
16
+ D as MakeTransferActionBlockLayer
16
17
  };
17
18
 
18
19
  //# sourceMappingURL=MakeTransferActionBlockLayer.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MakeTransferActionBlockLayer.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport { useGlobalCopyStore, useInsightsV2Store } from '../../../common'\n\nimport type { Beat } from '../../../core'\n\nimport { MakeTransferActionBlock } from './MakeTransferActionBlock'\nimport { resolveMakeTransferSlotData, resolveMakeTransferVariant } from './layout'\n\n/**\n * Adapter that plugs MakeTransfer into the ActionBlock registry.\n *\n * The variants are content-only — ActionBlockLayer owns the surrounding Drawer\n * (open/close/title). This adapter derives the variant from the clicked CTA, the\n * copy from GlobalCopyStore, and passes the slot data through; each variant reads\n * the fields it needs.\n */\nexport const MakeTransferActionBlockLayer = observer(function MakeTransferActionBlockLayer({\n beat,\n}: {\n beat: Beat\n}) {\n const { actionDrawer } = useInsightsV2Store()\n const { insights_feed: insightsFeedCopy } = useGlobalCopyStore()\n\n const payload = beat.insights_payload\n const cta =\n actionDrawer.trigger === 'secondaryCta' ? payload?.secondary_cta : payload?.primary_cta\n\n return (\n <MakeTransferActionBlock\n copy={insightsFeedCopy.make_transfer}\n slotData={resolveMakeTransferSlotData(payload)}\n variant={resolveMakeTransferVariant(cta?.variant)}\n />\n )\n})\n"],"mappings":";;;;;AAiBA,IAAa,IAA+B,EAAS,SAAsC,EACzF,MAAA,EAAA,GAGC;AACD,QAAM,EAAE,cAAA,EAAA,IAAiB,EAAmB,GACtC,EAAE,eAAe,EAAA,IAAqB,EAAmB,GAEzD,IAAU,EAAK,kBACf,IACJ,EAAa,YAAY,iBAAiB,GAAS,gBAAgB,GAAS;AAE9E,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,MAAM,EAAiB;AAAA,IACvB,UAAU,EAA4B,CAAO;AAAA,IAC7C,SAAS,EAA2B,GAAK,OAAO;AAAA,EACjD,CAAA;AAEL,CAAC"}
1
+ {"version":3,"file":"MakeTransferActionBlockLayer.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport { useGlobalCopyStore, useInsightsV2Store } from '../../../common'\n\nimport type { Beat } from '../../../core'\n\nimport { getDynamicCtaBasedOnTriggers } from '../util'\nimport { MakeTransferActionBlock } from './MakeTransferActionBlock'\nimport { resolveMakeTransferSlotData, resolveMakeTransferVariant } from './layout'\n\n/**\n * Adapter that plugs MakeTransfer into the ActionBlock registry.\n *\n * The variants are content-only — ActionBlockLayer owns the surrounding Drawer\n * (open/close/title). This adapter derives the variant from the clicked CTA, the\n * copy from GlobalCopyStore, and passes the slot data through; each variant reads\n * the fields it needs.\n */\nexport const MakeTransferActionBlockLayer = observer(function MakeTransferActionBlockLayer({\n beat,\n}: {\n beat: Beat\n}) {\n const { actionDrawer } = useInsightsV2Store()\n const { insights_feed: insightsFeedCopy } = useGlobalCopyStore()\n\n const { primary_cta, secondary_cta, in_description_cta, drilldown_data } =\n beat.insights_payload ?? {}\n const cta = getDynamicCtaBasedOnTriggers(\n actionDrawer,\n primary_cta,\n secondary_cta,\n in_description_cta,\n )\n // Per-CTA facts win over the envelope's.\n const slotData =\n resolveMakeTransferSlotData(cta?.drilldown_data) ?? resolveMakeTransferSlotData(drilldown_data)\n\n return (\n <MakeTransferActionBlock\n copy={insightsFeedCopy.make_transfer}\n slotData={slotData}\n variant={resolveMakeTransferVariant(cta?.variant)}\n />\n )\n})\n"],"mappings":";;;;;;AAkBA,IAAa,IAA+B,EAAS,SAAsC,EACzF,MAAA,EAAA,GAGC;AACD,QAAM,EAAE,cAAA,EAAA,IAAiB,EAAmB,GACtC,EAAE,eAAe,EAAA,IAAqB,EAAmB,GAEzD,EAAE,aAAA,GAAa,eAAA,GAAe,oBAAA,GAAoB,gBAAA,EAAA,IACtD,EAAK,oBAAoB,CAAC,GACtB,IAAM,EACV,GACA,GACA,GACA,CACF,GAEM,IACJ,EAA4B,GAAK,cAAc,KAAK,EAA4B,CAAc;AAEhG,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,MAAM,EAAiB;AAAA,IACb,UAAA;AAAA,IACV,SAAS,EAA2B,GAAK,OAAO;AAAA,EACjD,CAAA;AAEL,CAAC"}
@@ -41,7 +41,8 @@ var g = {
41
41
  children: [/* @__PURE__ */ e(m, {
42
42
  divProps: { style: {
43
43
  height: "auto",
44
- gridArea: "1 / 1"
44
+ gridArea: "1 / 1",
45
+ lineHeight: 0
45
46
  } },
46
47
  image: p
47
48
  }), /* @__PURE__ */ e(x, {
@@ -1 +1 @@
1
- {"version":3,"file":"SaveEnoughToLiveOnBottomSection.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\n\nimport { type SxProps } from '@mui/material/styles'\n\nimport { H2, Text } from '@mxenabled/mxui'\n\nimport { ReactComponent as Image } from '../../components/shared/images/SaveEnoughToLiveOnBottom.svg'\nimport { ThemedSVGImage } from '../../components/chartblocks/ThemedSVGImage'\n\nconst ROW_STYLES = {\n alignItems: 'center',\n flexDirection: 'row',\n height: 40,\n justifyContent: 'space-between',\n px: 16,\n py: 2,\n}\n\ninterface BalanceRowProps {\n label: string\n value: string\n withBorder?: boolean\n}\n\nconst BalanceRow = ({ label, value, withBorder = false }: BalanceRowProps) => (\n <Stack\n sx={{\n ...ROW_STYLES,\n ...(withBorder && {\n borderBottom: '1px solid',\n borderColor: 'divider',\n }),\n }}\n >\n <Text color=\"text.secondary\" variant=\"caption\">\n {label}\n </Text>\n <Text bold={true} variant=\"body2\">\n {value}\n </Text>\n </Stack>\n)\n\ninterface SaveEnoughToLiveOnBottomSectionProps {\n content: string\n leftLabel: string\n leftValue: string\n rightLabel: string\n rightValue: string\n sx?: SxProps\n}\n\nconst SaveEnoughToLiveOnBottomSection = ({\n content,\n leftLabel,\n leftValue,\n rightLabel,\n rightValue,\n sx,\n}: SaveEnoughToLiveOnBottomSectionProps) => (\n <Stack sx={{ alignItems: 'center', gap: 12 }}>\n <Box sx={{ display: 'grid', placeItems: 'center' }}>\n <ThemedSVGImage divProps={{ style: { height: 'auto', gridArea: '1 / 1' } }} image={Image} />\n <H2 sx={{ color: 'neutral.contrastText', gridArea: '1 / 1', textAlign: 'center' }}>\n {content}\n </H2>\n </Box>\n <Stack\n sx={{\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: 1,\n width: 288,\n ...sx,\n }}\n >\n <BalanceRow label={leftLabel} value={leftValue} withBorder={true} />\n <BalanceRow label={rightLabel} value={rightValue} />\n </Stack>\n </Stack>\n)\n\nexport default SaveEnoughToLiveOnBottomSection\n"],"mappings":";;;;;;AAUA,IAAM,IAAa;AAAA,EACjB,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,IAAI;AAAA,EACJ,IAAI;AACN,GAQM,IAAA,CAAc,EAAE,OAAA,GAAO,OAAA,GAAO,YAAA,IAAa,GAAA,MAC/C,gBAAA,EAAC,GAAD;AAAA,EACE,IAAI;AAAA,IACF,GAAG;AAAA,IACH,GAAI,KAAc;AAAA,MAChB,cAAc;AAAA,MACd,aAAa;AAAA,IACf;AAAA,EACF;AAA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noughToLiveOnBottomSection.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\n\nimport { type SxProps } from '@mui/material/styles'\n\nimport { H2, Text } from '@mxenabled/mxui'\n\nimport { ReactComponent as Image } from '../../components/shared/images/SaveEnoughToLiveOnBottom.svg'\nimport { ThemedSVGImage } from '../../components/chartblocks/ThemedSVGImage'\n\nconst ROW_STYLES = {\n alignItems: 'center',\n flexDirection: 'row',\n height: 40,\n justifyContent: 'space-between',\n px: 16,\n py: 2,\n}\n\ninterface BalanceRowProps {\n label: string\n value: string\n withBorder?: boolean\n}\n\nconst BalanceRow = ({ label, value, withBorder = false }: BalanceRowProps) => (\n <Stack\n sx={{\n ...ROW_STYLES,\n ...(withBorder && {\n borderBottom: '1px solid',\n borderColor: 'divider',\n }),\n }}\n >\n <Text color=\"text.secondary\" variant=\"caption\">\n {label}\n </Text>\n <Text bold={true} variant=\"body2\">\n {value}\n </Text>\n </Stack>\n)\n\ninterface SaveEnoughToLiveOnBottomSectionProps {\n content: string\n leftLabel: string\n leftValue: string\n rightLabel: string\n rightValue: string\n sx?: SxProps\n}\n\nconst SaveEnoughToLiveOnBottomSection = ({\n content,\n leftLabel,\n leftValue,\n rightLabel,\n rightValue,\n sx,\n}: SaveEnoughToLiveOnBottomSectionProps) => (\n <Stack sx={{ alignItems: 'center', gap: 12 }}>\n <Box sx={{ display: 'grid', placeItems: 'center' }}>\n <ThemedSVGImage\n divProps={{ style: { height: 'auto', gridArea: '1 / 1', lineHeight: 0 } }}\n image={Image}\n />\n <H2 sx={{ color: 'neutral.contrastText', gridArea: '1 / 1', textAlign: 'center' }}>\n {content}\n </H2>\n </Box>\n <Stack\n sx={{\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: 1,\n width: 288,\n ...sx,\n }}\n >\n <BalanceRow label={leftLabel} value={leftValue} withBorder={true}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,MAAS;AAAA,MAC7E,UAAA;AAAA,IACC,CAAA,CACD;AAAA,EACL,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,IACE,IAAI;AAAA,MACF,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,cAAc;AAAA,MACd,OAAO;AAAA,MACP,GAAG;AAAA,IACL;AAAA,IAPF,UAAA,CASE,gBAAA,EAAC,GAAD;AAAA,MAAY,OAAO;AAAA,MAAW,OAAO;AAAA,MAAW,YAAY;AAAA,IAAO,CAAA,GACnE,gBAAA,EAAC,GAAD;AAAA,MAAY,OAAO;AAAA,MAAY,OAAO;AAAA,IAAa,CAAA,CAC9C;AAAA,EACF,CAAA,CAAA"}
@@ -1,4 +1,4 @@
1
- import { GlobalCopy, InsightsPayload, MakeTransferCopy } from '../../../core';
1
+ import { DrilldownData, GlobalCopy, MakeTransferCopy } from '../../../core';
2
2
  import { SaveExtraBlockData } from '../../../core/types/InsightsInstanceSlotData';
3
3
  /**
4
4
  * MakeTransfer drilldown variants. The block uses the VALUE (e.g. "SaveAnExtra100"),
@@ -35,9 +35,9 @@ export declare const getMakeTransferDrawerTitle: (variant: string | null | undef
35
35
  /** Coerce a payload figure (number or numeric string) to a number, else undefined. */
36
36
  export declare const toNumber: (value?: string | number) => number | undefined;
37
37
  /**
38
- * The drawer's facts from a V2 envelope's `drilldown_data`. `DrilldownData` values are untyped
39
- * scalars, so each field is narrowed: a null or mistyped value is dropped rather than formatted.
40
- * undefined when the envelope carries none of them.
38
+ * The drawer's facts from a V2 `drilldown_data`. `DrilldownData` values are untyped scalars, so each
39
+ * field is narrowed: a null or mistyped value is dropped rather than formatted. undefined when it
40
+ * carries none of them.
41
41
  */
42
- export declare const resolveMakeTransferSlotData: (payload?: InsightsPayload) => SaveExtraBlockData | undefined;
42
+ export declare const resolveMakeTransferSlotData: (data?: DrilldownData) => SaveExtraBlockData | undefined;
43
43
  export {};
@@ -1,9 +1,9 @@
1
1
  import { asNonEmptyText as o, asNumber as _ } from "../../blocks/slotReaders.es.js";
2
- var t = {
2
+ var n = {
3
3
  SAVE_ENOUGH_TO_LIVE_ON: "SaveEnoughToLiveOn",
4
4
  SAVE_AN_EXTRA_100: "SaveAnExtra100"
5
- }, v = {
6
- [t.SAVE_ENOUGH_TO_LIVE_ON]: {
5
+ }, s = {
6
+ [n.SAVE_ENOUGH_TO_LIVE_ON]: {
7
7
  contentKey: "body_spending_content",
8
8
  descriptionKey: "body_spending_description",
9
9
  months: [
@@ -27,7 +27,7 @@ var t = {
27
27
  deltaAmount: 50,
28
28
  initialAmount: null
29
29
  },
30
- [t.SAVE_AN_EXTRA_100]: {
30
+ [n.SAVE_AN_EXTRA_100]: {
31
31
  contentKey: "body_saving_content",
32
32
  descriptionKey: "body_saving_description",
33
33
  months: [
@@ -47,32 +47,31 @@ var t = {
47
47
  deltaAmount: 5,
48
48
  initialAmount: 100
49
49
  }
50
- }, i = {
51
- save_enough: t.SAVE_ENOUGH_TO_LIVE_ON,
52
- save_extra: t.SAVE_AN_EXTRA_100
53
- }, l = (e) => i[e ?? ""] ?? t.SAVE_AN_EXTRA_100, m = (e, a) => {
54
- const n = a.insights_feed?.make_transfer;
55
- return n ? l(e) === t.SAVE_ENOUGH_TO_LIVE_ON ? n.save_enough_title : n.save_extra_title : "";
56
- }, d = (e) => e == null || e === "" ? void 0 : Number(e), E = (e) => {
57
- const a = e?.drilldown_data;
58
- if (!a) return;
59
- const n = {
60
- available_balance: _(a.available_balance),
61
- avg_monthly_spend: _(a.avg_monthly_spend),
62
- upcoming_expenses: _(a.upcoming_expenses),
63
- total_remaining: _(a.total_remaining),
64
- time_period: o(a.time_period),
65
- date: o(a.date)
50
+ }, r = {
51
+ save_enough: n.SAVE_ENOUGH_TO_LIVE_ON,
52
+ save_extra: n.SAVE_AN_EXTRA_100
53
+ }, i = (e) => r[e ?? ""] ?? n.SAVE_AN_EXTRA_100, v = (e, a) => {
54
+ const t = a.insights_feed?.make_transfer;
55
+ return t ? i(e) === n.SAVE_ENOUGH_TO_LIVE_ON ? t.save_enough_title : t.save_extra_title : "";
56
+ }, m = (e) => e == null || e === "" ? void 0 : Number(e), E = (e) => {
57
+ if (!e) return;
58
+ const a = {
59
+ available_balance: _(e.available_balance),
60
+ avg_monthly_spend: _(e.avg_monthly_spend),
61
+ upcoming_expenses: _(e.upcoming_expenses),
62
+ total_remaining: _(e.total_remaining),
63
+ time_period: o(e.time_period),
64
+ date: o(e.date)
66
65
  };
67
- return Object.values(n).some((r) => r !== void 0) ? n : void 0;
66
+ return Object.values(a).some((t) => t !== void 0) ? a : void 0;
68
67
  };
69
68
  export {
70
- v as PROJECTIONS,
71
- m as getMakeTransferDrawerTitle,
69
+ s as PROJECTIONS,
70
+ v as getMakeTransferDrawerTitle,
72
71
  E as resolveMakeTransferSlotData,
73
- l as resolveMakeTransferVariant,
74
- d as toNumber,
75
- t as variants
72
+ i as resolveMakeTransferVariant,
73
+ m as toNumber,
74
+ n as variants
76
75
  };
77
76
 
78
77
  //# sourceMappingURL=layout.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/MakeTransferActionBlock/layout.ts"],"sourcesContent":["import type { GlobalCopy, InsightsPayload, MakeTransferCopy } from '../../../core'\nimport type { SaveExtraBlockData } from '../../../core/types/InsightsInstanceSlotData'\nimport { asNonEmptyText, asNumber } from '../../blocks/slotReaders'\n\n/**\n * MakeTransfer drilldown variants. The block uses the VALUE (e.g. \"SaveAnExtra100\"),\n * which is also the key each variant registers under (see ./index).\n */\nexport const variants = {\n SAVE_ENOUGH_TO_LIVE_ON: 'SaveEnoughToLiveOn',\n SAVE_AN_EXTRA_100: 'SaveAnExtra100',\n} as const\n\nexport type MakeTransferVariant = (typeof variants)[keyof typeof variants]\n\nexport interface MonthRow {\n label: string\n value: number\n}\n\ntype BodyCopyKey = Extract<keyof MakeTransferCopy, `body_${string}`>\n\n/** Each variant's savings projection; a null `initialAmount` seeds from the average monthly spend. */\nexport const PROJECTIONS: Record<\n MakeTransferVariant,\n {\n contentKey: BodyCopyKey\n descriptionKey: BodyCopyKey\n months: readonly MonthRow[]\n deltaAmount: number\n initialAmount: number | null\n }\n> = {\n [variants.SAVE_ENOUGH_TO_LIVE_ON]: {\n contentKey: 'body_spending_content',\n descriptionKey: 'body_spending_description',\n months: [\n { label: '1 month', value: 1 },\n { label: '3 months', value: 3 },\n { label: '6 months', value: 6 },\n { label: '9 months', value: 9 },\n ],\n deltaAmount: 50,\n initialAmount: null,\n },\n [variants.SAVE_AN_EXTRA_100]: {\n contentKey: 'body_saving_content',\n descriptionKey: 'body_saving_description',\n months: [\n { label: '3 months', value: 3 },\n { label: '6 months', value: 6 },\n { label: '9 months', value: 9 },\n ],\n deltaAmount: 5,\n initialAmount: 100,\n },\n}\n\n// The beat payload sends the variant as a snake_case key; map it to the value. The keys are\n// behavior-named (aligning with the `save_enough_title` / `save_extra_title` copy), not beat-named.\nconst VARIANT_BY_KEY: Record<string, MakeTransferVariant> = {\n save_enough: variants.SAVE_ENOUGH_TO_LIVE_ON,\n save_extra: variants.SAVE_AN_EXTRA_100,\n}\n\n/** Props shared by every MakeTransfer variant. Each variant reads the fields it\n * needs directly off `slotData` — no per-variant key indirection. */\nexport interface MakeTransferVariantProps {\n slotData?: SaveExtraBlockData\n copy: MakeTransferCopy\n}\n\n/** Maps the payload variant key to the block's variant VALUE (defaults to save-extra). */\nexport const resolveMakeTransferVariant = (variant?: string | null): MakeTransferVariant =>\n VARIANT_BY_KEY[variant ?? ''] ?? variants.SAVE_AN_EXTRA_100\n\n/** Variant-specific, localized drawer title from `insights_feed.make_transfer`. */\nexport const getMakeTransferDrawerTitle = (\n variant: string | null | undefined,\n copy: GlobalCopy,\n): string => {\n const makeTransfer = copy.insights_feed?.make_transfer\n if (!makeTransfer) return ''\n return resolveMakeTransferVariant(variant) === variants.SAVE_ENOUGH_TO_LIVE_ON\n ? makeTransfer.save_enough_title\n : makeTransfer.save_extra_title\n}\n\n/** Coerce a payload figure (number or numeric string) to a number, else undefined. */\nexport const toNumber = (value?: string | number): number | undefined =>\n value === undefined || value === null || value === '' ? undefined : Number(value)\n\n/**\n * The drawer's facts from a V2 envelope's `drilldown_data`. `DrilldownData` values are untyped\n * scalars, so each field is narrowed: a null or mistyped value is dropped rather than formatted.\n * undefined when the envelope carries none of them.\n */\nexport const resolveMakeTransferSlotData = (\n payload?: InsightsPayload,\n): SaveExtraBlockData | undefined => {\n const data = payload?.drilldown_data\n if (!data) return undefined\n\n const facts: SaveExtraBlockData = {\n available_balance: asNumber(data.available_balance),\n avg_monthly_spend: asNumber(data.avg_monthly_spend),\n upcoming_expenses: asNumber(data.upcoming_expenses),\n total_remaining: asNumber(data.total_remaining),\n time_period: asNonEmptyText(data.time_period),\n date: asNonEmptyText(data.date),\n }\n\n return Object.values(facts).some((value) => value !== undefined) ? facts : undefined\n}\n"],"mappings":";AAQA,IAAa,IAAW;AAAA,EACtB,wBAAwB;AAAA,EACxB,mBAAmB;AACrB,GAYa,IAST;AAAA,EACD,CAAA,EAAS,sBAAA,GAAyB;AAAA,IACjC,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,QAAQ;AAAA,MACN;AAAA,QAAE,OAAO;AAAA,QAAW,OAAO;AAAA,MAAE;AAAA,MAC7B;AAAA,QAAE,OAAO;AAAA,QAAY,OAAO;AAAA,MAAE;AAAA,MAC9B;AAAA,QAAE,OAAO;AAAA,QAAY,OAAO;AAAA,MAAE;AAAA,MAC9B;AAAA,QAAE,OAAO;AAAA,QAAY,OAAO;AAAA,MAAE;AAAA,IAChC;AAAA,IACA,aAAa;AAAA,IACb,eAAe;AAAA,EACjB;AAAA,EACC,CAAA,EAAS,iBAAA,GAAoB;AAAA,IAC5B,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,QAAQ;AAAA,MACN;AAAA,QAAE,OAAO;AAAA,QAAY,OAAO;AAAA,MAAE;AAAA,MAC9B;AAAA,QAAE,OAAO;AAAA,QAAY,OAAO;AAAA,MAAE;AAAA,MAC9B;AAAA,QAAE,OAAO;AAAA,QAAY,OAAO;AAAA,MAAE;AAAA,IAChC;AAAA,IACA,aAAa;AAAA,IACb,eAAe;AAAA,EACjB;AACF,GAIM,IAAsD;AAAA,EAC1D,aAAa,EAAS;AAAA,EACtB,YAAY,EAAS;AACvB,GAUa,IAAA,CAA8B,MACzC,EAAe,KAAW,EAAA,KAAO,EAAS,mBAG/B,IAAA,CACX,GACA,MACW;AACX,QAAM,IAAe,EAAK,eAAe;AACzC,SAAK,IACE,EAA2B,CAAO,MAAM,EAAS,yBACpD,EAAa,oBACb,EAAa,mBAHS;AAI5B,GAGa,IAAA,CAAY,MACA,KAAU,QAAQ,MAAU,KAAK,SAAY,OAAO,CAAK,GAOrE,IAAA,CACX,MACmC;AACnC,QAAM,IAAO,GAAS;AACtB,MAAI,CAAC,EAAM;AAEX,QAAM,IAA4B;AAAA,IAChC,mBAAmB,EAAS,EAAK,iBAAiB;AAAA,IAClD,mBAAmB,EAAS,EAAK,iBAAiB;AAAA,IAClD,mBAAmB,EAAS,EAAK,iBAAiB;AAAA,IAClD,iBAAiB,EAAS,EAAK,eAAe;AAAA,IAC9C,aAAa,EAAe,EAAK,WAAW;AAAA,IAC5C,MAAM,EAAe,EAAK,IAAI;AAAA,EAChC;AAEA,SAAO,OAAO,OAAO,CAAK,EAAE,KAAA,CAAM,MAAU,MAAU,MAAS,IAAI,IAAQ;AAC7E"}
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/MakeTransferActionBlock/layout.ts"],"sourcesContent":["import type { DrilldownData, GlobalCopy, MakeTransferCopy } from '../../../core'\nimport type { SaveExtraBlockData } from '../../../core/types/InsightsInstanceSlotData'\nimport { asNonEmptyText, asNumber } from '../../blocks/slotReaders'\n\n/**\n * MakeTransfer drilldown variants. The block uses the VALUE (e.g. \"SaveAnExtra100\"),\n * which is also the key each variant registers under (see ./index).\n */\nexport const variants = {\n SAVE_ENOUGH_TO_LIVE_ON: 'SaveEnoughToLiveOn',\n SAVE_AN_EXTRA_100: 'SaveAnExtra100',\n} as const\n\nexport type MakeTransferVariant = (typeof variants)[keyof typeof variants]\n\nexport interface MonthRow {\n label: string\n value: number\n}\n\ntype BodyCopyKey = Extract<keyof MakeTransferCopy, `body_${string}`>\n\n/** Each variant's savings projection; a null `initialAmount` seeds from the average monthly spend. */\nexport const PROJECTIONS: Record<\n MakeTransferVariant,\n {\n contentKey: BodyCopyKey\n descriptionKey: BodyCopyKey\n months: readonly MonthRow[]\n deltaAmount: number\n initialAmount: number | null\n }\n> = {\n [variants.SAVE_ENOUGH_TO_LIVE_ON]: {\n contentKey: 'body_spending_content',\n descriptionKey: 'body_spending_description',\n months: [\n { label: '1 month', value: 1 },\n { label: '3 months', value: 3 },\n { label: '6 months', value: 6 },\n { label: '9 months', value: 9 },\n ],\n deltaAmount: 50,\n initialAmount: null,\n },\n [variants.SAVE_AN_EXTRA_100]: {\n contentKey: 'body_saving_content',\n descriptionKey: 'body_saving_description',\n months: [\n { label: '3 months', value: 3 },\n { label: '6 months', value: 6 },\n { label: '9 months', value: 9 },\n ],\n deltaAmount: 5,\n initialAmount: 100,\n },\n}\n\n// The beat payload sends the variant as a snake_case key; map it to the value. The keys are\n// behavior-named (aligning with the `save_enough_title` / `save_extra_title` copy), not beat-named.\nconst VARIANT_BY_KEY: Record<string, MakeTransferVariant> = {\n save_enough: variants.SAVE_ENOUGH_TO_LIVE_ON,\n save_extra: variants.SAVE_AN_EXTRA_100,\n}\n\n/** Props shared by every MakeTransfer variant. Each variant reads the fields it\n * needs directly off `slotData` — no per-variant key indirection. */\nexport interface MakeTransferVariantProps {\n slotData?: SaveExtraBlockData\n copy: MakeTransferCopy\n}\n\n/** Maps the payload variant key to the block's variant VALUE (defaults to save-extra). */\nexport const resolveMakeTransferVariant = (variant?: string | null): MakeTransferVariant =>\n VARIANT_BY_KEY[variant ?? ''] ?? variants.SAVE_AN_EXTRA_100\n\n/** Variant-specific, localized drawer title from `insights_feed.make_transfer`. */\nexport const getMakeTransferDrawerTitle = (\n variant: string | null | undefined,\n copy: GlobalCopy,\n): string => {\n const makeTransfer = copy.insights_feed?.make_transfer\n if (!makeTransfer) return ''\n return resolveMakeTransferVariant(variant) === variants.SAVE_ENOUGH_TO_LIVE_ON\n ? makeTransfer.save_enough_title\n : makeTransfer.save_extra_title\n}\n\n/** Coerce a payload figure (number or numeric string) to a number, else undefined. */\nexport const toNumber = (value?: string | number): number | undefined =>\n value === undefined || value === null || value === '' ? undefined : Number(value)\n\n/**\n * The drawer's facts from a V2 `drilldown_data`. `DrilldownData` values are untyped scalars, so each\n * field is narrowed: a null or mistyped value is dropped rather than formatted. undefined when it\n * carries none of them.\n */\nexport const resolveMakeTransferSlotData = (\n data?: DrilldownData,\n): SaveExtraBlockData | undefined => {\n if (!data) return undefined\n\n const facts: SaveExtraBlockData = {\n available_balance: asNumber(data.available_balance),\n avg_monthly_spend: asNumber(data.avg_monthly_spend),\n upcoming_expenses: asNumber(data.upcoming_expenses),\n total_remaining: asNumber(data.total_remaining),\n time_period: asNonEmptyText(data.time_period),\n date: asNonEmptyText(data.date),\n }\n\n return Object.values(facts).some((value) => value !== undefined) ? facts : undefined\n}\n"],"mappings":";AAQA,IAAa,IAAW;AAAA,EACtB,wBAAwB;AAAA,EACxB,mBAAmB;AACrB,GAYa,IAST;AAAA,EACD,CAAA,EAAS,sBAAA,GAAyB;AAAA,IACjC,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,QAAQ;AAAA,MACN;AAAA,QAAE,OAAO;AAAA,QAAW,OAAO;AAAA,MAAE;AAAA,MAC7B;AAAA,QAAE,OAAO;AAAA,QAAY,OAAO;AAAA,MAAE;AAAA,MAC9B;AAAA,QAAE,OAAO;AAAA,QAAY,OAAO;AAAA,MAAE;AAAA,MAC9B;AAAA,QAAE,OAAO;AAAA,QAAY,OAAO;AAAA,MAAE;AAAA,IAChC;AAAA,IACA,aAAa;AAAA,IACb,eAAe;AAAA,EACjB;AAAA,EACC,CAAA,EAAS,iBAAA,GAAoB;AAAA,IAC5B,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,QAAQ;AAAA,MACN;AAAA,QAAE,OAAO;AAAA,QAAY,OAAO;AAAA,MAAE;AAAA,MAC9B;AAAA,QAAE,OAAO;AAAA,QAAY,OAAO;AAAA,MAAE;AAAA,MAC9B;AAAA,QAAE,OAAO;AAAA,QAAY,OAAO;AAAA,MAAE;AAAA,IAChC;AAAA,IACA,aAAa;AAAA,IACb,eAAe;AAAA,EACjB;AACF,GAIM,IAAsD;AAAA,EAC1D,aAAa,EAAS;AAAA,EACtB,YAAY,EAAS;AACvB,GAUa,IAAA,CAA8B,MACzC,EAAe,KAAW,EAAA,KAAO,EAAS,mBAG/B,IAAA,CACX,GACA,MACW;AACX,QAAM,IAAe,EAAK,eAAe;AACzC,SAAK,IACE,EAA2B,CAAO,MAAM,EAAS,yBACpD,EAAa,oBACb,EAAa,mBAHS;AAI5B,GAGa,IAAA,CAAY,MACA,KAAU,QAAQ,MAAU,KAAK,SAAY,OAAO,CAAK,GAOrE,IAAA,CACX,MACmC;AACnC,MAAI,CAAC,EAAM;AAEX,QAAM,IAA4B;AAAA,IAChC,mBAAmB,EAAS,EAAK,iBAAiB;AAAA,IAClD,mBAAmB,EAAS,EAAK,iBAAiB;AAAA,IAClD,mBAAmB,EAAS,EAAK,iBAAiB;AAAA,IAClD,iBAAiB,EAAS,EAAK,eAAe;AAAA,IAC9C,aAAa,EAAe,EAAK,WAAW;AAAA,IAC5C,MAAM,EAAe,EAAK,IAAI;AAAA,EAChC;AAEA,SAAO,OAAO,OAAO,CAAK,EAAE,KAAA,CAAM,MAAU,MAAU,MAAS,IAAI,IAAQ;AAC7E"}
@@ -0,0 +1,9 @@
1
+ import { ActionBlockProps } from '../../mappings/blocks';
2
+ /**
3
+ * Debt Payoff Strategies drawer: Avalanche / Snowball tabs, each with the strategy's words and the
4
+ * beat's debt accounts in that strategy's order. A tapped account opens its Account Details (the
5
+ * shared AccountDetailsBlock) in a nested drawer.
6
+ */
7
+ export declare const PayoffStrategiesBlock: (({ beat, }: ActionBlockProps) => import("react/jsx-runtime").JSX.Element) & {
8
+ displayName: string;
9
+ };