@mx-cartographer/experiences 9.7.116 → 9.7.118

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 (72) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/common/components/drawer/Drawer.d.ts +3 -0
  3. package/dist/common/components/drawer/Drawer.es.js +30 -29
  4. package/dist/common/components/drawer/Drawer.es.js.map +1 -1
  5. package/dist/common/components/drawer/Header.d.ts +3 -0
  6. package/dist/common/components/drawer/Header.es.js +51 -45
  7. package/dist/common/components/drawer/Header.es.js.map +1 -1
  8. package/dist/core/stores/InsightsV2Store.d.ts +10 -0
  9. package/dist/core/stores/InsightsV2Store.es.js +15 -7
  10. package/dist/core/stores/InsightsV2Store.es.js.map +1 -1
  11. package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js +44 -33
  12. package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js.map +1 -1
  13. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.d.ts +1 -9
  14. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js +96 -83
  15. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js.map +1 -1
  16. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/CreateBudgetDialog.d.ts +5 -0
  17. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/CreateBudgetDialog.es.js +62 -0
  18. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/CreateBudgetDialog.es.js.map +1 -0
  19. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/layout.es.js.map +1 -1
  20. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js +212 -145
  21. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js.map +1 -1
  22. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetSummary.d.ts +3 -1
  23. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetSummary.es.js +36 -36
  24. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetSummary.es.js.map +1 -1
  25. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.d.ts +32 -2
  26. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.es.js +68 -22
  27. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.es.js.map +1 -1
  28. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/useBudgetDetailsPrepare.d.ts +3 -0
  29. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/useBudgetDetailsPrepare.es.js +34 -0
  30. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/useBudgetDetailsPrepare.es.js.map +1 -0
  31. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +81 -78
  32. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
  33. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +11 -8
  34. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +116 -91
  35. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
  36. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js +3 -3
  37. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +2 -0
  38. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
  39. package/dist/insights-v2/actionBlocks/util.d.ts +2 -11
  40. package/dist/insights-v2/actionBlocks/util.es.js +16 -6
  41. package/dist/insights-v2/actionBlocks/util.es.js.map +1 -1
  42. package/dist/insights-v2/analytics/analyticsEventsConfig.d.ts +16 -0
  43. package/dist/insights-v2/analytics/analyticsEventsConfig.es.js +19 -2
  44. package/dist/insights-v2/analytics/analyticsEventsConfig.es.js.map +1 -1
  45. package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js +8 -8
  46. package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js.map +1 -1
  47. package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/utils.d.ts +1 -1
  48. package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/utils.es.js +28 -27
  49. package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/utils.es.js.map +1 -1
  50. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.d.ts +1 -7
  51. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js +8 -10
  52. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js.map +1 -1
  53. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.d.ts +13 -17
  54. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.es.js +16 -11
  55. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.es.js.map +1 -1
  56. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/utils.d.ts +6 -2
  57. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/utils.es.js +7 -6
  58. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/utils.es.js.map +1 -1
  59. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js +14 -14
  60. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.es.js +4 -4
  61. package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js +1 -1
  62. package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js +4 -4
  63. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js +4 -4
  64. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js +4 -4
  65. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +10 -10
  66. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js +4 -4
  67. package/dist/insights-v2/components/BaseLayout.es.js +137 -118
  68. package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
  69. package/dist/insights-v2/mappings/blocks.d.ts +1 -0
  70. package/dist/insights-v2/mappings/blocks.es.js +131 -121
  71. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  72. package/package.json +1 -1
@@ -1,35 +1,36 @@
1
- import { useAppConfig as to, useGlobalCopyStore as eo, useGlobalStore as no, useInsightsV2Store as ro } from "../../common/context/hooks.es.js";
2
- import { sendClientConfiguredCta as so } from "../../common/utils/PostMessage.es.js";
3
- import { BeatActionsProvider as ao } from "../beatActions.es.js";
4
- import { isContactSupportCtaDisabled as lo } from "../actionBlocks/ContactSupportActionBlock.es.js";
5
- import { CtaStatus as co } from "./CtaStatus.es.js";
6
- import { HOST_ACTIONS as po } from "../ctaActions/hostActions.es.js";
7
- import { reportCtaClick as mo } from "../ctaActions/runCtaAction.es.js";
8
- import { useBeatCtaActions as uo } from "../ctaActions/useCtaAction.es.js";
9
- import { actionBlocksKey as fo } from "../mappings/actionBlocksKey.es.js";
10
- import { logoFromRef as Co } from "./shared/EntityLogo.es.js";
11
- import ho from "./FeedbackDialog.es.js";
12
- import { ErrorCard as go } from "./ErrorCard.es.js";
13
- import { blocks as bo } from "../mappings/blocks.es.js";
14
- import { ActionBlockLayer as _o } from "../actionBlocks/ActionBlockLayer.es.js";
15
- import ko from "./Footer.es.js";
16
- import yo from "./Header.es.js";
17
- import { FeedbackBar as vo } from "./FeedbackBar.es.js";
18
- import { DismissInsightDialog as xo } from "./DismissInsightDialog.es.js";
19
- import { HiddenConfirmationCard as So } from "./HiddenConfirmationCard.es.js";
20
- import { LoadingCard as To } from "./LoadingCard.es.js";
1
+ import { useAppConfig as no, useGlobalCopyStore as ro, useGlobalStore as so, useInsightsV2Store as ao } from "../../common/context/hooks.es.js";
2
+ import { BEAT_ACTIVE_AT_KEY as lo } from "../../core/stores/InsightsV2Store.es.js";
3
+ import { sendClientConfiguredCta as co } from "../../common/utils/PostMessage.es.js";
4
+ import { BeatActionsProvider as mo } from "../beatActions.es.js";
5
+ import { isContactSupportCtaDisabled as po } from "../actionBlocks/ContactSupportActionBlock.es.js";
6
+ import { CtaStatus as uo } from "./CtaStatus.es.js";
7
+ import { HOST_ACTIONS as fo } from "../ctaActions/hostActions.es.js";
8
+ import { reportCtaClick as Co } from "../ctaActions/runCtaAction.es.js";
9
+ import { useBeatCtaActions as go } from "../ctaActions/useCtaAction.es.js";
10
+ import { actionBlocksKey as ho } from "../mappings/actionBlocksKey.es.js";
11
+ import { logoFromRef as bo } from "./shared/EntityLogo.es.js";
12
+ import _o from "./FeedbackDialog.es.js";
13
+ import { ErrorCard as yo } from "./ErrorCard.es.js";
14
+ import { blocks as ko } from "../mappings/blocks.es.js";
15
+ import { ActionBlockLayer as vo } from "../actionBlocks/ActionBlockLayer.es.js";
16
+ import xo from "./Footer.es.js";
17
+ import So from "./Header.es.js";
18
+ import { FeedbackBar as Ao } from "./FeedbackBar.es.js";
19
+ import { DismissInsightDialog as To } from "./DismissInsightDialog.es.js";
20
+ import { HiddenConfirmationCard as wo } from "./HiddenConfirmationCard.es.js";
21
+ import { LoadingCard as Bo } from "./LoadingCard.es.js";
21
22
  import { ObsolesceBanner as Lo } from "./ObsolesceBanner.es.js";
22
- import { useBeatFeedbackFlow as wo } from "../hooks/useBeatFeedbackFlow.es.js";
23
- import { useMemo as Ao } from "react";
24
- import { observer as Bo } from "mobx-react-lite";
25
- import x from "@mui/material/Stack";
26
- import { P as Do } from "@mxenabled/mxui";
23
+ import { useBeatFeedbackFlow as Do } from "../hooks/useBeatFeedbackFlow.es.js";
24
+ import { useEffect as Oo, useMemo as Io } from "react";
25
+ import { observer as Eo } from "mobx-react-lite";
26
+ import T from "@mui/material/Stack";
27
+ import { P as Fo } from "@mxenabled/mxui";
27
28
  import f from "@mui/material/Button";
28
- import { ChevronRight as I } from "@mxenabled/mx-icons";
29
- import { Fragment as Oo, jsx as i, jsxs as C } from "react/jsx-runtime";
30
- import Io from "@mui/material/Box";
31
- import Fo from "@mui/material/Card";
32
- var Eo = {}, Ho = {
29
+ import { ChevronRight as H } from "@mxenabled/mx-icons";
30
+ import { Fragment as Ho, jsx as t, jsxs as C } from "react/jsx-runtime";
31
+ import Po from "@mui/material/Box";
32
+ import Mo from "@mui/material/Card";
33
+ var No = {}, Ro = {
33
34
  position: "absolute",
34
35
  top: 0,
35
36
  left: 0,
@@ -38,7 +39,7 @@ var Eo = {}, Ho = {
38
39
  backgroundColor: "background.default",
39
40
  opacity: 0.7,
40
41
  zIndex: 3
41
- }, S = {
42
+ }, w = {
42
43
  alignSelf: "flex-start",
43
44
  fontSize: 13,
44
45
  fontWeight: 600,
@@ -50,12 +51,12 @@ var Eo = {}, Ho = {
50
51
  px: 0,
51
52
  py: 4,
52
53
  textAlign: "left"
53
- }, Po = {
54
- ...S,
54
+ }, Go = {
55
+ ...w,
55
56
  alignItems: "center",
56
57
  display: "flex",
57
58
  textTransform: "none"
58
- }, Mo = {
59
+ }, Wo = {
59
60
  color: "text.secondary",
60
61
  fontSize: 13,
61
62
  fontWeight: 600,
@@ -65,162 +66,180 @@ var Eo = {}, Ho = {
65
66
  px: 16,
66
67
  py: 12,
67
68
  "&.Mui-disabled": { color: "text.disabled" }
68
- }, Ci = Bo(({ beat: t, beatActions: l = Eo, obsolete: g, isLoading: F = !1, isError: E = !1 }) => {
69
- const H = eo(), P = ro(), { config: M } = to(), o = wo(t, l), b = no(), { runCta: N, primary: _, secondary: T, linkPresentation: R } = uo(t, l, t.insights_payload?.primary_cta ?? void 0, t.insights_payload?.secondary_cta ?? void 0, t.insights_payload?.in_description_cta ?? void 0), c = t.insights_payload?.widget_type === "mini", W = Ao(() => ({
69
+ }, yt = Eo(({ beat: i, beatActions: c = No, obsolete: b, isLoading: P = !1, isError: M = !1 }) => {
70
+ const N = ro(), _ = ao(), { config: R } = no(), o = Do(i, c), y = so(), { runCta: G, primary: k, secondary: B, linkPresentation: W } = go(i, c, i.insights_payload?.primary_cta ?? void 0, i.insights_payload?.secondary_cta ?? void 0, i.insights_payload?.in_description_cta ?? void 0), l = i.insights_payload?.widget_type === "mini", g = i.active_at ?? i.insights_payload?.active_at;
71
+ Oo(() => {
72
+ g == null || g === "" || _.setBeatContext(i.guid, { [lo]: g });
73
+ }, [
74
+ g,
75
+ i.guid,
76
+ _
77
+ ]);
78
+ const V = Io(() => ({
70
79
  ...o.wrappedActions,
71
- beat: t
72
- }), [o.wrappedActions, t]);
73
- if (E) return /* @__PURE__ */ i(go, {});
74
- const e = t.insights_payload;
80
+ beat: i
81
+ }), [o.wrappedActions, i]);
82
+ if (M) return /* @__PURE__ */ t(yo, {});
83
+ const e = i.insights_payload;
75
84
  if (!e || o.cardState === "dismissed") return null;
76
- const { instance_slot: G, primary_cta: r, secondary_cta: d, sub_title: X, title: z, guid: L, dismissed_at: V } = e, { block: j } = G, K = X ?? (e.subtitle ? {
77
- logo: Co(e.logo),
85
+ const { instance_slot: X, primary_cta: r, secondary_cta: d, sub_title: z, title: K, guid: L, dismissed_at: j } = e, { block: U } = X, Y = z ?? (e.subtitle ? {
86
+ logo: bo(e.logo),
78
87
  text: e.subtitle
79
- } : void 0), p = (s) => lo(s, M, l.onContactSupport), w = async (s, a) => {
80
- if (!p(a.block)) {
81
- if (a.block === fo.CONTACT_SUPPORT_ACTION_BLOCK) {
82
- mo({
83
- beat: t,
84
- stores: b,
85
- hostActions: l,
88
+ } : void 0), m = (s) => po(s, R, c.onContactSupport), D = async (s, a) => {
89
+ if (!m(a.block)) {
90
+ if (a.block === ho.CONTACT_SUPPORT_ACTION_BLOCK) {
91
+ Co({
92
+ beat: i,
93
+ stores: y,
94
+ hostActions: c,
86
95
  slot: s
87
- }), l.onContactSupport?.();
96
+ }), c.onContactSupport?.();
88
97
  return;
89
98
  }
90
- await N(s, a);
99
+ await G(s, a);
91
100
  }
92
- }, A = bo[j], m = e.in_description_cta, k = !c && m?.label && m.block ? m : void 0, U = r?.label || (k ? void 0 : m?.label) || void 0, u = !c && !!r?.label, B = t.in_description_cta || t.html_in_description_cta, Y = () => {
93
- const { is_mobile_webview: s, clientConfig: a } = b.appDataStore.appConfig;
94
- so(t.template, {
101
+ }, O = ko[U], p = e.in_description_cta, v = !l && p?.label && p.block ? p : void 0, $ = r?.label || (v ? void 0 : p?.label) || void 0, u = !l && !!r?.label, I = i.in_description_cta || i.html_in_description_cta, q = () => {
102
+ const { is_mobile_webview: s, clientConfig: a } = y.appDataStore.appConfig;
103
+ co(i.template, {
95
104
  isMobileWebview: s,
96
105
  webviewScheme: a?.master?.ui_message_webview_url_scheme,
97
- userGuid: e.user_guid ?? t.user_guid
106
+ userGuid: e.user_guid ?? i.user_guid
98
107
  });
99
- }, n = u ? _.presentation : void 0, $ = n?.kind === "hidden" && !!n.hideAll, D = !c && !!d?.label && !$, h = c ? R : void 0, q = h?.kind === "status" ? h : void 0, O = h ? q?.action?.label : U, J = h?.title || z || "", Q = !!O && !u, Z = u && n?.kind !== "hidden" || D, oo = (s) => {
100
- const { onCtaAction: a } = l;
108
+ }, n = u ? k.presentation : void 0, J = n?.kind === "hidden" && !!n.hideAll, E = !l && !!d?.label && !J, h = l ? W : void 0, Q = h?.kind === "status" ? h : void 0, F = h ? Q?.action?.label : $, Z = h?.title || K || "", oo = !!F && !u, to = u && n?.kind !== "hidden" || E, io = (s) => {
109
+ const { onCtaAction: a } = c;
101
110
  a && (s.stopPropagation(), Promise.resolve().then(() => a({
102
- beatGuid: t.guid,
103
- name: po.cardClick
104
- })).catch((io) => b.captureException(io, {
111
+ beatGuid: i.guid,
112
+ name: fo.cardClick
113
+ })).catch((eo) => y.captureException(eo, {
105
114
  store: "BaseLayout",
106
- template: t.template,
115
+ template: i.template,
107
116
  handler: "cardClick"
108
117
  })));
109
- }, y = H.insights_feed?.general, v = g?.state === "not_refreshable" && !V && !!y;
110
- return /* @__PURE__ */ i(ao, {
111
- value: W,
112
- children: /* @__PURE__ */ C(x, {
118
+ }, x = l, S = N.insights_feed?.general, A = b?.state === "not_refreshable" && !j && !!S;
119
+ return /* @__PURE__ */ t(mo, {
120
+ value: V,
121
+ children: /* @__PURE__ */ C(T, {
113
122
  sx: { mb: 16 },
114
123
  children: [
115
- o.cardState === "confirming" ? /* @__PURE__ */ i(So, {
124
+ o.cardState === "confirming" ? /* @__PURE__ */ t(wo, {
116
125
  onClose: o.collapseConfirmation,
117
126
  onLeaveFeedback: o.openHideSurvey,
118
127
  onUndo: o.undoDismiss
119
- }) : /* @__PURE__ */ C(Oo, { children: [g && y && /* @__PURE__ */ i(Lo, {
120
- ...g,
121
- copy: y
122
- }), /* @__PURE__ */ C(Fo, {
123
- inert: v,
124
- sx: { ...v && {
125
- position: "relative",
126
- zIndex: 2,
127
- pointerEvents: "none"
128
- } },
128
+ }) : /* @__PURE__ */ C(Ho, { children: [b && S && /* @__PURE__ */ t(Lo, {
129
+ ...b,
130
+ copy: S
131
+ }), /* @__PURE__ */ C(Mo, {
132
+ inert: A,
133
+ sx: {
134
+ ...x && {
135
+ display: "flex",
136
+ flexDirection: "column"
137
+ },
138
+ ...A && {
139
+ position: "relative",
140
+ zIndex: 2,
141
+ pointerEvents: "none"
142
+ }
143
+ },
129
144
  children: [
130
- v && /* @__PURE__ */ i(Io, { sx: Ho }),
131
- /* @__PURE__ */ i(yo, {
132
- isMini: c,
133
- subtitle: K,
134
- title: J
145
+ A && /* @__PURE__ */ t(Po, { sx: Ro }),
146
+ /* @__PURE__ */ t(So, {
147
+ isMini: l,
148
+ subtitle: Y,
149
+ title: Z
135
150
  }),
136
- F ? /* @__PURE__ */ i(To, {}) : A && /* @__PURE__ */ i(A, {
151
+ P ? /* @__PURE__ */ t(Bo, {}) : O && /* @__PURE__ */ t(O, {
137
152
  beatGuid: L,
138
153
  payload: e
139
154
  }),
140
- /* @__PURE__ */ C(x, {
155
+ /* @__PURE__ */ C(T, {
141
156
  sx: {
142
157
  gap: 6,
143
158
  pb: 16,
144
159
  pt: 12,
145
- px: 16
160
+ px: 16,
161
+ ...x && { flexGrow: 1 }
146
162
  },
147
163
  children: [
148
- /* @__PURE__ */ i(Do, {
164
+ /* @__PURE__ */ t(Fo, {
149
165
  dangerouslySetInnerHTML: { __html: e.description.html_text },
150
166
  sx: { fontWeight: "fontWeightRegular" },
151
167
  variant: "subtitle2"
152
168
  }),
153
- k && /* @__PURE__ */ i(f, {
154
- endIcon: /* @__PURE__ */ i(I, {}),
155
- onClick: () => P.openActionDrawer({
169
+ v && /* @__PURE__ */ t(f, {
170
+ endIcon: /* @__PURE__ */ t(H, {}),
171
+ onClick: () => _.openActionDrawer({
156
172
  guid: L,
157
173
  trigger: "inDescriptionCta"
158
174
  }),
159
- sx: S,
160
- children: k.label
175
+ sx: w,
176
+ children: v.label
161
177
  }),
162
- Q && /* @__PURE__ */ i(f, {
163
- onClick: c ? oo : void 0,
164
- sx: Po,
178
+ oo && /* @__PURE__ */ t(f, {
179
+ onClick: l ? io : void 0,
180
+ sx: {
181
+ ...Go,
182
+ ...x && { mt: "auto" }
183
+ },
165
184
  variant: "text",
166
- children: O
185
+ children: F
167
186
  }),
168
- !m?.label && B && /* @__PURE__ */ i(f, {
169
- endIcon: /* @__PURE__ */ i(I, {}),
170
- onClick: Y,
171
- sx: S,
172
- children: B
187
+ !p?.label && I && /* @__PURE__ */ t(f, {
188
+ endIcon: /* @__PURE__ */ t(H, {}),
189
+ onClick: q,
190
+ sx: w,
191
+ children: I
173
192
  })
174
193
  ]
175
194
  }),
176
- Z && /* @__PURE__ */ C(x, {
195
+ to && /* @__PURE__ */ C(T, {
177
196
  sx: {
178
197
  gap: 8,
179
198
  pb: 16,
180
199
  px: 16
181
200
  },
182
201
  children: [
183
- u && r && n?.kind === "status" && /* @__PURE__ */ i(co, {
202
+ u && r && n?.kind === "status" && /* @__PURE__ */ t(uo, {
184
203
  action: n.action,
185
204
  sx: n.sx,
186
205
  icon: n.icon,
187
206
  label: n.label,
188
207
  tone: n.tone
189
208
  }),
190
- u && r && !n && /* @__PURE__ */ i(f, {
191
- "aria-disabled": p(r.block) || _.disabled,
192
- disabled: _.disabled,
193
- onClick: () => w("primary", r),
194
- sx: { ...p(r.block) && { color: "text.disabled" } },
209
+ u && r && !n && /* @__PURE__ */ t(f, {
210
+ "aria-disabled": m(r.block) || k.disabled,
211
+ disabled: k.disabled,
212
+ onClick: () => D("primary", r),
213
+ sx: { ...m(r.block) && { color: "text.disabled" } },
195
214
  variant: "outlined",
196
215
  children: r.label
197
216
  }),
198
- D && d && /* @__PURE__ */ i(f, {
199
- "aria-disabled": p(d.block) || T.disabled,
217
+ E && d && /* @__PURE__ */ t(f, {
218
+ "aria-disabled": m(d.block) || B.disabled,
200
219
  color: "inherit",
201
- disabled: T.disabled,
202
- onClick: () => w("secondary", d),
220
+ disabled: B.disabled,
221
+ onClick: () => D("secondary", d),
203
222
  sx: {
204
- ...Mo,
205
- ...p(d.block) && { color: "text.disabled" }
223
+ ...Wo,
224
+ ...m(d.block) && { color: "text.disabled" }
206
225
  },
207
226
  children: d.label
208
227
  })
209
228
  ]
210
229
  }),
211
- /* @__PURE__ */ i(vo, {
230
+ /* @__PURE__ */ t(Ao, {
212
231
  onTellUsMore: o.openRatingSurvey,
213
232
  show: o.isFeedbackBarShown
214
233
  })
215
234
  ]
216
235
  })] }),
217
- /* @__PURE__ */ i(_o, { beat: t }),
218
- /* @__PURE__ */ i(xo, {
236
+ /* @__PURE__ */ t(vo, { beat: i }),
237
+ /* @__PURE__ */ t(To, {
219
238
  isOpen: o.isDismissOpen,
220
239
  onClose: o.closeDismissDialog,
221
240
  onDismiss: o.confirmDismiss
222
241
  }),
223
- o.isSurveyOpen && /* @__PURE__ */ i(ho, {
242
+ o.isSurveyOpen && /* @__PURE__ */ t(_o, {
224
243
  characterLimitLabel: o.survey.characterLimitLabel,
225
244
  closeAriaLabel: o.survey.closeAriaLabel,
226
245
  isOpen: !0,
@@ -233,13 +252,13 @@ var Eo = {}, Ho = {
233
252
  secondaryText: o.survey.backText,
234
253
  title: o.survey.title
235
254
  }),
236
- o.cardState === "visible" && e.footer && /* @__PURE__ */ i(ko, { footer: e.footer })
255
+ o.cardState === "visible" && e.footer && /* @__PURE__ */ t(xo, { footer: e.footer })
237
256
  ]
238
257
  })
239
258
  });
240
259
  });
241
260
  export {
242
- Ci as default
261
+ yt as default
243
262
  };
244
263
 
245
264
  //# sourceMappingURL=BaseLayout.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { type MouseEvent, useMemo } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { ChevronRight } from '@mxenabled/mx-icons'\nimport { P } from '@mxenabled/mxui'\n\nimport { blocks } from '../mappings/blocks'\nimport { actionBlocksKey } from '../mappings/actionBlocksKey'\nimport { isContactSupportCtaDisabled } from '../actionBlocks/ContactSupportActionBlock'\nimport { logoFromRef } from './shared/EntityLogo'\n\nimport Footer from './Footer'\nimport Header from './Header'\nimport FeedbackBar from './FeedbackBar'\nimport FeedbackDialog from './FeedbackDialog'\nimport DismissInsightDialog from './DismissInsightDialog'\nimport HiddenConfirmationCard from './HiddenConfirmationCard'\nimport ErrorCard from './ErrorCard'\nimport LoadingCard from './LoadingCard'\nimport { ObsolesceBanner, type ObsolesceBannerState } from './ObsolesceBanner'\nimport { useAppConfig, useGlobalCopyStore, useGlobalStore, useInsightsV2Store } from '../../common'\nimport { sendClientConfiguredCta } from '../../common/utils/PostMessage'\nimport type { Beat, PrimaryCTA, SecondaryCTA } from '../../core'\nimport { BeatActionsProvider, type BeatActions } from '../beatActions'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { HOST_ACTIONS, reportCtaClick, useBeatCtaActions } from '../ctaActions'\nimport { CtaStatus } from './CtaStatus'\nimport { useBeatFeedbackFlow } from '../hooks/useBeatFeedbackFlow'\n\nexport interface ObsoleteState {\n state: ObsolesceBannerState\n onRefresh: () => void\n onDismiss: () => void\n}\n\ninterface BaseLayoutProps {\n beat: Beat\n beatActions?: BeatActions\n obsolete?: ObsoleteState\n /** Swap only the block slot for a LoadingCard (e.g. while a sampled beat loads). */\n isLoading?: boolean\n /** Replace the entire card with an ErrorCard (e.g. when the sample fails to load). */\n isError?: boolean\n}\n\nconst NO_BEAT_ACTIONS: BeatActions = {}\n\nconst OBSOLETE_OVERLAY_SX = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n backgroundColor: 'background.default',\n opacity: 0.7,\n // Above every block's own z-index (hero card 1, AccountBlock 2), or that section shows through.\n zIndex: 3,\n} as const\n\n// Figma's 24px text link: 13/16 semibold, 16px line plus 4px above and below, its text starting at the\n// card's 16px inset. A minimum height, not the theme's fixed 44px Button height, so a long or translated\n// label wraps instead of overflowing; MUI's 64px minimum width and centring are undone for the same inset.\n// The in-description links use it as is, with the Button's 20px chevron, so they are 28px tall, as in\n// Figma's Low Account Balance full card (node 438:27877); the 24px is the mini CTA's, which has no icon.\nconst TEXT_LINK_SX = {\n alignSelf: 'flex-start',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n justifyContent: 'flex-start',\n lineHeight: '16px',\n minHeight: 24,\n minWidth: 0,\n px: 0,\n py: 4,\n textAlign: 'left',\n} as const\n\n// Mini CTA label, which fits Pulse's 312px mini slide as a text link.\nconst MINI_CTA_SX = {\n ...TEXT_LINK_SX,\n alignItems: 'center',\n display: 'flex',\n textTransform: 'none',\n} as const\n\n// Full card's secondary CTA (e.g. Fee Detected's Contact Support): a quiet text button, 13/16\n// semibold in text.secondary, at least 40px tall with 12/16 padding, as in Figma. `color=\"inherit\"` keeps\n// hover, ripple and focus off the primary palette. An unavailable CTA (contact_support_block with no host\n// handler) is dimmed at the call site, as the primary CTA is, because it is only aria-disabled and so\n// never matches `.Mui-disabled`.\nconst SECONDARY_CTA_SX = {\n color: 'text.secondary',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n lineHeight: '16px',\n minHeight: 40,\n px: 16,\n py: 12,\n '&.Mui-disabled': { color: 'text.disabled' },\n} as const\n\nconst BaseLayout = observer(\n ({\n beat,\n beatActions = NO_BEAT_ACTIONS,\n obsolete,\n isLoading = false,\n isError = false,\n }: BaseLayoutProps) => {\n const copy = useGlobalCopyStore()\n const insightsV2Store = useInsightsV2Store()\n const { config } = useAppConfig()\n const flow = useBeatFeedbackFlow(beat, beatActions)\n\n const stores = useGlobalStore()\n const {\n runCta: handleCtaClick,\n primary: primaryCtaState,\n secondary: secondaryCtaState,\n linkPresentation,\n } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta ?? undefined,\n beat.insights_payload?.secondary_cta ?? undefined,\n beat.insights_payload?.in_description_cta ?? undefined,\n )\n\n // Guard: payload may not be loaded yet (isLoading/isError states).\n const isMini = beat.insights_payload?.widget_type === 'mini'\n\n // Memoized: an inline object here would change identity every render, making every\n // useAnalyticsEvent() consumer's callback (and its effect deps) unstable too.\n const beatActionsValue = useMemo(\n () => ({ ...flow.wrappedActions, beat }),\n [flow.wrappedActions, beat],\n )\n\n // Error replaces the entire card; loading only swaps the block slot (below).\n if (isError) return <ErrorCard />\n\n const insights_payload = beat.insights_payload\n\n if (!insights_payload) return null\n if (flow.cardState === 'dismissed') return null\n\n const { instance_slot, primary_cta, secondary_cta, sub_title, title, guid, dismissed_at } =\n insights_payload\n const { block } = instance_slot\n\n // Rebuild V1 subtitle shape; sub_title wins if present.\n const subtitle =\n sub_title ??\n (insights_payload.subtitle\n ? {\n logo: logoFromRef(insights_payload.logo),\n text: insights_payload.subtitle,\n }\n : undefined)\n\n // CTAs run via ctaActions; contact_support_block bypasses it.\n const isCtaDisabled = (ctaBlock: string | null | undefined) =>\n isContactSupportCtaDisabled(ctaBlock, config, beatActions.onContactSupport)\n\n const onCtaClick = async (slot: 'primary' | 'secondary', cta: PrimaryCTA | SecondaryCTA) => {\n if (isCtaDisabled(cta.block)) return\n\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n // Bypasses the runner, but still reports the press like any other CTA: the generic\n // press event, and (on a first primary press) FIRST_TIME_PRIMARY_ACTION_SELECTED +\n // cta_clicked_at.\n reportCtaClick({ beat, stores, hostActions: beatActions, slot })\n beatActions.onContactSupport?.()\n return\n }\n\n await handleCtaClick(slot, cta)\n }\n\n const Block = blocks[block as keyof typeof blocks]\n\n const inDescriptionCta = insights_payload.in_description_cta\n // Full card: the envelope's link opens the drawer its block names. A link with no block (mini's\n // \"Make a Transfer\") is the card's action, drawn as the mini label below, never a dead link.\n const envelopeLink =\n !isMini && inDescriptionCta?.label && inDescriptionCta.block ? inDescriptionCta : undefined\n // The card's action label: the primary CTA's, else a block-less envelope link's (ditto ≥ 1.4.3\n // sends mini's action as in_description_cta). `||`, not `??`: the copy may send the primary label\n // as \"\" rather than omit it, and an empty string must fall through. It is a button only on a full\n // card with a primary CTA; otherwise a label, so a tap reaches the host's card handler.\n const ctaLabel =\n primary_cta?.label || (envelopeLink ? undefined : inDescriptionCta?.label) || undefined\n const isCtaButton = !isMini && !!primary_cta?.label\n const clientConfiguredLabel = beat.in_description_cta || beat.html_in_description_cta\n const onClientConfiguredLinkClick = () => {\n const { is_mobile_webview, clientConfig } = stores.appDataStore.appConfig\n\n sendClientConfiguredCta(beat.template, {\n isMobileWebview: is_mobile_webview,\n webviewScheme: clientConfig?.master?.ui_message_webview_url_scheme,\n userGuid: insights_payload.user_guid ?? beat.user_guid,\n })\n }\n // The primary step's presenter may draw a status or nothing instead of the button (full card only).\n const primaryPresentation = isCtaButton ? primaryCtaState.presentation : undefined\n const hidesAllCtas = primaryPresentation?.kind === 'hidden' && !!primaryPresentation.hideAll\n const showSecondaryCta = !isMini && !!secondary_cta?.label && !hidesAllCtas\n // Mini: the card's action (in_description_cta) mirrors the full card's state, as a label only.\n // Answered → the status's action word (Undo) and its answered title; hidden → no label. The tap\n // stays the host's (it opens the insight with its block), so nothing runs from mini itself.\n const miniPresentation = isMini ? linkPresentation : undefined\n const miniStatus = miniPresentation?.kind === 'status' ? miniPresentation : undefined\n const actionLabel = miniPresentation ? miniStatus?.action?.label : ctaLabel\n const cardTitle = miniPresentation?.title || title || ''\n const showActionLink = !!actionLabel && !isCtaButton\n const showCtaRow = (isCtaButton && primaryPresentation?.kind !== 'hidden') || showSecondaryCta\n const handleMiniActionClick = (event: MouseEvent) => {\n const { onCtaAction } = beatActions\n if (!onCtaAction) return\n event.stopPropagation()\n Promise.resolve()\n .then(() => onCtaAction({ beatGuid: beat.guid, name: HOST_ACTIONS.cardClick }))\n .catch((error) =>\n stores.captureException(error, {\n store: 'BaseLayout',\n template: beat.template,\n handler: 'cardClick',\n }),\n )\n }\n const obsoleteCopy = copy.insights_feed?.general\n const isObsoleteDimmed =\n obsolete?.state === 'not_refreshable' && !dismissed_at && !!obsoleteCopy\n\n return (\n <BeatActionsProvider value={beatActionsValue}>\n <Stack sx={{ mb: 16 }}>\n {flow.cardState === 'confirming' ? (\n <HiddenConfirmationCard\n onClose={flow.collapseConfirmation}\n onLeaveFeedback={flow.openHideSurvey}\n onUndo={flow.undoDismiss}\n />\n ) : (\n <>\n {obsolete && obsoleteCopy && <ObsolesceBanner {...obsolete} copy={obsoleteCopy} />}\n <Card\n inert={isObsoleteDimmed}\n sx={{\n ...(isObsoleteDimmed && {\n position: 'relative',\n zIndex: 2,\n pointerEvents: 'none',\n }),\n }}\n >\n {isObsoleteDimmed && <Box sx={OBSOLETE_OVERLAY_SX} />}\n <Header isMini={isMini} subtitle={subtitle} title={cardTitle} />\n {isLoading ? (\n <LoadingCard />\n ) : (\n Block && <Block beatGuid={guid} payload={insights_payload} />\n )}\n\n <Stack sx={{ gap: 6, pb: 16, pt: 12, px: 16 }}>\n <P\n dangerouslySetInnerHTML={{\n __html: insights_payload.description.html_text,\n }}\n sx={{ fontWeight: 'fontWeightRegular' }}\n variant=\"subtitle2\"\n />\n {/* V2: the envelope's link opens the action block it names. */}\n {envelopeLink && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() =>\n insightsV2Store.openActionDrawer({ guid, trigger: 'inDescriptionCta' })\n }\n sx={TEXT_LINK_SX}\n >\n {envelopeLink.label}\n </Button>\n )}\n {/* The card's action with no primary CTA button, never a drawer: mini hands its tap to\n the host (`cardClick`); a full card's block-less link bubbles to the host's card handler. */}\n {showActionLink && (\n <Button\n onClick={isMini ? handleMiniActionClick : undefined}\n sx={MINI_CTA_SX}\n variant=\"text\"\n >\n {actionLabel}\n </Button>\n )}\n {/* Custom-copy link when the envelope sends none; legacy mini shows it too, so no mini guard. */}\n {!inDescriptionCta?.label && clientConfiguredLabel && (\n <Button\n endIcon={<ChevronRight />}\n onClick={onClientConfiguredLinkClick}\n sx={TEXT_LINK_SX}\n >\n {clientConfiguredLabel}\n </Button>\n )}\n </Stack>\n\n {showCtaRow && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n {isCtaButton && primary_cta && primaryPresentation?.kind === 'status' && (\n <CtaStatus\n action={primaryPresentation.action}\n sx={primaryPresentation.sx}\n icon={primaryPresentation.icon}\n label={primaryPresentation.label}\n tone={primaryPresentation.tone}\n />\n )}\n {isCtaButton && primary_cta && !primaryPresentation && (\n <Button\n aria-disabled={isCtaDisabled(primary_cta.block) || primaryCtaState.disabled}\n disabled={primaryCtaState.disabled}\n onClick={() => onCtaClick('primary', primary_cta)}\n sx={{\n ...(isCtaDisabled(primary_cta.block) && { color: 'text.disabled' }),\n }}\n variant=\"outlined\"\n >\n {primary_cta.label}\n </Button>\n )}\n {/* Mini has room for one CTA. */}\n {showSecondaryCta && secondary_cta && (\n <Button\n aria-disabled={\n isCtaDisabled(secondary_cta.block) || secondaryCtaState.disabled\n }\n color=\"inherit\"\n disabled={secondaryCtaState.disabled}\n onClick={() => onCtaClick('secondary', secondary_cta)}\n sx={{\n ...SECONDARY_CTA_SX,\n ...(isCtaDisabled(secondary_cta.block) && { color: 'text.disabled' }),\n }}\n >\n {secondary_cta.label}\n </Button>\n )}\n </Stack>\n )}\n\n <FeedbackBar onTellUsMore={flow.openRatingSurvey} show={flow.isFeedbackBarShown} />\n </Card>\n </>\n )}\n\n <ActionBlockLayer beat={beat} />\n\n <DismissInsightDialog\n isOpen={flow.isDismissOpen}\n onClose={flow.closeDismissDialog}\n onDismiss={flow.confirmDismiss}\n />\n\n {flow.isSurveyOpen && (\n <FeedbackDialog\n characterLimitLabel={flow.survey.characterLimitLabel}\n closeAriaLabel={flow.survey.closeAriaLabel}\n isOpen={true}\n onBackClick={flow.feedbackDialogCallbacks.onBackClick}\n onClose={flow.closeSurvey}\n onSubmit={flow.submitSurvey}\n onTextInputFocus={flow.feedbackDialogCallbacks.onTextInputFocus}\n options={flow.survey.options}\n primaryText={flow.survey.submitText}\n secondaryText={flow.survey.backText}\n title={flow.survey.title}\n />\n )}\n\n {flow.cardState === 'visible' && insights_payload.footer && (\n <Footer footer={insights_payload.footer} />\n )}\n </Stack>\n </BeatActionsProvider>\n )\n },\n)\n\nexport default BaseLayout\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,IAAM,KAA+B,CAAC,GAEhC,KAAsB;AAAA,EAC1B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,SAAS;AAAA,EAET,QAAQ;AACV,GAOM,IAAe;AAAA,EACnB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,UAAU;AAAA,EACV,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,WAAW;AACb,GAGM,KAAc;AAA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,UAC1C,SAAS,EAAK;AAAA,UACd,UAAU,EAAK;AAAA,UACf,kBAAkB,EAAK,wBAAwB;AAAA,UAC/C,SAAS,EAAK,OAAO;AAAA,UACrB,aAAa,EAAK,OAAO;AAAA,UACzB,eAAe,EAAK,OAAO;AAAA,UAC3B,OAAO,EAAK,OAAO;AAAA,QACpB,CAAA;AAAA,QAGF,EAAK,cAAc,aAAa,EAAiB,UAChD,gBAAA,EAAC,IAAD,EAAQ,QAAQ,EAAiB,OAAS,CAAA;AAAA,MAEvC;AAAA;EACY,CAAA;AAEzB,CACF"}
1
+ {"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { type MouseEvent, useEffect, useMemo } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { ChevronRight } from '@mxenabled/mx-icons'\nimport { P } from '@mxenabled/mxui'\n\nimport { blocks } from '../mappings/blocks'\nimport { actionBlocksKey } from '../mappings/actionBlocksKey'\nimport { isContactSupportCtaDisabled } from '../actionBlocks/ContactSupportActionBlock'\nimport { logoFromRef } from './shared/EntityLogo'\n\nimport Footer from './Footer'\nimport Header from './Header'\nimport FeedbackBar from './FeedbackBar'\nimport FeedbackDialog from './FeedbackDialog'\nimport DismissInsightDialog from './DismissInsightDialog'\nimport HiddenConfirmationCard from './HiddenConfirmationCard'\nimport ErrorCard from './ErrorCard'\nimport LoadingCard from './LoadingCard'\nimport { ObsolesceBanner, type ObsolesceBannerState } from './ObsolesceBanner'\nimport { useAppConfig, useGlobalCopyStore, useGlobalStore, useInsightsV2Store } from '../../common'\nimport { sendClientConfiguredCta } from '../../common/utils/PostMessage'\nimport type { Beat, PrimaryCTA, SecondaryCTA } from '../../core'\nimport { BEAT_ACTIVE_AT_KEY } from '../../core/stores/InsightsV2Store'\nimport { BeatActionsProvider, type BeatActions } from '../beatActions'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { HOST_ACTIONS, reportCtaClick, useBeatCtaActions } from '../ctaActions'\nimport { CtaStatus } from './CtaStatus'\nimport { useBeatFeedbackFlow } from '../hooks/useBeatFeedbackFlow'\n\nexport interface ObsoleteState {\n state: ObsolesceBannerState\n onRefresh: () => void\n onDismiss: () => void\n}\n\ninterface BaseLayoutProps {\n beat: Beat\n beatActions?: BeatActions\n obsolete?: ObsoleteState\n /** Swap only the block slot for a LoadingCard (e.g. while a sampled beat loads). */\n isLoading?: boolean\n /** Replace the entire card with an ErrorCard (e.g. when the sample fails to load). */\n isError?: boolean\n}\n\nconst NO_BEAT_ACTIONS: BeatActions = {}\n\nconst OBSOLETE_OVERLAY_SX = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n backgroundColor: 'background.default',\n opacity: 0.7,\n // Above every block's own z-index (hero card 1, AccountBlock 2), or that section shows through.\n zIndex: 3,\n} as const\n\n// Figma's 24px text link: 13/16 semibold, 16px line plus 4px above and below, its text starting at the\n// card's 16px inset. A minimum height, not the theme's fixed 44px Button height, so a long or translated\n// label wraps instead of overflowing; MUI's 64px minimum width and centring are undone for the same inset.\n// The in-description links use it as is, with the Button's 20px chevron, so they are 28px tall, as in\n// Figma's Low Account Balance full card (node 438:27877); the 24px is the mini CTA's, which has no icon.\nconst TEXT_LINK_SX = {\n alignSelf: 'flex-start',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n justifyContent: 'flex-start',\n lineHeight: '16px',\n minHeight: 24,\n minWidth: 0,\n px: 0,\n py: 4,\n textAlign: 'left',\n} as const\n\n// Mini CTA label, which fits Pulse's 312px mini slide as a text link.\nconst MINI_CTA_SX = {\n ...TEXT_LINK_SX,\n alignItems: 'center',\n display: 'flex',\n textTransform: 'none',\n} as const\n\n// Full card's secondary CTA (e.g. Fee Detected's Contact Support): a quiet text button, 13/16\n// semibold in text.secondary, at least 40px tall with 12/16 padding, as in Figma. `color=\"inherit\"` keeps\n// hover, ripple and focus off the primary palette. An unavailable CTA (contact_support_block with no host\n// handler) is dimmed at the call site, as the primary CTA is, because it is only aria-disabled and so\n// never matches `.Mui-disabled`.\nconst SECONDARY_CTA_SX = {\n color: 'text.secondary',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n lineHeight: '16px',\n minHeight: 40,\n px: 16,\n py: 12,\n '&.Mui-disabled': { color: 'text.disabled' },\n} as const\n\nconst BaseLayout = observer(\n ({\n beat,\n beatActions = NO_BEAT_ACTIONS,\n obsolete,\n isLoading = false,\n isError = false,\n }: BaseLayoutProps) => {\n const copy = useGlobalCopyStore()\n const insightsV2Store = useInsightsV2Store()\n const { config } = useAppConfig()\n const flow = useBeatFeedbackFlow(beat, beatActions)\n\n const stores = useGlobalStore()\n const {\n runCta: handleCtaClick,\n primary: primaryCtaState,\n secondary: secondaryCtaState,\n linkPresentation,\n } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta ?? undefined,\n beat.insights_payload?.secondary_cta ?? undefined,\n beat.insights_payload?.in_description_cta ?? undefined,\n )\n\n // Guard: payload may not be loaded yet (isLoading/isError states).\n const isMini = beat.insights_payload?.widget_type === 'mini'\n\n // A sampled beat is re-read without active_at after a CTA; keep the card's for its drawers.\n const activeAt = beat.active_at ?? beat.insights_payload?.active_at\n useEffect(() => {\n if (activeAt == null || activeAt === '') return\n insightsV2Store.setBeatContext(beat.guid, { [BEAT_ACTIVE_AT_KEY]: activeAt })\n }, [activeAt, beat.guid, insightsV2Store])\n\n // Memoized: an inline object here would change identity every render, making every\n // useAnalyticsEvent() consumer's callback (and its effect deps) unstable too.\n const beatActionsValue = useMemo(\n () => ({ ...flow.wrappedActions, beat }),\n [flow.wrappedActions, beat],\n )\n\n // Error replaces the entire card; loading only swaps the block slot (below).\n if (isError) return <ErrorCard />\n\n const insights_payload = beat.insights_payload\n\n if (!insights_payload) return null\n if (flow.cardState === 'dismissed') return null\n\n const { instance_slot, primary_cta, secondary_cta, sub_title, title, guid, dismissed_at } =\n insights_payload\n const { block } = instance_slot\n\n // Rebuild V1 subtitle shape; sub_title wins if present.\n const subtitle =\n sub_title ??\n (insights_payload.subtitle\n ? {\n logo: logoFromRef(insights_payload.logo),\n text: insights_payload.subtitle,\n }\n : undefined)\n\n // CTAs run via ctaActions; contact_support_block bypasses it.\n const isCtaDisabled = (ctaBlock: string | null | undefined) =>\n isContactSupportCtaDisabled(ctaBlock, config, beatActions.onContactSupport)\n\n const onCtaClick = async (slot: 'primary' | 'secondary', cta: PrimaryCTA | SecondaryCTA) => {\n if (isCtaDisabled(cta.block)) return\n\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n // Bypasses the runner, but still reports the press like any other CTA: the generic\n // press event, and (on a first primary press) FIRST_TIME_PRIMARY_ACTION_SELECTED +\n // cta_clicked_at.\n reportCtaClick({ beat, stores, hostActions: beatActions, slot })\n beatActions.onContactSupport?.()\n return\n }\n\n await handleCtaClick(slot, cta)\n }\n\n const Block = blocks[block as keyof typeof blocks]\n\n const inDescriptionCta = insights_payload.in_description_cta\n // Full card: the envelope's link opens the drawer its block names. A link with no block (mini's\n // \"Make a Transfer\") is the card's action, drawn as the mini label below, never a dead link.\n const envelopeLink =\n !isMini && inDescriptionCta?.label && inDescriptionCta.block ? inDescriptionCta : undefined\n // The card's action label: the primary CTA's, else a block-less envelope link's (ditto ≥ 1.4.3\n // sends mini's action as in_description_cta). `||`, not `??`: the copy may send the primary label\n // as \"\" rather than omit it, and an empty string must fall through. It is a button only on a full\n // card with a primary CTA; otherwise a label, so a tap reaches the host's card handler.\n const ctaLabel =\n primary_cta?.label || (envelopeLink ? undefined : inDescriptionCta?.label) || undefined\n const isCtaButton = !isMini && !!primary_cta?.label\n const clientConfiguredLabel = beat.in_description_cta || beat.html_in_description_cta\n const onClientConfiguredLinkClick = () => {\n const { is_mobile_webview, clientConfig } = stores.appDataStore.appConfig\n\n sendClientConfiguredCta(beat.template, {\n isMobileWebview: is_mobile_webview,\n webviewScheme: clientConfig?.master?.ui_message_webview_url_scheme,\n userGuid: insights_payload.user_guid ?? beat.user_guid,\n })\n }\n // The primary step's presenter may draw a status or nothing instead of the button (full card only).\n const primaryPresentation = isCtaButton ? primaryCtaState.presentation : undefined\n const hidesAllCtas = primaryPresentation?.kind === 'hidden' && !!primaryPresentation.hideAll\n const showSecondaryCta = !isMini && !!secondary_cta?.label && !hidesAllCtas\n // Mini: the card's action (in_description_cta) mirrors the full card's state, as a label only.\n // Answered → the status's action word (Undo) and its answered title; hidden → no label. The tap\n // stays the host's (it opens the insight with its block), so nothing runs from mini itself.\n const miniPresentation = isMini ? linkPresentation : undefined\n const miniStatus = miniPresentation?.kind === 'status' ? miniPresentation : undefined\n const actionLabel = miniPresentation ? miniStatus?.action?.label : ctaLabel\n const cardTitle = miniPresentation?.title || title || ''\n const showActionLink = !!actionLabel && !isCtaButton\n const showCtaRow = (isCtaButton && primaryPresentation?.kind !== 'hidden') || showSecondaryCta\n const handleMiniActionClick = (event: MouseEvent) => {\n const { onCtaAction } = beatActions\n if (!onCtaAction) return\n event.stopPropagation()\n Promise.resolve()\n .then(() => onCtaAction({ beatGuid: beat.guid, name: HOST_ACTIONS.cardClick }))\n .catch((error) =>\n stores.captureException(error, {\n store: 'BaseLayout',\n template: beat.template,\n handler: 'cardClick',\n }),\n )\n }\n // Figma's minis: the text 12px under the block, the link 16px from the card's bottom.\n const linkAtBottom = isMini\n const obsoleteCopy = copy.insights_feed?.general\n const isObsoleteDimmed =\n obsolete?.state === 'not_refreshable' && !dismissed_at && !!obsoleteCopy\n\n return (\n <BeatActionsProvider value={beatActionsValue}>\n <Stack sx={{ mb: 16 }}>\n {flow.cardState === 'confirming' ? (\n <HiddenConfirmationCard\n onClose={flow.collapseConfirmation}\n onLeaveFeedback={flow.openHideSurvey}\n onUndo={flow.undoDismiss}\n />\n ) : (\n <>\n {obsolete && obsoleteCopy && <ObsolesceBanner {...obsolete} copy={obsoleteCopy} />}\n <Card\n inert={isObsoleteDimmed}\n sx={{\n ...(linkAtBottom && { display: 'flex', flexDirection: 'column' }),\n ...(isObsoleteDimmed && {\n position: 'relative',\n zIndex: 2,\n pointerEvents: 'none',\n }),\n }}\n >\n {isObsoleteDimmed && <Box sx={OBSOLETE_OVERLAY_SX} />}\n <Header isMini={isMini} subtitle={subtitle} title={cardTitle} />\n {isLoading ? (\n <LoadingCard />\n ) : (\n Block && <Block beatGuid={guid} payload={insights_payload} />\n )}\n\n <Stack\n sx={{ gap: 6, pb: 16, pt: 12, px: 16, ...(linkAtBottom && { flexGrow: 1 }) }}\n >\n <P\n dangerouslySetInnerHTML={{\n __html: insights_payload.description.html_text,\n }}\n sx={{ fontWeight: 'fontWeightRegular' }}\n variant=\"subtitle2\"\n />\n {/* V2: the envelope's link opens the action block it names. */}\n {envelopeLink && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() =>\n insightsV2Store.openActionDrawer({ guid, trigger: 'inDescriptionCta' })\n }\n sx={TEXT_LINK_SX}\n >\n {envelopeLink.label}\n </Button>\n )}\n {/* The card's action with no primary CTA button, never a drawer: mini hands its tap to\n the host (`cardClick`); a full card's block-less link bubbles to the host's card handler. */}\n {showActionLink && (\n <Button\n onClick={isMini ? handleMiniActionClick : undefined}\n sx={{ ...MINI_CTA_SX, ...(linkAtBottom && { mt: 'auto' }) }}\n variant=\"text\"\n >\n {actionLabel}\n </Button>\n )}\n {/* Custom-copy link when the envelope sends none; legacy mini shows it too, so no mini guard. */}\n {!inDescriptionCta?.label && clientConfiguredLabel && (\n <Button\n endIcon={<ChevronRight />}\n onClick={onClientConfiguredLinkClick}\n sx={TEXT_LINK_SX}\n >\n {clientConfiguredLabel}\n </Button>\n )}\n </Stack>\n\n {showCtaRow && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n {isCtaButton && primary_cta && primaryPresentation?.kind === 'status' && (\n <CtaStatus\n action={primaryPresentation.action}\n sx={primaryPresentation.sx}\n icon={primaryPresentation.icon}\n label={primaryPresentation.label}\n tone={primaryPresentation.tone}\n />\n )}\n {isCtaButton && primary_cta && !primaryPresentation && (\n <Button\n aria-disabled={isCtaDisabled(primary_cta.block) || primaryCtaState.disabled}\n disabled={primaryCtaState.disabled}\n onClick={() => onCtaClick('primary', primary_cta)}\n sx={{\n ...(isCtaDisabled(primary_cta.block) && { color: 'text.disabled' }),\n }}\n variant=\"outlined\"\n >\n {primary_cta.label}\n </Button>\n )}\n {/* Mini has room for one CTA. */}\n {showSecondaryCta && secondary_cta && (\n <Button\n aria-disabled={\n isCtaDisabled(secondary_cta.block) || secondaryCtaState.disabled\n }\n color=\"inherit\"\n disabled={secondaryCtaState.disabled}\n onClick={() => onCtaClick('secondary', secondary_cta)}\n sx={{\n ...SECONDARY_CTA_SX,\n ...(isCtaDisabled(secondary_cta.block) && { color: 'text.disabled' }),\n }}\n >\n {secondary_cta.label}\n </Button>\n )}\n </Stack>\n )}\n\n <FeedbackBar onTellUsMore={flow.openRatingSurvey} show={flow.isFeedbackBarShown} />\n </Card>\n </>\n )}\n\n <ActionBlockLayer beat={beat} />\n\n <DismissInsightDialog\n isOpen={flow.isDismissOpen}\n onClose={flow.closeDismissDialog}\n onDismiss={flow.confirmDismiss}\n />\n\n {flow.isSurveyOpen && (\n <FeedbackDialog\n characterLimitLabel={flow.survey.characterLimitLabel}\n closeAriaLabel={flow.survey.closeAriaLabel}\n isOpen={true}\n onBackClick={flow.feedbackDialogCallbacks.onBackClick}\n onClose={flow.closeSurvey}\n onSubmit={flow.submitSurvey}\n onTextInputFocus={flow.feedbackDialogCallbacks.onTextInputFocus}\n options={flow.survey.options}\n primaryText={flow.survey.submitText}\n secondaryText={flow.survey.backText}\n title={flow.survey.title}\n />\n )}\n\n {flow.cardState === 'visible' && insights_payload.footer && (\n <Footer footer={insights_payload.footer} />\n )}\n </Stack>\n </BeatActionsProvider>\n )\n },\n)\n\nexport default BaseLayout\n"],"mappings":";;;;;;;;;;;;;;;;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EvC;AAAA;EACY,CAAA;AAEzB,CACF"}
@@ -8,6 +8,7 @@ export interface ActionBlockEntry {
8
8
  usePrepare: (props: ActionBlockProps) => void;
9
9
  title?: (variant: string | null | undefined, copy: GlobalCopy, beat?: Beat) => string;
10
10
  presentation?: 'drawer' | 'modal';
11
+ headerAction?: 'back' | 'close';
11
12
  }
12
13
  export declare const actionBlocks: Record<string, ActionBlockEntry>;
13
14
  export declare const blocks: Record<string, React.ComponentType<{