@cuemath/leap 2.8.21-rj-3 → 2.8.21-rj-6

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.
@@ -1,17 +1,17 @@
1
- import { useState as u, useCallback as _, useEffect as k } from "react";
2
- import { useGetCircleHomeAPI as y } from "../../api/get-content-for-today/get-circle-home-api.js";
3
- import { ProjectType as s } from "../../../games/web-view/enums/project-type-enum.js";
4
- const f = (r, o, n) => {
5
- const [m, l] = u(null), { data: a, get: c, isProcessed: e, ...d } = y(), p = _(() => {
6
- c("", {
1
+ import { useState as E, useCallback as d, useEffect as p } from "react";
2
+ import { useGetCircleHomeAPI as C } from "../../api/get-content-for-today/get-circle-home-api.js";
3
+ import { ProjectType as i } from "../../../games/web-view/enums/project-type-enum.js";
4
+ const O = (r, o, n) => {
5
+ const [c, _] = E(null), { data: a, get: m, isProcessed: e, ...l } = C(), R = d(() => {
6
+ m("", {
7
7
  user_id: r,
8
8
  country_code: o,
9
9
  grade: n
10
10
  });
11
- }, [c, r, o, n]);
12
- return k(() => {
13
- let i = null;
14
- e && a && (i = {
11
+ }, [m, r, o, n]);
12
+ return p(() => {
13
+ let s = null;
14
+ e && a && (s = {
15
15
  points: a.points,
16
16
  streakDays: a.streak_days,
17
17
  streakStatus: a.streak_status,
@@ -19,7 +19,7 @@ const f = (r, o, n) => {
19
19
  projects: {
20
20
  games: {
21
21
  label: a.projects.games.label,
22
- type: s.GAME,
22
+ type: i.GAME,
23
23
  initialProgressValue: 0,
24
24
  data: a.projects.games.data.map((t) => ({
25
25
  id: t.id,
@@ -32,7 +32,7 @@ const f = (r, o, n) => {
32
32
  },
33
33
  puzzles: {
34
34
  label: a.projects.puzzles.label,
35
- type: s.PUZZLE,
35
+ type: i.PUZZLE,
36
36
  initialProgressValue: 0,
37
37
  data: a.projects.puzzles.data.map((t) => ({
38
38
  id: t.id,
@@ -52,15 +52,15 @@ const f = (r, o, n) => {
52
52
  current: a.timestamps.current
53
53
  },
54
54
  coachmarkProgress: {
55
- activity: a.coachmark_completion.activity,
56
- tutorial: a.coachmark_completion.tutorial,
57
- points: a.coachmark_completion.points,
58
- streak: a.coachmark_completion.streak,
59
- leaderboard: a.coachmark_completion.leaderboard
55
+ CIRCLE_ACTIVITIES_INTRO_JOURNEY: a.coachmark_completion.CIRCLE_ACTIVITIES_INTRO_JOURNEY,
56
+ CIRCLE_LEADERBOARD_INTRO_JOURNEY: a.coachmark_completion.CIRCLE_LEADERBOARD_INTRO_JOURNEY,
57
+ CIRCLE_POINTS_REWARD_JOURNEY: a.coachmark_completion.CIRCLE_POINTS_REWARD_JOURNEY,
58
+ CIRCLE_STREAK_UPDATE_JOURNEY: a.coachmark_completion.CIRCLE_STREAK_UPDATE_JOURNEY,
59
+ CIRCLE_TUTORIAL_JOURNEY: a.coachmark_completion.CIRCLE_TUTORIAL_JOURNEY
60
60
  }
61
- }, a.projects.lessons && (i.projects.lessons = {
61
+ }, a.projects.lessons && (s.projects.lessons = {
62
62
  label: a.projects.lessons.label,
63
- type: s.LESSON,
63
+ type: i.LESSON,
64
64
  initialProgressValue: 0,
65
65
  data: a.projects.lessons.data.map((t) => ({
66
66
  id: t.id,
@@ -73,10 +73,10 @@ const f = (r, o, n) => {
73
73
  targetQuestions: t.target_questions,
74
74
  status: t.status
75
75
  }))
76
- })), l(i);
77
- }, [a, e]), { data: m, isProcessed: e, getCircleHomeDetails: p, ...d };
76
+ })), _(s);
77
+ }, [a, e]), { data: c, isProcessed: e, getCircleHomeDetails: R, ...l };
78
78
  };
79
79
  export {
80
- f as useGetCircleHomeDetailsDal
80
+ O as useGetCircleHomeDetailsDal
81
81
  };
82
82
  //# sourceMappingURL=use-get-circle-home-details-dal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-get-circle-home-details-dal.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.ts"],"sourcesContent":["import type { ICircleHomeDetails, TStreakStatus } from './use-get-circle-home-dal-types';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { useGetCircleHomeAPI } from '../../api/get-content-for-today/get-circle-home-api';\n\nexport const useGetCircleHomeDetailsDal = (\n userId: string,\n countryCode: string,\n grade: string,\n): Omit<ReturnType<typeof useGetCircleHomeAPI>, 'data' | 'get'> & {\n data: ICircleHomeDetails | null;\n getCircleHomeDetails: () => void;\n} => {\n const [contentForToday, setContentForToday] = useState<ICircleHomeDetails | null>(null);\n const { data, get: getHomeDetails, isProcessed, ...rest } = useGetCircleHomeAPI();\n\n const getCircleHomeDetails = useCallback(() => {\n getHomeDetails('', {\n user_id: userId,\n country_code: countryCode,\n grade: grade,\n });\n }, [getHomeDetails, userId, countryCode, grade]);\n\n useEffect(() => {\n let circleHomeDetails: ICircleHomeDetails | null = null;\n\n if (isProcessed && data) {\n circleHomeDetails = {\n points: data.points,\n streakDays: data.streak_days,\n streakStatus: data.streak_status as TStreakStatus,\n tournamentRank: data.tournament_rank,\n projects: {\n games: {\n label: data.projects.games.label,\n type: ProjectType.GAME,\n initialProgressValue: 0,\n data: data.projects.games.data.map(game => ({\n id: game.id,\n name: game.name,\n cardLottie: game.card,\n tutorial: game.tutorial,\n variant: game.variant,\n isPlayed: game.played,\n })),\n },\n puzzles: {\n label: data.projects.puzzles.label,\n type: ProjectType.PUZZLE,\n initialProgressValue: 0,\n data: data.projects.puzzles.data.map(puzzle => ({\n id: puzzle.id,\n name: puzzle.name,\n cardLottie: puzzle.card,\n tutorial: puzzle.tutorial,\n variant: puzzle.variant,\n question: puzzle.question,\n isHintSeen: puzzle.is_hint_seen,\n solved: puzzle.solved,\n })),\n },\n },\n timestamps: {\n startTimestamp: data.timestamps.start_timestamp,\n endTimestamp: data.timestamps.end_timestamp,\n current: data.timestamps.current,\n },\n coachmarkProgress: {\n activity: data.coachmark_completion.activity,\n tutorial: data.coachmark_completion.tutorial,\n points: data.coachmark_completion.points,\n streak: data.coachmark_completion.streak,\n leaderboard: data.coachmark_completion.leaderboard,\n },\n };\n\n if (data.projects.lessons) {\n circleHomeDetails.projects.lessons = {\n label: data.projects.lessons.label,\n type: ProjectType.LESSON,\n initialProgressValue: 0,\n data: data.projects.lessons.data.map(lesson => ({\n id: lesson.id,\n name: lesson.name,\n cardLottie: lesson.card,\n tutorial: lesson.tutorial,\n variant: lesson.variant,\n sessionId: lesson.session_id,\n miniGameIdentifier: lesson.mini_game_identifier,\n targetQuestions: lesson.target_questions,\n status: lesson.status,\n })),\n };\n }\n }\n setContentForToday(circleHomeDetails);\n }, [data, isProcessed]);\n\n return { data: contentForToday, isProcessed, getCircleHomeDetails, ...rest };\n};\n"],"names":["useGetCircleHomeDetailsDal","userId","countryCode","grade","contentForToday","setContentForToday","useState","data","getHomeDetails","isProcessed","rest","useGetCircleHomeAPI","getCircleHomeDetails","useCallback","useEffect","circleHomeDetails","ProjectType","game","puzzle","lesson"],"mappings":";;;AAOO,MAAMA,IAA6B,CACxCC,GACAC,GACAC,MAIG;AACH,QAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAAoC,IAAI,GAChF,EAAE,MAAAC,GAAM,KAAKC,GAAgB,aAAAC,GAAa,GAAGC,EAAA,IAASC,KAEtDC,IAAuBC,EAAY,MAAM;AAC7C,IAAAL,EAAe,IAAI;AAAA,MACjB,SAASP;AAAA,MACT,cAAcC;AAAA,MACd,OAAAC;AAAA,IAAA,CACD;AAAA,KACA,CAACK,GAAgBP,GAAQC,GAAaC,CAAK,CAAC;AAE/C,SAAAW,EAAU,MAAM;AACd,QAAIC,IAA+C;AAEnD,IAAIN,KAAeF,MACGQ,IAAA;AAAA,MAClB,QAAQR,EAAK;AAAA,MACb,YAAYA,EAAK;AAAA,MACjB,cAAcA,EAAK;AAAA,MACnB,gBAAgBA,EAAK;AAAA,MACrB,UAAU;AAAA,QACR,OAAO;AAAA,UACL,OAAOA,EAAK,SAAS,MAAM;AAAA,UAC3B,MAAMS,EAAY;AAAA,UAClB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O;AAAA,QACb,YAAYA,EAAO;AAAA,QACnB,UAAUA,EAAO;AAAA,QACjB,SAASA,EAAO;AAAA,QAChB,WAAWA,EAAO;AAAA,QAClB,oBAAoBA,EAAO;AAAA,QAC3B,iBAAiBA,EAAO;AAAA,QACxB,QAAQA,EAAO;AAAA,MAAA,EACf;AAAA,IAAA,KAIRd,EAAmBU,CAAiB;AAAA,EAAA,GACnC,CAACR,GAAME,CAAW,CAAC,GAEf,EAAE,MAAML,GAAiB,aAAAK,GAAa,sBAAAG,GAAsB,GAAGF;AACxE;"}
1
+ {"version":3,"file":"use-get-circle-home-details-dal.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.ts"],"sourcesContent":["import type { ICircleHomeDetails, TStreakStatus } from './use-get-circle-home-dal-types';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { useGetCircleHomeAPI } from '../../api/get-content-for-today/get-circle-home-api';\n\nexport const useGetCircleHomeDetailsDal = (\n userId: string,\n countryCode: string,\n grade: string,\n): Omit<ReturnType<typeof useGetCircleHomeAPI>, 'data' | 'get'> & {\n data: ICircleHomeDetails | null;\n getCircleHomeDetails: () => void;\n} => {\n const [contentForToday, setContentForToday] = useState<ICircleHomeDetails | null>(null);\n const { data, get: getHomeDetails, isProcessed, ...rest } = useGetCircleHomeAPI();\n\n const getCircleHomeDetails = useCallback(() => {\n getHomeDetails('', {\n user_id: userId,\n country_code: countryCode,\n grade: grade,\n });\n }, [getHomeDetails, userId, countryCode, grade]);\n\n useEffect(() => {\n let circleHomeDetails: ICircleHomeDetails | null = null;\n\n if (isProcessed && data) {\n circleHomeDetails = {\n points: data.points,\n streakDays: data.streak_days,\n streakStatus: data.streak_status as TStreakStatus,\n tournamentRank: data.tournament_rank,\n projects: {\n games: {\n label: data.projects.games.label,\n type: ProjectType.GAME,\n initialProgressValue: 0,\n data: data.projects.games.data.map(game => ({\n id: game.id,\n name: game.name,\n cardLottie: game.card,\n tutorial: game.tutorial,\n variant: game.variant,\n isPlayed: game.played,\n })),\n },\n puzzles: {\n label: data.projects.puzzles.label,\n type: ProjectType.PUZZLE,\n initialProgressValue: 0,\n data: data.projects.puzzles.data.map(puzzle => ({\n id: puzzle.id,\n name: puzzle.name,\n cardLottie: puzzle.card,\n tutorial: puzzle.tutorial,\n variant: puzzle.variant,\n question: puzzle.question,\n isHintSeen: puzzle.is_hint_seen,\n solved: puzzle.solved,\n })),\n },\n },\n timestamps: {\n startTimestamp: data.timestamps.start_timestamp,\n endTimestamp: data.timestamps.end_timestamp,\n current: data.timestamps.current,\n },\n coachmarkProgress: {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY:\n data.coachmark_completion.CIRCLE_ACTIVITIES_INTRO_JOURNEY,\n CIRCLE_LEADERBOARD_INTRO_JOURNEY:\n data.coachmark_completion.CIRCLE_LEADERBOARD_INTRO_JOURNEY,\n CIRCLE_POINTS_REWARD_JOURNEY: data.coachmark_completion.CIRCLE_POINTS_REWARD_JOURNEY,\n CIRCLE_STREAK_UPDATE_JOURNEY: data.coachmark_completion.CIRCLE_STREAK_UPDATE_JOURNEY,\n CIRCLE_TUTORIAL_JOURNEY: data.coachmark_completion.CIRCLE_TUTORIAL_JOURNEY,\n },\n };\n\n if (data.projects.lessons) {\n circleHomeDetails.projects.lessons = {\n label: data.projects.lessons.label,\n type: ProjectType.LESSON,\n initialProgressValue: 0,\n data: data.projects.lessons.data.map(lesson => ({\n id: lesson.id,\n name: lesson.name,\n cardLottie: lesson.card,\n tutorial: lesson.tutorial,\n variant: lesson.variant,\n sessionId: lesson.session_id,\n miniGameIdentifier: lesson.mini_game_identifier,\n targetQuestions: lesson.target_questions,\n status: lesson.status,\n })),\n };\n }\n }\n setContentForToday(circleHomeDetails);\n }, [data, isProcessed]);\n\n return { data: contentForToday, isProcessed, getCircleHomeDetails, ...rest };\n};\n"],"names":["useGetCircleHomeDetailsDal","userId","countryCode","grade","contentForToday","setContentForToday","useState","data","getHomeDetails","isProcessed","rest","useGetCircleHomeAPI","getCircleHomeDetails","useCallback","useEffect","circleHomeDetails","ProjectType","game","puzzle","lesson"],"mappings":";;;AAOO,MAAMA,IAA6B,CACxCC,GACAC,GACAC,MAIG;AACH,QAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAAoC,IAAI,GAChF,EAAE,MAAAC,GAAM,KAAKC,GAAgB,aAAAC,GAAa,GAAGC,EAAA,IAASC,KAEtDC,IAAuBC,EAAY,MAAM;AAC7C,IAAAL,EAAe,IAAI;AAAA,MACjB,SAASP;AAAA,MACT,cAAcC;AAAA,MACd,OAAAC;AAAA,IAAA,CACD;AAAA,KACA,CAACK,GAAgBP,GAAQC,GAAaC,CAAK,CAAC;AAE/C,SAAAW,EAAU,MAAM;AACd,QAAIC,IAA+C;AAEnD,IAAIN,KAAeF,MACGQ,IAAA;AAAA,MAClB,QAAQR,EAAK;AAAA,MACb,YAAYA,EAAK;AAAA,MACjB,cAAcA,EAAK;AAAA,MACnB,gBAAgBA,EAAK;AAAA,MACrB,UAAU;AAAA,QACR,OAAO;AAAA,UACL,OAAOA,EAAK,SAAS,MAAM;AAAA,UAC3B,MAAMS,EAAY;AAAA,UAClB,sBAAsB;AAAA,UACtB,MAAMT,EAAK,SAAS,MAAM,KAAK,IAAI,CAASU,OAAA;AAAA,YAC1C,IAAIA,EAAK;AAAA,YACT,MAAMA,EAAK;AAAA,YACX,YAAYA,EAAK;AAAA,YACjB,UAAUA,EAAK;AAAA,YACf,SAASA,EAAK;AAAA,YACd,UAAUA,EAAK;AAAA,UAAA,EACf;AAAA,QACJ;AAAA,QACA,SAAS;AAAA,UACP,OAAOV,EAAK,SAAS,QAAQ;AAAA,UAC7B,MAAMS,EAAY;AAAA,UAClB,sBAAsB;AAAA,UACtB,MAAMT,EAAK,SAAS,QAAQ,KAAK,IAAI,CAAWW,OAAA;AAAA,YAC9C,IAAIA,EAAO;AAAA,YACX,MAAMA,EAAO;AAAA,YACb,YAAYA,EAAO;AAAA,YACnB,UAAUA,EAAO;AAAA,YACjB,SAASA,EAAO;AAAA,YAChB,UAAUA,EAAO;AAAA,YACjB,YAAYA,EAAO;AAAA,YACnB,QAAQA,EAAO;AAAA,UAAA,EACf;AAAA,QACJ;AAAA,MACF;AAAA,MACA,YAAY;AAAA,QACV,gBAAgBX,EAAK,WAAW;AAAA,QAChC,cAAcA,EAAK,WAAW;AAAA,QAC9B,SAASA,EAAK,WAAW;AAAA,MAC3B;AAAA,MACA,mBAAmB;AAAA,QACjB,iCACEA,EAAK,qBAAqB;AAAA,QAC5B,kCACEA,EAAK,qBAAqB;AAAA,QAC5B,8BAA8BA,EAAK,qBAAqB;AAAA,QACxD,8BAA8BA,EAAK,qBAAqB;AAAA,QACxD,yBAAyBA,EAAK,qBAAqB;AAAA,MACrD;AAAA,IAAA,GAGEA,EAAK,SAAS,YAChBQ,EAAkB,SAAS,UAAU;AAAA,MACnC,OAAOR,EAAK,SAAS,QAAQ;AAAA,MAC7B,MAAMS,EAAY;AAAA,MAClB,sBAAsB;AAAA,MACtB,MAAMT,EAAK,SAAS,QAAQ,KAAK,IAAI,CAAWY,OAAA;AAAA,QAC9C,IAAIA,EAAO;AAAA,QACX,MAAMA,EAAO;AAAA,QACb,YAAYA,EAAO;AAAA,QACnB,UAAUA,EAAO;AAAA,QACjB,SAASA,EAAO;AAAA,QAChB,WAAWA,EAAO;AAAA,QAClB,oBAAoBA,EAAO;AAAA,QAC3B,iBAAiBA,EAAO;AAAA,QACxB,QAAQA,EAAO;AAAA,MAAA,EACf;AAAA,IAAA,KAIRd,EAAmBU,CAAiB;AAAA,EAAA,GACnC,CAACR,GAAME,CAAW,CAAC,GAEf,EAAE,MAAML,GAAiB,aAAAK,GAAa,sBAAAG,GAAsB,GAAGF;AACxE;"}
@@ -19,7 +19,6 @@ const J = () => import("../../../assets/lotties/circle/sleepy-boi-lottie.json.js
19
19
  carouselNextBtnRef: y,
20
20
  isJourneyInProgress: L
21
21
  } = B({
22
- journeyId: n,
23
22
  setCarouselIndex: A,
24
23
  onSegmentClick: o,
25
24
  onJourneyComplete: g
@@ -97,7 +96,7 @@ const J = () => import("../../../assets/lotties/circle/sleepy-boi-lottie.json.js
97
96
  l == null || l.destroy();
98
97
  };
99
98
  }, []), x(() => {
100
- e != null && e.puzzles && n && L && f(e == null ? void 0 : e.puzzles, !!(e != null && e.lessons));
99
+ e != null && e.puzzles && n && L && f(e == null ? void 0 : e.puzzles, !!(e != null && e.lessons), n);
101
100
  }, [e == null ? void 0 : e.lessons, e == null ? void 0 : e.puzzles, L, n, f]), C ? /* @__PURE__ */ r(G, {}) : e ? /* @__PURE__ */ r(
102
101
  V,
103
102
  {
@@ -1 +1 @@
1
- {"version":3,"file":"game-launcher.js","sources":["../../../../src/features/circle-games/game-launcher/game-launcher.tsx"],"sourcesContent":["import type { IGameLauncherProps } from './game-launcher-types';\nimport type { AnimationItem } from 'lottie-web';\nimport type { FC, ReactNode } from 'react';\n\nimport Lottie from 'lottie-web';\nimport { memo, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { CircularLoader } from '../../ui/loader/circular-loader/circular-loader';\nimport { ProjectType } from '../games/web-view/enums';\nimport { useCircleSounds } from '../hooks/use-circle-sounds/use-circle-sounds';\nimport { Carousel } from './comps/carousel/carousel';\nimport { SegmentedGameCard } from './comps/segmented-game-card/segmented-game-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from './game-launcher-analytics-events';\nimport * as Styled from './game-launcher-styled';\nimport { useGameLauncherJourney } from './use-game-launcher-journey/use-game-launcher-journey';\n\nconst sleepyBoi = () => import('../../../assets/lotties/circle/sleepy-boi-lottie.json');\n\nexport const GameLauncher: FC<IGameLauncherProps> = memo(\n ({ onSegmentClick, onJourneyComplete, journeyId, data, isLoading, defaultIndex = 0 }) => {\n const [currentIndex, setCurrentIndex] = useState(defaultIndex);\n\n const lottieContainerRef = useRef<HTMLDivElement>(null);\n const { playSwipSound } = useCircleSounds();\n\n const {\n gameRefs,\n lessonRefs,\n puzzleRefs,\n startJourney,\n carouselNextBtnRef,\n isJourneyInProgress,\n } = useGameLauncherJourney({\n journeyId,\n setCarouselIndex: setCurrentIndex,\n onSegmentClick,\n onJourneyComplete,\n });\n\n const items = useMemo(() => {\n let itemTypes: ReactNode[] = [];\n\n if (data) {\n if (data.lessons) {\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={lessonRefs}\n label={data.lessons.label}\n value={data.lessons.data.filter(lesson => lesson.status === 'completed').length}\n maxValue={data.lessons.data.length}\n initialValue={data.lessons.initialProgressValue}\n data={data?.lessons.data.map(lesson => ({\n card: lesson.cardLottie,\n name: lesson.name,\n isCompleted: lesson.status === 'completed',\n onPress: () =>\n lesson.status === 'completed'\n ? undefined\n : onSegmentClick(lesson, ProjectType.LESSON),\n }))}\n />,\n ];\n }\n\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={gameRefs}\n label={data.games.label}\n value={data.games.data.filter(game => game.isPlayed).length}\n maxValue={data.games.data.length}\n initialValue={data.games.initialProgressValue}\n data={data.games.data.map(game => ({\n card: game.cardLottie,\n name: game.name,\n isCompleted: false,\n onPress: () => onSegmentClick(game, ProjectType.GAME),\n }))}\n />,\n <SegmentedGameCard\n ref={puzzleRefs}\n label={data.puzzles.label}\n value={data.puzzles.data.filter(puzzle => puzzle.solved).length}\n maxValue={data.puzzles.data.length}\n initialValue={data.puzzles.initialProgressValue}\n data={data.puzzles.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: puzzle.name,\n isCompleted: puzzle.solved,\n onPress: () => onSegmentClick(puzzle, ProjectType.PUZZLE),\n }))}\n />,\n ];\n }\n\n return itemTypes;\n }, [data, gameRefs, lessonRefs, onSegmentClick, puzzleRefs]);\n\n const sleepyBoiItem = useMemo(\n () => [<Styled.SleepyBoiLottyContainer ref={lottieContainerRef} />],\n [],\n );\n\n useEffect(() => {\n let animation: AnimationItem | null = null;\n const loadAnimation = async () => {\n const animationModule = await sleepyBoi();\n\n const animationData = animationModule.default;\n\n animation = Lottie.loadAnimation({\n container: lottieContainerRef.current as Element,\n animationData: animationData,\n autoplay: true,\n loop: true,\n renderer: 'canvas',\n });\n };\n\n loadAnimation();\n\n return () => {\n animation?.destroy();\n };\n }, []);\n\n // Start game launcher journey when the data for puzzles is available\n useEffect(() => {\n if (data?.puzzles && journeyId && isJourneyInProgress) {\n startJourney(data?.puzzles, !!data?.lessons);\n }\n }, [data?.lessons, data?.puzzles, isJourneyInProgress, journeyId, startJourney]);\n\n if (isLoading) {\n return <CircularLoader />;\n }\n\n if (!data) {\n return (\n <Carousel\n ref={carouselNextBtnRef}\n items={sleepyBoiItem}\n analyticsNext={{\n analyticsLabel: '',\n }}\n analyticsPrev={{\n analyticsLabel: '',\n }}\n />\n );\n }\n\n return (\n <Carousel\n ref={carouselNextBtnRef}\n items={items}\n defaultIndex={currentIndex}\n onNext={playSwipSound}\n onPrev={playSwipSound}\n analyticsNext={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.NEXT_ACTIVITY,\n }}\n analyticsPrev={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.PREV_ACTIVITY,\n }}\n />\n );\n },\n);\n"],"names":["sleepyBoi","GameLauncher","memo","onSegmentClick","onJourneyComplete","journeyId","data","isLoading","defaultIndex","currentIndex","setCurrentIndex","useState","lottieContainerRef","useRef","playSwipSound","useCircleSounds","gameRefs","lessonRefs","puzzleRefs","startJourney","carouselNextBtnRef","isJourneyInProgress","useGameLauncherJourney","items","useMemo","itemTypes","jsx","SegmentedGameCard","lesson","ProjectType","game","puzzle","sleepyBoiItem","Styled.SleepyBoiLottyContainer","useEffect","animation","animationData","Lottie","CircularLoader","Carousel","GAME_LAUNCHER_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;;AAgBA,MAAMA,IAAY,MAAM,OAAO,0DAAuD,GAEzEC,IAAuCC;AAAA,EAClD,CAAC,EAAE,gBAAAC,GAAgB,mBAAAC,GAA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N,UAAU;AAAA,QAAA,CACX;AAAA,MAAA,MAKI,MAAM;AACX,QAAAD,KAAA,QAAAA,EAAW;AAAA,MAAQ;AAAA,IAEvB,GAAG,CAAE,CAAA,GAGLD,EAAU,MAAM;AACV,MAAA5B,KAAA,QAAAA,EAAM,WAAWD,KAAagB,KAChCF,EAAab,KAAA,gBAAAA,EAAM,SAAS,CAAC,EAACA,KAAA,QAAAA,EAAM,QAAO;AAAA,IAC7C,GACC,CAACA,KAAA,gBAAAA,EAAM,SAASA,KAAA,gBAAAA,EAAM,SAASe,GAAqBhB,GAAWc,CAAY,CAAC,GAE3EZ,sBACM+B,GAAe,CAAA,CAAA,IAGpBhC,IAgBH,gBAAAoB;AAAA,MAACa;AAAA,MAAA;AAAA,QACC,KAAKnB;AAAA,QACL,OAAAG;AAAA,QACA,cAAcd;AAAA,QACd,QAAQK;AAAA,QACR,QAAQA;AAAA,QACR,eAAe;AAAA,UACb,gBAAgB0B,EAA+B;AAAA,QACjD;AAAA,QACA,eAAe;AAAA,UACb,gBAAgBA,EAA+B;AAAA,QACjD;AAAA,MAAA;AAAA,IAAA,IAzBA,gBAAAd;AAAA,MAACa;AAAA,MAAA;AAAA,QACC,KAAKnB;AAAA,QACL,OAAOY;AAAA,QACP,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,QACA,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,MAAA;AAAA,IAAA;AAAA,EAoBR;AACF;"}
1
+ {"version":3,"file":"game-launcher.js","sources":["../../../../src/features/circle-games/game-launcher/game-launcher.tsx"],"sourcesContent":["import type { IGameLauncherProps } from './game-launcher-types';\nimport type { AnimationItem } from 'lottie-web';\nimport type { FC, ReactNode } from 'react';\n\nimport Lottie from 'lottie-web';\nimport { memo, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { CircularLoader } from '../../ui/loader/circular-loader/circular-loader';\nimport { ProjectType } from '../games/web-view/enums';\nimport { useCircleSounds } from '../hooks/use-circle-sounds/use-circle-sounds';\nimport { Carousel } from './comps/carousel/carousel';\nimport { SegmentedGameCard } from './comps/segmented-game-card/segmented-game-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from './game-launcher-analytics-events';\nimport * as Styled from './game-launcher-styled';\nimport { useGameLauncherJourney } from './use-game-launcher-journey/use-game-launcher-journey';\n\nconst sleepyBoi = () => import('../../../assets/lotties/circle/sleepy-boi-lottie.json');\n\nexport const GameLauncher: FC<IGameLauncherProps> = memo(\n ({ onSegmentClick, onJourneyComplete, journeyId, data, isLoading, defaultIndex = 0 }) => {\n const [currentIndex, setCurrentIndex] = useState(defaultIndex);\n\n const lottieContainerRef = useRef<HTMLDivElement>(null);\n const { playSwipSound } = useCircleSounds();\n\n const {\n gameRefs,\n lessonRefs,\n puzzleRefs,\n startJourney,\n carouselNextBtnRef,\n isJourneyInProgress,\n } = useGameLauncherJourney({\n setCarouselIndex: setCurrentIndex,\n onSegmentClick,\n onJourneyComplete,\n });\n\n const items = useMemo(() => {\n let itemTypes: ReactNode[] = [];\n\n if (data) {\n if (data.lessons) {\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={lessonRefs}\n label={data.lessons.label}\n value={data.lessons.data.filter(lesson => lesson.status === 'completed').length}\n maxValue={data.lessons.data.length}\n initialValue={data.lessons.initialProgressValue}\n data={data?.lessons.data.map(lesson => ({\n card: lesson.cardLottie,\n name: lesson.name,\n isCompleted: lesson.status === 'completed',\n onPress: () =>\n lesson.status === 'completed'\n ? undefined\n : onSegmentClick(lesson, ProjectType.LESSON),\n }))}\n />,\n ];\n }\n\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={gameRefs}\n label={data.games.label}\n value={data.games.data.filter(game => game.isPlayed).length}\n maxValue={data.games.data.length}\n initialValue={data.games.initialProgressValue}\n data={data.games.data.map(game => ({\n card: game.cardLottie,\n name: game.name,\n isCompleted: false,\n onPress: () => onSegmentClick(game, ProjectType.GAME),\n }))}\n />,\n <SegmentedGameCard\n ref={puzzleRefs}\n label={data.puzzles.label}\n value={data.puzzles.data.filter(puzzle => puzzle.solved).length}\n maxValue={data.puzzles.data.length}\n initialValue={data.puzzles.initialProgressValue}\n data={data.puzzles.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: puzzle.name,\n isCompleted: puzzle.solved,\n onPress: () => onSegmentClick(puzzle, ProjectType.PUZZLE),\n }))}\n />,\n ];\n }\n\n return itemTypes;\n }, [data, gameRefs, lessonRefs, onSegmentClick, puzzleRefs]);\n\n const sleepyBoiItem = useMemo(\n () => [<Styled.SleepyBoiLottyContainer ref={lottieContainerRef} />],\n [],\n );\n\n useEffect(() => {\n let animation: AnimationItem | null = null;\n const loadAnimation = async () => {\n const animationModule = await sleepyBoi();\n\n const animationData = animationModule.default;\n\n animation = Lottie.loadAnimation({\n container: lottieContainerRef.current as Element,\n animationData: animationData,\n autoplay: true,\n loop: true,\n renderer: 'canvas',\n });\n };\n\n loadAnimation();\n\n return () => {\n animation?.destroy();\n };\n }, []);\n\n // Start game launcher journey when the data for puzzles is available\n useEffect(() => {\n if (data?.puzzles && journeyId && isJourneyInProgress) {\n startJourney(data?.puzzles, !!data?.lessons, journeyId);\n }\n }, [data?.lessons, data?.puzzles, isJourneyInProgress, journeyId, startJourney]);\n\n if (isLoading) {\n return <CircularLoader />;\n }\n\n if (!data) {\n return (\n <Carousel\n ref={carouselNextBtnRef}\n items={sleepyBoiItem}\n analyticsNext={{\n analyticsLabel: '',\n }}\n analyticsPrev={{\n analyticsLabel: '',\n }}\n />\n );\n }\n\n return (\n <Carousel\n ref={carouselNextBtnRef}\n items={items}\n defaultIndex={currentIndex}\n onNext={playSwipSound}\n onPrev={playSwipSound}\n analyticsNext={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.NEXT_ACTIVITY,\n }}\n analyticsPrev={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.PREV_ACTIVITY,\n }}\n />\n );\n },\n);\n"],"names":["sleepyBoi","GameLauncher","memo","onSegmentClick","onJourneyComplete","journeyId","data","isLoading","defaultIndex","currentIndex","setCurrentIndex","useState","lottieContainerRef","useRef","playSwipSound","useCircleSounds","gameRefs","lessonRefs","puzzleRefs","startJourney","carouselNextBtnRef","isJourneyInProgress","useGameLauncherJourney","items","useMemo","itemTypes","jsx","SegmentedGameCard","lesson","ProjectType","game","puzzle","sleepyBoiItem","Styled.SleepyBoiLottyContainer","useEffect","animation","animationData","Lottie","CircularLoader","Carousel","GAME_LAUNCHER_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;;AAgBA,MAAMA,IAAY,MAAM,OAAO,0DAAuD,GAEzEC,IAAuCC;AAAA,EAClD,CAAC,EAAE,gBAAAC,GAAgB,mBAAAC,GAAmB,WAAAC,GAAW,MAAAC,GAAM,WAAAC,GAAW,cAAAC,IAAe,QAAQ;AACvF,UAAM,CAACC,GAAcC,CAAe,IAAIC,EAASH,CAAY,GAEvDI,IAAqBC,EAAuB,IAAI,GAChD,EAAE,eAAAC,MAAkBC,KAEpB;AAAA,MACJ,UAAAC;AAAA,MACA,YAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,oBAAAC;AAAA,MACA,qBAAAC;AAAA,QACEC,EAAuB;AAAA,MACzB,kBAAkBZ;AAAA,MAClB,gBAAAP;AAAA,MACA,mBAAAC;AAAA,IAAA,CACD,GAEKmB,IAAQC,EAAQ,MAAM;AAC1B,UAAIC,IAAyB,CAAA;AAE7B,aAAInB,MACEA,EAAK,YACKmB,IAAA;AAAA,QACV,GAAGA;AAAA,QACH,gBAAAC;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,KAAKV;AAAA,YACL,OAAOX,EAAK,QAAQ;AAAA,YACpB,OAAOA,EAAK,QAAQ,KAAK,OAAO,CAAUsB,MAAAA,EAAO,WAAW,WAAW,EAAE;AAAA,YACzE,UAAUtB,EAAK,QAAQ,KAAK;AAAA,YAC5B,cAAcA,EAAK,QAAQ;AAAA,YAC3B,MAAM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AAA,UACb,gBAAgB;AAAA,QAClB;AAAA,QACA,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,MAAA;AAAA,IAAA;AAAA,EAoBR;AACF;"}
@@ -1,151 +1,137 @@
1
- import { jsx as e, Fragment as E, jsxs as R } from "react/jsx-runtime";
2
- import { useRef as u, useCallback as C, useMemo as z } from "react";
3
- import q from "../../../../assets/line-icons/icons/next.js";
4
- import { JOURNEY_ID_STUDENT as g } from "../../../journey/journey-id/journey-id-student.js";
5
- import { IndicatorType as a } from "../../../journey/use-journey/constants.js";
6
- import { useJourney as ee } from "../../../journey/use-journey/use-journey.js";
7
- import K from "../../../ui/buttons/icon-button/icon-button.js";
8
- import y from "../../../ui/layout/flex-view.js";
9
- import r from "../../../ui/text/text.js";
10
- import { useCircleSounds as te } from "../../hooks/use-circle-sounds/use-circle-sounds.js";
11
- import { SegmentedGameCard as re } from "../comps/segmented-game-card/segmented-game-card.js";
12
- import { GO_TO_NEXT_SLIDE_AFTER_MS as ne, SHOW_LABEL_HIGHLIGHT_AFTER_MS as ie, SHOW_NUDGE_AFTER_MS as oe } from "./constants.js";
13
- import { ProjectType as le } from "../../games/web-view/enums/project-type-enum.js";
14
- const Ee = ({
15
- journeyId: s,
1
+ import { jsx as e, Fragment as R } from "react/jsx-runtime";
2
+ import { useRef as u, useCallback as b, useMemo as Q } from "react";
3
+ import V from "../../../../assets/line-icons/icons/next.js";
4
+ import { IndicatorType as s } from "../../../journey/use-journey/constants.js";
5
+ import { useJourney as j } from "../../../journey/use-journey/use-journey.js";
6
+ import Z from "../../../ui/buttons/icon-button/icon-button.js";
7
+ import C from "../../../ui/layout/flex-view.js";
8
+ import d from "../../../ui/text/text.js";
9
+ import { useCircleSounds as z } from "../../hooks/use-circle-sounds/use-circle-sounds.js";
10
+ import { SegmentedGameCard as ee } from "../comps/segmented-game-card/segmented-game-card.js";
11
+ import { GO_TO_NEXT_SLIDE_AFTER_MS as te, SHOW_LABEL_HIGHLIGHT_AFTER_MS as re, SHOW_NUDGE_AFTER_MS as ne } from "./constants.js";
12
+ import { ProjectType as ie } from "../../games/web-view/enums/project-type-enum.js";
13
+ const Te = ({
16
14
  onSegmentClick: L,
17
- setCarouselIndex: I,
18
- onJourneyComplete: H
15
+ setCarouselIndex: H,
16
+ onJourneyComplete: A
19
17
  }) => {
20
- const l = u(null), i = u(null), t = u(null), c = u(null), A = u(!1), { playButtonSound: O } = te(), { nextCoachmark: o, setJourney: w } = ee(), d = C(
21
- (n, m, T = !1) => {
22
- T || (O(), I((b) => b + 1), o(g.ACTIVITY, !1, ne));
18
+ const c = u(null), i = u(null), t = u(null), a = u(null), E = u(!1), { playButtonSound: O } = z(), { nextCoachmark: o, setJourney: y } = j(), h = b(
19
+ (n, l, r, m = !1) => {
20
+ m || (O(), H((T) => T + 1), o(r, !1, te));
23
21
  const f = setTimeout(() => {
24
- clearTimeout(f), n.startLabelAnimation(m);
25
- }, ie), p = setTimeout(() => {
26
- clearTimeout(p), o(g.ACTIVITY, !0);
27
- }, oe);
22
+ clearTimeout(f), n.startLabelAnimation(l);
23
+ }, re), p = setTimeout(() => {
24
+ clearTimeout(p), o(r, !0);
25
+ }, ne);
28
26
  },
29
- [o, O, I]
30
- ), P = C(
31
- (n) => {
32
- L(n, le.PUZZLE), o(g.ACTIVITY), s && H(s);
27
+ [o, O, H]
28
+ ), P = b(
29
+ (n, l) => {
30
+ L(n, ie.PUZZLE), o(l), A(l);
33
31
  },
34
- [s, o, H, L]
35
- ), _ = C(
36
- (n, m) => {
37
- var $, G, S, v, N, Y, B, U, x, V, W, D, X, J, M, F, Z;
38
- if (A.current || !s || !(($ = l == null ? void 0 : l.current) != null && $.nextBtnRef.current) || !((G = t == null ? void 0 : t.current) != null && G.segmentedCardWrapperRef.current) || !((S = i == null ? void 0 : i.current) != null && S.labelRef.current) || !((v = t == null ? void 0 : t.current) != null && v.labelRef.current) || !n)
32
+ [o, A, L]
33
+ ), _ = b(
34
+ (n, l, r) => {
35
+ var k, v, G, S, B, N, x, I, U, $, W, X, Y, D, F, J, M;
36
+ if (E.current || !((k = c == null ? void 0 : c.current) != null && k.nextBtnRef.current) || !((v = t == null ? void 0 : t.current) != null && v.segmentedCardWrapperRef.current) || !((G = i == null ? void 0 : i.current) != null && G.labelRef.current) || !((S = t == null ? void 0 : t.current) != null && S.labelRef.current) || !n)
39
37
  return;
40
- A.current = !0;
41
- const T = ((B = (Y = (N = c.current) == null ? void 0 : N.labelRef) == null ? void 0 : Y.current) == null ? void 0 : B.getBoundingClientRect()) || {
38
+ E.current = !0;
39
+ const m = ((x = (N = (B = a.current) == null ? void 0 : B.labelRef) == null ? void 0 : N.current) == null ? void 0 : x.getBoundingClientRect()) || {
42
40
  height: 0,
43
41
  width: 0
44
- }, f = ((V = (x = (U = i.current) == null ? void 0 : U.labelRef) == null ? void 0 : x.current) == null ? void 0 : V.getBoundingClientRect()) || {
42
+ }, f = (($ = (U = (I = i.current) == null ? void 0 : I.labelRef) == null ? void 0 : U.current) == null ? void 0 : $.getBoundingClientRect()) || {
45
43
  height: 0,
46
44
  width: 0
47
- }, p = ((X = (D = (W = t.current) == null ? void 0 : W.labelRef) == null ? void 0 : D.current) == null ? void 0 : X.getBoundingClientRect()) || {
45
+ }, p = ((Y = (X = (W = t.current) == null ? void 0 : W.labelRef) == null ? void 0 : X.current) == null ? void 0 : Y.getBoundingClientRect()) || {
48
46
  height: 0,
49
47
  width: 0
50
- }, b = ((F = (M = (J = t.current) == null ? void 0 : J.segmentedCardWrapperRef) == null ? void 0 : M.current) == null ? void 0 : F.getBoundingClientRect()) || {
48
+ }, T = ((J = (F = (D = t.current) == null ? void 0 : D.segmentedCardWrapperRef) == null ? void 0 : F.current) == null ? void 0 : J.getBoundingClientRect()) || {
51
49
  height: 0,
52
50
  width: 0
53
51
  };
54
- let k = [];
55
- m && c.current && (k = [
52
+ let w = [];
53
+ l && a.current && (w = [
56
54
  {
57
- originalElementToHighlightRef: c.current.labelRef,
55
+ originalElementToHighlightRef: a.current.labelRef,
58
56
  isActive: !1,
59
- type: a.TOOLTIP,
60
- elementToHighlight: /* @__PURE__ */ e(E, {}),
57
+ type: s.TOOLTIP,
58
+ elementToHighlight: /* @__PURE__ */ e(R, {}),
61
59
  indicator: {
62
60
  position: "right",
63
61
  backgroundColor: "BLUE_4",
64
- width: 244,
65
- tooltipItem: /* @__PURE__ */ R(y, { children: [
66
- /* @__PURE__ */ e(r, { $renderAs: "ab2-bold", children: "Practice Mental Math" }),
67
- /* @__PURE__ */ e(r, { $renderAs: "ub3", children: "Get faster & stay ahead in school," }),
68
- /* @__PURE__ */ e(r, { $renderAs: "ub3", children: "with 3 new skills everyday." })
69
- ] }),
70
- tooltipXCoOrdinates: T.width,
71
- tooltipYCoOrdinates: T.height / 2
62
+ width: 264,
63
+ tooltipItem: /* @__PURE__ */ e(C, { children: /* @__PURE__ */ e(d, { $renderAs: "ab2-bold", children: "Get faster & stay ahead in school. Practice 3 new skills everyday." }) }),
64
+ tooltipXCoOrdinates: m.width,
65
+ tooltipYCoOrdinates: m.height / 2
72
66
  }
73
67
  },
74
68
  {
75
- originalElementToHighlightRef: (Z = l.current) == null ? void 0 : Z.nextBtnRef,
69
+ originalElementToHighlightRef: (M = c.current) == null ? void 0 : M.nextBtnRef,
76
70
  isActive: !1,
77
- type: a.NUDGE,
71
+ type: s.NUDGE,
78
72
  elementToHighlight: /* @__PURE__ */ e(
79
- K,
73
+ Z,
80
74
  {
81
75
  renderAs: "secondary",
82
- Icon: q,
83
- onClick: () => d(i.current, "ORANGE_4"),
76
+ Icon: V,
77
+ onClick: () => h(i.current, "ORANGE_4", r),
84
78
  analyticsLabel: "HELLO "
85
79
  }
86
80
  ),
87
81
  indicator: {
88
82
  nudge: "click",
89
- content: /* @__PURE__ */ e(r, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
83
+ content: /* @__PURE__ */ e(d, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
90
84
  nudgePointerX: 0,
91
85
  nudgePointerY: 0
92
86
  }
93
87
  }
94
88
  ]);
95
- const Q = [
89
+ const q = [
96
90
  {
97
91
  originalElementToHighlightRef: i.current.labelRef,
98
92
  isActive: !1,
99
- type: a.TOOLTIP,
100
- elementToHighlight: /* @__PURE__ */ e(E, {}),
93
+ type: s.TOOLTIP,
94
+ elementToHighlight: /* @__PURE__ */ e(R, {}),
101
95
  indicator: {
102
96
  position: "right",
103
97
  backgroundColor: "ORANGE_4",
104
- width: 244,
105
- tooltipItem: /* @__PURE__ */ R(y, { children: [
106
- /* @__PURE__ */ e(r, { $renderAs: "ab2-bold", children: "Play Strategy Games" }),
107
- /* @__PURE__ */ e(r, { $renderAs: "ub3", children: "Train to think deeper & plan ahead," }),
108
- /* @__PURE__ */ e(r, { $renderAs: "ub3", children: "with 3 new games everyday." })
109
- ] }),
98
+ width: 264,
99
+ tooltipItem: /* @__PURE__ */ e(C, { children: /* @__PURE__ */ e(d, { $renderAs: "ab2-bold", children: "Train to think deeper & plan ahead. Play 3 new games everyday." }) }),
110
100
  tooltipXCoOrdinates: f.width,
111
101
  tooltipYCoOrdinates: f.height / 2
112
102
  }
113
103
  },
114
104
  {
115
- originalElementToHighlightRef: l.current.nextBtnRef,
105
+ originalElementToHighlightRef: c.current.nextBtnRef,
116
106
  isActive: !1,
117
- type: a.NUDGE,
107
+ type: s.NUDGE,
118
108
  elementToHighlight: /* @__PURE__ */ e(
119
- K,
109
+ Z,
120
110
  {
121
111
  renderAs: "secondary",
122
- Icon: q,
123
- onClick: () => d(t.current, "PURPLE_4"),
112
+ Icon: V,
113
+ onClick: () => h(t.current, "PURPLE_4", r),
124
114
  analyticsLabel: "HELLO "
125
115
  }
126
116
  ),
127
117
  indicator: {
128
118
  nudge: "click",
129
- content: /* @__PURE__ */ e(r, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
119
+ content: /* @__PURE__ */ e(d, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
130
120
  nudgePointerX: 0,
131
121
  nudgePointerY: 0
132
122
  }
133
123
  }
134
- ], j = [
124
+ ], K = [
135
125
  {
136
126
  originalElementToHighlightRef: t.current.labelRef,
137
127
  isActive: !1,
138
- type: a.TOOLTIP,
139
- elementToHighlight: /* @__PURE__ */ e(E, {}),
128
+ type: s.TOOLTIP,
129
+ elementToHighlight: /* @__PURE__ */ e(R, {}),
140
130
  indicator: {
141
131
  position: "right",
142
132
  backgroundColor: "PURPLE_4",
143
- width: 244,
144
- tooltipItem: /* @__PURE__ */ R(y, { children: [
145
- /* @__PURE__ */ e(r, { $renderAs: "ab2-bold", children: "Solve Logic Puzzles" }),
146
- /* @__PURE__ */ e(r, { $renderAs: "ub3", children: "Think in new ways & stay sharp," }),
147
- /* @__PURE__ */ e(r, { $renderAs: "ub3", children: "with 3 new puzzles everyday." })
148
- ] }),
133
+ width: 264,
134
+ tooltipItem: /* @__PURE__ */ e(C, { children: /* @__PURE__ */ e(d, { $renderAs: "ab2-bold", children: "Think in new ways & stay sharp. Solve 3 new puzzles everyday." }) }),
149
135
  tooltipXCoOrdinates: p.width,
150
136
  tooltipYCoOrdinates: p.height / 2
151
137
  }
@@ -153,48 +139,48 @@ const Ee = ({
153
139
  {
154
140
  originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
155
141
  isActive: !1,
156
- type: a.NUDGE,
142
+ type: s.NUDGE,
157
143
  elementToHighlight: /* @__PURE__ */ e(
158
- re,
144
+ ee,
159
145
  {
160
146
  label: "",
161
- value: n.data.filter((h) => h.solved).length,
147
+ value: n.data.filter((g) => g.solved).length,
162
148
  maxValue: n.data.length,
163
149
  initialValue: n.initialProgressValue,
164
- data: n.data.map((h) => ({
165
- card: h.cardLottie,
150
+ data: n.data.map((g) => ({
151
+ card: g.cardLottie,
166
152
  name: "",
167
153
  // We dont want to show the name of the puzzle in onboarding
168
- isCompleted: h.solved,
169
- onPress: () => P(h)
154
+ isCompleted: g.solved,
155
+ onPress: () => P(g, r)
170
156
  }))
171
157
  }
172
158
  ),
173
159
  indicator: {
174
160
  nudge: "click",
175
- content: /* @__PURE__ */ e(r, { $renderAs: "ab1", $color: "WHITE", children: "Click to solve a puzzle" }),
176
- nudgePointerX: b.width * 0.6,
177
- nudgePointerY: b.height * 0.4
161
+ content: /* @__PURE__ */ e(d, { $renderAs: "ab1", $color: "WHITE", children: "Click to solve a puzzle" }),
162
+ nudgePointerX: T.width * 0.6,
163
+ nudgePointerY: T.height * 0.4
178
164
  }
179
165
  }
180
166
  ];
181
- w(g.ACTIVITY, [...k, ...Q, ...j]), o(g.ACTIVITY, !0), m && c.current ? d(c.current, "BLUE_4", !0) : d(i.current, "ORANGE_4", !0);
167
+ y(r, [...w, ...q, ...K]), o(r, !0), l && a.current ? h(a.current, "BLUE_4", r, !0) : h(i.current, "ORANGE_4", r, !0);
182
168
  },
183
- [P, d, s, o, w]
169
+ [P, h, o, y]
184
170
  );
185
- return z(
171
+ return Q(
186
172
  () => ({
187
173
  gameRefs: i,
188
174
  puzzleRefs: t,
189
- lessonRefs: c,
190
- carouselNextBtnRef: l,
191
- isJourneyInProgress: A,
175
+ lessonRefs: a,
176
+ carouselNextBtnRef: c,
177
+ isJourneyInProgress: E,
192
178
  startJourney: _
193
179
  }),
194
180
  [_]
195
181
  );
196
182
  };
197
183
  export {
198
- Ee as useGameLauncherJourney
184
+ Te as useGameLauncherJourney
199
185
  };
200
186
  //# sourceMappingURL=use-game-launcher-journey.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-game-launcher-journey.js","sources":["../../../../../src/features/circle-games/game-launcher/use-game-launcher-journey/use-game-launcher-journey.tsx"],"sourcesContent":["import type { ICoachmarkProps } from '../../../journey/use-journey/journey-context-types';\nimport type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../ui/nudge/nudge-types';\nimport type { TColorNames } from '../../../ui/types';\nimport type { ICarouselRefs } from '../comps/carousel/carousel-types';\nimport type { ISegmentedGameCardRefs } from '../comps/segmented-game-card/segmented-game-card-types';\nimport type {\n IProject,\n Puzzle,\n} from '../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IUseGameLauncherJourneyProps } from './use-game-launcher-journey-types';\n\nimport { useCallback, useMemo, useRef } from 'react';\n\nimport NextIcon from '../../../../assets/line-icons/icons/next';\nimport { JOURNEY_ID_STUDENT } from '../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../journey/use-journey/constants';\nimport { useJourney } from '../../../journey/use-journey/use-journey';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { ProjectType } from '../../games/web-view/enums';\nimport { useCircleSounds } from '../../hooks/use-circle-sounds/use-circle-sounds';\nimport { SegmentedGameCard } from '../comps/segmented-game-card/segmented-game-card';\nimport {\n GO_TO_NEXT_SLIDE_AFTER_MS,\n SHOW_LABEL_HIGHLIGHT_AFTER_MS,\n SHOW_NUDGE_AFTER_MS,\n} from './constants';\n\nexport const useGameLauncherJourney = ({\n journeyId,\n onSegmentClick,\n setCarouselIndex,\n onJourneyComplete,\n}: IUseGameLauncherJourneyProps) => {\n const carouselNextBtnRef = useRef<ICarouselRefs>(null);\n const gameRefs = useRef<ISegmentedGameCardRefs>(null);\n const puzzleRefs = useRef<ISegmentedGameCardRefs>(null);\n const lessonRefs = useRef<ISegmentedGameCardRefs>(null);\n\n const isJourneyInProgress = useRef(false);\n\n const { playButtonSound } = useCircleSounds();\n const { nextCoachmark, setJourney } = useJourney();\n\n const goToNextCard = useCallback(\n (refOfNextSlide: ISegmentedGameCardRefs, color: TColorNames, isFirstSlide: boolean = false) => {\n if (!isFirstSlide) {\n playButtonSound();\n setCarouselIndex((prev: number) => prev + 1);\n nextCoachmark(JOURNEY_ID_STUDENT.ACTIVITY, false, GO_TO_NEXT_SLIDE_AFTER_MS);\n }\n\n const animateLabelTimer = setTimeout(() => {\n clearTimeout(animateLabelTimer);\n refOfNextSlide.startLabelAnimation(color);\n }, SHOW_LABEL_HIGHLIGHT_AFTER_MS);\n\n const showNudgeTimer = setTimeout(() => {\n clearTimeout(showNudgeTimer);\n nextCoachmark(JOURNEY_ID_STUDENT.ACTIVITY, true);\n }, SHOW_NUDGE_AFTER_MS);\n },\n [nextCoachmark, playButtonSound, setCarouselIndex],\n );\n\n const endJourney = useCallback(\n (puzzlesData: Puzzle) => {\n onSegmentClick(puzzlesData, ProjectType.PUZZLE);\n nextCoachmark(JOURNEY_ID_STUDENT.ACTIVITY);\n if (journeyId) {\n onJourneyComplete(journeyId);\n }\n },\n [journeyId, nextCoachmark, onJourneyComplete, onSegmentClick],\n );\n\n const startJourney = useCallback(\n (puzzlesData: IProject<Puzzle>, isLessonAvailable: boolean) => {\n if (isJourneyInProgress.current || !journeyId) {\n return;\n }\n\n // If element refs are not available return, this is just for type safety\n if (\n !carouselNextBtnRef?.current?.nextBtnRef.current ||\n !puzzleRefs?.current?.segmentedCardWrapperRef.current ||\n !gameRefs?.current?.labelRef.current ||\n !puzzleRefs?.current?.labelRef.current ||\n !puzzlesData\n ) {\n return;\n }\n\n isJourneyInProgress.current = true;\n const lessonLabelDims = lessonRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n const gameLabelDims = gameRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n const puzzleLabelDims = puzzleRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n const launcherDims =\n puzzleRefs.current?.segmentedCardWrapperRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n let lessonSteps: ICoachmarkProps[] = [];\n\n if (isLessonAvailable && lessonRefs.current) {\n lessonSteps = [\n {\n originalElementToHighlightRef: lessonRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'BLUE_4',\n width: 244,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">Practice Mental Math</Text>\n <Text $renderAs=\"ub3\">Get faster & stay ahead in school,</Text>\n <Text $renderAs=\"ub3\">with 3 new skills everyday.</Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: lessonLabelDims.width,\n tooltipYCoOrdinates: lessonLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: carouselNextBtnRef.current?.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={NextIcon}\n onClick={() => goToNextCard(gameRefs.current as ISegmentedGameCardRefs, 'ORANGE_4')}\n analyticsLabel=\"HELLO \"\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n ];\n }\n\n const gameSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: gameRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'ORANGE_4',\n width: 244,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">Play Strategy Games</Text>\n <Text $renderAs=\"ub3\">Train to think deeper & plan ahead,</Text>\n <Text $renderAs=\"ub3\">with 3 new games everyday.</Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: gameLabelDims.width,\n tooltipYCoOrdinates: gameLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: carouselNextBtnRef.current.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={NextIcon}\n onClick={() => goToNextCard(puzzleRefs.current as ISegmentedGameCardRefs, 'PURPLE_4')}\n analyticsLabel=\"HELLO \"\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n ];\n\n const puzzleSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: puzzleRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'PURPLE_4',\n width: 244,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">Solve Logic Puzzles</Text>\n <Text $renderAs=\"ub3\">Think in new ways & stay sharp,</Text>\n <Text $renderAs=\"ub3\">with 3 new puzzles everyday.</Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: puzzleLabelDims.width,\n tooltipYCoOrdinates: puzzleLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: puzzleRefs.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SegmentedGameCard\n label={''} // This is intentionally left blank to avoid showing the label\n value={puzzlesData.data.filter(puzzle => puzzle.solved).length}\n maxValue={puzzlesData.data.length}\n initialValue={puzzlesData.initialProgressValue}\n data={puzzlesData.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: '', // We dont want to show the name of the puzzle in onboarding\n isCompleted: puzzle.solved,\n onPress: () => endJourney(puzzle),\n }))}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to solve a puzzle\n </Text>\n ),\n nudgePointerX: launcherDims.width * 0.6,\n nudgePointerY: launcherDims.height * 0.4,\n } as INudgeProps,\n },\n ];\n\n setJourney(JOURNEY_ID_STUDENT.ACTIVITY, [...lessonSteps, ...gameSteps, ...puzzleSteps]);\n\n nextCoachmark(JOURNEY_ID_STUDENT.ACTIVITY, true);\n if (isLessonAvailable && lessonRefs.current) {\n goToNextCard(lessonRefs.current, 'BLUE_4', true);\n } else {\n goToNextCard(gameRefs.current, 'ORANGE_4', true);\n }\n },\n [endJourney, goToNextCard, journeyId, nextCoachmark, setJourney],\n );\n\n return useMemo(\n () => ({\n gameRefs,\n puzzleRefs,\n lessonRefs,\n carouselNextBtnRef,\n isJourneyInProgress,\n startJourney,\n }),\n [startJourney],\n );\n};\n"],"names":["useGameLauncherJourney","journeyId","onSegmentClick","setCarouselIndex","onJourneyComplete","carouselNextBtnRef","useRef","gameRefs","puzzleRefs","lessonRefs","isJourneyInProgress","playButtonSound","useCircleSounds","nextCoachmark","setJourney","useJourney","goToNextCard","useCallback","refOfNextSlide","color","isFirstSlide","prev","JOURNEY_ID_STUDENT","GO_TO_NEXT_SLIDE_AFTER_MS","animateLabelTimer","SHOW_LABEL_HIGHLIGHT_AFTER_MS","showNudgeTimer","SHOW_NUDGE_AFTER_MS","endJourney","puzzlesData","ProjectType","startJourney","isLessonAvailable","_a","_b","_c","_d","lessonLabelDims","_g","_f","_e","gameLabelDims","_j","_i","_h","puzzleLabelDims","_m","_l","_k","launcherDims","_p","_o","_n","lessonSteps","IndicatorType","jsx","Fragment","FlexView","Text","_q","IconButton","NextIcon","gameSteps","puzzleSteps","SegmentedGameCard","puzzle","useMemo"],"mappings":";;;;;;;;;;;;;AA8BO,MAAMA,KAAyB,CAAC;AAAA,EACrC,WAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,mBAAAC;AACF,MAAoC;AAC5B,QAAAC,IAAqBC,EAAsB,IAAI,GAC/CC,IAAWD,EAA+B,IAAI,GAC9CE,IAAaF,EAA+B,IAAI,GAChDG,IAAaH,EAA+B,IAAI,GAEhDI,IAAsBJ,EAAO,EAAK,GAElC,EAAE,iBAAAK,MAAoBC,MACtB,EAAE,eAAAC,GAAe,YAAAC,EAAW,IAAIC,GAAW,GAE3CC,IAAeC;AAAA,IACnB,CAACC,GAAwCC,GAAoBC,IAAwB,OAAU;AAC7F,MAAKA,MACaT,KACCR,EAAA,CAACkB,MAAiB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M,QAAO,SAAQ,UAErC,2BAAA;AAAA,YAEF,eAAeT,EAAa,QAAQ;AAAA,YACpC,eAAeA,EAAa,SAAS;AAAA,UACvC;AAAA,QACF;AAAA,MAAA;AAGS,MAAAnC,EAAAQ,EAAmB,UAAU,CAAC,GAAG+B,GAAa,GAAGS,GAAW,GAAGC,CAAW,CAAC,GAExElD,EAAAS,EAAmB,UAAU,EAAI,GAC3CU,KAAqBvB,EAAW,UACrBO,EAAAP,EAAW,SAAS,UAAU,EAAI,IAElCO,EAAAT,EAAS,SAAS,YAAY,EAAI;AAAA,IAEnD;AAAA,IACA,CAACqB,GAAYZ,GAAcf,GAAWY,GAAeC,CAAU;AAAA,EAAA;AAG1D,SAAAoD;AAAA,IACL,OAAO;AAAA,MACL,UAAA3D;AAAA,MACA,YAAAC;AAAA,MACA,YAAAC;AAAA,MACA,oBAAAJ;AAAA,MACA,qBAAAK;AAAA,MACA,cAAAqB;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAEjB;"}
1
+ {"version":3,"file":"use-game-launcher-journey.js","sources":["../../../../../src/features/circle-games/game-launcher/use-game-launcher-journey/use-game-launcher-journey.tsx"],"sourcesContent":["import type { TJourneyId } from '../../../journey/journey-id/journey-id-types';\nimport type { ICoachmarkProps } from '../../../journey/use-journey/journey-context-types';\nimport type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../ui/nudge/nudge-types';\nimport type { TColorNames } from '../../../ui/types';\nimport type { ICarouselRefs } from '../comps/carousel/carousel-types';\nimport type { ISegmentedGameCardRefs } from '../comps/segmented-game-card/segmented-game-card-types';\nimport type {\n IProject,\n Puzzle,\n} from '../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IUseGameLauncherJourneyProps } from './use-game-launcher-journey-types';\n\nimport { useCallback, useMemo, useRef } from 'react';\n\nimport NextIcon from '../../../../assets/line-icons/icons/next';\nimport { IndicatorType } from '../../../journey/use-journey/constants';\nimport { useJourney } from '../../../journey/use-journey/use-journey';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { ProjectType } from '../../games/web-view/enums';\nimport { useCircleSounds } from '../../hooks/use-circle-sounds/use-circle-sounds';\nimport { SegmentedGameCard } from '../comps/segmented-game-card/segmented-game-card';\nimport {\n GO_TO_NEXT_SLIDE_AFTER_MS,\n SHOW_LABEL_HIGHLIGHT_AFTER_MS,\n SHOW_NUDGE_AFTER_MS,\n} from './constants';\n\nexport const useGameLauncherJourney = ({\n onSegmentClick,\n setCarouselIndex,\n onJourneyComplete,\n}: IUseGameLauncherJourneyProps) => {\n const carouselNextBtnRef = useRef<ICarouselRefs>(null);\n const gameRefs = useRef<ISegmentedGameCardRefs>(null);\n const puzzleRefs = useRef<ISegmentedGameCardRefs>(null);\n const lessonRefs = useRef<ISegmentedGameCardRefs>(null);\n\n const isJourneyInProgress = useRef(false);\n\n const { playButtonSound } = useCircleSounds();\n const { nextCoachmark, setJourney } = useJourney();\n\n const goToNextCard = useCallback(\n (\n refOfNextSlide: ISegmentedGameCardRefs,\n color: TColorNames,\n journeyId: TJourneyId,\n isFirstSlide: boolean = false,\n ) => {\n if (!isFirstSlide) {\n playButtonSound();\n setCarouselIndex((prev: number) => prev + 1);\n nextCoachmark(journeyId, false, GO_TO_NEXT_SLIDE_AFTER_MS);\n }\n\n const animateLabelTimer = setTimeout(() => {\n clearTimeout(animateLabelTimer);\n refOfNextSlide.startLabelAnimation(color);\n }, SHOW_LABEL_HIGHLIGHT_AFTER_MS);\n\n const showNudgeTimer = setTimeout(() => {\n clearTimeout(showNudgeTimer);\n nextCoachmark(journeyId, true);\n }, SHOW_NUDGE_AFTER_MS);\n },\n [nextCoachmark, playButtonSound, setCarouselIndex],\n );\n\n const endJourney = useCallback(\n (puzzlesData: Puzzle, journeyId: TJourneyId) => {\n onSegmentClick(puzzlesData, ProjectType.PUZZLE);\n nextCoachmark(journeyId);\n onJourneyComplete(journeyId);\n },\n [nextCoachmark, onJourneyComplete, onSegmentClick],\n );\n\n const startJourney = useCallback(\n (puzzlesData: IProject<Puzzle>, isLessonAvailable: boolean, journeyId: TJourneyId) => {\n if (isJourneyInProgress.current) {\n return;\n }\n\n // If element refs are not available return, this is just for type safety\n if (\n !carouselNextBtnRef?.current?.nextBtnRef.current ||\n !puzzleRefs?.current?.segmentedCardWrapperRef.current ||\n !gameRefs?.current?.labelRef.current ||\n !puzzleRefs?.current?.labelRef.current ||\n !puzzlesData\n ) {\n return;\n }\n\n isJourneyInProgress.current = true;\n const lessonLabelDims = lessonRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n const gameLabelDims = gameRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n const puzzleLabelDims = puzzleRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n const launcherDims =\n puzzleRefs.current?.segmentedCardWrapperRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n let lessonSteps: ICoachmarkProps[] = [];\n\n if (isLessonAvailable && lessonRefs.current) {\n lessonSteps = [\n {\n originalElementToHighlightRef: lessonRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'BLUE_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Get faster & stay ahead in school. Practice 3 new skills everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: lessonLabelDims.width,\n tooltipYCoOrdinates: lessonLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: carouselNextBtnRef.current?.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={NextIcon}\n onClick={() =>\n goToNextCard(gameRefs.current as ISegmentedGameCardRefs, 'ORANGE_4', journeyId)\n }\n analyticsLabel=\"HELLO \"\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n ];\n }\n\n const gameSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: gameRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'ORANGE_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Train to think deeper & plan ahead. Play 3 new games everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: gameLabelDims.width,\n tooltipYCoOrdinates: gameLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: carouselNextBtnRef.current.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={NextIcon}\n onClick={() =>\n goToNextCard(puzzleRefs.current as ISegmentedGameCardRefs, 'PURPLE_4', journeyId)\n }\n analyticsLabel=\"HELLO \"\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n ];\n\n const puzzleSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: puzzleRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'PURPLE_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Think in new ways & stay sharp. Solve 3 new puzzles everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: puzzleLabelDims.width,\n tooltipYCoOrdinates: puzzleLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: puzzleRefs.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SegmentedGameCard\n label={''} // This is intentionally left blank to avoid showing the label\n value={puzzlesData.data.filter(puzzle => puzzle.solved).length}\n maxValue={puzzlesData.data.length}\n initialValue={puzzlesData.initialProgressValue}\n data={puzzlesData.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: '', // We dont want to show the name of the puzzle in onboarding\n isCompleted: puzzle.solved,\n onPress: () => endJourney(puzzle, journeyId),\n }))}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to solve a puzzle\n </Text>\n ),\n nudgePointerX: launcherDims.width * 0.6,\n nudgePointerY: launcherDims.height * 0.4,\n } as INudgeProps,\n },\n ];\n\n setJourney(journeyId, [...lessonSteps, ...gameSteps, ...puzzleSteps]);\n\n nextCoachmark(journeyId, true);\n if (isLessonAvailable && lessonRefs.current) {\n goToNextCard(lessonRefs.current, 'BLUE_4', journeyId, true);\n } else {\n goToNextCard(gameRefs.current, 'ORANGE_4', journeyId, true);\n }\n },\n [endJourney, goToNextCard, nextCoachmark, setJourney],\n );\n\n return useMemo(\n () => ({\n gameRefs,\n puzzleRefs,\n lessonRefs,\n carouselNextBtnRef,\n isJourneyInProgress,\n startJourney,\n }),\n [startJourney],\n );\n};\n"],"names":["useGameLauncherJourney","onSegmentClick","setCarouselIndex","onJourneyComplete","carouselNextBtnRef","useRef","gameRefs","puzzleRefs","lessonRefs","isJourneyInProgress","playButtonSound","useCircleSounds","nextCoachmark","setJourney","useJourney","goToNextCard","useCallback","refOfNextSlide","color","journeyId","isFirstSlide","prev","GO_TO_NEXT_SLIDE_AFTER_MS","animateLabelTimer","SHOW_LABEL_HIGHLIGHT_AFTER_MS","showNudgeTimer","SHOW_NUDGE_AFTER_MS","endJourney","puzzlesData","ProjectType","startJourney","isLessonAvailable","_a","_b","_c","_d","lessonLabelDims","_g","_f","_e","gameLabelDims","_j","_i","_h","puzzleLabelDims","_m","_l","_k","launcherDims","_p","_o","_n","lessonSteps","IndicatorType","jsx","Fragment","FlexView","Text","_q","IconButton","NextIcon","gameSteps","puzzleSteps","SegmentedGameCard","puzzle","useMemo"],"mappings":";;;;;;;;;;;;AA8BO,MAAMA,KAAyB,CAAC;AAAA,EACrC,gBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,mBAAAC;AACF,MAAoC;AAC5B,QAAAC,IAAqBC,EAAsB,IAAI,GAC/CC,IAAWD,EAA+B,IAAI,GAC9CE,IAAaF,EAA+B,IAAI,GAChDG,IAAaH,EAA+B,IAAI,GAEhDI,IAAsBJ,EAAO,EAAK,GAElC,EAAE,iBAAAK,MAAoBC,KACtB,EAAE,eAAAC,GAAe,YAAAC,EAAW,IAAIC,EAAW,GAE3CC,IAAeC;AAAA,IACnB,CACEC,GACAC,GACAC,GACAC,IAAwB,OACrB;AACH,MAAKA,MACaV,KACCR,EAAA,CAACmB,MAAiBA,IAAO,CAAC,GAC7BT,EAAAO,GAAW,IAAOG,EAAyB;AAGrD,YAAAC,IAAoB,WAAW,MAAM;AACzC,qBAAaA,CAAiB,GAC9BN,EAAe,oBAAoBC,CAAK;AAAA,SACvCM,EAA6B,GAE1BC,IAAiB,WAAW,MAAM;AACtC,qBAAaA,CAAc,GAC3Bb,EAAcO,GAAW,EAAI;AAAA,SAC5BO,EAAmB;AAAA,IACxB;AAAA,IACA,CAACd,GAAeF,GAAiBR,CAAgB;AAAA,EAAA,GAG7CyB,IAAaX;AAAA,IACjB,CAACY,GAAqBT,MAA0B;AAC/B,MAAAlB,EAAA2B,GAAaC,GAAY,MAAM,GAC9CjB,EAAcO,CAAS,GACvBhB,EAAkBgB,CAAS;AAAA,IAC7B;AAAA,IACA,CAACP,GAAeT,GAAmBF,CAAc;AAAA,EAAA,G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;AAAA,gBACN,aAAaA,EAAO;AAAA,gBACpB,SAAS,MAAMrC,EAAWqC,GAAQ7C,CAAS;AAAA,cAAA,EAC3C;AAAA,YAAA;AAAA,UACJ;AAAA,UAEF,WAAW;AAAA,YACT,OAAO;AAAA,YACP,SACG,gBAAAmC,EAAAG,GAAA,EAAK,WAAU,OAAM,QAAO,SAAQ,UAErC,2BAAA;AAAA,YAEF,eAAeT,EAAa,QAAQ;AAAA,YACpC,eAAeA,EAAa,SAAS;AAAA,UACvC;AAAA,QACF;AAAA,MAAA;AAGS,MAAAnC,EAAAM,GAAW,CAAC,GAAGiC,GAAa,GAAGS,GAAW,GAAGC,CAAW,CAAC,GAEpElD,EAAcO,GAAW,EAAI,GACzBY,KAAqBvB,EAAW,UAClCO,EAAaP,EAAW,SAAS,UAAUW,GAAW,EAAI,IAE1DJ,EAAaT,EAAS,SAAS,YAAYa,GAAW,EAAI;AAAA,IAE9D;AAAA,IACA,CAACQ,GAAYZ,GAAcH,GAAeC,CAAU;AAAA,EAAA;AAG/C,SAAAoD;AAAA,IACL,OAAO;AAAA,MACL,UAAA3D;AAAA,MACA,YAAAC;AAAA,MACA,YAAAC;AAAA,MACA,oBAAAJ;AAAA,MACA,qBAAAK;AAAA,MACA,cAAAqB;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAEjB;"}
@@ -1,5 +1,5 @@
1
- var t = /* @__PURE__ */ ((r) => (r.ACTIVITY = "activity", r.TUTORIAL = "tutorial", r.POINTS = "points", r.STREAK = "streak", r.LEADERBOARD = "leaderboard", r))(t || {});
1
+ var E = /* @__PURE__ */ ((R) => (R.CIRCLE_ACTIVITIES_INTRO_JOURNEY = "CIRCLE_ACTIVITIES_INTRO_JOURNEY", R.CIRCLE_LEADERBOARD_INTRO_JOURNEY = "CIRCLE_LEADERBOARD_INTRO_JOURNEY", R.CIRCLE_POINTS_REWARD_JOURNEY = "CIRCLE_POINTS_REWARD_JOURNEY", R.CIRCLE_STREAK_UPDATE_JOURNEY = "CIRCLE_STREAK_UPDATE_JOURNEY", R.CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY", R))(E || {});
2
2
  export {
3
- t as JOURNEY_ID_STUDENT
3
+ E as JOURNEY_ID_STUDENT
4
4
  };
5
5
  //# sourceMappingURL=journey-id-student.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"journey-id-student.js","sources":["../../../../src/features/journey/journey-id/journey-id-student.ts"],"sourcesContent":["export enum JOURNEY_ID_STUDENT {\n ACTIVITY = 'activity',\n TUTORIAL = 'tutorial',\n POINTS = 'points',\n STREAK = 'streak',\n LEADERBOARD = 'leaderboard',\n}\n"],"names":["JOURNEY_ID_STUDENT"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,WAAW,YACXA,EAAA,WAAW,YACXA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,cAAc,eALJA,IAAAA,KAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"journey-id-student.js","sources":["../../../../src/features/journey/journey-id/journey-id-student.ts"],"sourcesContent":["export enum JOURNEY_ID_STUDENT {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY = 'CIRCLE_ACTIVITIES_INTRO_JOURNEY',\n CIRCLE_LEADERBOARD_INTRO_JOURNEY = 'CIRCLE_LEADERBOARD_INTRO_JOURNEY',\n CIRCLE_POINTS_REWARD_JOURNEY = 'CIRCLE_POINTS_REWARD_JOURNEY',\n CIRCLE_STREAK_UPDATE_JOURNEY = 'CIRCLE_STREAK_UPDATE_JOURNEY',\n CIRCLE_TUTORIAL_JOURNEY = 'CIRCLE_TUTORIAL_JOURNEY',\n}\n"],"names":["JOURNEY_ID_STUDENT"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,kCAAkC,mCAClCA,EAAA,mCAAmC,oCACnCA,EAAA,+BAA+B,gCAC/BA,EAAA,+BAA+B,gCAC/BA,EAAA,0BAA0B,2BALhBA,IAAAA,KAAA,CAAA,CAAA;"}
package/dist/index.d.ts CHANGED
@@ -876,19 +876,19 @@ declare interface IClickableProps extends IClickableAnalyticsProps {
876
876
  }
877
877
 
878
878
  declare interface ICoachMarkCompletion {
879
- activity: boolean;
880
- tutorial: boolean;
881
- points: boolean;
882
- streak: boolean;
883
- leaderboard: boolean;
879
+ CIRCLE_ACTIVITIES_INTRO_JOURNEY: boolean;
880
+ CIRCLE_LEADERBOARD_INTRO_JOURNEY: boolean;
881
+ CIRCLE_POINTS_REWARD_JOURNEY: boolean;
882
+ CIRCLE_STREAK_UPDATE_JOURNEY: boolean;
883
+ CIRCLE_TUTORIAL_JOURNEY: boolean;
884
884
  }
885
885
 
886
886
  export declare interface ICoachmarkProgress {
887
- activity: boolean;
888
- tutorial: boolean;
889
- points: boolean;
890
- streak: boolean;
891
- leaderboard: boolean;
887
+ CIRCLE_ACTIVITIES_INTRO_JOURNEY: boolean;
888
+ CIRCLE_LEADERBOARD_INTRO_JOURNEY: boolean;
889
+ CIRCLE_POINTS_REWARD_JOURNEY: boolean;
890
+ CIRCLE_STREAK_UPDATE_JOURNEY: boolean;
891
+ CIRCLE_TUTORIAL_JOURNEY: boolean;
892
892
  }
893
893
 
894
894
  /**
@@ -3305,11 +3305,11 @@ export declare interface IWorksheetResponse {
3305
3305
  }
3306
3306
 
3307
3307
  export declare enum JOURNEY_ID_STUDENT {
3308
- ACTIVITY = "activity",
3309
- TUTORIAL = "tutorial",
3310
- POINTS = "points",
3311
- STREAK = "streak",
3312
- LEADERBOARD = "leaderboard"
3308
+ CIRCLE_ACTIVITIES_INTRO_JOURNEY = "CIRCLE_ACTIVITIES_INTRO_JOURNEY",
3309
+ CIRCLE_LEADERBOARD_INTRO_JOURNEY = "CIRCLE_LEADERBOARD_INTRO_JOURNEY",
3310
+ CIRCLE_POINTS_REWARD_JOURNEY = "CIRCLE_POINTS_REWARD_JOURNEY",
3311
+ CIRCLE_STREAK_UPDATE_JOURNEY = "CIRCLE_STREAK_UPDATE_JOURNEY",
3312
+ CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY"
3313
3313
  }
3314
3314
 
3315
3315
  export declare const JourneyProvider: FC<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "2.8.21-rj-3",
3
+ "version": "2.8.21-rj-6",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"