@cuemath/leap 3.1.6-j1 → 3.1.7-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/illustrations/illustrations.js +2 -1
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/lib/lib.js +1 -1
- package/dist/assets/lib/lib.js.map +1 -1
- 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/auth/account-selector/account-selector.js +33 -57
- package/dist/features/auth/account-selector/account-selector.js.map +1 -1
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styles.js +12 -0
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styles.js.map +1 -0
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +9 -8
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
- package/dist/features/auth/comps/auth-static-panel/auth-static-panel.js +1 -1
- package/dist/features/auth/comps/auth-static-panel/auth-static-panel.js.map +1 -1
- package/dist/features/auth/forgot-password/forgot-password-styled.js +3 -15
- package/dist/features/auth/forgot-password/forgot-password-styled.js.map +1 -1
- package/dist/features/auth/forgot-password/otp-form/otp-form.js +29 -29
- package/dist/features/auth/forgot-password/otp-form/otp-form.js.map +1 -1
- package/dist/features/auth/forgot-password/reset-password-form/reset-password-form.js +18 -14
- package/dist/features/auth/forgot-password/reset-password-form/reset-password-form.js.map +1 -1
- package/dist/features/auth/forgot-password/user-identifier-form/user-identifier-form.js +24 -23
- package/dist/features/auth/forgot-password/user-identifier-form/user-identifier-form.js.map +1 -1
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js +2 -4
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js.map +1 -1
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form.js +75 -85
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form.js.map +1 -1
- package/dist/features/auth/login/social-account-not-found/social-account-not-found.js +21 -27
- package/dist/features/auth/login/social-account-not-found/social-account-not-found.js.map +1 -1
- package/dist/features/auth/login/social-login-methods/social-login-methods.js +34 -43
- package/dist/features/auth/login/social-login-methods/social-login-methods.js.map +1 -1
- package/dist/features/auth/login/username-password-form/username-password-form.js +21 -22
- package/dist/features/auth/login/username-password-form/username-password-form.js.map +1 -1
- package/dist/features/auth/user-list/user-item/user-item.js +32 -33
- package/dist/features/auth/user-list/user-item/user-item.js.map +1 -1
- package/dist/features/auth/user-list/user-list.js +51 -60
- package/dist/features/auth/user-list/user-list.js.map +1 -1
- package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.js +74 -74
- package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.js.map +1 -1
- 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/constants/constants.js +33 -3
- package/dist/features/cue-canvas/constants/constants.js.map +1 -1
- 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 +140 -114
- package/dist/features/cue-canvas/cue-canvas-core.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-helpers.js +48 -38
- package/dist/features/cue-canvas/cue-canvas-helpers.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-provider.js +21 -21
- package/dist/features/cue-canvas/cue-canvas-provider.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas.js +70 -62
- package/dist/features/cue-canvas/cue-canvas.js.map +1 -1
- package/dist/features/cue-canvas/cue-cavas-styled.js +48 -47
- package/dist/features/cue-canvas/cue-cavas-styled.js.map +1 -1
- package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js +47 -44
- package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js.map +1 -1
- package/dist/features/cue-canvas/hooks/use-config-updater.js +13 -0
- package/dist/features/cue-canvas/hooks/use-config-updater.js.map +1 -0
- 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-height-extender.js +12 -10
- package/dist/features/cue-canvas/hooks/use-height-extender.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/color-palette.js +42 -33
- package/dist/features/cue-canvas/toolbar/color-palette.js.map +1 -1
- package/dist/features/cue-canvas/toolbar/color-picker-menu.js +28 -25
- package/dist/features/cue-canvas/toolbar/color-picker-menu.js.map +1 -1
- 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/cue-canvas/toolbar/pen-tool-menu.js +24 -35
- package/dist/features/cue-canvas/toolbar/pen-tool-menu.js.map +1 -1
- package/dist/features/cue-canvas/toolbar/tool.js +22 -20
- package/dist/features/cue-canvas/toolbar/tool.js.map +1 -1
- package/dist/features/cue-canvas/toolbar/toolbar.js +17 -18
- package/dist/features/cue-canvas/toolbar/toolbar.js.map +1 -1
- package/dist/features/cue-canvas/toolbar/whiteboard-toolbar.js +13 -11
- package/dist/features/cue-canvas/toolbar/whiteboard-toolbar.js.map +1 -1
- package/dist/features/homework/hw-card-list/api/get-homeworks.js +1 -1
- package/dist/features/homework/hw-card-list/api/get-homeworks.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-utils.js +8 -0
- package/dist/features/homework/hw-card-list/hw-card-list-utils.js.map +1 -0
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +144 -112
- package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
- package/dist/features/homework/styles.js +5 -4
- 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/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js +199 -262
- package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/use-home-page-journey.js +15 -15
- package/dist/features/journey/hooks/use-home-page-journey/use-home-page-journey.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js +38 -36
- 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 +24 -22
- 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 +23 -22
- 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 +49 -47
- 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 +94 -87
- 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 +13 -12
- 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 +23 -21
- 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 +165 -162
- package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
- package/dist/features/milestone/edit/comps/edit-milestone-modal/index.js +48 -47
- package/dist/features/milestone/edit/comps/edit-milestone-modal/index.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/api/get-past-milestone-count.js +18 -0
- package/dist/features/milestone/milestone-list-container/api/get-past-milestone-count.js.map +1 -0
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +100 -121
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget-styled.js +15 -14
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget-styled.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js +52 -51
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
- package/dist/features/trial-session/comps/pricing/india-pricing/index.js +96 -0
- package/dist/features/trial-session/comps/pricing/india-pricing/index.js.map +1 -0
- package/dist/features/trial-session/comps/pricing/india-pricing/india-pricing-styled.js +59 -0
- package/dist/features/trial-session/comps/pricing/india-pricing/india-pricing-styled.js.map +1 -0
- package/dist/features/trial-session/comps/pricing/pricing.js +36 -35
- package/dist/features/trial-session/comps/pricing/pricing.js.map +1 -1
- package/dist/features/ui/buttons/button/button-styled.js +29 -29
- package/dist/features/ui/buttons/button/button-styled.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/features/worksheet/worksheet/worksheet-container.js +26 -26
- package/dist/features/worksheet/worksheet/worksheet-container.js.map +1 -1
- package/dist/index.d.ts +104 -35
- package/dist/index.js +323 -321
- package/dist/index.js.map +1 -1
- package/dist/static/ellipse-clip.dfb25608.svg +1 -0
- package/dist/static/lib/{polypad-4.5.4.js → polypad-4.5.4.v1.js} +8 -1
- package/package.json +1 -1
- package/dist/features/auth/account-selector/account-selector-styled.js +0 -9
- package/dist/features/auth/account-selector/account-selector-styled.js.map +0 -1
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styled.js +0 -21
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styled.js.map +0 -1
- package/dist/features/auth/login/login-styled.js +0 -13
- package/dist/features/auth/login/login-styled.js.map +0 -1
- package/dist/features/auth/login/social-login-methods/social-login-methods-styled.js +0 -9
- package/dist/features/auth/login/social-login-methods/social-login-methods-styled.js.map +0 -1
- package/dist/features/hooks/use-viewport.js +0 -21
- package/dist/features/hooks/use-viewport.js.map +0 -1
- package/dist/features/utils/media.js +0 -16
- package/dist/features/utils/media.js.map +0 -1
- package/dist/static/cuemath-app-qr-code.7205ee79.svg +0 -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} 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","otherCurriculumStandards"],"mappings":";;;;;
|
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 TMilestoneFormFlow,\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 flow?: TMilestoneFormFlow | null;\n },\n ): ISectionOption<TCurriculumStandardOption>[];\n}\n\nconst getCategorizedCurriculumStandards: IGetCategorizedCurriculumStandards = (\n config,\n { grade, countryCode, goalCategory, courseStream, classRatio, enrollmentType, flow },\n) => {\n const curriculumStandards = getCurriculumStandardsFromConfig(config, {\n grade,\n countryCode,\n goalCategory,\n courseStream,\n classRatio,\n enrollmentType,\n flow,\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","flow","curriculumStandards","getCurriculumStandardsFromConfig","addTagToSectionOption","option","isDefault","jsx","ArrowTooltip","FlexView","Styled.StyledStarIcon","prioritySortByDefaultAndLabel","a","b","recommendedCurriculumStandards","otherCurriculumStandards"],"mappings":";;;;;AA8BM,MAAAA,IAAwE,CAC5EC,GACA,EAAE,OAAAC,GAAO,aAAAC,GAAa,cAAAC,GAAc,cAAAC,GAAc,YAAAC,GAAY,gBAAAC,GAAgB,MAAAC,QAC3E;AACG,QAAAC,IAAsBC,EAAiCT,GAAQ;AAAA,IACnE,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,MAAAC;AAAA,EAAA,CACD,GAEKG,IAAwB,CAACC,MAAsC;AAC7D,UAAA,EAAE,WAAAC,EAAc,IAAAD;AAEtB,WAAIC,IACK;AAAA,MACL,GAAGD;AAAA,MACH,KACG,gBAAAE,EAAAC,GAAA,EAAa,UAAS,aAAY,UAAS,OAAM,aAAY,WAAU,QAAQ,GAC9E,UAAA,gBAAAD,EAACE,KAAS,QAAQ,IAAI,SAAS,IAAI,aAAY,UAC7C,4BAACC,GAAA,CAAA,CAAsB,EAAA,CACzB,EACF,CAAA;AAAA,IAAA,IAKCL;AAAA,EAAA,GAGHM,IAAgC,CACpCC,GACAC,MAGID,EAAE,aAAa,CAACC,EAAE,YAAkB,KAGpC,CAACD,EAAE,aAAaC,EAAE,aAGlBD,EAAE,MAAM,YAAA,IAAgBC,EAAE,MAAM,gBAC3B,IAGF,IAGHC,IAAiCZ,EACpC,OAAO,CAAUG,MAAAA,EAAO,aAAa,EACrC,IAAID,CAAqB,EACzB,KAAKO,CAA6B,GAC/BI,IAA2Bb,EAC9B,OAAO,CAAAG,MAAU,CAACA,EAAO,aAAa,EACtC,IAAID,CAAqB,EACzB,KAAKO,CAA6B;AAO9B,SALgC;AAAA,IACrC,EAAE,OAAO,eAAe,MAAMG,EAA+B;AAAA,IAC7D,EAAE,OAAO,UAAU,MAAMC,EAAyB;AAAA,EAAA,EAClD,OAAO,CAAAV,MAAUA,EAAO,KAAK,SAAS,CAAC;AAG3C;"}
|
@@ -8,35 +8,37 @@ import P from "../../milestone-create-context.js";
|
|
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 l } 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: d,
|
19
|
+
onFormDataChange: C,
|
20
20
|
enrollmentType: r
|
21
21
|
}) => {
|
22
|
-
const { name:
|
23
|
-
step:
|
24
|
-
}, { testType:
|
22
|
+
const { name: p, title: h } = f, x = {
|
23
|
+
step: p
|
24
|
+
}, { testType: g, grade: i, board: n, region: m } = b, { flow: s } = L(P), { onEvent: c } = w(x), E = j(g, t, o, r), G = k(
|
25
25
|
(a) => {
|
26
26
|
const $ = X(t, {
|
27
27
|
grade: i ?? "",
|
28
|
-
goalCategory:
|
28
|
+
goalCategory: l(a),
|
29
29
|
countryCode: m ?? "",
|
30
30
|
courseStream: o,
|
31
|
-
classRatio:
|
32
|
-
enrollmentType: r
|
31
|
+
classRatio: d,
|
32
|
+
enrollmentType: r,
|
33
|
+
flow: s
|
33
34
|
}), v = S(t, {
|
34
35
|
grade: i ?? "",
|
35
|
-
goalCategory:
|
36
|
+
goalCategory: l(a),
|
36
37
|
countryCode: m ?? "",
|
37
38
|
courseStream: o,
|
38
|
-
classRatio:
|
39
|
-
enrollmentType: r
|
39
|
+
classRatio: d,
|
40
|
+
enrollmentType: r,
|
41
|
+
flow: s
|
40
42
|
}), u = n && v.some((I) => I.id === n) ? n : F($), A = O(
|
41
43
|
t,
|
42
44
|
a,
|
@@ -47,9 +49,9 @@ const Z = _(
|
|
47
49
|
m
|
48
50
|
);
|
49
51
|
c("SELECTED_GOAL_CATEGORY", {
|
50
|
-
goal_category:
|
51
|
-
flow:
|
52
|
-
}),
|
52
|
+
goal_category: l(a),
|
53
|
+
flow: s
|
54
|
+
}), C({
|
53
55
|
testType: a,
|
54
56
|
board: u,
|
55
57
|
chapterGoalCategory: {
|
@@ -64,12 +66,12 @@ const Z = _(
|
|
64
66
|
[
|
65
67
|
r,
|
66
68
|
n,
|
67
|
-
|
69
|
+
d,
|
68
70
|
t,
|
69
71
|
o,
|
70
|
-
|
72
|
+
s,
|
71
73
|
i,
|
72
|
-
|
74
|
+
C,
|
73
75
|
m,
|
74
76
|
c
|
75
77
|
]
|
@@ -77,16 +79,16 @@ const Z = _(
|
|
77
79
|
return /* @__PURE__ */ e(
|
78
80
|
T,
|
79
81
|
{
|
80
|
-
stepName:
|
82
|
+
stepName: p,
|
81
83
|
headerElement: /* @__PURE__ */ e(D, { $renderAs: "ab2", children: h }),
|
82
84
|
bodyElement: /* @__PURE__ */ e(y, { $alignItems: "center", $height: "100%", $gapX: 5, children: /* @__PURE__ */ e(y, { $flexDirection: "row", $flexGapX: 1.5, children: /* @__PURE__ */ e(
|
83
85
|
B,
|
84
86
|
{
|
85
87
|
options: E,
|
86
|
-
value:
|
88
|
+
value: g,
|
87
89
|
onChange: G,
|
88
90
|
analyticsLabel: "goal_category",
|
89
|
-
analyticsProps: { test_type:
|
91
|
+
analyticsProps: { test_type: g },
|
90
92
|
type: "radio"
|
91
93
|
}
|
92
94
|
) }) })
|
@@ -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 });\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,IAAiBC,EAAkBV,GAAUR,GAAQC,GAAcG,CAAc,GAEjFe,IAAuBC;AAAA,MAC3B,CAACC,MAAoE;AAG7D,cAAAC,IAASC,EAAkCvB,GAAQ;AAAA,UACvD,OAAOS,KAAS;AAAA,UAChB,cAAce,EAAyBH,CAAgB;AAAA,UACvD,aAAaV,KAAU;AAAA,UACvB,cAAAV;AAAA,UACA,YAAAC;AAAA,UACA,gBAAAE;AAAA,QAAA,CACD,
|
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 flow,\n });\n\n const curriculumStandards = getCurriculumStandardsFromConfig(config, {\n grade: grade ?? '',\n goalCategory: getTestTypeBasedCategory(selectedTestType),\n countryCode: region ?? '',\n courseStream,\n classRatio,\n enrollmentType,\n flow,\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,IAAiBC,EAAkBV,GAAUR,GAAQC,GAAcG,CAAc,GAEjFe,IAAuBC;AAAA,MAC3B,CAACC,MAAoE;AAG7D,cAAAC,IAASC,EAAkCvB,GAAQ;AAAA,UACvD,OAAOS,KAAS;AAAA,UAChB,cAAce,EAAyBH,CAAgB;AAAA,UACvD,aAAaV,KAAU;AAAA,UACvB,cAAAV;AAAA,UACA,YAAAC;AAAA,UACA,gBAAAE;AAAA,UACA,MAAAQ;AAAA,QAAA,CACD,GAEKa,IAAsBC,EAAiC1B,GAAQ;AAAA,UACnE,OAAOS,KAAS;AAAA,UAChB,cAAce,EAAyBH,CAAgB;AAAA,UACvD,aAAaV,KAAU;AAAA,UACvB,cAAAV;AAAA,UACA,YAAAC;AAAA,UACA,gBAAAE;AAAA,UACA,MAAAQ;AAAA,QAAA,CACD,GAKKe,IAFJjB,KAASe,EAAoB,KAAK,CAAAE,MAAaA,EAAU,OAAOjB,CAAK,IAEtBA,IAAQkB,EAAgBN,CAAM,GAEzEO,IAAsBC;AAAA,UAC1B9B;AAAA,UACAqB;AAAA,UACAZ;AAAA,UACAR;AAAA,UACAG;AAAA,UACAuB;AAAA,UACAhB;AAAA,QAAA;AAGF,QAAAI,EAAW,0BAA0B;AAAA,UACnC,eAAeS,EAAyBH,CAAgB;AAAA,UACxD,MAAAT;AAAA,QAAA,CACD,GAEgBT,EAAA;AAAA,UACf,UAAUkB;AAAA,UACV,OAAOM;AAAA,UACP,qBAAqB;AAAA,YACnB,qBAAAE;AAAA,UACF;AAAA,UACA,WAAW;AAAA,YACT,UAAU;AAAA,YACV,qBAAqB;AAAA,UACvB;AAAA,QAAA,CACD;AAAA,MACH;AAAA,MACA;AAAA,QACEzB;AAAA,QACAM;AAAA,QACAR;AAAA,QACAF;AAAA,QACAC;AAAA,QACAW;AAAA,QACAH;AAAA,QACAN;AAAA,QACAQ;AAAA,QACAI;AAAA,MACF;AAAA,IAAA;AAIA,WAAA,gBAAAgB;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,UAAU3B;AAAA,QACV,eAAe,gBAAA0B,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,237 +1,240 @@
|
|
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 y } from "../../../constants/country.js";
|
2
|
+
import { getStudentEnrollmentSupported as S, getIfGoalCurriculumStandardIsAccessible as h } from "./comps/chapters-selection-step/utils.js";
|
3
|
+
import { checkEnrollmentAvailable as C, getTestTypeBasedCategory as G } from "./comps/test-type-step/test-type-utils.js";
|
4
|
+
import { GOAL_EDIT_FLOWS as A } from "./milestone-create-constants.js";
|
5
|
+
const E = (t, r) => {
|
6
|
+
r.forEach((e) => {
|
7
|
+
t[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 = (t, r, e, l, n = []) => {
|
10
|
+
const { isLeafNode: i, next: o, reset: c } = t, s = { ...r };
|
11
|
+
if (i)
|
12
|
+
return E(s, [...c, ...n]), s;
|
13
|
+
if (o) {
|
14
|
+
let f = l, m;
|
15
|
+
if (o.every((a) => {
|
16
|
+
var u;
|
17
|
+
let d = !1;
|
18
|
+
return a.when !== void 0 ? d = a.when.every(([_, g]) => s[_] === g) : d = !0, d ? (f ? (u = a == null ? void 0 : a.reset) == null || u.forEach((_) => {
|
19
|
+
n.push(_);
|
20
|
+
}) : e === (a == null ? void 0 : a.name) && (f = !0), m = a, !1) : !0;
|
21
|
+
}), m)
|
22
22
|
return F(
|
23
|
-
|
24
|
-
|
23
|
+
m,
|
24
|
+
s,
|
25
25
|
e,
|
26
|
-
|
27
|
-
|
26
|
+
f,
|
27
|
+
n
|
28
28
|
);
|
29
29
|
}
|
30
|
-
},
|
31
|
-
const { isLeafNode: l, required:
|
30
|
+
}, T = (t, r, e) => {
|
31
|
+
const { isLeafNode: l, required: n, next: i } = t;
|
32
32
|
if (l)
|
33
|
-
return
|
34
|
-
const
|
35
|
-
if (
|
36
|
-
const c =
|
37
|
-
(
|
33
|
+
return t;
|
34
|
+
const o = n.every((c) => r[c] !== void 0);
|
35
|
+
if (A.includes(e)) {
|
36
|
+
const c = n.every(
|
37
|
+
(s) => r.reviewed[s] === !0
|
38
38
|
);
|
39
|
-
if (!
|
39
|
+
if (!o || !c)
|
40
40
|
return {
|
41
|
-
...
|
41
|
+
...t,
|
42
42
|
next: void 0
|
43
43
|
};
|
44
44
|
} else {
|
45
|
-
const c =
|
46
|
-
(
|
45
|
+
const c = n.every(
|
46
|
+
(s) => r.committed[s] === !0
|
47
47
|
);
|
48
|
-
if (!
|
48
|
+
if (!o || !c)
|
49
49
|
return {
|
50
|
-
...
|
50
|
+
...t,
|
51
51
|
next: void 0
|
52
52
|
};
|
53
53
|
}
|
54
|
-
if (
|
54
|
+
if (i) {
|
55
55
|
let c;
|
56
|
-
if (
|
57
|
-
([
|
58
|
-
) ? (c =
|
59
|
-
return
|
56
|
+
if (i.every((s) => s.when === void 0 || s.when.every(
|
57
|
+
([m, a]) => r[m] === a
|
58
|
+
) ? (c = s, !1) : !0), c)
|
59
|
+
return T(c, r, e);
|
60
60
|
}
|
61
|
-
},
|
62
|
-
const { id: l, event_name:
|
63
|
-
return
|
61
|
+
}, R = (t) => t.academic_events.reduce((r, e) => {
|
62
|
+
const { id: l, event_name: n, event_type: i } = e;
|
63
|
+
return i === "SCHOOL_TEST" && r.push({
|
64
64
|
id: l,
|
65
|
-
label:
|
66
|
-
}),
|
67
|
-
}, []),
|
68
|
-
const { currentGoalData:
|
69
|
-
blocked_countries:
|
65
|
+
label: n
|
66
|
+
}), r;
|
67
|
+
}, []), B = (t) => {
|
68
|
+
const { currentGoalData: r, enrollmentType: e, currentCountryCode: l, grade: n, selectedCategory: i } = t, {
|
69
|
+
blocked_countries: o,
|
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: s,
|
72
|
+
goal_category: f,
|
73
|
+
available_enrollment_types: m,
|
74
|
+
blocked_enrollment_types: a
|
75
|
+
} = r, d = S(
|
76
|
+
a,
|
77
|
+
m,
|
78
78
|
e
|
79
|
-
),
|
79
|
+
), u = o.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
|
-
|
81
|
+
), _ = c.length > 0 ? c.some((v) => v === l) : !0, g = s.some((v) => v === n);
|
82
|
+
return d && !u && _ && g && i === f;
|
83
|
+
}, N = (t, { grade: r, countryCode: e, goalCategory: l, courseStream: n, classRatio: i, enrollmentType: o, flow: c }) => {
|
84
|
+
const { goal_curriculum_map: s, curriculum_standards: f } = t, m = s.filter((d) => {
|
85
|
+
const u = d.course_stream === n;
|
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(
|
86
89
|
({
|
87
|
-
code:
|
88
|
-
name:
|
89
|
-
default_in_countries:
|
90
|
-
recommended_in_countries:
|
90
|
+
code: d,
|
91
|
+
name: u,
|
92
|
+
default_in_countries: _,
|
93
|
+
recommended_in_countries: g
|
91
94
|
}) => ({
|
92
|
-
id:
|
93
|
-
label:
|
94
|
-
isDefault:
|
95
|
-
isRecommended:
|
95
|
+
id: d,
|
96
|
+
label: u,
|
97
|
+
isDefault: _.includes(e),
|
98
|
+
isRecommended: g.includes(e)
|
96
99
|
})
|
97
|
-
).sort((
|
98
|
-
}, P = (
|
99
|
-
const { goal_curriculum_map: e } =
|
100
|
-
return
|
101
|
-
id:
|
102
|
-
label:
|
103
|
-
})).sort((
|
104
|
-
},
|
100
|
+
).sort((d, u) => d.label.toUpperCase() > u.label.toUpperCase() ? 1 : -1);
|
101
|
+
}, P = (t, r) => {
|
102
|
+
const { goal_curriculum_map: e } = t, { grade: l, countryCode: n, goalCategory: i, curriculumStandard: o, courseStream: c, enrollmentType: s } = r, f = e.filter((a) => a.course_stream === c), m = (a) => a.goal_category !== i || o && a.goal_curriculum_standard !== o || a.available_countries.length > 0 && !a.available_countries.includes(n) || a.available_countries.length === 0 && a.blocked_countries.includes(n) || !a.available_grades.includes(l) ? !1 : C(a, s);
|
103
|
+
return f == null ? void 0 : f.filter(m).map(({ goal_code: a, goal_name: d }) => ({
|
104
|
+
id: a,
|
105
|
+
label: d
|
106
|
+
})).sort((a, d) => a.label.toUpperCase() > d.label.toUpperCase() ? 1 : -1);
|
107
|
+
}, O = (t) => t.grades.reduce((r, e) => (e === "-1" || e === "0" ? r.push({
|
105
108
|
id: e,
|
106
109
|
label: e === "-1" ? "Pre-K" : "KG"
|
107
|
-
}) :
|
110
|
+
}) : r.push({
|
108
111
|
id: e,
|
109
112
|
label: `Grade ${e}`
|
110
|
-
}),
|
111
|
-
const { preference_config: e } =
|
112
|
-
const { grade:
|
113
|
-
return !(
|
113
|
+
}), r), []), U = (t, r) => {
|
114
|
+
const { preference_config: e } = t, l = (n) => {
|
115
|
+
const { grade: i, courseStream: o, preferenceCategory: c } = r;
|
116
|
+
return !(n.course_stream !== o || n.preference_category !== c || n.preference_grades.length > 0 && !n.preference_grades.includes(i) || !n.is_live);
|
114
117
|
};
|
115
118
|
return e == null ? void 0 : e.filter(l).map(
|
116
|
-
({ preference_code:
|
117
|
-
id:
|
118
|
-
label:
|
119
|
-
description:
|
119
|
+
({ preference_code: n, preference_name: i, preference_description: o }) => ({
|
120
|
+
id: n,
|
121
|
+
label: i,
|
122
|
+
description: o
|
120
123
|
})
|
121
124
|
);
|
122
|
-
},
|
123
|
-
const { goal_curriculum_map:
|
125
|
+
}, q = (t, r, e, l) => {
|
126
|
+
const { goal_curriculum_map: n } = t, i = O(t), o = ({ id: c }) => n.filter((s) => s.course_stream === e).some((s) => {
|
124
127
|
const {
|
125
|
-
available_grades:
|
126
|
-
goal_category:
|
127
|
-
available_enrollment_types:
|
128
|
-
blocked_enrollment_types:
|
129
|
-
} =
|
130
|
-
return
|
128
|
+
available_grades: f,
|
129
|
+
goal_category: m,
|
130
|
+
available_enrollment_types: a,
|
131
|
+
blocked_enrollment_types: d
|
132
|
+
} = s;
|
133
|
+
return a.length > 0 && !a.includes(l) || a.length === 0 && d.includes(l) ? !1 : m === r && f.includes(c);
|
131
134
|
});
|
132
|
-
return
|
133
|
-
},
|
135
|
+
return i.filter(o);
|
136
|
+
}, M = (t, r, e, l, n) => {
|
134
137
|
if (e === "KG" || Number(e) < 7) return [];
|
135
|
-
const { goal_curriculum_map:
|
136
|
-
return
|
138
|
+
const { goal_curriculum_map: i } = t, o = (s) => s.course_stream !== l ? !1 : C(s, n);
|
139
|
+
return i.filter(o).reduce((s, f) => {
|
137
140
|
const {
|
138
|
-
available_grades:
|
139
|
-
goal_curriculum_standard:
|
140
|
-
program_name:
|
141
|
-
program_code:
|
142
|
-
} =
|
143
|
-
return
|
144
|
-
id:
|
145
|
-
label:
|
146
|
-
}),
|
141
|
+
available_grades: m,
|
142
|
+
goal_curriculum_standard: a,
|
143
|
+
program_name: d,
|
144
|
+
program_code: u
|
145
|
+
} = f;
|
146
|
+
return m.some((b) => b === e) && a === r && s.push({
|
147
|
+
id: u,
|
148
|
+
label: d
|
149
|
+
}), s;
|
147
150
|
}, []);
|
148
|
-
},
|
151
|
+
}, k = (t) => {
|
149
152
|
var e;
|
150
|
-
return (e =
|
151
|
-
},
|
152
|
-
if (
|
153
|
-
const { country_code:
|
153
|
+
return (e = y.find((l) => l.country_code === t)) == null ? void 0 : e.region_code;
|
154
|
+
}, W = (t, r, e, l) => {
|
155
|
+
if (t && e) {
|
156
|
+
const { country_code: i, place_id: o } = t;
|
154
157
|
return {
|
155
158
|
committed: {},
|
156
159
|
reviewed: {},
|
157
160
|
grade: e,
|
158
161
|
schoolInfo: {
|
159
|
-
countryCode:
|
162
|
+
countryCode: i,
|
160
163
|
stateCode: "",
|
161
|
-
id:
|
164
|
+
id: o
|
162
165
|
},
|
163
|
-
region:
|
164
|
-
board:
|
166
|
+
region: i,
|
167
|
+
board: r ?? void 0
|
165
168
|
};
|
166
169
|
}
|
167
|
-
const
|
170
|
+
const n = l ? k(l) : void 0;
|
168
171
|
return e ? {
|
169
172
|
committed: {},
|
170
173
|
reviewed: {},
|
171
174
|
grade: e,
|
172
|
-
region:
|
173
|
-
board:
|
175
|
+
region: n,
|
176
|
+
board: r ?? void 0
|
174
177
|
} : {
|
175
178
|
committed: {},
|
176
179
|
reviewed: {}
|
177
180
|
};
|
178
|
-
},
|
179
|
-
if (
|
180
|
-
const { country_code:
|
181
|
+
}, j = (t, r, e, l) => {
|
182
|
+
if (r && l) {
|
183
|
+
const { country_code: n, place_id: i } = r;
|
181
184
|
return {
|
182
|
-
...
|
185
|
+
...t,
|
183
186
|
grade: l,
|
184
187
|
schoolInfo: {
|
185
|
-
countryCode:
|
188
|
+
countryCode: n,
|
186
189
|
stateCode: "",
|
187
|
-
id:
|
190
|
+
id: i
|
188
191
|
},
|
189
|
-
board:
|
192
|
+
board: t.board ?? e ?? void 0
|
190
193
|
};
|
191
194
|
}
|
192
|
-
return
|
193
|
-
},
|
194
|
-
const { goal_curriculum_map:
|
195
|
-
return
|
196
|
-
const
|
197
|
-
currentGoalData:
|
195
|
+
return t;
|
196
|
+
}, K = (t, r, e, l, n, i, o, c) => {
|
197
|
+
const { goal_curriculum_map: s } = t, f = r === "no-test", m = G(r);
|
198
|
+
return s.find((d) => {
|
199
|
+
const u = B({
|
200
|
+
currentGoalData: d,
|
198
201
|
grade: e,
|
199
|
-
currentCountryCode:
|
200
|
-
selectedCategory:
|
201
|
-
enrollmentType:
|
202
|
-
}), { goal_curriculum_standard:
|
203
|
-
goalCurriculumStandard:
|
204
|
-
referenceStandard:
|
205
|
-
}),
|
206
|
-
return
|
202
|
+
currentCountryCode: o,
|
203
|
+
selectedCategory: m,
|
204
|
+
enrollmentType: n
|
205
|
+
}), { goal_curriculum_standard: _, is_live: g } = d, b = h({
|
206
|
+
goalCurriculumStandard: _,
|
207
|
+
referenceStandard: i
|
208
|
+
}), v = d.course_stream === l, p = c === "CREATE" ? g : !0;
|
209
|
+
return f ? v && u && b && p : v && u && p;
|
207
210
|
});
|
208
|
-
},
|
209
|
-
var
|
210
|
-
let
|
211
|
-
for (const
|
212
|
-
|
213
|
-
const l =
|
211
|
+
}, H = (t) => {
|
212
|
+
var n, i;
|
213
|
+
let r = [], e = [];
|
214
|
+
for (const o of t)
|
215
|
+
o.title === "recommended" ? r = o.data : o.title === "others" && (e = o.data);
|
216
|
+
const l = r.find((o) => o.isDefault && o.isRecommended);
|
214
217
|
if (l)
|
215
218
|
return l.id;
|
216
|
-
if (
|
217
|
-
return (
|
219
|
+
if (r.length > 0)
|
220
|
+
return (n = r[0]) == null ? void 0 : n.id;
|
218
221
|
if (e.length > 0)
|
219
|
-
return (
|
222
|
+
return (i = e[0]) == null ? void 0 : i.id;
|
220
223
|
};
|
221
224
|
export {
|
222
|
-
|
223
|
-
|
225
|
+
K as appendPrimaryGoalCategoryToFormState,
|
226
|
+
j as appendSchoolDataToFormState,
|
224
227
|
F as clearNextFields,
|
225
|
-
|
226
|
-
|
228
|
+
W as generateFormStateWithPrefilledSchoolData,
|
229
|
+
T as getCurrenStep,
|
227
230
|
N as getCurriculumStandardsFromConfig,
|
228
|
-
|
231
|
+
H as getDefaultBoard,
|
229
232
|
P as getGoalsFromConfig,
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
233
|
+
q as getGradesBasedOnGoalAvailability,
|
234
|
+
O as getGradesFromConfig,
|
235
|
+
M as getMajorsFromConfigBasedOnBoardAndGrade,
|
236
|
+
U as getPreferencesFromConfig,
|
237
|
+
k as getRegionCodeBasedOnCountryCode,
|
238
|
+
R as getSchoolTestsFromConfig
|
236
239
|
};
|
237
240
|
//# sourceMappingURL=milestone-create-helpers.js.map
|