@burdenoff/microfe-buildmyiq 2026.1102.2 → 2026.1102.4
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/buildmyiq/hooks/index.d.ts +1 -0
- package/dist/buildmyiq/hooks/index.d.ts.map +1 -1
- package/dist/buildmyiq/hooks/index.js +1 -0
- package/dist/buildmyiq/hooks/useBuiInteractive.d.ts +139 -0
- package/dist/buildmyiq/hooks/useBuiInteractive.d.ts.map +1 -0
- package/dist/buildmyiq/hooks/useBuiInteractive.js +104 -0
- package/dist/buildmyiq/hooks/useBuiInteractive.js.map +1 -0
- package/dist/buildmyiq/pages/authoring/CourseBuilderPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/authoring/CourseBuilderPage.js +94 -73
- package/dist/buildmyiq/pages/authoring/CourseBuilderPage.js.map +1 -1
- package/dist/buildmyiq/pages/authoring/InteractivePackageModal.d.ts +7 -0
- package/dist/buildmyiq/pages/authoring/InteractivePackageModal.d.ts.map +1 -0
- package/dist/buildmyiq/pages/authoring/InteractivePackageModal.js +237 -0
- package/dist/buildmyiq/pages/authoring/InteractivePackageModal.js.map +1 -0
- package/dist/buildmyiq/pages/learning/InteractiveActivity.d.ts +22 -0
- package/dist/buildmyiq/pages/learning/InteractiveActivity.d.ts.map +1 -0
- package/dist/buildmyiq/pages/learning/InteractiveActivity.js +259 -0
- package/dist/buildmyiq/pages/learning/InteractiveActivity.js.map +1 -0
- package/dist/buildmyiq/pages/learning/LessonPlayerPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/learning/LessonPlayerPage.js +125 -96
- package/dist/buildmyiq/pages/learning/LessonPlayerPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,17 +10,19 @@ import { ErrorView as c, LoadingView as l } from "../../components/StateViews.js
|
|
|
10
10
|
import { MiniBar as ee } from "../../components/MiniBar.js";
|
|
11
11
|
import { ProgressRing as te } from "../../components/Viz.js";
|
|
12
12
|
import { useBuiCompleteMyEnrollment as ne, useBuiCourse as re, useBuiMyEnrollment as ie, useBuiRecordMyLessonProgress as ae } from "../../hooks/useBuildmyiqApi.js";
|
|
13
|
+
import { useBuiInteractivePlayer as oe, useBuiMyInteractiveAttempts as se, useBuiSubmitMyInteractiveAttempt as ce } from "../../hooks/useBuiInteractive.js";
|
|
13
14
|
import "../../hooks/index.js";
|
|
14
|
-
import { FileLink as
|
|
15
|
-
import { TutorPanel as
|
|
16
|
-
import { OfflineLessonControl as
|
|
15
|
+
import { FileLink as le } from "../../components/FileLink.js";
|
|
16
|
+
import { TutorPanel as ue } from "../../components/TutorPanel.js";
|
|
17
|
+
import { OfflineLessonControl as de } from "../../components/OfflineLessonControl.js";
|
|
17
18
|
import "../../components/index.js";
|
|
18
|
-
import { useBuildmyiqAnalytics as
|
|
19
|
+
import { useBuildmyiqAnalytics as fe } from "../../analytics/useBuildmyiqAnalytics.js";
|
|
19
20
|
import "../../analytics/index.js";
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
21
|
+
import { InteractiveActivity as pe } from "./InteractiveActivity.js";
|
|
22
|
+
import { useEffect as me, useMemo as u, useRef as he, useState as d } from "react";
|
|
23
|
+
import { ArrowLeft as ge, BookOpen as _e, Check as ve, CheckCircle2 as f, ChevronLeft as ye, ChevronRight as be, FileText as p, HelpCircle as m, ListChecks as xe, Loader2 as h, MousePointerClick as g, PenLine as _, PlayCircle as v, Radio as y, Trophy as Se } from "lucide-react";
|
|
24
|
+
import { useParams as Ce, useSearchParams as we } from "react-router";
|
|
25
|
+
import { Fragment as Te, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
24
26
|
import { Button as S, GlassCard as C } from "@burdenoff/fe-libs/ui";
|
|
25
27
|
//#region src/buildmyiq/pages/learning/LessonPlayerPage.tsx
|
|
26
28
|
var w = {
|
|
@@ -31,7 +33,7 @@ var w = {
|
|
|
31
33
|
INTERACTIVE: g,
|
|
32
34
|
LIVE_SESSION: y
|
|
33
35
|
}, T = (e) => [...e].sort((e, t) => e.position - t.position), E = () => {
|
|
34
|
-
let { enrollmentId: m } =
|
|
36
|
+
let { enrollmentId: m } = Ce(), [g] = we(), _ = g.get("lesson"), { navigateTo: v } = e(), y = t(), E = ie(m), D = E.data ?? null, O = D?.courseId, k = re(O), A = k.data ?? null, j = ae(), M = ne(), { trackLessonStarted: N, trackLessonCompleted: P, trackCourseCompleted: Ee } = fe(), De = j.mutate, Oe = he(/* @__PURE__ */ new Set()), [F, I] = d(null), [L, R] = d(!1), [z, B] = d(null), V = u(() => {
|
|
35
37
|
if (!A) return [];
|
|
36
38
|
let e = /* @__PURE__ */ new Set(), t = T(A.modules ?? []), n = [];
|
|
37
39
|
for (let r of t) {
|
|
@@ -48,78 +50,91 @@ var w = {
|
|
|
48
50
|
title: y("common.lessons", "Lessons"),
|
|
49
51
|
lessons: r
|
|
50
52
|
}), n;
|
|
51
|
-
}, [A, y]),
|
|
53
|
+
}, [A, y]), H = u(() => V.flatMap((e) => e.lessons), [V]), ke = u(() => new Map(H.map((e) => [e.id, e.title])), [H]), U = u(() => {
|
|
52
54
|
let e = /* @__PURE__ */ new Map();
|
|
53
55
|
for (let t of D?.lessonProgress ?? []) e.set(t.lessonId, t.status);
|
|
54
56
|
return e;
|
|
55
|
-
}, [D]),
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
}, [D]), W = u(() => H.length === 0 ? null : F && H.some((e) => e.id === F) ? F : _ && H.some((e) => e.id === _) ? _ : H[0].id, [
|
|
58
|
+
H,
|
|
59
|
+
F,
|
|
58
60
|
_
|
|
59
61
|
]);
|
|
60
|
-
|
|
61
|
-
if (!m || !
|
|
62
|
-
let e =
|
|
63
|
-
if (e === "COMPLETED" || e === "IN_PROGRESS" ||
|
|
64
|
-
|
|
65
|
-
let t =
|
|
66
|
-
|
|
62
|
+
me(() => {
|
|
63
|
+
if (!m || !W) return;
|
|
64
|
+
let e = U.get(W);
|
|
65
|
+
if (e === "COMPLETED" || e === "IN_PROGRESS" || Oe.current.has(W)) return;
|
|
66
|
+
Oe.current.add(W);
|
|
67
|
+
let t = H.find((e) => e.id === W)?.type;
|
|
68
|
+
De({
|
|
67
69
|
enrollmentId: m,
|
|
68
|
-
lessonId:
|
|
70
|
+
lessonId: W,
|
|
69
71
|
status: "IN_PROGRESS"
|
|
70
72
|
}, { onSuccess: () => N({
|
|
71
73
|
courseId: O,
|
|
72
74
|
enrollmentId: m,
|
|
73
|
-
lessonId:
|
|
75
|
+
lessonId: W,
|
|
74
76
|
lessonType: t
|
|
75
77
|
}) });
|
|
76
78
|
}, [
|
|
77
79
|
m,
|
|
78
|
-
G,
|
|
79
80
|
W,
|
|
80
|
-
P,
|
|
81
81
|
U,
|
|
82
|
+
De,
|
|
83
|
+
H,
|
|
82
84
|
O,
|
|
83
85
|
N
|
|
84
86
|
]);
|
|
85
|
-
let
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
if (
|
|
89
|
-
let t =
|
|
90
|
-
t &&
|
|
91
|
-
},
|
|
92
|
-
if (!m || !
|
|
93
|
-
|
|
87
|
+
let G = H.findIndex((e) => e.id === W), K = G >= 0 ? H[G] : null, q = (K ? U.get(K.id) : void 0) === "COMPLETED", J = K?.type === "INTERACTIVE", Y = oe(J ? K?.id : null), X = J ? Y.data ?? null : null, Ae = se(X ? m : null, X ? K?.id : null), je = Ae.data?.length ? Math.max(...Ae.data.map((e) => e.scaled)) : null, Me = ce(), Z = H.filter((e) => U.get(e.id) === "COMPLETED").length, Ne = H.length > 0 && Z === H.length, Pe = D?.status === "COMPLETED", Fe = (e) => {
|
|
88
|
+
I(e), R(!1), B(null);
|
|
89
|
+
}, Ie = (e) => {
|
|
90
|
+
if (G < 0) return;
|
|
91
|
+
let t = H[G + e];
|
|
92
|
+
t && Fe(t.id);
|
|
93
|
+
}, Le = async () => {
|
|
94
|
+
if (!m || !K) return;
|
|
95
|
+
B(null);
|
|
94
96
|
try {
|
|
95
97
|
await j.mutateAsync({
|
|
96
98
|
enrollmentId: m,
|
|
97
|
-
lessonId:
|
|
99
|
+
lessonId: K.id,
|
|
98
100
|
status: "COMPLETED"
|
|
99
101
|
});
|
|
100
102
|
} catch (e) {
|
|
101
|
-
|
|
103
|
+
B(e instanceof Error && e.message ? e.message : y("buildmyiq.lessonPlayer.markCompleteError", "Could not mark this lesson complete."));
|
|
102
104
|
return;
|
|
103
105
|
}
|
|
104
|
-
|
|
106
|
+
P({
|
|
105
107
|
courseId: O,
|
|
106
108
|
enrollmentId: m,
|
|
107
|
-
lessonId:
|
|
108
|
-
lessonType:
|
|
109
|
+
lessonId: K.id,
|
|
110
|
+
lessonType: K.type
|
|
111
|
+
});
|
|
112
|
+
let e = H[G + 1];
|
|
113
|
+
e && I(e.id);
|
|
114
|
+
}, Re = async (e) => {
|
|
115
|
+
if (!m || !K) throw Error(y("buildmyiq.interactive.noEnrollment", "Open this lesson from your enrollment."));
|
|
116
|
+
let t = await Me.mutateAsync({
|
|
117
|
+
enrollmentId: m,
|
|
118
|
+
lessonId: K.id,
|
|
119
|
+
responses: e
|
|
109
120
|
});
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
121
|
+
return t.lessonCompleted && !q && P({
|
|
122
|
+
courseId: O,
|
|
123
|
+
enrollmentId: m,
|
|
124
|
+
lessonId: K.id,
|
|
125
|
+
lessonType: K.type
|
|
126
|
+
}), t;
|
|
127
|
+
}, ze = async () => {
|
|
113
128
|
if (m) {
|
|
114
|
-
|
|
129
|
+
B(null);
|
|
115
130
|
try {
|
|
116
131
|
let e = await M.mutateAsync({ id: m });
|
|
117
|
-
|
|
132
|
+
Ee({
|
|
118
133
|
courseId: e.courseId,
|
|
119
134
|
enrollmentId: e.id
|
|
120
135
|
});
|
|
121
136
|
} catch (e) {
|
|
122
|
-
|
|
137
|
+
B(e instanceof Error && e.message ? e.message : y("buildmyiq.lessonPlayer.finishCourseError", "Could not finish this course."));
|
|
123
138
|
}
|
|
124
139
|
}
|
|
125
140
|
};
|
|
@@ -135,17 +150,17 @@ var w = {
|
|
|
135
150
|
})
|
|
136
151
|
})
|
|
137
152
|
});
|
|
138
|
-
let
|
|
153
|
+
let Be = E.isLoading || !!O && k.isLoading, Q = /* @__PURE__ */ x(S, {
|
|
139
154
|
variant: "ghost",
|
|
140
155
|
size: "sm",
|
|
141
156
|
onClick: () => v("learning"),
|
|
142
157
|
children: [
|
|
143
|
-
/* @__PURE__ */ b(
|
|
158
|
+
/* @__PURE__ */ b(ge, { className: "me-1 h-4 w-4 rtl:-scale-x-100" }),
|
|
144
159
|
" ",
|
|
145
160
|
y("buildmyiq.nav.learning", "My Learning")
|
|
146
161
|
]
|
|
147
162
|
});
|
|
148
|
-
if (
|
|
163
|
+
if (Be) return /* @__PURE__ */ b(r, {
|
|
149
164
|
title: y("buildmyiq.lessonPlayer.pageTitle", "Lesson"),
|
|
150
165
|
actions: Q,
|
|
151
166
|
children: /* @__PURE__ */ b(l, { label: y("buildmyiq.lessonPlayer.loading", "Loading your lesson…") })
|
|
@@ -181,7 +196,7 @@ var w = {
|
|
|
181
196
|
onRetry: () => k.refetch()
|
|
182
197
|
})
|
|
183
198
|
});
|
|
184
|
-
let $ = Math.round(D.progressPct ?? 0),
|
|
199
|
+
let $ = Math.round(D.progressPct ?? 0), Ve = K ? w[K.type] : p;
|
|
185
200
|
return /* @__PURE__ */ b(r, {
|
|
186
201
|
title: A?.title ?? y("buildmyiq.lessonPlayer.pageTitle", "Lesson"),
|
|
187
202
|
actions: Q,
|
|
@@ -205,8 +220,8 @@ var w = {
|
|
|
205
220
|
children: [/* @__PURE__ */ b(o, { status: D.status }), /* @__PURE__ */ b("span", {
|
|
206
221
|
className: "text-sm text-text-secondary tabular-nums",
|
|
207
222
|
children: y("buildmyiq.lessonPlayer.progressSummary", "{{completed}} of {{total}} lessons complete", {
|
|
208
|
-
completed:
|
|
209
|
-
total:
|
|
223
|
+
completed: Z,
|
|
224
|
+
total: H.length
|
|
210
225
|
})
|
|
211
226
|
})]
|
|
212
227
|
}), /* @__PURE__ */ b(ee, {
|
|
@@ -215,43 +230,43 @@ var w = {
|
|
|
215
230
|
className: "mt-3"
|
|
216
231
|
})]
|
|
217
232
|
}),
|
|
218
|
-
|
|
233
|
+
Ne && !Pe && /* @__PURE__ */ x(S, {
|
|
219
234
|
className: "shrink-0 max-sm:w-full",
|
|
220
|
-
onClick:
|
|
235
|
+
onClick: ze,
|
|
221
236
|
disabled: M.isPending,
|
|
222
|
-
children: [M.isPending ? /* @__PURE__ */ b(h, { className: "me-1 h-4 w-4 animate-spin" }) : /* @__PURE__ */ b(
|
|
237
|
+
children: [M.isPending ? /* @__PURE__ */ b(h, { className: "me-1 h-4 w-4 animate-spin" }) : /* @__PURE__ */ b(Se, { className: "me-1 h-4 w-4" }), y("buildmyiq.lessonPlayer.finishCourse", "Finish course")]
|
|
223
238
|
})
|
|
224
239
|
]
|
|
225
240
|
}),
|
|
226
|
-
|
|
241
|
+
z && /* @__PURE__ */ b("p", {
|
|
227
242
|
role: "alert",
|
|
228
243
|
className: "text-sm text-status-error-text",
|
|
229
|
-
children:
|
|
244
|
+
children: z
|
|
230
245
|
}),
|
|
231
246
|
/* @__PURE__ */ x(S, {
|
|
232
247
|
variant: "secondary",
|
|
233
248
|
size: "sm",
|
|
234
249
|
className: "w-full lg:hidden",
|
|
235
|
-
onClick: () =>
|
|
236
|
-
children: [/* @__PURE__ */ b(
|
|
237
|
-
completed:
|
|
238
|
-
total:
|
|
250
|
+
onClick: () => R((e) => !e),
|
|
251
|
+
children: [/* @__PURE__ */ b(xe, { className: "me-1 h-4 w-4" }), L ? y("buildmyiq.lessonPlayer.hideLessons", "Hide lessons") : y("buildmyiq.lessonPlayer.showLessons", "Lessons ({{completed}}/{{total}})", {
|
|
252
|
+
completed: Z,
|
|
253
|
+
total: H.length
|
|
239
254
|
})]
|
|
240
255
|
}),
|
|
241
256
|
/* @__PURE__ */ x("div", {
|
|
242
257
|
className: "flex flex-col gap-5 lg:flex-row",
|
|
243
258
|
children: [/* @__PURE__ */ b("aside", {
|
|
244
|
-
className: n("lg:block lg:w-80 lg:shrink-0",
|
|
259
|
+
className: n("lg:block lg:w-80 lg:shrink-0", L ? "block" : "hidden"),
|
|
245
260
|
children: /* @__PURE__ */ b(C, {
|
|
246
261
|
treatment: "plain",
|
|
247
262
|
className: "overflow-hidden p-0 lg:sticky lg:top-4",
|
|
248
|
-
children:
|
|
263
|
+
children: H.length === 0 ? /* @__PURE__ */ b("div", {
|
|
249
264
|
className: "p-4 text-sm text-text-secondary",
|
|
250
265
|
children: y("buildmyiq.lessonPlayer.noLessons", "This course has no lessons yet.")
|
|
251
|
-
}) : /* @__PURE__ */ x(
|
|
266
|
+
}) : /* @__PURE__ */ x(Te, { children: [/* @__PURE__ */ b("nav", {
|
|
252
267
|
className: "max-h-[68vh] overflow-auto p-3",
|
|
253
|
-
children:
|
|
254
|
-
let t = e.lessons.filter((e) =>
|
|
268
|
+
children: V.map((e) => {
|
|
269
|
+
let t = e.lessons.filter((e) => U.get(e.id) === "COMPLETED").length;
|
|
255
270
|
return /* @__PURE__ */ x("div", {
|
|
256
271
|
className: "mb-4 last:mb-0",
|
|
257
272
|
children: [/* @__PURE__ */ x("div", {
|
|
@@ -270,14 +285,14 @@ var w = {
|
|
|
270
285
|
}), /* @__PURE__ */ b("ul", {
|
|
271
286
|
className: "flex flex-col",
|
|
272
287
|
children: e.lessons.map((t, r) => {
|
|
273
|
-
let o =
|
|
288
|
+
let o = U.get(t.id) === "COMPLETED", s = t.id === W, c = r === e.lessons.length - 1, l = w[t.type];
|
|
274
289
|
return /* @__PURE__ */ x("li", {
|
|
275
290
|
className: "flex gap-3",
|
|
276
291
|
children: [/* @__PURE__ */ x("div", {
|
|
277
292
|
className: "flex flex-col items-center pt-1.5",
|
|
278
293
|
children: [o ? /* @__PURE__ */ b("span", {
|
|
279
294
|
className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--color-status-success-text)]",
|
|
280
|
-
children: /* @__PURE__ */ b(
|
|
295
|
+
children: /* @__PURE__ */ b(ve, { className: "h-3.5 w-3.5 text-status-success-bg-subtle" })
|
|
281
296
|
}) : s ? /* @__PURE__ */ b("span", {
|
|
282
297
|
className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--color-accent-soft)] ring-2 ring-[var(--color-accent-teal)]",
|
|
283
298
|
children: /* @__PURE__ */ b(l, { className: "h-3.5 w-3.5 text-[var(--color-accent-teal)]" })
|
|
@@ -287,7 +302,7 @@ var w = {
|
|
|
287
302
|
}), !c && /* @__PURE__ */ b("span", { className: n("my-1 w-px flex-1", o ? "bg-[color-mix(in_srgb,var(--color-status-success-text)_45%,transparent)]" : "bg-border-seam") })]
|
|
288
303
|
}), /* @__PURE__ */ x("button", {
|
|
289
304
|
type: "button",
|
|
290
|
-
onClick: () =>
|
|
305
|
+
onClick: () => Fe(t.id),
|
|
291
306
|
className: n("mb-1 min-w-0 flex-1 rounded-lg px-3 py-2 text-start transition-colors", s ? "bg-[var(--color-accent-soft)]" : "hover:bg-bg-sunken"),
|
|
292
307
|
"aria-current": s ? "true" : void 0,
|
|
293
308
|
children: [/* @__PURE__ */ b("span", {
|
|
@@ -311,7 +326,7 @@ var w = {
|
|
|
311
326
|
className: "w-full",
|
|
312
327
|
onClick: () => v(`catalog/${O}`),
|
|
313
328
|
children: [
|
|
314
|
-
/* @__PURE__ */ b(
|
|
329
|
+
/* @__PURE__ */ b(_e, { className: "me-1.5 h-4 w-4" }),
|
|
315
330
|
" ",
|
|
316
331
|
y("buildmyiq.lessonPlayer.courseOverview", "Course overview")
|
|
317
332
|
]
|
|
@@ -321,7 +336,7 @@ var w = {
|
|
|
321
336
|
}), /* @__PURE__ */ x("section", {
|
|
322
337
|
"aria-label": y("buildmyiq.lessonPlayer.lessonRegion", "Lesson"),
|
|
323
338
|
className: "min-w-0 flex-1",
|
|
324
|
-
children: [
|
|
339
|
+
children: [K ? /* @__PURE__ */ x(C, {
|
|
325
340
|
treatment: "plain",
|
|
326
341
|
className: "flex flex-col gap-4 p-5 sm:p-7",
|
|
327
342
|
children: [
|
|
@@ -330,13 +345,13 @@ var w = {
|
|
|
330
345
|
children: [
|
|
331
346
|
/* @__PURE__ */ x("span", {
|
|
332
347
|
className: "inline-flex items-center gap-1.5 rounded-full bg-[var(--color-accent-soft)] px-2.5 py-1 text-xs font-medium text-text-primary",
|
|
333
|
-
children: [/* @__PURE__ */ b(
|
|
348
|
+
children: [/* @__PURE__ */ b(Ve, { className: "h-3.5 w-3.5 text-[var(--color-accent-teal)]" }), a(K.type)]
|
|
334
349
|
}),
|
|
335
|
-
|
|
350
|
+
K.durationMin > 0 && /* @__PURE__ */ b("span", {
|
|
336
351
|
className: "text-xs text-text-secondary",
|
|
337
|
-
children: i(
|
|
352
|
+
children: i(K.durationMin)
|
|
338
353
|
}),
|
|
339
|
-
|
|
354
|
+
q && /* @__PURE__ */ x("span", {
|
|
340
355
|
className: "inline-flex items-center gap-1 text-xs font-medium text-status-success-text",
|
|
341
356
|
children: [
|
|
342
357
|
/* @__PURE__ */ b(f, { className: "h-3.5 w-3.5" }),
|
|
@@ -344,34 +359,45 @@ var w = {
|
|
|
344
359
|
y("buildmyiq.lessonPlayer.completedLabel", "Completed")
|
|
345
360
|
]
|
|
346
361
|
}),
|
|
347
|
-
/* @__PURE__ */ b(
|
|
362
|
+
/* @__PURE__ */ b(de, { lesson: K }, K.id),
|
|
348
363
|
/* @__PURE__ */ b("span", {
|
|
349
364
|
className: "ms-auto text-xs tabular-nums text-text-secondary",
|
|
350
365
|
children: y("buildmyiq.lessonPlayer.lessonPosition", "Lesson {{n}} of {{total}}", {
|
|
351
|
-
n:
|
|
352
|
-
total:
|
|
366
|
+
n: G + 1,
|
|
367
|
+
total: H.length
|
|
353
368
|
})
|
|
354
369
|
})
|
|
355
370
|
]
|
|
356
371
|
}),
|
|
357
372
|
/* @__PURE__ */ b("h2", {
|
|
358
373
|
className: "text-2xl font-semibold tracking-tight text-text-primary",
|
|
359
|
-
children:
|
|
374
|
+
children: K.title
|
|
360
375
|
}),
|
|
361
|
-
|
|
376
|
+
K.media ? /* @__PURE__ */ x("div", {
|
|
362
377
|
className: "rounded-xl border border-border-seam bg-bg-sunken p-3",
|
|
363
378
|
children: [/* @__PURE__ */ b("p", {
|
|
364
379
|
className: "mb-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
365
380
|
children: y("buildmyiq.lessonPlayer.resources", "Resources")
|
|
366
|
-
}), /* @__PURE__ */ b(
|
|
381
|
+
}), /* @__PURE__ */ b(le, { fileId: K.media.id })]
|
|
367
382
|
}) : null,
|
|
368
|
-
|
|
383
|
+
K.content ? /* @__PURE__ */ b("p", {
|
|
369
384
|
className: "max-w-prose whitespace-pre-wrap text-[15px] leading-7 text-text-primary",
|
|
370
|
-
children:
|
|
371
|
-
}) : /* @__PURE__ */ b("p", {
|
|
385
|
+
children: K.content
|
|
386
|
+
}) : X ? null : /* @__PURE__ */ b("p", {
|
|
372
387
|
className: "text-sm text-text-secondary",
|
|
373
|
-
children:
|
|
388
|
+
children: K.media ? y("buildmyiq.lessonPlayer.noContentWithMedia", "This lesson has no written content beyond the attached media.") : y("buildmyiq.lessonPlayer.noContent", "This lesson has no written content")
|
|
389
|
+
}),
|
|
390
|
+
J && Y.isLoading && /* @__PURE__ */ b(l, { label: y("buildmyiq.interactive.loading", "Loading the activity…") }),
|
|
391
|
+
J && Y.isError && /* @__PURE__ */ b(c, {
|
|
392
|
+
title: y("buildmyiq.interactive.loadError", "Couldn't load the activity"),
|
|
393
|
+
message: Y.error instanceof Error ? Y.error.message : void 0,
|
|
394
|
+
onRetry: () => Y.refetch()
|
|
374
395
|
}),
|
|
396
|
+
X && /* @__PURE__ */ b(pe, {
|
|
397
|
+
config: X,
|
|
398
|
+
bestScaled: je,
|
|
399
|
+
onSubmit: Re
|
|
400
|
+
}, X.packageId),
|
|
375
401
|
/* @__PURE__ */ x("div", {
|
|
376
402
|
className: "mt-2 flex flex-col gap-3 border-t border-border-seam pt-5 sm:flex-row sm:items-center sm:justify-between",
|
|
377
403
|
children: [
|
|
@@ -379,25 +405,28 @@ var w = {
|
|
|
379
405
|
variant: "outline",
|
|
380
406
|
size: "sm",
|
|
381
407
|
className: "max-sm:w-full",
|
|
382
|
-
onClick: () =>
|
|
383
|
-
disabled:
|
|
408
|
+
onClick: () => Ie(-1),
|
|
409
|
+
disabled: G <= 0,
|
|
384
410
|
children: [
|
|
385
|
-
/* @__PURE__ */ b(
|
|
411
|
+
/* @__PURE__ */ b(ye, { className: "me-1 h-4 w-4 rtl:-scale-x-100" }),
|
|
386
412
|
" ",
|
|
387
413
|
y("buildmyiq.lessonPlayer.previous", "Previous")
|
|
388
414
|
]
|
|
389
415
|
}),
|
|
390
|
-
|
|
416
|
+
q ? /* @__PURE__ */ x("span", {
|
|
391
417
|
className: "inline-flex items-center justify-center gap-2 rounded-lg bg-status-success-bg-subtle px-4 py-2 text-sm font-medium text-status-success-text max-sm:w-full",
|
|
392
418
|
children: [
|
|
393
419
|
/* @__PURE__ */ b(f, { className: "h-4 w-4" }),
|
|
394
420
|
" ",
|
|
395
421
|
y("buildmyiq.lessonPlayer.lessonComplete", "Lesson complete")
|
|
396
422
|
]
|
|
423
|
+
}) : J && (Y.isLoading || Y.isError) ? /* @__PURE__ */ b("span", { className: "max-sm:w-full" }) : X ? /* @__PURE__ */ b("span", {
|
|
424
|
+
className: "text-center text-sm text-text-secondary max-sm:w-full",
|
|
425
|
+
children: y("buildmyiq.interactive.passToComplete", "Pass the activity to complete this lesson.")
|
|
397
426
|
}) : /* @__PURE__ */ x(S, {
|
|
398
427
|
size: "lg",
|
|
399
428
|
className: "max-sm:w-full",
|
|
400
|
-
onClick:
|
|
429
|
+
onClick: Le,
|
|
401
430
|
disabled: j.isPending,
|
|
402
431
|
children: [j.isPending ? /* @__PURE__ */ b(h, { className: "me-1.5 h-4 w-4 animate-spin" }) : /* @__PURE__ */ b(f, { className: "me-1.5 h-4 w-4" }), j.isPending ? y("buildmyiq.lessonPlayer.markingComplete", "Marking complete…") : y("buildmyiq.lessonPlayer.markComplete", "Mark complete")]
|
|
403
432
|
}),
|
|
@@ -405,12 +434,12 @@ var w = {
|
|
|
405
434
|
variant: "outline",
|
|
406
435
|
size: "sm",
|
|
407
436
|
className: "max-sm:w-full",
|
|
408
|
-
onClick: () =>
|
|
409
|
-
disabled:
|
|
437
|
+
onClick: () => Ie(1),
|
|
438
|
+
disabled: G >= H.length - 1,
|
|
410
439
|
children: [
|
|
411
440
|
y("buildmyiq.lessonPlayer.next", "Next"),
|
|
412
441
|
" ",
|
|
413
|
-
/* @__PURE__ */ b(
|
|
442
|
+
/* @__PURE__ */ b(be, { className: "ms-1 h-4 w-4 rtl:-scale-x-100" })
|
|
414
443
|
]
|
|
415
444
|
})
|
|
416
445
|
]
|
|
@@ -420,14 +449,14 @@ var w = {
|
|
|
420
449
|
illustration: "empty-data",
|
|
421
450
|
title: y("buildmyiq.lessonPlayer.noLessonTitle", "No lesson to show"),
|
|
422
451
|
description: y("buildmyiq.lessonPlayer.noLessonDescription", "This course doesn't have any lessons yet. Check back once the author adds content.")
|
|
423
|
-
}),
|
|
452
|
+
}), K && O && m && /* @__PURE__ */ b("div", {
|
|
424
453
|
className: "mt-5",
|
|
425
|
-
children: /* @__PURE__ */ b(
|
|
454
|
+
children: /* @__PURE__ */ b(ue, {
|
|
426
455
|
courseId: O,
|
|
427
456
|
enrollmentId: m,
|
|
428
|
-
lessonId:
|
|
429
|
-
lessonTitle:
|
|
430
|
-
lessonTitlesById:
|
|
457
|
+
lessonId: K.id,
|
|
458
|
+
lessonTitle: K.title,
|
|
459
|
+
lessonTitlesById: ke
|
|
431
460
|
}, O)
|
|
432
461
|
})]
|
|
433
462
|
})]
|