@cuemath/leap 2.9.8-as1 → 2.9.8-as3

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.
@@ -0,0 +1,157 @@
1
+ import { jsxs as c, jsx as n } from "react/jsx-runtime";
2
+ import { memo as V, useState as p, useRef as G, useMemo as M, useCallback as l, useEffect as a } from "react";
3
+ import Q from "../../../assets/line-icons/icons/chevron-left.js";
4
+ import X from "../../../assets/line-icons/icons/chevron-right.js";
5
+ import d from "../../ui/layout/flex-view.js";
6
+ import $ from "../../ui/text/text.js";
7
+ import F from "../homework-card.js";
8
+ import { ContentWrapper as O, ScrollButton as g, ScrollContainer as P, QueueWrapper as Y, QueueText as q } from "./hw-card-list-styled.js";
9
+ const z = ({
10
+ userType: h,
11
+ studentId: v,
12
+ isHwProcessing: C,
13
+ hwDetails: e,
14
+ onTestStart: L,
15
+ onNodeAttempt: _,
16
+ onTestPreview: b,
17
+ onNodeView: k,
18
+ onTestReview: x,
19
+ onNodeReview: A,
20
+ onNodeUnassign: H
21
+ }) => {
22
+ const [I, u] = p(!1), [R, m] = p(!1), o = G(null), E = M(
23
+ () => ((e == null ? void 0 : e.filter((r) => r.state === "WAIT_FOR_REVIEW")) || []).length,
24
+ [e]
25
+ ), t = l(() => {
26
+ if (o.current) {
27
+ const { scrollLeft: r, scrollWidth: i, clientWidth: s } = o.current;
28
+ r > 1 && u(!0), r < i - s - 1 && m(!0);
29
+ }
30
+ }, []), T = l(() => {
31
+ o.current && t();
32
+ }, [t]), y = l(() => {
33
+ u(!1), m(!1);
34
+ }, []), B = l(() => {
35
+ o.current && (o.current.scrollBy({ left: -200, behavior: "smooth" }), t());
36
+ }, [t]), S = l(() => {
37
+ o.current && (o.current.scrollBy({ left: 200, behavior: "smooth" }), t());
38
+ }, [t]);
39
+ return a(() => {
40
+ if (e && (e == null ? void 0 : e.length) > 3 && o.current) {
41
+ const { scrollLeft: r } = o.current;
42
+ r > 1 && u(!0);
43
+ }
44
+ }, [e]), a(() => {
45
+ const r = o.current;
46
+ if (r)
47
+ return r.addEventListener("scroll", t), () => {
48
+ r.removeEventListener("scroll", t);
49
+ };
50
+ }, [t]), e && e.length === 0 ? /* @__PURE__ */ c(d, { $flexRowGapX: 1, children: [
51
+ /* @__PURE__ */ c($, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
52
+ "Homework (",
53
+ e == null ? void 0 : e.length,
54
+ ")"
55
+ ] }),
56
+ /* @__PURE__ */ n($, { $renderAs: "ab2", $color: "BLACK_T_60", children: "No Homework assigned yet" })
57
+ ] }) : /* @__PURE__ */ c(O, { $flexRowGapX: 1, $disablePointerEvents: C, children: [
58
+ /* @__PURE__ */ c($, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
59
+ "Homework (",
60
+ E,
61
+ "/",
62
+ e == null ? void 0 : e.length,
63
+ ")"
64
+ ] }),
65
+ /* @__PURE__ */ c(
66
+ d,
67
+ {
68
+ $position: "relative",
69
+ onMouseEnter: T,
70
+ onMouseLeave: y,
71
+ children: [
72
+ /* @__PURE__ */ n(
73
+ g,
74
+ {
75
+ $position: "absolute",
76
+ $background: "BLACK_T_60",
77
+ $justifyContent: "center",
78
+ $alignItems: "center",
79
+ $height: "100%",
80
+ onClick: B,
81
+ $visible: I,
82
+ left: "0px",
83
+ right: "auto",
84
+ children: /* @__PURE__ */ n(Q, { width: 24, height: 24 })
85
+ }
86
+ ),
87
+ /* @__PURE__ */ n(P, { ref: o, children: /* @__PURE__ */ n(d, { $flexDirection: "row", $flexGapX: 1, children: e == null ? void 0 : e.map((r, i) => {
88
+ const {
89
+ node_id: s,
90
+ worksheet_id: W,
91
+ node_type: K,
92
+ title: j,
93
+ subtext: N
94
+ } = r, f = K === "DYNAMIC";
95
+ return /* @__PURE__ */ c(
96
+ d,
97
+ {
98
+ $flexDirection: "row",
99
+ $flexGapX: 1,
100
+ children: [
101
+ e.length > 10 && i === 10 && /* @__PURE__ */ n(
102
+ Y,
103
+ {
104
+ $background: "BLACK_4",
105
+ $justifyContent: "center",
106
+ $gutter: 4,
107
+ $gap: 8,
108
+ children: /* @__PURE__ */ n(q, { $renderAs: "ac3", $color: "WHITE", children: "In Queue" })
109
+ }
110
+ ),
111
+ /* @__PURE__ */ n(
112
+ F,
113
+ {
114
+ isInQueue: e.length > 10 && i > 9,
115
+ userType: h,
116
+ header: j,
117
+ subHeader: N || "",
118
+ nodeData: r,
119
+ renderAs: "homework",
120
+ studentId: v,
121
+ onNodeAttempt: f ? L : _,
122
+ shouldOpenOnRight: !0,
123
+ onNodeView: f ? b : k,
124
+ onNodeReview: f ? x : A,
125
+ onNodeUnassign: H
126
+ }
127
+ )
128
+ ]
129
+ },
130
+ `${W}_${s}_${i}`
131
+ );
132
+ }) }) }),
133
+ /* @__PURE__ */ n(
134
+ g,
135
+ {
136
+ $position: "absolute",
137
+ $width: "60px",
138
+ $height: "100%",
139
+ $background: "BLACK_T_60",
140
+ $justifyContent: "center",
141
+ $alignItems: "center",
142
+ onClick: S,
143
+ $visible: R,
144
+ left: "auto",
145
+ right: "0px",
146
+ children: /* @__PURE__ */ n(X, { width: 24, height: 24 })
147
+ }
148
+ )
149
+ ]
150
+ }
151
+ )
152
+ ] });
153
+ }, ne = V(z);
154
+ export {
155
+ ne as default
156
+ };
157
+ //# sourceMappingURL=hw-card-list-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hw-card-list-view.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list-view.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../../chapters-v2/comps/node-card/node-card-types';\nimport type { TUserTypes } from '../../ui/types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport ChevronLeftIcon from '../../../assets/line-icons/icons/chevron-left';\nimport ChevronRightIcon from '../../../assets/line-icons/icons/chevron-right';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport HomeworkCard from '../homework-card';\nimport * as Styled from './hw-card-list-styled';\n\ninterface IHwCardListView extends INodeCardCallbacks {\n userType: TUserTypes;\n studentId: string;\n isHwProcessing: boolean;\n hwDetails?: INodeDataProps[];\n onTestPreview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n onTestStart?: (sheetData: INodeDataProps, homeworkId?: string) => void;\n onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n}\n\nconst HwCardListView: FC<IHwCardListView> = ({\n userType,\n studentId,\n isHwProcessing,\n hwDetails,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n}) => {\n const [isLeftHovered, setIsLeftHovered] = useState(false);\n const [isRightHovered, setIsRightHovered] = useState(false);\n const scrollRef = useRef<HTMLDivElement>(null);\n\n const waitForReviewSheets = useMemo(\n () => (hwDetails?.filter(sheet => sheet.state === 'WAIT_FOR_REVIEW') || []).length,\n [hwDetails],\n );\n\n const updatedCanScroll = useCallback(() => {\n if (scrollRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = scrollRef.current;\n\n if (scrollLeft > 1) {\n setIsLeftHovered(true);\n }\n\n if (scrollLeft < scrollWidth - clientWidth - 1) {\n setIsRightHovered(true);\n }\n }\n }, []);\n const handleHoverEnter = useCallback(() => {\n if (!scrollRef.current) return;\n\n updatedCanScroll();\n }, [updatedCanScroll]);\n\n const handleHoverLeave = useCallback(() => {\n setIsLeftHovered(false);\n setIsRightHovered(false);\n }, []);\n\n const handleScrollLeft = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: -200, behavior: 'smooth' });\n updatedCanScroll();\n }\n }, [updatedCanScroll]);\n\n const handleScrollRight = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: 200, behavior: 'smooth' });\n updatedCanScroll();\n }\n }, [updatedCanScroll]);\n\n useEffect(() => {\n if (hwDetails && hwDetails?.length > 3 && scrollRef.current) {\n const { scrollLeft } = scrollRef.current;\n\n if (scrollLeft > 1) {\n setIsLeftHovered(true);\n }\n }\n }, [hwDetails]);\n\n useEffect(() => {\n const scrollElement = scrollRef.current;\n\n if (scrollElement) {\n scrollElement.addEventListener('scroll', updatedCanScroll);\n\n return () => {\n scrollElement.removeEventListener('scroll', updatedCanScroll);\n };\n }\n }, [updatedCanScroll]);\n\n if (hwDetails && hwDetails.length === 0) {\n return (\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({hwDetails?.length})\n </Text>\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_60\">\n No Homework assigned yet\n </Text>\n </FlexView>\n );\n }\n\n return (\n <Styled.ContentWrapper $flexRowGapX={1} $disablePointerEvents={isHwProcessing}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({waitForReviewSheets}/{hwDetails?.length})\n </Text>\n <FlexView\n $position=\"relative\"\n onMouseEnter={handleHoverEnter}\n onMouseLeave={handleHoverLeave}\n >\n <Styled.ScrollButton\n $position=\"absolute\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $height=\"100%\"\n onClick={handleScrollLeft}\n $visible={isLeftHovered}\n left=\"0px\"\n right=\"auto\"\n >\n <ChevronLeftIcon width={24} height={24} />\n </Styled.ScrollButton>\n\n <Styled.ScrollContainer ref={scrollRef}>\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n {hwDetails?.map((sheet, idx) => {\n const {\n node_id: nodeId,\n worksheet_id: worksheetId,\n node_type: nodeType,\n title,\n subtext,\n } = sheet;\n const isDynamicSheet = nodeType === 'DYNAMIC';\n\n return (\n <FlexView\n key={`${worksheetId}_${nodeId}_${idx}`}\n $flexDirection=\"row\"\n $flexGapX={1}\n >\n {hwDetails.length > 10 && idx === 10 && (\n <Styled.QueueWrapper\n $background=\"BLACK_4\"\n $justifyContent=\"center\"\n $gutter={4}\n $gap={8}\n >\n <Styled.QueueText $renderAs=\"ac3\" $color=\"WHITE\">\n In Queue\n </Styled.QueueText>\n </Styled.QueueWrapper>\n )}\n <HomeworkCard\n isInQueue={hwDetails.length > 10 && idx > 9}\n userType={userType}\n header={title}\n subHeader={subtext || ''}\n nodeData={sheet}\n renderAs=\"homework\"\n studentId={studentId}\n onNodeAttempt={isDynamicSheet ? onTestStart : onNodeAttempt}\n shouldOpenOnRight={true}\n onNodeView={isDynamicSheet ? onTestPreview : onNodeView}\n onNodeReview={isDynamicSheet ? onTestReview : onNodeReview}\n onNodeUnassign={onNodeUnassign}\n />\n </FlexView>\n );\n })}\n </FlexView>\n </Styled.ScrollContainer>\n <Styled.ScrollButton\n $position=\"absolute\"\n $width=\"60px\"\n $height=\"100%\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n onClick={handleScrollRight}\n $visible={isRightHovered}\n left=\"auto\"\n right=\"0px\"\n >\n <ChevronRightIcon width={24} height={24} />\n </Styled.ScrollButton>\n </FlexView>\n </Styled.ContentWrapper>\n );\n};\n\nexport default memo(HwCardListView);\n"],"names":["HwCardListView","userType","studentId","isHwProcessing","hwDetails","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","isLeftHovered","setIsLeftHovered","useState","isRightHovered","setIsRightHovered","scrollRef","useRef","waitForReviewSheets","useMemo","sheet","updatedCanScroll","useCallback","scrollLeft","scrollWidth","clientWidth","handleHoverEnter","handleHoverLeave","handleScrollLeft","handleScrollRight","useEffect","scrollElement","jsxs","FlexView","Text","Styled.ContentWrapper","jsx","Styled.ScrollButton","ChevronLeftIcon","Styled.ScrollContainer","idx","nodeId","worksheetId","nodeType","title","subtext","isDynamicSheet","Styled.QueueWrapper","Styled.QueueText","HomeworkCard","ChevronRightIcon","HwCardListView$1","memo"],"mappings":";;;;;;;;AA0BA,MAAMA,IAAsC,CAAC;AAAA,EAC3C,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,gBAAAC;AAA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AGgC,CAAW,IAAID,CAAM,IAAID,CAAG;AAAA,YAAA;AAAA,UA8BtC,IAGN,EACF,CAAA;AAAA,UACA,gBAAAJ;AAAA,YAACC;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,QAAO;AAAA,cACP,SAAQ;AAAA,cACR,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,aAAY;AAAA,cACZ,SAASR;AAAA,cACT,UAAUf;AAAA,cACV,MAAK;AAAA,cACL,OAAM;AAAA,cAEN,UAAC,gBAAAsB,EAAAc,GAAA,EAAiB,OAAO,IAAI,QAAQ,IAAI;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ,GAEeC,KAAAC,EAAKrD,CAAc;"}
@@ -1,191 +1,67 @@
1
- import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
- import { memo as q, useRef as z, useState as H, useEffect as f, useCallback as s, useMemo as U } from "react";
3
- import Z from "../../../assets/line-icons/icons/chevron-left.js";
4
- import J from "../../../assets/line-icons/icons/chevron-right.js";
5
- import { useJourney as D } from "../../journey/use-journey/use-journey.js";
6
- import h from "../../ui/layout/flex-view.js";
7
- import C from "../../ui/text/text.js";
8
- import ee from "../homework-card.js";
9
- import { useGetHomeworks as re } from "./api/get-homeworks.js";
10
- import { ContentWrapper as oe, ScrollButton as x, ScrollContainer as te, QueueWrapper as ne, QueueText as ie } from "./hw-card-list-styled.js";
11
- const le = ({
12
- userType: a,
1
+ import { jsx as h } from "react/jsx-runtime";
2
+ import { memo as b, useEffect as e, useCallback as j } from "react";
3
+ import { useJourney as A } from "../../journey/use-journey/use-journey.js";
4
+ import { useGetHomeworks as D } from "./api/get-homeworks.js";
5
+ import E from "./hw-card-list-view.js";
6
+ const F = ({
7
+ userType: r,
13
8
  studentId: i,
14
- stream: d,
15
- onTestStart: R,
16
- onNodeAttempt: w,
17
- onTestPreview: E,
18
- onNodeView: B,
19
- onTestReview: W,
20
- onNodeReview: I,
21
- onNodeUnassign: S,
22
- homeworkRef: T,
23
- individualHomeworkRef: y,
24
- startHomePageJourney: $,
25
- canStartJourney: k
9
+ stream: o,
10
+ onTestStart: k,
11
+ onNodeAttempt: p,
12
+ onTestPreview: C,
13
+ onNodeView: H,
14
+ onTestReview: a,
15
+ onNodeReview: g,
16
+ onNodeUnassign: v,
17
+ homeworkRef: L,
18
+ startHomePageJourney: c,
19
+ canStartJourney: m
26
20
  }) => {
27
- const o = z(null), [K, m] = H(!1), [j, L] = H(!1), {
28
- get: _,
29
- data: e,
30
- isProcessingFailed: G,
31
- isProcessing: p,
32
- isStale: b
33
- } = re(i), { isJourneyActive: A } = D();
34
- f(() => {
35
- e != null && e.length && $ && !A && k && $({ hwDetails: e, studentId: i, stream: d, userType: a });
21
+ const {
22
+ get: l,
23
+ data: x,
24
+ isProcessingFailed: P,
25
+ isProcessing: f,
26
+ isProcessed: w,
27
+ isStale: t
28
+ } = D(i), { isJourneyActive: n } = A();
29
+ e(() => {
30
+ w && c && !n && m && c({ studentId: i, stream: o, userType: r });
36
31
  }, [
37
- k,
38
- e,
39
- A,
40
- $,
41
- d,
32
+ m,
33
+ n,
34
+ w,
35
+ c,
36
+ o,
42
37
  i,
43
- a
38
+ r
44
39
  ]);
45
- const n = s(() => {
46
- if (o.current) {
47
- const { scrollLeft: r, scrollWidth: l, clientWidth: g } = o.current;
48
- r > 1 && m(!0), r < l - g - 1 && L(!0);
40
+ const s = j(() => {
41
+ l(i, void 0, { stream: o });
42
+ }, [l, o, i]);
43
+ return e(() => {
44
+ !f && t && s();
45
+ }, [s, f, t]), e(() => {
46
+ s();
47
+ }, [s]), P ? null : /* @__PURE__ */ h("div", { ref: L, children: /* @__PURE__ */ h(
48
+ E,
49
+ {
50
+ isHwProcessing: f,
51
+ hwDetails: x,
52
+ onTestStart: k,
53
+ onNodeAttempt: p,
54
+ onTestPreview: C,
55
+ onNodeView: H,
56
+ onTestReview: a,
57
+ onNodeReview: g,
58
+ onNodeUnassign: v,
59
+ userType: r,
60
+ studentId: i
49
61
  }
50
- }, []), N = s(() => {
51
- o.current && (o.current.scrollBy({ left: -200, behavior: "smooth" }), n());
52
- }, [n]), F = s(() => {
53
- o.current && (o.current.scrollBy({ left: 200, behavior: "smooth" }), n());
54
- }, [n]), M = s(() => {
55
- o.current && n();
56
- }, [n]), Q = s(() => {
57
- m(!1), L(!1);
58
- }, []);
59
- f(() => {
60
- const r = o.current;
61
- if (r)
62
- return r.addEventListener("scroll", n), () => {
63
- r.removeEventListener("scroll", n);
64
- };
65
- }, [n]), f(() => {
66
- if (e && (e == null ? void 0 : e.length) > 3 && o.current) {
67
- const { scrollLeft: r } = o.current;
68
- r > 1 && m(!0);
69
- }
70
- }, [e]);
71
- const u = s(() => {
72
- _(i, void 0, { stream: d });
73
- }, [_, d, i]);
74
- f(() => {
75
- !p && b && u();
76
- }, [u, p, b]), f(() => {
77
- u();
78
- }, [u]);
79
- const X = U(
80
- () => ((e == null ? void 0 : e.filter((r) => r.state === "WAIT_FOR_REVIEW")) || []).length,
81
- [e]
82
- );
83
- return e && e.length === 0 ? /* @__PURE__ */ c(h, { $flexRowGapX: 1, children: [
84
- /* @__PURE__ */ c(C, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
85
- "Homework (",
86
- e == null ? void 0 : e.length,
87
- ")"
88
- ] }),
89
- /* @__PURE__ */ t(C, { $renderAs: "ab2", $color: "BLACK_T_60", children: "No Homework assigned yet" })
90
- ] }) : G ? null : /* @__PURE__ */ c(oe, { ref: T, $flexRowGapX: 1, $disablePointerEvents: p, children: [
91
- /* @__PURE__ */ c(C, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
92
- "Homework (",
93
- X,
94
- "/",
95
- e == null ? void 0 : e.length,
96
- ")"
97
- ] }),
98
- /* @__PURE__ */ c(
99
- h,
100
- {
101
- $position: "relative",
102
- onMouseEnter: M,
103
- onMouseLeave: Q,
104
- children: [
105
- /* @__PURE__ */ t(
106
- x,
107
- {
108
- $position: "absolute",
109
- $background: "BLACK_T_60",
110
- $justifyContent: "center",
111
- $alignItems: "center",
112
- $height: "100%",
113
- onClick: N,
114
- $visible: K,
115
- left: "0px",
116
- right: "auto",
117
- children: /* @__PURE__ */ t(Z, { width: 24, height: 24 })
118
- }
119
- ),
120
- /* @__PURE__ */ t(te, { ref: o, children: /* @__PURE__ */ t(h, { $flexDirection: "row", $flexGapX: 1, children: e == null ? void 0 : e.map((r, l) => {
121
- const {
122
- node_id: g,
123
- worksheet_id: O,
124
- node_type: V,
125
- title: P,
126
- subtext: Y
127
- } = r, v = V === "DYNAMIC";
128
- return /* @__PURE__ */ c(
129
- h,
130
- {
131
- ref: l === 0 ? y : void 0,
132
- $flexDirection: "row",
133
- $flexGapX: 1,
134
- children: [
135
- e.length > 10 && l === 10 && /* @__PURE__ */ t(
136
- ne,
137
- {
138
- $background: "BLACK_4",
139
- $justifyContent: "center",
140
- $gutter: 4,
141
- $gap: 8,
142
- children: /* @__PURE__ */ t(ie, { $renderAs: "ac3", $color: "WHITE", children: "In Queue" })
143
- }
144
- ),
145
- /* @__PURE__ */ t(
146
- ee,
147
- {
148
- isInQueue: e.length > 10 && l > 9,
149
- userType: a,
150
- header: P,
151
- subHeader: Y || "",
152
- nodeData: r,
153
- renderAs: "homework",
154
- studentId: i,
155
- onNodeAttempt: v ? R : w,
156
- shouldOpenOnRight: !0,
157
- onNodeView: v ? E : B,
158
- onNodeReview: v ? W : I,
159
- onNodeUnassign: S
160
- }
161
- )
162
- ]
163
- },
164
- `${O}_${g}_${l}`
165
- );
166
- }) }) }),
167
- /* @__PURE__ */ t(
168
- x,
169
- {
170
- $position: "absolute",
171
- $width: "60px",
172
- $height: "100%",
173
- $background: "BLACK_T_60",
174
- $justifyContent: "center",
175
- $alignItems: "center",
176
- onClick: F,
177
- $visible: j,
178
- left: "auto",
179
- right: "0px",
180
- children: /* @__PURE__ */ t(J, { width: 24, height: 24 })
181
- }
182
- )
183
- ]
184
- }
185
- )
186
- ] });
187
- }, ge = q(le);
62
+ ) });
63
+ }, u = b(F);
188
64
  export {
189
- ge as default
65
+ u as default
190
66
  };
191
67
  //# sourceMappingURL=hw-card-list.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hw-card-list.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../../chapters-v2/comps/node-card/node-card-types';\nimport type { IHomepageStartJourneyProps } from '../../journey/types/homepage-journey-types';\nimport type { TUserTypes } from '../../ui/types';\n\nimport React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport ChevronLeftIcon from '../../../assets/line-icons/icons/chevron-left';\nimport ChevronRightIcon from '../../../assets/line-icons/icons/chevron-right';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport HomeworkCard from '../homework-card';\nimport { useGetHomeworks } from './api/get-homeworks';\nimport * as Styled from './hw-card-list-styled';\n\ninterface HWCardListProps extends INodeCardCallbacks {\n userType: TUserTypes;\n studentId: string;\n stream: string;\n onTestPreview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n onTestStart?: (sheetData: INodeDataProps, homeworkId?: string) => void;\n onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n homeworkRef?: React.RefObject<HTMLDivElement>;\n individualHomeworkRef?: React.RefObject<HTMLDivElement>;\n startHomePageJourney?: ({\n hwDetails,\n studentId,\n stream,\n userType,\n }: IHomepageStartJourneyProps) => void;\n canStartJourney?: boolean;\n}\n\nconst HWCardList: React.FC<HWCardListProps> = ({\n userType,\n studentId,\n stream,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n homeworkRef,\n individualHomeworkRef,\n startHomePageJourney,\n canStartJourney,\n}) => {\n const scrollRef = useRef<HTMLDivElement>(null);\n const [isLeftHovered, setIsLeftHovered] = useState(false);\n const [isRightHovered, setIsRightHovered] = useState(false);\n const {\n get: getHomeworks,\n data: hwDetails,\n isProcessingFailed,\n isProcessing,\n isStale,\n } = useGetHomeworks(studentId);\n const { isJourneyActive } = useJourney();\n\n useEffect(() => {\n if (hwDetails?.length && startHomePageJourney && !isJourneyActive && canStartJourney) {\n startHomePageJourney({ hwDetails, studentId, stream, userType });\n }\n }, [\n canStartJourney,\n hwDetails,\n isJourneyActive,\n startHomePageJourney,\n stream,\n studentId,\n userType,\n ]);\n\n const updatedCanScroll = useCallback(() => {\n if (scrollRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = scrollRef.current;\n\n if (scrollLeft > 1) {\n setIsLeftHovered(true);\n }\n\n if (scrollLeft < scrollWidth - clientWidth - 1) {\n setIsRightHovered(true);\n }\n }\n }, []);\n\n const handleScrollLeft = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: -200, behavior: 'smooth' });\n updatedCanScroll();\n }\n }, [updatedCanScroll]);\n\n const handleScrollRight = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: 200, behavior: 'smooth' });\n updatedCanScroll();\n }\n }, [updatedCanScroll]);\n\n const handleHoverEnter = useCallback(() => {\n if (!scrollRef.current) return;\n\n updatedCanScroll();\n }, [updatedCanScroll]);\n\n const handleHoverLeave = useCallback(() => {\n setIsLeftHovered(false);\n setIsRightHovered(false);\n }, []);\n\n useEffect(() => {\n const scrollElement = scrollRef.current;\n\n if (scrollElement) {\n scrollElement.addEventListener('scroll', updatedCanScroll);\n\n return () => {\n scrollElement.removeEventListener('scroll', updatedCanScroll);\n };\n }\n }, [updatedCanScroll]);\n\n useEffect(() => {\n if (hwDetails && hwDetails?.length > 3 && scrollRef.current) {\n const { scrollLeft } = scrollRef.current;\n\n if (scrollLeft > 1) {\n setIsLeftHovered(true);\n }\n }\n }, [hwDetails]);\n\n const fetchHomeworks = useCallback(() => {\n getHomeworks(studentId, undefined, { stream });\n }, [getHomeworks, stream, studentId]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchHomeworks();\n }\n }, [fetchHomeworks, isProcessing, isStale]);\n\n useEffect(() => {\n fetchHomeworks();\n }, [fetchHomeworks]);\n\n const waitForReviewSheets = useMemo(\n () => (hwDetails?.filter(sheet => sheet.state === 'WAIT_FOR_REVIEW') || []).length,\n [hwDetails],\n );\n\n if (hwDetails && hwDetails.length === 0) {\n return (\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({hwDetails?.length})\n </Text>\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_60\">\n No Homework assigned yet\n </Text>\n </FlexView>\n );\n }\n\n if (isProcessingFailed) {\n return null;\n }\n\n return (\n <Styled.ContentWrapper ref={homeworkRef} $flexRowGapX={1} $disablePointerEvents={isProcessing}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({waitForReviewSheets}/{hwDetails?.length})\n </Text>\n <FlexView\n $position=\"relative\"\n onMouseEnter={handleHoverEnter}\n onMouseLeave={handleHoverLeave}\n >\n <Styled.ScrollButton\n $position=\"absolute\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $height=\"100%\"\n onClick={handleScrollLeft}\n $visible={isLeftHovered}\n left=\"0px\"\n right=\"auto\"\n >\n <ChevronLeftIcon width={24} height={24} />\n </Styled.ScrollButton>\n\n <Styled.ScrollContainer ref={scrollRef}>\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n {hwDetails?.map((sheet, idx) => {\n const {\n node_id: nodeId,\n worksheet_id: worksheetId,\n node_type: nodeType,\n title,\n subtext,\n } = sheet;\n const isDynamicSheet = nodeType === 'DYNAMIC';\n\n return (\n <FlexView\n ref={idx === 0 ? individualHomeworkRef : undefined}\n key={`${worksheetId}_${nodeId}_${idx}`}\n $flexDirection=\"row\"\n $flexGapX={1}\n >\n {hwDetails.length > 10 && idx === 10 && (\n <Styled.QueueWrapper\n $background=\"BLACK_4\"\n $justifyContent=\"center\"\n $gutter={4}\n $gap={8}\n >\n <Styled.QueueText $renderAs=\"ac3\" $color=\"WHITE\">\n In Queue\n </Styled.QueueText>\n </Styled.QueueWrapper>\n )}\n <HomeworkCard\n isInQueue={hwDetails.length > 10 && idx > 9}\n userType={userType}\n header={title}\n subHeader={subtext || ''}\n nodeData={sheet}\n renderAs=\"homework\"\n studentId={studentId}\n onNodeAttempt={isDynamicSheet ? onTestStart : onNodeAttempt}\n shouldOpenOnRight={true}\n onNodeView={isDynamicSheet ? onTestPreview : onNodeView}\n onNodeReview={isDynamicSheet ? onTestReview : onNodeReview}\n onNodeUnassign={onNodeUnassign}\n />\n </FlexView>\n );\n })}\n </FlexView>\n </Styled.ScrollContainer>\n <Styled.ScrollButton\n $position=\"absolute\"\n $width=\"60px\"\n $height=\"100%\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n onClick={handleScrollRight}\n $visible={isRightHovered}\n left=\"auto\"\n right=\"0px\"\n >\n <ChevronRightIcon width={24} height={24} />\n </Styled.ScrollButton>\n </FlexView>\n </Styled.ContentWrapper>\n );\n};\n\nexport default memo(HWCardList);\n"],"names":["HWCardList","userType","studentId","stream","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","homeworkRef","individualHomeworkRef","startHomePageJourney","canStartJourney","scrollRef","useRef","isLeftHovered","setIsLeftHovered","useState","isRightHovered","setIsRightHovered","getHomeworks","hwDetails","isProcessingFailed","isProcessing","isStale","useGetHomeworks","isJourneyActive","useJourney","useEffect","updatedCanScroll","useCallback","scrollLeft","scrollWidth","clientWidth","handleScrollLeft","handleScrollRight","handleHoverEnter","handleHoverLeave","scrollElement","fetchHomeworks","waitForReviewSheets","useMemo","sheet","jsxs","FlexView","Text","Styled.ContentWrapper","jsx","Styled.ScrollButton","ChevronLeftIcon","Styled.ScrollContainer","idx","nodeId","worksheetId","nodeType","title","subtext","isDynamicSheet","Styled.QueueWrapper","Styled.QueueText","HomeworkCard","ChevronRightIcon","HWCardList$1","memo"],"mappings":";;;;;;;;;;AAoCA,MAAMA,KAAwC,CAAC;AAAA,EAC7C,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,iBAAAC;AACF,MAAM;AACE,QAAAC,IAAYC,EAAuB,IAAI,GACvC,CAACC,GAAeC,CAAgB,IAAIC,EAAS,EAAK,GAClD,CAACC,GAAgBC,CAAiB,IAAIF,EAAS,EAAK,GACpD;AAAA,IACJ,KAAKG;AAAA,IACL,MAAMC;AAAA,IACN,oBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,IACEC,GAAgBzB,CAAS,GACvB,EAAE,iBAAA0B,MAAoBC;AAE5B,EAAAC,EAAU,MAAM;AACd,IAAIP,KAAA,QAAAA,EAAW,UAAUV,KAAwB,CAACe,KAAmBd,KACnED,EAAqB,EAAE,WAAAU,GAAW,WAAArB,GAAW,QAAAC,GAAQ,UAAAF,EAAU,CAAA;AAAA,EACjE,GACC;AAAA,IACDa;AAAA,IACAS;AAAA,IACAK;AAAA,IACAf;AAAA,IACAV;AAAA,IACAD;AAAA,IACAD;AAAA,EAAA,CACD;AAEK,QAAA8B,IAAmBC,EAAY,MAAM;AACzC,QAAIjB,EAAU,SAAS;AACrB,YAAM,EAAE,YAAAkB,GAAY,aAAAC,GAAa,aAAAC,EAAA,IAAgBpB,EAAU;AAE3D,MAAIkB,IAAa,KACff,EAAiB,EAAI,GAGnBe,IAAaC,IAAcC,IAAc,KAC3Cd,EAAkB,EAAI;AAAA,IAE1B;AAAA,EACF,GAAG,CAA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AA;AAAA,cACC,WAAU;AAAA,cACV,QAAO;AAAA,cACP,SAAQ;AAAA,cACR,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,aAAY;AAAA,cACZ,SAASb;AAAA,cACT,UAAUjB;AAAA,cACV,MAAK;AAAA,cACL,OAAM;AAAA,cAEN,UAAC,gBAAA6B,EAAAc,GAAA,EAAiB,OAAO,IAAI,QAAQ,IAAI;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ,GAEeC,KAAAC,EAAKjE,EAAU;"}
1
+ {"version":3,"file":"hw-card-list.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../../chapters-v2/comps/node-card/node-card-types';\nimport type { IHomepageStartJourneyProps } from '../../journey/types/homepage-journey-types';\nimport type { TUserTypes } from '../../ui/types';\n\nimport React, { memo, useCallback, useEffect } from 'react';\n\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport { useGetHomeworks } from './api/get-homeworks';\nimport HwCardListView from './hw-card-list-view';\n\ninterface HWCardListProps extends INodeCardCallbacks {\n userType: TUserTypes;\n studentId: string;\n stream: string;\n onTestPreview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n onTestStart?: (sheetData: INodeDataProps, homeworkId?: string) => void;\n onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n homeworkRef?: React.RefObject<HTMLDivElement>;\n startHomePageJourney?: ({ studentId, stream, userType }: IHomepageStartJourneyProps) => void;\n canStartJourney?: boolean;\n}\n\nconst HWCardList: React.FC<HWCardListProps> = ({\n userType,\n studentId,\n stream,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n homeworkRef,\n startHomePageJourney,\n canStartJourney,\n}) => {\n const {\n get: getHomeworks,\n data: hwDetails,\n isProcessingFailed,\n isProcessing,\n isProcessed,\n isStale,\n } = useGetHomeworks(studentId);\n const { isJourneyActive } = useJourney();\n\n useEffect(() => {\n if (isProcessed && startHomePageJourney && !isJourneyActive && canStartJourney) {\n startHomePageJourney({ studentId, stream, userType });\n }\n }, [\n canStartJourney,\n isJourneyActive,\n isProcessed,\n startHomePageJourney,\n stream,\n studentId,\n userType,\n ]);\n\n const fetchHomeworks = useCallback(() => {\n getHomeworks(studentId, undefined, { stream });\n }, [getHomeworks, stream, studentId]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchHomeworks();\n }\n }, [fetchHomeworks, isProcessing, isStale]);\n\n useEffect(() => {\n fetchHomeworks();\n }, [fetchHomeworks]);\n\n if (isProcessingFailed) {\n return null;\n }\n\n return (\n <div ref={homeworkRef}>\n <HwCardListView\n isHwProcessing={isProcessing}\n hwDetails={hwDetails}\n onTestStart={onTestStart}\n onNodeAttempt={onNodeAttempt}\n onTestPreview={onTestPreview}\n onNodeView={onNodeView}\n onTestReview={onTestReview}\n onNodeReview={onNodeReview}\n onNodeUnassign={onNodeUnassign}\n userType={userType}\n studentId={studentId}\n />\n </div>\n );\n};\n\nexport default memo(HWCardList);\n"],"names":["HWCardList","userType","studentId","stream","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","homeworkRef","startHomePageJourney","canStartJourney","getHomeworks","hwDetails","isProcessingFailed","isProcessing","isProcessed","isStale","useGetHomeworks","isJourneyActive","useJourney","useEffect","fetchHomeworks","useCallback","jsx","HwCardListView","hwCardList","memo"],"mappings":";;;;;AAyBA,MAAMA,IAAwC,CAAC;AAAA,EAC7C,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,iBAAAC;AACF,MAAM;AACE,QAAA;AAAA,IACJ,KAAKC;AAAA,IACL,MAAMC;AAAA,IACN,oBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,IACEC,EAAgBlB,CAAS,GACvB,EAAE,iBAAAmB,MAAoBC;AAE5B,EAAAC,EAAU,MAAM;AACd,IAAIL,KAAeN,KAAwB,CAACS,KAAmBR,KAC7DD,EAAqB,EAAE,WAAAV,GAAW,QAAAC,GAAQ,UAAAF,EAAU,CAAA;AAAA,EACtD,GACC;AAAA,IACDY;AAAA,IACAQ;AAAA,IACAH;AAAA,IACAN;AAAA,IACAT;AAAA,IACAD;AAAA,IACAD;AAAA,EAAA,CACD;AAEK,QAAAuB,IAAiBC,EAAY,MAAM;AACvC,IAAAX,EAAaZ,GAAW,QAAW,EAAE,QAAAC,EAAQ,CAAA;AAAA,EAC5C,GAAA,CAACW,GAAcX,GAAQD,CAAS,CAAC;AAYpC,SAVAqB,EAAU,MAAM;AACV,IAAA,CAACN,KAAgBE,KACJK;EAEhB,GAAA,CAACA,GAAgBP,GAAcE,CAAO,CAAC,GAE1CI,EAAU,MAAM;AACC,IAAAC;EAAA,GACd,CAACA,CAAc,CAAC,GAEfR,IACK,OAIP,gBAAAU,EAAC,OAAI,EAAA,KAAKf,GACR,UAAA,gBAAAe;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,gBAAgBV;AAAA,MAChB,WAAAF;AAAA,MACA,aAAAX;AAAA,MACA,eAAAC;AAAA,MACA,eAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,UAAAT;AAAA,MACA,WAAAC;AAAA,IAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEe0B,IAAAC,EAAK7B,CAAU;"}
@@ -1,24 +1,35 @@
1
1
  import e from "styled-components";
2
- import r from "../../../ui/layout/flex-view.js";
3
- const d = e(r)`
4
- top: ${({ $top: t }) => t}px;
5
- left: ${({ $left: t }) => t}px;
6
- `, a = e(r)(({ theme: t }) => {
7
- const { gutter: o } = t.layout;
2
+ import n from "../../../ui/layout/flex-view.js";
3
+ const d = e(n)`
4
+ top: ${({ $top: r }) => r}px;
5
+ left: ${({ $left: r }) => r}px;
6
+ `, i = e(n)(({ theme: r }) => {
7
+ const { gutter: t } = r.layout;
8
8
  return `
9
9
  width: 100%;
10
- padding: ${o * 0.75}px ${o * 0.5}px;
10
+ padding: ${t * 0.75}px ${t * 0.5}px;
11
11
  `;
12
- }), i = e.div`
12
+ }), s = e.div`
13
13
  pointer-events: none;
14
14
  width: 720px;
15
15
  overflow: hidden;
16
16
  padding: 30px;
17
17
  background-color: transparent;
18
- `;
18
+ `, c = e.div(({ theme: r }) => {
19
+ const { WHITE_5: t, WHITE_2: p } = r.colors;
20
+ return `
21
+ display: grid;
22
+ grid-template-columns: repeat(4, 1fr);
23
+ align-content: start;
24
+ background: ${p};
25
+ background-image: linear-gradient(${t} 0.5px, transparent 0.5px), linear-gradient(90deg, ${t} 0.5px, transparent 0.5px);
26
+ background-size: 45px 45px;
27
+ `;
28
+ });
19
29
  export {
30
+ c as ChaptersWrapper,
20
31
  d as ClonedElementWrapper,
21
- a as CoachmarkBody,
22
- i as ELementWrapper
32
+ i as CoachmarkBody,
33
+ s as ELementWrapper
23
34
  };
24
35
  //# sourceMappingURL=coachmark-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"coachmark-styled.js","sources":["../../../../../src/features/journey/comps/coachmark/coachmark-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nexport const ClonedElementWrapper = styled(FlexView)<{\n $top: number;\n $left: number;\n}>`\n top: ${({ $top }) => $top}px;\n left: ${({ $left }) => $left}px;\n`;\n\nexport const CoachmarkBody = styled(FlexView)(({ theme }) => {\n const { gutter } = theme.layout;\n\n return `\n width: 100%;\n padding: ${gutter * 0.75}px ${gutter * 0.5}px;\n `;\n});\n\nexport const ELementWrapper = styled.div`\n pointer-events: none;\n width: 720px;\n overflow: hidden;\n padding: 30px;\n background-color: transparent;\n`;\n"],"names":["ClonedElementWrapper","styled","FlexView","$top","$left","CoachmarkBody","theme","gutter","ELementWrapper"],"mappings":";;AAIa,MAAAA,IAAuBC,EAAOC,CAAQ;AAAA,SAI1C,CAAC,EAAE,MAAAC,EAAK,MAAMA,CAAI;AAAA,UACjB,CAAC,EAAE,OAAAC,EAAM,MAAMA,CAAK;AAAA,GAGjBC,IAAgBJ,EAAOC,CAAQ,EAAE,CAAC,EAAE,OAAAI,QAAY;AACrD,QAAA,EAAE,QAAAC,EAAO,IAAID,EAAM;AAElB,SAAA;AAAA;AAAA,eAEMC,IAAS,IAAI,MAAMA,IAAS,GAAG;AAAA;AAE9C,CAAC,GAEYC,IAAiBP,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
1
+ {"version":3,"file":"coachmark-styled.js","sources":["../../../../../src/features/journey/comps/coachmark/coachmark-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nexport const ClonedElementWrapper = styled(FlexView)<{\n $top: number;\n $left: number;\n}>`\n top: ${({ $top }) => $top}px;\n left: ${({ $left }) => $left}px;\n`;\n\nexport const CoachmarkBody = styled(FlexView)(({ theme }) => {\n const { gutter } = theme.layout;\n\n return `\n width: 100%;\n padding: ${gutter * 0.75}px ${gutter * 0.5}px;\n `;\n});\n\nexport const ELementWrapper = styled.div`\n pointer-events: none;\n width: 720px;\n overflow: hidden;\n padding: 30px;\n background-color: transparent;\n`;\n\nexport const ChaptersWrapper = styled.div(({ theme }) => {\n const { WHITE_5, WHITE_2 } = theme.colors;\n\n return `\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n align-content: start;\n background: ${WHITE_2};\n background-image: linear-gradient(${WHITE_5} 0.5px, transparent 0.5px), linear-gradient(90deg, ${WHITE_5} 0.5px, transparent 0.5px);\n background-size: 45px 45px;\n `;\n});\n"],"names":["ClonedElementWrapper","styled","FlexView","$top","$left","CoachmarkBody","theme","gutter","ELementWrapper","ChaptersWrapper","WHITE_5","WHITE_2"],"mappings":";;AAIa,MAAAA,IAAuBC,EAAOC,CAAQ;AAAA,SAI1C,CAAC,EAAE,MAAAC,EAAK,MAAMA,CAAI;AAAA,UACjB,CAAC,EAAE,OAAAC,EAAM,MAAMA,CAAK;AAAA,GAGjBC,IAAgBJ,EAAOC,CAAQ,EAAE,CAAC,EAAE,OAAAI,QAAY;AACrD,QAAA,EAAE,QAAAC,EAAO,IAAID,EAAM;AAElB,SAAA;AAAA;AAAA,eAEMC,IAAS,IAAI,MAAMA,IAAS,GAAG;AAAA;AAE9C,CAAC,GAEYC,IAAiBP,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQxBQ,IAAkBR,EAAO,IAAI,CAAC,EAAE,OAAAK,QAAY;AACvD,QAAM,EAAE,SAAAI,GAAS,SAAAC,MAAYL,EAAM;AAE5B,SAAA;AAAA;AAAA;AAAA;AAAA,kBAISK,CAAO;AAAA,wCACeD,CAAO,sDAAsDA,CAAO;AAAA;AAAA;AAG5G,CAAC;"}