@cuemath/leap 2.8.51 → 2.8.52-link.1
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/trial-session/api/trial-nodes.js +6 -5
- package/dist/features/trial-session/api/trial-nodes.js.map +1 -1
- package/dist/features/trial-session/api/trial-pricing.js.map +1 -1
- package/dist/features/trial-session/comps/pricing/pricing.js +66 -65
- package/dist/features/trial-session/comps/pricing/pricing.js.map +1 -1
- package/dist/features/trial-session/comps/school-goals/school-goals.js +54 -54
- package/dist/features/trial-session/comps/school-goals/school-goals.js.map +1 -1
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js +41 -41
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js.map +1 -1
- package/dist/features/trial-session/comps/student-info/student-info.js +35 -35
- package/dist/features/trial-session/comps/student-info/student-info.js.map +1 -1
- package/dist/features/trial-session/comps/test-prep/test-prep.js +45 -42
- package/dist/features/trial-session/comps/test-prep/test-prep.js.map +1 -1
- package/dist/features/trial-session/comps/worksheet/worksheet.js +23 -23
- package/dist/features/trial-session/comps/worksheet/worksheet.js.map +1 -1
- package/dist/features/trial-session/helper.js +52 -52
- package/dist/features/trial-session/helper.js.map +1 -1
- package/dist/features/trial-session/trial-session-types.js.map +1 -1
- package/package.json +1 -1
@@ -1,55 +1,55 @@
|
|
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 c, useCallback as G } from "react";
|
3
|
+
import { GIF as S } from "../../../../assets/gif/gif.js";
|
4
4
|
import { GOAL_CATEGORY as r } from "../../../milestone/constants.js";
|
5
|
-
import { getGoalsFromConfig as
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import { epochTimestampAfterOneYear as
|
11
|
-
import { useTrialSessionContext as
|
12
|
-
import { updateGoalInFormData as
|
13
|
-
import
|
14
|
-
import { Container as
|
15
|
-
const
|
16
|
-
const { formData:
|
17
|
-
() =>
|
18
|
-
countryCode:
|
5
|
+
import { getGoalsFromConfig as b } from "../../../milestone/create/milestone-create-helpers.js";
|
6
|
+
import x from "../../../ui/image/image.js";
|
7
|
+
import H from "../../../ui/inputs/searchable-select-input/searchable-select-input.js";
|
8
|
+
import p from "../../../ui/separator/separator.js";
|
9
|
+
import L from "../../../ui/text/text.js";
|
10
|
+
import { epochTimestampAfterOneYear as R } from "../../../utils/utils.js";
|
11
|
+
import { useTrialSessionContext as A } from "../../context/use-trial-session-context.js";
|
12
|
+
import { updateGoalInFormData as M } from "../../helper.js";
|
13
|
+
import D from "../slide-header/index.js";
|
14
|
+
import { Container as j, ContentWrapper as k, ImageWrapper as w, InputContainer as O } from "./student-enrichment-styled.js";
|
15
|
+
const Z = y(() => {
|
16
|
+
const { formData: d, milestoneConfig: n, updateSlideConfig: a, trialHomeData: f } = A(), { grade: i, goals: e } = d || {}, { demo_info: g } = f, { stream: m, region_data: h } = g || {}, { opportunity_country: s = "US" } = h || {}, u = c(
|
17
|
+
() => b(n, {
|
18
|
+
countryCode: s,
|
19
19
|
grade: i ?? "",
|
20
20
|
goalCategory: r.ENRICHMENT,
|
21
21
|
courseStream: m,
|
22
22
|
enrollmentType: "ONLINE"
|
23
23
|
}),
|
24
|
-
[n, i, m]
|
25
|
-
), { goal_code:
|
24
|
+
[n, s, i, m]
|
25
|
+
), { goal_code: C } = c(
|
26
26
|
() => (e == null ? void 0 : e.find((t) => t.goal_category === r.ENRICHMENT)) ?? {},
|
27
27
|
[e]
|
28
|
-
),
|
29
|
-
(t,
|
28
|
+
), E = G(
|
29
|
+
(t, I) => {
|
30
30
|
if (!t) {
|
31
|
-
const
|
32
|
-
(
|
31
|
+
const T = e == null ? void 0 : e.filter(
|
32
|
+
($) => $.goal_category !== r.ENRICHMENT
|
33
33
|
);
|
34
|
-
a({ goals:
|
34
|
+
a({ goals: T });
|
35
35
|
return;
|
36
36
|
}
|
37
|
-
const { label:
|
37
|
+
const { label: N } = I, _ = M(e, r.ENRICHMENT, {
|
38
38
|
goal_code: t,
|
39
|
-
milestone_name:
|
40
|
-
milestone_date_ts:
|
39
|
+
milestone_name: N,
|
40
|
+
milestone_date_ts: R()
|
41
41
|
});
|
42
|
-
a({ goals:
|
42
|
+
a({ goals: _ });
|
43
43
|
},
|
44
44
|
[e, a]
|
45
45
|
);
|
46
|
-
return /* @__PURE__ */
|
47
|
-
/* @__PURE__ */ o(
|
48
|
-
/* @__PURE__ */ o(
|
49
|
-
/* @__PURE__ */
|
50
|
-
/* @__PURE__ */ o(
|
46
|
+
return /* @__PURE__ */ l(j, { children: [
|
47
|
+
/* @__PURE__ */ o(p, { height: 60 }),
|
48
|
+
/* @__PURE__ */ o(D, {}),
|
49
|
+
/* @__PURE__ */ l(k, { $width: 750, $flexDirection: "row", $justifyContent: "center", children: [
|
50
|
+
/* @__PURE__ */ o(w, { children: /* @__PURE__ */ o(x, { withLoader: !0, height: 402, width: 302, src: S.ENRICHMENT, className: "image" }) }),
|
51
51
|
/* @__PURE__ */ o(
|
52
|
-
|
52
|
+
O,
|
53
53
|
{
|
54
54
|
$flexGap: 24,
|
55
55
|
$justifyContent: "center",
|
@@ -58,26 +58,26 @@ const Q = _(() => {
|
|
58
58
|
$gapX: 2.5,
|
59
59
|
$gutterX: 2.5,
|
60
60
|
children: /* @__PURE__ */ o(
|
61
|
-
|
61
|
+
H,
|
62
62
|
{
|
63
63
|
renderAs: "primary",
|
64
64
|
label: "Select a Goal",
|
65
|
-
value:
|
66
|
-
options:
|
65
|
+
value: C,
|
66
|
+
options: u,
|
67
67
|
shape: "borderLess",
|
68
68
|
theme: "dark",
|
69
|
-
onChange:
|
69
|
+
onChange: E,
|
70
70
|
isTransparent: !0
|
71
71
|
}
|
72
72
|
)
|
73
73
|
}
|
74
74
|
)
|
75
75
|
] }),
|
76
|
-
/* @__PURE__ */ o(
|
77
|
-
/* @__PURE__ */ o(
|
76
|
+
/* @__PURE__ */ o(p, { heightX: 1 }),
|
77
|
+
/* @__PURE__ */ o(L, { $renderAs: "ub3", $align: "center", children: "This is optional and can be skipped." })
|
78
78
|
] });
|
79
79
|
});
|
80
80
|
export {
|
81
|
-
|
81
|
+
Z as default
|
82
82
|
};
|
83
83
|
//# sourceMappingURL=student-enrichment.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"student-enrichment.js","sources":["../../../../../src/features/trial-session/comps/student-enrichment/student-enrichment.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 './student-enrichment-styled';\n\nconst StudentEnrichment = memo(() => {\n const { formData, milestoneConfig, updateSlideConfig, trialHomeData } = useTrialSessionContext();\n const { grade, goals } = formData || {};\n\n const { demo_info: demoInfo } = trialHomeData;\n const { stream } = demoInfo || {};\n const goalsList = useMemo(\n () =>\n getGoalsFromConfig(milestoneConfig, {\n countryCode
|
1
|
+
{"version":3,"file":"student-enrichment.js","sources":["../../../../../src/features/trial-session/comps/student-enrichment/student-enrichment.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 './student-enrichment-styled';\n\nconst StudentEnrichment = memo(() => {\n const { formData, milestoneConfig, updateSlideConfig, trialHomeData } = useTrialSessionContext();\n const { grade, goals } = formData || {};\n\n const { demo_info: demoInfo } = trialHomeData;\n const { stream, region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n\n const goalsList = useMemo(\n () =>\n getGoalsFromConfig(milestoneConfig, {\n countryCode,\n grade: grade ?? '',\n goalCategory: GOAL_CATEGORY.ENRICHMENT,\n courseStream: stream,\n enrollmentType: 'ONLINE',\n }),\n [milestoneConfig, countryCode, grade, stream],\n );\n\n const { goal_code: selectedGoal } = useMemo(\n () => goals?.find(goal => goal.goal_category === GOAL_CATEGORY.ENRICHMENT) ?? {},\n [goals],\n );\n\n const handleGoalChange = useCallback(\n (value: string, option: ISelectOption<string | number>) => {\n if (!value) {\n const goalsWithoutEnrichment = goals?.filter(\n goal => goal.goal_category !== GOAL_CATEGORY.ENRICHMENT,\n );\n\n updateSlideConfig({ goals: goalsWithoutEnrichment });\n\n return;\n }\n\n const { label } = option;\n\n const updatedGoals = updateGoalInFormData(goals, GOAL_CATEGORY.ENRICHMENT, {\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 $width={750} $flexDirection=\"row\" $justifyContent=\"center\">\n <Styled.ImageWrapper>\n <Image withLoader height={402} width={302} src={GIF.ENRICHMENT} className=\"image\" />\n </Styled.ImageWrapper>\n <Styled.InputContainer\n $flexGap={24}\n $justifyContent=\"center\"\n $background=\"PURPLE_1\"\n $borderColor=\"BLACK_1\"\n $gapX={2.5}\n $gutterX={2.5}\n >\n <SearchableSelectInput\n renderAs=\"primary\"\n label=\"Select a Goal\"\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 StudentEnrichment;\n"],"names":["StudentEnrichment","memo","formData","milestoneConfig","updateSlideConfig","trialHomeData","useTrialSessionContext","grade","goals","demoInfo","stream","regionData","countryCode","goalsList","useMemo","getGoalsFromConfig","GOAL_CATEGORY","selectedGoal","goal","handleGoalChange","useCallback","value","option","goalsWithoutEnrichment","label","updatedGoals","updateGoalInFormData","epochTimestampAfterOneYear","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.ContentWrapper","Styled.ImageWrapper","Image","GIF","Styled.InputContainer","SearchableSelectInput","Text"],"mappings":";;;;;;;;;;;;;;AAiBM,MAAAA,IAAoBC,EAAK,MAAM;AACnC,QAAM,EAAE,UAAAC,GAAU,iBAAAC,GAAiB,mBAAAC,GAAmB,eAAAC,EAAA,IAAkBC,KAClE,EAAE,OAAAC,GAAO,OAAAC,MAAUN,KAAY,CAAA,GAE/B,EAAE,WAAWO,EAAa,IAAAJ,GAC1B,EAAE,QAAAK,GAAQ,aAAaC,EAAW,IAAIF,KAAY,CAAA,GAClD,EAAE,qBAAqBG,IAAc,KAAK,IAAID,KAAc,CAAA,GAE5DE,IAAYC;AAAA,IAChB,MACEC,EAAmBZ,GAAiB;AAAA,MAClC,aAAAS;AAAA,MACA,OAAOL,KAAS;AAAA,MAChB,cAAcS,EAAc;AAAA,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iBAAgB;AAAA,UAChB,aAAY;AAAA,UACZ,cAAa;AAAA,UACb,OAAO;AAAA,UACP,UAAU;AAAA,UAEV,UAAA,gBAAAP;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,UAAS;AAAA,cACT,OAAM;AAAA,cACN,OAAOrB;AAAA,cACP,SAASJ;AAAA,cACT,OAAM;AAAA,cACN,OAAM;AAAA,cACN,UAAUM;AAAA,cACV,eAAa;AAAA,YAAA;AAAA,UACf;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,IACA,gBAAAW,EAACC,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,sBACtBQ,GAAK,EAAA,WAAU,OAAM,QAAO,UAAS,UAEtC,wCAAA;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
@@ -1,22 +1,22 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { memo as
|
3
|
-
import { ILLUSTRATIONS as
|
4
|
-
import { GOAL_CATEGORY as
|
5
|
-
import { getCategorizedCurriculumStandards as
|
6
|
-
import { getGradesFromConfig as
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import { useTrialSessionContext as
|
13
|
-
import
|
14
|
-
import { Container as
|
15
|
-
const
|
16
|
-
const { formData: c, milestoneConfig:
|
17
|
-
countryCode:
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
2
|
+
import { memo as T, useCallback as t, useEffect as x } from "react";
|
3
|
+
import { ILLUSTRATIONS as y } from "../../../../assets/illustrations/illustrations.js";
|
4
|
+
import { GOAL_CATEGORY as E } from "../../../milestone/constants.js";
|
5
|
+
import { getCategorizedCurriculumStandards as O } from "../../../milestone/create/comps/class-details-step/class-details-utils.js";
|
6
|
+
import { getGradesFromConfig as B } from "../../../milestone/create/milestone-create-helpers.js";
|
7
|
+
import G from "../../../ui/image/image.js";
|
8
|
+
import U from "../../../ui/inputs/searchable-select-input/searchable-select-input.js";
|
9
|
+
import $ from "../../../ui/inputs/select-input/select-input.js";
|
10
|
+
import D from "../../../ui/inputs/text-input/text-input.js";
|
11
|
+
import H from "../../../ui/separator/separator.js";
|
12
|
+
import { useTrialSessionContext as N } from "../../context/use-trial-session-context.js";
|
13
|
+
import W from "../slide-header/index.js";
|
14
|
+
import { Container as k, StudentInfoWrapper as v, ImageWrapper as R, InformationWrapper as j } from "./student-info-styled.js";
|
15
|
+
const re = T(() => {
|
16
|
+
const { formData: c, milestoneConfig: m, updateSlideConfig: a, updateButtonState: s, trialHomeData: f } = N(), { name: d, grade: n, curriculum: l } = c || {}, g = B(m), { demo_info: h } = f, { stream: C, region_data: S } = h || {}, { opportunity_country: I = "US" } = S || {}, L = O(m, {
|
17
|
+
countryCode: I,
|
18
18
|
grade: n ?? "",
|
19
|
-
goalCategory:
|
19
|
+
goalCategory: E.SCHOOL_SUCCESS,
|
20
20
|
courseStream: C,
|
21
21
|
enrollmentType: "ONLINE"
|
22
22
|
}), u = !!(d && n && l), o = t(
|
@@ -24,23 +24,23 @@ const Z = _(() => {
|
|
24
24
|
a(e === "grade" ? { [e]: p, goals: [] } : { [e]: p });
|
25
25
|
},
|
26
26
|
[a]
|
27
|
-
),
|
27
|
+
), b = t((e) => o("name", e.target.value), [o]), _ = t(
|
28
28
|
(e) => o("grade", e),
|
29
29
|
[o]
|
30
|
-
),
|
30
|
+
), A = t(
|
31
31
|
(e) => o("curriculum", e),
|
32
32
|
[o]
|
33
33
|
);
|
34
|
-
return
|
34
|
+
return x(() => {
|
35
35
|
s("right", { isDisabled: !u, isLoading: !1 });
|
36
|
-
}, [u, s]), /* @__PURE__ */
|
37
|
-
/* @__PURE__ */ r(
|
38
|
-
/* @__PURE__ */ r(
|
39
|
-
/* @__PURE__ */
|
40
|
-
/* @__PURE__ */ r(
|
41
|
-
/* @__PURE__ */
|
36
|
+
}, [u, s]), /* @__PURE__ */ i(k, { children: [
|
37
|
+
/* @__PURE__ */ r(H, { height: 60 }),
|
38
|
+
/* @__PURE__ */ r(W, {}),
|
39
|
+
/* @__PURE__ */ i(v, { $background: "BLUE_4", $borderColor: "BLACK_T_87", children: [
|
40
|
+
/* @__PURE__ */ r(R, { children: /* @__PURE__ */ r(G, { withLoader: !1, src: y.BLUE_CLIP, width: 261, height: 31 }) }),
|
41
|
+
/* @__PURE__ */ i(j, { $flexGapX: 2.75, $background: "WHITE_1", $borderColor: "BLACK_T_87", children: [
|
42
42
|
/* @__PURE__ */ r(
|
43
|
-
|
43
|
+
D,
|
44
44
|
{
|
45
45
|
renderAs: "primary",
|
46
46
|
label: "Student name",
|
@@ -48,32 +48,32 @@ const Z = _(() => {
|
|
48
48
|
type: "text",
|
49
49
|
name: "name",
|
50
50
|
shape: "borderLess",
|
51
|
-
onChange:
|
51
|
+
onChange: b
|
52
52
|
}
|
53
53
|
),
|
54
54
|
/* @__PURE__ */ r(
|
55
|
-
|
55
|
+
U,
|
56
56
|
{
|
57
57
|
renderAs: "primary",
|
58
58
|
label: "Grade",
|
59
59
|
value: n,
|
60
60
|
options: g,
|
61
61
|
shape: "borderLess",
|
62
|
-
onChange:
|
62
|
+
onChange: _,
|
63
63
|
theme: "dark"
|
64
64
|
}
|
65
65
|
),
|
66
66
|
/* @__PURE__ */ r(
|
67
|
-
|
67
|
+
$,
|
68
68
|
{
|
69
69
|
renderAs: "primary",
|
70
70
|
label: "Curriculum",
|
71
71
|
value: l,
|
72
|
-
options:
|
72
|
+
options: L,
|
73
73
|
shape: "borderLess",
|
74
74
|
renderOptionsAs: "section-list",
|
75
75
|
theme: "dark",
|
76
|
-
onChange:
|
76
|
+
onChange: A
|
77
77
|
}
|
78
78
|
)
|
79
79
|
] })
|
@@ -81,6 +81,6 @@ const Z = _(() => {
|
|
81
81
|
] });
|
82
82
|
});
|
83
83
|
export {
|
84
|
-
|
84
|
+
re as default
|
85
85
|
};
|
86
86
|
//# sourceMappingURL=student-info.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"student-info.js","sources":["../../../../../src/features/trial-session/comps/student-info/student-info.tsx"],"sourcesContent":["import { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport { getCategorizedCurriculumStandards } from '../../../milestone/create/comps/class-details-step/class-details-utils';\nimport { getGradesFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport SearchableSelectInput from '../../../ui/inputs/searchable-select-input/searchable-select-input';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\nimport TextInput from '../../../ui/inputs/text-input/text-input';\nimport Separator from '../../../ui/separator/separator';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './student-info-styled';\n\nconst StudentInformation = memo(() => {\n const { formData, milestoneConfig, updateSlideConfig, updateButtonState, trialHomeData } =\n useTrialSessionContext();\n\n const { name, grade, curriculum } = formData || {};\n const grades = getGradesFromConfig(milestoneConfig);\n\n const { demo_info: demoInfo } = trialHomeData;\n const { stream } = demoInfo || {};\n const curriculumStandards = getCategorizedCurriculumStandards(milestoneConfig, {\n countryCode
|
1
|
+
{"version":3,"file":"student-info.js","sources":["../../../../../src/features/trial-session/comps/student-info/student-info.tsx"],"sourcesContent":["import { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport { getCategorizedCurriculumStandards } from '../../../milestone/create/comps/class-details-step/class-details-utils';\nimport { getGradesFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport SearchableSelectInput from '../../../ui/inputs/searchable-select-input/searchable-select-input';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\nimport TextInput from '../../../ui/inputs/text-input/text-input';\nimport Separator from '../../../ui/separator/separator';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './student-info-styled';\n\nconst StudentInformation = memo(() => {\n const { formData, milestoneConfig, updateSlideConfig, updateButtonState, trialHomeData } =\n useTrialSessionContext();\n\n const { name, grade, curriculum } = formData || {};\n const grades = getGradesFromConfig(milestoneConfig);\n\n const { demo_info: demoInfo } = trialHomeData;\n const { stream, region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n\n const curriculumStandards = getCategorizedCurriculumStandards(milestoneConfig, {\n countryCode,\n grade: grade ?? '',\n goalCategory: GOAL_CATEGORY.SCHOOL_SUCCESS,\n courseStream: stream,\n enrollmentType: 'ONLINE',\n });\n const hasRequiredFields = Boolean(name && grade && curriculum);\n\n const updateStudentInformation = useCallback(\n (key: string, value: string) => {\n if (key === 'grade') {\n // reset goals as well if grade changes\n updateSlideConfig({ [key]: value, goals: [] });\n } else {\n updateSlideConfig({ [key]: value });\n }\n },\n [updateSlideConfig],\n );\n\n const handleNameChange = useCallback<\n NonNullable<React.InputHTMLAttributes<HTMLInputElement>['onChange']>\n >(event => updateStudentInformation('name', event.target.value), [updateStudentInformation]);\n\n const handleGradeChange = useCallback(\n (value: string) => updateStudentInformation('grade', value),\n [updateStudentInformation],\n );\n\n const handleCurriculumChange = useCallback(\n (value: string) => updateStudentInformation('curriculum', value),\n [updateStudentInformation],\n );\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: !hasRequiredFields, isLoading: false });\n }, [hasRequiredFields, updateButtonState]);\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.StudentInfoWrapper $background=\"BLUE_4\" $borderColor=\"BLACK_T_87\">\n <Styled.ImageWrapper>\n <Image withLoader={false} src={ILLUSTRATIONS.BLUE_CLIP} width={261} height={31} />\n </Styled.ImageWrapper>\n <Styled.InformationWrapper $flexGapX={2.75} $background=\"WHITE_1\" $borderColor=\"BLACK_T_87\">\n <TextInput\n renderAs=\"primary\"\n label=\"Student name\"\n value={name}\n type=\"text\"\n name=\"name\"\n shape=\"borderLess\"\n onChange={handleNameChange}\n />\n <SearchableSelectInput\n renderAs=\"primary\"\n label=\"Grade\"\n value={grade}\n options={grades}\n shape=\"borderLess\"\n onChange={handleGradeChange}\n theme=\"dark\"\n />\n <SelectInput\n renderAs=\"primary\"\n label=\"Curriculum\"\n value={curriculum}\n options={curriculumStandards}\n shape=\"borderLess\"\n renderOptionsAs=\"section-list\"\n theme=\"dark\"\n onChange={handleCurriculumChange}\n />\n </Styled.InformationWrapper>\n </Styled.StudentInfoWrapper>\n </Styled.Container>\n );\n});\n\nexport default StudentInformation;\n"],"names":["StudentInformation","memo","formData","milestoneConfig","updateSlideConfig","updateButtonState","trialHomeData","useTrialSessionContext","name","grade","curriculum","grades","getGradesFromConfig","demoInfo","stream","regionData","countryCode","curriculumStandards","getCategorizedCurriculumStandards","GOAL_CATEGORY","hasRequiredFields","updateStudentInformation","useCallback","key","value","handleNameChange","event","handleGradeChange","handleCurriculumChange","useEffect","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.StudentInfoWrapper","Styled.ImageWrapper","Image","ILLUSTRATIONS","Styled.InformationWrapper","TextInput","SearchableSelectInput","SelectInput"],"mappings":";;;;;;;;;;;;;;AAeM,MAAAA,KAAqBC,EAAK,MAAM;AACpC,QAAM,EAAE,UAAAC,GAAU,iBAAAC,GAAiB,mBAAAC,GAAmB,mBAAAC,GAAmB,eAAAC,EAAA,IACvEC,KAEI,EAAE,MAAAC,GAAM,OAAAC,GAAO,YAAAC,EAAW,IAAIR,KAAY,CAAA,GAC1CS,IAASC,EAAoBT,CAAe,GAE5C,EAAE,WAAWU,EAAa,IAAAP,GAC1B,EAAE,QAAAQ,GAAQ,aAAaC,EAAW,IAAIF,KAAY,CAAA,GAClD,EAAE,qBAAqBG,IAAc,KAAK,IAAID,KAAc,CAAA,GAE5DE,IAAsBC,EAAkCf,GAAiB;AAAA,IAC7E,aAAAa;AAAA,IACA,OAAOP,KAAS;AAAA,IAChB,cAAcU,EAAc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AAAA,YACN,OAAOhC;AAAA,YACP,MAAK;AAAA,YACL,MAAK;AAAA,YACL,OAAM;AAAA,YACN,UAAUiB;AAAA,UAAA;AAAA,QACZ;AAAA,QACA,gBAAAO;AAAA,UAACS;AAAA,UAAA;AAAA,YACC,UAAS;AAAA,YACT,OAAM;AAAA,YACN,OAAOhC;AAAA,YACP,SAASE;AAAA,YACT,OAAM;AAAA,YACN,UAAUgB;AAAA,YACV,OAAM;AAAA,UAAA;AAAA,QACR;AAAA,QACA,gBAAAK;AAAA,UAACU;AAAA,UAAA;AAAA,YACC,UAAS;AAAA,YACT,OAAM;AAAA,YACN,OAAOhC;AAAA,YACP,SAASO;AAAA,YACT,OAAM;AAAA,YACN,iBAAgB;AAAA,YAChB,OAAM;AAAA,YACN,UAAUW;AAAA,UAAA;AAAA,QACZ;AAAA,MAAA,GACF;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
@@ -1,49 +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
|
8
|
-
import
|
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
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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
|
+
import p from "../../../ui/separator/separator.js";
|
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
|
+
goalCategory: r.TEST_PREP,
|
21
|
+
courseStream: i,
|
22
|
+
enrollmentType: "ONLINE"
|
23
|
+
}),
|
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, _) => {
|
24
27
|
if (!t) {
|
25
|
-
const
|
26
|
-
(
|
28
|
+
const E = e == null ? void 0 : e.filter(
|
29
|
+
(P) => P.goal_category !== r.TEST_PREP
|
27
30
|
);
|
28
|
-
a({ goals:
|
31
|
+
a({ goals: E });
|
29
32
|
return;
|
30
33
|
}
|
31
|
-
const { label:
|
34
|
+
const { label: C } = _, S = j(e, r.TEST_PREP, {
|
32
35
|
goal_code: t,
|
33
|
-
milestone_name:
|
34
|
-
milestone_date_ts:
|
36
|
+
milestone_name: C,
|
37
|
+
milestone_date_ts: R()
|
35
38
|
});
|
36
|
-
a({ goals:
|
39
|
+
a({ goals: S });
|
37
40
|
},
|
38
41
|
[e, a]
|
39
42
|
);
|
40
|
-
return /* @__PURE__ */
|
41
|
-
/* @__PURE__ */ o(
|
42
|
-
/* @__PURE__ */ o(
|
43
|
-
/* @__PURE__ */
|
44
|
-
/* @__PURE__ */ o(
|
43
|
+
return /* @__PURE__ */ l(O, { children: [
|
44
|
+
/* @__PURE__ */ o(p, { height: 60 }),
|
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" }) }),
|
45
48
|
/* @__PURE__ */ o(
|
46
|
-
|
49
|
+
N,
|
47
50
|
{
|
48
51
|
$flexGap: 40,
|
49
52
|
$justifyContent: "center",
|
@@ -52,26 +55,26 @@ const M = E(() => {
|
|
52
55
|
$gapX: 2.5,
|
53
56
|
$gutterX: 2.5,
|
54
57
|
children: /* @__PURE__ */ o(
|
55
|
-
|
58
|
+
L,
|
56
59
|
{
|
57
60
|
renderAs: "primary",
|
58
61
|
label: "Select a Test",
|
59
|
-
value:
|
60
|
-
options:
|
62
|
+
value: h,
|
63
|
+
options: u,
|
61
64
|
shape: "borderLess",
|
62
65
|
theme: "dark",
|
63
|
-
onChange:
|
66
|
+
onChange: T,
|
64
67
|
isTransparent: !0
|
65
68
|
}
|
66
69
|
)
|
67
70
|
}
|
68
71
|
)
|
69
72
|
] }),
|
70
|
-
/* @__PURE__ */ o(
|
71
|
-
/* @__PURE__ */ o(
|
73
|
+
/* @__PURE__ */ o(p, { heightX: 1 }),
|
74
|
+
/* @__PURE__ */ o(A, { $renderAs: "ub3", $align: "center", children: "This is optional and can be skipped." })
|
72
75
|
] });
|
73
76
|
});
|
74
77
|
export {
|
75
|
-
|
78
|
+
Z as default
|
76
79
|
};
|
77
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 } 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 } = demoInfo || {};\n const { grade, goals } = formData || {};\n const goalsList = getGoalsFromConfig(milestoneConfig, {\n
|
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,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30 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { useState as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import { useResumeTrialWorksheet as
|
6
|
-
import { useTrialSessionContext as
|
7
|
-
const
|
8
|
-
const { isTeacher: o, studentId:
|
9
|
-
if (
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
2
|
+
import { useState as S, useCallback as T, useEffect as k } from "react";
|
3
|
+
import x from "../../../ui/error/error.js";
|
4
|
+
import E from "../../../ui/loader/app-loader/app-loader.js";
|
5
|
+
import { useResumeTrialWorksheet as A } from "../../api/trial-nodes.js";
|
6
|
+
import { useTrialSessionContext as D } from "../../context/use-trial-session-context.js";
|
7
|
+
const L = () => {
|
8
|
+
const { isTeacher: o, studentId: t, worksheet: r, updateSlideConfig: u, trialHomeData: c } = D(), [f, s] = S(!1), { demo_info: m } = c, { region_data: p } = m || {}, { opportunity_country: n = "US" } = p || {}, l = (h, d) => {
|
9
|
+
if (h && s(!0), d) {
|
10
10
|
const {
|
11
|
-
user_node_id:
|
12
|
-
node_id:
|
13
|
-
user_attempt_id:
|
14
|
-
node_type:
|
15
|
-
} =
|
16
|
-
|
11
|
+
user_node_id: g,
|
12
|
+
node_id: y,
|
13
|
+
user_attempt_id: I,
|
14
|
+
node_type: C
|
15
|
+
} = d;
|
16
|
+
u({ userNodeId: g, nodeId: y, attemptId: I, nodeType: C });
|
17
17
|
}
|
18
|
-
}, { patch: i, isProcessing:
|
19
|
-
onComplete:
|
20
|
-
}), e =
|
21
|
-
o && (s(!1), i(
|
22
|
-
}, [o, i,
|
23
|
-
return
|
18
|
+
}, { patch: i, isProcessing: _ } = A({
|
19
|
+
onComplete: l
|
20
|
+
}), e = T(() => {
|
21
|
+
o && (s(!1), i(t, { country_code: n }));
|
22
|
+
}, [n, o, i, t]);
|
23
|
+
return k(() => {
|
24
24
|
e();
|
25
|
-
}, [e]),
|
25
|
+
}, [e]), f ? /* @__PURE__ */ a(x, { height: "100%", onTryAgain: e }) : _ || !r ? /* @__PURE__ */ a(E, { height: "100%" }) : r;
|
26
26
|
};
|
27
27
|
export {
|
28
|
-
|
28
|
+
L as default
|
29
29
|
};
|
30
30
|
//# sourceMappingURL=worksheet.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"worksheet.js","sources":["../../../../../src/features/trial-session/comps/worksheet/worksheet.tsx"],"sourcesContent":["import type { IResumeWorksheetModel } from '../../../../types/models/worksheet';\nimport type { FC } from 'react';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport Error from '../../../ui/error/error';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport { useResumeTrialWorksheet } from '../../api/trial-nodes';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\n\nconst SessionWorksheet: FC = () => {\n const { isTeacher, studentId, worksheet, updateSlideConfig }
|
1
|
+
{"version":3,"file":"worksheet.js","sources":["../../../../../src/features/trial-session/comps/worksheet/worksheet.tsx"],"sourcesContent":["import type { IResumeWorksheetModel } from '../../../../types/models/worksheet';\nimport type { FC } from 'react';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport Error from '../../../ui/error/error';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport { useResumeTrialWorksheet } from '../../api/trial-nodes';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\n\nconst SessionWorksheet: FC = () => {\n const { isTeacher, studentId, worksheet, updateSlideConfig, trialHomeData } =\n useTrialSessionContext();\n const [isError, setIserror] = useState<boolean>(false);\n\n const { demo_info: demoInfo } = trialHomeData;\n const { region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n\n const onComplete = (error: string | null, sheetData?: IResumeWorksheetModel) => {\n if (error) {\n setIserror(true);\n }\n\n if (sheetData) {\n const {\n user_node_id: userNodeId,\n node_id: nodeId,\n user_attempt_id: attemptId,\n node_type: nodeType,\n } = sheetData;\n\n updateSlideConfig({ userNodeId, nodeId, attemptId, nodeType });\n }\n };\n\n const { patch: resumeNode, isProcessing } = useResumeTrialWorksheet({\n onComplete,\n });\n\n const fetchData = useCallback(() => {\n if (isTeacher) {\n setIserror(false);\n resumeNode(studentId, { country_code: countryCode });\n }\n }, [countryCode, isTeacher, resumeNode, studentId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n if (isError) {\n return <Error height=\"100%\" onTryAgain={fetchData} />;\n }\n\n if (isProcessing || !worksheet) {\n return <AppLoader height=\"100%\" />;\n }\n\n return worksheet;\n};\n\nexport default SessionWorksheet;\n"],"names":["SessionWorksheet","isTeacher","studentId","worksheet","updateSlideConfig","trialHomeData","useTrialSessionContext","isError","setIserror","useState","demoInfo","regionData","countryCode","onComplete","error","sheetData","userNodeId","nodeId","attemptId","nodeType","resumeNode","isProcessing","useResumeTrialWorksheet","fetchData","useCallback","useEffect","jsx","Error","AppLoader"],"mappings":";;;;;;AAUA,MAAMA,IAAuB,MAAM;AACjC,QAAM,EAAE,WAAAC,GAAW,WAAAC,GAAW,WAAAC,GAAW,mBAAAC,GAAmB,eAAAC,EAAA,IAC1DC,KACI,CAACC,GAASC,CAAU,IAAIC,EAAkB,EAAK,GAE/C,EAAE,WAAWC,EAAa,IAAAL,GAC1B,EAAE,aAAaM,MAAeD,KAAY,CAAA,GAC1C,EAAE,qBAAqBE,IAAc,KAAK,IAAID,KAAc,CAAA,GAE5DE,IAAa,CAACC,GAAsBC,MAAsC;AAK9E,QAJID,KACFN,EAAW,EAAI,GAGbO,GAAW;AACP,YAAA;AAAA,QACJ,cAAcC;AAAA,QACd,SAASC;AAAA,QACT,iBAAiBC;AAAA,QACjB,WAAWC;AAAA,MACT,IAAAJ;AAEJ,MAAAX,EAAkB,EAAE,YAAAY,GAAY,QAAAC,GAAQ,WAAAC,GAAW,UAAAC,EAAU,CAAA;AAAA,IAC/D;AAAA,EAAA,GAGI,EAAE,OAAOC,GAAY,cAAAC,EAAA,IAAiBC,EAAwB;AAAA,IAClE,YAAAT;AAAA,EAAA,CACD,GAEKU,IAAYC,EAAY,MAAM;AAClC,IAAIvB,MACFO,EAAW,EAAK,GAChBY,EAAWlB,GAAW,EAAE,cAAcU,EAAa,CAAA;AAAA,KAEpD,CAACA,GAAaX,GAAWmB,GAAYlB,CAAS,CAAC;AAMlD,SAJAuB,EAAU,MAAM;AACJ,IAAAF;EAAA,GACT,CAACA,CAAS,CAAC,GAEVhB,IACM,gBAAAmB,EAAAC,GAAA,EAAM,QAAO,QAAO,YAAYJ,EAAW,CAAA,IAGjDF,KAAgB,CAAClB,IACZ,gBAAAuB,EAACE,GAAU,EAAA,QAAO,OAAO,CAAA,IAG3BzB;AACT;"}
|