@cuemath/leap 2.8.62-aa1 → 2.8.62-rj-0
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/features/chapters/lpar-chapter/block-section/sheet-item/rewards-n-actions/student-actions/student-actions.js +46 -45
- package/dist/features/chapters/lpar-chapter/block-section/sheet-item/rewards-n-actions/student-actions/student-actions.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/block-section/sheet-item/rewards-n-actions/teacher-actions/teacher-actions.js +26 -25
- package/dist/features/chapters/lpar-chapter/block-section/sheet-item/rewards-n-actions/teacher-actions/teacher-actions.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js +51 -49
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js.map +1 -1
- package/dist/features/circle-games/game-launcher/game-launcher.js +87 -90
- package/dist/features/circle-games/game-launcher/game-launcher.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +83 -82
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +59 -57
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -1
- package/dist/features/circle-games/games/web-view/web-view-types.js.map +1 -1
- package/dist/features/circle-games/games/web-view/web-view.js +53 -47
- package/dist/features/circle-games/games/web-view/web-view.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-provider.js +8 -9
- package/dist/features/cue-canvas/cue-canvas-provider.js.map +1 -1
- package/dist/features/journey/hooks/use-get-eligible-journeys-via-route.js +7 -4
- package/dist/features/journey/hooks/use-get-eligible-journeys-via-route.js.map +1 -1
- package/dist/features/journey/use-journey/journey-context-provider.js +71 -67
- package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
- package/dist/features/sheets/lessons-list/lesson-item/lesson-item-cta-info.js +60 -59
- package/dist/features/sheets/lessons-list/lesson-item/lesson-item-cta-info.js.map +1 -1
- package/dist/features/sheets/resources-list/resource-item/resource-item.js +90 -89
- package/dist/features/sheets/resources-list/resource-item/resource-item.js.map +1 -1
- package/dist/features/sheets/sheets-list/sheet-item/reward-n-actions/student-actions/student-actions.js +61 -60
- package/dist/features/sheets/sheets-list/sheet-item/reward-n-actions/student-actions/student-actions.js.map +1 -1
- package/dist/features/sheets/sheets-list/sheet-item/reward-n-actions/teacher-actions/teacher-actions.js +64 -63
- package/dist/features/sheets/sheets-list/sheet-item/reward-n-actions/teacher-actions/teacher-actions.js.map +1 -1
- package/dist/features/sheets/utils/is-v3-worksheet.js +14 -4
- package/dist/features/sheets/utils/is-v3-worksheet.js.map +1 -1
- package/dist/features/ui/section-list/section-list.js +12 -12
- package/dist/features/ui/section-list/section-list.js.map +1 -1
- package/dist/index.d.ts +14 -13
- package/dist/index.js +75 -74
- package/package.json +2 -4
- package/dist/library/polypad.js +0 -24965
- package/dist/library/polypad.js.map +0 -1
@@ -1,70 +1,67 @@
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
2
|
-
import { memo as
|
3
|
-
import { LOTTIE as
|
4
|
-
import { JOURNEY_ID_STUDENT as
|
5
|
-
import {
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import {
|
14
|
-
import {
|
15
|
-
import {
|
16
|
-
import {
|
17
|
-
import {
|
18
|
-
|
19
|
-
const M = Z + w, ce = g(
|
2
|
+
import { memo as J, useRef as v, useCallback as n, useMemo as P, useEffect as x } from "react";
|
3
|
+
import { LOTTIE as D } from "../../../assets/lottie/lottie.js";
|
4
|
+
import { JOURNEY_ID_STUDENT as h } from "../../journey/journey-id/journey-id-student.js";
|
5
|
+
import { CircularLoader as U } from "../../ui/loader/circular-loader/circular-loader.js";
|
6
|
+
import Y from "../../ui/lottie-animation/lottie-animation.js";
|
7
|
+
import { useCircleSounds as B } from "../hooks/use-circle-sounds/use-circle-sounds.js";
|
8
|
+
import { CircleSoundKey as u } from "../hooks/use-circle-sounds/use-circle-sounds-enums.js";
|
9
|
+
import { GAME_LAUNCHER_SIZE as K } from "./comps/card-container/constants.js";
|
10
|
+
import { Carousel as z } from "./comps/carousel/carousel.js";
|
11
|
+
import { GAME_LAUNCHER_ASSET_PADDING as H } from "./comps/segmented-game-card/constants.js";
|
12
|
+
import { SegmentedGameCard as a } from "./comps/segmented-game-card/segmented-game-card.js";
|
13
|
+
import { TablesCard as Z } from "./comps/tables-card/tables-card.js";
|
14
|
+
import { GAME_LAUNCHER_ANALYTICS_EVENTS as G } from "./game-launcher-analytics-events.js";
|
15
|
+
import { useGameLauncherJourney as w } from "./hooks/use-game-launcher-journey/use-game-launcher-journey.js";
|
16
|
+
import { useTableLauncherJourney as X } from "./hooks/use-table-launcher-journey/use-table-launcher-journey.js";
|
17
|
+
import { ProjectType as f } from "../games/web-view/enums/project-type-enum.js";
|
18
|
+
const S = K + H, ue = J(
|
20
19
|
({
|
21
20
|
onSegmentClick: r,
|
22
|
-
journeyId:
|
21
|
+
journeyId: m,
|
23
22
|
data: e,
|
24
|
-
isLoading:
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
isLoading: c,
|
24
|
+
isError: V,
|
25
|
+
isTutorialOnboardingDone: E,
|
26
|
+
defaultIndex: M = 0
|
28
27
|
}) => {
|
29
|
-
const
|
28
|
+
const t = v(null), { playSwipSound: T, play: o } = B(), p = n(
|
30
29
|
(l) => {
|
31
|
-
o(
|
30
|
+
o(u.GAME_CARD_CLICK), r(l, f.TABLE);
|
32
31
|
},
|
33
32
|
[r, o]
|
34
|
-
),
|
33
|
+
), C = n(
|
35
34
|
(l) => {
|
36
|
-
l.status !== "completed" && (o(
|
35
|
+
l.status !== "completed" && (o(u.GAME_CARD_CLICK), r(l, f.LESSON));
|
37
36
|
},
|
38
37
|
[r, o]
|
39
|
-
),
|
38
|
+
), L = n(
|
40
39
|
(l) => {
|
41
|
-
o(
|
40
|
+
o(u.GAME_CARD_CLICK), r(l, f.GAME);
|
42
41
|
},
|
43
42
|
[r, o]
|
44
|
-
),
|
43
|
+
), A = n(
|
45
44
|
(l) => {
|
46
|
-
o(
|
45
|
+
o(u.GAME_CARD_CLICK), r(l, f.PUZZLE);
|
47
46
|
},
|
48
47
|
[r, o]
|
49
48
|
), {
|
50
|
-
gameRefs:
|
49
|
+
gameRefs: _,
|
51
50
|
lessonRefs: R,
|
52
|
-
puzzleRefs:
|
53
|
-
startJourney:
|
54
|
-
} =
|
55
|
-
carouselRefs:
|
56
|
-
onSegmentClick: r
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
onJourneyComplete: C
|
62
|
-
}), v = z(() => {
|
51
|
+
puzzleRefs: b,
|
52
|
+
startJourney: I
|
53
|
+
} = w({
|
54
|
+
carouselRefs: t,
|
55
|
+
onSegmentClick: r
|
56
|
+
}), { startJourney: y, tableRef: N } = X({
|
57
|
+
carouselRefs: t,
|
58
|
+
onTableSegmentClick: p
|
59
|
+
}), g = P(() => {
|
63
60
|
let l = [];
|
64
61
|
return e && (e.lessons && (l = [
|
65
62
|
...l,
|
66
63
|
/* @__PURE__ */ i(
|
67
|
-
|
64
|
+
a,
|
68
65
|
{
|
69
66
|
ref: R,
|
70
67
|
label: e.lessons.label,
|
@@ -75,16 +72,16 @@ const M = Z + w, ce = g(
|
|
75
72
|
card: s.cardLottie,
|
76
73
|
name: s.name,
|
77
74
|
isCompleted: s.status === "completed",
|
78
|
-
onPress: () =>
|
75
|
+
onPress: () => C(s)
|
79
76
|
}))
|
80
77
|
}
|
81
78
|
)
|
82
79
|
]), l = [
|
83
80
|
...l,
|
84
81
|
/* @__PURE__ */ i(
|
85
|
-
|
82
|
+
a,
|
86
83
|
{
|
87
|
-
ref:
|
84
|
+
ref: _,
|
88
85
|
label: e.games.label,
|
89
86
|
value: e.games.data.filter((s) => s.isPlayed).length,
|
90
87
|
maxValue: e.games.data.length,
|
@@ -93,14 +90,14 @@ const M = Z + w, ce = g(
|
|
93
90
|
card: s.cardLottie,
|
94
91
|
name: s.name,
|
95
92
|
isCompleted: !1,
|
96
|
-
onPress: () =>
|
93
|
+
onPress: () => L(s)
|
97
94
|
}))
|
98
95
|
}
|
99
96
|
),
|
100
97
|
/* @__PURE__ */ i(
|
101
|
-
|
98
|
+
a,
|
102
99
|
{
|
103
|
-
ref:
|
100
|
+
ref: b,
|
104
101
|
label: e.puzzles.label,
|
105
102
|
value: e.puzzles.data.filter((s) => s.solved).length,
|
106
103
|
maxValue: e.puzzles.data.length,
|
@@ -109,92 +106,92 @@ const M = Z + w, ce = g(
|
|
109
106
|
card: s.cardLottie,
|
110
107
|
name: s.name,
|
111
108
|
isCompleted: s.solved,
|
112
|
-
onPress: () =>
|
109
|
+
onPress: () => A(s)
|
113
110
|
}))
|
114
111
|
}
|
115
112
|
)
|
116
113
|
], e.tables && (l = [
|
117
114
|
...l,
|
118
115
|
/* @__PURE__ */ i(
|
119
|
-
|
116
|
+
Z,
|
120
117
|
{
|
121
|
-
ref:
|
118
|
+
ref: N,
|
122
119
|
label: e.tables.label,
|
123
120
|
data: e.tables.data,
|
124
|
-
onPress:
|
121
|
+
onPress: p,
|
125
122
|
openModesOfTable: e.tables.openModesOfTable
|
126
123
|
}
|
127
124
|
)
|
128
125
|
])), l;
|
129
126
|
}, [
|
130
127
|
e,
|
131
|
-
|
132
|
-
|
128
|
+
_,
|
129
|
+
b,
|
133
130
|
R,
|
131
|
+
C,
|
132
|
+
L,
|
134
133
|
A,
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
c
|
139
|
-
]), O = z(
|
134
|
+
N,
|
135
|
+
p
|
136
|
+
]), O = P(
|
140
137
|
() => [
|
141
138
|
/* @__PURE__ */ i(
|
142
|
-
|
139
|
+
Y,
|
143
140
|
{
|
144
|
-
src:
|
145
|
-
width:
|
146
|
-
height:
|
141
|
+
src: D.SLEEPY_BOI,
|
142
|
+
width: S,
|
143
|
+
height: S
|
147
144
|
}
|
148
145
|
)
|
149
146
|
],
|
150
147
|
[]
|
151
148
|
);
|
152
|
-
return
|
153
|
-
|
154
|
-
|
155
|
-
|
149
|
+
return x(() => {
|
150
|
+
var l, s;
|
151
|
+
if (!(c || !e)) {
|
152
|
+
if (e != null && e.puzzles && m === h.CIRCLE_ACTIVITIES_INTRO_JOURNEY) {
|
153
|
+
console.log("INTRO START", (l = t.current) == null ? void 0 : l.indicatorRefs), I(e == null ? void 0 : e.puzzles, !!(e != null && e.lessons), m);
|
156
154
|
return;
|
157
155
|
}
|
158
|
-
e != null && e.tables &&
|
156
|
+
e != null && e.tables && m === h.CIRCLE_TABLES_INTRO_JOURNEY && (console.log("TABLE START", (s = t.current) == null ? void 0 : s.indicatorRefs), y(e == null ? void 0 : e.tables, E));
|
159
157
|
}
|
160
158
|
}, [
|
161
159
|
e,
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
V,
|
160
|
+
c,
|
161
|
+
E,
|
162
|
+
m,
|
163
|
+
I,
|
164
|
+
y
|
165
|
+
]), c ? /* @__PURE__ */ i(U, {}) : V ? /* @__PURE__ */ i(
|
166
|
+
z,
|
170
167
|
{
|
171
|
-
|
172
|
-
items: v,
|
173
|
-
defaultIndex: J,
|
174
|
-
onNext: _,
|
175
|
-
onPrev: _,
|
168
|
+
items: O,
|
176
169
|
analyticsNext: {
|
177
|
-
analyticsLabel:
|
170
|
+
analyticsLabel: ""
|
178
171
|
},
|
179
172
|
analyticsPrev: {
|
180
|
-
analyticsLabel:
|
173
|
+
analyticsLabel: ""
|
181
174
|
}
|
182
175
|
}
|
183
176
|
) : /* @__PURE__ */ i(
|
184
|
-
|
177
|
+
z,
|
185
178
|
{
|
186
|
-
|
179
|
+
ref: t,
|
180
|
+
items: g,
|
181
|
+
defaultIndex: M,
|
182
|
+
onNext: T,
|
183
|
+
onPrev: T,
|
187
184
|
analyticsNext: {
|
188
|
-
analyticsLabel:
|
185
|
+
analyticsLabel: G.NEXT_ACTIVITY
|
189
186
|
},
|
190
187
|
analyticsPrev: {
|
191
|
-
analyticsLabel:
|
188
|
+
analyticsLabel: G.PREV_ACTIVITY
|
192
189
|
}
|
193
190
|
}
|
194
191
|
);
|
195
192
|
}
|
196
193
|
);
|
197
194
|
export {
|
198
|
-
|
195
|
+
ue as GameLauncher
|
199
196
|
};
|
200
197
|
//# sourceMappingURL=game-launcher.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"game-launcher.js","sources":["../../../../src/features/circle-games/game-launcher/game-launcher.tsx"],"sourcesContent":["import type { ICarouselRefs } from './comps/carousel/carousel-types';\nimport type { ITableDetails } from './comps/tables-card/tables-card-types';\nimport type {\n Game,\n Lesson,\n Puzzle,\n} from './dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IGameLauncherProps } from './game-launcher-types';\nimport type { FC, ReactNode } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport { JOURNEY_ID_STUDENT } from '../../journey/journey-id/journey-id-student';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport { CircularLoader } from '../../ui/loader/circular-loader/circular-loader';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport { ProjectType } from '../games/web-view/enums';\nimport { useCircleSounds } from '../hooks/use-circle-sounds/use-circle-sounds';\nimport { CircleSoundKey } from '../hooks/use-circle-sounds/use-circle-sounds-enums';\nimport { GAME_LAUNCHER_SIZE } from './comps/card-container/constants';\nimport { Carousel } from './comps/carousel/carousel';\nimport { GAME_LAUNCHER_ASSET_PADDING } from './comps/segmented-game-card/constants';\nimport { SegmentedGameCard } from './comps/segmented-game-card/segmented-game-card';\nimport { TablesCard } from './comps/tables-card/tables-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from './game-launcher-analytics-events';\nimport { useGameLauncherJourney } from './hooks/use-game-launcher-journey/use-game-launcher-journey';\nimport { useTableLauncherJourney } from './hooks/use-table-launcher-journey/use-table-launcher-journey';\n\nconst sleepyBoiDimension = GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING;\n\nexport const GameLauncher: FC<IGameLauncherProps> = memo(\n ({\n onSegmentClick,\n journeyId,\n data,\n isLoading,\n isTutorialOnboardingDone,\n defaultIndex = 0,\n onJourneyComplete,\n }) => {\n const carouselRefs = useRef<ICarouselRefs>(null);\n\n const { isJourneyActive } = useJourney();\n\n const { playSwipSound, play } = useCircleSounds();\n\n const onTableSegmentClick = useCallback(\n (table: ITableDetails) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(table, ProjectType.TABLE);\n },\n [onSegmentClick, play],\n );\n\n const handleLessonSegmentClick = useCallback(\n (lesson: Lesson) => {\n if (lesson.status !== 'completed') {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(lesson, ProjectType.LESSON);\n }\n },\n [onSegmentClick, play],\n );\n\n const handleGameSegmentClick = useCallback(\n (game: Game) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(game, ProjectType.GAME);\n },\n [onSegmentClick, play],\n );\n\n const handlePuzzleSegmentClick = useCallback(\n (puzzle: Puzzle) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(puzzle, ProjectType.PUZZLE);\n },\n [onSegmentClick, play],\n );\n\n const {\n gameRefs,\n lessonRefs,\n puzzleRefs,\n startJourney: startLessonPuzzleGamesJourney,\n } = useGameLauncherJourney({\n carouselRefs,\n onSegmentClick,\n onJourneyComplete,\n });\n\n const { startJourney: startTablesJourney, tableRef } = useTableLauncherJourney({\n carouselRefs,\n onTableSegmentClick,\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: () => handleLessonSegmentClick(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: () => handleGameSegmentClick(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: () => handlePuzzleSegmentClick(puzzle),\n }))}\n />,\n ];\n\n if (data.tables) {\n itemTypes = [\n ...itemTypes,\n <TablesCard\n ref={tableRef}\n label={data.tables.label}\n data={data.tables.data}\n onPress={onTableSegmentClick}\n openModesOfTable={data.tables.openModesOfTable}\n />,\n ];\n }\n }\n\n return itemTypes;\n }, [\n data,\n gameRefs,\n puzzleRefs,\n lessonRefs,\n handleLessonSegmentClick,\n handleGameSegmentClick,\n handlePuzzleSegmentClick,\n tableRef,\n onTableSegmentClick,\n ]);\n\n const sleepyBoiItem = useMemo(\n () => [\n <LottieAnimation\n src={LOTTIE.SLEEPY_BOI}\n width={sleepyBoiDimension}\n height={sleepyBoiDimension}\n />,\n ],\n [],\n );\n\n // Start game launcher journey only when isLoading has become false and data is available\n useEffect(() => {\n if (isLoading || !data || isJourneyActive) {\n return;\n }\n\n if (data?.puzzles && journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY) {\n startLessonPuzzleGamesJourney(data?.puzzles, !!data?.lessons);\n\n return; // CIRCLE_ACTIVITIES_INTRO_JOURNEY has higher priority\n }\n\n if (data?.tables && journeyId === JOURNEY_ID_STUDENT.CIRCLE_TABLES_INTRO_JOURNEY) {\n startTablesJourney(data?.tables, isTutorialOnboardingDone);\n }\n }, [\n data,\n isJourneyActive,\n isLoading,\n isTutorialOnboardingDone,\n journeyId,\n startLessonPuzzleGamesJourney,\n startTablesJourney,\n ]);\n\n if (isLoading) {\n return <CircularLoader />;\n }\n\n if (!data) {\n return (\n <Carousel\n items={sleepyBoiItem}\n analyticsNext={{\n analyticsLabel: '',\n }}\n analyticsPrev={{\n analyticsLabel: '',\n }}\n />\n );\n }\n\n return (\n <Carousel\n ref={carouselRefs}\n items={items}\n defaultIndex={defaultIndex}\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":["sleepyBoiDimension","GAME_LAUNCHER_SIZE","GAME_LAUNCHER_ASSET_PADDING","GameLauncher","memo","onSegmentClick","journeyId","data","isLoading","isTutorialOnboardingDone","defaultIndex","onJourneyComplete","carouselRefs","useRef","isJourneyActive","useJourney","playSwipSound","play","useCircleSounds","onTableSegmentClick","useCallback","table","CircleSoundKey","ProjectType","handleLessonSegmentClick","lesson","handleGameSegmentClick","game","handlePuzzleSegmentClick","puzzle","gameRefs","lessonRefs","puzzleRefs","startLessonPuzzleGamesJourney","useGameLauncherJourney","startTablesJourney","tableRef","useTableLauncherJourney","items","useMemo","itemTypes","jsx","SegmentedGameCard","TablesCard","sleepyBoiItem","LottieAnimation","LOTTIE","useEffect","JOURNEY_ID_STUDENT","CircularLoader","Car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AWD,MAAc0C,EAAmB,iCAAiC;AACrF,UAAAf,EAA8B1B,KAAA,gBAAAA,EAAM,SAAS,CAAC,EAACA,KAAA,QAAAA,EAAM,QAAO;AAE5D;AAAA,QACF;AAEA,QAAIA,KAAA,QAAAA,EAAM,UAAUD,MAAc0C,EAAmB,+BAChCb,EAAA5B,KAAA,gBAAAA,EAAM,QAAQE,CAAwB;AAAA;AAAA,IAC3D,GACC;AAAA,MACDF;AAAA,MACAO;AAAA,MACAN;AAAA,MACAC;AAAA,MACAH;AAAA,MACA2B;AAAA,MACAE;AAAA,IAAA,CACD,GAEG3B,sBACMyC,GAAe,CAAA,CAAA,IAGpB1C,IAeH,gBAAAkC;AAAA,MAACS;AAAA,MAAA;AAAA,QACC,KAAKtC;AAAA,QACL,OAAA0B;AAAA,QACA,cAAA5B;AAAA,QACA,QAAQM;AAAA,QACR,QAAQA;AAAA,QACR,eAAe;AAAA,UACb,gBAAgBmC,EAA+B;AAAA,QACjD;AAAA,QACA,eAAe;AAAA,UACb,gBAAgBA,EAA+B;AAAA,QACjD;AAAA,MAAA;AAAA,IAAA,IAxBA,gBAAAV;AAAA,MAACS;AAAA,MAAA;AAAA,QACC,OAAON;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 { ICarouselRefs } from './comps/carousel/carousel-types';\nimport type { ITableDetails } from './comps/tables-card/tables-card-types';\nimport type {\n Game,\n Lesson,\n Puzzle,\n} from './dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IGameLauncherProps } from './game-launcher-types';\nimport type { FC, ReactNode } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport { JOURNEY_ID_STUDENT } from '../../journey/journey-id/journey-id-student';\nimport { CircularLoader } from '../../ui/loader/circular-loader/circular-loader';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport { ProjectType } from '../games/web-view/enums';\nimport { useCircleSounds } from '../hooks/use-circle-sounds/use-circle-sounds';\nimport { CircleSoundKey } from '../hooks/use-circle-sounds/use-circle-sounds-enums';\nimport { GAME_LAUNCHER_SIZE } from './comps/card-container/constants';\nimport { Carousel } from './comps/carousel/carousel';\nimport { GAME_LAUNCHER_ASSET_PADDING } from './comps/segmented-game-card/constants';\nimport { SegmentedGameCard } from './comps/segmented-game-card/segmented-game-card';\nimport { TablesCard } from './comps/tables-card/tables-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from './game-launcher-analytics-events';\nimport { useGameLauncherJourney } from './hooks/use-game-launcher-journey/use-game-launcher-journey';\nimport { useTableLauncherJourney } from './hooks/use-table-launcher-journey/use-table-launcher-journey';\n\nconst sleepyBoiDimension = GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING;\n\nexport const GameLauncher: FC<IGameLauncherProps> = memo(\n ({\n onSegmentClick,\n journeyId,\n data,\n isLoading,\n isError,\n isTutorialOnboardingDone,\n defaultIndex = 0,\n }) => {\n const carouselRefs = useRef<ICarouselRefs>(null);\n\n const { playSwipSound, play } = useCircleSounds();\n\n const onTableSegmentClick = useCallback(\n (table: ITableDetails) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(table, ProjectType.TABLE);\n },\n [onSegmentClick, play],\n );\n\n const handleLessonSegmentClick = useCallback(\n (lesson: Lesson) => {\n if (lesson.status !== 'completed') {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(lesson, ProjectType.LESSON);\n }\n },\n [onSegmentClick, play],\n );\n\n const handleGameSegmentClick = useCallback(\n (game: Game) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(game, ProjectType.GAME);\n },\n [onSegmentClick, play],\n );\n\n const handlePuzzleSegmentClick = useCallback(\n (puzzle: Puzzle) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(puzzle, ProjectType.PUZZLE);\n },\n [onSegmentClick, play],\n );\n\n const {\n gameRefs,\n lessonRefs,\n puzzleRefs,\n startJourney: startLessonPuzzleGamesJourney,\n } = useGameLauncherJourney({\n carouselRefs,\n onSegmentClick,\n });\n\n const { startJourney: startTablesJourney, tableRef } = useTableLauncherJourney({\n carouselRefs,\n onTableSegmentClick,\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: () => handleLessonSegmentClick(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: () => handleGameSegmentClick(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: () => handlePuzzleSegmentClick(puzzle),\n }))}\n />,\n ];\n\n if (data.tables) {\n itemTypes = [\n ...itemTypes,\n <TablesCard\n ref={tableRef}\n label={data.tables.label}\n data={data.tables.data}\n onPress={onTableSegmentClick}\n openModesOfTable={data.tables.openModesOfTable}\n />,\n ];\n }\n }\n\n return itemTypes;\n }, [\n data,\n gameRefs,\n puzzleRefs,\n lessonRefs,\n handleLessonSegmentClick,\n handleGameSegmentClick,\n handlePuzzleSegmentClick,\n tableRef,\n onTableSegmentClick,\n ]);\n\n const sleepyBoiItem = useMemo(\n () => [\n <LottieAnimation\n src={LOTTIE.SLEEPY_BOI}\n width={sleepyBoiDimension}\n height={sleepyBoiDimension}\n />,\n ],\n [],\n );\n\n // Start game launcher journey only when isLoading has become false and data is available\n useEffect(() => {\n if (isLoading || !data) {\n return;\n }\n\n if (data?.puzzles && journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY) {\n console.log('INTRO START', carouselRefs.current?.indicatorRefs);\n startLessonPuzzleGamesJourney(data?.puzzles, !!data?.lessons, journeyId);\n\n return; // CIRCLE_ACTIVITIES_INTRO_JOURNEY has higher priority\n }\n\n if (data?.tables && journeyId === JOURNEY_ID_STUDENT.CIRCLE_TABLES_INTRO_JOURNEY) {\n console.log('TABLE START', carouselRefs.current?.indicatorRefs);\n startTablesJourney(data?.tables, isTutorialOnboardingDone);\n }\n }, [\n data,\n isLoading,\n isTutorialOnboardingDone,\n journeyId,\n startLessonPuzzleGamesJourney,\n startTablesJourney,\n ]);\n\n if (isLoading) {\n return <CircularLoader />;\n }\n\n if (isError) {\n return (\n <Carousel\n items={sleepyBoiItem}\n analyticsNext={{\n analyticsLabel: '',\n }}\n analyticsPrev={{\n analyticsLabel: '',\n }}\n />\n );\n }\n\n return (\n <Carousel\n ref={carouselRefs}\n items={items}\n defaultIndex={defaultIndex}\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":["sleepyBoiDimension","GAME_LAUNCHER_SIZE","GAME_LAUNCHER_ASSET_PADDING","GameLauncher","memo","onSegmentClick","journeyId","data","isLoading","isError","isTutorialOnboardingDone","defaultIndex","carouselRefs","useRef","playSwipSound","play","useCircleSounds","onTableSegmentClick","useCallback","table","CircleSoundKey","ProjectType","handleLessonSegmentClick","lesson","handleGameSegmentClick","game","handlePuzzleSegmentClick","puzzle","gameRefs","lessonRefs","puzzleRefs","startLessonPuzzleGamesJourney","useGameLauncherJourney","startTablesJourney","tableRef","useTableLauncherJourney","items","useMemo","itemTypes","jsx","SegmentedGameCard","TablesCard","sleepyBoiItem","LottieAnimation","LOTTIE","useEffect","JOURNEY_ID_STUDENT","_a","_b","CircularLoader","Carousel","GAME_LAUNCHER_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;;;;;;;;AA4BA,MAAMA,IAAqBC,IAAqBC,GAEnCC,KAAuCC;AAAA,EAClD,CAAC;AAAA,IACC,gBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,MAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,EAAA,MACX;AACE,UAAAC,IAAeC,EAAsB,IAAI,GAEzC,EAAE,eAAAC,GAAe,MAAAC,EAAK,IAAIC,EAAgB,GAE1CC,IAAsBC;AAAA,MAC1B,CAACC,MAAyB;AACxB,QAAAJ,EAAKK,EAAe,eAAe,GACpBf,EAAAc,GAAOE,EAAY,KAAK;AAAA,MACzC;AAAA,MACA,CAAChB,GAAgBU,CAAI;AAAA,IAAA,GAGjBO,IAA2BJ;AAAA,MAC/B,CAACK,MAAmB;AACd,QAAAA,EAAO,WAAW,gBACpBR,EAAKK,EAAe,eAAe,GACpBf,EAAAkB,GAAQF,EAAY,MAAM;AAAA,MAE7C;AAAA,MACA,CAAChB,GAAgBU,CAAI;AAAA,IAAA,GAGjBS,IAAyBN;AA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QACA,QAAQG;AAAA,QACR,QAAQA;AAAA,QACR,eAAe;AAAA,UACb,gBAAgBqC,EAA+B;AAAA,QACjD;AAAA,QACA,eAAe;AAAA,UACb,gBAAgBA,EAA+B;AAAA,QACjD;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
|
@@ -1,108 +1,108 @@
|
|
1
1
|
import { jsx as t, Fragment as O } from "react/jsx-runtime";
|
2
|
-
import { useRef as
|
2
|
+
import { useRef as p, useCallback as f, useMemo as le, useEffect as ce } from "react";
|
3
3
|
import z from "../../../../../assets/line-icons/icons/carat-right.js";
|
4
4
|
import { PLATFORM_EVENTS_STUDENT as ee } from "../../../../analytics-events/platform-events-student.js";
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import { useJourney as de } from "../../../../journey/use-journey/use-journey.js";
|
5
|
+
import { IndicatorType as a } from "../../../../journey/use-journey/constants.js";
|
6
|
+
import { useJourney as ae } from "../../../../journey/use-journey/use-journey.js";
|
8
7
|
import te from "../../../../ui/buttons/icon-button/icon-button.js";
|
9
|
-
import { useUIContext as
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as
|
8
|
+
import { useUIContext as de } from "../../../../ui/context/context.js";
|
9
|
+
import S from "../../../../ui/layout/flex-view.js";
|
10
|
+
import d from "../../../../ui/text/text.js";
|
11
|
+
import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as _ } from "../../../enum/circle-onboarding-steps.js";
|
13
12
|
import { useCircleSounds as se } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
|
14
|
-
import { SegmentedGameCard as
|
13
|
+
import { SegmentedGameCard as he } from "../../comps/segmented-game-card/segmented-game-card.js";
|
15
14
|
import { GAME_LAUNCHER_ANALYTICS_EVENTS as re } from "../../game-launcher-analytics-events.js";
|
16
|
-
import { GO_TO_NEXT_SLIDE_AFTER_MS as
|
17
|
-
import { ProjectType as
|
15
|
+
import { GO_TO_NEXT_SLIDE_AFTER_MS as ge, SHOW_LABEL_HIGHLIGHT_AFTER_MS as me, SHOW_NUDGE_AFTER_MS as ue, SLIDE_TO_LESSON_MS as Te } from "./constants.js";
|
16
|
+
import { ProjectType as Ee } from "../../../games/web-view/enums/project-type-enum.js";
|
18
17
|
const ke = ({
|
19
18
|
carouselRefs: n,
|
20
|
-
onSegmentClick:
|
21
|
-
onJourneyComplete: y
|
19
|
+
onSegmentClick: b
|
22
20
|
}) => {
|
23
|
-
const
|
21
|
+
const o = p(null), r = p(null), l = p(null), C = p([]), L = p(!1), { playButtonSound: R } = se(), { nextCoachmark: s, setJourney: P, endJourney: N } = ae(), { onEvent: A } = de(), y = f(
|
24
22
|
(e) => {
|
25
|
-
|
23
|
+
A(ee.ONBOARDING_STEP_VIEWED, {
|
26
24
|
step: e
|
27
25
|
});
|
28
26
|
},
|
29
|
-
[
|
30
|
-
), H =
|
27
|
+
[A]
|
28
|
+
), H = f(
|
31
29
|
(e) => {
|
32
|
-
|
30
|
+
A(ee.ONBOARDING_STEP_COMPLETED, {
|
33
31
|
step: e
|
34
32
|
});
|
35
33
|
},
|
36
|
-
[
|
37
|
-
), h =
|
38
|
-
(e,
|
39
|
-
var
|
40
|
-
|
41
|
-
const
|
42
|
-
clearTimeout(
|
43
|
-
},
|
44
|
-
|
34
|
+
[A]
|
35
|
+
), h = f(
|
36
|
+
(e, c, i, g, I = !1) => {
|
37
|
+
var u, T;
|
38
|
+
I || (R(), (T = n.current) == null || T.goToIndex(((u = n.current) == null ? void 0 : u.currentIndex) + 1), s(g, !1, ge)), y(e);
|
39
|
+
const m = setTimeout(() => {
|
40
|
+
clearTimeout(m), c.startLabelAnimation(i);
|
41
|
+
}, me);
|
42
|
+
C.current.push(m), s(g, !0, ue);
|
45
43
|
},
|
46
|
-
[n,
|
47
|
-
), G =
|
48
|
-
(e) => {
|
49
|
-
|
44
|
+
[n, s, R, y]
|
45
|
+
), G = f(
|
46
|
+
(e, c) => {
|
47
|
+
b(e, Ee.PUZZLE), H(_.PUZZLE_ACTIVITY), N(c);
|
50
48
|
},
|
51
|
-
[
|
52
|
-
),
|
53
|
-
(e,
|
54
|
-
var
|
55
|
-
if (!((
|
49
|
+
[N, b, H]
|
50
|
+
), k = f(
|
51
|
+
(e, c, i) => {
|
52
|
+
var Y, v, B, U, V, x, D, M, J, W, X, $, F, Z, K, q, Q, j;
|
53
|
+
if (L.current || !((Y = n == null ? void 0 : n.current) != null && Y.nextBtnRef.current) || !((v = r == null ? void 0 : r.current) != null && v.segmentedCardWrapperRef.current) || !((B = o == null ? void 0 : o.current) != null && B.labelRef.current) || !((U = r == null ? void 0 : r.current) != null && U.labelRef.current) || !e)
|
56
54
|
return;
|
57
|
-
|
55
|
+
L.current = !0;
|
56
|
+
const g = ((D = (x = (V = l.current) == null ? void 0 : V.labelRef) == null ? void 0 : x.current) == null ? void 0 : D.getBoundingClientRect()) || {
|
58
57
|
height: 0,
|
59
58
|
width: 0
|
60
|
-
},
|
59
|
+
}, I = ((W = (J = (M = o.current) == null ? void 0 : M.labelRef) == null ? void 0 : J.current) == null ? void 0 : W.getBoundingClientRect()) || {
|
61
60
|
height: 0,
|
62
61
|
width: 0
|
63
|
-
},
|
62
|
+
}, m = ((F = ($ = (X = r.current) == null ? void 0 : X.labelRef) == null ? void 0 : $.current) == null ? void 0 : F.getBoundingClientRect()) || {
|
64
63
|
height: 0,
|
65
64
|
width: 0
|
66
|
-
},
|
65
|
+
}, u = ((q = (K = (Z = r.current) == null ? void 0 : Z.segmentedCardWrapperRef) == null ? void 0 : K.current) == null ? void 0 : q.getBoundingClientRect()) || {
|
67
66
|
height: 0,
|
68
67
|
width: 0
|
69
68
|
};
|
70
|
-
let
|
71
|
-
|
69
|
+
let T = [];
|
70
|
+
c && l.current && (T = [
|
72
71
|
{
|
73
72
|
originalElementToHighlightRef: l.current.labelRef,
|
74
73
|
isActive: !1,
|
75
|
-
type:
|
74
|
+
type: a.TOOLTIP,
|
76
75
|
elementToHighlight: /* @__PURE__ */ t(O, {}),
|
77
76
|
indicator: {
|
78
77
|
position: "right",
|
79
78
|
backgroundColor: "BLUE_4",
|
80
79
|
width: 264,
|
81
|
-
tooltipItem: /* @__PURE__ */ t(
|
82
|
-
tooltipXCoOrdinates:
|
83
|
-
tooltipYCoOrdinates:
|
80
|
+
tooltipItem: /* @__PURE__ */ t(S, { children: /* @__PURE__ */ t(d, { $renderAs: "ab2-bold", children: "Get faster & stay ahead in school. Practice 3 new skills everyday." }) }),
|
81
|
+
tooltipXCoOrdinates: g.width + 50,
|
82
|
+
tooltipYCoOrdinates: g.height / 2
|
84
83
|
}
|
85
84
|
},
|
86
85
|
{
|
87
|
-
originalElementToHighlightRef: (
|
86
|
+
originalElementToHighlightRef: (Q = n.current) == null ? void 0 : Q.nextBtnRef,
|
88
87
|
isActive: !1,
|
89
|
-
type:
|
88
|
+
type: a.NUDGE,
|
90
89
|
elementToHighlight: /* @__PURE__ */ t(
|
91
90
|
te,
|
92
91
|
{
|
93
92
|
renderAs: "secondary",
|
94
93
|
Icon: z,
|
95
94
|
onClick: () => h(
|
96
|
-
|
95
|
+
_.GAMES_ACTIVITY,
|
97
96
|
o.current,
|
98
|
-
"ORANGE_4"
|
97
|
+
"ORANGE_4",
|
98
|
+
i
|
99
99
|
),
|
100
100
|
analyticsLabel: re.JOURNEY_NEXT_ACTIVITY
|
101
101
|
}
|
102
102
|
),
|
103
103
|
indicator: {
|
104
104
|
nudge: "click",
|
105
|
-
content: /* @__PURE__ */ t(
|
105
|
+
content: /* @__PURE__ */ t(d, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
|
106
106
|
nudgePointerX: 0,
|
107
107
|
nudgePointerY: 0
|
108
108
|
}
|
@@ -112,37 +112,38 @@ const ke = ({
|
|
112
112
|
{
|
113
113
|
originalElementToHighlightRef: o.current.labelRef,
|
114
114
|
isActive: !1,
|
115
|
-
type:
|
115
|
+
type: a.TOOLTIP,
|
116
116
|
elementToHighlight: /* @__PURE__ */ t(O, {}),
|
117
117
|
indicator: {
|
118
118
|
position: "right",
|
119
119
|
backgroundColor: "ORANGE_4",
|
120
120
|
width: 264,
|
121
|
-
tooltipItem: /* @__PURE__ */ t(
|
122
|
-
tooltipXCoOrdinates:
|
123
|
-
tooltipYCoOrdinates:
|
121
|
+
tooltipItem: /* @__PURE__ */ t(S, { children: /* @__PURE__ */ t(d, { $renderAs: "ab2-bold", children: "Train to think deeper & plan ahead. Play 3 new games everyday." }) }),
|
122
|
+
tooltipXCoOrdinates: I.width + 50,
|
123
|
+
tooltipYCoOrdinates: I.height / 2
|
124
124
|
}
|
125
125
|
},
|
126
126
|
{
|
127
127
|
originalElementToHighlightRef: n.current.nextBtnRef,
|
128
128
|
isActive: !1,
|
129
|
-
type:
|
129
|
+
type: a.NUDGE,
|
130
130
|
elementToHighlight: /* @__PURE__ */ t(
|
131
131
|
te,
|
132
132
|
{
|
133
133
|
renderAs: "secondary",
|
134
134
|
Icon: z,
|
135
135
|
onClick: () => h(
|
136
|
-
|
136
|
+
_.PUZZLE_ACTIVITY,
|
137
137
|
r.current,
|
138
|
-
"PURPLE_4"
|
138
|
+
"PURPLE_4",
|
139
|
+
i
|
139
140
|
),
|
140
141
|
analyticsLabel: re.JOURNEY_NEXT_ACTIVITY
|
141
142
|
}
|
142
143
|
),
|
143
144
|
indicator: {
|
144
145
|
nudge: "click",
|
145
|
-
content: /* @__PURE__ */ t(
|
146
|
+
content: /* @__PURE__ */ t(d, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
|
146
147
|
nudgePointerX: 0,
|
147
148
|
nudgePointerY: 0
|
148
149
|
}
|
@@ -151,63 +152,63 @@ const ke = ({
|
|
151
152
|
{
|
152
153
|
originalElementToHighlightRef: r.current.labelRef,
|
153
154
|
isActive: !1,
|
154
|
-
type:
|
155
|
+
type: a.TOOLTIP,
|
155
156
|
elementToHighlight: /* @__PURE__ */ t(O, {}),
|
156
157
|
indicator: {
|
157
158
|
position: "right",
|
158
159
|
backgroundColor: "PURPLE_4",
|
159
160
|
width: 264,
|
160
|
-
tooltipItem: /* @__PURE__ */ t(
|
161
|
-
tooltipXCoOrdinates:
|
162
|
-
tooltipYCoOrdinates:
|
161
|
+
tooltipItem: /* @__PURE__ */ t(S, { children: /* @__PURE__ */ t(d, { $renderAs: "ab2-bold", children: "Think in new ways & stay sharp. Solve 3 new puzzles everyday." }) }),
|
162
|
+
tooltipXCoOrdinates: m.width + 50,
|
163
|
+
tooltipYCoOrdinates: m.height / 2
|
163
164
|
}
|
164
165
|
},
|
165
166
|
{
|
166
167
|
originalElementToHighlightRef: r.current.segmentedCardWrapperRef,
|
167
168
|
isActive: !1,
|
168
|
-
type:
|
169
|
+
type: a.NUDGE,
|
169
170
|
elementToHighlight: /* @__PURE__ */ t(
|
170
|
-
|
171
|
+
he,
|
171
172
|
{
|
172
173
|
label: "",
|
173
|
-
value: e.data.filter((
|
174
|
+
value: e.data.filter((E) => E.solved).length,
|
174
175
|
maxValue: e.data.length,
|
175
176
|
initialValue: e.initialProgressValue,
|
176
|
-
data: e.data.map((
|
177
|
-
card:
|
177
|
+
data: e.data.map((E) => ({
|
178
|
+
card: E.cardLottie,
|
178
179
|
name: "",
|
179
180
|
// We dont want to show the name of the puzzle in onboarding
|
180
|
-
isCompleted:
|
181
|
-
onPress: () => G(
|
181
|
+
isCompleted: E.solved,
|
182
|
+
onPress: () => G(E, i)
|
182
183
|
}))
|
183
184
|
}
|
184
185
|
),
|
185
186
|
indicator: {
|
186
187
|
nudge: "click",
|
187
|
-
content: /* @__PURE__ */ t(
|
188
|
-
nudgePointerX:
|
189
|
-
nudgePointerY:
|
188
|
+
content: /* @__PURE__ */ t(d, { $renderAs: "ab1", $color: "WHITE", children: "Click to solve a puzzle" }),
|
189
|
+
nudgePointerX: u.width * 0.6,
|
190
|
+
nudgePointerY: u.height * 0.4
|
190
191
|
}
|
191
192
|
}
|
192
193
|
];
|
193
|
-
|
194
|
-
const
|
195
|
-
clearTimeout(
|
196
|
-
},
|
197
|
-
|
194
|
+
P(i, [...T, ...ie, ...oe]), (j = n.current) == null || j.goToIndex(0);
|
195
|
+
const w = setTimeout(() => {
|
196
|
+
clearTimeout(w), s(i);
|
197
|
+
}, Te);
|
198
|
+
C.current.push(w), c && l.current ? h(_.SKILL_ACTIVITY, l.current, "BLUE_4", i, !0) : h(_.GAMES_ACTIVITY, o.current, "ORANGE_4", i, !0);
|
198
199
|
},
|
199
|
-
[n,
|
200
|
+
[n, G, h, s, P]
|
200
201
|
), ne = le(
|
201
202
|
() => ({
|
202
203
|
gameRefs: o,
|
203
204
|
puzzleRefs: r,
|
204
205
|
lessonRefs: l,
|
205
|
-
startJourney:
|
206
|
+
startJourney: k
|
206
207
|
}),
|
207
|
-
[
|
208
|
+
[k]
|
208
209
|
);
|
209
210
|
return ce(() => () => {
|
210
|
-
|
211
|
+
C.current.forEach((e) => clearTimeout(e)), C.current = [], L.current = !1;
|
211
212
|
}, [n]), ne;
|
212
213
|
};
|
213
214
|
export {
|