@cuemath/leap 3.5.17-as3 → 3.5.17-as4
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/dist/features/timeline/comps/accordion-item/accordian-item-styled.js +13 -9
- package/dist/features/timeline/comps/accordion-item/accordian-item-styled.js.map +1 -1
- package/dist/features/timeline/comps/accordion-item/accordion-item.js +34 -33
- package/dist/features/timeline/comps/accordion-item/accordion-item.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import
|
|
1
|
+
import d from "styled-components";
|
|
2
2
|
import c from "../../../ui/text/text.js";
|
|
3
|
-
import { ClickableWrapper as
|
|
4
|
-
const p =
|
|
5
|
-
const { textButton:
|
|
3
|
+
import { ClickableWrapper as x } from "../../../ui/buttons/clickable/clickable-styled.js";
|
|
4
|
+
const p = d(c)(({ theme: t, $buttonSize: n, $isParent: o }) => {
|
|
5
|
+
const { textButton: r } = t, { underlineHeight: e, underlineOffset: i } = r.sizes[n];
|
|
6
6
|
return `
|
|
7
7
|
text-decoration: underline;
|
|
8
|
-
text-decoration-thickness: ${
|
|
9
|
-
text-underline-offset: ${
|
|
8
|
+
text-decoration-thickness: ${e}px;
|
|
9
|
+
text-underline-offset: ${i}px;
|
|
10
10
|
|
|
11
11
|
&:active {
|
|
12
12
|
text-decoration: underline;
|
|
13
|
-
text-decoration-thickness: ${
|
|
13
|
+
text-decoration-thickness: ${e}px;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
&:hover {
|
|
17
|
+
text-decoration: ${o ? "underline" : "none"};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
${x}[aria-disabled='true'] & {
|
|
17
21
|
text-decoration: underline;
|
|
18
|
-
text-decoration-thickness: ${
|
|
22
|
+
text-decoration-thickness: ${e}px;
|
|
19
23
|
opacity: 0.5;
|
|
20
24
|
}
|
|
21
25
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordian-item-styled.js","sources":["../../../../../src/features/timeline/comps/accordion-item/accordian-item-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport UIText from '../../../ui/text/text';\nimport { type ITextButtonProps } from '../../../ui/buttons/text-button/text-button-types';\nimport { ClickableWrapper } from '../../../ui/buttons/clickable/clickable-styled';\n\ninterface IStyledTextProps {\n $buttonSize: NonNullable<ITextButtonProps['size']>;\n}\n\nexport const Text = styled(UIText)<IStyledTextProps>(({ theme, $buttonSize }) => {\n const { textButton } = theme;\n const { underlineHeight, underlineOffset } = textButton.sizes[$buttonSize];\n\n return `\n text-decoration: underline;\n text-decoration-thickness: ${underlineHeight}px;\n text-underline-offset: ${underlineOffset}px;\n\n &:active {\n text-decoration: underline;\n text-decoration-thickness: ${underlineHeight}px;\n }\n\n ${ClickableWrapper}[aria-disabled='true'] & {\n text-decoration: underline;\n text-decoration-thickness: ${underlineHeight}px;\n opacity: 0.5;\n }\n `;\n});\n"],"names":["Text","styled","UIText","theme","$buttonSize","textButton","underlineHeight","underlineOffset","ClickableWrapper"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"accordian-item-styled.js","sources":["../../../../../src/features/timeline/comps/accordion-item/accordian-item-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport UIText from '../../../ui/text/text';\nimport { type ITextButtonProps } from '../../../ui/buttons/text-button/text-button-types';\nimport { ClickableWrapper } from '../../../ui/buttons/clickable/clickable-styled';\n\ninterface IStyledTextProps {\n $buttonSize: NonNullable<ITextButtonProps['size']>;\n $isParent: boolean;\n}\n\nexport const Text = styled(UIText)<IStyledTextProps>(({ theme, $buttonSize, $isParent }) => {\n const { textButton } = theme;\n const { underlineHeight, underlineOffset } = textButton.sizes[$buttonSize];\n\n return `\n text-decoration: underline;\n text-decoration-thickness: ${underlineHeight}px;\n text-underline-offset: ${underlineOffset}px;\n\n &:active {\n text-decoration: underline;\n text-decoration-thickness: ${underlineHeight}px;\n }\n\n &:hover {\n text-decoration: ${$isParent ? 'underline' : 'none'};\n }\n\n ${ClickableWrapper}[aria-disabled='true'] & {\n text-decoration: underline;\n text-decoration-thickness: ${underlineHeight}px;\n opacity: 0.5;\n }\n `;\n});\n"],"names":["Text","styled","UIText","theme","$buttonSize","$isParent","textButton","underlineHeight","underlineOffset","ClickableWrapper"],"mappings":";;;AAWa,MAAAA,IAAOC,EAAOC,CAAM,EAAoB,CAAC,EAAE,OAAAC,GAAO,aAAAC,GAAa,WAAAC,QAAgB;AACpF,QAAA,EAAE,YAAAC,EAAe,IAAAH,GACjB,EAAE,iBAAAI,GAAiB,iBAAAC,EAAA,IAAoBF,EAAW,MAAMF,CAAW;AAElE,SAAA;AAAA;AAAA,iCAEwBG,CAAe;AAAA,6BACnBC,CAAe;AAAA;AAAA;AAAA;AAAA,mCAITD,CAAe;AAAA;AAAA;AAAA;AAAA,yBAIzBF,IAAY,cAAc,MAAM;AAAA;AAAA;AAAA,MAGnDI,CAAgB;AAAA;AAAA,mCAEaF,CAAe;AAAA;AAAA;AAAA;AAIlD,CAAC;"}
|
|
@@ -1,70 +1,71 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { useTheme as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { memo as I, useMemo as N, useCallback as A } from "react";
|
|
3
|
+
import { useTheme as g } from "styled-components";
|
|
4
|
+
import z from "../../../ui/buttons/text-button/text-button.js";
|
|
5
|
+
import l from "../../../ui/layout/flex-view.js";
|
|
6
6
|
import c from "../../../ui/text/text.js";
|
|
7
|
-
import { getStateConf as
|
|
7
|
+
import { getStateConf as K } from "../utils.js";
|
|
8
8
|
import { BLOCK_TYPE as k } from "../../../chapters-v2/constants/block-constants.js";
|
|
9
|
-
import { CODING_ACTIVITY_NODE_TYPES as
|
|
10
|
-
import { NODE_STATE as
|
|
9
|
+
import { CODING_ACTIVITY_NODE_TYPES as P } from "../constants.js";
|
|
10
|
+
import { NODE_STATE as O, CARD_TYPE as V, USER_TYPE as t } from "../../daily-timeline-types.js";
|
|
11
11
|
import { NODE_TYPES as Y } from "../../../../types/models/worksheet.js";
|
|
12
12
|
import v from "../../../ui/buttons/clickable/clickable.js";
|
|
13
13
|
import { Text as G } from "./accordian-item-styled.js";
|
|
14
|
-
const M =
|
|
14
|
+
const M = I(
|
|
15
15
|
({ type: T, userType: o, card: d, onPuzzleClick: n, onReviewClick: m }) => {
|
|
16
|
-
const { textButton:
|
|
17
|
-
label:
|
|
18
|
-
title:
|
|
19
|
-
state:
|
|
16
|
+
const { textButton: C } = g(), {
|
|
17
|
+
label: b,
|
|
18
|
+
title: h,
|
|
19
|
+
state: $,
|
|
20
20
|
subtext: a,
|
|
21
21
|
user_node_id: _,
|
|
22
|
-
block_type:
|
|
23
|
-
user_block_id:
|
|
22
|
+
block_type: p,
|
|
23
|
+
user_block_id: u,
|
|
24
24
|
node_type: f
|
|
25
|
-
} = d, s =
|
|
25
|
+
} = d, s = p === k.SAT_MOCK_TEST, x = f === Y.PUZZLE_CARD, [E, w, B] = K($), r = $ === O.COMPLETED, L = N(() => T === V.CIRCLE ? !1 : o === t.TEACHER ? !s || r : o === t.STUDENT ? r && !P.includes(
|
|
26
26
|
f
|
|
27
|
-
) : !1, [o, T, s, r, f]),
|
|
27
|
+
) : !1, [o, T, s, r, f]), R = r && (o === t.STUDENT || o === t.PARENT) || o === t.TEACHER, S = A(() => {
|
|
28
28
|
n == null || n(d);
|
|
29
|
-
}, [n, d]),
|
|
30
|
-
m && _ && m(_, s,
|
|
31
|
-
}, [s, m,
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */ e(
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
29
|
+
}, [n, d]), D = A(() => {
|
|
30
|
+
m && _ && m(_, s, u);
|
|
31
|
+
}, [s, m, u, _]);
|
|
32
|
+
return /* @__PURE__ */ i(l, { $flexDirection: "row", $flexGapX: 1.5, children: [
|
|
33
|
+
/* @__PURE__ */ e(l, { $justifyContent: "flex-end", $height: 18, $background: "WHITE", children: /* @__PURE__ */ e(l, { $background: w, $borderColor: "BLACK_1", $borderRadiusX: 0.8, children: E && /* @__PURE__ */ e(E, { width: 14, height: 14, color: B }) }) }),
|
|
34
|
+
/* @__PURE__ */ i(l, { $flexRowGapX: 0.25, children: [
|
|
35
|
+
/* @__PURE__ */ i(c, { $renderAs: "ub2", $color: "BLACK_1", children: [
|
|
36
|
+
/* @__PURE__ */ i(c, { $renderAs: "ub2-bold", $inline: !0, $color: "BLACK_1", children: [
|
|
37
|
+
b,
|
|
38
38
|
":"
|
|
39
39
|
] }),
|
|
40
40
|
" ",
|
|
41
|
-
|
|
41
|
+
h
|
|
42
42
|
] }),
|
|
43
|
-
x ?
|
|
43
|
+
x ? R ? /* @__PURE__ */ e(
|
|
44
44
|
v,
|
|
45
45
|
{
|
|
46
46
|
label: r ? "View reviewed puzzle" : "View assigned puzzle",
|
|
47
|
-
onClick:
|
|
47
|
+
onClick: S,
|
|
48
48
|
analyticsLabel: "puzzle_click",
|
|
49
49
|
children: /* @__PURE__ */ e(
|
|
50
50
|
G,
|
|
51
51
|
{
|
|
52
52
|
$color: "BLACK_T_60",
|
|
53
|
-
$renderAs:
|
|
53
|
+
$renderAs: C.sizes.small.textVariant,
|
|
54
54
|
$buttonSize: "small",
|
|
55
|
+
$isParent: o === t.PARENT,
|
|
55
56
|
children: r ? "View reviewed puzzle" : "View assigned puzzle"
|
|
56
57
|
}
|
|
57
58
|
)
|
|
58
59
|
}
|
|
59
|
-
) : /* @__PURE__ */ e(c, { $renderAs: "ub3", $color: "BLACK_T_60", children: a }) : /* @__PURE__ */
|
|
60
|
+
) : /* @__PURE__ */ e(c, { $renderAs: "ub3", $color: "BLACK_T_60", children: a }) : /* @__PURE__ */ i(l, { $flexDirection: "row", $flexGapX: 0.75, $alignItems: "center", children: [
|
|
60
61
|
a && /* @__PURE__ */ e(c, { $renderAs: "ub3", $color: "BLACK_T_60", children: a }),
|
|
61
62
|
L && /* @__PURE__ */ e(
|
|
62
|
-
|
|
63
|
+
z,
|
|
63
64
|
{
|
|
64
65
|
label: "Review",
|
|
65
66
|
size: "small",
|
|
66
67
|
color: "BLACK_T_60",
|
|
67
|
-
onClick:
|
|
68
|
+
onClick: D
|
|
68
69
|
}
|
|
69
70
|
)
|
|
70
71
|
] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion-item.js","sources":["../../../../../src/features/timeline/comps/accordion-item/accordion-item.tsx"],"sourcesContent":["import { memo, useCallback, useMemo, type FC } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport type { IAccordionItemProps } from './accordion-item-types';\nimport { getStateConf } from '../utils';\nimport { BLOCK_TYPE } from '../../../chapters-v2/constants/block-constants';\nimport { type TColorNames } from '../../../ui/types';\nimport { CODING_ACTIVITY_NODE_TYPES } from '../constants';\nimport { CARD_TYPE, NODE_STATE, USER_TYPE } from '../../daily-timeline-types';\nimport { NODE_TYPES } from '../../../../types/models/worksheet';\nimport Clickable from '../../../ui/buttons/clickable/clickable';\nimport * as Styled from './accordian-item-styled';\n\nconst AccordionItem: FC<IAccordionItemProps> = memo(\n ({ type, userType, card, onPuzzleClick, onReviewClick }) => {\n const { textButton } = useTheme();\n\n const {\n label,\n title,\n state,\n subtext,\n user_node_id: userNodeId,\n block_type: blockType,\n user_block_id: userBlockId,\n node_type: nodeType,\n } = card;\n const isSatMockTestBlock = blockType === BLOCK_TYPE.SAT_MOCK_TEST;\n const isPuzzleCard = nodeType === NODE_TYPES.PUZZLE_CARD;\n const [Icon, bgColor, color] = getStateConf(state) as [\n FC<React.SVGProps<SVGSVGElement>>,\n TColorNames,\n TColorNames,\n ];\n const isCompleted = state === NODE_STATE.COMPLETED;\n const shouldShowReview = useMemo(() => {\n if (type === CARD_TYPE.CIRCLE) return false;\n\n if (userType === USER_TYPE.TEACHER) return !isSatMockTestBlock || isCompleted;\n\n if (userType === USER_TYPE.STUDENT)\n return (\n isCompleted &&\n !CODING_ACTIVITY_NODE_TYPES.includes(\n nodeType as (typeof CODING_ACTIVITY_NODE_TYPES)[number],\n )\n );\n\n return false;\n }, [userType, type, isSatMockTestBlock, isCompleted, nodeType]);\n\n const canReviewPuzzle =\n (isCompleted && (userType === USER_TYPE.STUDENT || userType === USER_TYPE.PARENT)) ||\n userType === USER_TYPE.TEACHER;\n\n const handlePuzzleClick = useCallback(() => {\n onPuzzleClick?.(card);\n }, [onPuzzleClick, card]);\n\n const handleReviewClick = useCallback(() => {\n if (onReviewClick && userNodeId) {\n onReviewClick(userNodeId, isSatMockTestBlock, userBlockId);\n }\n }, [isSatMockTestBlock, onReviewClick, userBlockId, userNodeId]);\n\n return (\n <FlexView $flexDirection=\"row\" $flexGapX={1.5}>\n <FlexView $justifyContent=\"flex-end\" $height={18} $background=\"WHITE\">\n <FlexView $background={bgColor} $borderColor=\"BLACK_1\" $borderRadiusX={0.8}>\n {Icon && <Icon width={14} height={14} color={color} />}\n </FlexView>\n </FlexView>\n <FlexView $flexRowGapX={0.25}>\n <Text $renderAs=\"ub2\" $color=\"BLACK_1\">\n <Text $renderAs=\"ub2-bold\" $inline $color=\"BLACK_1\">\n {label}:\n </Text>{' '}\n {title}\n </Text>\n {isPuzzleCard ? (\n canReviewPuzzle ? (\n <Clickable\n label={isCompleted ? 'View reviewed puzzle' : 'View assigned puzzle'}\n onClick={handlePuzzleClick}\n analyticsLabel=\"puzzle_click\"\n >\n <Styled.Text\n $color=\"BLACK_T_60\"\n $renderAs={textButton.sizes['small'].textVariant}\n $buttonSize=\"small\"\n >\n {isCompleted ? 'View reviewed puzzle' : 'View assigned puzzle'}\n </Styled.Text>\n </Clickable>\n ) : (\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subtext}\n </Text>\n )\n ) : (\n <FlexView $flexDirection=\"row\" $flexGapX={0.75} $alignItems=\"center\">\n {subtext && (\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subtext}\n </Text>\n )}\n {shouldShowReview && (\n <TextButton\n label=\"Review\"\n size=\"small\"\n color=\"BLACK_T_60\"\n onClick={handleReviewClick}\n />\n )}\n </FlexView>\n )}\n </FlexView>\n </FlexView>\n );\n },\n);\n\nAccordionItem.displayName = 'AccordionItem';\n\nexport default AccordionItem;\n"],"names":["AccordionItem","memo","type","userType","card","onPuzzleClick","onReviewClick","textButton","useTheme","label","title","state","subtext","userNodeId","blockType","userBlockId","nodeType","isSatMockTestBlock","BLOCK_TYPE","isPuzzleCard","NODE_TYPES","Icon","bgColor","color","getStateConf","isCompleted","NODE_STATE","shouldShowReview","useMemo","CARD_TYPE","USER_TYPE","CODING_ACTIVITY_NODE_TYPES","canReviewPuzzle","handlePuzzleClick","useCallback","handleReviewClick","jsxs","FlexView","jsx","Text","Clickable","Styled.Text","TextButton"],"mappings":";;;;;;;;;;;;;AAgBA,MAAMA,IAAyCC;AAAA,EAC7C,CAAC,EAAE,MAAAC,GAAM,UAAAC,GAAU,MAAAC,GAAM,eAAAC,GAAe,eAAAC,QAAoB;AACpD,UAAA,EAAE,YAAAC,MAAeC,KAEjB;AAAA,MACJ,OAAAC;AAAA,MACA,OAAAC;AAAA,MACA,OAAAC;AAAA,MACA,SAAAC;AAAA,MACA,cAAcC;AAAA,MACd,YAAYC;AAAA,MACZ,eAAeC;AAAA,MACf,WAAWC;AAAA,IACT,IAAAZ,GACEa,IAAqBH,MAAcI,EAAW,eAC9CC,IAAeH,MAAaI,EAAW,aACvC,CAACC,GAAMC,GAASC,CAAK,IAAIC,EAAab,CAAK,GAK3Cc,IAAcd,MAAUe,EAAW,WACnCC,IAAmBC,EAAQ,MAC3B1B,MAAS2B,EAAU,SAAe,KAElC1B,MAAa2B,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AAAA,YACT,gBAAe;AAAA,YAEf,UAAA,gBAAAK;AAAA,cAACG;AAAAA,cAAA;AAAA,gBACC,QAAO;AAAA,gBACP,WAAWlC,EAAW,MAAM,MAAS;AAAA,gBACrC,aAAY;AAAA,
|
|
1
|
+
{"version":3,"file":"accordion-item.js","sources":["../../../../../src/features/timeline/comps/accordion-item/accordion-item.tsx"],"sourcesContent":["import { memo, useCallback, useMemo, type FC } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport type { IAccordionItemProps } from './accordion-item-types';\nimport { getStateConf } from '../utils';\nimport { BLOCK_TYPE } from '../../../chapters-v2/constants/block-constants';\nimport { type TColorNames } from '../../../ui/types';\nimport { CODING_ACTIVITY_NODE_TYPES } from '../constants';\nimport { CARD_TYPE, NODE_STATE, USER_TYPE } from '../../daily-timeline-types';\nimport { NODE_TYPES } from '../../../../types/models/worksheet';\nimport Clickable from '../../../ui/buttons/clickable/clickable';\nimport * as Styled from './accordian-item-styled';\n\nconst AccordionItem: FC<IAccordionItemProps> = memo(\n ({ type, userType, card, onPuzzleClick, onReviewClick }) => {\n const { textButton } = useTheme();\n\n const {\n label,\n title,\n state,\n subtext,\n user_node_id: userNodeId,\n block_type: blockType,\n user_block_id: userBlockId,\n node_type: nodeType,\n } = card;\n const isSatMockTestBlock = blockType === BLOCK_TYPE.SAT_MOCK_TEST;\n const isPuzzleCard = nodeType === NODE_TYPES.PUZZLE_CARD;\n const [Icon, bgColor, color] = getStateConf(state) as [\n FC<React.SVGProps<SVGSVGElement>>,\n TColorNames,\n TColorNames,\n ];\n const isCompleted = state === NODE_STATE.COMPLETED;\n const shouldShowReview = useMemo(() => {\n if (type === CARD_TYPE.CIRCLE) return false;\n\n if (userType === USER_TYPE.TEACHER) return !isSatMockTestBlock || isCompleted;\n\n if (userType === USER_TYPE.STUDENT)\n return (\n isCompleted &&\n !CODING_ACTIVITY_NODE_TYPES.includes(\n nodeType as (typeof CODING_ACTIVITY_NODE_TYPES)[number],\n )\n );\n\n return false;\n }, [userType, type, isSatMockTestBlock, isCompleted, nodeType]);\n\n const canReviewPuzzle =\n (isCompleted && (userType === USER_TYPE.STUDENT || userType === USER_TYPE.PARENT)) ||\n userType === USER_TYPE.TEACHER;\n\n const handlePuzzleClick = useCallback(() => {\n onPuzzleClick?.(card);\n }, [onPuzzleClick, card]);\n\n const handleReviewClick = useCallback(() => {\n if (onReviewClick && userNodeId) {\n onReviewClick(userNodeId, isSatMockTestBlock, userBlockId);\n }\n }, [isSatMockTestBlock, onReviewClick, userBlockId, userNodeId]);\n\n return (\n <FlexView $flexDirection=\"row\" $flexGapX={1.5}>\n <FlexView $justifyContent=\"flex-end\" $height={18} $background=\"WHITE\">\n <FlexView $background={bgColor} $borderColor=\"BLACK_1\" $borderRadiusX={0.8}>\n {Icon && <Icon width={14} height={14} color={color} />}\n </FlexView>\n </FlexView>\n <FlexView $flexRowGapX={0.25}>\n <Text $renderAs=\"ub2\" $color=\"BLACK_1\">\n <Text $renderAs=\"ub2-bold\" $inline $color=\"BLACK_1\">\n {label}:\n </Text>{' '}\n {title}\n </Text>\n {isPuzzleCard ? (\n canReviewPuzzle ? (\n <Clickable\n label={isCompleted ? 'View reviewed puzzle' : 'View assigned puzzle'}\n onClick={handlePuzzleClick}\n analyticsLabel=\"puzzle_click\"\n >\n <Styled.Text\n $color=\"BLACK_T_60\"\n $renderAs={textButton.sizes['small'].textVariant}\n $buttonSize=\"small\"\n $isParent={userType === USER_TYPE.PARENT}\n >\n {isCompleted ? 'View reviewed puzzle' : 'View assigned puzzle'}\n </Styled.Text>\n </Clickable>\n ) : (\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subtext}\n </Text>\n )\n ) : (\n <FlexView $flexDirection=\"row\" $flexGapX={0.75} $alignItems=\"center\">\n {subtext && (\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subtext}\n </Text>\n )}\n {shouldShowReview && (\n <TextButton\n label=\"Review\"\n size=\"small\"\n color=\"BLACK_T_60\"\n onClick={handleReviewClick}\n />\n )}\n </FlexView>\n )}\n </FlexView>\n </FlexView>\n );\n },\n);\n\nAccordionItem.displayName = 'AccordionItem';\n\nexport default AccordionItem;\n"],"names":["AccordionItem","memo","type","userType","card","onPuzzleClick","onReviewClick","textButton","useTheme","label","title","state","subtext","userNodeId","blockType","userBlockId","nodeType","isSatMockTestBlock","BLOCK_TYPE","isPuzzleCard","NODE_TYPES","Icon","bgColor","color","getStateConf","isCompleted","NODE_STATE","shouldShowReview","useMemo","CARD_TYPE","USER_TYPE","CODING_ACTIVITY_NODE_TYPES","canReviewPuzzle","handlePuzzleClick","useCallback","handleReviewClick","jsxs","FlexView","jsx","Text","Clickable","Styled.Text","TextButton"],"mappings":";;;;;;;;;;;;;AAgBA,MAAMA,IAAyCC;AAAA,EAC7C,CAAC,EAAE,MAAAC,GAAM,UAAAC,GAAU,MAAAC,GAAM,eAAAC,GAAe,eAAAC,QAAoB;AACpD,UAAA,EAAE,YAAAC,MAAeC,KAEjB;AAAA,MACJ,OAAAC;AAAA,MACA,OAAAC;AAAA,MACA,OAAAC;AAAA,MACA,SAAAC;AAAA,MACA,cAAcC;AAAA,MACd,YAAYC;AAAA,MACZ,eAAeC;AAAA,MACf,WAAWC;AAAA,IACT,IAAAZ,GACEa,IAAqBH,MAAcI,EAAW,eAC9CC,IAAeH,MAAaI,EAAW,aACvC,CAACC,GAAMC,GAASC,CAAK,IAAIC,EAAab,CAAK,GAK3Cc,IAAcd,MAAUe,EAAW,WACnCC,IAAmBC,EAAQ,MAC3B1B,MAAS2B,EAAU,SAAe,KAElC1B,MAAa2B,EAAU,UAAgB,CAACb,KAAsBQ,IAE9DtB,MAAa2B,EAAU,UAEvBL,KACA,CAACM,EAA2B;AAAA,MAC1Bf;AAAA,IAAA,IAIC,IACN,CAACb,GAAUD,GAAMe,GAAoBQ,GAAaT,CAA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