@cuemath/leap 3.3.32-j2 → 3.3.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/auth/pla-signup/pla-analytics-events.js +1 -7
- package/dist/features/auth/pla-signup/pla-analytics-events.js.map +1 -1
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js.map +1 -1
- package/dist/features/auth/signup/custom-input-field/custom-input-field.js +8 -8
- package/dist/features/auth/signup/custom-input-field/custom-input-field.js.map +1 -1
- package/dist/features/milestone/constants.js +28 -15
- package/dist/features/milestone/constants.js.map +1 -1
- package/dist/features/milestone/create/comps/test-type-step/test-type-utils.js +23 -16
- package/dist/features/milestone/create/comps/test-type-step/test-type-utils.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-helpers.js +7 -13
- package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
- package/dist/features/trial-session/comps/class-preference/class-preference.js +49 -61
- package/dist/features/trial-session/comps/class-preference/class-preference.js.map +1 -1
- package/dist/features/trial-session/comps/navigation-bar/index.js +25 -25
- package/dist/features/trial-session/comps/navigation-bar/index.js.map +1 -1
- package/dist/features/trial-session/comps/school-goals/school-goals.js +53 -55
- package/dist/features/trial-session/comps/school-goals/school-goals.js.map +1 -1
- package/dist/features/trial-session/comps/session-report/session-report.js +15 -15
- package/dist/features/trial-session/comps/session-report/session-report.js.map +1 -1
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js +43 -44
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js.map +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js +0 -5
- package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js.map +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js +51 -96
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js.map +1 -1
- package/dist/features/trial-session/comps/student-profile/student-profile.js +63 -70
- package/dist/features/trial-session/comps/student-profile/student-profile.js.map +1 -1
- package/dist/features/trial-session/comps/test-prep/test-prep.js +39 -40
- package/dist/features/trial-session/comps/test-prep/test-prep.js.map +1 -1
- package/dist/features/trial-session/helper.js +53 -69
- package/dist/features/trial-session/helper.js.map +1 -1
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js +130 -150
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js.map +1 -1
- package/dist/features/trial-session/trial-session-types.js.map +1 -1
- package/dist/features/trial-session/trial-session-view.js +112 -103
- package/dist/features/trial-session/trial-session-view.js.map +1 -1
- package/dist/features/ui/accordion/accordion-items/accordion-items.js +13 -13
- package/dist/features/ui/accordion/accordion-items/accordion-items.js.map +1 -1
- package/dist/features/utils/utils.js +1 -1
- package/dist/features/utils/utils.js.map +1 -1
- package/dist/index.d.ts +4 -20
- package/dist/index.js +30 -32
- package/dist/index.js.map +1 -1
- package/dist/node_modules/query-string/base.js +1 -1
- package/dist/node_modules/query-string/node_modules/decode-uri-component/index.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/regex.js +5 -0
- package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +2 -3
- package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +10 -6
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +9 -12
- package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/validate.js +8 -0
- package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +1 -0
- package/package.json +1 -1
- package/dist/features/student-username/add/add-student-username-constants.js +0 -6
- package/dist/features/student-username/add/add-student-username-constants.js.map +0 -1
- package/dist/features/student-username/add/add-student-username-helpers.js +0 -6
- package/dist/features/student-username/add/add-student-username-helpers.js.map +0 -1
- package/dist/features/student-username/add/add-student-username-styled.js +0 -10
- package/dist/features/student-username/add/add-student-username-styled.js.map +0 -1
- package/dist/features/student-username/add/add-student-username.js +0 -78
- package/dist/features/student-username/add/add-student-username.js.map +0 -1
- package/dist/features/student-username/add/api/update-username.js +0 -9
- package/dist/features/student-username/add/api/update-username.js.map +0 -1
- package/dist/features/student-username/add/api/username-availability.js +0 -10
- package/dist/features/student-username/add/api/username-availability.js.map +0 -1
- package/dist/features/student-username/add/hooks/use-check-username-availability.js +0 -41
- package/dist/features/student-username/add/hooks/use-check-username-availability.js.map +0 -1
- package/dist/features/trial-session/api/teacher-availability.js +0 -9
- package/dist/features/trial-session/api/teacher-availability.js.map +0 -1
- package/dist/features/trial-session/comps/class-preference/helpers.js +0 -28
- package/dist/features/trial-session/comps/class-preference/helpers.js.map +0 -1
- package/dist/features/trial-session/hooks/use-slide-config-update.js +0 -49
- package/dist/features/trial-session/hooks/use-slide-config-update.js.map +0 -1
- package/dist/node_modules/decode-uri-component/index.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/native.js +0 -7
- package/dist/node_modules/uuid/dist/esm-browser/native.js.map +0 -1
- /package/dist/node_modules/{decode-uri-component → query-string/node_modules/decode-uri-component}/index.js +0 -0
|
@@ -1,102 +1,95 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { ILLUSTRATIONS as
|
|
4
|
-
import { GOAL_CATEGORY as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { useGetStudentProfileSummary as
|
|
1
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { memo as H, useMemo as L, useCallback as k, useEffect as d } from "react";
|
|
3
|
+
import { ILLUSTRATIONS as f } from "../../../../assets/illustrations/illustrations.js";
|
|
4
|
+
import { GOAL_CATEGORY as $ } from "../../../milestone/constants.js";
|
|
5
|
+
import N from "../../../ui/error/error.js";
|
|
6
|
+
import U from "../../../ui/image/image.js";
|
|
7
|
+
import C from "../../../ui/layout/flex-view.js";
|
|
8
|
+
import v from "../../../ui/loader/app-loader/app-loader.js";
|
|
9
|
+
import M from "../../../ui/separator/separator.js";
|
|
10
|
+
import I from "../../../ui/text/text.js";
|
|
11
|
+
import { useGetStudentProfileSummary as W } from "../../api/student-profile-summary.js";
|
|
12
12
|
import { useTrialSessionContext as X } from "../../context/use-trial-session-context.js";
|
|
13
|
-
import { getFormattedStudentPersonalizedPreference as
|
|
13
|
+
import { getFormattedStudentPersonalizedPreference as K } from "../../helper.js";
|
|
14
14
|
import j from "../slide-header/index.js";
|
|
15
15
|
import { GOAL_MAPPING as z } from "./constant.js";
|
|
16
16
|
import F from "./student-profile-highlights/student-profile-highlights.js";
|
|
17
|
-
import { Container as V, ContentWrapper as
|
|
18
|
-
import { getDummyProfileImage as J, getMilestoneGoalName as
|
|
19
|
-
const he =
|
|
17
|
+
import { Container as V, ContentWrapper as y, AbsoluteImage as Y, ImageWrapper as q } from "./student-profile-styled.js";
|
|
18
|
+
import { getDummyProfileImage as J, getMilestoneGoalName as A } from "./student-profile-utils.js";
|
|
19
|
+
const he = H(() => {
|
|
20
20
|
const {
|
|
21
|
-
isTeacher:
|
|
21
|
+
isTeacher: o,
|
|
22
22
|
studentId: u,
|
|
23
|
-
formData:
|
|
24
|
-
slideConfig:
|
|
25
|
-
milestoneConfig:
|
|
26
|
-
updateSlideConfig:
|
|
27
|
-
updateButtonState:
|
|
28
|
-
} = X(), { showProfileHighlights: r } =
|
|
29
|
-
name:
|
|
23
|
+
formData: b,
|
|
24
|
+
slideConfig: G,
|
|
25
|
+
milestoneConfig: c,
|
|
26
|
+
updateSlideConfig: p,
|
|
27
|
+
updateButtonState: g
|
|
28
|
+
} = X(), { showProfileHighlights: r } = G, {
|
|
29
|
+
name: O,
|
|
30
30
|
goals: t = [],
|
|
31
|
-
studentProfile:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} =
|
|
35
|
-
school_success_goal:
|
|
36
|
-
test_prep_goal:
|
|
31
|
+
studentProfile: i,
|
|
32
|
+
personalizedLevel: h = [],
|
|
33
|
+
personalizedObjectives: P = []
|
|
34
|
+
} = b || {}, { dummyProfileImageIndex: x, profileSummary: R } = i || {}, T = J(x), m = L(() => t && t.length > 0 ? {
|
|
35
|
+
school_success_goal: A(t, $.SCHOOL_SUCCESS),
|
|
36
|
+
test_prep_goal: A(t, $.TEST_PREP)
|
|
37
37
|
} : null, [t]), {
|
|
38
38
|
get: S,
|
|
39
|
-
data:
|
|
40
|
-
isProcessing:
|
|
41
|
-
isProcessed:
|
|
42
|
-
isProcessingFailed:
|
|
43
|
-
} =
|
|
44
|
-
|
|
45
|
-
}, [S,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, [
|
|
49
|
-
|
|
50
|
-
}, [
|
|
51
|
-
|
|
39
|
+
data: w,
|
|
40
|
+
isProcessing: l,
|
|
41
|
+
isProcessed: _,
|
|
42
|
+
isProcessingFailed: D
|
|
43
|
+
} = W(), { profile_summary: E } = w || {}, s = k(() => {
|
|
44
|
+
m && S(u, m);
|
|
45
|
+
}, [S, m, u]);
|
|
46
|
+
d(() => {
|
|
47
|
+
g("right", { isDisabled: l, isLoading: !1 });
|
|
48
|
+
}, [l, g]), d(() => {
|
|
49
|
+
o && !i && !r && s();
|
|
50
|
+
}, [s, o, i, r]), d(() => {
|
|
51
|
+
o && _ && !r && p({
|
|
52
52
|
studentProfile: {
|
|
53
53
|
profileSummary: E || "",
|
|
54
54
|
dummyProfileImageIndex: Math.floor(Math.random() * 6)
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
|
-
}, [
|
|
58
|
-
const
|
|
57
|
+
}, [_, o, r, E, p]);
|
|
58
|
+
const B = L(
|
|
59
59
|
() => [
|
|
60
60
|
{
|
|
61
|
-
title: "
|
|
62
|
-
description: `Catching up: ${
|
|
63
|
-
|
|
64
|
-
_
|
|
65
|
-
).map((o) => o.preference_description)}`,
|
|
66
|
-
illustration: c.KNOWLEDGE_BLUE,
|
|
61
|
+
title: "Studnet Level",
|
|
62
|
+
description: `Catching up: ${h[0]}`,
|
|
63
|
+
illustration: f.KNOWLEDGE_BLUE,
|
|
67
64
|
background: "BLUE_1"
|
|
68
65
|
},
|
|
69
66
|
{
|
|
70
|
-
illustration:
|
|
67
|
+
illustration: f.ARROW_BOARD_GREEN,
|
|
71
68
|
background: "GREEN_1",
|
|
72
69
|
title: "Goals",
|
|
73
|
-
description:
|
|
74
|
-
|
|
70
|
+
description: K(
|
|
71
|
+
c,
|
|
75
72
|
P
|
|
76
|
-
).map((
|
|
73
|
+
).map((n) => n.preference_name)
|
|
77
74
|
},
|
|
78
75
|
{
|
|
79
|
-
illustration:
|
|
76
|
+
illustration: f.BOOK_CHECKED_PURPLE,
|
|
80
77
|
background: "PURPLE_1",
|
|
81
78
|
title: "Learning Plan",
|
|
82
79
|
description: t.map(
|
|
83
|
-
(
|
|
80
|
+
(n) => `${z[n.goal_category]}: ${n.milestone_name}`
|
|
84
81
|
)
|
|
85
82
|
}
|
|
86
83
|
],
|
|
87
|
-
[t,
|
|
84
|
+
[t, c, h, P]
|
|
88
85
|
);
|
|
89
|
-
return
|
|
90
|
-
/* @__PURE__ */ e(
|
|
86
|
+
return D ? /* @__PURE__ */ e(N, { height: "70vh", onTryAgain: s }) : l || !i && !r ? /* @__PURE__ */ e(v, { height: "100vh" }) : /* @__PURE__ */ a(V, { children: [
|
|
87
|
+
/* @__PURE__ */ e(M, { height: 60 }),
|
|
91
88
|
/* @__PURE__ */ e(j, { marginBottom: r ? 50 : 100 }),
|
|
92
|
-
r ? /* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */ e(F, { profileHighlights: k }),
|
|
94
|
-
/* @__PURE__ */ e(I, { height: 16 }),
|
|
95
|
-
/* @__PURE__ */ e(p, { $renderAs: "ub3", $color: "BLACK_T_60", $align: "center", children: "We can always revisit this later" })
|
|
96
|
-
] }) : /* @__PURE__ */ i(b, { $widthX: 46.875, children: [
|
|
89
|
+
r ? /* @__PURE__ */ e(y, { $width: 650, children: /* @__PURE__ */ e(F, { profileHighlights: B }) }) : /* @__PURE__ */ a(y, { $widthX: 46.875, children: [
|
|
97
90
|
/* @__PURE__ */ e(Y, {}),
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
|
|
91
|
+
/* @__PURE__ */ a(
|
|
92
|
+
C,
|
|
100
93
|
{
|
|
101
94
|
$width: "100%",
|
|
102
95
|
$heightX: 21.875,
|
|
@@ -108,10 +101,10 @@ const he = N(() => {
|
|
|
108
101
|
$borderColor: "BLACK_T_87",
|
|
109
102
|
$borderRadiusX: 0.5,
|
|
110
103
|
children: [
|
|
111
|
-
/* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */ e(
|
|
114
|
-
/* @__PURE__ */ e(
|
|
104
|
+
/* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(U, { withLoader: !0, height: 200, width: 200, src: T }) }),
|
|
105
|
+
/* @__PURE__ */ a(C, { $flexGap: 16, children: [
|
|
106
|
+
/* @__PURE__ */ e(I, { $renderAs: "ac2-black", children: O }),
|
|
107
|
+
/* @__PURE__ */ e(I, { $renderAs: "ab1", children: R || "" })
|
|
115
108
|
] })
|
|
116
109
|
]
|
|
117
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"student-profile.js","sources":["../../../../../src/features/trial-session/comps/student-profile/student-profile.tsx"],"sourcesContent":["import type { TGoalCategory } from '../../../milestone/create/milestone-create-types';\nimport type { TColorNames } from '../../../ui/types';\nimport type { IGetStudentProfileSummaryQuery } from '../../api/student-profile-summary';\n\nimport { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport Error from '../../../ui/error/error';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useGetStudentProfileSummary } from '../../api/student-profile-summary';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { getFormattedStudentPersonalizedPreference } from '../../helper';\nimport SlideHeader from '../slide-header';\nimport { GOAL_MAPPING } from './constant';\nimport StudentProfileHighlights from './student-profile-highlights/student-profile-highlights';\nimport * as Styled from './student-profile-styled';\nimport { getDummyProfileImage, getMilestoneGoalName } from './student-profile-utils';\n\ntype TProfileHighlight = {\n illustration: string;\n background: TColorNames;\n title: string;\n description: string | string[];\n};\n\nconst StudentProfile = memo(() => {\n const {\n isTeacher,\n studentId,\n formData,\n slideConfig,\n milestoneConfig,\n updateSlideConfig,\n updateButtonState,\n } = useTrialSessionContext();\n const { showProfileHighlights } = slideConfig;\n\n const {\n name,\n goals = [],\n studentProfile,\n personalizedObjectives = [],\n personalizedPosition = [],\n } = formData || {};\n const { dummyProfileImageIndex, profileSummary } = studentProfile || {};\n const dummyProfileImage = getDummyProfileImage(dummyProfileImageIndex);\n\n const payload = useMemo<IGetStudentProfileSummaryQuery | null>(() => {\n if (goals && goals.length > 0) {\n return {\n school_success_goal: getMilestoneGoalName(goals, GOAL_CATEGORY.SCHOOL_SUCCESS),\n test_prep_goal: getMilestoneGoalName(goals, GOAL_CATEGORY.TEST_PREP),\n };\n }\n\n return null;\n }, [goals]);\n\n const {\n get: getStudentProfileSummary,\n data,\n isProcessing,\n isProcessed,\n isProcessingFailed,\n } = useGetStudentProfileSummary();\n const { profile_summary: studentProfileSummary } = data || {};\n\n const fetchData = useCallback(() => {\n if (payload) {\n getStudentProfileSummary(studentId, payload);\n }\n }, [getStudentProfileSummary, payload, studentId]);\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: isProcessing, isLoading: false });\n }, [isProcessing, updateButtonState]);\n\n useEffect(() => {\n if (isTeacher && !studentProfile && !showProfileHighlights) {\n fetchData();\n }\n }, [fetchData, isTeacher, studentProfile, showProfileHighlights]);\n\n useEffect(() => {\n if (isTeacher && isProcessed && !showProfileHighlights) {\n updateSlideConfig({\n studentProfile: {\n profileSummary: studentProfileSummary || '',\n dummyProfileImageIndex: Math.floor(Math.random() * 6),\n },\n });\n }\n }, [isProcessed, isTeacher, showProfileHighlights, studentProfileSummary, updateSlideConfig]);\n\n const profileHighlights: TProfileHighlight[] = useMemo(\n () => [\n {\n title: 'Student Level',\n description: `Catching up: ${getFormattedStudentPersonalizedPreference(\n milestoneConfig,\n personalizedPosition,\n ).map(objectives => objectives.preference_description)}`,\n illustration: ILLUSTRATIONS.KNOWLEDGE_BLUE,\n background: 'BLUE_1',\n },\n {\n illustration: ILLUSTRATIONS.ARROW_BOARD_GREEN,\n background: 'GREEN_1',\n title: 'Goals',\n description: getFormattedStudentPersonalizedPreference(\n milestoneConfig,\n personalizedObjectives,\n ).map(objectives => objectives.preference_name),\n },\n {\n illustration: ILLUSTRATIONS.BOOK_CHECKED_PURPLE,\n background: 'PURPLE_1',\n title: 'Learning Plan',\n description: goals.map(\n goal => `${GOAL_MAPPING[goal.goal_category as TGoalCategory]}: ${goal.milestone_name}`,\n ),\n },\n ],\n [goals, milestoneConfig, personalizedObjectives, personalizedPosition],\n );\n\n if (isProcessingFailed) {\n return <Error height=\"70vh\" onTryAgain={fetchData} />;\n }\n\n if (isProcessing || (!studentProfile && !showProfileHighlights)) {\n return <AppLoader height=\"100vh\" />;\n }\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader marginBottom={showProfileHighlights ? 50 : 100} />\n {showProfileHighlights ? (\n <Styled.ContentWrapper $width={650}>\n <StudentProfileHighlights profileHighlights={profileHighlights} />\n <Separator height={16} />\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\" $align=\"center\">\n We can always revisit this later\n </Text>\n </Styled.ContentWrapper>\n ) : (\n <Styled.ContentWrapper $widthX={46.875}>\n <Styled.AbsoluteImage />\n <FlexView\n $width=\"100%\"\n $heightX={21.875}\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGapX={1.5}\n $gutterX={1.5}\n $background=\"WHITE_2\"\n $borderColor=\"BLACK_T_87\"\n $borderRadiusX={0.5}\n >\n <Styled.ImageWrapper>\n <Image withLoader height={200} width={200} src={dummyProfileImage} />\n </Styled.ImageWrapper>\n <FlexView $flexGap={16}>\n <Text $renderAs=\"ac2-black\">{name}</Text>\n <Text $renderAs=\"ab1\">{profileSummary || ''}</Text>\n </FlexView>\n </FlexView>\n </Styled.ContentWrapper>\n )}\n </Styled.Container>\n );\n});\n\nexport default StudentProfile;\n"],"names":["StudentProfile","memo","isTeacher","studentId","formData","slideConfig","milestoneConfig","updateSlideConfig","updateButtonState","useTrialSessionContext","showProfileHighlights","name","goals","studentProfile","personalizedObjectives","personalizedPosition","dummyProfileImageIndex","profileSummary","dummyProfileImage","getDummyProfileImage","payload","useMemo","getMilestoneGoalName","GOAL_CATEGORY","getStudentProfileSummary","data","isProcessing","isProcessed","isProcessingFailed","useGetStudentProfileSummary","studentProfileSummary","fetchData","useCallback","useEffect","profileHighlights","getFormattedStudentPersonalizedPreference","objectives","ILLUSTRATIONS","goal","GOAL_MAPPING","jsx","Error","AppLoader","jsxs","Styled.Container","Separator","SlideHeader","Styled.ContentWrapper","StudentProfileHighlights","Text","Styled.AbsoluteImage","FlexView","Styled.ImageWrapper","Image"],"mappings":";;;;;;;;;;;;;;;;;;AA8BM,MAAAA,KAAiBC,EAAK,MAAM;AAC1B,QAAA;AAAA,IACJ,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,MACEC,EAAuB,GACrB,EAAE,uBAAAC,EAA0B,IAAAL,GAE5B;AAAA,IACJ,MAAAM;AAAA,IACA,OAAAC,IAAQ,CAAC;AAAA,IACT,gBAAAC;AAAA,IACA,wBAAAC,IAAyB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A,IAAA,EACF,CAAA,IAEC,gBAAAN,EAAAI,GAAA,EAAsB,SAAS,QAC9B,UAAA;AAAA,MAAC,gBAAAP,EAAAU,GAAA,EAAqB;AAAA,MACtB,gBAAAP;AAAA,QAACQ;AAAA,QAAA;AAAA,UACC,QAAO;AAAA,UACP,UAAU;AAAA,UACV,gBAAe;AAAA,UACf,aAAY;AAAA,UACZ,WAAW;AAAA,UACX,UAAU;AAAA,UACV,aAAY;AAAA,UACZ,cAAa;AAAA,UACb,gBAAgB;AAAA,UAEhB,UAAA;AAAA,YAAA,gBAAAX,EAACY,GAAA,EACC,UAAA,gBAAAZ,EAACa,GAAM,EAAA,YAAU,IAAC,QAAQ,KAAK,OAAO,KAAK,KAAKnC,EAAmB,CAAA,GACrE;AAAA,YACA,gBAAAyB,EAACQ,GAAS,EAAA,UAAU,IAClB,UAAA;AAAA,cAAC,gBAAAX,EAAAS,GAAA,EAAK,WAAU,aAAa,UAAKtC,GAAA;AAAA,cACjC,gBAAA6B,EAAAS,GAAA,EAAK,WAAU,OAAO,eAAkB,IAAG;AAAA,YAAA,GAC9C;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
|
|
1
|
+
{"version":3,"file":"student-profile.js","sources":["../../../../../src/features/trial-session/comps/student-profile/student-profile.tsx"],"sourcesContent":["import type { TGoalCategory } from '../../../milestone/create/milestone-create-types';\nimport type { TColorNames } from '../../../ui/types';\nimport type { IGetStudentProfileSummaryQuery } from '../../api/student-profile-summary';\n\nimport { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport Error from '../../../ui/error/error';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useGetStudentProfileSummary } from '../../api/student-profile-summary';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { getFormattedStudentPersonalizedPreference } from '../../helper';\nimport SlideHeader from '../slide-header';\nimport { GOAL_MAPPING } from './constant';\nimport StudentProfileHighlights from './student-profile-highlights/student-profile-highlights';\nimport * as Styled from './student-profile-styled';\nimport { getDummyProfileImage, getMilestoneGoalName } from './student-profile-utils';\n\ntype TProfileHighlight = {\n illustration: string;\n background: TColorNames;\n title: string;\n description: string | string[];\n};\n\nconst StudentProfile = memo(() => {\n const {\n isTeacher,\n studentId,\n formData,\n slideConfig,\n milestoneConfig,\n updateSlideConfig,\n updateButtonState,\n } = useTrialSessionContext();\n const { showProfileHighlights } = slideConfig;\n\n const {\n name,\n goals = [],\n studentProfile,\n personalizedLevel = [],\n personalizedObjectives = [],\n } = formData || {};\n const { dummyProfileImageIndex, profileSummary } = studentProfile || {};\n const dummyProfileImage = getDummyProfileImage(dummyProfileImageIndex);\n\n const payload = useMemo<IGetStudentProfileSummaryQuery | null>(() => {\n if (goals && goals.length > 0) {\n return {\n school_success_goal: getMilestoneGoalName(goals, GOAL_CATEGORY.SCHOOL_SUCCESS),\n test_prep_goal: getMilestoneGoalName(goals, GOAL_CATEGORY.TEST_PREP),\n };\n }\n\n return null;\n }, [goals]);\n\n const {\n get: getStudentProfileSummary,\n data,\n isProcessing,\n isProcessed,\n isProcessingFailed,\n } = useGetStudentProfileSummary();\n const { profile_summary: studentProfileSummary } = data || {};\n\n const fetchData = useCallback(() => {\n if (payload) {\n getStudentProfileSummary(studentId, payload);\n }\n }, [getStudentProfileSummary, payload, studentId]);\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: isProcessing, isLoading: false });\n }, [isProcessing, updateButtonState]);\n\n useEffect(() => {\n if (isTeacher && !studentProfile && !showProfileHighlights) {\n fetchData();\n }\n }, [fetchData, isTeacher, studentProfile, showProfileHighlights]);\n\n useEffect(() => {\n if (isTeacher && isProcessed && !showProfileHighlights) {\n updateSlideConfig({\n studentProfile: {\n profileSummary: studentProfileSummary || '',\n dummyProfileImageIndex: Math.floor(Math.random() * 6),\n },\n });\n }\n }, [isProcessed, isTeacher, showProfileHighlights, studentProfileSummary, updateSlideConfig]);\n\n const profileHighlights: TProfileHighlight[] = useMemo(\n () => [\n {\n title: 'Studnet Level',\n description: `Catching up: ${personalizedLevel[0]}`,\n illustration: ILLUSTRATIONS.KNOWLEDGE_BLUE,\n background: 'BLUE_1',\n },\n {\n illustration: ILLUSTRATIONS.ARROW_BOARD_GREEN,\n background: 'GREEN_1',\n title: 'Goals',\n description: getFormattedStudentPersonalizedPreference(\n milestoneConfig,\n personalizedObjectives,\n ).map(objectives => objectives.preference_name),\n },\n {\n illustration: ILLUSTRATIONS.BOOK_CHECKED_PURPLE,\n background: 'PURPLE_1',\n title: 'Learning Plan',\n description: goals.map(\n goal => `${GOAL_MAPPING[goal.goal_category as TGoalCategory]}: ${goal.milestone_name}`,\n ),\n },\n ],\n [goals, milestoneConfig, personalizedLevel, personalizedObjectives],\n );\n\n if (isProcessingFailed) {\n return <Error height=\"70vh\" onTryAgain={fetchData} />;\n }\n\n if (isProcessing || (!studentProfile && !showProfileHighlights)) {\n return <AppLoader height=\"100vh\" />;\n }\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader marginBottom={showProfileHighlights ? 50 : 100} />\n {showProfileHighlights ? (\n <Styled.ContentWrapper $width={650}>\n <StudentProfileHighlights profileHighlights={profileHighlights} />\n </Styled.ContentWrapper>\n ) : (\n <Styled.ContentWrapper $widthX={46.875}>\n <Styled.AbsoluteImage />\n <FlexView\n $width=\"100%\"\n $heightX={21.875}\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGapX={1.5}\n $gutterX={1.5}\n $background=\"WHITE_2\"\n $borderColor=\"BLACK_T_87\"\n $borderRadiusX={0.5}\n >\n <Styled.ImageWrapper>\n <Image withLoader height={200} width={200} src={dummyProfileImage} />\n </Styled.ImageWrapper>\n <FlexView $flexGap={16}>\n <Text $renderAs=\"ac2-black\">{name}</Text>\n <Text $renderAs=\"ab1\">{profileSummary || ''}</Text>\n </FlexView>\n </FlexView>\n </Styled.ContentWrapper>\n )}\n </Styled.Container>\n );\n});\n\nexport default StudentProfile;\n"],"names":["StudentProfile","memo","isTeacher","studentId","formData","slideConfig","milestoneConfig","updateSlideConfig","updateButtonState","useTrialSessionContext","showProfileHighlights","name","goals","studentProfile","personalizedLevel","personalizedObjectives","dummyProfileImageIndex","profileSummary","dummyProfileImage","getDummyProfileImage","payload","useMemo","getMilestoneGoalName","GOAL_CATEGORY","getStudentProfileSummary","data","isProcessing","isProcessed","isProcessingFailed","useGetStudentProfileSummary","studentProfileSummary","fetchData","useCallback","useEffect","profileHighlights","ILLUSTRATIONS","getFormattedStudentPersonalizedPreference","objectives","goal","GOAL_MAPPING","jsx","Error","AppLoader","jsxs","Styled.Container","Separator","SlideHeader","Styled.ContentWrapper","StudentProfileHighlights","Styled.AbsoluteImage","FlexView","Styled.ImageWrapper","Image","Text"],"mappings":";;;;;;;;;;;;;;;;;;AA8BM,MAAAA,KAAiBC,EAAK,MAAM;AAC1B,QAAA;AAAA,IACJ,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,MACEC,EAAuB,GACrB,EAAE,uBAAAC,EAA0B,IAAAL,GAE5B;AAAA,IACJ,MAAAM;AAAA,IACA,OAAAC,IAAQ,CAAC;AAAA,IACT,gBAAAC;AAAA,IACA,mBAAAC,IAAoB,CAAC;AAAA,IACrB,wBAAAC,IAAyB,CAAC;AAAA,EAAA,IACxBX,KAAY,CAAA,GACV,EAAE,wBAAAY,GAAwB,gBAAAC,MAAmBJ,KAAkB,CAAA,GAC/DK,IAAoBC,EAAqBH,CAAsB,GAE/DI,IAAUC,EAA+C,MACzDT,KAASA,EAAM,SAAS,IACn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,KAAKlC,EAAmB,CAAA,GACrE;AAAA,YACA,gBAAAyB,EAACO,GAAS,EAAA,UAAU,IAClB,UAAA;AAAA,cAAC,gBAAAV,EAAAa,GAAA,EAAK,WAAU,aAAa,UAAK1C,GAAA;AAAA,cACjC,gBAAA6B,EAAAa,GAAA,EAAK,WAAU,OAAO,eAAkB,IAAG;AAAA,YAAA,GAC9C;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
|
|
@@ -1,53 +1,52 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { GIF as
|
|
1
|
+
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { memo as y, useMemo as $, useCallback as b } from "react";
|
|
3
|
+
import { GIF as G } from "../../../../assets/gif/gif.js";
|
|
4
4
|
import { GOAL_CATEGORY as r } from "../../../milestone/constants.js";
|
|
5
|
-
import { getGoalsFromConfig as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
5
|
+
import { getGoalsFromConfig as I } from "../../../milestone/create/milestone-create-helpers.js";
|
|
6
|
+
import x from "../../../ui/image/image.js";
|
|
7
|
+
import L from "../../../ui/inputs/searchable-select-input/searchable-select-input.js";
|
|
8
8
|
import p from "../../../ui/separator/separator.js";
|
|
9
|
-
import
|
|
10
|
-
import { epochTimestampAfterOneYear as
|
|
11
|
-
import { useTrialSessionContext as
|
|
12
|
-
import { updateGoalInFormData as
|
|
13
|
-
import
|
|
14
|
-
import { Container as
|
|
15
|
-
const
|
|
16
|
-
const { milestoneConfig:
|
|
17
|
-
() =>
|
|
18
|
-
countryCode:
|
|
19
|
-
grade:
|
|
9
|
+
import A from "../../../ui/text/text.js";
|
|
10
|
+
import { epochTimestampAfterOneYear as R } from "../../../utils/utils.js";
|
|
11
|
+
import { useTrialSessionContext as D } from "../../context/use-trial-session-context.js";
|
|
12
|
+
import { updateGoalInFormData as j } from "../../helper.js";
|
|
13
|
+
import k from "../slide-header/index.js";
|
|
14
|
+
import { Container as O, ContentWrapper as w, ImageWrapper as F, InputContainer as N } from "./test-prep-styled.js";
|
|
15
|
+
const Z = y(() => {
|
|
16
|
+
const { milestoneConfig: n, formData: c, updateSlideConfig: a, trialHomeData: d } = D(), { demo_info: f } = d, { stream: i, region_data: g } = f || {}, { opportunity_country: m = "US" } = g || {}, { grade: s, goals: e } = c || {}, u = $(
|
|
17
|
+
() => I(n, {
|
|
18
|
+
countryCode: m,
|
|
19
|
+
grade: s ?? "",
|
|
20
20
|
goalCategory: r.TEST_PREP,
|
|
21
21
|
courseStream: i,
|
|
22
22
|
enrollmentType: "ONLINE"
|
|
23
23
|
}),
|
|
24
|
-
[
|
|
25
|
-
), { goal_code:
|
|
26
|
-
(t,
|
|
24
|
+
[m, s, n, i]
|
|
25
|
+
), { goal_code: h } = (e == null ? void 0 : e.find((t) => t.goal_category === r.TEST_PREP)) ?? {}, T = b(
|
|
26
|
+
(t, _) => {
|
|
27
27
|
if (!t) {
|
|
28
|
-
const
|
|
29
|
-
(
|
|
28
|
+
const E = e == null ? void 0 : e.filter(
|
|
29
|
+
(P) => P.goal_category !== r.TEST_PREP
|
|
30
30
|
);
|
|
31
|
-
|
|
31
|
+
a({ goals: E });
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
const { label:
|
|
34
|
+
const { label: C } = _, S = j(e, r.TEST_PREP, {
|
|
35
35
|
goal_code: t,
|
|
36
|
-
milestone_name:
|
|
37
|
-
milestone_date_ts:
|
|
38
|
-
publish: l
|
|
36
|
+
milestone_name: C,
|
|
37
|
+
milestone_date_ts: R()
|
|
39
38
|
});
|
|
40
|
-
|
|
39
|
+
a({ goals: S });
|
|
41
40
|
},
|
|
42
|
-
[e,
|
|
41
|
+
[e, a]
|
|
43
42
|
);
|
|
44
|
-
return /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ l(O, { children: [
|
|
45
44
|
/* @__PURE__ */ o(p, { height: 60 }),
|
|
46
|
-
/* @__PURE__ */ o(
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */ o(
|
|
45
|
+
/* @__PURE__ */ o(k, {}),
|
|
46
|
+
/* @__PURE__ */ l(w, { $flexDirection: "row", $justifyContent: "center", children: [
|
|
47
|
+
/* @__PURE__ */ o(F, { children: /* @__PURE__ */ o(x, { withLoader: !0, height: 402, width: 302, src: G.TEST_PREP, className: "image" }) }),
|
|
49
48
|
/* @__PURE__ */ o(
|
|
50
|
-
|
|
49
|
+
N,
|
|
51
50
|
{
|
|
52
51
|
$flexGap: 40,
|
|
53
52
|
$justifyContent: "center",
|
|
@@ -56,15 +55,15 @@ const te = G(() => {
|
|
|
56
55
|
$gapX: 2.5,
|
|
57
56
|
$gutterX: 2.5,
|
|
58
57
|
children: /* @__PURE__ */ o(
|
|
59
|
-
|
|
58
|
+
L,
|
|
60
59
|
{
|
|
61
60
|
renderAs: "primary",
|
|
62
61
|
label: "Select a Test",
|
|
63
|
-
value:
|
|
64
|
-
options:
|
|
62
|
+
value: h,
|
|
63
|
+
options: u,
|
|
65
64
|
shape: "borderLess",
|
|
66
65
|
theme: "dark",
|
|
67
|
-
onChange:
|
|
66
|
+
onChange: T,
|
|
68
67
|
isTransparent: !0
|
|
69
68
|
}
|
|
70
69
|
)
|
|
@@ -72,10 +71,10 @@ const te = G(() => {
|
|
|
72
71
|
)
|
|
73
72
|
] }),
|
|
74
73
|
/* @__PURE__ */ o(p, { heightX: 1 }),
|
|
75
|
-
/* @__PURE__ */ o(
|
|
74
|
+
/* @__PURE__ */ o(A, { $renderAs: "ub3", $align: "center", children: "This is optional and can be skipped." })
|
|
76
75
|
] });
|
|
77
76
|
});
|
|
78
77
|
export {
|
|
79
|
-
|
|
78
|
+
Z as default
|
|
80
79
|
};
|
|
81
80
|
//# sourceMappingURL=test-prep.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-prep.js","sources":["../../../../../src/features/trial-session/comps/test-prep/test-prep.tsx"],"sourcesContent":["import type { ISelectOption } from '../../../ui/inputs/base-select-input/base-select-input-types';\n\nimport { memo, useCallback, useMemo } from 'react';\n\nimport { GIF } from '../../../../assets/gif/gif';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport { getGoalsFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport SearchableSelectInput from '../../../ui/inputs/searchable-select-input/searchable-select-input';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { epochTimestampAfterOneYear } from '../../../utils/utils';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { updateGoalInFormData } from '../../helper';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './test-prep-styled';\n\nconst TestPrep = memo(() => {\n const { milestoneConfig, formData, updateSlideConfig, trialHomeData } = useTrialSessionContext();\n\n const { demo_info: demoInfo
|
|
1
|
+
{"version":3,"file":"test-prep.js","sources":["../../../../../src/features/trial-session/comps/test-prep/test-prep.tsx"],"sourcesContent":["import type { ISelectOption } from '../../../ui/inputs/base-select-input/base-select-input-types';\n\nimport { memo, useCallback, useMemo } from 'react';\n\nimport { GIF } from '../../../../assets/gif/gif';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport { getGoalsFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport SearchableSelectInput from '../../../ui/inputs/searchable-select-input/searchable-select-input';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { epochTimestampAfterOneYear } from '../../../utils/utils';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { updateGoalInFormData } from '../../helper';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './test-prep-styled';\n\nconst TestPrep = memo(() => {\n const { milestoneConfig, formData, updateSlideConfig, trialHomeData } = useTrialSessionContext();\n\n const { demo_info: demoInfo } = trialHomeData;\n const { stream, region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n const { grade, goals } = formData || {};\n\n const goalsList = useMemo(\n () =>\n getGoalsFromConfig(milestoneConfig, {\n countryCode,\n grade: grade ?? '',\n goalCategory: GOAL_CATEGORY.TEST_PREP,\n courseStream: stream,\n enrollmentType: 'ONLINE',\n }),\n [countryCode, grade, milestoneConfig, stream],\n );\n\n const { goal_code: selectedGoal } =\n goals?.find(goal => goal.goal_category === GOAL_CATEGORY.TEST_PREP) ?? {};\n\n const handleGoalChange = useCallback(\n (value: string, option: ISelectOption<string | number>) => {\n if (!value) {\n const goalsWithoutTestPrep = goals?.filter(\n goal => goal.goal_category !== GOAL_CATEGORY.TEST_PREP,\n );\n\n updateSlideConfig({ goals: goalsWithoutTestPrep });\n\n return;\n }\n\n const { label } = option;\n\n const updatedGoals = updateGoalInFormData(goals, GOAL_CATEGORY.TEST_PREP, {\n goal_code: value,\n milestone_name: label,\n milestone_date_ts: epochTimestampAfterOneYear(),\n });\n\n updateSlideConfig({ goals: updatedGoals });\n },\n [goals, updateSlideConfig],\n );\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.ContentWrapper $flexDirection=\"row\" $justifyContent=\"center\">\n <Styled.ImageWrapper>\n <Image withLoader height={402} width={302} src={GIF.TEST_PREP} className=\"image\" />\n </Styled.ImageWrapper>\n <Styled.InputContainer\n $flexGap={40}\n $justifyContent=\"center\"\n $background=\"BLUE_1\"\n $borderColor=\"BLACK_1\"\n $gapX={2.5}\n $gutterX={2.5}\n >\n <SearchableSelectInput\n renderAs=\"primary\"\n label=\"Select a Test\"\n value={selectedGoal}\n options={goalsList}\n shape=\"borderLess\"\n theme=\"dark\"\n onChange={handleGoalChange}\n isTransparent\n />\n </Styled.InputContainer>\n </Styled.ContentWrapper>\n <Separator heightX={1} />\n <Text $renderAs=\"ub3\" $align=\"center\">\n This is optional and can be skipped.\n </Text>\n </Styled.Container>\n );\n});\n\nexport default TestPrep;\n"],"names":["TestPrep","memo","milestoneConfig","formData","updateSlideConfig","trialHomeData","useTrialSessionContext","demoInfo","stream","regionData","countryCode","grade","goals","goalsList","useMemo","getGoalsFromConfig","GOAL_CATEGORY","selectedGoal","goal","handleGoalChange","useCallback","value","option","goalsWithoutTestPrep","label","updatedGoals","updateGoalInFormData","epochTimestampAfterOneYear","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.ContentWrapper","Styled.ImageWrapper","Image","GIF","Styled.InputContainer","SearchableSelectInput","Text"],"mappings":";;;;;;;;;;;;;;AAiBM,MAAAA,IAAWC,EAAK,MAAM;AAC1B,QAAM,EAAE,iBAAAC,GAAiB,UAAAC,GAAU,mBAAAC,GAAmB,eAAAC,EAAA,IAAkBC,KAElE,EAAE,WAAWC,EAAa,IAAAF,GAC1B,EAAE,QAAAG,GAAQ,aAAaC,EAAW,IAAIF,KAAY,CAAA,GAClD,EAAE,qBAAqBG,IAAc,KAAK,IAAID,KAAc,CAAA,GAC5D,EAAE,OAAAE,GAAO,OAAAC,MAAUT,KAAY,CAAA,GAE/BU,IAAYC;AAAA,IAChB,MACEC,EAAmBb,GAAiB;AAAA,MAClC,aAAAQ;AAAA,MACA,OAAOC,KAAS;AAAA,MAChB,cAAcK,EAAc;AAAA,MAC5B,cAAcR;AAAA,MACd,gBAAgB;AAAA,IAAA,CACjB;AAAA,IACH,CAACE,GAAaC,GAAOT,GAAiBM,CAAM;AAAA,EAAA,GAGxC,EAAE,WAAWS,OACjBL,KAAA,gBAAAA,EAAO,KAAK,CAAQM,MAAAA,EAAK,kBAAkBF,EAAc,eAAc,CAAA,GAEnEG,IAAmBC;AAAA,IACvB,CAACC,GAAeC,MAA2C;AACzD,UAAI,CAACD,GAAO;AACV,cAAME,IAAuBX,KAAA,gBAAAA,EAAO;AAAA,UAClC,CAAAM,MAAQA,EAAK,kBAAkBF,EAAc;AAAA;AAG7B,QAAAZ,EAAA,EAAE,OAAOmB,EAAA,CAAsB;AAEjD;AAAA,MACF;AAEM,YAAA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-
import { getOffsetBetweenTimezone as
|
|
1
|
+
import { DAYS as N } from "../../constants/date-time.js";
|
|
2
|
+
import { getOffsetBetweenTimezone as y, convertEpochToDateTime as O, getTimeUnits as x, convertToMilliseconds as D } from "../../helpers/date-time.js";
|
|
3
3
|
import { GOAL_CATEGORY as h } from "../milestone/constants.js";
|
|
4
|
-
import { getGoalsFromConfig as
|
|
5
|
-
import { TrialPageId as
|
|
6
|
-
const
|
|
7
|
-
const e =
|
|
8
|
-
if (
|
|
9
|
-
const
|
|
10
|
-
...
|
|
11
|
-
goal_category: t
|
|
4
|
+
import { getGoalsFromConfig as R } from "../milestone/create/milestone-create-helpers.js";
|
|
5
|
+
import { TrialPageId as a, TEACHER_TIMEZONE as L } from "./trial-session-constants.js";
|
|
6
|
+
const U = (c, t, r) => {
|
|
7
|
+
const e = c ? [...c] : [], s = e == null ? void 0 : e.findIndex((d) => d.goal_category === t);
|
|
8
|
+
if (s === -1) {
|
|
9
|
+
const d = {
|
|
10
|
+
...r,
|
|
11
|
+
goal_category: t,
|
|
12
|
+
publish: !1
|
|
12
13
|
};
|
|
13
|
-
e.push(
|
|
14
|
+
e.push(d);
|
|
14
15
|
} else
|
|
15
|
-
e[
|
|
16
|
-
...e[
|
|
17
|
-
...
|
|
16
|
+
e[s] = {
|
|
17
|
+
...e[s],
|
|
18
|
+
...r
|
|
18
19
|
};
|
|
19
20
|
return e;
|
|
20
|
-
},
|
|
21
|
+
}, $ = (c, t) => {
|
|
21
22
|
if (!t) return [];
|
|
22
|
-
const
|
|
23
|
-
return
|
|
24
|
-
const { selectedDay:
|
|
23
|
+
const r = (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0), e = y(L, t), s = r + e, { day: d = "" } = O(s, t), m = N.indexOf(d);
|
|
24
|
+
return c.length > 0 ? c.filter((f) => f.selectedDay && f.selectedTime).map((f) => {
|
|
25
|
+
const { selectedDay: P, selectedTime: u } = f, { hours: i, minutes: o, period: g } = x(u), T = (N.indexOf(P) - m + 7) % 7;
|
|
25
26
|
return {
|
|
26
|
-
id:
|
|
27
|
-
value: `${
|
|
27
|
+
id: r + e + D({ days: T, hours: i, minutes: o }),
|
|
28
|
+
value: `${P}, ${u} - ${i + 1}:${o < 10 ? "0" : ""}${o} ${g}`
|
|
28
29
|
// Formatted the value string as required
|
|
29
30
|
};
|
|
30
31
|
}) : [];
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
return { weekday: o, start_time: i };
|
|
34
|
-
}), b = ({
|
|
35
|
-
milestoneConfigData: r,
|
|
32
|
+
}, b = ({
|
|
33
|
+
milestoneConfigData: c,
|
|
36
34
|
trialHomeData: t,
|
|
37
|
-
grade:
|
|
35
|
+
grade: r
|
|
38
36
|
}) => {
|
|
39
37
|
var I;
|
|
40
|
-
const { student: e, demo_info:
|
|
41
|
-
countryCode:
|
|
42
|
-
grade:
|
|
38
|
+
const { student: e, demo_info: s } = t, { grade: d } = e || {}, { stream: m, region_data: f } = s || {}, { opportunity_country: P = "US" } = f || {}, u = (l) => R(c, {
|
|
39
|
+
countryCode: P,
|
|
40
|
+
grade: r || d || "",
|
|
43
41
|
goalCategory: l,
|
|
44
|
-
courseStream:
|
|
42
|
+
courseStream: m,
|
|
45
43
|
enrollmentType: "ONLINE"
|
|
46
|
-
}),
|
|
47
|
-
if ((
|
|
44
|
+
}), i = u(h.TEST_PREP), o = u(h.ENRICHMENT);
|
|
45
|
+
if ((i == null ? void 0 : i.length) > 0 && (o == null ? void 0 : o.length) > 0)
|
|
48
46
|
return t;
|
|
49
|
-
const
|
|
50
|
-
var l, _,
|
|
51
|
-
return ((_ = (l = p[
|
|
52
|
-
})(),
|
|
53
|
-
if (
|
|
54
|
-
const l = (
|
|
55
|
-
|
|
47
|
+
const g = { ...t }, p = Object.fromEntries(g.pages.map((l) => [l.id, l])), T = (() => {
|
|
48
|
+
var l, _, n, E;
|
|
49
|
+
return ((_ = (l = p[a.SCHOOL_GOALS]) == null ? void 0 : l.nextPage) == null ? void 0 : _.pageId) === a.TEST_PREP && i.length === 0 ? a.SCHOOL_GOALS : i.length > 0 && ((E = (n = p[a.TEST_PREP]) == null ? void 0 : n.nextPage) == null ? void 0 : E.pageId) === a.STUDENT_ENRICHMENT && o.length === 0 ? a.TEST_PREP : null;
|
|
50
|
+
})(), S = T ? (I = p[(o == null ? void 0 : o.length) === 0 ? a.STUDENT_ENRICHMENT : a.TEST_PREP]) == null ? void 0 : I.nextPage : null;
|
|
51
|
+
if (S && T) {
|
|
52
|
+
const l = (n) => i.length === 0 && n === a.TEST_PREP || o.length === 0 && n === a.STUDENT_ENRICHMENT, _ = g.pages.filter((n) => !l(n.id));
|
|
53
|
+
g.pages = _.map((n) => {
|
|
56
54
|
var E;
|
|
57
|
-
return
|
|
58
|
-
...
|
|
55
|
+
return n.id === T ? { ...n, nextPage: S } : n.id === S.pageId ? {
|
|
56
|
+
...n,
|
|
59
57
|
prevPage: {
|
|
60
|
-
buttonLabel: ((E = p[
|
|
61
|
-
pageId:
|
|
58
|
+
buttonLabel: ((E = p[T]) == null ? void 0 : E.navigationLabel) ?? "",
|
|
59
|
+
pageId: T
|
|
62
60
|
}
|
|
63
|
-
} :
|
|
61
|
+
} : n;
|
|
64
62
|
});
|
|
65
63
|
}
|
|
66
|
-
return
|
|
67
|
-
},
|
|
64
|
+
return g;
|
|
65
|
+
}, F = (c, t) => {
|
|
68
66
|
var e;
|
|
69
|
-
const { preference_config:
|
|
70
|
-
return t.length > 0 ? ((e =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
preference_description: i
|
|
76
|
-
})
|
|
77
|
-
)) || [] : [];
|
|
78
|
-
}, F = (r, t, n = !1) => {
|
|
79
|
-
const e = [];
|
|
80
|
-
if (!r || r.length === 0) return [];
|
|
81
|
-
for (let o = 0; o < r.length; o++) {
|
|
82
|
-
const s = r[o];
|
|
83
|
-
if (s && s.preference_category === t && (e.push(s.preference_code), n))
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
return n ? e[0] ? [e[0]] : [] : e;
|
|
67
|
+
const { preference_config: r } = c;
|
|
68
|
+
return t.length > 0 ? ((e = r == null ? void 0 : r.filter((s) => t.includes(s.preference_code))) == null ? void 0 : e.map(({ preference_code: s, preference_name: d, preference_category: m }) => ({
|
|
69
|
+
preference_code: s,
|
|
70
|
+
preference_name: d,
|
|
71
|
+
preference_category: m
|
|
72
|
+
}))) || [] : [];
|
|
87
73
|
};
|
|
88
74
|
export {
|
|
89
75
|
b as filterAndUpdateSlideNavigation,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
U as getWeekdayAndStartTimeFromPreference,
|
|
94
|
-
$ as updateGoalInFormData
|
|
76
|
+
$ as getFormattedPreferences,
|
|
77
|
+
F as getFormattedStudentPersonalizedPreference,
|
|
78
|
+
U as updateGoalInFormData
|
|
95
79
|
};
|
|
96
80
|
//# sourceMappingURL=helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sources":["../../../src/features/trial-session/helper.ts"],"sourcesContent":["import type { IMilestoneConfig } from '../milestone/create/milestone-create-types';\nimport type { TPreference } from './comps/class-preference/class-preference-types';\nimport type { ITrialHomeData, TGoals, TPreferenceSchema } from './trial-session-types';\n\nimport { DAYS } from '../../constants/date-time';\nimport {\n convertEpochToDateTime,\n convertToMilliseconds,\n getOffsetBetweenTimezone,\n getTimeUnits,\n} from '../../helpers/date-time';\nimport { GOAL_CATEGORY } from '../milestone/constants';\nimport { getGoalsFromConfig } from '../milestone/create/milestone-create-helpers';\nimport { TEACHER_TIMEZONE, TrialPageId } from './trial-session-constants';\n\nconst updateGoalInFormData = (goals: TGoals[] | undefined, goalCategory: string, data: TGoals) => {\n const updateGoals = goals ? [...goals] : [];\n const goalIndex = updateGoals?.findIndex(goal => goal.goal_category === goalCategory);\n\n if (goalIndex === -1) {\n const schoolSuccessGoal = {\n ...data,\n goal_category: goalCategory,\n };\n\n updateGoals.push(schoolSuccessGoal);\n } else {\n updateGoals[goalIndex] = {\n ...updateGoals[goalIndex],\n ...data,\n };\n }\n\n return updateGoals;\n};\n\nconst getFormattedPreferences = (preferences: TPreference[], studentTimezone?: string) => {\n if (!studentTimezone) return [];\n\n const todayTimestamp = new Date().setHours(0, 0, 0, 0); // Set the current date to midnight.\n const timestampOffset = getOffsetBetweenTimezone(TEACHER_TIMEZONE, studentTimezone); // Offset between the teacher's and student's timezone.\n const studentTimestamp = todayTimestamp + timestampOffset; // Adjusting the current date to the student's timezone.\n const { day: today = '' } = convertEpochToDateTime(studentTimestamp, studentTimezone); // Current day at student's timezone.\n const currentDayIndex = DAYS.indexOf(today); // Current day index.\n\n return preferences.length > 0\n ? preferences\n .filter(preference => preference.selectedDay && preference.selectedTime)\n .map(preference => {\n const { selectedDay, selectedTime } = preference;\n // Extracting hours, minutes, and period from the selected time.\n const { hours, minutes, period } = getTimeUnits(selectedTime);\n\n // Calculating the index of the selected day in the DAYS array.\n const selectedDayIndex = DAYS.indexOf(selectedDay);\n const dayDifference = (selectedDayIndex - currentDayIndex + 7) % 7;\n\n // Calculate the epoch timestamp for the selected day and time in the student's timezone.\n const epochTimestamp =\n todayTimestamp +\n timestampOffset +\n convertToMilliseconds({ days: dayDifference, hours, minutes });\n\n return {\n id: epochTimestamp,\n value: `${selectedDay}, ${selectedTime} - ${hours + 1}:${\n minutes < 10 ? '0' : ''\n }${minutes} ${period}`, // Formatted the value string as required\n };\n })\n : [];\n};\n\n/**\n * Converts a list of epoch timestamps to normalized weekday and start_time.\n * @param epochs Array of epoch timestamps (number)\n * @returns Array of { weekday, start_time }\n */\nconst getWeekdayAndStartTimeFromPreference = (\n preference: Array<{ id: number; value: string }>,\n): Array<{ weekday: string; start_time: string }> => {\n return preference\n .filter(pref => typeof pref.id === 'number' && !isNaN(pref.id))\n .map(pref => {\n const date = new Date(pref.id);\n // Get weekday in lowercase\n const weekdayRaw = DAYS[date.getDay()];\n const weekday = weekdayRaw ? weekdayRaw.toLowerCase() : 'unknown';\n // Get time in HH:MM:SS format\n const hour = date.getHours();\n const minute = date.getMinutes();\n const start_time = `${hour.toString().padStart(2, '0')}:${minute\n .toString()\n .padStart(2, '0')}:00`;\n\n return { weekday, start_time };\n });\n};\n\nconst filterAndUpdateSlideNavigation = ({\n milestoneConfigData,\n trialHomeData,\n grade,\n}: {\n milestoneConfigData: IMilestoneConfig;\n trialHomeData: ITrialHomeData;\n grade?: string;\n}) => {\n const { student, demo_info: demoInfo } = trialHomeData;\n const { grade: studentGrade } = student || {};\n const { stream, region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n\n const getGoals = (goalCategory: keyof typeof GOAL_CATEGORY) =>\n getGoalsFromConfig(milestoneConfigData, {\n countryCode,\n grade: grade || studentGrade || '',\n goalCategory,\n courseStream: stream,\n enrollmentType: 'ONLINE',\n });\n\n const testPrepGoals = getGoals(GOAL_CATEGORY.TEST_PREP);\n const enrichmentGoals = getGoals(GOAL_CATEGORY.ENRICHMENT);\n\n if (testPrepGoals?.length > 0 && enrichmentGoals?.length > 0) {\n return trialHomeData;\n }\n\n const updatedTrialHomeData = { ...trialHomeData };\n\n const pagesMap = Object.fromEntries(updatedTrialHomeData.pages.map(page => [page.id, page]));\n\n //slide whose nextPage reference needs to be updated\n const slideIdToUpdate = (() => {\n if (\n pagesMap[TrialPageId.SCHOOL_GOALS]?.nextPage?.pageId === TrialPageId.TEST_PREP &&\n testPrepGoals.length === 0\n ) {\n return TrialPageId.SCHOOL_GOALS;\n }\n\n if (\n testPrepGoals.length > 0 &&\n pagesMap[TrialPageId.TEST_PREP]?.nextPage?.pageId === TrialPageId.STUDENT_ENRICHMENT &&\n enrichmentGoals.length === 0\n ) {\n return TrialPageId.TEST_PREP;\n }\n\n return null;\n })();\n\n // the new next page reference for slideIdToUpdate\n const updatedNextPageInfo = slideIdToUpdate\n ? pagesMap[\n enrichmentGoals?.length === 0 ? TrialPageId.STUDENT_ENRICHMENT : TrialPageId.TEST_PREP\n ]?.nextPage\n : null;\n\n // updating the nextPage and prevPage references\n if (updatedNextPageInfo && slideIdToUpdate) {\n const shouldRemoveSlide = (slideId: TrialPageId) =>\n (testPrepGoals.length === 0 && slideId === TrialPageId.TEST_PREP) ||\n (enrichmentGoals.length === 0 && slideId === TrialPageId.STUDENT_ENRICHMENT);\n\n const filteredSlides = updatedTrialHomeData.pages.filter(page => !shouldRemoveSlide(page.id));\n\n updatedTrialHomeData.pages = filteredSlides.map(page => {\n if (page.id === slideIdToUpdate) {\n return { ...page, nextPage: updatedNextPageInfo };\n }\n\n if (page.id === updatedNextPageInfo.pageId) {\n return {\n ...page,\n prevPage: {\n buttonLabel: pagesMap[slideIdToUpdate]?.navigationLabel ?? '',\n pageId: slideIdToUpdate,\n },\n };\n }\n\n return page;\n });\n }\n\n return updatedTrialHomeData;\n};\n\nconst getFormattedStudentPersonalizedPreference = (\n config: IMilestoneConfig,\n selectedCodes: string[],\n) => {\n const { preference_config: preferenceConfig } = config;\n\n if (selectedCodes.length > 0) {\n return (\n preferenceConfig\n ?.filter(pref => selectedCodes.includes(pref.preference_code))\n ?.map(\n ({ preference_code, preference_name, preference_category, preference_description }) => ({\n preference_code,\n preference_name,\n preference_category,\n preference_description,\n }),\n ) || []\n );\n }\n\n return [];\n};\n\nconst getPreferenceCodesByCategory = (\n preferences: TPreferenceSchema[],\n category: string,\n returnFirstOnly: boolean = false,\n): string[] => {\n const filteredCodes = [];\n\n if (!preferences || preferences.length === 0) return [];\n\n for (let i = 0; i < preferences.length; i++) {\n const pref = preferences[i];\n\n if (pref && pref.preference_category === category) {\n filteredCodes.push(pref.preference_code);\n if (returnFirstOnly) break;\n }\n }\n\n return returnFirstOnly ? (filteredCodes[0] ? [filteredCodes[0]] : []) : filteredCodes;\n};\n\nexport {\n filterAndUpdateSlideNavigation,\n updateGoalInFormData,\n getFormattedPreferences,\n getWeekdayAndStartTimeFromPreference,\n getFormattedStudentPersonalizedPreference,\n getPreferenceCodesByCategory,\n};\n"],"names":["updateGoalInFormData","goals","goalCategory","data","updateGoals","goalIndex","goal","schoolSuccessGoal","getFormattedPreferences","preferences","studentTimezone","todayTimestamp","timestampOffset","getOffsetBetweenTimezone","TEACHER_TIMEZONE","studentTimestamp","today","convertEpochToDateTime","currentDayIndex","DAYS","preference","selectedDay","selectedTime","hours","minutes","period","getTimeUnits","dayDifference","convertToMilliseconds","getWeekdayAndStartTimeFromPreference","pref","date","weekdayRaw","weekday","hour","minute","start_time","filterAndUpdateSlideNavigation","milestoneConfigData","trialHomeData","grade","student","demoInfo","studentGrade","stream","regionData","countryCode","getGoals","getGoalsFromConfig","testPrepGoals","GOAL_CATEGORY","enrichmentGoals","updatedTrialHomeData","pagesMap","page","slideIdToUpdate","_b","_a","TrialPageId","_d","_c","updatedNextPageInfo","shouldRemoveSlide","slideId","filteredSlides","getFormattedStudentPersonalizedPreference","config","selectedCodes","preferenceConfig","preference_code","preference_name","preference_category","preference_description","getPreferenceCodesByCategory","category","returnFirstOnly","filteredCodes","i"],"mappings":";;;;;AAeA,MAAMA,IAAuB,CAACC,GAA6BC,GAAsBC,MAAiB;AAChG,QAAMC,IAAcH,IAAQ,CAAC,GAAGA,CAAK,IAAI,CAAA,GACnCI,IAAYD,KAAA,gBAAAA,EAAa,UAAU,CAAQE,MAAAA,EAAK,kBAAkBJ;AAExE,MAAIG,MAAc,IAAI;AACpB,UAAME,IAAoB;AAAA,MACxB,GAAGJ;AAAA,MACH,eAAeD;AAAA,IAAA;AAGjB,IAAAE,EAAY,KAAKG,CAAiB;AAAA,EAAA;AAElC,IAAAH,EAAYC,CAAS,IAAI;AAAA,MACvB,GAAGD,EAAYC,CAAS;AAAA,MACxB,GAAGF;AAAA,IAAA;AAIA,SAAAC;AACT,GAEMI,IAA0B,CAACC,GAA4BC,MAA6B;AACpF,MAAA,CAACA,EAAiB,QAAO;AAEvB,QAAAC,yBAAqB,QAAO,SAAS,GAAG,GAAG,GAAG,CAAC,GAC/CC,IAAkBC,EAAyBC,GAAkBJ,CAA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,CAAC,IAAI,CAACA,EAAc,CAAC,CAAC,IAAI,CAAM,IAAAA;AAC1E;"}
|
|
1
|
+
{"version":3,"file":"helper.js","sources":["../../../src/features/trial-session/helper.ts"],"sourcesContent":["import type { IMilestoneConfig } from '../milestone/create/milestone-create-types';\nimport type { TPreference } from './comps/class-preference/class-preference-types';\nimport type { ITrialHomeData, TGoals } from './trial-session-types';\n\nimport { DAYS } from '../../constants/date-time';\nimport {\n convertEpochToDateTime,\n convertToMilliseconds,\n getOffsetBetweenTimezone,\n getTimeUnits,\n} from '../../helpers/date-time';\nimport { GOAL_CATEGORY } from '../milestone/constants';\nimport { getGoalsFromConfig } from '../milestone/create/milestone-create-helpers';\nimport { TEACHER_TIMEZONE, TrialPageId } from './trial-session-constants';\n\nconst updateGoalInFormData = (goals: TGoals[] | undefined, goalCategory: string, data: TGoals) => {\n const updateGoals = goals ? [...goals] : [];\n const goalIndex = updateGoals?.findIndex(goal => goal.goal_category === goalCategory);\n\n if (goalIndex === -1) {\n const schoolSuccessGoal = {\n ...data,\n goal_category: goalCategory,\n publish: false,\n };\n\n updateGoals.push(schoolSuccessGoal);\n } else {\n updateGoals[goalIndex] = {\n ...updateGoals[goalIndex],\n ...data,\n };\n }\n\n return updateGoals;\n};\n\nconst getFormattedPreferences = (preferences: TPreference[], studentTimezone?: string) => {\n if (!studentTimezone) return [];\n\n const todayTimestamp = new Date().setHours(0, 0, 0, 0); // Set the current date to midnight.\n const timestampOffset = getOffsetBetweenTimezone(TEACHER_TIMEZONE, studentTimezone); // Offset between the teacher's and student's timezone.\n const studentTimestamp = todayTimestamp + timestampOffset; // Adjusting the current date to the student's timezone.\n const { day: today = '' } = convertEpochToDateTime(studentTimestamp, studentTimezone); // Current day at student's timezone.\n const currentDayIndex = DAYS.indexOf(today); // Current day index.\n\n return preferences.length > 0\n ? preferences\n .filter(preference => preference.selectedDay && preference.selectedTime)\n .map(preference => {\n const { selectedDay, selectedTime } = preference;\n // Extracting hours, minutes, and period from the selected time.\n const { hours, minutes, period } = getTimeUnits(selectedTime);\n\n // Calculating the index of the selected day in the DAYS array.\n const selectedDayIndex = DAYS.indexOf(selectedDay);\n const dayDifference = (selectedDayIndex - currentDayIndex + 7) % 7;\n\n // Calculate the epoch timestamp for the selected day and time in the student's timezone.\n const epochTimestamp =\n todayTimestamp +\n timestampOffset +\n convertToMilliseconds({ days: dayDifference, hours, minutes });\n\n return {\n id: epochTimestamp,\n value: `${selectedDay}, ${selectedTime} - ${hours + 1}:${\n minutes < 10 ? '0' : ''\n }${minutes} ${period}`, // Formatted the value string as required\n };\n })\n : [];\n};\n\nconst filterAndUpdateSlideNavigation = ({\n milestoneConfigData,\n trialHomeData,\n grade,\n}: {\n milestoneConfigData: IMilestoneConfig;\n trialHomeData: ITrialHomeData;\n grade?: string;\n}) => {\n const { student, demo_info: demoInfo } = trialHomeData;\n const { grade: studentGrade } = student || {};\n const { stream, region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n\n const getGoals = (goalCategory: keyof typeof GOAL_CATEGORY) =>\n getGoalsFromConfig(milestoneConfigData, {\n countryCode,\n grade: grade || studentGrade || '',\n goalCategory,\n courseStream: stream,\n enrollmentType: 'ONLINE',\n });\n\n const testPrepGoals = getGoals(GOAL_CATEGORY.TEST_PREP);\n const enrichmentGoals = getGoals(GOAL_CATEGORY.ENRICHMENT);\n\n if (testPrepGoals?.length > 0 && enrichmentGoals?.length > 0) {\n return trialHomeData;\n }\n\n const updatedTrialHomeData = { ...trialHomeData };\n\n const pagesMap = Object.fromEntries(updatedTrialHomeData.pages.map(page => [page.id, page]));\n\n //slide whose nextPage reference needs to be updated\n const slideIdToUpdate = (() => {\n if (\n pagesMap[TrialPageId.SCHOOL_GOALS]?.nextPage?.pageId === TrialPageId.TEST_PREP &&\n testPrepGoals.length === 0\n ) {\n return TrialPageId.SCHOOL_GOALS;\n }\n\n if (\n testPrepGoals.length > 0 &&\n pagesMap[TrialPageId.TEST_PREP]?.nextPage?.pageId === TrialPageId.STUDENT_ENRICHMENT &&\n enrichmentGoals.length === 0\n ) {\n return TrialPageId.TEST_PREP;\n }\n\n return null;\n })();\n\n // the new next page reference for slideIdToUpdate\n const updatedNextPageInfo = slideIdToUpdate\n ? pagesMap[\n enrichmentGoals?.length === 0 ? TrialPageId.STUDENT_ENRICHMENT : TrialPageId.TEST_PREP\n ]?.nextPage\n : null;\n\n // updating the nextPage and prevPage references\n if (updatedNextPageInfo && slideIdToUpdate) {\n const shouldRemoveSlide = (slideId: TrialPageId) =>\n (testPrepGoals.length === 0 && slideId === TrialPageId.TEST_PREP) ||\n (enrichmentGoals.length === 0 && slideId === TrialPageId.STUDENT_ENRICHMENT);\n\n const filteredSlides = updatedTrialHomeData.pages.filter(page => !shouldRemoveSlide(page.id));\n\n updatedTrialHomeData.pages = filteredSlides.map(page => {\n if (page.id === slideIdToUpdate) {\n return { ...page, nextPage: updatedNextPageInfo };\n }\n\n if (page.id === updatedNextPageInfo.pageId) {\n return {\n ...page,\n prevPage: {\n buttonLabel: pagesMap[slideIdToUpdate]?.navigationLabel ?? '',\n pageId: slideIdToUpdate,\n },\n };\n }\n\n return page;\n });\n }\n\n return updatedTrialHomeData;\n};\n\nconst getFormattedStudentPersonalizedPreference = (\n config: IMilestoneConfig,\n selectedCodes: string[],\n) => {\n const { preference_config: preferenceConfig } = config;\n\n if (selectedCodes.length > 0) {\n return (\n preferenceConfig\n ?.filter(pref => selectedCodes.includes(pref.preference_code))\n ?.map(({ preference_code, preference_name, preference_category }) => ({\n preference_code,\n preference_name,\n preference_category,\n })) || []\n );\n }\n\n return [];\n};\n\nexport {\n filterAndUpdateSlideNavigation,\n updateGoalInFormData,\n getFormattedPreferences,\n getFormattedStudentPersonalizedPreference,\n};\n"],"names":["updateGoalInFormData","goals","goalCategory","data","updateGoals","goalIndex","goal","schoolSuccessGoal","getFormattedPreferences","preferences","studentTimezone","todayTimestamp","timestampOffset","getOffsetBetweenTimezone","TEACHER_TIMEZONE","studentTimestamp","today","convertEpochToDateTime","currentDayIndex","DAYS","preference","selectedDay","selectedTime","hours","minutes","period","getTimeUnits","dayDifference","convertToMilliseconds","filterAndUpdateSlideNavigation","milestoneConfigData","trialHomeData","grade","student","demoInfo","studentGrade","stream","regionData","countryCode","getGoals","getGoalsFromConfig","testPrepGoals","GOAL_CATEGORY","enrichmentGoals","updatedTrialHomeData","pagesMap","page","slideIdToUpdate","_b","_a","TrialPageId","_d","_c","updatedNextPageInfo","shouldRemoveSlide","slideId","filteredSlides","getFormattedStudentPersonalizedPreference","config","selectedCodes","preferenceConfig","pref","preference_code","preference_name","preference_category"],"mappings":";;;;;AAeA,MAAMA,IAAuB,CAACC,GAA6BC,GAAsBC,MAAiB;AAChG,QAAMC,IAAcH,IAAQ,CAAC,GAAGA,CAAK,IAAI,CAAA,GACnCI,IAAYD,KAAA,gBAAAA,EAAa,UAAU,CAAQE,MAAAA,EAAK,kBAAkBJ;AAExE,MAAIG,MAAc,IAAI;AACpB,UAAME,IAAoB;AAAA,MACxB,GAAGJ;AAAA,MACH,eAAeD;AAAA,MACf,SAAS;AAAA,IAAA;AAGX,IAAAE,EAAY,KAAKG,CAAiB;AAAA,EAAA;AAElC,IAAAH,EAAYC,CAAS,IAAI;AAAA,MACvB,GAAGD,EAAYC,CAAS;AAAA,MACxB,GAAGF;AAAA,IAAA;AAIA,SAAAC;AACT,GAEMI,IAA0B,CAACC,GAA4BC,MAA6B;AACpF,MAAA,CAACA,EAAiB,QAAO;AAEvB,QAAAC,yBAAqB,QAAO,SAAS,GAAG,GAAG,GAAG,CAAC,GAC/CC,IAAkBC,EAAyBC,GAAkBJ,CAAe,GAC5EK,IAAmBJ,IAAiBC,GACpC,EAAE,KAAKI,IAAQ,GAAO,IAAAC,EAAuBF,GAAkBL,CAAe,GAC9EQ,IAAkBC,EAAK,QAAQH,CAAK;AAE1C,SAAOP,EAAY,SAAS,IACxBA,EACG,OAAO,CAAAW,MAAcA,EAAW,eAAeA,EAAW,YAAY,EACtE,I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