@cuemath/leap 3.3.0 → 3.3.2-2.beta-guru-01
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/gif/gif.js +3 -0
- package/dist/assets/gif/gif.js.map +1 -1
- package/dist/assets/illustrations/illustrations.js +10 -1
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/images/images.js +10 -0
- package/dist/assets/images/images.js.map +1 -1
- package/dist/assets/line-icons/icons/cue-coin.js +182 -0
- package/dist/assets/line-icons/icons/cue-coin.js.map +1 -0
- package/dist/assets/line-icons/icons/wins-common-icon.js +26 -0
- package/dist/assets/line-icons/icons/wins-common-icon.js.map +1 -0
- package/dist/assets/line-icons/icons/wins-epic-icon.js +25 -0
- package/dist/assets/line-icons/icons/wins-epic-icon.js.map +1 -0
- package/dist/assets/line-icons/icons/wins-legendary-icon.js +25 -0
- package/dist/assets/line-icons/icons/wins-legendary-icon.js.map +1 -0
- package/dist/assets/line-icons/icons/wins-mystery-icon.js +105 -0
- package/dist/assets/line-icons/icons/wins-mystery-icon.js.map +1 -0
- package/dist/assets/line-icons/icons/wins-mythic-icon.js +28 -0
- package/dist/assets/line-icons/icons/wins-mythic-icon.js.map +1 -0
- package/dist/assets/line-icons/icons/wins-rare-icon.js +28 -0
- package/dist/assets/line-icons/icons/wins-rare-icon.js.map +1 -0
- package/dist/assets/lottie/lottie.js +10 -3
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/constants/config.js +5 -0
- package/dist/constants/config.js.map +1 -0
- package/dist/constants/country.js +9 -0
- package/dist/constants/country.js.map +1 -1
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +6 -6
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js +4 -4
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js.map +1 -1
- package/dist/features/auth/comps/otp-input/otp-input.js +19 -18
- package/dist/features/auth/comps/otp-input/otp-input.js.map +1 -1
- package/dist/features/auth/comps/pill-button/pill-button-styled.js +17 -17
- package/dist/features/auth/comps/pill-button/pill-button-styled.js.map +1 -1
- package/dist/features/auth/comps/pill-button/pill-button.js +26 -24
- package/dist/features/auth/comps/pill-button/pill-button.js.map +1 -1
- package/dist/features/auth/comps/user-list/user-item/user-item.js +32 -30
- package/dist/features/auth/comps/user-list/user-item/user-item.js.map +1 -1
- package/dist/features/auth/comps/user-list/user-list.js +20 -19
- package/dist/features/auth/comps/user-list/user-list.js.map +1 -1
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-constants.js +9 -9
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-constants.js.map +1 -1
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-styled.js +58 -29
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-styled.js.map +1 -1
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide.js +78 -41
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide.js.map +1 -1
- package/dist/features/auth/pla-signup/pla-analytics-events.js +5 -4
- package/dist/features/auth/pla-signup/pla-analytics-events.js.map +1 -1
- package/dist/features/auth/pla-signup/signup-header/signup-header.js +1 -1
- package/dist/features/auth/pla-signup/signup-header/signup-header.js.map +1 -1
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper-styled.js +37 -35
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper-styled.js.map +1 -1
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js +75 -70
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js.map +1 -1
- package/dist/features/auth/signup/custom-input-field/custom-input-field.js +55 -50
- package/dist/features/auth/signup/custom-input-field/custom-input-field.js.map +1 -1
- package/dist/features/auth/signup/custom-input-field/input-wrapper/input-wrapper.js +47 -25
- package/dist/features/auth/signup/custom-input-field/input-wrapper/input-wrapper.js.map +1 -1
- package/dist/features/auth/signup-unavailable/signup-unavailable-styled.js +16 -0
- package/dist/features/auth/signup-unavailable/signup-unavailable-styled.js.map +1 -0
- package/dist/features/auth/signup-unavailable/signup-unavailable-view.js +62 -0
- package/dist/features/auth/signup-unavailable/signup-unavailable-view.js.map +1 -0
- package/dist/features/auth/signup-unavailable/signup-unavailable.js +17 -0
- package/dist/features/auth/signup-unavailable/signup-unavailable.js.map +1 -0
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/question-overview.js +19 -18
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/question-overview.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/sat-sheet-summary-styled.js +7 -7
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/sat-sheet-summary-styled.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/sat-sheet-summary.js +26 -24
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/sat-sheet-summary.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/summary-module.js +15 -13
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/summary-module.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/constants/index.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js +130 -69
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js +43 -33
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/chapter-details.js +137 -95
- package/dist/features/chapters-v2/chapter-details/chapter-details.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card-styled.js +36 -31
- package/dist/features/chapters-v2/comps/node-card/node-card-styled.js.map +1 -1
- package/dist/features/chapters-v2/comps/sat-mock-test/sat-mock-test-styled.js +22 -0
- package/dist/features/chapters-v2/comps/sat-mock-test/sat-mock-test-styled.js.map +1 -0
- package/dist/features/chapters-v2/comps/sat-mock-test/sat-mock-test.js +141 -0
- package/dist/features/chapters-v2/comps/sat-mock-test/sat-mock-test.js.map +1 -0
- package/dist/features/chapters-v2/constants/block-constants.js +7 -5
- package/dist/features/chapters-v2/constants/block-constants.js.map +1 -1
- package/dist/features/chapters-v2/utils/index.js +22 -12
- package/dist/features/chapters-v2/utils/index.js.map +1 -1
- package/dist/features/chapters-v2/utils/sat-sheet-utils.js +12 -0
- package/dist/features/chapters-v2/utils/sat-sheet-utils.js.map +1 -0
- package/dist/features/circle-games/games/web-view/web-view.js +0 -1
- package/dist/features/circle-games/games/web-view/web-view.js.map +1 -1
- package/dist/features/journey/hooks/use-chapter-page-journey/use-download-block-journey.js +86 -0
- package/dist/features/journey/hooks/use-chapter-page-journey/use-download-block-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-chapter-page-journey/use-download-node-journey.js +140 -0
- package/dist/features/journey/hooks/use-chapter-page-journey/use-download-node-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js +8 -4
- package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js.map +1 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +23 -29
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-teacher.js +2 -2
- package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
- package/dist/features/journey/mocks/chapter-page-journey-mock-data.js +400 -0
- package/dist/features/journey/mocks/chapter-page-journey-mock-data.js.map +1 -1
- package/dist/features/milestone/constants.js +13 -10
- package/dist/features/milestone/constants.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/add-custom-chapter.js +42 -40
- package/dist/features/milestone/create/comps/add-custom-chapter/add-custom-chapter.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js +70 -64
- 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 +54 -29
- 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 +48 -28
- 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/chapters-selection-step.js +79 -76
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/utils.js +97 -94
- 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 +160 -143
- 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 +22 -12
- package/dist/features/milestone/create/comps/class-details-step/class-details-utils.js.map +1 -1
- package/dist/features/milestone/create/comps/goal-completion-date-selector/goal-completion-date-selector.js +6 -6
- package/dist/features/milestone/create/comps/test-type-step/test-type-step.js +64 -59
- package/dist/features/milestone/create/comps/test-type-step/test-type-step.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-container.js +17 -15
- package/dist/features/milestone/create/milestone-create-container.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-helpers.js +170 -153
- package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-styled.js +1 -1
- package/dist/features/milestone/create/milestone-create-styled.js.map +1 -1
- package/dist/features/milestone/create/milestone-create.js +19 -17
- package/dist/features/milestone/create/milestone-create.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-creation/test-stages/test-preview/test-preview.js +19 -20
- package/dist/features/milestone/milestone-tests/tests-creation/test-stages/test-preview/test-preview.js.map +1 -1
- package/dist/features/parent-dashboard/api/get-student-profile-summary.js +9 -0
- package/dist/features/parent-dashboard/api/get-student-profile-summary.js.map +1 -0
- package/dist/features/parent-dashboard/api/parent-home.js +10 -0
- package/dist/features/parent-dashboard/api/parent-home.js.map +1 -0
- package/dist/features/parent-dashboard/comps/compact-header/compact-header.js +30 -0
- package/dist/features/parent-dashboard/comps/compact-header/compact-header.js.map +1 -0
- package/dist/features/parent-dashboard/comps/cuemath-app-features/cuemath-app-features-constants.js +25 -0
- package/dist/features/parent-dashboard/comps/cuemath-app-features/cuemath-app-features-constants.js.map +1 -0
- package/dist/features/parent-dashboard/comps/cuemath-app-features/cuemath-app-features-styled.js +15 -0
- package/dist/features/parent-dashboard/comps/cuemath-app-features/cuemath-app-features-styled.js.map +1 -0
- package/dist/features/parent-dashboard/comps/cuemath-app-features/cuemath-app-features.js +90 -0
- package/dist/features/parent-dashboard/comps/cuemath-app-features/cuemath-app-features.js.map +1 -0
- package/dist/features/parent-dashboard/comps/math-practice/math-practice-constants.js +19 -0
- package/dist/features/parent-dashboard/comps/math-practice/math-practice-constants.js.map +1 -0
- package/dist/features/parent-dashboard/comps/math-practice/math-practice-styled.js +32 -0
- package/dist/features/parent-dashboard/comps/math-practice/math-practice-styled.js.map +1 -0
- package/dist/features/parent-dashboard/comps/math-practice/math-practice.js +67 -0
- package/dist/features/parent-dashboard/comps/math-practice/math-practice.js.map +1 -0
- package/dist/features/parent-dashboard/comps/parent-dashboard-faqs/parent-dashboard-faqs-constants.js +42 -0
- package/dist/features/parent-dashboard/comps/parent-dashboard-faqs/parent-dashboard-faqs-constants.js.map +1 -0
- package/dist/features/parent-dashboard/comps/parent-dashboard-faqs/parent-dashboard-faqs.js +20 -0
- package/dist/features/parent-dashboard/comps/parent-dashboard-faqs/parent-dashboard-faqs.js.map +1 -0
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction-styled.js +10 -0
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction-styled.js.map +1 -0
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js +42 -0
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js.map +1 -0
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js +67 -0
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js.map +1 -0
- package/dist/features/parent-dashboard/hooks/use-student-profile-summary-data.js +24 -0
- package/dist/features/parent-dashboard/hooks/use-student-profile-summary-data.js.map +1 -0
- package/dist/features/parent-dashboard/hooks/use-switch-user-journey.js +71 -0
- package/dist/features/parent-dashboard/hooks/use-switch-user-journey.js.map +1 -0
- package/dist/features/parent-dashboard/modals/help-and-support/help-and-support.js +40 -0
- package/dist/features/parent-dashboard/modals/help-and-support/help-and-support.js.map +1 -0
- package/dist/features/parent-dashboard/modals/student-login-info/student-login-info.js +44 -0
- package/dist/features/parent-dashboard/modals/student-login-info/student-login-info.js.map +1 -0
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-helpers.js +32 -0
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-helpers.js.map +1 -0
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-styled.js +12 -0
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-styled.js.map +1 -0
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary.js +44 -0
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary.js.map +1 -0
- package/dist/features/parent-dashboard/modals/trial-report/trial-report-styled.js +13 -0
- package/dist/features/parent-dashboard/modals/trial-report/trial-report-styled.js.map +1 -0
- package/dist/features/parent-dashboard/modals/trial-report/trial-report.js +28 -0
- package/dist/features/parent-dashboard/modals/trial-report/trial-report.js.map +1 -0
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-constants.js +43 -0
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-constants.js.map +1 -0
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js +59 -0
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js.map +1 -0
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change.js +86 -0
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change.js.map +1 -0
- package/dist/features/parent-dashboard/parent-dashboard-constants.js +26 -0
- package/dist/features/parent-dashboard/parent-dashboard-constants.js.map +1 -0
- package/dist/features/parent-dashboard/parent-dashboard-styled.js +33 -0
- package/dist/features/parent-dashboard/parent-dashboard-styled.js.map +1 -0
- package/dist/features/parent-dashboard/parent-dashboard-types.js +6 -0
- package/dist/features/parent-dashboard/parent-dashboard-types.js.map +1 -0
- package/dist/features/parent-dashboard/parent-dashboard-view.js +215 -0
- package/dist/features/parent-dashboard/parent-dashboard-view.js.map +1 -0
- package/dist/features/parent-dashboard/parent-dashboard.js +8 -0
- package/dist/features/parent-dashboard/parent-dashboard.js.map +1 -0
- package/dist/features/sentry/constants/ignored.js +10 -6
- package/dist/features/sentry/constants/ignored.js.map +1 -1
- package/dist/features/sheets/constants/sheet.js +23 -10
- package/dist/features/sheets/constants/sheet.js.map +1 -1
- package/dist/features/sheets/utils/is-v3-worksheet.js +17 -0
- package/dist/features/sheets/utils/is-v3-worksheet.js.map +1 -1
- package/dist/features/student-details/class-details/class-details-utils.js +6 -6
- package/dist/features/trial-session/api/course-stream.js.map +1 -1
- package/dist/features/trial-session/comps/about-cuemath/about-cuemath-constants.js +1 -1
- package/dist/features/trial-session/comps/about-cuemath/about-cuemath-constants.js.map +1 -1
- package/dist/features/trial-session/comps/background-grid/background-grid-utils.js +66 -60
- package/dist/features/trial-session/comps/background-grid/background-grid-utils.js.map +1 -1
- package/dist/features/trial-session/comps/learning-plan/index.js +62 -88
- package/dist/features/trial-session/comps/learning-plan/index.js.map +1 -1
- package/dist/features/trial-session/comps/offering-information/offering-information-constants.js +12 -12
- package/dist/features/trial-session/comps/offering-information/offering-information-constants.js.map +1 -1
- package/dist/features/trial-session/comps/pla/next-steps/next-steps-constants.js +25 -0
- package/dist/features/trial-session/comps/pla/next-steps/next-steps-constants.js.map +1 -0
- package/dist/features/trial-session/comps/pla/next-steps/next-steps-styled.js +43 -0
- package/dist/features/trial-session/comps/pla/next-steps/next-steps-styled.js.map +1 -0
- package/dist/features/trial-session/comps/pla/next-steps/next-steps.js +49 -0
- package/dist/features/trial-session/comps/pla/next-steps/next-steps.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-countdown.js +29 -0
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-countdown.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-status-config.js +132 -0
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-status-config.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status-constants.js +11 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status-constants.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status-helpers.js +19 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status-helpers.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status-styled.js +17 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status-styled.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status.js +127 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-summary/session-summary-constants.js +53 -0
- package/dist/features/trial-session/comps/pla/session-summary/session-summary-constants.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-summary/session-summary.js +53 -0
- package/dist/features/trial-session/comps/pla/session-summary/session-summary.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card-styled.js +17 -0
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card-styled.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js +56 -0
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js.map +1 -0
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-constants.js +5 -0
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-constants.js.map +1 -0
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-styled.js +17 -0
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-styled.js.map +1 -0
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-types.js +5 -0
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-types.js.map +1 -0
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions.js +96 -0
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions.js.map +1 -0
- package/dist/features/trial-session/comps/school-goals/school-goals.js +25 -24
- package/dist/features/trial-session/comps/school-goals/school-goals.js.map +1 -1
- package/dist/features/trial-session/comps/session-report/report-404/report-404.js +34 -0
- package/dist/features/trial-session/comps/session-report/report-404/report-404.js.map +1 -0
- package/dist/features/trial-session/comps/session-report/report-information/report-card.js +41 -0
- package/dist/features/trial-session/comps/session-report/report-information/report-card.js.map +1 -0
- package/dist/features/trial-session/comps/session-report/report-information/report-information-styled.js +39 -0
- package/dist/features/trial-session/comps/session-report/report-information/report-information-styled.js.map +1 -0
- package/dist/features/trial-session/comps/session-report/report-information/report-information.js +179 -0
- package/dist/features/trial-session/comps/session-report/report-information/report-information.js.map +1 -0
- package/dist/features/trial-session/comps/session-report/session-report-styled.js +6 -29
- package/dist/features/trial-session/comps/session-report/session-report-styled.js.map +1 -1
- package/dist/features/trial-session/comps/session-report/session-report.js +44 -174
- package/dist/features/trial-session/comps/session-report/session-report.js.map +1 -1
- package/dist/features/trial-session/comps/student-personalization/student-personalization-styled.js +20 -5
- package/dist/features/trial-session/comps/student-personalization/student-personalization-styled.js.map +1 -1
- package/dist/features/trial-session/comps/student-personalization/student-personalization.js +59 -126
- package/dist/features/trial-session/comps/student-personalization/student-personalization.js.map +1 -1
- package/dist/features/trial-session/comps/student-profile/constant.js +10 -0
- package/dist/features/trial-session/comps/student-profile/constant.js.map +1 -0
- package/dist/features/trial-session/comps/student-profile/student-profile-highlights/student-profile-highlights.js +53 -0
- package/dist/features/trial-session/comps/student-profile/student-profile-highlights/student-profile-highlights.js.map +1 -0
- package/dist/features/trial-session/comps/student-profile/student-profile.js +93 -46
- package/dist/features/trial-session/comps/student-profile/student-profile.js.map +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-helpers.js +12 -0
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-helpers.js.map +1 -0
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js +121 -42
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js.map +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js +174 -56
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js.map +1 -1
- package/dist/features/trial-session/comps/worksheet/worksheet.js +23 -23
- package/dist/features/trial-session/comps/worksheet/worksheet.js.map +1 -1
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js +65 -63
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js.map +1 -1
- package/dist/features/trial-session/left-panel/index.js +1 -1
- package/dist/features/trial-session/left-panel/index.js.map +1 -1
- package/dist/features/trial-session/right-panel/slide-components-map.js +32 -32
- package/dist/features/trial-session/right-panel/slide-components-map.js.map +1 -1
- package/dist/features/trial-session/trial-session-constants.js +3 -3
- package/dist/features/trial-session/trial-session-constants.js.map +1 -1
- package/dist/features/trial-session/trial-session-types.js.map +1 -1
- package/dist/features/ui/buttons/icon-button/icon-button.js +32 -29
- package/dist/features/ui/buttons/icon-button/icon-button.js.map +1 -1
- package/dist/features/ui/constants/z-index.js +5 -3
- package/dist/features/ui/constants/z-index.js.map +1 -1
- package/dist/features/ui/inputs/base-select-input/select-section/select-section.js +12 -11
- package/dist/features/ui/inputs/base-select-input/select-section/select-section.js.map +1 -1
- package/dist/features/ui/inputs/checkbox-input-list/checkbox-input-list-styled.js +2 -7
- package/dist/features/ui/inputs/checkbox-input-list/checkbox-input-list-styled.js.map +1 -1
- package/dist/features/ui/inputs/checkbox-input-list/checkbox-input-list.js +29 -27
- package/dist/features/ui/inputs/checkbox-input-list/checkbox-input-list.js.map +1 -1
- package/dist/features/ui/modals/modal.js +30 -28
- package/dist/features/ui/modals/modal.js.map +1 -1
- package/dist/features/wins-dashboard/belts-elements-stickers/belts-elements-stickers.js +109 -0
- package/dist/features/wins-dashboard/belts-elements-stickers/belts-elements-stickers.js.map +1 -0
- package/dist/features/wins-dashboard/belts-elements-stickers/belts.js +95 -0
- package/dist/features/wins-dashboard/belts-elements-stickers/belts.js.map +1 -0
- package/dist/features/wins-dashboard/belts-elements-stickers/elements.js +184 -0
- package/dist/features/wins-dashboard/belts-elements-stickers/elements.js.map +1 -0
- package/dist/features/wins-dashboard/belts-elements-stickers/progress-bar-horizontal.js +36 -0
- package/dist/features/wins-dashboard/belts-elements-stickers/progress-bar-horizontal.js.map +1 -0
- package/dist/features/wins-dashboard/belts-elements-stickers/reward-elements.js +83 -0
- package/dist/features/wins-dashboard/belts-elements-stickers/reward-elements.js.map +1 -0
- package/dist/features/wins-dashboard/constants.js +161 -0
- package/dist/features/wins-dashboard/constants.js.map +1 -0
- package/dist/features/wins-dashboard/header/wins-header.js +95 -0
- package/dist/features/wins-dashboard/header/wins-header.js.map +1 -0
- package/dist/features/wins-dashboard/student-badges/animated-tabbar.js +66 -0
- package/dist/features/wins-dashboard/student-badges/animated-tabbar.js.map +1 -0
- package/dist/features/wins-dashboard/student-badges/hooks/use-student-badge-list-hook.js +135 -0
- package/dist/features/wins-dashboard/student-badges/hooks/use-student-badge-list-hook.js.map +1 -0
- package/dist/features/wins-dashboard/student-badges/student-badge.js +168 -0
- package/dist/features/wins-dashboard/student-badges/student-badge.js.map +1 -0
- package/dist/features/wins-dashboard/student-badges/student-badges-lists.js +137 -0
- package/dist/features/wins-dashboard/student-badges/student-badges-lists.js.map +1 -0
- package/dist/features/worksheet/worksheet/worksheet-action-bar/worksheet-action-bar.js +86 -90
- package/dist/features/worksheet/worksheet/worksheet-action-bar/worksheet-action-bar.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-behavior-helper.js +147 -0
- package/dist/features/worksheet/worksheet/worksheet-behavior-helper.js.map +1 -0
- package/dist/features/worksheet/worksheet/worksheet-container.js +62 -42
- package/dist/features/worksheet/worksheet/worksheet-container.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +197 -199
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +228 -300
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-styled.js +34 -34
- package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet.js +206 -215
- package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/dynamic-worksheet-preview/dynamic-worksheet-preview.js +33 -33
- package/dist/features/worksheet/worksheet-preview/dynamic-worksheet-preview/dynamic-worksheet-preview.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +30 -28
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js +69 -73
- package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js +30 -79
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
- package/dist/index.d.ts +473 -45
- package/dist/index.js +695 -627
- package/dist/index.js.map +1 -1
- package/dist/node_modules/date-fns/_lib/getRoundingMethod.js +10 -0
- package/dist/node_modules/date-fns/_lib/getRoundingMethod.js.map +1 -0
- package/dist/node_modules/date-fns/differenceInMilliseconds.js +9 -0
- package/dist/node_modules/date-fns/differenceInMilliseconds.js.map +1 -0
- package/dist/node_modules/date-fns/differenceInSeconds.js +11 -0
- package/dist/node_modules/date-fns/differenceInSeconds.js.map +1 -0
- package/dist/node_modules/date-fns/fromUnixTime.js +9 -0
- package/dist/node_modules/date-fns/fromUnixTime.js.map +1 -0
- package/dist/static/awesome.4239f583.json +1 -0
- package/dist/static/black-belt.81b3ebf9.png +0 -0
- package/dist/static/blue-belt.508a1b4b.png +0 -0
- package/dist/static/{book-checked-green.c275dbd9.svg → book-checked-green.0436b91e.svg} +1 -1
- package/dist/static/brown-belt.09bb7e93.png +0 -0
- package/dist/static/clapping-hands.17e7ecf0.json +1 -0
- package/dist/static/common.9e8ceef1.svg +1 -0
- package/dist/static/community-bulb-yellow-2.f89c30f9.svg +1 -0
- package/dist/static/cool.cd6921bb.json +1 -0
- package/dist/static/epic.37a0265a.svg +1 -0
- package/dist/static/error-responsive.9916ff66.json +1 -0
- package/dist/static/error.dd744fa5.json +1 -0
- package/dist/static/green-belt.5501296f.png +0 -0
- package/dist/static/learning-puzzle-bot.6fe93cf6.svg +1 -0
- package/dist/static/legendary.f15d09ca.svg +1 -0
- package/dist/static/like-button.281a2618.json +1 -0
- package/dist/static/mastered-badge.91d25e92.png +0 -0
- package/dist/static/mystery.81ada5fb.svg +1 -0
- package/dist/static/mythic.58ba0ae0.svg +1 -0
- package/dist/static/orange-belt.1fefcc8c.png +0 -0
- package/dist/static/personalization.7a6c33e8.svg +1 -0
- package/dist/static/personalized-session.b4fd7df8.gif +0 -0
- package/dist/static/purple-belt.e15611b4.png +0 -0
- package/dist/static/rare.1ffaa311.svg +1 -0
- package/dist/static/red-belt.11f841d9.png +0 -0
- package/dist/static/regular-practice.b15f24d9.gif +0 -0
- package/dist/static/star-strike-emoji.c0b31028.json +1 -0
- package/dist/static/stepup.321df6ed.gif +0 -0
- package/dist/static/trophy.5ef1853a.json +1 -0
- package/dist/static/username-responsive.787b5515.json +1 -0
- package/dist/static/username.2c755605.json +1 -0
- package/dist/static/white-belt.ea93103e.png +0 -0
- package/dist/static/yellow-belt.0c47b8cc.png +0 -0
- package/package.json +1 -1
- package/dist/features/trial-session/comps/session-report/report-card.js +0 -26
- package/dist/features/trial-session/comps/session-report/report-card.js.map +0 -1
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js +0 -28
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js.map +0 -1
- package/dist/static/error.cbe1ddde.json +0 -1
- package/dist/static/username.9e034d51.json +0 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsxs as f, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { memo as u } from "react";
|
|
3
|
+
import r, { css as C } from "styled-components";
|
|
4
|
+
import e from "../../ui/layout/flex-view.js";
|
|
5
|
+
import b from "../../ui/text/text.js";
|
|
6
|
+
const g = 725, B = r(e)`
|
|
7
|
+
flex: 1;
|
|
8
|
+
position: relative;
|
|
9
|
+
`, I = r(e)`
|
|
10
|
+
position: relative;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
padding-top: 16px;
|
|
14
|
+
padding-bottom: 12px;
|
|
15
|
+
flex: 1;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
`, w = r.div`
|
|
18
|
+
width: ${({ $width: t }) => t}px;
|
|
19
|
+
height: 2px;
|
|
20
|
+
position: absolute;
|
|
21
|
+
bottom: 0;
|
|
22
|
+
background: BLACK;
|
|
23
|
+
transition: transform 300ms linear;
|
|
24
|
+
transform: translateX(${({ $left: t }) => t}px);
|
|
25
|
+
`, A = r(e)`
|
|
26
|
+
${({ $hideTabText: t }) => t && C`
|
|
27
|
+
display: none;
|
|
28
|
+
`}
|
|
29
|
+
`, y = ({
|
|
30
|
+
onTabClick: t,
|
|
31
|
+
selectedTabId: d,
|
|
32
|
+
tabs: i,
|
|
33
|
+
currentScreenWidth: x
|
|
34
|
+
}) => {
|
|
35
|
+
const l = i.findIndex((o) => o.id === d), { ref: c } = i[l] || {}, { clientWidth: s = 0 } = (c == null ? void 0 : c.current) || {}, m = s, $ = l * s + (s - m) / 2;
|
|
36
|
+
return /* @__PURE__ */ f(B, { $background: "WHITE", children: [
|
|
37
|
+
/* @__PURE__ */ n(e, { $flexDirection: "row", $width: "100%", children: i.map((o) => {
|
|
38
|
+
const { id: a, title: T, Icon: h } = o, p = a === d;
|
|
39
|
+
return /* @__PURE__ */ n(
|
|
40
|
+
I,
|
|
41
|
+
{
|
|
42
|
+
$justifyContent: "center",
|
|
43
|
+
onClick: () => t(a),
|
|
44
|
+
ref: o.ref,
|
|
45
|
+
children: /* @__PURE__ */ f(e, { $flexDirection: "row", $justifyContent: "center", $alignItems: "center", children: [
|
|
46
|
+
/* @__PURE__ */ n(h, { selected: p }),
|
|
47
|
+
/* @__PURE__ */ n(
|
|
48
|
+
A,
|
|
49
|
+
{
|
|
50
|
+
$gutter: 4,
|
|
51
|
+
$hideTabText: x <= g,
|
|
52
|
+
children: /* @__PURE__ */ n(b, { $renderAs: "eyebrow2", $color: p ? "BLACK" : "BLACK_75", children: T })
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
] })
|
|
56
|
+
},
|
|
57
|
+
a
|
|
58
|
+
);
|
|
59
|
+
}) }),
|
|
60
|
+
/* @__PURE__ */ n(w, { $left: $, $width: m })
|
|
61
|
+
] });
|
|
62
|
+
}, v = u(y);
|
|
63
|
+
export {
|
|
64
|
+
v as default
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=animated-tabbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animated-tabbar.js","sources":["../../../../src/features/wins-dashboard/student-badges/animated-tabbar.tsx"],"sourcesContent":["import React, { memo } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\n\nconst MIN_SCREEN_WIDTH_FOR_TAB_TEXT = 725;\n\nexport interface TabItem {\n id: string;\n ref: React.RefObject<HTMLDivElement | null>;\n Icon: React.FC<{ selected: boolean }>;\n title: string;\n}\n\ninterface IndicatorProps {\n $width: number;\n $left: number;\n}\n\nconst TabBarContainer = styled(FlexView)`\n flex: 1;\n position: relative;\n`;\n\nconst TabBarColumn = styled(FlexView)`\n position: relative;\n align-items: center;\n justify-content: center;\n padding-top: 16px;\n padding-bottom: 12px;\n flex: 1;\n cursor: pointer;\n`;\n\nconst Indicator = styled.div<IndicatorProps>`\n width: ${({ $width }) => $width}px;\n height: 2px;\n position: absolute;\n bottom: 0;\n background: BLACK;\n transition: transform 300ms linear;\n transform: translateX(${({ $left }) => $left}px);\n`;\n\nconst TabTitleContainer = styled(FlexView)<{ $hideTabText: boolean }>`\n ${({ $hideTabText }) =>\n $hideTabText &&\n css`\n display: none;\n `}\n`;\n\ninterface AnimatedTabBarProps {\n onTabClick: (tabId: string) => void;\n selectedTabId: string;\n tabs: TabItem[];\n currentScreenWidth: number;\n}\n\nconst AnimatedTabBar = ({\n onTabClick,\n selectedTabId,\n tabs,\n currentScreenWidth,\n}: AnimatedTabBarProps) => {\n const selectedTabItemIndex = tabs.findIndex((tab: TabItem) => tab.id === selectedTabId);\n const { ref } = tabs[selectedTabItemIndex] || {};\n const { clientWidth = 0 } = ref?.current || {};\n const indicatorWidth = clientWidth;\n\n const indicatorTranslateX =\n selectedTabItemIndex * clientWidth + (clientWidth - indicatorWidth) / 2;\n\n return (\n <TabBarContainer $background=\"WHITE\">\n <FlexView $flexDirection=\"row\" $width={'100%'}>\n {tabs.map((tab: TabItem) => {\n const { id, title, Icon } = tab;\n const selected = id === selectedTabId;\n\n return (\n <TabBarColumn\n $justifyContent=\"center\"\n key={id}\n onClick={() => onTabClick(id)}\n ref={tab.ref}\n >\n <FlexView $flexDirection=\"row\" $justifyContent=\"center\" $alignItems=\"center\">\n <Icon selected={selected} />\n <TabTitleContainer\n $gutter={4}\n $hideTabText={currentScreenWidth <= MIN_SCREEN_WIDTH_FOR_TAB_TEXT}\n >\n <Text $renderAs=\"eyebrow2\" $color={selected ? 'BLACK' : 'BLACK_75'}>\n {title}\n </Text>\n </TabTitleContainer>\n </FlexView>\n </TabBarColumn>\n );\n })}\n </FlexView>\n <Indicator $left={indicatorTranslateX} $width={indicatorWidth} />\n </TabBarContainer>\n );\n};\n\nexport default memo(AnimatedTabBar);\n"],"names":["MIN_SCREEN_WIDTH_FOR_TAB_TEXT","TabBarContainer","styled","FlexView","TabBarColumn","Indicator","$width","$left","TabTitleContainer","$hideTabText","css","AnimatedTabBar","onTabClick","selectedTabId","tabs","currentScreenWidth","selectedTabItemIndex","tab","ref","clientWidth","indicatorWidth","indicatorTranslateX","jsxs","jsx","id","title","Icon","selected","Text","AnimatedTabBar$1","memo"],"mappings":";;;;;AAMA,MAAMA,IAAgC,KAchCC,IAAkBC,EAAOC,CAAQ;AAAA;AAAA;AAAA,GAKjCC,IAAeF,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAU9BE,IAAYH,EAAO;AAAA,WACd,CAAC,EAAE,QAAAI,EAAO,MAAMA,CAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAMP,CAAC,EAAE,OAAAC,EAAM,MAAMA,CAAK;AAAA,GAGxCC,IAAoBN,EAAOC,CAAQ;AAAA,IACrC,CAAC,EAAE,cAAAM,QACHA,KACAC;AAAA;AAAA,KAEC;AAAA,GAUCC,IAAiB,CAAC;AAAA,EACtB,YAAAC;AAAA,EACA,eAAAC;AAAA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}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { useRef as a, useMemo as R, useState as y, useEffect as j, useCallback as O } from "react";
|
|
2
|
+
import { css as l } from "styled-components";
|
|
3
|
+
import { STUDENT_BADGE_TYPE as e, BADGE_TYPE_TAB_ICON as W } from "../../constants.js";
|
|
4
|
+
const b = 64, w = 48, A = b + w, m = {
|
|
5
|
+
TABLET: 768,
|
|
6
|
+
LAPTOP: 1024,
|
|
7
|
+
LAPTOPL: 1440
|
|
8
|
+
}, $ = (n) => {
|
|
9
|
+
if (n > m.LAPTOPL)
|
|
10
|
+
return {
|
|
11
|
+
badgeWidth: 140,
|
|
12
|
+
badgeCategoryGap: 40,
|
|
13
|
+
badgeCategoryWidth: 1040,
|
|
14
|
+
maxBadgeNameLines: 1,
|
|
15
|
+
containerStyle: l`
|
|
16
|
+
grid-template-columns: repeat(auto-fit, 140px);
|
|
17
|
+
grid-column-gap: 40px;
|
|
18
|
+
margin-top: 32px;
|
|
19
|
+
`
|
|
20
|
+
};
|
|
21
|
+
if (n > m.LAPTOP) {
|
|
22
|
+
const u = (n - 440) / 6;
|
|
23
|
+
return {
|
|
24
|
+
badgeWidth: u,
|
|
25
|
+
badgeCategoryGap: 40,
|
|
26
|
+
badgeCategoryWidth: n - 2 * 120,
|
|
27
|
+
maxBadgeNameLines: 1,
|
|
28
|
+
containerStyle: l`
|
|
29
|
+
grid-template-columns: repeat(auto-fit, ${u}px);
|
|
30
|
+
grid-column-gap: 40px;
|
|
31
|
+
margin-top: 32px;
|
|
32
|
+
`
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
if (n > m.TABLET)
|
|
36
|
+
return {
|
|
37
|
+
badgeWidth: 104,
|
|
38
|
+
badgeCategoryGap: 24,
|
|
39
|
+
badgeCategoryWidth: 784,
|
|
40
|
+
maxBadgeNameLines: 2,
|
|
41
|
+
containerStyle: l`
|
|
42
|
+
grid-column-gap: 32px;
|
|
43
|
+
grid-template-columns: repeat(auto-fit, 104px);
|
|
44
|
+
margin-top: 24px;
|
|
45
|
+
`
|
|
46
|
+
};
|
|
47
|
+
const g = 40, p = (n - (2 * g + 5 * 26)) / 6;
|
|
48
|
+
return {
|
|
49
|
+
badgeWidth: p,
|
|
50
|
+
badgeCategoryGap: 24,
|
|
51
|
+
badgeCategoryWidth: n - 2 * g,
|
|
52
|
+
maxBadgeNameLines: 2,
|
|
53
|
+
containerStyle: l`
|
|
54
|
+
grid-column-gap: 26px;
|
|
55
|
+
grid-template-columns: repeat(auto-fit, ${p}px);
|
|
56
|
+
margin-top: 24px;
|
|
57
|
+
`
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
function q({
|
|
61
|
+
currentScreenWidth: n,
|
|
62
|
+
handleScrollTo: g,
|
|
63
|
+
scrollPosition: d,
|
|
64
|
+
userBadges: p
|
|
65
|
+
}) {
|
|
66
|
+
const B = a(null), C = a(null), u = a(null), x = a(null), L = a(null), G = a(null), M = a(null), N = a(null), P = a(null), S = a(null), _ = a(null), H = a(null), I = R(
|
|
67
|
+
() => ({
|
|
68
|
+
[e.COMMON]: B,
|
|
69
|
+
[e.RARE]: C,
|
|
70
|
+
[e.EPIC]: u,
|
|
71
|
+
[e.LEGENDARY]: x,
|
|
72
|
+
[e.MYTHIC]: L,
|
|
73
|
+
[e.MYSTERY]: G
|
|
74
|
+
}),
|
|
75
|
+
[]
|
|
76
|
+
), c = R(
|
|
77
|
+
() => ({
|
|
78
|
+
[e.COMMON]: M,
|
|
79
|
+
[e.RARE]: N,
|
|
80
|
+
[e.EPIC]: P,
|
|
81
|
+
[e.LEGENDARY]: S,
|
|
82
|
+
[e.MYTHIC]: _,
|
|
83
|
+
[e.MYSTERY]: H
|
|
84
|
+
}),
|
|
85
|
+
[]
|
|
86
|
+
), [f, E] = y(!1), [T, Y] = y(
|
|
87
|
+
e.COMMON
|
|
88
|
+
);
|
|
89
|
+
j(() => {
|
|
90
|
+
const t = Object.keys(c).reverse().find((o) => {
|
|
91
|
+
var i;
|
|
92
|
+
const s = c[o], r = (i = s == null ? void 0 : s.current) == null ? void 0 : i.offsetTop;
|
|
93
|
+
return typeof r != "number" ? !1 : d >= r - (o === e.COMMON ? b : A);
|
|
94
|
+
});
|
|
95
|
+
t && t !== T && Y(t), t && !f && E(!0), !t && f && E(!1);
|
|
96
|
+
}, [c, T, d, f]);
|
|
97
|
+
const h = O(
|
|
98
|
+
(t) => {
|
|
99
|
+
var r;
|
|
100
|
+
const o = c[t], s = (r = o == null ? void 0 : o.current) == null ? void 0 : r.offsetTop;
|
|
101
|
+
if (typeof s == "number") {
|
|
102
|
+
const i = s - (t === e.COMMON ? b : A);
|
|
103
|
+
g(i);
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
[c, g]
|
|
107
|
+
), D = O(() => {
|
|
108
|
+
g(0);
|
|
109
|
+
}, [g]), k = () => {
|
|
110
|
+
const t = [];
|
|
111
|
+
return Object.keys(p).forEach((o) => {
|
|
112
|
+
const s = W[o], r = I[o];
|
|
113
|
+
s && r && t.push({
|
|
114
|
+
id: o,
|
|
115
|
+
title: o,
|
|
116
|
+
Icon: s,
|
|
117
|
+
ref: r
|
|
118
|
+
});
|
|
119
|
+
}), t;
|
|
120
|
+
};
|
|
121
|
+
return {
|
|
122
|
+
badgeCategoryRefs: c,
|
|
123
|
+
categoryConfig: $(n),
|
|
124
|
+
currentSelectedBadgeType: T,
|
|
125
|
+
onTabClick: h,
|
|
126
|
+
scrollToTop: D,
|
|
127
|
+
showTabBar: f,
|
|
128
|
+
tabs: k(),
|
|
129
|
+
totalBadgeCategories: Object.keys(p).length
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
export {
|
|
133
|
+
q as default
|
|
134
|
+
};
|
|
135
|
+
//# sourceMappingURL=use-student-badge-list-hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-student-badge-list-hook.js","sources":["../../../../../src/features/wins-dashboard/student-badges/hooks/use-student-badge-list-hook.ts"],"sourcesContent":["import type { FC } from 'react';\nimport type React from 'react';\nimport type { RuleSet } from 'styled-components';\n\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { css } from 'styled-components';\n\nimport { BADGE_TYPE_TAB_ICON, STUDENT_BADGE_TYPE } from '../../constants';\n\nconst HEADER_HEIGHT = 64;\nconst TAB_BAR_HEIGHT = 48;\nconst TOTAL_TAB_BAR_HEIGHT = HEADER_HEIGHT + TAB_BAR_HEIGHT;\n\n// Screen sizes constants\nconst SCREEN_SIZES = {\n TABLET: 768,\n LAPTOP: 1024,\n LAPTOPL: 1440,\n};\n\ninterface CategoryConfig {\n badgeWidth: number;\n badgeCategoryGap: number;\n badgeCategoryWidth: number;\n maxBadgeNameLines: number;\n containerStyle: RuleSet<object>;\n}\n\nconst getBadgeContainerConfig = (containerWidth: number): CategoryConfig => {\n if (containerWidth > SCREEN_SIZES.LAPTOPL) {\n return {\n badgeWidth: 140,\n badgeCategoryGap: 40,\n badgeCategoryWidth: 1040,\n maxBadgeNameLines: 1,\n containerStyle: css`\n grid-template-columns: repeat(auto-fit, 140px);\n grid-column-gap: 40px;\n margin-top: 32px;\n `,\n };\n }\n\n if (containerWidth > SCREEN_SIZES.LAPTOP) {\n const gutter = 120;\n const badgeGap = 40;\n const badgeWidth = (containerWidth - (2 * gutter + 5 * badgeGap)) / 6;\n\n return {\n badgeWidth,\n badgeCategoryGap: 40,\n badgeCategoryWidth: containerWidth - 2 * gutter,\n maxBadgeNameLines: 1,\n containerStyle: css`\n grid-template-columns: repeat(auto-fit, ${badgeWidth}px);\n grid-column-gap: 40px;\n margin-top: 32px;\n `,\n };\n }\n\n if (containerWidth > SCREEN_SIZES.TABLET) {\n return {\n badgeWidth: 104,\n badgeCategoryGap: 24,\n badgeCategoryWidth: 784,\n maxBadgeNameLines: 2,\n containerStyle: css`\n grid-column-gap: 32px;\n grid-template-columns: repeat(auto-fit, 104px);\n margin-top: 24px;\n `,\n };\n }\n\n const gutter = 40;\n const badgeGap = 26;\n const badgeWidth = (containerWidth - (2 * gutter + 5 * badgeGap)) / 6;\n\n return {\n badgeWidth,\n badgeCategoryGap: 24,\n badgeCategoryWidth: containerWidth - 2 * gutter,\n maxBadgeNameLines: 2,\n containerStyle: css`\n grid-column-gap: 26px;\n grid-template-columns: repeat(auto-fit, ${badgeWidth}px);\n margin-top: 24px;\n `,\n };\n};\n\nexport default function useStudentBadgeListHook({\n currentScreenWidth,\n handleScrollTo,\n scrollPosition,\n userBadges,\n}: {\n currentScreenWidth: number;\n handleScrollTo: (position: number) => void;\n scrollPosition: number;\n userBadges: Record<string, unknown[]>;\n}) {\n // Create refs for all possible badge categories\n const commonTabRef = useRef<HTMLDivElement | null>(null);\n const rareTabRef = useRef<HTMLDivElement | null>(null);\n const epicTabRef = useRef<HTMLDivElement | null>(null);\n const legendaryTabRef = useRef<HTMLDivElement | null>(null);\n const mythicTabRef = useRef<HTMLDivElement | null>(null);\n const mysteryTabRef = useRef<HTMLDivElement | null>(null);\n\n const commonBadgeRef = useRef<HTMLDivElement | null>(null);\n const rareBadgeRef = useRef<HTMLDivElement | null>(null);\n const epicBadgeRef = useRef<HTMLDivElement | null>(null);\n const legendaryBadgeRef = useRef<HTMLDivElement | null>(null);\n const mythicBadgeRef = useRef<HTMLDivElement | null>(null);\n const mysteryBadgeRef = useRef<HTMLDivElement | null>(null);\n\n const tabBarRefs: Record<string, React.RefObject<HTMLDivElement | null>> = useMemo(\n () => ({\n [STUDENT_BADGE_TYPE.COMMON]: commonTabRef,\n [STUDENT_BADGE_TYPE.RARE]: rareTabRef,\n [STUDENT_BADGE_TYPE.EPIC]: epicTabRef,\n [STUDENT_BADGE_TYPE.LEGENDARY]: legendaryTabRef,\n [STUDENT_BADGE_TYPE.MYTHIC]: mythicTabRef,\n [STUDENT_BADGE_TYPE.MYSTERY]: mysteryTabRef,\n }),\n [],\n );\n\n const badgeCategoryRefs: Record<string, React.RefObject<HTMLDivElement | null>> = useMemo(\n () => ({\n [STUDENT_BADGE_TYPE.COMMON]: commonBadgeRef,\n [STUDENT_BADGE_TYPE.RARE]: rareBadgeRef,\n [STUDENT_BADGE_TYPE.EPIC]: epicBadgeRef,\n [STUDENT_BADGE_TYPE.LEGENDARY]: legendaryBadgeRef,\n [STUDENT_BADGE_TYPE.MYTHIC]: mythicBadgeRef,\n [STUDENT_BADGE_TYPE.MYSTERY]: mysteryBadgeRef,\n }),\n [],\n );\n\n const [showTabBar, setShowTabBar] = useState(false);\n const [currentSelectedBadgeType, setCurrentSelectedBadgeType] = useState(\n STUDENT_BADGE_TYPE.COMMON,\n );\n\n useEffect(() => {\n const categoryReached = Object.keys(badgeCategoryRefs)\n .reverse()\n .find(category => {\n const categoryRef = badgeCategoryRefs[category];\n const categoryTopOffset = categoryRef?.current?.offsetTop;\n\n if (typeof categoryTopOffset !== 'number') return false;\n\n return (\n scrollPosition >=\n categoryTopOffset -\n (category === STUDENT_BADGE_TYPE.COMMON ? HEADER_HEIGHT : TOTAL_TAB_BAR_HEIGHT)\n );\n });\n\n if (categoryReached && categoryReached !== currentSelectedBadgeType) {\n setCurrentSelectedBadgeType(categoryReached);\n }\n\n if (categoryReached && !showTabBar) {\n setShowTabBar(true);\n }\n\n if (!categoryReached && showTabBar) {\n setShowTabBar(false);\n }\n }, [badgeCategoryRefs, currentSelectedBadgeType, scrollPosition, showTabBar]);\n\n const onTabClick = useCallback(\n (category: string) => {\n const categoryRef = badgeCategoryRefs[category];\n const categoryTopOffset = categoryRef?.current?.offsetTop;\n\n if (typeof categoryTopOffset === 'number') {\n const scrollTopPosition =\n categoryTopOffset -\n (category === STUDENT_BADGE_TYPE.COMMON ? HEADER_HEIGHT : TOTAL_TAB_BAR_HEIGHT);\n\n handleScrollTo(scrollTopPosition);\n }\n },\n [badgeCategoryRefs, handleScrollTo],\n );\n\n const scrollToTop = useCallback(() => {\n const scrollTopPosition = 0;\n\n handleScrollTo(scrollTopPosition);\n }, [handleScrollTo]);\n\n const getTabBarData = (): Array<{\n id: string;\n title: string;\n Icon: FC<{ color?: string; selected?: boolean }>;\n ref: React.RefObject<HTMLDivElement | null>;\n }> => {\n const tabBarData: Array<{\n id: string;\n title: string;\n Icon: FC<{ color?: string; selected?: boolean }>;\n ref: React.RefObject<HTMLDivElement | null>;\n }> = [];\n\n Object.keys(userBadges).forEach(category => {\n const Icon = BADGE_TYPE_TAB_ICON[category];\n const ref = tabBarRefs[category];\n\n if (Icon && ref) {\n tabBarData.push({\n id: category,\n title: category,\n Icon,\n ref,\n });\n }\n });\n\n return tabBarData;\n };\n\n return {\n badgeCategoryRefs,\n categoryConfig: getBadgeContainerConfig(currentScreenWidth),\n currentSelectedBadgeType,\n onTabClick,\n scrollToTop,\n showTabBar,\n tabs: getTabBarData(),\n totalBadgeCategories: Object.keys(userBadges).length,\n };\n}\n"],"names":["HEADER_HEIGHT","TAB_BAR_HEIGHT","TOTAL_TAB_BAR_HEIGHT","SCREEN_SIZES","getBadgeContainerConfig","containerWidth","css","badgeWidth","gutter","useStudentBadgeListHook","currentScreenWidth","handleScrollTo","scrollPosition","userBadges","commonTabRef","useRef","rareTabRef","epicTabRef","legendaryTabRef","mythicTabRef","mysteryTabRef","commonBadgeRef","rareBadgeRef","epicBadgeRef","legendaryBadgeRef","mythicBadgeRef","mysteryBadgeRef","tabBarRefs","useMemo","STUDENT_BADGE_TYPE","badgeCategoryRefs","showTabBar","setShowTabBar","useState","currentSelectedBadgeType","setCurrentSelectedBadgeType","useEffect","categoryReached","category","categoryRef","categoryTopOffset","_a","onTabClick","useCallback","scrollTopPosition","scrollToTop","getTabBarData","tabBarData","Icon","BADGE_TYPE_TAB_ICON","ref"],"mappings":";;;AASA,MAAMA,IAAgB,IAChBC,IAAiB,IACjBC,IAAuBF,IAAgBC,GAGvCE,IAAe;AAAA,EACnB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AACX,GAUMC,IAA0B,CAACC,MAA2C;AACtE,MAAAA,IAAiBF,EAAa;AACzB,WAAA;AAAA,MACL,YAAY;AAAA,M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AAA,KAEpB,CAACF,GAAmBI,GAA0BtB,GAAgBmB,CAAU,CAAC;AAE5E,QAAMW,IAAaC;AAAA,IACjB,CAACL,MAAqB;;AACd,YAAAC,IAAcT,EAAkBQ,CAAQ,GACxCE,KAAoBC,IAAAF,KAAA,gBAAAA,EAAa,YAAb,gBAAAE,EAAsB;AAE5C,UAAA,OAAOD,KAAsB,UAAU;AACzC,cAAMI,IACJJ,KACCF,MAAaT,EAAmB,SAAS7B,IAAgBE;AAE5D,QAAAS,EAAeiC,CAAiB;AAAA,MAClC;AAAA,IACF;AAAA,IACA,CAACd,GAAmBnB,CAAc;AAAA,EAAA,GAG9BkC,IAAcF,EAAY,MAAM;AAGpC,IAAAhC,EAAe,CAAiB;AAAA,EAAA,GAC/B,CAACA,CAAc,CAAC,GAEbmC,IAAgB,MAKhB;AACJ,UAAMC,IAKD,CAAA;AAEL,kBAAO,KAAKlC,CAAU,EAAE,QAAQ,CAAYyB,MAAA;AACpC,YAAAU,IAAOC,EAAoBX,CAAQ,GACnCY,IAAMvB,EAAWW,CAAQ;AAE/B,MAAIU,KAAQE,KACVH,EAAW,KAAK;AAAA,QACd,IAAIT;AAAA,QACJ,OAAOA;AAAA,QACP,MAAAU;AAAA,QACA,KAAAE;AAAA,MAAA,CACD;AAAA,IACH,CACD,GAEMH;AAAA,EAAA;AAGF,SAAA;AAAA,IACL,mBAAAjB;AAAA,IACA,gBAAgB1B,EAAwBM,CAAkB;AAAA,IAC1D,0BAAAwB;AAAA,IACA,YAAAQ;AAAA,IACA,aAAAG;AAAA,IACA,YAAAd;AAAA,IACA,MAAMe,EAAc;AAAA,IACpB,sBAAsB,OAAO,KAAKjC,CAAU,EAAE;AAAA,EAAA;AAElD;"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { jsxs as u, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { memo as W, useState as O, useCallback as m } from "react";
|
|
3
|
+
import r, { css as j } from "styled-components";
|
|
4
|
+
import { useUIContext as H } from "../../ui/context/context.js";
|
|
5
|
+
import i from "../../ui/layout/flex-view.js";
|
|
6
|
+
import z from "../../ui/lottie-animation/lottie-animation.js";
|
|
7
|
+
import F from "../../ui/separator/separator.js";
|
|
8
|
+
import v from "../../ui/text/text.js";
|
|
9
|
+
import { getTheme as K } from "../../ui/theme/get-theme.js";
|
|
10
|
+
import { STUDENT_BADGE_STATUS as V, STUDENT_BADGE_TYPE as h, BADGE_TYPE_BADGE_ICON as k } from "../constants.js";
|
|
11
|
+
const { colors: b } = K(), S = 20, X = r(i)`
|
|
12
|
+
position: absolute;
|
|
13
|
+
top: 0;
|
|
14
|
+
right: 0;
|
|
15
|
+
background: ${b.ORANGE_3};
|
|
16
|
+
border-radius: 0px 8px;
|
|
17
|
+
padding: 2px 8px;
|
|
18
|
+
z-index: 1;
|
|
19
|
+
`, Z = r(i)`
|
|
20
|
+
cursor: ${(e) => e.$isEarned ? "pointer" : "default"};
|
|
21
|
+
`, q = r(i)`
|
|
22
|
+
position: relative;
|
|
23
|
+
border-radius: 8px;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
`, J = r(i)`
|
|
26
|
+
position: relative;
|
|
27
|
+
border-radius: 8px;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
background: ${({ $backgroundColor: e }) => e};
|
|
30
|
+
opacity: ${({ $badgeEarned: e }) => e ? 1 : 0.5};
|
|
31
|
+
|
|
32
|
+
${({ $notEarnedMysterBadge: e }) => e && j`
|
|
33
|
+
mix-blend-mode: luminosity;
|
|
34
|
+
`}
|
|
35
|
+
`, Q = r.img`
|
|
36
|
+
opacity: ${(e) => e.$mouseEntered ? 0 : 1};
|
|
37
|
+
`, ee = r(i)`
|
|
38
|
+
position: absolute;
|
|
39
|
+
bottom: 0;
|
|
40
|
+
`, te = r(i)`
|
|
41
|
+
position: relative;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
`, oe = r(i)`
|
|
44
|
+
position: absolute;
|
|
45
|
+
left: 0;
|
|
46
|
+
top: 0;
|
|
47
|
+
height: 100%;
|
|
48
|
+
transition: width 300ms ease-in-out;
|
|
49
|
+
`, A = r(v)`
|
|
50
|
+
display: -webkit-box;
|
|
51
|
+
-webkit-line-clamp: ${({ $numberOfLines: e }) => e};
|
|
52
|
+
-webkit-box-orient: vertical;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
`, ne = (e) => {
|
|
55
|
+
const {
|
|
56
|
+
is_recent: C,
|
|
57
|
+
badgeWidth: n,
|
|
58
|
+
animation_url: d,
|
|
59
|
+
maxBadgeNameLines: p = 1,
|
|
60
|
+
category: a,
|
|
61
|
+
current_count: E,
|
|
62
|
+
description: D,
|
|
63
|
+
image_url: $,
|
|
64
|
+
id: c,
|
|
65
|
+
invalidateRewardsHome: f,
|
|
66
|
+
name: N,
|
|
67
|
+
openModal: g,
|
|
68
|
+
state: I,
|
|
69
|
+
total_count: _
|
|
70
|
+
} = e, [B, w] = O(!1), { onEvent: l } = H(), t = I !== V.UNASSIGNED, x = E && _ ? E / _ * 100 : 0, M = a !== h.MYSTERY && !t && x > 0, y = t ? $ || k[a] : k[a], T = a === h.MYSTERY && !t, R = a === h.MYSTERY ? b.GREY_1 : b.WHITE, { badgeName: Y, badgeDescription: G } = T ? { badgeName: "????", badgeDescription: "----------------" } : { badgeName: N || "", badgeDescription: D || "" }, L = m(() => {
|
|
71
|
+
t && w(!0);
|
|
72
|
+
}, [t]), U = m(() => {
|
|
73
|
+
t && w(!1);
|
|
74
|
+
}, [t]), P = m(() => {
|
|
75
|
+
!t || !g || t && d && fetch(d).then((s) => s.json()).then((s) => {
|
|
76
|
+
g("student-badges", {
|
|
77
|
+
badges: [
|
|
78
|
+
{
|
|
79
|
+
...e,
|
|
80
|
+
animationData: s || null
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
invalidateRewardsHome: f
|
|
84
|
+
}), l("student_badge_clicked", {
|
|
85
|
+
studentBadgeId: c,
|
|
86
|
+
category: a,
|
|
87
|
+
badgeEarned: t
|
|
88
|
+
});
|
|
89
|
+
}).catch((s) => {
|
|
90
|
+
l("student_badge_animation_load_failed", {
|
|
91
|
+
studentBadgeId: c,
|
|
92
|
+
animationUrl: d,
|
|
93
|
+
error: s.message
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
}, [
|
|
97
|
+
t,
|
|
98
|
+
g,
|
|
99
|
+
d,
|
|
100
|
+
e,
|
|
101
|
+
c,
|
|
102
|
+
a,
|
|
103
|
+
l,
|
|
104
|
+
f
|
|
105
|
+
]);
|
|
106
|
+
return /* @__PURE__ */ u(
|
|
107
|
+
Z,
|
|
108
|
+
{
|
|
109
|
+
onClick: P,
|
|
110
|
+
$width: n,
|
|
111
|
+
$isEarned: t,
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ u(q, { children: [
|
|
114
|
+
/* @__PURE__ */ u(
|
|
115
|
+
J,
|
|
116
|
+
{
|
|
117
|
+
$backgroundColor: R,
|
|
118
|
+
$badgeEarned: t,
|
|
119
|
+
$notEarnedMysterBadge: T,
|
|
120
|
+
onMouseEnter: L,
|
|
121
|
+
onMouseLeave: U,
|
|
122
|
+
children: [
|
|
123
|
+
C && /* @__PURE__ */ o(X, { children: /* @__PURE__ */ o(v, { $renderAs: "cta2", children: "NEW" }) }),
|
|
124
|
+
t ? /* @__PURE__ */ o(
|
|
125
|
+
Q,
|
|
126
|
+
{
|
|
127
|
+
$mouseEntered: B,
|
|
128
|
+
src: $,
|
|
129
|
+
alt: "badge-placeholder",
|
|
130
|
+
width: n,
|
|
131
|
+
height: n
|
|
132
|
+
}
|
|
133
|
+
) : /* @__PURE__ */ o("img", { src: y, alt: "badge-placeholder", width: n, height: n }),
|
|
134
|
+
d && t && /* @__PURE__ */ o(
|
|
135
|
+
i,
|
|
136
|
+
{
|
|
137
|
+
$width: n + S,
|
|
138
|
+
$height: n + S,
|
|
139
|
+
$position: "absolute",
|
|
140
|
+
children: /* @__PURE__ */ o(
|
|
141
|
+
z,
|
|
142
|
+
{
|
|
143
|
+
src: d,
|
|
144
|
+
width: n,
|
|
145
|
+
height: n,
|
|
146
|
+
settings: { autoplay: B, loop: !0 },
|
|
147
|
+
animateOnIntersect: !1
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
)
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
),
|
|
155
|
+
M && /* @__PURE__ */ o(ee, { $width: n, children: /* @__PURE__ */ o(te, { $height: 4, $borderRadius: 2, $width: "100%", $background: "WHITE", children: /* @__PURE__ */ o(oe, { $width: `${x}%`, $borderRadius: 2, $background: "BLACK" }) }) })
|
|
156
|
+
] }),
|
|
157
|
+
/* @__PURE__ */ o(F, { height: 8 }),
|
|
158
|
+
/* @__PURE__ */ o(A, { $renderAs: "cta2", $numberOfLines: p, children: Y }),
|
|
159
|
+
/* @__PURE__ */ o(A, { $renderAs: "body3", $numberOfLines: p + 1, children: G })
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
c
|
|
163
|
+
);
|
|
164
|
+
}, he = W(ne);
|
|
165
|
+
export {
|
|
166
|
+
he as default
|
|
167
|
+
};
|
|
168
|
+
//# sourceMappingURL=student-badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"student-badge.js","sources":["../../../../src/features/wins-dashboard/student-badges/student-badge.tsx"],"sourcesContent":["import React, { memo, useCallback, useState } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { useUIContext } from '../../ui/context/context';\nimport FlexView from '../../ui/layout/flex-view';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport { getTheme } from '../../ui/theme/get-theme';\nimport { BADGE_TYPE_BADGE_ICON, STUDENT_BADGE_STATUS, STUDENT_BADGE_TYPE } from '../constants';\n\nconst { colors } = getTheme();\n\nconst EXTRA_BADGE_SIZE = 20;\n\nconst NewTag = styled(FlexView)`\n position: absolute;\n top: 0;\n right: 0;\n background: ${colors.ORANGE_3};\n border-radius: 0px 8px;\n padding: 2px 8px;\n z-index: 1;\n`;\n\ninterface StudentBadgeModalData {\n badges: Array<{\n animation_url?: string;\n animationData?: object;\n category: string;\n current_count?: number;\n description?: string;\n id: string;\n image_url?: string;\n name?: string;\n state?: string;\n total_count?: number;\n }>;\n invalidateRewardsHome?: () => void;\n}\n\nexport interface StudentBadgeProps {\n animation_url?: string;\n category: string;\n current_count?: number;\n description?: string;\n id: string;\n image_url?: string;\n invalidateRewardsHome?: () => void;\n is_recent?: boolean;\n name?: string;\n openModal?: (modalType: string, data: StudentBadgeModalData) => void;\n state?: string;\n total_count?: number;\n badgeWidth: number;\n maxBadgeNameLines: number;\n}\n\nconst Wrapper = styled(FlexView)<{ $isEarned: boolean }>`\n cursor: ${props => (props.$isEarned ? 'pointer' : 'default')};\n`;\nconst StudentBadgeWrapper = styled(FlexView)`\n position: relative;\n border-radius: 8px;\n overflow: hidden;\n`;\n\nconst BadgeImageContainer = styled(FlexView)<{\n $backgroundColor: string;\n $badgeEarned: boolean;\n $notEarnedMysterBadge: boolean;\n}>`\n position: relative;\n border-radius: 8px;\n overflow: hidden;\n background: ${({ $backgroundColor }) => $backgroundColor};\n opacity: ${({ $badgeEarned }) => ($badgeEarned ? 1 : 0.5)};\n\n ${({ $notEarnedMysterBadge }) =>\n $notEarnedMysterBadge &&\n css`\n mix-blend-mode: luminosity;\n `}\n`;\n\nconst BadgeImage = styled.img<{ $mouseEntered?: boolean }>`\n opacity: ${props => (props.$mouseEntered ? 0 : 1)};\n`;\n\nconst ProgressContainer = styled(FlexView)`\n position: absolute;\n bottom: 0;\n`;\n\nconst Background = styled(FlexView)`\n position: relative;\n overflow: hidden;\n`;\n\nconst Progress = styled(FlexView)`\n position: absolute;\n left: 0;\n top: 0;\n height: 100%;\n transition: width 300ms ease-in-out;\n`;\n\nconst BadgeText = styled(Text)<{ $numberOfLines: number }>`\n display: -webkit-box;\n -webkit-line-clamp: ${({ $numberOfLines }) => $numberOfLines};\n -webkit-box-orient: vertical;\n overflow: hidden;\n`;\n\nconst StudentBadge: React.FC<StudentBadgeProps> = props => {\n const {\n is_recent: isRecent,\n badgeWidth,\n animation_url: animationUrl,\n maxBadgeNameLines = 1,\n category,\n current_count: currentCount,\n description,\n image_url: imageUrl,\n id: studentBadgeId,\n invalidateRewardsHome,\n name,\n openModal,\n state,\n total_count: totalCount,\n } = props;\n const [mouseEntered, setMouseEntered] = useState(false);\n\n const { onEvent: trackEvent } = useUIContext();\n\n const badgeEarned = state !== STUDENT_BADGE_STATUS.UNASSIGNED;\n const badgeProgress = currentCount && totalCount ? (currentCount / totalCount) * 100 : 0;\n const showProgress = category !== STUDENT_BADGE_TYPE.MYSTERY && !badgeEarned && badgeProgress > 0;\n const badgeImage = badgeEarned\n ? imageUrl || BADGE_TYPE_BADGE_ICON[category as keyof typeof BADGE_TYPE_BADGE_ICON]\n : BADGE_TYPE_BADGE_ICON[category as keyof typeof BADGE_TYPE_BADGE_ICON];\n const notEarnedMysterBadge = category === STUDENT_BADGE_TYPE.MYSTERY && !badgeEarned;\n const badgeBackgroundColor =\n category === STUDENT_BADGE_TYPE.MYSTERY ? colors.GREY_1 : colors.WHITE;\n const { badgeName, badgeDescription } = notEarnedMysterBadge\n ? { badgeName: '????', badgeDescription: '----------------' }\n : { badgeName: name || '', badgeDescription: description || '' };\n\n const onBadgeMouseEnter = useCallback(() => {\n if (!badgeEarned) {\n return;\n }\n setMouseEntered(true);\n }, [badgeEarned]);\n\n const onBadgeMouseLeave = useCallback(() => {\n if (!badgeEarned) {\n return;\n }\n setMouseEntered(false);\n }, [badgeEarned]);\n\n const onBadgeClick = useCallback(() => {\n if (!badgeEarned || !openModal) {\n return;\n }\n\n if (badgeEarned && animationUrl) {\n fetch(animationUrl)\n .then(response => response.json())\n .then(data => {\n openModal('student-badges', {\n badges: [\n {\n ...props,\n animationData: data || null,\n },\n ],\n invalidateRewardsHome,\n });\n\n trackEvent('student_badge_clicked', {\n studentBadgeId,\n category,\n badgeEarned,\n });\n })\n .catch(error => {\n trackEvent('student_badge_animation_load_failed', {\n studentBadgeId,\n animationUrl,\n error: error.message,\n });\n });\n }\n }, [\n badgeEarned,\n openModal,\n animationUrl,\n props,\n studentBadgeId,\n category,\n trackEvent,\n invalidateRewardsHome,\n ]);\n\n return (\n <Wrapper\n onClick={onBadgeClick}\n $width={badgeWidth}\n $isEarned={badgeEarned}\n key={studentBadgeId}\n >\n <StudentBadgeWrapper>\n <BadgeImageContainer\n $backgroundColor={badgeBackgroundColor}\n $badgeEarned={badgeEarned}\n $notEarnedMysterBadge={notEarnedMysterBadge}\n onMouseEnter={onBadgeMouseEnter}\n onMouseLeave={onBadgeMouseLeave}\n >\n {isRecent && (\n <NewTag>\n <Text $renderAs=\"cta2\">NEW</Text>\n </NewTag>\n )}\n {badgeEarned ? (\n <BadgeImage\n $mouseEntered={mouseEntered}\n src={imageUrl}\n alt=\"badge-placeholder\"\n width={badgeWidth}\n height={badgeWidth}\n />\n ) : (\n <img src={badgeImage} alt=\"badge-placeholder\" width={badgeWidth} height={badgeWidth} />\n )}\n {animationUrl && badgeEarned && (\n <FlexView\n $width={badgeWidth + EXTRA_BADGE_SIZE}\n $height={badgeWidth + EXTRA_BADGE_SIZE}\n $position=\"absolute\"\n >\n <LottieAnimation\n src={animationUrl}\n width={badgeWidth}\n height={badgeWidth}\n settings={{ autoplay: mouseEntered, loop: true }}\n animateOnIntersect={false}\n />\n </FlexView>\n )}\n </BadgeImageContainer>\n {showProgress && (\n <ProgressContainer $width={badgeWidth}>\n <Background $height={4} $borderRadius={2} $width={'100%'} $background=\"WHITE\">\n <Progress $width={`${badgeProgress}%`} $borderRadius={2} $background=\"BLACK\" />\n </Background>\n </ProgressContainer>\n )}\n </StudentBadgeWrapper>\n <Separator height={8} />\n <BadgeText $renderAs=\"cta2\" $numberOfLines={maxBadgeNameLines}>\n {badgeName}\n </BadgeText>\n <BadgeText $renderAs=\"body3\" $numberOfLines={maxBadgeNameLines + 1}>\n {badgeDescription}\n </BadgeText>\n </Wrapper>\n );\n};\n\nexport default memo(StudentBadge);\n"],"names":["colors","getTheme","EXTRA_BADGE_SIZE","NewTag","styled","FlexView","Wrapper","props","StudentBadgeWrapper","BadgeImageContainer","$backgroundColor","$badgeEarned","$notEarnedMysterBadge","css","BadgeImage","ProgressContainer","Background","Progress","BadgeText","Text","$numberOfLines","StudentBadge","isRecent","badgeWidth","animationUrl","maxBadgeNameLines","category","currentCount","description","imageUrl","studentBadgeId","invalidateRewardsHome","name","openModal","state","totalCount","mouseEntered","setMouseEntered","useState","trackEvent","useUIContext","badgeEarned","STUDENT_BADGE_STATUS","badgeProgress","showProgress","STUDENT_BADGE_TYPE","badgeImage","BADGE_TYPE_BADGE_ICON","notEarnedMysterBadge","badgeBackgroundColor","badgeName","badgeDescription","onBadgeMouseEnter","useCallback","onBadgeMouseLeave","onBadgeClick","response","data","error","jsxs","jsx","LottieAnimation","Separator","StudentBadge$1","memo"],"mappings":";;;;;;;;;;AAWA,MAAM,EAAE,QAAAA,EAAO,IAAIC,KAEbC,IAAmB,IAEnBC,IAASC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,gBAIdL,EAAO,QAAQ;AAAA;AAAA;AAAA;AAAA,GAuCzBM,IAAUF,EAAOC,CAAQ;AAAA,YACnB,CAAUE,MAAAA,EAAM,YAAY,YAAY,SAAU;AAAA,GAExDC,IAAsBJ,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,GAMrCI,IAAsBL,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,gBAQ3B,CAAC,EAAE,kBAAAK,EAAiB,MAAMA,CAAgB;AAAA,aAC7C,CAAC,EAAE,cAAAC,EAAA,MAAoBA,IAAe,IAAI,GAAI;AAAA;AAAA,IAEvD,CAAC,EAAE,uBAAAC,QACHA,KACAC;AAAA;AAAA,KAEC;AAAA,GAGCC,IAAaV,EAAO;AAAA,aACb,CAAUG,MAAAA,EAAM,gBAAgB,IAAI,CAAE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AAA;AAAA,IAxDKrB;AAAA,EAAA;AA2DX,GAEeiC,KAAAC,EAAK3C,EAAY;"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { memo as G } from "react";
|
|
3
|
+
import i, { css as F } from "styled-components";
|
|
4
|
+
import S from "../../../assets/line-icons/icons/up.js";
|
|
5
|
+
import o from "../../ui/layout/flex-view.js";
|
|
6
|
+
import m from "../../ui/text/text.js";
|
|
7
|
+
import { BADGE_TYPE_BACKGROUND as _, BADGE_TYPE_TAB_ICON as j } from "../constants.js";
|
|
8
|
+
import L from "./animated-tabbar.js";
|
|
9
|
+
import O from "./hooks/use-student-badge-list-hook.js";
|
|
10
|
+
import R from "./student-badge.js";
|
|
11
|
+
const g = 64, { innerHeight: N } = window, Y = i(o)`
|
|
12
|
+
width: 100%;
|
|
13
|
+
background-color: ${({ $backgroundColor: t }) => t};
|
|
14
|
+
padding: ${({ $badgeCategoryGap: t }) => t}px 0;
|
|
15
|
+
align-items: center;
|
|
16
|
+
${({ $isLastCategory: t }) => t && F`
|
|
17
|
+
min-height: ${N - g}px;
|
|
18
|
+
`}
|
|
19
|
+
`, v = i(o)`
|
|
20
|
+
position: fixed;
|
|
21
|
+
top: ${({ $topOffset: t }) => t}px;
|
|
22
|
+
width: ${({ $width: t }) => t}px;
|
|
23
|
+
z-index: 1;
|
|
24
|
+
transition: transform 200ms linear;
|
|
25
|
+
transform: translateY(${({ $visible: t }) => t ? g : 0}px);
|
|
26
|
+
`, U = i(o)`
|
|
27
|
+
position: fixed;
|
|
28
|
+
top: ${window.innerHeight - 100}px;
|
|
29
|
+
right: 40px;
|
|
30
|
+
width: 48px;
|
|
31
|
+
height: 48px;
|
|
32
|
+
border: 1px solid black;
|
|
33
|
+
background: ${({ theme: t }) => t.colors.WHITE};
|
|
34
|
+
border-radius: 24px;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
opacity: ${({ $showTabBar: t }) => t ? 1 : 0};
|
|
37
|
+
transition: all 100ms linear;
|
|
38
|
+
`, W = i.div`
|
|
39
|
+
display: grid;
|
|
40
|
+
grid-row-gap: 16px;
|
|
41
|
+
${({ $containerStyle: t }) => t};
|
|
42
|
+
`, z = ({
|
|
43
|
+
invalidateRewardsHome: t,
|
|
44
|
+
openModal: $,
|
|
45
|
+
topOffset: h = 0,
|
|
46
|
+
userBadges: n,
|
|
47
|
+
currentScreenWidth: a,
|
|
48
|
+
handleScrollTo: f,
|
|
49
|
+
scrollPosition: x
|
|
50
|
+
}) => {
|
|
51
|
+
const {
|
|
52
|
+
badgeCategoryRefs: w,
|
|
53
|
+
categoryConfig: u,
|
|
54
|
+
currentSelectedBadgeType: y,
|
|
55
|
+
onTabClick: B,
|
|
56
|
+
scrollToTop: C,
|
|
57
|
+
showTabBar: c,
|
|
58
|
+
tabs: T,
|
|
59
|
+
totalBadgeCategories: b
|
|
60
|
+
} = O({
|
|
61
|
+
currentScreenWidth: a,
|
|
62
|
+
handleScrollTo: f,
|
|
63
|
+
scrollPosition: x,
|
|
64
|
+
userBadges: n
|
|
65
|
+
}), { badgeCategoryGap: I, badgeCategoryWidth: d, containerStyle: E, badgeWidth: k, maxBadgeNameLines: A } = u;
|
|
66
|
+
return /* @__PURE__ */ s(o, { $alignItems: "center", children: [
|
|
67
|
+
/* @__PURE__ */ e(
|
|
68
|
+
v,
|
|
69
|
+
{
|
|
70
|
+
$flexDirection: "row",
|
|
71
|
+
$background: "WHITE",
|
|
72
|
+
$visible: c,
|
|
73
|
+
$justifyContent: "center",
|
|
74
|
+
$width: a,
|
|
75
|
+
$topOffset: h,
|
|
76
|
+
children: /* @__PURE__ */ e(o, { $width: d, children: /* @__PURE__ */ e(
|
|
77
|
+
L,
|
|
78
|
+
{
|
|
79
|
+
tabs: T,
|
|
80
|
+
selectedTabId: y,
|
|
81
|
+
onTabClick: B,
|
|
82
|
+
currentScreenWidth: a
|
|
83
|
+
}
|
|
84
|
+
) })
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
/* @__PURE__ */ e(o, { $flexDirection: "row", $gap: 16, $width: d, children: /* @__PURE__ */ e(m, { $renderAs: "h5", children: "BADGES" }) }),
|
|
88
|
+
Object.keys(n).map((r, H) => {
|
|
89
|
+
const l = j[r];
|
|
90
|
+
return /* @__PURE__ */ e(
|
|
91
|
+
Y,
|
|
92
|
+
{
|
|
93
|
+
$backgroundColor: _[r] || "#FFFFFF",
|
|
94
|
+
$badgeCategoryGap: I,
|
|
95
|
+
$isLastCategory: H === b - 1,
|
|
96
|
+
ref: w[r],
|
|
97
|
+
children: /* @__PURE__ */ s(o, { $width: d, children: [
|
|
98
|
+
/* @__PURE__ */ s(o, { $flexDirection: "row", $flexGap: 8, $alignItems: "center", children: [
|
|
99
|
+
typeof l == "function" ? /* @__PURE__ */ e(l, {}) : null,
|
|
100
|
+
/* @__PURE__ */ e(m, { $renderAs: "eyebrow1", children: r })
|
|
101
|
+
] }),
|
|
102
|
+
/* @__PURE__ */ e(W, { $containerStyle: E, children: (n[r] || []).map((p) => {
|
|
103
|
+
const { id: D } = p || {};
|
|
104
|
+
return /* @__PURE__ */ e(
|
|
105
|
+
R,
|
|
106
|
+
{
|
|
107
|
+
...p,
|
|
108
|
+
category: r,
|
|
109
|
+
openModal: $,
|
|
110
|
+
badgeWidth: k,
|
|
111
|
+
maxBadgeNameLines: A,
|
|
112
|
+
invalidateRewardsHome: t
|
|
113
|
+
},
|
|
114
|
+
D
|
|
115
|
+
);
|
|
116
|
+
}) })
|
|
117
|
+
] })
|
|
118
|
+
},
|
|
119
|
+
r
|
|
120
|
+
);
|
|
121
|
+
}),
|
|
122
|
+
/* @__PURE__ */ e(
|
|
123
|
+
U,
|
|
124
|
+
{
|
|
125
|
+
$justifyContent: "center",
|
|
126
|
+
$alignItems: "center",
|
|
127
|
+
$showTabBar: c,
|
|
128
|
+
onClick: C,
|
|
129
|
+
children: /* @__PURE__ */ e(S, {})
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
] });
|
|
133
|
+
}, et = G(z);
|
|
134
|
+
export {
|
|
135
|
+
et as default
|
|
136
|
+
};
|
|
137
|
+
//# sourceMappingURL=student-badges-lists.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"student-badges-lists.js","sources":["../../../../src/features/wins-dashboard/student-badges/student-badges-lists.tsx"],"sourcesContent":["import type { Badge } from './mock/badges-list-mock';\nimport type { RuleSet } from 'styled-components';\n\nimport { memo } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport UpIcon from '../../../assets/line-icons/icons/up';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport { BADGE_TYPE_BACKGROUND, BADGE_TYPE_TAB_ICON } from '../constants';\nimport AnimatedTabBar from './animated-tabbar';\nimport useStudentBadgeListHook from './hooks/use-student-badge-list-hook';\nimport StudentBadge from './student-badge';\n\nconst HEADER_HEIGHT = 64;\nconst { innerHeight: windowHeight } = window;\n\nconst StudentBadgesContainer = styled(FlexView)<{\n $backgroundColor: string;\n $badgeCategoryGap: number;\n $isLastCategory: boolean;\n}>`\n width: 100%;\n background-color: ${({ $backgroundColor }) => $backgroundColor};\n padding: ${({ $badgeCategoryGap }) => $badgeCategoryGap}px 0;\n align-items: center;\n ${({ $isLastCategory }) =>\n $isLastCategory &&\n css`\n min-height: ${windowHeight - HEADER_HEIGHT}px;\n `}\n`;\n\nconst TabBarContainer = styled(FlexView)<{\n $topOffset: number;\n $width: number;\n $visible: boolean;\n}>`\n position: fixed;\n top: ${({ $topOffset }) => $topOffset}px;\n width: ${({ $width }) => $width}px;\n z-index: 1;\n transition: transform 200ms linear;\n transform: translateY(${({ $visible }) => ($visible ? HEADER_HEIGHT : 0)}px);\n`;\n\nconst ScrollTopButton = styled(FlexView)<{ $showTabBar: boolean }>`\n position: fixed;\n top: ${window.innerHeight - 100}px;\n right: 40px;\n width: 48px;\n height: 48px;\n border: 1px solid black;\n background: ${({ theme }) => theme.colors.WHITE};\n border-radius: 24px;\n cursor: pointer;\n opacity: ${({ $showTabBar }) => ($showTabBar ? 1 : 0)};\n transition: all 100ms linear;\n`;\n\nconst CustomRow = styled.div<{ $containerStyle: RuleSet<object> }>`\n display: grid;\n grid-row-gap: 16px;\n ${({ $containerStyle }) => $containerStyle};\n`;\n\ninterface StudentBadgeListProps {\n invalidateRewardsHome: () => void;\n openModal: (modal: string, props?: unknown) => void;\n topOffset?: number;\n userBadges: Record<string, Badge[]>;\n currentScreenWidth: number;\n handleScrollTo: (position: number) => void;\n scrollPosition: number;\n}\n\nconst StudentBadgeList = ({\n invalidateRewardsHome,\n openModal,\n topOffset = 0,\n userBadges,\n currentScreenWidth,\n handleScrollTo,\n scrollPosition,\n}: StudentBadgeListProps) => {\n const {\n badgeCategoryRefs,\n categoryConfig,\n currentSelectedBadgeType,\n onTabClick,\n scrollToTop,\n showTabBar,\n tabs,\n totalBadgeCategories,\n } = useStudentBadgeListHook({\n currentScreenWidth,\n handleScrollTo,\n scrollPosition,\n userBadges,\n });\n\n const { badgeCategoryGap, badgeCategoryWidth, containerStyle, badgeWidth, maxBadgeNameLines } =\n categoryConfig;\n\n return (\n <FlexView $alignItems=\"center\">\n <TabBarContainer\n $flexDirection=\"row\"\n $background=\"WHITE\"\n $visible={showTabBar}\n $justifyContent=\"center\"\n $width={currentScreenWidth}\n $topOffset={topOffset}\n >\n <FlexView $width={badgeCategoryWidth}>\n <AnimatedTabBar\n tabs={tabs}\n selectedTabId={currentSelectedBadgeType}\n onTabClick={onTabClick}\n currentScreenWidth={currentScreenWidth}\n />\n </FlexView>\n </TabBarContainer>\n <FlexView $flexDirection=\"row\" $gap={16} $width={badgeCategoryWidth}>\n <Text $renderAs=\"h5\">BADGES</Text>\n </FlexView>\n {Object.keys(userBadges).map((badge, index) => {\n const BadgeCategoryIcon = BADGE_TYPE_TAB_ICON[badge];\n\n return (\n <StudentBadgesContainer\n key={badge}\n $backgroundColor={BADGE_TYPE_BACKGROUND[badge] || '#FFFFFF'}\n $badgeCategoryGap={badgeCategoryGap}\n $isLastCategory={index === totalBadgeCategories - 1}\n ref={badgeCategoryRefs[badge]}\n >\n <FlexView $width={badgeCategoryWidth}>\n <FlexView $flexDirection=\"row\" $flexGap={8} $alignItems=\"center\">\n {typeof BadgeCategoryIcon === 'function' ? <BadgeCategoryIcon /> : null}\n <Text $renderAs=\"eyebrow1\">{badge}</Text>\n </FlexView>\n <CustomRow $containerStyle={containerStyle}>\n {(userBadges[badge] || []).map(badgeProps => {\n const { id: studentBadgeId } = badgeProps || {};\n\n return (\n <StudentBadge\n key={studentBadgeId}\n {...badgeProps}\n category={badge}\n openModal={openModal}\n badgeWidth={badgeWidth}\n maxBadgeNameLines={maxBadgeNameLines}\n invalidateRewardsHome={invalidateRewardsHome}\n />\n );\n })}\n </CustomRow>\n </FlexView>\n </StudentBadgesContainer>\n );\n })}\n <ScrollTopButton\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $showTabBar={showTabBar}\n onClick={scrollToTop}\n >\n <UpIcon />\n </ScrollTopButton>\n </FlexView>\n );\n};\n\nexport default memo(StudentBadgeList);\n"],"names":["HEADER_HEIGHT","windowHeight","StudentBadgesContainer","styled","FlexView","$backgroundColor","$badgeCategoryGap","$isLastCategory","css","TabBarContainer","$topOffset","$width","$visible","ScrollTopButton","theme","$showTabBar","CustomRow","$containerStyle","StudentBadgeList","invalidateRewardsHome","openModal","topOffset","userBadges","currentScreenWidth","handleScrollTo","scrollPosition","badgeCategoryRefs","categoryConfig","currentSelectedBadgeType","onTabClick","scrollToTop","showTabBar","tabs","totalBadgeCategories","useStudentBadgeListHook","badgeCategoryGap","badgeCategoryWidth","containerStyle","badgeWidth","maxBadgeNameLines","jsxs","jsx","AnimatedTabBar","Text","badge","index","BadgeCategoryIcon","BADGE_TYPE_TAB_ICON","BADGE_TYPE_BACKGROUND","badgeProps","studentBadgeId","StudentBadge","UpIcon","studentBadgesLists","memo"],"mappings":";;;;;;;;;;AAcA,MAAMA,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