@cuemath/leap 3.3.34 → 3.3.35-m
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 +1 -4
- package/dist/assets/gif/gif.js.map +1 -1
- package/dist/assets/illustrations/illustrations.js +1 -1
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/line-icons/icons/chevron-right.js.map +1 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js +1 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js.map +1 -1
- package/dist/features/auth/comps/otp-input/otp-input.js +29 -35
- package/dist/features/auth/comps/otp-input/otp-input.js.map +1 -1
- package/dist/features/auth/pla-signup/pla-analytics-events.js +3 -12
- package/dist/features/auth/pla-signup/pla-analytics-events.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js +34 -43
- 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 +101 -140
- package/dist/features/chapters-v2/chapter-details/chapter-details.js.map +1 -1
- package/dist/features/chapters-v2/utils/index.js +16 -20
- package/dist/features/chapters-v2/utils/index.js.map +1 -1
- package/dist/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.js +6 -6
- package/dist/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.js.map +1 -1
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js +21 -20
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js.map +1 -1
- package/dist/features/circle-games/games/web-view/web-view-types.js.map +1 -1
- package/dist/features/circle-games/sign-up/sign-up.js +6 -6
- package/dist/features/circle-games/sign-up/sign-up.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +17 -17
- 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 +0 -400
- package/dist/features/journey/mocks/chapter-page-journey-mock-data.js.map +1 -1
- package/dist/features/milestone/constants.js +15 -28
- package/dist/features/milestone/constants.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/sheets-list/sheets-list-styled.js +2 -2
- package/dist/features/milestone/create/comps/test-type-step/test-type-utils.js +16 -23
- package/dist/features/milestone/create/comps/test-type-step/test-type-utils.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-helpers.js +7 -13
- package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js +22 -28
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js.map +1 -1
- package/dist/features/parent-dashboard/hooks/use-fetch-parent-home.js +1 -1
- package/dist/features/parent-dashboard/hooks/use-fetch-parent-home.js.map +1 -1
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js +46 -48
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js.map +1 -1
- 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 +17 -16
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary.js.map +1 -1
- package/dist/features/parent-dashboard/modals/trial-report/trial-report-styled.js +8 -4
- package/dist/features/parent-dashboard/modals/trial-report/trial-report-styled.js.map +1 -1
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js +3 -3
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-constants.js +4 -45
- package/dist/features/parent-dashboard/parent-dashboard-constants.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-types.js +3 -3
- package/dist/features/parent-dashboard/parent-dashboard-types.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-view.js +174 -197
- package/dist/features/parent-dashboard/parent-dashboard-view.js.map +1 -1
- package/dist/features/stickers/sticker-selector/hooks/use-handle-sticker-send.js +32 -0
- package/dist/features/stickers/sticker-selector/hooks/use-handle-sticker-send.js.map +1 -0
- package/dist/features/stickers/sticker-selector/hooks/use-stickers-journey/use-stickers-journey.js +72 -0
- package/dist/features/stickers/sticker-selector/hooks/use-stickers-journey/use-stickers-journey.js.map +1 -0
- package/dist/features/stickers/sticker-selector/sticker-selector.js +58 -57
- package/dist/features/stickers/sticker-selector/sticker-selector.js.map +1 -1
- package/dist/features/stickers/stickers-effects/comps/sticker-with-fallback.js +34 -0
- package/dist/features/stickers/stickers-effects/comps/sticker-with-fallback.js.map +1 -0
- package/dist/features/stickers/stickers-effects/constants.js +26 -0
- package/dist/features/stickers/stickers-effects/constants.js.map +1 -0
- package/dist/features/stickers/stickers-effects/context/sticker-provider.js +28 -0
- package/dist/features/stickers/stickers-effects/context/sticker-provider.js.map +1 -0
- package/dist/features/stickers/stickers-effects/hooks/use-stickers.js +12 -0
- package/dist/features/stickers/stickers-effects/hooks/use-stickers.js.map +1 -0
- package/dist/features/stickers/stickers-effects/stickers-effects-helper.js.map +1 -1
- package/dist/features/stickers/stickers-effects/stickers-effects-styled.js +32 -17
- package/dist/features/stickers/stickers-effects/stickers-effects-styled.js.map +1 -1
- package/dist/features/stickers/stickers-effects/stickers-effects-types.js +6 -0
- package/dist/features/stickers/stickers-effects/stickers-effects-types.js.map +1 -0
- package/dist/features/stickers/stickers-effects/stickers-effects.js +40 -56
- package/dist/features/stickers/stickers-effects/stickers-effects.js.map +1 -1
- package/dist/features/student-details/class-details/class-details-utils.js +6 -6
- package/dist/features/trial-session/comps/class-preference/class-preference.js +58 -74
- package/dist/features/trial-session/comps/class-preference/class-preference.js.map +1 -1
- package/dist/features/trial-session/comps/learning-plan/index.js +45 -47
- package/dist/features/trial-session/comps/learning-plan/index.js.map +1 -1
- package/dist/features/trial-session/comps/navigation-bar/index.js +40 -41
- package/dist/features/trial-session/comps/navigation-bar/index.js.map +1 -1
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/next-steps/next-steps-constants.js +1 -1
- package/dist/features/trial-session/comps/pla/next-steps/next-steps-constants.js.map +1 -0
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/next-steps/next-steps-styled.js +1 -1
- package/dist/features/trial-session/comps/pla/next-steps/next-steps-styled.js.map +1 -0
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/next-steps/next-steps.js +5 -5
- 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/{parent-dashboard/comps → trial-session/comps/pla}/session-status/session-status-styled.js +2 -2
- 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/{parent-dashboard/comps → trial-session/comps/pla}/session-summary/session-summary-constants.js +12 -18
- 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/{parent-dashboard/comps → trial-session/comps/pla}/session-summary/summary-card/summary-card-styled.js +1 -1
- 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.map +1 -0
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/upcoming-sessions/upcoming-sessions-styled.js +1 -1
- 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.map +1 -0
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/upcoming-sessions/upcoming-sessions.js +14 -14
- 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 +57 -59
- package/dist/features/trial-session/comps/school-goals/school-goals.js.map +1 -1
- package/dist/features/trial-session/comps/session-report/session-report.js +15 -15
- package/dist/features/trial-session/comps/session-report/session-report.js.map +1 -1
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js +40 -41
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js.map +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js +0 -5
- package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js.map +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js +51 -96
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js.map +1 -1
- package/dist/features/trial-session/comps/student-profile/student-profile.js +63 -70
- 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.js +44 -43
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js.map +1 -1
- package/dist/features/trial-session/comps/test-prep/test-prep.js +40 -41
- package/dist/features/trial-session/comps/test-prep/test-prep.js.map +1 -1
- package/dist/features/trial-session/comps/trial-circle-game/trial-circle-game.js +61 -60
- package/dist/features/trial-session/comps/trial-circle-game/trial-circle-game.js.map +1 -1
- package/dist/features/trial-session/helper.js +61 -76
- package/dist/features/trial-session/helper.js.map +1 -1
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js +144 -174
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js.map +1 -1
- package/dist/features/trial-session/trial-session-types.js.map +1 -1
- package/dist/features/trial-session/trial-session-view.js +110 -99
- package/dist/features/trial-session/trial-session-view.js.map +1 -1
- package/dist/features/ui/accordion/accordion-items/accordion-items.js +13 -13
- package/dist/features/ui/accordion/accordion-items/accordion-items.js.map +1 -1
- package/dist/features/ui/modals/modal-styled.js +13 -45
- package/dist/features/ui/modals/modal-styled.js.map +1 -1
- package/dist/features/ui/modals/modal.js +31 -31
- package/dist/features/ui/modals/modal.js.map +1 -1
- package/dist/features/utils/utils.js +1 -1
- package/dist/features/utils/utils.js.map +1 -1
- package/dist/index.d.ts +145 -94
- package/dist/index.js +301 -292
- 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/static/trophy.a8ea85ef.json +6813 -0
- package/package.json +3 -2
- package/dist/features/journey/hooks/use-chapter-page-journey/use-download-block-journey.js +0 -86
- package/dist/features/journey/hooks/use-chapter-page-journey/use-download-block-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-chapter-page-journey/use-download-node-journey.js +0 -140
- package/dist/features/journey/hooks/use-chapter-page-journey/use-download-node-journey.js.map +0 -1
- package/dist/features/parent-dashboard/api/cancel-subscription.js +0 -9
- package/dist/features/parent-dashboard/api/cancel-subscription.js.map +0 -1
- package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js +0 -20
- package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js.map +0 -1
- package/dist/features/parent-dashboard/comps/billing-information/billing-information.js +0 -74
- package/dist/features/parent-dashboard/comps/billing-information/billing-information.js.map +0 -1
- package/dist/features/parent-dashboard/comps/next-steps/next-steps-constants.js.map +0 -1
- package/dist/features/parent-dashboard/comps/next-steps/next-steps-styled.js.map +0 -1
- package/dist/features/parent-dashboard/comps/next-steps/next-steps.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-countdown.js +0 -34
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-countdown.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-session-status-config.js +0 -137
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-session-status-config.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-status/session-status-constants.js +0 -20
- package/dist/features/parent-dashboard/comps/session-status/session-status-constants.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-status/session-status-helpers.js +0 -19
- package/dist/features/parent-dashboard/comps/session-status/session-status-helpers.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-status/session-status-styled.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-status/session-status.js +0 -124
- package/dist/features/parent-dashboard/comps/session-status/session-status.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-summary/session-summary-constants.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-summary/session-summary.js +0 -54
- package/dist/features/parent-dashboard/comps/session-summary/session-summary.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card-styled.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card.js +0 -72
- package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card.js.map +0 -1
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-constants.js.map +0 -1
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-styled.js.map +0 -1
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-types.js.map +0 -1
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions.js.map +0 -1
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription-constants.js +0 -21
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription-constants.js.map +0 -1
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription.js +0 -85
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription.js.map +0 -1
- package/dist/features/parent-dashboard/modals/cancellation-confirmation/cancellation-confirmation.js +0 -23
- package/dist/features/parent-dashboard/modals/cancellation-confirmation/cancellation-confirmation.js.map +0 -1
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-constant.js +0 -55
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-constant.js.map +0 -1
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js +0 -71
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js.map +0 -1
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason.js +0 -119
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason.js.map +0 -1
- package/dist/features/parent-dashboard/modals/hooks/use-pla-model-handlers.js +0 -58
- package/dist/features/parent-dashboard/modals/hooks/use-pla-model-handlers.js.map +0 -1
- package/dist/features/parent-dashboard/modals/view-payment-method/view-payment-method.js +0 -76
- package/dist/features/parent-dashboard/modals/view-payment-method/view-payment-method.js.map +0 -1
- package/dist/features/trial-session/api/teacher-availability.js +0 -9
- package/dist/features/trial-session/api/teacher-availability.js.map +0 -1
- package/dist/features/trial-session/comps/class-preference/helpers.js +0 -28
- package/dist/features/trial-session/comps/class-preference/helpers.js.map +0 -1
- package/dist/features/trial-session/hooks/use-slide-config-update.js +0 -49
- package/dist/features/trial-session/hooks/use-slide-config-update.js.map +0 -1
- package/dist/static/learning-session-grid-bg-mobile.8d2b7258.gif +0 -0
- package/dist/static/way-forward-grid-bg-mobile.374043d7.gif +0 -0
- package/dist/static/your-goals-grid-bg-mobile.62557024.gif +0 -0
- /package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/upcoming-sessions/upcoming-sessions-constants.js +0 -0
- /package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/upcoming-sessions/upcoming-sessions-types.js +0 -0
|
@@ -1,67 +1,51 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { generateStickerData as
|
|
6
|
-
import { Container as z, Sticker as
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
E,
|
|
24
|
-
{
|
|
25
|
-
data: r,
|
|
26
|
-
width: o,
|
|
27
|
-
height: o,
|
|
28
|
-
settings: s,
|
|
29
|
-
onError: () => e(!0)
|
|
30
|
-
}
|
|
31
|
-
);
|
|
32
|
-
}), $ = ({ stickerId: t, effect: i, count: o, duration: r }) => {
|
|
33
|
-
const [f, c] = l([]);
|
|
34
|
-
return d(() => {
|
|
35
|
-
const e = y({
|
|
36
|
-
count: o,
|
|
37
|
-
effect: i,
|
|
38
|
-
stickerId: t,
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { memo as E, useState as T, useEffect as s } from "react";
|
|
3
|
+
import g from "./comps/sticker-with-fallback.js";
|
|
4
|
+
import { EFFECTS_MAP as x } from "./constants.js";
|
|
5
|
+
import { generateStickerData as D } from "./stickers-effects-helper.js";
|
|
6
|
+
import { StickersWrapper as y, Container as z, Sticker as F } from "./stickers-effects-styled.js";
|
|
7
|
+
const j = ({
|
|
8
|
+
stickerId: c,
|
|
9
|
+
effectType: u,
|
|
10
|
+
duration: n = 3500,
|
|
11
|
+
onClose: i
|
|
12
|
+
}) => {
|
|
13
|
+
const [f, m] = T([]), t = x[u];
|
|
14
|
+
return s(() => {
|
|
15
|
+
if (!i) return;
|
|
16
|
+
const e = setTimeout(i, n);
|
|
17
|
+
return () => clearTimeout(e);
|
|
18
|
+
}, [i, n]), s(() => {
|
|
19
|
+
const e = D({
|
|
20
|
+
count: t.count,
|
|
21
|
+
effect: t.effect,
|
|
22
|
+
stickerId: c,
|
|
39
23
|
minSize: 48,
|
|
40
24
|
maxSize: 72
|
|
41
25
|
});
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
return () => clearTimeout(
|
|
45
|
-
}, [
|
|
46
|
-
const { id:
|
|
47
|
-
return /* @__PURE__ */
|
|
48
|
-
|
|
26
|
+
m(e);
|
|
27
|
+
const o = setTimeout(() => m([]), t.duration);
|
|
28
|
+
return () => clearTimeout(o);
|
|
29
|
+
}, [t, c]), f.length === 0 ? null : /* @__PURE__ */ r(y, { $alignItems: "top", $justifyContent: "center", $inherit: !0, children: /* @__PURE__ */ r(z, { children: f.map((e, o) => {
|
|
30
|
+
const { id: l, sticker: p, lottie: S, x: k, y: d, size: a, fromX: h, fromY: $ } = e;
|
|
31
|
+
return /* @__PURE__ */ r(
|
|
32
|
+
F,
|
|
49
33
|
{
|
|
50
|
-
effect:
|
|
51
|
-
duration:
|
|
34
|
+
effect: t.effect,
|
|
35
|
+
duration: t.duration,
|
|
52
36
|
delay: 500,
|
|
53
|
-
fromX:
|
|
54
|
-
fromY:
|
|
37
|
+
fromX: h,
|
|
38
|
+
fromY: $,
|
|
55
39
|
x: k,
|
|
56
|
-
y:
|
|
57
|
-
size:
|
|
58
|
-
children: /* @__PURE__ */
|
|
40
|
+
y: d,
|
|
41
|
+
size: a,
|
|
42
|
+
children: /* @__PURE__ */ r(g, { url: S, sticker: p, size: a })
|
|
59
43
|
},
|
|
60
|
-
`${
|
|
44
|
+
`${l}-${o}`
|
|
61
45
|
);
|
|
62
|
-
}) });
|
|
63
|
-
},
|
|
46
|
+
}) }) });
|
|
47
|
+
}, X = E(j);
|
|
64
48
|
export {
|
|
65
|
-
|
|
49
|
+
X as default
|
|
66
50
|
};
|
|
67
51
|
//# sourceMappingURL=stickers-effects.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stickers-effects.js","sources":["../../../../src/features/stickers/stickers-effects/stickers-effects.tsx"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"stickers-effects.js","sources":["../../../../src/features/stickers/stickers-effects/stickers-effects.tsx"],"sourcesContent":["import type { StickersEffectProps, TStickerAnimationData } from './stickers-effects-types';\n\nimport React, { memo, useEffect, useState } from 'react';\n\nimport StickerWithFallback from './comps/sticker-with-fallback';\nimport { EFFECTS_MAP } from './constants';\nimport { generateStickerData } from './stickers-effects-helper';\nimport * as Styled from './stickers-effects-styled';\n\nconst StickersEffect: React.FC<StickersEffectProps> = ({\n stickerId,\n effectType,\n duration = 3500,\n onClose,\n}) => {\n const [stickersData, setStickersData] = useState<ReturnType<typeof generateStickerData>>([]);\n\n const effectConfig = EFFECTS_MAP[effectType];\n\n useEffect(() => {\n if (!onClose) return;\n\n const timeout = setTimeout(onClose, duration);\n\n return () => clearTimeout(timeout);\n }, [onClose, duration]);\n\n useEffect(() => {\n const stickerData = generateStickerData({\n count: effectConfig.count,\n effect: effectConfig.effect,\n stickerId,\n minSize: 48,\n maxSize: 72,\n });\n\n setStickersData(stickerData);\n\n const timeout = setTimeout(() => setStickersData([]), effectConfig.duration);\n\n return () => clearTimeout(timeout);\n }, [effectConfig, stickerId]);\n\n if (stickersData.length === 0) return null;\n\n return (\n <Styled.StickersWrapper $alignItems=\"top\" $justifyContent=\"center\" $inherit>\n <Styled.Container>\n {stickersData.map((data: TStickerAnimationData, i) => {\n const { id, sticker, lottie, x, y, size, fromX, fromY } = data;\n\n return (\n <Styled.Sticker\n key={`${id}-${i}`}\n effect={effectConfig.effect}\n duration={effectConfig.duration}\n delay={500}\n fromX={fromX}\n fromY={fromY}\n x={x}\n y={y}\n size={size}\n >\n <StickerWithFallback url={lottie} sticker={sticker} size={size} />\n </Styled.Sticker>\n );\n })}\n </Styled.Container>\n </Styled.StickersWrapper>\n );\n};\n\nexport default memo(StickersEffect);\n"],"names":["StickersEffect","stickerId","effectType","duration","onClose","stickersData","setStickersData","useState","effectConfig","EFFECTS_MAP","useEffect","timeout","stickerData","generateStickerData","Styled.StickersWrapper","jsx","Styled.Container","data","i","id","sticker","lottie","x","y","size","fromX","fromY","Styled.Sticker","StickerWithFallback","StickersEffect$1","memo"],"mappings":";;;;;;AASA,MAAMA,IAAgD,CAAC;AAAA,EACrD,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,SAAAC;AACF,MAAM;AACJ,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAiD,CAAE,CAAA,GAErFC,IAAeC,EAAYP,CAAU;AA0BvC,SAxBJQ,EAAU,MAAM;AACd,QAAI,CAACN,EAAS;AAER,UAAAO,IAAU,WAAWP,GAASD,CAAQ;AAErC,WAAA,MAAM,aAAaQ,CAAO;AAAA,EAAA,GAChC,CAACP,GAASD,CAAQ,CAAC,GAEtBO,EAAU,MAAM;AACd,UAAME,IAAcC,EAAoB;AAAA,MACtC,OAAOL,EAAa;AAAA,MACpB,QAAQA,EAAa;AAAA,MACrB,WAAAP;AAAA,MACA,SAAS;AAAA,MACT,SAAS;AAAA,IAAA,CACV;AAED,IAAAK,EAAgBM,CAAW;AAErB,UAAAD,IAAU,WAAW,MAAML,EAAgB,CAAA,CAAE,GAAGE,EAAa,QAAQ;AAEpE,WAAA,MAAM,aAAaG,CAAO;AAAA,EAAA,GAChC,CAACH,GAAcP,CAAS,CAAC,GAExBI,EAAa,WAAW,IAAU,yBAGnCS,GAAA,EAAuB,aAAY,OAAM,iBAAgB,UAAS,UAAQ,IACzE,UAAA,gBAAAC,EAACC,GAAA,EACE,YAAa,IAAI,CAACC,GAA6BC,MAAM;AAC9C,UAAA,EAAE,IAAAC,GAAI,SAAAC,GAAS,QAAAC,GAAQ,GAAAC,GAAG,GAAAC,GAAG,MAAAC,GAAM,OAAAC,GAAO,OAAAC,EAAU,IAAAT;AAGxD,WAAA,gBAAAF;AAAA,MAACY;AAAAA,MAAA;AAAA,QAEC,QAAQnB,EAAa;AAAA,QACrB,UAAUA,EAAa;AAAA,QACvB,OAAO;AAAA,QACP,OAAAiB;AAAA,QACA,OAAAC;AAAA,QACA,GAAAJ;AAAA,QACA,GAAAC;AAAA,QACA,MAAAC;AAAA,QAEA,UAAC,gBAAAT,EAAAa,GAAA,EAAoB,KAAKP,GAAQ,SAAAD,GAAkB,MAAAI,GAAY;AAAA,MAAA;AAAA,MAV3D,GAAGL,CAAE,IAAID,CAAC;AAAA,IAAA;AAAA,EAWjB,CAEH,GACH,EACF,CAAA;AAEJ,GAEeW,IAAAC,EAAK9B,CAAc;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { startOfDay as s } from "../../../node_modules/date-fns/startOfDay.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { isAfter as n } from "../../../node_modules/date-fns/isAfter.js";
|
|
3
|
+
import { isBefore as i } from "../../../node_modules/date-fns/isBefore.js";
|
|
4
|
+
import { addDays as f } from "../../../node_modules/date-fns/addDays.js";
|
|
5
|
+
import { isToday as d } from "../../../node_modules/date-fns/isToday.js";
|
|
6
6
|
import { formatDate as m } from "../../../node_modules/date-fns/format.js";
|
|
7
7
|
const u = (e) => {
|
|
8
|
-
const o = /* @__PURE__ */ new Date(), t = new Date(e), r =
|
|
9
|
-
return
|
|
8
|
+
const o = /* @__PURE__ */ new Date(), t = new Date(e), r = f(s(o), 7);
|
|
9
|
+
return d(t) ? `Today, ${m(t, "hh:mm a")}` : n(t, o) && i(t, r) ? m(t, "eee, hh:mm a") : m(t, "MMM dd, hh:mm a");
|
|
10
10
|
}, M = (e, o, t) => {
|
|
11
11
|
const r = m(e * 1e3, "hh:mm a"), a = m((e + o + t) * 1e3, "hh:mm a");
|
|
12
12
|
return `${r} - ${a}`;
|
|
@@ -1,65 +1,49 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { DAYS as
|
|
4
|
-
import { getTimeUnits as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { useTrialSessionContext as
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
import { extractDayAndTimeFromEpoch as ee } from "./helpers.js";
|
|
16
|
-
const y = [
|
|
1
|
+
import { jsxs as d, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { memo as A, useCallback as O, useEffect as w } from "react";
|
|
3
|
+
import { DAYS as f } from "../../../../constants/date-time.js";
|
|
4
|
+
import { getTimeUnits as j, getOffsetBetweenTimezone as v, convertEpochToDateTime as g, convertToMilliseconds as H } from "../../../../helpers/date-time.js";
|
|
5
|
+
import $ from "../../../ui/inputs/select-input/select-input.js";
|
|
6
|
+
import u from "../../../ui/layout/flex-view.js";
|
|
7
|
+
import P from "../../../ui/separator/separator.js";
|
|
8
|
+
import W from "../../../ui/text/text.js";
|
|
9
|
+
import { useTrialSessionContext as z } from "../../context/use-trial-session-context.js";
|
|
10
|
+
import { TEACHER_TIMEZONE as y } from "../../trial-session-constants.js";
|
|
11
|
+
import B from "../slide-header/index.js";
|
|
12
|
+
import { timeSlots as Y } from "./class-preference-constants.js";
|
|
13
|
+
import { Container as F, PreferenceWrapper as K, FixedLineSeparator as M } from "./class-preference-styled.js";
|
|
14
|
+
const C = [
|
|
17
15
|
{ id: 1, selectedDay: "", selectedTime: "" },
|
|
18
16
|
{ id: 2, selectedDay: "", selectedTime: "" }
|
|
19
|
-
],
|
|
20
|
-
const { isTeacher:
|
|
21
|
-
(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
f({
|
|
25
|
-
preferences: (r ?? y).map(
|
|
26
|
-
(n) => n.id === e ? { ...n, [t]: i } : n
|
|
17
|
+
], se = A(({ miniScreenDevice: D }) => {
|
|
18
|
+
const { isTeacher: n, formData: x, updateSlideConfig: p } = z(), { preferences: o, studentTimezone: c } = x || {}, b = f.map((e) => ({ id: e, label: e })), h = n ? y : c, T = (e, t, s) => {
|
|
19
|
+
p({
|
|
20
|
+
preferences: (o ?? C).map(
|
|
21
|
+
(r) => r.id === e ? { ...r, [t]: s } : r
|
|
27
22
|
)
|
|
28
23
|
});
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
},
|
|
24
|
+
}, _ = (e, t) => {
|
|
25
|
+
T(e, "selectedDay", t);
|
|
26
|
+
}, S = (e, t) => {
|
|
27
|
+
T(e, "selectedTime", t);
|
|
28
|
+
}, E = O(
|
|
34
29
|
(e, t) => {
|
|
35
|
-
if (e && t &&
|
|
36
|
-
const { hours:
|
|
37
|
-
return
|
|
30
|
+
if (e && t && c) {
|
|
31
|
+
const { hours: s, minutes: r } = j(t), m = (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0), l = v(y, c), i = n ? m + l : m, { day: L = "" } = g(i, c), I = f.indexOf(L), X = (f.indexOf(e) - I + 7) % 7, k = i + H({ days: X, hours: s, minutes: r });
|
|
32
|
+
return g(k, h);
|
|
38
33
|
}
|
|
39
34
|
return {};
|
|
40
35
|
},
|
|
41
|
-
[
|
|
36
|
+
[n, c, h]
|
|
42
37
|
);
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
selectedTime: l.time
|
|
51
|
-
} : t
|
|
52
|
-
)), f({ preferences: e });
|
|
53
|
-
}
|
|
54
|
-
}, [o, r, l, f]), _(() => {
|
|
55
|
-
g("right", { isDisabled: !C, isLoading: !1 });
|
|
56
|
-
}, [C, g]), /* @__PURE__ */ m(J, { children: [
|
|
57
|
-
/* @__PURE__ */ c(R, { height: 60 }),
|
|
58
|
-
/* @__PURE__ */ c(U, {}),
|
|
59
|
-
/* @__PURE__ */ m(
|
|
60
|
-
Q,
|
|
38
|
+
return w(() => {
|
|
39
|
+
n && !o && p({ preferences: C });
|
|
40
|
+
}, [n, o, p]), /* @__PURE__ */ d(F, { children: [
|
|
41
|
+
/* @__PURE__ */ a(P, { height: 60 }),
|
|
42
|
+
/* @__PURE__ */ a(B, {}),
|
|
43
|
+
/* @__PURE__ */ d(
|
|
44
|
+
K,
|
|
61
45
|
{
|
|
62
|
-
$gapX:
|
|
46
|
+
$gapX: D ? 2.2 : 3.75,
|
|
63
47
|
$gutterX: 4.6875,
|
|
64
48
|
$background: "YELLOW_4",
|
|
65
49
|
$borderColor: "BLACK_1",
|
|
@@ -67,51 +51,51 @@ const y = [
|
|
|
67
51
|
$justifyContent: "space-between",
|
|
68
52
|
$alignItems: "center",
|
|
69
53
|
children: [
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
72
|
-
const { id: t, selectedDay:
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
54
|
+
/* @__PURE__ */ a(M, {}),
|
|
55
|
+
o == null ? void 0 : o.map((e) => {
|
|
56
|
+
const { id: t, selectedDay: s, selectedTime: r } = e, { day: m, time: l } = E(s, r);
|
|
57
|
+
return /* @__PURE__ */ d(u, { $widthX: 15, $background: "YELLOW_1", $borderColor: "BLACK_1", children: [
|
|
58
|
+
/* @__PURE__ */ d(u, { $gapX: 1.65, $gutterX: 2, $flexGapX: 0.25, children: [
|
|
59
|
+
/* @__PURE__ */ a(
|
|
60
|
+
$,
|
|
77
61
|
{
|
|
78
62
|
renderAs: "primary",
|
|
79
63
|
label: `Day ${t}`,
|
|
80
|
-
value:
|
|
81
|
-
options:
|
|
64
|
+
value: s,
|
|
65
|
+
options: b,
|
|
82
66
|
theme: "dark",
|
|
83
67
|
shape: "borderLess",
|
|
84
68
|
isTransparent: !0,
|
|
85
|
-
onChange: (
|
|
69
|
+
onChange: (i) => _(t, i)
|
|
86
70
|
}
|
|
87
71
|
),
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
|
|
72
|
+
/* @__PURE__ */ a(
|
|
73
|
+
$,
|
|
90
74
|
{
|
|
91
75
|
renderAs: "primary",
|
|
92
76
|
label: "Time",
|
|
93
|
-
value:
|
|
94
|
-
options:
|
|
77
|
+
value: r,
|
|
78
|
+
options: Y,
|
|
95
79
|
shape: "borderLess",
|
|
96
80
|
isTransparent: !0,
|
|
97
81
|
theme: "dark",
|
|
98
|
-
onChange: (
|
|
82
|
+
onChange: (i) => S(t, i)
|
|
99
83
|
}
|
|
100
84
|
)
|
|
101
85
|
] }),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
86
|
+
/* @__PURE__ */ a(
|
|
87
|
+
u,
|
|
104
88
|
{
|
|
105
89
|
$heightX: 3.125,
|
|
106
90
|
$gutterX: 2,
|
|
107
91
|
$justifyContent: "center",
|
|
108
92
|
$background: "WHITE_T_60",
|
|
109
|
-
children:
|
|
110
|
-
|
|
93
|
+
children: n ? /* @__PURE__ */ d(W, { $renderAs: "ac4-black", $align: "center", children: [
|
|
94
|
+
m ? m.slice(0, 3) : "__",
|
|
111
95
|
", ",
|
|
112
|
-
|
|
96
|
+
l || "__",
|
|
113
97
|
" ",
|
|
114
|
-
|
|
98
|
+
n ? "(IST)" : ""
|
|
115
99
|
] }) : null
|
|
116
100
|
}
|
|
117
101
|
)
|
|
@@ -123,6 +107,6 @@ const y = [
|
|
|
123
107
|
] });
|
|
124
108
|
});
|
|
125
109
|
export {
|
|
126
|
-
|
|
110
|
+
se as default
|
|
127
111
|
};
|
|
128
112
|
//# sourceMappingURL=class-preference.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-preference.js","sources":["../../../../../src/features/trial-session/comps/class-preference/class-preference.tsx"],"sourcesContent":["import type { IClassPreference, TPreference } from './class-preference-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { DAYS } from '../../../../constants/date-time';\nimport {\n convertEpochToDateTime,\n convertToMilliseconds,\n getOffsetBetweenTimezone,\n getTimeUnits,\n} from '../../../../helpers/date-time';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { isPLASource } from '../../helper';\nimport { TEACHER_TIMEZONE as teacherTimezone } from '../../trial-session-constants';\nimport SlideHeader from '../slide-header';\nimport { timeSlots } from './class-preference-constants';\nimport * as Styled from './class-preference-styled';\nimport { extractDayAndTimeFromEpoch } from './helpers';\n\nconst defaultPreferences = [\n { id: 1, selectedDay: '', selectedTime: '' },\n { id: 2, selectedDay: '', selectedTime: '' },\n];\n\nconst ClassPreference: FC<IClassPreference> = memo(({ miniScreenDevice }) => {\n const { isTeacher, formData, trialHomeData, updateSlideConfig, updateButtonState } =\n useTrialSessionContext();\n const { preferences, studentTimezone } = formData || {};\n const { demo_info: demoInfo, intel_student: intelStudent } = trialHomeData || {};\n const { scheduled_start_time: scheduledStartTime } = demoInfo || {};\n\n const daySlots = DAYS.map(day => ({ id: day, label: day }));\n const timezone = isTeacher ? teacherTimezone : studentTimezone;\n\n const preSelectedDateTimeFromEpoch = useMemo(\n () =>\n isTeacher && studentTimezone\n ? extractDayAndTimeFromEpoch(scheduledStartTime, studentTimezone)\n : undefined,\n [isTeacher, scheduledStartTime, studentTimezone],\n );\n\n const isPLA = isPLASource(intelStudent?.source);\n const hasRequiredFields = Boolean(\n isPLA\n ? preferences &&\n preferences.length > 0 &&\n preferences.every(preference => preference.selectedDay && preference.selectedTime)\n : true,\n );\n\n const handlePreferenceChange = (\n id: number,\n field: 'selectedDay' | 'selectedTime',\n value: string,\n ) => {\n updateSlideConfig({\n preferences: (preferences ?? defaultPreferences).map((preference: TPreference) =>\n preference.id === id ? { ...preference, [field]: value } : preference,\n ),\n });\n };\n\n const handleDayChange = (id: number, value: string) => {\n handlePreferenceChange(id, 'selectedDay', value);\n };\n\n const handleTimeChange = (id: number, value: string) => {\n handlePreferenceChange(id, 'selectedTime', value);\n };\n\n const getDisplayDateTimeValue = useCallback(\n (dayValue: string, timeValue: string) => {\n if (dayValue && timeValue && studentTimezone) {\n // Extracting hours, minutes, and period from the selected time.\n const { hours, minutes } = getTimeUnits(timeValue);\n const todayTimestamp = new Date().setHours(0, 0, 0, 0); // Setting current date to midnight\n\n // Calculating offset between the teacher's and student's timezone.\n const timestampOffset = getOffsetBetweenTimezone(teacherTimezone, studentTimezone);\n const studentTimestamp = isTeacher ? todayTimestamp + timestampOffset : todayTimestamp; // Current timestamp at student's timezone\n const { day: today = '' } = convertEpochToDateTime(studentTimestamp, studentTimezone); // Current day at student's timezone.\n\n // Calculating current and selected day index to get day difference.\n const currentDayIndex = DAYS.indexOf(today);\n const selectedDayIndex = DAYS.indexOf(dayValue);\n const dayDifference = (selectedDayIndex - currentDayIndex + 7) % 7;\n\n // Calculate the epoch timestamp for the selected day and time in the student's timezone.\n const epochTimestamp =\n studentTimestamp + convertToMilliseconds({ days: dayDifference, hours, minutes });\n\n // Returning date, time value with respect to both teacher and student timezone.\n return convertEpochToDateTime(epochTimestamp, timezone);\n }\n\n return {};\n },\n [isTeacher, studentTimezone, timezone],\n );\n\n useEffect(() => {\n // Only set preferences if teacher and preferences are not set\n if (isTeacher && (!preferences || !Array.isArray(preferences) || preferences.length === 0)) {\n let newPreferences = defaultPreferences;\n\n if (preSelectedDateTimeFromEpoch) {\n newPreferences = defaultPreferences.map((preference: TPreference) =>\n preference.id === 1\n ? {\n ...preference,\n selectedDay: preSelectedDateTimeFromEpoch.day,\n selectedTime: preSelectedDateTimeFromEpoch.time,\n }\n : preference,\n );\n }\n updateSlideConfig({ preferences: newPreferences });\n }\n }, [isTeacher, preferences, preSelectedDateTimeFromEpoch, updateSlideConfig]);\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: !hasRequiredFields, isLoading: false });\n }, [hasRequiredFields, updateButtonState]);\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.PreferenceWrapper\n $gapX={miniScreenDevice ? 2.2 : 3.75}\n $gutterX={4.6875}\n $background=\"YELLOW_4\"\n $borderColor=\"BLACK_1\"\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n >\n <Styled.FixedLineSeparator />\n {preferences?.map(preference => {\n const { id, selectedDay, selectedTime } = preference;\n const { day, time } = getDisplayDateTimeValue(selectedDay, selectedTime);\n\n return (\n <FlexView key={`slot-${id}`} $widthX={15} $background=\"YELLOW_1\" $borderColor=\"BLACK_1\">\n <FlexView $gapX={1.65} $gutterX={2} $flexGapX={0.25}>\n <SelectInput\n renderAs=\"primary\"\n label={`Day ${id}`}\n value={selectedDay}\n options={daySlots}\n theme=\"dark\"\n shape=\"borderLess\"\n isTransparent\n onChange={value => handleDayChange(id, value)}\n />\n <SelectInput\n renderAs=\"primary\"\n label=\"Time\"\n value={selectedTime}\n options={timeSlots}\n shape=\"borderLess\"\n isTransparent\n theme=\"dark\"\n onChange={value => handleTimeChange(id, value)}\n />\n </FlexView>\n <FlexView\n $heightX={3.125}\n $gutterX={2}\n $justifyContent=\"center\"\n $background=\"WHITE_T_60\"\n >\n {isTeacher ? (\n <Text $renderAs=\"ac4-black\" $align=\"center\">\n {day ? day.slice(0, 3) : '__'}, {time ? time : '__'} {isTeacher ? '(IST)' : ''}\n </Text>\n ) : null}\n </FlexView>\n </FlexView>\n );\n })}\n </Styled.PreferenceWrapper>\n </Styled.Container>\n );\n});\n\nexport default ClassPreference;\n"],"names":["defaultPreferences","ClassPreference","memo","miniScreenDevice","isTeacher","formData","trialHomeData","updateSlideConfig","updateButtonState","useTrialSessionContext","preferences","studentTimezone","demoInfo","intelStudent","scheduledStartTime","daySlots","DAYS","day","timezone","teacherTimezone","preSelectedDateTimeFromEpoch","useMemo","extractDayAndTimeFromEpoch","hasRequiredFields","isPLASource","preference","handlePreferenceChange","id","field","value","handleDayChange","handleTimeChange","getDisplayDateTimeValue","useCallback","dayValue","timeValue","hours","minutes","getTimeUnits","todayTimestamp","timestampOffset","getOffsetBetweenTimezone","studentTimestamp","today","convertEpochToDateTime","currentDayIndex","dayDifference","epochTimestamp","convertToMilliseconds","useEffect","newPreferences","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.PreferenceWrapper","Styled.FixedLineSeparator","selectedDay","selectedTime","time","FlexView","SelectInput","timeSlots","Text"],"mappings":";;;;;;;;;;;;;;;AAwBA,MAAMA,IAAqB;AAAA,EACzB,EAAE,IAAI,GAAG,aAAa,IAAI,cAAc,GAAG;AAAA,EAC3C,EAAE,IAAI,GAAG,aAAa,IAAI,cAAc,GAAG;AAC7C,GAEMC,KAAwCC,EAAK,CAAC,EAAE,kBAAAC,QAAuB;AAC3E,QAAM,EAAE,WAAAC,GAAW,UAAAC,GAAU,eAAAC,GAAe,mBAAAC,GAAmB,mBAAAC,EAAA,IAC7DC,KACI,EAAE,aAAAC,GAAa,iBAAAC,MAAoBN,KAAY,CAAA,GAC/C,EAAE,WAAWO,GAAU,eAAeC,EAAa,IAAIP,KAAiB,IACxE,EAAE,sBAAsBQ,MAAuBF,KAAY,CAAA,GAE3DG,IAAWC,EAAK,IAAI,CAAAC,OAAQ,EAAE,IAAIA,GAAK,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A,IACH;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
|
1
|
+
{"version":3,"file":"class-preference.js","sources":["../../../../../src/features/trial-session/comps/class-preference/class-preference.tsx"],"sourcesContent":["import type { IClassPreference, TPreference } from './class-preference-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect } from 'react';\n\nimport { DAYS } from '../../../../constants/date-time';\nimport {\n convertEpochToDateTime,\n convertToMilliseconds,\n getOffsetBetweenTimezone,\n getTimeUnits,\n} from '../../../../helpers/date-time';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { TEACHER_TIMEZONE as teacherTimezone } from '../../trial-session-constants';\nimport SlideHeader from '../slide-header';\nimport { timeSlots } from './class-preference-constants';\nimport * as Styled from './class-preference-styled';\n\nconst defaultPreferences = [\n { id: 1, selectedDay: '', selectedTime: '' },\n { id: 2, selectedDay: '', selectedTime: '' },\n];\n\nconst ClassPreference: FC<IClassPreference> = memo(({ miniScreenDevice }) => {\n const { isTeacher, formData, updateSlideConfig } = useTrialSessionContext();\n const { preferences, studentTimezone } = formData || {};\n\n const daySlots = DAYS.map(day => ({ id: day, label: day }));\n const timezone = isTeacher ? teacherTimezone : studentTimezone;\n\n const handlePreferenceChange = (\n id: number,\n field: 'selectedDay' | 'selectedTime',\n value: string,\n ) => {\n updateSlideConfig({\n preferences: (preferences ?? defaultPreferences).map((preference: TPreference) =>\n preference.id === id ? { ...preference, [field]: value } : preference,\n ),\n });\n };\n\n const handleDayChange = (id: number, value: string) => {\n handlePreferenceChange(id, 'selectedDay', value);\n };\n\n const handleTimeChange = (id: number, value: string) => {\n handlePreferenceChange(id, 'selectedTime', value);\n };\n\n const getDisplayDateTimeValue = useCallback(\n (dayValue: string, timeValue: string) => {\n if (dayValue && timeValue && studentTimezone) {\n // Extracting hours, minutes, and period from the selected time.\n const { hours, minutes } = getTimeUnits(timeValue);\n const todayTimestamp = new Date().setHours(0, 0, 0, 0); // Setting current date to midnight\n\n // Calculating offset between the teacher's and student's timezone.\n const timestampOffset = getOffsetBetweenTimezone(teacherTimezone, studentTimezone);\n const studentTimestamp = isTeacher ? todayTimestamp + timestampOffset : todayTimestamp; // Current timestamp at student's timezone\n const { day: today = '' } = convertEpochToDateTime(studentTimestamp, studentTimezone); // Current day at student's timezone.\n\n // Calculating current and selected day index to get day difference.\n const currentDayIndex = DAYS.indexOf(today);\n const selectedDayIndex = DAYS.indexOf(dayValue);\n const dayDifference = (selectedDayIndex - currentDayIndex + 7) % 7;\n\n // Calculate the epoch timestamp for the selected day and time in the student's timezone.\n const epochTimestamp =\n studentTimestamp + convertToMilliseconds({ days: dayDifference, hours, minutes });\n\n // Returning date, time value with respect to both teacher and student timezone.\n return convertEpochToDateTime(epochTimestamp, timezone);\n }\n\n return {};\n },\n [isTeacher, studentTimezone, timezone],\n );\n\n useEffect(() => {\n if (isTeacher && !preferences) {\n updateSlideConfig({ preferences: defaultPreferences });\n }\n }, [isTeacher, preferences, updateSlideConfig]);\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.PreferenceWrapper\n $gapX={miniScreenDevice ? 2.2 : 3.75}\n $gutterX={4.6875}\n $background=\"YELLOW_4\"\n $borderColor=\"BLACK_1\"\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n >\n <Styled.FixedLineSeparator />\n {preferences?.map(preference => {\n const { id, selectedDay, selectedTime } = preference;\n const { day, time } = getDisplayDateTimeValue(selectedDay, selectedTime);\n\n return (\n <FlexView key={`slot-${id}`} $widthX={15} $background=\"YELLOW_1\" $borderColor=\"BLACK_1\">\n <FlexView $gapX={1.65} $gutterX={2} $flexGapX={0.25}>\n <SelectInput\n renderAs=\"primary\"\n label={`Day ${id}`}\n value={selectedDay}\n options={daySlots}\n theme=\"dark\"\n shape=\"borderLess\"\n isTransparent\n onChange={value => handleDayChange(id, value)}\n />\n <SelectInput\n renderAs=\"primary\"\n label=\"Time\"\n value={selectedTime}\n options={timeSlots}\n shape=\"borderLess\"\n isTransparent\n theme=\"dark\"\n onChange={value => handleTimeChange(id, value)}\n />\n </FlexView>\n <FlexView\n $heightX={3.125}\n $gutterX={2}\n $justifyContent=\"center\"\n $background=\"WHITE_T_60\"\n >\n {isTeacher ? (\n <Text $renderAs=\"ac4-black\" $align=\"center\">\n {day ? day.slice(0, 3) : '__'}, {time ? time : '__'} {isTeacher ? '(IST)' : ''}\n </Text>\n ) : null}\n </FlexView>\n </FlexView>\n );\n })}\n </Styled.PreferenceWrapper>\n </Styled.Container>\n );\n});\n\nexport default ClassPreference;\n"],"names":["defaultPreferences","ClassPreference","memo","miniScreenDevice","isTeacher","formData","updateSlideConfig","useTrialSessionContext","preferences","studentTimezone","daySlots","DAYS","day","timezone","teacherTimezone","handlePreferenceChange","id","field","value","preference","handleDayChange","handleTimeChange","getDisplayDateTimeValue","useCallback","dayValue","timeValue","hours","minutes","getTimeUnits","todayTimestamp","timestampOffset","getOffsetBetweenTimezone","studentTimestamp","today","convertEpochToDateTime","currentDayIndex","dayDifference","epochTimestamp","convertToMilliseconds","useEffect","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.PreferenceWrapper","Styled.FixedLineSeparator","selectedDay","selectedTime","time","FlexView","SelectInput","timeSlots","Text"],"mappings":";;;;;;;;;;;;;AAsBA,MAAMA,IAAqB;AAAA,EACzB,EAAE,IAAI,GAAG,aAAa,IAAI,cAAc,GAAG;AAAA,EAC3C,EAAE,IAAI,GAAG,aAAa,IAAI,cAAc,GAAG;AAC7C,GAEMC,KAAwCC,EAAK,CAAC,EAAE,kBAAAC,QAAuB;AAC3E,QAAM,EAAE,WAAAC,GAAW,UAAAC,GAAU,mBAAAC,MAAsBC,EAAuB,GACpE,EAAE,aAAAC,GAAa,iBAAAC,MAAoBJ,KAAY,CAAA,GAE/CK,IAA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BACb,OAAM;AAAA,oBACN,UAAU,CAAAlC,MAASG,EAAiBL,GAAIE,CAAK;AAAA,kBAAA;AAAA,gBAC/C;AAAA,cAAA,GACF;AAAA,cACA,gBAAAwB;AAAA,gBAACQ;AAAA,gBAAA;AAAA,kBACC,UAAU;AAAA,kBACV,UAAU;AAAA,kBACV,iBAAgB;AAAA,kBAChB,aAAY;AAAA,kBAEX,cACE,gBAAAV,EAAAa,GAAA,EAAK,WAAU,aAAY,QAAO,UAChC,UAAA;AAAA,oBAAAzC,IAAMA,EAAI,MAAM,GAAG,CAAC,IAAI;AAAA,oBAAK;AAAA,oBAAGqC,KAAc;AAAA,oBAAK;AAAA,oBAAE7C,IAAY,UAAU;AAAA,kBAAA,EAAA,CAC9E,IACE;AAAA,gBAAA;AAAA,cACN;AAAA,YAlCa,EAAA,GAAA,QAAQY,CAAE,EAmCzB;AAAA,UAAA;AAAA,QAEH;AAAA,MAAA;AAAA,IACH;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
|
@@ -1,65 +1,63 @@
|
|
|
1
|
-
import { jsx as o, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { useRef as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useTrialSessionContext as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
publishScrollEvents: f,
|
|
16
|
-
closeChannel: T,
|
|
1
|
+
import { jsx as o, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import k from "../../../../node_modules/lodash.throttle/index.js";
|
|
3
|
+
import { useRef as h, useCallback as l, useMemo as D, useEffect as m } from "react";
|
|
4
|
+
import N from "../../../chapters-v2/chapter-details/chapter-details.js";
|
|
5
|
+
import O from "../../../milestone/milestone-list-container/milestone-list-container.js";
|
|
6
|
+
import { useTrialSessionContext as x } from "../../context/use-trial-session-context.js";
|
|
7
|
+
import { Container as $, Wrapper as H, ChapterWrapper as M } from "./learning-plan-styled.js";
|
|
8
|
+
import { useLearningPlanScrollSync as F } from "./use-learning-plan-scroll-sync.js";
|
|
9
|
+
const z = () => {
|
|
10
|
+
const { trialHomeData: P, studentId: s, formData: L, isTeacher: r, updateSlideConfig: c } = x(), {
|
|
11
|
+
demo_info: { student_classroom_id: S, stream: g }
|
|
12
|
+
} = P || {}, { name: I = "", chapterId: i } = L || {}, t = h(null), a = h([]), d = h(!1), {
|
|
13
|
+
publishScrollEvents: p,
|
|
14
|
+
closeChannel: C,
|
|
17
15
|
scrollPoints: n
|
|
18
|
-
} =
|
|
19
|
-
if (i &&
|
|
16
|
+
} = F(S), T = l(() => {
|
|
17
|
+
if (i && s) {
|
|
20
18
|
const e = t.current;
|
|
21
19
|
e == null || e.scrollTo({
|
|
22
20
|
top: 0,
|
|
23
21
|
behavior: "smooth"
|
|
24
22
|
});
|
|
25
23
|
}
|
|
26
|
-
}, [
|
|
24
|
+
}, [s, i]), R = l(
|
|
27
25
|
(e) => {
|
|
28
26
|
c({
|
|
29
27
|
chapterId: e.id
|
|
30
28
|
});
|
|
31
29
|
},
|
|
32
30
|
[c]
|
|
33
|
-
),
|
|
31
|
+
), A = l(() => {
|
|
34
32
|
c({
|
|
35
33
|
chapterId: void 0
|
|
36
34
|
});
|
|
37
|
-
}, [c]),
|
|
38
|
-
a.current.length === 0 ||
|
|
35
|
+
}, [c]), E = l(() => {
|
|
36
|
+
a.current.length === 0 || d.current || (d.current = !0, p && p({
|
|
39
37
|
eventName: "TRIAL_SESSION_GOAL_PLAN_SCROLL",
|
|
40
38
|
eventPayload: {
|
|
41
39
|
scrollPoints: a.current
|
|
42
40
|
}
|
|
43
|
-
}), a.current = [],
|
|
44
|
-
}, [
|
|
41
|
+
}), a.current = [], d.current = !1);
|
|
42
|
+
}, [p]), v = D(() => k(E, 500), [E]), f = l(() => {
|
|
45
43
|
var u;
|
|
46
44
|
const e = ((u = t.current) == null ? void 0 : u.scrollTop) || 0;
|
|
47
|
-
a.current.push(e),
|
|
48
|
-
}, [
|
|
45
|
+
a.current.push(e), v();
|
|
46
|
+
}, [v]);
|
|
49
47
|
return m(() => {
|
|
50
|
-
|
|
51
|
-
}, [
|
|
48
|
+
T();
|
|
49
|
+
}, [T]), m(() => {
|
|
52
50
|
if (t.current && r) {
|
|
53
51
|
const e = t.current;
|
|
54
|
-
return e.addEventListener("scroll",
|
|
55
|
-
e && e.removeEventListener("scroll",
|
|
52
|
+
return e.addEventListener("scroll", f), () => {
|
|
53
|
+
e && e.removeEventListener("scroll", f);
|
|
56
54
|
};
|
|
57
55
|
}
|
|
58
|
-
}, [r,
|
|
56
|
+
}, [r, f]), m(() => {
|
|
59
57
|
const e = t.current;
|
|
60
58
|
if (n && Array.isArray(n) && !r && e) {
|
|
61
59
|
const u = Math.floor(
|
|
62
|
-
n.reduce((
|
|
60
|
+
n.reduce((b, y) => b + y, 0) / n.length
|
|
63
61
|
);
|
|
64
62
|
e.scrollTo({
|
|
65
63
|
top: u,
|
|
@@ -67,32 +65,32 @@ const Q = () => {
|
|
|
67
65
|
});
|
|
68
66
|
}
|
|
69
67
|
}, [n, r]), m(() => () => {
|
|
70
|
-
|
|
71
|
-
}, [
|
|
72
|
-
|
|
68
|
+
C();
|
|
69
|
+
}, [C]), /* @__PURE__ */ o($, { ref: t, $isScrollable: r, children: /* @__PURE__ */ o(
|
|
70
|
+
H,
|
|
73
71
|
{
|
|
74
72
|
$clickable: r,
|
|
75
73
|
$gutterX: 2,
|
|
76
74
|
$isScrollable: r,
|
|
77
75
|
id: "milestone-list-element-container",
|
|
78
|
-
children: i ? /* @__PURE__ */ o(
|
|
79
|
-
|
|
76
|
+
children: i ? /* @__PURE__ */ o(_, { children: /* @__PURE__ */ o(M, { children: /* @__PURE__ */ o(
|
|
77
|
+
N,
|
|
80
78
|
{
|
|
81
79
|
userChapterId: i,
|
|
82
|
-
studentId:
|
|
80
|
+
studentId: s,
|
|
83
81
|
userType: r ? "TEACHER" : "STUDENT",
|
|
84
|
-
onExit:
|
|
82
|
+
onExit: A
|
|
85
83
|
}
|
|
86
84
|
) }) }) : /* @__PURE__ */ o(
|
|
87
|
-
|
|
85
|
+
O,
|
|
88
86
|
{
|
|
89
87
|
userType: r ? "TEACHER" : "STUDENT",
|
|
90
|
-
studentName:
|
|
91
|
-
studentId:
|
|
92
|
-
studentClassroomId:
|
|
93
|
-
milestoneType:
|
|
94
|
-
onChapterClick:
|
|
95
|
-
courseStream:
|
|
88
|
+
studentName: I,
|
|
89
|
+
studentId: s,
|
|
90
|
+
studentClassroomId: S,
|
|
91
|
+
milestoneType: "DRAFT",
|
|
92
|
+
onChapterClick: R,
|
|
93
|
+
courseStream: g,
|
|
96
94
|
isTrialSession: !0
|
|
97
95
|
}
|
|
98
96
|
)
|
|
@@ -100,6 +98,6 @@ const Q = () => {
|
|
|
100
98
|
) });
|
|
101
99
|
};
|
|
102
100
|
export {
|
|
103
|
-
|
|
101
|
+
z as default
|
|
104
102
|
};
|
|
105
103
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/features/trial-session/comps/learning-plan/index.tsx"],"sourcesContent":["import type { IChapterDataProps } from '../../../chapters/chapter/chapter-types';\n\nimport throttle from 'lodash.throttle';\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport ChapterDetails from '../../../chapters-v2/chapter-details/chapter-details';\nimport MilestoneList from '../../../milestone/milestone-list-container/milestone-list-container';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/features/trial-session/comps/learning-plan/index.tsx"],"sourcesContent":["import type { IChapterDataProps } from '../../../chapters/chapter/chapter-types';\n\nimport throttle from 'lodash.throttle';\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport ChapterDetails from '../../../chapters-v2/chapter-details/chapter-details';\nimport MilestoneList from '../../../milestone/milestone-list-container/milestone-list-container';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport * as Styled from './learning-plan-styled';\nimport { useLearningPlanScrollSync } from './use-learning-plan-scroll-sync';\n\nconst LearningPlan: React.FC = () => {\n const { trialHomeData, studentId, formData, isTeacher, updateSlideConfig } =\n useTrialSessionContext();\n const {\n demo_info: { student_classroom_id: studentClassroomId, stream },\n } = trialHomeData || {};\n const { name = '', chapterId } = formData || {};\n\n const containerRef = useRef<HTMLDivElement>(null);\n const scrollPointsRef = useRef<number[]>([]);\n const isSendingScrollPointsRef = useRef(false);\n\n const {\n publishScrollEvents,\n closeChannel,\n scrollPoints: receivedScrollPoints,\n } = useLearningPlanScrollSync(studentClassroomId);\n\n const fetchChapter = useCallback(() => {\n if (chapterId && studentId) {\n const scrollElement = containerRef.current;\n\n scrollElement?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }\n }, [studentId, chapterId]);\n\n const handleOnChapterClick = useCallback(\n (chapter: IChapterDataProps) => {\n updateSlideConfig({\n chapterId: chapter.id,\n });\n },\n [updateSlideConfig],\n );\n\n const handleOnBackIconClick = useCallback(() => {\n updateSlideConfig({\n chapterId: undefined,\n });\n }, [updateSlideConfig]);\n\n const sendScrollPoints = useCallback(() => {\n if (scrollPointsRef.current.length === 0 || isSendingScrollPointsRef.current) return;\n\n isSendingScrollPointsRef.current = true;\n\n if (publishScrollEvents) {\n publishScrollEvents({\n eventName: 'TRIAL_SESSION_GOAL_PLAN_SCROLL',\n eventPayload: {\n scrollPoints: scrollPointsRef.current,\n },\n });\n }\n\n scrollPointsRef.current = [];\n isSendingScrollPointsRef.current = false;\n }, [publishScrollEvents]);\n\n const throttleSend = useMemo(() => throttle(sendScrollPoints, 500), [sendScrollPoints]);\n\n const handleScroll = useCallback(() => {\n const scrollPoint = containerRef.current?.scrollTop || 0;\n\n scrollPointsRef.current.push(scrollPoint);\n\n throttleSend();\n }, [throttleSend]);\n\n useEffect(() => {\n fetchChapter();\n }, [fetchChapter]);\n\n useEffect(() => {\n if (containerRef.current) {\n if (isTeacher) {\n const scrollElement = containerRef.current;\n\n scrollElement.addEventListener('scroll', handleScroll);\n\n return () => {\n if (scrollElement) {\n scrollElement.removeEventListener('scroll', handleScroll);\n }\n };\n }\n }\n }, [isTeacher, handleScroll]);\n\n useEffect(() => {\n const scrollElement = containerRef.current;\n\n if (\n receivedScrollPoints &&\n Array.isArray(receivedScrollPoints) &&\n !isTeacher &&\n scrollElement\n ) {\n const averageScroll = Math.floor(\n receivedScrollPoints.reduce((a, b) => a + b, 0) / receivedScrollPoints.length,\n );\n\n scrollElement.scrollTo({\n top: averageScroll,\n behavior: 'smooth',\n });\n }\n }, [receivedScrollPoints, isTeacher]);\n\n useEffect(() => {\n return () => {\n closeChannel();\n };\n }, [closeChannel]);\n\n return (\n <Styled.Container ref={containerRef} $isScrollable={isTeacher}>\n <Styled.Wrapper\n $clickable={isTeacher}\n $gutterX={2}\n $isScrollable={isTeacher}\n id=\"milestone-list-element-container\"\n >\n {chapterId ? (\n <>\n <Styled.ChapterWrapper>\n <ChapterDetails\n userChapterId={chapterId}\n studentId={studentId}\n userType={isTeacher ? 'TEACHER' : 'STUDENT'}\n onExit={handleOnBackIconClick}\n />\n </Styled.ChapterWrapper>\n </>\n ) : (\n <MilestoneList\n userType={isTeacher ? 'TEACHER' : 'STUDENT'}\n studentName={name}\n studentId={studentId}\n studentClassroomId={studentClassroomId}\n milestoneType=\"DRAFT\"\n onChapterClick={handleOnChapterClick}\n courseStream={stream}\n isTrialSession\n />\n )}\n </Styled.Wrapper>\n </Styled.Container>\n );\n};\n\nexport default LearningPlan;\n"],"names":["LearningPlan","trialHomeData","studentId","formData","isTeacher","updateSlideConfig","useTrialSessionContext","studentClassroomId","stream","name","chapterId","containerRef","useRef","scrollPointsRef","isSendingScrollPointsRef","publishScrollEvents","closeChannel","receivedScrollPoints","useLearningPlanScrollSync","fetchChapter","useCallback","scrollElement","handleOnChapterClick","chapter","handleOnBackIconClick","sendScrollPoints","throttleSend","useMemo","throttle","handleScroll","scrollPoint","_a","useEffect","averageScroll","a","b","Styled.Container","jsx","Styled.Wrapper","Fragment","Styled.ChapterWrapper","ChapterDetails","MilestoneList"],"mappings":";;;;;;;;AAWA,MAAMA,IAAyB,MAAM;AACnC,QAAM,EAAE,eAAAC,GAAe,WAAAC,GAAW,UAAAC,GAAU,WAAAC,GAAW,mBAAAC,EAAA,IACrDC,KACI;AAAA,IACJ,WAAW,EAAE,sBAAsBC,GAAoB,QAAAC,EAAO;AAAA,EAAA,IAC5DP,KAAiB,CAAA,GACf,EAAE,MAAAQ,IAAO,IAAI,WAAAC,EAAU,IAAIP,KAAY,CAAA,GAEvCQ,IAAeC,EAAuB,IAAI,GAC1CC,IAAkBD,EAAiB,CAAA,CAAE,GACrCE,IAA2BF,EAAO,EAAK,GAEvC;AAAA,IACJ,qBAAAG;AAAA,IACA,cAAAC;AAAA,IACA,cAAcC;AAAA,EAAA,IACZC,EAA0BX,CAAkB,GAE1CY,IAAeC,EAAY,MAAM;AACrC,QAAIV,KAAaR,GAAW;AAC1B,YAAMmB,IAAgBV,EAAa;AAEnC,MAAAU,KAAA,QAAAA,EAAe,SAAS;AAAA,QACtB,KAAK;AAAA,QACL,UAAU;AAAA,MAAA;AAAA,IAEd;AAAA,EAAA,GACC,CAACnB,GAAWQ,CAAS,CAAC,GAEnBY,IAAuBF;AAAA,IAC3B,CAACG,MAA+B;AACZ,MAAAlB,EAAA;AAAA,QAChB,WAAWkB,EAAQ;AAAA,MAAA,CACpB;AAAA,IACH;AAAA,IACA,CAAClB,CAAiB;AAAA,EAAA,GAGdmB,IAAwBJ,EAAY,MAAM;AAC5B,IAAAf,EAAA;AAAA,MAChB,WAAW;AAAA,IAAA,CACZ;AAAA,EAAA,GACA,CAACA,CAAiB,CAAC,GAEhBoB,IAAmBL,EAAY,MAAM;AACzC,IAAIP,EAAgB,QAAQ,WAAW,KAAKC,EAAyB,YAErEA,EAAyB,UAAU,IAE/BC,KACkBA,E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