@mx-cartographer/experiences 9.7.198 → 9.7.199-alpha-moratorium

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/dist/core/types/Insights.d.ts +1 -1
  3. package/dist/core/types/Insights.es.js.map +1 -1
  4. package/dist/core/types/localization/InsightsFeedCopy.d.ts +2 -0
  5. package/dist/insights/components/insights/BillAmountNotStandard/BillAmountNotStandard.es.js +4 -4
  6. package/dist/insights/components/insights/BillAmountNotStandard/BillAmountNotStandardMUI.es.js +4 -4
  7. package/dist/insights/components/insights/MonthlySpendingComparisonV2/MonthlySpendingComparisonV2.es.js +4 -4
  8. package/dist/insights/components/insights/WeeklyNoSpendDays/WeeklyNoSpendDays.es.js +8 -8
  9. package/dist/insights/components/shared/Charts/EmptyBarChart.es.js +4 -4
  10. package/dist/insights/components/shared/ZeroState/LinedCardZeroState.es.js +4 -4
  11. package/dist/insights/index.es.js +84 -84
  12. package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsV2.es.js +17 -17
  13. package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsV2.es.js.map +1 -1
  14. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.d.ts +1 -5
  15. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.es.js +37 -36
  16. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.es.js.map +1 -1
  17. package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.d.ts +9 -11
  18. package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.es.js +12 -6
  19. package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.es.js.map +1 -1
  20. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.d.ts +3 -1
  21. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js +12 -11
  22. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js.map +1 -1
  23. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.d.ts +2 -2
  24. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js +13 -13
  25. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js.map +1 -1
  26. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.d.ts +10 -4
  27. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js +78 -71
  28. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js.map +1 -1
  29. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.d.ts +2 -4
  30. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.es.js +78 -82
  31. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.es.js.map +1 -1
  32. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +30 -24
  33. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
  34. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.d.ts +7 -0
  35. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.es.js +46 -0
  36. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.es.js.map +1 -0
  37. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/index.d.ts +3 -0
  38. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.d.ts +10 -0
  39. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.es.js +17 -0
  40. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.es.js.map +1 -0
  41. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js +25 -25
  42. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js.map +1 -1
  43. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.d.ts +0 -2
  44. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js +17 -21
  45. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js.map +1 -1
  46. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js +46 -63
  47. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js.map +1 -1
  48. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.d.ts +3 -3
  49. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js +44 -53
  50. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js.map +1 -1
  51. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.d.ts +1 -1
  52. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js +30 -31
  53. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js.map +1 -1
  54. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +54 -53
  55. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
  56. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +5 -3
  57. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +11 -9
  58. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
  59. package/dist/insights-v2/blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js +28 -27
  60. package/dist/insights-v2/blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js.map +1 -1
  61. package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +1 -0
  62. package/dist/insights-v2/components/AccountHeroCard.d.ts +3 -1
  63. package/dist/insights-v2/components/AccountHeroCard.es.js.map +1 -1
  64. package/dist/insights-v2/components/CompactDirectDepositCard.d.ts +26 -0
  65. package/dist/insights-v2/components/CompactDirectDepositCard.es.js +73 -0
  66. package/dist/insights-v2/components/CompactDirectDepositCard.es.js.map +1 -0
  67. package/dist/insights-v2/components/DirectDepositCard.d.ts +6 -1
  68. package/dist/insights-v2/components/DirectDepositCard.es.js +22 -20
  69. package/dist/insights-v2/components/DirectDepositCard.es.js.map +1 -1
  70. package/dist/insights-v2/components/LogoFromGuid.d.ts +1 -1
  71. package/dist/insights-v2/components/LogoFromGuid.es.js.map +1 -1
  72. package/dist/insights-v2/components/MerchantHighlightCard.es.js +4 -4
  73. package/dist/insights-v2/components/TransactionListCard.d.ts +3 -1
  74. package/dist/insights-v2/components/TransactionListCard.es.js +25 -25
  75. package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
  76. package/dist/insights-v2/components/TransferLogoCard.es.js +1 -0
  77. package/dist/insights-v2/components/TransferLogoCard.es.js.map +1 -1
  78. package/dist/insights-v2/index.es.js +120 -116
  79. package/dist/insights-v2/mappings/blocks.es.js +118 -116
  80. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  81. package/dist/microinsights/cards/InsightCard.es.js +53 -53
  82. package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
  83. package/package.json +1 -1
@@ -2,21 +2,20 @@ import { buildDynamicCopy as L, buildPluralCopy as y } from "../../../../core/ut
2
2
  import { useGlobalCopyStore as B, useInsightsV2Store as M, useTransactionStore as D } from "../../../../common/context/hooks.es.js";
3
3
  import { QUIZ_CONTEXT as c, QUIZ_VARIANTS as O, isTopMerchant as K, merchantKey as S, quizMerchantLogo as q, rankQuizMerchants as Q, readQuizMerchants as W } from "./quiz.es.js";
4
4
  import { actionBlocksKey as F } from "../../../mappings/actionBlocksKey.es.js";
5
- import { SMALL_CARD_SHADOW as Z } from "../../../components/shared/elevation.es.js";
6
- import N from "../../../components/LogoFromGuid.es.js";
7
- import { ConfettiOverlay as U } from "../../../components/shared/ConfettiOverlay.es.js";
8
- import V from "../../../components/LogoTile.es.js";
9
- import { LinedCardZeroState as j } from "../../../../insights/components/shared/ZeroState/LinedCardZeroState.es.js";
10
- import { useEffect as E, useState as H } from "react";
5
+ import { SMALL_CARD_SHADOW as N } from "../../../components/shared/elevation.es.js";
6
+ import U from "../../../components/LogoFromGuid.es.js";
7
+ import { ConfettiOverlay as V } from "../../../components/shared/ConfettiOverlay.es.js";
8
+ import Z from "../../../components/LogoTile.es.js";
9
+ import { useEffect as E, useState as j } from "react";
11
10
  import { observer as A } from "mobx-react-lite";
12
11
  import a from "@mui/material/Stack";
13
12
  import { Text as d } from "@mxenabled/mxui";
14
13
  import { Icon as I } from "@mxenabled/mx-icons";
15
14
  import { jsx as r, jsxs as p } from "react/jsx-runtime";
16
15
  import { alpha as _ } from "@mui/material/styles";
17
- import P from "@mui/material/Radio";
18
- import $ from "@mui/material/ButtonBase";
19
- var X = 3e3, z = 32, T = {
16
+ import H from "@mui/material/Radio";
17
+ import P from "@mui/material/ButtonBase";
18
+ var $ = 3e3, z = 32, T = {
20
19
  alignItems: "center",
21
20
  border: 1,
22
21
  borderColor: "divider",
@@ -25,7 +24,7 @@ var X = 3e3, z = 32, T = {
25
24
  height: 50,
26
25
  pl: 8,
27
26
  width: "100%"
28
- }, G = (o) => o.map((e) => ({
27
+ }, X = (o) => o.map((e) => ({
29
28
  item: e,
30
29
  order: Math.random()
31
30
  })).sort((e, t) => e.order - t.order).map(({ item: e }) => e), R = A(({ merchant: o }) => {
@@ -33,7 +32,7 @@ var X = 3e3, z = 32, T = {
33
32
  ...q(o, e),
34
33
  alt: ""
35
34
  };
36
- return /* @__PURE__ */ r(V, {
35
+ return /* @__PURE__ */ r(Z, {
37
36
  borderColor: null,
38
37
  borderRadius: 4,
39
38
  size: z,
@@ -41,19 +40,19 @@ var X = 3e3, z = 32, T = {
41
40
  position: "relative",
42
41
  textAlign: "left"
43
42
  },
44
- children: /* @__PURE__ */ r(N, {
43
+ children: /* @__PURE__ */ r(U, {
45
44
  logo: t,
46
45
  size: z
47
46
  })
48
47
  });
49
- }), J = ({ correct: o, copy: e }) => /* @__PURE__ */ p(a, {
48
+ }), G = ({ correct: o, copy: e }) => /* @__PURE__ */ p(a, {
50
49
  role: "status",
51
50
  sx: {
52
51
  alignItems: "center",
53
52
  backdropFilter: o ? void 0 : "blur(6px)",
54
53
  bgcolor: (t) => o ? "success.main" : _(t.palette.common.black, 0.5),
55
54
  borderRadius: "8px",
56
- boxShadow: o ? Z : void 0,
55
+ boxShadow: o ? N : void 0,
57
56
  color: o ? "success.contrastText" : "common.white",
58
57
  gap: 18,
59
58
  inset: 16,
@@ -76,11 +75,11 @@ var X = 3e3, z = 32, T = {
76
75
  variant: "h2",
77
76
  children: o ? e?.nailed_it : e?.not_quite
78
77
  })]
79
- }), Y = ({ copy: o, merchant: e, onClick: t }) => {
78
+ }), J = ({ copy: o, merchant: e, onClick: t }) => {
80
79
  const l = o ? y(o.transaction_count_one, o.transaction_count, e.count, String(e.count)) : "", f = o ? L(o.rank_aria, String(e.rank), e.label, l) : e.label;
81
80
  return /* @__PURE__ */ p(a, {
82
81
  "aria-label": f,
83
- component: $,
82
+ component: P,
84
83
  direction: "row",
85
84
  onClick: t,
86
85
  sx: {
@@ -118,11 +117,11 @@ var X = 3e3, z = 32, T = {
118
117
  })
119
118
  ]
120
119
  });
121
- }, vo = A(({ beatGuid: o = "", payload: e }) => {
122
- const t = B().insights_feed?.quiz_block, { beatContext: l, openActionDrawer: f, setBeatContext: h } = M(), m = W(e.instance_slot.data), [w] = H(() => G(m)), g = l[o] ?? {}, x = g[c.PICK], v = !!g[c.CHECKED], k = e.instance_slot.variant === O.RESULTS || !!g[c.REVEALED], s = v && !k;
120
+ }, go = A(({ beatGuid: o = "", payload: e }) => {
121
+ const t = B().insights_feed?.quiz_block, { beatContext: l, openActionDrawer: f, setBeatContext: h } = M(), u = W(e.instance_slot.data), [w] = j(() => X(u)), g = l[o] ?? {}, x = g[c.PICK], v = !!g[c.CHECKED], k = e.instance_slot.variant === O.RESULTS || !!g[c.REVEALED], s = v && !k;
123
122
  if (E(() => {
124
123
  if (!s) return;
125
- const n = setTimeout(() => h(o, { [c.REVEALED]: !0 }), X);
124
+ const n = setTimeout(() => h(o, { [c.REVEALED]: !0 }), $);
126
125
  return () => clearTimeout(n);
127
126
  }, [
128
127
  o,
@@ -130,7 +129,7 @@ var X = 3e3, z = 32, T = {
130
129
  s
131
130
  ]), E(() => {
132
131
  t || console.warn("quiz_block: copy namespace missing; rendering without its labels");
133
- }, [t]), !m.length) return /* @__PURE__ */ r(j, {});
132
+ }, [t]), !u.length) return null;
134
133
  if (k) {
135
134
  const n = (i) => f({
136
135
  guid: o,
@@ -146,14 +145,14 @@ var X = 3e3, z = 32, T = {
146
145
  gap: 12,
147
146
  p: 16
148
147
  },
149
- children: Q(m).map((i) => /* @__PURE__ */ r(Y, {
148
+ children: Q(u).map((i) => /* @__PURE__ */ r(J, {
150
149
  copy: t,
151
150
  merchant: i,
152
151
  onClick: () => n(i)
153
152
  }, S(i)))
154
153
  });
155
154
  }
156
- const C = !!x && K(m, x ?? "");
155
+ const C = !!x && K(u, x ?? "");
157
156
  return /* @__PURE__ */ p(a, {
158
157
  sx: {
159
158
  gap: 12,
@@ -161,8 +160,8 @@ var X = 3e3, z = 32, T = {
161
160
  position: "relative"
162
161
  },
163
162
  children: [
164
- s && C && /* @__PURE__ */ r(U, {}),
165
- s && /* @__PURE__ */ r(J, {
163
+ s && C && /* @__PURE__ */ r(V, {}),
164
+ s && /* @__PURE__ */ r(G, {
166
165
  copy: t,
167
166
  correct: C
168
167
  }),
@@ -177,15 +176,15 @@ var X = 3e3, z = 32, T = {
177
176
  visibility: s && C ? "hidden" : "visible"
178
177
  },
179
178
  children: w.map((n) => {
180
- const i = S(n), u = i === x;
179
+ const i = S(n), m = i === x;
181
180
  return /* @__PURE__ */ p(a, {
182
181
  component: "label",
183
182
  direction: "row",
184
183
  sx: {
185
184
  ...T,
186
- bgcolor: (b) => u ? _(b.palette.primary.main, 0.16) : "background.paper",
187
- borderColor: (b) => u ? _(b.palette.primary.main, 0.5) : b.palette.divider,
188
- borderWidth: u ? 2 : 1,
185
+ bgcolor: (b) => m ? _(b.palette.primary.main, 0.16) : "background.paper",
186
+ borderColor: (b) => m ? _(b.palette.primary.main, 0.5) : b.palette.divider,
187
+ borderWidth: m ? 2 : 1,
189
188
  cursor: v ? "default" : "pointer",
190
189
  pr: 4
191
190
  },
@@ -198,8 +197,8 @@ var X = 3e3, z = 32, T = {
198
197
  variant: "body1",
199
198
  children: n.label
200
199
  }),
201
- /* @__PURE__ */ r(P, {
202
- checked: u,
200
+ /* @__PURE__ */ r(H, {
201
+ checked: m,
203
202
  disabled: v,
204
203
  name: `quiz-${o}`,
205
204
  onChange: () => h(o, { [c.PICK]: i }),
@@ -214,7 +213,7 @@ var X = 3e3, z = 32, T = {
214
213
  });
215
214
  });
216
215
  export {
217
- vo as default
216
+ go as default
218
217
  };
219
218
 
220
219
  //# sourceMappingURL=QuizBlock.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"QuizBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\n\nimport ButtonBase from '@mui/material/ButtonBase'\nimport Radio from '@mui/material/Radio'\nimport Stack from '@mui/material/Stack'\nimport { alpha } from '@mui/material/styles'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { useGlobalCopyStore, useInsightsV2Store, useTransactionStore } from '../../../../common'\nimport type { QuizBlockCopy } from '../../../../core/types/localization/InsightsFeedCopy'\nimport { buildDynamicCopy, buildPluralCopy } from '../../../../core/utils/Localization'\nimport { LinedCardZeroState } from '../../../../insights/components/shared/ZeroState/LinedCardZeroState'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport LogoTile from '../../../components/LogoTile'\nimport { ConfettiOverlay } from '../../../components/shared/ConfettiOverlay'\nimport { SMALL_CARD_SHADOW } from '../../../components/shared/elevation'\nimport { actionBlocksKey } from '../../../mappings/actionBlocksKey'\nimport type { BlockProps } from '../../types'\nimport {\n QUIZ_CONTEXT,\n QUIZ_VARIANTS,\n isTopMerchant,\n merchantKey,\n quizMerchantLogo,\n rankQuizMerchants,\n readQuizMerchants,\n type QuizDrawerContext,\n type QuizMerchant,\n type RankedQuizMerchant,\n} from './quiz'\n\n/** How long the \"Nailed it!\" / \"Not quite...\" card shows before the results. */\nconst FEEDBACK_MS = 3000\n\nconst LOGO_SIZE = 32\nconst ROW_SX = {\n alignItems: 'center',\n border: 1,\n borderColor: 'divider',\n borderRadius: '8px',\n gap: 12,\n height: 50,\n pl: 8,\n width: '100%',\n} as const\n\nconst shuffle = <T,>(items: T[]) =>\n items\n .map((item) => ({ item, order: Math.random() }))\n .sort((a, b) => a.order - b.order)\n .map(({ item }) => item)\n\nconst MerchantLogo = observer(({ merchant }: { merchant: QuizMerchant }) => {\n const { detailedTransactions } = useTransactionStore()\n // Empty alt: the merchant's name sits beside it.\n const logo = { ...quizMerchantLogo(merchant, detailedTransactions), alt: '' }\n\n return (\n // mxui's MerchantLogo image is absolute with no left; a button row's centered text pushes it halfway out.\n <LogoTile\n borderColor={null}\n borderRadius={4}\n size={LOGO_SIZE}\n sx={{ position: 'relative', textAlign: 'left' }}\n >\n <LogoFromGuid logo={logo} size={LOGO_SIZE} />\n </LogoTile>\n )\n})\n\nconst FeedbackCard = ({ correct, copy }: { correct: boolean; copy?: QuizBlockCopy }) => (\n <Stack\n role=\"status\"\n sx={{\n alignItems: 'center',\n backdropFilter: correct ? undefined : 'blur(6px)',\n bgcolor: (theme) => (correct ? 'success.main' : alpha(theme.palette.common.black, 0.5)),\n borderRadius: '8px',\n boxShadow: correct ? SMALL_CARD_SHADOW : undefined,\n color: correct ? 'success.contrastText' : 'common.white',\n gap: 18,\n inset: 16,\n justifyContent: 'center',\n p: 16,\n position: 'absolute',\n zIndex: 2,\n }}\n >\n <Icon aria-hidden={true} fill={true} name={correct ? 'check_circle' : 'cancel'} size={56} />\n <Text component=\"p\" sx={{ color: 'inherit', textAlign: 'center' }} variant=\"h2\">\n {correct ? copy?.nailed_it : copy?.not_quite}\n </Text>\n </Stack>\n)\n\nconst ResultRow = ({\n copy,\n merchant,\n onClick,\n}: {\n copy?: QuizBlockCopy\n merchant: RankedQuizMerchant\n onClick: () => void\n}) => {\n const count = copy\n ? (buildPluralCopy(\n copy.transaction_count_one,\n copy.transaction_count,\n merchant.count,\n String(merchant.count),\n ) as string)\n : ''\n const label = copy\n ? (buildDynamicCopy(copy.rank_aria, String(merchant.rank), merchant.label, count) as string)\n : merchant.label\n\n return (\n <Stack\n aria-label={label}\n component={ButtonBase}\n direction=\"row\"\n onClick={onClick}\n sx={{ ...ROW_SX, pr: 8 }}\n >\n <MerchantLogo merchant={merchant} />\n <Stack sx={{ flexGrow: 1, minWidth: 0, textAlign: 'left' }}>\n <Text bold={true} noWrap={true} variant=\"body1\">\n {merchant.label}\n </Text>\n {count && <Text variant=\"caption\">{count}</Text>}\n </Stack>\n <Text bold={true} variant=\"body1\">\n {merchant.rank}\n </Text>\n <Icon aria-hidden={true} name=\"chevron_right\" size={16} sx={{ color: 'action.active' }} />\n </Stack>\n )\n}\n\n/** Monthly Top Transacted Merchant quiz; its progress lives in beat context for the quiz CTAs. */\nconst QuizBlock = observer(({ beatGuid = '', payload }: BlockProps) => {\n const copy = useGlobalCopyStore().insights_feed?.quiz_block\n const { beatContext, openActionDrawer, setBeatContext } = useInsightsV2Store()\n\n const merchants = readQuizMerchants(payload.instance_slot.data)\n const [options] = useState(() => shuffle(merchants))\n\n const context = beatContext[beatGuid] ?? {}\n const pick = context[QUIZ_CONTEXT.PICK] as string | undefined\n const checked = Boolean(context[QUIZ_CONTEXT.CHECKED])\n const revealed =\n payload.instance_slot.variant === QUIZ_VARIANTS.RESULTS ||\n Boolean(context[QUIZ_CONTEXT.REVEALED])\n const showFeedback = checked && !revealed\n\n useEffect(() => {\n if (!showFeedback) return\n const timer = setTimeout(\n () => setBeatContext(beatGuid, { [QUIZ_CONTEXT.REVEALED]: true }),\n FEEDBACK_MS,\n )\n return () => clearTimeout(timer)\n }, [beatGuid, setBeatContext, showFeedback])\n\n useEffect(() => {\n if (!copy) console.warn('quiz_block: copy namespace missing; rendering without its labels')\n }, [copy])\n\n // tupac's zero_state sends no data_series.\n if (!merchants.length) return <LinedCardZeroState />\n\n if (revealed) {\n const openMerchant = (merchant: RankedQuizMerchant) =>\n openActionDrawer({\n guid: beatGuid,\n trigger: 'inDescriptionCta',\n cta: { block: actionBlocksKey.QUIZ_MERCHANT_ACTION_BLOCK, variant: null },\n context: { quiz_merchant: merchant } satisfies QuizDrawerContext,\n })\n\n return (\n <Stack sx={{ gap: 12, p: 16 }}>\n {rankQuizMerchants(merchants).map((merchant) => (\n <ResultRow\n copy={copy}\n key={merchantKey(merchant)}\n merchant={merchant}\n onClick={() => openMerchant(merchant)}\n />\n ))}\n </Stack>\n )\n }\n\n const correct = Boolean(pick) && isTopMerchant(merchants, pick ?? '')\n\n return (\n <Stack sx={{ gap: 12, p: 16, position: 'relative' }}>\n {showFeedback && correct && <ConfettiOverlay />}\n {showFeedback && <FeedbackCard copy={copy} correct={correct} />}\n <Stack\n aria-label={payload.title}\n component=\"fieldset\"\n sx={{\n border: 0,\n gap: 12,\n m: 0,\n p: 0,\n visibility: showFeedback && correct ? 'hidden' : 'visible',\n }}\n >\n {options.map((merchant) => {\n const key = merchantKey(merchant)\n const selected = key === pick\n\n return (\n <Stack\n component=\"label\"\n direction=\"row\"\n key={key}\n sx={{\n ...ROW_SX,\n bgcolor: (theme) =>\n selected ? alpha(theme.palette.primary.main, 0.16) : 'background.paper',\n borderColor: (theme) =>\n selected ? alpha(theme.palette.primary.main, 0.5) : theme.palette.divider,\n borderWidth: selected ? 2 : 1,\n cursor: checked ? 'default' : 'pointer',\n pr: 4,\n }}\n >\n <MerchantLogo merchant={merchant} />\n <Text bold={true} noWrap={true} sx={{ flexGrow: 1 }} variant=\"body1\">\n {merchant.label}\n </Text>\n <Radio\n checked={selected}\n disabled={checked}\n name={`quiz-${beatGuid}`}\n onChange={() => setBeatContext(beatGuid, { [QUIZ_CONTEXT.PICK]: key })}\n size=\"small\"\n value={key}\n />\n </Stack>\n )\n })}\n </Stack>\n </Stack>\n )\n})\n\nexport default QuizBlock\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmCA,IAAM,IAAc,KAEd,IAAY,IACZ,IAAS;AAAA,EACb,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,cAAc;AAAA,EACd,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,IAAI;AAAA,EACJ,OAAO;AACT,GAEM,IAAA,CAAe,MACnB,EACG,IAAA,CAAK,OAAU;AAAA,EAAE,MAAA;AAAA,EAAM,OAAO,KAAK,OAAO;AAAE,EAAE,EAC9C,KAAA,CAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,KAAK,EAChC,IAAA,CAAK,EAAE,MAAA,EAAA,MAAW,CAAI,GAErB,IAAe,EAAA,CAAU,EAAE,UAAA,EAAA,MAA2C;AAC1E,QAAM,EAAE,sBAAA,EAAA,IAAyB,EAAoB,GAE/C,IAAO;AAAA,IAAE,GAAG,EAAiB,GAAU,CAAoB;AAAA,IAAG,KAAK;AAAA,EAAG;AAE5E,SAEE,gBAAA,EAAC,GAAD;AAAA,IACE,aAAa;AAAA,IACb,cAAc;AAAA,IACd,MAAM;AAAA,IACN,IAAI;AAAA,MAAE,UAAU;AAAA,MAAY,WAAW;AAAA,IAAO;AAAA,IAE9C,UAAA,gBAAA,EAAC,GAAD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QAEX,CAAC;AAAA,MACI,CAAA;AAAA,IACF;AAAA;AAEX,CAAC"}
1
+ {"version":3,"file":"QuizBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\n\nimport ButtonBase from '@mui/material/ButtonBase'\nimport Radio from '@mui/material/Radio'\nimport Stack from '@mui/material/Stack'\nimport { alpha } from '@mui/material/styles'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { useGlobalCopyStore, useInsightsV2Store, useTransactionStore } from '../../../../common'\nimport type { QuizBlockCopy } from '../../../../core/types/localization/InsightsFeedCopy'\nimport { buildDynamicCopy, buildPluralCopy } from '../../../../core/utils/Localization'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport LogoTile from '../../../components/LogoTile'\nimport { ConfettiOverlay } from '../../../components/shared/ConfettiOverlay'\nimport { SMALL_CARD_SHADOW } from '../../../components/shared/elevation'\nimport { actionBlocksKey } from '../../../mappings/actionBlocksKey'\nimport type { BlockProps } from '../../types'\nimport {\n QUIZ_CONTEXT,\n QUIZ_VARIANTS,\n isTopMerchant,\n merchantKey,\n quizMerchantLogo,\n rankQuizMerchants,\n readQuizMerchants,\n type QuizDrawerContext,\n type QuizMerchant,\n type RankedQuizMerchant,\n} from './quiz'\n\n/** How long the \"Nailed it!\" / \"Not quite...\" card shows before the results. */\nconst FEEDBACK_MS = 3000\n\nconst LOGO_SIZE = 32\nconst ROW_SX = {\n alignItems: 'center',\n border: 1,\n borderColor: 'divider',\n borderRadius: '8px',\n gap: 12,\n height: 50,\n pl: 8,\n width: '100%',\n} as const\n\nconst shuffle = <T,>(items: T[]) =>\n items\n .map((item) => ({ item, order: Math.random() }))\n .sort((a, b) => a.order - b.order)\n .map(({ item }) => item)\n\nconst MerchantLogo = observer(({ merchant }: { merchant: QuizMerchant }) => {\n const { detailedTransactions } = useTransactionStore()\n // Empty alt: the merchant's name sits beside it.\n const logo = { ...quizMerchantLogo(merchant, detailedTransactions), alt: '' }\n\n return (\n // mxui's MerchantLogo image is absolute with no left; a button row's centered text pushes it halfway out.\n <LogoTile\n borderColor={null}\n borderRadius={4}\n size={LOGO_SIZE}\n sx={{ position: 'relative', textAlign: 'left' }}\n >\n <LogoFromGuid logo={logo} size={LOGO_SIZE} />\n </LogoTile>\n )\n})\n\nconst FeedbackCard = ({ correct, copy }: { correct: boolean; copy?: QuizBlockCopy }) => (\n <Stack\n role=\"status\"\n sx={{\n alignItems: 'center',\n backdropFilter: correct ? undefined : 'blur(6px)',\n bgcolor: (theme) => (correct ? 'success.main' : alpha(theme.palette.common.black, 0.5)),\n borderRadius: '8px',\n boxShadow: correct ? SMALL_CARD_SHADOW : undefined,\n color: correct ? 'success.contrastText' : 'common.white',\n gap: 18,\n inset: 16,\n justifyContent: 'center',\n p: 16,\n position: 'absolute',\n zIndex: 2,\n }}\n >\n <Icon aria-hidden={true} fill={true} name={correct ? 'check_circle' : 'cancel'} size={56} />\n <Text component=\"p\" sx={{ color: 'inherit', textAlign: 'center' }} variant=\"h2\">\n {correct ? copy?.nailed_it : copy?.not_quite}\n </Text>\n </Stack>\n)\n\nconst ResultRow = ({\n copy,\n merchant,\n onClick,\n}: {\n copy?: QuizBlockCopy\n merchant: RankedQuizMerchant\n onClick: () => void\n}) => {\n const count = copy\n ? (buildPluralCopy(\n copy.transaction_count_one,\n copy.transaction_count,\n merchant.count,\n String(merchant.count),\n ) as string)\n : ''\n const label = copy\n ? (buildDynamicCopy(copy.rank_aria, String(merchant.rank), merchant.label, count) as string)\n : merchant.label\n\n return (\n <Stack\n aria-label={label}\n component={ButtonBase}\n direction=\"row\"\n onClick={onClick}\n sx={{ ...ROW_SX, pr: 8 }}\n >\n <MerchantLogo merchant={merchant} />\n <Stack sx={{ flexGrow: 1, minWidth: 0, textAlign: 'left' }}>\n <Text bold={true} noWrap={true} variant=\"body1\">\n {merchant.label}\n </Text>\n {count && <Text variant=\"caption\">{count}</Text>}\n </Stack>\n <Text bold={true} variant=\"body1\">\n {merchant.rank}\n </Text>\n <Icon aria-hidden={true} name=\"chevron_right\" size={16} sx={{ color: 'action.active' }} />\n </Stack>\n )\n}\n\n/** Monthly Top Transacted Merchant quiz; its progress lives in beat context for the quiz CTAs. */\nconst QuizBlock = observer(({ beatGuid = '', payload }: BlockProps) => {\n const copy = useGlobalCopyStore().insights_feed?.quiz_block\n const { beatContext, openActionDrawer, setBeatContext } = useInsightsV2Store()\n\n const merchants = readQuizMerchants(payload.instance_slot.data)\n const [options] = useState(() => shuffle(merchants))\n\n const context = beatContext[beatGuid] ?? {}\n const pick = context[QUIZ_CONTEXT.PICK] as string | undefined\n const checked = Boolean(context[QUIZ_CONTEXT.CHECKED])\n const revealed =\n payload.instance_slot.variant === QUIZ_VARIANTS.RESULTS ||\n Boolean(context[QUIZ_CONTEXT.REVEALED])\n const showFeedback = checked && !revealed\n\n useEffect(() => {\n if (!showFeedback) return\n const timer = setTimeout(\n () => setBeatContext(beatGuid, { [QUIZ_CONTEXT.REVEALED]: true }),\n FEEDBACK_MS,\n )\n return () => clearTimeout(timer)\n }, [beatGuid, setBeatContext, showFeedback])\n\n useEffect(() => {\n if (!copy) console.warn('quiz_block: copy namespace missing; rendering without its labels')\n }, [copy])\n\n // zero_state sends no data_series; the card shows only its copy.\n if (!merchants.length) return null\n\n if (revealed) {\n const openMerchant = (merchant: RankedQuizMerchant) =>\n openActionDrawer({\n guid: beatGuid,\n trigger: 'inDescriptionCta',\n cta: { block: actionBlocksKey.QUIZ_MERCHANT_ACTION_BLOCK, variant: null },\n context: { quiz_merchant: merchant } satisfies QuizDrawerContext,\n })\n\n return (\n <Stack sx={{ gap: 12, p: 16 }}>\n {rankQuizMerchants(merchants).map((merchant) => (\n <ResultRow\n copy={copy}\n key={merchantKey(merchant)}\n merchant={merchant}\n onClick={() => openMerchant(merchant)}\n />\n ))}\n </Stack>\n )\n }\n\n const correct = Boolean(pick) && isTopMerchant(merchants, pick ?? '')\n\n return (\n <Stack sx={{ gap: 12, p: 16, position: 'relative' }}>\n {showFeedback && correct && <ConfettiOverlay />}\n {showFeedback && <FeedbackCard copy={copy} correct={correct} />}\n <Stack\n aria-label={payload.title}\n component=\"fieldset\"\n sx={{\n border: 0,\n gap: 12,\n m: 0,\n p: 0,\n visibility: showFeedback && correct ? 'hidden' : 'visible',\n }}\n >\n {options.map((merchant) => {\n const key = merchantKey(merchant)\n const selected = key === pick\n\n return (\n <Stack\n component=\"label\"\n direction=\"row\"\n key={key}\n sx={{\n ...ROW_SX,\n bgcolor: (theme) =>\n selected ? alpha(theme.palette.primary.main, 0.16) : 'background.paper',\n borderColor: (theme) =>\n selected ? alpha(theme.palette.primary.main, 0.5) : theme.palette.divider,\n borderWidth: selected ? 2 : 1,\n cursor: checked ? 'default' : 'pointer',\n pr: 4,\n }}\n >\n <MerchantLogo merchant={merchant} />\n <Text bold={true} noWrap={true} sx={{ flexGrow: 1 }} variant=\"body1\">\n {merchant.label}\n </Text>\n <Radio\n checked={selected}\n disabled={checked}\n name={`quiz-${beatGuid}`}\n onChange={() => setBeatContext(beatGuid, { [QUIZ_CONTEXT.PICK]: key })}\n size=\"small\"\n value={key}\n />\n </Stack>\n )\n })}\n </Stack>\n </Stack>\n )\n})\n\nexport default QuizBlock\n"],"mappings":";;;;;;;;;;;;;;;;;AAkCA,IAAM,IAAc,KAEd,IAAY,IACZ,IAAS;AAAA,EACb,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,cAAc;AAAA,EACd,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,IAAI;AAAA,EACJ,OAAO;AACT,GAEM,IAAA,CAAe,MACnB,EACG,IAAA,CAAK,OAAU;AAAA,EAAE,MAAA;AAAA,EAAM,OAAO,KAAK,OAAO;AAAE,EAAE,EAC9C,KAAA,CAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,KAAK,EAChC,I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A,gBAAM,IAAI,EAAE,UAAU,EAAE;AAAA,gBAAG,SAAQ;AAAA,gBAC1D,UAAA,EAAS;AAAA,cACN,CAAA;AAAA,cACN,gBAAA,EAAC,GAAD;AAAA,gBACE,SAAS;AAAA,gBACT,UAAU;AAAA,gBACV,MAAM,QAAQ,CAAA;AAAA,gBACd,UAAA,MAAgB,EAAe,GAAU,EAAA,CAAG,EAAa,IAAA,GAAO,EAAI,CAAC;AAAA,gBACrE,MAAK;AAAA,gBACL,OAAO;AAAA,cACR,CAAA;AAAA,YACI;AAAA,UAxBA,GAAA,CAwBA;AAAA,QAEX,CAAC;AAAA,MACI,CAAA;AAAA,IACF;AAAA;AAEX,CAAC"}
@@ -1,51 +1,51 @@
1
- import { useGlobalCopyStore as D, useGlobalStore as H } from "../../../../common/context/hooks.es.js";
1
+ import { useGlobalCopyStore as H, useGlobalStore as P } from "../../../../common/context/hooks.es.js";
2
2
  import { slot as a } from "../../../../core/types/Insights.es.js";
3
3
  import { CURRENCY_FORMAT as x, formatCurrency as C } from "../../../../core/utils/NumberFormatting.es.js";
4
- import { useBeatActions as P } from "../../../beatActions.es.js";
5
- import { resolveVariantConfig as U } from "../../resolveVariantConfig.es.js";
4
+ import { useBeatActions as U } from "../../../beatActions.es.js";
5
+ import { resolveVariantConfig as V } from "../../resolveVariantConfig.es.js";
6
6
  import { asLogoRef as I } from "../../slotReaders.es.js";
7
- import { USER_RESPONSE as V, repeatingTransactionOf as W } from "../../../ctaActions/subscriptionAnswer.es.js";
8
- import Y from "../../../components/CategoryTile.es.js";
9
- import K, { isKnownIcon as J } from "../../../components/LogoMark.es.js";
10
- import { logoFromRef as Q } from "../../../components/shared/EntityLogo.es.js";
11
- import X from "../../../components/LogoFromGuid.es.js";
12
- import { statusIconName as oo, statusIconPalette as S } from "../../../components/statusIcon.es.js";
13
- import ro from "../../../components/StatusMessageCard.es.js";
14
- import to from "../../../components/TransactionListCard.es.js";
15
- import { subscriptionFrequency as eo } from "../../../components/SubscriptionStatus/subscriptionFrequency.es.js";
16
- import { getLayoutConfig as no, transactionBlockVariant as io } from "./layout.es.js";
17
- import { observer as ao } from "mobx-react-lite";
18
- import { Icon as R } from "@mxenabled/mx-icons";
7
+ import { USER_RESPONSE as W, repeatingTransactionOf as Y } from "../../../ctaActions/subscriptionAnswer.es.js";
8
+ import K from "../../../components/CategoryTile.es.js";
9
+ import J, { isKnownIcon as Q } from "../../../components/LogoMark.es.js";
10
+ import { logoFromRef as X } from "../../../components/shared/EntityLogo.es.js";
11
+ import oo from "../../../components/LogoFromGuid.es.js";
12
+ import { statusIconName as ro, statusIconPalette as R } from "../../../components/statusIcon.es.js";
13
+ import to from "../../../components/StatusMessageCard.es.js";
14
+ import eo from "../../../components/TransactionListCard.es.js";
15
+ import { subscriptionFrequency as no } from "../../../components/SubscriptionStatus/subscriptionFrequency.es.js";
16
+ import { getLayoutConfig as io, transactionBlockVariant as ao } from "./layout.es.js";
17
+ import { observer as so } from "mobx-react-lite";
18
+ import { Icon as T } from "@mxenabled/mx-icons";
19
19
  import { jsx as t } from "react/jsx-runtime";
20
- import { alpha as so, useTheme as co } from "@mui/material/styles";
20
+ import { alpha as co, useTheme as mo } from "@mui/material/styles";
21
21
  import g from "@mui/material/Box";
22
- var c = 32, mo = Math.round(c * 0.625), uo = 24, T = 32, lo = 20, go = ({ icon: i }) => {
23
- const e = oo(i?.guid);
22
+ var c = 32, uo = Math.round(c * 0.625), lo = 24, S = 32, go = 20, fo = ({ icon: i }) => {
23
+ const e = ro(i?.guid);
24
24
  return e ? /* @__PURE__ */ t(g, {
25
25
  "aria-hidden": !0,
26
26
  "data-icon": e,
27
27
  "data-testid": "subscription-badge",
28
28
  sx: {
29
29
  alignItems: "center",
30
- bgcolor: `${S(i?.color)}.main`,
30
+ bgcolor: `${R(i?.color)}.main`,
31
31
  borderRadius: "50%",
32
32
  display: "flex",
33
- height: T,
33
+ height: S,
34
34
  justifyContent: "center",
35
- width: T
35
+ width: S
36
36
  },
37
- children: /* @__PURE__ */ t(R, {
37
+ children: /* @__PURE__ */ t(T, {
38
38
  fill: !0,
39
39
  name: e,
40
- size: lo,
41
- sx: { color: `${S(i?.color)}.contrastText` }
40
+ size: go,
41
+ sx: { color: `${R(i?.color)}.contrastText` }
42
42
  })
43
43
  }) : null;
44
- }, fo = (i, e, m) => {
45
- const o = Q(i.logo, i.primary_text);
44
+ }, po = (i, e, m) => {
45
+ const o = X(i.logo, i.primary_text);
46
46
  if (o) {
47
47
  if (o.logo_name) {
48
- if (!J(o.logo_name)) return;
48
+ if (!Q(o.logo_name)) return;
49
49
  const s = !!o.logo_fill, n = o.logo_color ?? e.palette.chart.chart2 ?? e.palette.primary.main;
50
50
  return /* @__PURE__ */ t(g, {
51
51
  sx: {
@@ -55,41 +55,41 @@ var c = 32, mo = Math.round(c * 0.625), uo = 24, T = 32, lo = 20, go = ({ icon:
55
55
  justifyContent: "center",
56
56
  width: c,
57
57
  ...s && {
58
- bgcolor: so(n, 0.15),
58
+ bgcolor: co(n, 0.15),
59
59
  borderRadius: `${e.shape.borderRadius}px`
60
60
  }
61
61
  },
62
- children: /* @__PURE__ */ t(R, {
62
+ children: /* @__PURE__ */ t(T, {
63
63
  name: o.logo_name,
64
- size: mo,
64
+ size: uo,
65
65
  sx: { color: s ? n : o.logo_color }
66
66
  })
67
67
  });
68
68
  }
69
- if (o.merchant_guid || o.institution_guid) return /* @__PURE__ */ t(K, {
69
+ if (o.merchant_guid || o.institution_guid) return /* @__PURE__ */ t(J, {
70
70
  logo: o,
71
71
  size: c
72
72
  });
73
- if (o.category_guid) return /* @__PURE__ */ t(Y, {
73
+ if (o.category_guid) return /* @__PURE__ */ t(K, {
74
74
  categoryGuid: o.category_guid,
75
75
  size: c,
76
76
  tint: m
77
77
  });
78
78
  }
79
- }, Mo = ao(({ payload: i }) => {
80
- const e = co(), m = H(), { recurring: o } = D(), { beat: s } = P(), { data: n, variant: E } = i.instance_slot, { answeredBackground: f, background: u, cardVariant: k, categoryTint: B, creditAmounts: O, elevated: A, followsSubscription: l, headerColor: G, raised: L, showFooter: F, showFrequency: p, showHeader: N, statusMessage: M, sx: w } = U(no(e), E, io.NoHeader, "TransactionBlock"), _ = (p || l) && s ? W({
79
+ }, wo = so(({ payload: i }) => {
80
+ const e = mo(), m = P(), { recurring: o } = H(), { beat: s } = U(), { data: n, variant: E } = i.instance_slot, { answeredBackground: f, background: u, cardVariant: k, categoryTint: B, creditAmounts: O, elevated: A, followsSubscription: l, headerColor: G, headerRegular: L, raised: F, showFooter: N, showFrequency: p, showHeader: M, statusMessage: w, sx: z } = V(io(e), E, ao.NoHeader, "TransactionBlock"), _ = (p || l) && s ? Y({
81
81
  beat: s,
82
82
  stores: m
83
- }) : void 0, y = !!l && _?.user_response === V.CONFIRMED;
84
- if (M) {
83
+ }) : void 0, h = !!l && _?.user_response === W.CONFIRMED;
84
+ if (w) {
85
85
  const r = a(n, "message");
86
- return typeof r != "string" || !r.trim() ? (console.warn("[TransactionBlock] status_message has no message — rendering nothing."), null) : /* @__PURE__ */ t(ro, {
86
+ return typeof r != "string" || !r.trim() ? (console.warn("[TransactionBlock] status_message has no message — rendering nothing."), null) : /* @__PURE__ */ t(to, {
87
87
  icon: /* @__PURE__ */ t(g, {
88
88
  "aria-hidden": "true",
89
89
  sx: { display: "flex" },
90
- children: /* @__PURE__ */ t(X, {
90
+ children: /* @__PURE__ */ t(oo, {
91
91
  logo: I(a(n, "icon")),
92
- size: uo
92
+ size: lo
93
93
  })
94
94
  }),
95
95
  message: r,
@@ -99,34 +99,35 @@ var c = 32, mo = Math.round(c * 0.625), uo = 24, T = 32, lo = 20, go = ({ icon:
99
99
  } : void 0
100
100
  });
101
101
  }
102
- const d = a(n, "series"), h = a(n, "header_text");
102
+ const d = a(n, "series"), y = a(n, "header_text");
103
103
  if (!Array.isArray(d) || !d.length) return null;
104
- const z = N && typeof h == "string" ? h : void 0, b = a(n, "footer_text"), Z = a(n, "footer_amount"), $ = F && typeof b == "string" ? {
104
+ const Z = M && typeof y == "string" ? y : void 0, b = a(n, "footer_text"), $ = a(n, "footer_amount"), j = N && typeof b == "string" ? {
105
105
  label: b,
106
- amount: C(Z, x.cents)
107
- } : void 0, j = p ? eo(o, _) : void 0, q = l ? /* @__PURE__ */ t(go, { icon: I(a(n, y ? "reviewed_icon" : "icon")) }) : void 0, v = (r) => !!O && typeof r == "number" && r > 0;
108
- return /* @__PURE__ */ t(to, {
109
- background: y && f ? f : u,
110
- badge: q,
106
+ amount: C($, x.cents)
107
+ } : void 0, q = p ? no(o, _) : void 0, D = l ? /* @__PURE__ */ t(fo, { icon: I(a(n, h ? "reviewed_icon" : "icon")) }) : void 0, v = (r) => !!O && typeof r == "number" && r > 0;
108
+ return /* @__PURE__ */ t(eo, {
109
+ background: h && f ? f : u,
110
+ badge: D,
111
111
  elevated: A,
112
- footer: $,
113
- header: z,
112
+ footer: j,
113
+ header: Z,
114
114
  headerColor: G,
115
- raised: L,
116
- sx: w,
115
+ headerRegular: L,
116
+ raised: F,
117
+ sx: z,
117
118
  variant: k,
118
119
  rows: d.map((r) => ({
119
120
  amount: typeof r.amount == "number" ? `${v(r.amount) ? "+" : ""}${C(r.amount, x.cents)}` : "",
120
121
  amountColor: v(r.amount) ? "success.main" : void 0,
121
- amountCaption: j,
122
- leading: fo(r, e, B),
122
+ amountCaption: q,
123
+ leading: po(r, e, B),
123
124
  subtitle: r.secondary_text ?? "",
124
125
  title: r.primary_text ?? ""
125
126
  }))
126
127
  });
127
128
  });
128
129
  export {
129
- Mo as TransactionBlock
130
+ wo as TransactionBlock
130
131
  };
131
132
 
132
133
  //# sourceMappingURL=TransactionBlock.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport { alpha, useTheme } from '@mui/material/styles'\nimport type { Theme } from '@mui/material/styles'\n\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useGlobalCopyStore, useGlobalStore } from '../../../../common'\nimport { slot } from '../../../../core'\nimport type { InsightsPayload, InstanceSlotRow, LogoRef } from '../../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport { useBeatActions } from '../../../beatActions'\nimport CategoryTile from '../../../components/CategoryTile'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport LogoMark, { isKnownIcon } from '../../../components/LogoMark'\nimport StatusMessageCard from '../../../components/StatusMessageCard'\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { logoFromRef } from '../../../components/shared/EntityLogo'\nimport { statusIconName, statusIconPalette } from '../../../components/statusIcon'\nimport { subscriptionFrequency } from '../../../components/SubscriptionStatus/subscriptionFrequency'\nimport { repeatingTransactionOf, USER_RESPONSE } from '../../../ctaActions/subscriptionAnswer'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asLogoRef } from '../../slotReaders'\nimport { getLayoutConfig, transactionBlockVariant } from './layout'\n\ninterface TransactionBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\nconst ROW_LOGO_SIZE = 32\n// Same glyph-to-tile ratio mxui's `CategoryIcon` uses, so a status icon sits like the other logos.\nconst ROW_ICON_SIZE = Math.round(ROW_LOGO_SIZE * 0.625)\nconst STATUS_ICON_SIZE = 24\n// Status badge: palette disc, contrastText glyph.\nconst BADGE_SIZE = 32\nconst BADGE_GLYPH_SIZE = 20\n\n/** Status disc from `data.icon` / `data.reviewed_icon`. */\nconst SubscriptionBadge = ({ icon }: { icon?: LogoRef }) => {\n const name = statusIconName(icon?.guid)\n\n if (!name) return null\n\n return (\n <Box\n aria-hidden={true}\n data-icon={name}\n data-testid=\"subscription-badge\"\n sx={{\n alignItems: 'center',\n bgcolor: `${statusIconPalette(icon?.color)}.main`,\n borderRadius: '50%',\n display: 'flex',\n height: BADGE_SIZE,\n justifyContent: 'center',\n width: BADGE_SIZE,\n }}\n >\n <Icon\n fill={true}\n name={name}\n size={BADGE_GLYPH_SIZE}\n sx={{ color: `${statusIconPalette(icon?.color)}.contrastText` }}\n />\n </Box>\n )\n}\n\n/**\n * The row's leading logo from its `LogoRef`; an unrecognized guid prefix draws none rather than\n * guessing. The variant's `categoryTint` styles only a `CAT-` row; a merchant's `fallback_guid`\n * keeps `MerchantLogo`'s untinted fallback.\n */\nconst renderRowLogo = (row: InstanceSlotRow, theme: Theme, categoryTint?: number) => {\n const logo = logoFromRef(row.logo, row.primary_text)\n\n if (!logo) return undefined\n\n if (logo.logo_name) {\n if (!isKnownIcon(logo.logo_name)) return undefined\n\n // A status `{ icon, color }` logo is a bare coloured glyph. An `ICO-` fill logo (Weekly New\n // Merchants' \"Others\" row) is Figma's accent tile: its colour, else chart-2, at 15% behind the glyph.\n const accentTile = !!logo.logo_fill\n const tileColor = logo.logo_color ?? theme.palette.chart.chart2 ?? theme.palette.primary.main\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: ROW_LOGO_SIZE,\n justifyContent: 'center',\n width: ROW_LOGO_SIZE,\n ...(accentTile && {\n bgcolor: alpha(tileColor, 0.15),\n // Figma: match the row's other logo tiles.\n borderRadius: `${theme.shape.borderRadius}px`,\n }),\n }}\n >\n <Icon\n name={logo.logo_name}\n size={ROW_ICON_SIZE}\n sx={{ color: accentTile ? tileColor : logo.logo_color }}\n />\n </Box>\n )\n }\n\n if (logo.merchant_guid || logo.institution_guid) {\n return <LogoMark logo={logo} size={ROW_LOGO_SIZE} />\n }\n\n if (logo.category_guid) {\n return (\n <CategoryTile categoryGuid={logo.category_guid} size={ROW_LOGO_SIZE} tint={categoryTint} />\n )\n }\n\n return undefined\n}\n\n/**\n * The `transaction_block`: rows the backend already localized, carried inline on\n * `instance_slot.data.series` (`logo`, `primary_text`, `secondary_text`, `amount`). Only the\n * amount is formatted here, because the contract sends it as a number. `instance_slot.variant`\n * picks the header and slot treatment from `./layout.ts`.\n *\n * This is the full/mini shape. The reduced widgets (micro, embedded) resolve to the row logo\n * alone, carried flat on `data.logo` with no `series`, and are drawn by `CompactInsightCard`.\n *\n * `status_message` draws no rows: `data.message` beside the `data.icon` logo, as a\n * `StatusMessageCard` banner (Uncategorized Transactions V2 `complete`).\n *\n * A header, when the variant shows one, comes from `instance_slot.data.header_text` (the\n * transaction date, or \"{count} transactions\"). It deliberately does *not* come from the first\n * row: on a `with_merchant` card a row's `secondary_text` is the category, so reading it here\n * rendered the category twice and dropped the date entirely.\n *\n * A footer/summary row (Replenish Savings' \"Remaining Balance\", Weekly New Merchants' \"Total\")\n * renders when the variant's `showFooter` config is set (`with_header_footer`, `with_footer`), from\n * `data.footer_text` with `data.footer_amount` beside it, formatted like the row amounts (the\n * contract sends it as a number).\n */\nexport const TransactionBlock = observer(({ payload }: TransactionBlockProps) => {\n const theme = useTheme()\n const stores = useGlobalStore()\n const { recurring: recurringCopy } = useGlobalCopyStore()\n const { beat } = useBeatActions()\n const { data, variant } = payload.instance_slot\n // The plain row is the safe default: it adds nothing a wrong variant could misstate.\n const {\n answeredBackground,\n background,\n cardVariant,\n categoryTint,\n creditAmounts,\n elevated,\n followsSubscription,\n headerColor,\n raised,\n showFooter,\n showFrequency,\n showHeader,\n statusMessage,\n sx,\n } = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n transactionBlockVariant.NoHeader,\n 'TransactionBlock',\n )\n\n // The live repeating transaction (read-only), for the frequency and the badge / answered wash.\n const repeating =\n (showFrequency || followsSubscription) && beat\n ? repeatingTransactionOf({ beat, stores })\n : undefined\n const subscribed = !!followsSubscription && repeating?.user_response === USER_RESPONSE.CONFIRMED\n\n if (statusMessage) {\n const message = slot<string>(data, 'message')\n if (typeof message !== 'string' || !message.trim()) {\n console.warn('[TransactionBlock] status_message has no message — rendering nothing.')\n return null\n }\n\n // The icon only decorates the message, so it is hidden from the status announcement.\n return (\n <StatusMessageCard\n icon={\n <Box aria-hidden=\"true\" sx={{ display: 'flex' }}>\n <LogoFromGuid logo={asLogoRef(slot(data, 'icon'))} size={STATUS_ICON_SIZE} />\n </Box>\n }\n message={message}\n // The 20% wash layers over paper, as Figma's slot does.\n sx={background ? { backgroundImage: background, bgcolor: 'background.paper' } : undefined}\n />\n )\n }\n\n const series = slot<InstanceSlotRow[]>(data, 'series')\n const headerText = slot<string>(data, 'header_text')\n\n if (!Array.isArray(series) || !series.length) return null\n\n const header = showHeader && typeof headerText === 'string' ? headerText : undefined\n\n const footerText = slot<string>(data, 'footer_text')\n const footerAmount = slot<number>(data, 'footer_amount')\n const footer =\n showFooter && typeof footerText === 'string'\n ? {\n label: footerText,\n amount: formatCurrency(footerAmount, CURRENCY_FORMAT.cents),\n }\n : undefined\n\n // Live, as pulse: the repeating transaction the CTA's `prepare` loads.\n const frequency = showFrequency ? subscriptionFrequency(recurringCopy, repeating) : undefined\n const badge = followsSubscription ? (\n <SubscriptionBadge icon={asLogoRef(slot(data, subscribed ? 'reviewed_icon' : 'icon'))} />\n ) : undefined\n\n // Only a positive amount reads as a credit.\n const isCredit = (amount: unknown) => !!creditAmounts && typeof amount === 'number' && amount > 0\n\n return (\n <TransactionListCard\n background={subscribed && answeredBackground ? answeredBackground : background}\n badge={badge}\n elevated={elevated}\n footer={footer}\n header={header}\n headerColor={headerColor}\n raised={raised}\n sx={sx}\n variant={cardVariant}\n rows={series.map((row) => ({\n amount:\n typeof row.amount === 'number'\n ? `${isCredit(row.amount) ? '+' : ''}${formatCurrency(row.amount, CURRENCY_FORMAT.cents)}`\n : '',\n amountColor: isCredit(row.amount) ? 'success.main' : undefined,\n amountCaption: frequency,\n leading: renderRowLogo(row, theme, categoryTint),\n subtitle: row.secondary_text ?? '',\n title: row.primary_text ?? '',\n }))}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiCA,IAAM,IAAgB,IAEhB,KAAgB,KAAK,MAAM,IAAgB,KAAK,GAChD,KAAmB,IAEnB,IAAa,IACb,KAAmB,IAGnB,KAAA,CAAqB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ACf,SAAS,GAAc,GAAK,GAAO,CAAY;AAAA,MAC/C,UAAU,EAAI,kBAAkB;AAAA,MAChC,OAAO,EAAI,gBAAgB;AAAA,IAC7B,EAAE;AAAA,EACH,CAAA;AAEL,CAAC"}
1
+ {"version":3,"file":"TransactionBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport { alpha, useTheme } from '@mui/material/styles'\nimport type { Theme } from '@mui/material/styles'\n\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useGlobalCopyStore, useGlobalStore } from '../../../../common'\nimport { slot } from '../../../../core'\nimport type { InsightsPayload, InstanceSlotRow, LogoRef } from '../../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport { useBeatActions } from '../../../beatActions'\nimport CategoryTile from '../../../components/CategoryTile'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport LogoMark, { isKnownIcon } from '../../../components/LogoMark'\nimport StatusMessageCard from '../../../components/StatusMessageCard'\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { logoFromRef } from '../../../components/shared/EntityLogo'\nimport { statusIconName, statusIconPalette } from '../../../components/statusIcon'\nimport { subscriptionFrequency } from '../../../components/SubscriptionStatus/subscriptionFrequency'\nimport { repeatingTransactionOf, USER_RESPONSE } from '../../../ctaActions/subscriptionAnswer'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asLogoRef } from '../../slotReaders'\nimport { getLayoutConfig, transactionBlockVariant } from './layout'\n\ninterface TransactionBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\nconst ROW_LOGO_SIZE = 32\n// Same glyph-to-tile ratio mxui's `CategoryIcon` uses, so a status icon sits like the other logos.\nconst ROW_ICON_SIZE = Math.round(ROW_LOGO_SIZE * 0.625)\nconst STATUS_ICON_SIZE = 24\n// Status badge: palette disc, contrastText glyph.\nconst BADGE_SIZE = 32\nconst BADGE_GLYPH_SIZE = 20\n\n/** Status disc from `data.icon` / `data.reviewed_icon`. */\nconst SubscriptionBadge = ({ icon }: { icon?: LogoRef }) => {\n const name = statusIconName(icon?.guid)\n\n if (!name) return null\n\n return (\n <Box\n aria-hidden={true}\n data-icon={name}\n data-testid=\"subscription-badge\"\n sx={{\n alignItems: 'center',\n bgcolor: `${statusIconPalette(icon?.color)}.main`,\n borderRadius: '50%',\n display: 'flex',\n height: BADGE_SIZE,\n justifyContent: 'center',\n width: BADGE_SIZE,\n }}\n >\n <Icon\n fill={true}\n name={name}\n size={BADGE_GLYPH_SIZE}\n sx={{ color: `${statusIconPalette(icon?.color)}.contrastText` }}\n />\n </Box>\n )\n}\n\n/**\n * The row's leading logo from its `LogoRef`; an unrecognized guid prefix draws none rather than\n * guessing. The variant's `categoryTint` styles only a `CAT-` row; a merchant's `fallback_guid`\n * keeps `MerchantLogo`'s untinted fallback.\n */\nconst renderRowLogo = (row: InstanceSlotRow, theme: Theme, categoryTint?: number) => {\n const logo = logoFromRef(row.logo, row.primary_text)\n\n if (!logo) return undefined\n\n if (logo.logo_name) {\n if (!isKnownIcon(logo.logo_name)) return undefined\n\n // A status `{ icon, color }` logo is a bare coloured glyph. An `ICO-` fill logo (Weekly New\n // Merchants' \"Others\" row) is Figma's accent tile: its colour, else chart-2, at 15% behind the glyph.\n const accentTile = !!logo.logo_fill\n const tileColor = logo.logo_color ?? theme.palette.chart.chart2 ?? theme.palette.primary.main\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: ROW_LOGO_SIZE,\n justifyContent: 'center',\n width: ROW_LOGO_SIZE,\n ...(accentTile && {\n bgcolor: alpha(tileColor, 0.15),\n // Figma: match the row's other logo tiles.\n borderRadius: `${theme.shape.borderRadius}px`,\n }),\n }}\n >\n <Icon\n name={logo.logo_name}\n size={ROW_ICON_SIZE}\n sx={{ color: accentTile ? tileColor : logo.logo_color }}\n />\n </Box>\n )\n }\n\n if (logo.merchant_guid || logo.institution_guid) {\n return <LogoMark logo={logo} size={ROW_LOGO_SIZE} />\n }\n\n if (logo.category_guid) {\n return (\n <CategoryTile categoryGuid={logo.category_guid} size={ROW_LOGO_SIZE} tint={categoryTint} />\n )\n }\n\n return undefined\n}\n\n/**\n * The `transaction_block`: rows the backend already localized, carried inline on\n * `instance_slot.data.series` (`logo`, `primary_text`, `secondary_text`, `amount`). Only the\n * amount is formatted here, because the contract sends it as a number. `instance_slot.variant`\n * picks the header and slot treatment from `./layout.ts`.\n *\n * This is the full/mini shape. The reduced widgets (micro, embedded) resolve to the row logo\n * alone, carried flat on `data.logo` with no `series`, and are drawn by `CompactInsightCard`.\n *\n * `status_message` draws no rows: `data.message` beside the `data.icon` logo, as a\n * `StatusMessageCard` banner (Uncategorized Transactions V2 `complete`).\n *\n * A header, when the variant shows one, comes from `instance_slot.data.header_text` (the\n * transaction date, or \"{count} transactions\"). It deliberately does *not* come from the first\n * row: on a `with_merchant` card a row's `secondary_text` is the category, so reading it here\n * rendered the category twice and dropped the date entirely.\n *\n * A footer/summary row (Replenish Savings' \"Remaining Balance\", Weekly New Merchants' \"Total\")\n * renders when the variant's `showFooter` config is set (`with_header_footer`, `with_footer`), from\n * `data.footer_text` with `data.footer_amount` beside it, formatted like the row amounts (the\n * contract sends it as a number).\n */\nexport const TransactionBlock = observer(({ payload }: TransactionBlockProps) => {\n const theme = useTheme()\n const stores = useGlobalStore()\n const { recurring: recurringCopy } = useGlobalCopyStore()\n const { beat } = useBeatActions()\n const { data, variant } = payload.instance_slot\n // The plain row is the safe default: it adds nothing a wrong variant could misstate.\n const {\n answeredBackground,\n background,\n cardVariant,\n categoryTint,\n creditAmounts,\n elevated,\n followsSubscription,\n headerColor,\n headerRegular,\n raised,\n showFooter,\n showFrequency,\n showHeader,\n statusMessage,\n sx,\n } = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n transactionBlockVariant.NoHeader,\n 'TransactionBlock',\n )\n\n // The live repeating transaction (read-only), for the frequency and the badge / answered wash.\n const repeating =\n (showFrequency || followsSubscription) && beat\n ? repeatingTransactionOf({ beat, stores })\n : undefined\n const subscribed = !!followsSubscription && repeating?.user_response === USER_RESPONSE.CONFIRMED\n\n if (statusMessage) {\n const message = slot<string>(data, 'message')\n if (typeof message !== 'string' || !message.trim()) {\n console.warn('[TransactionBlock] status_message has no message — rendering nothing.')\n return null\n }\n\n // The icon only decorates the message, so it is hidden from the status announcement.\n return (\n <StatusMessageCard\n icon={\n <Box aria-hidden=\"true\" sx={{ display: 'flex' }}>\n <LogoFromGuid logo={asLogoRef(slot(data, 'icon'))} size={STATUS_ICON_SIZE} />\n </Box>\n }\n message={message}\n // The 20% wash layers over paper, as Figma's slot does.\n sx={background ? { backgroundImage: background, bgcolor: 'background.paper' } : undefined}\n />\n )\n }\n\n const series = slot<InstanceSlotRow[]>(data, 'series')\n const headerText = slot<string>(data, 'header_text')\n\n if (!Array.isArray(series) || !series.length) return null\n\n const header = showHeader && typeof headerText === 'string' ? headerText : undefined\n\n const footerText = slot<string>(data, 'footer_text')\n const footerAmount = slot<number>(data, 'footer_amount')\n const footer =\n showFooter && typeof footerText === 'string'\n ? {\n label: footerText,\n amount: formatCurrency(footerAmount, CURRENCY_FORMAT.cents),\n }\n : undefined\n\n // Live, as pulse: the repeating transaction the CTA's `prepare` loads.\n const frequency = showFrequency ? subscriptionFrequency(recurringCopy, repeating) : undefined\n const badge = followsSubscription ? (\n <SubscriptionBadge icon={asLogoRef(slot(data, subscribed ? 'reviewed_icon' : 'icon'))} />\n ) : undefined\n\n // Only a positive amount reads as a credit.\n const isCredit = (amount: unknown) => !!creditAmounts && typeof amount === 'number' && amount > 0\n\n return (\n <TransactionListCard\n background={subscribed && answeredBackground ? answeredBackground : background}\n badge={badge}\n elevated={elevated}\n footer={footer}\n header={header}\n headerColor={headerColor}\n headerRegular={headerRegular}\n raised={raised}\n sx={sx}\n variant={cardVariant}\n rows={series.map((row) => ({\n amount:\n typeof row.amount === 'number'\n ? `${isCredit(row.amount) ? '+' : ''}${formatCurrency(row.amount, CURRENCY_FORMAT.cents)}`\n : '',\n amountColor: isCredit(row.amount) ? 'success.main' : undefined,\n amountCaption: frequency,\n leading: renderRowLogo(row, theme, categoryTint),\n subtitle: row.secondary_text ?? '',\n title: row.primary_text ?? '',\n }))}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiCA,IAAM,IAAgB,IAEhB,KAAgB,KAAK,MAAM,IAAgB,KAAK,GAChD,KAAmB,IAEnB,IAAa,IACb,KAAmB,IAGnB,KAAA,CAAqB,EAAE,MAAA,EAAA,MAA+B;AAC1D,QAAM,IAAO,GAAe,GAAM,IAAI;AAEtC,SAAK,IAGH,gBAAA,EAAC,GAAD;AAAA,IACE,eAAa;AAAA,IACb,aAAW;AAAA,IACX,eAAY;AAAA,IACZ,IAAI;AAAA,MACF,YAAY;AAAA,MACZ,SAAS,GAAG,EAAkB,GAAM,KAAK,CAAA;AAAA,MACzC,cAAc;AAAA,MACd,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,OAAO;AAAA,IACT;AAAA,IAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,MAAM;AAAA,MACA,MAAA;AAAA,MACN,MAAM;AAAA,MACN,IAAI,EAAE,OAAO,GAAG,EAAkB,GAAM,KAAK,CAAA,gBAAiB;AAAA,IAC/D,CAAA;AAAA,EACE,CAAA,IAvBW;AAyBpB,GAOM,KAAA,CAAiB,GAAsB,GAAc,MAA0B;AACnF,QAAM,IAAO,EAAY,EAAI,MAAM,EAAI,YAAY;AAEnD,MAAK,GAEL;AAAA,QAAI,EAAK,WAAW;AAClB,UAAI,CAAC,EAAY,EAAK,SAAS,EAAG;AAIlC,YAAM,IAAa,CAAC,CAAC,EAAK,WACpB,IAAY,EAAK,cAAc,EAAM,QAAQ,MAAM,UAAU,EAAM,QAAQ,QAAQ;AACzF,aACE,gBAAA,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B,IAAqB;AAAA,IAC7D,OAAA;AAAA,IACG,UAAA;AAAA,IACF,QAAA;AAAA,IACA,QAAA;AAAA,IACK,aAAA;AAAA,IACE,eAAA;AAAA,IACP,QAAA;AAAA,IACJ,IAAA;AAAA,IACJ,SAAS;AAAA,IACT,MAAM,EAAO,IAAA,CAAK,OAAS;AAAA,MACzB,QACE,OAAO,EAAI,UAAW,WAClB,GAAG,EAAS,EAAI,MAAM,IAAI,MAAM,EAAA,GAAK,EAAe,EAAI,QAAQ,EAAgB,KAAK,CAAA,KACrF;AAAA,MACN,aAAa,EAAS,EAAI,MAAM,IAAI,iBAAiB;AAAA,MACrD,eAAe;AAAA,MACf,SAAS,GAAc,GAAK,GAAO,CAAY;AAAA,MAC/C,UAAU,EAAI,kBAAkB;AAAA,MAChC,OAAO,EAAI,gBAAgB;AAAA,IAC7B,EAAE;AAAA,EACH,CAAA;AAEL,CAAC"}
@@ -15,8 +15,8 @@ import { SxProps, Theme } from '@mui/material/styles';
15
15
  * - `StatusMessage` — no rows: an icon + message banner from `data.icon` / `data.message`
16
16
  * (Uncategorized Transactions V2 `complete`, "All Categorized!").
17
17
  * - `ListWithHeaderFooter` — every row under a date header plus a total row (Duplicate Payment).
18
- * - `SpendingSummary` — header, rows and footer, with the header text in `primary.main`
19
- * (Weekend Spending Summary: the weekend above one row per category and "Total spent").
18
+ * - `WithPrimaryHeaderFooter` — a regular `primary.main` header over the rows (each category on its
19
+ * tinted tile) and a total row (Weekend Spending Summary: "Showing x of y categories", "Total Spend").
20
20
  * - `CreditListWithHeader` — the date above the rows, each amount a green "+" credit (Micro Deposits' full).
21
21
  * - `CreditSummary` — credit rows, header never shown (Micro Deposits' mini sends one summed row).
22
22
  */
@@ -31,7 +31,7 @@ export declare const transactionBlockVariant: {
31
31
  readonly InfoWash: "info_wash";
32
32
  readonly WarningWash: "warning_wash";
33
33
  readonly StatusMessage: "status_message";
34
- readonly SpendingSummary: "spending_summary";
34
+ readonly WithPrimaryHeaderFooter: "with_primary_header_footer";
35
35
  readonly CreditListWithHeader: "credit_list_with_header";
36
36
  readonly CreditSummary: "credit_summary";
37
37
  };
@@ -45,6 +45,8 @@ export interface TransactionLayoutConfig {
45
45
  cardVariant?: 'default' | 'primary';
46
46
  /** Theme colour for the header text, over the card style's own. */
47
47
  headerColor?: string;
48
+ /** Header text in the regular weight, not the grey utility header's bold (Figma "Showing x of y categories"). */
49
+ headerRegular?: boolean;
48
50
  /** CSS background for the slot behind the card; the card renders borderless unless `raised`. */
49
51
  background?: string;
50
52
  /** Render `data.message` as a `StatusMessageCard` banner instead of the rows. */
@@ -1,4 +1,4 @@
1
- import { WARM_LIME_ACCENT_GRADIENT as r, WARNING_WASH_GRADIENT as o, getPrimaryWashGradient as s } from "../../../components/celebrationGradients.es.js";
1
+ import { WARM_LIME_ACCENT_GRADIENT as t, WARNING_WASH_GRADIENT as o, getPrimaryWashGradient as s } from "../../../components/celebrationGradients.es.js";
2
2
  var e = {
3
3
  WithHeader: "with_header",
4
4
  WithHeaderFooter: "with_header_footer",
@@ -10,10 +10,10 @@ var e = {
10
10
  InfoWash: "info_wash",
11
11
  WarningWash: "warning_wash",
12
12
  StatusMessage: "status_message",
13
- SpendingSummary: "spending_summary",
13
+ WithPrimaryHeaderFooter: "with_primary_header_footer",
14
14
  CreditListWithHeader: "credit_list_with_header",
15
15
  CreditSummary: "credit_summary"
16
- }, t = 0.25, d = (a) => ({
16
+ }, r = 0.25, d = (a) => ({
17
17
  [e.WithHeader]: {
18
18
  showHeader: !0,
19
19
  categoryTint: 0.15
@@ -47,28 +47,30 @@ var e = {
47
47
  background: o,
48
48
  showFrequency: !0,
49
49
  followsSubscription: !0,
50
- answeredBackground: r,
50
+ answeredBackground: t,
51
51
  elevated: !0,
52
52
  sx: { p: "28px 24px 24px 32px" }
53
53
  },
54
54
  [e.StatusMessage]: {
55
55
  showHeader: !1,
56
56
  statusMessage: !0,
57
- background: r
57
+ background: t
58
58
  },
59
- [e.SpendingSummary]: {
59
+ [e.WithPrimaryHeaderFooter]: {
60
60
  showHeader: !0,
61
61
  showFooter: !0,
62
- headerColor: "primary.main"
62
+ headerColor: "primary.main",
63
+ headerRegular: !0,
64
+ categoryTint: r
63
65
  },
64
66
  [e.CreditListWithHeader]: {
65
67
  showHeader: !0,
66
- categoryTint: t,
68
+ categoryTint: r,
67
69
  creditAmounts: !0
68
70
  },
69
71
  [e.CreditSummary]: {
70
72
  showHeader: !1,
71
- categoryTint: t,
73
+ categoryTint: r,
72
74
  creditAmounts: !0
73
75
  }
74
76
  });
@@ -1 +1 @@
1
- {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.ts"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material/styles'\n\nimport {\n WARM_LIME_ACCENT_GRADIENT,\n WARNING_WASH_GRADIENT,\n getPrimaryWashGradient,\n} from '../../../components/celebrationGradients'\n\n/**\n * Transaction block variants, keyed by the backend `instance_slot.variant`. All render the same\n * pre-localized rows through `TransactionListCard`; only the header and the slot differ.\n *\n * - `WithHeader` — row under a date header (Fee Detected, Large Transaction).\n * - `WithHeaderFooter` — date header above the rows plus the footer/summary row from\n * `data.footer_text` / `data.footer_amount` (Replenish Savings' \"Remaining Balance\").\n * - `NoHeader` — the row alone (Large Transaction without a merchant).\n * - `UncategorizedTransaction` — filled primary header (\"{count} transactions\").\n * - `InfoWash` — raised row (border + shadow) on the blue slot wash, with the\n * subscription's live frequency under the amount (e.g. Subscription Detected).\n * - `WarningWash` — borderless row on the warning slot wash (e.g. Unexpected\n * Subscription Payment). Treatment names, not beat names, so any beat can reuse the wash.\n * - `StatusMessage` — no rows: an icon + message banner from `data.icon` / `data.message`\n * (Uncategorized Transactions V2 `complete`, \"All Categorized!\").\n * - `ListWithHeaderFooter` — every row under a date header plus a total row (Duplicate Payment).\n * - `SpendingSummary` — header, rows and footer, with the header text in `primary.main`\n * (Weekend Spending Summary: the weekend above one row per category and \"Total spent\").\n * - `CreditListWithHeader` — the date above the rows, each amount a green \"+\" credit (Micro Deposits' full).\n * - `CreditSummary` — credit rows, header never shown (Micro Deposits' mini sends one summed row).\n */\nexport const transactionBlockVariant = {\n WithHeader: 'with_header',\n WithHeaderFooter: 'with_header_footer',\n NoHeader: 'no_header',\n // A multi-row list with no in-card header plus a \"Total\" summary row (Weekly New Merchants; the\n // date range is the card subtitle). The plain no-footer list reuses `NoHeader`.\n WithFooter: 'with_footer',\n ListWithHeaderFooter: 'list_with_header_footer',\n List: 'list',\n UncategorizedTransaction: 'uncategorized_transaction',\n InfoWash: 'info_wash',\n WarningWash: 'warning_wash',\n StatusMessage: 'status_message',\n SpendingSummary: 'spending_summary',\n CreditListWithHeader: 'credit_list_with_header',\n CreditSummary: 'credit_summary',\n} as const\n\nexport type TransactionBlockVariant =\n (typeof transactionBlockVariant)[keyof typeof transactionBlockVariant]\n\nexport interface TransactionLayoutConfig {\n /** Show `instance_slot.data.header_text` above the rows. */\n showHeader: boolean\n /** Show the `data.footer_text` / `data.footer_amount` summary row beneath the rows. */\n showFooter?: boolean\n /** `TransactionListCard` style: grey utility header, or filled primary header. */\n cardVariant?: 'default' | 'primary'\n /** Theme colour for the header text, over the card style's own. */\n headerColor?: string\n /** CSS background for the slot behind the card; the card renders borderless unless `raised`. */\n background?: string\n /** Render `data.message` as a `StatusMessageCard` banner instead of the rows. */\n statusMessage?: boolean\n /** Caption each amount with the beat's live repeating transaction frequency. */\n showFrequency?: boolean\n /** Status badge and answered wash from the live repeating transaction. */\n followsSubscription?: boolean\n /** Wash once subscribed. */\n answeredBackground?: string\n /** Row card at `elevation/1` (needs `background`). */\n elevated?: boolean\n /** Slot padding override (CSS shorthand). */\n sx?: SxProps\n /** Border and shadow on the row card. */\n raised?: boolean\n /** A `CAT-` row logo's accent tile: the category colour at this opacity (0–1), bordered in it. */\n categoryTint?: number\n /** Draw each amount as a credit: a \"+\" prefix in `success.main`. */\n creditAmounts?: boolean\n}\n\n/** Figma's category background token: the category colour at 25%. */\nconst CATEGORY_BACKGROUND_TINT = 0.25\n\n/** Per-variant `TransactionListCard` props (mirrors DetailedAccountBlock's `getLayoutConfig`). */\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<TransactionBlockVariant, TransactionLayoutConfig> => ({\n // `with_header` is Replenish Savings' multi-account card: its one summary row is a `CAT-` Transfer\n // logo, which we tint at its own 15% accent. (Other `with_header` beats, e.g. Large Transaction, use\n // a merchant logo, so the `CAT-` tint path never runs for them.)\n [transactionBlockVariant.WithHeader]: { showHeader: true, categoryTint: 0.15 },\n [transactionBlockVariant.WithHeaderFooter]: { showHeader: true, showFooter: true },\n [transactionBlockVariant.NoHeader]: { showHeader: false },\n [transactionBlockVariant.WithFooter]: { showHeader: false, showFooter: true },\n [transactionBlockVariant.ListWithHeaderFooter]: { showHeader: true, showFooter: true },\n [transactionBlockVariant.List]: { showHeader: false },\n [transactionBlockVariant.UncategorizedTransaction]: { showHeader: true, cardVariant: 'primary' },\n [transactionBlockVariant.InfoWash]: {\n showHeader: false,\n background: getPrimaryWashGradient(theme),\n raised: true,\n showFrequency: true,\n },\n [transactionBlockVariant.WarningWash]: {\n showHeader: false,\n background: WARNING_WASH_GRADIENT,\n showFrequency: true,\n followsSubscription: true,\n answeredBackground: WARM_LIME_ACCENT_GRADIENT,\n elevated: true,\n // Room for the badge.\n sx: { p: '28px 24px 24px 32px' },\n },\n // Figma 1941:207336: the banner sits on the warm-to-lime slot wash.\n [transactionBlockVariant.StatusMessage]: {\n showHeader: false,\n statusMessage: true,\n background: WARM_LIME_ACCENT_GRADIENT,\n },\n [transactionBlockVariant.SpendingSummary]: {\n showHeader: true,\n showFooter: true,\n headerColor: 'primary.main',\n },\n [transactionBlockVariant.CreditListWithHeader]: {\n showHeader: true,\n categoryTint: CATEGORY_BACKGROUND_TINT,\n creditAmounts: true,\n },\n [transactionBlockVariant.CreditSummary]: {\n showHeader: false,\n categoryTint: CATEGORY_BACKGROUND_TINT,\n creditAmounts: true,\n },\n})\n"],"m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gB;AAAA,IACvC,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,YAAY;AAAA,EACd;AAAA,EACC,CAAA,EAAwB,eAAA,GAAkB;AAAA,IACzC,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,aAAa;AAAA,EACf;AAAA,EACC,CAAA,EAAwB,oBAAA,GAAuB;AAAA,IAC9C,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,eAAe;AAAA,EACjB;AAAA,EACC,CAAA,EAAwB,aAAA,GAAgB;AAAA,IACvC,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,eAAe;AAAA,EACjB;AACF"}
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.ts"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material/styles'\n\nimport {\n WARM_LIME_ACCENT_GRADIENT,\n WARNING_WASH_GRADIENT,\n getPrimaryWashGradient,\n} from '../../../components/celebrationGradients'\n\n/**\n * Transaction block variants, keyed by the backend `instance_slot.variant`. All render the same\n * pre-localized rows through `TransactionListCard`; only the header and the slot differ.\n *\n * - `WithHeader` — row under a date header (Fee Detected, Large Transaction).\n * - `WithHeaderFooter` — date header above the rows plus the footer/summary row from\n * `data.footer_text` / `data.footer_amount` (Replenish Savings' \"Remaining Balance\").\n * - `NoHeader` — the row alone (Large Transaction without a merchant).\n * - `UncategorizedTransaction` — filled primary header (\"{count} transactions\").\n * - `InfoWash` — raised row (border + shadow) on the blue slot wash, with the\n * subscription's live frequency under the amount (e.g. Subscription Detected).\n * - `WarningWash` — borderless row on the warning slot wash (e.g. Unexpected\n * Subscription Payment). Treatment names, not beat names, so any beat can reuse the wash.\n * - `StatusMessage` — no rows: an icon + message banner from `data.icon` / `data.message`\n * (Uncategorized Transactions V2 `complete`, \"All Categorized!\").\n * - `ListWithHeaderFooter` — every row under a date header plus a total row (Duplicate Payment).\n * - `WithPrimaryHeaderFooter` — a regular `primary.main` header over the rows (each category on its\n * tinted tile) and a total row (Weekend Spending Summary: \"Showing x of y categories\", \"Total Spend\").\n * - `CreditListWithHeader` — the date above the rows, each amount a green \"+\" credit (Micro Deposits' full).\n * - `CreditSummary` — credit rows, header never shown (Micro Deposits' mini sends one summed row).\n */\nexport const transactionBlockVariant = {\n WithHeader: 'with_header',\n WithHeaderFooter: 'with_header_footer',\n NoHeader: 'no_header',\n // A multi-row list with no in-card header plus a \"Total\" summary row (Weekly New Merchants; the\n // date range is the card subtitle). The plain no-footer list reuses `NoHeader`.\n WithFooter: 'with_footer',\n ListWithHeaderFooter: 'list_with_header_footer',\n List: 'list',\n UncategorizedTransaction: 'uncategorized_transaction',\n InfoWash: 'info_wash',\n WarningWash: 'warning_wash',\n StatusMessage: 'status_message',\n WithPrimaryHeaderFooter: 'with_primary_header_footer',\n CreditListWithHeader: 'credit_list_with_header',\n CreditSummary: 'credit_summary',\n} as const\n\nexport type TransactionBlockVariant =\n (typeof transactionBlockVariant)[keyof typeof transactionBlockVariant]\n\nexport interface TransactionLayoutConfig {\n /** Show `instance_slot.data.header_text` above the rows. */\n showHeader: boolean\n /** Show the `data.footer_text` / `data.footer_amount` summary row beneath the rows. */\n showFooter?: boolean\n /** `TransactionListCard` style: grey utility header, or filled primary header. */\n cardVariant?: 'default' | 'primary'\n /** Theme colour for the header text, over the card style's own. */\n headerColor?: string\n /** Header text in the regular weight, not the grey utility header's bold (Figma \"Showing x of y categories\"). */\n headerRegular?: boolean\n /** CSS background for the slot behind the card; the card renders borderless unless `raised`. */\n background?: string\n /** Render `data.message` as a `StatusMessageCard` banner instead of the rows. */\n statusMessage?: boolean\n /** Caption each amount with the beat's live repeating transaction frequency. */\n showFrequency?: boolean\n /** Status badge and answered wash from the live repeating transaction. */\n followsSubscription?: boolean\n /** Wash once subscribed. */\n answeredBackground?: string\n /** Row card at `elevation/1` (needs `background`). */\n elevated?: boolean\n /** Slot padding override (CSS shorthand). */\n sx?: SxProps\n /** Border and shadow on the row card. */\n raised?: boolean\n /** A `CAT-` row logo's accent tile: the category colour at this opacity (0–1), bordered in it. */\n categoryTint?: number\n /** Draw each amount as a credit: a \"+\" prefix in `success.main`. */\n creditAmounts?: boolean\n}\n\n/** Figma's category background token: the category colour at 25%. */\nconst CATEGORY_BACKGROUND_TINT = 0.25\n\n/** Per-variant `TransactionListCard` props (mirrors DetailedAccountBlock's `getLayoutConfig`). */\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<TransactionBlockVariant, TransactionLayoutConfig> => ({\n // `with_header` is Replenish Savings' multi-account card: its one summary row is a `CAT-` Transfer\n // logo, which we tint at its own 15% accent. (Other `with_header` beats, e.g. Large Transaction, use\n // a merchant logo, so the `CAT-` tint path never runs for them.)\n [transactionBlockVariant.WithHeader]: { showHeader: true, categoryTint: 0.15 },\n [transactionBlockVariant.WithHeaderFooter]: { showHeader: true, showFooter: true },\n [transactionBlockVariant.NoHeader]: { showHeader: false },\n [transactionBlockVariant.WithFooter]: { showHeader: false, showFooter: true },\n [transactionBlockVariant.ListWithHeaderFooter]: { showHeader: true, showFooter: true },\n [transactionBlockVariant.List]: { showHeader: false },\n [transactionBlockVariant.UncategorizedTransaction]: { showHeader: true, cardVariant: 'primary' },\n [transactionBlockVariant.InfoWash]: {\n showHeader: false,\n background: getPrimaryWashGradient(theme),\n raised: true,\n showFrequency: true,\n },\n [transactionBlockVariant.WarningWash]: {\n showHeader: false,\n background: WARNING_WASH_GRADIENT,\n showFrequency: true,\n followsSubscription: true,\n answeredBackground: WARM_LIME_ACCENT_GRADIENT,\n elevated: true,\n // Room for the badge.\n sx: { p: '28px 24px 24px 32px' },\n },\n // Figma 1941:207336: the banner sits on the warm-to-lime slot wash.\n [transactionBlockVariant.StatusMessage]: {\n showHeader: false,\n statusMessage: true,\n background: WARM_LIME_ACCENT_GRADIENT,\n },\n // Figma 1283:89587: \"Showing x of y categories\" in 11px regular primary, each category tile at its 25% background.\n [transactionBlockVariant.WithPrimaryHeaderFooter]: {\n showHeader: true,\n showFooter: true,\n headerColor: 'primary.main',\n headerRegular: true,\n categoryTint: CATEGORY_BACKGROUND_TINT,\n },\n [transactionBlockVariant.CreditListWithHeader]: {\n showHeader: true,\n categoryTint: CATEGORY_BACKGROUND_TINT,\n creditAmounts: true,\n },\n [transactionBlockVariant.CreditSummary]: {\n showHeader: false,\n categoryTint: CATEGORY_BACKGROUND_TINT,\n creditAmounts: true,\n },\n})\n"],"mappings":";AA6BA,IAAa,IAA0B;AAAA,EACrC,YAAY;AAAA,EACZ,kBAAkB;AAAA,EAClB,UAAU;AAAA,EAGV,YAAY;AAAA,EACZ,sBAAsB;AAAA,EACtB,MAAM;AAAA,EACN,0BAA0B;AAAA,EAC1B,UAAU;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AAAA,EACf,yBAAyB;AAAA,EACzB,sBAAsB;AAAA,EACtB,eAAe;AACjB,GAuCM,IAA2B,MAGpB,IAAA,CACX,OAC8D;AAAA,EAI7D,CAAA,EAAwB,UAAA,GAAa;AAAA,IAAE,YAAY;AAAA,IAAM,cAAc;AAAA,EAAK;AAAA,EAC5E,CAAA,EAAwB,gBAAA,GAAmB;AAAA,IAAE,YAAY;AAAA,IAAM,YAAY;AAAA,EAAK;AAAA,EAChF,CAAA,EAAwB,QAAA,GAAW,EAAE,YAAY,GAAM;AAAA,EACvD,CAAA,EAAwB,UAAA,GAAa;AAAA,IAAE,YAAY;AAAA,IAAO,YAAY;AAAA,EAAK;AAAA,EAC3E,CAAA,EAAwB,oBAAA,GAAuB;AAAA,IAAE,YAAY;AAAA,IAAM,YAAY;AAAA,EAAK;AAAA,EACpF,CAAA,EAAwB,IAAA,GAAO,EAAE,YAAY,GAAM;AAAA,EACnD,CAAA,EAAwB,wBAAA,GAA2B;AAAA,IAAE,YAAY;AAAA,IAAM,aAAa;AAAA,EAAU;AAAA,EAC9F,CAAA,EAAwB,QAAA,GAAW;AAAA,IAClC,YAAY;AAAA,IACZ,YAAY,EAAuB,CAAK;AAAA,IACxC,QAAQ;AAAA,IACR,eAAe;A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