@cuemath/leap 3.5.50 → 3.5.51-as10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist/assets/illustrations/illustrations.js +4 -0
  2. package/dist/assets/illustrations/illustrations.js.map +1 -1
  3. package/dist/features/chapters-v2/comps/node-card/node-card-styled.js +27 -31
  4. package/dist/features/chapters-v2/comps/node-card/node-card-styled.js.map +1 -1
  5. package/dist/features/chapters-v2/comps/node-card/node-card-tags.js +21 -13
  6. package/dist/features/chapters-v2/comps/node-card/node-card-tags.js.map +1 -1
  7. package/dist/features/chapters-v2/constants/node-constants.js +1 -1
  8. package/dist/features/chapters-v2/constants/node-constants.js.map +1 -1
  9. package/dist/features/chapters-v2/utils/node-card-utils.js +86 -79
  10. package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
  11. package/dist/features/homework/homework-card-view.js +125 -98
  12. package/dist/features/homework/homework-card-view.js.map +1 -1
  13. package/dist/features/homework/homework-card.js +196 -161
  14. package/dist/features/homework/homework-card.js.map +1 -1
  15. package/dist/features/homework/hw-card-list/api/get-homeworks.js +1 -1
  16. package/dist/features/homework/hw-card-list/api/get-homeworks.js.map +1 -1
  17. package/dist/features/homework/hw-card-list/hw-card-list-types.js +5 -0
  18. package/dist/features/homework/hw-card-list/hw-card-list-types.js.map +1 -0
  19. package/dist/features/homework/hw-card-list/hw-card-list-view.js +96 -86
  20. package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
  21. package/dist/features/homework/hw-card-list/hw-card-list.js +45 -43
  22. package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
  23. package/dist/features/homework/styles.js +0 -1
  24. package/dist/features/homework/styles.js.map +1 -1
  25. package/dist/features/homework/utils.js +18 -15
  26. package/dist/features/homework/utils.js.map +1 -1
  27. package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js +325 -201
  28. package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js.map +1 -1
  29. package/dist/features/journey/hooks/use-home-page-journey/use-home-page-journey.js +59 -56
  30. package/dist/features/journey/hooks/use-home-page-journey/use-home-page-journey.js.map +1 -1
  31. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +17 -15
  32. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +1 -1
  33. package/dist/features/math-fit/api/get-mathfit-assessment.js +10 -0
  34. package/dist/features/math-fit/api/get-mathfit-assessment.js.map +1 -0
  35. package/dist/features/math-fit/math-fit/math-fit.js +37 -0
  36. package/dist/features/math-fit/math-fit/math-fit.js.map +1 -0
  37. package/dist/features/math-fit/math-fit-card/math-fit-card-styled.js +22 -0
  38. package/dist/features/math-fit/math-fit-card/math-fit-card-styled.js.map +1 -0
  39. package/dist/features/math-fit/math-fit-card/math-fit-card.js +80 -0
  40. package/dist/features/math-fit/math-fit-card/math-fit-card.js.map +1 -0
  41. package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card-styled.js +24 -0
  42. package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card-styled.js.map +1 -0
  43. package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card-types.js +5 -0
  44. package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card-types.js.map +1 -0
  45. package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card.js +99 -0
  46. package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card.js.map +1 -0
  47. package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item-styled.js +9 -0
  48. package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item-styled.js.map +1 -0
  49. package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item.js +26 -0
  50. package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item.js.map +1 -0
  51. package/dist/features/math-fit/math-fit-overview/math-fit-overview-helpers.js +63 -0
  52. package/dist/features/math-fit/math-fit-overview/math-fit-overview-helpers.js.map +1 -0
  53. package/dist/features/math-fit/math-fit-overview/math-fit-overview-styled.js +9 -0
  54. package/dist/features/math-fit/math-fit-overview/math-fit-overview-styled.js.map +1 -0
  55. package/dist/features/math-fit/math-fit-overview/math-fit-overview-types.js +7 -0
  56. package/dist/features/math-fit/math-fit-overview/math-fit-overview-types.js.map +1 -0
  57. package/dist/features/math-fit/math-fit-overview/math-fit-overview.js +71 -0
  58. package/dist/features/math-fit/math-fit-overview/math-fit-overview.js.map +1 -0
  59. package/dist/features/math-fit/math-fit-report/comps/report-header/report-header-styled.js +38 -0
  60. package/dist/features/math-fit/math-fit-report/comps/report-header/report-header-styled.js.map +1 -0
  61. package/dist/features/math-fit/math-fit-report/comps/report-header/report-header.js +58 -0
  62. package/dist/features/math-fit/math-fit-report/comps/report-header/report-header.js.map +1 -0
  63. package/dist/features/math-fit/math-fit-report/comps/score-badge/score-badge-styled.js +28 -0
  64. package/dist/features/math-fit/math-fit-report/comps/score-badge/score-badge-styled.js.map +1 -0
  65. package/dist/features/math-fit/math-fit-report/comps/score-badge/score-badge.js +30 -0
  66. package/dist/features/math-fit/math-fit-report/comps/score-badge/score-badge.js.map +1 -0
  67. package/dist/features/math-fit/math-fit-report/comps/score-section/score-section-styled.js +9 -0
  68. package/dist/features/math-fit/math-fit-report/comps/score-section/score-section-styled.js.map +1 -0
  69. package/dist/features/math-fit/math-fit-report/comps/score-section/score-section.js +82 -0
  70. package/dist/features/math-fit/math-fit-report/comps/score-section/score-section.js.map +1 -0
  71. package/dist/features/math-fit/math-fit-report/math-fit-report-helpers.js +42 -0
  72. package/dist/features/math-fit/math-fit-report/math-fit-report-helpers.js.map +1 -0
  73. package/dist/features/math-fit/math-fit-report/math-fit-report.js +68 -0
  74. package/dist/features/math-fit/math-fit-report/math-fit-report.js.map +1 -0
  75. package/dist/features/milestone/milestone-list-container/api/get-tests-list.js +1 -1
  76. package/dist/features/milestone/milestone-list-container/api/get-tests-list.js.map +1 -1
  77. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +38 -36
  78. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
  79. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js +57 -55
  80. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js.map +1 -1
  81. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js +59 -57
  82. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js.map +1 -1
  83. package/dist/features/milestone/milestone-list-container/milestone-list-container.js +54 -52
  84. package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
  85. package/dist/features/milestone/milestone-tests/test-list-v2/test-list-container.js +39 -37
  86. package/dist/features/milestone/milestone-tests/test-list-v2/test-list-container.js.map +1 -1
  87. package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js +48 -56
  88. package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js.map +1 -1
  89. package/dist/features/sheet-v2/resource-list/resource-list.js +27 -23
  90. package/dist/features/sheet-v2/resource-list/resource-list.js.map +1 -1
  91. package/dist/index.d.ts +132 -7
  92. package/dist/index.js +131 -121
  93. package/dist/index.js.map +1 -1
  94. package/dist/static/clock-green.020570d3.svg +1 -0
  95. package/dist/static/math-fit-bg.4bfa3244.svg +1 -0
  96. package/dist/static/math-fit-card-bg.20c826bb.svg +1 -0
  97. package/dist/static/question-mark-blue.b6a7f37d.svg +1 -0
  98. package/package.json +1 -1
@@ -1,125 +1,135 @@
1
1
  import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import { memo as T, useMemo as x, useCallback as j } from "react";
3
- import F from "../../../assets/line-icons/icons/chevron-left.js";
4
- import G from "../../../assets/line-icons/icons/chevron-right.js";
5
- import c from "../../ui/layout/flex-view.js";
6
- import u from "../../ui/text/text.js";
7
- import W from "../homework-card.js";
8
- import { QueueWrapper as X, QueueText as O, ContentWrapper as V, ScrollButton as H, ScrollContainer as N } from "./hw-card-list-styled.js";
9
- import { getWaitForReviewSheetsCount as Y } from "./hw-card-list-utils.js";
10
- import { NODE_TYPE as P } from "../../sheets/constants/sheet.js";
11
- import { useScrollButtons as Q } from "./hooks/use-scroll-buttons.js";
12
- const z = ({
13
- userType: m,
14
- studentId: h,
15
- isHwProcessing: b,
16
- hwDetails: t,
17
- onTestStart: $,
2
+ import { memo as X, useMemo as b, useCallback as F } from "react";
3
+ import O from "../../../assets/line-icons/icons/chevron-left.js";
4
+ import V from "../../../assets/line-icons/icons/chevron-right.js";
5
+ import { NODE_TYPE as Y } from "../../sheets/constants/sheet.js";
6
+ import a from "../../ui/layout/flex-view.js";
7
+ import m from "../../ui/text/text.js";
8
+ import N from "../homework-card.js";
9
+ import { QueueWrapper as P, QueueText as Q, ContentWrapper as z, ScrollButton as L, ScrollContainer as J } from "./hw-card-list-styled.js";
10
+ import { getWaitForReviewSheetsCount as Z } from "./hw-card-list-utils.js";
11
+ import { useScrollButtons as U } from "./hooks/use-scroll-buttons.js";
12
+ const D = ({
13
+ userType: h,
14
+ studentId: $,
15
+ isHwProcessing: y,
16
+ hwDetails: r,
17
+ onTestStart: p,
18
18
  onNodeAttempt: C,
19
19
  onTestPreview: f,
20
- onNodeView: p,
21
- onTestReview: g,
22
- onNodeReview: k,
23
- onNodeUnassign: w,
24
- puzzleHWCardRef: _
20
+ onNodeView: g,
21
+ onTestReview: k,
22
+ onNodeReview: w,
23
+ onNodeUnassign: _,
24
+ onMathFitClick: x,
25
+ puzzleHWCardRef: H
25
26
  }) => {
26
- const o = x(() => {
27
- const n = (t == null ? void 0 : t.assigned_homeworks) || [], i = (t == null ? void 0 : t.queued_homeworks) || [], r = n.length + i.length, s = Y(t);
27
+ const o = b(() => {
28
+ const s = (r == null ? void 0 : r.assigned_homeworks) || [], i = (r == null ? void 0 : r.queued_homeworks) || [], t = s.length + i.length, n = Z(r);
28
29
  return {
29
- assignedHomeworks: n,
30
+ assignedHomeworks: s,
30
31
  queuedHomeworks: i,
31
- totalCount: r,
32
- waitForReviewCount: s
32
+ totalCount: t,
33
+ waitForReviewCount: n
33
34
  };
34
- }, [t]), {
35
- scrollRef: L,
36
- showLeftButton: A,
37
- showRightButton: v,
38
- handleMouseEnter: B,
39
- handleMouseLeave: I,
40
- handleScrollLeft: R,
35
+ }, [r]), {
36
+ scrollRef: A,
37
+ showLeftButton: v,
38
+ showRightButton: B,
39
+ handleMouseEnter: I,
40
+ handleMouseLeave: R,
41
+ handleScrollLeft: T,
41
42
  handleScrollRight: q
42
- } = Q({
43
+ } = U({
43
44
  totalCount: o.totalCount
44
- }), a = j(
45
- (n, i, r = !1) => {
45
+ }), u = F(
46
+ (s, i, t = !1) => {
46
47
  const {
47
- node_id: s,
48
- worksheet_id: E,
49
- node_type: K,
50
- title: M,
51
- subtext: S
52
- } = n, d = K === P.DYNAMIC;
48
+ entity_id: n,
49
+ sheets: K,
50
+ subtext: S,
51
+ entity_type: j,
52
+ state: M,
53
+ score: G,
54
+ id: W
55
+ } = s, c = K[0], d = (c == null ? void 0 : c.node_type) === Y.DYNAMIC;
53
56
  return /* @__PURE__ */ l(
54
- c,
57
+ a,
55
58
  {
56
59
  $flexDirection: "row",
57
60
  $flexGapX: 1,
58
61
  children: [
59
- r && i === 0 && /* @__PURE__ */ e(
60
- X,
62
+ t && i === 0 && /* @__PURE__ */ e(
63
+ P,
61
64
  {
62
65
  $background: "BLACK_4",
63
66
  $justifyContent: "center",
64
67
  $gutter: 4,
65
68
  $gap: 8,
66
- children: /* @__PURE__ */ e(O, { $renderAs: "ac3", $color: "WHITE", children: "In Queue" })
69
+ children: /* @__PURE__ */ e(Q, { $renderAs: "ac3", $color: "WHITE", children: "In Queue" })
67
70
  }
68
71
  ),
69
- /* @__PURE__ */ e(
70
- W,
72
+ c && /* @__PURE__ */ e(
73
+ N,
71
74
  {
72
- isInQueue: r,
73
- userType: m,
74
- header: M,
75
+ isInQueue: t,
76
+ userType: h,
77
+ header: c.title,
75
78
  subHeader: S || "",
76
- nodeData: n,
79
+ nodeData: c,
77
80
  renderAs: "homework",
78
- studentId: h,
79
- onNodeAttempt: d ? $ : C,
81
+ studentId: $,
82
+ onNodeAttempt: d ? p : C,
80
83
  shouldOpenOnRight: !0,
81
- onNodeView: d ? f : p,
82
- onNodeReview: d ? g : k,
83
- onNodeUnassign: w,
84
- puzzleHWCardRef: r ? void 0 : _
84
+ onNodeView: d ? f : g,
85
+ onNodeReview: d ? k : w,
86
+ onNodeUnassign: _,
87
+ puzzleHWCardRef: t ? void 0 : H,
88
+ onMathFitClick: x,
89
+ entityType: j,
90
+ entityId: n,
91
+ state: M,
92
+ score: G,
93
+ homeworkId: W
85
94
  }
86
95
  )
87
96
  ]
88
97
  },
89
- `${E}_${s}_${i}_${r ? "queued" : "assigned"}`
98
+ `${n}_${i}_${t ? "queued" : "assigned"}`
90
99
  );
91
100
  },
92
101
  [
93
- m,
94
102
  h,
95
103
  $,
104
+ p,
96
105
  C,
97
106
  f,
98
- p,
99
107
  g,
100
108
  k,
101
109
  w,
102
- _
110
+ _,
111
+ x,
112
+ H
103
113
  ]
104
- ), y = x(() => {
114
+ ), E = b(() => {
105
115
  if (o.totalCount === 0) return [];
106
- const n = o.assignedHomeworks.map(
107
- (r, s) => a(r, s, !1)
116
+ const s = o.assignedHomeworks.map(
117
+ (t, n) => u(t, n, !1)
108
118
  ), i = o.queuedHomeworks.map(
109
- (r, s) => a(r, s, !0)
119
+ (t, n) => u(t, n, !0)
110
120
  );
111
- return [...n, ...i];
121
+ return [...s, ...i];
112
122
  }, [
113
123
  o.assignedHomeworks,
114
124
  o.queuedHomeworks,
115
- a,
125
+ u,
116
126
  o.totalCount
117
127
  ]);
118
- return o.totalCount === 0 ? /* @__PURE__ */ l(c, { $flexRowGapX: 1, children: [
119
- /* @__PURE__ */ e(u, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: "Homework (0)" }),
120
- /* @__PURE__ */ e(u, { $renderAs: "ab2", $color: "BLACK_T_60", children: "No Homework assigned yet" })
121
- ] }) : /* @__PURE__ */ l(V, { $flexRowGapX: 1, $disablePointerEvents: b, children: [
122
- /* @__PURE__ */ l(u, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
128
+ return o.totalCount === 0 ? /* @__PURE__ */ l(a, { $flexRowGapX: 1, children: [
129
+ /* @__PURE__ */ e(m, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: "Homework (0)" }),
130
+ /* @__PURE__ */ e(m, { $renderAs: "ab2", $color: "BLACK_T_60", children: "No Homework assigned yet" })
131
+ ] }) : /* @__PURE__ */ l(z, { $flexRowGapX: 1, $disablePointerEvents: y, children: [
132
+ /* @__PURE__ */ l(m, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
123
133
  "Homework (",
124
134
  o.waitForReviewCount,
125
135
  "/",
@@ -127,30 +137,30 @@ const z = ({
127
137
  ")"
128
138
  ] }),
129
139
  /* @__PURE__ */ l(
130
- c,
140
+ a,
131
141
  {
132
142
  $position: "relative",
133
- onMouseEnter: B,
134
- onMouseLeave: I,
143
+ onMouseEnter: I,
144
+ onMouseLeave: R,
135
145
  children: [
136
146
  /* @__PURE__ */ e(
137
- H,
147
+ L,
138
148
  {
139
149
  $position: "absolute",
140
150
  $background: "BLACK_T_60",
141
151
  $justifyContent: "center",
142
152
  $alignItems: "center",
143
153
  $height: "100%",
144
- onClick: R,
145
- $visible: A,
154
+ onClick: T,
155
+ $visible: v,
146
156
  left: "0px",
147
157
  right: "auto",
148
- children: /* @__PURE__ */ e(F, { width: 24, height: 24 })
158
+ children: /* @__PURE__ */ e(O, { width: 24, height: 24 })
149
159
  }
150
160
  ),
151
- /* @__PURE__ */ e(N, { ref: L, children: /* @__PURE__ */ e(c, { $flexDirection: "row", $flexGapX: 1, children: y }) }),
161
+ /* @__PURE__ */ e(J, { ref: A, children: /* @__PURE__ */ e(a, { $flexDirection: "row", $flexGapX: 1, children: E }) }),
152
162
  /* @__PURE__ */ e(
153
- H,
163
+ L,
154
164
  {
155
165
  $position: "absolute",
156
166
  $width: "60px",
@@ -159,18 +169,18 @@ const z = ({
159
169
  $justifyContent: "center",
160
170
  $alignItems: "center",
161
171
  onClick: q,
162
- $visible: v,
172
+ $visible: B,
163
173
  left: "auto",
164
174
  right: "0px",
165
- children: /* @__PURE__ */ e(G, { width: 24, height: 24 })
175
+ children: /* @__PURE__ */ e(V, { width: 24, height: 24 })
166
176
  }
167
177
  )
168
178
  ]
169
179
  }
170
180
  )
171
181
  ] });
172
- }, le = T(z);
182
+ }, de = X(D);
173
183
  export {
174
- le as default
184
+ de as default
175
185
  };
176
186
  //# sourceMappingURL=hw-card-list-view.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hw-card-list-view.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list-view.tsx"],"sourcesContent":["import { memo, useCallback, useMemo, type FC } from 'react';\n\nimport ChevronLeftIcon from '../../../assets/line-icons/icons/chevron-left';\nimport ChevronRightIcon from '../../../assets/line-icons/icons/chevron-right';\nimport type { INodeDataProps } from '../../chapters-v2/comps/node-card/node-card-types';\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';\nimport { getWaitForReviewSheetsCount } from './hw-card-list-utils';\nimport { NODE_TYPE } from '../../sheets/constants/sheet';\nimport type { IHwCardListView } from './hw-card-list-types';\nimport { useScrollButtons } from './hooks/use-scroll-buttons';\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 puzzleHWCardRef,\n}) => {\n const homeworkData = useMemo(() => {\n const assignedHomeworks = hwDetails?.assigned_homeworks || [];\n const queuedHomeworks = hwDetails?.queued_homeworks || [];\n const totalCount = assignedHomeworks.length + queuedHomeworks.length;\n const waitForReviewCount = getWaitForReviewSheetsCount(hwDetails);\n\n return {\n assignedHomeworks,\n queuedHomeworks,\n totalCount,\n waitForReviewCount,\n };\n }, [hwDetails]);\n\n const {\n scrollRef,\n showLeftButton,\n showRightButton,\n handleMouseEnter,\n handleMouseLeave,\n handleScrollLeft,\n handleScrollRight,\n } = useScrollButtons({\n totalCount: homeworkData.totalCount,\n });\n\n const renderHomeworkCard = useCallback(\n (sheet: INodeDataProps, idx: number, isQueued = false) => {\n const {\n node_id: nodeId,\n worksheet_id: worksheetId,\n node_type: nodeType,\n title,\n subtext,\n } = sheet;\n const isDynamicSheet = nodeType === NODE_TYPE.DYNAMIC;\n\n return (\n <FlexView\n key={`${worksheetId}_${nodeId}_${idx}_${isQueued ? 'queued' : 'assigned'}`}\n $flexDirection=\"row\"\n $flexGapX={1}\n >\n {isQueued && idx === 0 && (\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={isQueued}\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 puzzleHWCardRef={isQueued ? undefined : puzzleHWCardRef}\n />\n </FlexView>\n );\n },\n [\n userType,\n studentId,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n puzzleHWCardRef,\n ],\n );\n\n const homeworkCards = useMemo(() => {\n if (homeworkData.totalCount === 0) return [];\n\n const assignedCards = homeworkData.assignedHomeworks.map((sheet, idx) =>\n renderHomeworkCard(sheet, idx, false),\n );\n\n const queuedCards = homeworkData.queuedHomeworks.map((sheet, idx) =>\n renderHomeworkCard(sheet, idx, true),\n );\n\n return [...assignedCards, ...queuedCards];\n }, [\n homeworkData.assignedHomeworks,\n homeworkData.queuedHomeworks,\n renderHomeworkCard,\n homeworkData.totalCount,\n ]);\n\n if (homeworkData.totalCount === 0) {\n return (\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework (0)\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 ({homeworkData.waitForReviewCount}/{homeworkData.totalCount})\n </Text>\n <FlexView\n $position=\"relative\"\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\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={showLeftButton}\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 {homeworkCards}\n </FlexView>\n </Styled.ScrollContainer>\n\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={showRightButton}\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","puzzleHWCardRef","homeworkData","useMemo","assignedHomeworks","queuedHomeworks","totalCount","waitForReviewCount","getWaitForReviewSheetsCount","scrollRef","showLeftButton","showRightButton","handleMouseEnter","handleMouseLeave","handleScrollLeft","handleScrollRight","useScrollButtons","renderHomeworkCard","useCallback","sheet","idx","isQueued","nodeId","worksheetId","nodeType","title","subtext","isDynamicSheet","NODE_TYPE","jsxs","FlexView","jsx","Styled.QueueWrapper","Styled.QueueText","HomeworkCard","homeworkCards","assignedCards","queuedCards","Text","Styled.ContentWrapper","Styled.ScrollButton","ChevronLeftIcon","Styled.ScrollContainer","ChevronRightIcon","HwCardListView$1","memo"],"mappings":";;;;;;;;;;;AAcA,MAAMA,IAAsC,CAAC;AAAA,EAC3C,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,iBAAAC;AACF,MAAM;AACE,QAAAC,IAAeC,EAAQ,MAAM;AAC3B,UAAAC,KAAoBX,KAAA,gBAAAA,EAAW,uBAAsB,IACrDY,KAAkBZ,KAAA,gBAAAA,EAAW,qBAAoB,IACjDa,IAAaF,EAAkB,SAASC,EAAgB,QACxDE,IAAqBC,EAA4Bf,CAAS;AAEzD,WAAA;AAAA,MACL,mBAAAW;AAAA,MACA,iBAAAC;AAAA,MACA,YAAAC;AAAA,MACA,oBAAAC;AAAA,IAAA;AAAA,EACF,GACC,CAACd,CAAS,CAAC,GAER;AAAA,IACJ,WAAAgB;AAAA,IACA,gBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,mBAAAC;AAAA,MACEC,EAAiB;AAAA,IACnB,YAAYd,EAAa;AAAA,EAA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AAUJ;AAAA,cACV,MAAK;AAAA,cACL,OAAM;AAAA,cAEN,UAAC,gBAAAqB,EAAAU,GAAA,EAAgB,OAAO,IAAI,QAAQ,IAAI;AAAA,YAAA;AAAA,UAC1C;AAAA,UAEC,gBAAAV,EAAAW,GAAA,EAAuB,KAAKjC,GAC3B,UAAC,gBAAAsB,EAAAD,GAAA,EAAS,gBAAe,OAAM,WAAW,GACvC,YACH,CAAA,GACF;AAAA,UAEA,gBAAAC;AAAA,YAACS;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,QAAO;AAAA,cACP,SAAQ;AAAA,cACR,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,aAAY;AAAA,cACZ,SAASzB;AAAA,cACT,UAAUJ;AAAA,cACV,MAAK;AAAA,cACL,OAAM;AAAA,cAEN,UAAC,gBAAAoB,EAAAY,GAAA,EAAiB,OAAO,IAAI,QAAQ,IAAI;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ,GAEeC,KAAAC,EAAKxD,CAAc;"}
1
+ {"version":3,"file":"hw-card-list-view.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list-view.tsx"],"sourcesContent":["import { memo, useCallback, useMemo, type FC } from 'react';\n\nimport ChevronLeftIcon from '../../../assets/line-icons/icons/chevron-left';\nimport ChevronRightIcon from '../../../assets/line-icons/icons/chevron-right';\nimport { NODE_TYPE } from '../../sheets/constants/sheet';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport HomeworkCard from '../homework-card';\nimport type { IHomeworkItem } from './api/get-homeworks';\nimport * as Styled from './hw-card-list-styled';\nimport type { IHwCardListView } from './hw-card-list-types';\nimport { getWaitForReviewSheetsCount } from './hw-card-list-utils';\nimport { useScrollButtons } from './hooks/use-scroll-buttons';\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 onMathFitClick,\n puzzleHWCardRef,\n}) => {\n const homeworkData = useMemo(() => {\n const assignedHomeworks = hwDetails?.assigned_homeworks || [];\n const queuedHomeworks = hwDetails?.queued_homeworks || [];\n const totalCount = assignedHomeworks.length + queuedHomeworks.length;\n const waitForReviewCount = getWaitForReviewSheetsCount(hwDetails);\n\n return {\n assignedHomeworks,\n queuedHomeworks,\n totalCount,\n waitForReviewCount,\n };\n }, [hwDetails]);\n\n const {\n scrollRef,\n showLeftButton,\n showRightButton,\n handleMouseEnter,\n handleMouseLeave,\n handleScrollLeft,\n handleScrollRight,\n } = useScrollButtons({\n totalCount: homeworkData.totalCount,\n });\n\n const renderHomeworkCard = useCallback(\n (item: IHomeworkItem, idx: number, isQueued = false) => {\n const {\n entity_id: entityId,\n sheets,\n subtext,\n entity_type: entitYType,\n state,\n score,\n id,\n } = item;\n const sheet = sheets[0];\n const isDynamicSheet = sheet?.node_type === NODE_TYPE.DYNAMIC;\n\n return (\n <FlexView\n key={`${entityId}_${idx}_${isQueued ? 'queued' : 'assigned'}`}\n $flexDirection=\"row\"\n $flexGapX={1}\n >\n {isQueued && idx === 0 && (\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\n {sheet && (\n <HomeworkCard\n isInQueue={isQueued}\n userType={userType}\n header={sheet.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 puzzleHWCardRef={isQueued ? undefined : puzzleHWCardRef}\n // homeworkItem={item}\n onMathFitClick={onMathFitClick}\n entityType={entitYType}\n entityId={entityId}\n state={state}\n score={score}\n homeworkId={id}\n />\n )}\n </FlexView>\n );\n },\n [\n userType,\n studentId,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n onMathFitClick,\n puzzleHWCardRef,\n ],\n );\n\n const homeworkCards = useMemo(() => {\n if (homeworkData.totalCount === 0) return [];\n\n const assignedCards = homeworkData.assignedHomeworks.map((sheet, idx) =>\n renderHomeworkCard(sheet, idx, false),\n );\n\n const queuedCards = homeworkData.queuedHomeworks.map((sheet, idx) =>\n renderHomeworkCard(sheet, idx, true),\n );\n\n return [...assignedCards, ...queuedCards];\n }, [\n homeworkData.assignedHomeworks,\n homeworkData.queuedHomeworks,\n renderHomeworkCard,\n homeworkData.totalCount,\n ]);\n\n if (homeworkData.totalCount === 0) {\n return (\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework (0)\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 ({homeworkData.waitForReviewCount}/{homeworkData.totalCount})\n </Text>\n <FlexView\n $position=\"relative\"\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\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={showLeftButton}\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 {homeworkCards}\n </FlexView>\n </Styled.ScrollContainer>\n\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={showRightButton}\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","onMathFitClick","puzzleHWCardRef","homeworkData","useMemo","assignedHomeworks","queuedHomeworks","totalCount","waitForReviewCount","getWaitForReviewSheetsCount","scrollRef","showLeftButton","showRightButton","handleMouseEnter","handleMouseLeave","handleScrollLeft","handleScrollRight","useScrollButtons","renderHomeworkCard","useCallback","item","idx","isQueued","entityId","sheets","subtext","entitYType","state","score","id","sheet","isDynamicSheet","NODE_TYPE","jsxs","FlexView","jsx","Styled.QueueWrapper","Styled.QueueText","HomeworkCard","homeworkCards","assignedCards","queuedCards","Text","Styled.ContentWrapper","Styled.ScrollButton","ChevronLeftIcon","Styled.ScrollContainer","ChevronRightIcon","HwCardListView$1","memo"],"mappings":";;;;;;;;;;;AAcA,MAAMA,IAAsC,CAAC;AAAA,EAC3C,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,iBAAAC;AACF,MAAM;AACE,QAAAC,IAAeC,EAAQ,MAAM;AAC3B,UAAAC,KAAoBZ,KAAA,gBAAAA,EAAW,uBAAsB,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YAAA;AAAA,UAC3C;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ,GAEeC,KAAAC,EAAK5D,CAAc;"}
@@ -1,73 +1,75 @@
1
1
  import { jsx as C } from "react/jsx-runtime";
2
- import { memo as A, useMemo as W, useEffect as e, useCallback as b } from "react";
3
- import { usePuzzleAssignedJourney as j } from "../../journey/hooks/use-puzzles-journey/use-puzzle-assigned.js";
4
- import { useJourney as E } from "../../journey/use-journey/use-journey.js";
5
- import { getPuzzleCardData as F } from "../utils.js";
6
- import { useGetHomeworks as G } from "./api/get-homeworks.js";
7
- import J from "./hw-card-list-view.js";
8
- const M = ({
2
+ import { memo as W, useMemo as b, useEffect as t, useCallback as j } from "react";
3
+ import { usePuzzleAssignedJourney as E } from "../../journey/hooks/use-puzzles-journey/use-puzzle-assigned.js";
4
+ import { useJourney as F } from "../../journey/use-journey/use-journey.js";
5
+ import { getPuzzleCardData as G } from "../utils.js";
6
+ import { useGetHomeworks as J } from "./api/get-homeworks.js";
7
+ import M from "./hw-card-list-view.js";
8
+ const R = ({
9
9
  userType: f,
10
10
  studentId: o,
11
- stream: i,
12
- onTestStart: g,
13
- onNodeAttempt: H,
14
- onTestPreview: d,
15
- onNodeView: h,
11
+ stream: s,
12
+ onTestStart: h,
13
+ onNodeAttempt: g,
14
+ onTestPreview: H,
15
+ onNodeView: d,
16
16
  onTestReview: k,
17
17
  onNodeReview: P,
18
18
  onNodeUnassign: v,
19
- homeworkRef: D,
20
- startHomePageJourney: t,
19
+ onMathFitClick: D,
20
+ homeworkRef: L,
21
+ startHomePageJourney: m,
21
22
  canStartJourney: n,
22
23
  canStartPuzzleAssignedJourney: p
23
24
  }) => {
24
25
  const {
25
26
  get: u,
26
- data: m,
27
- isProcessingFailed: L,
28
- isProcessing: c,
27
+ data: c,
28
+ isProcessingFailed: x,
29
+ isProcessing: l,
29
30
  isProcessed: w,
30
31
  isStale: z
31
- } = G(o), { isJourneyActive: r } = E(), { puzzleHWCardRef: x, startJourney: l } = j(), a = W(() => F(m), [m]);
32
- e(() => {
33
- w && t && !r && n && t({ studentId: o, stream: i, userType: f });
32
+ } = J(o), { isJourneyActive: i } = F(), { puzzleHWCardRef: A, startJourney: a } = E(), e = b(() => G(c), [c]);
33
+ t(() => {
34
+ w && m && !i && n && m({ studentId: o, stream: s, userType: f });
34
35
  }, [
35
36
  n,
36
- r,
37
- w,
38
- t,
39
37
  i,
38
+ w,
39
+ m,
40
+ s,
40
41
  o,
41
42
  f
42
43
  ]);
43
- const s = b(() => {
44
- u(o, void 0, { stream: i });
45
- }, [u, i, o]);
46
- return e(() => {
47
- !c && z && s();
48
- }, [s, c, z]), e(() => {
49
- s();
50
- }, [s]), e(() => {
51
- p && !r && l && a && l(a);
52
- }, [p, a, r, l]), L ? null : /* @__PURE__ */ C("div", { ref: D, children: /* @__PURE__ */ C(
53
- J,
44
+ const r = j(() => {
45
+ u(o, void 0, { stream: s });
46
+ }, [u, s, o]);
47
+ return t(() => {
48
+ !l && z && r();
49
+ }, [r, l, z]), t(() => {
50
+ r();
51
+ }, [r]), t(() => {
52
+ p && !i && a && e && e.sheets[0] && a(e.sheets[0]);
53
+ }, [p, e, i, a]), x ? null : /* @__PURE__ */ C("div", { ref: L, children: /* @__PURE__ */ C(
54
+ M,
54
55
  {
55
- isHwProcessing: c,
56
- hwDetails: m,
57
- onTestStart: g,
58
- onNodeAttempt: H,
59
- onTestPreview: d,
60
- onNodeView: h,
56
+ isHwProcessing: l,
57
+ hwDetails: c,
58
+ onTestStart: h,
59
+ onNodeAttempt: g,
60
+ onTestPreview: H,
61
+ onNodeView: d,
61
62
  onTestReview: k,
62
63
  onNodeReview: P,
63
64
  onNodeUnassign: v,
65
+ onMathFitClick: D,
64
66
  userType: f,
65
67
  studentId: o,
66
- puzzleHWCardRef: x
68
+ puzzleHWCardRef: A
67
69
  }
68
70
  ) });
69
- }, Q = A(M);
71
+ }, U = W(R);
70
72
  export {
71
- Q as default
73
+ U as default
72
74
  };
73
75
  //# 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 { memo, useCallback, useEffect, useMemo, type FC } from 'react';\n\nimport { usePuzzleAssignedJourney } from '../../journey/hooks/use-puzzles-journey/use-puzzle-assigned';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport { getPuzzleCardData } from '../utils';\nimport { useGetHomeworks } from './api/get-homeworks';\nimport HwCardListView from './hw-card-list-view';\nimport type { IHWCardListProps } from './hw-card-list-types';\n\nconst HWCardList: FC<IHWCardListProps> = ({\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 canStartPuzzleAssignedJourney,\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 const { puzzleHWCardRef, startJourney: startPuzzleAssignedJourney } = usePuzzleAssignedJourney();\n\n const puzzleCardData = useMemo(() => getPuzzleCardData(hwDetails), [hwDetails]);\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 useEffect(() => {\n if (\n canStartPuzzleAssignedJourney &&\n !isJourneyActive &&\n startPuzzleAssignedJourney &&\n puzzleCardData\n ) {\n startPuzzleAssignedJourney(puzzleCardData);\n }\n }, [canStartPuzzleAssignedJourney, puzzleCardData, isJourneyActive, startPuzzleAssignedJourney]);\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 puzzleHWCardRef={puzzleHWCardRef}\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","canStartPuzzleAssignedJourney","getHomeworks","hwDetails","isProcessingFailed","isProcessing","isProcessed","isStale","useGetHomeworks","isJourneyActive","useJourney","puzzleHWCardRef","startPuzzleAssignedJourney","usePuzzleAssignedJourney","puzzleCardData","useMemo","getPuzzleCardData","useEffect","fetchHomeworks","useCallback","jsx","HwCardListView","hwCardList","memo"],"mappings":";;;;;;;AASA,MAAMA,IAAmC,CAAC;AAAA,EACxC,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;AAAA,EACA,+BAAAC;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,EAAgBn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AEJ,GAEeW,IAAAC,EAAKpC,CAAU;"}
1
+ {"version":3,"file":"hw-card-list.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo, type FC } from 'react';\n\nimport { usePuzzleAssignedJourney } from '../../journey/hooks/use-puzzles-journey/use-puzzle-assigned';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport { getPuzzleCardData } from '../utils';\nimport { useGetHomeworks } from './api/get-homeworks';\nimport HwCardListView from './hw-card-list-view';\nimport type { IHWCardListProps } from './hw-card-list-types';\n\nconst HWCardList: FC<IHWCardListProps> = ({\n userType,\n studentId,\n stream,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n onMathFitClick,\n homeworkRef,\n startHomePageJourney,\n canStartJourney,\n canStartPuzzleAssignedJourney,\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 const { puzzleHWCardRef, startJourney: startPuzzleAssignedJourney } = usePuzzleAssignedJourney();\n\n const puzzleCardData = useMemo(() => getPuzzleCardData(hwDetails), [hwDetails]);\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 useEffect(() => {\n if (\n canStartPuzzleAssignedJourney &&\n !isJourneyActive &&\n startPuzzleAssignedJourney &&\n puzzleCardData &&\n puzzleCardData.sheets[0]\n ) {\n startPuzzleAssignedJourney(puzzleCardData.sheets[0]);\n }\n }, [canStartPuzzleAssignedJourney, puzzleCardData, isJourneyActive, startPuzzleAssignedJourney]);\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 onMathFitClick={onMathFitClick}\n userType={userType}\n studentId={studentId}\n puzzleHWCardRef={puzzleHWCardRef}\n />\n </div>\n );\n};\n\nexport default memo(HWCardList);\n"],"names":["HWCardList","userType","studentId","stream","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","onMathFitClick","homeworkRef","startHomePageJourney","canStartJourney","canStartPuzzleAssignedJourney","getHomeworks","hwDetails","isProcessingFailed","isProcessing","isProcessed","isStale","useGetHomeworks","isJourneyActive","useJourney","puzzleHWCardRef","startPuzzleAssignedJourney","usePuzzleAssignedJourney","puzzleCardData","useMemo","getPuzzleCardData","useEffect","fetchHomeworks","useCallback","jsx","HwCardListView","hwCardList","memo"],"mappings":";;;;;;;AASA,MAAMA,IAAmC,CAAC;AAAA,EACxC,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,gBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,+BAAAC;AACF,MAAM;AACE,QAAA;AAAA,IACJ,KAAKC;AAAA,IACL,MAAMC;AAAA,IACN,oBAAAC;AAA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AAC;AAAA,MACA,gBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,UAAAV;AAAA,MACA,WAAAC;AAAA,MACA,iBAAAuB;AAAA,IAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEeW,IAAAC,EAAKrC,CAAU;"}
@@ -74,7 +74,6 @@ const c = r(e)(({ theme: o }) => `
74
74
  text-overflow: ellipsis;
75
75
  white-space: break-spaces;
76
76
  `;
77
- r(e)``;
78
77
  r(e)(({
79
78
  theme: o,
80
79
  $disabled: t
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sources":["../../../src/features/homework/styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport Minus2Icon from '../../assets/line-icons/icons/minus2';\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\n\ninterface ICardWrapperProps {\n $bgImage: string;\n}\ninterface ICardOptionsMenuWrapperProps {\n $visible: boolean;\n $shouldopenonright: boolean;\n}\n\nexport const CardKebabMenuWrapper = styled(FlexView)(({ theme }) => {\n return `\n cursor: pointer;\n width: 24px;\n height: 24px;\n \n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\nexport const SubHeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const CardMenuOptionsWrapper = styled(FlexView)<ICardOptionsMenuWrapperProps>(({\n $shouldopenonright,\n $visible,\n}) => {\n return `\n cursor: pointer;\n position: absolute;\n z-index: 6;\n top: calc(100% + 4px);\n right: ${$shouldopenonright ? 0 : 'auto'};\n transform-origin: top;\n transform: scaleY(${$visible ? 1 : 0});\n opacity: ${$visible ? 1 : 0};\n transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;\n box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.4);\n z-index: 10;\n `;\n});\n\nexport const CardContainer = styled(FlexView)`\n border: 1px solid ${({ theme }) => theme.colors.BLACK_T_15};\n border-top-width: 2px;\n &:hover {\n border: 1px solid ${({ theme }) => theme.colors.BLACK};\n border-top-width: 2px;\n }\n`;\n\nexport const CardWrapper = styled(FlexView)<ICardWrapperProps>(({ $bgImage }) => {\n if ($bgImage) {\n return `\n background-image: url(${$bgImage});\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n overflow: hidden;\n `;\n }\n\n return 'overflow: hidden;';\n});\n\nexport const IconWrapper = styled(FlexView)`\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const BannerImageWrapper = styled(FlexView)`\n position: absolute;\n right: -18px;\n top: -4px;\n`;\n\nexport const BannerImage = styled.img(({ theme }) => {\n const { gutter } = theme.layout;\n\n return `\n border: 1px solid ${theme.colors.BLACK_T_15};\n width: ${gutter * 4}px;\n height: ${gutter * 4}px;\n border-radius: 50%;\n `;\n});\n\nexport const StyledMinus2Icon = styled(Minus2Icon)`\n path {\n stroke: ${({ theme }) => theme.colors.WHITE};\n }\n`;\n\nexport const HeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: break-spaces;\n`;\n\ninterface ICardOptionWrapperProps {\n $disabled?: boolean;\n}\ninterface ICardOptionsProps {\n $top: number;\n $left: number;\n}\n\nexport const CardOptions = styled(FlexView)<ICardOptionsProps>``;\n\nexport const CardOptionWrapper = styled(FlexView)<ICardOptionWrapperProps>(({\n theme,\n $disabled,\n}) => {\n return `\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n \n &:hover {\n background: ${$disabled ? 'transparent' : theme.colors.BLACK};\n };\n \n path {\n fill: ${theme.colors.WHITE_1};\n }\n `;\n});\n\nexport const OptionText = styled(Text)`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const MenuWrapper = styled(FlexView)`\n position: absolute;\n z-index: 6;\n top: calc(100% - 36px);\n right: 12px;\n transform-origin: top;\n transform: scaleY(1);\n`;\n\nexport const BlurContainer = styled(FlexView)`\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0.5;\n`;\n\nexport const BlurFlexView = styled(FlexView)`\n position: absolute;\n right: 42px;\n top: 24px;\n`;\n\nexport const PuzzleCardWrapper = styled(FlexView)<{ $disabled?: boolean }>(({ $disabled }) => {\n if ($disabled)\n return `\n cursor: not-allowed;\n `;\n\n return 'cursor: pointer';\n});\n"],"names":["CardKebabMenuWrapper","styled","FlexView","theme","SubHeaderText","Text","CardMenuOptionsWrapper","$shouldopenonright","$visible","CardContainer","CardWrapper","$bgImage","IconWrapper","BannerImageWrapper","BannerImage","gutter","StyledMinus2Icon","Minus2Icon","HeaderText","$disabled","MenuWrapper","BlurContainer","BlurFlexView","PuzzleCardWrapper"],"mappings":";;;;AAcO,MAAMA,IAAuBC,EAAOC,CAAQ,EAAE,CAAC,EAAE,OAAAC,QAC/C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAQWA,EAAM,OAAO,OAAO;AAAA;AAAA,GAGvC,GAEYC,IAAgBH,EAAOI,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQ3BC,IAAyBL,EAAOC,CAAQ,EAAgC,CAAC;AAAA,EACpF,oBAAAK;AAAA,EACA,UAAAC;AACF,MACS;AAAA;AAAA;AAAA;AAAA;AAAA,aAKID,IAAqB,IAAI,MAAM;AAAA;AAAA,wBAEpBC,IAAW,IAAI,CAAC;AAAA,eACzBA,IAAW,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA,GAK9B,GAEYC,IAAgBR,EAAOC,CAAQ;AAAA,sBACtB,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA,wBAGpC,CAAC,EAAE,OAAAA,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA,GAK5CO,IAAcT,EAAOC,CAAQ,EAAqB,CAAC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
1
+ {"version":3,"file":"styles.js","sources":["../../../src/features/homework/styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport Minus2Icon from '../../assets/line-icons/icons/minus2';\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\n\ninterface ICardWrapperProps {\n $bgImage: string;\n}\ninterface ICardOptionsMenuWrapperProps {\n $visible: boolean;\n $shouldopenonright: boolean;\n}\n\nexport const CardKebabMenuWrapper = styled(FlexView)(({ theme }) => {\n return `\n cursor: pointer;\n width: 24px;\n height: 24px;\n \n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\nexport const SubHeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const CardMenuOptionsWrapper = styled(FlexView)<ICardOptionsMenuWrapperProps>(({\n $shouldopenonright,\n $visible,\n}) => {\n return `\n cursor: pointer;\n position: absolute;\n z-index: 6;\n top: calc(100% + 4px);\n right: ${$shouldopenonright ? 0 : 'auto'};\n transform-origin: top;\n transform: scaleY(${$visible ? 1 : 0});\n opacity: ${$visible ? 1 : 0};\n transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;\n box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.4);\n z-index: 10;\n `;\n});\n\nexport const CardContainer = styled(FlexView)`\n border: 1px solid ${({ theme }) => theme.colors.BLACK_T_15};\n border-top-width: 2px;\n &:hover {\n border: 1px solid ${({ theme }) => theme.colors.BLACK};\n border-top-width: 2px;\n }\n`;\n\nexport const CardWrapper = styled(FlexView)<ICardWrapperProps>(({ $bgImage }) => {\n if ($bgImage) {\n return `\n background-image: url(${$bgImage});\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n overflow: hidden;\n `;\n }\n\n return 'overflow: hidden;';\n});\n\nexport const IconWrapper = styled(FlexView)`\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const BannerImageWrapper = styled(FlexView)`\n position: absolute;\n right: -18px;\n top: -4px;\n`;\n\nexport const BannerImage = styled.img(({ theme }) => {\n const { gutter } = theme.layout;\n\n return `\n border: 1px solid ${theme.colors.BLACK_T_15};\n width: ${gutter * 4}px;\n height: ${gutter * 4}px;\n border-radius: 50%;\n `;\n});\n\nexport const StyledMinus2Icon = styled(Minus2Icon)`\n path {\n stroke: ${({ theme }) => theme.colors.WHITE};\n }\n`;\n\nexport const HeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: break-spaces;\n`;\n\ninterface ICardOptionWrapperProps {\n $disabled?: boolean;\n}\nexport const CardOptionWrapper = styled(FlexView)<ICardOptionWrapperProps>(({\n theme,\n $disabled,\n}) => {\n return `\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n \n &:hover {\n background: ${$disabled ? 'transparent' : theme.colors.BLACK};\n };\n \n path {\n fill: ${theme.colors.WHITE_1};\n }\n `;\n});\n\nexport const OptionText = styled(Text)`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const MenuWrapper = styled(FlexView)`\n position: absolute;\n z-index: 6;\n top: calc(100% - 36px);\n right: 12px;\n transform-origin: top;\n transform: scaleY(1);\n`;\n\nexport const BlurContainer = styled(FlexView)`\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0.5;\n`;\n\nexport const BlurFlexView = styled(FlexView)`\n position: absolute;\n right: 42px;\n top: 24px;\n`;\n\nexport const PuzzleCardWrapper = styled(FlexView)<{ $disabled?: boolean }>(({ $disabled }) => {\n if ($disabled)\n return `\n cursor: not-allowed;\n `;\n\n return 'cursor: pointer';\n});\n"],"names":["CardKebabMenuWrapper","styled","FlexView","theme","SubHeaderText","Text","CardMenuOptionsWrapper","$shouldopenonright","$visible","CardContainer","CardWrapper","$bgImage","IconWrapper","BannerImageWrap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AC,GAEYC,IAAmBf,EAAOgB,CAAU;AAAA;AAAA,cAEnC,CAAC,EAAE,OAAAd,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA,GAIlCe,IAAajB,EAAOI,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYJJ,EAAOC,CAAQ,EAA2B,CAAC;AAAA,EAC1E,OAAAC;AAAA,EACA,WAAAgB;AACF,MACS;AAAA,cACKA,IAAY,gBAAgB,SAAS;AAAA;AAAA;AAAA,oBAG/BA,IAAY,gBAAgBhB,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA,cAIpDA,EAAM,OAAO,OAAO;AAAA;AAAA,GAGjC;AAEyBF,EAAOI,CAAI;AAAA;AAAA;AAAA;AAAA;AAMxB,MAAAe,IAAcnB,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAS7BmB,IAAgBpB,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAS/BoB,IAAerB,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,GAM9BqB,IAAoBtB,EAAOC,CAAQ,EAA2B,CAAC,EAAE,WAAAiB,QACxEA,IACK;AAAA;AAAA,QAIF,iBACR;"}
@@ -4,48 +4,51 @@ import { HOMEWORK_ANALYTICS_EVENTS as c } from "./homework-analytics-events.js";
4
4
  const y = ({
5
5
  canResume: t,
6
6
  canStart: e,
7
- homeworkId: i,
8
- isHomeWork: o,
9
- isStudent: _,
10
- milestoneId: s,
7
+ homeworkId: o,
8
+ isHomeWork: a,
9
+ isStudent: s,
10
+ milestoneId: _,
11
11
  nodeType: r,
12
- studentId: a,
12
+ studentId: i,
13
13
  userNodeId: d
14
14
  }) => {
15
- if (_) {
16
- if (o)
15
+ if (s) {
16
+ if (a)
17
17
  return e || t ? {
18
18
  analyticsLabel: c.HOMEWORK_ATTEMPTED,
19
- analyticsProps: { student_id: a, node_type: r, homework_id: i }
19
+ analyticsProps: { student_id: i, node_type: r, homework_id: o }
20
20
  } : {
21
21
  analyticsLabel: "homework-student-menu",
22
- analyticsProps: { student_id: a, node_type: r, homework_id: i }
22
+ analyticsProps: { student_id: i, node_type: r, homework_id: o }
23
23
  };
24
24
  if (e || t)
25
25
  return {
26
26
  analyticsLabel: r === n.DYNAMIC ? l.CUSTOM_TEST_ATTEMPTED : "node-attempted",
27
27
  analyticsProps: {
28
- student_id: a,
28
+ student_id: i,
29
29
  node_type: r,
30
30
  user_node_id: d,
31
- milestone_id: s,
31
+ milestone_id: _,
32
32
  can_start: e,
33
33
  can_resume: t
34
34
  }
35
35
  };
36
36
  }
37
- return o ? {
37
+ return a ? {
38
38
  analyticsLabel: "homework-card-teacher",
39
- analyticsProps: { student_id: a, node_type: r }
39
+ analyticsProps: { student_id: i, node_type: r }
40
40
  } : {
41
41
  analyticsLabel: "goals-card-teacher",
42
- analyticsProps: { student_id: a, node_type: r }
42
+ analyticsProps: { student_id: i, node_type: r }
43
43
  };
44
44
  }, T = (t) => {
45
45
  if (!t)
46
46
  return;
47
47
  const { assigned_homeworks: e } = t;
48
- return e.find((i) => i.node_type === n.PUZZLE_CARD);
48
+ return e.find((o) => {
49
+ var a;
50
+ return ((a = o.sheets[0]) == null ? void 0 : a.node_type) === n.PUZZLE_CARD;
51
+ });
49
52
  };
50
53
  export {
51
54
  y as getCardAnalyticProps,
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../src/features/homework/utils.ts"],"sourcesContent":["import type { TNodeTypes } from '../chapters-v2/comps/node-card/node-card-types';\nimport { TESTS_CREATION_ANALYTICS_EVENTS } from '../milestone/milestone-tests/tests-creation/tests-creation-analytics-events';\nimport { NODE_TYPE } from '../sheets/constants/sheet';\nimport { HOMEWORK_ANALYTICS_EVENTS } from './homework-analytics-events';\nimport type { IHomeworkDetails } from './hw-card-list/api/get-homeworks';\n\ninterface IGetCardAnalyticProps {\n canResume: boolean;\n canStart: boolean;\n homeworkId?: string;\n isHomeWork: boolean;\n isStudent: boolean;\n milestoneId?: string;\n nodeType: TNodeTypes;\n studentId: string;\n userNodeId: string | null;\n}\n\nconst getCardAnalyticProps = ({\n canResume,\n canStart,\n homeworkId,\n isHomeWork,\n isStudent,\n milestoneId,\n nodeType,\n studentId,\n userNodeId,\n}: IGetCardAnalyticProps) => {\n if (isStudent) {\n if (isHomeWork) {\n if (canStart || canResume) {\n return {\n analyticsLabel: HOMEWORK_ANALYTICS_EVENTS.HOMEWORK_ATTEMPTED,\n analyticsProps: { student_id: studentId, node_type: nodeType, homework_id: homeworkId },\n };\n }\n\n return {\n analyticsLabel: 'homework-student-menu',\n analyticsProps: { student_id: studentId, node_type: nodeType, homework_id: homeworkId },\n };\n }\n\n if (canStart || canResume) {\n return {\n analyticsLabel:\n nodeType === NODE_TYPE.DYNAMIC\n ? TESTS_CREATION_ANALYTICS_EVENTS.CUSTOM_TEST_ATTEMPTED\n : 'node-attempted',\n analyticsProps: {\n student_id: studentId,\n node_type: nodeType,\n user_node_id: userNodeId,\n milestone_id: milestoneId,\n can_start: canStart,\n can_resume: canResume,\n },\n };\n }\n }\n\n if (isHomeWork) {\n return {\n analyticsLabel: 'homework-card-teacher',\n analyticsProps: { student_id: studentId, node_type: nodeType },\n };\n }\n\n return {\n analyticsLabel: 'goals-card-teacher',\n analyticsProps: { student_id: studentId, node_type: nodeType },\n };\n};\n\nconst getPuzzleCardData = (hwDetails?: IHomeworkDetails) => {\n if (!hwDetails) {\n return undefined;\n }\n\n const { assigned_homeworks: assignedHomework } = hwDetails;\n\n return assignedHomework.find(homework => homework.node_type === NODE_TYPE.PUZZLE_CARD);\n};\n\nexport { getCardAnalyticProps, getPuzzleCardData };\n"],"names":["getCardAnalyticProps","canResume","canStart","homeworkId","isHomeWork","isStudent","milestoneId","nodeType","studentId","userNodeId","HOMEWORK_ANALYTICS_EVENTS","NODE_TYPE","TESTS_CREATION_ANALYTICS_EVENTS","getPuzzleCardData","hwDetails","assignedHomework","homework"],"mappings":";;;AAkBA,MAAMA,IAAuB,CAAC;AAAA,EAC5B,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AACF,MAA6B;AAC3B,MAAIJ,GAAW;AACb,QAAID;AACF,aAAIF,KAAYD,IACP;AAAA,QACL,gBAAgBS,EAA0B;AAAA,QAC1C,gBAAgB,EAAE,YAAYF,GAAW,WAAWD,GAAU,aAAaJ,EAAW;AAAA,MAAA,IAInF;AAAA,QACL,gBAAgB;AAAA,QAChB,gBAAgB,EAAE,YAAYK,GAAW,WAAWD,GAAU,aAAaJ,EAAW;AAAA,MAAA;AAI1F,QAAID,KAAYD;AACP,aAAA;AAAA,QACL,gBACEM,MAAaI,EAAU,UACnBC,EAAgC,wBAChC;AAAA,QACN,gBAAgB;AAAA,UACd,YAAYJ;AAAA,UACZ,WAAWD;AAAA,UACX,cAAcE;AAAA,UACd,cAAcH;AAAA,UACd,WAAWJ;AAAA,UACX,YAAYD;AAAA,QACd;AAAA,MAAA;AAAA,EAGN;AAEA,SAAIG,IACK;AAAA,IACL,gBAAgB;AAAA,IAChB,gBAAgB,EAAE,YAAYI,GAAW,WAAWD,EAAS;AAAA,EAAA,IAI1D;AAAA,IACL,gBAAgB;AAAA,IAChB,gBAAgB,EAAE,YAAYC,GAAW,WAAWD,EAAS;AAAA,EAAA;AAEjE,GAEMM,IAAoB,CAACC,MAAiC;AAC1D,MAAI,CAACA;AACI;AAGH,QAAA,EAAE,oBAAoBC,EAAqB,IAAAD;AAEjD,SAAOC,EAAiB,KAAK,CAAAC,MAAYA,EAAS,cAAcL,EAAU,WAAW;AACvF;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../src/features/homework/utils.ts"],"sourcesContent":["import type { TNodeTypes } from '../chapters-v2/comps/node-card/node-card-types';\nimport { TESTS_CREATION_ANALYTICS_EVENTS } from '../milestone/milestone-tests/tests-creation/tests-creation-analytics-events';\nimport { NODE_TYPE } from '../sheets/constants/sheet';\nimport { HOMEWORK_ANALYTICS_EVENTS } from './homework-analytics-events';\nimport type { IHomeworkDetails } from './hw-card-list/api/get-homeworks';\n\ninterface IGetCardAnalyticProps {\n canResume: boolean;\n canStart: boolean;\n homeworkId?: string;\n isHomeWork: boolean;\n isStudent: boolean;\n milestoneId?: string;\n nodeType: TNodeTypes;\n studentId: string;\n userNodeId: string | null;\n}\n\nconst getCardAnalyticProps = ({\n canResume,\n canStart,\n homeworkId,\n isHomeWork,\n isStudent,\n milestoneId,\n nodeType,\n studentId,\n userNodeId,\n}: IGetCardAnalyticProps) => {\n if (isStudent) {\n if (isHomeWork) {\n if (canStart || canResume) {\n return {\n analyticsLabel: HOMEWORK_ANALYTICS_EVENTS.HOMEWORK_ATTEMPTED,\n analyticsProps: { student_id: studentId, node_type: nodeType, homework_id: homeworkId },\n };\n }\n\n return {\n analyticsLabel: 'homework-student-menu',\n analyticsProps: { student_id: studentId, node_type: nodeType, homework_id: homeworkId },\n };\n }\n\n if (canStart || canResume) {\n return {\n analyticsLabel:\n nodeType === NODE_TYPE.DYNAMIC\n ? TESTS_CREATION_ANALYTICS_EVENTS.CUSTOM_TEST_ATTEMPTED\n : 'node-attempted',\n analyticsProps: {\n student_id: studentId,\n node_type: nodeType,\n user_node_id: userNodeId,\n milestone_id: milestoneId,\n can_start: canStart,\n can_resume: canResume,\n },\n };\n }\n }\n\n if (isHomeWork) {\n return {\n analyticsLabel: 'homework-card-teacher',\n analyticsProps: { student_id: studentId, node_type: nodeType },\n };\n }\n\n return {\n analyticsLabel: 'goals-card-teacher',\n analyticsProps: { student_id: studentId, node_type: nodeType },\n };\n};\n\nconst getPuzzleCardData = (hwDetails?: IHomeworkDetails) => {\n if (!hwDetails) {\n return undefined;\n }\n\n const { assigned_homeworks: assignedHomework } = hwDetails;\n\n return assignedHomework.find(homework => homework.sheets[0]?.node_type === NODE_TYPE.PUZZLE_CARD);\n};\n\nexport { getCardAnalyticProps, getPuzzleCardData };\n"],"names":["getCardAnalyticProps","canResume","canStart","homeworkId","isHomeWork","isStudent","milestoneId","nodeType","studentId","userNodeId","HOMEWORK_ANALYTICS_EVENTS","NODE_TYPE","TESTS_CREATION_ANALYTICS_EVENTS","getPuzzleCardData","hwDetails","assignedHomework","homework","_a"],"mappings":";;;AAkBA,MAAMA,IAAuB,CAAC;AAAA,EAC5B,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AACF,MAA6B;AAC3B,MAAIJ,GAAW;AACb,QAAID;AACF,aAAIF,KAAYD,IACP;AAAA,QACL,gBAAgBS,EAA0B;AAAA,QAC1C,gBAAgB,EAAE,YAAYF,GAAW,WAAWD,GAAU,aAAaJ,EAAW;AAAA,MAAA,IAInF;AAAA,QACL,gBAAgB;AAAA,QAChB,gBAAgB,EAAE,YAAYK,GAAW,WAAWD,GAAU,aAAaJ,EAAW;AAAA,MAAA;AAI1F,QAAID,KAAYD;AACP,aAAA;AAAA,QACL,gBACEM,MAAaI,EAAU,UACnBC,EAAgC,wBAChC;AAAA,QACN,gBAAgB;AAAA,UACd,YAAYJ;AAAA,UACZ,WAAWD;AAAA,UACX,cAAcE;AAAA,UACd,cAAcH;AAAA,UACd,WAAWJ;AAAA,UACX,YAAYD;AAAA,QACd;AAAA,MAAA;AAAA,EAGN;AAEA,SAAIG,IACK;AAAA,IACL,gBAAgB;AAAA,IAChB,gBAAgB,EAAE,YAAYI,GAAW,WAAWD,EAAS;AAAA,EAAA,IAI1D;AAAA,IACL,gBAAgB;AAAA,IAChB,gBAAgB,EAAE,YAAYC,GAAW,WAAWD,EAAS;AAAA,EAAA;AAEjE,GAEMM,IAAoB,CAACC,MAAiC;AAC1D,MAAI,CAACA;AACI;AAGH,QAA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