@cuemath/leap 3.3.1 → 3.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/assets/gif/gif.js +3 -0
  2. package/dist/assets/gif/gif.js.map +1 -1
  3. package/dist/assets/illustrations/illustrations.js +1 -0
  4. package/dist/assets/illustrations/illustrations.js.map +1 -1
  5. package/dist/features/milestone/constants.js +12 -10
  6. package/dist/features/milestone/constants.js.map +1 -1
  7. package/dist/features/trial-session/api/course-stream.js.map +1 -1
  8. package/dist/features/trial-session/comps/about-cuemath/about-cuemath-constants.js +1 -1
  9. package/dist/features/trial-session/comps/about-cuemath/about-cuemath-constants.js.map +1 -1
  10. package/dist/features/trial-session/comps/background-grid/background-grid-utils.js +66 -60
  11. package/dist/features/trial-session/comps/background-grid/background-grid-utils.js.map +1 -1
  12. package/dist/features/trial-session/comps/offering-information/offering-information-constants.js +12 -12
  13. package/dist/features/trial-session/comps/offering-information/offering-information-constants.js.map +1 -1
  14. package/dist/features/trial-session/comps/session-report/report-404/report-404.js +34 -0
  15. package/dist/features/trial-session/comps/session-report/report-404/report-404.js.map +1 -0
  16. package/dist/features/trial-session/comps/session-report/{report-card.js → report-information/report-card.js} +2 -2
  17. package/dist/features/trial-session/comps/session-report/report-information/report-card.js.map +1 -0
  18. package/dist/features/trial-session/comps/session-report/report-information/report-information-styled.js +29 -0
  19. package/dist/features/trial-session/comps/session-report/report-information/report-information-styled.js.map +1 -0
  20. package/dist/features/trial-session/comps/session-report/report-information/report-information.js +107 -0
  21. package/dist/features/trial-session/comps/session-report/report-information/report-information.js.map +1 -0
  22. package/dist/features/trial-session/comps/session-report/session-report-styled.js +6 -29
  23. package/dist/features/trial-session/comps/session-report/session-report-styled.js.map +1 -1
  24. package/dist/features/trial-session/comps/session-report/session-report.js +44 -174
  25. package/dist/features/trial-session/comps/session-report/session-report.js.map +1 -1
  26. package/dist/features/trial-session/comps/student-personalization/student-personalization-styled.js +20 -5
  27. package/dist/features/trial-session/comps/student-personalization/student-personalization-styled.js.map +1 -1
  28. package/dist/features/trial-session/comps/student-personalization/student-personalization.js +59 -126
  29. package/dist/features/trial-session/comps/student-personalization/student-personalization.js.map +1 -1
  30. package/dist/features/trial-session/comps/student-profile/constant.js +10 -0
  31. package/dist/features/trial-session/comps/student-profile/constant.js.map +1 -0
  32. package/dist/features/trial-session/comps/student-profile/student-profile-highlights/student-profile-highlights.js +38 -0
  33. package/dist/features/trial-session/comps/student-profile/student-profile-highlights/student-profile-highlights.js.map +1 -0
  34. package/dist/features/trial-session/comps/student-profile/student-profile.js +93 -46
  35. package/dist/features/trial-session/comps/student-profile/student-profile.js.map +1 -1
  36. package/dist/features/trial-session/hooks/use-trial-session-navigation.js +65 -63
  37. package/dist/features/trial-session/hooks/use-trial-session-navigation.js.map +1 -1
  38. package/dist/features/trial-session/left-panel/index.js +1 -1
  39. package/dist/features/trial-session/left-panel/index.js.map +1 -1
  40. package/dist/features/trial-session/right-panel/slide-components-map.js +32 -32
  41. package/dist/features/trial-session/right-panel/slide-components-map.js.map +1 -1
  42. package/dist/features/trial-session/trial-session-constants.js +3 -3
  43. package/dist/features/trial-session/trial-session-constants.js.map +1 -1
  44. package/dist/features/trial-session/trial-session-types.js.map +1 -1
  45. package/dist/features/ui/inputs/checkbox-input-list/checkbox-input-list-styled.js +2 -7
  46. package/dist/features/ui/inputs/checkbox-input-list/checkbox-input-list-styled.js.map +1 -1
  47. package/dist/features/ui/inputs/checkbox-input-list/checkbox-input-list.js +29 -27
  48. package/dist/features/ui/inputs/checkbox-input-list/checkbox-input-list.js.map +1 -1
  49. package/dist/index.d.ts +65 -0
  50. package/dist/index.js +226 -220
  51. package/dist/index.js.map +1 -1
  52. package/dist/static/personalization.7a6c33e8.svg +1 -0
  53. package/dist/static/personalized-session.b4fd7df8.gif +0 -0
  54. package/dist/static/regular-practice.b15f24d9.gif +0 -0
  55. package/dist/static/stepup.321df6ed.gif +0 -0
  56. package/package.json +2 -3
  57. package/dist/features/trial-session/comps/session-report/report-card.js.map +0 -1
@@ -1,141 +1,74 @@
1
- import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
- import { memo as T, useMemo as a, useCallback as d, useEffect as K } from "react";
3
- import { COURSE_STREAMS as c, PREFERENCE_CATEGORY as u } from "../../../milestone/constants.js";
4
- import { getPreferencesFromConfig as m } from "../../../milestone/create/milestone-create-helpers.js";
5
- import h from "../../../ui/inputs/checkbox-input-list/checkbox-input-list.js";
6
- import s from "../../../ui/separator/separator.js";
7
- import o from "../../../ui/text/text.js";
8
- import { useTrialSessionContext as R } from "../../context/use-trial-session-context.js";
9
- import y from "../slide-header/index.js";
10
- import { Container as F, ContentWrapper as k } from "./student-personalization-styled.js";
11
- const U = T(() => {
12
- const { formData: g, milestoneConfig: l, updateSlideConfig: t, updateButtonState: p } = R(), {
13
- name: A,
14
- grade: i,
15
- personalizedLevel: C = [],
16
- personalizedFocus: b = [],
17
- personalizedBehaviors: $ = []
18
- } = g || {}, f = C.length > 0, S = a(
19
- () => m(l, {
20
- grade: i ?? "",
21
- courseStream: c.MATH,
22
- preferenceCategory: u.LEVEL
23
- }).map(({ id: r, label: x, description: z }) => ({
24
- id: r,
25
- label: /* @__PURE__ */ n(o, { $renderAs: "ub3", children: [
26
- /* @__PURE__ */ e(o, { $renderAs: "ub3-bold", $color: "BLACK_1", $inline: !0, children: x }),
27
- " ",
28
- "- ",
29
- z
30
- ] })
31
- })),
32
- [i, l]
33
- ), L = a(
34
- () => m(l, {
35
- grade: i ?? "",
36
- courseStream: c.MATH,
37
- preferenceCategory: u.FOCUS
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
+ import { memo as p, useMemo as f, useCallback as u, useEffect as h } from "react";
3
+ import { ILLUSTRATIONS as C } from "../../../../assets/illustrations/illustrations.js";
4
+ import { COURSE_STREAMS as g, PREFERENCE_CATEGORY as S } from "../../../milestone/constants.js";
5
+ import { getPreferencesFromConfig as E } from "../../../milestone/create/milestone-create-helpers.js";
6
+ import b from "../../../ui/image/image.js";
7
+ import x from "../../../ui/inputs/checkbox-input-list/checkbox-input-list.js";
8
+ import A from "../../../ui/layout/flex-view.js";
9
+ import $ from "../../../ui/separator/separator.js";
10
+ import L from "../../../ui/text/text.js";
11
+ import { useTrialSessionContext as O } from "../../context/use-trial-session-context.js";
12
+ import R from "../slide-header/index.js";
13
+ import { Container as T, ContentWrapper as j, ImageWrapper as I } from "./student-personalization-styled.js";
14
+ const W = p(() => {
15
+ const { formData: m, milestoneConfig: r, updateSlideConfig: t, updateButtonState: i } = O(), { grade: n, personalizedObjectives: a = [] } = m || {}, s = a.length > 0, l = f(
16
+ () => E(r, {
17
+ grade: n ?? "",
18
+ courseStream: g.MATH,
19
+ preferenceCategory: S.OBJECTIVES
38
20
  }),
39
- [i, l]
40
- ), v = a(
41
- () => m(l, {
42
- grade: i ?? "",
43
- courseStream: c.MATH,
44
- preferenceCategory: u.BEHAVIOR
45
- }),
46
- [i, l]
47
- ), B = d(
48
- (r) => {
49
- t({ personalizedLevel: r });
50
- },
51
- [t]
52
- ), _ = d(
53
- (r) => {
54
- t({ personalizedFocus: r });
55
- },
56
- [t]
57
- ), E = d(
58
- (r) => {
59
- t({ personalizedBehaviors: r });
21
+ [n, r]
22
+ ), d = u(
23
+ (c) => {
24
+ t({ personalizedObjectives: c });
60
25
  },
61
26
  [t]
62
27
  );
63
- return K(() => {
64
- p("right", { isDisabled: !f, isLoading: !1 });
65
- }, [f, p]), /* @__PURE__ */ n(F, { children: [
66
- /* @__PURE__ */ e(s, { height: 60 }),
67
- /* @__PURE__ */ e(y, {}),
68
- /* @__PURE__ */ n(
69
- k,
70
- {
71
- $width: 750,
72
- $flexDirection: "column",
73
- $justifyContent: "center",
74
- $flexGap: 24,
75
- $borderColor: "BLACK_1",
76
- $background: "GREEN_1",
77
- $gapX: 1.5,
78
- $gutterX: 2.5,
79
- children: [
80
- /* @__PURE__ */ n("div", { children: [
81
- /* @__PURE__ */ n(o, { $renderAs: "ab2-bold", $color: "BLACK_1", children: [
82
- "How would you describe ",
83
- A,
84
- "’s current level?"
85
- ] }),
86
- /* @__PURE__ */ e(o, { $renderAs: "ub3", $color: "BLACK_T_60", children: "(Select one)" }),
87
- /* @__PURE__ */ e(s, { height: 12 }),
88
- /* @__PURE__ */ e(
89
- h,
90
- {
91
- size: "small",
92
- renderAs: "black",
93
- options: S,
94
- value: C,
95
- onChange: B,
96
- maximumSelection: 1
97
- }
98
- )
99
- ] }),
100
- /* @__PURE__ */ n("div", { children: [
101
- /* @__PURE__ */ e(o, { $renderAs: "ab2-bold", $color: "BLACK_1", children: "What should we focus on?" }),
102
- /* @__PURE__ */ e(o, { $renderAs: "ub3", $color: "BLACK_T_60", children: "(Select all that apply)" }),
103
- /* @__PURE__ */ e(s, { height: 12 }),
104
- /* @__PURE__ */ e(
105
- h,
106
- {
107
- size: "small",
108
- renderAs: "black",
109
- numColumns: 4,
110
- options: L,
111
- value: b,
112
- onChange: _
113
- }
114
- )
115
- ] }),
116
- /* @__PURE__ */ n("div", { children: [
117
- /* @__PURE__ */ e(o, { $renderAs: "ab2-bold", $color: "BLACK_1", children: "Should we focus on any learning behaviors?" }),
118
- /* @__PURE__ */ e(o, { $renderAs: "ub3", $color: "BLACK_T_60", children: "(Select upto 2)" }),
119
- /* @__PURE__ */ e(s, { height: 12 }),
28
+ return h(() => {
29
+ i("right", { isDisabled: !s, isLoading: !1 });
30
+ }, [s, i]), /* @__PURE__ */ o(T, { children: [
31
+ /* @__PURE__ */ e($, { height: 60 }),
32
+ /* @__PURE__ */ e(R, {}),
33
+ /* @__PURE__ */ o(j, { $width: 750, $flexDirection: "row", $justifyContent: "center", children: [
34
+ /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(
35
+ b,
36
+ {
37
+ withLoader: !0,
38
+ height: 402,
39
+ width: 302,
40
+ className: "image",
41
+ src: C.PERSONALIZATION
42
+ }
43
+ ) }),
44
+ /* @__PURE__ */ o(
45
+ A,
46
+ {
47
+ $flexGap: 24,
48
+ $borderColor: "BLACK_1",
49
+ $background: "GREEN_1",
50
+ $gutterX: 1.5,
51
+ $justifyContent: "center",
52
+ children: [
53
+ /* @__PURE__ */ e(L, { $renderAs: "ab2-bold", $color: "BLACK_1", children: "What would you like your child to work on?" }),
120
54
  /* @__PURE__ */ e(
121
- h,
55
+ x,
122
56
  {
123
57
  size: "small",
124
58
  renderAs: "black",
125
- numColumns: 3,
126
- options: v,
127
- value: $,
128
- onChange: E,
129
- maximumSelection: 2
59
+ options: l,
60
+ value: a,
61
+ onChange: d,
62
+ optionFlexGap: 16
130
63
  }
131
64
  )
132
- ] })
133
- ]
134
- }
135
- )
65
+ ]
66
+ }
67
+ )
68
+ ] })
136
69
  ] });
137
70
  });
138
71
  export {
139
- U as default
72
+ W as default
140
73
  };
141
74
  //# sourceMappingURL=student-personalization.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"student-personalization.js","sources":["../../../../../src/features/trial-session/comps/student-personalization/student-personalization.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { COURSE_STREAMS, PREFERENCE_CATEGORY } from '../../../milestone/constants';\nimport { getPreferencesFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport CheckboxInputList from '../../../ui/inputs/checkbox-input-list/checkbox-input-list';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './student-personalization-styled';\n\nconst StudentPersonalization = memo(() => {\n const { formData, milestoneConfig, updateSlideConfig, updateButtonState } =\n useTrialSessionContext();\n\n const {\n name,\n grade,\n personalizedLevel = [],\n personalizedFocus = [],\n personalizedBehaviors = [],\n } = formData || {};\n\n const hasRequiredFields = Boolean(personalizedLevel.length > 0);\n\n const levelList = useMemo(\n () =>\n getPreferencesFromConfig(milestoneConfig, {\n grade: grade ?? '',\n courseStream: COURSE_STREAMS.MATH,\n preferenceCategory: PREFERENCE_CATEGORY.LEVEL,\n }).map(({ id, label, description }) => ({\n id,\n label: (\n <Text $renderAs=\"ub3\">\n <Text $renderAs=\"ub3-bold\" $color=\"BLACK_1\" $inline>\n {label}\n </Text>{' '}\n - {description}\n </Text>\n ),\n })),\n [grade, milestoneConfig],\n );\n\n const focusList = useMemo(\n () =>\n getPreferencesFromConfig(milestoneConfig, {\n grade: grade ?? '',\n courseStream: COURSE_STREAMS.MATH,\n preferenceCategory: PREFERENCE_CATEGORY.FOCUS,\n }),\n [grade, milestoneConfig],\n );\n\n const behaviorsList = useMemo(\n () =>\n getPreferencesFromConfig(milestoneConfig, {\n grade: grade ?? '',\n courseStream: COURSE_STREAMS.MATH,\n preferenceCategory: PREFERENCE_CATEGORY.BEHAVIOR,\n }),\n [grade, milestoneConfig],\n );\n\n const handleChangeLevel = useCallback(\n (value: string[]) => {\n updateSlideConfig({ personalizedLevel: value });\n },\n [updateSlideConfig],\n );\n\n const handleChangeFocus = useCallback(\n (value: string[]) => {\n updateSlideConfig({ personalizedFocus: value });\n },\n [updateSlideConfig],\n );\n\n const handleChangeBehaviors = useCallback(\n (value: string[]) => {\n updateSlideConfig({ personalizedBehaviors: value });\n },\n [updateSlideConfig],\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.ContentWrapper\n $width={750}\n $flexDirection=\"column\"\n $justifyContent=\"center\"\n $flexGap={24}\n $borderColor=\"BLACK_1\"\n $background=\"GREEN_1\"\n $gapX={1.5}\n $gutterX={2.5}\n >\n <div>\n <Text $renderAs=\"ab2-bold\" $color=\"BLACK_1\">\n How would you describe {name}’s current level?\n </Text>\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n (Select one)\n </Text>\n <Separator height={12} />\n <CheckboxInputList\n size=\"small\"\n renderAs=\"black\"\n options={levelList}\n value={personalizedLevel}\n onChange={handleChangeLevel}\n maximumSelection={1}\n />\n </div>\n <div>\n <Text $renderAs=\"ab2-bold\" $color=\"BLACK_1\">\n What should we focus on?\n </Text>\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n (Select all that apply)\n </Text>\n <Separator height={12} />\n <CheckboxInputList\n size=\"small\"\n renderAs=\"black\"\n numColumns={4}\n options={focusList}\n value={personalizedFocus}\n onChange={handleChangeFocus}\n />\n </div>\n <div>\n <Text $renderAs=\"ab2-bold\" $color=\"BLACK_1\">\n Should we focus on any learning behaviors?\n </Text>\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n (Select upto 2)\n </Text>\n <Separator height={12} />\n <CheckboxInputList\n size=\"small\"\n renderAs=\"black\"\n numColumns={3}\n options={behaviorsList}\n value={personalizedBehaviors}\n onChange={handleChangeBehaviors}\n maximumSelection={2}\n />\n </div>\n </Styled.ContentWrapper>\n </Styled.Container>\n );\n});\n\nexport default StudentPersonalization;\n"],"names":["StudentPersonalization","memo","formData","milestoneConfig","updateSlideConfig","updateButtonState","useTrialSessionContext","name","grade","personalizedLevel","personalizedFocus","personalizedBehaviors","hasRequiredFields","levelList","useMemo","getPreferencesFromConfig","COURSE_STREAMS","PREFERENCE_CATEGORY","id","label","description","jsxs","Text","jsx","focusList","behaviorsList","handleChangeLevel","useCallback","value","handleChangeFocus","handleChangeBehaviors","useEffect","Styled.Container","Separator","SlideHeader","Styled.ContentWrapper","CheckboxInputList"],"mappings":";;;;;;;;;;AAWM,MAAAA,IAAyBC,EAAK,MAAM;AACxC,QAAM,EAAE,UAAAC,GAAU,iBAAAC,GAAiB,mBAAAC,GAAmB,mBAAAC,EAAA,IACpDC,KAEI;AAAA,IACJ,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,mBAAAC,IAAoB,CAAC;AAAA,IACrB,mBAAAC,IAAoB,CAAC;AAAA,IACrB,uBAAAC,IAAwB,CAAC;AAAA,EAAA,IACvBT,KAAY,CAAA,GAE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A,YACA,gBAAAC,EAACU,GAAU,EAAA,QAAQ,GAAI,CAAA;AAAA,YACvB,gBAAAV;AAAA,cAACa;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,UAAS;AAAA,gBACT,YAAY;AAAA,gBACZ,SAASZ;AAAA,gBACT,OAAOd;AAAA,gBACP,UAAUmB;AAAA,cAAA;AAAA,YACZ;AAAA,UAAA,GACF;AAAA,4BACC,OACC,EAAA,UAAA;AAAA,YAAA,gBAAAN,EAACD,GAAK,EAAA,WAAU,YAAW,QAAO,WAAU,UAE5C,8CAAA;AAAA,8BACCA,GAAK,EAAA,WAAU,OAAM,QAAO,cAAa,UAE1C,mBAAA;AAAA,YACA,gBAAAC,EAACU,GAAU,EAAA,QAAQ,GAAI,CAAA;AAAA,YACvB,gBAAAV;AAAA,cAACa;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,UAAS;AAAA,gBACT,YAAY;AAAA,gBACZ,SAASX;AAAA,gBACT,OAAOd;AAAA,gBACP,UAAUmB;AAAA,gBACV,kBAAkB;AAAA,cAAA;AAAA,YACpB;AAAA,UAAA,GACF;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
1
+ {"version":3,"file":"student-personalization.js","sources":["../../../../../src/features/trial-session/comps/student-personalization/student-personalization.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport { COURSE_STREAMS, PREFERENCE_CATEGORY } from '../../../milestone/constants';\nimport { getPreferencesFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport CheckboxInputList from '../../../ui/inputs/checkbox-input-list/checkbox-input-list';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './student-personalization-styled';\n\nconst StudentPersonalization = memo(() => {\n const { formData, milestoneConfig, updateSlideConfig, updateButtonState } =\n useTrialSessionContext();\n\n const { grade, personalizedObjectives = [] } = formData || {};\n\n const hasRequiredFields = Boolean(personalizedObjectives.length > 0);\n\n const objectivesList = useMemo(\n () =>\n getPreferencesFromConfig(milestoneConfig, {\n grade: grade ?? '',\n courseStream: COURSE_STREAMS.MATH,\n preferenceCategory: PREFERENCE_CATEGORY.OBJECTIVES,\n }),\n [grade, milestoneConfig],\n );\n\n const handleChangeObjectives = useCallback(\n (value: string[]) => {\n updateSlideConfig({ personalizedObjectives: value });\n },\n [updateSlideConfig],\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.ContentWrapper $width={750} $flexDirection=\"row\" $justifyContent=\"center\">\n <Styled.ImageWrapper>\n <Image\n withLoader\n height={402}\n width={302}\n className=\"image\"\n src={ILLUSTRATIONS.PERSONALIZATION}\n />\n </Styled.ImageWrapper>\n <FlexView\n $flexGap={24}\n $borderColor=\"BLACK_1\"\n $background=\"GREEN_1\"\n $gutterX={1.5}\n $justifyContent=\"center\"\n >\n <Text $renderAs=\"ab2-bold\" $color=\"BLACK_1\">\n What would you like your child to work on?\n </Text>\n <CheckboxInputList\n size=\"small\"\n renderAs=\"black\"\n options={objectivesList}\n value={personalizedObjectives}\n onChange={handleChangeObjectives}\n optionFlexGap={16}\n />\n </FlexView>\n </Styled.ContentWrapper>\n </Styled.Container>\n );\n});\n\nexport default StudentPersonalization;\n"],"names":["StudentPersonalization","memo","formData","milestoneConfig","updateSlideConfig","updateButtonState","useTrialSessionContext","grade","personalizedObjectives","hasRequiredFields","objectivesList","useMemo","getPreferencesFromConfig","COURSE_STREAMS","PREFERENCE_CATEGORY","handleChangeObjectives","useCallback","value","useEffect","jsxs","Styled.Container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,QAACS;AAAA,QAAA;AAAA,UACC,UAAU;AAAA,UACV,cAAa;AAAA,UACb,aAAY;AAAA,UACZ,UAAU;AAAA,UACV,iBAAgB;AAAA,UAEhB,UAAA;AAAA,YAAA,gBAAAP,EAACQ,GAAK,EAAA,WAAU,YAAW,QAAO,WAAU,UAE5C,8CAAA;AAAA,YACA,gBAAAR;AAAA,cAACS;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,UAAS;AAAA,gBACT,SAASpB;AAAA,gBACT,OAAOF;AAAA,gBACP,UAAUO;AAAA,gBACV,eAAe;AAAA,cAAA;AAAA,YACjB;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
@@ -0,0 +1,10 @@
1
+ import { GOAL_CATEGORY as E } from "../../../milestone/constants.js";
2
+ const S = {
3
+ [E.SCHOOL_SUCCESS]: "School",
4
+ [E.TEST_PREP]: "Test Prep",
5
+ [E.ENRICHMENT]: "Enrichment"
6
+ };
7
+ export {
8
+ S as GOAL_MAPPING
9
+ };
10
+ //# sourceMappingURL=constant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constant.js","sources":["../../../../../src/features/trial-session/comps/student-profile/constant.ts"],"sourcesContent":["import { GOAL_CATEGORY } from '../../../milestone/constants';\n\nexport const GOAL_MAPPING = {\n [GOAL_CATEGORY.SCHOOL_SUCCESS]: 'School',\n [GOAL_CATEGORY.TEST_PREP]: 'Test Prep',\n [GOAL_CATEGORY.ENRICHMENT]: 'Enrichment',\n};\n"],"names":["GOAL_MAPPING","GOAL_CATEGORY"],"mappings":";AAEO,MAAMA,IAAe;AAAA,EAC1B,CAACC,EAAc,cAAc,GAAG;AAAA,EAChC,CAACA,EAAc,SAAS,GAAG;AAAA,EAC3B,CAACA,EAAc,UAAU,GAAG;AAC9B;"}
@@ -0,0 +1,38 @@
1
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
+ import { memo as d } from "react";
3
+ import c from "styled-components";
4
+ import a from "../../../../ui/image/image.js";
5
+ import o from "../../../../ui/layout/flex-view.js";
6
+ import n from "../../../../ui/text/text.js";
7
+ const m = c(o)`
8
+ &:not(:last-child) {
9
+ border-bottom: 1px solid ${({ theme: t }) => t.colors.BLACK_1};
10
+ }
11
+ `, s = d(
12
+ ({ profileHighlights: t }) => /* @__PURE__ */ e(o, { $borderColor: "BLACK_1", children: t.map((r) => /* @__PURE__ */ l(
13
+ m,
14
+ {
15
+ $flexDirection: "row",
16
+ $alignItems: "center",
17
+ $justifyContent: "flex-start",
18
+ $gapX: 1,
19
+ $gutterX: 1,
20
+ $flexGapX: 1.5,
21
+ $background: r.background,
22
+ children: [
23
+ /* @__PURE__ */ e(a, { src: r.illustration, alt: r.title, height: 96, width: 96 }),
24
+ /* @__PURE__ */ l(o, { $flexDirection: "column", $flex: 1, $flexGap: 2, children: [
25
+ /* @__PURE__ */ e(n, { $renderAs: "ac3-black", children: r.title }),
26
+ /* @__PURE__ */ e(n, { $renderAs: "ab2", children: typeof r.description == "string" ? r.description : r.description.map((i) => /* @__PURE__ */ e("li", { children: i }, i)) })
27
+ ] })
28
+ ]
29
+ },
30
+ r.title
31
+ )) })
32
+ );
33
+ s.displayName = "StudentProfileHighlights";
34
+ const y = s;
35
+ export {
36
+ y as default
37
+ };
38
+ //# sourceMappingURL=student-profile-highlights.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"student-profile-highlights.js","sources":["../../../../../../src/features/trial-session/comps/student-profile/student-profile-highlights/student-profile-highlights.tsx"],"sourcesContent":["import type { TColorNames } from '../../../../ui/types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\nimport styled from 'styled-components';\n\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\n\ntype TProfileHighlight = {\n illustration: string;\n background: TColorNames;\n title: string;\n description: string | string[];\n};\n\nconst HighlightWrapper = styled(FlexView)`\n &:not(:last-child) {\n border-bottom: 1px solid ${({ theme }) => theme.colors.BLACK_1};\n }\n`;\n\ninterface IStudentProfileHighlightsProps {\n profileHighlights: TProfileHighlight[];\n}\n\nconst StudentProfileHighlights: FC<IStudentProfileHighlightsProps> = memo(\n ({ profileHighlights }) => {\n return (\n <FlexView $borderColor=\"BLACK_1\">\n {profileHighlights.map(highlight => (\n <HighlightWrapper\n key={highlight.title}\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"flex-start\"\n $gapX={1}\n $gutterX={1}\n $flexGapX={1.5}\n $background={highlight.background}\n >\n <Image src={highlight.illustration} alt={highlight.title} height={96} width={96} />\n <FlexView $flexDirection=\"column\" $flex={1} $flexGap={2}>\n <Text $renderAs=\"ac3-black\">{highlight.title}</Text>\n <Text $renderAs=\"ab2\">\n {typeof highlight.description === 'string'\n ? highlight.description\n : highlight.description.map(desc => <li key={desc}>{desc}</li>)}\n </Text>\n </FlexView>\n </HighlightWrapper>\n ))}\n </FlexView>\n );\n },\n);\n\nStudentProfileHighlights.displayName = 'StudentProfileHighlights';\n\nexport default StudentProfileHighlights;\n"],"names":["HighlightWrapper","styled","FlexView","theme","StudentProfileHighlights","memo","profileHighlights","highlight","jsxs","jsx","Image","Text","desc","StudentProfileHighlights$1"],"mappings":";;;;;;AAiBA,MAAMA,IAAmBC,EAAOC,CAAQ;AAAA;AAAA,+BAET,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA,GAQ5DC,IAA+DC;AAAA,EACnE,CAAC,EAAE,mBAAAC,EAAA,wBAEEJ,GAAS,EAAA,cAAa,WACpB,UAAAI,EAAkB,IAAI,CACrBC,MAAA,gBAAAC;AAAA,IAACR;AAAA,IAAA;AAAA,MAEC,gBAAe;AAAA,MACf,aAAY;AAAA,MACZ,iBAAgB;AAAA,MAChB,OAAO;AAAA,MACP,UAAU;AAAA,MACV,WAAW;AAAA,MACX,aAAaO,EAAU;AAAA,MAEvB,UAAA;AAAA,QAAC,gBAAAE,EAAAC,GAAA,EAAM,KAAKH,EAAU,cAAc,KAAKA,EAAU,OAAO,QAAQ,IAAI,OAAO,GAAI,CAAA;AAAA,0BAChFL,GAAS,EAAA,gBAAe,UAAS,OAAO,GAAG,UAAU,GACpD,UAAA;AAAA,UAAA,gBAAAO,EAACE,GAAK,EAAA,WAAU,aAAa,UAAAJ,EAAU,OAAM;AAAA,4BAC5CI,GAAK,EAAA,WAAU,OACb,UAAO,OAAAJ,EAAU,eAAgB,WAC9BA,EAAU,cACVA,EAAU,YAAY,IAAI,CAAQK,MAAA,gBAAAH,EAAC,QAAe,UAAPG,EAAA,GAAAA,CAAY,CAAK,EAClE,CAAA;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,IAjBKL,EAAU;AAAA,EAmBlB,CAAA,EACH,CAAA;AAGN;AAEAH,EAAyB,cAAc;AAEvC,MAAAS,IAAeT;"}
@@ -1,48 +1,95 @@
1
- import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
- import { memo as b, useMemo as A, useCallback as E, useEffect as s } from "react";
3
- import { GOAL_CATEGORY as g } from "../../../milestone/constants.js";
4
- import w from "../../../ui/error/error.js";
5
- import G from "../../../ui/image/image.js";
6
- import h from "../../../ui/layout/flex-view.js";
7
- import L from "../../../ui/loader/app-loader/app-loader.js";
8
- import D from "../../../ui/separator/separator.js";
9
- import S from "../../../ui/text/text.js";
10
- import { useGetStudentProfileSummary as X } from "../../api/student-profile-summary.js";
11
- import { useTrialSessionContext as M } from "../../context/use-trial-session-context.js";
12
- import O from "../slide-header/index.js";
13
- import { Container as k, ContentWrapper as B, AbsoluteImage as H, ImageWrapper as R } from "./student-profile-styled.js";
14
- import { getDummyProfileImage as W, getMilestoneGoalName as P } from "./student-profile-utils.js";
15
- const re = b(() => {
16
- const { isTeacher: t, studentId: l, formData: $, updateSlideConfig: d, updateButtonState: f } = M(), { name: y, goals: r, studentProfile: o } = $ || {}, { dummyProfileImageIndex: I, profileSummary: x } = o || {}, C = W(I), m = A(() => r && r.length > 0 ? {
17
- school_success_goal: P(r, g.SCHOOL_SUCCESS),
18
- test_prep_goal: P(r, g.TEST_PREP)
19
- } : null, [r]), {
20
- get: u,
21
- data: _,
22
- isProcessing: a,
23
- isProcessed: c,
24
- isProcessingFailed: T
25
- } = X(), { profile_summary: p } = _ || {}, n = E(() => {
26
- m && u(l, m);
27
- }, [u, m, l]);
28
- return s(() => {
29
- f("right", { isDisabled: a, isLoading: !1 });
30
- }, [a, f]), s(() => {
31
- t && !o && n();
32
- }, [n, t, o]), s(() => {
33
- t && c && d({
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
+ import { useTrialSessionContext as X } from "../../context/use-trial-session-context.js";
13
+ import { getFormattedStudentPersonalizedPreference as K } from "../../helper.js";
14
+ import j from "../slide-header/index.js";
15
+ import { GOAL_MAPPING as z } from "./constant.js";
16
+ import F from "./student-profile-highlights/student-profile-highlights.js";
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
+ const {
21
+ isTeacher: o,
22
+ studentId: u,
23
+ formData: b,
24
+ slideConfig: G,
25
+ milestoneConfig: c,
26
+ updateSlideConfig: p,
27
+ updateButtonState: g
28
+ } = X(), { showProfileHighlights: r } = G, {
29
+ name: O,
30
+ goals: t = [],
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
+ } : null, [t]), {
38
+ get: S,
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({
34
52
  studentProfile: {
35
- profileSummary: p || "",
53
+ profileSummary: E || "",
36
54
  dummyProfileImageIndex: Math.floor(Math.random() * 6)
37
55
  }
38
56
  });
39
- }, [c, t, p, d]), T ? /* @__PURE__ */ e(w, { height: "70vh", onTryAgain: n }) : a || !o ? /* @__PURE__ */ e(L, { height: "100vh" }) : /* @__PURE__ */ i(k, { children: [
40
- /* @__PURE__ */ e(D, { height: 60 }),
41
- /* @__PURE__ */ e(O, { marginBottom: 100 }),
42
- /* @__PURE__ */ i(B, { $widthX: 46.875, children: [
43
- /* @__PURE__ */ e(H, {}),
44
- /* @__PURE__ */ i(
45
- h,
57
+ }, [_, o, r, E, p]);
58
+ const B = L(
59
+ () => [
60
+ {
61
+ title: "Studnet Level",
62
+ description: `Catching up: ${h[0]}`,
63
+ illustration: f.KNOWLEDGE_BLUE,
64
+ background: "BLUE_1"
65
+ },
66
+ {
67
+ illustration: f.ARROW_BOARD_GREEN,
68
+ background: "GREEN_1",
69
+ title: "Goals",
70
+ description: K(
71
+ c,
72
+ P
73
+ ).map((n) => n.preference_name)
74
+ },
75
+ {
76
+ illustration: f.BOOK_CHECKED_PURPLE,
77
+ background: "PURPLE_1",
78
+ title: "Learning Plan",
79
+ description: t.map(
80
+ (n) => `${z[n.goal_category]}: ${n.milestone_name}`
81
+ )
82
+ }
83
+ ],
84
+ [t, c, h, P]
85
+ );
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 }),
88
+ /* @__PURE__ */ e(j, { marginBottom: r ? 50 : 100 }),
89
+ r ? /* @__PURE__ */ e(y, { $width: 650, children: /* @__PURE__ */ e(F, { profileHighlights: B }) }) : /* @__PURE__ */ a(y, { $widthX: 46.875, children: [
90
+ /* @__PURE__ */ e(Y, {}),
91
+ /* @__PURE__ */ a(
92
+ C,
46
93
  {
47
94
  $width: "100%",
48
95
  $heightX: 21.875,
@@ -54,10 +101,10 @@ const re = b(() => {
54
101
  $borderColor: "BLACK_T_87",
55
102
  $borderRadiusX: 0.5,
56
103
  children: [
57
- /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(G, { withLoader: !0, height: 200, width: 200, src: C }) }),
58
- /* @__PURE__ */ i(h, { $flexGap: 16, children: [
59
- /* @__PURE__ */ e(S, { $renderAs: "ac2-black", children: y }),
60
- /* @__PURE__ */ e(S, { $renderAs: "ab1", children: x || "" })
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 || "" })
61
108
  ] })
62
109
  ]
63
110
  }
@@ -66,6 +113,6 @@ const re = b(() => {
66
113
  ] });
67
114
  });
68
115
  export {
69
- re as default
116
+ he as default
70
117
  };
71
118
  //# sourceMappingURL=student-profile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"student-profile.js","sources":["../../../../../src/features/trial-session/comps/student-profile/student-profile.tsx"],"sourcesContent":["import type { IGetStudentProfileSummaryQuery } from '../../api/student-profile-summary';\n\nimport { memo, useCallback, useEffect, useMemo } from 'react';\n\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 SlideHeader from '../slide-header';\nimport * as Styled from './student-profile-styled';\nimport { getDummyProfileImage, getMilestoneGoalName } from './student-profile-utils';\n\nconst StudentProfile = memo(() => {\n const { isTeacher, studentId, formData, updateSlideConfig, updateButtonState } =\n useTrialSessionContext();\n\n const { name, goals, studentProfile } = 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) {\n fetchData();\n }\n }, [fetchData, isTeacher, studentProfile]);\n\n useEffect(() => {\n if (isTeacher && isProcessed) {\n updateSlideConfig({\n studentProfile: {\n profileSummary: studentProfileSummary || '',\n dummyProfileImageIndex: Math.floor(Math.random() * 6),\n },\n });\n }\n }, [isProcessed, isTeacher, studentProfileSummary, updateSlideConfig]);\n\n if (isProcessingFailed) {\n return <Error height=\"70vh\" onTryAgain={fetchData} />;\n }\n\n if (isProcessing || !studentProfile) {\n return <AppLoader height=\"100vh\" />;\n }\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader marginBottom={100} />\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 </Styled.Container>\n );\n});\n\nexport default StudentProfile;\n"],"names":["StudentProfile","memo","isTeacher","studentId","formData","updateSlideConfig","updateButtonState","useTrialSessionContext","name","goals","studentProfile","dummyProfileImageIndex","profileSummary","dummyProfileImage","getDummyProfileImage","payload","useMemo","getMilestoneGoalName","GOAL_CATEGORY","getStudentProfileSummary","data","isProcessing","isProcessed","isProcessingFailed","useGetStudentProfileSummary","studentProfileSummary","fetchData","useCallback","useEffect","jsx","Error","AppLoader","jsxs","Styled.Container","Separator","SlideHeader","Styled.ContentWrapper","Styled.AbsoluteImage","FlexView","Styled.ImageWrapper","Image","Text"],"mappings":";;;;;;;;;;;;;;AAiBM,MAAAA,KAAiBC,EAAK,MAAM;AAChC,QAAM,EAAE,WAAAC,GAAW,WAAAC,GAAW,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,YAAYJ,EAAW,CAAA,IAGjDL,KAAgB,CAACX,IACZ,gBAAAmB,EAACE,GAAU,EAAA,QAAO,QAAQ,CAAA,IAIjC,gBAAAC,EAACC,GAAA,EACC,UAAA;AAAA,IAAC,gBAAAJ,EAAAK,GAAA,EAAU,QAAQ,GAAI,CAAA;AAAA,IACvB,gBAAAL,EAACM,GAAY,EAAA,cAAc,IAAK,CAAA;AAAA,IAC/B,gBAAAH,EAAAI,GAAA,EAAsB,SAAS,QAC9B,UAAA;AAAA,MAAC,gBAAAP,EAAAQ,GAAA,EAAqB;AAAA,MACtB,gBAAAL;AAAA,QAACM;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,gBAAAT,EAACU,GAAA,EACC,UAAA,gBAAAV,EAACW,GAAM,EAAA,YAAU,IAAC,QAAQ,KAAK,OAAO,KAAK,KAAK3B,EAAmB,CAAA,GACrE;AAAA,YACA,gBAAAmB,EAACM,GAAS,EAAA,UAAU,IAClB,UAAA;AAAA,cAAC,gBAAAT,EAAAY,GAAA,EAAK,WAAU,aAAa,UAAKjC,GAAA;AAAA,cACjC,gBAAAqB,EAAAY,GAAA,EAAK,WAAU,OAAO,eAAkB,IAAG;AAAA,YAAA,GAC9C;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,EACF,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,m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