@mx-cartographer/experiences 9.7.83 → 9.7.85

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,13 @@
1
+ ## [9.7.85] - 11-02-2026
2
+
3
+ - **FIXED** - account filter keeps the selection and shows a loading state while it saves (WELL-46)
4
+
5
+ ## [9.7.84] - 11-03-2026
6
+
7
+ - **FIXED** - An Insights 2.0 mini card's action link hands its tap to the host as the card tap (`HOST_ACTIONS.cardClick` through `beatActions.onCtaAction`), as micro's link does, so the host sends its post message and analytics (WEC-2196)
8
+ - **CHANGED** - Host: pulse handles `cardClick` in pulse !3906; until then the link sends nothing, as before (pulse's `MiniCardV2` skips taps on buttons). A host without `onCtaAction` keeps today's behaviour (the click bubbles)
9
+ - **CHANGED** - The card's action link (mini, and a full card's block-less link) sits under the description, as in Figma
10
+
1
11
  ## [9.7.83] - 11-02-2026
2
12
 
3
13
  - **FIXED** - dialogs fit on small mobile screens, mxui (WELL-51)
@@ -1,96 +1,105 @@
1
- import { buildDynamicCopy as O } from "../../core/utils/Localization.es.js";
2
- import { useAccountStore as T, useGlobalCopyStore as j, useGlobalUiStore as W, useHostMessage as H } from "../context/hooks.es.js";
3
- import { useAriaLive as A } from "../hooks/useAriaLive.es.js";
4
- import { buildSelectionFilter as I, getSelectionCounts as K } from "./globalaccountfilter/selection.es.js";
5
- import { GlobalAccountFilterList as P } from "./globalaccountfilter/GlobalAccountFilterList.es.js";
6
- import i from "react";
7
- import { observer as U } from "mobx-react-lite";
8
- import C from "@mui/material/Stack";
9
- import u from "@mui/material/Button";
10
- import { FilterAlt as S } from "@mxenabled/mx-icons";
11
- import { jsx as t, jsxs as p } from "react/jsx-runtime";
12
- import q from "@mui/material/Box";
13
- import J from "@mui/material/IconButton";
14
- import N from "@mui/material/Divider";
15
- import Q from "@mui/material/Popover";
16
- import V from "@mui/material/Tooltip";
17
- var dt = U(({ allowedAccountTypes: d, isDesktop: F, onAccountFilterClick: k, sx: _ = {}, variant: w = "text" }) => {
18
- const { common: a } = j(), { accountFilterMap: m, resetAccountFilterMap: B } = W(), { detailedAccounts: f, updateAccountFilter: E } = T(), { sendHostMessage: c } = H(), { announce: L, ariaLive: D } = A(), { announce: h, ariaLive: R } = A(), [b, s] = i.useState(null), o = i.useRef(null), l = i.useRef(0), n = a.account_filter, g = (r) => {
19
- l.current += 1, o.current = null, B(), s(r.currentTarget), k?.();
20
- }, v = () => {
21
- l.current += 1, s(null);
22
- }, x = async () => {
23
- const { selected: r, total: G } = K(I(m, f, d)), M = l.current;
24
- await E(m), M === l.current && (o.current = O(n.applied_announcement, String(r), String(G)), s(null));
25
- }, z = (r) => {
26
- r.key === "Enter" && r.target === r.currentTarget && x();
27
- }, e = !!b, y = f.length === 0;
28
- return i.useEffect(() => {
1
+ import { buildDynamicCopy as I } from "../../core/utils/Localization.es.js";
2
+ import { useAccountStore as W, useGlobalCopyStore as H, useGlobalUiStore as K, useHostMessage as P } from "../context/hooks.es.js";
3
+ import { useAriaLive as k } from "../hooks/useAriaLive.es.js";
4
+ import { buildSelectionFilter as U, getSelectionCounts as q } from "./globalaccountfilter/selection.es.js";
5
+ import { GlobalAccountFilterList as J } from "./globalaccountfilter/GlobalAccountFilterList.es.js";
6
+ import n from "react";
7
+ import { observer as N } from "mobx-react-lite";
8
+ import _ from "@mui/material/Stack";
9
+ import d from "@mui/material/Button";
10
+ import { FilterAlt as w } from "@mxenabled/mx-icons";
11
+ import { jsx as t, jsxs as f } from "react/jsx-runtime";
12
+ import Q from "@mui/material/Box";
13
+ import V from "@mui/material/IconButton";
14
+ import X from "@mui/material/Divider";
15
+ import Y from "@mui/material/Popover";
16
+ import Z from "@mui/material/Tooltip";
17
+ var gt = N(({ allowedAccountTypes: m, isDesktop: B, onAccountFilterClick: E, sx: L = {}, variant: D = "text" }) => {
18
+ const { common: i } = H(), c = K(), { accountFilterMap: g, resetAccountFilterMap: b, setIsApplyingAccountFilter: h } = c, s = c.isApplyingAccountFilter, { detailedAccounts: y, updateAccountFilter: R } = W(), { sendHostMessage: u } = P(), { announce: z, ariaLive: G } = k(), { announce: A, ariaLive: M } = k(), [v, p] = n.useState(null), l = n.useRef(null), a = n.useRef(0), o = i.account_filter, x = (r) => {
19
+ a.current += 1, b(), p(r.currentTarget), E?.();
20
+ }, F = () => {
21
+ a.current += 1, p(null);
22
+ }, S = async () => {
23
+ if (c.isApplyingAccountFilter) return;
24
+ const { selected: r, total: T } = q(U(g, y, m)), j = a.current;
25
+ h(!0);
26
+ try {
27
+ await R(g);
28
+ } finally {
29
+ h(!1);
30
+ }
31
+ b(), j === a.current && (l.current = I(o.applied_announcement, String(r), String(T)), p(null));
32
+ }, O = (r) => {
33
+ r.key === "Enter" && r.target === r.currentTarget && S();
34
+ }, e = !!v, C = y.length === 0;
35
+ return n.useEffect(() => {
29
36
  if (e)
30
- return c("focusTrap", { trapped: !0 }), () => c("focusTrap", { trapped: !1 });
31
- }, [e, c]), i.useEffect(() => {
32
- e || !o.current || (h(o.current), o.current = null);
33
- }, [e, h]), /* @__PURE__ */ p(q, {
34
- sx: { ..._ },
37
+ return u("focusTrap", { trapped: !0 }), () => u("focusTrap", { trapped: !1 });
38
+ }, [e, u]), n.useEffect(() => {
39
+ e || !l.current || (A(l.current), l.current = null);
40
+ }, [e, A]), /* @__PURE__ */ f(Q, {
41
+ sx: { ...L },
35
42
  children: [
36
- R,
37
- F ? /* @__PURE__ */ t(u, {
43
+ M,
44
+ B ? /* @__PURE__ */ t(d, {
38
45
  "aria-controls": e ? "filter_accounts" : void 0,
39
46
  "aria-expanded": e,
40
47
  "aria-haspopup": "dialog",
41
- "aria-label": n.title,
42
- disabled: y,
43
- onClick: g,
44
- startIcon: /* @__PURE__ */ t(S, { size: 24 }),
48
+ "aria-label": o.title,
49
+ disabled: C,
50
+ onClick: x,
51
+ startIcon: /* @__PURE__ */ t(w, { size: 24 }),
45
52
  sx: {
46
53
  p: 8,
47
54
  whiteSpace: "nowrap",
48
55
  minWidth: "max-content"
49
56
  },
50
- variant: w,
51
- children: a.filter_button
52
- }) : /* @__PURE__ */ t(V, {
57
+ variant: D,
58
+ children: i.filter_button
59
+ }) : /* @__PURE__ */ t(Z, {
53
60
  id: "filter-accounts",
54
61
  placement: "bottom",
55
- title: n.title,
56
- children: /* @__PURE__ */ t(J, {
62
+ title: o.title,
63
+ children: /* @__PURE__ */ t(V, {
57
64
  "aria-controls": e ? "filter_accounts" : void 0,
58
65
  "aria-expanded": e,
59
66
  "aria-haspopup": "dialog",
60
- "aria-label": n.title,
67
+ "aria-label": o.title,
61
68
  color: "primary",
62
- disabled: y,
63
- onClick: g,
69
+ disabled: C,
70
+ onClick: x,
64
71
  sx: { p: 8 },
65
- children: /* @__PURE__ */ t(S, { size: 24 })
72
+ children: /* @__PURE__ */ t(w, { size: 24 })
66
73
  })
67
74
  }),
68
- /* @__PURE__ */ t(Q, {
69
- anchorEl: b,
75
+ /* @__PURE__ */ t(Y, {
76
+ anchorEl: v,
70
77
  anchorOrigin: {
71
78
  vertical: "bottom",
72
79
  horizontal: "left"
73
80
  },
74
- onClose: v,
81
+ onClose: F,
75
82
  open: e,
76
83
  slotProps: { paper: {
77
- "aria-label": n.title,
84
+ "aria-busy": s,
85
+ "aria-label": o.title,
78
86
  "aria-modal": !0,
79
- onKeyDown: z,
87
+ onKeyDown: O,
80
88
  role: "dialog"
81
89
  } },
82
90
  transformOrigin: {
83
91
  vertical: "top",
84
92
  horizontal: "left"
85
93
  },
86
- children: /* @__PURE__ */ p(C, { children: [
87
- D,
88
- /* @__PURE__ */ t(P, {
89
- allowedAccountTypes: d,
90
- announce: L
94
+ children: /* @__PURE__ */ f(_, { children: [
95
+ G,
96
+ /* @__PURE__ */ t(J, {
97
+ allowedAccountTypes: m,
98
+ announce: z,
99
+ disabled: s
91
100
  }),
92
- /* @__PURE__ */ t(N, {}),
93
- /* @__PURE__ */ p(C, {
101
+ /* @__PURE__ */ t(X, {}),
102
+ /* @__PURE__ */ f(_, {
94
103
  direction: "row",
95
104
  justifyContent: "space-between",
96
105
  spacing: 16,
@@ -100,17 +109,18 @@ var dt = U(({ allowedAccountTypes: d, isDesktop: F, onAccountFilterClick: k, sx:
100
109
  p: 16,
101
110
  position: "sticky"
102
111
  },
103
- children: [/* @__PURE__ */ t(u, {
112
+ children: [/* @__PURE__ */ t(d, {
104
113
  fullWidth: !0,
105
- onClick: v,
114
+ onClick: F,
106
115
  variant: "text",
107
- children: a.cancel_button
108
- }), /* @__PURE__ */ t(u, {
116
+ children: i.cancel_button
117
+ }), /* @__PURE__ */ t(d, {
109
118
  color: "primary",
110
119
  fullWidth: !0,
111
- onClick: x,
120
+ loading: s,
121
+ onClick: S,
112
122
  variant: "contained",
113
- children: a.filter_button
123
+ children: i.filter_button
114
124
  })]
115
125
  })
116
126
  ] })
@@ -119,7 +129,7 @@ var dt = U(({ allowedAccountTypes: d, isDesktop: F, onAccountFilterClick: k, sx:
119
129
  });
120
130
  });
121
131
  export {
122
- dt as GlobalAccountFilter
132
+ gt as GlobalAccountFilter
123
133
  };
124
134
 
125
135
  //# sourceMappingURL=GlobalAccountFilter.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GlobalAccountFilter.es.js","names":[],"sources":["../../../src/common/components/GlobalAccountFilter.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 Divider from '@mui/material/Divider'\nimport IconButton from '@mui/material/IconButton'\nimport Popover from '@mui/material/Popover'\nimport Stack from '@mui/material/Stack'\nimport Tooltip from '@mui/material/Tooltip'\nimport { SxProps } from '@mui/material/styles'\n\nimport { FilterAlt } from '@mxenabled/mx-icons'\n\nimport { useAccountStore, useGlobalCopyStore, useGlobalUiStore, useHostMessage } from '../context'\nimport { AccountType } from '../../core'\nimport { buildDynamicCopy } from '../../core/utils/Localization'\nimport { useAriaLive } from '../hooks/useAriaLive'\n\nimport { GlobalAccountFilterList } from './globalaccountfilter/GlobalAccountFilterList'\nimport { buildSelectionFilter, getSelectionCounts } from './globalaccountfilter/selection'\n\nexport interface GlobalAccountFilterProps {\n allowedAccountTypes?: AccountType[] | undefined\n isDesktop?: boolean\n onAccountFilterClick?: () => void\n sx?: SxProps\n variant?: 'outlined' | 'text'\n}\n\nexport const GlobalAccountFilter = observer(\n ({\n allowedAccountTypes,\n isDesktop,\n onAccountFilterClick,\n sx = {},\n variant = 'text',\n }: GlobalAccountFilterProps) => {\n const { common: commonCopy } = useGlobalCopyStore()\n const { accountFilterMap, resetAccountFilterMap } = useGlobalUiStore()\n\n const { detailedAccounts, updateAccountFilter } = useAccountStore()\n const { sendHostMessage } = useHostMessage()\n\n // Two regions, because MUI's ModalManager sets aria-hidden on every body\n // child outside the popover while it is open (and aria-modal tells AT to\n // ignore them anyway). Selection changes happen while the dialog is open, so\n // that region must live INSIDE it; the applied message is spoken after the\n // dialog is gone, so its region must live outside to survive the unmount.\n const { announce: announceSelection, ariaLive: selectionAriaLive } = useAriaLive()\n const { announce: announceApplied, ariaLive: appliedAriaLive } = useAriaLive()\n\n const [filterButtonEl, setFilterButtonEl] = React.useState<HTMLButtonElement | null>(null)\n // Set once the update resolves, consumed by the close effect below. It cannot\n // be announced from handleFilter directly: aria-hidden is still on the rest of\n // the document at that point, so the message would go into a hidden region.\n const pendingAppliedRef = React.useRef<string | null>(null)\n // Identifies one open..close cycle of the dialog. `handleFilter` captures it\n // before awaiting and bails if it changed, so a slow request cannot reach\n // back into a session the user has already left.\n const generationRef = React.useRef(0)\n\n const copy = commonCopy.account_filter\n\n const handleOpen = (event: React.MouseEvent<HTMLButtonElement>) => {\n generationRef.current += 1\n // Not subsumed by the generation guard. handleOpen and handleCancel both\n // bump the generation, so a single interrupted apply bails before it writes.\n // What still reaches this line is a SECOND apply started while the first was\n // in flight -- applying does not bump, so both continuations pass the guard.\n // The first closes the dialog and the effect consumes its message; the second\n // then writes onto an already-null anchor, so setFilterButtonEl(null) is a\n // no-op, React bails out of the render, and the effect never runs to consume\n // it. Clearing on the way back in stops that leftover surfacing later.\n //\n // Pinned by 'discards a leftover message from a second apply on the next\n // open' -- delete this line and that test fails. An in-flight guard on apply\n // (MEW-4138) would remove the reachable case and retire both.\n pendingAppliedRef.current = null\n resetAccountFilterMap()\n setFilterButtonEl(event.currentTarget)\n onAccountFilterClick?.()\n }\n\n const handleCancel = () => {\n // Ends the session too, so a request abandoned here cannot write its message\n // even if it resolves before the user reopens.\n generationRef.current += 1\n setFilterButtonEl(null)\n }\n\n const handleFilter = async () => {\n const { selected, total } = getSelectionCounts(\n buildSelectionFilter(accountFilterMap, detailedAccounts, allowedAccountTypes),\n )\n\n const generation = generationRef.current\n\n await updateAccountFilter(accountFilterMap)\n\n // The dialog moved on while this was in flight -- the user cancelled, or\n // cancelled and reopened. Announcing now would speak over a session that did\n // not ask for it, and closing would shut a dialog the user just opened.\n // NOTE: the update itself already committed; cancelling does not roll it\n // back. Only the announcement and the close are suppressed here.\n if (generation !== generationRef.current) return\n\n pendingAppliedRef.current = buildDynamicCopy(\n copy.applied_announcement,\n String(selected),\n String(total),\n ) as string\n setFilterButtonEl(null)\n }\n\n // Bound to the Paper, not an inner element: FocusTrap focuses the Paper on\n // open (getFocusTarget finds no `data-mui-focusable` marker and falls back to\n // the root), and keydown there bubbles UP -- a handler on a descendant would\n // never see the first keypress.\n //\n // Only fires when the Paper ITSELF holds focus. Anything focused inside it\n // owns its own Enter behaviour: buttons activate, and a checkbox must not\n // submit -- native checkboxes ignore Enter, so without this the keypress\n // bubbled up here and closed the dialog out from under someone who was just\n // moving through the list. A whitelist rather than a `closest()` exclusion\n // list, so a control added later cannot silently inherit submit-on-Enter.\n //\n // Narrower than it looks: the Paper is tabIndex=\"-1\", so once focus moves off\n // it there is no way to Tab back. Enter-applies is a one-shot affordance,\n // available only before the first Tab. The scroll region (tabIndex={0}) is the\n // first stop after it and deliberately does nothing on Enter.\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.key !== 'Enter') return\n if (event.target !== event.currentTarget) return\n\n handleFilter()\n }\n\n const isFilterOpen = Boolean(filterButtonEl)\n const filterDisabled = detailedAccounts.length === 0\n\n React.useEffect(() => {\n if (!isFilterOpen) return\n\n sendHostMessage('focusTrap', { trapped: true })\n return () => sendHostMessage('focusTrap', { trapped: false })\n }, [isFilterOpen, sendHostMessage])\n\n // Announce only once the popover is closed. `handleFilter` cannot announce\n // directly: at that point ModalManager still has aria-hidden on the rest of\n // the document, so the message would be written into a hidden region.\n //\n // Modal lifts aria-hidden in an effect when `open` flips false\n // (`closeAfterTransition` defaults false, so `useModal`'s open/close effect\n // calls handleClose immediately rather than waiting for the exit). Modal is a\n // descendant of this component and React flushes child effects first (and every\n // destroy before any create, so FocusTrap's restore lands first too), meaning\n // by the time this effect runs focus is back on the trigger and the document is\n // exposed again.\n //\n // Only ever consumes a message from the session that is closing. An apply\n // interrupted by a cancel or a reopen is stopped at the generation guard in\n // handleFilter and never writes one, in either order.\n React.useEffect(() => {\n if (isFilterOpen || !pendingAppliedRef.current) return\n\n announceApplied(pendingAppliedRef.current)\n pendingAppliedRef.current = null\n }, [isFilterOpen, announceApplied])\n\n return (\n <Box sx={{ ...sx }}>\n {appliedAriaLive}\n {isDesktop ? (\n <Button\n aria-controls={isFilterOpen ? 'filter_accounts' : undefined}\n aria-expanded={isFilterOpen}\n aria-haspopup=\"dialog\"\n aria-label={copy.title}\n disabled={filterDisabled}\n onClick={handleOpen}\n startIcon={<FilterAlt size={24} />}\n sx={{ p: 8, whiteSpace: 'nowrap', minWidth: 'max-content' }}\n variant={variant}\n >\n {commonCopy.filter_button}\n </Button>\n ) : (\n <Tooltip id=\"filter-accounts\" placement=\"bottom\" title={copy.title}>\n <IconButton\n aria-controls={isFilterOpen ? 'filter_accounts' : undefined}\n aria-expanded={isFilterOpen}\n aria-haspopup=\"dialog\"\n aria-label={copy.title}\n color=\"primary\"\n disabled={filterDisabled}\n onClick={handleOpen}\n sx={{ p: 8 }}\n >\n <FilterAlt size={24} />\n </IconButton>\n </Tooltip>\n )}\n\n <Popover\n anchorEl={filterButtonEl}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}\n onClose={handleCancel}\n open={isFilterOpen}\n // aria-modal is what Chrome surfaces to the Android accessibility API as a\n // modal subtree. Without it TalkBack walks past the last control and out of\n // the webview into the host app's native chrome -- aria-hidden (applied to\n // background siblings by MUI's Modal) only bounds the DOM, not the webview.\n slotProps={{\n paper: {\n 'aria-label': copy.title,\n 'aria-modal': true,\n onKeyDown: handleKeyDown,\n role: 'dialog',\n },\n }}\n transformOrigin={{ vertical: 'top', horizontal: 'left' }}\n >\n <Stack>\n {selectionAriaLive}\n <GlobalAccountFilterList\n allowedAccountTypes={allowedAccountTypes}\n announce={announceSelection}\n />\n <Divider />\n <Stack\n direction=\"row\"\n justifyContent=\"space-between\"\n spacing={16}\n sx={{ bgcolor: 'background.paper', bottom: 0, p: 16, position: 'sticky' }}\n >\n <Button fullWidth={true} onClick={handleCancel} variant=\"text\">\n {commonCopy.cancel_button}\n </Button>\n <Button color=\"primary\" fullWidth={true} onClick={handleFilter} variant=\"contained\">\n {commonCopy.filter_button}\n </Button>\n </Stack>\n </Stack>\n </Popover>\n </Box>\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;;AA8BA,IAAa,KAAsB,EAAA,CAChC,EACC,qBAAA,GACA,WAAA,GACA,sBAAA,GACA,IAAA,IAAK,CAAC,GACN,SAAA,IAAU,OAAA,MACoB;AAC9B,QAAM,EAAE,QAAQ,EAAA,IAAe,EAAmB,GAC5C,EAAE,kBAAA,GAAkB,uBAAA,EAAA,IAA0B,EAAiB,GAE/D,EAAE,kBAAA,GAAkB,qBAAA,EAAA,IAAwB,EAAgB,GAC5D,EAAE,iBAAA,EAAA,IAAoB,EAAe,GAOrC,EAAE,UAAU,GAAmB,UAAU,EAAA,IAAsB,EAAY,GAC3E,EAAE,UAAU,GAAiB,UAAU,EAAA,IAAoB,EAAY,GA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BAAA,EAAC,GAAD,CAAU,CAAA;AAAA,UACV,gBAAA,EAAC,GAAD;AAAA,YACE,WAAU;AAAA,YACV,gBAAe;AAAA,YACf,SAAS;AAAA,YACT,IAAI;AAAA,cAAE,SAAS;AAAA,cAAoB,QAAQ;AAAA,cAAG,GAAG;AAAA,cAAI,UAAU;AAAA,YAAS;AAAA,YAJ1E,UAAA,CAME,gBAAA,EAAC,GAAD;AAAA,cAAQ,WAAW;AAAA,cAAM,SAAS;AAAA,cAAc,SAAQ;AAAA,cACrD,UAAA,EAAW;AAAA,YACN,CAAA,GACR,gBAAA,EAAC,GAAD;AAAA,cAAQ,OAAM;AAAA,cAAU,WAAW;AAAA,cAAM,SAAS;AAAA,cAAc,SAAQ;AAAA,cACrE,UAAA,EAAW;AAAA,YACN,CAAA,CACH;AAAA;QACF,EAAA,CAAA;AAAA,MACA,CAAA;AAAA,IACN;AAAA;AAET,CACF"}
1
+ {"version":3,"file":"GlobalAccountFilter.es.js","names":[],"sources":["../../../src/common/components/GlobalAccountFilter.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 Divider from '@mui/material/Divider'\nimport IconButton from '@mui/material/IconButton'\nimport Popover from '@mui/material/Popover'\nimport Stack from '@mui/material/Stack'\nimport Tooltip from '@mui/material/Tooltip'\nimport { SxProps } from '@mui/material/styles'\n\nimport { FilterAlt } from '@mxenabled/mx-icons'\n\nimport { useAccountStore, useGlobalCopyStore, useGlobalUiStore, useHostMessage } from '../context'\nimport { AccountType } from '../../core'\nimport { buildDynamicCopy } from '../../core/utils/Localization'\nimport { useAriaLive } from '../hooks/useAriaLive'\n\nimport { GlobalAccountFilterList } from './globalaccountfilter/GlobalAccountFilterList'\nimport { buildSelectionFilter, getSelectionCounts } from './globalaccountfilter/selection'\n\nexport interface GlobalAccountFilterProps {\n allowedAccountTypes?: AccountType[] | undefined\n isDesktop?: boolean\n onAccountFilterClick?: () => void\n sx?: SxProps\n variant?: 'outlined' | 'text'\n}\n\nexport const GlobalAccountFilter = observer(\n ({\n allowedAccountTypes,\n isDesktop,\n onAccountFilterClick,\n sx = {},\n variant = 'text',\n }: GlobalAccountFilterProps) => {\n const { common: commonCopy } = useGlobalCopyStore()\n const globalUiStore = useGlobalUiStore()\n const { accountFilterMap, resetAccountFilterMap, setIsApplyingAccountFilter } = globalUiStore\n const isApplying = globalUiStore.isApplyingAccountFilter\n\n const { detailedAccounts, updateAccountFilter } = useAccountStore()\n const { sendHostMessage } = useHostMessage()\n\n // Two regions, because MUI's ModalManager sets aria-hidden on every body\n // child outside the popover while it is open (and aria-modal tells AT to\n // ignore them anyway). Selection changes happen while the dialog is open, so\n // that region must live INSIDE it; the applied message is spoken after the\n // dialog is gone, so its region must live outside to survive the unmount.\n const { announce: announceSelection, ariaLive: selectionAriaLive } = useAriaLive()\n const { announce: announceApplied, ariaLive: appliedAriaLive } = useAriaLive()\n\n const [filterButtonEl, setFilterButtonEl] = React.useState<HTMLButtonElement | null>(null)\n // Set once the update resolves, consumed by the close effect below. It cannot\n // be announced from handleFilter directly: aria-hidden is still on the rest of\n // the document at that point, so the message would go into a hidden region.\n const pendingAppliedRef = React.useRef<string | null>(null)\n // Identifies one open..close cycle of the dialog. `handleFilter` captures it\n // before awaiting and bails if it changed, so a slow request cannot reach\n // back into a session the user has already left.\n const generationRef = React.useRef(0)\n\n const copy = commonCopy.account_filter\n\n const handleOpen = (event: React.MouseEvent<HTMLButtonElement>) => {\n generationRef.current += 1\n resetAccountFilterMap()\n setFilterButtonEl(event.currentTarget)\n onAccountFilterClick?.()\n }\n\n const handleCancel = () => {\n // Ends the session too, so a request abandoned here cannot write its message\n // even if it resolves before the user reopens.\n generationRef.current += 1\n setFilterButtonEl(null)\n }\n\n const handleFilter = async () => {\n // A second apply while the first is saving would send requests computed from\n // accounts that are about to change, so the earlier save could win. Read from\n // the store, not the render, so it holds even before React re-renders.\n if (globalUiStore.isApplyingAccountFilter) return\n\n const { selected, total } = getSelectionCounts(\n buildSelectionFilter(accountFilterMap, detailedAccounts, allowedAccountTypes),\n )\n\n const generation = generationRef.current\n\n setIsApplyingAccountFilter(true)\n try {\n await updateAccountFilter(accountFilterMap)\n } finally {\n setIsApplyingAccountFilter(false)\n }\n\n // A filter opened during the save, here or in another widget, was filled\n // before the save landed and would show the old selection. Its controls were\n // disabled, so no edit is lost.\n resetAccountFilterMap()\n\n // The dialog moved on while this was in flight -- the user cancelled, or\n // cancelled and reopened. Announcing now would speak over a session that did\n // not ask for it, and closing would shut a dialog the user just opened.\n // NOTE: the update itself already committed; cancelling does not roll it\n // back. Only the announcement and the close are suppressed here.\n if (generation !== generationRef.current) return\n\n pendingAppliedRef.current = buildDynamicCopy(\n copy.applied_announcement,\n String(selected),\n String(total),\n ) as string\n setFilterButtonEl(null)\n }\n\n // Bound to the Paper, not an inner element: FocusTrap focuses the Paper on\n // open (getFocusTarget finds no `data-mui-focusable` marker and falls back to\n // the root), and keydown there bubbles UP -- a handler on a descendant would\n // never see the first keypress.\n //\n // Only fires when the Paper ITSELF holds focus. Anything focused inside it\n // owns its own Enter behaviour: buttons activate, and a checkbox must not\n // submit -- native checkboxes ignore Enter, so without this the keypress\n // bubbled up here and closed the dialog out from under someone who was just\n // moving through the list. A whitelist rather than a `closest()` exclusion\n // list, so a control added later cannot silently inherit submit-on-Enter.\n //\n // Narrower than it looks: the Paper is tabIndex=\"-1\", so once focus moves off\n // it there is no way to Tab back. Enter-applies is a one-shot affordance,\n // available only before the first Tab. The scroll region (tabIndex={0}) is the\n // first stop after it and deliberately does nothing on Enter.\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.key !== 'Enter') return\n if (event.target !== event.currentTarget) return\n\n handleFilter()\n }\n\n const isFilterOpen = Boolean(filterButtonEl)\n const filterDisabled = detailedAccounts.length === 0\n\n React.useEffect(() => {\n if (!isFilterOpen) return\n\n sendHostMessage('focusTrap', { trapped: true })\n return () => sendHostMessage('focusTrap', { trapped: false })\n }, [isFilterOpen, sendHostMessage])\n\n // Announce only once the popover is closed. `handleFilter` cannot announce\n // directly: at that point ModalManager still has aria-hidden on the rest of\n // the document, so the message would be written into a hidden region.\n //\n // Modal lifts aria-hidden in an effect when `open` flips false\n // (`closeAfterTransition` defaults false, so `useModal`'s open/close effect\n // calls handleClose immediately rather than waiting for the exit). Modal is a\n // descendant of this component and React flushes child effects first (and every\n // destroy before any create, so FocusTrap's restore lands first too), meaning\n // by the time this effect runs focus is back on the trigger and the document is\n // exposed again.\n //\n // Only ever consumes a message from the session that is closing. An apply\n // interrupted by a cancel or a reopen is stopped at the generation guard in\n // handleFilter and never writes one, in either order.\n React.useEffect(() => {\n if (isFilterOpen || !pendingAppliedRef.current) return\n\n announceApplied(pendingAppliedRef.current)\n pendingAppliedRef.current = null\n }, [isFilterOpen, announceApplied])\n\n return (\n <Box sx={{ ...sx }}>\n {appliedAriaLive}\n {isDesktop ? (\n <Button\n aria-controls={isFilterOpen ? 'filter_accounts' : undefined}\n aria-expanded={isFilterOpen}\n aria-haspopup=\"dialog\"\n aria-label={copy.title}\n disabled={filterDisabled}\n onClick={handleOpen}\n startIcon={<FilterAlt size={24} />}\n sx={{ p: 8, whiteSpace: 'nowrap', minWidth: 'max-content' }}\n variant={variant}\n >\n {commonCopy.filter_button}\n </Button>\n ) : (\n <Tooltip id=\"filter-accounts\" placement=\"bottom\" title={copy.title}>\n <IconButton\n aria-controls={isFilterOpen ? 'filter_accounts' : undefined}\n aria-expanded={isFilterOpen}\n aria-haspopup=\"dialog\"\n aria-label={copy.title}\n color=\"primary\"\n disabled={filterDisabled}\n onClick={handleOpen}\n sx={{ p: 8 }}\n >\n <FilterAlt size={24} />\n </IconButton>\n </Tooltip>\n )}\n\n <Popover\n anchorEl={filterButtonEl}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}\n onClose={handleCancel}\n open={isFilterOpen}\n // aria-modal is what Chrome surfaces to the Android accessibility API as a\n // modal subtree. Without it TalkBack walks past the last control and out of\n // the webview into the host app's native chrome -- aria-hidden (applied to\n // background siblings by MUI's Modal) only bounds the DOM, not the webview.\n slotProps={{\n paper: {\n 'aria-busy': isApplying,\n 'aria-label': copy.title,\n 'aria-modal': true,\n onKeyDown: handleKeyDown,\n role: 'dialog',\n },\n }}\n transformOrigin={{ vertical: 'top', horizontal: 'left' }}\n >\n <Stack>\n {selectionAriaLive}\n <GlobalAccountFilterList\n allowedAccountTypes={allowedAccountTypes}\n announce={announceSelection}\n disabled={isApplying}\n />\n <Divider />\n <Stack\n direction=\"row\"\n justifyContent=\"space-between\"\n spacing={16}\n sx={{ bgcolor: 'background.paper', bottom: 0, p: 16, position: 'sticky' }}\n >\n <Button fullWidth={true} onClick={handleCancel} variant=\"text\">\n {commonCopy.cancel_button}\n </Button>\n <Button\n color=\"primary\"\n fullWidth={true}\n loading={isApplying}\n onClick={handleFilter}\n variant=\"contained\"\n >\n {commonCopy.filter_button}\n </Button>\n </Stack>\n </Stack>\n </Popover>\n </Box>\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;;AA8BA,IAAa,KAAsB,EAAA,CAChC,EACC,qBAAA,GACA,WAAA,GACA,sBAAA,GACA,IAAA,IAAK,CAAC,GACN,SAAA,IAAU,OAAA,MACoB;AAC9B,QAAM,EAAE,QAAQ,EAAA,IAAe,EAAmB,GAC5C,IAAgB,EAAiB,GACjC,EAAE,kBAAA,GAAkB,uBAAA,GAAuB,4BAAA,EAAA,IAA+B,GAC1E,IAAa,EAAc,yBAE3B,EAAE,kBAAA,GAAkB,qBAAA,EAAA,IAAwB,EAAgB,GAC5D,EAAE,iBAAA,EAAA,IAAoB,EAAe,GAOrC,EAAE,UAAU,GAAmB,UAAU,EAAA,IAAsB,EAAY,GAC3E,EAAE,UAAU,GAAiB,UAAU,EAAA,IAAoB,EAAY,GAEvE,CAAC,GAAgB,CAAA,IAAqB,EAAM,SAAmC,IAAI,GAInF,IAAoB,EAAM,OAAsB,IAAI,GAIpD,IAAgB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UAAU;AAAA,YACV,UAAU;AAAA,UACX,CAAA;AAAA,UACD,gBAAA,EAAC,GAAD,CAAU,CAAA;AAAA,UACV,gBAAA,EAAC,GAAD;AAAA,YACE,WAAU;AAAA,YACV,gBAAe;AAAA,YACf,SAAS;AAAA,YACT,IAAI;AAAA,cAAE,SAAS;AAAA,cAAoB,QAAQ;AAAA,cAAG,GAAG;AAAA,cAAI,UAAU;AAAA,YAAS;AAAA,YAJ1E,UAAA,CAME,gBAAA,EAAC,GAAD;AAAA,cAAQ,WAAW;AAAA,cAAM,SAAS;AAAA,cAAc,SAAQ;AAAA,cACrD,UAAA,EAAW;AAAA,YACN,CAAA,GACR,gBAAA,EAAC,GAAD;AAAA,cACE,OAAM;AAAA,cACN,WAAW;AAAA,cACX,SAAS;AAAA,cACT,SAAS;AAAA,cACT,SAAQ;AAAA,cAEP,UAAA,EAAW;AAAA,YACN,CAAA,CACH;AAAA;QACF,EAAA,CAAA;AAAA,MACA,CAAA;AAAA,IACN;AAAA;AAET,CACF"}
@@ -2,7 +2,8 @@ import { AccountType } from '../../../core';
2
2
  export interface GlobalAccountFilterListProps {
3
3
  allowedAccountTypes: AccountType[] | undefined;
4
4
  announce?: (message: string) => void;
5
+ disabled?: boolean;
5
6
  }
6
- export declare const GlobalAccountFilterList: (({ allowedAccountTypes, announce }: GlobalAccountFilterListProps) => import("react/jsx-runtime").JSX.Element) & {
7
+ export declare const GlobalAccountFilterList: (({ allowedAccountTypes, announce, disabled }: GlobalAccountFilterListProps) => import("react/jsx-runtime").JSX.Element) & {
7
8
  displayName: string;
8
9
  };
@@ -1,33 +1,33 @@
1
- import { buildDynamicCopy as L } from "../../../core/utils/Localization.es.js";
2
- import { useAccountStore as W, useGlobalCopyStore as B, useGlobalUiStore as H } from "../../context/hooks.es.js";
3
- import { buildSelectionFilter as S, getSelectionCounts as I } from "./selection.es.js";
4
- import { TriStateCheckbox as x } from "./TriStateCheckbox.es.js";
1
+ import { buildDynamicCopy as W } from "../../../core/utils/Localization.es.js";
2
+ import { useAccountStore as B, useGlobalCopyStore as D, useGlobalUiStore as H } from "../../context/hooks.es.js";
3
+ import { buildSelectionFilter as x, getSelectionCounts as I } from "./selection.es.js";
4
+ import { TriStateCheckbox as C } from "./TriStateCheckbox.es.js";
5
5
  import { observer as M } from "mobx-react-lite";
6
6
  import j from "@mui/material/Stack";
7
- import { jsx as t, jsxs as C } from "react/jsx-runtime";
8
- import D from "@mui/material/Box";
9
- import N from "@mui/material/Divider";
10
- import U from "@mui/material/Checkbox";
7
+ import { jsx as t, jsxs as k } from "react/jsx-runtime";
8
+ import N from "@mui/material/Box";
9
+ import U from "@mui/material/Divider";
10
+ import Y from "@mui/material/Checkbox";
11
11
  import g from "@mui/material/FormControlLabel";
12
- import k from "@mui/material/List";
12
+ import _ from "@mui/material/List";
13
13
  import a from "@mui/material/ListItem";
14
- var T = M(({ allowedAccountTypes: n, announce: _ }) => {
15
- const { accountFilterMap: i, updateAccountFilterMap: d } = H(), { accounts: h, common: A } = B(), { account_filter: p } = A, { accountsByTypeMap: m, detailedAccounts: b } = W(), s = S(i, b, n), u = s.size > 0 && Array.from(s.values()).every((e) => e), F = Array.from(s.values()).some((e) => e), f = () => {
16
- const { selected: e, total: o } = I(S(i, b, n));
17
- _?.(L(p.selection_announcement, String(e), String(o)));
18
- }, G = () => {
14
+ var ee = M(({ allowedAccountTypes: l, announce: A, disabled: h = !1 }) => {
15
+ const { accountFilterMap: i, updateAccountFilterMap: d } = H(), { accounts: p, common: F } = D(), { account_filter: b } = F, { accountsByTypeMap: m, detailedAccounts: f } = B(), s = x(i, f, l), u = s.size > 0 && Array.from(s.values()).every((e) => e), G = Array.from(s.values()).some((e) => e), y = () => {
16
+ const { selected: e, total: o } = I(x(i, f, l));
17
+ A?.(W(b.selection_announcement, String(e), String(o)));
18
+ }, P = () => {
19
19
  for (const e of s.keys()) d(e, !u);
20
- f();
21
- }, P = (e) => {
22
- if (n && !n.includes(e)) return;
20
+ y();
21
+ }, z = (e) => {
22
+ if (l && !l.includes(e)) return;
23
23
  const o = m.get(e);
24
24
  if (!o) return;
25
- const c = o.every((l) => i.get(l.guid));
26
- for (const l of o) d(l.guid, !c);
27
- f();
25
+ const c = o.every((n) => i.get(n.guid));
26
+ for (const n of o) d(n.guid, !c);
27
+ y();
28
28
  };
29
- return /* @__PURE__ */ t(D, {
30
- "aria-label": h.title,
29
+ return /* @__PURE__ */ t(N, {
30
+ "aria-label": p.title,
31
31
  id: "filter_accounts",
32
32
  role: "region",
33
33
  sx: {
@@ -36,20 +36,21 @@ var T = M(({ allowedAccountTypes: n, announce: _ }) => {
36
36
  minWidth: 280
37
37
  },
38
38
  tabIndex: 0,
39
- children: /* @__PURE__ */ C(k, {
39
+ children: /* @__PURE__ */ k(_, {
40
40
  dense: !0,
41
41
  children: [/* @__PURE__ */ t(a, {
42
42
  disableGutters: !0,
43
43
  disablePadding: !0,
44
44
  sx: { py: 16 },
45
45
  children: /* @__PURE__ */ t(g, {
46
- control: /* @__PURE__ */ t(x, {
46
+ control: /* @__PURE__ */ t(C, {
47
47
  checked: u,
48
- indeterminate: !u && F,
49
- onChange: G,
48
+ disabled: h,
49
+ indeterminate: !u && G,
50
+ onChange: P,
50
51
  size: "small"
51
52
  }),
52
- label: p.select_all_accounts,
53
+ label: b.select_all_accounts,
53
54
  slotProps: { typography: {
54
55
  variant: "body1",
55
56
  fontWeight: "normal"
@@ -61,33 +62,33 @@ var T = M(({ allowedAccountTypes: n, announce: _ }) => {
61
62
  }
62
63
  })
63
64
  }), Array.from(m.keys()).map((e) => {
64
- const o = m.get(e), c = n ? !n.includes(e) : !1, l = h.account_type_accounts[e], y = `account-filter-group-${e}`, v = !!o?.length && o.every((r) => i.get(r.guid)), z = !!o?.some((r) => i.get(r.guid));
65
+ const o = m.get(e), c = h || (l ? !l.includes(e) : !1), n = p.account_type_accounts[e], v = `account-filter-group-${e}`, S = !!o?.length && o.every((r) => i.get(r.guid)), L = !!o?.some((r) => i.get(r.guid));
65
66
  return /* @__PURE__ */ t(a, {
66
67
  disableGutters: !0,
67
68
  disablePadding: !0,
68
- children: /* @__PURE__ */ C(j, {
69
- "aria-labelledby": y,
69
+ children: /* @__PURE__ */ k(j, {
70
+ "aria-labelledby": v,
70
71
  role: "group",
71
72
  sx: {
72
73
  pb: 8,
73
74
  width: "100%"
74
75
  },
75
- children: [/* @__PURE__ */ t(N, {}), /* @__PURE__ */ t(k, {
76
+ children: [/* @__PURE__ */ t(U, {}), /* @__PURE__ */ t(_, {
76
77
  dense: !0,
77
78
  subheader: /* @__PURE__ */ t(a, {
78
79
  disableGutters: !0,
79
80
  disablePadding: !0,
80
81
  children: /* @__PURE__ */ t(g, {
81
- control: /* @__PURE__ */ t(x, {
82
- checked: v,
82
+ control: /* @__PURE__ */ t(C, {
83
+ checked: S,
83
84
  disabled: c,
84
- indeterminate: !v && z,
85
- onChange: () => P(e),
85
+ indeterminate: !S && L,
86
+ onChange: () => z(e),
86
87
  size: "small"
87
88
  }),
88
- label: l,
89
+ label: n,
89
90
  slotProps: { typography: {
90
- id: y,
91
+ id: v,
91
92
  variant: "body1",
92
93
  fontWeight: "bold"
93
94
  } },
@@ -100,7 +101,7 @@ var T = M(({ allowedAccountTypes: n, announce: _ }) => {
100
101
  })
101
102
  }),
102
103
  children: o?.map((r) => /* @__PURE__ */ t(a, { children: /* @__PURE__ */ t(g, {
103
- control: /* @__PURE__ */ t(U, {
104
+ control: /* @__PURE__ */ t(Y, {
104
105
  checked: !!i.get(r.guid),
105
106
  disabled: c,
106
107
  onChange: () => d(r.guid, !i.get(r.guid)),
@@ -126,7 +127,7 @@ var T = M(({ allowedAccountTypes: n, announce: _ }) => {
126
127
  });
127
128
  });
128
129
  export {
129
- T as GlobalAccountFilterList
130
+ ee as GlobalAccountFilterList
130
131
  };
131
132
 
132
133
  //# sourceMappingURL=GlobalAccountFilterList.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GlobalAccountFilterList.es.js","names":[],"sources":["../../../../src/common/components/globalaccountfilter/GlobalAccountFilterList.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport CheckBox from '@mui/material/Checkbox'\nimport Divider from '@mui/material/Divider'\nimport FormControlLabel from '@mui/material/FormControlLabel'\nimport List from '@mui/material/List'\nimport ListItem from '@mui/material/ListItem'\nimport Stack from '@mui/material/Stack'\n\nimport { useAccountStore, useGlobalCopyStore, useGlobalUiStore } from '../../context'\nimport { AccountType } from '../../../core'\nimport { buildDynamicCopy } from '../../../core/utils/Localization'\n\nimport { buildSelectionFilter, getSelectionCounts } from './selection'\nimport { TriStateCheckbox } from './TriStateCheckbox'\n\nexport interface GlobalAccountFilterListProps {\n allowedAccountTypes: AccountType[] | undefined\n announce?: (message: string) => void\n}\n\nexport const GlobalAccountFilterList = observer(\n ({ allowedAccountTypes, announce }: GlobalAccountFilterListProps) => {\n const { accountFilterMap, updateAccountFilterMap } = useGlobalUiStore()\n const { accounts: accountsCopy, common: commonCopy } = useGlobalCopyStore()\n const { account_filter: copy } = commonCopy\n\n const { accountsByTypeMap, detailedAccounts } = useAccountStore()\n\n // Only the accounts this widget is allowed to show drive the select-all\n // state and the announced counts.\n const selectionFilter = buildSelectionFilter(\n accountFilterMap,\n detailedAccounts,\n allowedAccountTypes,\n )\n\n // `every` is vacuously true on an empty set, which would render Select All\n // checked when no account is selectable. Mirrors the per-group guard below.\n const allSelected =\n selectionFilter.size > 0 &&\n Array.from(selectionFilter.values()).every((isSelected) => isSelected)\n const someSelected = Array.from(selectionFilter.values()).some((isSelected) => isSelected)\n\n // Bulk changes move many checkboxes at once, so the resulting count is\n // announced rather than left to the individual checkbox states. This is\n // also what conveys the tri-state to screen readers that handle\n // aria-checked=\"mixed\" poorly.\n const announceSelection = () => {\n const { selected, total } = getSelectionCounts(\n buildSelectionFilter(accountFilterMap, detailedAccounts, allowedAccountTypes),\n )\n\n announce?.(\n buildDynamicCopy(copy.selection_announcement, String(selected), String(total)) as string,\n )\n }\n\n const handleSelectAllClick = () => {\n for (const guid of selectionFilter.keys()) {\n updateAccountFilterMap(guid, !allSelected)\n }\n\n announceSelection()\n }\n\n const handleSelectAccountTypeClick = (accountType: AccountType) => {\n if (allowedAccountTypes && !allowedAccountTypes.includes(accountType)) return\n\n const accounts = accountsByTypeMap.get(accountType)\n if (!accounts) return\n\n const allAccountsSelected = accounts.every((account) => accountFilterMap.get(account.guid))\n for (const account of accounts) {\n updateAccountFilterMap(account.guid, !allAccountsSelected)\n }\n\n announceSelection()\n }\n\n return (\n <Box\n // Named for the content it holds, not the dialog it sits in -- the paper\n // already announces \"Filter accounts\", so reusing that here made screen\n // readers say the same name twice on entry.\n aria-label={accountsCopy.title}\n id=\"filter_accounts\"\n role=\"region\"\n sx={{ overflowY: 'scroll', maxHeight: 350, minWidth: 280 }}\n tabIndex={0}\n >\n <List dense={true}>\n {/* Select All Checkbox */}\n <ListItem disableGutters={true} disablePadding={true} sx={{ py: 16 }}>\n <FormControlLabel\n control={\n <TriStateCheckbox\n checked={allSelected}\n indeterminate={!allSelected && someSelected}\n onChange={handleSelectAllClick}\n size=\"small\"\n />\n }\n label={copy.select_all_accounts}\n slotProps={{ typography: { variant: 'body1', fontWeight: 'normal' } }}\n sx={{ width: '100%', m: 0, '&:hover': { bgcolor: 'action.hover' } }}\n />\n </ListItem>\n\n {Array.from(accountsByTypeMap.keys()).map((accountType) => {\n const accounts = accountsByTypeMap.get(accountType)\n const disabled = allowedAccountTypes\n ? !allowedAccountTypes.includes(accountType)\n : false\n const typeName = accountsCopy.account_type_accounts[accountType]\n const headingId = `account-filter-group-${accountType}`\n\n const typeAllSelected =\n !!accounts?.length && accounts.every((account) => accountFilterMap.get(account.guid))\n const typeSomeSelected = !!accounts?.some((account) =>\n accountFilterMap.get(account.guid),\n )\n\n return (\n // Account Type Group\n <ListItem disableGutters={true} disablePadding={true} key={accountType}>\n <Stack aria-labelledby={headingId} role=\"group\" sx={{ pb: 8, width: '100%' }}>\n <Divider />\n <List\n dense={true}\n subheader={\n // Account Type Checkbox — toggles every account of this type\n <ListItem disableGutters={true} disablePadding={true}>\n <FormControlLabel\n control={\n <TriStateCheckbox\n checked={typeAllSelected}\n disabled={disabled}\n indeterminate={!typeAllSelected && typeSomeSelected}\n onChange={() => handleSelectAccountTypeClick(accountType)}\n size=\"small\"\n />\n }\n label={typeName}\n slotProps={{\n typography: { id: headingId, variant: 'body1', fontWeight: 'bold' },\n }}\n sx={{\n width: '100%',\n m: 0,\n minHeight: 40,\n '&:hover': { bgcolor: 'action.hover' },\n }}\n />\n </ListItem>\n }\n >\n {accounts?.map((account) => (\n // Account Checkbox\n <ListItem key={account.guid}>\n <FormControlLabel\n control={\n <CheckBox\n checked={!!accountFilterMap.get(account.guid)}\n disabled={disabled}\n onChange={() =>\n updateAccountFilterMap(\n account.guid,\n !accountFilterMap.get(account.guid),\n )\n }\n size=\"small\"\n />\n }\n label={account.displayName}\n slotProps={{ typography: { variant: 'body1', fontWeight: 'normal' } }}\n sx={{\n width: '100%',\n m: 0,\n minHeight: 40,\n '&:hover': { bgcolor: 'action.hover' },\n }}\n />\n </ListItem>\n ))}\n </List>\n </Stack>\n </ListItem>\n )\n })}\n </List>\n </Box>\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;AAsBA,IAAa,IAA0B,EAAA,CACpC,EAAE,qBAAA,GAAqB,UAAA,EAAA,MAA6C;AACnE,QAAM,EAAE,kBAAA,GAAkB,wBAAA,EAAA,IAA2B,EAAiB,GAChE,EAAE,UAAU,GAAc,QAAQ,EAAA,IAAe,EAAmB,GACpE,EAAE,gBAAgB,EAAA,IAAS,GAE3B,EAAE,mBAAA,GAAmB,kBAAA,EAAA,IAAqB,EAAgB,GAI1D,IAAkB,EACtB,GACA,GACA,CACF,GAIM,IACJ,EAAgB,OAAO,KACvB,MAAM,KAAK,EAAgB,OAAO,CAAC,EAAE,MAAA,CAAO,MAAe,CAAU,GACjE,IAAe,MAAM,KAAK,EAAgB,OAAO,CAAC,EAAE,KAAA,CAA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,WAAW,EACT,YAAY;AAAA,oBAAE,IAAI;AAAA,oBAAW,SAAS;AAAA,oBAAS,YAAY;AAAA,kBAAO,EACpE;AAAA,kBACA,IAAI;AAAA,oBACF,OAAO;AAAA,oBACP,GAAG;AAAA,oBACH,WAAW;AAAA,oBACX,WAAW,EAAE,SAAS,eAAe;AAAA,kBACvC;AAAA,gBACD,CAAA;AAAA,cACO,CAAA;AAAA,cAGX,UAAA,GAAU,IAAA,CAAK,MAEd,gBAAA,EAAC,GAAD,EAAA,UACE,gBAAA,EAAC,GAAD;AAAA,gBACE,SACE,gBAAA,EAAC,GAAD;AAAA,kBACE,SAAS,CAAC,CAAC,EAAiB,IAAI,EAAQ,IAAI;AAAA,kBAClC,UAAA;AAAA,kBACV,UAAA,MACE,EACE,EAAQ,MACR,CAAC,EAAiB,IAAI,EAAQ,IAAI,CACpC;AAAA,kBAEF,MAAK;AAAA,gBACN,CAAA;AAAA,gBAEH,OAAO,EAAQ;AAAA,gBACf,WAAW,EAAE,YAAY;AAAA,kBAAE,SAAS;AAAA,kBAAS,YAAY;AAAA,gBAAS,EAAE;AAAA,gBACpE,IAAI;AAAA,kBACF,OAAO;AAAA,kBACP,GAAG;AAAA,kBACH,WAAW;AAAA,kBACX,WAAW,EAAE,SAAS,eAAe;AAAA,gBACvC;AAAA,cACD,CAAA,EACO,GAxBK,EAAQ,IAwBb,CACX;AAAA,YACG,CAAA,CACD;AAAA;QACC,GA9DiD,CA8DjD;AAAA,MAEd,CAAC,CACG;AAAA;EACH,CAAA;AAET,CACF"}
1
+ {"version":3,"file":"GlobalAccountFilterList.es.js","names":[],"sources":["../../../../src/common/components/globalaccountfilter/GlobalAccountFilterList.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport CheckBox from '@mui/material/Checkbox'\nimport Divider from '@mui/material/Divider'\nimport FormControlLabel from '@mui/material/FormControlLabel'\nimport List from '@mui/material/List'\nimport ListItem from '@mui/material/ListItem'\nimport Stack from '@mui/material/Stack'\n\nimport { useAccountStore, useGlobalCopyStore, useGlobalUiStore } from '../../context'\nimport { AccountType } from '../../../core'\nimport { buildDynamicCopy } from '../../../core/utils/Localization'\n\nimport { buildSelectionFilter, getSelectionCounts } from './selection'\nimport { TriStateCheckbox } from './TriStateCheckbox'\n\nexport interface GlobalAccountFilterListProps {\n allowedAccountTypes: AccountType[] | undefined\n announce?: (message: string) => void\n disabled?: boolean\n}\n\nexport const GlobalAccountFilterList = observer(\n ({ allowedAccountTypes, announce, disabled = false }: GlobalAccountFilterListProps) => {\n const { accountFilterMap, updateAccountFilterMap } = useGlobalUiStore()\n const { accounts: accountsCopy, common: commonCopy } = useGlobalCopyStore()\n const { account_filter: copy } = commonCopy\n\n const { accountsByTypeMap, detailedAccounts } = useAccountStore()\n\n // Only the accounts this widget is allowed to show drive the select-all\n // state and the announced counts.\n const selectionFilter = buildSelectionFilter(\n accountFilterMap,\n detailedAccounts,\n allowedAccountTypes,\n )\n\n // `every` is vacuously true on an empty set, which would render Select All\n // checked when no account is selectable. Mirrors the per-group guard below.\n const allSelected =\n selectionFilter.size > 0 &&\n Array.from(selectionFilter.values()).every((isSelected) => isSelected)\n const someSelected = Array.from(selectionFilter.values()).some((isSelected) => isSelected)\n\n // Bulk changes move many checkboxes at once, so the resulting count is\n // announced rather than left to the individual checkbox states. This is\n // also what conveys the tri-state to screen readers that handle\n // aria-checked=\"mixed\" poorly.\n const announceSelection = () => {\n const { selected, total } = getSelectionCounts(\n buildSelectionFilter(accountFilterMap, detailedAccounts, allowedAccountTypes),\n )\n\n announce?.(\n buildDynamicCopy(copy.selection_announcement, String(selected), String(total)) as string,\n )\n }\n\n const handleSelectAllClick = () => {\n for (const guid of selectionFilter.keys()) {\n updateAccountFilterMap(guid, !allSelected)\n }\n\n announceSelection()\n }\n\n const handleSelectAccountTypeClick = (accountType: AccountType) => {\n if (allowedAccountTypes && !allowedAccountTypes.includes(accountType)) return\n\n const accounts = accountsByTypeMap.get(accountType)\n if (!accounts) return\n\n const allAccountsSelected = accounts.every((account) => accountFilterMap.get(account.guid))\n for (const account of accounts) {\n updateAccountFilterMap(account.guid, !allAccountsSelected)\n }\n\n announceSelection()\n }\n\n return (\n <Box\n // Named for the content it holds, not the dialog it sits in -- the paper\n // already announces \"Filter accounts\", so reusing that here made screen\n // readers say the same name twice on entry.\n aria-label={accountsCopy.title}\n id=\"filter_accounts\"\n role=\"region\"\n sx={{ overflowY: 'scroll', maxHeight: 350, minWidth: 280 }}\n tabIndex={0}\n >\n <List dense={true}>\n {/* Select All Checkbox */}\n <ListItem disableGutters={true} disablePadding={true} sx={{ py: 16 }}>\n <FormControlLabel\n control={\n <TriStateCheckbox\n checked={allSelected}\n disabled={disabled}\n indeterminate={!allSelected && someSelected}\n onChange={handleSelectAllClick}\n size=\"small\"\n />\n }\n label={copy.select_all_accounts}\n slotProps={{ typography: { variant: 'body1', fontWeight: 'normal' } }}\n sx={{ width: '100%', m: 0, '&:hover': { bgcolor: 'action.hover' } }}\n />\n </ListItem>\n\n {Array.from(accountsByTypeMap.keys()).map((accountType) => {\n const accounts = accountsByTypeMap.get(accountType)\n const typeDisabled =\n disabled || (allowedAccountTypes ? !allowedAccountTypes.includes(accountType) : false)\n const typeName = accountsCopy.account_type_accounts[accountType]\n const headingId = `account-filter-group-${accountType}`\n\n const typeAllSelected =\n !!accounts?.length && accounts.every((account) => accountFilterMap.get(account.guid))\n const typeSomeSelected = !!accounts?.some((account) =>\n accountFilterMap.get(account.guid),\n )\n\n return (\n // Account Type Group\n <ListItem disableGutters={true} disablePadding={true} key={accountType}>\n <Stack aria-labelledby={headingId} role=\"group\" sx={{ pb: 8, width: '100%' }}>\n <Divider />\n <List\n dense={true}\n subheader={\n // Account Type Checkbox — toggles every account of this type\n <ListItem disableGutters={true} disablePadding={true}>\n <FormControlLabel\n control={\n <TriStateCheckbox\n checked={typeAllSelected}\n disabled={typeDisabled}\n indeterminate={!typeAllSelected && typeSomeSelected}\n onChange={() => handleSelectAccountTypeClick(accountType)}\n size=\"small\"\n />\n }\n label={typeName}\n slotProps={{\n typography: { id: headingId, variant: 'body1', fontWeight: 'bold' },\n }}\n sx={{\n width: '100%',\n m: 0,\n minHeight: 40,\n '&:hover': { bgcolor: 'action.hover' },\n }}\n />\n </ListItem>\n }\n >\n {accounts?.map((account) => (\n // Account Checkbox\n <ListItem key={account.guid}>\n <FormControlLabel\n control={\n <CheckBox\n checked={!!accountFilterMap.get(account.guid)}\n disabled={typeDisabled}\n onChange={() =>\n updateAccountFilterMap(\n account.guid,\n !accountFilterMap.get(account.guid),\n )\n }\n size=\"small\"\n />\n }\n label={account.displayName}\n slotProps={{ typography: { variant: 'body1', fontWeight: 'normal' } }}\n sx={{\n width: '100%',\n m: 0,\n minHeight: 40,\n '&:hover': { bgcolor: 'action.hover' },\n }}\n />\n </ListItem>\n ))}\n </List>\n </Stack>\n </ListItem>\n )\n })}\n </List>\n </Box>\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;AAuBA,IAAa,KAA0B,EAAA,CACpC,EAAE,qBAAA,GAAqB,UAAA,GAAU,UAAA,IAAW,GAAA,MAA0C;AACrF,QAAM,EAAE,kBAAA,GAAkB,wBAAA,EAAA,IAA2B,EAAiB,GAChE,EAAE,UAAU,GAAc,QAAQ,EAAA,IAAe,EAAmB,GACpE,EAAE,gBAAgB,EAAA,IAAS,GAE3B,EAAE,mBAAA,GAAmB,kBAAA,EAAA,IAAqB,EAAgB,GAI1D,IAAkB,EACtB,GACA,GACA,CACF,GAIM,IACJ,EAAgB,OAAO,KACvB,MAAM,KAAK,EAAgB,OAAO,CAAC,EAAE,MAAA,CAAO,MAAe,CAAU,GACjE,IAAe,MAAM,KAAK,EAAgB,OAAO,CAAC,EAAE,KAAA,CAAM,MAAe,CAAU,GAMnF,IAAA,MAA0B;AAC9B,UAAM,EAAE,UAAA,GAAU,OAAA,EAAA,IAAU,EAC1B,EAAqB,GAAkB,GAAkB,CAAmB,CAC9E;AAEA,IAAA,IACE,E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,oBACF,OAAO;AAAA,oBACP,GAAG;AAAA,oBACH,WAAW;AAAA,oBACX,WAAW,EAAE,SAAS,eAAe;AAAA,kBACvC;AAAA,gBACD,CAAA;AAAA,cACO,CAAA;AAAA,cAGX,UAAA,GAAU,IAAA,CAAK,MAEd,gBAAA,EAAC,GAAD,EAAA,UACE,gBAAA,EAAC,GAAD;AAAA,gBACE,SACE,gBAAA,EAAC,GAAD;AAAA,kBACE,SAAS,CAAC,CAAC,EAAiB,IAAI,EAAQ,IAAI;AAAA,kBAC5C,UAAU;AAAA,kBACV,UAAA,MACE,EACE,EAAQ,MACR,CAAC,EAAiB,IAAI,EAAQ,IAAI,CACpC;AAAA,kBAEF,MAAK;AAAA,gBACN,CAAA;AAAA,gBAEH,OAAO,EAAQ;AAAA,gBACf,WAAW,EAAE,YAAY;AAAA,kBAAE,SAAS;AAAA,kBAAS,YAAY;AAAA,gBAAS,EAAE;AAAA,gBACpE,IAAI;AAAA,kBACF,OAAO;AAAA,kBACP,GAAG;AAAA,kBACH,WAAW;AAAA,kBACX,WAAW,EAAE,SAAS,eAAe;AAAA,gBACvC;AAAA,cACD,CAAA,EACO,GAxBK,EAAQ,IAwBb,CACX;AAAA,YACG,CAAA,CACD;AAAA;QACC,GA9DiD,CA8DjD;AAAA,MAEd,CAAC,CACG;AAAA;EACH,CAAA;AAET,CACF"}
@@ -3,6 +3,7 @@ import { GlobalStore } from './GlobalStore';
3
3
  export declare class GlobalUiStore {
4
4
  globalStore: GlobalStore;
5
5
  accountFilterMap: Map<string, boolean>;
6
+ isApplyingAccountFilter: boolean;
6
7
  displayedDate: Date;
7
8
  displayedDateRange: {
8
9
  start: Date;
@@ -20,6 +21,7 @@ export declare class GlobalUiStore {
20
21
  populateAccountFilterMap: (accounts: Account[]) => void;
21
22
  resetAccountFilterMap: () => void;
22
23
  updateAccountFilterMap: (guid: string, isIncluded: boolean) => void;
24
+ setIsApplyingAccountFilter: (isApplying: boolean) => void;
23
25
  setDisplayedDate: (startDate: Date, endDate: Date) => void;
24
26
  get shouldDisableNextDate(): boolean;
25
27
  get shouldDisablePrevDate(): boolean;
@@ -1,20 +1,19 @@
1
1
  import { addMonths as o } from "date-fns/addMonths";
2
- import { endOfMonth as s } from "date-fns/endOfMonth";
3
- import { startOfMonth as i } from "date-fns/startOfMonth";
4
- import { makeAutoObservable as r, reaction as l } from "mobx";
2
+ import { endOfMonth as i } from "date-fns/endOfMonth";
3
+ import { startOfMonth as s } from "date-fns/startOfMonth";
4
+ import { makeAutoObservable as r } from "mobx";
5
5
  import { getMonth as a } from "date-fns/getMonth";
6
- var h = class {
6
+ var p = class {
7
7
  globalStore;
8
8
  accountFilterMap = /* @__PURE__ */ new Map();
9
+ isApplyingAccountFilter = !1;
9
10
  displayedDate = /* @__PURE__ */ new Date();
10
11
  displayedDateRange = {
11
- start: i(this.displayedDate),
12
- end: s(this.displayedDate)
12
+ start: s(this.displayedDate),
13
+ end: i(this.displayedDate)
13
14
  };
14
15
  constructor(t) {
15
- r(this), this.globalStore = t, l(() => this.globalStore.accountStore.visibleAccounts, (e) => {
16
- this.populateAccountFilterMap(e);
17
- });
16
+ r(this), this.globalStore = t;
18
17
  }
19
18
  get allSelectedAccounts() {
20
19
  return this.globalStore.accountStore.detailedAccounts.filter((t) => !t.is_excluded_from_accounts);
@@ -53,6 +52,9 @@ var h = class {
53
52
  updateAccountFilterMap = (t, e) => {
54
53
  this.accountFilterMap.set(t, e);
55
54
  };
55
+ setIsApplyingAccountFilter = (t) => {
56
+ this.isApplyingAccountFilter = t;
57
+ };
56
58
  setDisplayedDate = (t, e) => {
57
59
  this.displayedDate = e, this.displayedDateRange = {
58
60
  start: t,
@@ -67,7 +69,7 @@ var h = class {
67
69
  }
68
70
  };
69
71
  export {
70
- h as GlobalUiStore
72
+ p as GlobalUiStore
71
73
  };
72
74
 
73
75
  //# sourceMappingURL=GlobalUiStore.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GlobalUiStore.es.js","names":[],"sources":["../../../src/core/stores/GlobalUiStore.ts"],"sourcesContent":["import { makeAutoObservable, reaction } from 'mobx'\n\nimport { addMonths } from 'date-fns/addMonths'\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { getMonth } from 'date-fns/getMonth'\nimport { startOfMonth } from 'date-fns/startOfMonth'\n\nimport { Account } from '../types'\n\nimport type { GlobalStore } from './GlobalStore'\n\nexport class GlobalUiStore {\n globalStore: GlobalStore\n\n accountFilterMap: Map<string, boolean> = new Map()\n\n displayedDate = new Date()\n displayedDateRange = {\n start: startOfMonth(this.displayedDate),\n end: endOfMonth(this.displayedDate),\n }\n\n constructor(globalStore: GlobalStore) {\n makeAutoObservable(this)\n this.globalStore = globalStore\n\n reaction(\n () => this.globalStore.accountStore.visibleAccounts,\n (visibleAccounts) => {\n this.populateAccountFilterMap(visibleAccounts)\n },\n )\n }\n\n get allSelectedAccounts() {\n return this.globalStore.accountStore.detailedAccounts.filter(\n (account: Account) => !account.is_excluded_from_accounts,\n )\n }\n\n get selectedAccounts() {\n return this.globalStore.accountStore.visibleAccounts.filter(\n (account: Account) => !account.is_excluded_from_accounts,\n )\n }\n\n get selectedAccountGuids() {\n return this.selectedAccounts.map((account) => account.guid)\n }\n\n get isCopyLoaded() {\n return this.globalStore.copyStore.isInitialized\n }\n\n get isConfigLoaded() {\n return this.globalStore.appDataStore.isAppDataLoaded\n }\n\n get areUserFeaturesLoaded() {\n return this.globalStore.userStore.userFeaturesLoaded\n }\n\n get isInitialized() {\n return this.isCopyLoaded && this.isConfigLoaded && this.areUserFeaturesLoaded\n }\n\n get shouldShowWelcomeDialog() {\n if (!this.isInitialized) {\n return false\n }\n\n const { config } = this.globalStore.appDataStore.appConfig\n const user = this.globalStore.appDataStore.user\n\n return Boolean(config.display_terms_and_conditions && user && !user.has_accepted_terms)\n }\n\n populateAccountFilterMap = (accounts: Account[]) => {\n if (accounts) {\n accounts.forEach((account) => {\n this.accountFilterMap.set(account.guid, !account.is_excluded_from_accounts)\n })\n }\n }\n\n resetAccountFilterMap = () => {\n this.accountFilterMap.clear()\n this.populateAccountFilterMap(this.globalStore.accountStore.visibleAccounts)\n }\n\n updateAccountFilterMap = (guid: string, isIncluded: boolean) => {\n this.accountFilterMap.set(guid, isIncluded)\n }\n\n setDisplayedDate = (startDate: Date, endDate: Date) => {\n this.displayedDate = endDate\n this.displayedDateRange = {\n start: startDate,\n end: endDate,\n }\n }\n\n get shouldDisableNextDate() {\n const selectedMonth = getMonth(this.displayedDate)\n const nextMonth = getMonth(addMonths(new Date(), 1))\n\n return selectedMonth === nextMonth\n }\n\n get shouldDisablePrevDate() {\n const selectedMonth = getMonth(this.displayedDate)\n const currentMonth = getMonth(new Date())\n\n return selectedMonth === currentMonth\n }\n}\n"],"mappings":";;;;;AAWA,IAAa,IAAb,MAA2B;AAAA,EACzB;AAAA,EAEA,mBAAyC,oBAAI,IAAI;AAAA,EAEjD,gBAAgB,oBAAI,KAAK;AAAA,EACzB,qBAAqB;AAAA,IACnB,OAAO,EAAa,KAAK,aAAa;AAAA,IACtC,KAAK,EAAW,KAAK,aAAa;AAAA,EACpC;AAAA,EAEA,YAAY,GAA0B;AACpC,IAAA,EAAmB,IAAI,GACvB,KAAK,cAAc,GAEnB,EAAA,MACQ,KAAK,YAAY,aAAa,iBAAA,CACnC,MAAoB;AACnB,WAAK,yBAAyB,CAAe;AAAA,IAC/C,CACF;AAAA,EACF;AAAA,EAEA,IAAI,sBAAsB;AACxB,WAAO,KAAK,YAAY,aAAa,iBAAiB,OAAA,CACnD,MAAqB,CAAC,EAAQ,yBACjC;AAAA,EACF;AAAA,EAEA,IAAI,mBAAmB;AACrB,WAAO,KAAK,YAAY,aAAa,gBAAgB,OAAA,CAClD,MAAqB,CAAC,EAAQ,yBACjC;AAAA,EACF;AAAA,EAEA,IAAI,uBAAuB;AACzB,WAAO,KAAK,iBAAiB,IAAA,CAAK,MAAY,EAAQ,IAAI;AAAA,EAC5D;AAAA,EAEA,IAAI,eAAe;AACjB,WAAO,KAAK,YAAY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ore.es.js","names":[],"sources":["../../../src/core/stores/GlobalUiStore.ts"],"sourcesContent":["import { makeAutoObservable } from 'mobx'\n\nimport { addMonths } from 'date-fns/addMonths'\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { getMonth } from 'date-fns/getMonth'\nimport { startOfMonth } from 'date-fns/startOfMonth'\n\nimport { Account } from '../types'\n\nimport type { GlobalStore } from './GlobalStore'\n\nexport class GlobalUiStore {\n globalStore: GlobalStore\n\n accountFilterMap: Map<string, boolean> = new Map()\n // Shared, not per filter: the map is global, so a filter in another widget\n // must not accept edits that a save started elsewhere will overwrite.\n isApplyingAccountFilter = false\n\n displayedDate = new Date()\n displayedDateRange = {\n start: startOfMonth(this.displayedDate),\n end: endOfMonth(this.displayedDate),\n }\n\n constructor(globalStore: GlobalStore) {\n makeAutoObservable(this)\n this.globalStore = globalStore\n }\n\n get allSelectedAccounts() {\n return this.globalStore.accountStore.detailedAccounts.filter(\n (account: Account) => !account.is_excluded_from_accounts,\n )\n }\n\n get selectedAccounts() {\n return this.globalStore.accountStore.visibleAccounts.filter(\n (account: Account) => !account.is_excluded_from_accounts,\n )\n }\n\n get selectedAccountGuids() {\n return this.selectedAccounts.map((account) => account.guid)\n }\n\n get isCopyLoaded() {\n return this.globalStore.copyStore.isInitialized\n }\n\n get isConfigLoaded() {\n return this.globalStore.appDataStore.isAppDataLoaded\n }\n\n get areUserFeaturesLoaded() {\n return this.globalStore.userStore.userFeaturesLoaded\n }\n\n get isInitialized() {\n return this.isCopyLoaded && this.isConfigLoaded && this.areUserFeaturesLoaded\n }\n\n get shouldShowWelcomeDialog() {\n if (!this.isInitialized) {\n return false\n }\n\n const { config } = this.globalStore.appDataStore.appConfig\n const user = this.globalStore.appDataStore.user\n\n return Boolean(config.display_terms_and_conditions && user && !user.has_accepted_terms)\n }\n\n populateAccountFilterMap = (accounts: Account[]) => {\n if (accounts) {\n accounts.forEach((account) => {\n this.accountFilterMap.set(account.guid, !account.is_excluded_from_accounts)\n })\n }\n }\n\n resetAccountFilterMap = () => {\n this.accountFilterMap.clear()\n this.populateAccountFilterMap(this.globalStore.accountStore.visibleAccounts)\n }\n\n updateAccountFilterMap = (guid: string, isIncluded: boolean) => {\n this.accountFilterMap.set(guid, isIncluded)\n }\n\n setIsApplyingAccountFilter = (isApplying: boolean) => {\n this.isApplyingAccountFilter = isApplying\n }\n\n setDisplayedDate = (startDate: Date, endDate: Date) => {\n this.displayedDate = endDate\n this.displayedDateRange = {\n start: startDate,\n end: endDate,\n }\n }\n\n get shouldDisableNextDate() {\n const selectedMonth = getMonth(this.displayedDate)\n const nextMonth = getMonth(addMonths(new Date(), 1))\n\n return selectedMonth === nextMonth\n }\n\n get shouldDisablePrevDate() {\n const selectedMonth = getMonth(this.displayedDate)\n const currentMonth = getMonth(new Date())\n\n return selectedMonth === currentMonth\n }\n}\n"],"mappings":";;;;;AAWA,IAAa,IAAb,MAA2B;AAAA,EACzB;AAAA,EAEA,mBAAyC,oBAAI,IAAI;AAAA,EAGjD,0BAA0B;AAAA,EAE1B,gBAAgB,oBAAI,KAAK;AAAA,EACzB,qBAAqB;AAAA,IACnB,OAAO,EAAa,KAAK,aAAa;AAAA,IACtC,KAAK,EAAW,KAAK,aAAa;AAAA,EACpC;AAAA,EAEA,YAAY,GAA0B;AACpC,IAAA,EAAmB,IAAI,GACvB,KAAK,cAAc;AAAA,EACrB;AAAA,EAEA,IAAI,sBAAsB;AACxB,WAAO,KAAK,YAAY,aAAa,iBAAiB,OAAA,CACnD,MAAqB,CAAC,EAAQ,yBACjC;AAAA,EACF;AAAA,EAEA,IAAI,mBAAmB;AACrB,WAAO,KAAK,YAAY,aAAa,gBAAgB,OAAA,CAClD,MAAqB,CAAC,EAAQ,yBACjC;AAAA,EACF;AAAA,EAEA,IAAI,uBAAuB;AACzB,WAAO,KAAK,iBAAiB,IAAA,CAAK,MAAY,EAAQ,IAAI;AAAA,EAC5D;AAAA,EAEA,IAAI,eAAe;AACjB,WAAO,KAAK,YAAY,UAAU;A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KAAK,CAEd;AAAA,EAC3B;AACF"}
@@ -1,34 +1,35 @@
1
- import { useAppConfig as Z, useGlobalCopyStore as oo, useGlobalStore as io, useInsightsV2Store as to } from "../../common/context/hooks.es.js";
2
- import { sendClientConfiguredCta as eo } from "../../common/utils/PostMessage.es.js";
3
- import { BeatActionsProvider as no } from "../beatActions.es.js";
4
- import { isContactSupportCtaDisabled as ro } from "../actionBlocks/ContactSupportActionBlock.es.js";
5
- import { CtaStatus as so } from "./CtaStatus.es.js";
6
- import { reportCtaClick as ao } from "../ctaActions/runCtaAction.es.js";
7
- import { useBeatCtaActions as lo } from "../ctaActions/useCtaAction.es.js";
8
- import { actionBlocksKey as co } from "../mappings/actionBlocksKey.es.js";
9
- import { logoFromRef as mo } from "./shared/EntityLogo.es.js";
10
- import po from "./FeedbackDialog.es.js";
11
- import { ErrorCard as uo } from "./ErrorCard.es.js";
12
- import { blocks as fo } from "../mappings/blocks.es.js";
13
- import { ActionBlockLayer as bo } from "../actionBlocks/ActionBlockLayer.es.js";
14
- import Co from "./Footer.es.js";
15
- import go from "./Header.es.js";
16
- import { FeedbackBar as ho } from "./FeedbackBar.es.js";
17
- import { DismissInsightDialog as _o } from "./DismissInsightDialog.es.js";
18
- import { HiddenConfirmationCard as yo } from "./HiddenConfirmationCard.es.js";
19
- import { LoadingCard as ko } from "./LoadingCard.es.js";
20
- import { ObsolesceBanner as xo } from "./ObsolesceBanner.es.js";
21
- import { useBeatFeedbackFlow as vo } from "../hooks/useBeatFeedbackFlow.es.js";
22
- import { useMemo as So } from "react";
23
- import { observer as To } from "mobx-react-lite";
1
+ import { useAppConfig as to, useGlobalCopyStore as eo, useGlobalStore as no, useInsightsV2Store as ro } from "../../common/context/hooks.es.js";
2
+ import { sendClientConfiguredCta as so } from "../../common/utils/PostMessage.es.js";
3
+ import { BeatActionsProvider as ao } from "../beatActions.es.js";
4
+ import { isContactSupportCtaDisabled as lo } from "../actionBlocks/ContactSupportActionBlock.es.js";
5
+ import { CtaStatus as co } from "./CtaStatus.es.js";
6
+ import { HOST_ACTIONS as po } from "../ctaActions/hostActions.es.js";
7
+ import { reportCtaClick as mo } from "../ctaActions/runCtaAction.es.js";
8
+ import { useBeatCtaActions as uo } from "../ctaActions/useCtaAction.es.js";
9
+ import { actionBlocksKey as fo } from "../mappings/actionBlocksKey.es.js";
10
+ import { logoFromRef as Co } from "./shared/EntityLogo.es.js";
11
+ import ho from "./FeedbackDialog.es.js";
12
+ import { ErrorCard as go } from "./ErrorCard.es.js";
13
+ import { blocks as bo } from "../mappings/blocks.es.js";
14
+ import { ActionBlockLayer as _o } from "../actionBlocks/ActionBlockLayer.es.js";
15
+ import ko from "./Footer.es.js";
16
+ import yo from "./Header.es.js";
17
+ import { FeedbackBar as xo } from "./FeedbackBar.es.js";
18
+ import { DismissInsightDialog as vo } from "./DismissInsightDialog.es.js";
19
+ import { HiddenConfirmationCard as So } from "./HiddenConfirmationCard.es.js";
20
+ import { LoadingCard as To } from "./LoadingCard.es.js";
21
+ import { ObsolesceBanner as Lo } from "./ObsolesceBanner.es.js";
22
+ import { useBeatFeedbackFlow as wo } from "../hooks/useBeatFeedbackFlow.es.js";
23
+ import { useMemo as Ao } from "react";
24
+ import { observer as Bo } from "mobx-react-lite";
24
25
  import v from "@mui/material/Stack";
25
- import { P as wo } from "@mxenabled/mxui";
26
- import u from "@mui/material/Button";
26
+ import { P as Do } from "@mxenabled/mxui";
27
+ import f from "@mui/material/Button";
27
28
  import { ChevronRight as I } from "@mxenabled/mx-icons";
28
- import { Fragment as Lo, jsx as i, jsxs as f } from "react/jsx-runtime";
29
- import Do from "@mui/material/Box";
30
- import Ao from "@mui/material/Card";
31
- var Bo = {}, Oo = {
29
+ import { Fragment as Oo, jsx as i, jsxs as C } from "react/jsx-runtime";
30
+ import Io from "@mui/material/Box";
31
+ import Fo from "@mui/material/Card";
32
+ var Eo = {}, Ho = {
32
33
  position: "absolute",
33
34
  top: 0,
34
35
  left: 0,
@@ -49,12 +50,12 @@ var Bo = {}, Oo = {
49
50
  px: 0,
50
51
  py: 4,
51
52
  textAlign: "left"
52
- }, Io = {
53
+ }, Po = {
53
54
  ...S,
54
55
  alignItems: "center",
55
56
  display: "flex",
56
57
  textTransform: "none"
57
- }, Fo = {
58
+ }, Mo = {
58
59
  color: "text.secondary",
59
60
  fontSize: 13,
60
61
  fontWeight: 600,
@@ -64,51 +65,61 @@ var Bo = {}, Oo = {
64
65
  px: 16,
65
66
  py: 12,
66
67
  "&.Mui-disabled": { color: "text.disabled" }
67
- }, di = To(({ beat: t, beatActions: l = Bo, obsolete: g, isLoading: F = !1, isError: E = !1 }) => {
68
- const H = oo(), R = to(), { config: M } = Z(), o = vo(t, l), T = io(), { runCta: N, primary: h, secondary: w, linkPresentation: P } = lo(t, l, t.insights_payload?.primary_cta, t.insights_payload?.secondary_cta, t.insights_payload?.in_description_cta), c = t.insights_payload?.widget_type === "mini", W = So(() => ({
68
+ }, Ci = Bo(({ beat: t, beatActions: l = Eo, obsolete: g, isLoading: F = !1, isError: E = !1 }) => {
69
+ const H = eo(), P = ro(), { config: M } = to(), o = wo(t, l), b = no(), { runCta: N, primary: _, secondary: T, linkPresentation: R } = uo(t, l, t.insights_payload?.primary_cta, t.insights_payload?.secondary_cta, t.insights_payload?.in_description_cta), c = t.insights_payload?.widget_type === "mini", W = Ao(() => ({
69
70
  ...o.wrappedActions,
70
71
  beat: t
71
72
  }), [o.wrappedActions, t]);
72
- if (E) return /* @__PURE__ */ i(uo, {});
73
+ if (E) return /* @__PURE__ */ i(go, {});
73
74
  const e = t.insights_payload;
74
75
  if (!e || o.cardState === "dismissed") return null;
75
- const { instance_slot: X, primary_cta: r, secondary_cta: s, sub_title: z, title: G, guid: L, dismissed_at: V } = e, { block: j } = X, K = z ?? (e.subtitle ? {
76
- logo: mo(e.logo),
76
+ const { instance_slot: G, primary_cta: r, secondary_cta: d, sub_title: X, title: z, guid: L, dismissed_at: V } = e, { block: j } = G, K = X ?? (e.subtitle ? {
77
+ logo: Co(e.logo),
77
78
  text: e.subtitle
78
- } : void 0), d = (a) => ro(a, M, l.onContactSupport), D = async (a, p) => {
79
- if (!d(p.block)) {
80
- if (p.block === co.CONTACT_SUPPORT_ACTION_BLOCK) {
81
- ao({
79
+ } : void 0), p = (s) => lo(s, M, l.onContactSupport), w = async (s, a) => {
80
+ if (!p(a.block)) {
81
+ if (a.block === fo.CONTACT_SUPPORT_ACTION_BLOCK) {
82
+ mo({
82
83
  beat: t,
83
- stores: T,
84
+ stores: b,
84
85
  hostActions: l,
85
- slot: a
86
+ slot: s
86
87
  }), l.onContactSupport?.();
87
88
  return;
88
89
  }
89
- await N(a, p);
90
+ await N(s, a);
90
91
  }
91
- }, A = fo[j], m = e.in_description_cta, _ = !c && m?.label && m.block ? m : void 0, U = r?.label || (_ ? void 0 : m?.label) || void 0, b = !c && !!r?.label, B = t.in_description_cta || t.html_in_description_cta, Y = () => {
92
- const { is_mobile_webview: a, clientConfig: p } = T.appDataStore.appConfig;
93
- eo(t.template, {
94
- isMobileWebview: a,
95
- webviewScheme: p?.master?.ui_message_webview_url_scheme,
92
+ }, A = bo[j], m = e.in_description_cta, k = !c && m?.label && m.block ? m : void 0, U = r?.label || (k ? void 0 : m?.label) || void 0, u = !c && !!r?.label, B = t.in_description_cta || t.html_in_description_cta, Y = () => {
93
+ const { is_mobile_webview: s, clientConfig: a } = b.appDataStore.appConfig;
94
+ so(t.template, {
95
+ isMobileWebview: s,
96
+ webviewScheme: a?.master?.ui_message_webview_url_scheme,
96
97
  userGuid: e.user_guid ?? t.user_guid
97
98
  });
98
- }, n = b ? h.presentation : void 0, $ = n?.kind === "hidden" && !!n.hideAll, O = !c && !!s?.label && !$, C = c ? P : void 0, q = C?.kind === "status" ? C : void 0, y = C ? q?.action?.label : U, J = C?.title || G || "", Q = !!y && n?.kind !== "hidden" || O, k = H.insights_feed?.general, x = g?.state === "not_refreshable" && !V && !!k;
99
- return /* @__PURE__ */ i(no, {
99
+ }, n = u ? _.presentation : void 0, $ = n?.kind === "hidden" && !!n.hideAll, D = !c && !!d?.label && !$, h = c ? R : void 0, q = h?.kind === "status" ? h : void 0, O = h ? q?.action?.label : U, J = h?.title || z || "", Q = !!O && !u, Z = u && n?.kind !== "hidden" || D, oo = (s) => {
100
+ const { onCtaAction: a } = l;
101
+ a && (s.stopPropagation(), Promise.resolve().then(() => a({
102
+ beatGuid: t.guid,
103
+ name: po.cardClick
104
+ })).catch((io) => b.captureException(io, {
105
+ store: "BaseLayout",
106
+ template: t.template,
107
+ handler: "cardClick"
108
+ })));
109
+ }, y = H.insights_feed?.general, x = g?.state === "not_refreshable" && !V && !!y;
110
+ return /* @__PURE__ */ i(ao, {
100
111
  value: W,
101
- children: /* @__PURE__ */ f(v, {
112
+ children: /* @__PURE__ */ C(v, {
102
113
  sx: { mb: 16 },
103
114
  children: [
104
- o.cardState === "confirming" ? /* @__PURE__ */ i(yo, {
115
+ o.cardState === "confirming" ? /* @__PURE__ */ i(So, {
105
116
  onClose: o.collapseConfirmation,
106
117
  onLeaveFeedback: o.openHideSurvey,
107
118
  onUndo: o.undoDismiss
108
- }) : /* @__PURE__ */ f(Lo, { children: [g && k && /* @__PURE__ */ i(xo, {
119
+ }) : /* @__PURE__ */ C(Oo, { children: [g && y && /* @__PURE__ */ i(Lo, {
109
120
  ...g,
110
- copy: k
111
- }), /* @__PURE__ */ f(Ao, {
121
+ copy: y
122
+ }), /* @__PURE__ */ C(Fo, {
112
123
  inert: x,
113
124
  sx: { ...x && {
114
125
  position: "relative",
@@ -116,17 +127,17 @@ var Bo = {}, Oo = {
116
127
  pointerEvents: "none"
117
128
  } },
118
129
  children: [
119
- x && /* @__PURE__ */ i(Do, { sx: Oo }),
120
- /* @__PURE__ */ i(go, {
130
+ x && /* @__PURE__ */ i(Io, { sx: Ho }),
131
+ /* @__PURE__ */ i(yo, {
121
132
  isMini: c,
122
133
  subtitle: K,
123
134
  title: J
124
135
  }),
125
- F ? /* @__PURE__ */ i(ko, {}) : A && /* @__PURE__ */ i(A, {
136
+ F ? /* @__PURE__ */ i(To, {}) : A && /* @__PURE__ */ i(A, {
126
137
  beatGuid: L,
127
138
  payload: e
128
139
  }),
129
- /* @__PURE__ */ f(v, {
140
+ /* @__PURE__ */ C(v, {
130
141
  sx: {
131
142
  gap: 6,
132
143
  pb: 16,
@@ -134,21 +145,27 @@ var Bo = {}, Oo = {
134
145
  px: 16
135
146
  },
136
147
  children: [
137
- /* @__PURE__ */ i(wo, {
148
+ /* @__PURE__ */ i(Do, {
138
149
  dangerouslySetInnerHTML: { __html: e.description.html_text },
139
150
  sx: { fontWeight: "fontWeightRegular" },
140
151
  variant: "subtitle2"
141
152
  }),
142
- _ && /* @__PURE__ */ i(u, {
153
+ k && /* @__PURE__ */ i(f, {
143
154
  endIcon: /* @__PURE__ */ i(I, {}),
144
- onClick: () => R.openActionDrawer({
155
+ onClick: () => P.openActionDrawer({
145
156
  guid: L,
146
157
  trigger: "inDescriptionCta"
147
158
  }),
148
159
  sx: S,
149
- children: _.label
160
+ children: k.label
150
161
  }),
151
- !m?.label && B && /* @__PURE__ */ i(u, {
162
+ Q && /* @__PURE__ */ i(f, {
163
+ onClick: c ? oo : void 0,
164
+ sx: Po,
165
+ variant: "text",
166
+ children: O
167
+ }),
168
+ !m?.label && B && /* @__PURE__ */ i(f, {
152
169
  endIcon: /* @__PURE__ */ i(I, {}),
153
170
  onClick: Y,
154
171
  sx: S,
@@ -156,59 +173,54 @@ var Bo = {}, Oo = {
156
173
  })
157
174
  ]
158
175
  }),
159
- Q && /* @__PURE__ */ f(v, {
176
+ Z && /* @__PURE__ */ C(v, {
160
177
  sx: {
161
178
  gap: 8,
162
179
  pb: 16,
163
180
  px: 16
164
181
  },
165
182
  children: [
166
- y && !b && /* @__PURE__ */ i(u, {
167
- sx: Io,
168
- variant: "text",
169
- children: y
170
- }),
171
- b && r && n?.kind === "status" && /* @__PURE__ */ i(so, {
183
+ u && r && n?.kind === "status" && /* @__PURE__ */ i(co, {
172
184
  action: n.action,
173
185
  sx: n.sx,
174
186
  icon: n.icon,
175
187
  label: n.label,
176
188
  tone: n.tone
177
189
  }),
178
- b && r && !n && /* @__PURE__ */ i(u, {
179
- "aria-disabled": d(r.block) || h.disabled,
180
- disabled: h.disabled,
181
- onClick: () => D("primary", r),
182
- sx: { ...d(r.block) && { color: "text.disabled" } },
190
+ u && r && !n && /* @__PURE__ */ i(f, {
191
+ "aria-disabled": p(r.block) || _.disabled,
192
+ disabled: _.disabled,
193
+ onClick: () => w("primary", r),
194
+ sx: { ...p(r.block) && { color: "text.disabled" } },
183
195
  variant: "outlined",
184
196
  children: r.label
185
197
  }),
186
- O && s && /* @__PURE__ */ i(u, {
187
- "aria-disabled": d(s.block) || w.disabled,
198
+ D && d && /* @__PURE__ */ i(f, {
199
+ "aria-disabled": p(d.block) || T.disabled,
188
200
  color: "inherit",
189
- disabled: w.disabled,
190
- onClick: () => D("secondary", s),
201
+ disabled: T.disabled,
202
+ onClick: () => w("secondary", d),
191
203
  sx: {
192
- ...Fo,
193
- ...d(s.block) && { color: "text.disabled" }
204
+ ...Mo,
205
+ ...p(d.block) && { color: "text.disabled" }
194
206
  },
195
- children: s.label
207
+ children: d.label
196
208
  })
197
209
  ]
198
210
  }),
199
- /* @__PURE__ */ i(ho, {
211
+ /* @__PURE__ */ i(xo, {
200
212
  onTellUsMore: o.openRatingSurvey,
201
213
  show: o.isFeedbackBarShown
202
214
  })
203
215
  ]
204
216
  })] }),
205
- /* @__PURE__ */ i(bo, { beat: t }),
206
- /* @__PURE__ */ i(_o, {
217
+ /* @__PURE__ */ i(_o, { beat: t }),
218
+ /* @__PURE__ */ i(vo, {
207
219
  isOpen: o.isDismissOpen,
208
220
  onClose: o.closeDismissDialog,
209
221
  onDismiss: o.confirmDismiss
210
222
  }),
211
- o.isSurveyOpen && /* @__PURE__ */ i(po, {
223
+ o.isSurveyOpen && /* @__PURE__ */ i(ho, {
212
224
  characterLimitLabel: o.survey.characterLimitLabel,
213
225
  closeAriaLabel: o.survey.closeAriaLabel,
214
226
  isOpen: !0,
@@ -221,13 +233,13 @@ var Bo = {}, Oo = {
221
233
  secondaryText: o.survey.backText,
222
234
  title: o.survey.title
223
235
  }),
224
- o.cardState === "visible" && e.footer && /* @__PURE__ */ i(Co, { footer: e.footer })
236
+ o.cardState === "visible" && e.footer && /* @__PURE__ */ i(ko, { footer: e.footer })
225
237
  ]
226
238
  })
227
239
  });
228
240
  });
229
241
  export {
230
- di as default
242
+ Ci as default
231
243
  };
232
244
 
233
245
  //# 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 { CtaStatus } from './CtaStatus'\nimport { useBeatFeedbackFlow } from '../hooks/useBeatFeedbackFlow'\n\nexport interface ObsoleteState {\n state: ObsolesceBannerState\n onRefresh: () => void\n onDismiss: () => void\n}\n\ninterface BaseLayoutProps {\n beat: Beat\n beatActions?: BeatActions\n obsolete?: ObsoleteState\n /** Swap only the block slot for a LoadingCard (e.g. while a sampled beat loads). */\n isLoading?: boolean\n /** Replace the entire card with an ErrorCard (e.g. when the sample fails to load). */\n isError?: boolean\n}\n\nconst NO_BEAT_ACTIONS: BeatActions = {}\n\nconst OBSOLETE_OVERLAY_SX = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n backgroundColor: 'background.default',\n opacity: 0.7,\n // Above every block's own z-index (hero card 1, AccountBlock 2), or that section shows through.\n zIndex: 3,\n} as const\n\n// Figma's 24px text link: 13/16 semibold, 16px line plus 4px above and below, its text starting at the\n// card's 16px inset. A minimum height, not the theme's fixed 44px Button height, so a long or translated\n// label wraps instead of overflowing; MUI's 64px minimum width and centring are undone for the same inset.\n// The in-description links use it as is, with the Button's 20px chevron, so they are 28px tall, as in\n// Figma's Low Account Balance full card (node 438:27877); the 24px is the mini CTA's, which has no icon.\nconst TEXT_LINK_SX = {\n alignSelf: 'flex-start',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n justifyContent: 'flex-start',\n lineHeight: '16px',\n minHeight: 24,\n minWidth: 0,\n px: 0,\n py: 4,\n textAlign: 'left',\n} as const\n\n// Mini CTA label, which fits Pulse's 312px mini slide as a text link.\nconst MINI_CTA_SX = {\n ...TEXT_LINK_SX,\n alignItems: 'center',\n display: 'flex',\n textTransform: 'none',\n} as const\n\n// Full card's secondary CTA (e.g. Fee Detected's Contact Support): a quiet text button, 13/16\n// semibold in text.secondary, at least 40px tall with 12/16 padding, as in Figma. `color=\"inherit\"` keeps\n// hover, ripple and focus off the primary palette. An unavailable CTA (contact_support_block with no host\n// handler) is dimmed at the call site, as the primary CTA is, because it is only aria-disabled and so\n// never matches `.Mui-disabled`.\nconst SECONDARY_CTA_SX = {\n color: 'text.secondary',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n lineHeight: '16px',\n minHeight: 40,\n px: 16,\n py: 12,\n '&.Mui-disabled': { color: 'text.disabled' },\n} as const\n\nconst BaseLayout = observer(\n ({\n beat,\n beatActions = NO_BEAT_ACTIONS,\n obsolete,\n isLoading = false,\n isError = false,\n }: BaseLayoutProps) => {\n const copy = useGlobalCopyStore()\n const insightsV2Store = useInsightsV2Store()\n const { config } = useAppConfig()\n const flow = useBeatFeedbackFlow(beat, beatActions)\n\n const stores = useGlobalStore()\n const {\n runCta: handleCtaClick,\n primary: primaryCtaState,\n secondary: secondaryCtaState,\n linkPresentation,\n } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta,\n beat.insights_payload?.secondary_cta,\n beat.insights_payload?.in_description_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 // The primary step's presenter may draw a status or nothing instead of the button (full card only).\n const primaryPresentation = isCtaButton ? primaryCtaState.presentation : undefined\n const hidesAllCtas = primaryPresentation?.kind === 'hidden' && !!primaryPresentation.hideAll\n const showSecondaryCta = !isMini && !!secondary_cta?.label && !hidesAllCtas\n // Mini: the card's action (in_description_cta) mirrors the full card's state, as a label only.\n // Answered → the status's action word (Undo) and its answered title; hidden → no label. The tap\n // stays the host's (it opens the insight with its block), so nothing runs from mini itself.\n const miniPresentation = isMini ? linkPresentation : undefined\n const miniStatus = miniPresentation?.kind === 'status' ? miniPresentation : undefined\n const actionLabel = miniPresentation ? miniStatus?.action?.label : ctaLabel\n const cardTitle = miniPresentation?.title || title || ''\n const showCtaRow = (!!actionLabel && primaryPresentation?.kind !== 'hidden') || showSecondaryCta\n const obsoleteCopy = copy.insights_feed?.general\n const isObsoleteDimmed =\n obsolete?.state === 'not_refreshable' && !dismissed_at && !!obsoleteCopy\n\n return (\n <BeatActionsProvider value={beatActionsValue}>\n <Stack sx={{ mb: 16 }}>\n {flow.cardState === 'confirming' ? (\n <HiddenConfirmationCard\n onClose={flow.collapseConfirmation}\n onLeaveFeedback={flow.openHideSurvey}\n onUndo={flow.undoDismiss}\n />\n ) : (\n <>\n {obsolete && obsoleteCopy && <ObsolesceBanner {...obsolete} copy={obsoleteCopy} />}\n <Card\n inert={isObsoleteDimmed}\n sx={{\n ...(isObsoleteDimmed && {\n position: 'relative',\n zIndex: 2,\n pointerEvents: 'none',\n }),\n }}\n >\n {isObsoleteDimmed && <Box sx={OBSOLETE_OVERLAY_SX} />}\n <Header isMini={isMini} subtitle={subtitle} title={cardTitle} />\n {isLoading ? (\n <LoadingCard />\n ) : (\n Block && <Block beatGuid={guid} payload={insights_payload} />\n )}\n\n <Stack sx={{ gap: 6, pb: 16, pt: 12, px: 16 }}>\n <P\n dangerouslySetInnerHTML={{\n __html: insights_payload.description.html_text,\n }}\n sx={{ fontWeight: 'fontWeightRegular' }}\n variant=\"subtitle2\"\n />\n {/* V2: the envelope's link opens the action block it names. */}\n {envelopeLink && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() =>\n insightsV2Store.openActionDrawer({ guid, trigger: 'inDescriptionCta' })\n }\n sx={TEXT_LINK_SX}\n >\n {envelopeLink.label}\n </Button>\n )}\n {/* Custom-copy link when the envelope sends none; legacy mini shows it too, so no mini guard. */}\n {!inDescriptionCta?.label && clientConfiguredLabel && (\n <Button\n endIcon={<ChevronRight />}\n onClick={onClientConfiguredLinkClick}\n sx={TEXT_LINK_SX}\n >\n {clientConfiguredLabel}\n </Button>\n )}\n </Stack>\n\n {showCtaRow && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n {actionLabel &&\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 {actionLabel}\n </Button>\n )}\n {isCtaButton && primary_cta && primaryPresentation?.kind === 'status' && (\n <CtaStatus\n action={primaryPresentation.action}\n sx={primaryPresentation.sx}\n icon={primaryPresentation.icon}\n label={primaryPresentation.label}\n tone={primaryPresentation.tone}\n />\n )}\n {isCtaButton && primary_cta && !primaryPresentation && (\n <Button\n aria-disabled={isCtaDisabled(primary_cta.block) || primaryCtaState.disabled}\n disabled={primaryCtaState.disabled}\n onClick={() => onCtaClick('primary', primary_cta)}\n sx={{\n ...(isCtaDisabled(primary_cta.block) && { color: 'text.disabled' }),\n }}\n variant=\"outlined\"\n >\n {primary_cta.label}\n </Button>\n )}\n {/* Mini has room for one CTA. */}\n {showSecondaryCta && secondary_cta && (\n <Button\n aria-disabled={\n isCtaDisabled(secondary_cta.block) || secondaryCtaState.disabled\n }\n color=\"inherit\"\n disabled={secondaryCtaState.disabled}\n onClick={() => onCtaClick('secondary', secondary_cta)}\n sx={{\n ...SECONDARY_CTA_SX,\n ...(isCtaDisabled(secondary_cta.block) && { color: 'text.disabled' }),\n }}\n >\n {secondary_cta.label}\n </Button>\n )}\n </Stack>\n )}\n\n <FeedbackBar onTellUsMore={flow.openRatingSurvey} show={flow.isFeedbackBarShown} />\n </Card>\n </>\n )}\n\n <ActionBlockLayer beat={beat} />\n\n <DismissInsightDialog\n isOpen={flow.isDismissOpen}\n onClose={flow.closeDismissDialog}\n onDismiss={flow.confirmDismiss}\n />\n\n {flow.isSurveyOpen && (\n <FeedbackDialog\n characterLimitLabel={flow.survey.characterLimitLabel}\n closeAriaLabel={flow.survey.closeAriaLabel}\n isOpen={true}\n onBackClick={flow.feedbackDialogCallbacks.onBackClick}\n onClose={flow.closeSurvey}\n onSubmit={flow.submitSurvey}\n onTextInputFocus={flow.feedbackDialogCallbacks.onTextInputFocus}\n options={flow.survey.options}\n primaryText={flow.survey.submitText}\n secondaryText={flow.survey.backText}\n title={flow.survey.title}\n />\n )}\n\n {flow.cardState === 'visible' && insights_payload.footer && (\n <Footer footer={insights_payload.footer} />\n )}\n </Stack>\n </BeatActionsProvider>\n )\n },\n)\n\nexport default BaseLayout\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,IAAM,KAA+B,CAAC,GAEhC,KAAsB;AAAA,EAC1B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,SAAS;AAAA,EAET,QAAQ;AACV,GAOM,IAAe;AAAA,EACnB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,UAAU;AAAA,EACV,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,WAAW;AACb,GAGM,KAAc;AAAA,EAClB,GAAG;AAAA,EACH,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,eAAe;AACjB,GAOM,KAAmB;AAAA,EACvB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW;AAAA,EACX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AA,oBACH,GAAI,EAAc,EAAc,KAAK,KAAK,EAAE,OAAO,gBAAgB;AAAA,kBACrE;AAAA,kBAEC,UAAA,EAAc;AAAA,gBACT,CAAA;AAAA,cAEL;AAAA;YAGT,gBAAA,EAAC,IAAD;AAAA,cAAa,cAAc,EAAK;AAAA,cAAkB,MAAM,EAAK;AAAA,YAAqB,CAAA;AAAA,UAC9E;AAAA,QACN,CAAA,CAAA,EAAA,CAAA;AAAA,QAGJ,gBAAA,EAAC,IAAD,EAAwB,MAAA,EAAO,CAAA;AAAA,QAE/B,gBAAA,EAAC,IAAD;AAAA,UACE,QAAQ,EAAK;AAAA,UACb,SAAS,EAAK;AAAA,UACd,WAAW,EAAK;AAAA,QACjB,CAAA;AAAA,QAEA,EAAK,gBACJ,gBAAA,EAAC,IAAD;AAAA,UACE,qBAAqB,EAAK,OAAO;AAAA,UACjC,gBAAgB,EAAK,OAAO;AAAA,UAC5B,QAAQ;AAAA,UACR,aAAa,EAAK,wBAAwB;AAAA,UAC1C,SAAS,EAAK;AAAA,UACd,UAAU,EAAK;AAAA,UACf,kBAAkB,EAAK,wBAAwB;AAAA,UAC/C,SAAS,EAAK,OAAO;AAAA,UACrB,aAAa,EAAK,OAAO;AAAA,UACzB,eAAe,EAAK,OAAO;AAAA,UAC3B,OAAO,EAAK,OAAO;AAAA,QACpB,CAAA;AAAA,QAGF,EAAK,cAAc,aAAa,EAAiB,UAChD,gBAAA,EAAC,IAAD,EAAQ,QAAQ,EAAiB,OAAS,CAAA;AAAA,MAEvC;AAAA;EACY,CAAA;AAEzB,CACF"}
1
+ {"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { type MouseEvent, useMemo } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { ChevronRight } from '@mxenabled/mx-icons'\nimport { P } from '@mxenabled/mxui'\n\nimport { blocks } from '../mappings/blocks'\nimport { actionBlocksKey } from '../mappings/actionBlocksKey'\nimport { isContactSupportCtaDisabled } from '../actionBlocks/ContactSupportActionBlock'\nimport { logoFromRef } from './shared/EntityLogo'\n\nimport Footer from './Footer'\nimport Header from './Header'\nimport FeedbackBar from './FeedbackBar'\nimport FeedbackDialog from './FeedbackDialog'\nimport DismissInsightDialog from './DismissInsightDialog'\nimport HiddenConfirmationCard from './HiddenConfirmationCard'\nimport ErrorCard from './ErrorCard'\nimport LoadingCard from './LoadingCard'\nimport { ObsolesceBanner, type ObsolesceBannerState } from './ObsolesceBanner'\nimport { useAppConfig, useGlobalCopyStore, useGlobalStore, useInsightsV2Store } from '../../common'\nimport { sendClientConfiguredCta } from '../../common/utils/PostMessage'\nimport type { Beat, PrimaryCTA, SecondaryCTA } from '../../core'\nimport { BeatActionsProvider, type BeatActions } from '../beatActions'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { HOST_ACTIONS, reportCtaClick, useBeatCtaActions } from '../ctaActions'\nimport { CtaStatus } from './CtaStatus'\nimport { useBeatFeedbackFlow } from '../hooks/useBeatFeedbackFlow'\n\nexport interface ObsoleteState {\n state: ObsolesceBannerState\n onRefresh: () => void\n onDismiss: () => void\n}\n\ninterface BaseLayoutProps {\n beat: Beat\n beatActions?: BeatActions\n obsolete?: ObsoleteState\n /** Swap only the block slot for a LoadingCard (e.g. while a sampled beat loads). */\n isLoading?: boolean\n /** Replace the entire card with an ErrorCard (e.g. when the sample fails to load). */\n isError?: boolean\n}\n\nconst NO_BEAT_ACTIONS: BeatActions = {}\n\nconst OBSOLETE_OVERLAY_SX = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n backgroundColor: 'background.default',\n opacity: 0.7,\n // Above every block's own z-index (hero card 1, AccountBlock 2), or that section shows through.\n zIndex: 3,\n} as const\n\n// Figma's 24px text link: 13/16 semibold, 16px line plus 4px above and below, its text starting at the\n// card's 16px inset. A minimum height, not the theme's fixed 44px Button height, so a long or translated\n// label wraps instead of overflowing; MUI's 64px minimum width and centring are undone for the same inset.\n// The in-description links use it as is, with the Button's 20px chevron, so they are 28px tall, as in\n// Figma's Low Account Balance full card (node 438:27877); the 24px is the mini CTA's, which has no icon.\nconst TEXT_LINK_SX = {\n alignSelf: 'flex-start',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n justifyContent: 'flex-start',\n lineHeight: '16px',\n minHeight: 24,\n minWidth: 0,\n px: 0,\n py: 4,\n textAlign: 'left',\n} as const\n\n// Mini CTA label, which fits Pulse's 312px mini slide as a text link.\nconst MINI_CTA_SX = {\n ...TEXT_LINK_SX,\n alignItems: 'center',\n display: 'flex',\n textTransform: 'none',\n} as const\n\n// Full card's secondary CTA (e.g. Fee Detected's Contact Support): a quiet text button, 13/16\n// semibold in text.secondary, at least 40px tall with 12/16 padding, as in Figma. `color=\"inherit\"` keeps\n// hover, ripple and focus off the primary palette. An unavailable CTA (contact_support_block with no host\n// handler) is dimmed at the call site, as the primary CTA is, because it is only aria-disabled and so\n// never matches `.Mui-disabled`.\nconst SECONDARY_CTA_SX = {\n color: 'text.secondary',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n lineHeight: '16px',\n minHeight: 40,\n px: 16,\n py: 12,\n '&.Mui-disabled': { color: 'text.disabled' },\n} as const\n\nconst BaseLayout = observer(\n ({\n beat,\n beatActions = NO_BEAT_ACTIONS,\n obsolete,\n isLoading = false,\n isError = false,\n }: BaseLayoutProps) => {\n const copy = useGlobalCopyStore()\n const insightsV2Store = useInsightsV2Store()\n const { config } = useAppConfig()\n const flow = useBeatFeedbackFlow(beat, beatActions)\n\n const stores = useGlobalStore()\n const {\n runCta: handleCtaClick,\n primary: primaryCtaState,\n secondary: secondaryCtaState,\n linkPresentation,\n } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta,\n beat.insights_payload?.secondary_cta,\n beat.insights_payload?.in_description_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 // The primary step's presenter may draw a status or nothing instead of the button (full card only).\n const primaryPresentation = isCtaButton ? primaryCtaState.presentation : undefined\n const hidesAllCtas = primaryPresentation?.kind === 'hidden' && !!primaryPresentation.hideAll\n const showSecondaryCta = !isMini && !!secondary_cta?.label && !hidesAllCtas\n // Mini: the card's action (in_description_cta) mirrors the full card's state, as a label only.\n // Answered → the status's action word (Undo) and its answered title; hidden → no label. The tap\n // stays the host's (it opens the insight with its block), so nothing runs from mini itself.\n const miniPresentation = isMini ? linkPresentation : undefined\n const miniStatus = miniPresentation?.kind === 'status' ? miniPresentation : undefined\n const actionLabel = miniPresentation ? miniStatus?.action?.label : ctaLabel\n const cardTitle = miniPresentation?.title || title || ''\n const showActionLink = !!actionLabel && !isCtaButton\n const showCtaRow = (isCtaButton && primaryPresentation?.kind !== 'hidden') || showSecondaryCta\n const handleMiniActionClick = (event: MouseEvent) => {\n const { onCtaAction } = beatActions\n if (!onCtaAction) return\n event.stopPropagation()\n Promise.resolve()\n .then(() => onCtaAction({ beatGuid: beat.guid, name: HOST_ACTIONS.cardClick }))\n .catch((error) =>\n stores.captureException(error, {\n store: 'BaseLayout',\n template: beat.template,\n handler: 'cardClick',\n }),\n )\n }\n const obsoleteCopy = copy.insights_feed?.general\n const isObsoleteDimmed =\n obsolete?.state === 'not_refreshable' && !dismissed_at && !!obsoleteCopy\n\n return (\n <BeatActionsProvider value={beatActionsValue}>\n <Stack sx={{ mb: 16 }}>\n {flow.cardState === 'confirming' ? (\n <HiddenConfirmationCard\n onClose={flow.collapseConfirmation}\n onLeaveFeedback={flow.openHideSurvey}\n onUndo={flow.undoDismiss}\n />\n ) : (\n <>\n {obsolete && obsoleteCopy && <ObsolesceBanner {...obsolete} copy={obsoleteCopy} />}\n <Card\n inert={isObsoleteDimmed}\n sx={{\n ...(isObsoleteDimmed && {\n position: 'relative',\n zIndex: 2,\n pointerEvents: 'none',\n }),\n }}\n >\n {isObsoleteDimmed && <Box sx={OBSOLETE_OVERLAY_SX} />}\n <Header isMini={isMini} subtitle={subtitle} title={cardTitle} />\n {isLoading ? (\n <LoadingCard />\n ) : (\n Block && <Block beatGuid={guid} payload={insights_payload} />\n )}\n\n <Stack sx={{ gap: 6, pb: 16, pt: 12, px: 16 }}>\n <P\n dangerouslySetInnerHTML={{\n __html: insights_payload.description.html_text,\n }}\n sx={{ fontWeight: 'fontWeightRegular' }}\n variant=\"subtitle2\"\n />\n {/* V2: the envelope's link opens the action block it names. */}\n {envelopeLink && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() =>\n insightsV2Store.openActionDrawer({ guid, trigger: 'inDescriptionCta' })\n }\n sx={TEXT_LINK_SX}\n >\n {envelopeLink.label}\n </Button>\n )}\n {/* The card's action with no primary CTA button, never a drawer: mini hands its tap to\n the host (`cardClick`); a full card's block-less link bubbles to the host's card handler. */}\n {showActionLink && (\n <Button\n onClick={isMini ? handleMiniActionClick : undefined}\n sx={MINI_CTA_SX}\n variant=\"text\"\n >\n {actionLabel}\n </Button>\n )}\n {/* Custom-copy link when the envelope sends none; legacy mini shows it too, so no mini guard. */}\n {!inDescriptionCta?.label && clientConfiguredLabel && (\n <Button\n endIcon={<ChevronRight />}\n onClick={onClientConfiguredLinkClick}\n sx={TEXT_LINK_SX}\n >\n {clientConfiguredLabel}\n </Button>\n )}\n </Stack>\n\n {showCtaRow && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n {isCtaButton && primary_cta && primaryPresentation?.kind === 'status' && (\n <CtaStatus\n action={primaryPresentation.action}\n sx={primaryPresentation.sx}\n icon={primaryPresentation.icon}\n label={primaryPresentation.label}\n tone={primaryPresentation.tone}\n />\n )}\n {isCtaButton && primary_cta && !primaryPresentation && (\n <Button\n aria-disabled={isCtaDisabled(primary_cta.block) || primaryCtaState.disabled}\n disabled={primaryCtaState.disabled}\n onClick={() => onCtaClick('primary', primary_cta)}\n sx={{\n ...(isCtaDisabled(primary_cta.block) && { color: 'text.disabled' }),\n }}\n variant=\"outlined\"\n >\n {primary_cta.label}\n </Button>\n )}\n {/* Mini has room for one CTA. */}\n {showSecondaryCta && secondary_cta && (\n <Button\n aria-disabled={\n isCtaDisabled(secondary_cta.block) || secondaryCtaState.disabled\n }\n color=\"inherit\"\n disabled={secondaryCtaState.disabled}\n onClick={() => onCtaClick('secondary', secondary_cta)}\n sx={{\n ...SECONDARY_CTA_SX,\n ...(isCtaDisabled(secondary_cta.block) && { color: 'text.disabled' }),\n }}\n >\n {secondary_cta.label}\n </Button>\n )}\n </Stack>\n )}\n\n <FeedbackBar onTellUsMore={flow.openRatingSurvey} show={flow.isFeedbackBarShown} />\n </Card>\n </>\n )}\n\n <ActionBlockLayer beat={beat} />\n\n <DismissInsightDialog\n isOpen={flow.isDismissOpen}\n onClose={flow.closeDismissDialog}\n onDismiss={flow.confirmDismiss}\n />\n\n {flow.isSurveyOpen && (\n <FeedbackDialog\n characterLimitLabel={flow.survey.characterLimitLabel}\n closeAriaLabel={flow.survey.closeAriaLabel}\n isOpen={true}\n onBackClick={flow.feedbackDialogCallbacks.onBackClick}\n onClose={flow.closeSurvey}\n onSubmit={flow.submitSurvey}\n onTextInputFocus={flow.feedbackDialogCallbacks.onTextInputFocus}\n options={flow.survey.options}\n primaryText={flow.survey.submitText}\n secondaryText={flow.survey.backText}\n title={flow.survey.title}\n />\n )}\n\n {flow.cardState === 'visible' && insights_payload.footer && (\n <Footer footer={insights_payload.footer} />\n )}\n </Stack>\n </BeatActionsProvider>\n )\n },\n)\n\nexport default BaseLayout\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,IAAM,KAA+B,CAAC,GAEhC,KAAsB;AAAA,EAC1B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,SAAS;AAAA,EAET,QAAQ;AACV,GAOM,IAAe;AAAA,EACnB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,UAAU;AAAA,EACV,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,WAAW;AACb,GAGM,KAAc;AAAA,EAClB,GAAG;AAAA,EACH,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,eAAe;AACjB,GAOM,KAAmB;AAAA,EACvB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,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,GAAmB,GAC1B,IAAkB,GAAmB,GACrC,EAAE,QAAA,EAAA,IAAW,GAAa,GAC1B,IAAO,GAAoB,GAAM,CAAW,GAE5C,IAAS,GAAe,GACxB,EACJ,QAAQ,GACR,SAAS,GACT,WAAW,GACX,kBAAA,EAAA,IACE,GACF,GACA,GACA,EAAK,kBAAkB,aACvB,EAA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AK,KAAK,EAAE,OAAO,gBAAgB;AAAA,kBACrE;AAAA,kBAEC,UAAA,EAAc;AAAA,gBACT,CAAA;AAAA,cAEL;AAAA;YAGT,gBAAA,EAAC,IAAD;AAAA,cAAa,cAAc,EAAK;AAAA,cAAkB,MAAM,EAAK;AAAA,YAAqB,CAAA;AAAA,UAC9E;AAAA,QACN,CAAA,CAAA,EAAA,CAAA;AAAA,QAGJ,gBAAA,EAAC,IAAD,EAAwB,MAAA,EAAO,CAAA;AAAA,QAE/B,gBAAA,EAAC,IAAD;AAAA,UACE,QAAQ,EAAK;AAAA,UACb,SAAS,EAAK;AAAA,UACd,WAAW,EAAK;AAAA,QACjB,CAAA;AAAA,QAEA,EAAK,gBACJ,gBAAA,EAAC,IAAD;AAAA,UACE,qBAAqB,EAAK,OAAO;AAAA,UACjC,gBAAgB,EAAK,OAAO;AAAA,UAC5B,QAAQ;AAAA,UACR,aAAa,EAAK,wBAAwB;AAAA,UAC1C,SAAS,EAAK;AAAA,UACd,UAAU,EAAK;AAAA,UACf,kBAAkB,EAAK,wBAAwB;AAAA,UAC/C,SAAS,EAAK,OAAO;AAAA,UACrB,aAAa,EAAK,OAAO;AAAA,UACzB,eAAe,EAAK,OAAO;AAAA,UAC3B,OAAO,EAAK,OAAO;AAAA,QACpB,CAAA;AAAA,QAGF,EAAK,cAAc,aAAa,EAAiB,UAChD,gBAAA,EAAC,IAAD,EAAQ,QAAQ,EAAiB,OAAS,CAAA;AAAA,MAEvC;AAAA;EACY,CAAA;AAEzB,CACF"}
@@ -15,5 +15,7 @@ export declare const HOST_ACTIONS: {
15
15
  readonly spendingPlanItemDelete: "spendingPlanItem.delete";
16
16
  /** Set Up Direct Deposit: the host fetches the Atomic SDK token and runs the flow. */
17
17
  readonly atomicTransact: "atomicTransact";
18
+ /** A mini link's tap, handled by the host as a card tap. */
19
+ readonly cardClick: "cardClick";
18
20
  };
19
21
  export type HostActionName = (typeof HOST_ACTIONS)[keyof typeof HOST_ACTIONS];
@@ -8,7 +8,8 @@ var e = {
8
8
  spendingPlanItemCreate: "spendingPlanItem.create",
9
9
  spendingPlanItemEdit: "spendingPlanItem.edit",
10
10
  spendingPlanItemDelete: "spendingPlanItem.delete",
11
- atomicTransact: "atomicTransact"
11
+ atomicTransact: "atomicTransact",
12
+ cardClick: "cardClick"
12
13
  };
13
14
  export {
14
15
  e as HOST_ACTIONS
@@ -1 +1 @@
1
- {"version":3,"file":"hostActions.es.js","names":[],"sources":["../../../src/insights-v2/ctaActions/hostActions.ts"],"sourcesContent":["/**\n * Host-owned effects requested via `beatActions.onCtaAction`. Contract with pulse\n * (`HOST_CTA_ACTIONS` in `src/hooks/useBeatActions.js`): add names on both sides together.\n */\nexport const HOST_ACTIONS = {\n /** First primary click (`cta_clicked_at`); fired by the runner, not by steps. */\n markCtaClicked: 'markCtaClicked',\n dismissBeat: 'dismissBeat',\n updateBeat: 'updateBeat',\n readBeatSummary: 'readBeatSummary',\n sendBeatFeedback: 'sendBeatFeedback',\n disableBeatTemplate: 'disableBeatTemplate',\n spendingPlanItemCreate: 'spendingPlanItem.create',\n spendingPlanItemEdit: 'spendingPlanItem.edit',\n spendingPlanItemDelete: 'spendingPlanItem.delete',\n /** Set Up Direct Deposit: the host fetches the Atomic SDK token and runs the flow. */\n atomicTransact: 'atomicTransact',\n} as const\n\nexport type HostActionName = (typeof HOST_ACTIONS)[keyof typeof HOST_ACTIONS]\n"],"mappings":"AAIA,IAAa,IAAe;AAAA,EAE1B,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,wBAAwB;AAAA,EACxB,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EAExB,gBAAgB;AAClB"}
1
+ {"version":3,"file":"hostActions.es.js","names":[],"sources":["../../../src/insights-v2/ctaActions/hostActions.ts"],"sourcesContent":["/**\n * Host-owned effects requested via `beatActions.onCtaAction`. Contract with pulse\n * (`HOST_CTA_ACTIONS` in `src/hooks/useBeatActions.js`): add names on both sides together.\n */\nexport const HOST_ACTIONS = {\n /** First primary click (`cta_clicked_at`); fired by the runner, not by steps. */\n markCtaClicked: 'markCtaClicked',\n dismissBeat: 'dismissBeat',\n updateBeat: 'updateBeat',\n readBeatSummary: 'readBeatSummary',\n sendBeatFeedback: 'sendBeatFeedback',\n disableBeatTemplate: 'disableBeatTemplate',\n spendingPlanItemCreate: 'spendingPlanItem.create',\n spendingPlanItemEdit: 'spendingPlanItem.edit',\n spendingPlanItemDelete: 'spendingPlanItem.delete',\n /** Set Up Direct Deposit: the host fetches the Atomic SDK token and runs the flow. */\n atomicTransact: 'atomicTransact',\n /** A mini link's tap, handled by the host as a card tap. */\n cardClick: 'cardClick',\n} as const\n\nexport type HostActionName = (typeof HOST_ACTIONS)[keyof typeof HOST_ACTIONS]\n"],"mappings":"AAIA,IAAa,IAAe;AAAA,EAE1B,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,wBAAwB;AAAA,EACxB,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EAExB,gBAAgB;AAAA,EAEhB,WAAW;AACb"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "9.7.83",
3
+ "version": "9.7.85",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",