@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
@@ -0,0 +1,81 @@
1
+ import { jsx as v } from "react/jsx-runtime";
2
+ import { memo as D, useCallback as f } from "react";
3
+ import { NODE_TYPE as R } from "../../../sheets/constants/sheet.js";
4
+ import N from "../../../worksheet/worksheet-preview/dynamic-worksheet-preview/dynamic-worksheet-preview.js";
5
+ import { useTrialSessionContext as A } from "../../context/use-trial-session-context.js";
6
+ import { ELearningPlanView as w } from "../../trial-session-types.js";
7
+ import J from "../../../worksheet/worksheet-preview/worksheet-preview.js";
8
+ import { useWorksheetPreviewJourney as O } from "../../hooks/use-worksheet-preview-journey.js";
9
+ const U = D(
10
+ function({ resetScrollPosition: t }) {
11
+ const { studentId: n, formData: e, isTeacher: o, updateSlideConfig: r } = A(), i = o ? "TEACHER" : "STUDENT", {
12
+ name: C = "",
13
+ learningPlanChapterId: a,
14
+ learningPlanActiveMilestoneId: s,
15
+ previewWorksheetJourneyCompleted: y
16
+ } = e || {}, E = f(() => {
17
+ r({ previewWorksheetJourneyCompleted: !0 });
18
+ }, [r]), { worksheetBackIconRef: m, startJourney: c } = O({
19
+ onComplete: E
20
+ }), d = !!(o && !y), u = f(() => {
21
+ if (!o) return;
22
+ const T = s ? w.ADD_RESOURCE : void 0;
23
+ r({
24
+ learningPlanView: a ? w.VIEW_CHAPTER_DETAILS : T,
25
+ learningPlanWorksheetData: void 0
26
+ }), t();
27
+ }, [
28
+ o,
29
+ s,
30
+ r,
31
+ a,
32
+ t
33
+ ]), l = e == null ? void 0 : e.learningPlanWorksheetData;
34
+ if (!l) return null;
35
+ const {
36
+ itemRefs: P,
37
+ activityReference: p,
38
+ nodeType: k,
39
+ worksheetName: g,
40
+ activityType: W,
41
+ imageHue: I,
42
+ userNodeId: h
43
+ } = l;
44
+ return (!p || k === R.DYNAMIC) && h ? /* @__PURE__ */ v(
45
+ N,
46
+ {
47
+ userNodeId: h,
48
+ studentId: n,
49
+ studentName: C,
50
+ onBackIconClick: u,
51
+ userType: i,
52
+ worksheetBackIconRef: m,
53
+ canStartJourney: d,
54
+ startJourney: c
55
+ }
56
+ ) : /* @__PURE__ */ v(
57
+ J,
58
+ {
59
+ activityReference: p,
60
+ mode: "preview",
61
+ nodeType: k,
62
+ activityType: W,
63
+ userType: i,
64
+ studentId: n ?? "student-id",
65
+ worksheetName: g,
66
+ onBackIconClick: u,
67
+ items: P,
68
+ behaviorOverride: { navigationMode: "OPEN" },
69
+ layoutOverride: { containerWidth: "100%" },
70
+ imageHue: I ?? void 0,
71
+ worksheetBackIconRef: m,
72
+ canStartJourney: d,
73
+ startJourney: c
74
+ }
75
+ );
76
+ }
77
+ );
78
+ export {
79
+ U as default
80
+ };
81
+ //# sourceMappingURL=learning-preview-worksheet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"learning-preview-worksheet.js","sources":["../../../../../src/features/trial-session/comps/learning-plan/learning-preview-worksheet.tsx"],"sourcesContent":["import { type FC, memo, useCallback } from 'react';\n\nimport { NODE_TYPE } from '../../../sheets/constants/sheet';\nimport DynamicWorksheetPreview from '../../../worksheet/worksheet-preview/dynamic-worksheet-preview/dynamic-worksheet-preview';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { ELearningPlanView } from '../../trial-session-types';\nimport { type TNodeTypes } from '../../../../types/models/worksheet';\nimport PreviewWorksheet from '../../../worksheet/worksheet-preview/worksheet-preview';\nimport { useWorksheetPreviewJourney } from '../../hooks/use-worksheet-preview-journey';\nimport { type IBaseLearningPlanProps } from './learning-plan-types';\n\nconst LearningPreviewWorksheet: FC<IBaseLearningPlanProps> = memo(\n function LearningPreviewWorksheet({ resetScrollPosition }) {\n const { studentId, formData, isTeacher, updateSlideConfig } = useTrialSessionContext();\n\n const userType = isTeacher ? 'TEACHER' : 'STUDENT';\n const {\n name = '',\n learningPlanChapterId,\n learningPlanActiveMilestoneId,\n previewWorksheetJourneyCompleted,\n } = formData || {};\n\n const onJourneyCompleted = useCallback(() => {\n updateSlideConfig({ previewWorksheetJourneyCompleted: true });\n }, [updateSlideConfig]);\n\n const { worksheetBackIconRef, startJourney } = useWorksheetPreviewJourney({\n onComplete: onJourneyCompleted,\n });\n const canStartJourney = Boolean(isTeacher && !previewWorksheetJourneyCompleted);\n\n const handleExitWorksheet = useCallback(() => {\n if (!isTeacher) return;\n\n const addResourcesView = learningPlanActiveMilestoneId\n ? ELearningPlanView.ADD_RESOURCE\n : undefined;\n\n updateSlideConfig({\n learningPlanView: learningPlanChapterId\n ? ELearningPlanView.VIEW_CHAPTER_DETAILS\n : addResourcesView,\n learningPlanWorksheetData: undefined,\n });\n resetScrollPosition();\n }, [\n isTeacher,\n learningPlanActiveMilestoneId,\n updateSlideConfig,\n learningPlanChapterId,\n resetScrollPosition,\n ]);\n\n const worksheetData = formData?.learningPlanWorksheetData;\n\n if (!worksheetData) return null;\n\n const {\n itemRefs,\n activityReference,\n nodeType,\n worksheetName,\n activityType,\n imageHue,\n userNodeId,\n } = worksheetData;\n\n if ((!activityReference || nodeType === NODE_TYPE.DYNAMIC) && userNodeId) {\n return (\n <DynamicWorksheetPreview\n userNodeId={userNodeId}\n studentId={studentId}\n studentName={name}\n onBackIconClick={handleExitWorksheet}\n userType={userType}\n worksheetBackIconRef={worksheetBackIconRef}\n canStartJourney={canStartJourney}\n startJourney={startJourney}\n />\n );\n }\n\n return (\n <PreviewWorksheet\n activityReference={activityReference!}\n mode=\"preview\"\n nodeType={nodeType as TNodeTypes}\n activityType={activityType}\n userType={userType}\n studentId={studentId ?? 'student-id'}\n worksheetName={worksheetName}\n onBackIconClick={handleExitWorksheet}\n items={itemRefs}\n behaviorOverride={{ navigationMode: 'OPEN' }}\n layoutOverride={{ containerWidth: '100%' }}\n imageHue={imageHue ?? undefined}\n worksheetBackIconRef={worksheetBackIconRef}\n canStartJourney={canStartJourney}\n startJourney={startJourney}\n />\n );\n },\n);\n\nexport default LearningPreviewWorksheet;\n"],"names":["LearningPreviewWorksheet","memo","resetScrollPosition","studentId","formData","isTeacher","updateSlideConfig","useTrialSessionContext","userType","name","learningPlanChapterId","learningPlanActiveMilestoneId","previewWorksheetJourneyCompleted","onJourneyCompleted","useCallback","worksheetBackIconRef","startJourney","useWorksheetPreviewJourney","canStartJourney","handleExitWorksheet","addResourcesView","ELearningPlanView","worksheetData","itemRefs","activityReference","nodeType","worksheetName","activityType","imageHue","userNodeId","NODE_TYPE","jsx","DynamicWorksheetPreview","PreviewWorksheet"],"mappings":";;;;;;;;AAWA,MAAMA,IAAuDC;AAAA,EAC3D,SAAkC,EAAE,qBAAAC,KAAuB;AACzD,UAAM,EAAE,WAAAC,GAAW,UAAAC,GAAU,WAAAC,GAAW,mBAAAC,EAAA,IAAsBC,KAExDC,IAAWH,IAAY,YAAY,WACnC;AAAA,MACJ,MAAAI,IAAO;AAAA,MACP,uBAAAC;AAAA,MACA,+BAAAC;AAAA,MACA,kCAAAC;AAAA,IAAA,IACER,KAAY,CAAA,GAEVS,IAAqBC,EAAY,MAAM;AACzB,MAAAR,EAAA,EAAE,kCAAkC,GAAA,CAAM;AAAA,IAAA,GAC3D,CAACA,CAAiB,CAAC,GAEhB,EAAE,sBAAAS,GAAsB,cAAAC,EAAa,IAAIC,EAA2B;AAAA,MACxE,YAAYJ;AAAA,IAAA,CACb,GACKK,IAAkB,GAAQb,KAAa,CAACO,IAExCO,IAAsBL,EAAY,MAAM;AAC5C,UAAI,CAACT,EAAW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} from "react";
3
+ import S from "../../../milestone/milestone-tests/tests-creation/tests-creation-sync.js";
4
+ import { useTrialSessionContext as g } from "../../context/use-trial-session-context.js";
5
+ import { useUIContext as p } from "../../../ui/context/context.js";
6
+ const P = I(
7
+ function(a) {
8
+ const { resetScrollPosition: n } = a, { trialHomeData: l, studentId: c, teacherClassroomId: m, formData: u, isTeacher: e, updateSlideConfig: o } = g(), { onEvent: r } = p(), d = e ? "TEACHER" : "STUDENT", {
9
+ demo_info: { stream: f }
10
+ } = l || {}, { learningPlanActiveMilestoneId: t } = u || {}, s = i(() => {
11
+ e && (o({
12
+ learningPlanView: void 0,
13
+ learningPlanActiveMilestoneId: void 0
14
+ }), n());
15
+ }, [e, o, n]), E = i(
16
+ (T) => {
17
+ r("LEARNING_PLAN_SLIDE_ERROR", { message: T });
18
+ },
19
+ [r]
20
+ );
21
+ return t ? /* @__PURE__ */ C(
22
+ S,
23
+ {
24
+ channelId: `a-t-s-${m}-${t}`,
25
+ courseStream: f,
26
+ milestoneId: t,
27
+ studentId: c,
28
+ testNumber: 1,
29
+ userType: d,
30
+ onTestAssign: s,
31
+ onExit: s,
32
+ onError: E,
33
+ useAbsoluteFooter: !0
34
+ }
35
+ ) : null;
36
+ }
37
+ );
38
+ export {
39
+ P as default
40
+ };
41
+ //# sourceMappingURL=learning-test-creation-sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"learning-test-creation-sync.js","sources":["../../../../../src/features/trial-session/comps/learning-plan/learning-test-creation-sync.tsx"],"sourcesContent":["import { type FC, memo, useCallback } from 'react';\n\nimport TestsCreationSync from '../../../milestone/milestone-tests/tests-creation/tests-creation-sync';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { type IBaseLearningPlanProps } from './learning-plan-types';\nimport { useUIContext } from '../../../ui/context/context';\n\nconst LearningTestCreationSync: FC<IBaseLearningPlanProps> = memo(\n function LearningTestCreationSync(props) {\n const { resetScrollPosition } = props;\n const { trialHomeData, studentId, teacherClassroomId, formData, isTeacher, updateSlideConfig } =\n useTrialSessionContext();\n const { onEvent: trackEvent } = useUIContext();\n const userType = isTeacher ? 'TEACHER' : 'STUDENT';\n\n const {\n demo_info: { stream },\n } = trialHomeData || {};\n const { learningPlanActiveMilestoneId } = formData || {};\n\n const handleExitForm = useCallback(() => {\n if (!isTeacher) return;\n\n updateSlideConfig({\n learningPlanView: undefined,\n learningPlanActiveMilestoneId: undefined,\n });\n resetScrollPosition();\n }, [isTeacher, updateSlideConfig, resetScrollPosition]);\n\n const handleError = useCallback(\n (errorMessage?: string) => {\n trackEvent('LEARNING_PLAN_SLIDE_ERROR', { message: errorMessage });\n },\n [trackEvent],\n );\n\n if (!learningPlanActiveMilestoneId) return null;\n\n return (\n <TestsCreationSync\n channelId={`a-t-s-${teacherClassroomId}-${learningPlanActiveMilestoneId}`}\n courseStream={stream}\n milestoneId={learningPlanActiveMilestoneId}\n studentId={studentId}\n testNumber={1}\n userType={userType}\n onTestAssign={handleExitForm}\n onExit={handleExitForm}\n onError={handleError}\n useAbsoluteFooter\n />\n );\n },\n);\n\nexport default LearningTestCreationSync;\n"],"names":["LearningTestCreationSync","memo","props","resetScrollPosition","trialHomeData","studentId","teacherClassroomId","formData","isTeacher","updateSlideConfig","useTrialSessionContext","trackEvent","useUIContext","userType","stream","learningPlanActiveMilestoneId","handleExitForm","useCallback","handleError","errorMessage","jsx","TestsCreationSync"],"mappings":";;;;;AAOA,MAAMA,IAAuDC;AAAA,EAC3D,SAAkCC,GAAO;AACjC,UAAA,EAAE,qBAAAC,EAAwB,IAAAD,GAC1B,EAAE,eAAAE,GAAe,WAAAC,GAAW,oBAAAC,GAAoB,UAAAC,GAAU,WAAAC,GAAW,mBAAAC,MACzEC,KACI,EAAE,SAASC,EAAW,IAAIC,EAAa,GACvCC,IAAWL,IAAY,YAAY,WAEnC;AAAA,MACJ,WAAW,EAAE,QAAAM,EAAO;AAAA,IAAA,IAClBV,KAAiB,CAAA,GACf,EAAE,+BAAAW,EAAA,IAAkCR,KAAY,IAEhDS,IAAiBC,EAAY,MAAM;AACvC,MAAKT,MAEaC,EAAA;AAAA,QAChB,kBAAkB;AAAA,QAClB,+BAA+B;AAAA,MAAA,CAChC,GACmBN;IACnB,GAAA,CAACK,GAAWC,GAAmBN,CAAmB,CAAC,GAEhDe,IAAcD;AAAA,MAClB,CAACE,MAA0B;AACzB,QAAAR,EAAW,6BAA6B,EAAE,SAASQ,EAAc,CAAA;AAAA,MACnE;AAAA,MACA,CAACR,CAAU;AAAA,IAAA;AAGT,WAACI,IAGH,gBAAAK;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,WAAW,SAASf,CAAkB,IAAIS,CAA6B;AAAA,QACvE,cAAcD;AAAA,QACd,aAAaC;AAAA,QACb,WAAAV;AAAA,QACA,YAAY;AAAA,QACZ,UAAAQ;AAAA,QACA,cAAcG;AAAA,QACd,QAAQA;AAAA,QACR,SAASE;AAAA,QACT,mBAAiB;AAAA,MAAA;AAAA,IAAA,IAbsB;AAAA,EAgB7C;AACF;"}
@@ -0,0 +1,97 @@
1
+ import { jsx as o, Fragment as b, jsxs as f } from "react/jsx-runtime";
2
+ import { useRef as a, useCallback as s, useEffect as E, useMemo as k } from "react";
3
+ import y from "../../ui/layout/flex-view.js";
4
+ import { JOURNEY_ID_TEACHER as I } from "../../journey/journey-id/journey-id-teacher.js";
5
+ import { IndicatorType as T } from "../../journey/use-journey/constants.js";
6
+ import g from "../../ui/separator/separator.js";
7
+ import i from "../../ui/text/text.js";
8
+ import A from "../../journey/hooks/use-home-page-journey/tooltip-item.js";
9
+ import { useJourney as L } from "../../journey/use-journey/use-journey.js";
10
+ const D = ({ onComplete: d }) => {
11
+ const n = I.CHAPTER_DETAILS_INTRO_JOURNEY, e = a(null), t = a(null), O = a([]), { setJourney: m, clearJourney: r, nextCoachmark: c, isJourneyActive: u } = L(), h = s(() => {
12
+ document.body.style.overflow = "unset", r(), d();
13
+ }, [r, d]), l = s(() => {
14
+ c(n);
15
+ }, [n, c]), p = s(() => {
16
+ if (!(e != null && e.current) || !(t != null && t.current) || u) return;
17
+ const w = [
18
+ {
19
+ originalElementToHighlightRef: e,
20
+ elementToHighlight: /* @__PURE__ */ o(b, {}),
21
+ type: T.TOOLTIP,
22
+ indicator: {
23
+ width: 264,
24
+ renderAs: "primary",
25
+ tooltipXCoOrdinates: 145,
26
+ tooltipYCoOrdinates: 125,
27
+ arrowSize: 10,
28
+ arrowXCoOrdinates: -100,
29
+ position: "bottom",
30
+ backgroundColor: "PURPLE_4",
31
+ borderColor: "BLACK",
32
+ arrowColor: "BLACK",
33
+ tooltipItem: /* @__PURE__ */ o(
34
+ A,
35
+ {
36
+ element: /* @__PURE__ */ f(y, { children: [
37
+ /* @__PURE__ */ o(i, { $renderAs: "ub3-bold", children: "Open a worksheet" }),
38
+ /* @__PURE__ */ o(g, { height: 4 }),
39
+ /* @__PURE__ */ o(i, { $renderAs: "ub3", children: "Tap to open any worksheet." })
40
+ ] }),
41
+ buttonLabel: "Got it",
42
+ onButtonClick: l
43
+ }
44
+ )
45
+ }
46
+ },
47
+ {
48
+ originalElementToHighlightRef: t,
49
+ elementToHighlight: /* @__PURE__ */ o(b, {}),
50
+ type: T.TOOLTIP,
51
+ indicator: {
52
+ width: 283,
53
+ renderAs: "primary",
54
+ tooltipXCoOrdinates: 130,
55
+ tooltipYCoOrdinates: 40,
56
+ arrowSize: 10,
57
+ arrowXCoOrdinates: -115,
58
+ position: "bottom",
59
+ backgroundColor: "ORANGE_4",
60
+ borderColor: "BLACK",
61
+ arrowColor: "BLACK",
62
+ tooltipItem: /* @__PURE__ */ o(
63
+ A,
64
+ {
65
+ element: /* @__PURE__ */ f(y, { children: [
66
+ /* @__PURE__ */ o(i, { $renderAs: "ub3-bold", children: "Back to Goals" }),
67
+ /* @__PURE__ */ o(g, { height: 4 }),
68
+ /* @__PURE__ */ o(i, { $renderAs: "ub3", children: "Tap here to go back to learning home." })
69
+ ] }),
70
+ buttonLabel: "Got it",
71
+ onButtonClick: h
72
+ }
73
+ )
74
+ }
75
+ }
76
+ ];
77
+ m(n, w, void 0, !1);
78
+ const C = setTimeout(() => {
79
+ clearTimeout(C), document.body.style.overflow = "hidden", l();
80
+ }, 500);
81
+ O.current.push(C);
82
+ }, [h, l, u, n, m]);
83
+ return E(() => () => {
84
+ r && r();
85
+ }, [r]), k(
86
+ () => ({
87
+ nodeCardsRef: e,
88
+ backButtonRef: t,
89
+ startJourney: p
90
+ }),
91
+ [p]
92
+ );
93
+ };
94
+ export {
95
+ D as useChapterDetailsJourney
96
+ };
97
+ //# sourceMappingURL=use-chapter-details-journey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-chapter-details-journey.js","sources":["../../../../src/features/trial-session/hooks/use-chapter-details-journey.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, type RefObject } from 'react';\n\nimport type { IArrowTooltipProps } from '../../ui/arrow-tooltip/arrow-tooltip-types';\nimport FlexView from '../../ui/layout/flex-view';\nimport { JOURNEY_ID_TEACHER } from '../../journey/journey-id/journey-id-teacher';\nimport { IndicatorType } from '../../journey/use-journey/constants';\nimport type { TCoachmarkJourneyProps } from '../../journey/use-journey/journey-context-types';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport TooltipItem from '../../journey/hooks/use-home-page-journey/tooltip-item';\nimport { useJourney } from '../../journey/use-journey/use-journey';\n\ninterface IUseChapterDetailsJourney {\n (params: { onComplete: () => void }): {\n nodeCardsRef: RefObject<HTMLDivElement>;\n backButtonRef: RefObject<HTMLDivElement>;\n startJourney: () => void;\n };\n}\n\nconst useChapterDetailsJourney: IUseChapterDetailsJourney = ({ onComplete }) => {\n const journeyId = JOURNEY_ID_TEACHER.CHAPTER_DETAILS_INTRO_JOURNEY;\n\n // Refs for elements to highlight\n const nodeCardsRef = useRef<HTMLDivElement>(null) as RefObject<HTMLDivElement>;\n const backButtonRef = useRef<HTMLDivElement>(null) as RefObject<HTMLDivElement>;\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { setJourney, clearJourney, nextCoachmark, isJourneyActive } = useJourney();\n\n // Helper to mark journey as completed for a class\n const handleEndJourney = useCallback(() => {\n document.body.style.overflow = 'unset';\n clearJourney();\n onComplete();\n }, [clearJourney, onComplete]);\n\n const handleNextCoachmark = useCallback(() => {\n nextCoachmark(journeyId);\n }, [journeyId, nextCoachmark]);\n\n const startJourney = useCallback(() => {\n // Check if elements are absent or journey was already completed for this class\n if (!nodeCardsRef?.current || !backButtonRef?.current || isJourneyActive) return;\n\n const chapterDetailsSteps: TCoachmarkJourneyProps[] = [\n {\n originalElementToHighlightRef: nodeCardsRef,\n elementToHighlight: <></>,\n type: IndicatorType.TOOLTIP,\n indicator: {\n width: 264,\n renderAs: 'primary',\n tooltipXCoOrdinates: 145,\n tooltipYCoOrdinates: 125,\n arrowSize: 10,\n arrowXCoOrdinates: -100,\n position: 'bottom',\n backgroundColor: 'PURPLE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n tooltipItem: (\n <TooltipItem\n element={\n <FlexView>\n <Text $renderAs=\"ub3-bold\">Open a worksheet</Text>\n <Separator height={4} />\n <Text $renderAs=\"ub3\">Tap to open any worksheet.</Text>\n </FlexView>\n }\n buttonLabel=\"Got it\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: backButtonRef,\n elementToHighlight: <></>,\n type: IndicatorType.TOOLTIP,\n indicator: {\n width: 283,\n renderAs: 'primary',\n tooltipXCoOrdinates: 130,\n tooltipYCoOrdinates: 40,\n arrowSize: 10,\n arrowXCoOrdinates: -115,\n position: 'bottom',\n backgroundColor: 'ORANGE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n tooltipItem: (\n <TooltipItem\n element={\n <FlexView>\n <Text $renderAs=\"ub3-bold\">Back to Goals</Text>\n <Separator height={4} />\n <Text $renderAs=\"ub3\">Tap here to go back to learning home.</Text>\n </FlexView>\n }\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n },\n ];\n\n setJourney(journeyId, chapterDetailsSteps, undefined, false);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n document.body.style.overflow = 'hidden';\n handleNextCoachmark();\n }, 500);\n\n timerRefs.current.push(delayBeforeStart);\n }, [handleEndJourney, handleNextCoachmark, isJourneyActive, journeyId, setJourney]);\n\n useEffect(() => {\n return () => {\n if (clearJourney) {\n clearJourney();\n }\n };\n }, [clearJourney]);\n\n const data = useMemo(\n () => ({\n nodeCardsRef,\n backButtonRef,\n startJourney,\n }),\n [startJourney],\n );\n\n return data;\n};\n\nexport { useChapterDetailsJourney };\n"],"names":["useChapterDetailsJourney","onComplete","journeyId","JOURNEY_ID_TEACHER","nodeCardsRef","useRef","backButtonRef","timerRefs","setJourney","clearJourney","nextCoachmark","isJourneyActive","useJourney","handleEndJourney","useCallback","handleNextCoachmark","startJourney","chapterDetailsSteps","jsx","Fragment","IndicatorType","TooltipItem","FlexView","Text","Separator","delayBeforeStart","useEffect","useMemo"],"mappings":";;;;;;;;;AAoBA,MAAMA,IAAsD,CAAC,EAAE,YAAAC,QAAiB;AAC9E,QAAMC,IAAYC,EAAmB,+BAG/BC,IAAeC,EAAuB,IAAI,GAC1CC,IAAgBD,EAAuB,IAAI,GAC3CE,IAAYF,EAAwC,CAAA,CAAE,GAEtD,EAAE,YAAAG,GAAY,cAAAC,GAAc,eAAAC,GAAe,iBAAAC,EAAA,IAAoBC,KAG/DC,IAAmBC,EAAY,MAAM;AAChC,aAAA,KAAK,MAAM,WAAW,SAClBL,KACFR;EAAA,GACV,CAACQ,GAAcR,CAAU,CAAC,GAEvBc,IAAsBD,EAAY,MAAM;AAC5C,IAAAJ,EAAcR,CAAS;AAAA,EAAA,GACtB,CAACA,GAAWQ,CAAa,CAAC,GAEvBM,IAAeF,EAAY,MAAM;AAErC,QAAI,EAACV,KAAA,QAAAA,EAAc,YAAW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AL,EAACM,GAAU,EAAA,QAAQ,EAAG,CAAA;AAAA,gBACrB,gBAAAN,EAAAK,GAAA,EAAK,WAAU,OAAM,UAAqC,yCAAA;AAAA,cAAA,GAC7D;AAAA,cAEF,aAAY;AAAA,cACZ,eAAeV;AAAA,YAAA;AAAA,UACjB;AAAA,QAEJ;AAAA,MACF;AAAA,IAAA;AAGS,IAAAL,EAAAN,GAAWe,GAAqB,QAAW,EAAK;AAErD,UAAAQ,IAAmB,WAAW,MAAM;AACxC,mBAAaA,CAAgB,GACpB,SAAA,KAAK,MAAM,WAAW,UACXV;OACnB,GAAG;AAEI,IAAAR,EAAA,QAAQ,KAAKkB,CAAgB;AAAA,EAAA,GACtC,CAACZ,GAAkBE,GAAqBJ,GAAiBT,GAAWM,CAAU,CAAC;AAElF,SAAAkB,EAAU,MACD,MAAM;AACX,IAAIjB,KACWA;EACf,GAED,CAACA,CAAY,CAAC,GAEJkB;AAAA,IACX,OAAO;AAAA,MACL,cAAAvB;AAAA,MACA,eAAAE;AAAA,MACA,cAAAU;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIjB;"}
@@ -0,0 +1,105 @@
1
+ import { jsx as o, Fragment as y, jsxs as b } from "react/jsx-runtime";
2
+ import { useRef as a, useCallback as s, useEffect as w, useMemo as L } from "react";
3
+ import f from "../../ui/layout/flex-view.js";
4
+ import { JOURNEY_ID_TEACHER as I } from "../../journey/journey-id/journey-id-teacher.js";
5
+ import { IndicatorType as g } from "../../journey/use-journey/constants.js";
6
+ import T from "../../ui/separator/separator.js";
7
+ import l from "../../ui/text/text.js";
8
+ import A from "../../journey/hooks/use-home-page-journey/tooltip-item.js";
9
+ import { useJourney as J } from "../../journey/use-journey/use-journey.js";
10
+ const Y = ({ onComplete: d }) => {
11
+ const e = I.LEARNING_PLAN_INTRO_JOURNEY, r = a(null), t = a(null), O = a([]), { isJourneyActive: c, setJourney: m, clearJourney: n, nextCoachmark: i } = J(), u = s(() => {
12
+ i(e);
13
+ }, [e, i]), p = s(() => {
14
+ document.body.style.overflow = "unset", n(), d();
15
+ }, [n, d]), h = s(() => {
16
+ if (!(r != null && r.current) || !(t != null && t.current) || c)
17
+ return;
18
+ const E = [
19
+ {
20
+ originalElementToHighlightRef: r,
21
+ elementToHighlight: /* @__PURE__ */ o(y, {}),
22
+ type: g.TOOLTIP,
23
+ indicator: {
24
+ width: 264,
25
+ renderAs: "primary",
26
+ tooltipXCoOrdinates: -85,
27
+ tooltipYCoOrdinates: 40,
28
+ arrowSize: 10,
29
+ arrowXCoOrdinates: 102,
30
+ position: "bottom",
31
+ backgroundColor: "BLUE_4",
32
+ borderColor: "BLACK",
33
+ arrowColor: "BLACK",
34
+ tooltipItem: /* @__PURE__ */ o(
35
+ A,
36
+ {
37
+ element: /* @__PURE__ */ b(f, { children: [
38
+ /* @__PURE__ */ o(l, { $renderAs: "ub3-bold", children: "Edit a Goal" }),
39
+ /* @__PURE__ */ o(T, { height: 4 }),
40
+ /* @__PURE__ */ o(l, { $renderAs: "ub3", children: "You can always edit this later." })
41
+ ] }),
42
+ buttonLabel: "Got it",
43
+ onButtonClick: u
44
+ }
45
+ )
46
+ }
47
+ },
48
+ {
49
+ originalElementToHighlightRef: t,
50
+ elementToHighlight: /* @__PURE__ */ o(y, {}),
51
+ type: g.TOOLTIP,
52
+ indicator: {
53
+ width: 232,
54
+ renderAs: "primary",
55
+ tooltipXCoOrdinates: 175,
56
+ tooltipYCoOrdinates: 75,
57
+ arrowSize: 10,
58
+ arrowXCoOrdinates: 0,
59
+ position: "right",
60
+ backgroundColor: "GREEN_4",
61
+ borderColor: "BLACK",
62
+ arrowColor: "BLACK",
63
+ tooltipItem: /* @__PURE__ */ o(
64
+ A,
65
+ {
66
+ element: /* @__PURE__ */ b(f, { children: [
67
+ /* @__PURE__ */ o(l, { $renderAs: "ub3-bold", children: "Open a Chapter" }),
68
+ /* @__PURE__ */ o(T, { height: 4 }),
69
+ /* @__PURE__ */ o(l, { $renderAs: "ub3", children: "Tap to open any chapter." })
70
+ ] }),
71
+ buttonLabel: "Got it",
72
+ onButtonClick: p
73
+ }
74
+ )
75
+ }
76
+ }
77
+ ];
78
+ m(e, E, void 0, !1);
79
+ const C = setTimeout(() => {
80
+ clearTimeout(C), document.body.style.overflow = "hidden", i(e);
81
+ }, 500);
82
+ O.current.push(C);
83
+ }, [
84
+ p,
85
+ u,
86
+ c,
87
+ e,
88
+ i,
89
+ m
90
+ ]);
91
+ return w(() => () => {
92
+ n && n();
93
+ }, [n]), L(
94
+ () => ({
95
+ editButtonRef: r,
96
+ firstChapterRef: t,
97
+ startJourney: h
98
+ }),
99
+ [h]
100
+ );
101
+ };
102
+ export {
103
+ Y as useLearningPlanJourney
104
+ };
105
+ //# sourceMappingURL=use-learning-plan-journey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-learning-plan-journey.js","sources":["../../../../src/features/trial-session/hooks/use-learning-plan-journey.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, type RefObject } from 'react';\n\nimport type { IArrowTooltipProps } from '../../ui/arrow-tooltip/arrow-tooltip-types';\nimport FlexView from '../../ui/layout/flex-view';\nimport { JOURNEY_ID_TEACHER } from '../../journey/journey-id/journey-id-teacher';\nimport { IndicatorType } from '../../journey/use-journey/constants';\nimport type { TCoachmarkJourneyProps } from '../../journey/use-journey/journey-context-types';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport TooltipItem from '../../journey/hooks/use-home-page-journey/tooltip-item';\nimport { useJourney } from '../../journey/use-journey/use-journey';\n\ninterface IUseLearningPlanJourney {\n ({ onComplete }: { onComplete: () => void }): {\n editButtonRef: RefObject<HTMLDivElement>;\n firstChapterRef: RefObject<HTMLDivElement>;\n startJourney: () => void;\n };\n}\n\nconst useLearningPlanJourney: IUseLearningPlanJourney = ({ onComplete }) => {\n const journeyId = JOURNEY_ID_TEACHER.LEARNING_PLAN_INTRO_JOURNEY;\n\n // Refs for elements to highlight\n const editButtonRef = useRef<HTMLDivElement>(null) as RefObject<HTMLDivElement>;\n const firstChapterRef = useRef<HTMLDivElement>(null) as RefObject<HTMLDivElement>;\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { isJourneyActive, setJourney, clearJourney, nextCoachmark } = useJourney();\n\n const handleNextCoachmark = useCallback(() => {\n nextCoachmark(journeyId);\n }, [journeyId, nextCoachmark]);\n\n const handleEndJourney = useCallback(() => {\n document.body.style.overflow = 'unset';\n clearJourney();\n onComplete();\n }, [clearJourney, onComplete]);\n\n const startJourney = useCallback(() => {\n // Check if targeted is absent or journey was already completed or active for this class\n\n if (!editButtonRef?.current || !firstChapterRef?.current || isJourneyActive) {\n return;\n }\n\n const learningPlanSteps: TCoachmarkJourneyProps[] = [\n {\n originalElementToHighlightRef: editButtonRef,\n elementToHighlight: <></>,\n type: IndicatorType.TOOLTIP,\n indicator: {\n width: 264,\n renderAs: 'primary',\n tooltipXCoOrdinates: -85,\n tooltipYCoOrdinates: 40,\n arrowSize: 10,\n arrowXCoOrdinates: 102,\n position: 'bottom',\n backgroundColor: 'BLUE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n tooltipItem: (\n <TooltipItem\n element={\n <FlexView>\n <Text $renderAs=\"ub3-bold\">Edit a Goal</Text>\n <Separator height={4} />\n <Text $renderAs=\"ub3\">You can always edit this later.</Text>\n </FlexView>\n }\n buttonLabel=\"Got it\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: firstChapterRef,\n elementToHighlight: <></>,\n type: IndicatorType.TOOLTIP,\n indicator: {\n width: 232,\n renderAs: 'primary',\n tooltipXCoOrdinates: 175,\n tooltipYCoOrdinates: 75,\n arrowSize: 10,\n arrowXCoOrdinates: 0,\n position: 'right',\n backgroundColor: 'GREEN_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n tooltipItem: (\n <TooltipItem\n element={\n <FlexView>\n <Text $renderAs=\"ub3-bold\">Open a Chapter</Text>\n <Separator height={4} />\n <Text $renderAs=\"ub3\">Tap to open any chapter.</Text>\n </FlexView>\n }\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n },\n ];\n\n setJourney(journeyId, learningPlanSteps, undefined, false);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n document.body.style.overflow = 'hidden';\n nextCoachmark(journeyId);\n }, 500);\n\n timerRefs.current.push(delayBeforeStart);\n }, [\n handleEndJourney,\n handleNextCoachmark,\n isJourneyActive,\n journeyId,\n nextCoachmark,\n setJourney,\n ]);\n\n useEffect(() => {\n return () => {\n if (clearJourney) {\n clearJourney();\n }\n };\n }, [clearJourney]);\n\n const data = useMemo(\n () => ({\n editButtonRef,\n firstChapterRef,\n startJourney,\n }),\n [startJourney],\n );\n\n return data;\n};\n\nexport { useLearningPlanJourney };\n"],"names":["useLearningPlanJourney","onComplete","journeyId","JOURNEY_ID_TEACHER","editButtonRef","useRef","firstChapterRef","timerRefs","isJourneyActive","setJourney","clearJourney","nextCoachmark","useJourney","handleNextCoachmark","useCallback","handleEndJourney","startJourney","learningPlanSteps","jsx","Fragment","IndicatorType","TooltipItem","FlexView","Text","Separator","delayBeforeStart","useEffect","useMemo"],"mappings":";;;;;;;;;AAoBA,MAAMA,IAAkD,CAAC,EAAE,YAAAC,QAAiB;AAC1E,QAAMC,IAAYC,EAAmB,6BAG/BC,IAAgBC,EAAuB,IAAI,GAC3CC,IAAkBD,EAAuB,IAAI,GAC7CE,IAAYF,EAAwC,CAAA,CAAE,GAEtD,EAAE,iBAAAG,GAAiB,YAAAC,GAAY,cAAAC,GAAc,eAAAC,EAAA,IAAkBC,KAE/DC,IAAsBC,EAAY,MAAM;AAC5C,IAAAH,EAAcT,CAAS;AAAA,EAAA,GACtB,CAACA,GAAWS,CAAa,CAAC,GAEvBI,IAAmBD,EAAY,MAAM;AAChC,aAAA,KAAK,MAAM,WAAW,SAClBJ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C,2BACGC,GACC,EAAA,UAAA;AAAA,gBAAC,gBAAAJ,EAAAK,GAAA,EAAK,WAAU,YAAW,UAAc,kBAAA;AAAA,gBACzC,gBAAAL,EAACM,GAAU,EAAA,QAAQ,EAAG,CAAA;AAAA,gBACrB,gBAAAN,EAAAK,GAAA,EAAK,WAAU,OAAM,UAAwB,4BAAA;AAAA,cAAA,GAChD;AAAA,cAEF,aAAY;AAAA,cACZ,eAAeR;AAAA,YAAA;AAAA,UACjB;AAAA,QAEJ;AAAA,MACF;AAAA,IAAA;AAGS,IAAAN,EAAAP,GAAWe,GAAmB,QAAW,EAAK;AAEnD,UAAAQ,IAAmB,WAAW,MAAM;AACxC,mBAAaA,CAAgB,GACpB,SAAA,KAAK,MAAM,WAAW,UAC/Bd,EAAcT,CAAS;AAAA,OACtB,GAAG;AAEI,IAAAK,EAAA,QAAQ,KAAKkB,CAAgB;AAAA,EAAA,GACtC;AAAA,IACDV;AAAA,IACAF;AAAA,IACAL;AAAA,IACAN;AAAA,IACAS;AAAA,IACAF;AAAA,EAAA,CACD;AAED,SAAAiB,EAAU,MACD,MAAM;AACX,IAAIhB,KACWA;EACf,GAED,CAACA,CAAY,CAAC,GAEJiB;AAAA,IACX,OAAO;AAAA,MACL,eAAAvB;AAAA,MACA,iBAAAE;AAAA,MACA,cAAAU;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIjB;"}
@@ -0,0 +1,64 @@
1
+ import { jsx as t, Fragment as h, jsxs as T } from "react/jsx-runtime";
2
+ import { useRef as u, useCallback as d, useEffect as E, useMemo as b } from "react";
3
+ import { JOURNEY_ID_TEACHER as g } from "../../journey/journey-id/journey-id-teacher.js";
4
+ import A from "../../journey/hooks/use-home-page-journey/tooltip-item.js";
5
+ import { IndicatorType as C } from "../../journey/use-journey/constants.js";
6
+ import J from "../../ui/layout/flex-view.js";
7
+ import R from "../../ui/separator/separator.js";
8
+ import p from "../../ui/text/text.js";
9
+ import { useJourney as I } from "../../journey/use-journey/use-journey.js";
10
+ const U = ({ onComplete: n }) => {
11
+ const r = g.RESOURCE_ASSIGNMENT_INTRO_JOURNEY, e = u(null), f = u([]), { setJourney: i, nextCoachmark: s, clearJourney: o, isJourneyActive: m } = I(), a = d(() => {
12
+ document.body.style.overflow = "unset", o(), n();
13
+ }, [o, n]), l = d(() => {
14
+ if (!(e != null && e.current) || m) return;
15
+ const y = [
16
+ {
17
+ originalElementToHighlightRef: e,
18
+ elementToHighlight: /* @__PURE__ */ t(h, {}),
19
+ type: C.TOOLTIP,
20
+ indicator: {
21
+ width: 264,
22
+ renderAs: "primary",
23
+ tooltipXCoOrdinates: 85,
24
+ tooltipYCoOrdinates: 50,
25
+ arrowSize: 10,
26
+ position: "bottom",
27
+ backgroundColor: "PURPLE_4",
28
+ borderColor: "BLACK",
29
+ arrowColor: "BLACK",
30
+ tooltipItem: /* @__PURE__ */ t(
31
+ A,
32
+ {
33
+ element: /* @__PURE__ */ T(J, { children: [
34
+ /* @__PURE__ */ t(p, { $renderAs: "ub3-bold", children: "Assign Extra Practice" }),
35
+ /* @__PURE__ */ t(R, { height: 4 }),
36
+ /* @__PURE__ */ t(p, { $renderAs: "ub3", children: "Tap here to assign a new activity." })
37
+ ] }),
38
+ buttonLabel: "Got it",
39
+ onButtonClick: a
40
+ }
41
+ )
42
+ }
43
+ }
44
+ ];
45
+ i(r, y, void 0, !1);
46
+ const c = setTimeout(() => {
47
+ clearTimeout(c), document.body.style.overflow = "hidden", s(r);
48
+ }, 100);
49
+ f.current.push(c);
50
+ }, [a, m, r, s, i]);
51
+ return E(() => () => {
52
+ o && o();
53
+ }, [o]), b(
54
+ () => ({
55
+ assignResourceButtonRef: e,
56
+ startJourney: l
57
+ }),
58
+ [l]
59
+ );
60
+ };
61
+ export {
62
+ U as useResourceAssignmentJourney
63
+ };
64
+ //# sourceMappingURL=use-resource-assignment-journey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-resource-assignment-journey.js","sources":["../../../../src/features/trial-session/hooks/use-resource-assignment-journey.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, type RefObject } from 'react';\n\nimport { JOURNEY_ID_TEACHER } from '../../journey/journey-id/journey-id-teacher';\nimport TooltipItem from '../../journey/hooks/use-home-page-journey/tooltip-item';\nimport { IndicatorType } from '../../journey/use-journey/constants';\nimport type { TCoachmarkJourneyProps } from '../../journey/use-journey/journey-context-types';\nimport type { IArrowTooltipProps } from '../../ui/arrow-tooltip/arrow-tooltip-types';\nimport FlexView from '../../ui/layout/flex-view';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport { useJourney } from '../../journey/use-journey/use-journey';\n\ninterface IUseResourceAssignmentJourney {\n (props: { onComplete: () => void }): {\n assignResourceButtonRef: RefObject<HTMLDivElement>;\n startJourney: () => void;\n };\n}\n\nconst useResourceAssignmentJourney: IUseResourceAssignmentJourney = ({ onComplete }) => {\n const journeyId = JOURNEY_ID_TEACHER.RESOURCE_ASSIGNMENT_INTRO_JOURNEY;\n\n // Refs for elements to highlight\n const assignResourceButtonRef = useRef<HTMLDivElement>(null) as RefObject<HTMLDivElement>;\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { setJourney, nextCoachmark, clearJourney, isJourneyActive } = useJourney();\n\n const handleEndJourney = useCallback(() => {\n document.body.style.overflow = 'unset';\n clearJourney();\n onComplete();\n }, [clearJourney, onComplete]);\n\n const startJourney = useCallback(() => {\n // Check if elements are absent or journey was already completed for this class\n if (!assignResourceButtonRef?.current || isJourneyActive) return;\n\n const resourceAssignmentSteps: TCoachmarkJourneyProps[] = [\n {\n originalElementToHighlightRef: assignResourceButtonRef,\n elementToHighlight: <></>,\n type: IndicatorType.TOOLTIP,\n indicator: {\n width: 264,\n renderAs: 'primary',\n tooltipXCoOrdinates: 85,\n tooltipYCoOrdinates: 50,\n arrowSize: 10,\n position: 'bottom',\n backgroundColor: 'PURPLE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n tooltipItem: (\n <TooltipItem\n element={\n <FlexView>\n <Text $renderAs=\"ub3-bold\">Assign Extra Practice</Text>\n <Separator height={4} />\n <Text $renderAs=\"ub3\">Tap here to assign a new activity.</Text>\n </FlexView>\n }\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n },\n ];\n\n setJourney(journeyId, resourceAssignmentSteps, undefined, false);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n document.body.style.overflow = 'hidden';\n nextCoachmark(journeyId);\n }, 100);\n\n timerRefs.current.push(delayBeforeStart);\n }, [handleEndJourney, isJourneyActive, journeyId, nextCoachmark, setJourney]);\n\n useEffect(() => {\n return () => {\n if (clearJourney) {\n clearJourney();\n }\n };\n }, [clearJourney]);\n\n const data = useMemo(\n () => ({\n assignResourceButtonRef,\n startJourney,\n }),\n [startJourney],\n );\n\n return data;\n};\n\nexport { useResourceAssignmentJourney };\n"],"names":["useResourceAssignmentJourney","onComplete","journeyId","JOURNEY_ID_TEACHER","assignResourceButtonRef","useRef","timerRefs","setJourney","nextCoachmark","clearJourney","isJourneyActive","useJourney","handleEndJourney","useCallback","startJourney","resourceAssignmentSteps","jsx","Fragment","IndicatorType","TooltipItem","FlexView","Text","Separator","delayBeforeStart","useEffect","useMemo"],"mappings":";;;;;;;;;AAmBA,MAAMA,IAA8D,CAAC,EAAE,YAAAC,QAAiB;AACtF,QAAMC,IAAYC,EAAmB,mCAG/BC,IAA0BC,EAAuB,IAAI,GACrDC,IAAYD,EAAwC,CAAA,CAAE,GAEtD,EAAE,YAAAE,GAAY,eAAAC,GAAe,cAAAC,GAAc,iBAAAC,EAAA,IAAoBC,KAE/DC,IAAmBC,EAAY,MAAM;AAChC,aAAA,KAAK,MAAM,WAAW,SAClBJ,KACFR;EAAA,GACV,CAACQ,GAAcR,CAAU,CAAC,GAEvBa,IAAeD,EAAY,MAAM;AAEjC,QAAA,EAACT,KAAA,QAAAA,EAAyB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sx as e, Fragment as h, jsxs as T } from "react/jsx-runtime";
2
+ import { useRef as d, useCallback as c, useEffect as C, useMemo as b } from "react";
3
+ import { JOURNEY_ID_TEACHER as g } from "../../journey/journey-id/journey-id-teacher.js";
4
+ import E from "../../journey/hooks/use-home-page-journey/tooltip-item.js";
5
+ import { IndicatorType as A } from "../../journey/use-journey/constants.js";
6
+ import J from "../../ui/layout/flex-view.js";
7
+ import I from "../../ui/separator/separator.js";
8
+ import p from "../../ui/text/text.js";
9
+ import { useJourney as O } from "../../journey/use-journey/use-journey.js";
10
+ const j = ({ onComplete: n }) => {
11
+ const r = g.TEST_CREATION_INTRO_JOURNEY, o = d(null), f = d([]), { setJourney: i, nextCoachmark: s, clearJourney: t, isJourneyActive: a } = O(), l = c(() => {
12
+ document.body.style.overflow = "unset", t(), n();
13
+ }, [t, n]), m = c(() => {
14
+ if (!(o != null && o.current) || a) return;
15
+ const y = [
16
+ {
17
+ originalElementToHighlightRef: o,
18
+ elementToHighlight: /* @__PURE__ */ e(h, {}),
19
+ type: A.TOOLTIP,
20
+ indicator: {
21
+ width: 264,
22
+ renderAs: "primary",
23
+ tooltipXCoOrdinates: 85,
24
+ tooltipYCoOrdinates: 50,
25
+ arrowSize: 10,
26
+ position: "bottom",
27
+ backgroundColor: "BLUE_4",
28
+ borderColor: "BLACK",
29
+ arrowColor: "BLACK",
30
+ tooltipItem: /* @__PURE__ */ e(
31
+ E,
32
+ {
33
+ element: /* @__PURE__ */ T(J, { children: [
34
+ /* @__PURE__ */ e(p, { $renderAs: "ub3-bold", children: "Assign a test" }),
35
+ /* @__PURE__ */ e(I, { height: 4 }),
36
+ /* @__PURE__ */ e(p, { $renderAs: "ub3", children: "Tap here to assign a test." })
37
+ ] }),
38
+ buttonLabel: "Got it",
39
+ onButtonClick: l
40
+ }
41
+ )
42
+ }
43
+ }
44
+ ];
45
+ i(r, y, void 0, !1);
46
+ const u = setTimeout(() => {
47
+ clearTimeout(u), document.body.style.overflow = "hidden", s(r);
48
+ }, 100);
49
+ f.current.push(u);
50
+ }, [l, a, r, s, i]);
51
+ return C(() => () => {
52
+ t && t();
53
+ }, [t]), b(
54
+ () => ({
55
+ createTestButtonRef: o,
56
+ startJourney: m
57
+ }),
58
+ [m]
59
+ );
60
+ };
61
+ export {
62
+ j as useTestCreationJourney
63
+ };
64
+ //# sourceMappingURL=use-test-creation-journey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-test-creation-journey.js","sources":["../../../../src/features/trial-session/hooks/use-test-creation-journey.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, type RefObject } from 'react';\n\nimport { JOURNEY_ID_TEACHER } from '../../journey/journey-id/journey-id-teacher';\nimport TooltipItem from '../../journey/hooks/use-home-page-journey/tooltip-item';\nimport { IndicatorType } from '../../journey/use-journey/constants';\nimport type { TCoachmarkJourneyProps } from '../../journey/use-journey/journey-context-types';\nimport type { IArrowTooltipProps } from '../../ui/arrow-tooltip/arrow-tooltip-types';\nimport FlexView from '../../ui/layout/flex-view';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport { useJourney } from '../../journey/use-journey/use-journey';\n\ninterface IUseTestCreationJourney {\n (props: { onComplete: () => void }): {\n createTestButtonRef: RefObject<HTMLDivElement>;\n startJourney: () => void;\n };\n}\n\nconst useTestCreationJourney: IUseTestCreationJourney = ({ onComplete }) => {\n const journeyId = JOURNEY_ID_TEACHER.TEST_CREATION_INTRO_JOURNEY;\n\n // Refs for elements to highlight\n const createTestButtonRef = useRef<HTMLDivElement>(null) as RefObject<HTMLDivElement>;\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { setJourney, nextCoachmark, clearJourney, isJourneyActive } = useJourney();\n\n const handleEndJourney = useCallback(() => {\n document.body.style.overflow = 'unset';\n clearJourney();\n onComplete();\n }, [clearJourney, onComplete]);\n\n const startJourney = useCallback(() => {\n // Check if elements are absent or journey was already completed for this class\n if (!createTestButtonRef?.current || isJourneyActive) return;\n\n const testCreationSteps: TCoachmarkJourneyProps[] = [\n {\n originalElementToHighlightRef: createTestButtonRef,\n elementToHighlight: <></>,\n type: IndicatorType.TOOLTIP,\n indicator: {\n width: 264,\n renderAs: 'primary',\n tooltipXCoOrdinates: 85,\n tooltipYCoOrdinates: 50,\n arrowSize: 10,\n position: 'bottom',\n backgroundColor: 'BLUE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n tooltipItem: (\n <TooltipItem\n element={\n <FlexView>\n <Text $renderAs=\"ub3-bold\">Assign a test</Text>\n <Separator height={4} />\n <Text $renderAs=\"ub3\">Tap here to assign a test.</Text>\n </FlexView>\n }\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n },\n ];\n\n setJourney(journeyId, testCreationSteps, undefined, false);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n document.body.style.overflow = 'hidden';\n nextCoachmark(journeyId);\n }, 100);\n\n timerRefs.current.push(delayBeforeStart);\n }, [handleEndJourney, isJourneyActive, journeyId, nextCoachmark, setJourney]);\n\n useEffect(() => {\n return () => {\n if (clearJourney) {\n clearJourney();\n }\n };\n }, [clearJourney]);\n\n const data = useMemo(\n () => ({\n createTestButtonRef,\n startJourney,\n }),\n [startJourney],\n );\n\n return data;\n};\n\nexport { useTestCreationJourney };\n"],"names":["useTestCreationJourney","onComplete","journeyId","JOURNEY_ID_TEACHER","createTestButtonRef","useRef","timerRefs","setJourney","nextCoachmark","clearJourney","isJourneyActive","useJourney","handleEndJourney","useCallback","startJourney","testCreationSteps","jsx","Fragment","IndicatorType","TooltipItem","FlexView","Text","Separator","delayBeforeStart","useEffect","useMemo"],"mappings":";;;;;;;;;AAmBA,MAAMA,IAAkD,CAAC,EAAE,YAAAC,QAAiB;AAC1E,QAAMC,IAAYC,EAAmB,6BAG/BC,IAAsBC,EAAuB,IAAI,GACjDC,IAAYD,EAAwC,CAAA,CAAE,GAEtD,EAAE,YAAAE,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C;AAE5E,SAAAiB,EAAU,MACD,MAAM;AACX,IAAIf,KACWA;EACf,GAED,CAACA,CAAY,CAAC,GAEJgB;AAAA,IACX,OAAO;AAAA,MACL,qBAAArB;AAAA,MACA,cAAAU;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIjB;"}
@@ -0,0 +1,65 @@
1
+ import { jsx as r, Fragment as y, jsxs as T } from "react/jsx-runtime";
2
+ import { useRef as c, useCallback as d, useEffect as E, useMemo as b } from "react";
3
+ import C from "../../ui/layout/flex-view.js";
4
+ import { JOURNEY_ID_TEACHER as O } from "../../journey/journey-id/journey-id-teacher.js";
5
+ import { IndicatorType as g } from "../../journey/use-journey/constants.js";
6
+ import w from "../../ui/separator/separator.js";
7
+ import p from "../../ui/text/text.js";
8
+ import J from "../../journey/hooks/use-home-page-journey/tooltip-item.js";
9
+ import { useJourney as I } from "../../journey/use-journey/use-journey.js";
10
+ const P = ({ onComplete: n }) => {
11
+ const t = O.WORKSHEET_PREVIEW_INTRO_JOURNEY, o = c(null), f = c([]), { isJourneyActive: i, setJourney: s, clearJourney: e, nextCoachmark: a } = I(), l = d(() => {
12
+ document.body.style.overflow = "unset", e(), n();
13
+ }, [e, n]), m = d(() => {
14
+ if (!(o != null && o.current) || i) return;
15
+ const h = [
16
+ {
17
+ originalElementToHighlightRef: o,
18
+ elementToHighlight: /* @__PURE__ */ r(y, {}),
19
+ type: g.TOOLTIP,
20
+ indicator: {
21
+ width: 264,
22
+ renderAs: "primary",
23
+ tooltipXCoOrdinates: 125,
24
+ tooltipYCoOrdinates: 30,
25
+ arrowSize: 10,
26
+ arrowXCoOrdinates: -115,
27
+ position: "bottom",
28
+ backgroundColor: "YELLOW_4",
29
+ borderColor: "BLACK",
30
+ arrowColor: "WHITE",
31
+ tooltipItem: /* @__PURE__ */ r(
32
+ J,
33
+ {
34
+ element: /* @__PURE__ */ T(C, { children: [
35
+ /* @__PURE__ */ r(p, { $renderAs: "ub3-bold", children: "Back to Chapters" }),
36
+ /* @__PURE__ */ r(w, { height: 4 }),
37
+ /* @__PURE__ */ r(p, { $renderAs: "ub3", children: "Tap here to go back to chapters." })
38
+ ] }),
39
+ buttonLabel: "Got it",
40
+ onButtonClick: l
41
+ }
42
+ )
43
+ }
44
+ }
45
+ ];
46
+ s(t, h, void 0, !1);
47
+ const u = setTimeout(() => {
48
+ clearTimeout(u), document.body.style.overflow = "hidden", a(t);
49
+ }, 500);
50
+ f.current.push(u);
51
+ }, [i, l, s, t, a]);
52
+ return E(() => () => {
53
+ e && e();
54
+ }, [e]), b(
55
+ () => ({
56
+ worksheetBackIconRef: o,
57
+ startJourney: m
58
+ }),
59
+ [m]
60
+ );
61
+ };
62
+ export {
63
+ P as useWorksheetPreviewJourney
64
+ };
65
+ //# sourceMappingURL=use-worksheet-preview-journey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-worksheet-preview-journey.js","sources":["../../../../src/features/trial-session/hooks/use-worksheet-preview-journey.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, type RefObject } from 'react';\n\nimport type { IArrowTooltipProps } from '../../ui/arrow-tooltip/arrow-tooltip-types';\nimport FlexView from '../../ui/layout/flex-view';\nimport { JOURNEY_ID_TEACHER } from '../../journey/journey-id/journey-id-teacher';\nimport { IndicatorType } from '../../journey/use-journey/constants';\nimport type { TCoachmarkJourneyProps } from '../../journey/use-journey/journey-context-types';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport TooltipItem from '../../journey/hooks/use-home-page-journey/tooltip-item';\nimport { useJourney } from '../../journey/use-journey/use-journey';\n\ninterface IUseWorksheetPreviewJourney {\n ({ onComplete }: { onComplete: () => void }): {\n worksheetBackIconRef: RefObject<HTMLDivElement>;\n startJourney: () => void;\n };\n}\n\nconst useWorksheetPreviewJourney: IUseWorksheetPreviewJourney = ({ onComplete }) => {\n const journeyId = JOURNEY_ID_TEACHER.WORKSHEET_PREVIEW_INTRO_JOURNEY;\n\n // Refs for elements to highlight\n const worksheetBackIconRef = useRef<HTMLDivElement>(null) as RefObject<HTMLDivElement>;\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { isJourneyActive, setJourney, clearJourney, nextCoachmark } = useJourney();\n\n const handleEndJourney = useCallback(() => {\n document.body.style.overflow = 'unset';\n clearJourney();\n onComplete();\n }, [clearJourney, onComplete]);\n\n const startJourney = useCallback(() => {\n // Check if elements are absent or journey was already active for this class\n if (!worksheetBackIconRef?.current || isJourneyActive) return;\n\n const worksheetPreviewSteps: TCoachmarkJourneyProps[] = [\n {\n originalElementToHighlightRef: worksheetBackIconRef,\n elementToHighlight: <></>,\n type: IndicatorType.TOOLTIP,\n indicator: {\n width: 264,\n renderAs: 'primary',\n tooltipXCoOrdinates: 125,\n tooltipYCoOrdinates: 30,\n arrowSize: 10,\n arrowXCoOrdinates: -115,\n position: 'bottom',\n backgroundColor: 'YELLOW_4',\n borderColor: 'BLACK',\n arrowColor: 'WHITE',\n tooltipItem: (\n <TooltipItem\n element={\n <FlexView>\n <Text $renderAs=\"ub3-bold\">Back to Chapters</Text>\n <Separator height={4} />\n <Text $renderAs=\"ub3\">Tap here to go back to chapters.</Text>\n </FlexView>\n }\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n },\n ];\n\n setJourney(journeyId, worksheetPreviewSteps, undefined, false);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n document.body.style.overflow = 'hidden';\n nextCoachmark(journeyId);\n }, 500);\n\n timerRefs.current.push(delayBeforeStart);\n }, [isJourneyActive, handleEndJourney, setJourney, journeyId, nextCoachmark]);\n\n useEffect(() => {\n return () => {\n if (clearJourney) {\n clearJourney();\n }\n };\n }, [clearJourney]);\n\n const data = useMemo(\n () => ({\n worksheetBackIconRef,\n startJourney,\n }),\n [startJourney],\n );\n\n return data;\n};\n\nexport { useWorksheetPreviewJourney };\n"],"names":["useWorksheetPreviewJourney","onComplete","journeyId","JOURNEY_ID_TEACHER","worksheetBackIconRef","useRef","timerRefs","isJourneyActive","setJourney","clearJourney","nextCoachmark","useJourney","handleEndJourney","useCallback","startJourney","worksheetPreviewSteps","jsx","Fragment","IndicatorType","TooltipItem","FlexView","Text","Separator","delayBeforeStart","useEffect","useMemo"],"mappings":";;;;;;;;;AAmBA,MAAMA,IAA0D,CAAC,EAAE,YAAAC,QAAiB;AAClF,QAAMC,IAAYC,EAAmB,iCAG/BC,IAAuBC,EAAuB,IAAI,GAClDC,IAAYD,EAAwC,CAAA,CAAE,GAEtD,EAAE,iBAAAE,GAAiB,YAAAC,GAAY,cAAAC,GAAc,eAAAC,EAAA,IAAkBC,KAE/DC,IAAmBC,EAAY,MAAM;AAChC,aAAA,KAAK,MAAM,WAAW,SAClBJ,KACFR;EAAA,GACV,CAACQ,GAAcR,CAAU,CAAC,GAEvBa,IAAeD,EAAY,MAAM;AAEjC,QAAA,EAACT,KAAA,QAAAA,EAAsB,YAAWG,EAAiB;AAEvD,UAAMQ,IAAkD;AAAA,MACtD;AAAA,QACE,+BAA+BX;AAAA,QAC/B,oBAAsB,gBAAAY,EAAAC,GAAA,EAAA;AAAA,QACtB,MAAMC,EAAc;AAAA,QACpB,WAAW;AAAA,UACT,OAAO;AAAA,UACP,UAAU;AAAA,UACV,qBAAqB;AAAA,UACrB,qBAAqB;AAAA,UACrB,WAAW;AAAA,UACX,mBAAmB;AAAA,UACnB,UAAU;AAAA,UACV,iBAAiB;AAAA,UACjB,aAAa;AAAA,UACb,YAAY;AAAA,UACZ,aACE,gBAAAF;AAAA,YAACG;AAAA,YAAA;AAAA,cACC,2BACGC,GACC,EAAA,UAAA;AAAA,gBAAC,gBAAAJ,EAAAK,GAAA,EAAK,WAAU,YAAW,UAAgB,oBAAA;AAAA,gBAC3C,gBAAAL,EAACM,GAAU,EAAA,QAAQ,EAAG,CAAA;AAAA,gBACrB,gBAAAN,EAAAK,GAAA,EAAK,WAAU,OAAM,UAAgC,oCAAA;AAAA,cAAA,GACxD;AAAA,cAEF,aAAY;AAAA,cACZ,eAAeT;AAAA,YAAA;AAAA,UACjB;AAAA,QAEJ;AAAA,MACF;AAAA,IAAA;AAGS,IAAAJ,EAAAN,GAAWa,GAAuB,QAAW,EAAK;AAEvD,UAAAQ,IAAmB,WAAW,MAAM;AACxC,mBAAaA,CAAgB,GACpB,SAAA,KAAK,MAAM,WAAW,UAC/Bb,EAAcR,CAAS;AAAA,OACtB,GAAG;AAEI,IAAAI,EAAA,QAAQ,KAAKiB,CAAgB;AAAA,EAAA,GACtC,CAAChB,GAAiBK,GAAkBJ,GAAYN,GAAWQ,CAAa,CAAC;AAE5E,SAAAc,EAAU,MACD,MAAM;AACX,IAAIf,KACWA;EACf,GAED,CAACA,CAAY,CAAC,GAEJgB;AAAA,IACX,OAAO;AAAA,MACL,sBAAArB;AAAA,MACA,cAAAU;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIjB;"}
@@ -1,7 +1,7 @@
1
1
  import I from "../comps/additional-info/additional-info.js";
2
2
  import N from "../comps/class-preference/class-preference.js";
3
3
  import E from "../comps/communication-slide/index.js";
4
- import S from "../comps/learning-plan/index.js";
4
+ import S from "../comps/learning-plan/learning-plan.js";
5
5
  import i from "../comps/learning-session/learning-session.js";
6
6
  import r from "../comps/offering-information/offering-information.js";
7
7
  import T from "../comps/pricing/pricing.js";