@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
@@ -1,20 +1,41 @@
1
- import { ThemedSVGImage as n } from "../../../components/chartblocks/ThemedSVGImage.es.js";
2
- import { getLayoutConfig as g } from "./layout.es.js";
1
+ import { ThemedSVGImage as f } from "../../../components/chartblocks/ThemedSVGImage.es.js";
2
+ import { resolveVariantConfig as p } from "../../resolveVariantConfig.es.js";
3
+ import { getLayoutConfig as d } from "./layout.es.js";
4
+ import { CtaStatus as v } from "../../../components/CtaStatus.es.js";
5
+ import { EmergencySavingsAccountPicker as h } from "./EmergencySavingsAccountPicker.es.js";
3
6
  import s from "@mui/material/Stack";
4
- import { jsx as i } from "react/jsx-runtime";
5
- var d = ({ payload: { instance_slot: o, instance_slot_data: t, widget_type: m } }) => {
6
- const r = m === "mini", { variant: a } = o, e = g(a, t?.isCIBC);
7
- return /* @__PURE__ */ i(s, {
7
+ import { jsx as o, jsxs as u } from "react/jsx-runtime";
8
+ var V = ({ payload: { instance_slot: m, instance_slot_data: n, widget_type: t }, beatGuid: c }) => {
9
+ const l = t === "mini", a = t === "full", { variant: g, data: e } = m, i = p(d(n?.isCIBC), g, "savings", "SVGImageBlock"), r = typeof e?.saved_label == "string" ? e.saved_label.trim() : "";
10
+ return /* @__PURE__ */ u(s, {
8
11
  alignItems: "center",
9
12
  sx: { width: "100%" },
10
- children: /* @__PURE__ */ i(n, {
11
- image: e.image,
12
- isMini: r
13
- })
13
+ children: [
14
+ /* @__PURE__ */ o(f, {
15
+ image: i.image,
16
+ isMini: l
17
+ }),
18
+ i.showPicker && a && /* @__PURE__ */ o(h, {
19
+ beatGuid: c,
20
+ data: e
21
+ }),
22
+ i.showSavedLabel && a && r && /* @__PURE__ */ o(s, {
23
+ sx: {
24
+ pt: 24,
25
+ px: 16,
26
+ width: "100%"
27
+ },
28
+ children: /* @__PURE__ */ o(v, {
29
+ icon: "check_circle",
30
+ label: r,
31
+ tone: "success"
32
+ })
33
+ })
34
+ ]
14
35
  });
15
36
  };
16
37
  export {
17
- d as SVGImageBlock
38
+ V as SVGImageBlock
18
39
  };
19
40
 
20
41
  //# sourceMappingURL=SVGImageBlock.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SVGImageBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.tsx"],"sourcesContent":["import { BlockProps } from '../../types'\nimport Stack from '@mui/material/Stack'\nimport { getLayoutConfig } from './layout'\n\nimport type { SVGImageBlockData } from '../../../../core/types/InsightsInstanceSlotData'\n\nimport { ThemedSVGImage } from '../../../components/chartblocks/ThemedSVGImage'\n\nexport const SVGImageBlock = ({\n payload: { instance_slot, instance_slot_data, widget_type },\n}: BlockProps<SVGImageBlockData>) => {\n const isMini = widget_type === 'mini'\n const { variant } = instance_slot\n const layoutConfig = getLayoutConfig(variant, instance_slot_data?.isCIBC)\n\n // TODO : Add Designate Emergency Savings Account dropdown, post discussion with BE design.\n return (\n <Stack alignItems=\"center\" sx={{ width: '100%' }}>\n <ThemedSVGImage image={layoutConfig.image} isMini={isMini} />\n </Stack>\n )\n}\n"],"mappings":";;;;AAQA,IAAa,IAAA,CAAiB,EAC5B,SAAS,EAAE,eAAA,GAAe,oBAAA,GAAoB,aAAA,EAAA,EAAA,MACX;AACnC,QAAM,IAAS,MAAgB,QACzB,EAAE,SAAA,EAAA,IAAY,GACd,IAAe,EAAgB,GAAS,GAAoB,MAAM;AAGxE,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,YAAW;AAAA,IAAS,IAAI,EAAE,OAAO,OAAO;AAAA,IAC7C,UAAA,gBAAA,EAAC,GAAD;AAAA,MAAgB,OAAO,EAAa;AAAA,MAAe,QAAA;AAAA,IAAS,CAAA;AAAA,EACvD,CAAA;AAEX"}
1
+ {"version":3,"file":"SVGImageBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { BlockProps } from '../../types'\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { getLayoutConfig } from './layout'\n\nimport type { SVGImageBlockData } from '../../../../core/types/InsightsInstanceSlotData'\n\nimport { ThemedSVGImage } from '../../../components/chartblocks/ThemedSVGImage'\nimport { CtaStatus } from '../../../components/CtaStatus'\nimport { EmergencySavingsAccountPicker } from './EmergencySavingsAccountPicker'\n\nexport const SVGImageBlock = ({\n payload: { instance_slot, instance_slot_data, widget_type },\n beatGuid,\n}: BlockProps<SVGImageBlockData>) => {\n const isMini = widget_type === 'mini'\n const isFull = widget_type === 'full'\n const { variant, data } = instance_slot\n // An unknown variant (drift with ditto) warns and draws the plain illustration.\n const layoutConfig = resolveVariantConfig(\n getLayoutConfig(instance_slot_data?.isCIBC),\n variant,\n 'savings',\n 'SVGImageBlock',\n )\n\n const savedLabel = typeof data?.saved_label === 'string' ? data.saved_label.trim() : ''\n\n return (\n <Stack alignItems=\"center\" sx={{ width: '100%' }}>\n <ThemedSVGImage image={layoutConfig.image} isMini={isMini} />\n {layoutConfig.showPicker && isFull && (\n <EmergencySavingsAccountPicker beatGuid={beatGuid} data={data} />\n )}\n {layoutConfig.showSavedLabel &&\n isFull &&\n savedLabel && (\n // Figma 1943:219096: the saved status sits in the card body, under the illustration.\n <Stack sx={{ pt: 24, px: 16, width: '100%' }}>\n <CtaStatus icon=\"check_circle\" label={savedLabel} tone=\"success\" />\n </Stack>\n )}\n </Stack>\n )\n}\n"],"mappings":";;;;;;;AAYA,IAAa,IAAA,CAAiB,EAC5B,SAAS,EAAE,eAAA,GAAe,oBAAA,GAAoB,aAAA,EAAA,GAC9C,UAAA,EAAA,MACmC;AACnC,QAAM,IAAS,MAAgB,QACzB,IAAS,MAAgB,QACzB,EAAE,SAAA,GAAS,MAAA,EAAA,IAAS,GAEpB,IAAe,EACnB,EAAgB,GAAoB,MAAM,GAC1C,GACA,WACA,eACF,GAEM,IAAa,OAAO,GAAM,eAAgB,WAAW,EAAK,YAAY,KAAK,IAAI;AAErF,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,YAAW;AAAA,IAAS,IAAI,EAAE,OAAO,OAAO;AAAA,IAA/C,UAAA;AAAA,MACE,gBAAA,EAAC,GAAD;AAAA,QAAgB,OAAO,EAAa;AAAA,QAAe,QAAA;AAAA,MAAS,CAAA;AAAA,MAC3D,EAAa,cAAc,KAC1B,gBAAA,EAAC,GAAD;AAAA,QAAyC,UAAA;AAAA,QAAgB,MAAA;AAAA,MAAO,CAAA;AAAA,MAEjE,EAAa,kBACZ,KACA,KAEE,gBAAA,EAAC,GAAD;AAAA,QAAO,IAAI;AAAA,UAAE,IAAI;AAAA,UAAI,IAAI;AAAA,UAAI,OAAO;AAAA,QAAO;AAAA,QACzC,UAAA,gBAAA,EAAC,GAAD;AAAA,UAAW,MAAK;AAAA,UAAe,OAAO;AAAA,UAAY,MAAK;AAAA,QAAW,CAAA;AAAA,MAC7D,CAAA;AAAA,IAEN;AAAA;AAEX"}
@@ -1,7 +1,10 @@
1
- export declare const getLayoutConfig: (variant?: string | null, isCibc?: boolean) => {
2
- image: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
3
- } | {
4
- image: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
5
- } | {
6
- image: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
7
- };
1
+ export interface SVGImageLayoutConfig {
2
+ image: React.FC<React.SVGProps<SVGSVGElement>>;
3
+ /** Draw the savings-account picker under the image (full card only). */
4
+ showPicker?: boolean;
5
+ /** Draw the slot's `saved_label` as a status under the image (full card only). */
6
+ showSavedLabel?: boolean;
7
+ }
8
+ export type SVGImageVariant = 'Holiday' | 'Reminder' | 'savings' | 'savings_account_picker' | 'savings_account_saved';
9
+ /** Variant table for resolveVariantConfig; `isCibc` picks the CIBC art where a variant has one. */
10
+ export declare const getLayoutConfig: (isCibc?: boolean) => Record<SVGImageVariant, SVGImageLayoutConfig>;
@@ -1,15 +1,22 @@
1
- import { ReactComponent as e } from "./images/UpcomingTaxDeadlineAlert.es.js";
2
- import { ReactComponent as a } from "./images/UpcomingTaxDeadlineAlertCIBC.es.js";
3
- import { ReactComponent as m } from "./images/FederalBankHoliday.es.js";
4
- import { ReactComponent as t } from "./images/FederalBankHolidayCibc.es.js";
1
+ import { ReactComponent as o } from "./images/UpcomingTaxDeadlineAlert.es.js";
2
+ import { ReactComponent as r } from "./images/UpcomingTaxDeadlineAlertCIBC.es.js";
3
+ import { ReactComponent as t } from "./images/FederalBankHoliday.es.js";
4
+ import { ReactComponent as m } from "./images/FederalBankHolidayCibc.es.js";
5
5
  import { ReactComponent as n } from "./images/DesignateEmergencySavingsAccount.es.js";
6
- var g = (r, o = !1) => ({
7
- Holiday: { image: o ? t : m },
8
- Reminder: { image: o ? a : e },
9
- Savings: { image: n }
10
- })[r];
6
+ var a = (e = {}) => ({
7
+ image: n,
8
+ showPicker: !1,
9
+ showSavedLabel: !1,
10
+ ...e
11
+ }), R = (e = !1) => ({
12
+ Holiday: { image: e ? m : t },
13
+ Reminder: { image: e ? r : o },
14
+ savings: a(),
15
+ savings_account_picker: a({ showPicker: !0 }),
16
+ savings_account_saved: a({ showSavedLabel: !0 })
17
+ });
11
18
  export {
12
- g as getLayoutConfig
19
+ R as getLayoutConfig
13
20
  };
14
21
 
15
22
  //# sourceMappingURL=layout.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.ts"],"sourcesContent":["// SVGs to be moved to S3 and imported from there.\nimport { ReactComponent as UpcomingTaxDeadline } from './images/UpcomingTaxDeadlineAlert.svg'\nimport { ReactComponent as UpcomingTaxDeadlineCIBC } from './images/UpcomingTaxDeadlineAlertCIBC.svg'\n\nimport { ReactComponent as FederalBankHoliday } from './images/FederalBankHoliday.svg'\nimport { ReactComponent as FederalBankHolidayCIBC } from './images/FederalBankHolidayCibc.svg'\n\nimport { ReactComponent as DesignateEmergencySavingsAccount } from './images/DesignateEmergencySavingsAccount.svg'\n\nexport const getLayoutConfig = (variant?: string | null, isCibc: boolean = false) => {\n const config = {\n Holiday: {\n image: isCibc ? FederalBankHolidayCIBC : FederalBankHoliday,\n },\n Reminder: {\n image: isCibc ? UpcomingTaxDeadlineCIBC : UpcomingTaxDeadline,\n },\n Savings: {\n image: DesignateEmergencySavingsAccount,\n },\n }\n return config[variant as keyof typeof config]\n}\n"],"mappings":";;;;;AASA,IAAa,IAAA,CAAmB,GAAyB,IAAkB,QAYlE;AAAA,EAVL,SAAS,EACP,OAAO,IAAS,IAAyB,EAC3C;AAAA,EACA,UAAU,EACR,OAAO,IAAS,IAA0B,EAC5C;AAAA,EACA,SAAS,EACP,OAAO,EACT;AAEK,GAAO,CAAA"}
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.ts"],"sourcesContent":["// SVGs to be moved to S3 and imported from there.\nimport { ReactComponent as UpcomingTaxDeadline } from './images/UpcomingTaxDeadlineAlert.svg'\nimport { ReactComponent as UpcomingTaxDeadlineCIBC } from './images/UpcomingTaxDeadlineAlertCIBC.svg'\n\nimport { ReactComponent as FederalBankHoliday } from './images/FederalBankHoliday.svg'\nimport { ReactComponent as FederalBankHolidayCIBC } from './images/FederalBankHolidayCibc.svg'\n\nimport { ReactComponent as DesignateEmergencySavingsAccount } from './images/DesignateEmergencySavingsAccount.svg'\n\nexport interface SVGImageLayoutConfig {\n image: React.FC<React.SVGProps<SVGSVGElement>>\n /** Draw the savings-account picker under the image (full card only). */\n showPicker?: boolean\n /** Draw the slot's `saved_label` as a status under the image (full card only). */\n showSavedLabel?: boolean\n}\n\n// Designate Emergency Savings Account (ditto layout variants): the illustration alone (open_account),\n// with the account picker (choose_account), or with the \"Account Saved!\" status in the card body\n// (change_account, the card the beat refreshes into after Save; Figma 1943:219096).\nconst emergencySavings = (overrides: Partial<SVGImageLayoutConfig> = {}): SVGImageLayoutConfig => ({\n image: DesignateEmergencySavingsAccount,\n showPicker: false,\n showSavedLabel: false,\n ...overrides,\n})\n\nexport type SVGImageVariant =\n | 'Holiday'\n | 'Reminder'\n | 'savings'\n | 'savings_account_picker'\n | 'savings_account_saved'\n\n/** Variant table for resolveVariantConfig; `isCibc` picks the CIBC art where a variant has one. */\nexport const getLayoutConfig = (\n isCibc: boolean = false,\n): Record<SVGImageVariant, SVGImageLayoutConfig> => ({\n Holiday: {\n image: isCibc ? FederalBankHolidayCIBC : FederalBankHoliday,\n },\n Reminder: {\n image: isCibc ? UpcomingTaxDeadlineCIBC : UpcomingTaxDeadline,\n },\n savings: emergencySavings(),\n savings_account_picker: emergencySavings({ showPicker: true }),\n savings_account_saved: emergencySavings({ showSavedLabel: true }),\n})\n"],"mappings":";;;;;AAoBA,IAAM,IAAA,CAAoB,IAA2C,CAAC,OAA6B;AAAA,EACjG,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,GAAG;AACL,IAUa,IAAA,CACX,IAAkB,QACiC;AAAA,EACnD,SAAS,EACP,OAAO,IAAS,IAAyB,EAC3C;AAAA,EACA,UAAU,EACR,OAAO,IAAS,IAA0B,EAC5C;AAAA,EACA,SAAS,EAAiB;AAAA,EAC1B,wBAAwB,EAAiB,EAAE,YAAY,GAAK,CAAC;AAAA,EAC7D,uBAAuB,EAAiB,EAAE,gBAAgB,GAAK,CAAC;AAClE"}
@@ -0,0 +1,19 @@
1
+ export type CtaStatusTone = 'success' | 'neutral' | 'error';
2
+ export interface CtaStatusProps {
3
+ /** The words, from the backend (copy or a slot) so they stay localized and customizable. */
4
+ label: string;
5
+ /** Background, border, icon and text colours. */
6
+ tone: CtaStatusTone;
7
+ /** mx-icons name, drawn filled and hidden from assistive technology. */
8
+ icon?: string;
9
+ /** An inline button inside the status (e.g. Subscription Detected's "Undo"). */
10
+ action?: {
11
+ label: string;
12
+ onPress: () => void;
13
+ };
14
+ }
15
+ /**
16
+ * A CTA slot's status: what the slot shows once its action is done, instead of a button. Not a
17
+ * control itself (`role="status"`); only the optional inline `action` is pressable.
18
+ */
19
+ export declare const CtaStatus: ({ label, tone, icon, action }: CtaStatusProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,67 @@
1
+ import i from "@mui/material/Stack";
2
+ import { Text as n } from "@mxenabled/mxui";
3
+ import c from "@mui/material/Button";
4
+ import { Icon as m } from "@mxenabled/mx-icons";
5
+ import { jsx as t, jsxs as s } from "react/jsx-runtime";
6
+ var d = {
7
+ success: {
8
+ main: "success.main",
9
+ fill: "success.lighter",
10
+ text: "success.dark"
11
+ },
12
+ neutral: {
13
+ main: "text.secondary",
14
+ fill: "background.default",
15
+ text: "text.primary"
16
+ },
17
+ error: {
18
+ main: "error.main",
19
+ fill: "error.lighter",
20
+ text: "error.dark"
21
+ }
22
+ }, g = ({ label: l, tone: a, icon: o, action: e }) => {
23
+ const r = d[a];
24
+ return /* @__PURE__ */ s(i, {
25
+ alignItems: "center",
26
+ direction: "row",
27
+ gap: 8,
28
+ justifyContent: e ? "space-between" : "center",
29
+ sx: {
30
+ bgcolor: r.fill,
31
+ border: "1px solid",
32
+ borderColor: r.main,
33
+ borderRadius: 1,
34
+ minHeight: 44,
35
+ px: 16,
36
+ py: 8
37
+ },
38
+ children: [/* @__PURE__ */ s(i, {
39
+ alignItems: "center",
40
+ direction: "row",
41
+ gap: 8,
42
+ role: "status",
43
+ children: [o && /* @__PURE__ */ t(m, {
44
+ "aria-hidden": !0,
45
+ fill: !0,
46
+ name: o,
47
+ size: 24,
48
+ sx: { color: r.main }
49
+ }), /* @__PURE__ */ t(n, {
50
+ bold: !0,
51
+ sx: { color: r.text },
52
+ variant: "body1",
53
+ children: l
54
+ })]
55
+ }), e && /* @__PURE__ */ t(c, {
56
+ onClick: e.onPress,
57
+ size: "small",
58
+ sx: { color: r.text },
59
+ children: e.label
60
+ })]
61
+ });
62
+ };
63
+ export {
64
+ g as CtaStatus
65
+ };
66
+
67
+ //# sourceMappingURL=CtaStatus.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CtaStatus.es.js","names":[],"sources":["../../../src/insights-v2/components/CtaStatus.tsx"],"sourcesContent":["import Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\n\nexport type CtaStatusTone = 'success' | 'neutral' | 'error'\n\nexport interface CtaStatusProps {\n /** The words, from the backend (copy or a slot) so they stay localized and customizable. */\n label: string\n /** Background, border, icon and text colours. */\n tone: CtaStatusTone\n /** mx-icons name, drawn filled and hidden from assistive technology. */\n icon?: string\n /** An inline button inside the status (e.g. Subscription Detected's \"Undo\"). */\n action?: { label: string; onPress: () => void }\n}\n\n// Figma: the \"after the press\" bar drawn in a CTA's place (Designate's \"Account Saved!\",\n// Subscription Detected's \"Confirmed / Undo\"). Button-sized, outlined, tinted fill.\nconst TONE_COLORS: Record<CtaStatusTone, { main: string; fill: string; text: string }> = {\n success: { main: 'success.main', fill: 'success.lighter', text: 'success.dark' },\n neutral: { main: 'text.secondary', fill: 'background.default', text: 'text.primary' },\n error: { main: 'error.main', fill: 'error.lighter', text: 'error.dark' },\n}\n\n/**\n * A CTA slot's status: what the slot shows once its action is done, instead of a button. Not a\n * control itself (`role=\"status\"`); only the optional inline `action` is pressable.\n */\nexport const CtaStatus = ({ label, tone, icon, action }: CtaStatusProps) => {\n const colors = TONE_COLORS[tone]\n\n return (\n <Stack\n alignItems=\"center\"\n direction=\"row\"\n gap={8}\n justifyContent={action ? 'space-between' : 'center'}\n sx={{\n bgcolor: colors.fill,\n border: '1px solid',\n borderColor: colors.main,\n borderRadius: 1,\n minHeight: 44,\n px: 16,\n py: 8,\n }}\n >\n <Stack alignItems=\"center\" direction=\"row\" gap={8} role=\"status\">\n {icon && (\n <Icon aria-hidden={true} fill={true} name={icon} size={24} sx={{ color: colors.main }} />\n )}\n <Text bold={true} sx={{ color: colors.text }} variant=\"body1\">\n {label}\n </Text>\n </Stack>\n {action && (\n <Button onClick={action.onPress} size=\"small\" sx={{ color: colors.text }}>\n {action.label}\n </Button>\n )}\n </Stack>\n )\n}\n"],"mappings":";;;;;AAqBA,IAAM,IAAmF;AAAA,EACvF,SAAS;AAAA,IAAE,MAAM;AAAA,IAAgB,MAAM;AAAA,IAAmB,MAAM;AAAA,EAAe;AAAA,EAC/E,SAAS;AAAA,IAAE,MAAM;AAAA,IAAkB,MAAM;AAAA,IAAsB,MAAM;AAAA,EAAe;AAAA,EACpF,OAAO;AAAA,IAAE,MAAM;AAAA,IAAc,MAAM;AAAA,IAAiB,MAAM;AAAA,EAAa;AACzE,GAMa,IAAA,CAAa,EAAE,OAAA,GAAO,MAAA,GAAM,MAAA,GAAM,QAAA,EAAA,MAA6B;AAC1E,QAAM,IAAS,EAAY,CAAA;AAE3B,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,YAAW;AAAA,IACX,WAAU;AAAA,IACV,KAAK;AAAA,IACL,gBAAgB,IAAS,kBAAkB;AAAA,IAC3C,IAAI;AAAA,MACF,SAAS,EAAO;AAAA,MAChB,QAAQ;AAAA,MACR,aAAa,EAAO;AAAA,MACpB,cAAc;AAAA,MACd,WAAW;AAAA,MACX,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,IAbF,UAAA,CAeE,gBAAA,EAAC,GAAD;AAAA,MAAO,YAAW;AAAA,MAAS,WAAU;AAAA,MAAM,KAAK;AAAA,MAAG,MAAK;AAAA,MAAxD,UAAA,CACG,KACC,gBAAA,EAAC,GAAD;AAAA,QAAM,eAAa;AAAA,QAAM,MAAM;AAAA,QAAM,MAAM;AAAA,QAAM,MAAM;AAAA,QAAI,IAAI,EAAE,OAAO,EAAO,KAAK;AAAA,MAAI,CAAA,GAE1F,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM;AAAA,QAAM,IAAI,EAAE,OAAO,EAAO,KAAK;AAAA,QAAG,SAAQ;AAAA,QACnD,UAAA;AAAA,MACG,CAAA,CACD;AAAA,IACN,CAAA,GAAA,KACC,gBAAA,EAAC,GAAD;AAAA,MAAQ,SAAS,EAAO;AAAA,MAAS,MAAK;AAAA,MAAQ,IAAI,EAAE,OAAO,EAAO,KAAK;AAAA,MACpE,UAAA,EAAO;AAAA,IACF,CAAA,CAEL;AAAA;AAEX"}
@@ -0,0 +1,42 @@
1
+ import { ReactNode } from 'react';
2
+ export interface GoalProgressRow {
3
+ /** mx-icons glyph drawn in the row's tile, e.g. `today`. */
4
+ icon: string;
5
+ /** Caption above the value, e.g. "Projected to Complete:". */
6
+ label: ReactNode;
7
+ /** Pre-formatted value, e.g. "Dec 31, 2026". */
8
+ value: ReactNode;
9
+ }
10
+ export interface GoalProgressPillConfig {
11
+ bgcolor: string;
12
+ borderColor: string;
13
+ labelColor: string;
14
+ icon?: string;
15
+ }
16
+ export interface GoalProgressCardStyleProps {
17
+ /** Slot surface token behind the white card. Default `primary.main`. */
18
+ bgcolor?: string;
19
+ /** Progress fill token. Default `primary.main`. */
20
+ barColor?: string;
21
+ /** Progress track token. Default `grey.200`. */
22
+ trackColor?: string;
23
+ /** Row icon tile surface token. Default `primary.lighter`. */
24
+ tileColor?: string;
25
+ /** Row icon glyph token. Default `primary.main`. */
26
+ iconColor?: string;
27
+ pill?: GoalProgressPillConfig;
28
+ }
29
+ interface GoalProgressCardProps extends GoalProgressCardStyleProps {
30
+ /** Progress toward the goal as a percentage; clamped to 0–100 for the bar. */
31
+ percent: number;
32
+ /** Pre-localized progress line above the bar, e.g. "50% Complete". */
33
+ percentLabel?: ReactNode;
34
+ /** Names the bar together with the progress line, e.g. the goal's name. */
35
+ barLabel?: string;
36
+ /** Optional status pill beside the progress line, e.g. "Goal reached". */
37
+ statusLabel?: ReactNode;
38
+ rows?: GoalProgressRow[];
39
+ }
40
+ export declare const clampPercent: (percent: number) => number;
41
+ declare const GoalProgressCard: ({ barColor, barLabel, bgcolor, iconColor, percent, percentLabel, pill, rows, statusLabel, tileColor, trackColor, }: GoalProgressCardProps) => import("react/jsx-runtime").JSX.Element;
42
+ export default GoalProgressCard;
@@ -0,0 +1,135 @@
1
+ import S from "./StatusPill.es.js";
2
+ import o from "@mui/material/Stack";
3
+ import { Text as c } from "@mxenabled/mxui";
4
+ import { Icon as g } from "@mxenabled/mx-icons";
5
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
6
+ import d from "@mui/material/Box";
7
+ var I = {
8
+ bgcolor: "grey.200",
9
+ borderColor: "grey.200",
10
+ labelColor: "text.primary"
11
+ }, R = [], k = (a) => Number.isFinite(a) ? Math.min(100, Math.max(0, a)) : 0, T = ({ barColor: a = "primary.main", barLabel: t, bgcolor: p = "primary.main", iconColor: b = "primary.main", percent: u, percentLabel: n, pill: e = I, rows: s = R, statusLabel: m, tileColor: f = "primary.lighter", trackColor: v = "grey.200" }) => {
12
+ const h = k(u), l = typeof n == "string" ? n : void 0, y = t && l ? `${t}, ${l}` : t ?? l;
13
+ return /* @__PURE__ */ r(d, {
14
+ sx: {
15
+ bgcolor: p,
16
+ p: 16,
17
+ width: "100%"
18
+ },
19
+ children: /* @__PURE__ */ i(o, {
20
+ sx: {
21
+ bgcolor: "background.paper",
22
+ borderRadius: "12px",
23
+ gap: 16,
24
+ p: 16,
25
+ width: "100%"
26
+ },
27
+ children: [/* @__PURE__ */ i(o, {
28
+ sx: { gap: 12 },
29
+ children: [/* @__PURE__ */ i(o, {
30
+ sx: {
31
+ alignItems: "center",
32
+ flexDirection: "row",
33
+ gap: 12
34
+ },
35
+ children: [n && /* @__PURE__ */ r(c, {
36
+ sx: {
37
+ flexGrow: 1,
38
+ fontWeight: 700
39
+ },
40
+ variant: "h3",
41
+ children: n
42
+ }), m && /* @__PURE__ */ r(S, {
43
+ bgcolor: e.bgcolor,
44
+ borderColor: e.borderColor,
45
+ icon: e.icon ? /* @__PURE__ */ r(g, {
46
+ "aria-hidden": !0,
47
+ fill: !0,
48
+ name: e.icon,
49
+ size: 16,
50
+ sx: { color: e.labelColor }
51
+ }) : void 0,
52
+ label: m,
53
+ labelColor: e.labelColor,
54
+ labelVariant: "caption",
55
+ sx: {
56
+ alignSelf: "center",
57
+ flexShrink: 0,
58
+ ml: "auto",
59
+ px: 12
60
+ }
61
+ })]
62
+ }), /* @__PURE__ */ r(d, {
63
+ "aria-label": y,
64
+ "aria-valuemax": 100,
65
+ "aria-valuemin": 0,
66
+ "aria-valuenow": h,
67
+ role: "progressbar",
68
+ sx: {
69
+ bgcolor: v,
70
+ borderRadius: 999,
71
+ height: 16,
72
+ overflow: "hidden"
73
+ },
74
+ children: /* @__PURE__ */ r(d, { sx: {
75
+ bgcolor: a,
76
+ borderRadius: 999,
77
+ height: "100%",
78
+ transition: "width .4s cubic-bezier(0.28, 0.14, 0.34, 1.04)",
79
+ width: `${h}%`
80
+ } })
81
+ })]
82
+ }), s.length > 0 && /* @__PURE__ */ r(o, {
83
+ component: "ul",
84
+ sx: {
85
+ gap: 12,
86
+ listStyle: "none",
87
+ m: 0,
88
+ p: 0
89
+ },
90
+ children: s.map(({ icon: x, label: w, value: C }) => /* @__PURE__ */ i(o, {
91
+ component: "li",
92
+ sx: {
93
+ alignItems: "center",
94
+ flexDirection: "row",
95
+ gap: 16
96
+ },
97
+ children: [/* @__PURE__ */ r(o, {
98
+ sx: {
99
+ alignItems: "center",
100
+ bgcolor: f,
101
+ borderRadius: "8px",
102
+ flexShrink: 0,
103
+ height: 48,
104
+ justifyContent: "center",
105
+ width: 48
106
+ },
107
+ children: /* @__PURE__ */ r(g, {
108
+ "aria-hidden": !0,
109
+ name: x,
110
+ size: 24,
111
+ sx: { color: b }
112
+ })
113
+ }), /* @__PURE__ */ i(o, {
114
+ sx: { minWidth: 0 },
115
+ children: [/* @__PURE__ */ r(c, {
116
+ color: "text.secondary",
117
+ variant: "body2",
118
+ children: w
119
+ }), /* @__PURE__ */ r(c, {
120
+ sx: { fontWeight: 700 },
121
+ variant: "body1",
122
+ children: C
123
+ })]
124
+ })]
125
+ }, x))
126
+ })]
127
+ })
128
+ });
129
+ };
130
+ export {
131
+ k as clampPercent,
132
+ T as default
133
+ };
134
+
135
+ //# sourceMappingURL=GoalProgressCard.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoalProgressCard.es.js","names":[],"sources":["../../../src/insights-v2/components/GoalProgressCard.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\n\nimport StatusPill from './StatusPill'\n\nexport interface GoalProgressRow {\n /** mx-icons glyph drawn in the row's tile, e.g. `today`. */\n icon: string\n /** Caption above the value, e.g. \"Projected to Complete:\". */\n label: ReactNode\n /** Pre-formatted value, e.g. \"Dec 31, 2026\". */\n value: ReactNode\n}\n\nexport interface GoalProgressPillConfig {\n bgcolor: string\n borderColor: string\n labelColor: string\n icon?: string\n}\n\nexport interface GoalProgressCardStyleProps {\n /** Slot surface token behind the white card. Default `primary.main`. */\n bgcolor?: string\n /** Progress fill token. Default `primary.main`. */\n barColor?: string\n /** Progress track token. Default `grey.200`. */\n trackColor?: string\n /** Row icon tile surface token. Default `primary.lighter`. */\n tileColor?: string\n /** Row icon glyph token. Default `primary.main`. */\n iconColor?: string\n pill?: GoalProgressPillConfig\n}\n\ninterface GoalProgressCardProps extends GoalProgressCardStyleProps {\n /** Progress toward the goal as a percentage; clamped to 0–100 for the bar. */\n percent: number\n /** Pre-localized progress line above the bar, e.g. \"50% Complete\". */\n percentLabel?: ReactNode\n /** Names the bar together with the progress line, e.g. the goal's name. */\n barLabel?: string\n /** Optional status pill beside the progress line, e.g. \"Goal reached\". */\n statusLabel?: ReactNode\n rows?: GoalProgressRow[]\n}\n\nconst NEUTRAL_PILL: GoalProgressPillConfig = {\n bgcolor: 'grey.200',\n borderColor: 'grey.200',\n labelColor: 'text.primary',\n}\n\nconst NO_ROWS: GoalProgressRow[] = []\n\nexport const clampPercent = (percent: number) =>\n Number.isFinite(percent) ? Math.min(100, Math.max(0, percent)) : 0\n\nconst GoalProgressCard = ({\n barColor = 'primary.main',\n barLabel,\n bgcolor = 'primary.main',\n iconColor = 'primary.main',\n percent,\n percentLabel,\n pill = NEUTRAL_PILL,\n rows = NO_ROWS,\n statusLabel,\n tileColor = 'primary.lighter',\n trackColor = 'grey.200',\n}: GoalProgressCardProps) => {\n const value = clampPercent(percent)\n const percentText = typeof percentLabel === 'string' ? percentLabel : undefined\n const barName =\n barLabel && percentText ? `${barLabel}, ${percentText}` : (barLabel ?? percentText)\n\n return (\n <Box sx={{ bgcolor, p: 16, width: '100%' }}>\n <Stack\n sx={{\n bgcolor: 'background.paper',\n borderRadius: '12px',\n gap: 16,\n p: 16,\n width: '100%',\n }}\n >\n <Stack sx={{ gap: 12 }}>\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 12 }}>\n {percentLabel && (\n <Text sx={{ flexGrow: 1, fontWeight: 700 }} variant=\"h3\">\n {percentLabel}\n </Text>\n )}\n {statusLabel && (\n <StatusPill\n bgcolor={pill.bgcolor}\n borderColor={pill.borderColor}\n icon={\n pill.icon ? (\n <Icon\n aria-hidden={true}\n fill={true}\n name={pill.icon}\n size={16}\n sx={{ color: pill.labelColor }}\n />\n ) : undefined\n }\n label={statusLabel}\n labelColor={pill.labelColor}\n labelVariant=\"caption\"\n sx={{ alignSelf: 'center', flexShrink: 0, ml: 'auto', px: 12 }}\n />\n )}\n </Stack>\n <Box\n aria-label={barName}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuenow={value}\n role=\"progressbar\"\n sx={{ bgcolor: trackColor, borderRadius: 999, height: 16, overflow: 'hidden' }}\n >\n <Box\n sx={{\n bgcolor: barColor,\n borderRadius: 999,\n height: '100%',\n transition: 'width .4s cubic-bezier(0.28, 0.14, 0.34, 1.04)',\n width: `${value}%`,\n }}\n />\n </Box>\n </Stack>\n\n {rows.length > 0 && (\n <Stack component=\"ul\" sx={{ gap: 12, listStyle: 'none', m: 0, p: 0 }}>\n {rows.map(({ icon, label, value: rowValue }) => (\n <Stack\n component=\"li\"\n key={icon}\n sx={{ alignItems: 'center', flexDirection: 'row', gap: 16 }}\n >\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: tileColor,\n borderRadius: '8px',\n flexShrink: 0,\n height: 48,\n justifyContent: 'center',\n width: 48,\n }}\n >\n <Icon aria-hidden={true} name={icon} size={24} sx={{ color: iconColor }} />\n </Stack>\n <Stack sx={{ minWidth: 0 }}>\n <Text color=\"text.secondary\" variant=\"body2\">\n {label}\n </Text>\n <Text sx={{ fontWeight: 700 }} variant=\"body1\">\n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A,UAEV,IAAI;AAAA,YAAE,YAAY;AAAA,YAAU,eAAe;AAAA,YAAO,KAAK;AAAA,UAAG;AAAA,UAH5D,UAAA,CAKE,gBAAA,EAAC,GAAD;AAAA,YACE,IAAI;AAAA,cACF,YAAY;AAAA,cACZ,SAAS;AAAA,cACT,cAAc;AAAA,cACd,YAAY;AAAA,cACZ,QAAQ;AAAA,cACR,gBAAgB;AAAA,cAChB,OAAO;AAAA,YACT;AAAA,YAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,cAAM,eAAa;AAAA,cAAM,MAAM;AAAA,cAAM,MAAM;AAAA,cAAI,IAAI,EAAE,OAAO,EAAU;AAAA,YAAI,CAAA;AAAA,UACrE,CAAA,GACP,gBAAA,EAAC,GAAD;AAAA,YAAO,IAAI,EAAE,UAAU,EAAE;AAAA,YAAzB,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,cAAM,OAAM;AAAA,cAAiB,SAAQ;AAAA,cAClC,UAAA;AAAA,YACG,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,cAAM,IAAI,EAAE,YAAY,IAAI;AAAA,cAAG,SAAQ;AAAA,cACpC,UAAA;AAAA,YACG,CAAA,CACD;AAAA,UACF,CAAA,CAAA;AAAA,QAxBA,GAAA,CAwBA,CACR;AAAA,MACI,CAAA,CAEJ;AAAA;EACJ,CAAA;AAET"}
@@ -1,10 +1,25 @@
1
- import { HOST_ACTIONS as s } from "./hostActions.es.js";
2
- var o = { dismiss_beat: {
3
- run: "delegateToHost",
4
- params: { hostAction: s.dismissBeat }
5
- } };
1
+ import { ANALYTICS_EVENTS_CONFIG as n } from "../analytics/analyticsEventsConfig.es.js";
2
+ import { HOST_ACTIONS as o } from "./hostActions.es.js";
3
+ var a = ({ beat: e, stores: t }) => {
4
+ const s = t.insightsV2Store.beatContext[e.guid]?.selected_account_guid;
5
+ if (typeof s == "string")
6
+ return t.accountStore.visibleSavingsAccounts.some((i) => i.guid === s && !i.is_closed && !i.is_deleted) ? s : void 0;
7
+ }, _ = {
8
+ dismiss_beat: {
9
+ run: "delegateToHost",
10
+ params: { hostAction: o.dismissBeat }
11
+ },
12
+ select_savings_account: {
13
+ run: "updateUserInsightProfile",
14
+ params: (e) => ({ fields: { emergency_savings_account_guid: a(e) } }),
15
+ disabledWhen: (e) => !a(e),
16
+ onSuccess: ["refreshBeat"],
17
+ analytics: n.EMERGENCY_SAVINGS_ACCT_SAVED
18
+ },
19
+ open_savings_account: { analytics: n.EMERGENCY_SAVINGS_ACCT_CREATED }
20
+ };
6
21
  export {
7
- o as ctaActions
22
+ _ as ctaActions
8
23
  };
9
24
 
10
25
  //# sourceMappingURL=ctaConfig.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ctaConfig.es.js","names":[],"sources":["../../../src/insights-v2/ctaActions/ctaConfig.ts"],"sourcesContent":["import { HOST_ACTIONS } from './hostActions'\nimport type { CtaStep } from './types'\n\n/**\n * Steps keyed by the backend-named `cta.action_key` (ditto `*_cta_action`, via tupac). No key or\n * an unknown key = default: open the CTA's block drawer, if any. Its post message, when one\n * resolves (`cta.metadata` / `ctaPostMessages`), is sent either way. A new key is registered in\n * ditto and here in the same change; most CTAs need none. See README.md.\n */\nexport const ctaActions: Record<string, CtaStep> = {\n /** ConnectDiscoveredAccounts \"I don't have any\": dismiss through the host, then stop. */\n dismiss_beat: {\n run: 'delegateToHost',\n params: { hostAction: HOST_ACTIONS.dismissBeat },\n },\n}\n"],"mappings":";AASA,IAAa,IAAsC,EAEjD,cAAc;AAAA,EACZ,KAAK;AAAA,EACL,QAAQ,EAAE,YAAY,EAAa,YAAY;AACjD,EACF"}
1
+ {"version":3,"file":"ctaConfig.es.js","names":[],"sources":["../../../src/insights-v2/ctaActions/ctaConfig.ts"],"sourcesContent":["import { ANALYTICS_EVENTS_CONFIG } from '../analytics/analyticsEventsConfig'\nimport { HOST_ACTIONS } from './hostActions'\nimport type { CtaStateContext, CtaStep } from './types'\n\n/**\n * The account the svg_image_block picker wrote into this beat's context, and only while it is\n * still one the user can save into (visible, open, not deleted) — a pick that went stale between\n * pick and Save never reaches the API.\n */\nconst pickedSavingsAccountGuid = ({ beat, stores }: Pick<CtaStateContext, 'beat' | 'stores'>) => {\n const picked = stores.insightsV2Store.beatContext[beat.guid]?.selected_account_guid\n\n if (typeof picked !== 'string') return undefined\n\n const usable = stores.accountStore.visibleSavingsAccounts.some(\n (account) => account.guid === picked && !account.is_closed && !account.is_deleted,\n )\n\n return usable ? picked : undefined\n}\n\n/**\n * Steps keyed by the backend-named `cta.action_key` (ditto `*_cta_action`, via tupac). No key or\n * an unknown key = default: open the CTA's block drawer, if any. Its post message, when one\n * resolves (`cta.metadata` / `ctaPostMessages`), is sent either way. A new key is registered in\n * ditto and here in the same change; most CTAs need none. See README.md.\n */\nexport const ctaActions: Record<string, CtaStep> = {\n /** ConnectDiscoveredAccounts \"I don't have any\": dismiss through the host, then stop. */\n dismiss_beat: {\n run: 'delegateToHost',\n params: { hostAction: HOST_ACTIONS.dismissBeat },\n },\n\n /**\n * Designate Emergency Savings Account \"Save\": designates the account picked in the\n * svg_image_block picker (kept in the per-beat context), then refreshes the beat. The beat is\n * sampled, so the refresh re-reads its sample, which the backend rebuilds as the saved card\n * (change_account: \"Account Saved!\", no CTA). Disabled until a pick is made.\n */\n select_savings_account: {\n run: 'updateUserInsightProfile',\n params: (ctx) => ({\n fields: { emergency_savings_account_guid: pickedSavingsAccountGuid(ctx) },\n }),\n disabledWhen: (ctx) => !pickedSavingsAccountGuid(ctx),\n onSuccess: ['refreshBeat'],\n analytics: ANALYTICS_EVENTS_CONFIG.EMERGENCY_SAVINGS_ACCT_SAVED,\n },\n\n /**\n * Designate Emergency Savings Account \"Open a Savings Account\": no handler. The op_1 post\n * message comes from `ctaPostMessages`; this step adds the Created event.\n */\n open_savings_account: {\n analytics: ANALYTICS_EVENTS_CONFIG.EMERGENCY_SAVINGS_ACCT_CREATED,\n },\n}\n"],"mappings":";;AASA,IAAM,IAAA,CAA4B,EAAE,MAAA,GAAM,QAAA,EAAA,MAAuD;AAC/F,QAAM,IAAS,EAAO,gBAAgB,YAAY,EAAK,IAAA,GAAO;AAE9D,MAAI,OAAO,KAAW;AAMtB,WAJe,EAAO,aAAa,uBAAuB,KAAA,CACvD,MAAY,EAAQ,SAAS,KAAU,CAAC,EAAQ,aAAa,CAAC,EAAQ,UAGlE,IAAS,IAAS;AAC3B,GAQa,IAAsC;AAAA,EAEjD,cAAc;AAAA,IACZ,KAAK;AAAA,IACL,QAAQ,EAAE,YAAY,EAAa,YAAY;AAAA,EACjD;AAAA,EAQA,wBAAwB;AAAA,IACtB,KAAK;AAAA,IACL,QAAA,CAAS,OAAS,EAChB,QAAQ,EAAE,gCAAgC,EAAyB,CAAG,EAAE,EAC1E;AAAA,IACA,cAAA,CAAe,MAAQ,CAAC,EAAyB,CAAG;AAAA,IACpD,WAAW,CAAC,aAAa;AAAA,IACzB,WAAW,EAAwB;AAAA,EACrC;AAAA,EAMA,sBAAsB,EACpB,WAAW,EAAwB,+BACrC;AACF"}
@@ -1,9 +1,9 @@
1
- import { AccountType as s } from "../../core/types/Account.es.js";
1
+ import { AccountType as u } from "../../core/types/Account.es.js";
2
2
  import { BEAT_OPERATION_1 as n, BEAT_OPERATION_2 as l } from "../../common/utils/PostMessage.es.js";
3
3
  var c = (a) => !a.is_hidden && !a.is_deleted && !a.is_closed, e = ({ beat: a, stores: t }) => a.primary_account ?? t.accountStore.accounts.find((o) => o.guid === a.primary_account_guid), d = ({ beat: a, stores: t }) => {
4
4
  const o = new Set(a.account_guids);
5
5
  return t.accountStore.accounts.filter((r) => o.has(r.guid) && c(r));
6
- }, _ = ({ stores: a }) => a.accountStore.accounts.filter((t) => t.account_type === s.SAVINGS && c(t)), i = { primary: () => ({ action: n }) }, g = {
6
+ }, _ = ({ stores: a }) => a.accountStore.accounts.filter((t) => t.account_type === u.SAVINGS && c(t)), i = { primary: () => ({ action: n }) }, p = {
7
7
  SaveAnExtra100Dollars: i,
8
8
  SaveAnExtra100DollarsV2: i,
9
9
  PaydayCashLeftOverStatus: { primary: () => ({ action: n }) },
@@ -16,7 +16,7 @@ var c = (a) => !a.is_hidden && !a.is_deleted && !a.is_closed, e = ({ beat: a, st
16
16
  } : null;
17
17
  } },
18
18
  MonthlyObligationsStatus: { primary: ({ beat: a }) => (a.payload?.total_remaining ?? 0) < 0 ? { action: n } : null },
19
- DesignateEmergencySavingsAccount: { primary: ({ beat: a }) => !a.payload?.emergency_savings_account_guid && !a.account_guids.length ? { action: n } : null },
19
+ DesignateEmergencySavingsAccount: { primary: ({ cta: a }) => a.action_key === "open_savings_account" ? { action: n } : null },
20
20
  ReplenishSavings: { primary: (a) => ({
21
21
  action: n,
22
22
  payload: {
@@ -38,17 +38,17 @@ var c = (a) => !a.is_hidden && !a.is_deleted && !a.is_closed, e = ({ beat: a, st
38
38
  action: n,
39
39
  payload: {
40
40
  ...r,
41
- destination_account_ids: o.map((u) => u.external_guid)
41
+ destination_account_ids: o.map((s) => s.external_guid)
42
42
  }
43
43
  } : {
44
44
  action: l,
45
45
  payload: r
46
46
  };
47
47
  } }
48
- }, y = (a) => a.cta.metadata ?? g[a.beat.template]?.[a.slot]?.(a) ?? null;
48
+ }, g = (a) => a.cta.metadata ?? p[a.beat.template]?.[a.slot]?.(a) ?? null;
49
49
  export {
50
- g as ctaPostMessages,
51
- y as resolveCtaMetadata
50
+ p as ctaPostMessages,
51
+ g as resolveCtaMetadata
52
52
  };
53
53
 
54
54
  //# sourceMappingURL=ctaPostMessages.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ctaPostMessages.es.js","names":[],"sources":["../../../src/insights-v2/ctaActions/ctaPostMessages.ts"],"sourcesContent":["import { BEAT_OPERATION_1, BEAT_OPERATION_2 } from '../../common/utils/PostMessage'\nimport { AccountType, type Account, type CtaPostMessageMetadata } from '../../core'\nimport type { CtaSlot, CtaStateContext } from './types'\n\n/**\n * Interim per-template post messages, carried over from the pulse beats, for CTAs the backend\n * does not yet describe with `cta.metadata`. Each resolver returns the same shape the backend\n * will send, or `null` for \"no message\" (the default then only opens the drawer for a block).\n * Backend `metadata` always wins, so entries become dead the moment tupac ships the key for\n * their template.\n *\n * Remove once every template here has `metadata` from the backend: delete this file, its test\n * and README section, and the `resolveCtaMetadata` call in `runCtaAction.ts`.\n */\nexport type CtaPostMessageResolver = (ctx: CtaStateContext) => CtaPostMessageMetadata | null\n\ntype BeatContext = Pick<CtaStateContext, 'beat' | 'stores'>\n\nconst isUsable = (account: Account) =>\n !account.is_hidden && !account.is_deleted && !account.is_closed\n\n/** The beat's primary account: from the beat when the host attached it, else the account store. */\nconst primaryAccountOf = ({ beat, stores }: BeatContext): Account | undefined =>\n beat.primary_account ??\n stores.accountStore.accounts.find((account) => account.guid === beat.primary_account_guid)\n\n/** The accounts the beat points at (`account_guids`), as loaded in the account store. */\nconst beatAccountsOf = ({ beat, stores }: BeatContext): Account[] => {\n const guids = new Set<string>(beat.account_guids)\n\n return stores.accountStore.accounts.filter(\n (account) => guids.has(account.guid) && isUsable(account),\n )\n}\n\nconst savingsAccountsOf = ({ stores }: BeatContext): Account[] =>\n stores.accountStore.accounts.filter(\n (account) => account.account_type === AccountType.SAVINGS && isUsable(account),\n )\n\n/** \"Make Transfer\": the base `beat/cta` op_1, nothing beat-specific. */\nconst saveAnExtra100Dollars: Partial<Record<CtaSlot, CtaPostMessageResolver>> = {\n primary: () => ({ action: BEAT_OPERATION_1 }),\n}\n\nexport const ctaPostMessages: Record<string, Partial<Record<CtaSlot, CtaPostMessageResolver>>> = {\n SaveAnExtra100Dollars: saveAnExtra100Dollars,\n /** The Insights 2.0 template: the same \"Make a Transfer\" op_1 as V1. */\n SaveAnExtra100DollarsV2: saveAnExtra100Dollars,\n\n /** \"Transfer to Savings\" / \"Transfer Funds\": the base `beat/cta` op_1 on both variants. */\n PaydayCashLeftOverStatus: {\n primary: () => ({ action: BEAT_OPERATION_1 }),\n },\n\n /**\n * \"Make a Transfer\" / \"View Emergency Savings\": both deep-link into online banking through the\n * base `beat/cta` op_1 (the label differs by variant, the action does not, as in V1). The\n * secondary \"View Transaction\" opens the transaction-details drilldown, not a post message.\n */\n EmergencyFundWithdrawal: {\n primary: () => ({ action: BEAT_OPERATION_1 }),\n },\n\n /** \"Transfer\": op_1 with the primary account's external id. No primary account → default. */\n LowAccountBalance: {\n primary: (ctx) => {\n const account = primaryAccountOf(ctx)\n\n return account\n ? { action: BEAT_OPERATION_1, payload: { account_guid: account.external_guid } }\n : null\n },\n },\n\n /** Posts only while off track (negative remaining); on track the CTA opens the drawer. */\n MonthlyObligationsStatus: {\n primary: ({ beat }) =>\n (beat.payload?.total_remaining ?? 0) < 0 ? { action: BEAT_OPERATION_1 } : null,\n },\n\n /**\n * \"Open savings account\": only when nothing is designated and there is no savings account to\n * pick from. The other states save the pick through an `action_key` (see `ctaConfig.ts`).\n */\n DesignateEmergencySavingsAccount: {\n primary: ({ beat }) =>\n !beat.payload?.emergency_savings_account_guid && !beat.account_guids.length\n ? { action: BEAT_OPERATION_1 }\n : null,\n },\n\n /** op_1 with the withdrawn total and the beat's accounts (external ids). */\n ReplenishSavings: {\n primary: (ctx) => ({\n action: BEAT_OPERATION_1,\n payload: {\n total_amount_withdrawn: ctx.beat.payload?.total_amount,\n accounts: beatAccountsOf(ctx).map((account) => ({\n account_guid: account.external_guid,\n account_name: ctx.beat.payload?.account_name?.default,\n })),\n },\n }),\n },\n\n /** op_1 = transfer into the user's savings accounts; op_2 = open one when there are none. */\n SavingsOpportunityV2: {\n primary: (ctx) => {\n const source = primaryAccountOf(ctx)\n\n if (!source) return null\n\n const savings = savingsAccountsOf(ctx)\n const payload = {\n amount: ctx.beat.payload?.suggested_savings_amount,\n source_account_id: source.external_guid,\n }\n\n return savings.length\n ? {\n action: BEAT_OPERATION_1,\n payload: {\n ...payload,\n destination_account_ids: savings.map((account) => account.external_guid),\n },\n }\n : { action: BEAT_OPERATION_2, payload }\n },\n },\n}\n\n/** Backend `cta.metadata` first, else this template's interim resolver for the slot, else null. */\n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,EAAiB,IAAI,KAC9E;AAAA,EAMA,kCAAkC,EAChC,SAAA,CAAU,EAAE,MAAA,EAAA,MACV,CAAC,EAAK,SAAS,kCAAkC,CAAC,EAAK,cAAc,SACjE,EAAE,QAAQ,EAAiB,IAC3B,KACR;AAAA,EAGA,kBAAkB,EAChB,SAAA,CAAU,OAAS;AAAA,IACjB,QAAQ;AAAA,IACR,SAAS;AAAA,MACP,wBAAwB,EAAI,KAAK,SAAS;AAAA,MAC1C,UAAU,EAAe,CAAG,EAAE,IAAA,CAAK,OAAa;AAAA,QAC9C,cAAc,EAAQ;AAAA,QACtB,cAAc,EAAI,KAAK,SAAS,cAAc;AAAA,MAChD,EAAE;AAAA,IACJ;AAAA,EACF,GACF;AAAA,EAGA,sBAAsB,EACpB,SAAA,CAAU,MAAQ;AAChB,UAAM,IAAS,EAAiB,CAAG;AAEnC,QAAI,CAAC,EAAQ,QAAO;AAEpB,UAAM,IAAU,EAAkB,CAAG,GAC/B,IAAU;AAAA,MACd,QAAQ,EAAI,KAAK,SAAS;AAAA,MAC1B,mBAAmB,EAAO;AAAA,IAC5B;AAEA,WAAO,EAAQ,SACX;AAAA,MACE,QAAQ;AAAA,MACR,SAAS;AAAA,QACP,GAAG;AAAA,QACH,yBAAyB,EAAQ,IAAA,CAAK,MAAY,EAAQ,aAAa;AAAA,MACzE;AAAA,IACF,IACA;AAAA,MAAE,QAAQ;AAAA,MAAkB,SAAA;AAAA,IAAQ;AAAA,EAC1C,EACF;AACF,GAGa,IAAA,CAAsB,MACjC,EAAI,IAAI,YAAY,EAAgB,EAAI,KAAK,QAAA,IAAY,EAAI,IAAA,IAAQ,CAAG,KAAK"}
1
+ {"version":3,"file":"ctaPostMessages.es.js","names":[],"sources":["../../../src/insights-v2/ctaActions/ctaPostMessages.ts"],"sourcesContent":["import { BEAT_OPERATION_1, BEAT_OPERATION_2 } from '../../common/utils/PostMessage'\nimport { AccountType, type Account, type CtaPostMessageMetadata } from '../../core'\nimport type { CtaSlot, CtaStateContext } from './types'\n\n/**\n * Interim per-template post messages, carried over from the pulse beats, for CTAs the backend\n * does not yet describe with `cta.metadata`. Each resolver returns the same shape the backend\n * will send, or `null` for \"no message\" (the default then only opens the drawer for a block).\n * Backend `metadata` always wins, so entries become dead the moment tupac ships the key for\n * their template.\n *\n * Remove once every template here has `metadata` from the backend: delete this file, its test\n * and README section, and the `resolveCtaMetadata` call in `runCtaAction.ts`.\n */\nexport type CtaPostMessageResolver = (ctx: CtaStateContext) => CtaPostMessageMetadata | null\n\ntype BeatContext = Pick<CtaStateContext, 'beat' | 'stores'>\n\nconst isUsable = (account: Account) =>\n !account.is_hidden && !account.is_deleted && !account.is_closed\n\n/** The beat's primary account: from the beat when the host attached it, else the account store. */\nconst primaryAccountOf = ({ beat, stores }: BeatContext): Account | undefined =>\n beat.primary_account ??\n stores.accountStore.accounts.find((account) => account.guid === beat.primary_account_guid)\n\n/** The accounts the beat points at (`account_guids`), as loaded in the account store. */\nconst beatAccountsOf = ({ beat, stores }: BeatContext): Account[] => {\n const guids = new Set<string>(beat.account_guids)\n\n return stores.accountStore.accounts.filter(\n (account) => guids.has(account.guid) && isUsable(account),\n )\n}\n\nconst savingsAccountsOf = ({ stores }: BeatContext): Account[] =>\n stores.accountStore.accounts.filter(\n (account) => account.account_type === AccountType.SAVINGS && isUsable(account),\n )\n\n/** \"Make Transfer\": the base `beat/cta` op_1, nothing beat-specific. */\nconst saveAnExtra100Dollars: Partial<Record<CtaSlot, CtaPostMessageResolver>> = {\n primary: () => ({ action: BEAT_OPERATION_1 }),\n}\n\nexport const ctaPostMessages: Record<string, Partial<Record<CtaSlot, CtaPostMessageResolver>>> = {\n SaveAnExtra100Dollars: saveAnExtra100Dollars,\n /** The Insights 2.0 template: the same \"Make a Transfer\" op_1 as V1. */\n SaveAnExtra100DollarsV2: saveAnExtra100Dollars,\n\n /** \"Transfer to Savings\" / \"Transfer Funds\": the base `beat/cta` op_1 on both variants. */\n PaydayCashLeftOverStatus: {\n primary: () => ({ action: BEAT_OPERATION_1 }),\n },\n\n /**\n * \"Make a Transfer\" / \"View Emergency Savings\": both deep-link into online banking through the\n * base `beat/cta` op_1 (the label differs by variant, the action does not, as in V1). The\n * secondary \"View Transaction\" opens the transaction-details drilldown, not a post message.\n */\n EmergencyFundWithdrawal: {\n primary: () => ({ action: BEAT_OPERATION_1 }),\n },\n\n /** \"Transfer\": op_1 with the primary account's external id. No primary account → default. */\n LowAccountBalance: {\n primary: (ctx) => {\n const account = primaryAccountOf(ctx)\n\n return account\n ? { action: BEAT_OPERATION_1, payload: { account_guid: account.external_guid } }\n : null\n },\n },\n\n /** Posts only while off track (negative remaining); on track the CTA opens the drawer. */\n MonthlyObligationsStatus: {\n primary: ({ beat }) =>\n (beat.payload?.total_remaining ?? 0) < 0 ? { action: BEAT_OPERATION_1 } : null,\n },\n\n /**\n * \"Open a Savings Account\": op_1 for the open_savings_account press only. The backend names that\n * key on the open_account state (no designation and no savings account — pulse's legacy branch),\n * so the frontend repeats no data rule and it holds on every widget. \"Save\"\n * (select_savings_account) saves the pick through ctaConfig instead; the saved state has no press.\n */\n DesignateEmergencySavingsAccount: {\n primary: ({ cta }) =>\n cta.action_key === 'open_savings_account' ? { action: BEAT_OPERATION_1 } : null,\n },\n\n /** op_1 with the withdrawn total and the beat's accounts (external ids). */\n ReplenishSavings: {\n primary: (ctx) => ({\n action: BEAT_OPERATION_1,\n payload: {\n total_amount_withdrawn: ctx.beat.payload?.total_amount,\n accounts: beatAccountsOf(ctx).map((account) => ({\n account_guid: account.external_guid,\n account_name: ctx.beat.payload?.account_name?.default,\n })),\n },\n }),\n },\n\n /** op_1 = transfer into the user's savings accounts; op_2 = open one when there are none. */\n SavingsOpportunityV2: {\n primary: (ctx) => {\n const source = primaryAccountOf(ctx)\n\n if (!source) return null\n\n const savings = savingsAccountsOf(ctx)\n const payload = {\n amount: ctx.beat.payload?.suggested_savings_amount,\n source_account_id: source.external_guid,\n }\n\n return savings.length\n ? {\n action: BEAT_OPERATION_1,\n payload: {\n ...payload,\n destination_account_ids: savings.map((account) => account.external_guid),\n },\n }\n : { action: BEAT_OPERATION_2, payload }\n },\n },\n}\n\n/** Backend `cta.metadata` first, else this template's interim resolver for the slot, else null. */\nexport const resolveCtaMetadata = (ctx: CtaStateContext): CtaPostMessageMetadata | null =>\n ctx.cta.metadata ?? ctaPostMessages[ctx.beat.template]?.[ctx.slot]?.(ctx) ?? null\n"],"mappings":";;AAkBA,IAAM,IAAA,CAAY,MAChB,CAAC,EAAQ,aAAa,CAAC,EAAQ,cAAc,CAAC,EAAQ,WAGlD,IAAA,CAAoB,EAAE,MAAA,GAAM,QAAA,EAAA,MAChC,EAAK,mBACL,EAAO,aAAa,SAAS,KAAA,CAAM,MAAY,EAAQ,SAAS,EAAK,oBAAoB,GAGrF,IAAA,CAAkB,EAAE,MAAA,GAAM,QAAA,EAAA,MAAqC;AACnE,QAAM,IAAQ,IAAI,IAAY,EAAK,aAAa;AAEhD,SAAO,EAAO,aAAa,SAAS,OAAA,CACjC,MAAY,EAAM,IAAI,EAAQ,IAAI,KAAK,EAAS,CAAO,CAC1D;AACF,GAEM,IAAA,CAAqB,EAAE,QAAA,EAAA,MAC3B,EAAO,aAAa,SAAS,OAAA,CAC1B,MAAY,EAAQ,iBAAiB,EAAY,WAAW,EAAS,CAAO,CAC/E,GAGI,IAA0E,EAC9E,SAAA,OAAgB,EAAE,QAAQ,EAAiB,GAC7C,GAEa,IAAoF;AAAA,EAC/F,uBAAuB;AAAA,EAEvB,yBAAyB;AAAA,EAGzB,0BAA0B,EACxB,SAAA,OAAgB,EAAE,QAAQ,EAAiB,GAC7C;AAAA,EAOA,yBAAyB,EACvB,SAAA,OAAgB,EAAE,QAAQ,EAAiB,GAC7C;AAAA,EAGA,mBAAmB,EACjB,SAAA,CAAU,MAAQ;AAChB,UAAM,IAAU,EAAiB,CAAG;AAEpC,WAAO,IACH;AAAA,MAAE,QAAQ;AAAA,MAAkB,SAAS,EAAE,cAAc,EAAQ,cAAc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