@cuemath/leap 3.0.31 → 3.1.0-aa0
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/assets/line-icons/icons/check.js +3 -3
- package/dist/assets/line-icons/icons/check.js.map +1 -1
- package/dist/assets/line-icons/icons/puzzle-icon.js +51 -0
- package/dist/assets/line-icons/icons/puzzle-icon.js.map +1 -0
- package/dist/assets/line-icons/icons/share.js +48 -0
- package/dist/assets/line-icons/icons/share.js.map +1 -0
- package/dist/assets/line-icons/icons/tile.js +54 -0
- package/dist/assets/line-icons/icons/tile.js.map +1 -0
- package/dist/features/cue-canvas/bottombar/homework-controls.js +73 -0
- package/dist/features/cue-canvas/bottombar/homework-controls.js.map +1 -0
- package/dist/features/cue-canvas/cue-canvas-context.js +8 -5
- package/dist/features/cue-canvas/cue-canvas-context.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-core.js +68 -70
- package/dist/features/cue-canvas/cue-canvas-core.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-helpers.js +31 -25
- package/dist/features/cue-canvas/cue-canvas-helpers.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-provider.js +14 -12
- package/dist/features/cue-canvas/cue-canvas-provider.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas.js +86 -66
- package/dist/features/cue-canvas/cue-canvas.js.map +1 -1
- package/dist/features/cue-canvas/cue-cavas-styled.js +45 -42
- package/dist/features/cue-canvas/cue-cavas-styled.js.map +1 -1
- package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js +61 -54
- package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js.map +1 -1
- package/dist/features/cue-canvas/hooks/use-cue-canvas-actions.js +18 -14
- package/dist/features/cue-canvas/hooks/use-cue-canvas-actions.js.map +1 -1
- package/dist/features/cue-canvas/hooks/use-upload-helper.js +23 -0
- package/dist/features/cue-canvas/hooks/use-upload-helper.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/homework/helper.js +20 -0
- package/dist/features/cue-canvas/sidebar/homework/helper.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/homework/homework-menu.js +33 -0
- package/dist/features/cue-canvas/sidebar/homework/homework-menu.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/homework/homework-request.js +68 -0
- package/dist/features/cue-canvas/sidebar/homework/homework-request.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/homework/homework-styled.js +25 -0
- package/dist/features/cue-canvas/sidebar/homework/homework-styled.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/homework/homework.js +39 -0
- package/dist/features/cue-canvas/sidebar/homework/homework.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/api/get-puzzles.js +13 -0
- package/dist/features/cue-canvas/sidebar/puzzles/api/get-puzzles.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/filter-selection-menu.js +60 -0
- package/dist/features/cue-canvas/sidebar/puzzles/filter-selection-menu.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/filters-section.js +44 -0
- package/dist/features/cue-canvas/sidebar/puzzles/filters-section.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/filters.js +107 -0
- package/dist/features/cue-canvas/sidebar/puzzles/filters.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/hooks/use-fetch-cue-canvas-activity.js +42 -0
- package/dist/features/cue-canvas/sidebar/puzzles/hooks/use-fetch-cue-canvas-activity.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/launch-puzzle.js +84 -0
- package/dist/features/cue-canvas/sidebar/puzzles/launch-puzzle.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu-header.js +36 -0
- package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu-header.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu.js +133 -0
- package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/puzzles-styled.js +96 -0
- package/dist/features/cue-canvas/sidebar/puzzles/puzzles-styled.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/puzzles.js +29 -0
- package/dist/features/cue-canvas/sidebar/puzzles/puzzles.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/utils.js +120 -0
- package/dist/features/cue-canvas/sidebar/puzzles/utils.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/sidebar-styled.js +32 -0
- package/dist/features/cue-canvas/sidebar/sidebar-styled.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/sidebar.js +29 -0
- package/dist/features/cue-canvas/sidebar/sidebar.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/tiles/tile.js +16 -0
- package/dist/features/cue-canvas/sidebar/tiles/tile.js.map +1 -0
- package/dist/features/cue-canvas/toolbar/grid-menu.js +13 -13
- package/dist/features/cue-canvas/toolbar/grid-menu.js.map +1 -1
- package/dist/features/homework/styles.js +4 -5
- package/dist/features/homework/styles.js.map +1 -1
- package/dist/features/hooks/use-debounce.js +16 -0
- package/dist/features/hooks/use-debounce.js.map +1 -0
- package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js +36 -38
- package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/hooks/use-catalog-helpers.js +22 -24
- package/dist/features/milestone/create/comps/add-custom-chapter/hooks/use-catalog-helpers.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapter-category/chapter-category-container.js +22 -23
- package/dist/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapter-category/chapter-category-container.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/utils.js +47 -49
- package/dist/features/milestone/create/comps/chapters-selection-step/utils.js.map +1 -1
- package/dist/features/milestone/create/comps/class-details-step/class-details-step.js +87 -94
- package/dist/features/milestone/create/comps/class-details-step/class-details-step.js.map +1 -1
- package/dist/features/milestone/create/comps/class-details-step/class-details-utils.js +12 -13
- package/dist/features/milestone/create/comps/class-details-step/class-details-utils.js.map +1 -1
- package/dist/features/milestone/create/comps/test-type-step/test-type-step.js +21 -23
- package/dist/features/milestone/create/comps/test-type-step/test-type-step.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-helpers.js +162 -165
- package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
- package/dist/features/ui/stepper/stepper.js +7 -7
- package/dist/features/worksheet/worksheet/hooks/use-s3-helper.js +22 -19
- package/dist/features/worksheet/worksheet/hooks/use-s3-helper.js.map +1 -1
- package/dist/index.d.ts +48 -3
- package/dist/index.js +184 -180
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"class-details-utils.js","sources":["../../../../../../src/features/milestone/create/comps/class-details-step/class-details-utils.tsx"],"sourcesContent":["import type { ISectionOption } from '../../../../ui/section-list/section-list-types';\nimport type {\n IMilestoneConfig,\n TCourseStream,\n TCurriculumStandardOption,\n TEnrollmentTypes,\n TGoalCategory,\n
|
1
|
+
{"version":3,"file":"class-details-utils.js","sources":["../../../../../../src/features/milestone/create/comps/class-details-step/class-details-utils.tsx"],"sourcesContent":["import type { ISectionOption } from '../../../../ui/section-list/section-list-types';\nimport type {\n IMilestoneConfig,\n TCourseStream,\n TCurriculumStandardOption,\n TEnrollmentTypes,\n TGoalCategory,\n} from '../../milestone-create-types';\n\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport { getCurriculumStandardsFromConfig } from '../../milestone-create-helpers';\nimport * as Styled from './class-details-styled';\n\ninterface IGetCategorizedCurriculumStandards {\n (\n config: IMilestoneConfig,\n options: {\n grade: string;\n countryCode: string;\n goalCategory: TGoalCategory;\n courseStream: TCourseStream;\n classRatio?: number;\n enrollmentType: TEnrollmentTypes;\n },\n ): ISectionOption<TCurriculumStandardOption>[];\n}\n\nconst getCategorizedCurriculumStandards: IGetCategorizedCurriculumStandards = (\n config,\n { grade, countryCode, goalCategory, courseStream, classRatio, enrollmentType },\n) => {\n const curriculumStandards = getCurriculumStandardsFromConfig(config, {\n grade,\n countryCode,\n goalCategory,\n courseStream,\n classRatio,\n enrollmentType,\n });\n\n const addTagToSectionOption = (option: TCurriculumStandardOption) => {\n const { isDefault } = option;\n\n if (isDefault) {\n return {\n ...option,\n tag: (\n <ArrowTooltip renderAs=\"secondary\" position=\"top\" tooltipItem=\"Default\" zIndex={4}>\n <FlexView $width={20} $height={20} $alignItems=\"center\">\n <Styled.StyledStarIcon />\n </FlexView>\n </ArrowTooltip>\n ),\n };\n }\n\n return option;\n };\n\n const prioritySortByDefaultAndLabel = (\n a: TCurriculumStandardOption,\n b: TCurriculumStandardOption,\n ) => {\n //* If a has tag, It should come before b\n if (a.isDefault && !b.isDefault) return -1;\n\n //* If b has tag, It should come before a\n if (!a.isDefault && b.isDefault) return 1;\n\n //* Else we sort based on alphabetic order of label\n if (a.label.toUpperCase() > b.label.toUpperCase()) {\n return 1;\n }\n\n return -1;\n };\n\n const recommendedCurriculumStandards = curriculumStandards\n .filter(option => option.isRecommended)\n .map(addTagToSectionOption)\n .sort(prioritySortByDefaultAndLabel);\n const otherCurriculumStandards = curriculumStandards\n .filter(option => !option.isRecommended)\n .map(addTagToSectionOption)\n .sort(prioritySortByDefaultAndLabel);\n\n const categorizedCurriculumStandards = [\n { title: 'recommended', data: recommendedCurriculumStandards },\n { title: 'others', data: otherCurriculumStandards },\n ].filter(option => option.data.length > 0);\n\n return categorizedCurriculumStandards;\n};\n\nexport { getCategorizedCurriculumStandards };\n"],"names":["getCategorizedCurriculumStandards","config","grade","countryCode","goalCategory","courseStream","classRatio","enrollmentType","curriculumStandards","getCurriculumStandardsFromConfig","addTagToSectionOption","option","isDefault","jsx","ArrowTooltip","FlexView","Styled.StyledStarIcon","prioritySortByDefaultAndLabel","a","b","recommendedCurriculumStandards","ot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
|
8
8
|
import { getCurriculumStandardsFromConfig as S, getDefaultBoard as F, appendPrimaryGoalCategoryToFormState as O } from "../../milestone-create-helpers.js";
|
9
9
|
import T from "../body-layout/body-layout.js";
|
10
10
|
import { getCategorizedCurriculumStandards as X } from "../class-details-step/class-details-utils.js";
|
11
|
-
import { getGoalCategories as j, getTestTypeBasedCategory as
|
11
|
+
import { getGoalCategories as j, getTestTypeBasedCategory as g } from "./test-type-utils.js";
|
12
12
|
const Z = _(
|
13
13
|
({
|
14
14
|
currentStep: f,
|
15
15
|
formData: b,
|
16
16
|
config: t,
|
17
17
|
courseStream: o,
|
18
|
-
classRatio:
|
19
|
-
onFormDataChange:
|
18
|
+
classRatio: s,
|
19
|
+
onFormDataChange: l,
|
20
20
|
enrollmentType: r
|
21
21
|
}) => {
|
22
|
-
const { name:
|
23
|
-
step:
|
24
|
-
}, { testType:
|
22
|
+
const { name: C, title: h } = f, x = {
|
23
|
+
step: C
|
24
|
+
}, { testType: d, grade: i, board: n, region: m } = b, { flow: p } = L(P), { onEvent: c } = w(x), E = j(d, t, o, r), G = k(
|
25
25
|
(a) => {
|
26
26
|
const $ = X(t, {
|
27
27
|
grade: i ?? "",
|
28
|
-
goalCategory:
|
28
|
+
goalCategory: g(a),
|
29
29
|
countryCode: m ?? "",
|
30
30
|
courseStream: o,
|
31
|
-
classRatio:
|
32
|
-
enrollmentType: r
|
33
|
-
flow: s
|
31
|
+
classRatio: s,
|
32
|
+
enrollmentType: r
|
34
33
|
}), v = S(t, {
|
35
34
|
grade: i ?? "",
|
36
|
-
goalCategory:
|
35
|
+
goalCategory: g(a),
|
37
36
|
countryCode: m ?? "",
|
38
37
|
courseStream: o,
|
39
|
-
classRatio:
|
40
|
-
enrollmentType: r
|
41
|
-
flow: s
|
38
|
+
classRatio: s,
|
39
|
+
enrollmentType: r
|
42
40
|
}), u = n && v.some((I) => I.id === n) ? n : F($), A = O(
|
43
41
|
t,
|
44
42
|
a,
|
@@ -49,9 +47,9 @@ const Z = _(
|
|
49
47
|
m
|
50
48
|
);
|
51
49
|
c("SELECTED_GOAL_CATEGORY", {
|
52
|
-
goal_category:
|
53
|
-
flow:
|
54
|
-
}),
|
50
|
+
goal_category: g(a),
|
51
|
+
flow: p
|
52
|
+
}), l({
|
55
53
|
testType: a,
|
56
54
|
board: u,
|
57
55
|
chapterGoalCategory: {
|
@@ -66,12 +64,12 @@ const Z = _(
|
|
66
64
|
[
|
67
65
|
r,
|
68
66
|
n,
|
69
|
-
|
67
|
+
s,
|
70
68
|
t,
|
71
69
|
o,
|
72
|
-
|
70
|
+
p,
|
73
71
|
i,
|
74
|
-
|
72
|
+
l,
|
75
73
|
m,
|
76
74
|
c
|
77
75
|
]
|
@@ -79,16 +77,16 @@ const Z = _(
|
|
79
77
|
return /* @__PURE__ */ e(
|
80
78
|
T,
|
81
79
|
{
|
82
|
-
stepName:
|
80
|
+
stepName: C,
|
83
81
|
headerElement: /* @__PURE__ */ e(D, { $renderAs: "ab2", children: h }),
|
84
82
|
bodyElement: /* @__PURE__ */ e(y, { $alignItems: "center", $height: "100%", $gapX: 5, children: /* @__PURE__ */ e(y, { $flexDirection: "row", $flexGapX: 1.5, children: /* @__PURE__ */ e(
|
85
83
|
B,
|
86
84
|
{
|
87
85
|
options: E,
|
88
|
-
value:
|
86
|
+
value: d,
|
89
87
|
onChange: G,
|
90
88
|
analyticsLabel: "goal_category",
|
91
|
-
analyticsProps: { test_type:
|
89
|
+
analyticsProps: { test_type: d },
|
92
90
|
type: "radio"
|
93
91
|
}
|
94
92
|
) }) })
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"test-type-step.js","sources":["../../../../../../src/features/milestone/create/comps/test-type-step/test-type-step.tsx"],"sourcesContent":["import type { IFormStepProps, IMileStoneFormFields } from '../../milestone-create-types';\n\nimport React, { memo, useCallback, useContext } from 'react';\n\nimport useTrackingContext from '../../../../ui/context/use-tracking-context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport SelectionCards from '../../../../ui/selection-cards/selection-cards';\nimport Text from '../../../../ui/text/text';\nimport MilestoneCreateContext from '../../milestone-create-context';\nimport {\n appendPrimaryGoalCategoryToFormState,\n getCurriculumStandardsFromConfig,\n getDefaultBoard,\n} from '../../milestone-create-helpers';\nimport BodyLayout from '../body-layout/body-layout';\nimport { getCategorizedCurriculumStandards } from '../class-details-step/class-details-utils';\nimport { getGoalCategories, getTestTypeBasedCategory } from './test-type-utils';\n\nconst TestTypeStep: React.FC<IFormStepProps> = memo(\n ({\n currentStep,\n formData,\n config,\n courseStream,\n classRatio,\n onFormDataChange,\n enrollmentType,\n }) => {\n const { name, title } = currentStep;\n const analyticsProps = {\n step: name,\n };\n const { testType, grade, board, region } = formData;\n\n const { flow } = useContext(MilestoneCreateContext);\n const { onEvent: trackEvent } = useTrackingContext(analyticsProps);\n\n const goalCategories = getGoalCategories(testType, config, courseStream, enrollmentType);\n\n const handleTestTypeChange = useCallback(\n (selectedTestType: NonNullable<IMileStoneFormFields['testType']>) => {\n //* This is to compensate for kids with no board.\n //* ref: https://www.notion.so/cuemath/FE-Goal-Creator-15a8897caec780f3ae21e34ce6f34371?p=1758897caec7803689f8cfc7acf5f5fc&pm=s\n const boards = getCategorizedCurriculumStandards(config, {\n grade: grade ?? '',\n goalCategory: getTestTypeBasedCategory(selectedTestType),\n countryCode: region ?? '',\n courseStream,\n classRatio,\n enrollmentType,\n
|
1
|
+
{"version":3,"file":"test-type-step.js","sources":["../../../../../../src/features/milestone/create/comps/test-type-step/test-type-step.tsx"],"sourcesContent":["import type { IFormStepProps, IMileStoneFormFields } from '../../milestone-create-types';\n\nimport React, { memo, useCallback, useContext } from 'react';\n\nimport useTrackingContext from '../../../../ui/context/use-tracking-context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport SelectionCards from '../../../../ui/selection-cards/selection-cards';\nimport Text from '../../../../ui/text/text';\nimport MilestoneCreateContext from '../../milestone-create-context';\nimport {\n appendPrimaryGoalCategoryToFormState,\n getCurriculumStandardsFromConfig,\n getDefaultBoard,\n} from '../../milestone-create-helpers';\nimport BodyLayout from '../body-layout/body-layout';\nimport { getCategorizedCurriculumStandards } from '../class-details-step/class-details-utils';\nimport { getGoalCategories, getTestTypeBasedCategory } from './test-type-utils';\n\nconst TestTypeStep: React.FC<IFormStepProps> = memo(\n ({\n currentStep,\n formData,\n config,\n courseStream,\n classRatio,\n onFormDataChange,\n enrollmentType,\n }) => {\n const { name, title } = currentStep;\n const analyticsProps = {\n step: name,\n };\n const { testType, grade, board, region } = formData;\n\n const { flow } = useContext(MilestoneCreateContext);\n const { onEvent: trackEvent } = useTrackingContext(analyticsProps);\n\n const goalCategories = getGoalCategories(testType, config, courseStream, enrollmentType);\n\n const handleTestTypeChange = useCallback(\n (selectedTestType: NonNullable<IMileStoneFormFields['testType']>) => {\n //* This is to compensate for kids with no board.\n //* ref: https://www.notion.so/cuemath/FE-Goal-Creator-15a8897caec780f3ae21e34ce6f34371?p=1758897caec7803689f8cfc7acf5f5fc&pm=s\n const boards = getCategorizedCurriculumStandards(config, {\n grade: grade ?? '',\n goalCategory: getTestTypeBasedCategory(selectedTestType),\n countryCode: region ?? '',\n courseStream,\n classRatio,\n enrollmentType,\n });\n\n const curriculumStandards = getCurriculumStandardsFromConfig(config, {\n grade: grade ?? '',\n goalCategory: getTestTypeBasedCategory(selectedTestType),\n countryCode: region ?? '',\n courseStream,\n classRatio,\n enrollmentType,\n });\n\n const boardIsAvailableInCurriculum =\n board && curriculumStandards.some(boardData => boardData.id === board);\n\n const boardData = boardIsAvailableInCurriculum ? board : getDefaultBoard(boards);\n\n const primaryGoalCategory = appendPrimaryGoalCategoryToFormState(\n config,\n selectedTestType,\n grade,\n courseStream,\n enrollmentType,\n boardData,\n region,\n );\n\n trackEvent('SELECTED_GOAL_CATEGORY', {\n goal_category: getTestTypeBasedCategory(selectedTestType),\n flow,\n });\n\n onFormDataChange({\n testType: selectedTestType,\n board: boardData,\n chapterGoalCategory: {\n primaryGoalCategory,\n },\n committed: {\n testType: true,\n chapterGoalCategory: true,\n },\n });\n },\n [\n enrollmentType,\n board,\n classRatio,\n config,\n courseStream,\n flow,\n grade,\n onFormDataChange,\n region,\n trackEvent,\n ],\n );\n\n return (\n <BodyLayout\n stepName={name}\n headerElement={<Text $renderAs=\"ab2\">{title}</Text>}\n bodyElement={\n <FlexView $alignItems=\"center\" $height=\"100%\" $gapX={5}>\n <FlexView $flexDirection=\"row\" $flexGapX={1.5}>\n <SelectionCards\n options={goalCategories}\n value={testType}\n onChange={handleTestTypeChange}\n analyticsLabel=\"goal_category\"\n analyticsProps={{ test_type: testType }}\n type=\"radio\"\n />\n </FlexView>\n </FlexView>\n }\n />\n );\n },\n);\n\nexport default TestTypeStep;\n"],"names":["TestTypeStep","memo","currentStep","formData","config","courseStream","classRatio","onFormDataChange","enrollmentType","name","title","analyticsProps","testType","grade","board","region","flow","useContext","MilestoneCreateContext","trackEvent","useTrackingContext","goalCategories","getGoalCategories","handleTestTypeChange","useCallback","selectedTestType","boards","getCategorizedCurriculumStandards","getTestTypeBasedCategory","curriculumStandards","getCurriculumStandardsFromConfig","boardData","getDefaultBoard","primaryGoalCategory","appendPrimaryGoalCategoryToFormState","jsx","BodyLayout","Text","FlexView","SelectionCards"],"mappings":";;;;;;;;;;;AAkBA,MAAMA,IAAyCC;AAAA,EAC7C,CAAC;AAAA,IACC,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,gBAAAC;AAAA,EAAA,MACI;AACE,UAAA,EAAE,MAAAC,GAAM,OAAAC,EAAU,IAAAR,GAClBS,IAAiB;AAAA,MACrB,MAAMF;AAAA,IAAA,GAEF,EAAE,UAAAG,GAAU,OAAAC,GAAO,OAAAC,GAAO,QAAAC,MAAWZ,GAErC,EAAE,MAAAa,EAAA,IAASC,EAAWC,CAAsB,GAC5C,EAAE,SAASC,EAAW,IAAIC,EAAmBT,CAAc,GAE3DU,IAA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0B,EAACE,GAAK,EAAA,WAAU,OAAO,UAAM3B,GAAA;AAAA,QAC5C,aACE,gBAAAyB,EAACG,GAAS,EAAA,aAAY,UAAS,SAAQ,QAAO,OAAO,GACnD,UAAC,gBAAAH,EAAAG,GAAA,EAAS,gBAAe,OAAM,WAAW,KACxC,UAAA,gBAAAH;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,SAASlB;AAAA,YACT,OAAOT;AAAA,YACP,UAAUW;AAAA,YACV,gBAAe;AAAA,YACf,gBAAgB,EAAE,WAAWX,EAAS;AAAA,YACtC,MAAK;AAAA,UAAA;AAAA,WAET,EACF,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;"}
|
@@ -1,240 +1,237 @@
|
|
1
|
-
import { COUNTRY_MAP as
|
2
|
-
import { getStudentEnrollmentSupported as
|
3
|
-
import { checkEnrollmentAvailable as
|
4
|
-
import { GOAL_EDIT_FLOWS as
|
5
|
-
const
|
6
|
-
|
7
|
-
|
1
|
+
import { COUNTRY_MAP as p } from "../../../constants/country.js";
|
2
|
+
import { getStudentEnrollmentSupported as y, getIfGoalCurriculumStandardIsAccessible as h } from "./comps/chapters-selection-step/utils.js";
|
3
|
+
import { checkEnrollmentAvailable as b, getTestTypeBasedCategory as S } from "./comps/test-type-step/test-type-utils.js";
|
4
|
+
import { GOAL_EDIT_FLOWS as G } from "./milestone-create-constants.js";
|
5
|
+
const A = (n, t) => {
|
6
|
+
t.forEach((e) => {
|
7
|
+
n[e] = void 0;
|
8
8
|
});
|
9
|
-
}, F = (
|
10
|
-
const { isLeafNode:
|
11
|
-
if (
|
12
|
-
return
|
13
|
-
if (
|
14
|
-
let
|
15
|
-
if (
|
16
|
-
var
|
17
|
-
let
|
18
|
-
return
|
19
|
-
|
20
|
-
}) : e === (
|
21
|
-
}),
|
9
|
+
}, F = (n, t, e, l, a = []) => {
|
10
|
+
const { isLeafNode: s, next: i, reset: c } = n, u = { ...t };
|
11
|
+
if (s)
|
12
|
+
return A(u, [...c, ...a]), u;
|
13
|
+
if (i) {
|
14
|
+
let d = l, f;
|
15
|
+
if (i.every((r) => {
|
16
|
+
var m;
|
17
|
+
let o = !1;
|
18
|
+
return r.when !== void 0 ? o = r.when.every(([_, g]) => u[_] === g) : o = !0, o ? (d ? (m = r == null ? void 0 : r.reset) == null || m.forEach((_) => {
|
19
|
+
a.push(_);
|
20
|
+
}) : e === (r == null ? void 0 : r.name) && (d = !0), f = r, !1) : !0;
|
21
|
+
}), f)
|
22
22
|
return F(
|
23
|
-
m,
|
24
|
-
s,
|
25
|
-
e,
|
26
23
|
f,
|
27
|
-
|
24
|
+
u,
|
25
|
+
e,
|
26
|
+
d,
|
27
|
+
a
|
28
28
|
);
|
29
29
|
}
|
30
|
-
},
|
31
|
-
const { isLeafNode: l, required:
|
30
|
+
}, E = (n, t, e) => {
|
31
|
+
const { isLeafNode: l, required: a, next: s } = n;
|
32
32
|
if (l)
|
33
|
-
return
|
34
|
-
const
|
35
|
-
if (
|
36
|
-
const c =
|
37
|
-
(
|
33
|
+
return n;
|
34
|
+
const i = a.every((c) => t[c] !== void 0);
|
35
|
+
if (G.includes(e)) {
|
36
|
+
const c = a.every(
|
37
|
+
(u) => t.reviewed[u] === !0
|
38
38
|
);
|
39
|
-
if (!
|
39
|
+
if (!i || !c)
|
40
40
|
return {
|
41
|
-
...
|
41
|
+
...n,
|
42
42
|
next: void 0
|
43
43
|
};
|
44
44
|
} else {
|
45
|
-
const c =
|
46
|
-
(
|
45
|
+
const c = a.every(
|
46
|
+
(u) => t.committed[u] === !0
|
47
47
|
);
|
48
|
-
if (!
|
48
|
+
if (!i || !c)
|
49
49
|
return {
|
50
|
-
...
|
50
|
+
...n,
|
51
51
|
next: void 0
|
52
52
|
};
|
53
53
|
}
|
54
|
-
if (
|
54
|
+
if (s) {
|
55
55
|
let c;
|
56
|
-
if (
|
57
|
-
([
|
58
|
-
) ? (c =
|
59
|
-
return
|
56
|
+
if (s.every((u) => u.when === void 0 || u.when.every(
|
57
|
+
([f, r]) => t[f] === r
|
58
|
+
) ? (c = u, !1) : !0), c)
|
59
|
+
return E(c, t, e);
|
60
60
|
}
|
61
|
-
},
|
62
|
-
const { id: l, event_name:
|
63
|
-
return
|
61
|
+
}, L = (n) => n.academic_events.reduce((t, e) => {
|
62
|
+
const { id: l, event_name: a, event_type: s } = e;
|
63
|
+
return s === "SCHOOL_TEST" && t.push({
|
64
64
|
id: l,
|
65
|
-
label:
|
66
|
-
}),
|
67
|
-
}, []),
|
68
|
-
const { currentGoalData:
|
69
|
-
blocked_countries:
|
65
|
+
label: a
|
66
|
+
}), t;
|
67
|
+
}, []), T = (n) => {
|
68
|
+
const { currentGoalData: t, enrollmentType: e, currentCountryCode: l, grade: a, selectedCategory: s } = n, {
|
69
|
+
blocked_countries: i,
|
70
70
|
available_countries: c,
|
71
|
-
available_grades:
|
72
|
-
goal_category:
|
73
|
-
available_enrollment_types:
|
74
|
-
blocked_enrollment_types:
|
75
|
-
} =
|
76
|
-
|
77
|
-
|
71
|
+
available_grades: u,
|
72
|
+
goal_category: d,
|
73
|
+
available_enrollment_types: f,
|
74
|
+
blocked_enrollment_types: r
|
75
|
+
} = t, o = y(
|
76
|
+
r,
|
77
|
+
f,
|
78
78
|
e
|
79
|
-
),
|
79
|
+
), m = i.some(
|
80
80
|
(v) => v === l
|
81
|
-
), _ = c.length > 0 ? c.some((v) => v === l) : !0, g =
|
82
|
-
return
|
83
|
-
}, N = (
|
84
|
-
const { goal_curriculum_map:
|
85
|
-
|
86
|
-
return c === "CREATE" ? u && d.is_live : u;
|
87
|
-
}), a = (d) => m.some((u) => u.goal_category !== l || i && u.available_class_ratios.length > 0 && !u.available_class_ratios.includes(i) || u.goal_curriculum_standard && u.goal_curriculum_standard !== d.code || l === "SCHOOL_SUCCESS" && !u.goal_curriculum_standard || u.available_countries.length > 0 && !u.available_countries.includes(e) || u.available_countries.length === 0 && u.blocked_countries.includes(e) || !u.available_grades.includes(r) ? !1 : C(u, o));
|
88
|
-
return f.filter(a).map(
|
81
|
+
), _ = c.length > 0 ? c.some((v) => v === l) : !0, g = u.some((v) => v === a);
|
82
|
+
return o && !m && _ && g && s === d;
|
83
|
+
}, N = (n, { grade: t, countryCode: e, goalCategory: l, courseStream: a, classRatio: s, enrollmentType: i }) => {
|
84
|
+
const { goal_curriculum_map: c, curriculum_standards: u } = n, d = c.filter((r) => r.course_stream === a), f = (r) => d.some((o) => o.goal_category !== l || s && o.available_class_ratios.length > 0 && !o.available_class_ratios.includes(s) || o.goal_curriculum_standard && o.goal_curriculum_standard !== r.code || l === "SCHOOL_SUCCESS" && !o.goal_curriculum_standard || o.available_countries.length > 0 && !o.available_countries.includes(e) || o.available_countries.length === 0 && o.blocked_countries.includes(e) || !o.available_grades.includes(t) ? !1 : b(o, i));
|
85
|
+
return u.filter(f).map(
|
89
86
|
({
|
90
|
-
code:
|
91
|
-
name:
|
92
|
-
default_in_countries:
|
93
|
-
recommended_in_countries:
|
87
|
+
code: r,
|
88
|
+
name: o,
|
89
|
+
default_in_countries: m,
|
90
|
+
recommended_in_countries: _
|
94
91
|
}) => ({
|
95
|
-
id:
|
96
|
-
label:
|
97
|
-
isDefault:
|
98
|
-
isRecommended:
|
92
|
+
id: r,
|
93
|
+
label: o,
|
94
|
+
isDefault: m.includes(e),
|
95
|
+
isRecommended: _.includes(e)
|
99
96
|
})
|
100
|
-
).sort((
|
101
|
-
}, P = (
|
102
|
-
const { goal_curriculum_map: e } =
|
103
|
-
return
|
104
|
-
id:
|
105
|
-
label:
|
106
|
-
})).sort((
|
107
|
-
},
|
97
|
+
).sort((r, o) => r.label.toUpperCase() > o.label.toUpperCase() ? 1 : -1);
|
98
|
+
}, P = (n, t) => {
|
99
|
+
const { goal_curriculum_map: e } = n, { grade: l, countryCode: a, goalCategory: s, curriculumStandard: i, courseStream: c, enrollmentType: u } = t, d = e.filter((r) => r.course_stream === c), f = (r) => r.goal_category !== s || i && r.goal_curriculum_standard !== i || r.available_countries.length > 0 && !r.available_countries.includes(a) || r.available_countries.length === 0 && r.blocked_countries.includes(a) || !r.available_grades.includes(l) ? !1 : b(r, u);
|
100
|
+
return d == null ? void 0 : d.filter(f).map(({ goal_code: r, goal_name: o }) => ({
|
101
|
+
id: r,
|
102
|
+
label: o
|
103
|
+
})).sort((r, o) => r.label.toUpperCase() > o.label.toUpperCase() ? 1 : -1);
|
104
|
+
}, B = (n) => n.grades.reduce((t, e) => (e === "-1" || e === "0" ? t.push({
|
108
105
|
id: e,
|
109
106
|
label: e === "-1" ? "Pre-K" : "KG"
|
110
|
-
}) :
|
107
|
+
}) : t.push({
|
111
108
|
id: e,
|
112
109
|
label: `Grade ${e}`
|
113
|
-
}),
|
114
|
-
const { preference_config: e } =
|
115
|
-
const { grade:
|
116
|
-
return !(
|
110
|
+
}), t), []), R = (n, t) => {
|
111
|
+
const { preference_config: e } = n, l = (a) => {
|
112
|
+
const { grade: s, courseStream: i, preferenceCategory: c } = t;
|
113
|
+
return !(a.course_stream !== i || a.preference_category !== c || a.preference_grades.length > 0 && !a.preference_grades.includes(s) || !a.is_live);
|
117
114
|
};
|
118
115
|
return e == null ? void 0 : e.filter(l).map(
|
119
|
-
({ preference_code:
|
120
|
-
id:
|
121
|
-
label:
|
122
|
-
description:
|
116
|
+
({ preference_code: a, preference_name: s, preference_description: i }) => ({
|
117
|
+
id: a,
|
118
|
+
label: s,
|
119
|
+
description: i
|
123
120
|
})
|
124
121
|
);
|
125
|
-
},
|
126
|
-
const { goal_curriculum_map:
|
122
|
+
}, U = (n, t, e, l) => {
|
123
|
+
const { goal_curriculum_map: a } = n, s = B(n), i = ({ id: c }) => a.filter((u) => u.course_stream === e).some((u) => {
|
127
124
|
const {
|
128
|
-
available_grades:
|
129
|
-
goal_category:
|
130
|
-
available_enrollment_types:
|
131
|
-
blocked_enrollment_types:
|
132
|
-
} =
|
133
|
-
return
|
125
|
+
available_grades: d,
|
126
|
+
goal_category: f,
|
127
|
+
available_enrollment_types: r,
|
128
|
+
blocked_enrollment_types: o
|
129
|
+
} = u;
|
130
|
+
return r.length > 0 && !r.includes(l) || r.length === 0 && o.includes(l) ? !1 : f === t && d.includes(c);
|
134
131
|
});
|
135
|
-
return
|
136
|
-
},
|
132
|
+
return s.filter(i);
|
133
|
+
}, q = (n, t, e, l, a) => {
|
137
134
|
if (e === "KG" || Number(e) < 7) return [];
|
138
|
-
const { goal_curriculum_map:
|
139
|
-
return
|
135
|
+
const { goal_curriculum_map: s } = n, i = (u) => u.course_stream !== l ? !1 : b(u, a);
|
136
|
+
return s.filter(i).reduce((u, d) => {
|
140
137
|
const {
|
141
|
-
available_grades:
|
142
|
-
goal_curriculum_standard:
|
143
|
-
program_name:
|
144
|
-
program_code:
|
145
|
-
} =
|
146
|
-
return
|
147
|
-
id:
|
148
|
-
label:
|
149
|
-
}),
|
138
|
+
available_grades: f,
|
139
|
+
goal_curriculum_standard: r,
|
140
|
+
program_name: o,
|
141
|
+
program_code: m
|
142
|
+
} = d;
|
143
|
+
return f.some((C) => C === e) && r === t && u.push({
|
144
|
+
id: m,
|
145
|
+
label: o
|
146
|
+
}), u;
|
150
147
|
}, []);
|
151
|
-
},
|
148
|
+
}, O = (n) => {
|
152
149
|
var e;
|
153
|
-
return (e =
|
154
|
-
},
|
155
|
-
if (
|
156
|
-
const { country_code:
|
150
|
+
return (e = p.find((l) => l.country_code === n)) == null ? void 0 : e.region_code;
|
151
|
+
}, M = (n, t, e, l) => {
|
152
|
+
if (n && e) {
|
153
|
+
const { country_code: s, place_id: i } = n;
|
157
154
|
return {
|
158
155
|
committed: {},
|
159
156
|
reviewed: {},
|
160
157
|
grade: e,
|
161
158
|
schoolInfo: {
|
162
|
-
countryCode:
|
159
|
+
countryCode: s,
|
163
160
|
stateCode: "",
|
164
|
-
id:
|
161
|
+
id: i
|
165
162
|
},
|
166
|
-
region:
|
167
|
-
board:
|
163
|
+
region: s,
|
164
|
+
board: t ?? void 0
|
168
165
|
};
|
169
166
|
}
|
170
|
-
const
|
167
|
+
const a = l ? O(l) : void 0;
|
171
168
|
return e ? {
|
172
169
|
committed: {},
|
173
170
|
reviewed: {},
|
174
171
|
grade: e,
|
175
|
-
region:
|
176
|
-
board:
|
172
|
+
region: a,
|
173
|
+
board: t ?? void 0
|
177
174
|
} : {
|
178
175
|
committed: {},
|
179
176
|
reviewed: {}
|
180
177
|
};
|
181
|
-
},
|
182
|
-
if (
|
183
|
-
const { country_code:
|
178
|
+
}, W = (n, t, e, l) => {
|
179
|
+
if (t && l) {
|
180
|
+
const { country_code: a, place_id: s } = t;
|
184
181
|
return {
|
185
|
-
...
|
182
|
+
...n,
|
186
183
|
grade: l,
|
187
184
|
schoolInfo: {
|
188
|
-
countryCode:
|
185
|
+
countryCode: a,
|
189
186
|
stateCode: "",
|
190
|
-
id:
|
187
|
+
id: s
|
191
188
|
},
|
192
|
-
board:
|
189
|
+
board: n.board ?? e ?? void 0
|
193
190
|
};
|
194
191
|
}
|
195
|
-
return
|
196
|
-
},
|
197
|
-
const { goal_curriculum_map:
|
198
|
-
return
|
199
|
-
const
|
200
|
-
currentGoalData:
|
192
|
+
return n;
|
193
|
+
}, j = (n, t, e, l, a, s, i) => {
|
194
|
+
const { goal_curriculum_map: c } = n, u = t === "no-test", d = S(t);
|
195
|
+
return c.find((r) => {
|
196
|
+
const o = T({
|
197
|
+
currentGoalData: r,
|
201
198
|
grade: e,
|
202
|
-
currentCountryCode:
|
203
|
-
selectedCategory:
|
204
|
-
enrollmentType:
|
205
|
-
}), { goal_curriculum_standard:
|
206
|
-
goalCurriculumStandard:
|
207
|
-
referenceStandard:
|
208
|
-
}),
|
209
|
-
return
|
199
|
+
currentCountryCode: i,
|
200
|
+
selectedCategory: d,
|
201
|
+
enrollmentType: a
|
202
|
+
}), { goal_curriculum_standard: m } = r, _ = h({
|
203
|
+
goalCurriculumStandard: m,
|
204
|
+
referenceStandard: s
|
205
|
+
}), g = r.course_stream === l;
|
206
|
+
return u ? g && o && _ : g && o;
|
210
207
|
});
|
211
|
-
},
|
212
|
-
var
|
213
|
-
let
|
214
|
-
for (const
|
215
|
-
|
216
|
-
const l =
|
208
|
+
}, K = (n) => {
|
209
|
+
var a, s;
|
210
|
+
let t = [], e = [];
|
211
|
+
for (const i of n)
|
212
|
+
i.title === "recommended" ? t = i.data : i.title === "others" && (e = i.data);
|
213
|
+
const l = t.find((i) => i.isDefault && i.isRecommended);
|
217
214
|
if (l)
|
218
215
|
return l.id;
|
219
|
-
if (
|
220
|
-
return (
|
216
|
+
if (t.length > 0)
|
217
|
+
return (a = t[0]) == null ? void 0 : a.id;
|
221
218
|
if (e.length > 0)
|
222
|
-
return (
|
219
|
+
return (s = e[0]) == null ? void 0 : s.id;
|
223
220
|
};
|
224
221
|
export {
|
225
|
-
|
226
|
-
|
222
|
+
j as appendPrimaryGoalCategoryToFormState,
|
223
|
+
W as appendSchoolDataToFormState,
|
227
224
|
F as clearNextFields,
|
228
|
-
|
229
|
-
|
225
|
+
M as generateFormStateWithPrefilledSchoolData,
|
226
|
+
E as getCurrenStep,
|
230
227
|
N as getCurriculumStandardsFromConfig,
|
231
|
-
|
228
|
+
K as getDefaultBoard,
|
232
229
|
P as getGoalsFromConfig,
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
230
|
+
U as getGradesBasedOnGoalAvailability,
|
231
|
+
B as getGradesFromConfig,
|
232
|
+
q as getMajorsFromConfigBasedOnBoardAndGrade,
|
233
|
+
R as getPreferencesFromConfig,
|
234
|
+
O as getRegionCodeBasedOnCountryCode,
|
235
|
+
L as getSchoolTestsFromConfig
|
239
236
|
};
|
240
237
|
//# sourceMappingURL=milestone-create-helpers.js.map
|