@mx-cartographer/experiences 9.7.63 → 9.7.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [9.7.65] - 10-28-2026
2
+
3
+ - **FIXED** - Fee Detected design QA (WEC-2139): quieter full-card Contact Support CTA, tighter Transaction Details header spacing with 32px action-row tiles, and Fee Detected fixtures that follow the V2 contract (no date header, orange `ICO-error` icon, `contact_support_block`).
4
+
5
+ ## [9.7.64] - 10-28-2026
6
+
7
+ - **ADDED** - Replenish Savings beat on Insights 2.0 (MEW2-3376): the `with_header_footer` transaction card whose "View Transactions" CTA opens the Transaction List drawer's `summary_header` variant, or the withdrawal's Transaction Details when there is only one. Fixture, story, contract test and block doc
8
+
1
9
  ## [9.7.63] - 10-28-2026
2
10
 
3
11
  - **ADDED** - Monthly Subscription Aggregate's "View Transactions" drawer on Insights 2.0 (MEW2-3380): the `transaction_history_block` `monthly_subscription_aggregate` row, a month-tabs drawer (one tab per `series` month, no chart) that lists the selected month's `aggregated_guids` within that month and the empty state for a month that names none. Fixtures (`mock/BlockBeatsData/MonthlySubscriptionAggregate*.ts`), the `InsightsV2/Insights/MonthlySubscriptionAggregateV2` story, contract test and the block doc
@@ -1,4 +1,4 @@
1
- import { useAppConfig as z, useGlobalCopyStore as K, useGlobalStore as W, useInsightsV2Store as X } from "../../common/context/hooks.es.js";
1
+ import { useAppConfig as W, useGlobalCopyStore as X, useGlobalStore as j, useInsightsV2Store as K } from "../../common/context/hooks.es.js";
2
2
  import { sendClientConfiguredCta as Y } from "../../common/utils/PostMessage.es.js";
3
3
  import { BeatActionsProvider as $ } from "../beatActions.es.js";
4
4
  import { isContactSupportCtaDisabled as q } from "../actionBlocks/ContactSupportActionBlock.es.js";
@@ -19,15 +19,15 @@ import { LoadingCard as mo } from "./LoadingCard.es.js";
19
19
  import { ObsolesceBanner as po } from "./ObsolesceBanner.es.js";
20
20
  import { useBeatFeedbackFlow as uo } from "../hooks/useBeatFeedbackFlow.es.js";
21
21
  import { useMemo as fo } from "react";
22
- import { observer as Co } from "mobx-react-lite";
23
- import y from "@mui/material/Stack";
24
- import { P as bo } from "@mxenabled/mxui";
25
- import d from "@mui/material/Button";
22
+ import { observer as bo } from "mobx-react-lite";
23
+ import _ from "@mui/material/Stack";
24
+ import { P as Co } from "@mxenabled/mxui";
25
+ import m from "@mui/material/Button";
26
26
  import { ChevronRight as T } from "@mxenabled/mx-icons";
27
- import { Fragment as go, jsx as e, jsxs as m } from "react/jsx-runtime";
27
+ import { Fragment as go, jsx as e, jsxs as p } from "react/jsx-runtime";
28
28
  import ho from "@mui/material/Box";
29
- import yo from "@mui/material/Card";
30
- var _o = {}, ko = {
29
+ import _o from "@mui/material/Card";
30
+ var yo = {}, ko = {
31
31
  position: "absolute",
32
32
  top: 0,
33
33
  left: 0,
@@ -36,7 +36,7 @@ var _o = {}, ko = {
36
36
  backgroundColor: "background.default",
37
37
  opacity: 0.7,
38
38
  zIndex: 3
39
- }, vo = {
39
+ }, xo = {
40
40
  alignItems: "center",
41
41
  alignSelf: "flex-start",
42
42
  display: "flex",
@@ -44,51 +44,57 @@ var _o = {}, ko = {
44
44
  height: 44,
45
45
  px: 2,
46
46
  textTransform: "none"
47
- }, Qo = Co(({ beat: i, beatActions: s = _o, obsolete: f, isLoading: O = !1, isError: I = !1 }) => {
48
- const A = K(), F = X(), { config: E } = z(), o = uo(i, s), _ = W(), { runCta: M, primary: k, secondary: v } = Q(i, s, i.insights_payload?.primary_cta, i.insights_payload?.secondary_cta), p = i.insights_payload?.widget_type === "mini", N = fo(() => ({
47
+ }, vo = {
48
+ color: "text.secondary",
49
+ fontSize: 13,
50
+ fontWeight: 600,
51
+ lineHeight: "16px",
52
+ "&.Mui-disabled": { color: "text.disabled" }
53
+ }, Zo = bo(({ beat: i, beatActions: a = yo, obsolete: f, isLoading: O = !1, isError: A = !1 }) => {
54
+ const I = X(), F = K(), { config: E } = W(), o = uo(i, a), y = j(), { runCta: M, primary: k, secondary: x } = Q(i, a, i.insights_payload?.primary_cta, i.insights_payload?.secondary_cta), u = i.insights_payload?.widget_type === "mini", N = fo(() => ({
49
55
  ...o.wrappedActions,
50
56
  beat: i
51
57
  }), [o.wrappedActions, i]);
52
- if (I) return /* @__PURE__ */ e(io, {});
58
+ if (A) return /* @__PURE__ */ e(io, {});
53
59
  const t = i.insights_payload;
54
60
  if (!t || o.cardState === "dismissed") return null;
55
- const { instance_slot: R, primary_cta: r, secondary_cta: a, sub_title: G, title: H, guid: x, dismissed_at: P } = t, { block: V } = R, U = G ?? (t.subtitle ? {
61
+ const { instance_slot: R, primary_cta: r, secondary_cta: n, sub_title: H, title: G, guid: v, dismissed_at: P } = t, { block: V } = R, z = H ?? (t.subtitle ? {
56
62
  logo: oo(t.logo),
57
63
  text: t.subtitle
58
- } : void 0), u = (n) => q(n, E, s.onContactSupport), S = async (n, c) => {
59
- if (!u(c.block)) {
60
- if (c.block === Z.CONTACT_SUPPORT_ACTION_BLOCK) {
64
+ } : void 0), l = (s) => q(s, E, a.onContactSupport), S = async (s, d) => {
65
+ if (!l(d.block)) {
66
+ if (d.block === Z.CONTACT_SUPPORT_ACTION_BLOCK) {
61
67
  J({
62
68
  beat: i,
63
- stores: _,
64
- hostActions: s,
65
- slot: n
66
- }), s.onContactSupport?.();
69
+ stores: y,
70
+ hostActions: a,
71
+ slot: s
72
+ }), a.onContactSupport?.();
67
73
  return;
68
74
  }
69
- await M(n, c);
75
+ await M(s, d);
70
76
  }
71
- }, w = to[V], l = t.in_description_cta, C = !p && l?.label && l.block ? l : void 0, b = r?.label || (C ? void 0 : l?.label) || void 0, B = !p && !!r?.label, D = i.in_description_cta || i.html_in_description_cta, j = () => {
72
- const { is_mobile_webview: n, clientConfig: c } = _.appDataStore.appConfig;
77
+ }, w = to[V], c = t.in_description_cta, b = !u && c?.label && c.block ? c : void 0, C = r?.label || (b ? void 0 : c?.label) || void 0, D = !u && !!r?.label, B = i.in_description_cta || i.html_in_description_cta, U = () => {
78
+ const { is_mobile_webview: s, clientConfig: d } = y.appDataStore.appConfig;
73
79
  Y(i.template, {
74
- isMobileWebview: n,
75
- webviewScheme: c?.master?.ui_message_webview_url_scheme,
80
+ isMobileWebview: s,
81
+ webviewScheme: d?.master?.ui_message_webview_url_scheme,
76
82
  userGuid: t.user_guid ?? i.user_guid
77
83
  });
78
- }, L = !p && !!a?.label, g = A.insights_feed?.general, h = f?.state === "not_refreshable" && !P && !!g;
84
+ }, L = !u && !!n?.label, g = I.insights_feed?.general, h = f?.state === "not_refreshable" && !P && !!g;
79
85
  return /* @__PURE__ */ e($, {
80
86
  value: N,
81
- children: /* @__PURE__ */ m(y, {
87
+ children: /* @__PURE__ */ p(_, {
82
88
  sx: { mb: 16 },
83
89
  children: [
84
90
  o.cardState === "confirming" ? /* @__PURE__ */ e(co, {
85
91
  onClose: o.collapseConfirmation,
86
92
  onLeaveFeedback: o.openHideSurvey,
87
93
  onUndo: o.undoDismiss
88
- }) : /* @__PURE__ */ m(go, { children: [f && g && /* @__PURE__ */ e(po, {
94
+ }) : /* @__PURE__ */ p(go, { children: [f && g && /* @__PURE__ */ e(po, {
89
95
  ...f,
90
96
  copy: g
91
- }), /* @__PURE__ */ m(yo, {
97
+ }), /* @__PURE__ */ p(_o, {
92
98
  inert: h,
93
99
  sx: { ...h && {
94
100
  position: "relative",
@@ -98,15 +104,15 @@ var _o = {}, ko = {
98
104
  children: [
99
105
  h && /* @__PURE__ */ e(ho, { sx: ko }),
100
106
  /* @__PURE__ */ e(so, {
101
- isMini: p,
102
- subtitle: U,
103
- title: H ?? ""
107
+ isMini: u,
108
+ subtitle: z,
109
+ title: G ?? ""
104
110
  }),
105
111
  O ? /* @__PURE__ */ e(mo, {}) : w && /* @__PURE__ */ e(w, {
106
- beatGuid: x,
112
+ beatGuid: v,
107
113
  payload: t
108
114
  }),
109
- /* @__PURE__ */ m(y, {
115
+ /* @__PURE__ */ p(_, {
110
116
  sx: {
111
117
  gap: 6,
112
118
  pb: 16,
@@ -114,14 +120,14 @@ var _o = {}, ko = {
114
120
  px: 16
115
121
  },
116
122
  children: [
117
- /* @__PURE__ */ e(bo, {
123
+ /* @__PURE__ */ e(Co, {
118
124
  dangerouslySetInnerHTML: { __html: t.description.html_text },
119
125
  variant: "subtitle2"
120
126
  }),
121
- C && /* @__PURE__ */ e(d, {
127
+ b && /* @__PURE__ */ e(m, {
122
128
  endIcon: /* @__PURE__ */ e(T, {}),
123
129
  onClick: () => F.openActionDrawer({
124
- guid: x,
130
+ guid: v,
125
131
  trigger: "inDescriptionCta"
126
132
  }),
127
133
  sx: {
@@ -129,46 +135,50 @@ var _o = {}, ko = {
129
135
  p: 4,
130
136
  width: "max-content"
131
137
  },
132
- children: C.label
138
+ children: b.label
133
139
  }),
134
- !l?.label && D && /* @__PURE__ */ e(d, {
140
+ !c?.label && B && /* @__PURE__ */ e(m, {
135
141
  endIcon: /* @__PURE__ */ e(T, {}),
136
- onClick: j,
142
+ onClick: U,
137
143
  sx: {
138
144
  height: 24,
139
145
  p: 4,
140
146
  width: "max-content"
141
147
  },
142
- children: D
148
+ children: B
143
149
  })
144
150
  ]
145
151
  }),
146
- (b || L) && /* @__PURE__ */ m(y, {
152
+ (C || L) && /* @__PURE__ */ p(_, {
147
153
  sx: {
148
154
  gap: 8,
149
155
  pb: 16,
150
156
  px: 16
151
157
  },
152
158
  children: [
153
- b && !B && /* @__PURE__ */ e(d, {
154
- sx: vo,
159
+ C && !D && /* @__PURE__ */ e(m, {
160
+ sx: xo,
155
161
  variant: "text",
156
- children: b
162
+ children: C
157
163
  }),
158
- B && r && /* @__PURE__ */ e(d, {
159
- "aria-disabled": u(r.block) || k.disabled,
164
+ D && r && /* @__PURE__ */ e(m, {
165
+ "aria-disabled": l(r.block) || k.disabled,
160
166
  disabled: k.disabled,
161
167
  onClick: () => S("primary", r),
162
- sx: { ...u(r.block) && { color: "text.disabled" } },
168
+ sx: { ...l(r.block) && { color: "text.disabled" } },
163
169
  variant: "outlined",
164
170
  children: r.label
165
171
  }),
166
- L && a && /* @__PURE__ */ e(d, {
167
- "aria-disabled": u(a.block) || v.disabled,
168
- color: "secondary",
169
- disabled: v.disabled,
170
- onClick: () => S("secondary", a),
171
- children: a.label
172
+ L && n && /* @__PURE__ */ e(m, {
173
+ "aria-disabled": l(n.block) || x.disabled,
174
+ color: "inherit",
175
+ disabled: x.disabled,
176
+ onClick: () => S("secondary", n),
177
+ sx: {
178
+ ...vo,
179
+ ...l(n.block) && { color: "text.disabled" }
180
+ },
181
+ children: n.label
172
182
  })
173
183
  ]
174
184
  }),
@@ -203,7 +213,7 @@ var _o = {}, ko = {
203
213
  });
204
214
  });
205
215
  export {
206
- Qo as default
216
+ Zo as default
207
217
  };
208
218
 
209
219
  //# sourceMappingURL=BaseLayout.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { 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 { reportCtaClick, useBeatCtaActions } from '../ctaActions'\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// Mini CTA label styled like a Button.\nconst MINI_CTA_SX = {\n alignItems: 'center',\n alignSelf: 'flex-start',\n display: 'flex',\n fontWeight: 600,\n height: 44,\n px: 2,\n textTransform: 'none',\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 } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta,\n beat.insights_payload?.secondary_cta,\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 const showSecondaryCta = !isMini && !!secondary_cta?.label\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={title ?? ''} />\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 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={{ height: 24, p: 4, width: 'max-content' }}\n >\n {envelopeLink.label}\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={{ height: 24, p: 4, width: 'max-content' }}\n >\n {clientConfiguredLabel}\n </Button>\n )}\n </Stack>\n\n {(ctaLabel || showSecondaryCta) && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n {ctaLabel &&\n !isCtaButton && (\n // The card's action when it has no primary CTA button (mini always; a full card whose\n // only link names no block). What the tap does is the host's decision (Pulse posts\n // `carousel/cta`, the same redirect a V1 mini card sends), never the action drawer the\n // full card's CTA opens. It is a real (blue, focusable) button for that tap, but has no\n // handler of its own and does not stop the click, so it reaches the host's card handler\n // exactly as a tap on the card does.\n <Button sx={MINI_CTA_SX} variant=\"text\">\n {ctaLabel}\n </Button>\n )}\n {isCtaButton && primary_cta && (\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=\"secondary\"\n disabled={secondaryCtaState.disabled}\n onClick={() => onCtaClick('secondary', secondary_cta)}\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,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,GAGM,KAAc;AAAA,EAClB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,IAAI;AAAA,EACJ,eAAe;AACjB,GAEM,KAAa,GAAA,CAChB,EACC,MAAA,GACA,aAAA,IAAc,IACd,UAAA,GACA,WAAA,IAAY,IACZ,SAAA,IAAU,GAAA,MACW;AACrB,QAAM,IAAO,EAAmB,GAC1B,IAAkB,EAAmB,GACrC,EAAE,QAAA,EAAA,IAAW,EAAa,GAC1B,IAAO,GAAoB,GAAM,CAAW,GAE5C,IAAS,EAAe,GACxB,EACJ,QAAQ,GACR,SAAS,GACT,WAAW,EAAA,IACT,EACF,GACA,GACA,EAAK,kBAAkB,aACvB,EAAK,kBAAkB,aACzB,GAGM,IAAS,EAAK,kBAAkB,gBAAgB,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","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { 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 { reportCtaClick, useBeatCtaActions } from '../ctaActions'\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// Mini CTA label styled like a Button.\nconst MINI_CTA_SX = {\n alignItems: 'center',\n alignSelf: 'flex-start',\n display: 'flex',\n fontWeight: 600,\n height: 44,\n px: 2,\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. `color=\"inherit\"` keeps hover, ripple and focus off the primary palette.\n// An unavailable CTA (contact_support_block with no host handler) is dimmed at the call site, as the\n// primary CTA is, because it is only aria-disabled and so never matches `.Mui-disabled`.\nconst SECONDARY_CTA_SX = {\n color: 'text.secondary',\n fontSize: 13,\n fontWeight: 600,\n lineHeight: '16px',\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 } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta,\n beat.insights_payload?.secondary_cta,\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 const showSecondaryCta = !isMini && !!secondary_cta?.label\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={title ?? ''} />\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 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={{ height: 24, p: 4, width: 'max-content' }}\n >\n {envelopeLink.label}\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={{ height: 24, p: 4, width: 'max-content' }}\n >\n {clientConfiguredLabel}\n </Button>\n )}\n </Stack>\n\n {(ctaLabel || showSecondaryCta) && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n {ctaLabel &&\n !isCtaButton && (\n // The card's action when it has no primary CTA button (mini always; a full card whose\n // only link names no block). What the tap does is the host's decision (Pulse posts\n // `carousel/cta`, the same redirect a V1 mini card sends), never the action drawer the\n // full card's CTA opens. It is a real (blue, focusable) button for that tap, but has no\n // handler of its own and does not stop the click, so it reaches the host's card handler\n // exactly as a tap on the card does.\n <Button sx={MINI_CTA_SX} variant=\"text\">\n {ctaLabel}\n </Button>\n )}\n {isCtaButton && primary_cta && (\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,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,GAGM,KAAc;AAAA,EAClB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,IAAI;AAAA,EACJ,eAAe;AACjB,GAMM,KAAmB;AAAA,EACvB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,kBAAkB,EAAE,OAAO,gBAAgB;AAC7C,GAEM,KAAa,GAAA,CAChB,EACC,MAAA,GACA,aAAA,IAAc,IACd,UAAA,GACA,WAAA,IAAY,IACZ,SAAA,IAAU,GAAA,MACW;AACrB,QAAM,IAAO,EAAmB,GAC1B,IAAkB,EAAmB,GACrC,EAAE,QAAA,EAAA,IAAW,EAAa,GAC1B,IAAO,GAAoB,GAAM,CAAW,GAE5C,IAAS,EAAe,GACxB,EACJ,QAAQ,GACR,SAAS,GACT,WAAW,EAAA,IACT,EACF,GACA,GACA,EAAK,kBAAkB,aACvB,EAAK,kBAAkB,aACzB,GAGM,IAAS,EAAK,kBAAkB,gBAAgB,QAIhD,IAAmB,GAAA,OAChB;AAAA,IAAE,GAAG,EAAK;AAAA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A;EACY,CAAA;AAEzB,CACF"}
@@ -1,61 +1,68 @@
1
- import { buildDynamicCopy as V } from "../../../core/utils/Localization.es.js";
2
- import { DATE_FORMATS_INTL as pe, formatDate as ge } from "../../../core/constants/DateFormats.es.js";
3
- import { useAppConfig as fe, useCategoryStore as he, useEvent as _e, useGlobalCopyStore as Te, useGlobalUiStore as ye, useTransactionStore as Se, useUserStore as be } from "../../../common/context/hooks.es.js";
4
- import { TransactionType as Ce } from "../../../core/types/Transaction.es.js";
1
+ import { buildDynamicCopy as W } from "../../../core/utils/Localization.es.js";
2
+ import { DATE_FORMATS_INTL as ge, formatDate as fe } from "../../../core/constants/DateFormats.es.js";
3
+ import { useAppConfig as he, useCategoryStore as _e, useEvent as Te, useGlobalCopyStore as ye, useGlobalUiStore as Se, useTransactionStore as be, useUserStore as Ce } from "../../../common/context/hooks.es.js";
4
+ import { TransactionType as ve } from "../../../core/types/Transaction.es.js";
5
5
  import { fromUnixUTC as De } from "../../../core/utils/DateUtil.es.js";
6
- import { formatCurrency as W } from "../../../core/utils/NumberFormatting.es.js";
7
- import { ANALYTICS_EVENTS as ve } from "../../../common/constants/Analytics.es.js";
8
- import { isFeatureEnabled as Ae } from "../../../core/utils/UserUtils.es.js";
9
- import { isTransferTransaction as xe } from "../../../core/utils/TransactionUtils.es.js";
10
- import Ie from "../../../common/components/Loader.es.js";
11
- import { BottomActions as m, DEFAULT_BOTTOM_ACTIONS as Le, DEFAULT_TOP_ACTIONS as we, TopActions as h } from "../../constants/Actions.es.js";
6
+ import { formatCurrency as V } from "../../../core/utils/NumberFormatting.es.js";
7
+ import { ANALYTICS_EVENTS as Ae } from "../../../common/constants/Analytics.es.js";
8
+ import { isFeatureEnabled as xe } from "../../../core/utils/UserUtils.es.js";
9
+ import { isTransferTransaction as Ie } from "../../../core/utils/TransactionUtils.es.js";
10
+ import Le from "../../../common/components/Loader.es.js";
11
+ import { BottomActions as m, DEFAULT_BOTTOM_ACTIONS as Oe, DEFAULT_TOP_ACTIONS as we, TopActions as h } from "../../constants/Actions.es.js";
12
12
  import { resolveInsightRender as Ee } from "../../../insights-v2/resolveInsightRender.es.js";
13
- import { isContactSupportCtaDisabled as Oe } from "../../../insights-v2/actionBlocks/ContactSupportActionBlock.es.js";
14
- import { actionBlocksKey as Me } from "../../../insights-v2/mappings/actionBlocksKey.es.js";
15
- import Ne from "../../../insights-v2/components/InsightErrorCard.es.js";
16
- import Be from "../../../insights-v2/components/CompactInsightCard.es.js";
17
- import ke from "../../../insights/components/shared/ChartTransactionWithDrillDown.es.js";
18
- import { EmbeddedCard as Fe } from "../../../insights/components/shared/InsightsCard/EmbeddedCard.es.js";
19
- import { AddMerchantBudgetAction as Re } from "./transactiondetails/actions/AddMerchantBudgetAction.es.js";
20
- import Ge from "./transactiondetails/actions/CategoryAction.es.js";
21
- import Pe from "./transactiondetails/actions/DateAction.es.js";
22
- import Ue from "./transactiondetails/actions/DeleteAction.es.js";
13
+ import { isContactSupportCtaDisabled as Me } from "../../../insights-v2/actionBlocks/ContactSupportActionBlock.es.js";
14
+ import { actionBlocksKey as Ne } from "../../../insights-v2/mappings/actionBlocksKey.es.js";
15
+ import Be from "../../../insights-v2/components/InsightErrorCard.es.js";
16
+ import ke from "../../../insights-v2/components/CompactInsightCard.es.js";
17
+ import Fe from "../../../insights/components/shared/ChartTransactionWithDrillDown.es.js";
18
+ import { EmbeddedCard as Re } from "../../../insights/components/shared/InsightsCard/EmbeddedCard.es.js";
19
+ import { AddMerchantBudgetAction as Ge } from "./transactiondetails/actions/AddMerchantBudgetAction.es.js";
20
+ import Pe from "./transactiondetails/actions/CategoryAction.es.js";
21
+ import Ue from "./transactiondetails/actions/DateAction.es.js";
22
+ import We from "./transactiondetails/actions/DeleteAction.es.js";
23
23
  import Ve from "./transactiondetails/actions/DeleteLogoAction.es.js";
24
- import We from "./transactiondetails/actions/ExcludeAction.es.js";
25
- import He from "./transactiondetails/actions/MemoAction.es.js";
24
+ import He from "./transactiondetails/actions/ExcludeAction.es.js";
25
+ import Xe from "./transactiondetails/actions/MemoAction.es.js";
26
26
  import je from "./transactiondetails/actions/SplitAction.es.js";
27
27
  import ze from "./transactiondetails/actions/TagsAction.es.js";
28
- import Xe from "./transactiondetails/Description.es.js";
29
- import qe from "./transactiondetails/FlagTransaction.es.js";
30
- import Ke from "./transactiondetails/TransactionDetailsView.es.js";
31
- import { getEmbeddedInstanceSlotByBeatTemplates as Ye } from "./getEmbeddedInstanceSlotByBeatTemplates.es.js";
28
+ import qe from "./transactiondetails/Description.es.js";
29
+ import Ke from "./transactiondetails/FlagTransaction.es.js";
30
+ import Ye from "./transactiondetails/TransactionDetailsView.es.js";
31
+ import { getEmbeddedInstanceSlotByBeatTemplates as $e } from "./getEmbeddedInstanceSlotByBeatTemplates.es.js";
32
32
  import s, { useMemo as H } from "react";
33
- import { observer as $e } from "mobx-react-lite";
33
+ import { observer as Ze } from "mobx-react-lite";
34
34
  import c from "@mui/material/Stack";
35
- import { MerchantLogo as j, P as Ze, Text as _ } from "@mxenabled/mxui";
36
- import { endOfMonth as Je } from "date-fns/endOfMonth";
37
- import { isBefore as Qe } from "date-fns/isBefore";
38
- import { startOfMonth as z } from "date-fns/startOfMonth";
39
- import X from "@mui/material/Paper";
35
+ import { MerchantLogo as X, P as Je, Text as _ } from "@mxenabled/mxui";
36
+ import { endOfMonth as Qe } from "date-fns/endOfMonth";
37
+ import { isBefore as et } from "date-fns/isBefore";
38
+ import { startOfMonth as j } from "date-fns/startOfMonth";
39
+ import z from "@mui/material/Paper";
40
40
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
41
- import { useTheme as et } from "@mui/material/styles";
41
+ import { useTheme as tt } from "@mui/material/styles";
42
42
  import q from "@mui/material/Box";
43
43
  import K from "@mui/material/Divider";
44
44
  import Y from "@mui/material/List";
45
- import tt from "@mui/material/Alert";
46
- import rt from "@mui/material/Snackbar";
47
- var v = 64, ot = 8, $ = {
45
+ import rt from "@mui/material/Alert";
46
+ import ot from "@mui/material/Snackbar";
47
+ var D = 64, $ = {
48
+ boxShadow: "none",
49
+ "& .MuiAvatar-root": {
50
+ height: 32,
51
+ width: 32
52
+ },
53
+ "& .MuiDivider-inset": { marginLeft: "68px" }
54
+ }, it = 8, Z = {
48
55
  fontWeight: 700,
49
56
  letterSpacing: "0.27px",
50
57
  textTransform: "uppercase"
51
- }, it = ({ bottomActions: T = Le, canFlagTransaction: Z = !0, topActions: A = we, transaction: e, shouldShowEmbeddedCard: x = !0, onContactSupport: I }) => {
52
- const { onEvent: J } = _e(), { config: Q } = fe(), { isCopyLoaded: ee } = ye(), { userFeatures: te } = be(), { accounts: re, common: oe, insights_feed: d } = Te(), { detailedCategories: L } = he(), { alert: w, associatedBeats: E, detailedTransactions: O, cachedStartDate: M, loadEmbeddedInstanceTransactions: ie, setAlert: N } = Se(), [ae, B] = s.useState(!1), [k, F] = s.useState(!1), [ne, se] = s.useState(!1), de = et(), le = e?.number && e.number.length > 4, R = e?.number ? le ? e.number : `••••${e.number}` : void 0, G = e?.transaction_type === Ce.CREDIT, P = xe(e) && !!e.institutionName, a = s.useMemo(() => E.find((r) => r.associated_transaction_guid === e.guid), [E, e]), y = x ? Ee(a) : "legacy", S = y === "v2" ? a?.insights_payload : void 0, o = x && y === "legacy" ? Ye(oe, a) : null, me = (r) => {
53
- r.block === Me.CONTACT_SUPPORT_ACTION_BLOCK && I?.();
58
+ }, at = ({ bottomActions: T = Oe, canFlagTransaction: J = !0, topActions: A = we, transaction: e, shouldShowEmbeddedCard: x = !0, onContactSupport: I }) => {
59
+ const { onEvent: Q } = Te(), { config: ee } = he(), { isCopyLoaded: te } = Se(), { userFeatures: re } = Ce(), { accounts: oe, common: ie, insights_feed: d } = ye(), { detailedCategories: L } = _e(), { alert: O, associatedBeats: w, detailedTransactions: E, cachedStartDate: M, loadEmbeddedInstanceTransactions: ae, setAlert: N } = be(), [ne, B] = s.useState(!1), [k, F] = s.useState(!1), [se, de] = s.useState(!1), le = tt(), me = e?.number && e.number.length > 4, R = e?.number ? me ? e.number : `••••${e.number}` : void 0, G = e?.transaction_type === ve.CREDIT, P = Ie(e) && !!e.institutionName, a = s.useMemo(() => w.find((r) => r.associated_transaction_guid === e.guid), [w, e]), y = x ? Ee(a) : "legacy", S = y === "v2" ? a?.insights_payload : void 0, o = x && y === "legacy" ? $e(ie, a) : null, ce = (r) => {
60
+ r.block === Ne.CONTACT_SUPPORT_ACTION_BLOCK && I?.();
54
61
  }, [l, b] = s.useState(o ? o.dataSeries.length - 1 : 0);
55
- s.useEffect(() => J(ve.TRANSACTION_DETAILS_VIEW, { transaction_guid: e.guid }), []), s.useEffect(() => {
62
+ s.useEffect(() => Q(Ae.TRANSACTION_DETAILS_VIEW, { transaction_guid: e.guid }), []), s.useEffect(() => {
56
63
  if (!o || o.dataSeries.length === 0) return;
57
- const { date: r } = o.dataSeries[l], i = z(r);
58
- Qe(i, M) && (F(!0), ie(i).finally(() => {
64
+ const { date: r } = o.dataSeries[l], i = j(r);
65
+ et(i, M) && (F(!0), ae(i).finally(() => {
59
66
  F(!1);
60
67
  }));
61
68
  }, [
@@ -63,7 +70,7 @@ var v = 64, ot = 8, $ = {
63
70
  o,
64
71
  M
65
72
  ]);
66
- const C = T.includes(m.MerchantBudget) && !e?.merchant_guid ? T.filter((r) => r !== m.MerchantBudget) : T, D = H(() => {
73
+ const C = T.includes(m.MerchantBudget) && !e?.merchant_guid ? T.filter((r) => r !== m.MerchantBudget) : T, v = H(() => {
67
74
  if (o) {
68
75
  const r = L.find((f) => f.guid === e.top_level_category_guid), i = a?.payload?.average_amount ?? 0, p = e.amount;
69
76
  let g = d.general.increased_text;
@@ -74,45 +81,45 @@ var v = 64, ot = 8, $ = {
74
81
  };
75
82
  }
76
83
  return null;
77
- }, [o, L]), ce = H(() => {
84
+ }, [o, L]), ue = H(() => {
78
85
  if (!o?.dataSeries?.length) return [];
79
- const { guid: r, date: i } = o.dataSeries[l], p = z(i), g = Je(i);
80
- return O.filter((f) => {
86
+ const { guid: r, date: i } = o.dataSeries[l], p = j(i), g = Qe(i);
87
+ return E.filter((f) => {
81
88
  const U = De(f.date);
82
89
  return U >= p && U <= g && f.guid === r;
83
90
  });
84
91
  }, [
85
92
  l,
86
93
  o,
87
- O,
94
+ E,
88
95
  k
89
96
  ]);
90
- if (!ee) return /* @__PURE__ */ t(Ie, {});
91
- const u = Ae(te, "MX_TXN_DETAILS_VIEW_ONLY"), ue = de.palette.mode === "dark" ? "grey.800" : "grey.100";
97
+ if (!te) return /* @__PURE__ */ t(Le, {});
98
+ const u = xe(re, "MX_TXN_DETAILS_VIEW_ONLY"), pe = le.palette.mode === "dark" ? "grey.800" : "grey.100";
92
99
  return /* @__PURE__ */ n(q, {
93
100
  className: "mx-txn-transaction-details",
94
101
  width: "100%",
95
102
  children: [
96
103
  e && /* @__PURE__ */ n(c, { children: [
97
104
  /* @__PURE__ */ n(c, {
98
- gap: 12,
105
+ gap: 8,
99
106
  p: 24,
100
107
  children: [
101
108
  /* @__PURE__ */ t(q, {
102
109
  sx: {
103
110
  bgcolor: "background.paper",
104
- borderRadius: `${ot}px`,
105
- height: v,
111
+ borderRadius: `${it}px`,
112
+ height: D,
106
113
  overflow: "hidden",
107
- width: v
114
+ width: D
108
115
  },
109
- children: /* @__PURE__ */ t(j, {
116
+ children: /* @__PURE__ */ t(X, {
110
117
  categoryGuid: e.top_level_category_guid || "",
111
118
  merchantGuid: e.merchant_guid || "",
112
- size: v
119
+ size: D
113
120
  })
114
121
  }),
115
- /* @__PURE__ */ t(Xe, {
122
+ /* @__PURE__ */ t(qe, {
116
123
  displayValue: P ? e.institutionName : void 0,
117
124
  transaction: e,
118
125
  viewOnly: u || P
@@ -121,25 +128,25 @@ var v = 64, ot = 8, $ = {
121
128
  direction: "row",
122
129
  justifyContent: "space-between",
123
130
  sx: { minHeight: 44 },
124
- children: [/* @__PURE__ */ n(Ze, {
131
+ children: [/* @__PURE__ */ n(Je, {
125
132
  color: G ? "success.main" : "text.primary",
126
133
  variant: "h1",
127
- children: [G ? "+" : "", W(e.amount, "0,0.00")]
128
- }), !u && Z && /* @__PURE__ */ t(qe, { transaction: e })]
134
+ children: [G ? "+" : "", V(e.amount, "0,0.00")]
135
+ }), !u && J && /* @__PURE__ */ t(Ke, { transaction: e })]
129
136
  }),
130
- S && /* @__PURE__ */ t(Be, {
137
+ S && /* @__PURE__ */ t(ke, {
131
138
  beat: a,
132
- isCtaDisabled: Oe(S.primary_cta?.block, Q, I),
133
- onCtaClick: me,
139
+ isCtaDisabled: Me(S.primary_cta?.block, ee, I),
140
+ onCtaClick: ce,
134
141
  payload: S
135
142
  }),
136
- y === "error" && a && /* @__PURE__ */ t(Ne, {
143
+ y === "error" && a && /* @__PURE__ */ t(Be, {
137
144
  beat: a,
138
145
  variant: "plain"
139
146
  }),
140
- o?.instanceSlot && /* @__PURE__ */ t(Fe, {
147
+ o?.instanceSlot && /* @__PURE__ */ t(Re, {
141
148
  callToAction: o.callToAction,
142
- description: V(d.general.embedded_description, D.changetype, /* @__PURE__ */ t("strong", { children: D.percentageAmount })),
149
+ description: W(d.general.embedded_description, v.changetype, /* @__PURE__ */ t("strong", { children: v.percentageAmount })),
143
150
  instanceSlot: o.instanceSlot,
144
151
  onCtaClick: () => {
145
152
  B(!0);
@@ -148,9 +155,10 @@ var v = 64, ot = 8, $ = {
148
155
  }),
149
156
  /* @__PURE__ */ n(c, {
150
157
  sx: {
151
- bgcolor: ue,
158
+ bgcolor: pe,
152
159
  borderRadius: "4px",
153
160
  gap: 4,
161
+ mt: 16,
154
162
  p: 8
155
163
  },
156
164
  children: [/* @__PURE__ */ t(_, {
@@ -165,7 +173,7 @@ var v = 64, ot = 8, $ = {
165
173
  children: [/* @__PURE__ */ t(_, {
166
174
  color: "text.secondary",
167
175
  sx: {
168
- ...$,
176
+ ...Z,
169
177
  minWidth: 0
170
178
  },
171
179
  truncate: !0,
@@ -174,7 +182,7 @@ var v = 64, ot = 8, $ = {
174
182
  }), R && /* @__PURE__ */ t(_, {
175
183
  color: "text.secondary",
176
184
  sx: {
177
- ...$,
185
+ ...Z,
178
186
  flexShrink: 0
179
187
  },
180
188
  variant: "tiny",
@@ -184,13 +192,13 @@ var v = 64, ot = 8, $ = {
184
192
  })
185
193
  ]
186
194
  }),
187
- /* @__PURE__ */ t(X, {
195
+ /* @__PURE__ */ t(z, {
188
196
  square: !0,
189
- sx: { boxShadow: "none" },
190
- children: u ? /* @__PURE__ */ t(Ke, { transaction: e }) : /* @__PURE__ */ t(Y, { children: A.map((r, i) => /* @__PURE__ */ n(s.Fragment, { children: [
191
- r === h.Category && /* @__PURE__ */ t(Ge, { transaction: e }),
192
- r === h.Date && /* @__PURE__ */ t(Pe, { transaction: e }),
193
- r === h.Memo && /* @__PURE__ */ t(He, { transaction: e }),
197
+ sx: $,
198
+ children: u ? /* @__PURE__ */ t(Ye, { transaction: e }) : /* @__PURE__ */ t(Y, { children: A.map((r, i) => /* @__PURE__ */ n(s.Fragment, { children: [
199
+ r === h.Category && /* @__PURE__ */ t(Pe, { transaction: e }),
200
+ r === h.Date && /* @__PURE__ */ t(Ue, { transaction: e }),
201
+ r === h.Memo && /* @__PURE__ */ t(Xe, { transaction: e }),
194
202
  r === h.Tags && /* @__PURE__ */ t(ze, { transaction: e }),
195
203
  /* @__PURE__ */ t(K, {
196
204
  component: "li",
@@ -204,30 +212,30 @@ var v = 64, ot = 8, $ = {
204
212
  ml: 26,
205
213
  mt: 16,
206
214
  variant: "body1",
207
- children: re.actions
208
- }), /* @__PURE__ */ t(X, {
215
+ children: oe.actions
216
+ }), /* @__PURE__ */ t(z, {
209
217
  square: !0,
210
- sx: { boxShadow: "none" },
218
+ sx: $,
211
219
  children: /* @__PURE__ */ n(Y, { children: [C.map((r, i) => /* @__PURE__ */ n(s.Fragment, { children: [
212
- r === m.MerchantBudget && /* @__PURE__ */ t(Re, { transaction: e }),
220
+ r === m.MerchantBudget && /* @__PURE__ */ t(Ge, { transaction: e }),
213
221
  r === m.SplitTransaction && /* @__PURE__ */ t(je, { transaction: e }),
214
- r === m.HideTransaction && /* @__PURE__ */ t(We, { transaction: e }),
222
+ r === m.HideTransaction && /* @__PURE__ */ t(He, { transaction: e }),
215
223
  r === m.MerchantLogo && /* @__PURE__ */ t(Ve, { transaction: e }),
216
224
  /* @__PURE__ */ t(K, {
217
225
  component: "li",
218
226
  variant: i < C.length - 1 ? "inset" : "fullWidth"
219
227
  })
220
- ] }, r)), e.is_manual && !e.parent_guid && !e.has_been_split && /* @__PURE__ */ t(Ue, { transaction: e })] })
228
+ ] }, r)), e.is_manual && !e.parent_guid && !e.has_been_split && /* @__PURE__ */ t(We, { transaction: e })] })
221
229
  })] })
222
230
  ] }),
223
- a && o && /* @__PURE__ */ t(ke, {
224
- ariaLabel: ge(o?.dataSeries[l]?.date, pe.MONTH),
231
+ a && o && /* @__PURE__ */ t(Fe, {
232
+ ariaLabel: fe(o?.dataSeries[l]?.date, ge.MONTH),
225
233
  barChartProps: {
226
234
  amounts: {
227
235
  average: a.payload.average_amount,
228
- formattedAverage: W(a.payload.average_amount, "0,0")
236
+ formattedAverage: V(a.payload.average_amount, "0,0")
229
237
  },
230
- color: D.category?.color || "",
238
+ color: v.category?.color || "",
231
239
  data: o.chartData,
232
240
  margin: {
233
241
  bottom: 10,
@@ -252,51 +260,51 @@ var v = 64, ot = 8, $ = {
252
260
  },
253
261
  data: o.chartData,
254
262
  defaultSelectedIndex: l,
255
- icon: /* @__PURE__ */ t(j, {
263
+ icon: /* @__PURE__ */ t(X, {
256
264
  alt: e.description ?? "",
257
265
  categoryGuid: e.category_guid ?? "",
258
266
  merchantGuid: e.merchant_guid ?? "",
259
267
  size: 16
260
268
  }),
261
- isOpen: ae,
269
+ isOpen: ne,
262
270
  onClose: () => {
263
271
  B(!1), b(o.dataSeries.length - 1);
264
272
  },
265
273
  onTabChange: (r) => {
266
274
  b(r);
267
275
  },
268
- tipSection: ne ? void 0 : {
269
- message: V(d.general.tip_section_message, /* @__PURE__ */ t("strong", { children: d.general.tip_section_title }), /* @__PURE__ */ t("strong", { children: a.primary_transaction?.description })),
270
- onDismiss: () => se(!0)
276
+ tipSection: se ? void 0 : {
277
+ message: W(d.general.tip_section_message, /* @__PURE__ */ t("strong", { children: d.general.tip_section_title }), /* @__PURE__ */ t("strong", { children: a.primary_transaction?.description })),
278
+ onDismiss: () => de(!0)
271
279
  },
272
280
  title: d.general.transaction_history_title,
273
281
  transactionListProps: {
274
282
  showLoader: k,
275
283
  showInsights: !0,
276
- transaction: ce
284
+ transaction: ue
277
285
  }
278
286
  }),
279
- /* @__PURE__ */ t(rt, {
287
+ /* @__PURE__ */ t(ot, {
280
288
  anchorOrigin: {
281
289
  vertical: "bottom",
282
290
  horizontal: "right"
283
291
  },
284
292
  autoHideDuration: 3500,
285
293
  onClose: () => N(""),
286
- open: !!w,
287
- children: /* @__PURE__ */ t(tt, {
294
+ open: !!O,
295
+ children: /* @__PURE__ */ t(rt, {
288
296
  closeText: "",
289
297
  onClose: () => N(""),
290
298
  severity: "success",
291
299
  variant: "filled",
292
- children: w
300
+ children: O
293
301
  })
294
302
  })
295
303
  ]
296
304
  });
297
- }, Zt = $e(it);
305
+ }, Jt = Ze(at);
298
306
  export {
299
- Zt as default
307
+ Jt as default
300
308
  };
301
309
 
302
310
  //# sourceMappingURL=TransactionDetails.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionDetails.es.js","names":[],"sources":["../../../../src/transactions/components/shared/TransactionDetails.tsx"],"sourcesContent":["import React, { useMemo } from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Alert from '@mui/material/Alert'\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport List from '@mui/material/List'\nimport Paper from '@mui/material/Paper'\nimport Snackbar from '@mui/material/Snackbar'\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { MerchantLogo, P, Text } from '@mxenabled/mxui'\n\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { isBefore } from 'date-fns/isBefore'\nimport { startOfMonth } from 'date-fns/startOfMonth'\n\nimport {\n ANALYTICS_EVENTS,\n Loader,\n useAppConfig,\n useCategoryStore,\n useEvent,\n useGlobalCopyStore,\n useGlobalUiStore,\n useTransactionStore,\n useUserStore,\n} from '../../../common'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../core/constants'\nimport { type PrimaryCTA, Transaction, TransactionType } from '../../../core'\n// Leaf imports on purpose: the `insights-v2` barrel pulls in `mappings/blocks`, whose chart blocks\n// reach back into transactions code — the circular-import/TDZ trap `actionBlocksKey.ts` documents.\nimport { isContactSupportCtaDisabled } from '../../../insights-v2/actionBlocks/ContactSupportActionBlock'\nimport CompactInsightCard from '../../../insights-v2/components/CompactInsightCard'\nimport InsightErrorCard from '../../../insights-v2/components/InsightErrorCard'\nimport { actionBlocksKey } from '../../../insights-v2/mappings/actionBlocksKey'\nimport { resolveInsightRender } from '../../../insights-v2/resolveInsightRender'\nimport { fromUnixUTC } from '../../../core/utils/DateUtil'\nimport { isTransferTransaction } from '../../../core/utils/TransactionUtils'\nimport { isFeatureEnabled } from '../../../core/utils/UserUtils'\nimport { ChartTransactionWithDrillDown, EmbeddedCard } from '../../../insights'\n\nimport {\n BottomActions,\n DEFAULT_BOTTOM_ACTIONS,\n DEFAULT_TOP_ACTIONS,\n TopActions,\n} from '../../constants/Actions'\n\nimport {\n AddMerchantBudgetAction,\n CategoryAction,\n DateAction,\n DeleteAction,\n DeleteLogoAction,\n ExcludeAction,\n MemoAction,\n SplitAction,\n TagsAction,\n} from './transactiondetails/actions'\nimport Description from './transactiondetails/Description'\nimport FlagTransaction from './transactiondetails/FlagTransaction'\nimport TransactionDetailsView from './transactiondetails/TransactionDetailsView'\nimport { getEmbeddedInstanceSlotByBeatTemplates } from './getEmbeddedInstanceSlotByBeatTemplates'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { buildDynamicCopy } from '../../../core/utils/Localization'\n\nexport interface TransactionDetailsProps {\n bottomActions?: BottomActions[]\n canFlagTransaction?: boolean\n topActions?: TopActions[]\n transaction: Transaction\n shouldShowEmbeddedCard?: boolean\n /**\n * Opens the host's contact-support flow when the embedded insight card's CTA is\n * `contact_support_block`. This module cannot import the help module (hosts that don't ship the\n * Help widget stub the import — pulse's webpack `IgnorePlugin`), so the host supplies it. Without\n * it, or with the client's `enable_support_requests` off, the CTA renders disabled.\n */\n onContactSupport?: () => void\n}\n\nconst LOGO_SIZE = 64\n// Fixed per Figma; the theme's shape.borderRadius is client-configurable.\nconst LOGO_RADIUS = 8\n\n// Account feed line per Figma: 9/12 bold 700, uppercase, 0.27px tracking.\nconst FEED_LINE_SX = {\n fontWeight: 700,\n letterSpacing: '0.27px',\n textTransform: 'uppercase',\n} as const\n\nconst TransactionDetails: React.FC<TransactionDetailsProps> = ({\n bottomActions = DEFAULT_BOTTOM_ACTIONS,\n canFlagTransaction = true,\n topActions = DEFAULT_TOP_ACTIONS,\n transaction,\n shouldShowEmbeddedCard = true,\n onContactSupport,\n}) => {\n const { onEvent } = useEvent()\n const { config } = useAppConfig()\n const { isCopyLoaded } = useGlobalUiStore()\n const { userFeatures } = useUserStore()\n const { accounts: copy, common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n\n const { detailedCategories } = useCategoryStore()\n const {\n alert,\n associatedBeats,\n detailedTransactions,\n cachedStartDate,\n loadEmbeddedInstanceTransactions,\n setAlert,\n } = useTransactionStore()\n\n const [showTranscationDrilldownDrawer, setShowTransactionDrillDownDrawer] = React.useState(false)\n\n const [isLoading, setIsLoading] = React.useState(false)\n const [closeTipSection, setCloseTipSection] = React.useState(false)\n const theme = useTheme()\n\n const showFullNumber = transaction?.number && transaction.number.length > 4\n const maskedNumber = transaction?.number\n ? showFullNumber\n ? transaction.number\n : `\\u2022\\u2022\\u2022\\u2022${transaction.number}`\n : undefined\n\n const isCredit = transaction?.transaction_type === TransactionType.CREDIT\n\n const showInstitution = isTransferTransaction(transaction) && Boolean(transaction.institutionName)\n\n const beat = React.useMemo(() => {\n return associatedBeats.find((beat) => beat.associated_transaction_guid === transaction.guid)\n }, [associatedBeats, transaction])\n\n // Insights 2.0 (insights_v2.2.md §8.3, §10.1): branch on the beat the widget already matched from\n // its associated-beats fetch (which carries `widget_type=embedded`). `v2` renders the compact card\n // from the held envelope and `error` the error card, both in the slot above the account block;\n // only `legacy` runs the per-template switch below. There is deliberately no fetch on open.\n const insightRender = shouldShowEmbeddedCard ? resolveInsightRender(beat) : 'legacy'\n const v2Payload = insightRender === 'v2' ? beat?.insights_payload : undefined\n\n const embeddedData =\n shouldShowEmbeddedCard && insightRender === 'legacy'\n ? getEmbeddedInstanceSlotByBeatTemplates(commonCopy, beat)\n : null\n\n // `contact_support_block` hands off to the host's flow (see `onContactSupport`). The card itself\n // never opens anything; `isContactSupportCtaDisabled` keeps the CTA inert when it cannot be honoured.\n const handleV2CtaClick = (cta: PrimaryCTA) => {\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n onContactSupport?.()\n }\n }\n\n const [selectedTabIndex, setSelectedTabIndex] = React.useState(\n embeddedData ? embeddedData.dataSeries.length - 1 : 0,\n )\n\n React.useEffect(\n () =>\n onEvent(ANALYTICS_EVENTS.TRANSACTION_DETAILS_VIEW, { transaction_guid: transaction.guid }),\n [],\n )\n\n React.useEffect(() => {\n if (!embeddedData || embeddedData.dataSeries.length === 0) return\n\n const { date: selectedSeriesItemDate } = embeddedData.dataSeries[selectedTabIndex]\n\n const start = startOfMonth(selectedSeriesItemDate)\n\n if (isBefore(start, cachedStartDate)) {\n setIsLoading(true)\n loadEmbeddedInstanceTransactions(start).finally(() => {\n setIsLoading(false)\n })\n }\n }, [selectedTabIndex, embeddedData, cachedStartDate])\n\n //if merchant_guid is null then no need to show the MerchantBudget action.\n const updatedBottomActions =\n bottomActions.includes(BottomActions.MerchantBudget) && !transaction?.merchant_guid\n ? bottomActions.filter((action) => action !== BottomActions.MerchantBudget)\n : bottomActions\n\n const embeddedCardDataCategory = useMemo(() => {\n if (embeddedData) {\n const category = detailedCategories.find(\n (cat) => cat.guid === transaction.top_level_category_guid,\n )\n const mean = beat?.payload?.average_amount ?? 0\n const currentAmount = transaction.amount\n\n let changetype = insightsCopy.general.increased_text\n if (currentAmount - mean < 0) {\n changetype = insightsCopy.general.decreased_text\n }\n const percentageAmount =\n mean === 0 ? 0 : Math.round((Math.abs(currentAmount - mean) / mean) * 100)\n\n return { category, percentageAmount, changetype }\n }\n return null\n }, [embeddedData, detailedCategories])\n\n const filteredTransactions = useMemo(() => {\n if (!embeddedData?.dataSeries?.length) {\n return []\n }\n\n const { guid: selectedSeriesItemGuid, date: selectedSeriesItemDate } =\n embeddedData.dataSeries[selectedTabIndex]\n\n const start = startOfMonth(selectedSeriesItemDate)\n const end = endOfMonth(selectedSeriesItemDate)\n\n return detailedTransactions.filter((t) => {\n const transactionDate = fromUnixUTC(t.date)\n return transactionDate >= start && transactionDate <= end && t.guid === selectedSeriesItemGuid\n })\n }, [selectedTabIndex, embeddedData, detailedTransactions, isLoading])\n\n if (!isCopyLoaded) {\n return <Loader />\n }\n\n const shouldShowViewOnlyMode = isFeatureEnabled(userFeatures, 'MX_TXN_DETAILS_VIEW_ONLY')\n\n const bgColor = theme.palette.mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return (\n <Box className=\"mx-txn-transaction-details\" width=\"100%\">\n {transaction && (\n <Stack>\n <Stack gap={12} p={24}>\n <Box\n sx={{\n bgcolor: 'background.paper',\n borderRadius: `${LOGO_RADIUS}px`,\n height: LOGO_SIZE,\n overflow: 'hidden',\n width: LOGO_SIZE,\n }}\n >\n <MerchantLogo\n categoryGuid={transaction.top_level_category_guid || ''}\n merchantGuid={transaction.merchant_guid || ''}\n size={LOGO_SIZE}\n />\n </Box>\n\n <Description\n displayValue={showInstitution ? transaction.institutionName : undefined}\n transaction={transaction}\n viewOnly={shouldShowViewOnlyMode || showInstitution}\n />\n\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ minHeight: 44 }}>\n <P color={isCredit ? 'success.main' : 'text.primary'} variant=\"h1\">\n {isCredit ? '+' : ''}\n {formatCurrency(transaction.amount, '0,0.00')}\n </P>\n {!shouldShowViewOnlyMode && canFlagTransaction && (\n <FlagTransaction transaction={transaction} />\n )}\n </Stack>\n\n {v2Payload && (\n <CompactInsightCard\n beat={beat}\n isCtaDisabled={isContactSupportCtaDisabled(\n v2Payload.primary_cta?.block,\n config,\n onContactSupport,\n )}\n onCtaClick={handleV2CtaClick}\n payload={v2Payload}\n />\n )}\n {insightRender === 'error' && beat && <InsightErrorCard beat={beat} variant=\"plain\" />}\n {embeddedData?.instanceSlot && (\n <EmbeddedCard\n callToAction={embeddedData.callToAction}\n description={\n buildDynamicCopy(\n insightsCopy.general.embedded_description,\n embeddedCardDataCategory!.changetype,\n <strong>{embeddedCardDataCategory!.percentageAmount}</strong>,\n ) as string\n }\n instanceSlot={embeddedData.instanceSlot}\n onCtaClick={() => {\n setShowTransactionDrillDownDrawer(true)\n }}\n title={beat!.html_micro_title!}\n />\n )}\n <Stack sx={{ bgcolor: bgColor, borderRadius: '4px', gap: 4, p: 8 }}>\n <Text bold={true}>{transaction.account}</Text>\n <Stack\n alignItems=\"baseline\"\n data-testid=\"account-feed-line\"\n direction=\"row\"\n gap={4}\n sx={{ overflow: 'hidden' }}\n >\n <Text\n color=\"text.secondary\"\n sx={{ ...FEED_LINE_SX, minWidth: 0 }}\n truncate={true}\n variant=\"tiny\"\n >\n {transaction.feed_description}\n </Text>\n {maskedNumber && (\n <Text\n color=\"text.secondary\"\n sx={{ ...FEED_LINE_SX, flexShrink: 0 }}\n variant=\"tiny\"\n >\n {maskedNumber}\n </Text>\n )}\n </Stack>\n </Stack>\n </Stack>\n\n <Paper square={true} sx={{ boxShadow: 'none' }}>\n {shouldShowViewOnlyMode ? (\n <TransactionDetailsView transaction={transaction} />\n ) : (\n <List>\n {topActions.map((action, index) => (\n <React.Fragment key={action}>\n {action === TopActions.Category && <CategoryAction transaction={transaction} />}\n {action === TopActions.Date && <DateAction transaction={transaction} />}\n {action === TopActions.Memo && <MemoAction transaction={transaction} />}\n {action === TopActions.Tags && <TagsAction transaction={transaction} />}\n <Divider\n component=\"li\"\n variant={index < topActions.length - 1 ? 'inset' : 'fullWidth'}\n />\n </React.Fragment>\n ))}\n </List>\n )}\n </Paper>\n\n {!shouldShowViewOnlyMode && updatedBottomActions.length > 0 && (\n <React.Fragment>\n <Text bold={true} mb={8} ml={26} mt={16} variant=\"body1\">\n {copy.actions}\n </Text>\n\n <Paper square={true} sx={{ boxShadow: 'none' }}>\n <List>\n {updatedBottomActions.map((action, index) => (\n <React.Fragment key={action}>\n {action === BottomActions.MerchantBudget && (\n <AddMerchantBudgetAction transaction={transaction} />\n )}\n {action === BottomActions.SplitTransaction && (\n <SplitAction transaction={transaction} />\n )}\n {action === BottomActions.HideTransaction && (\n <ExcludeAction transaction={transaction} />\n )}\n {action === BottomActions.MerchantLogo && (\n <DeleteLogoAction transaction={transaction} />\n )}\n <Divider\n component=\"li\"\n variant={index < updatedBottomActions.length - 1 ? 'inset' : 'fullWidth'}\n />\n </React.Fragment>\n ))}\n\n {/*\n Show DeleteAction only if:\n - The transaction is manual\n - The transaction is NOT a parent transaction (no parent_guid)\n - The transaction has NOT been split (has_been_split is false)\n \n This ensures delete is hidden for parent or split transactions.\n */}\n {transaction.is_manual &&\n !transaction.parent_guid &&\n !transaction.has_been_split && <DeleteAction transaction={transaction} />}\n </List>\n </Paper>\n </React.Fragment>\n )}\n </Stack>\n )}\n {beat && embeddedData && (\n <ChartTransactionWithDrillDown\n ariaLabel={formatDate(\n embeddedData?.dataSeries[selectedTabIndex]?.date,\n DATE_FORMATS_INTL.MONTH,\n )}\n barChartProps={{\n amounts: {\n average: beat.payload.average_amount,\n formattedAverage: formatCurrency(beat.payload.average_amount, '0,0'),\n },\n color: embeddedCardDataCategory!.category?.color || '',\n data: embeddedData.chartData,\n margin: { bottom: 10, left: 24, right: 24, top: 20 },\n monthlyAmountLabel: insightsCopy.general.monthly_amount,\n onBarClick: (index) => {\n setSelectedTabIndex(index)\n },\n trendAmountLabel: insightsCopy.general.trend,\n legendPosition: 'top',\n }}\n beat={{\n heading: beat.html_title,\n subHeading: {\n category_guid: transaction.category_guid ?? '',\n merchant_guid: transaction.merchant_guid ?? '',\n description: transaction.description ?? '',\n },\n }}\n data={embeddedData.chartData}\n defaultSelectedIndex={selectedTabIndex}\n icon={\n <MerchantLogo\n alt={transaction.description ?? ''}\n categoryGuid={transaction.category_guid ?? ''}\n merchantGuid={transaction.merchant_guid ?? ''}\n size={16}\n />\n }\n isOpen={showTranscationDrilldownDrawer}\n onClose={() => {\n setShowTransactionDrillDownDrawer(false)\n setSelectedTabIndex(embeddedData!.dataSeries.length - 1)\n }}\n onTabChange={(index: number) => {\n setSelectedTabIndex(index)\n }}\n tipSection={\n !closeTipSection\n ? {\n message: buildDynamicCopy(\n insightsCopy.general.tip_section_message,\n <strong>{insightsCopy.general.tip_section_title}</strong>,\n <strong>{beat.primary_transaction?.description}</strong>,\n ) as string,\n onDismiss: () => setCloseTipSection(true),\n }\n : undefined\n }\n title={insightsCopy.general.transaction_history_title}\n transactionListProps={{\n showLoader: isLoading,\n showInsights: true,\n transaction: filteredTransactions,\n }}\n />\n )}\n <Snackbar\n anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}\n autoHideDuration={3500}\n onClose={() => setAlert('')}\n open={Boolean(alert)}\n >\n <Alert closeText=\"\" onClose={() => setAlert('')} severity=\"success\" variant=\"filled\">\n {alert}\n </Alert>\n </Snackbar>\n </Box>\n )\n}\n\nexport default observer(TransactionDetails)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA,IAAM,IAAY,IAEZ,KAAc,GAGd,IAAe;AAAA,EACnB,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,eAAe;AACjB,GAEM,KAAA,CAAyD,EAC7D,eAAA,IAAgB,IAChB,oBAAA,IAAqB,IACrB,YAAA,IAAa,IACb,aAAA,GACA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E,cAAc;AAAA,UAAE,UAAU;AAAA,UAAU,YAAY;AAAA,QAAQ;AAAA,QACxD,kBAAkB;AAAA,QAClB,SAAA,MAAe,EAAS,EAAE;AAAA,QAC1B,MAAM,EAAQ;AAAA,QAEd,UAAA,gBAAA,EAAC,IAAD;AAAA,UAAO,WAAU;AAAA,UAAG,SAAA,MAAe,EAAS,EAAE;AAAA,UAAG,UAAS;AAAA,UAAU,SAAQ;AAAA,UACzE,UAAA;AAAA,QACI,CAAA;AAAA,MACC,CAAA;AAAA,IACP;AAAA;AAET,GAEA,KAAe,GAAS,EAAkB"}
1
+ {"version":3,"file":"TransactionDetails.es.js","names":[],"sources":["../../../../src/transactions/components/shared/TransactionDetails.tsx"],"sourcesContent":["import React, { useMemo } from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Alert from '@mui/material/Alert'\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport List from '@mui/material/List'\nimport Paper from '@mui/material/Paper'\nimport Snackbar from '@mui/material/Snackbar'\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { MerchantLogo, P, Text } from '@mxenabled/mxui'\n\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { isBefore } from 'date-fns/isBefore'\nimport { startOfMonth } from 'date-fns/startOfMonth'\n\nimport {\n ANALYTICS_EVENTS,\n Loader,\n useAppConfig,\n useCategoryStore,\n useEvent,\n useGlobalCopyStore,\n useGlobalUiStore,\n useTransactionStore,\n useUserStore,\n} from '../../../common'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../core/constants'\nimport { type PrimaryCTA, Transaction, TransactionType } from '../../../core'\n// Leaf imports on purpose: the `insights-v2` barrel pulls in `mappings/blocks`, whose chart blocks\n// reach back into transactions code — the circular-import/TDZ trap `actionBlocksKey.ts` documents.\nimport { isContactSupportCtaDisabled } from '../../../insights-v2/actionBlocks/ContactSupportActionBlock'\nimport CompactInsightCard from '../../../insights-v2/components/CompactInsightCard'\nimport InsightErrorCard from '../../../insights-v2/components/InsightErrorCard'\nimport { actionBlocksKey } from '../../../insights-v2/mappings/actionBlocksKey'\nimport { resolveInsightRender } from '../../../insights-v2/resolveInsightRender'\nimport { fromUnixUTC } from '../../../core/utils/DateUtil'\nimport { isTransferTransaction } from '../../../core/utils/TransactionUtils'\nimport { isFeatureEnabled } from '../../../core/utils/UserUtils'\nimport { ChartTransactionWithDrillDown, EmbeddedCard } from '../../../insights'\n\nimport {\n BottomActions,\n DEFAULT_BOTTOM_ACTIONS,\n DEFAULT_TOP_ACTIONS,\n TopActions,\n} from '../../constants/Actions'\n\nimport {\n AddMerchantBudgetAction,\n CategoryAction,\n DateAction,\n DeleteAction,\n DeleteLogoAction,\n ExcludeAction,\n MemoAction,\n SplitAction,\n TagsAction,\n} from './transactiondetails/actions'\nimport Description from './transactiondetails/Description'\nimport FlagTransaction from './transactiondetails/FlagTransaction'\nimport TransactionDetailsView from './transactiondetails/TransactionDetailsView'\nimport { getEmbeddedInstanceSlotByBeatTemplates } from './getEmbeddedInstanceSlotByBeatTemplates'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { buildDynamicCopy } from '../../../core/utils/Localization'\n\nexport interface TransactionDetailsProps {\n bottomActions?: BottomActions[]\n canFlagTransaction?: boolean\n topActions?: TopActions[]\n transaction: Transaction\n shouldShowEmbeddedCard?: boolean\n /**\n * Opens the host's contact-support flow when the embedded insight card's CTA is\n * `contact_support_block`. This module cannot import the help module (hosts that don't ship the\n * Help widget stub the import — pulse's webpack `IgnorePlugin`), so the host supplies it. Without\n * it, or with the client's `enable_support_requests` off, the CTA renders disabled.\n */\n onContactSupport?: () => void\n}\n\nconst LOGO_SIZE = 64\n\n// Action rows per Figma: a 32px icon tile, so text starts at x68 (24 padding + 32 + 12 margin) and\n// the inset divider lines up with it. MUI's inset divider defaults to 72.\nconst ROWS_SX = {\n boxShadow: 'none',\n '& .MuiAvatar-root': { height: 32, width: 32 },\n '& .MuiDivider-inset': { marginLeft: '68px' },\n} as const\n// Fixed per Figma; the theme's shape.borderRadius is client-configurable.\nconst LOGO_RADIUS = 8\n\n// Account feed line per Figma: 9/12 bold 700, uppercase, 0.27px tracking.\nconst FEED_LINE_SX = {\n fontWeight: 700,\n letterSpacing: '0.27px',\n textTransform: 'uppercase',\n} as const\n\nconst TransactionDetails: React.FC<TransactionDetailsProps> = ({\n bottomActions = DEFAULT_BOTTOM_ACTIONS,\n canFlagTransaction = true,\n topActions = DEFAULT_TOP_ACTIONS,\n transaction,\n shouldShowEmbeddedCard = true,\n onContactSupport,\n}) => {\n const { onEvent } = useEvent()\n const { config } = useAppConfig()\n const { isCopyLoaded } = useGlobalUiStore()\n const { userFeatures } = useUserStore()\n const { accounts: copy, common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n\n const { detailedCategories } = useCategoryStore()\n const {\n alert,\n associatedBeats,\n detailedTransactions,\n cachedStartDate,\n loadEmbeddedInstanceTransactions,\n setAlert,\n } = useTransactionStore()\n\n const [showTranscationDrilldownDrawer, setShowTransactionDrillDownDrawer] = React.useState(false)\n\n const [isLoading, setIsLoading] = React.useState(false)\n const [closeTipSection, setCloseTipSection] = React.useState(false)\n const theme = useTheme()\n\n const showFullNumber = transaction?.number && transaction.number.length > 4\n const maskedNumber = transaction?.number\n ? showFullNumber\n ? transaction.number\n : `\\u2022\\u2022\\u2022\\u2022${transaction.number}`\n : undefined\n\n const isCredit = transaction?.transaction_type === TransactionType.CREDIT\n\n const showInstitution = isTransferTransaction(transaction) && Boolean(transaction.institutionName)\n\n const beat = React.useMemo(() => {\n return associatedBeats.find((beat) => beat.associated_transaction_guid === transaction.guid)\n }, [associatedBeats, transaction])\n\n // Insights 2.0 (insights_v2.2.md §8.3, §10.1): branch on the beat the widget already matched from\n // its associated-beats fetch (which carries `widget_type=embedded`). `v2` renders the compact card\n // from the held envelope and `error` the error card, both in the slot above the account block;\n // only `legacy` runs the per-template switch below. There is deliberately no fetch on open.\n const insightRender = shouldShowEmbeddedCard ? resolveInsightRender(beat) : 'legacy'\n const v2Payload = insightRender === 'v2' ? beat?.insights_payload : undefined\n\n const embeddedData =\n shouldShowEmbeddedCard && insightRender === 'legacy'\n ? getEmbeddedInstanceSlotByBeatTemplates(commonCopy, beat)\n : null\n\n // `contact_support_block` hands off to the host's flow (see `onContactSupport`). The card itself\n // never opens anything; `isContactSupportCtaDisabled` keeps the CTA inert when it cannot be honoured.\n const handleV2CtaClick = (cta: PrimaryCTA) => {\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n onContactSupport?.()\n }\n }\n\n const [selectedTabIndex, setSelectedTabIndex] = React.useState(\n embeddedData ? embeddedData.dataSeries.length - 1 : 0,\n )\n\n React.useEffect(\n () =>\n onEvent(ANALYTICS_EVENTS.TRANSACTION_DETAILS_VIEW, { transaction_guid: transaction.guid }),\n [],\n )\n\n React.useEffect(() => {\n if (!embeddedData || embeddedData.dataSeries.length === 0) return\n\n const { date: selectedSeriesItemDate } = embeddedData.dataSeries[selectedTabIndex]\n\n const start = startOfMonth(selectedSeriesItemDate)\n\n if (isBefore(start, cachedStartDate)) {\n setIsLoading(true)\n loadEmbeddedInstanceTransactions(start).finally(() => {\n setIsLoading(false)\n })\n }\n }, [selectedTabIndex, embeddedData, cachedStartDate])\n\n //if merchant_guid is null then no need to show the MerchantBudget action.\n const updatedBottomActions =\n bottomActions.includes(BottomActions.MerchantBudget) && !transaction?.merchant_guid\n ? bottomActions.filter((action) => action !== BottomActions.MerchantBudget)\n : bottomActions\n\n const embeddedCardDataCategory = useMemo(() => {\n if (embeddedData) {\n const category = detailedCategories.find(\n (cat) => cat.guid === transaction.top_level_category_guid,\n )\n const mean = beat?.payload?.average_amount ?? 0\n const currentAmount = transaction.amount\n\n let changetype = insightsCopy.general.increased_text\n if (currentAmount - mean < 0) {\n changetype = insightsCopy.general.decreased_text\n }\n const percentageAmount =\n mean === 0 ? 0 : Math.round((Math.abs(currentAmount - mean) / mean) * 100)\n\n return { category, percentageAmount, changetype }\n }\n return null\n }, [embeddedData, detailedCategories])\n\n const filteredTransactions = useMemo(() => {\n if (!embeddedData?.dataSeries?.length) {\n return []\n }\n\n const { guid: selectedSeriesItemGuid, date: selectedSeriesItemDate } =\n embeddedData.dataSeries[selectedTabIndex]\n\n const start = startOfMonth(selectedSeriesItemDate)\n const end = endOfMonth(selectedSeriesItemDate)\n\n return detailedTransactions.filter((t) => {\n const transactionDate = fromUnixUTC(t.date)\n return transactionDate >= start && transactionDate <= end && t.guid === selectedSeriesItemGuid\n })\n }, [selectedTabIndex, embeddedData, detailedTransactions, isLoading])\n\n if (!isCopyLoaded) {\n return <Loader />\n }\n\n const shouldShowViewOnlyMode = isFeatureEnabled(userFeatures, 'MX_TXN_DETAILS_VIEW_ONLY')\n\n const bgColor = theme.palette.mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return (\n <Box className=\"mx-txn-transaction-details\" width=\"100%\">\n {transaction && (\n <Stack>\n <Stack gap={8} p={24}>\n <Box\n sx={{\n bgcolor: 'background.paper',\n borderRadius: `${LOGO_RADIUS}px`,\n height: LOGO_SIZE,\n overflow: 'hidden',\n width: LOGO_SIZE,\n }}\n >\n <MerchantLogo\n categoryGuid={transaction.top_level_category_guid || ''}\n merchantGuid={transaction.merchant_guid || ''}\n size={LOGO_SIZE}\n />\n </Box>\n\n <Description\n displayValue={showInstitution ? transaction.institutionName : undefined}\n transaction={transaction}\n viewOnly={shouldShowViewOnlyMode || showInstitution}\n />\n\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ minHeight: 44 }}>\n <P color={isCredit ? 'success.main' : 'text.primary'} variant=\"h1\">\n {isCredit ? '+' : ''}\n {formatCurrency(transaction.amount, '0,0.00')}\n </P>\n {!shouldShowViewOnlyMode && canFlagTransaction && (\n <FlagTransaction transaction={transaction} />\n )}\n </Stack>\n\n {v2Payload && (\n <CompactInsightCard\n beat={beat}\n isCtaDisabled={isContactSupportCtaDisabled(\n v2Payload.primary_cta?.block,\n config,\n onContactSupport,\n )}\n onCtaClick={handleV2CtaClick}\n payload={v2Payload}\n />\n )}\n {insightRender === 'error' && beat && <InsightErrorCard beat={beat} variant=\"plain\" />}\n {embeddedData?.instanceSlot && (\n <EmbeddedCard\n callToAction={embeddedData.callToAction}\n description={\n buildDynamicCopy(\n insightsCopy.general.embedded_description,\n embeddedCardDataCategory!.changetype,\n <strong>{embeddedCardDataCategory!.percentageAmount}</strong>,\n ) as string\n }\n instanceSlot={embeddedData.instanceSlot}\n onCtaClick={() => {\n setShowTransactionDrillDownDrawer(true)\n }}\n title={beat!.html_micro_title!}\n />\n )}\n {/* 24px below the amount: mt 16 plus the parent's 8px gap. */}\n <Stack sx={{ bgcolor: bgColor, borderRadius: '4px', gap: 4, mt: 16, p: 8 }}>\n <Text bold={true}>{transaction.account}</Text>\n <Stack\n alignItems=\"baseline\"\n data-testid=\"account-feed-line\"\n direction=\"row\"\n gap={4}\n sx={{ overflow: 'hidden' }}\n >\n <Text\n color=\"text.secondary\"\n sx={{ ...FEED_LINE_SX, minWidth: 0 }}\n truncate={true}\n variant=\"tiny\"\n >\n {transaction.feed_description}\n </Text>\n {maskedNumber && (\n <Text\n color=\"text.secondary\"\n sx={{ ...FEED_LINE_SX, flexShrink: 0 }}\n variant=\"tiny\"\n >\n {maskedNumber}\n </Text>\n )}\n </Stack>\n </Stack>\n </Stack>\n\n <Paper square={true} sx={ROWS_SX}>\n {shouldShowViewOnlyMode ? (\n <TransactionDetailsView transaction={transaction} />\n ) : (\n <List>\n {topActions.map((action, index) => (\n <React.Fragment key={action}>\n {action === TopActions.Category && <CategoryAction transaction={transaction} />}\n {action === TopActions.Date && <DateAction transaction={transaction} />}\n {action === TopActions.Memo && <MemoAction transaction={transaction} />}\n {action === TopActions.Tags && <TagsAction transaction={transaction} />}\n <Divider\n component=\"li\"\n variant={index < topActions.length - 1 ? 'inset' : 'fullWidth'}\n />\n </React.Fragment>\n ))}\n </List>\n )}\n </Paper>\n\n {!shouldShowViewOnlyMode && updatedBottomActions.length > 0 && (\n <React.Fragment>\n <Text bold={true} mb={8} ml={26} mt={16} variant=\"body1\">\n {copy.actions}\n </Text>\n\n <Paper square={true} sx={ROWS_SX}>\n <List>\n {updatedBottomActions.map((action, index) => (\n <React.Fragment key={action}>\n {action === BottomActions.MerchantBudget && (\n <AddMerchantBudgetAction transaction={transaction} />\n )}\n {action === BottomActions.SplitTransaction && (\n <SplitAction transaction={transaction} />\n )}\n {action === BottomActions.HideTransaction && (\n <ExcludeAction transaction={transaction} />\n )}\n {action === BottomActions.MerchantLogo && (\n <DeleteLogoAction transaction={transaction} />\n )}\n <Divider\n component=\"li\"\n variant={index < updatedBottomActions.length - 1 ? 'inset' : 'fullWidth'}\n />\n </React.Fragment>\n ))}\n\n {/*\n Show DeleteAction only if:\n - The transaction is manual\n - The transaction is NOT a parent transaction (no parent_guid)\n - The transaction has NOT been split (has_been_split is false)\n \n This ensures delete is hidden for parent or split transactions.\n */}\n {transaction.is_manual &&\n !transaction.parent_guid &&\n !transaction.has_been_split && <DeleteAction transaction={transaction} />}\n </List>\n </Paper>\n </React.Fragment>\n )}\n </Stack>\n )}\n {beat && embeddedData && (\n <ChartTransactionWithDrillDown\n ariaLabel={formatDate(\n embeddedData?.dataSeries[selectedTabIndex]?.date,\n DATE_FORMATS_INTL.MONTH,\n )}\n barChartProps={{\n amounts: {\n average: beat.payload.average_amount,\n formattedAverage: formatCurrency(beat.payload.average_amount, '0,0'),\n },\n color: embeddedCardDataCategory!.category?.color || '',\n data: embeddedData.chartData,\n margin: { bottom: 10, left: 24, right: 24, top: 20 },\n monthlyAmountLabel: insightsCopy.general.monthly_amount,\n onBarClick: (index) => {\n setSelectedTabIndex(index)\n },\n trendAmountLabel: insightsCopy.general.trend,\n legendPosition: 'top',\n }}\n beat={{\n heading: beat.html_title,\n subHeading: {\n category_guid: transaction.category_guid ?? '',\n merchant_guid: transaction.merchant_guid ?? '',\n description: transaction.description ?? '',\n },\n }}\n data={embeddedData.chartData}\n defaultSelectedIndex={selectedTabIndex}\n icon={\n <MerchantLogo\n alt={transaction.description ?? ''}\n categoryGuid={transaction.category_guid ?? ''}\n merchantGuid={transaction.merchant_guid ?? ''}\n size={16}\n />\n }\n isOpen={showTranscationDrilldownDrawer}\n onClose={() => {\n setShowTransactionDrillDownDrawer(false)\n setSelectedTabIndex(embeddedData!.dataSeries.length - 1)\n }}\n onTabChange={(index: number) => {\n setSelectedTabIndex(index)\n }}\n tipSection={\n !closeTipSection\n ? {\n message: buildDynamicCopy(\n insightsCopy.general.tip_section_message,\n <strong>{insightsCopy.general.tip_section_title}</strong>,\n <strong>{beat.primary_transaction?.description}</strong>,\n ) as string,\n onDismiss: () => setCloseTipSection(true),\n }\n : undefined\n }\n title={insightsCopy.general.transaction_history_title}\n transactionListProps={{\n showLoader: isLoading,\n showInsights: true,\n transaction: filteredTransactions,\n }}\n />\n )}\n <Snackbar\n anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}\n autoHideDuration={3500}\n onClose={() => setAlert('')}\n open={Boolean(alert)}\n >\n <Alert closeText=\"\" onClose={() => setAlert('')} severity=\"success\" variant=\"filled\">\n {alert}\n </Alert>\n </Snackbar>\n </Box>\n )\n}\n\nexport default observer(TransactionDetails)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA,IAAM,IAAY,IAIZ,IAAU;AAAA,EACd,WAAW;AAAA,EACX,qBAAqB;AAAA,IAAE,QAAQ;AAAA,IAAI,OAAO;AAAA,EAAG;AAAA,EAC7C,uBAAuB,EAAE,YAAY,OAAO;AAC9C,GAEM,KAAc,GAGd,IAAe;AAAA,EACnB,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,eAAe;AACjB,GAEM,KAAA,CAAyD,EAC7D,eAAA,IAAgB,IAChB,oBAAA,IAAqB,IACrB,YAAA,IAAa,IACb,aAAA,GACA,wBAAA,IAAyB,IACzB,kBAAA,EAAA,MACI;AACJ,QAAM,EAAE,SAAA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A,QAClB,SAAA,MAAe,EAAS,EAAE;AAAA,QAC1B,MAAM,EAAQ;AAAA,QAEd,UAAA,gBAAA,EAAC,IAAD;AAAA,UAAO,WAAU;AAAA,UAAG,SAAA,MAAe,EAAS,EAAE;AAAA,UAAG,UAAS;AAAA,UAAU,SAAQ;AAAA,UACzE,UAAA;AAAA,QACI,CAAA;AAAA,MACC,CAAA;AAAA,IACP;AAAA;AAET,GAEA,KAAe,GAAS,EAAkB"}
@@ -1,10 +1,10 @@
1
- import { useEvent as E, useGlobalCopyStore as h, useTransactionStore as R } from "../../../../common/context/hooks.es.js";
2
- import { useAriaLive as S } from "../../../../common/hooks/useAriaLive.es.js";
3
- import { ANALYTICS_EVENTS as v } from "../../../../common/constants/Analytics.es.js";
4
- import { ON_CLICK_EVENTS as x } from "../../../constants/OnClickEvents.es.js";
1
+ import { useEvent as E, useGlobalCopyStore as h, useTransactionStore as x } from "../../../../common/context/hooks.es.js";
2
+ import { useAriaLive as R } from "../../../../common/hooks/useAriaLive.es.js";
3
+ import { ANALYTICS_EVENTS as S } from "../../../../common/constants/Analytics.es.js";
4
+ import { ON_CLICK_EVENTS as v } from "../../../constants/OnClickEvents.es.js";
5
5
  import n from "react";
6
- import { observer as N } from "mobx-react-lite";
7
- import y from "@mui/material/Stack";
6
+ import { observer as y } from "mobx-react-lite";
7
+ import N from "@mui/material/Stack";
8
8
  import { Icon as L, Text as O } from "@mxenabled/mxui";
9
9
  import A from "@mui/material/Button";
10
10
  import { jsx as e, jsxs as a } from "react/jsx-runtime";
@@ -13,14 +13,14 @@ import D from "@mui/material/IconButton";
13
13
  import k from "@mui/material/TextField";
14
14
  import w from "@mui/material/FormGroup";
15
15
  var K = ({ transaction: o, viewOnly: p = !1, displayValue: s }) => {
16
- const l = p || !!s, { updateTransaction: f } = R(), { common: I, transactions: t } = h(), { onEvent: c } = E(), { announce: T, ariaLive: _ } = S(), [r, d] = n.useState(!1), [i, u] = n.useState(""), m = n.useRef(null);
16
+ const l = p || !!s, { updateTransaction: f } = x(), { common: I, transactions: t } = h(), { onEvent: c } = E(), { announce: T, ariaLive: _ } = R(), [r, d] = n.useState(!1), [i, u] = n.useState(""), m = n.useRef(null);
17
17
  n.useEffect(() => {
18
18
  r && (u(o.description), m?.current?.focus());
19
19
  }, [r]);
20
20
  const C = () => {
21
- d(!0), c(x.ON_TRANSACTION_DESCRIPTION_EDIT_CLICK), setTimeout(() => document.getElementById("transaction-description-input")?.focus(), 0);
21
+ d(!0), c(v.ON_TRANSACTION_DESCRIPTION_EDIT_CLICK), setTimeout(() => document.getElementById("transaction-description-input")?.focus(), 0);
22
22
  }, b = async () => {
23
- c(v.TRANSACTION_DETAILS_CLICK_DESCRIPTION, { transaction_guid: o.guid }), await f({
23
+ c(S.TRANSACTION_DETAILS_CLICK_DESCRIPTION, { transaction_guid: o.guid }), await f({
24
24
  ...o,
25
25
  description: i
26
26
  }), d(!1), T(`${t.payee_title}: ${i}`), setTimeout(() => document.getElementById("transaction-description-edit-button")?.focus(), 0);
@@ -57,11 +57,11 @@ var K = ({ transaction: o, viewOnly: p = !1, displayValue: s }) => {
57
57
  variant: "outlined",
58
58
  children: I.save_button
59
59
  })]
60
- }) : /* @__PURE__ */ a(y, {
60
+ }) : /* @__PURE__ */ a(N, {
61
61
  alignItems: "center",
62
62
  direction: "row",
63
63
  gap: 4,
64
- sx: { minHeight: 44 },
64
+ sx: { minHeight: 24 },
65
65
  children: [/* @__PURE__ */ e(O, {
66
66
  bold: !0,
67
67
  children: s ?? o.description
@@ -69,7 +69,10 @@ var K = ({ transaction: o, viewOnly: p = !1, displayValue: s }) => {
69
69
  "aria-label": t.payee_edit,
70
70
  id: "transaction-description-edit-button",
71
71
  onClick: C,
72
- sx: { color: "action.active" },
72
+ sx: {
73
+ color: "action.active",
74
+ my: "-10px"
75
+ },
73
76
  children: /* @__PURE__ */ e(L, {
74
77
  name: "create",
75
78
  size: 22
@@ -77,7 +80,7 @@ var K = ({ transaction: o, viewOnly: p = !1, displayValue: s }) => {
77
80
  })]
78
81
  })]
79
82
  });
80
- }, W = N(K);
83
+ }, W = y(K);
81
84
  export {
82
85
  W as default
83
86
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Description.es.js","names":[],"sources":["../../../../../src/transactions/components/shared/transactiondetails/Description.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport FormGroup from '@mui/material/FormGroup'\nimport IconButton from '@mui/material/IconButton'\nimport Stack from '@mui/material/Stack'\nimport TextField from '@mui/material/TextField'\n\nimport { Icon, Text } from '@mxenabled/mxui'\n\nimport type { Transaction } from '../../../../core'\n\nimport {\n ANALYTICS_EVENTS,\n useEvent,\n useGlobalCopyStore,\n useTransactionStore,\n} from '../../../../common'\nimport { useAriaLive } from '../../../../common/hooks/useAriaLive'\nimport { ON_CLICK_EVENTS } from '../../../constants/OnClickEvents'\n\ninterface DescriptionProps {\n transaction: Transaction\n viewOnly?: boolean\n // Overrides the displayed value (e.g. institution name on transfers) while\n // leaving the underlying transaction description untouched. A display override\n // is inherently read-only, so it also suppresses the edit affordance.\n displayValue?: string\n}\n\nconst Description: React.FC<DescriptionProps> = ({\n transaction,\n viewOnly = false,\n displayValue,\n}) => {\n const isReadOnly = viewOnly || Boolean(displayValue)\n const { updateTransaction } = useTransactionStore()\n const { common: commonCopy, transactions: copy } = useGlobalCopyStore()\n const { onEvent } = useEvent()\n const { announce, ariaLive } = useAriaLive()\n\n const [isEditing, setIsEditing] = React.useState(false)\n const [description, setDescription] = React.useState('')\n\n const inputRef = React.useRef<HTMLInputElement>(null)\n\n React.useEffect(() => {\n if (isEditing) {\n setDescription(transaction.description)\n inputRef?.current?.focus()\n }\n }, [isEditing])\n\n const handleEdit = () => {\n setIsEditing(true)\n onEvent(ON_CLICK_EVENTS.ON_TRANSACTION_DESCRIPTION_EDIT_CLICK)\n setTimeout(() => document.getElementById(`transaction-description-input`)?.focus(), 0)\n }\n\n const handleSave = async () => {\n onEvent(ANALYTICS_EVENTS.TRANSACTION_DETAILS_CLICK_DESCRIPTION, {\n transaction_guid: transaction.guid,\n })\n await updateTransaction({ ...transaction, description })\n setIsEditing(false)\n announce(`${copy.payee_title}: ${description}`)\n setTimeout(() => document.getElementById(`transaction-description-edit-button`)?.focus(), 0)\n }\n\n return (\n <Box className=\"mx-txn-transaction-description\">\n {ariaLive}\n {isEditing ? (\n <FormGroup row={true}>\n <TextField\n aria-label={copy.payee_title}\n id={`transaction-description-input`}\n label={copy.payee_title}\n name={copy.payee_title}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => setDescription(e.target.value)}\n ref={inputRef}\n slotProps={{ htmlInput: { maxLength: 140 } }}\n sx={{\n backgroundColor: 'background.paper',\n '.MuiOutlinedInput-root': { borderTopRightRadius: 0, borderBottomRightRadius: 0 },\n '.MuiOutlinedInput-input': { p: 11 },\n width: 250,\n }}\n value={description}\n />\n <Button\n disabled={!description}\n onClick={handleSave}\n sx={{\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n }}\n variant=\"outlined\"\n >\n {commonCopy.save_button}\n </Button>\n </FormGroup>\n ) : (\n <Stack alignItems=\"center\" direction=\"row\" gap={4} sx={{ minHeight: 44 }}>\n <Text bold={true}>{displayValue ?? transaction.description}</Text>\n {!isReadOnly && (\n <IconButton\n aria-label={copy.payee_edit}\n id={`transaction-description-edit-button`}\n onClick={handleEdit}\n sx={{ color: 'action.active' }}\n >\n <Icon name=\"create\" size={22} />\n </IconButton>\n )}\n </Stack>\n )}\n </Box>\n )\n}\n\nexport default observer(Description)\n"],"mappings":";;;;;;;;;;;;;;AAgCA,IAAM,IAAA,CAA2C,EAC/C,aAAA,GACA,UAAA,IAAW,IACX,cAAA,EAAA,MACI;AACJ,QAAM,IAAa,KAAY,EAAQ,GACjC,EAAE,mBAAA,EAAA,IAAsB,EAAoB,GAC5C,EAAE,QAAQ,GAAY,cAAc,EAAA,IAAS,EAAmB,GAChE,EAAE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A,YAAE,sBAAsB;AAAA,YAAG,yBAAyB;AAAA,UAAE;AAAA,UAChF,2BAA2B,EAAE,GAAG,GAAG;AAAA,UACnC,OAAO;AAAA,QACT;AAAA,QACA,OAAO;AAAA,MACR,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,QACE,UAAU,CAAC;AAAA,QACX,SAAS;AAAA,QACT,IAAI;AAAA,UACF,qBAAqB;AAAA,UACrB,wBAAwB;AAAA,QAC1B;AAAA,QACA,SAAQ;AAAA,QAEP,UAAA,EAAW;AAAA,MACN,CAAA,CACC;AAAA,IAEX,CAAA,IAAA,gBAAA,EAAC,GAAD;AAAA,MAAO,YAAW;AAAA,MAAS,WAAU;AAAA,MAAM,KAAK;AAAA,MAAG,IAAI,EAAE,WAAW,GAAG;AAAA,MAAvE,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM;AAAA,QAAO,UAAA,KAAgB,EAAY;AAAA,MAAkB,CAAA,GAChE,CAAC,KACA,gBAAA,EAAC,GAAD;AAAA,QACE,cAAY,EAAK;AAAA,QACjB,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI,EAAE,OAAO,gBAAgB;AAAA,QAE7B,UAAA,gBAAA,EAAC,GAAD;AAAA,UAAM,MAAK;AAAA,UAAS,MAAM;AAAA,QAAK,CAAA;AAAA,MACrB,CAAA,CAET;AAAA,IAEN,CAAA,CAAA;AAAA;AAET,GAEA,IAAe,EAAS,CAAW"}
1
+ {"version":3,"file":"Description.es.js","names":[],"sources":["../../../../../src/transactions/components/shared/transactiondetails/Description.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport FormGroup from '@mui/material/FormGroup'\nimport IconButton from '@mui/material/IconButton'\nimport Stack from '@mui/material/Stack'\nimport TextField from '@mui/material/TextField'\n\nimport { Icon, Text } from '@mxenabled/mxui'\n\nimport type { Transaction } from '../../../../core'\n\nimport {\n ANALYTICS_EVENTS,\n useEvent,\n useGlobalCopyStore,\n useTransactionStore,\n} from '../../../../common'\nimport { useAriaLive } from '../../../../common/hooks/useAriaLive'\nimport { ON_CLICK_EVENTS } from '../../../constants/OnClickEvents'\n\ninterface DescriptionProps {\n transaction: Transaction\n viewOnly?: boolean\n // Overrides the displayed value (e.g. institution name on transfers) while\n // leaving the underlying transaction description untouched. A display override\n // is inherently read-only, so it also suppresses the edit affordance.\n displayValue?: string\n}\n\nconst Description: React.FC<DescriptionProps> = ({\n transaction,\n viewOnly = false,\n displayValue,\n}) => {\n const isReadOnly = viewOnly || Boolean(displayValue)\n const { updateTransaction } = useTransactionStore()\n const { common: commonCopy, transactions: copy } = useGlobalCopyStore()\n const { onEvent } = useEvent()\n const { announce, ariaLive } = useAriaLive()\n\n const [isEditing, setIsEditing] = React.useState(false)\n const [description, setDescription] = React.useState('')\n\n const inputRef = React.useRef<HTMLInputElement>(null)\n\n React.useEffect(() => {\n if (isEditing) {\n setDescription(transaction.description)\n inputRef?.current?.focus()\n }\n }, [isEditing])\n\n const handleEdit = () => {\n setIsEditing(true)\n onEvent(ON_CLICK_EVENTS.ON_TRANSACTION_DESCRIPTION_EDIT_CLICK)\n setTimeout(() => document.getElementById(`transaction-description-input`)?.focus(), 0)\n }\n\n const handleSave = async () => {\n onEvent(ANALYTICS_EVENTS.TRANSACTION_DETAILS_CLICK_DESCRIPTION, {\n transaction_guid: transaction.guid,\n })\n await updateTransaction({ ...transaction, description })\n setIsEditing(false)\n announce(`${copy.payee_title}: ${description}`)\n setTimeout(() => document.getElementById(`transaction-description-edit-button`)?.focus(), 0)\n }\n\n return (\n <Box className=\"mx-txn-transaction-description\">\n {ariaLive}\n {isEditing ? (\n <FormGroup row={true}>\n <TextField\n aria-label={copy.payee_title}\n id={`transaction-description-input`}\n label={copy.payee_title}\n name={copy.payee_title}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => setDescription(e.target.value)}\n ref={inputRef}\n slotProps={{ htmlInput: { maxLength: 140 } }}\n sx={{\n backgroundColor: 'background.paper',\n '.MuiOutlinedInput-root': { borderTopRightRadius: 0, borderBottomRightRadius: 0 },\n '.MuiOutlinedInput-input': { p: 11 },\n width: 250,\n }}\n value={description}\n />\n <Button\n disabled={!description}\n onClick={handleSave}\n sx={{\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n }}\n variant=\"outlined\"\n >\n {commonCopy.save_button}\n </Button>\n </FormGroup>\n ) : (\n <Stack alignItems=\"center\" direction=\"row\" gap={4} sx={{ minHeight: 24 }}>\n <Text bold={true}>{displayValue ?? transaction.description}</Text>\n {!isReadOnly && (\n <IconButton\n aria-label={copy.payee_edit}\n id={`transaction-description-edit-button`}\n onClick={handleEdit}\n // 44px tap target, but only 24px of layout height (Figma's name row).\n sx={{ color: 'action.active', my: '-10px' }}\n >\n <Icon name=\"create\" size={22} />\n </IconButton>\n )}\n </Stack>\n )}\n </Box>\n )\n}\n\nexport default observer(Description)\n"],"mappings":";;;;;;;;;;;;;;AAgCA,IAAM,IAAA,CAA2C,EAC/C,aAAA,GACA,UAAA,IAAW,IACX,cAAA,EAAA,MACI;AACJ,QAAM,IAAa,KAAY,EAAQ,GACjC,EAAE,mBAAA,EAAA,IAAsB,EAAoB,GAC5C,EAAE,QAAQ,GAAY,cAAc,EAAA,IAAS,EAAmB,GAChE,EAAE,SAAA,EAAA,IAAY,EAAS,GACvB,EAAE,UAAA,GAAU,UAAA,EAAA,IAAa,EAAY,GAErC,CAAC,GAAW,CAAA,IAAgB,EAAM,SAAS,EAAK,GAChD,CAAC,GAAa,CAAA,IAAkB,EAAM,SAAS,EAAE,GAEjD,IAAW,EAAM,OAAyB,IAAI;AAEpD,EAAA,EAAM,UAAA,MAAgB;AACpB,IAAI,MACF,EAAe,EAAY,WAAW,GACtC,GAAU,SAAS,MAAM;AAAA,EAE7B,GAAG,CAAC,CAAS,CAAC;AAEd,QAAM,IAAA,MAAmB;AACvB,IAAA,EAAa,EAAI,GACjB,EAAQ,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,MAAO,YAAW;AAAA,MAAS,WAAU;AAAA,MAAM,KAAK;AAAA,MAAG,IAAI,EAAE,WAAW,GAAG;AAAA,MAAvE,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM;AAAA,QAAO,UAAA,KAAgB,EAAY;AAAA,MAAkB,CAAA,GAChE,CAAC,KACA,gBAAA,EAAC,GAAD;AAAA,QACE,cAAY,EAAK;AAAA,QACjB,IAAI;AAAA,QACJ,SAAS;AAAA,QAET,IAAI;AAAA,UAAE,OAAO;AAAA,UAAiB,IAAI;AAAA,QAAQ;AAAA,QAE1C,UAAA,gBAAA,EAAC,GAAD;AAAA,UAAM,MAAK;AAAA,UAAS,MAAM;AAAA,QAAK,CAAA;AAAA,MACrB,CAAA,CAET;AAAA,IAEN,CAAA,CAAA;AAAA;AAET,GAEA,IAAe,EAAS,CAAW"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "9.7.63",
3
+ "version": "9.7.65",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",