@cuemath/leap 4.1.1-beta.5 → 4.1.1-link.0

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 (78) hide show
  1. package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js +27 -25
  2. package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js.map +1 -1
  3. package/dist/features/chapters/chapters-list/chapters-list.js +53 -43
  4. package/dist/features/chapters/chapters-list/chapters-list.js.map +1 -1
  5. package/dist/features/chapters-v2/chapter-details/chapter-details.js +70 -68
  6. package/dist/features/chapters-v2/chapter-details/chapter-details.js.map +1 -1
  7. package/dist/features/journey/journey-id/journey-id-teacher.js +1 -1
  8. package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
  9. package/dist/features/journey/mocks/chapter-page-journey-mock-data.js +1 -1
  10. package/dist/features/journey/mocks/chapter-page-journey-mock-data.js.map +1 -1
  11. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +105 -93
  12. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
  13. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/goals/goal-action-ctas.js +44 -43
  14. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/goals/goal-action-ctas.js.map +1 -1
  15. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js +36 -34
  16. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js.map +1 -1
  17. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js +126 -107
  18. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js.map +1 -1
  19. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js +107 -95
  20. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js.map +1 -1
  21. package/dist/features/milestone/milestone-list-container/milestone-list-container.js +116 -104
  22. package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
  23. package/dist/features/milestone/milestone-resources/resources-list/resources-list.js +100 -93
  24. package/dist/features/milestone/milestone-resources/resources-list/resources-list.js.map +1 -1
  25. package/dist/features/milestone/milestone-tests/test-list-v2/test-list-container.js +81 -76
  26. package/dist/features/milestone/milestone-tests/test-list-v2/test-list-container.js.map +1 -1
  27. package/dist/features/timeline/monthly-timeline/ptm-report/ptm-report-types.js.map +1 -1
  28. package/dist/features/timeline/monthly-timeline/ptm-report/ptm-report.js +97 -113
  29. package/dist/features/timeline/monthly-timeline/ptm-report/ptm-report.js.map +1 -1
  30. package/dist/features/trial-session/comps/learning-plan/goal-edit-sync.js +40 -0
  31. package/dist/features/trial-session/comps/learning-plan/goal-edit-sync.js.map +1 -0
  32. package/dist/features/trial-session/comps/learning-plan/learning-assign-resource-sync.js +55 -0
  33. package/dist/features/trial-session/comps/learning-plan/learning-assign-resource-sync.js.map +1 -0
  34. package/dist/features/trial-session/comps/learning-plan/learning-chapter-details.js +48 -0
  35. package/dist/features/trial-session/comps/learning-plan/learning-chapter-details.js.map +1 -0
  36. package/dist/features/trial-session/comps/learning-plan/learning-milestone-sync.js +145 -0
  37. package/dist/features/trial-session/comps/learning-plan/learning-milestone-sync.js.map +1 -0
  38. package/dist/features/trial-session/comps/learning-plan/learning-plan-helpers.js +30 -0
  39. package/dist/features/trial-session/comps/learning-plan/learning-plan-helpers.js.map +1 -0
  40. package/dist/features/trial-session/comps/learning-plan/learning-plan-view.js +17 -0
  41. package/dist/features/trial-session/comps/learning-plan/learning-plan-view.js.map +1 -0
  42. package/dist/features/trial-session/comps/learning-plan/learning-plan.js +93 -0
  43. package/dist/features/trial-session/comps/learning-plan/learning-plan.js.map +1 -0
  44. package/dist/features/trial-session/comps/learning-plan/learning-preview-worksheet.js +81 -0
  45. package/dist/features/trial-session/comps/learning-plan/learning-preview-worksheet.js.map +1 -0
  46. package/dist/features/trial-session/comps/learning-plan/learning-test-creation-sync.js +41 -0
  47. package/dist/features/trial-session/comps/learning-plan/learning-test-creation-sync.js.map +1 -0
  48. package/dist/features/trial-session/hooks/use-chapter-details-journey.js +97 -0
  49. package/dist/features/trial-session/hooks/use-chapter-details-journey.js.map +1 -0
  50. package/dist/features/trial-session/hooks/use-learning-plan-journey.js +105 -0
  51. package/dist/features/trial-session/hooks/use-learning-plan-journey.js.map +1 -0
  52. package/dist/features/trial-session/hooks/use-resource-assignment-journey.js +64 -0
  53. package/dist/features/trial-session/hooks/use-resource-assignment-journey.js.map +1 -0
  54. package/dist/features/trial-session/hooks/use-test-creation-journey.js +64 -0
  55. package/dist/features/trial-session/hooks/use-test-creation-journey.js.map +1 -0
  56. package/dist/features/trial-session/hooks/use-worksheet-preview-journey.js +65 -0
  57. package/dist/features/trial-session/hooks/use-worksheet-preview-journey.js.map +1 -0
  58. package/dist/features/trial-session/right-panel/slide-components-map.js +1 -1
  59. package/dist/features/trial-session/right-panel/slide-components-map.js.map +1 -1
  60. package/dist/features/trial-session/trial-session-types.js.map +1 -1
  61. package/dist/features/worksheet/worksheet-preview/dynamic-worksheet-preview/dynamic-worksheet-preview.js +47 -34
  62. package/dist/features/worksheet/worksheet-preview/dynamic-worksheet-preview/dynamic-worksheet-preview.js.map +1 -1
  63. package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js +43 -42
  64. package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js.map +1 -1
  65. package/dist/features/worksheet/worksheet-preview/worksheet-preview.js +28 -26
  66. package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
  67. package/dist/index.d.ts +42 -4
  68. package/package.json +1 -1
  69. package/dist/features/timeline/monthly-timeline/ptm-report/comps/ptm-feedback/ptm-feedback-styled.js +0 -16
  70. package/dist/features/timeline/monthly-timeline/ptm-report/comps/ptm-feedback/ptm-feedback-styled.js.map +0 -1
  71. package/dist/features/timeline/monthly-timeline/ptm-report/comps/ptm-feedback/ptm-feedback.js +0 -56
  72. package/dist/features/timeline/monthly-timeline/ptm-report/comps/ptm-feedback/ptm-feedback.js.map +0 -1
  73. package/dist/features/timeline/monthly-timeline/ptm-report/comps/sticky-footer/sticky-footer-styled.js +0 -22
  74. package/dist/features/timeline/monthly-timeline/ptm-report/comps/sticky-footer/sticky-footer-styled.js.map +0 -1
  75. package/dist/features/timeline/monthly-timeline/ptm-report/comps/sticky-footer/sticky-footer.js +0 -14
  76. package/dist/features/timeline/monthly-timeline/ptm-report/comps/sticky-footer/sticky-footer.js.map +0 -1
  77. package/dist/features/trial-session/comps/learning-plan/index.js +0 -355
  78. package/dist/features/trial-session/comps/learning-plan/index.js.map +0 -1
@@ -1,29 +1,30 @@
1
- import { jsx as t, jsxs as _ } from "react/jsx-runtime";
2
- import { memo as x, useState as W, useRef as w, useCallback as y, useLayoutEffect as A } from "react";
1
+ import { jsx as t, jsxs as x } from "react/jsx-runtime";
2
+ import { memo as W, useState as w, useRef as y, useCallback as A, useLayoutEffect as H } from "react";
3
3
  import p from "../../../ui/arrow-tooltip/arrow-tooltip.js";
4
- import H from "../../../ui/layout/flex-view.js";
5
- import k from "../../../ui/text/text.js";
6
- import X from "./chapter-circular-progress/chapter-circular-progress.js";
7
- import { ChapterItemWrapper as j, ChapterName as S, ChapterItemNumberWrapper as E } from "./chapter-item-styled.js";
8
- const F = x(function({
4
+ import k from "../../../ui/layout/flex-view.js";
5
+ import X from "../../../ui/text/text.js";
6
+ import j from "./chapter-circular-progress/chapter-circular-progress.js";
7
+ import { ChapterItemWrapper as S, ChapterName as E, ChapterItemNumberWrapper as L } from "./chapter-item-styled.js";
8
+ const G = W(function({
9
9
  milestoneId: o,
10
10
  chapter: i,
11
11
  onChapterClick: n,
12
12
  itemIndex: a,
13
- shouldShowItemIndex: h
13
+ shouldShowItemIndex: h,
14
+ firstChapterRef: d
14
15
  }) {
15
16
  const {
16
17
  name: l,
17
- image_url: d,
18
- progress_stat: u,
18
+ image_url: u,
19
+ progress_stat: g,
19
20
  image_hue: c
20
- } = i, { mandatory: g, optional: $ } = u || {}, { completed: s = 0, total: m = 0 } = g || {}, { total: f = 0 } = $ || {}, [C, T] = W(!1), e = w(null), b = s > 0 ? Math.floor((s / m || 1) * 100) : 0, r = m + f, I = y(() => {
21
+ } = i, { mandatory: f, optional: $ } = g || {}, { completed: s = 0, total: m = 0 } = f || {}, { total: C = 0 } = $ || {}, [T, b] = w(!1), e = y(null), I = s > 0 ? Math.floor((s / m || 1) * 100) : 0, r = m + C, _ = A(() => {
21
22
  if (r === 0)
22
23
  return null;
23
24
  n(i, o);
24
25
  }, [i, o, n, r]);
25
- return A(() => {
26
- e.current && e.current.scrollHeight > e.current.clientHeight && T(!0);
26
+ return H(() => {
27
+ e.current && e.current.scrollHeight > e.current.clientHeight && b(!0);
27
28
  }, [e]), /* @__PURE__ */ t(
28
29
  p,
29
30
  {
@@ -33,41 +34,42 @@ const F = x(function({
33
34
  hidden: r > 0,
34
35
  parentWidth: "100%",
35
36
  zIndex: 5,
36
- children: /* @__PURE__ */ _(
37
- j,
37
+ children: /* @__PURE__ */ x(
38
+ S,
38
39
  {
40
+ ref: d,
39
41
  id: `milestone-chapter-${o || ""}-${a}`,
40
42
  $alignItems: "center",
41
43
  $gapX: 1,
42
44
  $gutterX: 1,
43
45
  $flexGap: 8,
44
46
  $background: "WHITE_1",
45
- onClick: I,
47
+ onClick: _,
46
48
  className: "goal-widget-chapter-item",
47
49
  $bgColor: `${c}_1`,
48
50
  shouldHideClick: r === 0,
49
51
  children: [
50
52
  /* @__PURE__ */ t(
51
- X,
53
+ j,
52
54
  {
53
- completionPercentage: b,
54
- imageUrl: d,
55
+ completionPercentage: I,
56
+ imageUrl: u,
55
57
  imageHue: c,
56
58
  imageWidth: 96,
57
59
  iconWidth: 20
58
60
  }
59
61
  ),
60
- /* @__PURE__ */ t(H, { $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ t(
62
+ /* @__PURE__ */ t(k, { $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ t(
61
63
  p,
62
64
  {
63
65
  renderAs: "primary",
64
66
  position: "bottom",
65
67
  tooltipItem: l,
66
- hidden: !C,
68
+ hidden: !T,
67
69
  widthX: 21.75,
68
70
  zIndex: 5,
69
71
  children: /* @__PURE__ */ t(
70
- S,
72
+ E,
71
73
  {
72
74
  ref: e,
73
75
  $renderAs: "ab2",
@@ -79,14 +81,14 @@ const F = x(function({
79
81
  }
80
82
  ) }),
81
83
  !!h && /* @__PURE__ */ t(
82
- E,
84
+ L,
83
85
  {
84
86
  $background: "WHITE_4",
85
87
  $widthX: 1.75,
86
88
  $heightX: 1.75,
87
89
  $alignItems: "center",
88
90
  $justifyContent: "center",
89
- children: /* @__PURE__ */ t(k, { $renderAs: "ab2", $color: "BLACK_1", $align: "center", children: a + 1 })
91
+ children: /* @__PURE__ */ t(X, { $renderAs: "ab2", $color: "BLACK_1", $align: "center", children: a + 1 })
90
92
  }
91
93
  )
92
94
  ]
@@ -96,6 +98,6 @@ const F = x(function({
96
98
  );
97
99
  });
98
100
  export {
99
- F as default
101
+ G as default
100
102
  };
101
103
  //# sourceMappingURL=chapter-item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chapter-item.js","sources":["../../../../../src/features/chapters/chapters-list/chapter-item/chapter-item.tsx"],"sourcesContent":["import { useCallback, useLayoutEffect, useRef, useState, memo, type FC } from 'react';\n\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport ChapterCircularProgress from './chapter-circular-progress/chapter-circular-progress';\nimport * as Styled from './chapter-item-styled';\nimport type { IChapterItemProps } from './chapter-item-types';\n\nconst ChapterItem: FC<IChapterItemProps> = memo(function ChapterItem({\n milestoneId,\n chapter,\n onChapterClick,\n itemIndex,\n shouldShowItemIndex,\n}) {\n const {\n name,\n image_url: imageUrl,\n progress_stat: chapterProgressStat,\n image_hue: imageHue,\n } = chapter;\n const { mandatory, optional } = chapterProgressStat || {};\n const { completed = 0, total: totalMandatory = 0 } = mandatory || {};\n const { total: optionalTotal = 0 } = optional || {};\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n const titleTextRef = useRef<HTMLDivElement>(null);\n const completionPercentage =\n completed > 0 ? Math.floor((completed / totalMandatory || 1) * 100) : 0;\n const totalSheets = totalMandatory + optionalTotal;\n const handleOnChapterClick = useCallback(() => {\n if (totalSheets === 0) {\n return null;\n }\n\n onChapterClick(chapter, milestoneId);\n }, [chapter, milestoneId, onChapterClick, totalSheets]);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n return (\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem=\"Coming soon! We’re building this chapter\"\n hidden={totalSheets > 0}\n parentWidth=\"100%\"\n zIndex={5}\n >\n <Styled.ChapterItemWrapper\n id={`milestone-chapter-${milestoneId || ''}-${itemIndex}`}\n $alignItems=\"center\"\n $gapX={1}\n $gutterX={1}\n $flexGap={8}\n $background=\"WHITE_1\"\n onClick={handleOnChapterClick}\n className=\"goal-widget-chapter-item\"\n $bgColor={`${imageHue}_1`}\n shouldHideClick={totalSheets === 0}\n >\n <ChapterCircularProgress\n completionPercentage={completionPercentage}\n imageUrl={imageUrl}\n imageHue={imageHue}\n imageWidth={96}\n iconWidth={20}\n />\n <FlexView $justifyContent=\"center\" $alignItems=\"center\">\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={name}\n hidden={!showTitleTooltip}\n widthX={21.75}\n zIndex={5}\n >\n <Styled.ChapterName\n ref={titleTextRef}\n $renderAs=\"ab2\"\n $color=\"BLACK_T_87\"\n $align=\"center\"\n >\n {name}\n </Styled.ChapterName>\n </ArrowTooltip>\n </FlexView>\n {!!shouldShowItemIndex && (\n <Styled.ChapterItemNumberWrapper\n $background=\"WHITE_4\"\n $widthX={1.75}\n $heightX={1.75}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n <Text $renderAs=\"ab2\" $color=\"BLACK_1\" $align=\"center\">\n {itemIndex + 1}\n </Text>\n </Styled.ChapterItemNumberWrapper>\n )}\n </Styled.ChapterItemWrapper>\n </ArrowTooltip>\n );\n});\n\nexport default ChapterItem;\n"],"names":["ChapterItem","memo","milestoneId","chapter","onChapterClick","itemIndex","shouldShowItemIndex","name","imageUrl","chapterProgressStat","imageHue","mandatory","optional","completed","totalMandatory","optionalTotal","showTitleTooltip","setShowTitleTooltip","useState","titleTextRef","useRef","completionPercentage","totalSheets","handleOnChapterClick","useCallback","useLayoutEffect","jsx","ArrowTooltip","jsxs","Styled.ChapterItemWrapper","ChapterCircularProgress","FlexView","Styled.ChapterName","Styled.ChapterItemNumberWrapper","Text"],"mappings":";;;;;;;AASM,MAAAA,IAAqCC,EAAK,SAAqB;AAAA,EACnE,aAAAC;AAAA,EACA,SAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,qBAAAC;AACF,GAAG;AACK,QAAA;AAAA,IACJ,MAAAC;AAAA,IACA,WAAWC;AAAA,IACX,eAAeC;AAAA,IACf,WAAWC;AAAA,EACT,IAAAP,GACE,EAAE,WAAAQ,GAAW,UAAAC,MAAaH,KAAuB,CAAA,GACjD,EAAE,WAAAI,IAAY,GAAG,OAAOC,IAAiB,EAAE,IAAIH,KAAa,IAC5D,EAAE,OAAOI,IAAgB,EAAE,IAAIH,KAAY,CAAA,GAC3C,CAACI,GAAkBC,CAAmB,IAAIC,EAAS,EAAK,GACxDC,IAAeC,EAAuB,IAAI,GAC1CC,IACJR,IAAY,IAAI,KAAK,OAAOA,IAAYC,KAAkB,KAAK,GAAG,IAAI,GAClEQ,IAAcR,IAAiBC,GAC/BQ,IAAuBC,EAAY,MAAM;AAC7C,QAAIF,MAAgB;AACX,aAAA;AAGT,IAAAlB,EAAeD,GAASD,CAAW;AAAA,KAClC,CAACC,GA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A,YACC,CAAC,CAACD,KACD,gBAAAoB;AAAA,cAACO;AAAAA,cAAA;AAAA,gBACC,aAAY;AAAA,gBACZ,SAAS;AAAA,gBACT,UAAU;AAAA,gBACV,aAAY;AAAA,gBACZ,iBAAgB;AAAA,gBAEhB,UAAA,gBAAAP,EAACQ,KAAK,WAAU,OAAM,QAAO,WAAU,QAAO,UAC3C,UAAA7B,IAAY,EACf,CAAA;AAAA,cAAA;AAAA,YACF;AAAA,UAAA;AAAA,QAAA;AAAA,MAEJ;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
1
+ {"version":3,"file":"chapter-item.js","sources":["../../../../../src/features/chapters/chapters-list/chapter-item/chapter-item.tsx"],"sourcesContent":["import { memo, useCallback, useLayoutEffect, useRef, useState, type FC } from 'react';\n\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport ChapterCircularProgress from './chapter-circular-progress/chapter-circular-progress';\nimport * as Styled from './chapter-item-styled';\nimport type { IChapterItemProps } from './chapter-item-types';\n\nconst ChapterItem: FC<IChapterItemProps> = memo(function ChapterItem({\n milestoneId,\n chapter,\n onChapterClick,\n itemIndex,\n shouldShowItemIndex,\n firstChapterRef,\n}) {\n const {\n name,\n image_url: imageUrl,\n progress_stat: chapterProgressStat,\n image_hue: imageHue,\n } = chapter;\n const { mandatory, optional } = chapterProgressStat || {};\n const { completed = 0, total: totalMandatory = 0 } = mandatory || {};\n const { total: optionalTotal = 0 } = optional || {};\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n const titleTextRef = useRef<HTMLDivElement>(null);\n const completionPercentage =\n completed > 0 ? Math.floor((completed / totalMandatory || 1) * 100) : 0;\n const totalSheets = totalMandatory + optionalTotal;\n const handleOnChapterClick = useCallback(() => {\n if (totalSheets === 0) {\n return null;\n }\n\n onChapterClick(chapter, milestoneId);\n }, [chapter, milestoneId, onChapterClick, totalSheets]);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n return (\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem=\"Coming soon! We’re building this chapter\"\n hidden={totalSheets > 0}\n parentWidth=\"100%\"\n zIndex={5}\n >\n <Styled.ChapterItemWrapper\n ref={firstChapterRef}\n id={`milestone-chapter-${milestoneId || ''}-${itemIndex}`}\n $alignItems=\"center\"\n $gapX={1}\n $gutterX={1}\n $flexGap={8}\n $background=\"WHITE_1\"\n onClick={handleOnChapterClick}\n className=\"goal-widget-chapter-item\"\n $bgColor={`${imageHue}_1`}\n shouldHideClick={totalSheets === 0}\n >\n <ChapterCircularProgress\n completionPercentage={completionPercentage}\n imageUrl={imageUrl}\n imageHue={imageHue}\n imageWidth={96}\n iconWidth={20}\n />\n <FlexView $justifyContent=\"center\" $alignItems=\"center\">\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={name}\n hidden={!showTitleTooltip}\n widthX={21.75}\n zIndex={5}\n >\n <Styled.ChapterName\n ref={titleTextRef}\n $renderAs=\"ab2\"\n $color=\"BLACK_T_87\"\n $align=\"center\"\n >\n {name}\n </Styled.ChapterName>\n </ArrowTooltip>\n </FlexView>\n {!!shouldShowItemIndex && (\n <Styled.ChapterItemNumberWrapper\n $background=\"WHITE_4\"\n $widthX={1.75}\n $heightX={1.75}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n <Text $renderAs=\"ab2\" $color=\"BLACK_1\" $align=\"center\">\n {itemIndex + 1}\n </Text>\n </Styled.ChapterItemNumberWrapper>\n )}\n </Styled.ChapterItemWrapper>\n </ArrowTooltip>\n );\n});\n\nexport default ChapterItem;\n"],"names":["ChapterItem","memo","milestoneId","chapter","onChapterClick","itemIndex","shouldShowItemIndex","firstChapterRef","name","imageUrl","chapterProgressStat","imageHue","mandatory","optional","completed","totalMandatory","optionalTotal","showTitleTooltip","setShowTitleTooltip","useState","titleTextRef","useRef","completionPercentage","totalSheets","handleOnChapterClick","useCallback","useLayoutEffect","jsx","ArrowTooltip","jsxs","Styled.ChapterItemWrapper","ChapterCircularProgress","FlexView","Styled.ChapterName","Styled.ChapterItemNumberWrapper","Text"],"mappings":";;;;;;;AASM,MAAAA,IAAqCC,EAAK,SAAqB;AAAA,EACnE,aAAAC;AAAA,EACA,SAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,iBAAAC;AACF,GAAG;AACK,QAAA;AAAA,IACJ,MAAAC;AAAA,IACA,WAAWC;AAAA,IACX,eAAeC;AAAA,IACf,WAAWC;AAAA,EACT,IAAAR,GACE,EAAE,WAAAS,GAAW,UAAAC,MAAaH,KAAuB,CAAA,GACjD,EAAE,WAAAI,IAAY,GAAG,OAAOC,IAAiB,EAAE,IAAIH,KAAa,IAC5D,EAAE,OAAOI,IAAgB,EAAE,IAAIH,KAAY,CAAA,GAC3C,CAACI,GAAkBC,CAAmB,IAAIC,EAAS,EAAK,GACxDC,IAAeC,EAAuB,IAAI,GAC1CC,IACJR,IAAY,IAAI,KAAK,OAAOA,IAAYC,KAAkB,KAAK,GAAG,IAAI,GAClEQ,IAAcR,IAAiBC,GAC/BQ,IAAuBC,EAAY,MAAM;AAC7C,QAAIF,MAAgB;AACX,aAAA;AAGT,IAAAnB,EAAeD,GAASD,CAAW;AAAA,KAClC,CAACC,GAASD,GAAaE,GAAgBmB,CAAW,CAAC;AAEtD,SAAAG,EAAgB,MAAM;AACpB,IACEN,EAAa,WACbA,EAAa,QAAQ,eAAeA,EAAa,QAAQ,gBAEzDF,EAAoB,EAAI;AAAA,EAC1B,GACC,CAACE,CAAY,CAAC,GAGf,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,UAAS;AAAA,MACT,UAAS;AAAA,MACT,aAAY;AAAA,MACZ,QAAQL,IAAc;AAAA,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F;AAAA,UAAA;AAAA,QAAA;AAAA,MAEJ;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
@@ -1,81 +1,91 @@
1
- import { jsxs as p, jsx as t, Fragment as A } from "react/jsx-runtime";
2
- import { memo as T, useCallback as b } from "react";
3
- import { IMAGES as g } from "../../../assets/images/images.js";
4
- import x from "../../ui/arrow-tooltip/arrow-tooltip.js";
5
- import k from "../../ui/buttons/button/button.js";
6
- import { useUIContext as $ } from "../../ui/context/context.js";
7
- import m from "../../ui/separator/separator.js";
8
- import y from "../../ui/text/text.js";
9
- import E from "./chapter-item/chapter-item.js";
10
- import { ChaptersListContainer as l, ChaptersWrapper as I } from "./chapters-list-styled.js";
11
- const L = T(function({
12
- milestoneId: r,
13
- canUpdatePlan: c,
14
- chapters: o,
15
- ...d
16
- }) {
17
- const { isGoalCreation: i, userType: h, onChapterClick: C, onAddChapter: e, isMilestoneActive: n } = d, { onClick: a } = $(), f = b(() => {
18
- a({
1
+ import { jsxs as c, jsx as t, Fragment as b } from "react/jsx-runtime";
2
+ import { memo as g, useCallback as y, useEffect as k } from "react";
3
+ import { IMAGES as x } from "../../../assets/images/images.js";
4
+ import E from "../../ui/arrow-tooltip/arrow-tooltip.js";
5
+ import $ from "../../ui/buttons/button/button.js";
6
+ import { useUIContext as S } from "../../ui/context/context.js";
7
+ import d from "../../ui/separator/separator.js";
8
+ import L from "../../ui/text/text.js";
9
+ import X from "./chapter-item/chapter-item.js";
10
+ import { ChaptersListContainer as h, ChaptersWrapper as M } from "./chapters-list-styled.js";
11
+ const P = g(function(f) {
12
+ const {
13
+ milestoneId: e,
14
+ canUpdatePlan: C,
15
+ chapters: i,
16
+ isGoalCreation: n,
17
+ userType: u,
18
+ onChapterClick: I,
19
+ onAddChapter: r,
20
+ isMilestoneActive: a,
21
+ firstChapterRef: _,
22
+ canStartJourney: s,
23
+ startJourney: o
24
+ } = f, { onClick: p } = S(), A = y(() => {
25
+ p({
19
26
  label: "add_chapter_icon",
20
27
  props: {
21
- milestone_id: r
28
+ milestone_id: e
22
29
  }
23
- }), e == null || e({ milestoneId: r, isGoalCreation: i });
24
- }, [r, i, e, a]);
25
- return o.length ? /* @__PURE__ */ t(l, { children: /* @__PURE__ */ t(I, { children: o.map((s, u) => {
26
- const { id: _ } = s;
30
+ }), r == null || r({ milestoneId: e, isGoalCreation: n });
31
+ }, [e, n, r, p]);
32
+ return k(() => {
33
+ s && o && o();
34
+ }, [s, o]), i.length ? /* @__PURE__ */ t(h, { children: /* @__PURE__ */ t(M, { children: i.map((m, l) => {
35
+ const { id: T } = m;
27
36
  return /* @__PURE__ */ t(
28
- E,
37
+ X,
29
38
  {
30
- milestoneId: r,
31
- chapter: s,
32
- onChapterClick: C,
33
- itemIndex: u,
39
+ firstChapterRef: l === 0 ? _ : void 0,
40
+ milestoneId: e,
41
+ chapter: m,
42
+ onChapterClick: I,
43
+ itemIndex: l,
34
44
  shouldShowItemIndex: !0
35
45
  },
36
- _
46
+ T
37
47
  );
38
- }) }) }) : /* @__PURE__ */ p(
39
- l,
48
+ }) }) }) : /* @__PURE__ */ c(
49
+ h,
40
50
  {
41
51
  $gapX: 6.75,
42
52
  $alignItems: "center",
43
53
  $justifyContent: "center",
44
54
  $background: "WHITE",
45
55
  children: [
46
- /* @__PURE__ */ t("img", { src: g.EMPTY_MIX_TESTS, alt: "empty_mix_tests" }),
47
- /* @__PURE__ */ t(m, { heightX: 2 }),
48
- h === "TEACHER" ? /* @__PURE__ */ p(A, { children: [
56
+ /* @__PURE__ */ t("img", { src: x.EMPTY_MIX_TESTS, alt: "empty_mix_tests" }),
57
+ /* @__PURE__ */ t(d, { heightX: 2 }),
58
+ u === "TEACHER" ? /* @__PURE__ */ c(b, { children: [
49
59
  /* @__PURE__ */ t(
50
- x,
60
+ E,
51
61
  {
52
62
  renderAs: "primary",
53
63
  position: "bottom",
54
- hidden: n,
64
+ hidden: a,
55
65
  tooltipItem: "Plan is completed",
56
66
  children: /* @__PURE__ */ t(
57
- k,
67
+ $,
58
68
  {
59
69
  widthX: 10,
60
70
  renderAs: "primary",
61
71
  shape: "square",
62
72
  size: "small",
63
73
  label: "Add chapter",
64
- onClick: f,
65
- disabled: !n || !c,
74
+ onClick: A,
75
+ disabled: !a || !C,
66
76
  analyticsProps: {
67
- milestone_id: r
77
+ milestone_id: e
68
78
  }
69
79
  }
70
80
  )
71
81
  }
72
82
  ),
73
- /* @__PURE__ */ t(m, { heightX: 2 })
74
- ] }) : /* @__PURE__ */ t(y, { $renderAs: "ab2-bold", $color: "BLACK_T_87", children: "Wait for the teacher to add a chapter" })
83
+ /* @__PURE__ */ t(d, { heightX: 2 })
84
+ ] }) : /* @__PURE__ */ t(L, { $renderAs: "ab2-bold", $color: "BLACK_T_87", children: "Wait for the teacher to add a chapter" })
75
85
  ]
76
86
  }
77
87
  );
78
- }), q = L;
88
+ }), q = P;
79
89
  export {
80
90
  q as default
81
91
  };
@@ -1 +1 @@
1
- {"version":3,"file":"chapters-list.js","sources":["../../../../src/features/chapters/chapters-list/chapters-list.tsx"],"sourcesContent":["import { memo, useCallback, type FC } from 'react';\n\nimport { IMAGES } from '../../../assets/images/images';\nimport ArrowTooltip from '../../ui/arrow-tooltip/arrow-tooltip';\nimport Button from '../../ui/buttons/button/button';\nimport { useUIContext } from '../../ui/context/context';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport ChapterItem from './chapter-item/chapter-item';\nimport * as Styled from './chapters-list-styled';\nimport type { IChaptersListProps } from './chapters-list-types';\n\nconst ChaptersList: FC<IChaptersListProps> = memo(function ChaptersList({\n milestoneId,\n canUpdatePlan,\n chapters,\n ...restChaptersList\n}) {\n const { isGoalCreation, userType, onChapterClick, onAddChapter, isMilestoneActive } =\n restChaptersList;\n\n const { onClick: trackOnClick } = useUIContext();\n\n const handleOnAddChapter = useCallback(() => {\n trackOnClick({\n label: 'add_chapter_icon',\n props: {\n milestone_id: milestoneId,\n },\n });\n onAddChapter?.({ milestoneId, isGoalCreation });\n }, [milestoneId, isGoalCreation, onAddChapter, trackOnClick]);\n\n if (!chapters.length) {\n return (\n <Styled.ChaptersListContainer\n $gapX={6.75}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $background=\"WHITE\"\n >\n <img src={IMAGES.EMPTY_MIX_TESTS} alt=\"empty_mix_tests\" />\n <Separator heightX={2} />\n {userType === 'TEACHER' ? (\n <>\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n hidden={isMilestoneActive}\n tooltipItem=\"Plan is completed\"\n >\n <Button\n widthX={10}\n renderAs=\"primary\"\n shape=\"square\"\n size=\"small\"\n label=\"Add chapter\"\n onClick={handleOnAddChapter}\n disabled={!isMilestoneActive || !canUpdatePlan}\n analyticsProps={{\n milestone_id: milestoneId,\n }}\n />\n </ArrowTooltip>\n <Separator heightX={2} />\n </>\n ) : (\n <Text $renderAs=\"ab2-bold\" $color=\"BLACK_T_87\">\n Wait for the teacher to add a chapter\n </Text>\n )}\n </Styled.ChaptersListContainer>\n );\n }\n\n return (\n <Styled.ChaptersListContainer>\n <Styled.ChaptersWrapper>\n {chapters.map((chapter, idx) => {\n const { id } = chapter;\n\n return (\n <ChapterItem\n key={id}\n milestoneId={milestoneId}\n chapter={chapter}\n onChapterClick={onChapterClick}\n itemIndex={idx}\n shouldShowItemIndex\n />\n );\n })}\n </Styled.ChaptersWrapper>\n </Styled.ChaptersListContainer>\n );\n});\n\nexport default ChaptersList;\n"],"names":["ChaptersList","memo","milestoneId","canUpdatePlan","chapters","restChaptersList","isGoalCreation","userType","onChapterClick","onAddChapter","isMilestoneActive","trackOnClick","useUIContext","handleOnAddChapter","useCallback","jsx","Styled.ChaptersListContainer","Styled.ChaptersWrapper","chapter","idx","id","ChapterItem","jsxs","IMAGES","Separator","Fragment","ArrowTooltip","Button","Text","ChaptersList$1"],"mappings":";;;;;;;;;;AAYA,MAAMA,IAAuCC,EAAK,SAAsB;AAAA,EACtE,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC;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AAA,gBAAAK;AAAA,gBAACY;AAAA,gBAAA;AAAA,kBACC,QAAQ;AAAA,kBACR,UAAS;AAAA,kBACT,OAAM;AAAA,kBACN,MAAK;AAAA,kBACL,OAAM;AAAA,kBACN,SAASd;AAAA,kBACT,UAAU,CAACH,KAAqB,CAACP;AAAA,kBACjC,gBAAgB;AAAA,oBACd,cAAcD;AAAA,kBAChB;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UACF;AAAA,UACA,gBAAAa,EAACS,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,QAAA,EAAA,CACzB,IAEC,gBAAAT,EAAAa,GAAA,EAAK,WAAU,YAAW,QAAO,cAAa,UAE/C,yCAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AA0BV,CAAC,GAEDC,IAAe7B;"}
1
+ {"version":3,"file":"chapters-list.js","sources":["../../../../src/features/chapters/chapters-list/chapters-list.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, type FC } from 'react';\n\nimport { IMAGES } from '../../../assets/images/images';\nimport ArrowTooltip from '../../ui/arrow-tooltip/arrow-tooltip';\nimport Button from '../../ui/buttons/button/button';\nimport { useUIContext } from '../../ui/context/context';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport ChapterItem from './chapter-item/chapter-item';\nimport * as Styled from './chapters-list-styled';\nimport type { IChaptersListProps } from './chapters-list-types';\n\nconst ChaptersList: FC<IChaptersListProps> = memo(function ChaptersList(props) {\n const {\n milestoneId,\n canUpdatePlan,\n chapters,\n isGoalCreation,\n userType,\n onChapterClick,\n onAddChapter,\n isMilestoneActive,\n firstChapterRef,\n canStartJourney,\n startJourney,\n } = props;\n\n const { onClick: trackOnClick } = useUIContext();\n\n const handleOnAddChapter = useCallback(() => {\n trackOnClick({\n label: 'add_chapter_icon',\n props: {\n milestone_id: milestoneId,\n },\n });\n onAddChapter?.({ milestoneId, isGoalCreation });\n }, [milestoneId, isGoalCreation, onAddChapter, trackOnClick]);\n\n useEffect(() => {\n if (canStartJourney && startJourney) startJourney();\n }, [canStartJourney, startJourney]);\n\n if (!chapters.length) {\n return (\n <Styled.ChaptersListContainer\n $gapX={6.75}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $background=\"WHITE\"\n >\n <img src={IMAGES.EMPTY_MIX_TESTS} alt=\"empty_mix_tests\" />\n <Separator heightX={2} />\n {userType === 'TEACHER' ? (\n <>\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n hidden={isMilestoneActive}\n tooltipItem=\"Plan is completed\"\n >\n <Button\n widthX={10}\n renderAs=\"primary\"\n shape=\"square\"\n size=\"small\"\n label=\"Add chapter\"\n onClick={handleOnAddChapter}\n disabled={!isMilestoneActive || !canUpdatePlan}\n analyticsProps={{\n milestone_id: milestoneId,\n }}\n />\n </ArrowTooltip>\n <Separator heightX={2} />\n </>\n ) : (\n <Text $renderAs=\"ab2-bold\" $color=\"BLACK_T_87\">\n Wait for the teacher to add a chapter\n </Text>\n )}\n </Styled.ChaptersListContainer>\n );\n }\n\n return (\n <Styled.ChaptersListContainer>\n <Styled.ChaptersWrapper>\n {chapters.map((chapter, idx) => {\n const { id } = chapter;\n\n return (\n <ChapterItem\n key={id}\n firstChapterRef={idx === 0 ? firstChapterRef : undefined}\n milestoneId={milestoneId}\n chapter={chapter}\n onChapterClick={onChapterClick}\n itemIndex={idx}\n shouldShowItemIndex\n />\n );\n })}\n </Styled.ChaptersWrapper>\n </Styled.ChaptersListContainer>\n );\n});\n\nexport default ChaptersList;\n"],"names":["ChaptersList","memo","props","milestoneId","canUpdatePlan","chapters","isGoalCreation","userType","onChapterClick","onAddChapter","isMilestoneActive","firstChapterRef","canStartJourney","startJourney","trackOnClick","useUIContext","handleOnAddChapter","useCallback","useEffect","jsx","Styled.ChaptersListContainer","Styled.ChaptersWrapper","chapter","idx","id","ChapterItem","jsxs","IMAGES","Separator","Fragment","ArrowTooltip","Button","Text","ChaptersList$1"],"mappings":";;;;;;;;;;AAYA,M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AKQ,EAAO,iBAAiB,KAAI,mBAAkB;AAAA,QACxD,gBAAAR,EAACS,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,QACtBrB,MAAa,YAEV,gBAAAmB,EAAAG,GAAA,EAAA,UAAA;AAAA,UAAA,gBAAAV;AAAA,YAACW;AAAA,YAAA;AAAA,cACC,UAAS;AAAA,cACT,UAAS;AAAA,cACT,QAAQpB;AAAA,cACR,aAAY;AAAA,cAEZ,UAAA,gBAAAS;AAAA,gBAACY;AAAA,gBAAA;AAAA,kBACC,QAAQ;AAAA,kBACR,UAAS;AAAA,kBACT,OAAM;AAAA,kBACN,MAAK;AAAA,kBACL,OAAM;AAAA,kBACN,SAASf;AAAA,kBACT,UAAU,CAACN,KAAqB,CAACN;AAAA,kBACjC,gBAAgB;AAAA,oBACd,cAAcD;AAAA,kBAChB;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UACF;AAAA,UACA,gBAAAgB,EAACS,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,QAAA,EAAA,CACzB,IAEC,gBAAAT,EAAAa,GAAA,EAAK,WAAU,YAAW,QAAO,cAAa,UAE/C,yCAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AA2BV,CAAC,GAEDC,IAAejC;"}
@@ -1,33 +1,33 @@
1
- import { jsxs as p, jsx as o, Fragment as z } from "react/jsx-runtime";
2
- import { memo as G, useCallback as M, useEffect as f, useMemo as u } from "react";
3
- import { ILLUSTRATIONS as V } from "../../../assets/illustrations/illustrations.js";
4
- import q from "../../../assets/line-icons/icons/back2.js";
5
- import { useChallengeArenaJourney as K } from "../../journey/hooks/use-chapter-page-journey/use-challenge-arena-journey.js";
6
- import { useDownloadBlockJourney as Q } from "../../journey/hooks/use-chapter-page-journey/use-download-block-journey.js";
7
- import { useDownloadNodeJourney as Y } from "../../journey/hooks/use-chapter-page-journey/use-download-node-journey.js";
8
- import { useJourney as Z } from "../../journey/use-journey/use-journey.js";
9
- import ee from "../../ui/buttons/button/button.js";
10
- import oe from "../../ui/buttons/icon-button/icon-button.js";
11
- import te from "../../ui/layout/flex-view.js";
12
- import re from "../../ui/loader/app-loader/app-loader.js";
13
- import ne from "../../ui/text/text.js";
14
- import { useGetChapterDetails as ae } from "../api/chapter.js";
15
- import { getHasDownloadBlock as ie, getHasNonDownloadBlockWithPdfNode as se } from "../utils/index.js";
16
- import le from "./block-sections/block-sections.js";
17
- import ce from "./chapter-banner/chapter-banner.js";
18
- import { ContentWrapper as de, BackButtonContainer as me, BackButtonWrapper as pe, LoaderWrapper as fe } from "./chapter-details-styled.js";
19
- const ue = G(function(S) {
1
+ import { jsxs as f, jsx as o, Fragment as M } from "react/jsx-runtime";
2
+ import { memo as V, useCallback as q, useEffect as p, useMemo as u } from "react";
3
+ import { ILLUSTRATIONS as K } from "../../../assets/illustrations/illustrations.js";
4
+ import Q from "../../../assets/line-icons/icons/back2.js";
5
+ import { useChallengeArenaJourney as Y } from "../../journey/hooks/use-chapter-page-journey/use-challenge-arena-journey.js";
6
+ import { useDownloadBlockJourney as Z } from "../../journey/hooks/use-chapter-page-journey/use-download-block-journey.js";
7
+ import { useDownloadNodeJourney as ee } from "../../journey/hooks/use-chapter-page-journey/use-download-node-journey.js";
8
+ import { useJourney as oe } from "../../journey/use-journey/use-journey.js";
9
+ import te from "../../ui/buttons/button/button.js";
10
+ import re from "../../ui/buttons/icon-button/icon-button.js";
11
+ import ne from "../../ui/layout/flex-view.js";
12
+ import ae from "../../ui/loader/app-loader/app-loader.js";
13
+ import ie from "../../ui/text/text.js";
14
+ import { useGetChapterDetails as se } from "../api/chapter.js";
15
+ import { getHasDownloadBlock as le, getHasNonDownloadBlockWithPdfNode as ce } from "../utils/index.js";
16
+ import de from "./block-sections/block-sections.js";
17
+ import me from "./chapter-banner/chapter-banner.js";
18
+ import { ContentWrapper as fe, BackButtonContainer as pe, BackButtonWrapper as ue, LoaderWrapper as he } from "./chapter-details-styled.js";
19
+ const ge = V(function(S) {
20
20
  const {
21
21
  userChapterId: s,
22
22
  studentId: l,
23
23
  userType: t,
24
24
  onBlockSkipUnskip: J,
25
- onNodeAttempt: A,
26
- onNodeAssignAsHomework: b,
25
+ onNodeAttempt: b,
26
+ onNodeAssignAsHomework: A,
27
27
  onNodeMarkAsDone: $,
28
28
  onNodeReattempt: x,
29
- onNodeReview: I,
30
- onNodeView: v,
29
+ onNodeReview: v,
30
+ onNodeView: I,
31
31
  onExit: P,
32
32
  onNodeUnassign: _,
33
33
  onNodeUnlock: E,
@@ -40,53 +40,55 @@ const ue = G(function(S) {
40
40
  canStartJourney: r,
41
41
  canStartChallengeArenaJourney: h,
42
42
  canStartDownloadNodeJourney: c,
43
- canStartDownloadBlockJourney: n
44
- } = S, { isJourneyActive: g } = Z(), {
43
+ canStartDownloadBlockJourney: n,
44
+ nodeCardsRef: j,
45
+ backButtonRef: F
46
+ } = S, { isJourneyActive: g } = oe(), {
45
47
  get: k,
46
48
  data: e,
47
49
  isProcessing: a,
48
- isProcessingFailed: j,
49
- isStale: y
50
- } = ae(), i = M(() => {
50
+ isProcessingFailed: O,
51
+ isStale: B
52
+ } = se(), i = q(() => {
51
53
  k(s, void 0, { studentId: l });
52
54
  }, [k, s, l]);
53
- f(() => {
55
+ p(() => {
54
56
  i();
55
57
  }, [i]);
56
- const { blockSectionRef: F, startJourney: B } = K(), {
58
+ const { blockSectionRef: X, startJourney: y } = Y(), {
57
59
  blockSectionRef: w,
58
- downloadCoreBlockRef: O,
60
+ downloadCoreBlockRef: z,
59
61
  startJourney: C
60
- } = Y(), { blockSectionRef: D, startJourney: N } = Q(), R = u(
61
- () => e && ie(e.blocks),
62
+ } = ee(), { blockSectionRef: R, startJourney: D } = Z(), N = u(
63
+ () => e && le(e.blocks),
62
64
  [e]
63
65
  ), d = u(
64
- () => e && se(e.blocks),
66
+ () => e && ce(e.blocks),
65
67
  [e]
66
- ), X = u(
67
- () => c && d ? w : n ? D : void 0,
68
+ ), G = u(
69
+ () => c && d ? w : n ? R : void 0,
68
70
  [
69
71
  c,
70
72
  n,
71
73
  d,
72
74
  w,
73
- D
75
+ R
74
76
  ]
75
77
  );
76
- return f(() => {
78
+ return p(() => {
77
79
  e && !g && (r && m && m({
78
80
  chapterDetails: e,
79
81
  userChapterId: s,
80
82
  studentId: l,
81
83
  userType: t
82
- }), !r && h && B({
84
+ }), !r && h && y({
83
85
  chapterDetails: e,
84
86
  userType: t
85
87
  }), !r && c && d && C({
86
88
  chapterDetails: e,
87
89
  userType: t,
88
90
  canStartDownloadBlockJourney: n
89
- }), !r && n && R && N({
91
+ }), !r && n && N && D({
90
92
  chapterDetails: e,
91
93
  userType: t
92
94
  }));
@@ -95,23 +97,23 @@ const ue = G(function(S) {
95
97
  r,
96
98
  e,
97
99
  g,
98
- B,
100
+ y,
99
101
  m,
100
- N,
102
+ D,
101
103
  C,
102
104
  l,
103
105
  s,
104
106
  t,
105
107
  d,
106
- R,
108
+ N,
107
109
  c,
108
110
  n
109
- ]), f(() => {
110
- !a && y && i();
111
- }, [i, a, y]), j ? /* @__PURE__ */ p(te, { $flexGapX: 1.5, $height: "100vh", $justifyContent: "center", $alignItems: "center", children: [
112
- /* @__PURE__ */ o(ne, { $renderAs: "ab1-bold", children: "Oops! Something went wrong. Please try again later." }),
111
+ ]), p(() => {
112
+ !a && B && i();
113
+ }, [i, a, B]), O ? /* @__PURE__ */ f(ne, { $flexGapX: 1.5, $height: "100vh", $justifyContent: "center", $alignItems: "center", children: [
114
+ /* @__PURE__ */ o(ie, { $renderAs: "ab1-bold", children: "Oops! Something went wrong. Please try again later." }),
113
115
  /* @__PURE__ */ o(
114
- ee,
116
+ te,
115
117
  {
116
118
  widthX: 14,
117
119
  size: "small",
@@ -121,8 +123,8 @@ const ue = G(function(S) {
121
123
  onClick: i
122
124
  }
123
125
  )
124
- ] }) : !e && a ? /* @__PURE__ */ o(re, { height: "100vh" }) : /* @__PURE__ */ p(
125
- de,
126
+ ] }) : !e && a ? /* @__PURE__ */ o(ae, { height: "100vh" }) : /* @__PURE__ */ f(
127
+ fe,
126
128
  {
127
129
  ref: T,
128
130
  $widthX: 50,
@@ -131,20 +133,20 @@ const ue = G(function(S) {
131
133
  $alignItems: "center",
132
134
  $height: "max-content",
133
135
  children: [
134
- t === "TEACHER" && /* @__PURE__ */ o(me, { $height: "100%", className: "goal-widget-chapter-item", children: /* @__PURE__ */ o(pe, { children: /* @__PURE__ */ o(
135
- oe,
136
+ t === "TEACHER" && /* @__PURE__ */ o(pe, { $height: "100%", className: "goal-widget-chapter-item", children: /* @__PURE__ */ o(ue, { ref: F, children: /* @__PURE__ */ o(
137
+ re,
136
138
  {
137
- Icon: q,
139
+ Icon: Q,
138
140
  renderAs: "secondary-gray",
139
141
  analyticsLabel: "chapter_page_exit",
140
142
  size: "xsmall",
141
143
  onClick: P
142
144
  }
143
145
  ) }) }),
144
- a && /* @__PURE__ */ o(fe, { children: /* @__PURE__ */ o("img", { src: V.LOADER_1, alt: "loader" }) }),
145
- e && /* @__PURE__ */ p(z, { children: [
146
+ a && /* @__PURE__ */ o(he, { children: /* @__PURE__ */ o("img", { src: K.LOADER_1, alt: "loader" }) }),
147
+ e && /* @__PURE__ */ f(M, { children: [
146
148
  /* @__PURE__ */ o(
147
- ce,
149
+ me,
148
150
  {
149
151
  title: e.name,
150
152
  imageHue: e.image_hue,
@@ -153,35 +155,35 @@ const ue = G(function(S) {
153
155
  bannerRef: U
154
156
  }
155
157
  ),
156
- /* @__PURE__ */ o(
157
- le,
158
+ /* @__PURE__ */ o("div", { ref: j, children: /* @__PURE__ */ o(
159
+ de,
158
160
  {
159
161
  imageHue: e.image_hue,
160
162
  userType: t,
161
163
  blocks: e.blocks,
162
164
  onBlockSkipUnskip: J,
163
- onNodeAttempt: A,
164
- onNodeAssignAsHomework: b,
165
+ onNodeAttempt: b,
166
+ onNodeAssignAsHomework: A,
165
167
  onNodeMarkAsDone: $,
166
168
  onNodeReattempt: x,
167
- onNodeReview: I,
168
- onNodeView: v,
169
+ onNodeReview: v,
170
+ onNodeView: I,
169
171
  coreBlocksRef: W,
170
- challengeBlockRef: F,
171
- downloadCoreBlockRef: O,
172
- downloadBlockRef: X,
172
+ challengeBlockRef: X,
173
+ downloadCoreBlockRef: z,
174
+ downloadBlockRef: G,
173
175
  onNodeUnassign: _,
174
176
  onNodeUnlock: E,
175
177
  onNodeSkipUnSkip: H,
176
178
  onBlockReset: L
177
179
  }
178
- )
180
+ ) })
179
181
  ] })
180
182
  ]
181
183
  }
182
184
  );
183
- }), _e = ue;
185
+ }), He = ge;
184
186
  export {
185
- _e as default
187
+ He as default
186
188
  };
187
189
  //# sourceMappingURL=chapter-details.js.map