@cuemath/leap 3.5.30-as8 → 3.5.30-gg2
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 +0 -11
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/images/images.js +0 -8
- package/dist/assets/images/images.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapter-item/chapter-circular-progress/chapter-circular-progress.js +3 -3
- package/dist/features/chapters/chapters-list/chapter-item/chapter-circular-progress/chapter-circular-progress.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel-styled.js +32 -16
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel-styled.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js +87 -88
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/swipable-component/swipeable-component-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/swipable-component/swipeable-component.js +26 -0
- package/dist/features/circle-games/game-launcher/comps/swipable-component/swipeable-component.js.map +1 -0
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +35 -35
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -1
- package/dist/features/stickers/hooks/use-handle-sticker-send/use-handle-sticker-send.js +1 -0
- package/dist/features/stickers/hooks/use-handle-sticker-send/use-handle-sticker-send.js.map +1 -1
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js.map +1 -1
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js +11 -11
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js.map +1 -1
- package/dist/features/worksheet/user-pointer-pin/hooks/use-user-location.js +21 -20
- package/dist/features/worksheet/user-pointer-pin/hooks/use-user-location.js.map +1 -1
- package/dist/features/worksheet/user-pointer-pin/user-pin.js +37 -35
- package/dist/features/worksheet/user-pointer-pin/user-pin.js.map +1 -1
- package/dist/features/worksheet/worksheet/hooks/use-active-question-observer.js +59 -0
- package/dist/features/worksheet/worksheet/hooks/use-active-question-observer.js.map +1 -0
- package/dist/features/worksheet/worksheet/hooks/use-create-imperative-handle.js +132 -132
- package/dist/features/worksheet/worksheet/hooks/use-create-imperative-handle.js.map +1 -1
- package/dist/features/worksheet/worksheet/hooks/use-time-on-questions.js +24 -19
- package/dist/features/worksheet/worksheet/hooks/use-time-on-questions.js.map +1 -1
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-store.js +13 -0
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-store.js.map +1 -0
- package/dist/features/worksheet/worksheet/question-tips.js +48 -47
- package/dist/features/worksheet/worksheet/question-tips.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-action-bar/worksheet-action-bar.js +88 -132
- package/dist/features/worksheet/worksheet/worksheet-action-bar/worksheet-action-bar.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-blocker/worksheet-blocker-view.js +68 -0
- package/dist/features/worksheet/worksheet/worksheet-blocker/worksheet-blocker-view.js.map +1 -0
- package/dist/features/worksheet/worksheet/worksheet-blocker/worksheet-blocker.js +44 -55
- package/dist/features/worksheet/worksheet/worksheet-blocker/worksheet-blocker.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-calculator/worksheet-calculator.js +17 -0
- package/dist/features/worksheet/worksheet/worksheet-calculator/worksheet-calculator.js.map +1 -0
- package/dist/features/worksheet/worksheet/worksheet-helpers.js +109 -112
- package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-item-navigation/worksheet-item-navigation.js +25 -27
- package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-item-navigation/worksheet-item-navigation.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-item-number/worksheet-item-number.js +47 -47
- package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-item-number/worksheet-item-number.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-navigation.js +66 -64
- package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-navigation.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-section-navigation/worksheet-section-navigation.js +38 -40
- package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-section-navigation/worksheet-section-navigation.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-nudge-banner/worksheet-nudge-banner-styled.js +20 -0
- package/dist/features/worksheet/worksheet/worksheet-nudge-banner/worksheet-nudge-banner-styled.js.map +1 -0
- package/dist/features/worksheet/worksheet/worksheet-nudge-banner/worksheet-nudge-banner.js +49 -0
- package/dist/features/worksheet/worksheet/worksheet-nudge-banner/worksheet-nudge-banner.js.map +1 -0
- package/dist/features/worksheet/worksheet/worksheet-permissions/error.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-provider.js +20 -0
- package/dist/features/worksheet/worksheet/worksheet-provider.js.map +1 -0
- package/dist/features/worksheet/worksheet/worksheet-question/header/header.js +73 -71
- package/dist/features/worksheet/worksheet/worksheet-question/header/header.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +61 -59
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/subjective-review.js +21 -18
- package/dist/features/worksheet/worksheet/worksheet-question/subjective-review.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +269 -272
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions/worksheet-questions-styled.js +16 -0
- package/dist/features/worksheet/worksheet/worksheet-questions/worksheet-questions-styled.js.map +1 -0
- package/dist/features/worksheet/worksheet/worksheet-questions/worksheet-questions.js +73 -0
- package/dist/features/worksheet/worksheet/worksheet-questions/worksheet-questions.js.map +1 -0
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/scribble-switch.js +32 -31
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/scribble-switch.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/use-handler-callbacks.js +147 -149
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/use-handler-callbacks.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +212 -223
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-summary/worksheet-questions-summary.js +22 -20
- package/dist/features/worksheet/worksheet/worksheet-questions-summary/worksheet-questions-summary.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-sidebar/question-guide.js +57 -55
- package/dist/features/worksheet/worksheet/worksheet-sidebar/question-guide.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-sidebar/sidebar.js +47 -42
- package/dist/features/worksheet/worksheet/worksheet-sidebar/sidebar.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-store.js +293 -0
- package/dist/features/worksheet/worksheet/worksheet-store.js.map +1 -0
- package/dist/features/worksheet/worksheet/worksheet-styled.js +24 -34
- package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-summary/worksheet-summary.js +16 -12
- package/dist/features/worksheet/worksheet/worksheet-summary/worksheet-summary.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-summary-controller/worksheet-summary-controller.js +8 -7
- package/dist/features/worksheet/worksheet/worksheet-summary-controller/worksheet-summary-controller.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-view.js +141 -0
- package/dist/features/worksheet/worksheet/worksheet-view.js.map +1 -0
- package/dist/features/worksheet/worksheet/worksheet.js +203 -441
- package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js.map +1 -1
- package/dist/index.d.ts +26 -271
- package/dist/index.js +451 -465
- package/dist/index.js.map +1 -1
- package/dist/node_modules/zustand/esm/middleware.js +196 -0
- package/dist/node_modules/zustand/esm/middleware.js.map +1 -0
- package/dist/node_modules/zustand/esm/react/shallow.js +13 -0
- package/dist/node_modules/zustand/esm/react/shallow.js.map +1 -0
- package/dist/node_modules/zustand/esm/vanilla/shallow.js +31 -0
- package/dist/node_modules/zustand/esm/vanilla/shallow.js.map +1 -0
- package/package.json +3 -2
- package/dist/assets/line-icons/icons/carat-right.js +0 -26
- package/dist/assets/line-icons/icons/carat-right.js.map +0 -1
- package/dist/features/timeline/monthly-report/api/use-monthly-report-get.js +0 -13
- package/dist/features/timeline/monthly-report/api/use-monthly-report-get.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/achievements/achievements.js +0 -60
- package/dist/features/timeline/monthly-report/comps/achievements/achievements.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/achievements/achievements.styled.js +0 -15
- package/dist/features/timeline/monthly-report/comps/achievements/achievements.styled.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.js +0 -128
- package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.styled.js +0 -53
- package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.styled.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.js +0 -120
- package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.styled.js +0 -58
- package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.styled.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/activities/activities.js +0 -27
- package/dist/features/timeline/monthly-report/comps/activities/activities.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/activities/constants.js +0 -95
- package/dist/features/timeline/monthly-report/comps/activities/constants.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/activities/utils.js +0 -15
- package/dist/features/timeline/monthly-report/comps/activities/utils.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-constants.js +0 -29
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-constants.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-utils.js +0 -94
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-utils.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.js +0 -44
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.styled.js +0 -39
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.styled.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/attendance/attendence-view.js +0 -52
- package/dist/features/timeline/monthly-report/comps/attendance/attendence-view.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/feedback/feedback-styled.js +0 -9
- package/dist/features/timeline/monthly-report/comps/feedback/feedback-styled.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/feedback/feedback.js +0 -94
- package/dist/features/timeline/monthly-report/comps/feedback/feedback.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goal-chapter-card.js +0 -48
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goal-chapter-card.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card-styled.js +0 -28
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card-styled.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card.js +0 -113
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/goals/goals-constants.js +0 -30
- package/dist/features/timeline/monthly-report/comps/goals/goals-constants.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/goals/goals.js +0 -22
- package/dist/features/timeline/monthly-report/comps/goals/goals.js.map +0 -1
- package/dist/features/timeline/monthly-report/monthly-report-styled.js +0 -14
- package/dist/features/timeline/monthly-report/monthly-report-styled.js.map +0 -1
- package/dist/features/timeline/monthly-report/monthly-report-types.js +0 -5
- package/dist/features/timeline/monthly-report/monthly-report-types.js.map +0 -1
- package/dist/features/timeline/monthly-report/monthly-report.js +0 -69
- package/dist/features/timeline/monthly-report/monthly-report.js.map +0 -1
- package/dist/features/timeline/monthly-timeline/api/use-monthly-timeline-get.js +0 -10
- package/dist/features/timeline/monthly-timeline/api/use-monthly-timeline-get.js.map +0 -1
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.js +0 -87
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.js.map +0 -1
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.styled.js +0 -9
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.styled.js.map +0 -1
- package/dist/features/timeline/monthly-timeline/constants.js +0 -41
- package/dist/features/timeline/monthly-timeline/constants.js.map +0 -1
- package/dist/features/timeline/monthly-timeline/monthly-timeline-styled.js +0 -9
- package/dist/features/timeline/monthly-timeline/monthly-timeline-styled.js.map +0 -1
- package/dist/features/timeline/monthly-timeline/monthly-timeline-types.js +0 -6
- package/dist/features/timeline/monthly-timeline/monthly-timeline-types.js.map +0 -1
- package/dist/features/timeline/monthly-timeline/monthly-timeline-view.js +0 -28
- package/dist/features/timeline/monthly-timeline/monthly-timeline-view.js.map +0 -1
- package/dist/features/timeline/monthly-timeline/monthly-timeline.js +0 -56
- package/dist/features/timeline/monthly-timeline/monthly-timeline.js.map +0 -1
- package/dist/features/timeline/ptm-report/api/use-ptm-report-get.js +0 -9
- package/dist/features/timeline/ptm-report/api/use-ptm-report-get.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/key-need/key-need-styled.js +0 -9
- package/dist/features/timeline/ptm-report/comps/key-need/key-need-styled.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/key-need/key-need.js +0 -35
- package/dist/features/timeline/ptm-report/comps/key-need/key-need.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/parent-support/parent-support.js +0 -53
- package/dist/features/timeline/ptm-report/comps/parent-support/parent-support.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/real-world-projects/real-world-projects-styled.js +0 -19
- package/dist/features/timeline/ptm-report/comps/real-world-projects/real-world-projects-styled.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/real-world-projects/real-world-projects.js +0 -50
- package/dist/features/timeline/ptm-report/comps/real-world-projects/real-world-projects.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/report-card/report-card-styled.js +0 -9
- package/dist/features/timeline/ptm-report/comps/report-card/report-card-styled.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/report-card/report-card.js +0 -22
- package/dist/features/timeline/ptm-report/comps/report-card/report-card.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/school-support/school-support-styled.js +0 -9
- package/dist/features/timeline/ptm-report/comps/school-support/school-support-styled.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/school-support/school-support.js +0 -84
- package/dist/features/timeline/ptm-report/comps/school-support/school-support.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/strategies/strategies-constant.js +0 -11
- package/dist/features/timeline/ptm-report/comps/strategies/strategies-constant.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/strategies/strategies.js +0 -36
- package/dist/features/timeline/ptm-report/comps/strategies/strategies.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/strategy-card/strategy-card-styled.js +0 -55
- package/dist/features/timeline/ptm-report/comps/strategy-card/strategy-card-styled.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/strategy-card/strategy-card.js +0 -35
- package/dist/features/timeline/ptm-report/comps/strategy-card/strategy-card.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/student-info/student-info-styled.js +0 -21
- package/dist/features/timeline/ptm-report/comps/student-info/student-info-styled.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/student-info/student-info.js +0 -21
- package/dist/features/timeline/ptm-report/comps/student-info/student-info.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/support-card/support-card-styled.js +0 -9
- package/dist/features/timeline/ptm-report/comps/support-card/support-card-styled.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/support-card/support-card.js +0 -30
- package/dist/features/timeline/ptm-report/comps/support-card/support-card.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/teacher-observations/teacher-observations-constant.js +0 -9
- package/dist/features/timeline/ptm-report/comps/teacher-observations/teacher-observations-constant.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/teacher-observations/teacher-observations.js +0 -56
- package/dist/features/timeline/ptm-report/comps/teacher-observations/teacher-observations.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/upcoming-chapters/upcoming-chapters.js +0 -15
- package/dist/features/timeline/ptm-report/comps/upcoming-chapters/upcoming-chapters.js.map +0 -1
- package/dist/features/timeline/ptm-report/ptm-report-constants.js +0 -16
- package/dist/features/timeline/ptm-report/ptm-report-constants.js.map +0 -1
- package/dist/features/timeline/ptm-report/ptm-report-helpers.js +0 -8
- package/dist/features/timeline/ptm-report/ptm-report-helpers.js.map +0 -1
- package/dist/features/timeline/ptm-report/ptm-report-styled.js +0 -11
- package/dist/features/timeline/ptm-report/ptm-report-styled.js.map +0 -1
- package/dist/features/timeline/ptm-report/ptm-report-types.js +0 -5
- package/dist/features/timeline/ptm-report/ptm-report-types.js.map +0 -1
- package/dist/features/timeline/ptm-report/ptm-report.js +0 -113
- package/dist/features/timeline/ptm-report/ptm-report.js.map +0 -1
- package/dist/features/timeline/timeline-tabs/timeline-tabs-types.js +0 -5
- package/dist/features/timeline/timeline-tabs/timeline-tabs-types.js.map +0 -1
- package/dist/features/timeline/timeline-tabs/timeline-tabs.js +0 -41
- package/dist/features/timeline/timeline-tabs/timeline-tabs.js.map +0 -1
- package/dist/features/timeline/timeline-tabs/timeline-tabs.styled.js +0 -37
- package/dist/features/timeline/timeline-tabs/timeline-tabs.styled.js.map +0 -1
- package/dist/features/ui/swipable-carousel/swipable-carousel-styled.js +0 -57
- package/dist/features/ui/swipable-carousel/swipable-carousel-styled.js.map +0 -1
- package/dist/features/ui/swipable-carousel/swipable-carousel.js +0 -132
- package/dist/features/ui/swipable-carousel/swipable-carousel.js.map +0 -1
- package/dist/features/ui/swipeable-component/swipeable-component-styled.js.map +0 -1
- package/dist/features/ui/swipeable-component/swipeable-component.js +0 -27
- package/dist/features/ui/swipeable-component/swipeable-component.js.map +0 -1
- package/dist/features/worksheet/worksheet/hooks/use-get-active-question-id.js +0 -62
- package/dist/features/worksheet/worksheet/hooks/use-get-active-question-id.js.map +0 -1
- package/dist/features/worksheet/worksheet/worksheet-container.js +0 -87
- package/dist/features/worksheet/worksheet/worksheet-container.js.map +0 -1
- package/dist/static/2021.0683b580.png +0 -0
- package/dist/static/2022.d34ad7a5.png +0 -0
- package/dist/static/2023.fce87149.png +0 -0
- package/dist/static/2024.a275ee85.png +0 -0
- package/dist/static/2025.677cc187.png +0 -0
- package/dist/static/2026.63763214.png +0 -0
- package/dist/static/2027.b82dc039.png +0 -0
- package/dist/static/2028.580b8cc0.png +0 -0
- package/dist/static/coding-report-icon.91a1e900.svg +0 -1
- package/dist/static/elp-icon.d45b457d.svg +0 -1
- package/dist/static/english-icon.50c2e005.svg +0 -1
- package/dist/static/full-report.00112c74.svg +0 -1
- package/dist/static/math-fit-grey.c32f37b3.svg +0 -1
- package/dist/static/no-report.4158fad3.svg +0 -1
- package/dist/static/ptm-report-icon.5089218f.svg +0 -1
- package/dist/static/sat-report-icon.4331be86.svg +0 -1
- package/dist/static/science-report-icon.a0014c40.svg +0 -1
- package/dist/static/thumps-down.a1192a62.svg +0 -1
- package/dist/static/thumps-up.caa35a98.svg +0 -1
- /package/dist/features/{ui/swipeable-component → circle-games/game-launcher/comps/swipable-component}/swipeable-component-styled.js +0 -0
package/dist/features/circle-games/game-launcher/comps/swipable-component/swipeable-component.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import { memo as T, useRef as l, useCallback as o } from "react";
|
|
3
|
+
import { SwipeableWrapper as X } from "./swipeable-component-styled.js";
|
|
4
|
+
const C = T(
|
|
5
|
+
({ onSwipeLeft: t, onSwipeRight: a, minSwipeDistance: e = 50, children: m }) => {
|
|
6
|
+
const s = l(0), n = l(0), u = o(() => {
|
|
7
|
+
const r = s.current - n.current;
|
|
8
|
+
Math.abs(r) < e || (r > 0 ? t == null || t() : a == null || a());
|
|
9
|
+
}, [e, t, a]), d = o((r) => {
|
|
10
|
+
var c;
|
|
11
|
+
s.current = ((c = r.changedTouches[0]) == null ? void 0 : c.clientX) || 0;
|
|
12
|
+
}, []), b = o(
|
|
13
|
+
(r) => {
|
|
14
|
+
var c;
|
|
15
|
+
n.current = ((c = r.changedTouches[0]) == null ? void 0 : c.clientX) || 0, u();
|
|
16
|
+
},
|
|
17
|
+
[u]
|
|
18
|
+
);
|
|
19
|
+
return /* @__PURE__ */ h(X, { onTouchStart: d, onTouchEnd: b, children: m });
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
C.displayName = "SwipeableComponent";
|
|
23
|
+
export {
|
|
24
|
+
C as default
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=swipeable-component.js.map
|
package/dist/features/circle-games/game-launcher/comps/swipable-component/swipeable-component.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swipeable-component.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/swipable-component/swipeable-component.tsx"],"sourcesContent":["import { useRef, useCallback, memo } from 'react';\n\nimport * as Styled from './swipeable-component-styled';\nimport { type ISwipeableComponentProps } from './swipeable-component-types';\n\nconst SwipeableComponent: React.FC<ISwipeableComponentProps> = memo(\n ({ onSwipeLeft, onSwipeRight, minSwipeDistance = 50, children }) => {\n const touchStartX = useRef(0);\n const touchEndX = useRef(0);\n\n const handleSwipe = useCallback(() => {\n const distance = touchStartX.current - touchEndX.current;\n\n if (Math.abs(distance) < minSwipeDistance) return;\n\n if (distance > 0) {\n onSwipeLeft?.();\n } else {\n onSwipeRight?.();\n }\n }, [minSwipeDistance, onSwipeLeft, onSwipeRight]);\n\n const onTouchStart = useCallback((e: React.TouchEvent) => {\n touchStartX.current = e.changedTouches[0]?.clientX || 0;\n }, []);\n\n const onTouchEnd = useCallback(\n (e: React.TouchEvent) => {\n touchEndX.current = e.changedTouches[0]?.clientX || 0;\n handleSwipe();\n },\n [handleSwipe],\n );\n\n return (\n <Styled.SwipeableWrapper onTouchStart={onTouchStart} onTouchEnd={onTouchEnd}>\n {children}\n </Styled.SwipeableWrapper>\n );\n },\n);\n\nSwipeableComponent.displayName = 'SwipeableComponent';\n\nexport default SwipeableComponent;\n"],"names":["SwipeableComponent","memo","onSwipeLeft","onSwipeRight","minSwipeDistance","children","touchStartX","useRef","touchEndX","handleSwipe","useCallback","distance","onTouchStart","e","_a","onTouchEnd","Styled.SwipeableWrapper"],"mappings":";;;AAKA,MAAMA,IAAyDC;AAAA,EAC7D,CAAC,EAAE,aAAAC,GAAa,cAAAC,GAAc,kBAAAC,IAAmB,IAAI,UAAAC,QAAe;AAC5D,UAAAC,IAAcC,EAAO,CAAC,GACtBC,IAAYD,EAAO,CAAC,GAEpBE,IAAcC,EAAY,MAAM;AAC9B,YAAAC,IAAWL,EAAY,UAAUE,EAAU;AAEjD,MAAI,KAAK,IAAIG,CAAQ,IAAIP,MAErBO,IAAW,IACCT,KAAA,QAAAA,MAECC,KAAA,QAAAA;AAAA,IAEhB,GAAA,CAACC,GAAkBF,GAAaC,CAAY,CAAC,GAE1CS,IAAeF,EAAY,CAACG,MAAwB;;AACxD,MAAAP,EAAY,YAAUQ,IAAAD,EAAE,eAAe,CAAC,MAAlB,gBAAAC,EAAqB,YAAW;AAAA,IACxD,GAAG,CAAE,CAAA,GAECC,IAAaL;AAAA,MACjB,CAACG,MAAwB;;AACvB,QAAAL,EAAU,YAAUM,IAAAD,EAAE,eAAe,CAAC,MAAlB,gBAAAC,EAAqB,YAAW,GACxCL;MACd;AAAA,MACA,CAACA,CAAW;AAAA,IAAA;AAGd,6BACGO,GAAA,EAAwB,cAAAJ,GAA4B,YAAAG,GAClD,UAAAV,EACH,CAAA;AAAA,EAEJ;AACF;AAEAL,EAAmB,cAAc;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as N, useCallback as f, useMemo as J, useEffect as X } from "react";
|
|
3
3
|
import { useTheme as $ } from "styled-components";
|
|
4
4
|
import { PLATFORM_EVENTS_STUDENT as B } from "../../../../analytics-events/platform-events-student.js";
|
|
@@ -9,35 +9,35 @@ import A from "../../../../ui/text/text.js";
|
|
|
9
9
|
import { EDeviceType as Q } from "../../../../ui/theme/constants.js";
|
|
10
10
|
import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as S } from "../../../enum/circle-onboarding-steps.js";
|
|
11
11
|
import { CircularGameCard as D } from "../../comps/circular-game-card/circular-game-card.js";
|
|
12
|
-
import j from "
|
|
12
|
+
import j from "../../comps/swipable-component/swipeable-component.js";
|
|
13
13
|
import { SHOW_NUDGE_AFTER_MS as V, SLIDE_TO_LESSON_MS as ee } from "./constants.js";
|
|
14
|
-
import { SwipableArea as
|
|
15
|
-
import { CarouselIndicator as
|
|
16
|
-
import { ProjectType as
|
|
14
|
+
import { SwipableArea as te } from "./use-game-launcher-journey-style.js";
|
|
15
|
+
import { CarouselIndicator as re } from "../../comps/carousel/carousel-indicator/carousel-indicator.js";
|
|
16
|
+
import { ProjectType as n } from "../../../games/web-view/enums/project-type-enum.js";
|
|
17
17
|
const Se = ({
|
|
18
18
|
carouselRefs: o,
|
|
19
19
|
onSegmentClick: d,
|
|
20
20
|
onJourneyComplete: a
|
|
21
21
|
}) => {
|
|
22
22
|
const { device: W } = $(), l = W <= Q.TABLET, L = N([]), c = N(null), C = N(null), { nextCoachmark: u, setJourney: _, endJourney: h } = K(), { onEvent: p } = q(), E = f(
|
|
23
|
-
(
|
|
23
|
+
(r) => {
|
|
24
24
|
p(B.ONBOARDING_STEP_COMPLETED, {
|
|
25
|
-
step:
|
|
25
|
+
step: r
|
|
26
26
|
});
|
|
27
27
|
},
|
|
28
28
|
[p]
|
|
29
29
|
), O = f(
|
|
30
|
-
(
|
|
31
|
-
d(
|
|
30
|
+
(r, e) => {
|
|
31
|
+
d(r, n.PUZZLE), E(S.PUZZLE_ACTIVITY), h(e), a(e);
|
|
32
32
|
},
|
|
33
33
|
[h, a, d, E]
|
|
34
34
|
), y = f(
|
|
35
|
-
(
|
|
36
|
-
d(
|
|
35
|
+
(r, e) => {
|
|
36
|
+
d(r, n.LESSON), E(S.SKILL_ACTIVITY), h(e), a(e);
|
|
37
37
|
},
|
|
38
38
|
[h, a, d, E]
|
|
39
39
|
), R = f(
|
|
40
|
-
(
|
|
40
|
+
(r, e) => {
|
|
41
41
|
var G, w, x, P, U, Y, Z, k, H, M, z;
|
|
42
42
|
const T = (G = o.current) == null ? void 0 : G.indicatorRefs, s = ((x = (w = c.current) == null ? void 0 : w.circularCardWrapperRef.current) == null ? void 0 : x.getBoundingClientRect()) || {
|
|
43
43
|
height: 0,
|
|
@@ -49,56 +49,56 @@ const Se = ({
|
|
|
49
49
|
(P = e == null ? void 0 : e.games) != null && P.data.length && ((U = e == null ? void 0 : e.puzzles) != null && U.data.length) && g.push(
|
|
50
50
|
{
|
|
51
51
|
projectData: e.games.data[0],
|
|
52
|
-
type:
|
|
52
|
+
type: n.GAME
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
projectData: e.puzzles.data[0],
|
|
56
|
-
type:
|
|
56
|
+
type: n.PUZZLE
|
|
57
57
|
}
|
|
58
58
|
), (Y = e == null ? void 0 : e.lessons) != null && Y.data.length && g.push(
|
|
59
|
-
{ projectData: e.lessons.data[0], type:
|
|
60
|
-
{ projectData: e.lessons.data[1], type:
|
|
59
|
+
{ projectData: e.lessons.data[0], type: n.LESSON },
|
|
60
|
+
{ projectData: e.lessons.data[1], type: n.LESSON }
|
|
61
61
|
);
|
|
62
|
-
const
|
|
62
|
+
const t = g[1];
|
|
63
63
|
p(B.ONBOARDING_STEP_VIEWED, {
|
|
64
|
-
step: ((Z = g[0]) == null ? void 0 : Z.type) ===
|
|
64
|
+
step: ((Z = g[0]) == null ? void 0 : Z.type) === n.LESSON ? S.SKILL_ACTIVITY : S.GAMES_ACTIVITY
|
|
65
65
|
});
|
|
66
66
|
const F = [
|
|
67
67
|
l ? {
|
|
68
68
|
originalElementToHighlightRef: c.current.circularCardWrapperRef,
|
|
69
69
|
type: I.NUDGE,
|
|
70
|
-
elementToHighlight: /* @__PURE__ */
|
|
70
|
+
elementToHighlight: /* @__PURE__ */ i(
|
|
71
71
|
j,
|
|
72
72
|
{
|
|
73
73
|
onSwipeLeft: () => {
|
|
74
74
|
var m;
|
|
75
|
-
(m = o.current) == null || m.goToIndex(1), u(
|
|
75
|
+
(m = o.current) == null || m.goToIndex(1), u(r, !1, V);
|
|
76
76
|
},
|
|
77
|
-
children: /* @__PURE__ */
|
|
77
|
+
children: /* @__PURE__ */ i(te, {})
|
|
78
78
|
}
|
|
79
79
|
),
|
|
80
80
|
indicator: {
|
|
81
81
|
nudge: "swipe",
|
|
82
|
-
content: /* @__PURE__ */
|
|
82
|
+
content: /* @__PURE__ */ i(A, { $renderAs: "ab2-bold", children: "Swipe to explore" }),
|
|
83
83
|
nudgePointerX: s.width / 2 - 30,
|
|
84
84
|
nudgePointerY: s.height / 2
|
|
85
85
|
}
|
|
86
86
|
} : {
|
|
87
87
|
originalElementToHighlightRef: T[1],
|
|
88
88
|
type: I.NUDGE,
|
|
89
|
-
elementToHighlight: /* @__PURE__ */
|
|
90
|
-
|
|
89
|
+
elementToHighlight: /* @__PURE__ */ i(
|
|
90
|
+
re,
|
|
91
91
|
{
|
|
92
92
|
textToShowInsideIndicator: "2",
|
|
93
93
|
onClick: () => {
|
|
94
94
|
var m;
|
|
95
|
-
(m = o.current) == null || m.goToIndex(1), u(
|
|
95
|
+
(m = o.current) == null || m.goToIndex(1), u(r, !1, V);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
),
|
|
99
99
|
indicator: {
|
|
100
100
|
nudge: "click",
|
|
101
|
-
content: /* @__PURE__ */
|
|
101
|
+
content: /* @__PURE__ */ i(A, { $renderAs: "ab1-bold", children: "Click to proceed" }),
|
|
102
102
|
nudgePointerX: 0,
|
|
103
103
|
nudgePointerY: 0
|
|
104
104
|
}
|
|
@@ -106,32 +106,32 @@ const Se = ({
|
|
|
106
106
|
{
|
|
107
107
|
originalElementToHighlightRef: C.current.circularCardWrapperRef,
|
|
108
108
|
type: I.NUDGE,
|
|
109
|
-
elementToHighlight: /* @__PURE__ */
|
|
109
|
+
elementToHighlight: /* @__PURE__ */ i(
|
|
110
110
|
D,
|
|
111
111
|
{
|
|
112
112
|
label: "",
|
|
113
113
|
data: {
|
|
114
|
-
card: ((k =
|
|
115
|
-
name: ((H =
|
|
114
|
+
card: ((k = t == null ? void 0 : t.projectData) == null ? void 0 : k.cardLottie) ?? "",
|
|
115
|
+
name: ((H = t == null ? void 0 : t.projectData) == null ? void 0 : H.name) ?? "",
|
|
116
116
|
isCompleted: !1,
|
|
117
|
-
displayNameImage: (M =
|
|
117
|
+
displayNameImage: (M = t == null ? void 0 : t.projectData) == null ? void 0 : M.displayNameImage,
|
|
118
118
|
onPress: () => {
|
|
119
|
-
(
|
|
119
|
+
(t == null ? void 0 : t.type) === n.LESSON && y(t.projectData, r), (t == null ? void 0 : t.type) === n.PUZZLE && O(t.projectData, r);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
),
|
|
124
124
|
indicator: {
|
|
125
125
|
nudge: "click",
|
|
126
|
-
content: /* @__PURE__ */
|
|
126
|
+
content: /* @__PURE__ */ i(A, { $renderAs: l ? "ab2-bold" : "ab1-bold", children: l ? "Tap to start" : " Click to start" }),
|
|
127
127
|
nudgePointerX: l ? s.width / 2 : s.width / 1.3,
|
|
128
128
|
nudgePointerY: l ? s.height / 2 : s.height / 1.3
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
];
|
|
132
|
-
_(
|
|
132
|
+
_(r, F), (z = o.current) == null || z.goToIndex(0);
|
|
133
133
|
const b = setTimeout(() => {
|
|
134
|
-
clearTimeout(b), u(
|
|
134
|
+
clearTimeout(b), u(r);
|
|
135
135
|
}, ee);
|
|
136
136
|
L.current.push(b);
|
|
137
137
|
},
|
|
@@ -153,7 +153,7 @@ const Se = ({
|
|
|
153
153
|
[R]
|
|
154
154
|
);
|
|
155
155
|
return X(() => () => {
|
|
156
|
-
L.current.forEach((
|
|
156
|
+
L.current.forEach((r) => clearTimeout(r)), L.current = [];
|
|
157
157
|
}, [o]), v;
|
|
158
158
|
};
|
|
159
159
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-game-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport {\n PLATFORM_EVENTS_STUDENT as AnalyticsLabel,\n PLATFORM_EVENTS_STUDENT,\n} from '../../../../analytics-events/platform-events-student';\nimport { type JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport type { TCoachmarkJourneyProps } from '../../../../journey/use-journey/journey-context-types';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport { useUIContext } from '../../../../ui/context/context';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport Text from '../../../../ui/text/text';\nimport { EDeviceType } from '../../../../ui/theme/constants';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as ActionEvent } from '../../../enum/circle-onboarding-steps';\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { CircularGameCard } from '../../comps/circular-game-card/circular-game-card';\nimport { type ICircularGameCardRefs } from '../../comps/circular-game-card/circular-game-card-types';\nimport SwipeableCard from '../../../../ui/swipeable-component/swipeable-component';\nimport type {\n Lesson,\n Puzzle,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport { type IProjectData } from '../../game-launcher-types';\nimport { SHOW_NUDGE_AFTER_MS, SLIDE_TO_LESSON_MS } from './constants';\nimport type { IUseGameLauncherJourneyProps } from './use-game-launcher-journey-types';\nimport { SwipableArea } from './use-game-launcher-journey-style';\nimport { CarouselIndicator } from '../../comps/carousel/carousel-indicator/carousel-indicator';\n\nexport const useGameLauncherJourney = ({\n carouselRefs,\n onSegmentClick,\n onJourneyComplete,\n}: IUseGameLauncherJourneyProps) => {\n const { device } = useTheme();\n const isCompact = device <= EDeviceType.TABLET;\n\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const firstCardRefs = useRef<ICircularGameCardRefs>(null);\n const secondCardRefs = useRef<ICircularGameCardRefs>(null);\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const trackEventCompleted = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_COMPLETED, {\n step,\n });\n },\n [trackAnalytics],\n );\n\n const handleEndJourneyForPuzzle = useCallback(\n (puzzlesData: Puzzle, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(puzzlesData, ProjectType.PUZZLE);\n trackEventCompleted(ActionEvent.PUZZLE_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const handleEndJourneyForLesson = useCallback(\n (lessonsData: Lesson, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(lessonsData, ProjectType.LESSON);\n trackEventCompleted(ActionEvent.SKILL_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const startJourney = useCallback(\n (journeyId: JOURNEY_ID_STUDENT, projectData?: IProjectData) => {\n const paginationList = carouselRefs.current?.indicatorRefs;\n\n const launcherDims =\n firstCardRefs.current?.circularCardWrapperRef.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n // Exit early if required refs or data are missing\n if (paginationList?.length < 2 || !secondCardRefs.current || !firstCardRefs.current) {\n return;\n }\n\n // prepare journey projects based on the data available as\n // games and puzzles are not aviailbale for K-1\n const journeyProjectsData = [];\n\n if (projectData?.games?.data.length && projectData?.puzzles?.data.length) {\n journeyProjectsData.push(\n {\n projectData: projectData.games.data[0],\n type: ProjectType.GAME,\n },\n {\n projectData: projectData.puzzles.data[0],\n type: ProjectType.PUZZLE,\n },\n );\n }\n\n if (projectData?.lessons?.data.length) {\n journeyProjectsData.push(\n { projectData: projectData.lessons.data[0], type: ProjectType.LESSON },\n { projectData: projectData.lessons.data[1], type: ProjectType.LESSON },\n );\n }\n\n const secondProjectData = journeyProjectsData[1];\n\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_VIEWED, {\n step:\n journeyProjectsData[0]?.type === ProjectType.LESSON\n ? ActionEvent.SKILL_ACTIVITY\n : ActionEvent.GAMES_ACTIVITY,\n });\n\n const coachmarks: TCoachmarkJourneyProps[] = [\n isCompact\n ? {\n originalElementToHighlightRef: firstCardRefs.current.circularCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SwipeableCard\n onSwipeLeft={() => {\n carouselRefs.current?.goToIndex(1);\n nextCoachmark(journeyId, false, SHOW_NUDGE_AFTER_MS);\n }}\n >\n <SwipableArea />\n </SwipeableCard>\n ),\n indicator: {\n nudge: 'swipe',\n content: <Text $renderAs=\"ab2-bold\">Swipe to explore</Text>,\n nudgePointerX: launcherDims.width / 2 - 30,\n nudgePointerY: launcherDims.height / 2,\n } as INudgeProps,\n }\n : {\n originalElementToHighlightRef: paginationList[1] as React.RefObject<HTMLDivElement>,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <CarouselIndicator\n textToShowInsideIndicator=\"2\"\n onClick={() => {\n carouselRefs.current?.goToIndex(1);\n nextCoachmark(journeyId, false, SHOW_NUDGE_AFTER_MS);\n }}\n />\n ),\n indicator: {\n nudge: 'click',\n content: <Text $renderAs=\"ab1-bold\">Click to proceed</Text>,\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n {\n originalElementToHighlightRef: secondCardRefs.current.circularCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <CircularGameCard\n label=\"\"\n data={{\n card: secondProjectData?.projectData?.cardLottie ?? '',\n name: secondProjectData?.projectData?.name ?? '',\n isCompleted: false,\n displayNameImage: secondProjectData?.projectData?.displayNameImage,\n onPress: () => {\n if (secondProjectData?.type === ProjectType.LESSON) {\n handleEndJourneyForLesson(secondProjectData.projectData as Lesson, journeyId);\n }\n\n if (secondProjectData?.type === ProjectType.PUZZLE) {\n handleEndJourneyForPuzzle(secondProjectData.projectData as Puzzle, journeyId);\n }\n },\n }}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs={isCompact ? 'ab2-bold' : 'ab1-bold'}>\n {isCompact ? 'Tap to start' : ' Click to start'}\n </Text>\n ),\n nudgePointerX: isCompact ? launcherDims.width / 2 : launcherDims.width / 1.3,\n nudgePointerY: isCompact ? launcherDims.height / 2 : launcherDims.height / 1.3,\n } as INudgeProps,\n },\n ];\n\n setJourney(journeyId, coachmarks);\n carouselRefs.current?.goToIndex(0);\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n nextCoachmark(journeyId);\n }, SLIDE_TO_LESSON_MS);\n\n timerRefs.current.push(delayBeforeStart);\n },\n [\n carouselRefs,\n trackAnalytics,\n isCompact,\n setJourney,\n nextCoachmark,\n handleEndJourneyForLesson,\n handleEndJourneyForPuzzle,\n ],\n );\n\n const data = useMemo(\n () => ({\n firstCardRefs,\n secondCardRefs,\n startJourney,\n }),\n [startJourney],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, [carouselRefs]);\n\n return data;\n};\n"],"names":["useGameLauncherJourney","carouselRefs","onSegmentClick","onJourneyComplete","device","useTheme","isCompact","EDeviceType","timerRefs","useRef","firstCardRefs","secondCardRefs","nextCoachmark","setJourney","endJourney","useJourney","trackAnalytics","useUIContext","trackEventCompleted","useCallback","step","AnalyticsLabel","handleEndJourneyForPuzzle","puzzlesData","journeyId","ProjectType","ActionEvent","handleEndJourneyForLesson","lessonsData","startJourney","projectData","paginationList","_a","launcherDims","_c","_b","journeyProjectsData","_d","_e","_f","secondProjectData","PLATFORM_EVENTS_STUDENT","_g","coachmarks","IndicatorType","jsx","SwipeableCard","SHOW_NUDGE_AFTER_MS","SwipableArea","Text","CarouselIndicator","CircularGameCard","_h","_i","_j","_k","delayBeforeStart","SLIDE_TO_LESSON_MS","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;AA8BO,MAAMA,KAAyB,CAAC;AAAA,EACrC,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,mBAAAC;AACF,MAAoC;AAC5B,QAAA,EAAE,QAAAC,MAAWC,KACbC,IAAYF,KAAUG,EAAY,QAElCC,IAAYC,EAAwC,CAAA,CAAE,GAEtDC,IAAgBD,EAA8B,IAAI,GAClDE,IAAiBF,EAA8B,IAAI,GACnD,EAAE,eAAAG,GAAe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E,eAAe3B,IAAY2B,EAAa,SAAS,IAAIA,EAAa,SAAS;AAAA,UAC7E;AAAA,QACF;AAAA,MAAA;AAGF,MAAApB,EAAWW,GAAWmB,CAAU,IACnBY,IAAAtD,EAAA,YAAA,QAAAsD,EAAS,UAAU;AAC1B,YAAAC,IAAmB,WAAW,MAAM;AACxC,qBAAaA,CAAgB,GAC7B5C,EAAcY,CAAS;AAAA,SACtBiC,EAAkB;AAEX,MAAAjD,EAAA,QAAQ,KAAKgD,CAAgB;AAAA,IACzC;AAAA,IACA;AAAA,MACEvD;AAAA,MACAe;AAAA,MACAV;AAAA,MACAO;AAAA,MACAD;AAAA,MACAe;AAAA,MACAL;AAAA,IACF;AAAA,EAAA,GAGIoC,IAAOC;AAAA,IACX,OAAO;AAAA,MACL,eAAAjD;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAkB;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAA+B,EAAU,MACD,MAAM;AACX,IAAApD,EAAU,QAAQ,QAAQ,CAASqD,MAAA,aAAaA,CAAK,CAAC,GACtDrD,EAAU,UAAU;EAAC,GAEtB,CAACP,CAAY,CAAC,GAEVyD;AACT;"}
|
|
1
|
+
{"version":3,"file":"use-game-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport {\n PLATFORM_EVENTS_STUDENT as AnalyticsLabel,\n PLATFORM_EVENTS_STUDENT,\n} from '../../../../analytics-events/platform-events-student';\nimport { type JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport type { TCoachmarkJourneyProps } from '../../../../journey/use-journey/journey-context-types';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport { useUIContext } from '../../../../ui/context/context';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport Text from '../../../../ui/text/text';\nimport { EDeviceType } from '../../../../ui/theme/constants';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as ActionEvent } from '../../../enum/circle-onboarding-steps';\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { CircularGameCard } from '../../comps/circular-game-card/circular-game-card';\nimport { type ICircularGameCardRefs } from '../../comps/circular-game-card/circular-game-card-types';\nimport SwipeableCard from '../../comps/swipable-component/swipeable-component';\nimport type {\n Lesson,\n Puzzle,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport { type IProjectData } from '../../game-launcher-types';\nimport { SHOW_NUDGE_AFTER_MS, SLIDE_TO_LESSON_MS } from './constants';\nimport type { IUseGameLauncherJourneyProps } from './use-game-launcher-journey-types';\nimport { SwipableArea } from './use-game-launcher-journey-style';\nimport { CarouselIndicator } from '../../comps/carousel/carousel-indicator/carousel-indicator';\n\nexport const useGameLauncherJourney = ({\n carouselRefs,\n onSegmentClick,\n onJourneyComplete,\n}: IUseGameLauncherJourneyProps) => {\n const { device } = useTheme();\n const isCompact = device <= EDeviceType.TABLET;\n\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const firstCardRefs = useRef<ICircularGameCardRefs>(null);\n const secondCardRefs = useRef<ICircularGameCardRefs>(null);\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const trackEventCompleted = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_COMPLETED, {\n step,\n });\n },\n [trackAnalytics],\n );\n\n const handleEndJourneyForPuzzle = useCallback(\n (puzzlesData: Puzzle, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(puzzlesData, ProjectType.PUZZLE);\n trackEventCompleted(ActionEvent.PUZZLE_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const handleEndJourneyForLesson = useCallback(\n (lessonsData: Lesson, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(lessonsData, ProjectType.LESSON);\n trackEventCompleted(ActionEvent.SKILL_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const startJourney = useCallback(\n (journeyId: JOURNEY_ID_STUDENT, projectData?: IProjectData) => {\n const paginationList = carouselRefs.current?.indicatorRefs;\n\n const launcherDims =\n firstCardRefs.current?.circularCardWrapperRef.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n // Exit early if required refs or data are missing\n if (paginationList?.length < 2 || !secondCardRefs.current || !firstCardRefs.current) {\n return;\n }\n\n // prepare journey projects based on the data available as\n // games and puzzles are not aviailbale for K-1\n const journeyProjectsData = [];\n\n if (projectData?.games?.data.length && projectData?.puzzles?.data.length) {\n journeyProjectsData.push(\n {\n projectData: projectData.games.data[0],\n type: ProjectType.GAME,\n },\n {\n projectData: projectData.puzzles.data[0],\n type: ProjectType.PUZZLE,\n },\n );\n }\n\n if (projectData?.lessons?.data.length) {\n journeyProjectsData.push(\n { projectData: projectData.lessons.data[0], type: ProjectType.LESSON },\n { projectData: projectData.lessons.data[1], type: ProjectType.LESSON },\n );\n }\n\n const secondProjectData = journeyProjectsData[1];\n\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_VIEWED, {\n step:\n journeyProjectsData[0]?.type === ProjectType.LESSON\n ? ActionEvent.SKILL_ACTIVITY\n : ActionEvent.GAMES_ACTIVITY,\n });\n\n const coachmarks: TCoachmarkJourneyProps[] = [\n isCompact\n ? {\n originalElementToHighlightRef: firstCardRefs.current.circularCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SwipeableCard\n onSwipeLeft={() => {\n carouselRefs.current?.goToIndex(1);\n nextCoachmark(journeyId, false, SHOW_NUDGE_AFTER_MS);\n }}\n >\n <SwipableArea />\n </SwipeableCard>\n ),\n indicator: {\n nudge: 'swipe',\n content: <Text $renderAs=\"ab2-bold\">Swipe to explore</Text>,\n nudgePointerX: launcherDims.width / 2 - 30,\n nudgePointerY: launcherDims.height / 2,\n } as INudgeProps,\n }\n : {\n originalElementToHighlightRef: paginationList[1] as React.RefObject<HTMLDivElement>,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <CarouselIndicator\n textToShowInsideIndicator=\"2\"\n onClick={() => {\n carouselRefs.current?.goToIndex(1);\n nextCoachmark(journeyId, false, SHOW_NUDGE_AFTER_MS);\n }}\n />\n ),\n indicator: {\n nudge: 'click',\n content: <Text $renderAs=\"ab1-bold\">Click to proceed</Text>,\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n {\n originalElementToHighlightRef: secondCardRefs.current.circularCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <CircularGameCard\n label=\"\"\n data={{\n card: secondProjectData?.projectData?.cardLottie ?? '',\n name: secondProjectData?.projectData?.name ?? '',\n isCompleted: false,\n displayNameImage: secondProjectData?.projectData?.displayNameImage,\n onPress: () => {\n if (secondProjectData?.type === ProjectType.LESSON) {\n handleEndJourneyForLesson(secondProjectData.projectData as Lesson, journeyId);\n }\n\n if (secondProjectData?.type === ProjectType.PUZZLE) {\n handleEndJourneyForPuzzle(secondProjectData.projectData as Puzzle, journeyId);\n }\n },\n }}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs={isCompact ? 'ab2-bold' : 'ab1-bold'}>\n {isCompact ? 'Tap to start' : ' Click to start'}\n </Text>\n ),\n nudgePointerX: isCompact ? launcherDims.width / 2 : launcherDims.width / 1.3,\n nudgePointerY: isCompact ? launcherDims.height / 2 : launcherDims.height / 1.3,\n } as INudgeProps,\n },\n ];\n\n setJourney(journeyId, coachmarks);\n carouselRefs.current?.goToIndex(0);\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n nextCoachmark(journeyId);\n }, SLIDE_TO_LESSON_MS);\n\n timerRefs.current.push(delayBeforeStart);\n },\n [\n carouselRefs,\n trackAnalytics,\n isCompact,\n setJourney,\n nextCoachmark,\n handleEndJourneyForLesson,\n handleEndJourneyForPuzzle,\n ],\n );\n\n const data = useMemo(\n () => ({\n firstCardRefs,\n secondCardRefs,\n startJourney,\n }),\n [startJourney],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, [carouselRefs]);\n\n return data;\n};\n"],"names":["useGameLauncherJourney","carouselRefs","onSegmentClick","onJourneyComplete","device","useTheme","isCompact","EDeviceType","timerRefs","useRef","firstCardRefs","secondCardRefs","nextCoachmark","setJourney","endJourney","useJourney","trackAnalytics","useUIContext","trackEventCompleted","useCallback","step","AnalyticsLabel","handleEndJourneyForPuzzle","puzzlesData","journeyId","ProjectType","ActionEvent","handleEndJourneyForLesson","lessonsData","startJourney","projectData","paginationList","_a","launcherDims","_c","_b","journeyProjectsData","_d","_e","_f","secondProjectData","PLATFORM_EVENTS_STUDENT","_g","coachmarks","IndicatorType","jsx","SwipeableCard","SHOW_NUDGE_AFTER_MS","SwipableArea","Text","CarouselIndicator","CircularGameCard","_h","_i","_j","_k","delayBeforeStart","SLIDE_TO_LESSON_MS","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;AA8BO,MAAMA,KAAyB,CAAC;AAAA,EACrC,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,mBAAAC;AACF,MAAoC;AAC5B,QAAA,EAAE,QAAAC,MAAWC,KACbC,IAAYF,KAAUG,EAAY,QAElCC,IAAYC,EAAwC,CAAA,CAAE,GAEtDC,IAAgBD,EAA8B,IAAI,GAClDE,IAAiBF,EAA8B,IAAI,GACnD,EAAE,eAAAG,GAAe,YAAAC,GAAY,YAAAC,MAAeC,EAAW,GACvD,EAAE,SAASC,EAAe,IAAI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;AAAA,QACF;AAAA,MAAA;AAGF,MAAApB,EAAWW,GAAWmB,CAAU,IACnBY,IAAAtD,EAAA,YAAA,QAAAsD,EAAS,UAAU;AAC1B,YAAAC,IAAmB,WAAW,MAAM;AACxC,qBAAaA,CAAgB,GAC7B5C,EAAcY,CAAS;AAAA,SACtBiC,EAAkB;AAEX,MAAAjD,EAAA,QAAQ,KAAKgD,CAAgB;AAAA,IACzC;AAAA,IACA;AAAA,MACEvD;AAAA,MACAe;AAAA,MACAV;AAAA,MACAO;AAAA,MACAD;AAAA,MACAe;AAAA,MACAL;AAAA,IACF;AAAA,EAAA,GAGIoC,IAAOC;AAAA,IACX,OAAO;AAAA,MACL,eAAAjD;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAkB;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAA+B,EAAU,MACD,MAAM;AACX,IAAApD,EAAU,QAAQ,QAAQ,CAASqD,MAAA,aAAaA,CAAK,CAAC,GACtDrD,EAAU,UAAU;EAAC,GAEtB,CAACP,CAAY,CAAC,GAEVyD;AACT;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-handle-sticker-send.js","sources":["../../../../../src/features/stickers/hooks/use-handle-sticker-send/use-handle-sticker-send.tsx"],"sourcesContent":["import { useCallback } from 'react';\n\nimport useInClassMessageBroker from '../../../communication/hooks/use-inclass-message-broker/use-inclass-message-broker';\nimport { useUIContext } from '../../../ui/context/context';\nimport { STICKERS_ANALYTICS_EVENT } from '../../stickers-analytics-events';\nimport { useStickers } from '../../stickers-effects/hooks/use-stickers';\nimport type {\n IStickerData,\n TStickerAnimationEffects,\n TStickersPayload,\n} from '../../stickers-types';\nimport { useStickersErrorLogger } from '../use-stickers-error-logger';\nimport { type TUseStickerSendMetaData } from './use-handle-sticker-send-types';\n\nexport const useHandleStickerSend = (\n studentClassroomId: string,\n metaData: TUseStickerSendMetaData,\n) => {\n const { publish } = useInClassMessageBroker({\n studentClassroomId,\n });\n\n const { onEvent: trackEvent } = useUIContext();\n const logError = useStickersErrorLogger();\n\n const { showSticker } = useStickers();\n\n const sendSticker = useCallback(\n (sticker: IStickerData, effect: TStickerAnimationEffects) => {\n const baseEventData = {\n classroom_id: studentClassroomId,\n sticker: sticker.id,\n teacherClassroomId: metaData.teacherClassroomId,\n triggerType: metaData.triggerType,\n };\n\n try {\n const payload: TStickersPayload = {\n message: {\n data: {\n selectedSticker: {\n id: sticker.id,\n name: sticker.name,\n },\n effectId: effect,\n },\n },\n type: 'STICKERS',\n };\n\n showSticker(payload);\n\n publish?.({\n eventName: 'STICKERS',\n eventPayload: payload,\n });\n\n trackEvent(STICKERS_ANALYTICS_EVENT.STICKER_SENT, baseEventData);\n } catch (error) {\n logError(error, { baseEventData });\n }\n },\n [logError, publish, showSticker, studentClassroomId, trackEvent],\n );\n\n return sendSticker;\n};\n"],"names":["useHandleStickerSend","studentClassroomId","metaData","publish","useInClassMessageBroker","trackEvent","useUIContext","logError","useStickersErrorLogger","showSticker","useStickers","useCallback","sticker","effect","baseEventData","payload","STICKERS_ANALYTICS_EVENT","error"],"mappings":";;;;;;AAca,MAAAA,IAAuB,CAClCC,GACAC,MACG;AACG,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAwB;AAAA,IAC1C,oBAAAH;AAAA,EAAA,CACD,GAEK,EAAE,SAASI,EAAW,IAAIC,EAAa,GACvCC,IAAWC,KAEX,EAAE,aAAAC,MAAgBC;
|
|
1
|
+
{"version":3,"file":"use-handle-sticker-send.js","sources":["../../../../../src/features/stickers/hooks/use-handle-sticker-send/use-handle-sticker-send.tsx"],"sourcesContent":["import { useCallback } from 'react';\n\nimport useInClassMessageBroker from '../../../communication/hooks/use-inclass-message-broker/use-inclass-message-broker';\nimport { useUIContext } from '../../../ui/context/context';\nimport { STICKERS_ANALYTICS_EVENT } from '../../stickers-analytics-events';\nimport { useStickers } from '../../stickers-effects/hooks/use-stickers';\nimport type {\n IStickerData,\n TStickerAnimationEffects,\n TStickersPayload,\n} from '../../stickers-types';\nimport { useStickersErrorLogger } from '../use-stickers-error-logger';\nimport { type TUseStickerSendMetaData } from './use-handle-sticker-send-types';\n\nexport const useHandleStickerSend = (\n studentClassroomId: string,\n metaData: TUseStickerSendMetaData,\n) => {\n const { publish } = useInClassMessageBroker({\n studentClassroomId,\n });\n\n const { onEvent: trackEvent } = useUIContext();\n const logError = useStickersErrorLogger();\n\n const { showSticker } = useStickers();\n\n const sendSticker = useCallback(\n (sticker: IStickerData, effect: TStickerAnimationEffects) => {\n const baseEventData = {\n classroom_id: studentClassroomId,\n sticker: sticker.id,\n teacherClassroomId: metaData.teacherClassroomId,\n triggerType: metaData.triggerType,\n };\n\n try {\n const payload: TStickersPayload = {\n message: {\n data: {\n selectedSticker: {\n id: sticker.id,\n name: sticker.name,\n },\n effectId: effect,\n },\n },\n type: 'STICKERS',\n };\n\n showSticker(payload);\n\n publish?.({\n eventName: 'STICKERS',\n eventPayload: payload,\n });\n\n trackEvent(STICKERS_ANALYTICS_EVENT.STICKER_SENT, baseEventData);\n } catch (error) {\n logError(error, { baseEventData });\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [logError, publish, showSticker, studentClassroomId, trackEvent],\n );\n\n return sendSticker;\n};\n"],"names":["useHandleStickerSend","studentClassroomId","metaData","publish","useInClassMessageBroker","trackEvent","useUIContext","logError","useStickersErrorLogger","showSticker","useStickers","useCallback","sticker","effect","baseEventData","payload","STICKERS_ANALYTICS_EVENT","error"],"mappings":";;;;;;AAca,MAAAA,IAAuB,CAClCC,GACAC,MACG;AACG,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAwB;AAAA,IAC1C,oBAAAH;AAAA,EAAA,CACD,GAEK,EAAE,SAASI,EAAW,IAAIC,EAAa,GACvCC,IAAWC,KAEX,EAAE,aAAAC,MAAgBC;AAyCjB,SAvCaC;AAAA,IAClB,CAACC,GAAuBC,MAAqC;AAC3D,YAAMC,IAAgB;AAAA,QACpB,cAAcb;AAAA,QACd,SAASW,EAAQ;AAAA,QACjB,oBAAoBV,EAAS;AAAA,QAC7B,aAAaA,EAAS;AAAA,MAAA;AAGpB,UAAA;AACF,cAAMa,IAA4B;AAAA,UAChC,SAAS;AAAA,YACP,MAAM;AAAA,cACJ,iBAAiB;AAAA,gBACf,IAAIH,EAAQ;AAAA,gBACZ,MAAMA,EAAQ;AAAA,cAChB;AAAA,cACA,UAAUC;AAAA,YACZ;AAAA,UACF;AAAA,UACA,MAAM;AAAA,QAAA;AAGR,QAAAJ,EAAYM,CAAO,GAETZ,KAAA,QAAAA,EAAA;AAAA,UACR,WAAW;AAAA,UACX,cAAcY;AAAA,QAAA,IAGLV,EAAAW,EAAyB,cAAcF,CAAa;AAAA,eACxDG,GAAO;AACL,QAAAV,EAAAU,GAAO,EAAE,eAAAH,EAAA,CAAe;AAAA,MACnC;AAAA,IACF;AAAA;AAAA,IAEA,CAACP,GAAUJ,GAASM,GAAaR,GAAoBI,CAAU;AAAA,EAAA;AAInE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip-body-styled.js","sources":["../../../../../src/features/ui/arrow-tooltip/comps/tooltip-body-styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../layout/flex-view';\nimport { animateToolTip, arrowPosition, tooltipPosition } from '../arrow-tooltip-util';\nimport type { ITooltipBodyProps } from './tooltip-body-types';\n\nexport const TooltipBody = styled(FlexView)<ITooltipBodyProps
|
|
1
|
+
{"version":3,"file":"tooltip-body-styled.js","sources":["../../../../../src/features/ui/arrow-tooltip/comps/tooltip-body-styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../layout/flex-view';\nimport { animateToolTip, arrowPosition, tooltipPosition } from '../arrow-tooltip-util';\nimport type { ITooltipBodyProps } from './tooltip-body-types';\n\nexport const TooltipBody = styled(FlexView)<Omit<ITooltipBodyProps, 'textVariant'>>(({\n theme,\n $arrowColor,\n $arrowSize,\n $arrowXCoOrdinates,\n $arrowYCoOrdinates,\n $borderColor,\n $isAnimated,\n $position,\n $renderAs,\n $tooltipCoOrdinates,\n $tooltipOffset,\n $tooltipXCoOrdinates,\n $tooltipYCoOrdinates,\n $zIndex,\n $backgroundColor,\n}) => {\n const { gutter } = theme.layout;\n const { REAL_BLACK_15 } = theme.colors;\n const { tooltipVariants } = theme.arrowTooltip;\n let { backgroundColorName } = tooltipVariants[$renderAs];\n const { textColorName } = tooltipVariants[$renderAs];\n\n backgroundColorName = $backgroundColor || backgroundColorName;\n\n return `\n position: fixed;\n z-index: ${$zIndex || 1};\n padding: ${gutter * 0.25}px ${gutter * 0.5}px;\n color: ${textColorName};\n box-shadow: 0px 2px 15px 0px ${REAL_BLACK_15};\n background-color: ${theme.colors[backgroundColorName]};\n border: 1px solid ${$borderColor ? theme.colors[$borderColor] : 'transparent'};\n\n &::after {\n content: '';\n position: absolute;\n height: ${$arrowSize}px;\n width: ${$arrowSize}px;\n clip-path: polygon(0% 0%, 100% 100%, 0% 100%);\n background-color: ${\n $arrowColor ? theme.colors[$arrowColor] : theme.colors[backgroundColorName]\n };\n ${arrowPosition({\n position: $position,\n arrowXCoOrdinates: $arrowXCoOrdinates,\n arrowYCoOrdinates: $arrowYCoOrdinates,\n arrowSize: $arrowSize,\n })};\n }\n\n ${tooltipPosition({\n position: $position,\n arrowSize: $arrowSize,\n tooltipCoOrdinates: $tooltipCoOrdinates,\n tooltipOffset: $tooltipOffset,\n tooltipXCoOrdinates: $tooltipXCoOrdinates,\n tooltipYCoOrdinates: $tooltipYCoOrdinates,\n })};\n\n ${animateToolTip($isAnimated)};\n `;\n});\n"],"names":["TooltipBody","styled","FlexView","theme","$arrowColor","$arrowSize","$arrowXCoOrdinates","$arrowYCoOrdinates","$borderColor","$isAnimated","$position","$renderAs","$tooltipCoOrdinates","$tooltipOffset","$tooltipXCoOrdinates","$tooltipYCoOrdinates","$zIndex","$backgroundColor","gutter","REAL_BLACK_15","tooltipVariants","backgroundColorName","textColor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,IACpB,eAAeC;AAAA,IACf,qBAAqBC;AAAA,IACrB,qBAAqBC;AAAA,EAAA,CACtB,CAAC;AAAA;AAAA,MAEAU,EAAehB,CAAW,CAAC;AAAA;AAEjC,CAAC;"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
3
|
-
import { useTheme as
|
|
4
|
-
import
|
|
5
|
-
import { TooltipBody as
|
|
6
|
-
const
|
|
7
|
-
const {
|
|
8
|
-
return /* @__PURE__ */ t(
|
|
9
|
-
|
|
2
|
+
import { memo as n } from "react";
|
|
3
|
+
import { useTheme as l } from "styled-components";
|
|
4
|
+
import m from "../../text/text.js";
|
|
5
|
+
import { TooltipBody as d } from "./tooltip-body-styled.js";
|
|
6
|
+
const a = (o) => {
|
|
7
|
+
const { textVariant: c, ...r } = o, { arrowTooltip: e } = l(), { tooltipVariants: i } = e;
|
|
8
|
+
return /* @__PURE__ */ t(d, { ...r, children: typeof o.children == "string" ? /* @__PURE__ */ t(
|
|
9
|
+
m,
|
|
10
10
|
{
|
|
11
11
|
$renderAs: o.textVariant || "body3",
|
|
12
|
-
$color:
|
|
12
|
+
$color: i[o.$renderAs].textColorName,
|
|
13
13
|
$align: "center",
|
|
14
14
|
children: o.children
|
|
15
15
|
}
|
|
16
16
|
) : o.children });
|
|
17
|
-
},
|
|
17
|
+
}, y = n(a);
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
y as default
|
|
20
20
|
};
|
|
21
21
|
//# sourceMappingURL=tooltip-body.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip-body.js","sources":["../../../../../src/features/ui/arrow-tooltip/comps/tooltip-body.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Text from '../../text/text';\nimport * as Styled from './tooltip-body-styled';\nimport type { ITooltipBodyProps } from './tooltip-body-types';\n\nconst TooltipBody: FC<ITooltipBodyProps> = props => {\n const { arrowTooltip } = useTheme();\n const { tooltipVariants } = arrowTooltip;\n\n return (\n <Styled.TooltipBody {...
|
|
1
|
+
{"version":3,"file":"tooltip-body.js","sources":["../../../../../src/features/ui/arrow-tooltip/comps/tooltip-body.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Text from '../../text/text';\nimport * as Styled from './tooltip-body-styled';\nimport type { ITooltipBodyProps } from './tooltip-body-types';\n\nconst TooltipBody: FC<ITooltipBodyProps> = props => {\n const { textVariant, ...rest } = props;\n const { arrowTooltip } = useTheme();\n const { tooltipVariants } = arrowTooltip;\n\n return (\n <Styled.TooltipBody {...rest}>\n {typeof props.children === 'string' ? (\n <Text\n $renderAs={props.textVariant || 'body3'}\n $color={tooltipVariants[props.$renderAs].textColorName}\n $align=\"center\"\n >\n {props.children}\n </Text>\n ) : (\n props.children\n )}\n </Styled.TooltipBody>\n );\n};\n\nexport default memo(TooltipBody);\n"],"names":["TooltipBody","props","textVariant","rest","arrowTooltip","useTheme","tooltipVariants","jsx","Styled.TooltipBody","Text","TooltipBody$1","memo"],"mappings":";;;;;AAOA,MAAMA,IAAqC,CAASC,MAAA;AAClD,QAAM,EAAE,aAAAC,GAAa,GAAGC,EAAA,IAASF,GAC3B,EAAE,cAAAG,MAAiBC,KACnB,EAAE,iBAAAC,EAAoB,IAAAF;AAG1B,SAAA,gBAAAG,EAACC,GAAA,EAAoB,GAAGL,GACrB,UAAA,OAAOF,EAAM,YAAa,WACzB,gBAAAM;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,WAAWR,EAAM,eAAe;AAAA,MAChC,QAAQK,EAAgBL,EAAM,SAAS,EAAE;AAAA,MACzC,QAAO;AAAA,MAEN,UAAMA,EAAA;AAAA,IAAA;AAAA,EAAA,IAGTA,EAAM,SAEV,CAAA;AAEJ,GAEeS,IAAAC,EAAKX,CAAW;"}
|
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { useAVMessage as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
userType:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { useState as m, useMemo as a, useCallback as c } from "react";
|
|
2
|
+
import { useAVMessage as I } from "@cuemath/av";
|
|
3
|
+
import { useWorksheetStore as T } from "../../worksheet/hooks/use-worksheet-store.js";
|
|
4
|
+
const f = () => {
|
|
5
|
+
var r;
|
|
6
|
+
const { activeQuestionIndex: t, questions: s, userType: i } = T((e) => ({
|
|
7
|
+
activeQuestionIndex: e.activeQuestionIndex,
|
|
8
|
+
questions: e.questions,
|
|
9
|
+
userType: e.userType
|
|
10
|
+
})), [n, u] = m(), o = a(
|
|
11
|
+
() => s.findIndex((e) => e.response_id === n),
|
|
12
|
+
[n, s]
|
|
13
|
+
), p = c((e, d) => {
|
|
14
|
+
u(d.id);
|
|
14
15
|
}, []);
|
|
15
|
-
return
|
|
16
|
+
return I({
|
|
16
17
|
type: "STUDENT_MOUSE_POINTER_POSITION_CHANGED",
|
|
17
|
-
onMessage:
|
|
18
|
-
}),
|
|
18
|
+
onMessage: p
|
|
19
|
+
}), i !== "TEACHER" || o === -1 || t === o ? {
|
|
19
20
|
peerLocation: void 0,
|
|
20
21
|
peerQuestionIndex: void 0,
|
|
21
22
|
peerItemNumber: void 0
|
|
22
23
|
} : {
|
|
23
|
-
peerLocation:
|
|
24
|
-
peerQuestionIndex:
|
|
25
|
-
peerItemNumber: (
|
|
24
|
+
peerLocation: o > t ? "down" : "up",
|
|
25
|
+
peerQuestionIndex: o,
|
|
26
|
+
peerItemNumber: (r = s[o]) == null ? void 0 : r.item_number
|
|
26
27
|
};
|
|
27
28
|
};
|
|
28
29
|
export {
|
|
29
|
-
|
|
30
|
+
f as default
|
|
30
31
|
};
|
|
31
32
|
//# sourceMappingURL=use-user-location.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-user-location.js","sources":["../../../../../src/features/worksheet/user-pointer-pin/hooks/use-user-location.ts"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react';\n\nimport { useAVMessage } from '@cuemath/av';\n\nimport
|
|
1
|
+
{"version":3,"file":"use-user-location.js","sources":["../../../../../src/features/worksheet/user-pointer-pin/hooks/use-user-location.ts"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react';\n\nimport { useAVMessage } from '@cuemath/av';\n\nimport { useWorksheetStore } from '../../worksheet/hooks/use-worksheet-store';\n\ntype TPointerLocation = 'up' | 'down' | undefined;\n\ninterface IUseRemoteUserLocation {\n peerLocation: TPointerLocation;\n peerQuestionIndex: number | undefined;\n peerItemNumber: number | undefined;\n}\n\nconst useRemoteUserLocation = (): IUseRemoteUserLocation => {\n const { activeQuestionIndex, questions, userType } = useWorksheetStore(store => ({\n activeQuestionIndex: store.activeQuestionIndex,\n questions: store.questions,\n userType: store.userType,\n }));\n const [peerResponseId, setPeerResponseId] = useState<string | undefined>();\n const peerQuestionIndex = useMemo(\n () => questions.findIndex(qs => qs.response_id === peerResponseId),\n [peerResponseId, questions],\n );\n const onPointerReceive = useCallback((_: string, data: Record<string, unknown>) => {\n setPeerResponseId(data.id as string);\n }, []);\n\n useAVMessage<Record<string, unknown>>({\n type: 'STUDENT_MOUSE_POINTER_POSITION_CHANGED',\n onMessage: onPointerReceive,\n });\n\n if (\n userType !== 'TEACHER' ||\n peerQuestionIndex === -1 ||\n activeQuestionIndex === peerQuestionIndex\n ) {\n return {\n peerLocation: undefined,\n peerQuestionIndex: undefined,\n peerItemNumber: undefined,\n };\n }\n\n return {\n peerLocation: peerQuestionIndex > activeQuestionIndex ? 'down' : 'up',\n peerQuestionIndex,\n peerItemNumber: questions[peerQuestionIndex]?.item_number,\n };\n};\n\nexport default useRemoteUserLocation;\n"],"names":["useRemoteUserLocation","activeQuestionIndex","questions","userType","useWorksheetStore","store","peerResponseId","setPeerResponseId","useState","peerQuestionIndex","useMemo","qs","onPointerReceive","useCallback","_","data","useAVMessage","_a"],"mappings":";;;AAcA,MAAMA,IAAwB,MAA8B;;AAC1D,QAAM,EAAE,qBAAAC,GAAqB,WAAAC,GAAW,UAAAC,EAAS,IAAIC,EAAkB,CAAUC,OAAA;AAAA,IAC/E,qBAAqBA,EAAM;AAAA,IAC3B,WAAWA,EAAM;AAAA,IACjB,UAAUA,EAAM;AAAA,EAChB,EAAA,GACI,CAACC,GAAgBC,CAAiB,IAAIC,EAA6B,GACnEC,IAAoBC;AAAA,IACxB,MAAMR,EAAU,UAAU,CAAMS,MAAAA,EAAG,gBAAgBL,CAAc;AAAA,IACjE,CAACA,GAAgBJ,CAAS;AAAA,EAAA,GAEtBU,IAAmBC,EAAY,CAACC,GAAWC,MAAkC;AACjF,IAAAR,EAAkBQ,EAAK,EAAY;AAAA,EACrC,GAAG,CAAE,CAAA;AAOL,SALsCC,EAAA;AAAA,IACpC,MAAM;AAAA,IACN,WAAWJ;AAAA,EAAA,CACZ,GAGCT,MAAa,aACbM,MAAsB,MACtBR,MAAwBQ,IAEjB;AAAA,IACL,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB,gBAAgB;AAAA,EAAA,IAIb;AAAA,IACL,cAAcA,IAAoBR,IAAsB,SAAS;AAAA,IACjE,mBAAAQ;AAAA,IACA,iBAAgBQ,IAAAf,EAAUO,CAAiB,MAA3B,gBAAAQ,EAA8B;AAAA,EAAA;AAElD;"}
|
|
@@ -1,55 +1,57 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import { ILLUSTRATIONS as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
2
|
+
import { memo as h, useCallback as x } from "react";
|
|
3
|
+
import l from "styled-components";
|
|
4
|
+
import { ILLUSTRATIONS as a } from "../../../assets/illustrations/illustrations.js";
|
|
5
|
+
import I from "../../ui/buttons/clickable/clickable.js";
|
|
6
|
+
import U from "../../ui/layout/flex-view.js";
|
|
7
|
+
import { useWorksheetStore as y } from "../worksheet/hooks/use-worksheet-store.js";
|
|
8
|
+
import { scrollToQuestion as S } from "../worksheet/worksheet-helpers.js";
|
|
9
|
+
import T from "./hooks/use-user-location.js";
|
|
10
|
+
const c = 32, f = 36, b = l.img`
|
|
10
11
|
position: absolute;
|
|
11
|
-
transform: ${({ $pointer:
|
|
12
|
-
`,
|
|
13
|
-
({ $pointer:
|
|
12
|
+
transform: ${({ $pointer: e }) => e === "down" ? `translate(-${c / 2}px, -${f}px)` : `translate(-${c / 2}px, 0)`};
|
|
13
|
+
`, _ = l(U)(
|
|
14
|
+
({ $pointer: e, $topOffset: n, $bottomOffset: o }) => `
|
|
14
15
|
position: sticky;
|
|
15
|
-
top: ${
|
|
16
|
+
top: ${e === "down" ? `calc(100% - ${o}px)` : `calc(${n + 48 + 8}px)`};
|
|
16
17
|
z-index: 1;
|
|
17
18
|
`
|
|
18
|
-
),
|
|
19
|
-
const {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
userType:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
), q = h(function() {
|
|
20
|
+
const { topOffset: n, questions: o, userType: m, actionbarHeight: u } = y((t) => ({
|
|
21
|
+
topOffset: t.layout.topOffset,
|
|
22
|
+
questions: t.questions,
|
|
23
|
+
userType: t.userType,
|
|
24
|
+
actionbarHeight: t.actionbarHeight
|
|
25
|
+
})), { peerLocation: r, peerQuestionIndex: i } = T(), d = x(() => {
|
|
26
|
+
var t, p;
|
|
27
|
+
if (i === void 0)
|
|
26
28
|
return null;
|
|
27
|
-
if ((
|
|
28
|
-
const
|
|
29
|
-
|
|
29
|
+
if ((t = o[i]) != null && t.response_id) {
|
|
30
|
+
const $ = (p = o[i]) == null ? void 0 : p.response_id;
|
|
31
|
+
S($);
|
|
30
32
|
}
|
|
31
|
-
}, [
|
|
32
|
-
return !
|
|
33
|
-
|
|
33
|
+
}, [i, o]);
|
|
34
|
+
return !r || m !== "TEACHER" ? null : /* @__PURE__ */ s(
|
|
35
|
+
_,
|
|
34
36
|
{
|
|
35
37
|
$alignItems: "center",
|
|
36
38
|
$justifyContent: "center",
|
|
37
|
-
$pointer:
|
|
38
|
-
$bottomOffset:
|
|
39
|
-
$topOffset:
|
|
40
|
-
children: /* @__PURE__ */ s(
|
|
41
|
-
|
|
39
|
+
$pointer: r,
|
|
40
|
+
$bottomOffset: u,
|
|
41
|
+
$topOffset: n,
|
|
42
|
+
children: /* @__PURE__ */ s(I, { label: "User Location Pointer", onClick: d, children: /* @__PURE__ */ s(
|
|
43
|
+
b,
|
|
42
44
|
{
|
|
43
|
-
$pointer:
|
|
45
|
+
$pointer: r,
|
|
44
46
|
width: c,
|
|
45
|
-
height:
|
|
46
|
-
src:
|
|
47
|
+
height: f,
|
|
48
|
+
src: r === "up" ? a.USER_UP : a.USER_DOWN
|
|
47
49
|
}
|
|
48
50
|
) })
|
|
49
51
|
}
|
|
50
52
|
);
|
|
51
53
|
});
|
|
52
54
|
export {
|
|
53
|
-
|
|
55
|
+
q as default
|
|
54
56
|
};
|
|
55
57
|
//# sourceMappingURL=user-pin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-pin.js","sources":["../../../../src/features/worksheet/user-pointer-pin/user-pin.tsx"],"sourcesContent":["import { memo, useCallback, type FC } from 'react';\nimport styled from 'styled-components';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Clickable from '../../ui/buttons/clickable/clickable';\nimport FlexView from '../../ui/layout/flex-view';\nimport
|
|
1
|
+
{"version":3,"file":"user-pin.js","sources":["../../../../src/features/worksheet/user-pointer-pin/user-pin.tsx"],"sourcesContent":["import { memo, useCallback, type FC } from 'react';\nimport styled from 'styled-components';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Clickable from '../../ui/buttons/clickable/clickable';\nimport FlexView from '../../ui/layout/flex-view';\nimport { useWorksheetStore } from '../worksheet/hooks/use-worksheet-store';\nimport { scrollToQuestion } from '../worksheet/worksheet-helpers';\nimport useRemoteUserLocation from './hooks/use-user-location';\n\nconst USER_PIN_WIDTH = 32;\nconst USER_PIN_HEIGHT = 36;\n\nconst StyledImage = styled.img<{ $pointer: 'up' | 'down' | undefined }>`\n position: absolute;\n transform: ${({ $pointer }) =>\n $pointer === 'down'\n ? `translate(-${USER_PIN_WIDTH / 2}px, -${USER_PIN_HEIGHT}px)`\n : `translate(-${USER_PIN_WIDTH / 2}px, 0)`};\n`;\n\nconst StickyContainer = styled(FlexView)<{\n $pointer: 'up' | 'down' | undefined;\n $topOffset: number;\n $bottomOffset: number;\n}>(\n ({ $pointer, $topOffset, $bottomOffset }) => `\n position: sticky;\n top: ${\n $pointer === 'down' ? `calc(100% - ${$bottomOffset}px)` : `calc(${$topOffset + 48 + 8}px)`\n };\n z-index: 1;\n`,\n);\n\nconst UserPointer: FC = memo(function UserPointer() {\n const { topOffset, questions, userType, actionbarHeight } = useWorksheetStore(store => ({\n topOffset: store.layout.topOffset,\n questions: store.questions,\n userType: store.userType,\n actionbarHeight: store.actionbarHeight,\n }));\n const { peerLocation, peerQuestionIndex } = useRemoteUserLocation();\n\n const handleClick = useCallback(() => {\n if (peerQuestionIndex === undefined) {\n return null;\n }\n\n if (questions[peerQuestionIndex]?.response_id) {\n const qrId = questions[peerQuestionIndex]?.response_id as string;\n\n scrollToQuestion(qrId);\n }\n }, [peerQuestionIndex, questions]);\n\n if (!peerLocation || userType !== 'TEACHER') {\n return null;\n }\n\n return (\n <StickyContainer\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $pointer={peerLocation}\n $bottomOffset={actionbarHeight}\n $topOffset={topOffset}\n >\n <Clickable label=\"User Location Pointer\" onClick={handleClick}>\n <StyledImage\n $pointer={peerLocation}\n width={USER_PIN_WIDTH}\n height={USER_PIN_HEIGHT}\n src={peerLocation === 'up' ? ILLUSTRATIONS.USER_UP : ILLUSTRATIONS.USER_DOWN}\n />\n </Clickable>\n </StickyContainer>\n );\n});\n\nexport default UserPointer;\n"],"names":["USER_PIN_WIDTH","USER_PIN_HEIGHT","StyledImage","styled","$pointer","StickyContainer","FlexView","$topOffset","$bottomOffset","UserPointer","memo","topOffset","questions","userType","actionbarHeight","useWorksheetStore","store","peerLocation","peerQuestionIndex","useRemoteUserLocation","handleClick","useCallback","_a","qrId","_b","scrollToQuestion","jsx","Clickable","ILLUSTRATIONS"],"mappings":";;;;;;;;;AAUA,MAAMA,IAAiB,IACjBC,IAAkB,IAElBC,IAAcC,EAAO;AAAA;AAAA,eAEZ,CAAC,EAAE,UAAAC,QACdA,MAAa,SACT,cAAcJ,IAAiB,CAAC,QAAQC,CAAe,QACvD,cAAcD,IAAiB,CAAC,QAAQ;AAAA,GAG1CK,IAAkBF,EAAOG,CAAQ;AAAA,EAKrC,CAAC,EAAE,UAAAF,GAAU,YAAAG,GAAY,eAAAC,EAAoB,MAAA;AAAA;AAAA,SAG3CJ,MAAa,SAAS,eAAeI,CAAa,QAAQ,QAAQD,IAAa,KAAK,CAAC,KACvF;AAAA;AAAA;AAGF,GAEME,IAAkBC,EAAK,WAAuB;AAClD,QAAM,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,GAAU,iBAAAC,MAAoBC,EAAkB,CAAUC,OAAA;AAAA,IACtF,WAAWA,EAAM,OAAO;AAAA,IACxB,WAAWA,EAAM;AAAA,IACjB,UAAUA,EAAM;AAAA,IAChB,iBAAiBA,EAAM;AAAA,EACvB,EAAA,GACI,EAAE,cAAAC,GAAc,mBAAAC,EAAkB,IAAIC,EAAsB,GAE5DC,IAAcC,EAAY,MAAM;;AACpC,QAAIH,MAAsB;AACjB,aAAA;AAGL,SAAAI,IAAAV,EAAUM,CAAiB,MAA3B,QAAAI,EAA8B,aAAa;AACvC,YAAAC,KAAOC,IAAAZ,EAAUM,CAAiB,MAA3B,gBAAAM,EAA8B;AAE3C,MAAA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