@mx-cartographer/experiences 9.7.27 → 9.7.29

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 (43) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/core/api/UserApi.es.js +8 -8
  3. package/dist/core/api/UserApi.es.js.map +1 -1
  4. package/dist/core/stores/GlobalStore.d.ts +4 -2
  5. package/dist/core/stores/GlobalStore.es.js +34 -34
  6. package/dist/core/stores/GlobalStore.es.js.map +1 -1
  7. package/dist/core/types/Insights.d.ts +1 -0
  8. package/dist/core/types/Insights.es.js.map +1 -1
  9. package/dist/core/types/localization/InsightsFeedCopy.d.ts +11 -0
  10. package/dist/insights-v2/analytics/analyticsEventsConfig.d.ts +12 -0
  11. package/dist/insights-v2/analytics/analyticsEventsConfig.es.js +12 -0
  12. package/dist/insights-v2/analytics/analyticsEventsConfig.es.js.map +1 -1
  13. package/dist/insights-v2/blocks/ComponentBlocks/GoalsBlock/GoalsBlock.d.ts +10 -0
  14. package/dist/insights-v2/blocks/ComponentBlocks/GoalsBlock/GoalsBlock.es.js +75 -0
  15. package/dist/insights-v2/blocks/ComponentBlocks/GoalsBlock/GoalsBlock.es.js.map +1 -0
  16. package/dist/insights-v2/blocks/ComponentBlocks/GoalsBlock/index.d.ts +1 -0
  17. package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +1 -0
  18. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/EmergencySavingsAccountPicker.d.ts +15 -0
  19. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/EmergencySavingsAccountPicker.es.js +30 -0
  20. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/EmergencySavingsAccountPicker.es.js.map +1 -0
  21. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.d.ts +1 -1
  22. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js +32 -11
  23. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js.map +1 -1
  24. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.d.ts +10 -7
  25. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.es.js +17 -10
  26. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.es.js.map +1 -1
  27. package/dist/insights-v2/components/CtaStatus.d.ts +19 -0
  28. package/dist/insights-v2/components/CtaStatus.es.js +67 -0
  29. package/dist/insights-v2/components/CtaStatus.es.js.map +1 -0
  30. package/dist/insights-v2/components/GoalProgressCard.d.ts +42 -0
  31. package/dist/insights-v2/components/GoalProgressCard.es.js +135 -0
  32. package/dist/insights-v2/components/GoalProgressCard.es.js.map +1 -0
  33. package/dist/insights-v2/ctaActions/ctaConfig.es.js +21 -6
  34. package/dist/insights-v2/ctaActions/ctaConfig.es.js.map +1 -1
  35. package/dist/insights-v2/ctaActions/ctaPostMessages.es.js +7 -7
  36. package/dist/insights-v2/ctaActions/ctaPostMessages.es.js.map +1 -1
  37. package/dist/insights-v2/ctaActions/runCtaAction.es.js.map +1 -1
  38. package/dist/insights-v2/ctaActions/types.d.ts +1 -1
  39. package/dist/insights-v2/index.d.ts +1 -0
  40. package/dist/insights-v2/index.es.js +94 -90
  41. package/dist/insights-v2/mappings/blocks.es.js +52 -50
  42. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  43. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## [9.7.29] - 10-22-2026
2
+
3
+ - **ADDED** - Designate Emergency Savings Account on Insights 2.0. `ctaConfig` gains the two backend-named actions: `select_savings_account` ("Save") designates the account picked in the card through `updateUserInsightProfile`, stays disabled until a pick is made, refreshes the beat and fires `EMERGENCY_SAVINGS_ACCT_SAVED`; `open_savings_account` ("Open a Savings Account") fires `EMERGENCY_SAVINGS_ACCT_CREATED` while `ctaPostMessages.DesignateEmergencySavingsAccount` sends `beat/cta` op_1 — now keyed on the CTA's `action_key` (`open_savings_account`) instead of re-deriving pulse's data rule (no designation, no savings accounts), so it holds on every widget. The analytics catalogue gains `EMERGENCY_SAVINGS_ACCT_SELECTED` / `_SAVED` / `_CREATED` with pulse's strings (WEC-1859)
4
+ - **ADDED** - `CtaStatus`, a shared component for an "after the press" status bar (label, tone, filled icon, optional inline action such as Undo; `role="status"`, only the inline action is a button). Designate Emergency Savings Account's saved state draws its "Account Saved!" (`instance_slot.data.saved_label`) with it in the card body, under the illustration, per the updated Figma Saved state (WEC-1859)
5
+ - **ADDED** - `svg_image_block` layout variants `savings_account_picker` (the emergency-savings illustration with the account picker: options from `accountStore.savingsAccounts`, labels and pre-selection from `instance_slot.data`, the pick written to the beat context with the Selected event and no API call) and `savings_account_saved` (the illustration with the slot's `saved_label` as a `CtaStatus` under it, no picker; full card only, nothing when the label is missing) — the card the sampled beat refreshes into after Save, whose empty `primary_cta.label` renders no button (WEC-1859)
6
+ - **CHANGED** - `svg_image_block`'s emergency-savings variant is keyed `savings`, the name ditto sends (was `Savings`, which never matched). An unknown variant now renders nothing instead of throwing (WEC-1859)
7
+ - **FIXED** - `UserApi.updateUserInsightProfile` sends the profile fields flat, as pulse does. firefly's `PUT user_insight_profile` reads each field at the top level of the body and drops nils, so the `{ user_insight_profile: ... }` body it sent reached firefly empty and the upsert saved nothing: Designate Emergency Savings Account's "Save" and the safety-net save in `AmountInputModalBlock` silently kept the old profile. The MSW handler takes the flat body too (WEC-1859)
8
+ - **ADDED** - `GlobalStore.loadData` accepts `userInsightProfile` and seeds `UserStore.setUserInsightProfile`, so the host (pulse) hands in the profile it loads; experiences never fetches it. `select_savings_account` PUTs this seeded profile (WEC-1859)
9
+
10
+ ## [9.7.28] - 10-21-2026
11
+
12
+ - **ADDED** - `goals_block` component block (`status` variant) for the Monthly Emergency Fund Review beat. Renders the new `GoalProgressCard` (progress line with an optional status pill, progress bar and icon-tile fact rows) from `instance_slot.data`, with row copy from the new `insights_feed.goals_block` namespace. Mock payloads, fixtures, stories and tests (WEC-1302)
13
+
1
14
  ## [9.7.27] - 10-21-2026
2
15
 
3
16
  - **ADDED** - `no_spend_days_block` for Weekly No Spend Days
@@ -1,17 +1,17 @@
1
1
  import { ApiEndpoints as s } from "../constants/ApiEndpoints.es.js";
2
2
  import { Fetch as r } from "../utils/Fetch.es.js";
3
- var h = class {
3
+ var i = class {
4
4
  fetchInstance;
5
- constructor(e, t, n) {
6
- this.fetchInstance = new r(e, t, void 0, n);
5
+ constructor(t, e, n) {
6
+ this.fetchInstance = new r(t, e, void 0, n);
7
7
  }
8
- getUserFeatures = async () => this.fetchInstance.get(s.USER_FEATURES).then((e) => e.user_features);
9
- updateUser = async (e) => this.fetchInstance.put(s.USER, e).then((t) => t.user);
10
- updateUserProfile = async (e) => this.fetchInstance.put(`${s.USER_PROFILES}/${e.guid}`, e).then((t) => t.user_profile);
11
- updateUserInsightProfile = async (e) => this.fetchInstance.put(s.USER_INSIGHT_PROFILE, { user_insight_profile: e }).then((t) => t.user_insight_profile);
8
+ getUserFeatures = async () => this.fetchInstance.get(s.USER_FEATURES).then((t) => t.user_features);
9
+ updateUser = async (t) => this.fetchInstance.put(s.USER, t).then((e) => e.user);
10
+ updateUserProfile = async (t) => this.fetchInstance.put(`${s.USER_PROFILES}/${t.guid}`, t).then((e) => e.user_profile);
11
+ updateUserInsightProfile = async (t) => this.fetchInstance.put(s.USER_INSIGHT_PROFILE, t).then((e) => e.user_insight_profile);
12
12
  };
13
13
  export {
14
- h as UserApi
14
+ i as UserApi
15
15
  };
16
16
 
17
17
  //# sourceMappingURL=UserApi.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserApi.es.js","names":[],"sources":["../../../src/core/api/UserApi.ts"],"sourcesContent":["import { Fetch } from '../utils'\nimport { ApiEndpoints } from '../constants'\nimport type { GlobalErrorHandler, User, UserInsightProfile, UserProfile } from '..'\n\nexport class UserApi {\n fetchInstance: Fetch\n\n constructor(endpoint: string, token: string, onError?: GlobalErrorHandler) {\n this.fetchInstance = new Fetch(endpoint, token, undefined, onError)\n }\n\n getUserFeatures = async () => {\n return this.fetchInstance.get(ApiEndpoints.USER_FEATURES).then((data) => data.user_features)\n }\n\n updateUser = async (user: User) => {\n return this.fetchInstance.put(ApiEndpoints.USER, user).then((data) => data.user)\n }\n\n updateUserProfile = async (userProfile: UserProfile) => {\n return this.fetchInstance\n .put(`${ApiEndpoints.USER_PROFILES}/${userProfile.guid}`, userProfile)\n .then((data) => data.user_profile)\n }\n\n // The endpoint is singular per user, so no guid in the path (mirrors pulse FireflyAPI).\n updateUserInsightProfile = async (\n profile: Partial<UserInsightProfile>,\n ): Promise<UserInsightProfile> => {\n return this.fetchInstance\n .put(ApiEndpoints.USER_INSIGHT_PROFILE, { user_insight_profile: profile })\n .then((data) => data.user_insight_profile)\n }\n}\n"],"mappings":";;AAIA,IAAa,IAAb,MAAqB;AAAA,EACnB;AAAA,EAEA,YAAY,GAAkB,GAAe,GAA8B;AACzE,SAAK,gBAAgB,IAAI,EAAM,GAAU,GAAO,QAAW,CAAO;AAAA,EACpE;AAAA,EAEA,kBAAkB,YACT,KAAK,cAAc,IAAI,EAAa,aAAa,EAAE,KAAA,CAAM,MAAS,EAAK,aAAa;AAAA,EAG7F,aAAa,OAAO,MACX,KAAK,cAAc,IAAI,EAAa,MAAM,CAAI,EAAE,KAAA,CAAM,MAAS,EAAK,IAAI;AAAA,EAGjF,oBAAoB,OAAO,MAClB,KAAK,cACT,IAAI,GAAG,EAAa,aAAA,IAAiB,EAAY,IAAA,IAAQ,CAAW,EACpE,KAAA,CAAM,MAAS,EAAK,YAAY;AAAA,EAIrC,2BAA2B,OACzB,MAEO,KAAK,cACT,IAAI,EAAa,sBAAsB,EAAE,sBAAsB,EAAQ,CAAC,EACxE,KAAA,CAAM,MAAS,EAAK,oBAAoB;AAE/C"}
1
+ {"version":3,"file":"UserApi.es.js","names":[],"sources":["../../../src/core/api/UserApi.ts"],"sourcesContent":["import { Fetch } from '../utils'\nimport { ApiEndpoints } from '../constants'\nimport type { GlobalErrorHandler, User, UserInsightProfile, UserProfile } from '..'\n\nexport class UserApi {\n fetchInstance: Fetch\n\n constructor(endpoint: string, token: string, onError?: GlobalErrorHandler) {\n this.fetchInstance = new Fetch(endpoint, token, undefined, onError)\n }\n\n getUserFeatures = async () => {\n return this.fetchInstance.get(ApiEndpoints.USER_FEATURES).then((data) => data.user_features)\n }\n\n updateUser = async (user: User) => {\n return this.fetchInstance.put(ApiEndpoints.USER, user).then((data) => data.user)\n }\n\n updateUserProfile = async (userProfile: UserProfile) => {\n return this.fetchInstance\n .put(`${ApiEndpoints.USER_PROFILES}/${userProfile.guid}`, userProfile)\n .then((data) => data.user_profile)\n }\n\n // The endpoint is singular per user, so no guid in the path (mirrors pulse FireflyAPI).\n updateUserInsightProfile = async (\n profile: Partial<UserInsightProfile>,\n ): Promise<UserInsightProfile> => {\n return (\n this.fetchInstance\n // Flat, as pulse sends it: firefly reads each field at the top level of the body and drops\n // nils, so a wrapped body would reach it empty and the upsert would write nothing.\n .put(ApiEndpoints.USER_INSIGHT_PROFILE, profile)\n .then((data) => data.user_insight_profile)\n )\n }\n}\n"],"mappings":";;AAIA,IAAa,IAAb,MAAqB;AAAA,EACnB;AAAA,EAEA,YAAY,GAAkB,GAAe,GAA8B;AACzE,SAAK,gBAAgB,IAAI,EAAM,GAAU,GAAO,QAAW,CAAO;AAAA,EACpE;AAAA,EAEA,kBAAkB,YACT,KAAK,cAAc,IAAI,EAAa,aAAa,EAAE,KAAA,CAAM,MAAS,EAAK,aAAa;AAAA,EAG7F,aAAa,OAAO,MACX,KAAK,cAAc,IAAI,EAAa,MAAM,CAAI,EAAE,KAAA,CAAM,MAAS,EAAK,IAAI;AAAA,EAGjF,oBAAoB,OAAO,MAClB,KAAK,cACT,IAAI,GAAG,EAAa,aAAA,IAAiB,EAAY,IAAA,IAAQ,CAAW,EACpE,KAAA,CAAM,MAAS,EAAK,YAAY;AAAA,EAIrC,2BAA2B,OACzB,MAGE,KAAK,cAGF,IAAI,EAAa,sBAAsB,CAAO,EAC9C,KAAA,CAAM,MAAS,EAAK,oBAAoB;AAGjD"}
@@ -1,5 +1,5 @@
1
1
  import { AccountStore, AgreementStore, AnalyticsStore, AppDataStore, BeatStore, BudgetsStore, CashflowStore, CategoryStore, ConnectStore, DebtsStore, FinstrongStore, GlobalCopyStore, GlobalUiStore, GoalStore, HelpStore, HoldingStore, InsightsV2Store, MerchantStore, NetWorthStore, NotificationStore, RecurringTransactionsStore, SettingsStore, TransactionStore, TrendsStore, UserStore } from '../stores';
2
- import { Account, Category, Institution, Member, AppConfig, AppData, Beat, GlobalCaptureException, GlobalErrorHandler, MerchantBudget, Tag, Tagging, Transaction, TransactionRule, UserFeature } from '../types';
2
+ import { Account, Category, Institution, Member, AppConfig, AppData, Beat, GlobalCaptureException, GlobalErrorHandler, MerchantBudget, Tag, Tagging, Transaction, TransactionRule, UserFeature, UserInsightProfile } from '../types';
3
3
  interface LoadDataProps {
4
4
  accounts?: Account[];
5
5
  appData?: AppData;
@@ -13,6 +13,8 @@ interface LoadDataProps {
13
13
  transactionRules?: TransactionRule[];
14
14
  transactions?: Transaction[];
15
15
  userFeatures?: UserFeature[];
16
+ /** Loaded by the host (pulse); experiences never fetches it. Read and PUT by insight CTAs. */
17
+ userInsightProfile?: UserInsightProfile;
16
18
  }
17
19
  type OnStoreUpdate = (update: ObservedUpdate) => void;
18
20
  export type ObservedUpdate = {
@@ -61,6 +63,6 @@ export declare class GlobalStore {
61
63
  captureException: (error: unknown, context?: Record<string, string>) => void;
62
64
  emitUpdate: (change: ObservedUpdate) => void;
63
65
  loadConfigData: () => Promise<void>;
64
- loadData: ({ accounts, appData, associatedBeats, categories, institutions, transactionRules, transactions, userFeatures, merchantBudgets, }?: LoadDataProps) => Promise<void>;
66
+ loadData: ({ accounts, appData, associatedBeats, categories, institutions, transactionRules, transactions, userFeatures, merchantBudgets, userInsightProfile, }?: LoadDataProps) => Promise<void>;
65
67
  }
66
68
  export {};
@@ -1,32 +1,32 @@
1
- import { AccountStore as p } from "./AccountStore.es.js";
2
- import { AgreementStore as m } from "./AgreementStore.es.js";
3
- import { AppDataStore as c } from "./AppDataStore.es.js";
4
- import { AnalyticsStore as f } from "./AnalyticsStore.es.js";
5
- import { BeatStore as l } from "./BeatStore.es.js";
6
- import { BudgetsStore as g } from "./BudgetsStore.es.js";
7
- import { CashflowStore as w } from "./CashflowStore.es.js";
8
- import { CategoryStore as d } from "./CategoryStore.es.js";
9
- import { ConnectStore as u } from "./ConnectStore.es.js";
10
- import { DebtsStore as b } from "./DebtsStore.es.js";
11
- import { FinstrongStore as y } from "./FinstrongStore.es.js";
12
- import { DefaultAppConfig as h } from "../constants/DefaultConfig.es.js";
13
- import { GlobalUiStore as C } from "./GlobalUiStore.es.js";
14
- import { GlobalCopyStore as U } from "./GlobalCopyStore.es.js";
15
- import { GoalStore as A } from "./GoalStore.es.js";
16
- import { HelpStore as D } from "./HelpStore.es.js";
17
- import { HoldingStore as T } from "./HoldingStore.es.js";
18
- import { InsightsV2Store as E } from "./InsightsV2Store.es.js";
19
- import { MerchantStore as x } from "./MerchantStore.es.js";
20
- import { NetWorthStore as k } from "./NetWorthStore.es.js";
21
- import { NotificationStore as G } from "./NotificationStore.es.js";
22
- import { RecurringTransactionsStore as I } from "./RecurringTransactionsStore.es.js";
23
- import { SettingsStore as M } from "./SettingsStore.es.js";
24
- import { TransactionStore as V } from "./TransactionStore.es.js";
25
- import { TrendsStore as W } from "./TrendsStore.es.js";
26
- import { UserStore as v } from "./UserStore.es.js";
27
- import { autorun as z, makeAutoObservable as B } from "mobx";
28
- var pt = class {
29
- appConfig = h;
1
+ import { AccountStore as m } from "./AccountStore.es.js";
2
+ import { AgreementStore as c } from "./AgreementStore.es.js";
3
+ import { AppDataStore as f } from "./AppDataStore.es.js";
4
+ import { AnalyticsStore as l } from "./AnalyticsStore.es.js";
5
+ import { BeatStore as g } from "./BeatStore.es.js";
6
+ import { BudgetsStore as w } from "./BudgetsStore.es.js";
7
+ import { CashflowStore as d } from "./CashflowStore.es.js";
8
+ import { CategoryStore as u } from "./CategoryStore.es.js";
9
+ import { ConnectStore as b } from "./ConnectStore.es.js";
10
+ import { DebtsStore as y } from "./DebtsStore.es.js";
11
+ import { FinstrongStore as C } from "./FinstrongStore.es.js";
12
+ import { DefaultAppConfig as p } from "../constants/DefaultConfig.es.js";
13
+ import { GlobalUiStore as U } from "./GlobalUiStore.es.js";
14
+ import { GlobalCopyStore as A } from "./GlobalCopyStore.es.js";
15
+ import { GoalStore as D } from "./GoalStore.es.js";
16
+ import { HelpStore as T } from "./HelpStore.es.js";
17
+ import { HoldingStore as E } from "./HoldingStore.es.js";
18
+ import { InsightsV2Store as x } from "./InsightsV2Store.es.js";
19
+ import { MerchantStore as k } from "./MerchantStore.es.js";
20
+ import { NetWorthStore as G } from "./NetWorthStore.es.js";
21
+ import { NotificationStore as I } from "./NotificationStore.es.js";
22
+ import { RecurringTransactionsStore as M } from "./RecurringTransactionsStore.es.js";
23
+ import { SettingsStore as V } from "./SettingsStore.es.js";
24
+ import { TransactionStore as W } from "./TransactionStore.es.js";
25
+ import { TrendsStore as v } from "./TrendsStore.es.js";
26
+ import { UserStore as z } from "./UserStore.es.js";
27
+ import { autorun as B, makeAutoObservable as H } from "mobx";
28
+ var mt = class {
29
+ appConfig = p;
30
30
  endpoint = "/";
31
31
  sessionToken = "";
32
32
  onCaptureException;
@@ -57,8 +57,8 @@ var pt = class {
57
57
  userStore;
58
58
  globalUiStore;
59
59
  insightsV2Store;
60
- constructor(t = h, o = "/", e, r, i) {
61
- this.appConfig = t, this.endpoint = o, this.sessionToken = t.options.session_token ?? "", this.onCaptureException = i, this.onError = e, this.onStoreUpdate = r, this.accountStore = new p(this), this.agreementStore = new m(this), this.appDataStore = new c(this), this.analyticsStore = new f(this), this.beatStore = new l(this), this.budgetsStore = new g(this), this.cashflowStore = new w(this), this.categoryStore = new d(this), this.connectStore = new u(this), this.copyStore = new U(this), this.debtsStore = new b(this), this.finstrongStore = new y(this), this.goalStore = new A(this), this.helpStore = new D(this), this.holdingStore = new T(this), this.merchantStore = new x(this), this.netWorthStore = new k(this), this.notificationStore = new G(this), this.recurringTransactionsStore = new I(this), this.settingsStore = new M(this), this.transactionStore = new V(this), this.trendsStore = new W(this), this.userStore = new v(this), this.globalUiStore = new C(this), this.insightsV2Store = new E(this), B(this), z(() => {
60
+ constructor(t = p, o = "/", e, r, i) {
61
+ this.appConfig = t, this.endpoint = o, this.sessionToken = t.options.session_token ?? "", this.onCaptureException = i, this.onError = e, this.onStoreUpdate = r, this.accountStore = new m(this), this.agreementStore = new c(this), this.appDataStore = new f(this), this.analyticsStore = new l(this), this.beatStore = new g(this), this.budgetsStore = new w(this), this.cashflowStore = new d(this), this.categoryStore = new u(this), this.connectStore = new b(this), this.copyStore = new A(this), this.debtsStore = new y(this), this.finstrongStore = new C(this), this.goalStore = new D(this), this.helpStore = new T(this), this.holdingStore = new E(this), this.merchantStore = new k(this), this.netWorthStore = new G(this), this.notificationStore = new I(this), this.recurringTransactionsStore = new M(this), this.settingsStore = new V(this), this.transactionStore = new W(this), this.trendsStore = new v(this), this.userStore = new z(this), this.globalUiStore = new U(this), this.insightsV2Store = new x(this), H(this), B(() => {
62
62
  const { transactions: s } = this.transactionStore;
63
63
  this.emitUpdate({ transactions: s });
64
64
  });
@@ -84,12 +84,12 @@ var pt = class {
84
84
  this.userStore.loadUserFeatures()
85
85
  ]);
86
86
  };
87
- loadData = async ({ accounts: t, appData: o, associatedBeats: e, categories: r, institutions: i, transactionRules: s, transactions: a, userFeatures: n, merchantBudgets: S } = {}) => {
88
- (!o || !n) && await this.loadConfigData(), o && this.appDataStore.setAppData(o), n && this.userStore.setUserFeatures(n), t && (await this.accountStore.loadMembers(), i && this.accountStore.setInstitutions(i), this.accountStore.setAccounts(t)), e && this.transactionStore.setAssociatedBeats(e), r && this.categoryStore.setCategories(r), a && this.transactionStore.setTransactions(a), s && this.transactionStore.setTransactionRules(s), S && this.budgetsStore.setMerchantBudgets(S);
87
+ loadData = async ({ accounts: t, appData: o, associatedBeats: e, categories: r, institutions: i, transactionRules: s, transactions: a, userFeatures: n, merchantBudgets: S, userInsightProfile: h } = {}) => {
88
+ (!o || !n) && await this.loadConfigData(), o && this.appDataStore.setAppData(o), n && this.userStore.setUserFeatures(n), t && (await this.accountStore.loadMembers(), i && this.accountStore.setInstitutions(i), this.accountStore.setAccounts(t)), e && this.transactionStore.setAssociatedBeats(e), r && this.categoryStore.setCategories(r), a && this.transactionStore.setTransactions(a), s && this.transactionStore.setTransactionRules(s), S && this.budgetsStore.setMerchantBudgets(S), h && this.userStore.setUserInsightProfile(h);
89
89
  };
90
90
  };
91
91
  export {
92
- pt as GlobalStore
92
+ mt as GlobalStore
93
93
  };
94
94
 
95
95
  //# sourceMappingURL=GlobalStore.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GlobalStore.es.js","names":[],"sources":["../../../src/core/stores/GlobalStore.ts"],"sourcesContent":["import { autorun, makeAutoObservable } from 'mobx'\n\nimport { DefaultAppConfig } from '../constants/DefaultConfig'\n\nimport {\n AccountStore,\n AgreementStore,\n AnalyticsStore,\n AppDataStore,\n BeatStore,\n BudgetsStore,\n CashflowStore,\n CategoryStore,\n ConnectStore,\n DebtsStore,\n FinstrongStore,\n GlobalCopyStore,\n GlobalUiStore,\n GoalStore,\n HelpStore,\n HoldingStore,\n InsightsV2Store,\n MerchantStore,\n NetWorthStore,\n NotificationStore,\n RecurringTransactionsStore,\n SettingsStore,\n TransactionStore,\n TrendsStore,\n UserStore,\n} from '../stores'\n\nimport type {\n Account,\n Category,\n Institution,\n Member,\n AppConfig,\n AppData,\n Beat,\n GlobalCaptureException,\n GlobalErrorHandler,\n MerchantBudget,\n Tag,\n Tagging,\n Transaction,\n TransactionRule,\n UserFeature,\n} from '../types'\n\ninterface LoadDataProps {\n accounts?: Account[]\n appData?: AppData\n associatedBeats?: Beat[]\n categories?: Category[]\n institutions?: Institution[]\n members?: Member[]\n merchantBudgets?: MerchantBudget[]\n taggings?: Tagging[]\n tags?: Tag[]\n transactionRules?: TransactionRule[]\n transactions?: Transaction[]\n userFeatures?: UserFeature[]\n}\n\ntype OnStoreUpdate = (update: ObservedUpdate) => void\nexport type ObservedUpdate = {\n transactions?: Transaction[]\n /**\n * Guid of a beat whose data went stale because of an action taken inside experiences\n * (e.g. an insight CTA that mutated data). Hosts refetch that beat's sampled data.\n * Emitted only from explicit actions, never from the transactions autorun.\n */\n staleBeatGuid?: string\n}\nexport class GlobalStore {\n // Global properties\n appConfig: AppConfig = DefaultAppConfig\n endpoint: string = '/'\n sessionToken: string = ''\n onCaptureException?: GlobalCaptureException\n onError?: GlobalErrorHandler\n onStoreUpdate?: OnStoreUpdate\n\n // Data Stores\n accountStore: AccountStore\n agreementStore: AgreementStore\n appDataStore: AppDataStore\n analyticsStore: AnalyticsStore\n beatStore: BeatStore\n budgetsStore: BudgetsStore\n cashflowStore: CashflowStore\n categoryStore: CategoryStore\n connectStore: ConnectStore\n copyStore: GlobalCopyStore\n debtsStore: DebtsStore\n finstrongStore: FinstrongStore\n goalStore: GoalStore\n helpStore: HelpStore\n holdingStore: HoldingStore\n merchantStore: MerchantStore\n netWorthStore: NetWorthStore\n notificationStore: NotificationStore\n recurringTransactionsStore: RecurringTransactionsStore\n settingsStore: SettingsStore\n transactionStore: TransactionStore\n trendsStore: TrendsStore\n userStore: UserStore\n\n // UI Stores\n globalUiStore: GlobalUiStore\n insightsV2Store: InsightsV2Store\n\n constructor(\n appConfig: AppConfig = DefaultAppConfig,\n endpoint: string = '/',\n onError?: GlobalErrorHandler,\n onStoreUpdate?: OnStoreUpdate,\n onCaptureException?: GlobalCaptureException,\n ) {\n this.appConfig = appConfig\n this.endpoint = endpoint\n this.sessionToken = appConfig.options.session_token ?? ''\n this.onCaptureException = onCaptureException\n this.onError = onError\n this.onStoreUpdate = onStoreUpdate\n\n this.accountStore = new AccountStore(this)\n this.agreementStore = new AgreementStore(this)\n this.appDataStore = new AppDataStore(this)\n this.analyticsStore = new AnalyticsStore(this)\n this.beatStore = new BeatStore(this)\n this.budgetsStore = new BudgetsStore(this)\n this.cashflowStore = new CashflowStore(this)\n this.categoryStore = new CategoryStore(this)\n this.connectStore = new ConnectStore(this)\n this.copyStore = new GlobalCopyStore(this)\n this.debtsStore = new DebtsStore(this)\n this.finstrongStore = new FinstrongStore(this)\n this.goalStore = new GoalStore(this)\n this.helpStore = new HelpStore(this)\n this.holdingStore = new HoldingStore(this)\n this.merchantStore = new MerchantStore(this)\n this.netWorthStore = new NetWorthStore(this)\n this.notificationStore = new NotificationStore(this)\n this.recurringTransactionsStore = new RecurringTransactionsStore(this)\n this.settingsStore = new SettingsStore(this)\n this.transactionStore = new TransactionStore(this)\n this.trendsStore = new TrendsStore(this)\n this.userStore = new UserStore(this)\n\n this.globalUiStore = new GlobalUiStore(this)\n this.insightsV2Store = new InsightsV2Store(this)\n\n makeAutoObservable(this)\n\n // detects a change based on an observed value\n autorun(() => {\n // destructure or assign new variables to observe changes to them\n // in this case we are observing changes to `transactions`\n const { transactions } = this.transactionStore\n this.emitUpdate({\n transactions,\n })\n })\n }\n\n get isInitialized() {\n return this.globalUiStore.isInitialized\n }\n\n captureException = (error: unknown, context?: Record<string, string>) => {\n if (this.onCaptureException) {\n this.onCaptureException(error, context)\n return\n }\n console.error('Unreported error:', error, context)\n }\n\n // emits change triggered in the autorun\n emitUpdate = (change: ObservedUpdate) => {\n this.onStoreUpdate?.(change)\n }\n\n loadConfigData = async () => {\n await Promise.all([\n // Load copy, config and user data\n this.copyStore.loadCopy(),\n this.appDataStore.loadAppData(),\n this.accountStore.refreshMembers(),\n this.userStore.loadUserFeatures(),\n ])\n }\n\n loadData = async ({\n accounts,\n appData,\n associatedBeats,\n categories,\n institutions,\n transactionRules,\n transactions,\n userFeatures,\n merchantBudgets,\n }: LoadDataProps = {}) => {\n if (!appData || !userFeatures) {\n await this.loadConfigData()\n }\n\n // Keep for backwards compatibility for Insights\n if (appData) {\n this.appDataStore.setAppData(appData)\n }\n\n if (userFeatures) {\n this.userStore.setUserFeatures(userFeatures)\n }\n\n if (accounts) {\n await this.accountStore.loadMembers()\n if (institutions) {\n this.accountStore.setInstitutions(institutions)\n }\n this.accountStore.setAccounts(accounts)\n }\n\n if (associatedBeats) {\n this.transactionStore.setAssociatedBeats(associatedBeats)\n }\n\n if (categories) {\n this.categoryStore.setCategories(categories)\n }\n\n if (transactions) {\n this.transactionStore.setTransactions(transactions)\n }\n\n if (transactionRules) {\n this.transactionStore.setTransactionRules(transactionRules)\n }\n\n if (merchantBudgets) {\n this.budgetsStore.setMerchantBudgets(merchantBudgets)\n }\n }\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"GlobalStore.es.js","names":[],"sources":["../../../src/core/stores/GlobalStore.ts"],"sourcesContent":["import { autorun, makeAutoObservable } from 'mobx'\n\nimport { DefaultAppConfig } from '../constants/DefaultConfig'\n\nimport {\n AccountStore,\n AgreementStore,\n AnalyticsStore,\n AppDataStore,\n BeatStore,\n BudgetsStore,\n CashflowStore,\n CategoryStore,\n ConnectStore,\n DebtsStore,\n FinstrongStore,\n GlobalCopyStore,\n GlobalUiStore,\n GoalStore,\n HelpStore,\n HoldingStore,\n InsightsV2Store,\n MerchantStore,\n NetWorthStore,\n NotificationStore,\n RecurringTransactionsStore,\n SettingsStore,\n TransactionStore,\n TrendsStore,\n UserStore,\n} from '../stores'\n\nimport type {\n Account,\n Category,\n Institution,\n Member,\n AppConfig,\n AppData,\n Beat,\n GlobalCaptureException,\n GlobalErrorHandler,\n MerchantBudget,\n Tag,\n Tagging,\n Transaction,\n TransactionRule,\n UserFeature,\n UserInsightProfile,\n} from '../types'\n\ninterface LoadDataProps {\n accounts?: Account[]\n appData?: AppData\n associatedBeats?: Beat[]\n categories?: Category[]\n institutions?: Institution[]\n members?: Member[]\n merchantBudgets?: MerchantBudget[]\n taggings?: Tagging[]\n tags?: Tag[]\n transactionRules?: TransactionRule[]\n transactions?: Transaction[]\n userFeatures?: UserFeature[]\n /** Loaded by the host (pulse); experiences never fetches it. Read and PUT by insight CTAs. */\n userInsightProfile?: UserInsightProfile\n}\n\ntype OnStoreUpdate = (update: ObservedUpdate) => void\nexport type ObservedUpdate = {\n transactions?: Transaction[]\n /**\n * Guid of a beat whose data went stale because of an action taken inside experiences\n * (e.g. an insight CTA that mutated data). Hosts refetch that beat's sampled data.\n * Emitted only from explicit actions, never from the transactions autorun.\n */\n staleBeatGuid?: string\n}\nexport class GlobalStore {\n // Global properties\n appConfig: AppConfig = DefaultAppConfig\n endpoint: string = '/'\n sessionToken: string = ''\n onCaptureException?: GlobalCaptureException\n onError?: GlobalErrorHandler\n onStoreUpdate?: OnStoreUpdate\n\n // Data Stores\n accountStore: AccountStore\n agreementStore: AgreementStore\n appDataStore: AppDataStore\n analyticsStore: AnalyticsStore\n beatStore: BeatStore\n budgetsStore: BudgetsStore\n cashflowStore: CashflowStore\n categoryStore: CategoryStore\n connectStore: ConnectStore\n copyStore: GlobalCopyStore\n debtsStore: DebtsStore\n finstrongStore: FinstrongStore\n goalStore: GoalStore\n helpStore: HelpStore\n holdingStore: HoldingStore\n merchantStore: MerchantStore\n netWorthStore: NetWorthStore\n notificationStore: NotificationStore\n recurringTransactionsStore: RecurringTransactionsStore\n settingsStore: SettingsStore\n transactionStore: TransactionStore\n trendsStore: TrendsStore\n userStore: UserStore\n\n // UI Stores\n globalUiStore: GlobalUiStore\n insightsV2Store: InsightsV2Store\n\n constructor(\n appConfig: AppConfig = DefaultAppConfig,\n endpoint: string = '/',\n onError?: GlobalErrorHandler,\n onStoreUpdate?: OnStoreUpdate,\n onCaptureException?: GlobalCaptureException,\n ) {\n this.appConfig = appConfig\n this.endpoint = endpoint\n this.sessionToken = appConfig.options.session_token ?? ''\n this.onCaptureException = onCaptureException\n this.onError = onError\n this.onStoreUpdate = onStoreUpdate\n\n this.accountStore = new AccountStore(this)\n this.agreementStore = new AgreementStore(this)\n this.appDataStore = new AppDataStore(this)\n this.analyticsStore = new AnalyticsStore(this)\n this.beatStore = new BeatStore(this)\n this.budgetsStore = new BudgetsStore(this)\n this.cashflowStore = new CashflowStore(this)\n this.categoryStore = new CategoryStore(this)\n this.connectStore = new ConnectStore(this)\n this.copyStore = new GlobalCopyStore(this)\n this.debtsStore = new DebtsStore(this)\n this.finstrongStore = new FinstrongStore(this)\n this.goalStore = new GoalStore(this)\n this.helpStore = new HelpStore(this)\n this.holdingStore = new HoldingStore(this)\n this.merchantStore = new MerchantStore(this)\n this.netWorthStore = new NetWorthStore(this)\n this.notificationStore = new NotificationStore(this)\n this.recurringTransactionsStore = new RecurringTransactionsStore(this)\n this.settingsStore = new SettingsStore(this)\n this.transactionStore = new TransactionStore(this)\n this.trendsStore = new TrendsStore(this)\n this.userStore = new UserStore(this)\n\n this.globalUiStore = new GlobalUiStore(this)\n this.insightsV2Store = new InsightsV2Store(this)\n\n makeAutoObservable(this)\n\n // detects a change based on an observed value\n autorun(() => {\n // destructure or assign new variables to observe changes to them\n // in this case we are observing changes to `transactions`\n const { transactions } = this.transactionStore\n this.emitUpdate({\n transactions,\n })\n })\n }\n\n get isInitialized() {\n return this.globalUiStore.isInitialized\n }\n\n captureException = (error: unknown, context?: Record<string, string>) => {\n if (this.onCaptureException) {\n this.onCaptureException(error, context)\n return\n }\n console.error('Unreported error:', error, context)\n }\n\n // emits change triggered in the autorun\n emitUpdate = (change: ObservedUpdate) => {\n this.onStoreUpdate?.(change)\n }\n\n loadConfigData = async () => {\n await Promise.all([\n // Load copy, config and user data\n this.copyStore.loadCopy(),\n this.appDataStore.loadAppData(),\n this.accountStore.refreshMembers(),\n this.userStore.loadUserFeatures(),\n ])\n }\n\n loadData = async ({\n accounts,\n appData,\n associatedBeats,\n categories,\n institutions,\n transactionRules,\n transactions,\n userFeatures,\n merchantBudgets,\n userInsightProfile,\n }: LoadDataProps = {}) => {\n if (!appData || !userFeatures) {\n await this.loadConfigData()\n }\n\n // Keep for backwards compatibility for Insights\n if (appData) {\n this.appDataStore.setAppData(appData)\n }\n\n if (userFeatures) {\n this.userStore.setUserFeatures(userFeatures)\n }\n\n if (accounts) {\n await this.accountStore.loadMembers()\n if (institutions) {\n this.accountStore.setInstitutions(institutions)\n }\n this.accountStore.setAccounts(accounts)\n }\n\n if (associatedBeats) {\n this.transactionStore.setAssociatedBeats(associatedBeats)\n }\n\n if (categories) {\n this.categoryStore.setCategories(categories)\n }\n\n if (transactions) {\n this.transactionStore.setTransactions(transactions)\n }\n\n if (transactionRules) {\n this.transactionStore.setTransactionRules(transactionRules)\n }\n\n if (merchantBudgets) {\n this.budgetsStore.setMerchantBudgets(merchantBudgets)\n }\n\n if (userInsightProfile) {\n this.userStore.setUserInsightProfile(userInsightProfile)\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EA,IAAa,KAAb,MAAyB;AAAA,EAEvB,YAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB,eAAuB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EAEA,YACE,IAAuB,GACvB,IAAmB,KACnB,GACA,GACA,GACA;AACA,SAAK,YAAY,GACjB,KAAK,WAAW,GAChB,KAAK,eAAe,EAAU,QAAQ,iBAAiB,IACvD,KAAK,qBAAqB,GAC1B,KAAK,UAAU,GACf,KAAK,gBAAgB,GAErB,KAAK,eAAe,IAAI,EAAa,IAAI,GACzC,KAAK,iBAAiB,IAAI,EAAe,IAAI,GAC7C,KAAK,eAAe,IAAI,EAAa,IAAI,GACzC,KAAK,iBAAiB,IAAI,EAAe,IAAI,GAC7C,KAAK,YAAY,IAAI,EAAU,IAAI,GACnC,KAAK,eAAe,IAAI,EAAa,IAAI,GACzC,KAAK,gBAAgB,IAAI,EAAc,IAAI,GAC3C,KAAK,gBAAgB,IAAI,EAAc,IAAI,GAC3C,KAAK,eAAe,IAAI,EAAa,IAAI,GACzC,KAAK,YAAY,IAAI,EAAgB,IAAI,GACzC,KAAK,aAAa,IAAI,EAAW,IAAI,GACrC,KAAK,iBAAiB,IAAI,EAAe,IAAI,GAC7C,KAAK,YAAY,IAAI,EAAU,IAAI,GACnC,KAAK,YAAY,IAAI,EAAU,IAAI,GACnC,KAAK,eAAe,IAAI,EAAa,IAAI,GACzC,KAAK,gBAAgB,IAAI,EAAc,IAAI,GAC3C,KAAK,gBAAgB,IAAI,EAAc,IAAI,GAC3C,KAAK,oBAAoB,IAAI,EAAkB,IAAI,GACnD,KAAK,6BAA6B,IAAI,EAA2B,IAAI,GACrE,KAAK,gBAAgB,IAAI,EAAc,IAAI,GAC3C,KAAK,mBAAmB,IAAI,EAAiB,IAAI,GACjD,KAAK,cAAc,IAAI,EAAY,IAAI,GACvC,KAAK,YAAY,IAAI,EAAU,IAAI,GAEnC,KAAK,gBAAgB,IAAI,EAAc,IAAI,GAC3C,KAAK,kBAAkB,IAAI,EAAgB,IAAI,GAE/C,EAAmB,IAAI,GAGvB,EAAA,MAAc;AAGZ,YAAM,EAAE,cAAA,EAAA,IAAiB,KAAK;AAC9B,WAAK,WAAW,EACd,cAAA,EACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,IAAI,gBAAgB;AAClB,WAAO,KAAK,cAAc;AAAA,EAC5B;AAAA,EAEA,mBAAA,CAAoB,GAAgB,MAAqC;AACvE,QAAI,KAAK,oBAAoB;AAC3B,WAAK,mBAAmB,GAAO,CAAO;AACtC;AAAA,IACF;AACA,YAAQ,MAAM,qBAAqB,GAAO,CAAO;AAAA,EACnD;AAAA,EAGA,aAAA,CAAc,MAA2B;AACvC,SAAK,gBAAgB,CAAM;AAAA,EAC7B;AAAA,EAEA,iBAAiB,YAAY;AAC3B,UAAM,QAAQ,IAAI;AAAA,MAEhB,KAAK,UAAU,SAAS;AAAA,MACxB,KAAK,aAAa,YAAY;AAAA,MAC9B,KAAK,aAAa,eAAe;AAAA,MACjC,KAAK,UAAU,iBAAiB;AAAA,IAClC,CAAC;AAAA,EACH;AAAA,EAEA,WAAW,OAAO,EAChB,UAAA,GACA,SAAA,GACA,iBAAA,GACA,YAAA,GACA,cAAA,GACA,kBAAA,GACA,cAAA,GACA,cAAA,GACA,iBAAA,GACA,oBAAA,EAAA,IACiB,CAAC,MAAM;AACxB,KAAI,CAAC,KAAW,CAAC,MACf,MAAM,KAAK,eAAe,GAIxB,KACF,KAAK,aAAa,WAAW,CAAO,GAGlC,KACF,KAAK,UAAU,gBAAgB,CAAY,GAGzC,MACF,MAAM,KAAK,aAAa,YAAY,GAChC,KACF,KAAK,aAAa,gBAAgB,CAAY,GAEhD,KAAK,aAAa,YAAY,CAAQ,IAGpC,KACF,KAAK,iBAAiB,mBAAmB,CAAe,GAGtD,KACF,KAAK,cAAc,cAAc,CAAU,GAGzC,KACF,KAAK,iBAAiB,gBAAgB,CAAY,GAGhD,KACF,KAAK,iBAAiB,oBAAoB,CAAgB,GAGxD,KACF,KAAK,aAAa,mBAAmB,CAAe,GAGlD,KACF,KAAK,UAAU,sBAAsB,CAAkB;AAAA,EAE3D;AACF"}
@@ -252,6 +252,7 @@ export declare const BlockType: {
252
252
  readonly DoubleBarChartBlock: "double_bar_chart_block";
253
253
  readonly DoubleProgressBarBlock: "double_progress_bar_block";
254
254
  readonly DebtsBlock: "debts_block";
255
+ readonly GoalsBlock: "goals_block";
255
256
  readonly NoSpendDaysBlock: "no_spend_days_block";
256
257
  readonly RepeatingTransactionBlock: "repeating_transaction_block";
257
258
  readonly SaveExtraBlock: "save_extra_block";
@@ -1 +1 @@
1
- {"version":3,"file":"Insights.es.js","names":[],"sources":["../../../src/core/types/Insights.ts"],"sourcesContent":["// ============ Core InsightsV2 Types ============\n\nimport { InsightsInstanceSlotData } from './InsightsInstanceSlotData'\n\nexport interface ThemedSVGImageProps {\n divProps?: React.HTMLAttributes<HTMLDivElement>\n image: React.ComponentType<React.SVGProps<SVGSVGElement>>\n isMini?: boolean\n}\n\n/**\n * Emitted by a block when the user drills into a specific datum (e.g. clicks a\n * chart bar). Named fields rather than positional args so blocks with differing\n * shapes can extend this without the call sites transposing values.\n */\nexport interface DrilldownPayload {\n chartBarIndex: number\n tabIndex?: number\n transaction_guid?: string\n block?: string\n}\n\n/**\n * Which envelope a beat was fetched with. `embedded` (the transaction-row pill + details-drawer\n * card) and `notification` are V2 additions; a surface asks for one with `widget_type=` on the fetch.\n */\nexport type WidgetType = 'full' | 'mini' | 'micro' | 'embedded' | 'notification'\n\n/**\n * V2: the transaction-row tag, its own small section of the `embedded` envelope (the same grammar\n * as `description` / `footer`, with room for a tone or an icon later). Omitted for an insight that\n * tags no transaction row. It deliberately is *not* `short_title`, which stays a per-variant\n * attribute with a second consumer (the bank-holiday sub-header).\n */\nexport interface Pill {\n text: string\n}\n\n/**\n * V2: facts a drilldown shows that the card does not (e.g. the account number for the Transaction\n * Details drawer), or the guid list a list drawer shows (`transaction_guids`). Scalars or string\n * lists, shared by every CTA of the card, omitted when the insight has none. Never carries copy or\n * user actions (memo, tags, hide, flag come from the transaction store). Values come from the\n * server, so a reader still checks each value's runtime shape.\n */\nexport type DrilldownData = Record<string, string | number | boolean | null | string[]>\n\nexport interface InsightsPayload {\n widget_type: WidgetType\n instance_slot: InstanceSlot\n /**\n * V1 only. The v2 contract carries everything a block needs on `instance_slot.data`,\n * and omits this key entirely (see the LargeTransactionV2 payload). Blocks that still require it\n * get it as a required field through `BlockProps`, which re-declares it.\n */\n instance_slot_data?: InsightsInstanceSlotData\n description: Description\n primary_cta?: PrimaryCTA\n secondary_cta?: SecondaryCTA\n title?: string\n sub_title?: Subtitle\n /**\n * V2 rename of `sub_title`: a flat string, with the logo promoted to the payload-level `logo`\n * field below. `sub_title` wins when both are present.\n */\n subtitle?: string\n /** V2: header logo paired with the flat `subtitle`: an entity guid or a status icon (`LogoRef`). */\n logo?: LogoRef\n /** V2: which design branch the backend picked (e.g. `no_merchant`). */\n variant?: string\n /** V2, `embedded` envelope only: the transaction-row pill. */\n pill?: Pill\n /**\n * V2: drilldown-only facts, e.g. `{ account_number: 'XXXXXXXX043' }`, or the guid list a list\n * drawer shows (`{ transaction_guids: [...] }`).\n */\n drilldown_data?: DrilldownData\n footer?: Footer\n /**\n * V2: the link inside the description: on the full card a drawer of its own (Low Account\n * Balance's \"Transactions ›\"); on mini and micro the card's action, sent instead of `primary_cta`.\n * Absent when the beat has no link.\n */\n in_description_cta?: InDescriptionCTA\n guid: string\n user_guid: string\n client_guid?: string\n /** Template name, e.g. `LargeTransactionV2`. */\n template?: string\n revision?: number\n /** Unix seconds. */\n created_at?: number\n /** Unix seconds. */\n updated_at?: number\n /** Unix seconds. */\n active_at?: number\n displayed_at?: number | null\n dismissed_at: number | null\n cta_clicked_at?: number | null\n has_been_displayed?: boolean\n is_dismissed: boolean\n is_deleted?: boolean\n is_hidden_by_system?: boolean\n is_obsolete?: boolean\n is_refreshable?: boolean\n is_sampled?: boolean\n is_zero_state?: boolean\n status?: string | null\n /**\n * V2 (LargeTransactionV2 onward): the entities the beat is about, carried on the payload so\n * action blocks do not have to reach back out to the beat envelope.\n */\n primary_account_guid?: string | null\n primary_transaction_guid?: string | null\n primary_category_guid?: string | null\n primary_merchant_guid?: string | null\n /**\n * V2: the repeating transaction a subscription beat is about (Upcoming Subscription, Subscription\n * Price Increase). Read by `recurring_transaction_block`, see\n * `actionBlocks/RecurringTransactionBlock/subscriptionBeats.ts`.\n */\n primary_repeating_transaction_guid?: string | null\n}\n\nexport interface Legends {\n label: string\n value: number\n additional_value?: number\n additional_value_type?: string\n value_type?: string\n}\n\nexport interface Logo {\n category_guid?: string\n category_name?: string\n institution_guid?: string\n institution_name?: string\n logo_color?: string\n /** Draw the `logo_name` icon filled (V2 `ICO-` logos). */\n logo_fill?: boolean\n logo_name?: string\n merchant_guid?: string\n merchant_name?: string\n}\n\nexport interface Subtitle {\n logo?: Logo\n text: string\n}\n\n/**\n * A V2 logo, shared by the header (`InsightsPayload.logo`) and every instance-slot row. It takes\n * one of two shapes:\n *\n * - **Entity**: `guid`, whose prefix (`INS-` / `MCH-` / `CAT-`) picks the logo component, plus an\n * optional `fallback_guid` for when that component's asset cannot load. Today that is the\n * category behind an `MCH-` guid, which `MerchantLogo` shows as a tile when the merchant image\n * is missing.\n * - **Status icon**: `icon` (an mx-icons name, e.g. `warning`) and `color` (a theme palette path,\n * e.g. `error.main`), for subheaders that show a state rather than an entity (V1's\n * `logo_name` / `logo_color`).\n *\n * `alt` is the accessible name for either shape. A logo sends one shape; if it sends both, `icon`\n * wins, as `logo_name` does in V1's `SubHeader`.\n */\nexport interface LogoRef {\n alt?: string\n color?: string\n fallback_guid?: string\n guid?: string\n icon?: string\n}\n\nexport interface CategoryLogo {\n category_guid: string\n category_name: string\n}\n\nexport interface MerchantLogo {\n merchant_guid: string\n merchant_name: string\n}\n\nexport interface InstitutionLogo {\n institution_guid: string\n institution_name: string\n}\n\nexport interface Description {\n text: string\n html_text: string\n}\n\n/**\n * Post message a CTA press sends to the host, resolved by the backend for the beat's current\n * state. Absent/null = the backend has not described one: the frontend uses the template's\n * interim `ctaPostMessages` entry if there is one, else sends no message. `payload` carries only\n * beat-specific extras; the frontend always adds `beat_guid`, `beat_template`, `user_guid` and\n * `action_string`.\n */\nexport interface CtaPostMessageMetadata {\n /** Post message event; defaults to `beat/cta`. */\n event?: string | null\n /** Operation the host should perform, e.g. `op_1`, `op_2`, `op_3`. Defaults to `op_1`. */\n action?: string | null\n /** Beat-specific fields merged into the message metadata (account ids, amounts, ...). */\n payload?: Record<string, unknown> | null\n}\n\nexport interface PrimaryCTA {\n label: string\n block: string\n variant?: string | null\n /**\n * What pressing the CTA does beyond opening its block, named by the backend (ditto\n * `primary_cta_action`, passed through by tupac). Looked up in `insights-v2/ctaActions`;\n * null / absent / unknown means the CTA only opens its block or posts its message.\n */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n}\n\nexport interface SecondaryCTA {\n label: string\n /**\n * Drawer block to open. `null` when the CTA opens nothing (ditto `secondary_cta_block: null`,\n * e.g. Fee Detected's \"Contact Support\"): the press posts its message to the host instead.\n */\n block: string | null\n variant?: string | null\n /** See `PrimaryCTA.action_key` (ditto `secondary_cta_action`). */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n}\n\n/**\n * The description link: its label, the action block it opens and, like a CTA's, the variant that\n * tells that block what to show (ditto's `in_description_cta_variant`, e.g. `low_balance`). On mini\n * and micro it words the card's action; `block` is empty when that action opens no drawer.\n */\nexport interface InDescriptionCTA {\n label: string\n block?: string\n variant?: string | null\n action_key?: string | null\n}\n\nexport interface Footer {\n /** V1: a pre-formatted date string. */\n date?: string\n /**\n * The account label, on both V1 and V2. The backend resolves the plurality: one account sends\n * its name (e.g. `Epic Bank`), several send a localized count (e.g. `2 Accounts`), none sends\n * `null` (tupac's `footer_account_label` returns nil for a beat with no accounts, as Payday Cash\n * Left Over Status does). There is deliberately no separate `accounts` key.\n */\n account?: string | null\n /**\n * V2 (LargeTransactionV2 onward): unix seconds, formatted by `Footer` for display.\n * Replaces `date`; `date` wins when a beat somehow sends both.\n */\n timestamp?: number\n}\n\n// ============ Instance Slot Types ============\n// Values are the snake_case block names the backend sends on a beat's instance slot; the PascalCase\n// keys stay as friendly references (e.g. BlockType.BarChartBlock === 'bar_chart_block').\nexport const BlockType = {\n AccountBlock: 'account_block',\n AccountSwitchBlock: 'account_switch_block',\n BarChartBlock: 'bar_chart_block',\n BudgetBlock: 'budget_block',\n DirectDepositBlock: 'direct_deposit_block',\n ImageBlock: 'image_block',\n TransactionBlock: 'transaction_block',\n DonutChartBlock: 'donut_chart_block',\n DoubleBarChartBlock: 'double_bar_chart_block',\n DoubleProgressBarBlock: 'double_progress_bar_block',\n DebtsBlock: 'debts_block',\n NoSpendDaysBlock: 'no_spend_days_block',\n RepeatingTransactionBlock: 'repeating_transaction_block',\n SaveExtraBlock: 'save_extra_block',\n SavingsOpportunityBlock: 'savings_opportunity_block',\n StepChartBlock: 'step_chart_block',\n SVGImageBlock: 'svg_image_block',\n UpcomingBillBlock: 'upcoming_bill_block',\n UpcomingSubscriptionBlock: 'upcoming_subscription_block',\n WithdrawalBlock: 'withdrawal_block',\n} as const\n\nexport type BlockType = (typeof BlockType)[keyof typeof BlockType]\n\n/**\n * A pre-localized row on a V2 instance slot. The backend resolves the copy and formatting; the\n * logo is a `LogoRef` (an entity guid or a status icon, see `logoFromRef`).\n */\nexport interface InstanceSlotRow {\n amount?: number\n logo?: LogoRef\n primary_text?: string\n secondary_text?: string\n}\n\n/**\n * V2: the slots a block's variant filled, keyed by slot name; ditto owns the names and omits any\n * slot it has no value for (`lib/ditto/blocks/<block>.yml`). Read with `slot()`, which names the\n * kind the caller expects.\n */\nexport interface InstanceSlotData {\n [slot: string]: unknown\n}\n\n/**\n * Reads one slot off a block's `data`; undefined when ditto did not fill it.\n *\n * The caller names the kind, because the slot's kind lives in the block's ditto schema and not\n * here — a block fills slots with whatever its card needs, so no fixed list of kinds would hold\n * (`account_switch_block` alone carries a boolean and `budget_block` a nested object).\n */\nexport const slot = <T = unknown>(\n data: InstanceSlotData | undefined,\n name: string,\n): T | undefined => data?.[name] as T | undefined\n\n/**\n * V2: which block renders this beat's content, and what it renders.\n *\n * `block` is optional: a beat whose template has no ditto config arrives as an empty `{}` and the\n * card renders its copy and CTAs alone, so a reader cannot assume a block is named. One interface\n * with `block` optional rather than a union with `Record<string, never>`, which TypeScript absorbs\n * — that union left `block` reading as required and typed a promise it did not keep.\n *\n * `variant` is optional for the same reason — the empty `{}` carries neither. Every ditto beat\n * file that names a block also names a variant, so a *filled* slot always has one; ditto drops a\n * nil variant rather than sending null, which is why the type is `string | null | undefined`.\n */\nexport interface InstanceSlot {\n block?: BlockType\n variant?: string | null\n /** The slots this block's variant declares in ditto. */\n data?: InstanceSlotData\n // Direct Deposit block (Set Up Direct Deposit, Switch Direct Deposit, Missing\n // Interest Rate): account facts carried flat on the slot, beside `data`.\n /** Primary line on the hero card, e.g. \"Epic Bank Checking, *1234\". */\n account_name?: string\n /** Secondary line beneath the name, e.g. \"Checking Account\" / \"Credit Card\". */\n account_type?: string\n /** Status pill label, e.g. \"Direct Deposit Not Set Up\" / \"Interest Rate: 19.99% APR\". */\n status_text?: string\n institution_guid?: string\n institution_name?: string\n // Shared across multiple V2 component blocks:\n // `amount` — UpcomingBillBlock (projected bill), SavingsOpportunityBlock (coupon),\n // UpcomingSubscriptionBlock (price per cadence).\n // `merchant_guid` / `merchant_name` — UpcomingBillBlock (bill row logo + name),\n // UpcomingSubscriptionBlock (hero logo + name).\n /** Dollar amount (unformatted); the block formats it as currency. */\n amount?: number\n // Withdrawal block (Emergency Fund Withdrawal): one row flat on the slot - `amount` above is the\n // withdrawal, shown with its date line \"{amount_label} {withdrawal_date}\" over the balance row.\n /** Pre-localized lead-in for the date line, e.g. \"Withdrawn on\". */\n amount_label?: string\n /** The withdrawal's calendar day, `YYYY-MM-DD` (e.g. `2026-10-20`); the card formats it. */\n withdrawal_date?: string\n /** Account balance after the withdrawal (unformatted); the card formats it as currency. */\n balance?: number\n /** Pre-localized label for the balance row, e.g. \"Balance\". */\n balance_label?: string\n /** Merchant guid used to render the inline / hero logo via `LogoFromGuid` (`MCH-...`). */\n merchant_guid?: string\n /** Merchant display name — shown as logo alt text and as the merchant/hero label. */\n merchant_name?: string\n // Upcoming Bill block (Projected Bill Payment): the block derives the Sun→Sat week strip\n // around `due_date` at render time.\n /** Due date of the projected bill in ISO form (e.g. `2025-10-30`). */\n due_date?: string\n // Savings Opportunity block (Save An Extra, Potential Savings, Embedded): purely data-driven\n // coupon card. Backend sends the caption and the amount, plus `slot` to toggle the green\n // gradient background when the card is embedded in a parent surface that supplies its own.\n /** Caption shown above the amount, e.g. `Save an extra` or `Potential savings`. */\n label?: string\n /**\n * Whether to render the green gradient slot behind the coupon. Defaults to true. Backend sends\n * `false` when the coupon is embedded in a parent surface that supplies its own background.\n */\n slot?: boolean\n // Upcoming Subscription block: billing cadence for the price pill (`${amount} / ${cadence}`).\n /** Billing cadence word that trails the price, e.g. `month` or `year`. */\n cadence?: string\n // Account block (status on/off-track, deposit, payoff variants): card content carried flat on\n // the slot (the V2 contract drops `instance_slot_data`). `amount`, `label`, `merchant_guid`,\n // `merchant_name`, `institution_guid`, `institution_name` are shared fields declared above.\n /** Secondary line beneath the amount on the standard card, e.g. \"Remaining after expenses\". */\n sub_text?: string\n /** Header bar text (standard card) or the colored category strip label (deposit cards). */\n header_text?: string\n /** Generic-tile icon name used when no merchant/institution logo is available. */\n icon_name?: string\n /** Category guid used to render the deposit-card logo fallback. */\n category_guid?: string\n // Debts block: `amount` is the current balance; the shared account/institution fields above.\n /** Projected payoff date in ISO form (e.g. `2027-03-01`); the block formats it as month + year. */\n payoff_date?: string\n /** Monthly payment toward the debt (unformatted); the block formats it as currency. */\n monthly_payment?: number\n /** Annual interest rate as a percentage (e.g. `19.99`); the block formats it as a percent. */\n interest_rate?: number\n start_date?: string\n no_spend_days?: string[]\n}\n"],"mappings":"AA+TA,IAAa,IAAA,CACX,GACA,MACkB,IAAO,CAAA"}
1
+ {"version":3,"file":"Insights.es.js","names":[],"sources":["../../../src/core/types/Insights.ts"],"sourcesContent":["// ============ Core InsightsV2 Types ============\n\nimport { InsightsInstanceSlotData } from './InsightsInstanceSlotData'\n\nexport interface ThemedSVGImageProps {\n divProps?: React.HTMLAttributes<HTMLDivElement>\n image: React.ComponentType<React.SVGProps<SVGSVGElement>>\n isMini?: boolean\n}\n\n/**\n * Emitted by a block when the user drills into a specific datum (e.g. clicks a\n * chart bar). Named fields rather than positional args so blocks with differing\n * shapes can extend this without the call sites transposing values.\n */\nexport interface DrilldownPayload {\n chartBarIndex: number\n tabIndex?: number\n transaction_guid?: string\n block?: string\n}\n\n/**\n * Which envelope a beat was fetched with. `embedded` (the transaction-row pill + details-drawer\n * card) and `notification` are V2 additions; a surface asks for one with `widget_type=` on the fetch.\n */\nexport type WidgetType = 'full' | 'mini' | 'micro' | 'embedded' | 'notification'\n\n/**\n * V2: the transaction-row tag, its own small section of the `embedded` envelope (the same grammar\n * as `description` / `footer`, with room for a tone or an icon later). Omitted for an insight that\n * tags no transaction row. It deliberately is *not* `short_title`, which stays a per-variant\n * attribute with a second consumer (the bank-holiday sub-header).\n */\nexport interface Pill {\n text: string\n}\n\n/**\n * V2: facts a drilldown shows that the card does not (e.g. the account number for the Transaction\n * Details drawer), or the guid list a list drawer shows (`transaction_guids`). Scalars or string\n * lists, shared by every CTA of the card, omitted when the insight has none. Never carries copy or\n * user actions (memo, tags, hide, flag come from the transaction store). Values come from the\n * server, so a reader still checks each value's runtime shape.\n */\nexport type DrilldownData = Record<string, string | number | boolean | null | string[]>\n\nexport interface InsightsPayload {\n widget_type: WidgetType\n instance_slot: InstanceSlot\n /**\n * V1 only. The v2 contract carries everything a block needs on `instance_slot.data`,\n * and omits this key entirely (see the LargeTransactionV2 payload). Blocks that still require it\n * get it as a required field through `BlockProps`, which re-declares it.\n */\n instance_slot_data?: InsightsInstanceSlotData\n description: Description\n primary_cta?: PrimaryCTA\n secondary_cta?: SecondaryCTA\n title?: string\n sub_title?: Subtitle\n /**\n * V2 rename of `sub_title`: a flat string, with the logo promoted to the payload-level `logo`\n * field below. `sub_title` wins when both are present.\n */\n subtitle?: string\n /** V2: header logo paired with the flat `subtitle`: an entity guid or a status icon (`LogoRef`). */\n logo?: LogoRef\n /** V2: which design branch the backend picked (e.g. `no_merchant`). */\n variant?: string\n /** V2, `embedded` envelope only: the transaction-row pill. */\n pill?: Pill\n /**\n * V2: drilldown-only facts, e.g. `{ account_number: 'XXXXXXXX043' }`, or the guid list a list\n * drawer shows (`{ transaction_guids: [...] }`).\n */\n drilldown_data?: DrilldownData\n footer?: Footer\n /**\n * V2: the link inside the description: on the full card a drawer of its own (Low Account\n * Balance's \"Transactions ›\"); on mini and micro the card's action, sent instead of `primary_cta`.\n * Absent when the beat has no link.\n */\n in_description_cta?: InDescriptionCTA\n guid: string\n user_guid: string\n client_guid?: string\n /** Template name, e.g. `LargeTransactionV2`. */\n template?: string\n revision?: number\n /** Unix seconds. */\n created_at?: number\n /** Unix seconds. */\n updated_at?: number\n /** Unix seconds. */\n active_at?: number\n displayed_at?: number | null\n dismissed_at: number | null\n cta_clicked_at?: number | null\n has_been_displayed?: boolean\n is_dismissed: boolean\n is_deleted?: boolean\n is_hidden_by_system?: boolean\n is_obsolete?: boolean\n is_refreshable?: boolean\n is_sampled?: boolean\n is_zero_state?: boolean\n status?: string | null\n /**\n * V2 (LargeTransactionV2 onward): the entities the beat is about, carried on the payload so\n * action blocks do not have to reach back out to the beat envelope.\n */\n primary_account_guid?: string | null\n primary_transaction_guid?: string | null\n primary_category_guid?: string | null\n primary_merchant_guid?: string | null\n /**\n * V2: the repeating transaction a subscription beat is about (Upcoming Subscription, Subscription\n * Price Increase). Read by `recurring_transaction_block`, see\n * `actionBlocks/RecurringTransactionBlock/subscriptionBeats.ts`.\n */\n primary_repeating_transaction_guid?: string | null\n}\n\nexport interface Legends {\n label: string\n value: number\n additional_value?: number\n additional_value_type?: string\n value_type?: string\n}\n\nexport interface Logo {\n category_guid?: string\n category_name?: string\n institution_guid?: string\n institution_name?: string\n logo_color?: string\n /** Draw the `logo_name` icon filled (V2 `ICO-` logos). */\n logo_fill?: boolean\n logo_name?: string\n merchant_guid?: string\n merchant_name?: string\n}\n\nexport interface Subtitle {\n logo?: Logo\n text: string\n}\n\n/**\n * A V2 logo, shared by the header (`InsightsPayload.logo`) and every instance-slot row. It takes\n * one of two shapes:\n *\n * - **Entity**: `guid`, whose prefix (`INS-` / `MCH-` / `CAT-`) picks the logo component, plus an\n * optional `fallback_guid` for when that component's asset cannot load. Today that is the\n * category behind an `MCH-` guid, which `MerchantLogo` shows as a tile when the merchant image\n * is missing.\n * - **Status icon**: `icon` (an mx-icons name, e.g. `warning`) and `color` (a theme palette path,\n * e.g. `error.main`), for subheaders that show a state rather than an entity (V1's\n * `logo_name` / `logo_color`).\n *\n * `alt` is the accessible name for either shape. A logo sends one shape; if it sends both, `icon`\n * wins, as `logo_name` does in V1's `SubHeader`.\n */\nexport interface LogoRef {\n alt?: string\n color?: string\n fallback_guid?: string\n guid?: string\n icon?: string\n}\n\nexport interface CategoryLogo {\n category_guid: string\n category_name: string\n}\n\nexport interface MerchantLogo {\n merchant_guid: string\n merchant_name: string\n}\n\nexport interface InstitutionLogo {\n institution_guid: string\n institution_name: string\n}\n\nexport interface Description {\n text: string\n html_text: string\n}\n\n/**\n * Post message a CTA press sends to the host, resolved by the backend for the beat's current\n * state. Absent/null = the backend has not described one: the frontend uses the template's\n * interim `ctaPostMessages` entry if there is one, else sends no message. `payload` carries only\n * beat-specific extras; the frontend always adds `beat_guid`, `beat_template`, `user_guid` and\n * `action_string`.\n */\nexport interface CtaPostMessageMetadata {\n /** Post message event; defaults to `beat/cta`. */\n event?: string | null\n /** Operation the host should perform, e.g. `op_1`, `op_2`, `op_3`. Defaults to `op_1`. */\n action?: string | null\n /** Beat-specific fields merged into the message metadata (account ids, amounts, ...). */\n payload?: Record<string, unknown> | null\n}\n\nexport interface PrimaryCTA {\n label: string\n block: string\n variant?: string | null\n /**\n * What pressing the CTA does beyond opening its block, named by the backend (ditto\n * `primary_cta_action`, passed through by tupac). Looked up in `insights-v2/ctaActions`;\n * null / absent / unknown means the CTA only opens its block or posts its message.\n */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n}\n\nexport interface SecondaryCTA {\n label: string\n /**\n * Drawer block to open. `null` when the CTA opens nothing (ditto `secondary_cta_block: null`,\n * e.g. Fee Detected's \"Contact Support\"): the press posts its message to the host instead.\n */\n block: string | null\n variant?: string | null\n /** See `PrimaryCTA.action_key` (ditto `secondary_cta_action`). */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n}\n\n/**\n * The description link: its label, the action block it opens and, like a CTA's, the variant that\n * tells that block what to show (ditto's `in_description_cta_variant`, e.g. `low_balance`). On mini\n * and micro it words the card's action; `block` is empty when that action opens no drawer.\n */\nexport interface InDescriptionCTA {\n label: string\n block?: string\n variant?: string | null\n action_key?: string | null\n}\n\nexport interface Footer {\n /** V1: a pre-formatted date string. */\n date?: string\n /**\n * The account label, on both V1 and V2. The backend resolves the plurality: one account sends\n * its name (e.g. `Epic Bank`), several send a localized count (e.g. `2 Accounts`), none sends\n * `null` (tupac's `footer_account_label` returns nil for a beat with no accounts, as Payday Cash\n * Left Over Status does). There is deliberately no separate `accounts` key.\n */\n account?: string | null\n /**\n * V2 (LargeTransactionV2 onward): unix seconds, formatted by `Footer` for display.\n * Replaces `date`; `date` wins when a beat somehow sends both.\n */\n timestamp?: number\n}\n\n// ============ Instance Slot Types ============\n// Values are the snake_case block names the backend sends on a beat's instance slot; the PascalCase\n// keys stay as friendly references (e.g. BlockType.BarChartBlock === 'bar_chart_block').\nexport const BlockType = {\n AccountBlock: 'account_block',\n AccountSwitchBlock: 'account_switch_block',\n BarChartBlock: 'bar_chart_block',\n BudgetBlock: 'budget_block',\n DirectDepositBlock: 'direct_deposit_block',\n ImageBlock: 'image_block',\n TransactionBlock: 'transaction_block',\n DonutChartBlock: 'donut_chart_block',\n DoubleBarChartBlock: 'double_bar_chart_block',\n DoubleProgressBarBlock: 'double_progress_bar_block',\n DebtsBlock: 'debts_block',\n GoalsBlock: 'goals_block',\n NoSpendDaysBlock: 'no_spend_days_block',\n RepeatingTransactionBlock: 'repeating_transaction_block',\n SaveExtraBlock: 'save_extra_block',\n SavingsOpportunityBlock: 'savings_opportunity_block',\n StepChartBlock: 'step_chart_block',\n SVGImageBlock: 'svg_image_block',\n UpcomingBillBlock: 'upcoming_bill_block',\n UpcomingSubscriptionBlock: 'upcoming_subscription_block',\n WithdrawalBlock: 'withdrawal_block',\n} as const\n\nexport type BlockType = (typeof BlockType)[keyof typeof BlockType]\n\n/**\n * A pre-localized row on a V2 instance slot. The backend resolves the copy and formatting; the\n * logo is a `LogoRef` (an entity guid or a status icon, see `logoFromRef`).\n */\nexport interface InstanceSlotRow {\n amount?: number\n logo?: LogoRef\n primary_text?: string\n secondary_text?: string\n}\n\n/**\n * V2: the slots a block's variant filled, keyed by slot name; ditto owns the names and omits any\n * slot it has no value for (`lib/ditto/blocks/<block>.yml`). Read with `slot()`, which names the\n * kind the caller expects.\n */\nexport interface InstanceSlotData {\n [slot: string]: unknown\n}\n\n/**\n * Reads one slot off a block's `data`; undefined when ditto did not fill it.\n *\n * The caller names the kind, because the slot's kind lives in the block's ditto schema and not\n * here — a block fills slots with whatever its card needs, so no fixed list of kinds would hold\n * (`account_switch_block` alone carries a boolean and `budget_block` a nested object).\n */\nexport const slot = <T = unknown>(\n data: InstanceSlotData | undefined,\n name: string,\n): T | undefined => data?.[name] as T | undefined\n\n/**\n * V2: which block renders this beat's content, and what it renders.\n *\n * `block` is optional: a beat whose template has no ditto config arrives as an empty `{}` and the\n * card renders its copy and CTAs alone, so a reader cannot assume a block is named. One interface\n * with `block` optional rather than a union with `Record<string, never>`, which TypeScript absorbs\n * — that union left `block` reading as required and typed a promise it did not keep.\n *\n * `variant` is optional for the same reason — the empty `{}` carries neither. Every ditto beat\n * file that names a block also names a variant, so a *filled* slot always has one; ditto drops a\n * nil variant rather than sending null, which is why the type is `string | null | undefined`.\n */\nexport interface InstanceSlot {\n block?: BlockType\n variant?: string | null\n /** The slots this block's variant declares in ditto. */\n data?: InstanceSlotData\n // Direct Deposit block (Set Up Direct Deposit, Switch Direct Deposit, Missing\n // Interest Rate): account facts carried flat on the slot, beside `data`.\n /** Primary line on the hero card, e.g. \"Epic Bank Checking, *1234\". */\n account_name?: string\n /** Secondary line beneath the name, e.g. \"Checking Account\" / \"Credit Card\". */\n account_type?: string\n /** Status pill label, e.g. \"Direct Deposit Not Set Up\" / \"Interest Rate: 19.99% APR\". */\n status_text?: string\n institution_guid?: string\n institution_name?: string\n // Shared across multiple V2 component blocks:\n // `amount` — UpcomingBillBlock (projected bill), SavingsOpportunityBlock (coupon),\n // UpcomingSubscriptionBlock (price per cadence).\n // `merchant_guid` / `merchant_name` — UpcomingBillBlock (bill row logo + name),\n // UpcomingSubscriptionBlock (hero logo + name).\n /** Dollar amount (unformatted); the block formats it as currency. */\n amount?: number\n // Withdrawal block (Emergency Fund Withdrawal): one row flat on the slot - `amount` above is the\n // withdrawal, shown with its date line \"{amount_label} {withdrawal_date}\" over the balance row.\n /** Pre-localized lead-in for the date line, e.g. \"Withdrawn on\". */\n amount_label?: string\n /** The withdrawal's calendar day, `YYYY-MM-DD` (e.g. `2026-10-20`); the card formats it. */\n withdrawal_date?: string\n /** Account balance after the withdrawal (unformatted); the card formats it as currency. */\n balance?: number\n /** Pre-localized label for the balance row, e.g. \"Balance\". */\n balance_label?: string\n /** Merchant guid used to render the inline / hero logo via `LogoFromGuid` (`MCH-...`). */\n merchant_guid?: string\n /** Merchant display name — shown as logo alt text and as the merchant/hero label. */\n merchant_name?: string\n // Upcoming Bill block (Projected Bill Payment): the block derives the Sun→Sat week strip\n // around `due_date` at render time.\n /** Due date of the projected bill in ISO form (e.g. `2025-10-30`). */\n due_date?: string\n // Savings Opportunity block (Save An Extra, Potential Savings, Embedded): purely data-driven\n // coupon card. Backend sends the caption and the amount, plus `slot` to toggle the green\n // gradient background when the card is embedded in a parent surface that supplies its own.\n /** Caption shown above the amount, e.g. `Save an extra` or `Potential savings`. */\n label?: string\n /**\n * Whether to render the green gradient slot behind the coupon. Defaults to true. Backend sends\n * `false` when the coupon is embedded in a parent surface that supplies its own background.\n */\n slot?: boolean\n // Upcoming Subscription block: billing cadence for the price pill (`${amount} / ${cadence}`).\n /** Billing cadence word that trails the price, e.g. `month` or `year`. */\n cadence?: string\n // Account block (status on/off-track, deposit, payoff variants): card content carried flat on\n // the slot (the V2 contract drops `instance_slot_data`). `amount`, `label`, `merchant_guid`,\n // `merchant_name`, `institution_guid`, `institution_name` are shared fields declared above.\n /** Secondary line beneath the amount on the standard card, e.g. \"Remaining after expenses\". */\n sub_text?: string\n /** Header bar text (standard card) or the colored category strip label (deposit cards). */\n header_text?: string\n /** Generic-tile icon name used when no merchant/institution logo is available. */\n icon_name?: string\n /** Category guid used to render the deposit-card logo fallback. */\n category_guid?: string\n // Debts block: `amount` is the current balance; the shared account/institution fields above.\n /** Projected payoff date in ISO form (e.g. `2027-03-01`); the block formats it as month + year. */\n payoff_date?: string\n /** Monthly payment toward the debt (unformatted); the block formats it as currency. */\n monthly_payment?: number\n /** Annual interest rate as a percentage (e.g. `19.99`); the block formats it as a percent. */\n interest_rate?: number\n start_date?: string\n no_spend_days?: string[]\n}\n"],"mappings":"AAgUA,IAAa,IAAA,CACX,GACA,MACkB,IAAO,CAAA"}
@@ -256,6 +256,15 @@ export interface DebtsBlockCopy {
256
256
  /** Footer caption for the `debt_summary` total, e.g. "Total balance". Optional until the service ships it. */
257
257
  total_balance_label?: string;
258
258
  }
259
+ /** Labels for the Goals component block. */
260
+ export interface GoalsBlockCopy {
261
+ /** `_1{percentage}` — whole-number percent, e.g. "50% Complete". */
262
+ percent_complete: string;
263
+ projected_completion_label: string;
264
+ contribution_label: string;
265
+ total_saved_label: string;
266
+ complete_label: string;
267
+ }
259
268
  export interface InsightsFeedCopy {
260
269
  general: GeneralInsightsFeedCopy;
261
270
  settings_menu: SettingsMenuCopy;
@@ -279,5 +288,7 @@ export interface InsightsFeedCopy {
279
288
  amount_input_modal?: AmountInputModalCopy;
280
289
  /** Optional until the localized-content service ships the namespace. */
281
290
  debts_block?: DebtsBlockCopy;
291
+ /** Optional until the localized-content service ships the namespace. */
292
+ goals_block?: GoalsBlockCopy;
282
293
  }
283
294
  export {};
@@ -54,6 +54,18 @@ export declare const ANALYTICS_EVENTS_CONFIG: {
54
54
  readonly category: "Safety Net";
55
55
  readonly action: (beat: Beat) => string;
56
56
  };
57
+ readonly EMERGENCY_SAVINGS_ACCT_SELECTED: {
58
+ readonly category: "Emergency Savings";
59
+ readonly action: "Designate Emergency Savings Account Selected";
60
+ };
61
+ readonly EMERGENCY_SAVINGS_ACCT_SAVED: {
62
+ readonly category: "Emergency Savings";
63
+ readonly action: "Designate Emergency Savings Account Saved";
64
+ };
65
+ readonly EMERGENCY_SAVINGS_ACCT_CREATED: {
66
+ readonly category: "Emergency Savings";
67
+ readonly action: "Designate Emergency Savings Account - Savings Account Created";
68
+ };
57
69
  readonly OPENED_CONNECT_DRAWER: {
58
70
  readonly postHog: {
59
71
  readonly eventName: "opened_connect_drawer";
@@ -43,6 +43,18 @@ var t = (e) => e?.replace(/([A-Z]+)/g, " $1")?.replace(/^ /, "") ?? "", a = {
43
43
  category: "Safety Net",
44
44
  action: (e) => `${t(e.template)} = Edit Safety Net - Cancel`
45
45
  },
46
+ EMERGENCY_SAVINGS_ACCT_SELECTED: {
47
+ category: "Emergency Savings",
48
+ action: "Designate Emergency Savings Account Selected"
49
+ },
50
+ EMERGENCY_SAVINGS_ACCT_SAVED: {
51
+ category: "Emergency Savings",
52
+ action: "Designate Emergency Savings Account Saved"
53
+ },
54
+ EMERGENCY_SAVINGS_ACCT_CREATED: {
55
+ category: "Emergency Savings",
56
+ action: "Designate Emergency Savings Account - Savings Account Created"
57
+ },
46
58
  OPENED_CONNECT_DRAWER: { postHog: {
47
59
  eventName: "opened_connect_drawer",
48
60
  properties: (e) => ({
@@ -1 +1 @@
1
- {"version":3,"file":"analyticsEventsConfig.es.js","names":[],"sources":["../../../src/insights-v2/analytics/analyticsEventsConfig.ts"],"sourcesContent":["import type { Beat } from '../../core'\n\n// PascalCase template to label, ported from Pulse.\nexport const sentenceCaseTemplate = (template?: string | null): string =>\n template?.replace(/([A-Z]+)/g, ' $1')?.replace(/^ /, '') ?? ''\n\n// Fixed or beat-computed value.\ntype Resolvable = string | ((beat: Beat) => string)\n\n// Source of truth for insights-v2 analytics events. Mirrors Pulse's strings.\n// Entry has a Firefly half (action/category) and/or a postHog half.\nexport interface AnalyticsEventConfigEntry {\n category?: Resolvable\n action?: Resolvable\n postHog?: {\n eventName: string\n properties?: (beat: Beat) => Record<string, unknown>\n }\n}\n\nexport const ANALYTICS_EVENTS_CONFIG = {\n // Primary/secondary CTA click, fired via sendCtaAnalytics.\n PRIMARY_ACTION_SELECTED: {\n category: 'Beat Interaction',\n action: 'Primary Action Selected',\n },\n SECONDARY_ACTION_SELECTED: {\n category: 'Beat Interaction',\n action: 'Secondary Action Selected',\n },\n // Fires once, gated on !beat.cta_clicked_at.\n FIRST_TIME_PRIMARY_ACTION_SELECTED: {\n category: 'Beat Interaction',\n action: 'First Time Primary Action Selected',\n },\n\n // Bar click on the card's inline chart.\n CHART_BAR_CLICKED: {\n category: 'Beat Chart',\n action: (beat) => `${sentenceCaseTemplate(beat.template)} - Bar Clicked`,\n },\n // Bar click inside the drill-down drawer.\n DRAWER_CHART_BAR_CLICKED: {\n category: 'Drawer Chart',\n action: (beat) => `${sentenceCaseTemplate(beat.template)} - Bar Clicked`,\n },\n // Month/tab change inside the drill-down drawer.\n TAB_SELECTED: {\n category: 'Drawer Chart',\n action: (beat) => `${sentenceCaseTemplate(beat.template)} - Month Tab Selected`,\n },\n\n // LowAccountBalance threshold dialog.\n EDIT_INSIGHT_THRESHOLD_SAVE: {\n category: 'User Configurable Settings',\n action: 'Edit Insight Threshold Save',\n },\n EDIT_INSIGHT_THRESHOLD_CANCELED: {\n category: 'User Configurable Settings',\n action: 'Edit Insight Threshold Canceled',\n },\n EDIT_INSIGHT_THRESHOLD_INPUT_SELECTED: {\n category: 'User Configurable Settings',\n action: 'Edit Insight Threshold Input Selected',\n },\n\n // SavingsOpportunityV2 safety-net dialog.\n EDIT_SAFETY_NET_SAVE: {\n category: 'Safety Net',\n action: 'Edit Safety Net',\n },\n // Ported verbatim from Pulse (uses '=' not '-').\n EDIT_SAFETY_NET_CANCEL: {\n category: 'Safety Net',\n action: (beat) => `${sentenceCaseTemplate(beat.template)} = Edit Safety Net - Cancel`,\n },\n\n // Connect drawer opened. PostHog-only.\n OPENED_CONNECT_DRAWER: {\n postHog: {\n eventName: 'opened_connect_drawer',\n properties: (beat) => ({ beat_guid: beat.guid, template: beat.template }),\n },\n },\n} as const satisfies Record<string, AnalyticsEventConfigEntry>\n"],"mappings":"AAGA,IAAa,IAAA,CAAwB,MACnC,GAAU,QAAQ,aAAa,KAAK,GAAG,QAAQ,MAAM,EAAE,KAAK,IAgBjD,IAA0B;AAAA,EAErC,yBAAyB;AAAA,IACvB,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EACA,2BAA2B;AAAA,IACzB,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EAEA,oCAAoC;AAAA,IAClC,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EAGA,mBAAmB;AAAA,IACjB,UAAU;AAAA,IACV,QAAA,CAAS,MAAS,GAAG,EAAqB,EAAK,QAAQ,CAAA;AAAA,EACzD;AAAA,EAEA,0BAA0B;AAAA,IACxB,UAAU;AAAA,IACV,QAAA,CAAS,MAAS,GAAG,EAAqB,EAAK,QAAQ,CAAA;AAAA,EACzD;AAAA,EAEA,cAAc;AAAA,IACZ,UAAU;AAAA,IACV,QAAA,CAAS,MAAS,GAAG,EAAqB,EAAK,QAAQ,CAAA;AAAA,EACzD;AAAA,EAGA,6BAA6B;AAAA,IAC3B,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EACA,iCAAiC;AAAA,IAC/B,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EACA,uCAAuC;AAAA,IACrC,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EAGA,sBAAsB;AAAA,IACpB,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EAEA,wBAAwB;AAAA,IACtB,UAAU;AAAA,IACV,QAAA,CAAS,MAAS,GAAG,EAAqB,EAAK,QAAQ,CAAA;AAAA,EACzD;AAAA,EAGA,uBAAuB,EACrB,SAAS;AAAA,IACP,WAAW;AAAA,IACX,YAAA,CAAa,OAAU;AAAA,MAAE,WAAW,EAAK;AAAA,MAAM,UAAU,EAAK;AAAA,IAAS;AAAA,EACzE,EACF;AACF"}
1
+ {"version":3,"file":"analyticsEventsConfig.es.js","names":[],"sources":["../../../src/insights-v2/analytics/analyticsEventsConfig.ts"],"sourcesContent":["import type { Beat } from '../../core'\n\n// PascalCase template to label, ported from Pulse.\nexport const sentenceCaseTemplate = (template?: string | null): string =>\n template?.replace(/([A-Z]+)/g, ' $1')?.replace(/^ /, '') ?? ''\n\n// Fixed or beat-computed value.\ntype Resolvable = string | ((beat: Beat) => string)\n\n// Source of truth for insights-v2 analytics events. Mirrors Pulse's strings.\n// Entry has a Firefly half (action/category) and/or a postHog half.\nexport interface AnalyticsEventConfigEntry {\n category?: Resolvable\n action?: Resolvable\n postHog?: {\n eventName: string\n properties?: (beat: Beat) => Record<string, unknown>\n }\n}\n\nexport const ANALYTICS_EVENTS_CONFIG = {\n // Primary/secondary CTA click, fired via sendCtaAnalytics.\n PRIMARY_ACTION_SELECTED: {\n category: 'Beat Interaction',\n action: 'Primary Action Selected',\n },\n SECONDARY_ACTION_SELECTED: {\n category: 'Beat Interaction',\n action: 'Secondary Action Selected',\n },\n // Fires once, gated on !beat.cta_clicked_at.\n FIRST_TIME_PRIMARY_ACTION_SELECTED: {\n category: 'Beat Interaction',\n action: 'First Time Primary Action Selected',\n },\n\n // Bar click on the card's inline chart.\n CHART_BAR_CLICKED: {\n category: 'Beat Chart',\n action: (beat) => `${sentenceCaseTemplate(beat.template)} - Bar Clicked`,\n },\n // Bar click inside the drill-down drawer.\n DRAWER_CHART_BAR_CLICKED: {\n category: 'Drawer Chart',\n action: (beat) => `${sentenceCaseTemplate(beat.template)} - Bar Clicked`,\n },\n // Month/tab change inside the drill-down drawer.\n TAB_SELECTED: {\n category: 'Drawer Chart',\n action: (beat) => `${sentenceCaseTemplate(beat.template)} - Month Tab Selected`,\n },\n\n // LowAccountBalance threshold dialog.\n EDIT_INSIGHT_THRESHOLD_SAVE: {\n category: 'User Configurable Settings',\n action: 'Edit Insight Threshold Save',\n },\n EDIT_INSIGHT_THRESHOLD_CANCELED: {\n category: 'User Configurable Settings',\n action: 'Edit Insight Threshold Canceled',\n },\n EDIT_INSIGHT_THRESHOLD_INPUT_SELECTED: {\n category: 'User Configurable Settings',\n action: 'Edit Insight Threshold Input Selected',\n },\n\n // SavingsOpportunityV2 safety-net dialog.\n EDIT_SAFETY_NET_SAVE: {\n category: 'Safety Net',\n action: 'Edit Safety Net',\n },\n // Ported verbatim from Pulse (uses '=' not '-').\n EDIT_SAFETY_NET_CANCEL: {\n category: 'Safety Net',\n action: (beat) => `${sentenceCaseTemplate(beat.template)} = Edit Safety Net - Cancel`,\n },\n\n // Designate Emergency Savings Account (picker pick, Save, Open a Savings Account). Pulse's strings.\n EMERGENCY_SAVINGS_ACCT_SELECTED: {\n category: 'Emergency Savings',\n action: 'Designate Emergency Savings Account Selected',\n },\n EMERGENCY_SAVINGS_ACCT_SAVED: {\n category: 'Emergency Savings',\n action: 'Designate Emergency Savings Account Saved',\n },\n EMERGENCY_SAVINGS_ACCT_CREATED: {\n category: 'Emergency Savings',\n action: 'Designate Emergency Savings Account - Savings Account Created',\n },\n\n // Connect drawer opened. PostHog-only.\n OPENED_CONNECT_DRAWER: {\n postHog: {\n eventName: 'opened_connect_drawer',\n properties: (beat) => ({ beat_guid: beat.guid, template: beat.template }),\n },\n },\n} as const satisfies Record<string, AnalyticsEventConfigEntry>\n"],"mappings":"AAGA,IAAa,IAAA,CAAwB,MACnC,GAAU,QAAQ,aAAa,KAAK,GAAG,QAAQ,MAAM,EAAE,KAAK,IAgBjD,IAA0B;AAAA,EAErC,yBAAyB;AAAA,IACvB,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EACA,2BAA2B;AAAA,IACzB,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EAEA,oCAAoC;AAAA,IAClC,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EAGA,mBAAmB;AAAA,IACjB,UAAU;AAAA,IACV,QAAA,CAAS,MAAS,GAAG,EAAqB,EAAK,QAAQ,CAAA;AAAA,EACzD;AAAA,EAEA,0BAA0B;AAAA,IACxB,UAAU;AAAA,IACV,QAAA,CAAS,MAAS,GAAG,EAAqB,EAAK,QAAQ,CAAA;AAAA,EACzD;AAAA,EAEA,cAAc;AAAA,IACZ,UAAU;AAAA,IACV,QAAA,CAAS,MAAS,GAAG,EAAqB,EAAK,QAAQ,CAAA;AAAA,EACzD;AAAA,EAGA,6BAA6B;AAAA,IAC3B,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EACA,iCAAiC;AAAA,IAC/B,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EACA,uCAAuC;AAAA,IACrC,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EAGA,sBAAsB;AAAA,IACpB,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EAEA,wBAAwB;AAAA,IACtB,UAAU;AAAA,IACV,QAAA,CAAS,MAAS,GAAG,EAAqB,EAAK,QAAQ,CAAA;AAAA,EACzD;AAAA,EAGA,iCAAiC;AAAA,IAC/B,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EACA,8BAA8B;AAAA,IAC5B,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EACA,gCAAgC;AAAA,IAC9B,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EAGA,uBAAuB,EACrB,SAAS;AAAA,IACP,WAAW;AAAA,IACX,YAAA,CAAa,OAAU;AAAA,MAAE,WAAW,EAAK;AAAA,MAAM,UAAU,EAAK;AAAA,IAAS;AAAA,EACzE,EACF;AACF"}
@@ -0,0 +1,10 @@
1
+ import { InsightsPayload } from '../../../../core';
2
+ import { GoalProgressCardStyleProps } from '../../../components/GoalProgressCard';
3
+ interface GoalsBlockProps {
4
+ payload: InsightsPayload;
5
+ beatGuid?: string;
6
+ }
7
+ export declare const IN_PROGRESS: GoalProgressCardStyleProps;
8
+ export declare const COMPLETE: GoalProgressCardStyleProps;
9
+ declare const GoalsBlock: ({ payload }: GoalsBlockProps) => import("react/jsx-runtime").JSX.Element;
10
+ export default GoalsBlock;
@@ -0,0 +1,75 @@
1
+ import { buildDynamicCopy as x } from "../../../../core/utils/Localization.es.js";
2
+ import { DATE_FORMATS_INTL as A, formatDate as N } from "../../../../core/constants/DateFormats.es.js";
3
+ import { useGlobalCopyStore as M } from "../../../../common/context/hooks.es.js";
4
+ import { slot as O } from "../../../../core/types/Insights.es.js";
5
+ import { formatCurrency as f, formatPercentage as R } from "../../../../core/utils/NumberFormatting.es.js";
6
+ import { STATUS_SUCCESS_TOKENS as u } from "../../../components/statusTokens.es.js";
7
+ import { parseDueDate as j } from "../RepeatingTransactionBlock/weekStrip.es.js";
8
+ import k, { clampPercent as F } from "../../../components/GoalProgressCard.es.js";
9
+ import G from "react";
10
+ import { jsx as w } from "react/jsx-runtime";
11
+ var v = {
12
+ bgcolor: "primary.main",
13
+ barColor: "primary.main",
14
+ trackColor: "grey.200",
15
+ tileColor: "primary.lighter",
16
+ iconColor: "primary.main",
17
+ pill: {
18
+ bgcolor: "primary.lighter",
19
+ borderColor: "primary.lighter",
20
+ labelColor: "text.primary"
21
+ }
22
+ }, U = {
23
+ ...v,
24
+ bgcolor: "success.main",
25
+ barColor: "success.main",
26
+ tileColor: "success.lighter",
27
+ iconColor: "success.main",
28
+ pill: {
29
+ bgcolor: u.bgcolor,
30
+ borderColor: u.borderColor,
31
+ labelColor: u.textColor,
32
+ icon: "check_circle"
33
+ }
34
+ }, H = (e) => !!e?.percent_complete && !!e.projected_completion_label && !!e.contribution_label && !!e.total_saved_label && !!e.complete_label, W = ({ payload: e }) => {
35
+ const r = M().insights_feed?.goals_block, o = H(r) ? r : void 0, { data: y } = e.instance_slot, t = (m) => O(y, m), l = (m) => {
36
+ const p = t(m);
37
+ return typeof p == "number" && Number.isFinite(p) ? p : void 0;
38
+ }, h = t("goal_name"), S = l("goal_percentage"), a = l("amount"), i = l("target_amount"), b = l("contributed_last_month"), _ = t("projected_completion_date"), s = t("is_complete"), d = s === !0 || s === "true" || s === 1, D = t("status_text")?.trim() || void 0;
39
+ G.useEffect(() => {
40
+ o || console.warn(`goals_block: ${r ? "copy incomplete" : "copy namespace missing"}; rendering the progress bar only`);
41
+ }, [r, o]);
42
+ const T = d ? U : v, E = a != null && i != null && i > 0 ? a / i * 100 : void 0, g = S ?? E, n = g != null ? Math.round(F(g)) : void 0, L = n == null ? void 0 : o ? x(o.percent_complete, `${n}`) : R(n / 100, {
43
+ style: "percent",
44
+ maximumFractionDigits: 0
45
+ }), c = [], C = _ ? j(_) : null;
46
+ o && C && c.push({
47
+ icon: "today",
48
+ label: o.projected_completion_label,
49
+ value: N(C, A.MED_MONTH_SHORT_DAY_FULL_YEAR)
50
+ }), o && b != null && c.push({
51
+ icon: "paid",
52
+ label: o.contribution_label,
53
+ value: f(b, "0,0.00")
54
+ }), o && a != null && c.push({
55
+ icon: "savings",
56
+ label: o.total_saved_label,
57
+ value: f(a, "0,0.00")
58
+ });
59
+ const P = d ? D ?? o?.complete_label : void 0;
60
+ return /* @__PURE__ */ w(k, {
61
+ ...T,
62
+ barLabel: h,
63
+ percent: n ?? 0,
64
+ percentLabel: L,
65
+ rows: c,
66
+ statusLabel: P
67
+ });
68
+ };
69
+ export {
70
+ U as COMPLETE,
71
+ v as IN_PROGRESS,
72
+ W as default
73
+ };
74
+
75
+ //# sourceMappingURL=GoalsBlock.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoalsBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/GoalsBlock/GoalsBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport { useGlobalCopyStore } from '../../../../common'\nimport { slot, type InsightsPayload } from '../../../../core'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../../core/constants'\nimport type { GoalsBlockCopy } from '../../../../core/types/localization/InsightsFeedCopy'\nimport { buildDynamicCopy } from '../../../../core/utils/Localization'\nimport { formatCurrency, formatPercentage } from '../../../../core/utils/NumberFormatting'\n\nimport GoalProgressCard, {\n clampPercent,\n type GoalProgressCardStyleProps,\n type GoalProgressRow,\n} from '../../../components/GoalProgressCard'\nimport { STATUS_SUCCESS_TOKENS } from '../../../components/statusTokens'\nimport { parseDueDate } from '../RepeatingTransactionBlock/weekStrip'\n\ninterface GoalsBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\nexport const IN_PROGRESS: GoalProgressCardStyleProps = {\n bgcolor: 'primary.main',\n barColor: 'primary.main',\n trackColor: 'grey.200',\n tileColor: 'primary.lighter',\n iconColor: 'primary.main',\n pill: { bgcolor: 'primary.lighter', borderColor: 'primary.lighter', labelColor: 'text.primary' },\n}\n\nexport const COMPLETE: GoalProgressCardStyleProps = {\n ...IN_PROGRESS,\n bgcolor: 'success.main',\n barColor: 'success.main',\n tileColor: 'success.lighter',\n iconColor: 'success.main',\n pill: {\n bgcolor: STATUS_SUCCESS_TOKENS.bgcolor,\n borderColor: STATUS_SUCCESS_TOKENS.borderColor,\n labelColor: STATUS_SUCCESS_TOKENS.textColor,\n icon: 'check_circle',\n },\n}\n\nconst hasAllLabels = (copy?: GoalsBlockCopy): copy is GoalsBlockCopy =>\n !!copy?.percent_complete &&\n !!copy.projected_completion_label &&\n !!copy.contribution_label &&\n !!copy.total_saved_label &&\n !!copy.complete_label\n\nconst GoalsBlock = ({ payload }: GoalsBlockProps) => {\n const copy = useGlobalCopyStore().insights_feed?.goals_block\n const labels = hasAllLabels(copy) ? copy : undefined\n const { data } = payload.instance_slot\n\n const read = <T,>(name: string): T | undefined => slot<T>(data, name)\n const readNumber = (name: string) => {\n const value = read<unknown>(name)\n return typeof value === 'number' && Number.isFinite(value) ? value : undefined\n }\n\n const goalName = read<string>('goal_name')\n const goalPercentage = readNumber('goal_percentage')\n const amount = readNumber('amount')\n const targetAmount = readNumber('target_amount')\n const contributedLastMonth = readNumber('contributed_last_month')\n const projectedCompletionDate = read<string>('projected_completion_date')\n const rawComplete = read<unknown>('is_complete')\n const isComplete = rawComplete === true || rawComplete === 'true' || rawComplete === 1\n const statusText = read<string>('status_text')?.trim() || undefined\n\n React.useEffect(() => {\n if (labels) return\n console.warn(\n `goals_block: ${copy ? 'copy incomplete' : 'copy namespace missing'}; rendering the progress bar only`,\n )\n }, [copy, labels])\n\n const style = isComplete ? COMPLETE : IN_PROGRESS\n\n const derivedPercent =\n amount != null && targetAmount != null && targetAmount > 0\n ? (amount / targetAmount) * 100\n : undefined\n const percent = goalPercentage ?? derivedPercent\n const roundedPercent = percent != null ? Math.round(clampPercent(percent)) : undefined\n\n const percentLabel =\n roundedPercent == null\n ? undefined\n : labels\n ? (buildDynamicCopy(labels.percent_complete, `${roundedPercent}`) as string)\n : formatPercentage(roundedPercent / 100, {\n style: 'percent',\n maximumFractionDigits: 0,\n })\n\n const rows: GoalProgressRow[] = []\n const completionDate = projectedCompletionDate ? parseDueDate(projectedCompletionDate) : null\n if (labels && completionDate) {\n rows.push({\n icon: 'today',\n label: labels.projected_completion_label,\n value: formatDate(completionDate, DATE_FORMATS_INTL.MED_MONTH_SHORT_DAY_FULL_YEAR),\n })\n }\n if (labels && contributedLastMonth != null) {\n rows.push({\n icon: 'paid',\n label: labels.contribution_label,\n value: formatCurrency(contributedLastMonth, '0,0.00'),\n })\n }\n if (labels && amount != null) {\n rows.push({\n icon: 'savings',\n label: labels.total_saved_label,\n value: formatCurrency(amount, '0,0.00'),\n })\n }\n\n const statusLabel = isComplete ? (statusText ?? labels?.complete_label) : undefined\n\n return (\n <GoalProgressCard\n {...style}\n barLabel={goalName}\n percent={roundedPercent ?? 0}\n percentLabel={percentLabel}\n rows={rows}\n statusLabel={statusLabel}\n />\n )\n}\n\nexport default GoalsBlock\n"],"mappings":";;;;;;;;;;AAsBA,IAAa,IAA0C;AAAA,EACrD,SAAS;AAAA,EACT,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AAAA,EACX,MAAM;AAAA,IAAE,SAAS;AAAA,IAAmB,aAAa;AAAA,IAAmB,YAAY;AAAA,EAAe;AACjG,GAEa,IAAuC;AAAA,EAClD,GAAG;AAAA,EACH,SAAS;AAAA,EACT,UAAU;AAAA,EACV,WAAW;AAAA,EACX,WAAW;AAAA,EACX,MAAM;AAAA,IACJ,SAAS,EAAsB;AAAA,IAC/B,aAAa,EAAsB;AAAA,IACnC,YAAY,EAAsB;AAAA,IAClC,MAAM;AAAA,EACR;AACF,GAEM,IAAA,CAAgB,MACpB,CAAC,CAAC,GAAM,oBACR,CAAC,CAAC,EAAK,8BACP,CAAC,CAAC,EAAK,sBACP,CAAC,CAAC,EAAK,qBACP,CAAC,CAAC,EAAK,gBAEH,IAAA,CAAc,EAAE,SAAA,EAAA,MAA+B;AACnD,QAAM,IAAO,EAAmB,EAAE,eAAe,aAC3C,IAAS,EAAa,CAAI,IAAI,IAAO,QACrC,EAAE,MAAA,EAAA,IAAS,EAAQ,eAEnB,IAAA,CAAY,MAAgC,EAAQ,GAAM,CAAI,GAC9D,IAAA,CAAc,MAAiB;AACnC,UAAM,IAAQ,EAAc,CAAI;AAChC,WAAO,OAAO,KAAU,YAAY,OAAO,SAAS,CAAK,IAAI,IAAQ;AAAA,EACvE,GAEM,IAAW,EAAa,WAAW,GACnC,IAAiB,EAAW,iBAAiB,GAC7C,IAAS,EAAW,QAAQ,GAC5B,IAAe,EAAW,eAAe,GACzC,IAAuB,EAAW,wBAAwB,GAC1D,IAA0B,EAAa,2BAA2B,GAClE,IAAc,EAAc,aAAa,GACzC,IAAa,MAAgB,MAAQ,MAAgB,UAAU,MAAgB,GAC/E,IAAa,EAAa,aAAa,GAAG,KAAK,KAAK;AAE1D,EAAA,EAAM,UAAA,MAAgB;AACpB,IAAI,KACJ,QAAQ,KACN,gBAAgB,IAAO,oBAAoB,wBAAA,mCAC7C;AAAA,EACF,GAAG,CAAC,GAAM,CAAM,CAAC;AAEjB,QAAM,IAAQ,IAAa,IAAW,GAEhC,IACJ,KAAU,QAAQ,KAAgB,QAAQ,IAAe,IACpD,IAAS,IAAgB,MAC1B,QACA,IAAU,KAAkB,GAC5B,IAAiB,KAAW,OAAO,KAAK,MAAM,EAAa,CAAO,CAAC,IAAI,QAEvE,IACJ,KAAkB,OACd,SACA,IACG,EAAiB,EAAO,kBAAkB,GAAG,CAAA,EAAgB,IAC9D,EAAiB,IAAiB,KAAK;AAAA,IACrC,OAAO;AAAA,IACP,uBAAuB;AAAA,EACzB,CAAC,GAEH,IAA0B,CAAC,GAC3B,IAAiB,IAA0B,EAAa,CAAuB,IAAI;AACzF,EAAI,KAAU,KACZ,EAAK,KAAK;AAAA,IACR,MAAM;AAAA,IACN,OAAO,EAAO;AAAA,IACd,OAAO,EAAW,GAAgB,EAAkB,6BAA6B;AAAA,EACnF,CAAC,GAEC,KAAU,KAAwB,QACpC,EAAK,KAAK;AAAA,IACR,MAAM;AAAA,IACN,OAAO,EAAO;AAAA,IACd,OAAO,EAAe,GAAsB,QAAQ;AAAA,EACtD,CAAC,GAEC,KAAU,KAAU,QACtB,EAAK,KAAK;AAAA,IACR,MAAM;AAAA,IACN,OAAO,EAAO;AAAA,IACd,OAAO,EAAe,GAAQ,QAAQ;AAAA,EACxC,CAAC;AAGH,QAAM,IAAc,IAAc,KAAc,GAAQ,iBAAkB;AAE1E,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,GAAI;AAAA,IACJ,UAAU;AAAA,IACV,SAAS,KAAkB;AAAA,IACb,cAAA;AAAA,IACR,MAAA;AAAA,IACO,aAAA;AAAA,EACd,CAAA;AAEL"}
@@ -0,0 +1 @@
1
+ export { default as GoalsBlock } from './GoalsBlock';
@@ -3,6 +3,7 @@ export * from './AccountSwitchBlock';
3
3
  export * from './BudgetBlock';
4
4
  export * from './DebtsBlock';
5
5
  export * from './DetailedAccountBlock';
6
+ export * from './GoalsBlock';
6
7
  export * from './NoSpendDaysBlock';
7
8
  export * from './RepeatingTransactionBlock';
8
9
  export * from './SaveExtraBlock';
@@ -0,0 +1,15 @@
1
+ interface EmergencySavingsAccountPickerProps {
2
+ beatGuid?: string;
3
+ /** The beat's `instance_slot.data` for the `savings_account_picker` variant. */
4
+ data?: Record<string, unknown>;
5
+ }
6
+ /**
7
+ * Designate Emergency Savings Account picker (svg_image_block / savings_account_picker). Lists
8
+ * the user's savings accounts from the account store; the words come from the slot. A pick is
9
+ * only written to the beat's context — the card's "Save" CTA (`select_savings_account`) reads it
10
+ * and makes the API call.
11
+ */
12
+ export declare const EmergencySavingsAccountPicker: (({ beatGuid, data }: EmergencySavingsAccountPickerProps) => import("react/jsx-runtime").JSX.Element | null) & {
13
+ displayName: string;
14
+ };
15
+ export {};
@@ -0,0 +1,30 @@
1
+ import { useAccountStore as p, useInsightsV2Store as u } from "../../../../common/context/hooks.es.js";
2
+ import { ANALYTICS_EVENTS_CONFIG as _ } from "../../../analytics/analyticsEventsConfig.es.js";
3
+ import { useAnalyticsEvent as v } from "../../../analytics/useAnalyticsEvent.es.js";
4
+ import d from "../../../components/DesignateEmergencySavingsCard.es.js";
5
+ import { observer as E } from "mobx-react-lite";
6
+ import { jsx as S } from "react/jsx-runtime";
7
+ var o = (t) => typeof t == "string" ? t : void 0, b = E(({ beatGuid: t, data: n = {} }) => {
8
+ const i = p(), r = u(), l = v();
9
+ if (!t) return null;
10
+ const a = o(r.beatContext[t]?.selected_account_guid), s = i.visibleSavingsAccounts.filter((e) => !e.is_closed && !e.is_deleted).map(({ guid: e, name: m }) => ({
11
+ value: e,
12
+ label: m ?? ""
13
+ })), c = a ?? o(n.emergency_savings_account_guid), g = s.some((e) => e.value === c) ? c ?? "" : "";
14
+ return /* @__PURE__ */ S(d, {
15
+ graphic: null,
16
+ onChange: (e) => {
17
+ r.setBeatContext(t, { selected_account_guid: e }), l(_.EMERGENCY_SAVINGS_ACCT_SELECTED);
18
+ },
19
+ options: s,
20
+ placeholder: o(n.picker_placeholder),
21
+ selectLabel: o(n.picker_label),
22
+ sx: { width: "100%" },
23
+ value: g
24
+ });
25
+ });
26
+ export {
27
+ b as EmergencySavingsAccountPicker
28
+ };
29
+
30
+ //# sourceMappingURL=EmergencySavingsAccountPicker.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmergencySavingsAccountPicker.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ImageBlocks/SVGImageBlock/EmergencySavingsAccountPicker.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport { useAccountStore, useInsightsV2Store } from '../../../../common'\nimport DesignateEmergencySavingsCard from '../../../components/DesignateEmergencySavingsCard'\nimport { ANALYTICS_EVENTS_CONFIG } from '../../../analytics/analyticsEventsConfig'\nimport { useAnalyticsEvent } from '../../../analytics'\n\ninterface EmergencySavingsAccountPickerProps {\n beatGuid?: string\n /** The beat's `instance_slot.data` for the `savings_account_picker` variant. */\n data?: Record<string, unknown>\n}\n\nconst text = (value: unknown) => (typeof value === 'string' ? value : undefined)\n\n/**\n * Designate Emergency Savings Account picker (svg_image_block / savings_account_picker). Lists\n * the user's savings accounts from the account store; the words come from the slot. A pick is\n * only written to the beat's context — the card's \"Save\" CTA (`select_savings_account`) reads it\n * and makes the API call.\n */\nexport const EmergencySavingsAccountPicker = observer(\n ({ beatGuid, data = {} }: EmergencySavingsAccountPickerProps) => {\n const accountStore = useAccountStore()\n const insightsV2Store = useInsightsV2Store()\n const fireAnalyticsEvent = useAnalyticsEvent()\n\n if (!beatGuid) return null\n\n const picked = text(insightsV2Store.beatContext[beatGuid]?.selected_account_guid)\n // Only an account the user can still save into: visible, open and not deleted.\n const options = accountStore.visibleSavingsAccounts\n .filter((account) => !account.is_closed && !account.is_deleted)\n .map(({ guid, name }) => ({ value: guid, label: name ?? '' }))\n\n // The pick, else the designation the slot carries — only when it is among the options, so an\n // account the filter dropped (hidden, closed, deleted) shows the placeholder, not a blank value.\n const candidate = picked ?? text(data.emergency_savings_account_guid)\n const value = options.some((option) => option.value === candidate) ? (candidate ?? '') : ''\n\n const onChange = (guid: string) => {\n insightsV2Store.setBeatContext(beatGuid, { selected_account_guid: guid })\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.EMERGENCY_SAVINGS_ACCT_SELECTED)\n }\n\n return (\n <DesignateEmergencySavingsCard\n graphic={null}\n onChange={onChange}\n options={options}\n placeholder={text(data.picker_placeholder)}\n selectLabel={text(data.picker_label)}\n sx={{ width: '100%' }}\n value={value}\n />\n )\n },\n)\n"],"mappings":";;;;;;AAaA,IAAM,IAAA,CAAQ,MAAoB,OAAO,KAAU,WAAW,IAAQ,QAQzD,IAAgC,EAAA,CAC1C,EAAE,UAAA,GAAU,MAAA,IAAO,CAAC,EAAA,MAA4C;AAC/D,QAAM,IAAe,EAAgB,GAC/B,IAAkB,EAAmB,GACrC,IAAqB,EAAkB;AAE7C,MAAI,CAAC,EAAU,QAAO;AAEtB,QAAM,IAAS,EAAK,EAAgB,YAAY,CAAA,GAAW,qBAAqB,GAE1E,IAAU,EAAa,uBAC1B,OAAA,CAAQ,MAAY,CAAC,EAAQ,aAAa,CAAC,EAAQ,UAAU,EAC7D,IAAA,CAAK,EAAE,MAAA,GAAM,MAAA,EAAA,OAAY;AAAA,IAAE,OAAO;AAAA,IAAM,OAAO,KAAQ;AAAA,EAAG,EAAE,GAIzD,IAAY,KAAU,EAAK,EAAK,8BAA8B,GAC9D,IAAQ,EAAQ,KAAA,CAAM,MAAW,EAAO,UAAU,CAAS,IAAK,KAAa,KAAM;AAOzF,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,SAAS;AAAA,IACC,UARR,CAAY,MAAiB;AACjC,MAAA,EAAgB,eAAe,GAAU,EAAE,uBAAuB,EAAK,CAAC,GACxE,EAAmB,EAAwB,+BAA+B;AAAA,IAC5E;AAAA,IAMa,SAAA;AAAA,IACT,aAAa,EAAK,EAAK,kBAAkB;AAAA,IACzC,aAAa,EAAK,EAAK,YAAY;AAAA,IACnC,IAAI,EAAE,OAAO,OAAO;AAAA,IACb,OAAA;AAAA,EACR,CAAA;AAEL,CACF"}
@@ -1,3 +1,3 @@
1
1
  import { BlockProps } from '../../types';
2
2
  import { SVGImageBlockData } from '../../../../core/types/InsightsInstanceSlotData';
3
- export declare const SVGImageBlock: ({ payload: { instance_slot, instance_slot_data, widget_type }, }: BlockProps<SVGImageBlockData>) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const SVGImageBlock: ({ payload: { instance_slot, instance_slot_data, widget_type }, beatGuid, }: BlockProps<SVGImageBlockData>) => import("react/jsx-runtime").JSX.Element;