@hydralms/components 0.3.0 → 0.3.1
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/StudentProfile-BPsZBaJj.cjs +1 -0
- package/dist/{StudentProfile-DeMxdrL3.js → StudentProfile-Cw2p-RZn.js} +577 -579
- package/dist/index.cjs +1 -1
- package/dist/index.js +172 -166
- package/dist/license/index.d.ts +2 -2
- package/dist/license/tiers.d.ts +3 -0
- package/dist/modules.cjs +1 -1
- package/dist/modules.js +111 -110
- package/dist/sections/AdaptiveLearningPath/AdaptiveLearningPath.d.ts +5 -0
- package/dist/sections/AdaptiveLearningPath/path-connector.d.ts +8 -0
- package/dist/sections/AdaptiveLearningPath/path-milestone-marker.d.ts +7 -0
- package/dist/sections/AdaptiveLearningPath/path-node-card.d.ts +10 -0
- package/dist/sections/AdaptiveLearningPath/path-skill-bar.d.ts +8 -0
- package/dist/sections/AdaptiveLearningPath/types.d.ts +136 -0
- package/dist/sections/ContentAuthoringStudio/ContentAuthoringStudio.d.ts +5 -0
- package/dist/sections/ContentAuthoringStudio/block-editor-item.d.ts +14 -0
- package/dist/sections/ContentAuthoringStudio/block-type-picker.d.ts +12 -0
- package/dist/sections/ContentAuthoringStudio/types.d.ts +67 -0
- package/dist/sections/index.d.ts +4 -0
- package/dist/sections.cjs +1 -1
- package/dist/sections.js +1325 -232
- package/dist/withProGate-BJdu1T9Y.cjs +2 -0
- package/dist/withProGate-BvFc7Jwy.js +4975 -0
- package/package.json +24 -7
- package/src/license/index.ts +2 -2
- package/src/license/tiers.ts +12 -2
- package/src/modules/CoursePlayer/CoursePlayer.tsx +3 -1
- package/src/progress/stat-card.tsx +10 -5
- package/src/sections/AdaptiveLearningPath/AdaptiveLearningPath.tsx +251 -0
- package/src/sections/AdaptiveLearningPath/path-connector.tsx +27 -0
- package/src/sections/AdaptiveLearningPath/path-milestone-marker.tsx +50 -0
- package/src/sections/AdaptiveLearningPath/path-node-card.tsx +166 -0
- package/src/sections/AdaptiveLearningPath/path-skill-bar.tsx +49 -0
- package/src/sections/AdaptiveLearningPath/types.ts +159 -0
- package/src/sections/ContentAuthoringStudio/ContentAuthoringStudio.tsx +289 -0
- package/src/sections/ContentAuthoringStudio/block-editor-item.tsx +487 -0
- package/src/sections/ContentAuthoringStudio/block-type-picker.tsx +123 -0
- package/src/sections/ContentAuthoringStudio/types.ts +67 -0
- package/src/sections/ForumBoard/ForumBoard.tsx +8 -6
- package/src/sections/LessonPage/LessonPage.tsx +4 -7
- package/src/sections/index.ts +18 -0
- package/src/video/video-player.tsx +14 -5
- package/dist/StudentProfile-BVfZMbnV.cjs +0 -1
- package/dist/tabs-BsfVo2Bl.cjs +0 -173
- package/dist/tabs-BuY1iNJE.js +0 -22305
- package/dist/withProGate-BWqcKdPM.js +0 -137
- package/dist/withProGate-DX6XqKLp.cjs +0 -1
|
@@ -0,0 +1,4975 @@
|
|
|
1
|
+
import { jsx as t, jsxs as u, Fragment as ae } from "react/jsx-runtime";
|
|
2
|
+
import { Bold as st, Italic as ot, Underline as it, List as lt, ListOrdered as ct, Link as dt, Heading2 as ut, Quote as ft, Code as ce, GripVertical as mt, ChevronUp as pt, ChevronDown as Le, Clock as ee, ChevronLeft as ge, Send as Ee, ChevronRight as se, BookOpen as te, Flag as gt, X as oe, Video as de, Play as ue, RotateCcw as ke, Pause as ht, VolumeX as xt, Volume2 as bt, FileCode as vt, Check as $e, Copy as yt, ExternalLink as fe, Download as Nt, Image as Re, Film as wt, Music as He, FileText as Y, Archive as kt, File as Ue, Lightbulb as Ct, AlertTriangle as St, Info as _t, Upload as Tt, MessageSquare as zt, ClipboardList as Dt, HelpCircle as Ce, PlayCircle as It, CheckCircle2 as Mt, Circle as je, Lock as Pe, Users as Lt, Search as Et, CheckCircle as he, XCircle as $t, Star as Rt, Minus as Ht, TrendingDown as Ut, TrendingUp as jt, Trophy as Pt, Flame as Bt, Award as At, Pin as Ft } from "lucide-react";
|
|
3
|
+
import * as X from "react";
|
|
4
|
+
import { memo as L, useState as T, useMemo as D, useId as O, useRef as I, useEffect as H, useCallback as E, useLayoutEffect as Vt, isValidElement as Ot, cloneElement as Kt, createContext as Q, useContext as W } from "react";
|
|
5
|
+
import { cva as G } from "class-variance-authority";
|
|
6
|
+
import { createPortal as xe } from "react-dom";
|
|
7
|
+
import { useEditor as Qt, EditorContent as Wt } from "@tiptap/react";
|
|
8
|
+
import Gt from "@tiptap/starter-kit";
|
|
9
|
+
import Yt from "@tiptap/extension-placeholder";
|
|
10
|
+
import Zt from "@tiptap/extension-underline";
|
|
11
|
+
import Jt from "@tiptap/extension-link";
|
|
12
|
+
import { clsx as Xt } from "clsx";
|
|
13
|
+
import { twMerge as qt } from "tailwind-merge";
|
|
14
|
+
function h(...r) {
|
|
15
|
+
return qt(Xt(r));
|
|
16
|
+
}
|
|
17
|
+
const er = G(
|
|
18
|
+
"relative flex w-full items-start gap-3 rounded-lg border p-4 text-sm [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:translate-y-0.5",
|
|
19
|
+
{
|
|
20
|
+
variants: {
|
|
21
|
+
variant: {
|
|
22
|
+
default: "bg-card text-foreground",
|
|
23
|
+
destructive: "border-destructive/50 bg-destructive/5 text-destructive [&>svg]:text-destructive",
|
|
24
|
+
success: "border-success/50 bg-success/5 text-success [&>svg]:text-success",
|
|
25
|
+
warning: "border-warning/50 bg-warning/5 text-warning [&>svg]:text-warning",
|
|
26
|
+
info: "border-info/50 bg-info/5 text-info [&>svg]:text-info"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
variant: "default"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
function U({
|
|
35
|
+
className: r,
|
|
36
|
+
variant: e,
|
|
37
|
+
...n
|
|
38
|
+
}) {
|
|
39
|
+
return /* @__PURE__ */ t(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
"data-slot": "alert",
|
|
43
|
+
role: "alert",
|
|
44
|
+
className: h(er({ variant: e }), r),
|
|
45
|
+
...n
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
function ua({ className: r, ...e }) {
|
|
50
|
+
return /* @__PURE__ */ t(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
"data-slot": "alert-title",
|
|
54
|
+
className: h("font-medium leading-normal tracking-tight", r),
|
|
55
|
+
...e
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
function j({
|
|
60
|
+
className: r,
|
|
61
|
+
...e
|
|
62
|
+
}) {
|
|
63
|
+
return /* @__PURE__ */ t(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
"data-slot": "alert-description",
|
|
67
|
+
className: h("text-foreground text-sm [&_p]:leading-relaxed", r),
|
|
68
|
+
...e
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
const tr = L(function({
|
|
73
|
+
question: e,
|
|
74
|
+
sessionAnswers: n,
|
|
75
|
+
onAnswer: a,
|
|
76
|
+
readOnly: s = !1,
|
|
77
|
+
showCorrectAnswers: o = !1,
|
|
78
|
+
disabled: i = !1
|
|
79
|
+
}) {
|
|
80
|
+
const [l, c] = T(
|
|
81
|
+
() => (n == null ? void 0 : n.map((f) => f.answerUid)) || []
|
|
82
|
+
), p = D(
|
|
83
|
+
() => [...e.answers || []].sort((f, d) => f.sequence - d.sequence),
|
|
84
|
+
[e.answers]
|
|
85
|
+
), g = (f) => {
|
|
86
|
+
s || i || c((d) => {
|
|
87
|
+
const m = d.includes(f) ? d.filter((b) => b !== f) : [...d, f];
|
|
88
|
+
return a == null || a(m.map((b) => ({ uid: b }))), m;
|
|
89
|
+
});
|
|
90
|
+
}, x = (f) => {
|
|
91
|
+
var m;
|
|
92
|
+
if (!o) return "";
|
|
93
|
+
const d = (m = e.answers) == null ? void 0 : m.find((b) => b.uid === f);
|
|
94
|
+
return d != null && d.isCorrect ? "bg-success/10 border border-success/30 px-2" : l.includes(f) && !(d != null && d.isCorrect) ? "bg-destructive/10 border border-destructive/30 px-2" : "";
|
|
95
|
+
};
|
|
96
|
+
return /* @__PURE__ */ u("div", { className: "flex flex-col gap-4", children: [
|
|
97
|
+
/* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: e.content } }),
|
|
98
|
+
/* @__PURE__ */ u("fieldset", { className: "flex flex-col gap-2 border-0 p-0 m-0", children: [
|
|
99
|
+
/* @__PURE__ */ t("legend", { className: "sr-only", children: "Select all correct answers" }),
|
|
100
|
+
p.map((f) => /* @__PURE__ */ t(
|
|
101
|
+
"div",
|
|
102
|
+
{
|
|
103
|
+
className: h("rounded-md transition-colors", x(f.uid)),
|
|
104
|
+
children: /* @__PURE__ */ u("label", { className: "flex items-center gap-2 cursor-pointer py-1 has-[input:disabled]:cursor-default has-[input:disabled]:opacity-60", children: [
|
|
105
|
+
/* @__PURE__ */ t(
|
|
106
|
+
"input",
|
|
107
|
+
{
|
|
108
|
+
type: "checkbox",
|
|
109
|
+
checked: l.includes(f.uid),
|
|
110
|
+
onChange: () => g(f.uid),
|
|
111
|
+
disabled: s || i,
|
|
112
|
+
className: "accent-primary m-0 shrink-0"
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
/* @__PURE__ */ t(
|
|
116
|
+
"span",
|
|
117
|
+
{
|
|
118
|
+
className: "text-sm",
|
|
119
|
+
dangerouslySetInnerHTML: { __html: f.content }
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
o && f.isCorrect && /* @__PURE__ */ t("span", { className: "sr-only", children: "(Correct answer)" }),
|
|
123
|
+
o && l.includes(f.uid) && !f.isCorrect && /* @__PURE__ */ t("span", { className: "sr-only", children: "(Your answer — incorrect)" })
|
|
124
|
+
] })
|
|
125
|
+
},
|
|
126
|
+
f.uid
|
|
127
|
+
))
|
|
128
|
+
] }),
|
|
129
|
+
o && e.explanation && /* @__PURE__ */ t(U, { className: "mt-2", children: /* @__PURE__ */ u(j, { children: [
|
|
130
|
+
/* @__PURE__ */ t("strong", { children: "Explanation:" }),
|
|
131
|
+
" ",
|
|
132
|
+
/* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: e.explanation } })
|
|
133
|
+
] }) })
|
|
134
|
+
] });
|
|
135
|
+
}), rr = L(function({
|
|
136
|
+
question: e,
|
|
137
|
+
sessionAnswers: n,
|
|
138
|
+
onAnswer: a,
|
|
139
|
+
readOnly: s = !1,
|
|
140
|
+
showCorrectAnswers: o = !1,
|
|
141
|
+
disabled: i = !1
|
|
142
|
+
}) {
|
|
143
|
+
const [l, c] = T(
|
|
144
|
+
() => {
|
|
145
|
+
var f;
|
|
146
|
+
return ((f = n == null ? void 0 : n[0]) == null ? void 0 : f.answerUid) || "";
|
|
147
|
+
}
|
|
148
|
+
), p = D(
|
|
149
|
+
() => [...e.answers || []].sort((f, d) => f.sequence - d.sequence),
|
|
150
|
+
[e.answers]
|
|
151
|
+
), g = (f) => {
|
|
152
|
+
s || i || (c(f), a == null || a([{ uid: f }]));
|
|
153
|
+
}, x = (f) => {
|
|
154
|
+
var m;
|
|
155
|
+
if (!o) return "px-2";
|
|
156
|
+
const d = (m = e.answers) == null ? void 0 : m.find((b) => b.uid === f);
|
|
157
|
+
return d != null && d.isCorrect ? "bg-success/10 border border-success/30 px-2" : l === f && !(d != null && d.isCorrect) ? "bg-destructive/10 border border-destructive/30 px-2" : "px-2";
|
|
158
|
+
};
|
|
159
|
+
return /* @__PURE__ */ u("div", { className: "flex flex-col gap-4", children: [
|
|
160
|
+
/* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: e.content } }),
|
|
161
|
+
/* @__PURE__ */ u("fieldset", { className: "flex flex-col gap-2 border-0 p-0 m-0", children: [
|
|
162
|
+
/* @__PURE__ */ t("legend", { className: "sr-only", children: "Answer choices" }),
|
|
163
|
+
p.map((f) => /* @__PURE__ */ t(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
className: h("rounded-md transition-colors", x(f.uid)),
|
|
167
|
+
children: /* @__PURE__ */ u("label", { className: "flex items-center gap-2 cursor-pointer py-1 has-[input:disabled]:cursor-default has-[input:disabled]:opacity-60", children: [
|
|
168
|
+
/* @__PURE__ */ t(
|
|
169
|
+
"input",
|
|
170
|
+
{
|
|
171
|
+
type: "radio",
|
|
172
|
+
name: e.uid,
|
|
173
|
+
value: f.uid,
|
|
174
|
+
checked: l === f.uid,
|
|
175
|
+
onChange: () => g(f.uid),
|
|
176
|
+
disabled: s || i,
|
|
177
|
+
className: "accent-primary m-0 shrink-0"
|
|
178
|
+
}
|
|
179
|
+
),
|
|
180
|
+
/* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: f.content } }),
|
|
181
|
+
o && f.isCorrect && /* @__PURE__ */ t("span", { className: "sr-only", children: "(Correct answer)" }),
|
|
182
|
+
o && l === f.uid && !f.isCorrect && /* @__PURE__ */ t("span", { className: "sr-only", children: "(Your answer — incorrect)" })
|
|
183
|
+
] })
|
|
184
|
+
},
|
|
185
|
+
f.uid
|
|
186
|
+
))
|
|
187
|
+
] }),
|
|
188
|
+
o && e.explanation && /* @__PURE__ */ t(U, { className: "mt-2", children: /* @__PURE__ */ u(j, { children: [
|
|
189
|
+
/* @__PURE__ */ t("strong", { children: "Explanation:" }),
|
|
190
|
+
" ",
|
|
191
|
+
/* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: e.explanation } })
|
|
192
|
+
] }) })
|
|
193
|
+
] });
|
|
194
|
+
}), nr = L(function({
|
|
195
|
+
question: e,
|
|
196
|
+
sessionAnswers: n,
|
|
197
|
+
onAnswer: a,
|
|
198
|
+
readOnly: s = !1,
|
|
199
|
+
showCorrectAnswers: o = !1,
|
|
200
|
+
disabled: i = !1
|
|
201
|
+
}) {
|
|
202
|
+
const [l, c] = T(
|
|
203
|
+
() => {
|
|
204
|
+
var f;
|
|
205
|
+
return ((f = n == null ? void 0 : n[0]) == null ? void 0 : f.answerUid) || "";
|
|
206
|
+
}
|
|
207
|
+
), p = D(
|
|
208
|
+
() => [...e.answers || []].sort((f, d) => f.sequence - d.sequence),
|
|
209
|
+
[e.answers]
|
|
210
|
+
), g = (f) => {
|
|
211
|
+
s || i || (c(f), a == null || a([{ uid: f }]));
|
|
212
|
+
}, x = (f) => {
|
|
213
|
+
var m;
|
|
214
|
+
if (!o) return "px-2";
|
|
215
|
+
const d = (m = e.answers) == null ? void 0 : m.find((b) => b.uid === f);
|
|
216
|
+
return d != null && d.isCorrect ? "bg-success/10 border border-success/30 px-2" : l === f && !(d != null && d.isCorrect) ? "bg-destructive/10 border border-destructive/30 px-2" : "px-2";
|
|
217
|
+
};
|
|
218
|
+
return /* @__PURE__ */ u("div", { className: "flex flex-col gap-4", children: [
|
|
219
|
+
/* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: e.content } }),
|
|
220
|
+
/* @__PURE__ */ u("fieldset", { className: "flex flex-col gap-2 border-0 p-0 m-0", children: [
|
|
221
|
+
/* @__PURE__ */ t("legend", { className: "sr-only", children: "True or False" }),
|
|
222
|
+
p.map((f) => /* @__PURE__ */ t(
|
|
223
|
+
"div",
|
|
224
|
+
{
|
|
225
|
+
className: h("rounded-md transition-colors", x(f.uid)),
|
|
226
|
+
children: /* @__PURE__ */ u("label", { className: "flex items-center gap-2 cursor-pointer py-1 has-[input:disabled]:cursor-default has-[input:disabled]:opacity-60", children: [
|
|
227
|
+
/* @__PURE__ */ t(
|
|
228
|
+
"input",
|
|
229
|
+
{
|
|
230
|
+
type: "radio",
|
|
231
|
+
name: e.uid,
|
|
232
|
+
value: f.uid,
|
|
233
|
+
checked: l === f.uid,
|
|
234
|
+
onChange: () => g(f.uid),
|
|
235
|
+
disabled: s || i,
|
|
236
|
+
className: "accent-primary m-0 shrink-0"
|
|
237
|
+
}
|
|
238
|
+
),
|
|
239
|
+
/* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: f.content } }),
|
|
240
|
+
o && f.isCorrect && /* @__PURE__ */ t("span", { className: "sr-only", children: "(Correct answer)" }),
|
|
241
|
+
o && l === f.uid && !f.isCorrect && /* @__PURE__ */ t("span", { className: "sr-only", children: "(Your answer — incorrect)" })
|
|
242
|
+
] })
|
|
243
|
+
},
|
|
244
|
+
f.uid
|
|
245
|
+
))
|
|
246
|
+
] }),
|
|
247
|
+
o && e.explanation && /* @__PURE__ */ t(U, { className: "mt-2", children: /* @__PURE__ */ u(j, { children: [
|
|
248
|
+
/* @__PURE__ */ t("strong", { children: "Explanation:" }),
|
|
249
|
+
" ",
|
|
250
|
+
/* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: e.explanation } })
|
|
251
|
+
] }) })
|
|
252
|
+
] });
|
|
253
|
+
});
|
|
254
|
+
function Z(r, e) {
|
|
255
|
+
let n;
|
|
256
|
+
const a = (...s) => {
|
|
257
|
+
clearTimeout(n), n = setTimeout(() => r(...s), e);
|
|
258
|
+
};
|
|
259
|
+
return a.cancel = () => clearTimeout(n), a;
|
|
260
|
+
}
|
|
261
|
+
function be({ className: r, type: e, ...n }) {
|
|
262
|
+
return /* @__PURE__ */ t(
|
|
263
|
+
"input",
|
|
264
|
+
{
|
|
265
|
+
type: e,
|
|
266
|
+
"data-slot": "input",
|
|
267
|
+
className: h(
|
|
268
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-sm shadow-xs outline-none transition-[color,box-shadow] file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50",
|
|
269
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
270
|
+
"aria-invalid:ring-destructive/20 aria-invalid:border-destructive",
|
|
271
|
+
r
|
|
272
|
+
),
|
|
273
|
+
...n
|
|
274
|
+
}
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
const ar = L(function({
|
|
278
|
+
question: e,
|
|
279
|
+
sessionAnswers: n,
|
|
280
|
+
onAnswer: a,
|
|
281
|
+
readOnly: s = !1,
|
|
282
|
+
showCorrectAnswers: o = !1,
|
|
283
|
+
disabled: i = !1
|
|
284
|
+
}) {
|
|
285
|
+
var m, b, y, C;
|
|
286
|
+
const l = O(), [c, p] = T(() => {
|
|
287
|
+
var S;
|
|
288
|
+
return ((S = n == null ? void 0 : n[0]) == null ? void 0 : S.content) || "";
|
|
289
|
+
}), g = I(a);
|
|
290
|
+
g.current = a;
|
|
291
|
+
const x = I(((b = (m = e.answers) == null ? void 0 : m[0]) == null ? void 0 : b.uid) || "");
|
|
292
|
+
x.current = ((C = (y = e.answers) == null ? void 0 : y[0]) == null ? void 0 : C.uid) || "";
|
|
293
|
+
const f = D(
|
|
294
|
+
() => Z((S) => {
|
|
295
|
+
var k;
|
|
296
|
+
(k = g.current) == null || k.call(g, [{ uid: x.current, content: S }]);
|
|
297
|
+
}, 300),
|
|
298
|
+
[]
|
|
299
|
+
);
|
|
300
|
+
H(() => () => f.cancel(), [f]);
|
|
301
|
+
const d = (S) => {
|
|
302
|
+
const k = S.target.value;
|
|
303
|
+
p(k), f(k);
|
|
304
|
+
};
|
|
305
|
+
return /* @__PURE__ */ u("div", { className: "flex flex-col gap-2", children: [
|
|
306
|
+
/* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: e.content } }),
|
|
307
|
+
/* @__PURE__ */ t("label", { htmlFor: l, className: "sr-only", children: "Your answer" }),
|
|
308
|
+
/* @__PURE__ */ t(
|
|
309
|
+
be,
|
|
310
|
+
{
|
|
311
|
+
id: l,
|
|
312
|
+
value: c,
|
|
313
|
+
onChange: d,
|
|
314
|
+
placeholder: "Type your answer here...",
|
|
315
|
+
disabled: s || i
|
|
316
|
+
}
|
|
317
|
+
),
|
|
318
|
+
o && e.explanation && /* @__PURE__ */ t(U, { className: "mt-1", children: /* @__PURE__ */ u(j, { children: [
|
|
319
|
+
/* @__PURE__ */ t("strong", { children: "Explanation:" }),
|
|
320
|
+
" ",
|
|
321
|
+
/* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: e.explanation } })
|
|
322
|
+
] }) })
|
|
323
|
+
] });
|
|
324
|
+
});
|
|
325
|
+
function K({
|
|
326
|
+
className: r,
|
|
327
|
+
orientation: e = "horizontal",
|
|
328
|
+
decorative: n = !0,
|
|
329
|
+
...a
|
|
330
|
+
}) {
|
|
331
|
+
return /* @__PURE__ */ t(
|
|
332
|
+
"div",
|
|
333
|
+
{
|
|
334
|
+
"data-slot": "separator",
|
|
335
|
+
role: n ? "none" : "separator",
|
|
336
|
+
"aria-orientation": n ? void 0 : e,
|
|
337
|
+
className: h(
|
|
338
|
+
"bg-border shrink-0",
|
|
339
|
+
e === "horizontal" ? "h-px w-full" : "h-full w-px",
|
|
340
|
+
r
|
|
341
|
+
),
|
|
342
|
+
...a
|
|
343
|
+
}
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
function B({
|
|
347
|
+
active: r,
|
|
348
|
+
disabled: e,
|
|
349
|
+
onClick: n,
|
|
350
|
+
title: a,
|
|
351
|
+
children: s
|
|
352
|
+
}) {
|
|
353
|
+
return /* @__PURE__ */ t(
|
|
354
|
+
"button",
|
|
355
|
+
{
|
|
356
|
+
type: "button",
|
|
357
|
+
onClick: n,
|
|
358
|
+
disabled: e,
|
|
359
|
+
title: a,
|
|
360
|
+
"aria-label": a,
|
|
361
|
+
className: h(
|
|
362
|
+
"inline-flex items-center justify-center rounded-sm p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-50",
|
|
363
|
+
r && "bg-muted text-foreground"
|
|
364
|
+
),
|
|
365
|
+
children: s
|
|
366
|
+
}
|
|
367
|
+
);
|
|
368
|
+
}
|
|
369
|
+
function sr({
|
|
370
|
+
editor: r,
|
|
371
|
+
variant: e = "default"
|
|
372
|
+
}) {
|
|
373
|
+
function a() {
|
|
374
|
+
const s = r.getAttributes("link").href, o = window.prompt("Enter URL", s || "https://");
|
|
375
|
+
o !== null && (o === "" ? r.chain().focus().extendMarkRange("link").unsetLink().run() : r.chain().focus().extendMarkRange("link").setLink({ href: o }).run());
|
|
376
|
+
}
|
|
377
|
+
return /* @__PURE__ */ u("div", { className: "flex items-center gap-0.5 border-b border-border px-2 py-1.5", role: "toolbar", "aria-label": "Text formatting", children: [
|
|
378
|
+
/* @__PURE__ */ t(
|
|
379
|
+
B,
|
|
380
|
+
{
|
|
381
|
+
active: r.isActive("bold"),
|
|
382
|
+
onClick: () => r.chain().focus().toggleBold().run(),
|
|
383
|
+
title: "Bold",
|
|
384
|
+
children: /* @__PURE__ */ t(st, { size: 16 })
|
|
385
|
+
}
|
|
386
|
+
),
|
|
387
|
+
/* @__PURE__ */ t(
|
|
388
|
+
B,
|
|
389
|
+
{
|
|
390
|
+
active: r.isActive("italic"),
|
|
391
|
+
onClick: () => r.chain().focus().toggleItalic().run(),
|
|
392
|
+
title: "Italic",
|
|
393
|
+
children: /* @__PURE__ */ t(ot, { size: 16 })
|
|
394
|
+
}
|
|
395
|
+
),
|
|
396
|
+
/* @__PURE__ */ t(
|
|
397
|
+
B,
|
|
398
|
+
{
|
|
399
|
+
active: r.isActive("underline"),
|
|
400
|
+
onClick: () => r.chain().focus().toggleUnderline().run(),
|
|
401
|
+
title: "Underline",
|
|
402
|
+
children: /* @__PURE__ */ t(it, { size: 16 })
|
|
403
|
+
}
|
|
404
|
+
),
|
|
405
|
+
/* @__PURE__ */ t(K, { orientation: "vertical", className: "mx-1 h-5" }),
|
|
406
|
+
/* @__PURE__ */ t(
|
|
407
|
+
B,
|
|
408
|
+
{
|
|
409
|
+
active: r.isActive("bulletList"),
|
|
410
|
+
onClick: () => r.chain().focus().toggleBulletList().run(),
|
|
411
|
+
title: "Bullet list",
|
|
412
|
+
children: /* @__PURE__ */ t(lt, { size: 16 })
|
|
413
|
+
}
|
|
414
|
+
),
|
|
415
|
+
/* @__PURE__ */ t(
|
|
416
|
+
B,
|
|
417
|
+
{
|
|
418
|
+
active: r.isActive("orderedList"),
|
|
419
|
+
onClick: () => r.chain().focus().toggleOrderedList().run(),
|
|
420
|
+
title: "Ordered list",
|
|
421
|
+
children: /* @__PURE__ */ t(ct, { size: 16 })
|
|
422
|
+
}
|
|
423
|
+
),
|
|
424
|
+
/* @__PURE__ */ t(K, { orientation: "vertical", className: "mx-1 h-5" }),
|
|
425
|
+
/* @__PURE__ */ t(
|
|
426
|
+
B,
|
|
427
|
+
{
|
|
428
|
+
active: r.isActive("link"),
|
|
429
|
+
onClick: a,
|
|
430
|
+
title: "Link",
|
|
431
|
+
children: /* @__PURE__ */ t(dt, { size: 16 })
|
|
432
|
+
}
|
|
433
|
+
),
|
|
434
|
+
e === "default" && /* @__PURE__ */ u(ae, { children: [
|
|
435
|
+
/* @__PURE__ */ t(K, { orientation: "vertical", className: "mx-1 h-5" }),
|
|
436
|
+
/* @__PURE__ */ t(
|
|
437
|
+
B,
|
|
438
|
+
{
|
|
439
|
+
active: r.isActive("heading", { level: 2 }),
|
|
440
|
+
onClick: () => r.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
441
|
+
title: "Heading",
|
|
442
|
+
children: /* @__PURE__ */ t(ut, { size: 16 })
|
|
443
|
+
}
|
|
444
|
+
),
|
|
445
|
+
/* @__PURE__ */ t(
|
|
446
|
+
B,
|
|
447
|
+
{
|
|
448
|
+
active: r.isActive("blockquote"),
|
|
449
|
+
onClick: () => r.chain().focus().toggleBlockquote().run(),
|
|
450
|
+
title: "Blockquote",
|
|
451
|
+
children: /* @__PURE__ */ t(ft, { size: 16 })
|
|
452
|
+
}
|
|
453
|
+
),
|
|
454
|
+
/* @__PURE__ */ t(
|
|
455
|
+
B,
|
|
456
|
+
{
|
|
457
|
+
active: r.isActive("codeBlock"),
|
|
458
|
+
onClick: () => r.chain().focus().toggleCodeBlock().run(),
|
|
459
|
+
title: "Code block",
|
|
460
|
+
children: /* @__PURE__ */ t(ce, { size: 16 })
|
|
461
|
+
}
|
|
462
|
+
)
|
|
463
|
+
] })
|
|
464
|
+
] });
|
|
465
|
+
}
|
|
466
|
+
function or({
|
|
467
|
+
value: r = "",
|
|
468
|
+
onChange: e,
|
|
469
|
+
placeholder: n,
|
|
470
|
+
readOnly: a = !1,
|
|
471
|
+
disabled: s = !1,
|
|
472
|
+
variant: o = "default",
|
|
473
|
+
ariaLabel: i = "Rich text editor",
|
|
474
|
+
className: l,
|
|
475
|
+
style: c
|
|
476
|
+
}) {
|
|
477
|
+
const p = Qt({
|
|
478
|
+
extensions: [
|
|
479
|
+
Gt,
|
|
480
|
+
Zt,
|
|
481
|
+
Jt.configure({
|
|
482
|
+
openOnClick: !1,
|
|
483
|
+
HTMLAttributes: { class: "text-primary underline" }
|
|
484
|
+
}),
|
|
485
|
+
Yt.configure({ placeholder: n })
|
|
486
|
+
],
|
|
487
|
+
content: r,
|
|
488
|
+
editable: !a && !s,
|
|
489
|
+
editorProps: {
|
|
490
|
+
attributes: {
|
|
491
|
+
"aria-label": i,
|
|
492
|
+
role: "textbox",
|
|
493
|
+
"aria-multiline": "true"
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
onUpdate: ({ editor: g }) => {
|
|
497
|
+
e == null || e(g.getHTML());
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
return H(() => {
|
|
501
|
+
p && p.getHTML() !== r && p.commands.setContent(r, { emitUpdate: !1 });
|
|
502
|
+
}, [p, r]), H(() => {
|
|
503
|
+
p && p.setEditable(!a && !s);
|
|
504
|
+
}, [p, a, s]), p ? /* @__PURE__ */ u(
|
|
505
|
+
"div",
|
|
506
|
+
{
|
|
507
|
+
className: h(
|
|
508
|
+
"rounded-md border border-input bg-transparent text-sm shadow-xs transition-[color,box-shadow]",
|
|
509
|
+
"focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",
|
|
510
|
+
s && "pointer-events-none opacity-50",
|
|
511
|
+
l
|
|
512
|
+
),
|
|
513
|
+
style: c,
|
|
514
|
+
children: [
|
|
515
|
+
!a && !s && /* @__PURE__ */ t(sr, { editor: p, variant: o }),
|
|
516
|
+
/* @__PURE__ */ t(
|
|
517
|
+
Wt,
|
|
518
|
+
{
|
|
519
|
+
editor: p,
|
|
520
|
+
className: h(
|
|
521
|
+
"px-3 py-2 [&_.tiptap]:min-h-16 [&_.tiptap]:outline-none",
|
|
522
|
+
"[&_.tiptap_p]:mb-1 [&_.tiptap_h2]:text-lg [&_.tiptap_h2]:font-semibold [&_.tiptap_h2]:mb-1",
|
|
523
|
+
"[&_.tiptap_ul]:list-disc [&_.tiptap_ul]:pl-5 [&_.tiptap_ol]:list-decimal [&_.tiptap_ol]:pl-5",
|
|
524
|
+
"[&_.tiptap_blockquote]:border-l-2 [&_.tiptap_blockquote]:border-muted-foreground/30 [&_.tiptap_blockquote]:pl-3 [&_.tiptap_blockquote]:italic",
|
|
525
|
+
"[&_.tiptap_pre]:rounded-md [&_.tiptap_pre]:bg-muted [&_.tiptap_pre]:p-3 [&_.tiptap_pre]:font-mono [&_.tiptap_pre]:text-sm"
|
|
526
|
+
)
|
|
527
|
+
}
|
|
528
|
+
)
|
|
529
|
+
]
|
|
530
|
+
}
|
|
531
|
+
) : null;
|
|
532
|
+
}
|
|
533
|
+
const ir = L(function({
|
|
534
|
+
question: e,
|
|
535
|
+
sessionAnswers: n,
|
|
536
|
+
onAnswer: a,
|
|
537
|
+
readOnly: s = !1,
|
|
538
|
+
disabled: o = !1
|
|
539
|
+
}) {
|
|
540
|
+
var f, d, m, b;
|
|
541
|
+
const [i, l] = T(() => {
|
|
542
|
+
var y;
|
|
543
|
+
return ((y = n == null ? void 0 : n[0]) == null ? void 0 : y.content) || "";
|
|
544
|
+
}), c = I(a);
|
|
545
|
+
c.current = a;
|
|
546
|
+
const p = I(((d = (f = e.answers) == null ? void 0 : f[0]) == null ? void 0 : d.uid) || e.uid);
|
|
547
|
+
p.current = ((b = (m = e.answers) == null ? void 0 : m[0]) == null ? void 0 : b.uid) || e.uid;
|
|
548
|
+
const g = D(
|
|
549
|
+
() => Z((y) => {
|
|
550
|
+
var C;
|
|
551
|
+
(C = c.current) == null || C.call(c, [{ uid: p.current, content: y }]);
|
|
552
|
+
}, 500),
|
|
553
|
+
[]
|
|
554
|
+
);
|
|
555
|
+
H(() => () => g.cancel(), [g]);
|
|
556
|
+
const x = (y) => {
|
|
557
|
+
l(y), g(y);
|
|
558
|
+
};
|
|
559
|
+
return /* @__PURE__ */ u("div", { className: "flex flex-col gap-2", children: [
|
|
560
|
+
/* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: e.content } }),
|
|
561
|
+
/* @__PURE__ */ t(
|
|
562
|
+
or,
|
|
563
|
+
{
|
|
564
|
+
className: "min-h-30",
|
|
565
|
+
value: i,
|
|
566
|
+
onChange: x,
|
|
567
|
+
placeholder: "Write your response here...",
|
|
568
|
+
readOnly: s,
|
|
569
|
+
disabled: o,
|
|
570
|
+
variant: "default",
|
|
571
|
+
ariaLabel: "Essay response"
|
|
572
|
+
}
|
|
573
|
+
)
|
|
574
|
+
] });
|
|
575
|
+
}), lr = L(function({
|
|
576
|
+
question: e,
|
|
577
|
+
sessionAnswers: n,
|
|
578
|
+
onAnswer: a,
|
|
579
|
+
readOnly: s = !1,
|
|
580
|
+
showCorrectAnswers: o = !1,
|
|
581
|
+
disabled: i = !1
|
|
582
|
+
}) {
|
|
583
|
+
const l = O(), [c, p] = T(() => {
|
|
584
|
+
var y;
|
|
585
|
+
return ((y = n == null ? void 0 : n[0]) == null ? void 0 : y.content) || "";
|
|
586
|
+
}), g = I(a);
|
|
587
|
+
g.current = a;
|
|
588
|
+
const x = I(e.uid);
|
|
589
|
+
x.current = e.uid;
|
|
590
|
+
const f = D(
|
|
591
|
+
() => Z((y) => {
|
|
592
|
+
var C;
|
|
593
|
+
(C = g.current) == null || C.call(g, [{ uid: x.current, content: y }]);
|
|
594
|
+
}, 300),
|
|
595
|
+
[]
|
|
596
|
+
);
|
|
597
|
+
H(() => () => f.cancel(), [f]);
|
|
598
|
+
const d = (y) => {
|
|
599
|
+
const C = y.target.value;
|
|
600
|
+
p(C), f(C);
|
|
601
|
+
}, m = (() => {
|
|
602
|
+
if (!o || e.numericAnswer === void 0) return null;
|
|
603
|
+
if (c === "") return !1;
|
|
604
|
+
const y = parseFloat(c);
|
|
605
|
+
if (isNaN(y)) return !1;
|
|
606
|
+
const C = e.numericTolerance ?? 0;
|
|
607
|
+
return Math.abs(y - e.numericAnswer) <= C;
|
|
608
|
+
})(), b = !o || m === null ? "" : m ? "border-success/50 bg-success/5" : "border-destructive/50 bg-destructive/5";
|
|
609
|
+
return /* @__PURE__ */ u("div", { className: "flex flex-col gap-2", children: [
|
|
610
|
+
/* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: e.content } }),
|
|
611
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
612
|
+
/* @__PURE__ */ t("label", { htmlFor: l, className: "sr-only", children: "Numeric answer" }),
|
|
613
|
+
/* @__PURE__ */ t(
|
|
614
|
+
be,
|
|
615
|
+
{
|
|
616
|
+
id: l,
|
|
617
|
+
type: "number",
|
|
618
|
+
value: c,
|
|
619
|
+
onChange: d,
|
|
620
|
+
placeholder: "Enter a number...",
|
|
621
|
+
disabled: s || i,
|
|
622
|
+
className: h("max-w-48", b),
|
|
623
|
+
step: "any"
|
|
624
|
+
}
|
|
625
|
+
),
|
|
626
|
+
e.numericUnit && /* @__PURE__ */ t("span", { className: "text-muted-foreground text-sm", children: e.numericUnit })
|
|
627
|
+
] }),
|
|
628
|
+
o && e.numericAnswer !== void 0 && /* @__PURE__ */ u("p", { className: "text-sm text-muted-foreground", children: [
|
|
629
|
+
"Correct answer: ",
|
|
630
|
+
e.numericAnswer,
|
|
631
|
+
(e.numericTolerance ?? 0) > 0 && /* @__PURE__ */ u("span", { children: [
|
|
632
|
+
" (± ",
|
|
633
|
+
e.numericTolerance,
|
|
634
|
+
")"
|
|
635
|
+
] })
|
|
636
|
+
] }),
|
|
637
|
+
o && e.explanation && /* @__PURE__ */ t(U, { className: "mt-1", children: /* @__PURE__ */ u(j, { children: [
|
|
638
|
+
/* @__PURE__ */ t("strong", { children: "Explanation:" }),
|
|
639
|
+
" ",
|
|
640
|
+
/* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: e.explanation } })
|
|
641
|
+
] }) })
|
|
642
|
+
] });
|
|
643
|
+
});
|
|
644
|
+
function cr({
|
|
645
|
+
items: r,
|
|
646
|
+
onReorder: e,
|
|
647
|
+
disabled: n = !1
|
|
648
|
+
}) {
|
|
649
|
+
const [a, s] = T(null), [o, i] = T(null), l = I(null), c = E(
|
|
650
|
+
(d) => (m) => {
|
|
651
|
+
if (n) {
|
|
652
|
+
m.preventDefault();
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
l.current = d, s(d), m.dataTransfer.effectAllowed = "move", m.dataTransfer.setData("text/plain", String(d));
|
|
656
|
+
},
|
|
657
|
+
[n]
|
|
658
|
+
), p = E(
|
|
659
|
+
(d) => (m) => {
|
|
660
|
+
m.preventDefault(), m.dataTransfer.dropEffect = "move", i(d);
|
|
661
|
+
},
|
|
662
|
+
[]
|
|
663
|
+
), g = E(
|
|
664
|
+
(d) => (m) => {
|
|
665
|
+
m.preventDefault();
|
|
666
|
+
const b = l.current;
|
|
667
|
+
if (b === null || b === d) {
|
|
668
|
+
s(null), i(null);
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
const y = [...r], [C] = y.splice(b, 1);
|
|
672
|
+
y.splice(d, 0, C), s(null), i(null), e(y);
|
|
673
|
+
},
|
|
674
|
+
[r, e]
|
|
675
|
+
), x = E(() => {
|
|
676
|
+
s(null), i(null), l.current = null;
|
|
677
|
+
}, []);
|
|
678
|
+
return { getDragProps: E(
|
|
679
|
+
(d) => ({
|
|
680
|
+
draggable: !n,
|
|
681
|
+
onDragStart: c(d),
|
|
682
|
+
onDragOver: p(d),
|
|
683
|
+
onDrop: g(d),
|
|
684
|
+
onDragEnd: x
|
|
685
|
+
}),
|
|
686
|
+
[n, c, p, g, x]
|
|
687
|
+
), dragIndex: a, dragOverIndex: o };
|
|
688
|
+
}
|
|
689
|
+
const dr = L(function({
|
|
690
|
+
question: e,
|
|
691
|
+
sessionAnswers: n,
|
|
692
|
+
onAnswer: a,
|
|
693
|
+
readOnly: s = !1,
|
|
694
|
+
showCorrectAnswers: o = !1,
|
|
695
|
+
disabled: i = !1
|
|
696
|
+
}) {
|
|
697
|
+
const l = D(
|
|
698
|
+
() => [...e.answers || []].sort((k, _) => k.sequence - _.sequence),
|
|
699
|
+
[e.answers]
|
|
700
|
+
), [c, p] = T(""), [g, x] = T(() => {
|
|
701
|
+
if (n && n.length > 0) {
|
|
702
|
+
const k = /* @__PURE__ */ new Map();
|
|
703
|
+
for (const _ of n)
|
|
704
|
+
k.set(_.answerUid, parseInt(_.content || "0", 10));
|
|
705
|
+
return [...l].sort(
|
|
706
|
+
(_, $) => (k.get(_.uid) ?? 0) - (k.get($.uid) ?? 0)
|
|
707
|
+
);
|
|
708
|
+
}
|
|
709
|
+
return [...l].sort(() => Math.random() - 0.5);
|
|
710
|
+
}), f = (k) => {
|
|
711
|
+
a == null || a(
|
|
712
|
+
k.map((_, $) => ({
|
|
713
|
+
uid: _.uid,
|
|
714
|
+
content: String($)
|
|
715
|
+
}))
|
|
716
|
+
);
|
|
717
|
+
}, d = (k) => {
|
|
718
|
+
x(k), f(k);
|
|
719
|
+
}, m = (k, _) => {
|
|
720
|
+
if (s || i || _ < 0 || _ >= g.length) return;
|
|
721
|
+
const $ = [...g], [N] = $.splice(k, 1);
|
|
722
|
+
$.splice(_, 0, N), x($), f($), p(
|
|
723
|
+
`${N.content.replace(/<[^>]+>/g, "")} moved to position ${_ + 1} of ${g.length}`
|
|
724
|
+
);
|
|
725
|
+
}, { getDragProps: b, dragIndex: y, dragOverIndex: C } = cr({
|
|
726
|
+
items: g,
|
|
727
|
+
onReorder: d,
|
|
728
|
+
disabled: s || i
|
|
729
|
+
}), S = (k, _) => o ? l.findIndex((N) => N.uid === k.uid) === _ ? "bg-success/10 border-success/30" : "bg-destructive/10 border-destructive/30" : "";
|
|
730
|
+
return /* @__PURE__ */ u("div", { className: "flex flex-col gap-4", children: [
|
|
731
|
+
/* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: e.content } }),
|
|
732
|
+
/* @__PURE__ */ t("span", { className: "sr-only", "aria-live": "assertive", role: "status", children: c }),
|
|
733
|
+
/* @__PURE__ */ t("div", { className: "flex flex-col gap-1.5", children: g.map((k, _) => /* @__PURE__ */ u(
|
|
734
|
+
"div",
|
|
735
|
+
{
|
|
736
|
+
...b(_),
|
|
737
|
+
className: h(
|
|
738
|
+
"flex items-center gap-2 rounded-md border px-3 py-2 transition-all select-none",
|
|
739
|
+
y === _ && "opacity-50",
|
|
740
|
+
C === _ && y !== _ && "border-t-2 border-t-primary",
|
|
741
|
+
!(s || i) && "cursor-grab active:cursor-grabbing",
|
|
742
|
+
S(k, _)
|
|
743
|
+
),
|
|
744
|
+
children: [
|
|
745
|
+
!(s || i) && /* @__PURE__ */ t(mt, { className: "size-4 text-muted-foreground shrink-0" }),
|
|
746
|
+
/* @__PURE__ */ u("span", { className: "text-sm font-medium text-muted-foreground w-6 shrink-0", children: [
|
|
747
|
+
_ + 1,
|
|
748
|
+
"."
|
|
749
|
+
] }),
|
|
750
|
+
/* @__PURE__ */ t(
|
|
751
|
+
"span",
|
|
752
|
+
{
|
|
753
|
+
className: "flex-1 text-foreground",
|
|
754
|
+
dangerouslySetInnerHTML: { __html: k.content }
|
|
755
|
+
}
|
|
756
|
+
),
|
|
757
|
+
!(s || i) && /* @__PURE__ */ u("div", { className: "flex flex-col shrink-0", children: [
|
|
758
|
+
/* @__PURE__ */ t(
|
|
759
|
+
"button",
|
|
760
|
+
{
|
|
761
|
+
type: "button",
|
|
762
|
+
onClick: () => m(_, _ - 1),
|
|
763
|
+
disabled: _ === 0,
|
|
764
|
+
className: "p-0.5 text-muted-foreground hover:text-foreground disabled:opacity-30 disabled:cursor-default",
|
|
765
|
+
"aria-label": `Move ${k.content} up`,
|
|
766
|
+
children: /* @__PURE__ */ t(pt, { className: "size-4" })
|
|
767
|
+
}
|
|
768
|
+
),
|
|
769
|
+
/* @__PURE__ */ t(
|
|
770
|
+
"button",
|
|
771
|
+
{
|
|
772
|
+
type: "button",
|
|
773
|
+
onClick: () => m(_, _ + 1),
|
|
774
|
+
disabled: _ === g.length - 1,
|
|
775
|
+
className: "p-0.5 text-muted-foreground hover:text-foreground disabled:opacity-30 disabled:cursor-default",
|
|
776
|
+
"aria-label": `Move ${k.content} down`,
|
|
777
|
+
children: /* @__PURE__ */ t(Le, { className: "size-4" })
|
|
778
|
+
}
|
|
779
|
+
)
|
|
780
|
+
] }),
|
|
781
|
+
o && /* @__PURE__ */ u("span", { className: "text-xs text-muted-foreground shrink-0", children: [
|
|
782
|
+
"(correct: ",
|
|
783
|
+
l.findIndex(($) => $.uid === k.uid) + 1,
|
|
784
|
+
")"
|
|
785
|
+
] })
|
|
786
|
+
]
|
|
787
|
+
},
|
|
788
|
+
k.uid
|
|
789
|
+
)) }),
|
|
790
|
+
o && e.explanation && /* @__PURE__ */ t(U, { className: "mt-2", children: /* @__PURE__ */ u(j, { children: [
|
|
791
|
+
/* @__PURE__ */ t("strong", { children: "Explanation:" }),
|
|
792
|
+
" ",
|
|
793
|
+
/* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: e.explanation } })
|
|
794
|
+
] }) })
|
|
795
|
+
] });
|
|
796
|
+
}), ur = L(function({
|
|
797
|
+
question: e,
|
|
798
|
+
sessionAnswers: n,
|
|
799
|
+
onAnswer: a,
|
|
800
|
+
readOnly: s = !1,
|
|
801
|
+
showCorrectAnswers: o = !1,
|
|
802
|
+
disabled: i = !1
|
|
803
|
+
}) {
|
|
804
|
+
const l = D(
|
|
805
|
+
() => [...e.matchingPairs ?? []].sort(
|
|
806
|
+
(v, w) => v.sequence - w.sequence
|
|
807
|
+
),
|
|
808
|
+
[e.matchingPairs]
|
|
809
|
+
), c = D(
|
|
810
|
+
() => [...l].sort(() => Math.random() - 0.5),
|
|
811
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
812
|
+
[l.map((v) => v.uid).join()]
|
|
813
|
+
), [p, g] = T(() => {
|
|
814
|
+
const v = /* @__PURE__ */ new Map();
|
|
815
|
+
for (const w of n ?? [])
|
|
816
|
+
w.content && v.set(w.answerUid, w.content);
|
|
817
|
+
return v;
|
|
818
|
+
}), [x, f] = T(null), [d, m] = T(
|
|
819
|
+
null
|
|
820
|
+
), b = E(
|
|
821
|
+
(v) => {
|
|
822
|
+
a == null || a(
|
|
823
|
+
[...v.entries()].map(([w, M]) => ({ uid: w, content: M }))
|
|
824
|
+
);
|
|
825
|
+
},
|
|
826
|
+
[a]
|
|
827
|
+
), y = (v, w) => {
|
|
828
|
+
if (s || i) return;
|
|
829
|
+
const M = new Map(p);
|
|
830
|
+
w ? M.set(v, w) : M.delete(v), g(M), b(M);
|
|
831
|
+
}, C = (v) => (w) => {
|
|
832
|
+
if (s || i) {
|
|
833
|
+
w.preventDefault();
|
|
834
|
+
return;
|
|
835
|
+
}
|
|
836
|
+
f(v), w.dataTransfer.effectAllowed = "link", w.dataTransfer.setData("text/plain", v);
|
|
837
|
+
}, S = (v) => (w) => {
|
|
838
|
+
w.preventDefault(), w.dataTransfer.dropEffect = "link", m(v);
|
|
839
|
+
}, k = (v) => (w) => {
|
|
840
|
+
w.preventDefault(), x && y(x, v), f(null), m(null);
|
|
841
|
+
}, _ = () => {
|
|
842
|
+
f(null), m(null);
|
|
843
|
+
}, $ = (v) => {
|
|
844
|
+
if (!o) return "";
|
|
845
|
+
const w = p.get(v);
|
|
846
|
+
return w ? w === v ? "bg-success/10 border-success/30" : "bg-destructive/10 border-destructive/30" : "";
|
|
847
|
+
}, N = (v) => {
|
|
848
|
+
for (const [w, M] of p)
|
|
849
|
+
if (M === v) return w;
|
|
850
|
+
};
|
|
851
|
+
return /* @__PURE__ */ u("div", { className: "flex flex-col gap-4", children: [
|
|
852
|
+
/* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: e.content } }),
|
|
853
|
+
/* @__PURE__ */ u("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
854
|
+
/* @__PURE__ */ u("div", { className: "flex flex-col gap-2", children: [
|
|
855
|
+
/* @__PURE__ */ t("div", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-1", children: "Items" }),
|
|
856
|
+
l.map((v) => /* @__PURE__ */ t(
|
|
857
|
+
"div",
|
|
858
|
+
{
|
|
859
|
+
draggable: !(s || i),
|
|
860
|
+
onDragStart: C(v.uid),
|
|
861
|
+
onDragEnd: _,
|
|
862
|
+
className: h(
|
|
863
|
+
"rounded-md border px-3 py-2 transition-colors",
|
|
864
|
+
x === v.uid && "opacity-50",
|
|
865
|
+
!(s || i) && "cursor-grab active:cursor-grabbing",
|
|
866
|
+
$(v.uid)
|
|
867
|
+
),
|
|
868
|
+
children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
869
|
+
/* @__PURE__ */ t(
|
|
870
|
+
"span",
|
|
871
|
+
{
|
|
872
|
+
className: "flex-1 text-foreground",
|
|
873
|
+
dangerouslySetInnerHTML: { __html: v.item }
|
|
874
|
+
}
|
|
875
|
+
),
|
|
876
|
+
/* @__PURE__ */ u(
|
|
877
|
+
"select",
|
|
878
|
+
{
|
|
879
|
+
"aria-label": `Match for: ${v.item.replace(/<[^>]+>/g, "")}`,
|
|
880
|
+
value: p.get(v.uid) || "",
|
|
881
|
+
onChange: (w) => y(v.uid, w.target.value),
|
|
882
|
+
disabled: s || i,
|
|
883
|
+
className: h(
|
|
884
|
+
"px-2 py-1 rounded border border-border bg-background text-foreground text-sm",
|
|
885
|
+
"disabled:opacity-60 disabled:cursor-default"
|
|
886
|
+
),
|
|
887
|
+
children: [
|
|
888
|
+
/* @__PURE__ */ t("option", { value: "", children: "—" }),
|
|
889
|
+
c.map((w) => /* @__PURE__ */ t("option", { value: w.uid, children: w.target.replace(/<[^>]+>/g, "") }, w.uid))
|
|
890
|
+
]
|
|
891
|
+
}
|
|
892
|
+
)
|
|
893
|
+
] })
|
|
894
|
+
},
|
|
895
|
+
v.uid
|
|
896
|
+
))
|
|
897
|
+
] }),
|
|
898
|
+
/* @__PURE__ */ u("div", { className: "flex flex-col gap-2", children: [
|
|
899
|
+
/* @__PURE__ */ t("div", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-1", children: "Targets" }),
|
|
900
|
+
c.map((v) => {
|
|
901
|
+
const w = N(v.uid), M = w ? l.find((V) => V.uid === w) : null;
|
|
902
|
+
return /* @__PURE__ */ u(
|
|
903
|
+
"div",
|
|
904
|
+
{
|
|
905
|
+
onDragOver: S(v.uid),
|
|
906
|
+
onDrop: k(v.uid),
|
|
907
|
+
className: h(
|
|
908
|
+
"rounded-md border border-dashed px-3 py-2 transition-colors min-h-10",
|
|
909
|
+
d === v.uid && "ring-2 ring-primary",
|
|
910
|
+
w && "border-solid"
|
|
911
|
+
),
|
|
912
|
+
children: [
|
|
913
|
+
/* @__PURE__ */ t(
|
|
914
|
+
"span",
|
|
915
|
+
{
|
|
916
|
+
className: "text-foreground",
|
|
917
|
+
dangerouslySetInnerHTML: { __html: v.target }
|
|
918
|
+
}
|
|
919
|
+
),
|
|
920
|
+
M && /* @__PURE__ */ t("div", { className: "mt-1 text-xs text-muted-foreground", children: "← matched" })
|
|
921
|
+
]
|
|
922
|
+
},
|
|
923
|
+
v.uid
|
|
924
|
+
);
|
|
925
|
+
})
|
|
926
|
+
] })
|
|
927
|
+
] }),
|
|
928
|
+
o && e.explanation && /* @__PURE__ */ t(U, { className: "mt-2", children: /* @__PURE__ */ u(j, { children: [
|
|
929
|
+
/* @__PURE__ */ t("strong", { children: "Explanation:" }),
|
|
930
|
+
" ",
|
|
931
|
+
/* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: e.explanation } })
|
|
932
|
+
] }) })
|
|
933
|
+
] });
|
|
934
|
+
});
|
|
935
|
+
function fr(r) {
|
|
936
|
+
if (r.shape === "rect") {
|
|
937
|
+
const [s, o, i, l] = r.coords;
|
|
938
|
+
return {
|
|
939
|
+
left: `${s}%`,
|
|
940
|
+
top: `${o}%`,
|
|
941
|
+
width: `${i}%`,
|
|
942
|
+
height: `${l}%`
|
|
943
|
+
};
|
|
944
|
+
}
|
|
945
|
+
const [e, n, a] = r.coords;
|
|
946
|
+
return {
|
|
947
|
+
left: `${e - a}%`,
|
|
948
|
+
top: `${n - a}%`,
|
|
949
|
+
width: `${a * 2}%`,
|
|
950
|
+
height: `${a * 2}%`,
|
|
951
|
+
borderRadius: "50%"
|
|
952
|
+
};
|
|
953
|
+
}
|
|
954
|
+
const mr = L(function({
|
|
955
|
+
question: e,
|
|
956
|
+
sessionAnswers: n,
|
|
957
|
+
onAnswer: a,
|
|
958
|
+
readOnly: s = !1,
|
|
959
|
+
showCorrectAnswers: o = !1,
|
|
960
|
+
disabled: i = !1
|
|
961
|
+
}) {
|
|
962
|
+
const l = e.hotspotMultiSelect ?? !1, [c, p] = T(() => {
|
|
963
|
+
const d = /* @__PURE__ */ new Set();
|
|
964
|
+
for (const m of n ?? [])
|
|
965
|
+
d.add(m.answerUid);
|
|
966
|
+
return d;
|
|
967
|
+
}), g = D(
|
|
968
|
+
() => e.hotspotRegions ?? [],
|
|
969
|
+
[e.hotspotRegions]
|
|
970
|
+
), x = (d) => {
|
|
971
|
+
if (s || i) return;
|
|
972
|
+
let m;
|
|
973
|
+
l ? (m = new Set(c), m.has(d) ? m.delete(d) : m.add(d)) : m = c.has(d) ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([d]), p(m), a == null || a([...m].map((b) => ({ uid: b })));
|
|
974
|
+
}, f = (d) => {
|
|
975
|
+
const m = c.has(d.uid);
|
|
976
|
+
return o ? d.isCorrect && m ? "ring-3 ring-success bg-success/20 border-2 border-success" : d.isCorrect && !m ? "ring-2 ring-success/50 border-2 border-dashed border-success/50" : !d.isCorrect && m ? "ring-3 ring-destructive bg-destructive/20 border-2 border-destructive" : "" : m ? "ring-3 ring-primary bg-primary/20 border-2 border-primary" : "hover:bg-primary/10";
|
|
977
|
+
};
|
|
978
|
+
return /* @__PURE__ */ u("div", { className: "flex flex-col gap-4", children: [
|
|
979
|
+
/* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: e.content } }),
|
|
980
|
+
/* @__PURE__ */ u("div", { className: "relative inline-block max-w-full", children: [
|
|
981
|
+
e.hotspotImageUrl && /* @__PURE__ */ t(
|
|
982
|
+
"img",
|
|
983
|
+
{
|
|
984
|
+
src: e.hotspotImageUrl,
|
|
985
|
+
alt: "Hotspot question image",
|
|
986
|
+
className: "w-full h-auto rounded-md",
|
|
987
|
+
draggable: !1
|
|
988
|
+
}
|
|
989
|
+
),
|
|
990
|
+
g.map((d, m) => /* @__PURE__ */ t(
|
|
991
|
+
"button",
|
|
992
|
+
{
|
|
993
|
+
type: "button",
|
|
994
|
+
onClick: () => x(d.uid),
|
|
995
|
+
disabled: s || i,
|
|
996
|
+
"aria-label": d.label || `Region ${m + 1}`,
|
|
997
|
+
"aria-pressed": c.has(d.uid),
|
|
998
|
+
className: h(
|
|
999
|
+
"absolute transition-all cursor-pointer",
|
|
1000
|
+
"disabled:cursor-default",
|
|
1001
|
+
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",
|
|
1002
|
+
f(d)
|
|
1003
|
+
),
|
|
1004
|
+
style: fr(d)
|
|
1005
|
+
},
|
|
1006
|
+
d.uid
|
|
1007
|
+
))
|
|
1008
|
+
] }),
|
|
1009
|
+
o && e.explanation && /* @__PURE__ */ t(U, { className: "mt-2", children: /* @__PURE__ */ u(j, { children: [
|
|
1010
|
+
/* @__PURE__ */ t("strong", { children: "Explanation:" }),
|
|
1011
|
+
" ",
|
|
1012
|
+
/* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: e.explanation } })
|
|
1013
|
+
] }) })
|
|
1014
|
+
] });
|
|
1015
|
+
});
|
|
1016
|
+
function pr(r) {
|
|
1017
|
+
const e = [], n = /\{\{blank:([\w-]+)\}\}/g;
|
|
1018
|
+
let a = 0, s;
|
|
1019
|
+
for (; (s = n.exec(r)) !== null; )
|
|
1020
|
+
s.index > a && e.push({ type: "text", html: r.slice(a, s.index) }), e.push({ type: "blank", uid: s[1] }), a = n.lastIndex;
|
|
1021
|
+
return a < r.length && e.push({ type: "text", html: r.slice(a) }), e;
|
|
1022
|
+
}
|
|
1023
|
+
const gr = L(function({
|
|
1024
|
+
question: e,
|
|
1025
|
+
sessionAnswers: n,
|
|
1026
|
+
onAnswer: a,
|
|
1027
|
+
readOnly: s = !1,
|
|
1028
|
+
showCorrectAnswers: o = !1,
|
|
1029
|
+
disabled: i = !1
|
|
1030
|
+
}) {
|
|
1031
|
+
const l = D(() => {
|
|
1032
|
+
const d = /* @__PURE__ */ new Map();
|
|
1033
|
+
for (const m of e.inlineBlanks ?? [])
|
|
1034
|
+
d.set(m.uid, m);
|
|
1035
|
+
return d;
|
|
1036
|
+
}, [e.inlineBlanks]), [c, p] = T(() => {
|
|
1037
|
+
const d = /* @__PURE__ */ new Map();
|
|
1038
|
+
for (const m of n ?? [])
|
|
1039
|
+
m.content && d.set(m.answerUid, m.content);
|
|
1040
|
+
return d;
|
|
1041
|
+
}), g = D(
|
|
1042
|
+
() => pr(e.content),
|
|
1043
|
+
[e.content]
|
|
1044
|
+
), x = (d, m) => {
|
|
1045
|
+
if (s || i) return;
|
|
1046
|
+
const b = new Map(c);
|
|
1047
|
+
b.set(d, m), p(b);
|
|
1048
|
+
const y = [...b.entries()].map(([C, S]) => ({
|
|
1049
|
+
uid: C,
|
|
1050
|
+
content: S
|
|
1051
|
+
}));
|
|
1052
|
+
a == null || a(y);
|
|
1053
|
+
}, f = (d) => {
|
|
1054
|
+
if (!o) return "";
|
|
1055
|
+
const m = l.get(d), b = c.get(d);
|
|
1056
|
+
if (!m || !b) return "";
|
|
1057
|
+
const y = m.options.find((C) => C.isCorrect);
|
|
1058
|
+
return y ? b === y.uid ? "border-success/50 bg-success/5 text-success" : "border-destructive/50 bg-destructive/5 text-destructive" : "";
|
|
1059
|
+
};
|
|
1060
|
+
return /* @__PURE__ */ u("div", { className: "flex flex-col gap-4", children: [
|
|
1061
|
+
/* @__PURE__ */ t("div", { className: "leading-relaxed text-foreground", children: g.map((d, m) => {
|
|
1062
|
+
if (d.type === "text")
|
|
1063
|
+
return /* @__PURE__ */ t(
|
|
1064
|
+
"span",
|
|
1065
|
+
{
|
|
1066
|
+
dangerouslySetInnerHTML: { __html: d.html }
|
|
1067
|
+
},
|
|
1068
|
+
m
|
|
1069
|
+
);
|
|
1070
|
+
const b = l.get(d.uid);
|
|
1071
|
+
return b ? /* @__PURE__ */ u(
|
|
1072
|
+
"select",
|
|
1073
|
+
{
|
|
1074
|
+
"aria-label": `Blank ${b.sequence + 1}`,
|
|
1075
|
+
value: c.get(d.uid) || "",
|
|
1076
|
+
onChange: (y) => x(d.uid, y.target.value),
|
|
1077
|
+
disabled: s || i,
|
|
1078
|
+
className: h(
|
|
1079
|
+
"inline-block mx-1 px-2 py-0.5 rounded border border-border bg-background text-foreground text-sm align-baseline",
|
|
1080
|
+
"disabled:opacity-60 disabled:cursor-default",
|
|
1081
|
+
f(d.uid)
|
|
1082
|
+
),
|
|
1083
|
+
children: [
|
|
1084
|
+
/* @__PURE__ */ t("option", { value: "", children: "Select..." }),
|
|
1085
|
+
b.options.map((y) => /* @__PURE__ */ t("option", { value: y.uid, children: y.content }, y.uid))
|
|
1086
|
+
]
|
|
1087
|
+
},
|
|
1088
|
+
d.uid
|
|
1089
|
+
) : null;
|
|
1090
|
+
}) }),
|
|
1091
|
+
o && e.explanation && /* @__PURE__ */ t(U, { className: "mt-2", children: /* @__PURE__ */ u(j, { children: [
|
|
1092
|
+
/* @__PURE__ */ t("strong", { children: "Explanation:" }),
|
|
1093
|
+
" ",
|
|
1094
|
+
/* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: e.explanation } })
|
|
1095
|
+
] }) })
|
|
1096
|
+
] });
|
|
1097
|
+
}), hr = L(function({
|
|
1098
|
+
question: e,
|
|
1099
|
+
sessionAnswers: n,
|
|
1100
|
+
onAnswer: a,
|
|
1101
|
+
readOnly: s = !1,
|
|
1102
|
+
showCorrectAnswers: o = !1,
|
|
1103
|
+
disabled: i = !1
|
|
1104
|
+
}) {
|
|
1105
|
+
const l = e.scenarioQuestions ?? [], c = I(
|
|
1106
|
+
/* @__PURE__ */ new Map()
|
|
1107
|
+
), p = D(() => {
|
|
1108
|
+
const x = /* @__PURE__ */ new Map();
|
|
1109
|
+
for (const f of n ?? []) {
|
|
1110
|
+
const d = f.answerUid.indexOf("::");
|
|
1111
|
+
if (d === -1) continue;
|
|
1112
|
+
const m = f.answerUid.slice(0, d), b = f.answerUid.slice(d + 2), y = x.get(m) ?? [];
|
|
1113
|
+
y.push({ ...f, uid: m, answerUid: b }), x.set(m, y);
|
|
1114
|
+
}
|
|
1115
|
+
c.current = /* @__PURE__ */ new Map();
|
|
1116
|
+
for (const [f, d] of x)
|
|
1117
|
+
c.current.set(
|
|
1118
|
+
f,
|
|
1119
|
+
d.map((m) => ({ uid: `${f}::${m.answerUid}`, content: m.content }))
|
|
1120
|
+
);
|
|
1121
|
+
return x;
|
|
1122
|
+
}, [n]), g = (x, f) => {
|
|
1123
|
+
const d = f.map((b) => ({
|
|
1124
|
+
uid: `${x}::${b.uid}`,
|
|
1125
|
+
content: b.content
|
|
1126
|
+
}));
|
|
1127
|
+
c.current.set(x, d);
|
|
1128
|
+
const m = [];
|
|
1129
|
+
for (const b of c.current.values())
|
|
1130
|
+
m.push(...b);
|
|
1131
|
+
a == null || a(m);
|
|
1132
|
+
};
|
|
1133
|
+
return /* @__PURE__ */ u("div", { className: "flex flex-col gap-6", children: [
|
|
1134
|
+
/* @__PURE__ */ u(
|
|
1135
|
+
"div",
|
|
1136
|
+
{
|
|
1137
|
+
className: h(
|
|
1138
|
+
"rounded-lg border border-border bg-muted/30 px-4 py-3",
|
|
1139
|
+
"prose prose-sm max-w-none text-foreground"
|
|
1140
|
+
),
|
|
1141
|
+
children: [
|
|
1142
|
+
/* @__PURE__ */ t("div", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2", children: "Scenario" }),
|
|
1143
|
+
/* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: e.content } })
|
|
1144
|
+
]
|
|
1145
|
+
}
|
|
1146
|
+
),
|
|
1147
|
+
/* @__PURE__ */ t(K, {}),
|
|
1148
|
+
/* @__PURE__ */ t("div", { className: "flex flex-col gap-5", children: l.map((x, f) => /* @__PURE__ */ u("div", { className: "flex flex-col gap-1", children: [
|
|
1149
|
+
/* @__PURE__ */ u("span", { className: "text-xs font-medium text-muted-foreground", children: [
|
|
1150
|
+
"Part ",
|
|
1151
|
+
String.fromCharCode(65 + f)
|
|
1152
|
+
] }),
|
|
1153
|
+
/* @__PURE__ */ t(
|
|
1154
|
+
Ve,
|
|
1155
|
+
{
|
|
1156
|
+
question: x,
|
|
1157
|
+
sessionAnswers: p.get(x.uid) ?? [],
|
|
1158
|
+
onAnswer: (d) => g(x.uid, d),
|
|
1159
|
+
readOnly: s,
|
|
1160
|
+
showCorrectAnswers: o,
|
|
1161
|
+
disabled: i
|
|
1162
|
+
}
|
|
1163
|
+
)
|
|
1164
|
+
] }, x.uid)) }),
|
|
1165
|
+
o && e.explanation && /* @__PURE__ */ t(U, { className: "mt-2", children: /* @__PURE__ */ u(j, { children: [
|
|
1166
|
+
/* @__PURE__ */ t("strong", { children: "Scenario Explanation:" }),
|
|
1167
|
+
" ",
|
|
1168
|
+
/* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: e.explanation } })
|
|
1169
|
+
] }) })
|
|
1170
|
+
] });
|
|
1171
|
+
});
|
|
1172
|
+
function Be({ className: r, ...e }) {
|
|
1173
|
+
return /* @__PURE__ */ t("div", { "data-slot": "table-container", className: "relative w-full overflow-auto", children: /* @__PURE__ */ t(
|
|
1174
|
+
"table",
|
|
1175
|
+
{
|
|
1176
|
+
"data-slot": "table",
|
|
1177
|
+
className: h("w-full caption-bottom text-sm", r),
|
|
1178
|
+
...e
|
|
1179
|
+
}
|
|
1180
|
+
) });
|
|
1181
|
+
}
|
|
1182
|
+
function Ae({ className: r, ...e }) {
|
|
1183
|
+
return /* @__PURE__ */ t(
|
|
1184
|
+
"thead",
|
|
1185
|
+
{
|
|
1186
|
+
"data-slot": "table-header",
|
|
1187
|
+
className: h("[&_tr]:border-b", r),
|
|
1188
|
+
...e
|
|
1189
|
+
}
|
|
1190
|
+
);
|
|
1191
|
+
}
|
|
1192
|
+
function Fe({ className: r, ...e }) {
|
|
1193
|
+
return /* @__PURE__ */ t(
|
|
1194
|
+
"tbody",
|
|
1195
|
+
{
|
|
1196
|
+
"data-slot": "table-body",
|
|
1197
|
+
className: h("[&_tr:last-child]:border-0", r),
|
|
1198
|
+
...e
|
|
1199
|
+
}
|
|
1200
|
+
);
|
|
1201
|
+
}
|
|
1202
|
+
function xr({ className: r, ...e }) {
|
|
1203
|
+
return /* @__PURE__ */ t(
|
|
1204
|
+
"tfoot",
|
|
1205
|
+
{
|
|
1206
|
+
"data-slot": "table-footer",
|
|
1207
|
+
className: h(
|
|
1208
|
+
"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
|
|
1209
|
+
r
|
|
1210
|
+
),
|
|
1211
|
+
...e
|
|
1212
|
+
}
|
|
1213
|
+
);
|
|
1214
|
+
}
|
|
1215
|
+
function re({ className: r, ...e }) {
|
|
1216
|
+
return /* @__PURE__ */ t(
|
|
1217
|
+
"tr",
|
|
1218
|
+
{
|
|
1219
|
+
"data-slot": "table-row",
|
|
1220
|
+
className: h(
|
|
1221
|
+
"border-b border-border transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
|
|
1222
|
+
r
|
|
1223
|
+
),
|
|
1224
|
+
...e
|
|
1225
|
+
}
|
|
1226
|
+
);
|
|
1227
|
+
}
|
|
1228
|
+
function me({ className: r, ...e }) {
|
|
1229
|
+
return /* @__PURE__ */ t(
|
|
1230
|
+
"th",
|
|
1231
|
+
{
|
|
1232
|
+
"data-slot": "table-head",
|
|
1233
|
+
className: h(
|
|
1234
|
+
"text-muted-foreground h-10 px-3 text-left align-middle font-semibold whitespace-nowrap text-sm [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
1235
|
+
r
|
|
1236
|
+
),
|
|
1237
|
+
...e
|
|
1238
|
+
}
|
|
1239
|
+
);
|
|
1240
|
+
}
|
|
1241
|
+
function q({ className: r, ...e }) {
|
|
1242
|
+
return /* @__PURE__ */ t(
|
|
1243
|
+
"td",
|
|
1244
|
+
{
|
|
1245
|
+
"data-slot": "table-cell",
|
|
1246
|
+
className: h(
|
|
1247
|
+
"px-3 py-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
1248
|
+
r
|
|
1249
|
+
),
|
|
1250
|
+
...e
|
|
1251
|
+
}
|
|
1252
|
+
);
|
|
1253
|
+
}
|
|
1254
|
+
function br({ className: r, ...e }) {
|
|
1255
|
+
return /* @__PURE__ */ t(
|
|
1256
|
+
"caption",
|
|
1257
|
+
{
|
|
1258
|
+
"data-slot": "table-caption",
|
|
1259
|
+
className: h("text-muted-foreground mt-4 text-sm", r),
|
|
1260
|
+
...e
|
|
1261
|
+
}
|
|
1262
|
+
);
|
|
1263
|
+
}
|
|
1264
|
+
function vr(r, e, n) {
|
|
1265
|
+
if (r.locked || !r.correctAnswer) return null;
|
|
1266
|
+
if (!n || n.trim() === "") return "empty";
|
|
1267
|
+
if (e.type === "numeric" || e.type === "currency") {
|
|
1268
|
+
const a = parseFloat(n.replace(/,/g, "")), s = parseFloat(r.correctAnswer);
|
|
1269
|
+
if (isNaN(a) || isNaN(s)) return "incorrect";
|
|
1270
|
+
const o = r.tolerance ?? 0;
|
|
1271
|
+
return Math.abs(a - s) <= o ? "correct" : "incorrect";
|
|
1272
|
+
}
|
|
1273
|
+
return n.trim().toLowerCase() === r.correctAnswer.trim().toLowerCase() ? "correct" : "incorrect";
|
|
1274
|
+
}
|
|
1275
|
+
const yr = L(function({
|
|
1276
|
+
question: e,
|
|
1277
|
+
sessionAnswers: n,
|
|
1278
|
+
onAnswer: a,
|
|
1279
|
+
readOnly: s = !1,
|
|
1280
|
+
showCorrectAnswers: o = !1,
|
|
1281
|
+
disabled: i = !1
|
|
1282
|
+
}) {
|
|
1283
|
+
const l = e.spreadsheetColumns ?? [], c = e.spreadsheetRows ?? [], p = D(() => {
|
|
1284
|
+
const N = /* @__PURE__ */ new Map();
|
|
1285
|
+
for (const v of l) N.set(v.uid, v);
|
|
1286
|
+
return N;
|
|
1287
|
+
}, [l]), g = D(
|
|
1288
|
+
() => c.flatMap((N) => N.cells.filter((v) => !v.locked).map((v) => v.uid)),
|
|
1289
|
+
[c]
|
|
1290
|
+
), x = D(() => c.some((N) => N.label != null), [c]), f = D(() => c.filter((N) => !N.isTotals), [c]), d = D(() => c.filter((N) => N.isTotals), [c]), m = I(a);
|
|
1291
|
+
m.current = a;
|
|
1292
|
+
const b = D(
|
|
1293
|
+
() => Z((N) => {
|
|
1294
|
+
var v;
|
|
1295
|
+
(v = m.current) == null || v.call(
|
|
1296
|
+
m,
|
|
1297
|
+
[...N.entries()].map(([w, M]) => ({ uid: w, content: M }))
|
|
1298
|
+
);
|
|
1299
|
+
}, 300),
|
|
1300
|
+
[]
|
|
1301
|
+
);
|
|
1302
|
+
H(() => () => b.cancel(), [b]);
|
|
1303
|
+
const [y, C] = T(() => {
|
|
1304
|
+
const N = /* @__PURE__ */ new Map();
|
|
1305
|
+
for (const v of n ?? [])
|
|
1306
|
+
v.content !== void 0 && N.set(v.answerUid, v.content);
|
|
1307
|
+
for (const v of c)
|
|
1308
|
+
for (const w of v.cells)
|
|
1309
|
+
!w.locked && !N.has(w.uid) && N.set(w.uid, w.value ?? "");
|
|
1310
|
+
return N;
|
|
1311
|
+
}), S = (N, v) => {
|
|
1312
|
+
if (s || i) return;
|
|
1313
|
+
const w = new Map(y);
|
|
1314
|
+
w.set(N, v), C(w), b(w);
|
|
1315
|
+
}, k = (N, v) => {
|
|
1316
|
+
if (v.key !== "Tab") return;
|
|
1317
|
+
const w = g.indexOf(N), M = v.shiftKey ? w - 1 : w + 1;
|
|
1318
|
+
if (M < 0 || M >= g.length) return;
|
|
1319
|
+
v.preventDefault();
|
|
1320
|
+
const V = g[M], z = document.querySelector(
|
|
1321
|
+
`[data-cell-uid="${V}"]`
|
|
1322
|
+
);
|
|
1323
|
+
z == null || z.focus();
|
|
1324
|
+
}, _ = (N) => {
|
|
1325
|
+
const v = p.get(N.columnUid);
|
|
1326
|
+
if (!v) return null;
|
|
1327
|
+
const w = y.get(N.uid) ?? "", M = o ? vr(N, v, w) : null, V = M === "correct" ? "bg-success/10 border-l-2 border-l-success/50" : M === "incorrect" || M === "empty" ? "bg-destructive/10 border-l-2 border-l-destructive/50" : "";
|
|
1328
|
+
return N.locked ? /* @__PURE__ */ t(
|
|
1329
|
+
q,
|
|
1330
|
+
{
|
|
1331
|
+
className: h(
|
|
1332
|
+
"px-2 py-1.5 text-sm text-muted-foreground bg-muted/30",
|
|
1333
|
+
v.type !== "text" && "text-right tabular-nums"
|
|
1334
|
+
),
|
|
1335
|
+
children: N.value ?? ""
|
|
1336
|
+
},
|
|
1337
|
+
N.uid
|
|
1338
|
+
) : /* @__PURE__ */ u(
|
|
1339
|
+
q,
|
|
1340
|
+
{
|
|
1341
|
+
className: h("p-0 relative", V),
|
|
1342
|
+
children: [
|
|
1343
|
+
/* @__PURE__ */ t(
|
|
1344
|
+
be,
|
|
1345
|
+
{
|
|
1346
|
+
type: v.type === "numeric" ? "number" : "text",
|
|
1347
|
+
inputMode: v.type === "currency" ? "decimal" : void 0,
|
|
1348
|
+
step: v.type === "numeric" ? "any" : void 0,
|
|
1349
|
+
value: w,
|
|
1350
|
+
onChange: (z) => S(N.uid, z.target.value),
|
|
1351
|
+
onKeyDown: (z) => k(N.uid, z),
|
|
1352
|
+
disabled: s || i,
|
|
1353
|
+
"data-cell-uid": N.uid,
|
|
1354
|
+
placeholder: v.type === "text" ? "" : "0.00",
|
|
1355
|
+
className: h(
|
|
1356
|
+
"h-8 rounded-none border-0 shadow-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring",
|
|
1357
|
+
v.type !== "text" && "text-right tabular-nums"
|
|
1358
|
+
)
|
|
1359
|
+
}
|
|
1360
|
+
),
|
|
1361
|
+
o && M !== "correct" && M !== null && N.correctAnswer && /* @__PURE__ */ u("div", { className: "px-2 pb-1 text-xs", children: [
|
|
1362
|
+
/* @__PURE__ */ t("span", { className: "text-success", children: N.correctAnswer }),
|
|
1363
|
+
N.formula && /* @__PURE__ */ u("span", { className: "ml-1 text-muted-foreground/70", children: [
|
|
1364
|
+
"(",
|
|
1365
|
+
N.formula,
|
|
1366
|
+
")"
|
|
1367
|
+
] })
|
|
1368
|
+
] })
|
|
1369
|
+
]
|
|
1370
|
+
},
|
|
1371
|
+
N.uid
|
|
1372
|
+
);
|
|
1373
|
+
}, $ = (N) => /* @__PURE__ */ u(
|
|
1374
|
+
re,
|
|
1375
|
+
{
|
|
1376
|
+
className: h(
|
|
1377
|
+
N.isHeader && "bg-muted/50 font-semibold hover:bg-muted/50"
|
|
1378
|
+
),
|
|
1379
|
+
children: [
|
|
1380
|
+
x && /* @__PURE__ */ t(q, { className: "px-2 py-1.5 font-medium text-sm text-muted-foreground whitespace-nowrap", children: N.label ?? "" }),
|
|
1381
|
+
N.cells.map(_)
|
|
1382
|
+
]
|
|
1383
|
+
},
|
|
1384
|
+
N.uid
|
|
1385
|
+
);
|
|
1386
|
+
return /* @__PURE__ */ u("div", { className: "flex flex-col gap-3", children: [
|
|
1387
|
+
/* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: e.content } }),
|
|
1388
|
+
/* @__PURE__ */ t("div", { className: "rounded-md border border-border overflow-auto", children: /* @__PURE__ */ u(Be, { children: [
|
|
1389
|
+
/* @__PURE__ */ t(Ae, { children: /* @__PURE__ */ u(re, { className: "hover:bg-transparent", children: [
|
|
1390
|
+
x && /* @__PURE__ */ t(me, { className: "w-auto" }),
|
|
1391
|
+
l.map((N) => /* @__PURE__ */ t(
|
|
1392
|
+
me,
|
|
1393
|
+
{
|
|
1394
|
+
style: { width: N.width ? `${N.width}rem` : void 0 },
|
|
1395
|
+
className: h(
|
|
1396
|
+
N.type !== "text" && "text-right"
|
|
1397
|
+
),
|
|
1398
|
+
children: N.label
|
|
1399
|
+
},
|
|
1400
|
+
N.uid
|
|
1401
|
+
))
|
|
1402
|
+
] }) }),
|
|
1403
|
+
/* @__PURE__ */ t(Fe, { children: f.map($) }),
|
|
1404
|
+
d.length > 0 && /* @__PURE__ */ t(xr, { children: d.map($) })
|
|
1405
|
+
] }) }),
|
|
1406
|
+
o && e.explanation && /* @__PURE__ */ t(U, { className: "mt-1", children: /* @__PURE__ */ u(j, { children: [
|
|
1407
|
+
/* @__PURE__ */ t("strong", { children: "Explanation:" }),
|
|
1408
|
+
" ",
|
|
1409
|
+
/* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: e.explanation } })
|
|
1410
|
+
] }) })
|
|
1411
|
+
] });
|
|
1412
|
+
}), Ve = L(function(e) {
|
|
1413
|
+
switch (e.question.type) {
|
|
1414
|
+
case "multiple_choice":
|
|
1415
|
+
return /* @__PURE__ */ t(tr, { ...e });
|
|
1416
|
+
case "choice":
|
|
1417
|
+
return /* @__PURE__ */ t(rr, { ...e });
|
|
1418
|
+
case "true_false":
|
|
1419
|
+
return /* @__PURE__ */ t(nr, { ...e });
|
|
1420
|
+
case "fill_in_the_blank":
|
|
1421
|
+
return /* @__PURE__ */ t(ar, { ...e });
|
|
1422
|
+
case "essay":
|
|
1423
|
+
return /* @__PURE__ */ t(ir, { ...e });
|
|
1424
|
+
case "numeric":
|
|
1425
|
+
return /* @__PURE__ */ t(lr, { ...e });
|
|
1426
|
+
case "ordering":
|
|
1427
|
+
return /* @__PURE__ */ t(dr, { ...e });
|
|
1428
|
+
case "matching":
|
|
1429
|
+
return /* @__PURE__ */ t(ur, { ...e });
|
|
1430
|
+
case "hotspot":
|
|
1431
|
+
return /* @__PURE__ */ t(mr, { ...e });
|
|
1432
|
+
case "inline_choice":
|
|
1433
|
+
return /* @__PURE__ */ t(gr, { ...e });
|
|
1434
|
+
case "scenario":
|
|
1435
|
+
return /* @__PURE__ */ t(hr, { ...e });
|
|
1436
|
+
case "spreadsheet":
|
|
1437
|
+
return /* @__PURE__ */ t(yr, { ...e });
|
|
1438
|
+
default:
|
|
1439
|
+
return /* @__PURE__ */ u("p", { className: "text-muted-foreground", children: [
|
|
1440
|
+
"Question type “",
|
|
1441
|
+
e.question.type,
|
|
1442
|
+
"” is not supported yet."
|
|
1443
|
+
] });
|
|
1444
|
+
}
|
|
1445
|
+
});
|
|
1446
|
+
function ve(r, e) {
|
|
1447
|
+
var n;
|
|
1448
|
+
switch (r.type) {
|
|
1449
|
+
case "choice":
|
|
1450
|
+
case "multiple_choice":
|
|
1451
|
+
case "true_false": {
|
|
1452
|
+
const a = new Set(
|
|
1453
|
+
(r.answers ?? []).filter((o) => o.isCorrect).map((o) => o.uid)
|
|
1454
|
+
), s = new Set(e.map((o) => o.answerUid));
|
|
1455
|
+
return a.size === 0 ? null : a.size === s.size && [...a].every((o) => s.has(o));
|
|
1456
|
+
}
|
|
1457
|
+
case "fill_in_the_blank":
|
|
1458
|
+
case "essay":
|
|
1459
|
+
return null;
|
|
1460
|
+
case "ordering": {
|
|
1461
|
+
const a = r.answers ?? [];
|
|
1462
|
+
return a.length === 0 ? null : [...a].sort((o, i) => o.sequence - i.sequence).every((o, i) => {
|
|
1463
|
+
const l = e.find((c) => c.answerUid === o.uid);
|
|
1464
|
+
return (l == null ? void 0 : l.content) === String(i);
|
|
1465
|
+
});
|
|
1466
|
+
}
|
|
1467
|
+
case "matching": {
|
|
1468
|
+
const a = r.matchingPairs ?? [];
|
|
1469
|
+
return a.length === 0 ? null : a.every((s) => {
|
|
1470
|
+
const o = e.find((i) => i.answerUid === s.uid);
|
|
1471
|
+
return (o == null ? void 0 : o.content) === s.uid;
|
|
1472
|
+
});
|
|
1473
|
+
}
|
|
1474
|
+
case "numeric": {
|
|
1475
|
+
if (r.numericAnswer === void 0) return null;
|
|
1476
|
+
const a = (n = e[0]) == null ? void 0 : n.content;
|
|
1477
|
+
if (a === void 0 || a === "") return !1;
|
|
1478
|
+
const s = parseFloat(a);
|
|
1479
|
+
if (isNaN(s)) return !1;
|
|
1480
|
+
const o = r.numericTolerance ?? 0;
|
|
1481
|
+
return Math.abs(s - r.numericAnswer) <= o;
|
|
1482
|
+
}
|
|
1483
|
+
case "hotspot": {
|
|
1484
|
+
const a = r.hotspotRegions ?? [], s = new Set(
|
|
1485
|
+
a.filter((i) => i.isCorrect).map((i) => i.uid)
|
|
1486
|
+
);
|
|
1487
|
+
if (s.size === 0) return null;
|
|
1488
|
+
const o = new Set(e.map((i) => i.answerUid));
|
|
1489
|
+
return s.size === o.size && [...s].every((i) => o.has(i));
|
|
1490
|
+
}
|
|
1491
|
+
case "inline_choice": {
|
|
1492
|
+
const a = r.inlineBlanks ?? [];
|
|
1493
|
+
return a.length === 0 ? null : a.every((s) => {
|
|
1494
|
+
const o = s.options.find((l) => l.isCorrect);
|
|
1495
|
+
if (!o) return !0;
|
|
1496
|
+
const i = e.find((l) => l.answerUid === s.uid);
|
|
1497
|
+
return (i == null ? void 0 : i.content) === o.uid;
|
|
1498
|
+
});
|
|
1499
|
+
}
|
|
1500
|
+
case "spreadsheet": {
|
|
1501
|
+
const a = r.spreadsheetRows ?? [], s = r.spreadsheetColumns ?? [], o = new Map(s.map((l) => [l.uid, l])), i = a.flatMap(
|
|
1502
|
+
(l) => l.cells.filter((c) => !c.locked && c.correctAnswer !== void 0)
|
|
1503
|
+
);
|
|
1504
|
+
return i.length === 0 ? null : i.every((l) => {
|
|
1505
|
+
var m;
|
|
1506
|
+
const c = e.find((b) => b.answerUid === l.uid), p = ((m = c == null ? void 0 : c.content) == null ? void 0 : m.trim()) ?? "";
|
|
1507
|
+
if (!p) return !1;
|
|
1508
|
+
const g = o.get(l.columnUid);
|
|
1509
|
+
if (!g || g.type === "text")
|
|
1510
|
+
return p.toLowerCase() === l.correctAnswer.trim().toLowerCase();
|
|
1511
|
+
const x = parseFloat(p.replace(/,/g, "")), f = parseFloat(l.correctAnswer.replace(/,/g, ""));
|
|
1512
|
+
if (isNaN(x) || isNaN(f)) return !1;
|
|
1513
|
+
const d = l.tolerance ?? 0;
|
|
1514
|
+
return Math.abs(x - f) <= d;
|
|
1515
|
+
});
|
|
1516
|
+
}
|
|
1517
|
+
case "scenario": {
|
|
1518
|
+
const a = r.scenarioQuestions ?? [];
|
|
1519
|
+
if (a.length === 0) return null;
|
|
1520
|
+
if ((r.scenarioScoringMode ?? "per_question") === "all_or_nothing") {
|
|
1521
|
+
const o = Oe(e), i = a.map((l) => {
|
|
1522
|
+
const c = o.get(l.uid) ?? [];
|
|
1523
|
+
return ve(l, c);
|
|
1524
|
+
});
|
|
1525
|
+
return i.some((l) => l === null) ? null : i.every((l) => l === !0);
|
|
1526
|
+
}
|
|
1527
|
+
return null;
|
|
1528
|
+
}
|
|
1529
|
+
default:
|
|
1530
|
+
return null;
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
function fa(r, e) {
|
|
1534
|
+
let n = 0, a = 0;
|
|
1535
|
+
for (const i of r) {
|
|
1536
|
+
const l = e.filter((p) => p.uid === i.uid);
|
|
1537
|
+
if (i.type === "scenario" && i.scenarioScoringMode !== "all_or_nothing") {
|
|
1538
|
+
const p = Nr(i, l);
|
|
1539
|
+
for (const [, g] of p)
|
|
1540
|
+
g !== null && (a++, g && n++);
|
|
1541
|
+
continue;
|
|
1542
|
+
}
|
|
1543
|
+
const c = ve(i, l);
|
|
1544
|
+
c !== null && (a++, c && n++);
|
|
1545
|
+
}
|
|
1546
|
+
const s = a > 0 ? a : r.length, o = s > 0 ? Math.round(n / s * 100) : 0;
|
|
1547
|
+
return { correct: n, total: s, percentage: o };
|
|
1548
|
+
}
|
|
1549
|
+
function Oe(r) {
|
|
1550
|
+
const e = /* @__PURE__ */ new Map();
|
|
1551
|
+
for (const n of r) {
|
|
1552
|
+
const a = n.answerUid.indexOf("::");
|
|
1553
|
+
if (a === -1) continue;
|
|
1554
|
+
const s = n.answerUid.slice(0, a), o = n.answerUid.slice(a + 2), i = e.get(s) ?? [];
|
|
1555
|
+
i.push({ ...n, answerUid: o }), e.set(s, i);
|
|
1556
|
+
}
|
|
1557
|
+
return e;
|
|
1558
|
+
}
|
|
1559
|
+
function Nr(r, e) {
|
|
1560
|
+
const n = /* @__PURE__ */ new Map(), a = r.scenarioQuestions ?? [], s = Oe(e);
|
|
1561
|
+
for (const o of a) {
|
|
1562
|
+
const i = s.get(o.uid) ?? [];
|
|
1563
|
+
n.set(o.uid, ve(o, i));
|
|
1564
|
+
}
|
|
1565
|
+
return n;
|
|
1566
|
+
}
|
|
1567
|
+
const wr = (r) => {
|
|
1568
|
+
if (r < 1)
|
|
1569
|
+
return "-";
|
|
1570
|
+
const e = Math.floor(r / 3600), n = Math.floor(r % 3600 / 60), a = r % 60, s = [];
|
|
1571
|
+
return e > 0 && s.push(`${e}h`), n > 0 && s.push(`${n}m`), a > 0 && s.push(`${a}s`), s.join(" ");
|
|
1572
|
+
}, ne = (r) => {
|
|
1573
|
+
const e = Math.floor(r / 3600), n = Math.floor(r % 3600 / 60), a = r % 60, s = (o) => o.toString().padStart(2, "0");
|
|
1574
|
+
return e > 0 ? `${s(e)}:${s(n)}:${s(a)}` : `${s(n)}:${s(a)}`;
|
|
1575
|
+
};
|
|
1576
|
+
function kr(r, e) {
|
|
1577
|
+
return r ? {
|
|
1578
|
+
wrapper: "border-destructive/30 bg-destructive/10 text-destructive",
|
|
1579
|
+
bold: !0
|
|
1580
|
+
} : e ? {
|
|
1581
|
+
wrapper: "border-warning/30 bg-warning/10 text-warning",
|
|
1582
|
+
bold: !0
|
|
1583
|
+
} : {
|
|
1584
|
+
wrapper: "border-border bg-muted text-muted-foreground",
|
|
1585
|
+
bold: !1
|
|
1586
|
+
};
|
|
1587
|
+
}
|
|
1588
|
+
const Cr = L(function({
|
|
1589
|
+
timeElapsedSeconds: e,
|
|
1590
|
+
timeLimitSeconds: n,
|
|
1591
|
+
variant: a = "compact"
|
|
1592
|
+
}) {
|
|
1593
|
+
const s = n != null && n > 0, o = s ? Math.max(0, n - e) : 0, i = s && o < n * 0.1, l = s && o <= 60, c = ne(s ? o : e), p = kr(l, i);
|
|
1594
|
+
return a === "compact" ? /* @__PURE__ */ u(
|
|
1595
|
+
"div",
|
|
1596
|
+
{
|
|
1597
|
+
className: h(
|
|
1598
|
+
"flex items-center gap-1.5 px-2.5 py-1 rounded-full border",
|
|
1599
|
+
p.wrapper
|
|
1600
|
+
),
|
|
1601
|
+
children: [
|
|
1602
|
+
/* @__PURE__ */ t("span", { className: "inline-flex leading-none", children: /* @__PURE__ */ t(ee, { size: 13 }) }),
|
|
1603
|
+
/* @__PURE__ */ t("span", { className: "text-xs font-semibold font-mono tracking-wide", "aria-live": "polite", "aria-atomic": "true", children: c })
|
|
1604
|
+
]
|
|
1605
|
+
}
|
|
1606
|
+
) : /* @__PURE__ */ u("div", { className: h("flex items-center gap-1.5", p.wrapper), children: [
|
|
1607
|
+
/* @__PURE__ */ t("span", { className: "inline-flex leading-none", children: /* @__PURE__ */ t(ee, { size: 16 }) }),
|
|
1608
|
+
/* @__PURE__ */ u("span", { className: h("text-sm", p.bold && "font-semibold"), children: [
|
|
1609
|
+
s ? "Time remaining: " : "Time elapsed: ",
|
|
1610
|
+
/* @__PURE__ */ t("span", { className: "font-mono font-semibold", "aria-live": "polite", "aria-atomic": "true", children: c })
|
|
1611
|
+
] })
|
|
1612
|
+
] });
|
|
1613
|
+
}), Sr = {
|
|
1614
|
+
current: "bg-primary text-primary-foreground border-primary",
|
|
1615
|
+
flagged: "bg-warning/10 text-warning border-warning/30",
|
|
1616
|
+
answered: "bg-success/10 text-success border-success/30",
|
|
1617
|
+
default: "bg-background text-muted-foreground border-border"
|
|
1618
|
+
}, _r = (r, e) => r.uid === e ? "current" : r.isFlagged ? "flagged" : r.isAnswered ? "answered" : "default", Tr = L(function({
|
|
1619
|
+
questions: e,
|
|
1620
|
+
currentQuestionUid: n,
|
|
1621
|
+
onNavigate: a,
|
|
1622
|
+
readOnly: s = !1
|
|
1623
|
+
}) {
|
|
1624
|
+
const o = (i) => {
|
|
1625
|
+
const l = [`Question ${i.sequence + 1}`];
|
|
1626
|
+
return i.isFlagged && l.push("Flagged"), i.isAnswered && l.push("Answered"), i.isSkipped && l.push("Skipped"), l.join(" · ");
|
|
1627
|
+
};
|
|
1628
|
+
return /* @__PURE__ */ t("div", { className: "flex gap-1", children: e.map((i) => {
|
|
1629
|
+
const l = _r(i, n);
|
|
1630
|
+
return /* @__PURE__ */ t(
|
|
1631
|
+
"button",
|
|
1632
|
+
{
|
|
1633
|
+
type: "button",
|
|
1634
|
+
title: o(i),
|
|
1635
|
+
"aria-label": o(i),
|
|
1636
|
+
"aria-current": i.uid === n ? "step" : void 0,
|
|
1637
|
+
className: h(
|
|
1638
|
+
"inline-flex items-center justify-center px-1.5 py-0.5 rounded border text-[11px] leading-tight transition-all duration-150 min-w-5.5",
|
|
1639
|
+
Sr[l],
|
|
1640
|
+
s ? "cursor-default" : "cursor-pointer hover:shadow-sm hover:-translate-y-px"
|
|
1641
|
+
),
|
|
1642
|
+
onClick: s ? void 0 : () => a == null ? void 0 : a(i.uid),
|
|
1643
|
+
disabled: s,
|
|
1644
|
+
children: /* @__PURE__ */ t("span", { className: "font-semibold min-w-3.5 text-center", children: i.sequence + 1 })
|
|
1645
|
+
},
|
|
1646
|
+
i.uid
|
|
1647
|
+
);
|
|
1648
|
+
}) });
|
|
1649
|
+
});
|
|
1650
|
+
function Ke({
|
|
1651
|
+
children: r,
|
|
1652
|
+
...e
|
|
1653
|
+
}) {
|
|
1654
|
+
return X.isValidElement(r) ? X.cloneElement(r, {
|
|
1655
|
+
...zr(e, r.props),
|
|
1656
|
+
ref: r.ref
|
|
1657
|
+
}) : (X.Children.count(r) > 1 && X.Children.only(null), null);
|
|
1658
|
+
}
|
|
1659
|
+
function zr(r, e) {
|
|
1660
|
+
const n = { ...e };
|
|
1661
|
+
for (const a in e) {
|
|
1662
|
+
const s = r[a], o = e[a];
|
|
1663
|
+
a === "style" ? n[a] = { ...s, ...o } : a === "className" ? n[a] = [s, o].filter(Boolean).join(" ") : typeof s == "function" && typeof o == "function" && (n[a] = (...i) => {
|
|
1664
|
+
o(...i), s(...i);
|
|
1665
|
+
});
|
|
1666
|
+
}
|
|
1667
|
+
return { ...r, ...n };
|
|
1668
|
+
}
|
|
1669
|
+
const ie = G(
|
|
1670
|
+
"inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1671
|
+
{
|
|
1672
|
+
variants: {
|
|
1673
|
+
variant: {
|
|
1674
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
1675
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
|
|
1676
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
1677
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
1678
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
1679
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
1680
|
+
},
|
|
1681
|
+
size: {
|
|
1682
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
1683
|
+
xs: "h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
1684
|
+
sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
|
|
1685
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
1686
|
+
icon: "size-9",
|
|
1687
|
+
"icon-xs": "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
1688
|
+
"icon-sm": "size-8",
|
|
1689
|
+
"icon-lg": "size-10"
|
|
1690
|
+
}
|
|
1691
|
+
},
|
|
1692
|
+
defaultVariants: {
|
|
1693
|
+
variant: "default",
|
|
1694
|
+
size: "default"
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
);
|
|
1698
|
+
function R({
|
|
1699
|
+
className: r,
|
|
1700
|
+
variant: e = "default",
|
|
1701
|
+
size: n = "default",
|
|
1702
|
+
asChild: a = !1,
|
|
1703
|
+
...s
|
|
1704
|
+
}) {
|
|
1705
|
+
return /* @__PURE__ */ t(
|
|
1706
|
+
a ? Ke : "button",
|
|
1707
|
+
{
|
|
1708
|
+
"data-slot": "button",
|
|
1709
|
+
className: h(ie({ variant: e, size: n, className: r })),
|
|
1710
|
+
...s
|
|
1711
|
+
}
|
|
1712
|
+
);
|
|
1713
|
+
}
|
|
1714
|
+
const ma = ({
|
|
1715
|
+
currentQuestionIndex: r,
|
|
1716
|
+
totalQuestions: e,
|
|
1717
|
+
hasNext: n,
|
|
1718
|
+
hasPrevious: a,
|
|
1719
|
+
onNext: s,
|
|
1720
|
+
onPrevious: o,
|
|
1721
|
+
onSubmit: i,
|
|
1722
|
+
timeElapsedSeconds: l,
|
|
1723
|
+
timeLimitSeconds: c,
|
|
1724
|
+
questions: p,
|
|
1725
|
+
onNavigateToQuestion: g,
|
|
1726
|
+
currentQuestionUid: x,
|
|
1727
|
+
isCompleted: f = !1,
|
|
1728
|
+
isSubmitting: d = !1,
|
|
1729
|
+
readOnly: m = !1
|
|
1730
|
+
}) => {
|
|
1731
|
+
const b = l != null && l >= 0, y = p && p.length > 0;
|
|
1732
|
+
return /* @__PURE__ */ u("div", { className: "flex items-center gap-2 rounded-lg border border-border bg-muted px-2 py-1.5 shadow-sm", children: [
|
|
1733
|
+
/* @__PURE__ */ u(
|
|
1734
|
+
R,
|
|
1735
|
+
{
|
|
1736
|
+
variant: "ghost",
|
|
1737
|
+
size: "icon",
|
|
1738
|
+
className: "size-8 shrink-0 rounded-md",
|
|
1739
|
+
disabled: !a || m,
|
|
1740
|
+
onClick: o,
|
|
1741
|
+
children: [
|
|
1742
|
+
/* @__PURE__ */ t(ge, { size: 16 }),
|
|
1743
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: "Previous" })
|
|
1744
|
+
]
|
|
1745
|
+
}
|
|
1746
|
+
),
|
|
1747
|
+
!y && /* @__PURE__ */ u("span", { className: "text-xs font-medium text-muted-foreground whitespace-nowrap", children: [
|
|
1748
|
+
/* @__PURE__ */ t("span", { className: "font-bold text-foreground", children: r + 1 }),
|
|
1749
|
+
/* @__PURE__ */ t("span", { className: "mx-0.5", children: "/" }),
|
|
1750
|
+
e
|
|
1751
|
+
] }),
|
|
1752
|
+
y && /* @__PURE__ */ t("div", { className: "min-w-0 flex-1 overflow-x-auto [scrollbar-width:none]", children: /* @__PURE__ */ t(
|
|
1753
|
+
Tr,
|
|
1754
|
+
{
|
|
1755
|
+
questions: p,
|
|
1756
|
+
currentQuestionUid: x,
|
|
1757
|
+
onNavigate: g,
|
|
1758
|
+
readOnly: m
|
|
1759
|
+
}
|
|
1760
|
+
) }),
|
|
1761
|
+
!y && /* @__PURE__ */ t("div", { className: "flex-1" }),
|
|
1762
|
+
b && /* @__PURE__ */ t(
|
|
1763
|
+
Cr,
|
|
1764
|
+
{
|
|
1765
|
+
timeElapsedSeconds: l,
|
|
1766
|
+
timeLimitSeconds: c
|
|
1767
|
+
}
|
|
1768
|
+
),
|
|
1769
|
+
!n || f ? /* @__PURE__ */ u(
|
|
1770
|
+
R,
|
|
1771
|
+
{
|
|
1772
|
+
variant: f ? "secondary" : "default",
|
|
1773
|
+
size: "sm",
|
|
1774
|
+
className: h("shrink-0 rounded-md", d && "gap-0"),
|
|
1775
|
+
onClick: i,
|
|
1776
|
+
disabled: m || d,
|
|
1777
|
+
children: [
|
|
1778
|
+
d ? "..." : f ? "Review" : "Submit",
|
|
1779
|
+
!d && /* @__PURE__ */ t(Ee, { size: 14 })
|
|
1780
|
+
]
|
|
1781
|
+
}
|
|
1782
|
+
) : /* @__PURE__ */ u(
|
|
1783
|
+
R,
|
|
1784
|
+
{
|
|
1785
|
+
variant: "ghost",
|
|
1786
|
+
size: "icon",
|
|
1787
|
+
className: "size-8 shrink-0 rounded-md",
|
|
1788
|
+
disabled: !n || m,
|
|
1789
|
+
onClick: s,
|
|
1790
|
+
children: [
|
|
1791
|
+
/* @__PURE__ */ t(se, { size: 16 }),
|
|
1792
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: "Next" })
|
|
1793
|
+
]
|
|
1794
|
+
}
|
|
1795
|
+
)
|
|
1796
|
+
] });
|
|
1797
|
+
}, pa = ({
|
|
1798
|
+
questionNumber: r,
|
|
1799
|
+
totalQuestions: e,
|
|
1800
|
+
isFlagged: n,
|
|
1801
|
+
onToggleFlag: a,
|
|
1802
|
+
hasMaterials: s = !1,
|
|
1803
|
+
onOpenMaterials: o,
|
|
1804
|
+
readOnly: i = !1
|
|
1805
|
+
}) => /* @__PURE__ */ u("div", { className: "flex items-center justify-between pb-3 border-b border-border", children: [
|
|
1806
|
+
/* @__PURE__ */ u("span", { className: "text-sm font-semibold text-foreground", children: [
|
|
1807
|
+
"Question ",
|
|
1808
|
+
r,
|
|
1809
|
+
" ",
|
|
1810
|
+
/* @__PURE__ */ u("span", { className: "font-normal text-muted-foreground", children: [
|
|
1811
|
+
"of ",
|
|
1812
|
+
e
|
|
1813
|
+
] })
|
|
1814
|
+
] }),
|
|
1815
|
+
!i && /* @__PURE__ */ u("div", { className: "flex items-center gap-1", children: [
|
|
1816
|
+
s && o && /* @__PURE__ */ u(
|
|
1817
|
+
R,
|
|
1818
|
+
{
|
|
1819
|
+
variant: "ghost",
|
|
1820
|
+
size: "sm",
|
|
1821
|
+
className: "gap-1.5 text-muted-foreground hover:text-foreground",
|
|
1822
|
+
onClick: o,
|
|
1823
|
+
children: [
|
|
1824
|
+
/* @__PURE__ */ t(te, { size: 14 }),
|
|
1825
|
+
"Related Material"
|
|
1826
|
+
]
|
|
1827
|
+
}
|
|
1828
|
+
),
|
|
1829
|
+
a && /* @__PURE__ */ t(
|
|
1830
|
+
R,
|
|
1831
|
+
{
|
|
1832
|
+
variant: "ghost",
|
|
1833
|
+
size: "icon",
|
|
1834
|
+
className: h(
|
|
1835
|
+
"size-8",
|
|
1836
|
+
n ? "text-warning hover:text-warning/80" : "text-muted-foreground hover:text-warning"
|
|
1837
|
+
),
|
|
1838
|
+
onClick: a,
|
|
1839
|
+
"aria-label": n ? "Unflag question" : "Flag question",
|
|
1840
|
+
children: /* @__PURE__ */ t(
|
|
1841
|
+
gt,
|
|
1842
|
+
{
|
|
1843
|
+
size: 14,
|
|
1844
|
+
fill: n ? "currentColor" : "none"
|
|
1845
|
+
}
|
|
1846
|
+
)
|
|
1847
|
+
}
|
|
1848
|
+
)
|
|
1849
|
+
] })
|
|
1850
|
+
] }), Qe = Q(null);
|
|
1851
|
+
function We() {
|
|
1852
|
+
const r = W(Qe);
|
|
1853
|
+
if (!r) throw new Error("Tooltip compound components must be used within <Tooltip>");
|
|
1854
|
+
return r;
|
|
1855
|
+
}
|
|
1856
|
+
function Dr({ children: r, delayDuration: e = 300 }) {
|
|
1857
|
+
const [n, a] = T(!1), s = I(null), o = I(void 0), i = O(), l = E(() => {
|
|
1858
|
+
clearTimeout(o.current), o.current = setTimeout(() => a(!0), e);
|
|
1859
|
+
}, [e]), c = E(() => {
|
|
1860
|
+
clearTimeout(o.current), a(!1);
|
|
1861
|
+
}, []);
|
|
1862
|
+
return /* @__PURE__ */ t(Qe.Provider, { value: { open: n, show: l, hide: c, triggerRef: s, tooltipId: i }, children: r });
|
|
1863
|
+
}
|
|
1864
|
+
function Ir({ children: r }) {
|
|
1865
|
+
const { show: e, hide: n, triggerRef: a, tooltipId: s, open: o } = We();
|
|
1866
|
+
return Ot(r) ? Kt(r, {
|
|
1867
|
+
ref: (i) => {
|
|
1868
|
+
a.current = i;
|
|
1869
|
+
const l = r.ref;
|
|
1870
|
+
typeof l == "function" ? l(i) : l && typeof l == "object" && (l.current = i);
|
|
1871
|
+
},
|
|
1872
|
+
onMouseEnter: (i) => {
|
|
1873
|
+
e();
|
|
1874
|
+
const l = r.props.onMouseEnter;
|
|
1875
|
+
l == null || l(i);
|
|
1876
|
+
},
|
|
1877
|
+
onMouseLeave: (i) => {
|
|
1878
|
+
n();
|
|
1879
|
+
const l = r.props.onMouseLeave;
|
|
1880
|
+
l == null || l(i);
|
|
1881
|
+
},
|
|
1882
|
+
onFocus: (i) => {
|
|
1883
|
+
e();
|
|
1884
|
+
const l = r.props.onFocus;
|
|
1885
|
+
l == null || l(i);
|
|
1886
|
+
},
|
|
1887
|
+
onBlur: (i) => {
|
|
1888
|
+
n();
|
|
1889
|
+
const l = r.props.onBlur;
|
|
1890
|
+
l == null || l(i);
|
|
1891
|
+
},
|
|
1892
|
+
"aria-describedby": o ? s : void 0
|
|
1893
|
+
}) : r;
|
|
1894
|
+
}
|
|
1895
|
+
function Mr({
|
|
1896
|
+
className: r,
|
|
1897
|
+
sideOffset: e = 8,
|
|
1898
|
+
children: n,
|
|
1899
|
+
style: a,
|
|
1900
|
+
...s
|
|
1901
|
+
}) {
|
|
1902
|
+
const { open: o, triggerRef: i, tooltipId: l } = We(), c = I(null), [p, g] = T({
|
|
1903
|
+
position: "fixed",
|
|
1904
|
+
top: 0,
|
|
1905
|
+
left: 0,
|
|
1906
|
+
visibility: "hidden"
|
|
1907
|
+
});
|
|
1908
|
+
return Vt(() => {
|
|
1909
|
+
if (!o || !i.current || !c.current) return;
|
|
1910
|
+
const x = i.current.getBoundingClientRect(), f = c.current.getBoundingClientRect();
|
|
1911
|
+
let d = x.top - f.height - e, m = x.left + x.width / 2 - f.width / 2;
|
|
1912
|
+
d < 4 && (d = x.bottom + e), m < 4 && (m = 4), m + f.width > window.innerWidth - 4 && (m = window.innerWidth - f.width - 4), g({ position: "fixed", top: d, left: m, visibility: "visible" });
|
|
1913
|
+
}, [o, e, i]), o ? xe(
|
|
1914
|
+
/* @__PURE__ */ t(
|
|
1915
|
+
"div",
|
|
1916
|
+
{
|
|
1917
|
+
ref: c,
|
|
1918
|
+
id: l,
|
|
1919
|
+
role: "tooltip",
|
|
1920
|
+
"data-slot": "tooltip-content",
|
|
1921
|
+
className: h(
|
|
1922
|
+
"bg-primary text-primary-foreground z-50 max-w-60 rounded-md px-2.5 py-1.5 text-xs leading-snug shadow-md animate-in fade-in-0 zoom-in-95",
|
|
1923
|
+
r
|
|
1924
|
+
),
|
|
1925
|
+
style: { ...p, ...a },
|
|
1926
|
+
...s,
|
|
1927
|
+
children: n
|
|
1928
|
+
}
|
|
1929
|
+
),
|
|
1930
|
+
document.body
|
|
1931
|
+
) : null;
|
|
1932
|
+
}
|
|
1933
|
+
const Ge = Q(null);
|
|
1934
|
+
function Lr() {
|
|
1935
|
+
const r = W(Ge);
|
|
1936
|
+
if (!r)
|
|
1937
|
+
throw new Error(
|
|
1938
|
+
"DrawerNavItem must be used within <DrawerNav>"
|
|
1939
|
+
);
|
|
1940
|
+
return r;
|
|
1941
|
+
}
|
|
1942
|
+
const Ye = Q(null);
|
|
1943
|
+
function F() {
|
|
1944
|
+
const r = W(Ye);
|
|
1945
|
+
if (!r)
|
|
1946
|
+
throw new Error("Drawer compound components must be used within <Drawer>");
|
|
1947
|
+
return r;
|
|
1948
|
+
}
|
|
1949
|
+
const Se = [
|
|
1950
|
+
"a[href]",
|
|
1951
|
+
"button:not([disabled])",
|
|
1952
|
+
"input:not([disabled])",
|
|
1953
|
+
"select:not([disabled])",
|
|
1954
|
+
"textarea:not([disabled])",
|
|
1955
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
1956
|
+
].join(", ");
|
|
1957
|
+
function Er(r, e) {
|
|
1958
|
+
const n = I(null);
|
|
1959
|
+
return H(() => {
|
|
1960
|
+
if (!e || !r.current) return;
|
|
1961
|
+
n.current = document.activeElement;
|
|
1962
|
+
const s = r.current.querySelectorAll(Se);
|
|
1963
|
+
return s.length > 0 && s[0].focus(), () => {
|
|
1964
|
+
n.current instanceof HTMLElement && n.current.focus();
|
|
1965
|
+
};
|
|
1966
|
+
}, [e, r]), E(
|
|
1967
|
+
(s) => {
|
|
1968
|
+
if (s.key !== "Tab" || !r.current) return;
|
|
1969
|
+
const o = Array.from(
|
|
1970
|
+
r.current.querySelectorAll(Se)
|
|
1971
|
+
);
|
|
1972
|
+
if (o.length === 0) return;
|
|
1973
|
+
const i = o[0], l = o[o.length - 1];
|
|
1974
|
+
s.shiftKey && document.activeElement === i ? (s.preventDefault(), l.focus()) : !s.shiftKey && document.activeElement === l && (s.preventDefault(), i.focus());
|
|
1975
|
+
},
|
|
1976
|
+
[r]
|
|
1977
|
+
);
|
|
1978
|
+
}
|
|
1979
|
+
function $r(r) {
|
|
1980
|
+
H(() => {
|
|
1981
|
+
if (!r) return;
|
|
1982
|
+
const e = document.body.style.overflow;
|
|
1983
|
+
return document.body.style.overflow = "hidden", () => {
|
|
1984
|
+
document.body.style.overflow = e;
|
|
1985
|
+
};
|
|
1986
|
+
}, [r]);
|
|
1987
|
+
}
|
|
1988
|
+
const Rr = G(
|
|
1989
|
+
"bg-background fixed inset-y-0 z-50 flex flex-col shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
1990
|
+
{
|
|
1991
|
+
variants: {
|
|
1992
|
+
side: {
|
|
1993
|
+
right: "right-0 border-l data-[state=open]:slide-in-from-right data-[state=closed]:slide-out-to-right",
|
|
1994
|
+
left: "left-0 border-r data-[state=open]:slide-in-from-left data-[state=closed]:slide-out-to-left"
|
|
1995
|
+
},
|
|
1996
|
+
size: {
|
|
1997
|
+
sm: "w-80",
|
|
1998
|
+
default: "w-100",
|
|
1999
|
+
lg: "w-128",
|
|
2000
|
+
xl: "w-160",
|
|
2001
|
+
full: "w-full"
|
|
2002
|
+
}
|
|
2003
|
+
},
|
|
2004
|
+
defaultVariants: {
|
|
2005
|
+
side: "right",
|
|
2006
|
+
size: "default"
|
|
2007
|
+
}
|
|
2008
|
+
}
|
|
2009
|
+
);
|
|
2010
|
+
function Hr({ children: r, open: e, onOpenChange: n, side: a = "right" }) {
|
|
2011
|
+
const s = O(), o = O(), [i, l] = T(!1);
|
|
2012
|
+
return /* @__PURE__ */ t(
|
|
2013
|
+
Ye.Provider,
|
|
2014
|
+
{
|
|
2015
|
+
value: { open: e, onOpenChange: n, side: a, titleId: s, descriptionId: o, hasNav: i, setHasNav: l },
|
|
2016
|
+
children: r
|
|
2017
|
+
}
|
|
2018
|
+
);
|
|
2019
|
+
}
|
|
2020
|
+
function ga({
|
|
2021
|
+
className: r,
|
|
2022
|
+
onClick: e,
|
|
2023
|
+
...n
|
|
2024
|
+
}) {
|
|
2025
|
+
const { onOpenChange: a } = F();
|
|
2026
|
+
return /* @__PURE__ */ t(
|
|
2027
|
+
"button",
|
|
2028
|
+
{
|
|
2029
|
+
type: "button",
|
|
2030
|
+
"data-slot": "drawer-trigger",
|
|
2031
|
+
className: r,
|
|
2032
|
+
onClick: (s) => {
|
|
2033
|
+
a(!0), e == null || e(s);
|
|
2034
|
+
},
|
|
2035
|
+
...n
|
|
2036
|
+
}
|
|
2037
|
+
);
|
|
2038
|
+
}
|
|
2039
|
+
function Ur({ children: r }) {
|
|
2040
|
+
return xe(r, document.body);
|
|
2041
|
+
}
|
|
2042
|
+
function jr({
|
|
2043
|
+
className: r,
|
|
2044
|
+
...e
|
|
2045
|
+
}) {
|
|
2046
|
+
const { onOpenChange: n } = F();
|
|
2047
|
+
return /* @__PURE__ */ t(
|
|
2048
|
+
"div",
|
|
2049
|
+
{
|
|
2050
|
+
"data-slot": "drawer-backdrop",
|
|
2051
|
+
className: h(
|
|
2052
|
+
"fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
2053
|
+
r
|
|
2054
|
+
),
|
|
2055
|
+
"data-state": "open",
|
|
2056
|
+
onClick: () => n(!1),
|
|
2057
|
+
...e
|
|
2058
|
+
}
|
|
2059
|
+
);
|
|
2060
|
+
}
|
|
2061
|
+
function Pr({
|
|
2062
|
+
className: r,
|
|
2063
|
+
children: e,
|
|
2064
|
+
size: n = "default",
|
|
2065
|
+
scrollLock: a = !0,
|
|
2066
|
+
...s
|
|
2067
|
+
}) {
|
|
2068
|
+
const { open: o, onOpenChange: i, side: l, titleId: c, descriptionId: p, hasNav: g } = F(), x = I(null), f = Er(x, o);
|
|
2069
|
+
return $r(o && a), H(() => {
|
|
2070
|
+
if (!o) return;
|
|
2071
|
+
const d = (m) => {
|
|
2072
|
+
m.key === "Escape" && i(!1);
|
|
2073
|
+
};
|
|
2074
|
+
return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
|
|
2075
|
+
}, [o, i]), o ? /* @__PURE__ */ u(Ur, { children: [
|
|
2076
|
+
/* @__PURE__ */ t(jr, {}),
|
|
2077
|
+
/* @__PURE__ */ t(
|
|
2078
|
+
"div",
|
|
2079
|
+
{
|
|
2080
|
+
ref: x,
|
|
2081
|
+
role: "dialog",
|
|
2082
|
+
"aria-modal": "true",
|
|
2083
|
+
"aria-labelledby": c,
|
|
2084
|
+
"aria-describedby": p,
|
|
2085
|
+
"data-slot": "drawer-content",
|
|
2086
|
+
"data-state": "open",
|
|
2087
|
+
className: h(Rr({ side: l, size: n }), g && "flex-row", r),
|
|
2088
|
+
onKeyDown: f,
|
|
2089
|
+
...s,
|
|
2090
|
+
children: e
|
|
2091
|
+
}
|
|
2092
|
+
)
|
|
2093
|
+
] }) : null;
|
|
2094
|
+
}
|
|
2095
|
+
function Br({
|
|
2096
|
+
className: r,
|
|
2097
|
+
...e
|
|
2098
|
+
}) {
|
|
2099
|
+
return /* @__PURE__ */ t(
|
|
2100
|
+
"div",
|
|
2101
|
+
{
|
|
2102
|
+
"data-slot": "drawer-header",
|
|
2103
|
+
className: h("flex flex-col gap-1.5 border-b px-6 py-4 shrink-0", r),
|
|
2104
|
+
...e
|
|
2105
|
+
}
|
|
2106
|
+
);
|
|
2107
|
+
}
|
|
2108
|
+
function Ar({
|
|
2109
|
+
className: r,
|
|
2110
|
+
...e
|
|
2111
|
+
}) {
|
|
2112
|
+
return /* @__PURE__ */ t(
|
|
2113
|
+
"div",
|
|
2114
|
+
{
|
|
2115
|
+
"data-slot": "drawer-body",
|
|
2116
|
+
className: h("flex-1 overflow-y-auto px-6 py-4", r),
|
|
2117
|
+
...e
|
|
2118
|
+
}
|
|
2119
|
+
);
|
|
2120
|
+
}
|
|
2121
|
+
function ha({
|
|
2122
|
+
className: r,
|
|
2123
|
+
...e
|
|
2124
|
+
}) {
|
|
2125
|
+
return /* @__PURE__ */ t(
|
|
2126
|
+
"div",
|
|
2127
|
+
{
|
|
2128
|
+
"data-slot": "drawer-footer",
|
|
2129
|
+
className: h(
|
|
2130
|
+
"flex items-center gap-2 border-t px-6 py-4 shrink-0",
|
|
2131
|
+
r
|
|
2132
|
+
),
|
|
2133
|
+
...e
|
|
2134
|
+
}
|
|
2135
|
+
);
|
|
2136
|
+
}
|
|
2137
|
+
function Fr({
|
|
2138
|
+
className: r,
|
|
2139
|
+
...e
|
|
2140
|
+
}) {
|
|
2141
|
+
const { titleId: n } = F();
|
|
2142
|
+
return /* @__PURE__ */ t(
|
|
2143
|
+
"h2",
|
|
2144
|
+
{
|
|
2145
|
+
id: n,
|
|
2146
|
+
"data-slot": "drawer-title",
|
|
2147
|
+
className: h("text-lg font-semibold", r),
|
|
2148
|
+
...e
|
|
2149
|
+
}
|
|
2150
|
+
);
|
|
2151
|
+
}
|
|
2152
|
+
function xa({
|
|
2153
|
+
className: r,
|
|
2154
|
+
...e
|
|
2155
|
+
}) {
|
|
2156
|
+
const { descriptionId: n } = F();
|
|
2157
|
+
return /* @__PURE__ */ t(
|
|
2158
|
+
"p",
|
|
2159
|
+
{
|
|
2160
|
+
id: n,
|
|
2161
|
+
"data-slot": "drawer-description",
|
|
2162
|
+
className: h("text-muted-foreground text-sm", r),
|
|
2163
|
+
...e
|
|
2164
|
+
}
|
|
2165
|
+
);
|
|
2166
|
+
}
|
|
2167
|
+
function Vr({
|
|
2168
|
+
className: r,
|
|
2169
|
+
children: e,
|
|
2170
|
+
onClick: n,
|
|
2171
|
+
...a
|
|
2172
|
+
}) {
|
|
2173
|
+
const { onOpenChange: s } = F();
|
|
2174
|
+
return /* @__PURE__ */ t(
|
|
2175
|
+
"button",
|
|
2176
|
+
{
|
|
2177
|
+
type: "button",
|
|
2178
|
+
"data-slot": "drawer-close",
|
|
2179
|
+
className: h(ie({ variant: "ghost", size: "sm" }), r),
|
|
2180
|
+
onClick: (o) => {
|
|
2181
|
+
s(!1), n == null || n(o);
|
|
2182
|
+
},
|
|
2183
|
+
...a,
|
|
2184
|
+
children: e ?? /* @__PURE__ */ t(oe, { className: "h-4 w-4" })
|
|
2185
|
+
}
|
|
2186
|
+
);
|
|
2187
|
+
}
|
|
2188
|
+
function ba({
|
|
2189
|
+
value: r,
|
|
2190
|
+
onValueChange: e,
|
|
2191
|
+
className: n,
|
|
2192
|
+
children: a,
|
|
2193
|
+
...s
|
|
2194
|
+
}) {
|
|
2195
|
+
const { setHasNav: o } = F(), i = I(null);
|
|
2196
|
+
H(() => (o(!0), () => o(!1)), [o]);
|
|
2197
|
+
const l = (c) => {
|
|
2198
|
+
if (!["ArrowUp", "ArrowDown", "Home", "End"].includes(c.key)) return;
|
|
2199
|
+
const p = i.current;
|
|
2200
|
+
if (!p) return;
|
|
2201
|
+
const g = Array.from(
|
|
2202
|
+
p.querySelectorAll('[role="tab"]:not([disabled])')
|
|
2203
|
+
), x = g.indexOf(document.activeElement);
|
|
2204
|
+
if (x === -1) return;
|
|
2205
|
+
c.preventDefault();
|
|
2206
|
+
let f;
|
|
2207
|
+
switch (c.key) {
|
|
2208
|
+
case "ArrowDown":
|
|
2209
|
+
f = (x + 1) % g.length;
|
|
2210
|
+
break;
|
|
2211
|
+
case "ArrowUp":
|
|
2212
|
+
f = (x - 1 + g.length) % g.length;
|
|
2213
|
+
break;
|
|
2214
|
+
case "Home":
|
|
2215
|
+
f = 0;
|
|
2216
|
+
break;
|
|
2217
|
+
case "End":
|
|
2218
|
+
f = g.length - 1;
|
|
2219
|
+
break;
|
|
2220
|
+
default:
|
|
2221
|
+
return;
|
|
2222
|
+
}
|
|
2223
|
+
g[f].focus();
|
|
2224
|
+
};
|
|
2225
|
+
return /* @__PURE__ */ t(Ge.Provider, { value: { value: r, onValueChange: e }, children: /* @__PURE__ */ t(
|
|
2226
|
+
"nav",
|
|
2227
|
+
{
|
|
2228
|
+
ref: i,
|
|
2229
|
+
role: "tablist",
|
|
2230
|
+
"aria-orientation": "vertical",
|
|
2231
|
+
"data-slot": "drawer-nav",
|
|
2232
|
+
className: h(
|
|
2233
|
+
"flex shrink-0 flex-col items-center gap-1 border-r bg-muted/30 px-1.5 py-2",
|
|
2234
|
+
n
|
|
2235
|
+
),
|
|
2236
|
+
onKeyDown: l,
|
|
2237
|
+
...s,
|
|
2238
|
+
children: a
|
|
2239
|
+
}
|
|
2240
|
+
) });
|
|
2241
|
+
}
|
|
2242
|
+
function va({
|
|
2243
|
+
value: r,
|
|
2244
|
+
icon: e,
|
|
2245
|
+
label: n,
|
|
2246
|
+
className: a,
|
|
2247
|
+
...s
|
|
2248
|
+
}) {
|
|
2249
|
+
const { value: o, onValueChange: i } = Lr(), { side: l } = F(), c = o === r;
|
|
2250
|
+
return /* @__PURE__ */ u(Dr, { children: [
|
|
2251
|
+
/* @__PURE__ */ t(Ir, { children: /* @__PURE__ */ u(
|
|
2252
|
+
"button",
|
|
2253
|
+
{
|
|
2254
|
+
role: "tab",
|
|
2255
|
+
type: "button",
|
|
2256
|
+
"aria-selected": c,
|
|
2257
|
+
"aria-label": n,
|
|
2258
|
+
"data-slot": "drawer-nav-item",
|
|
2259
|
+
...c ? { "data-active": "" } : {},
|
|
2260
|
+
className: h(
|
|
2261
|
+
"relative flex cursor-pointer items-center justify-center rounded-md size-9 transition-colors",
|
|
2262
|
+
"text-muted-foreground hover:text-foreground hover:bg-accent",
|
|
2263
|
+
c && "text-foreground bg-accent/50",
|
|
2264
|
+
a
|
|
2265
|
+
),
|
|
2266
|
+
onClick: () => i(r),
|
|
2267
|
+
...s,
|
|
2268
|
+
children: [
|
|
2269
|
+
c && /* @__PURE__ */ t(
|
|
2270
|
+
"span",
|
|
2271
|
+
{
|
|
2272
|
+
"aria-hidden": "true",
|
|
2273
|
+
className: h(
|
|
2274
|
+
"absolute top-1 bottom-1 w-0.5 rounded-full bg-primary",
|
|
2275
|
+
l === "left" ? "right-0 -mr-1.5" : "left-0 -ml-1.5"
|
|
2276
|
+
)
|
|
2277
|
+
}
|
|
2278
|
+
),
|
|
2279
|
+
e
|
|
2280
|
+
]
|
|
2281
|
+
}
|
|
2282
|
+
) }),
|
|
2283
|
+
/* @__PURE__ */ t(Mr, { children: n })
|
|
2284
|
+
] });
|
|
2285
|
+
}
|
|
2286
|
+
function ya({
|
|
2287
|
+
className: r,
|
|
2288
|
+
...e
|
|
2289
|
+
}) {
|
|
2290
|
+
return /* @__PURE__ */ t(
|
|
2291
|
+
"div",
|
|
2292
|
+
{
|
|
2293
|
+
role: "tabpanel",
|
|
2294
|
+
"data-slot": "drawer-viewport",
|
|
2295
|
+
className: h("flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden", r),
|
|
2296
|
+
...e
|
|
2297
|
+
}
|
|
2298
|
+
);
|
|
2299
|
+
}
|
|
2300
|
+
const Or = ({
|
|
2301
|
+
src: r,
|
|
2302
|
+
poster: e,
|
|
2303
|
+
title: n,
|
|
2304
|
+
autoPlay: a = !1,
|
|
2305
|
+
onPlay: s,
|
|
2306
|
+
onPause: o,
|
|
2307
|
+
onEnded: i,
|
|
2308
|
+
onTimeUpdate: l,
|
|
2309
|
+
readOnly: c = !1,
|
|
2310
|
+
aspectRatio: p = "16/9",
|
|
2311
|
+
tracks: g,
|
|
2312
|
+
className: x,
|
|
2313
|
+
style: f
|
|
2314
|
+
}) => {
|
|
2315
|
+
const d = I(null), m = I(-1), b = D(
|
|
2316
|
+
() => ({ aspectRatio: p, ...f }),
|
|
2317
|
+
[p, f]
|
|
2318
|
+
), y = D(
|
|
2319
|
+
() => ({ width: "100%", aspectRatio: p, display: "block" }),
|
|
2320
|
+
[p]
|
|
2321
|
+
), C = E(() => {
|
|
2322
|
+
const S = d.current;
|
|
2323
|
+
if (S && l) {
|
|
2324
|
+
const k = Math.floor(S.currentTime * 4) / 4;
|
|
2325
|
+
k !== m.current && (m.current = k, l(S.currentTime, S.duration));
|
|
2326
|
+
}
|
|
2327
|
+
}, [l]);
|
|
2328
|
+
return r ? c ? /* @__PURE__ */ u(
|
|
2329
|
+
"div",
|
|
2330
|
+
{
|
|
2331
|
+
className: h("relative overflow-hidden rounded-lg", x),
|
|
2332
|
+
style: b,
|
|
2333
|
+
children: [
|
|
2334
|
+
e ? /* @__PURE__ */ t(
|
|
2335
|
+
"img",
|
|
2336
|
+
{
|
|
2337
|
+
src: e,
|
|
2338
|
+
alt: n || "Video poster",
|
|
2339
|
+
loading: "lazy",
|
|
2340
|
+
className: "w-full h-full object-cover"
|
|
2341
|
+
}
|
|
2342
|
+
) : /* @__PURE__ */ t("div", { className: "absolute inset-0 flex items-center justify-center bg-muted", children: /* @__PURE__ */ t("div", { className: "flex items-center justify-center size-14 rounded-full bg-black/60", children: /* @__PURE__ */ t(ue, { size: 28, className: "text-white ml-0.5" }) }) }),
|
|
2343
|
+
e && /* @__PURE__ */ t("div", { className: "absolute inset-0 flex items-center justify-center bg-black/30 transition-opacity", children: /* @__PURE__ */ t("div", { className: "flex items-center justify-center size-14 rounded-full bg-black/60", children: /* @__PURE__ */ t(ue, { size: 28, className: "text-white ml-0.5" }) }) }),
|
|
2344
|
+
n && /* @__PURE__ */ t("div", { className: "absolute bottom-0 left-0 right-0 bg-linear-to-t from-black/60 to-transparent p-2", children: /* @__PURE__ */ t("span", { className: "text-sm text-white font-medium", children: n }) })
|
|
2345
|
+
]
|
|
2346
|
+
}
|
|
2347
|
+
) : /* @__PURE__ */ u("div", { className: x, style: f, children: [
|
|
2348
|
+
n && /* @__PURE__ */ t("p", { className: "mb-2 text-sm font-medium", children: n }),
|
|
2349
|
+
/* @__PURE__ */ t("div", { className: "rounded-lg overflow-hidden", children: /* @__PURE__ */ t(
|
|
2350
|
+
"video",
|
|
2351
|
+
{
|
|
2352
|
+
ref: d,
|
|
2353
|
+
src: r,
|
|
2354
|
+
poster: e,
|
|
2355
|
+
controls: !0,
|
|
2356
|
+
preload: "metadata",
|
|
2357
|
+
autoPlay: a,
|
|
2358
|
+
onPlay: s,
|
|
2359
|
+
onPause: o,
|
|
2360
|
+
onEnded: i,
|
|
2361
|
+
onTimeUpdate: C,
|
|
2362
|
+
style: y,
|
|
2363
|
+
children: g == null ? void 0 : g.map((S) => /* @__PURE__ */ t(
|
|
2364
|
+
"track",
|
|
2365
|
+
{
|
|
2366
|
+
src: S.src,
|
|
2367
|
+
kind: S.kind,
|
|
2368
|
+
label: S.label,
|
|
2369
|
+
srcLang: S.srcLang,
|
|
2370
|
+
default: S.default
|
|
2371
|
+
},
|
|
2372
|
+
`${S.kind}-${S.srcLang}`
|
|
2373
|
+
))
|
|
2374
|
+
}
|
|
2375
|
+
) })
|
|
2376
|
+
] }) : /* @__PURE__ */ t(
|
|
2377
|
+
"div",
|
|
2378
|
+
{
|
|
2379
|
+
className: h("relative overflow-hidden rounded-lg border border-border bg-muted", x),
|
|
2380
|
+
style: b,
|
|
2381
|
+
children: /* @__PURE__ */ u("div", { className: "absolute inset-0 flex flex-col items-center justify-center gap-2", children: [
|
|
2382
|
+
/* @__PURE__ */ t("div", { className: "flex items-center justify-center size-12 rounded-full bg-muted-foreground/10", children: /* @__PURE__ */ t(de, { size: 24 }) }),
|
|
2383
|
+
/* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: "No video source provided" })
|
|
2384
|
+
] })
|
|
2385
|
+
}
|
|
2386
|
+
);
|
|
2387
|
+
}, Kr = G("h-full rounded-full transition-all duration-300", {
|
|
2388
|
+
variants: {
|
|
2389
|
+
variant: {
|
|
2390
|
+
default: "bg-primary",
|
|
2391
|
+
success: "bg-success",
|
|
2392
|
+
warning: "bg-warning",
|
|
2393
|
+
info: "bg-info",
|
|
2394
|
+
palette0: "bg-palette-0",
|
|
2395
|
+
palette1: "bg-palette-1",
|
|
2396
|
+
palette2: "bg-palette-2",
|
|
2397
|
+
palette3: "bg-palette-3"
|
|
2398
|
+
},
|
|
2399
|
+
size: {
|
|
2400
|
+
sm: "",
|
|
2401
|
+
default: ""
|
|
2402
|
+
}
|
|
2403
|
+
},
|
|
2404
|
+
defaultVariants: {
|
|
2405
|
+
variant: "default",
|
|
2406
|
+
size: "default"
|
|
2407
|
+
}
|
|
2408
|
+
}), Qr = G("bg-muted overflow-hidden rounded-full w-full", {
|
|
2409
|
+
variants: {
|
|
2410
|
+
size: {
|
|
2411
|
+
sm: "h-1.5",
|
|
2412
|
+
default: "h-2.5"
|
|
2413
|
+
}
|
|
2414
|
+
},
|
|
2415
|
+
defaultVariants: {
|
|
2416
|
+
size: "default"
|
|
2417
|
+
}
|
|
2418
|
+
});
|
|
2419
|
+
function Na({
|
|
2420
|
+
className: r,
|
|
2421
|
+
value: e = 0,
|
|
2422
|
+
max: n = 100,
|
|
2423
|
+
variant: a,
|
|
2424
|
+
size: s,
|
|
2425
|
+
...o
|
|
2426
|
+
}) {
|
|
2427
|
+
const i = Math.min(100, Math.max(0, e / n * 100));
|
|
2428
|
+
return /* @__PURE__ */ t(
|
|
2429
|
+
"div",
|
|
2430
|
+
{
|
|
2431
|
+
"data-slot": "progress",
|
|
2432
|
+
role: "progressbar",
|
|
2433
|
+
"aria-valuenow": e,
|
|
2434
|
+
"aria-valuemin": 0,
|
|
2435
|
+
"aria-valuemax": n,
|
|
2436
|
+
className: h(Qr({ size: s }), r),
|
|
2437
|
+
...o,
|
|
2438
|
+
children: /* @__PURE__ */ t(
|
|
2439
|
+
"div",
|
|
2440
|
+
{
|
|
2441
|
+
className: Kr({ variant: a, size: s }),
|
|
2442
|
+
style: { width: `${i}%` }
|
|
2443
|
+
}
|
|
2444
|
+
)
|
|
2445
|
+
}
|
|
2446
|
+
);
|
|
2447
|
+
}
|
|
2448
|
+
const _e = {
|
|
2449
|
+
color1: { bg: "bg-palette-0/10", border: "border-palette-0/30", accent: "bg-palette-0/30" },
|
|
2450
|
+
color2: { bg: "bg-palette-1/10", border: "border-palette-1/30", accent: "bg-palette-1/30" },
|
|
2451
|
+
color3: { bg: "bg-palette-2/10", border: "border-palette-2/30", accent: "bg-palette-2/30" },
|
|
2452
|
+
color4: { bg: "bg-palette-3/10", border: "border-palette-3/30", accent: "bg-palette-3/30" },
|
|
2453
|
+
color5: { bg: "bg-info/10", border: "border-info/30", accent: "bg-info/30" },
|
|
2454
|
+
color6: { bg: "bg-success/10", border: "border-success/30", accent: "bg-success/30" }
|
|
2455
|
+
}, Wr = {
|
|
2456
|
+
small: { width: 280, height: 180, fontSize: "0.875rem" },
|
|
2457
|
+
medium: { width: 400, height: 260, fontSize: "1rem" },
|
|
2458
|
+
large: { width: 520, height: 340, fontSize: "1.125rem" }
|
|
2459
|
+
}, Gr = ({
|
|
2460
|
+
card: r,
|
|
2461
|
+
isFlipped: e,
|
|
2462
|
+
onFlip: n,
|
|
2463
|
+
readOnly: a = !1,
|
|
2464
|
+
size: s = "medium"
|
|
2465
|
+
}) => {
|
|
2466
|
+
const [o, i] = T(!1), l = e !== void 0, c = l ? e : o, p = () => {
|
|
2467
|
+
a || (l || i((b) => !b), n == null || n());
|
|
2468
|
+
}, { width: g, height: x, fontSize: f } = Wr[s], d = _e[r.color] || _e.color1, m = (b) => {
|
|
2469
|
+
(b.key === "Enter" || b.key === " ") && (b.preventDefault(), p());
|
|
2470
|
+
};
|
|
2471
|
+
return /* @__PURE__ */ u(
|
|
2472
|
+
"div",
|
|
2473
|
+
{
|
|
2474
|
+
className: "perspective-[1000px]",
|
|
2475
|
+
style: { width: `${g}px`, height: `${x}px` },
|
|
2476
|
+
children: [
|
|
2477
|
+
/* @__PURE__ */ t("span", { className: "sr-only", "aria-live": "polite", children: c ? "Answer revealed" : "Question shown" }),
|
|
2478
|
+
/* @__PURE__ */ u(
|
|
2479
|
+
"div",
|
|
2480
|
+
{
|
|
2481
|
+
className: h(
|
|
2482
|
+
"relative size-full motion-safe:transition-transform motion-safe:duration-500 transform-3d",
|
|
2483
|
+
c && "transform-[rotateY(180deg)]"
|
|
2484
|
+
),
|
|
2485
|
+
children: [
|
|
2486
|
+
/* @__PURE__ */ u(
|
|
2487
|
+
"div",
|
|
2488
|
+
{
|
|
2489
|
+
className: h(
|
|
2490
|
+
"absolute inset-0 flex flex-col rounded-lg border backface-hidden",
|
|
2491
|
+
d.bg,
|
|
2492
|
+
d.border,
|
|
2493
|
+
!a && "cursor-pointer",
|
|
2494
|
+
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
|
2495
|
+
),
|
|
2496
|
+
onClick: p,
|
|
2497
|
+
onKeyDown: a ? void 0 : m,
|
|
2498
|
+
role: "button",
|
|
2499
|
+
tabIndex: a ? -1 : 0,
|
|
2500
|
+
"aria-label": "Flashcard — press Enter to reveal answer",
|
|
2501
|
+
children: [
|
|
2502
|
+
/* @__PURE__ */ t("div", { className: "flex flex-1 items-center justify-center p-5 overflow-auto", children: /* @__PURE__ */ t(
|
|
2503
|
+
"div",
|
|
2504
|
+
{
|
|
2505
|
+
className: "text-center",
|
|
2506
|
+
style: { fontSize: f },
|
|
2507
|
+
dangerouslySetInnerHTML: { __html: r.front }
|
|
2508
|
+
}
|
|
2509
|
+
) }),
|
|
2510
|
+
!a && /* @__PURE__ */ u("div", { className: "flex items-center justify-center gap-1 pb-3 text-muted-foreground", children: [
|
|
2511
|
+
/* @__PURE__ */ t(ke, { size: 12 }),
|
|
2512
|
+
/* @__PURE__ */ t("span", { className: "text-xs", children: "Press Enter to flip" })
|
|
2513
|
+
] })
|
|
2514
|
+
]
|
|
2515
|
+
}
|
|
2516
|
+
),
|
|
2517
|
+
/* @__PURE__ */ u(
|
|
2518
|
+
"div",
|
|
2519
|
+
{
|
|
2520
|
+
className: h(
|
|
2521
|
+
"absolute inset-0 flex flex-col rounded-lg border border-border bg-background backface-hidden transform-[rotateY(180deg)]",
|
|
2522
|
+
!a && "cursor-pointer",
|
|
2523
|
+
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
|
2524
|
+
),
|
|
2525
|
+
onClick: p,
|
|
2526
|
+
onKeyDown: a ? void 0 : m,
|
|
2527
|
+
role: "button",
|
|
2528
|
+
tabIndex: a ? -1 : 0,
|
|
2529
|
+
"aria-label": "Flashcard answer — press Enter to flip back",
|
|
2530
|
+
children: [
|
|
2531
|
+
/* @__PURE__ */ t("div", { className: h("h-1.5 rounded-t-lg", d.accent) }),
|
|
2532
|
+
/* @__PURE__ */ t("div", { className: "flex flex-1 items-start justify-center p-5 overflow-auto", children: /* @__PURE__ */ t(
|
|
2533
|
+
"div",
|
|
2534
|
+
{
|
|
2535
|
+
className: "text-left w-full flashcard-back-content",
|
|
2536
|
+
style: { fontSize: f },
|
|
2537
|
+
dangerouslySetInnerHTML: { __html: r.back }
|
|
2538
|
+
}
|
|
2539
|
+
) }),
|
|
2540
|
+
!a && /* @__PURE__ */ u("div", { className: "flex items-center justify-center gap-1 pb-3 text-muted-foreground", children: [
|
|
2541
|
+
/* @__PURE__ */ t(ke, { size: 12 }),
|
|
2542
|
+
/* @__PURE__ */ t("span", { className: "text-xs", children: "Press Enter to flip back" })
|
|
2543
|
+
] })
|
|
2544
|
+
]
|
|
2545
|
+
}
|
|
2546
|
+
)
|
|
2547
|
+
]
|
|
2548
|
+
}
|
|
2549
|
+
)
|
|
2550
|
+
]
|
|
2551
|
+
}
|
|
2552
|
+
);
|
|
2553
|
+
};
|
|
2554
|
+
function Yr(r) {
|
|
2555
|
+
const e = [...r];
|
|
2556
|
+
for (let n = e.length - 1; n > 0; n--) {
|
|
2557
|
+
const a = Math.floor(Math.random() * (n + 1));
|
|
2558
|
+
[e[n], e[a]] = [e[a], e[n]];
|
|
2559
|
+
}
|
|
2560
|
+
return e;
|
|
2561
|
+
}
|
|
2562
|
+
const Zr = ({
|
|
2563
|
+
cards: r,
|
|
2564
|
+
deckName: e,
|
|
2565
|
+
deckDescription: n,
|
|
2566
|
+
currentIndex: a,
|
|
2567
|
+
onNavigate: s,
|
|
2568
|
+
onComplete: o,
|
|
2569
|
+
readOnly: i = !1,
|
|
2570
|
+
showProgress: l = !0,
|
|
2571
|
+
shuffled: c = !1
|
|
2572
|
+
}) => {
|
|
2573
|
+
const p = D(
|
|
2574
|
+
() => c ? Yr(r) : r,
|
|
2575
|
+
[r, c]
|
|
2576
|
+
), [g, x] = T(0), [f, d] = T(!1), m = a !== void 0, b = m ? a : g, y = p[b], C = b > 0, S = b < p.length - 1, k = (v) => {
|
|
2577
|
+
d(!1), m ? s == null || s(v) : x(v);
|
|
2578
|
+
}, _ = () => {
|
|
2579
|
+
C && k(b - 1);
|
|
2580
|
+
}, $ = () => {
|
|
2581
|
+
S ? k(b + 1) : o == null || o();
|
|
2582
|
+
};
|
|
2583
|
+
if (!p.length)
|
|
2584
|
+
return /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: "No flashcards in this deck." });
|
|
2585
|
+
const N = (b + 1) / p.length * 100;
|
|
2586
|
+
return /* @__PURE__ */ u("div", { className: "flex flex-col items-center gap-4", children: [
|
|
2587
|
+
(e || n) && /* @__PURE__ */ u("div", { className: "flex flex-col gap-0.5 text-center", children: [
|
|
2588
|
+
e && /* @__PURE__ */ t("span", { className: "text-lg font-semibold", children: e }),
|
|
2589
|
+
n && /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: n })
|
|
2590
|
+
] }),
|
|
2591
|
+
y && /* @__PURE__ */ t(
|
|
2592
|
+
Gr,
|
|
2593
|
+
{
|
|
2594
|
+
card: y,
|
|
2595
|
+
isFlipped: f,
|
|
2596
|
+
onFlip: () => d((v) => !v),
|
|
2597
|
+
readOnly: i
|
|
2598
|
+
}
|
|
2599
|
+
),
|
|
2600
|
+
l && /* @__PURE__ */ u("div", { className: "flex w-full items-center gap-2", children: [
|
|
2601
|
+
/* @__PURE__ */ t("div", { className: "flex-1 h-1.5 rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ t(
|
|
2602
|
+
"div",
|
|
2603
|
+
{
|
|
2604
|
+
className: "h-full rounded-full bg-primary transition-[width] duration-300",
|
|
2605
|
+
style: { width: `${N}%` }
|
|
2606
|
+
}
|
|
2607
|
+
) }),
|
|
2608
|
+
/* @__PURE__ */ u("span", { className: "text-xs text-muted-foreground whitespace-nowrap", children: [
|
|
2609
|
+
b + 1,
|
|
2610
|
+
" of ",
|
|
2611
|
+
p.length
|
|
2612
|
+
] })
|
|
2613
|
+
] }),
|
|
2614
|
+
/* @__PURE__ */ u("div", { className: "flex w-full items-center justify-between gap-3", children: [
|
|
2615
|
+
/* @__PURE__ */ u(
|
|
2616
|
+
R,
|
|
2617
|
+
{
|
|
2618
|
+
variant: "outline",
|
|
2619
|
+
size: "sm",
|
|
2620
|
+
className: "rounded-lg",
|
|
2621
|
+
disabled: !C,
|
|
2622
|
+
onClick: _,
|
|
2623
|
+
children: [
|
|
2624
|
+
/* @__PURE__ */ t(ge, { size: 16 }),
|
|
2625
|
+
" Previous"
|
|
2626
|
+
]
|
|
2627
|
+
}
|
|
2628
|
+
),
|
|
2629
|
+
/* @__PURE__ */ u(
|
|
2630
|
+
R,
|
|
2631
|
+
{
|
|
2632
|
+
size: "sm",
|
|
2633
|
+
className: "rounded-lg",
|
|
2634
|
+
onClick: $,
|
|
2635
|
+
children: [
|
|
2636
|
+
S ? "Next" : "Finish",
|
|
2637
|
+
" ",
|
|
2638
|
+
/* @__PURE__ */ t(se, { size: 16 })
|
|
2639
|
+
]
|
|
2640
|
+
}
|
|
2641
|
+
)
|
|
2642
|
+
] })
|
|
2643
|
+
] });
|
|
2644
|
+
}, le = [0.5, 0.75, 1, 1.25, 1.5, 2], Jr = L(function({
|
|
2645
|
+
src: e,
|
|
2646
|
+
title: n,
|
|
2647
|
+
onEnded: a,
|
|
2648
|
+
onTimeUpdate: s,
|
|
2649
|
+
className: o,
|
|
2650
|
+
style: i
|
|
2651
|
+
}) {
|
|
2652
|
+
const l = I(null), [c, p] = T(!1), [g, x] = T(!1), [f, d] = T(0), [m, b] = T(0), [y, C] = T(1), S = I(-1), k = I(s);
|
|
2653
|
+
k.current = s;
|
|
2654
|
+
const _ = E(() => {
|
|
2655
|
+
const z = l.current;
|
|
2656
|
+
z && (z.paused ? z.play() : z.pause());
|
|
2657
|
+
}, []), $ = E(() => {
|
|
2658
|
+
const z = l.current;
|
|
2659
|
+
z && (z.muted = !z.muted, x((P) => !P));
|
|
2660
|
+
}, []), N = E(() => {
|
|
2661
|
+
const z = l.current;
|
|
2662
|
+
z && C((P) => {
|
|
2663
|
+
const A = le.indexOf(P), we = le[(A + 1) % le.length];
|
|
2664
|
+
return z.playbackRate = we, we;
|
|
2665
|
+
});
|
|
2666
|
+
}, []), v = E(
|
|
2667
|
+
(z) => {
|
|
2668
|
+
const P = l.current;
|
|
2669
|
+
if (!P) return;
|
|
2670
|
+
const A = Number(z.target.value);
|
|
2671
|
+
P.currentTime = A, S.current = Math.floor(A * 4) / 4, d(A);
|
|
2672
|
+
},
|
|
2673
|
+
[]
|
|
2674
|
+
), w = E(() => {
|
|
2675
|
+
var A;
|
|
2676
|
+
const z = l.current;
|
|
2677
|
+
if (!z) return;
|
|
2678
|
+
const P = Math.floor(z.currentTime * 4) / 4;
|
|
2679
|
+
P !== S.current && (S.current = P, d(z.currentTime), (A = k.current) == null || A.call(k, z.currentTime, z.duration));
|
|
2680
|
+
}, []), M = E(() => {
|
|
2681
|
+
const z = l.current;
|
|
2682
|
+
z && !isNaN(z.duration) && b(z.duration);
|
|
2683
|
+
}, []), V = m > 0 ? f / m * 100 : 0;
|
|
2684
|
+
return /* @__PURE__ */ u(
|
|
2685
|
+
"div",
|
|
2686
|
+
{
|
|
2687
|
+
"data-slot": "audio-player",
|
|
2688
|
+
className: h("rounded-lg border bg-card p-4 space-y-3", o),
|
|
2689
|
+
style: i,
|
|
2690
|
+
children: [
|
|
2691
|
+
n && /* @__PURE__ */ t("p", { className: "text-sm font-medium text-foreground", children: n }),
|
|
2692
|
+
/* @__PURE__ */ t(
|
|
2693
|
+
"audio",
|
|
2694
|
+
{
|
|
2695
|
+
ref: l,
|
|
2696
|
+
src: e,
|
|
2697
|
+
onPlay: () => p(!0),
|
|
2698
|
+
onPause: () => p(!1),
|
|
2699
|
+
onEnded: () => {
|
|
2700
|
+
p(!1), a == null || a();
|
|
2701
|
+
},
|
|
2702
|
+
onTimeUpdate: w,
|
|
2703
|
+
onLoadedMetadata: M,
|
|
2704
|
+
preload: "metadata"
|
|
2705
|
+
}
|
|
2706
|
+
),
|
|
2707
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-3", children: [
|
|
2708
|
+
/* @__PURE__ */ t(
|
|
2709
|
+
R,
|
|
2710
|
+
{
|
|
2711
|
+
variant: "ghost",
|
|
2712
|
+
size: "icon-sm",
|
|
2713
|
+
onClick: _,
|
|
2714
|
+
"aria-label": c ? "Pause" : "Play",
|
|
2715
|
+
children: c ? /* @__PURE__ */ t(ht, { className: "size-4" }) : /* @__PURE__ */ t(ue, { className: "size-4" })
|
|
2716
|
+
}
|
|
2717
|
+
),
|
|
2718
|
+
/* @__PURE__ */ t("span", { className: "text-xs tabular-nums text-muted-foreground w-12 shrink-0", children: ne(Math.floor(f)) }),
|
|
2719
|
+
/* @__PURE__ */ u("div", { className: "relative flex-1 h-5 flex items-center", children: [
|
|
2720
|
+
/* @__PURE__ */ t("div", { className: "absolute inset-y-0 left-0 flex items-center w-full", children: /* @__PURE__ */ t("div", { className: "w-full h-1 rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ t(
|
|
2721
|
+
"div",
|
|
2722
|
+
{
|
|
2723
|
+
className: "h-full bg-primary rounded-full transition-[width] duration-100",
|
|
2724
|
+
style: { width: `${V}%` }
|
|
2725
|
+
}
|
|
2726
|
+
) }) }),
|
|
2727
|
+
/* @__PURE__ */ t(
|
|
2728
|
+
"input",
|
|
2729
|
+
{
|
|
2730
|
+
type: "range",
|
|
2731
|
+
min: 0,
|
|
2732
|
+
max: m || 0,
|
|
2733
|
+
step: 0.1,
|
|
2734
|
+
value: f,
|
|
2735
|
+
onChange: v,
|
|
2736
|
+
className: "absolute inset-0 w-full opacity-0 cursor-pointer",
|
|
2737
|
+
"aria-label": "Seek"
|
|
2738
|
+
}
|
|
2739
|
+
)
|
|
2740
|
+
] }),
|
|
2741
|
+
/* @__PURE__ */ t("span", { className: "text-xs tabular-nums text-muted-foreground w-12 shrink-0 text-right", children: ne(Math.floor(m)) }),
|
|
2742
|
+
/* @__PURE__ */ t(
|
|
2743
|
+
R,
|
|
2744
|
+
{
|
|
2745
|
+
variant: "ghost",
|
|
2746
|
+
size: "icon-xs",
|
|
2747
|
+
onClick: $,
|
|
2748
|
+
"aria-label": g ? "Unmute" : "Mute",
|
|
2749
|
+
children: g ? /* @__PURE__ */ t(xt, { className: "size-3.5" }) : /* @__PURE__ */ t(bt, { className: "size-3.5" })
|
|
2750
|
+
}
|
|
2751
|
+
),
|
|
2752
|
+
/* @__PURE__ */ u(
|
|
2753
|
+
"button",
|
|
2754
|
+
{
|
|
2755
|
+
type: "button",
|
|
2756
|
+
onClick: N,
|
|
2757
|
+
className: "text-xs font-medium text-muted-foreground hover:text-foreground transition-colors tabular-nums w-8 text-center",
|
|
2758
|
+
"aria-label": `Playback speed ${y}x`,
|
|
2759
|
+
children: [
|
|
2760
|
+
y,
|
|
2761
|
+
"x"
|
|
2762
|
+
]
|
|
2763
|
+
}
|
|
2764
|
+
)
|
|
2765
|
+
] })
|
|
2766
|
+
]
|
|
2767
|
+
}
|
|
2768
|
+
);
|
|
2769
|
+
}), Xr = L(function({
|
|
2770
|
+
code: e,
|
|
2771
|
+
language: n,
|
|
2772
|
+
filename: a,
|
|
2773
|
+
showLineNumbers: s = !1,
|
|
2774
|
+
onCopy: o,
|
|
2775
|
+
className: i,
|
|
2776
|
+
style: l
|
|
2777
|
+
}) {
|
|
2778
|
+
const [c, p] = T(!1), g = !!(a || n), x = I(void 0);
|
|
2779
|
+
H(() => () => clearTimeout(x.current), []);
|
|
2780
|
+
const f = E(async () => {
|
|
2781
|
+
try {
|
|
2782
|
+
await navigator.clipboard.writeText(e), p(!0), o == null || o(), clearTimeout(x.current), x.current = setTimeout(() => p(!1), 2e3);
|
|
2783
|
+
} catch {
|
|
2784
|
+
}
|
|
2785
|
+
}, [e, o]), d = e.split(`
|
|
2786
|
+
`), m = /* @__PURE__ */ t(
|
|
2787
|
+
R,
|
|
2788
|
+
{
|
|
2789
|
+
variant: "ghost",
|
|
2790
|
+
size: "icon-xs",
|
|
2791
|
+
onClick: f,
|
|
2792
|
+
"aria-label": c ? "Copied" : "Copy code",
|
|
2793
|
+
children: c ? /* @__PURE__ */ t($e, { className: "size-3" }) : /* @__PURE__ */ t(yt, { className: "size-3" })
|
|
2794
|
+
}
|
|
2795
|
+
);
|
|
2796
|
+
return /* @__PURE__ */ u(
|
|
2797
|
+
"div",
|
|
2798
|
+
{
|
|
2799
|
+
"data-slot": "code-block",
|
|
2800
|
+
className: h(
|
|
2801
|
+
"relative rounded-lg border bg-card overflow-hidden text-sm",
|
|
2802
|
+
i
|
|
2803
|
+
),
|
|
2804
|
+
style: l,
|
|
2805
|
+
children: [
|
|
2806
|
+
g ? /* @__PURE__ */ u("div", { className: "flex items-center justify-between px-4 py-2 border-b bg-muted/50", children: [
|
|
2807
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
2808
|
+
/* @__PURE__ */ t(vt, { className: "size-3.5" }),
|
|
2809
|
+
/* @__PURE__ */ t("span", { children: a ?? n })
|
|
2810
|
+
] }),
|
|
2811
|
+
m
|
|
2812
|
+
] }) : /* @__PURE__ */ t("div", { className: "absolute top-2 right-2 z-10", children: m }),
|
|
2813
|
+
/* @__PURE__ */ t("div", { className: "overflow-x-auto", children: /* @__PURE__ */ t("pre", { className: "p-4 m-0", children: /* @__PURE__ */ t("code", { className: n ? `language-${n}` : void 0, children: s ? d.map((b, y) => /* @__PURE__ */ u("div", { className: "flex", children: [
|
|
2814
|
+
/* @__PURE__ */ t("span", { className: "select-none text-muted-foreground/50 w-8 shrink-0 text-right pr-4 tabular-nums", children: y + 1 }),
|
|
2815
|
+
/* @__PURE__ */ t("span", { children: b })
|
|
2816
|
+
] }, y)) : e }) }) })
|
|
2817
|
+
]
|
|
2818
|
+
}
|
|
2819
|
+
);
|
|
2820
|
+
});
|
|
2821
|
+
function qr({ className: r, ...e }) {
|
|
2822
|
+
return /* @__PURE__ */ t(
|
|
2823
|
+
"div",
|
|
2824
|
+
{
|
|
2825
|
+
"data-slot": "skeleton",
|
|
2826
|
+
className: h("bg-muted animate-pulse rounded-md", r),
|
|
2827
|
+
...e
|
|
2828
|
+
}
|
|
2829
|
+
);
|
|
2830
|
+
}
|
|
2831
|
+
const en = {
|
|
2832
|
+
"16/9": "aspect-video",
|
|
2833
|
+
"4/3": "aspect-[4/3]",
|
|
2834
|
+
"1/1": "aspect-square"
|
|
2835
|
+
}, tn = L(function({
|
|
2836
|
+
src: e,
|
|
2837
|
+
title: n,
|
|
2838
|
+
aspectRatio: a = "16/9",
|
|
2839
|
+
allowFullscreen: s = !0,
|
|
2840
|
+
className: o,
|
|
2841
|
+
style: i
|
|
2842
|
+
}) {
|
|
2843
|
+
const [l, c] = T(!1);
|
|
2844
|
+
return /* @__PURE__ */ u(
|
|
2845
|
+
"div",
|
|
2846
|
+
{
|
|
2847
|
+
"data-slot": "embed-block",
|
|
2848
|
+
className: h("rounded-lg border bg-card overflow-hidden", o),
|
|
2849
|
+
style: i,
|
|
2850
|
+
children: [
|
|
2851
|
+
n && /* @__PURE__ */ t("div", { className: "flex items-center justify-between px-4 py-2 border-b bg-muted/50", children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
2852
|
+
/* @__PURE__ */ t(fe, { className: "size-3.5" }),
|
|
2853
|
+
/* @__PURE__ */ t("span", { children: n })
|
|
2854
|
+
] }) }),
|
|
2855
|
+
/* @__PURE__ */ u("div", { className: h("relative w-full", en[a]), children: [
|
|
2856
|
+
!l && /* @__PURE__ */ t(qr, { className: "absolute inset-0 rounded-none" }),
|
|
2857
|
+
/* @__PURE__ */ t(
|
|
2858
|
+
"iframe",
|
|
2859
|
+
{
|
|
2860
|
+
src: e,
|
|
2861
|
+
title: n ?? "Embedded content",
|
|
2862
|
+
allowFullScreen: s,
|
|
2863
|
+
onLoad: () => c(!0),
|
|
2864
|
+
className: "absolute inset-0 w-full h-full border-0",
|
|
2865
|
+
sandbox: "allow-scripts allow-same-origin allow-popups allow-presentation"
|
|
2866
|
+
}
|
|
2867
|
+
)
|
|
2868
|
+
] })
|
|
2869
|
+
]
|
|
2870
|
+
}
|
|
2871
|
+
);
|
|
2872
|
+
});
|
|
2873
|
+
function Ze(r) {
|
|
2874
|
+
return r < 1024 ? `${r} B` : r < 1024 * 1024 ? `${(r / 1024).toFixed(1)} KB` : `${(r / (1024 * 1024)).toFixed(1)} MB`;
|
|
2875
|
+
}
|
|
2876
|
+
function rn(r) {
|
|
2877
|
+
return r.startsWith("image/") ? Re : r.startsWith("video/") ? wt : r.startsWith("audio/") ? He : r === "application/pdf" ? Y : r === "application/zip" || r === "application/x-rar-compressed" || r === "application/gzip" ? kt : Ue;
|
|
2878
|
+
}
|
|
2879
|
+
function nn({
|
|
2880
|
+
files: r,
|
|
2881
|
+
onDownload: e,
|
|
2882
|
+
onRemove: n,
|
|
2883
|
+
readOnly: a = !0,
|
|
2884
|
+
className: s,
|
|
2885
|
+
style: o
|
|
2886
|
+
}) {
|
|
2887
|
+
return r.length === 0 ? null : /* @__PURE__ */ t("div", { className: h("flex flex-col gap-1", s), style: o, children: r.map((i, l) => {
|
|
2888
|
+
const c = rn(i.type);
|
|
2889
|
+
return /* @__PURE__ */ u(
|
|
2890
|
+
"div",
|
|
2891
|
+
{
|
|
2892
|
+
className: "flex items-center gap-3 rounded-md px-2 py-1.5 hover:bg-muted/50 transition-colors",
|
|
2893
|
+
children: [
|
|
2894
|
+
/* @__PURE__ */ t("span", { className: "shrink-0 text-muted-foreground", children: /* @__PURE__ */ t(c, { size: 18 }) }),
|
|
2895
|
+
/* @__PURE__ */ u("div", { className: "flex-1 min-w-0", children: [
|
|
2896
|
+
/* @__PURE__ */ t("span", { className: "text-sm text-foreground block truncate", children: i.name }),
|
|
2897
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: Ze(i.size) })
|
|
2898
|
+
] }),
|
|
2899
|
+
e && i.url && /* @__PURE__ */ t(
|
|
2900
|
+
R,
|
|
2901
|
+
{
|
|
2902
|
+
variant: "ghost",
|
|
2903
|
+
size: "sm",
|
|
2904
|
+
className: "shrink-0 h-7 w-7 p-0",
|
|
2905
|
+
onClick: () => e(i),
|
|
2906
|
+
"aria-label": `Download ${i.name}`,
|
|
2907
|
+
children: /* @__PURE__ */ t(Nt, { size: 14 })
|
|
2908
|
+
}
|
|
2909
|
+
),
|
|
2910
|
+
!a && n && /* @__PURE__ */ t(
|
|
2911
|
+
R,
|
|
2912
|
+
{
|
|
2913
|
+
variant: "ghost",
|
|
2914
|
+
size: "sm",
|
|
2915
|
+
className: "shrink-0 h-7 w-7 p-0 text-muted-foreground hover:text-destructive",
|
|
2916
|
+
onClick: () => n(i),
|
|
2917
|
+
"aria-label": `Remove ${i.name}`,
|
|
2918
|
+
children: /* @__PURE__ */ t(oe, { size: 14 })
|
|
2919
|
+
}
|
|
2920
|
+
)
|
|
2921
|
+
]
|
|
2922
|
+
},
|
|
2923
|
+
`${i.name}-${l}`
|
|
2924
|
+
);
|
|
2925
|
+
}) });
|
|
2926
|
+
}
|
|
2927
|
+
const an = {
|
|
2928
|
+
info: { variant: "info", Icon: _t },
|
|
2929
|
+
warning: { variant: "warning", Icon: St },
|
|
2930
|
+
tip: { variant: "success", Icon: Ct }
|
|
2931
|
+
}, sn = L(function({
|
|
2932
|
+
block: e,
|
|
2933
|
+
onQuestionAnswer: n,
|
|
2934
|
+
readOnly: a = !1,
|
|
2935
|
+
className: s,
|
|
2936
|
+
style: o
|
|
2937
|
+
}) {
|
|
2938
|
+
const i = (l) => /* @__PURE__ */ t("div", { className: h(s), style: o, children: l });
|
|
2939
|
+
switch (e.type) {
|
|
2940
|
+
case "video":
|
|
2941
|
+
return i(/* @__PURE__ */ t(Or, { ...e.video, readOnly: a }));
|
|
2942
|
+
case "richtext":
|
|
2943
|
+
return i(
|
|
2944
|
+
/* @__PURE__ */ t(
|
|
2945
|
+
"div",
|
|
2946
|
+
{
|
|
2947
|
+
className: "[&_p]:mb-[1.5em] [&_ul]:pl-[1.5em] [&_ol]:pl-[1.5em]",
|
|
2948
|
+
dangerouslySetInnerHTML: { __html: e.html }
|
|
2949
|
+
}
|
|
2950
|
+
)
|
|
2951
|
+
);
|
|
2952
|
+
case "heading": {
|
|
2953
|
+
const l = e.level === 1 ? "h2" : e.level === 3 ? "h4" : "h3", c = e.level === 1 ? "text-xl" : e.level === 3 ? "text-base" : "text-lg";
|
|
2954
|
+
return i(
|
|
2955
|
+
/* @__PURE__ */ t(l, { className: h(c, "font-semibold m-0"), children: e.text })
|
|
2956
|
+
);
|
|
2957
|
+
}
|
|
2958
|
+
case "image":
|
|
2959
|
+
return i(
|
|
2960
|
+
/* @__PURE__ */ u("figure", { className: "m-0", children: [
|
|
2961
|
+
/* @__PURE__ */ t(
|
|
2962
|
+
"img",
|
|
2963
|
+
{
|
|
2964
|
+
src: e.src,
|
|
2965
|
+
alt: e.alt ?? "",
|
|
2966
|
+
loading: "lazy",
|
|
2967
|
+
className: "max-w-full rounded-sm"
|
|
2968
|
+
}
|
|
2969
|
+
),
|
|
2970
|
+
e.caption && /* @__PURE__ */ t("figcaption", { className: "text-xs text-muted-foreground mt-0.5", children: e.caption })
|
|
2971
|
+
] })
|
|
2972
|
+
);
|
|
2973
|
+
case "callout": {
|
|
2974
|
+
const l = an[e.variant ?? "info"];
|
|
2975
|
+
return i(
|
|
2976
|
+
/* @__PURE__ */ u(U, { variant: l.variant, children: [
|
|
2977
|
+
/* @__PURE__ */ t(l.Icon, { size: 20 }),
|
|
2978
|
+
/* @__PURE__ */ t(j, { children: e.content })
|
|
2979
|
+
] })
|
|
2980
|
+
);
|
|
2981
|
+
}
|
|
2982
|
+
case "question":
|
|
2983
|
+
return i(
|
|
2984
|
+
/* @__PURE__ */ t(
|
|
2985
|
+
Ve,
|
|
2986
|
+
{
|
|
2987
|
+
question: e.question,
|
|
2988
|
+
onAnswer: (l) => n == null ? void 0 : n(
|
|
2989
|
+
e.question.uid,
|
|
2990
|
+
l.map((c) => ({
|
|
2991
|
+
uid: e.question.uid,
|
|
2992
|
+
answerUid: c.uid,
|
|
2993
|
+
content: c.content
|
|
2994
|
+
}))
|
|
2995
|
+
),
|
|
2996
|
+
readOnly: a
|
|
2997
|
+
}
|
|
2998
|
+
)
|
|
2999
|
+
);
|
|
3000
|
+
case "flashcards":
|
|
3001
|
+
return i(
|
|
3002
|
+
/* @__PURE__ */ t(
|
|
3003
|
+
Zr,
|
|
3004
|
+
{
|
|
3005
|
+
cards: e.cards,
|
|
3006
|
+
deckName: e.deckName,
|
|
3007
|
+
readOnly: a
|
|
3008
|
+
}
|
|
3009
|
+
)
|
|
3010
|
+
);
|
|
3011
|
+
case "audio":
|
|
3012
|
+
return i(
|
|
3013
|
+
/* @__PURE__ */ t(Jr, { src: e.src, title: e.title })
|
|
3014
|
+
);
|
|
3015
|
+
case "code":
|
|
3016
|
+
return i(
|
|
3017
|
+
/* @__PURE__ */ t(
|
|
3018
|
+
Xr,
|
|
3019
|
+
{
|
|
3020
|
+
code: e.code,
|
|
3021
|
+
language: e.language,
|
|
3022
|
+
filename: e.filename,
|
|
3023
|
+
showLineNumbers: e.showLineNumbers
|
|
3024
|
+
}
|
|
3025
|
+
)
|
|
3026
|
+
);
|
|
3027
|
+
case "embed":
|
|
3028
|
+
return i(
|
|
3029
|
+
/* @__PURE__ */ t(
|
|
3030
|
+
tn,
|
|
3031
|
+
{
|
|
3032
|
+
src: e.src,
|
|
3033
|
+
title: e.title,
|
|
3034
|
+
aspectRatio: e.aspectRatio,
|
|
3035
|
+
allowFullscreen: e.allowFullscreen
|
|
3036
|
+
}
|
|
3037
|
+
)
|
|
3038
|
+
);
|
|
3039
|
+
case "table":
|
|
3040
|
+
return i(
|
|
3041
|
+
/* @__PURE__ */ u(Be, { children: [
|
|
3042
|
+
e.caption && /* @__PURE__ */ t(br, { children: e.caption }),
|
|
3043
|
+
/* @__PURE__ */ t(Ae, { children: /* @__PURE__ */ t(re, { children: e.headers.map((l, c) => /* @__PURE__ */ t(me, { children: l }, c)) }) }),
|
|
3044
|
+
/* @__PURE__ */ t(Fe, { children: e.rows.map((l, c) => /* @__PURE__ */ t(re, { children: l.map((p, g) => /* @__PURE__ */ t(q, { children: p }, g)) }, c)) })
|
|
3045
|
+
] })
|
|
3046
|
+
);
|
|
3047
|
+
case "file":
|
|
3048
|
+
return i(/* @__PURE__ */ t(nn, { files: e.files, readOnly: !0 }));
|
|
3049
|
+
case "divider":
|
|
3050
|
+
return i(/* @__PURE__ */ t(K, {}));
|
|
3051
|
+
case "custom":
|
|
3052
|
+
return i(/* @__PURE__ */ t(ae, { children: e.render }));
|
|
3053
|
+
default:
|
|
3054
|
+
return null;
|
|
3055
|
+
}
|
|
3056
|
+
});
|
|
3057
|
+
function wa({
|
|
3058
|
+
files: r,
|
|
3059
|
+
onFilesAdded: e,
|
|
3060
|
+
onFileRemove: n,
|
|
3061
|
+
accept: a,
|
|
3062
|
+
maxFiles: s,
|
|
3063
|
+
maxSizeMB: o,
|
|
3064
|
+
disabled: i = !1,
|
|
3065
|
+
label: l = "Drag files here or click to browse"
|
|
3066
|
+
}) {
|
|
3067
|
+
const c = I(null), [p, g] = T(!1), x = s != null && r.length >= s;
|
|
3068
|
+
function f(d) {
|
|
3069
|
+
if (!d) return;
|
|
3070
|
+
let m = Array.from(d);
|
|
3071
|
+
o && (m = m.filter((b) => b.size <= o * 1024 * 1024)), s && (m = m.slice(0, s - r.length)), m.length > 0 && e(m);
|
|
3072
|
+
}
|
|
3073
|
+
return /* @__PURE__ */ u("div", { children: [
|
|
3074
|
+
/* @__PURE__ */ u(
|
|
3075
|
+
"div",
|
|
3076
|
+
{
|
|
3077
|
+
className: h(
|
|
3078
|
+
"border-2 border-dashed border-border rounded-md p-8 text-center cursor-pointer transition-all duration-200",
|
|
3079
|
+
p && "border-primary bg-muted",
|
|
3080
|
+
i && "cursor-default opacity-50",
|
|
3081
|
+
x && "cursor-default",
|
|
3082
|
+
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
|
3083
|
+
),
|
|
3084
|
+
role: "button",
|
|
3085
|
+
tabIndex: i || x ? -1 : 0,
|
|
3086
|
+
"aria-label": x ? `Maximum ${s} files reached` : l,
|
|
3087
|
+
onKeyDown: (d) => {
|
|
3088
|
+
var m;
|
|
3089
|
+
(d.key === "Enter" || d.key === " ") && !i && !x && (d.preventDefault(), (m = c.current) == null || m.click());
|
|
3090
|
+
},
|
|
3091
|
+
onDragOver: (d) => {
|
|
3092
|
+
d.preventDefault(), !i && !x && g(!0);
|
|
3093
|
+
},
|
|
3094
|
+
onDragLeave: () => g(!1),
|
|
3095
|
+
onDrop: (d) => {
|
|
3096
|
+
d.preventDefault(), g(!1), !i && !x && f(d.dataTransfer.files);
|
|
3097
|
+
},
|
|
3098
|
+
onClick: () => {
|
|
3099
|
+
var d;
|
|
3100
|
+
return !i && !x && ((d = c.current) == null ? void 0 : d.click());
|
|
3101
|
+
},
|
|
3102
|
+
children: [
|
|
3103
|
+
/* @__PURE__ */ t(Tt, { size: 32, className: "mx-auto mb-2 opacity-50" }),
|
|
3104
|
+
/* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: x ? `Maximum ${s} files reached` : l }),
|
|
3105
|
+
(a || o) && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground mt-1 block", children: [a && `Accepted: ${a}`, o && `Max: ${o}MB`].filter(Boolean).join(" · ") })
|
|
3106
|
+
]
|
|
3107
|
+
}
|
|
3108
|
+
),
|
|
3109
|
+
/* @__PURE__ */ t(
|
|
3110
|
+
"input",
|
|
3111
|
+
{
|
|
3112
|
+
ref: c,
|
|
3113
|
+
type: "file",
|
|
3114
|
+
accept: a,
|
|
3115
|
+
multiple: !s || s > 1,
|
|
3116
|
+
hidden: !0,
|
|
3117
|
+
onChange: (d) => {
|
|
3118
|
+
f(d.target.files), d.target.value = "";
|
|
3119
|
+
}
|
|
3120
|
+
}
|
|
3121
|
+
),
|
|
3122
|
+
r.length > 0 && /* @__PURE__ */ t("div", { className: "flex flex-col gap-1 mt-2", children: r.map((d, m) => /* @__PURE__ */ u("div", { className: "flex items-center gap-3 py-1", children: [
|
|
3123
|
+
/* @__PURE__ */ t("div", { className: "shrink-0 w-9 flex justify-center text-muted-foreground", children: /* @__PURE__ */ t(Ue, { size: 18 }) }),
|
|
3124
|
+
/* @__PURE__ */ u("div", { className: "flex-1 min-w-0", children: [
|
|
3125
|
+
/* @__PURE__ */ t("span", { className: "text-sm block truncate", children: d.name }),
|
|
3126
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: Ze(d.size) })
|
|
3127
|
+
] }),
|
|
3128
|
+
/* @__PURE__ */ t(
|
|
3129
|
+
R,
|
|
3130
|
+
{
|
|
3131
|
+
variant: "ghost",
|
|
3132
|
+
size: "icon-xs",
|
|
3133
|
+
"aria-label": "Remove file",
|
|
3134
|
+
onClick: () => n(m),
|
|
3135
|
+
disabled: i,
|
|
3136
|
+
children: /* @__PURE__ */ t(oe, { size: 16 })
|
|
3137
|
+
}
|
|
3138
|
+
)
|
|
3139
|
+
] }, `${d.name}-${m}`)) })
|
|
3140
|
+
] });
|
|
3141
|
+
}
|
|
3142
|
+
const ka = ({
|
|
3143
|
+
open: r,
|
|
3144
|
+
onOpenChange: e,
|
|
3145
|
+
materials: n,
|
|
3146
|
+
questionNumber: a
|
|
3147
|
+
}) => {
|
|
3148
|
+
if (!n.length) return null;
|
|
3149
|
+
const s = a ? `Question ${a} — Related Material` : "Related Material";
|
|
3150
|
+
return /* @__PURE__ */ t(Hr, { open: r, onOpenChange: e, side: "right", children: /* @__PURE__ */ u(Pr, { size: "lg", scrollLock: !1, children: [
|
|
3151
|
+
/* @__PURE__ */ u(Br, { className: "flex-row items-center justify-between", children: [
|
|
3152
|
+
/* @__PURE__ */ t(Fr, { children: s }),
|
|
3153
|
+
/* @__PURE__ */ t(Vr, {})
|
|
3154
|
+
] }),
|
|
3155
|
+
/* @__PURE__ */ t(Ar, { children: /* @__PURE__ */ t("div", { className: "space-y-6", children: n.map((o, i) => /* @__PURE__ */ u("section", { children: [
|
|
3156
|
+
o.label && /* @__PURE__ */ t("h3", { className: "text-sm font-semibold text-foreground mb-3", children: o.label }),
|
|
3157
|
+
/* @__PURE__ */ t("div", { className: "space-y-4", children: o.blocks.map((l, c) => /* @__PURE__ */ t(sn, { block: l, readOnly: !0 }, c)) }),
|
|
3158
|
+
i < n.length - 1 && /* @__PURE__ */ t("div", { className: "border-b border-border mt-6" })
|
|
3159
|
+
] }, i)) }) })
|
|
3160
|
+
] }) });
|
|
3161
|
+
}, on = {
|
|
3162
|
+
video: de,
|
|
3163
|
+
video_lesson: de,
|
|
3164
|
+
stream: It,
|
|
3165
|
+
document: Y,
|
|
3166
|
+
pdf: Y,
|
|
3167
|
+
page: Y,
|
|
3168
|
+
quiz: Ce,
|
|
3169
|
+
assessment: Ce,
|
|
3170
|
+
assignment: Dt,
|
|
3171
|
+
discussion: zt,
|
|
3172
|
+
link: fe,
|
|
3173
|
+
url: fe,
|
|
3174
|
+
audio: He,
|
|
3175
|
+
image: Re,
|
|
3176
|
+
scorm: ce,
|
|
3177
|
+
iframe: ce,
|
|
3178
|
+
lesson: te,
|
|
3179
|
+
module: te
|
|
3180
|
+
}, ln = ({
|
|
3181
|
+
type: r,
|
|
3182
|
+
size: e = 18
|
|
3183
|
+
}) => {
|
|
3184
|
+
const n = on[r] ?? Y;
|
|
3185
|
+
return /* @__PURE__ */ t(n, { size: e });
|
|
3186
|
+
}, cn = L(function({
|
|
3187
|
+
item: e,
|
|
3188
|
+
level: n,
|
|
3189
|
+
isActive: a = !1,
|
|
3190
|
+
isCompleted: s = !1,
|
|
3191
|
+
isExpanded: o = !1,
|
|
3192
|
+
hasChildren: i,
|
|
3193
|
+
onToggleExpand: l,
|
|
3194
|
+
onClick: c,
|
|
3195
|
+
showDuration: p = !0,
|
|
3196
|
+
showIcon: g = !0,
|
|
3197
|
+
showProgress: x = !0
|
|
3198
|
+
}) {
|
|
3199
|
+
const f = i, d = f ? "font-semibold" : a ? "font-medium" : "font-normal";
|
|
3200
|
+
return /* @__PURE__ */ u(
|
|
3201
|
+
"div",
|
|
3202
|
+
{
|
|
3203
|
+
className: h(
|
|
3204
|
+
"flex items-center gap-2 py-2 pr-3 transition-colors",
|
|
3205
|
+
c && "cursor-pointer hover:bg-muted",
|
|
3206
|
+
a && "bg-secondary"
|
|
3207
|
+
),
|
|
3208
|
+
style: { paddingLeft: `${n * 20 + 8}px` },
|
|
3209
|
+
onClick: c ? () => c(e) : void 0,
|
|
3210
|
+
role: c ? "button" : void 0,
|
|
3211
|
+
tabIndex: c ? 0 : void 0,
|
|
3212
|
+
onKeyDown: c ? (m) => {
|
|
3213
|
+
(m.key === "Enter" || m.key === " ") && (m.preventDefault(), c(e));
|
|
3214
|
+
} : void 0,
|
|
3215
|
+
children: [
|
|
3216
|
+
/* @__PURE__ */ t("div", { className: "shrink-0 flex items-center justify-center size-5", children: x && s ? /* @__PURE__ */ t("span", { className: "text-success", children: /* @__PURE__ */ t(Mt, { size: 18 }) }) : g ? /* @__PURE__ */ t("span", { className: a ? "text-primary" : "text-muted-foreground", children: /* @__PURE__ */ t(ln, { type: e.type, size: 16 }) }) : /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: /* @__PURE__ */ t(je, { size: 16 }) }) }),
|
|
3217
|
+
/* @__PURE__ */ u("div", { className: "flex-1 min-w-0", children: [
|
|
3218
|
+
/* @__PURE__ */ t(
|
|
3219
|
+
"div",
|
|
3220
|
+
{
|
|
3221
|
+
className: h("text-sm truncate", a ? "text-primary" : "text-foreground", d),
|
|
3222
|
+
children: e.name
|
|
3223
|
+
}
|
|
3224
|
+
),
|
|
3225
|
+
p && e.duration > 0 && !f && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground mt-0.5", children: wr(e.duration) })
|
|
3226
|
+
] }),
|
|
3227
|
+
i && /* @__PURE__ */ t(
|
|
3228
|
+
"button",
|
|
3229
|
+
{
|
|
3230
|
+
className: "inline-flex items-center justify-center rounded-md p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
3231
|
+
"aria-label": o ? "Collapse" : "Expand",
|
|
3232
|
+
onClick: (m) => {
|
|
3233
|
+
m.stopPropagation(), l == null || l(e.uid);
|
|
3234
|
+
},
|
|
3235
|
+
children: o ? /* @__PURE__ */ t(Le, { size: 16 }) : /* @__PURE__ */ t(se, { size: 16 })
|
|
3236
|
+
}
|
|
3237
|
+
)
|
|
3238
|
+
]
|
|
3239
|
+
}
|
|
3240
|
+
);
|
|
3241
|
+
}), Ca = ({
|
|
3242
|
+
items: r,
|
|
3243
|
+
progress: e,
|
|
3244
|
+
activeItemUid: n,
|
|
3245
|
+
onItemClick: a,
|
|
3246
|
+
readOnly: s = !1,
|
|
3247
|
+
showDuration: o = !0,
|
|
3248
|
+
showIcons: i = !0,
|
|
3249
|
+
showProgress: l = !0
|
|
3250
|
+
}) => {
|
|
3251
|
+
const [c, p] = T({}), g = D(() => !e || !l ? /* @__PURE__ */ new Set() : new Set(
|
|
3252
|
+
e.filter((m) => m.isCompleted).map((m) => m.resourceUid)
|
|
3253
|
+
), [e, l]), x = E((m) => {
|
|
3254
|
+
p((b) => ({ ...b, [m]: !b[m] }));
|
|
3255
|
+
}, []), f = E(
|
|
3256
|
+
(m) => {
|
|
3257
|
+
a == null || a(m);
|
|
3258
|
+
},
|
|
3259
|
+
[a]
|
|
3260
|
+
);
|
|
3261
|
+
if (!r || r.length === 0)
|
|
3262
|
+
return null;
|
|
3263
|
+
const d = (m, b) => /* @__PURE__ */ t("div", { className: "flex flex-col", children: m.map((y) => {
|
|
3264
|
+
var k;
|
|
3265
|
+
const C = !!((k = y.children) != null && k.length), S = c[y.uid] || !1;
|
|
3266
|
+
return /* @__PURE__ */ u("div", { children: [
|
|
3267
|
+
/* @__PURE__ */ t(
|
|
3268
|
+
cn,
|
|
3269
|
+
{
|
|
3270
|
+
item: y,
|
|
3271
|
+
level: b,
|
|
3272
|
+
isActive: n === y.uid,
|
|
3273
|
+
isCompleted: g.has(y.uid),
|
|
3274
|
+
isExpanded: S,
|
|
3275
|
+
hasChildren: C,
|
|
3276
|
+
onToggleExpand: x,
|
|
3277
|
+
onClick: s ? void 0 : f,
|
|
3278
|
+
showDuration: o,
|
|
3279
|
+
showIcon: i,
|
|
3280
|
+
showProgress: l
|
|
3281
|
+
}
|
|
3282
|
+
),
|
|
3283
|
+
C && S && d(y.children, b + 1)
|
|
3284
|
+
] }, y.uid);
|
|
3285
|
+
}) });
|
|
3286
|
+
return /* @__PURE__ */ t("nav", { className: "rounded-lg border border-border overflow-hidden", children: d(r, 0) });
|
|
3287
|
+
};
|
|
3288
|
+
function ye({ className: r, ...e }) {
|
|
3289
|
+
return /* @__PURE__ */ t(
|
|
3290
|
+
"div",
|
|
3291
|
+
{
|
|
3292
|
+
"data-slot": "card",
|
|
3293
|
+
className: h(
|
|
3294
|
+
"bg-card text-card-foreground rounded-xl border shadow-sm",
|
|
3295
|
+
r
|
|
3296
|
+
),
|
|
3297
|
+
...e
|
|
3298
|
+
}
|
|
3299
|
+
);
|
|
3300
|
+
}
|
|
3301
|
+
function Sa({ className: r, ...e }) {
|
|
3302
|
+
return /* @__PURE__ */ t(
|
|
3303
|
+
"div",
|
|
3304
|
+
{
|
|
3305
|
+
"data-slot": "card-header",
|
|
3306
|
+
className: h(
|
|
3307
|
+
"flex flex-col gap-1.5 px-6 pt-6 has-data-[slot=card-action]:flex-row has-data-[slot=card-action]:items-center has-data-[slot=card-action]:justify-between",
|
|
3308
|
+
r
|
|
3309
|
+
),
|
|
3310
|
+
...e
|
|
3311
|
+
}
|
|
3312
|
+
);
|
|
3313
|
+
}
|
|
3314
|
+
function _a({ className: r, ...e }) {
|
|
3315
|
+
return /* @__PURE__ */ t(
|
|
3316
|
+
"div",
|
|
3317
|
+
{
|
|
3318
|
+
"data-slot": "card-title",
|
|
3319
|
+
className: h("leading-none font-semibold", r),
|
|
3320
|
+
...e
|
|
3321
|
+
}
|
|
3322
|
+
);
|
|
3323
|
+
}
|
|
3324
|
+
function Ta({ className: r, ...e }) {
|
|
3325
|
+
return /* @__PURE__ */ t(
|
|
3326
|
+
"div",
|
|
3327
|
+
{
|
|
3328
|
+
"data-slot": "card-description",
|
|
3329
|
+
className: h("text-muted-foreground text-sm", r),
|
|
3330
|
+
...e
|
|
3331
|
+
}
|
|
3332
|
+
);
|
|
3333
|
+
}
|
|
3334
|
+
function za({ className: r, ...e }) {
|
|
3335
|
+
return /* @__PURE__ */ t(
|
|
3336
|
+
"div",
|
|
3337
|
+
{
|
|
3338
|
+
"data-slot": "card-action",
|
|
3339
|
+
className: h(
|
|
3340
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
3341
|
+
r
|
|
3342
|
+
),
|
|
3343
|
+
...e
|
|
3344
|
+
}
|
|
3345
|
+
);
|
|
3346
|
+
}
|
|
3347
|
+
function Je({ className: r, ...e }) {
|
|
3348
|
+
return /* @__PURE__ */ t(
|
|
3349
|
+
"div",
|
|
3350
|
+
{
|
|
3351
|
+
"data-slot": "card-content",
|
|
3352
|
+
className: h("px-6 pb-6 pt-0", r),
|
|
3353
|
+
...e
|
|
3354
|
+
}
|
|
3355
|
+
);
|
|
3356
|
+
}
|
|
3357
|
+
function Da({ className: r, ...e }) {
|
|
3358
|
+
return /* @__PURE__ */ t(
|
|
3359
|
+
"div",
|
|
3360
|
+
{
|
|
3361
|
+
"data-slot": "card-footer",
|
|
3362
|
+
className: h("flex items-center px-6 pb-6 pt-0", r),
|
|
3363
|
+
...e
|
|
3364
|
+
}
|
|
3365
|
+
);
|
|
3366
|
+
}
|
|
3367
|
+
const dn = G(
|
|
3368
|
+
"inline-flex items-center justify-center rounded-full border px-2.5 py-0.5 text-xs font-medium whitespace-nowrap transition-colors [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3",
|
|
3369
|
+
{
|
|
3370
|
+
variants: {
|
|
3371
|
+
variant: {
|
|
3372
|
+
default: "border-transparent bg-primary text-primary-foreground",
|
|
3373
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground",
|
|
3374
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground",
|
|
3375
|
+
outline: "text-foreground",
|
|
3376
|
+
success: "border-transparent bg-success/15 text-success",
|
|
3377
|
+
warning: "border-transparent bg-warning/15 text-warning",
|
|
3378
|
+
info: "border-transparent bg-info/15 text-info",
|
|
3379
|
+
muted: "border-transparent bg-muted text-muted-foreground",
|
|
3380
|
+
palette0: "border-transparent bg-palette-0/15 text-palette-0",
|
|
3381
|
+
palette1: "border-transparent bg-palette-1/15 text-palette-1",
|
|
3382
|
+
palette2: "border-transparent bg-palette-2/15 text-palette-2",
|
|
3383
|
+
palette3: "border-transparent bg-palette-3/15 text-palette-3"
|
|
3384
|
+
}
|
|
3385
|
+
},
|
|
3386
|
+
defaultVariants: {
|
|
3387
|
+
variant: "default"
|
|
3388
|
+
}
|
|
3389
|
+
}
|
|
3390
|
+
);
|
|
3391
|
+
function pe({
|
|
3392
|
+
className: r,
|
|
3393
|
+
variant: e,
|
|
3394
|
+
asChild: n = !1,
|
|
3395
|
+
...a
|
|
3396
|
+
}) {
|
|
3397
|
+
return /* @__PURE__ */ t(
|
|
3398
|
+
n ? Ke : "span",
|
|
3399
|
+
{
|
|
3400
|
+
"data-slot": "badge",
|
|
3401
|
+
className: h(dn({ variant: e }), r),
|
|
3402
|
+
...a
|
|
3403
|
+
}
|
|
3404
|
+
);
|
|
3405
|
+
}
|
|
3406
|
+
const un = { small: 28, medium: 36, large: 48 }, Te = {
|
|
3407
|
+
student: "Student",
|
|
3408
|
+
instructor: "Instructor",
|
|
3409
|
+
ta: "Teaching Assistant",
|
|
3410
|
+
admin: "Admin"
|
|
3411
|
+
}, fn = {
|
|
3412
|
+
instructor: "var(--primary)",
|
|
3413
|
+
ta: "var(--palette-0)",
|
|
3414
|
+
admin: "var(--destructive)",
|
|
3415
|
+
student: "var(--muted-foreground)"
|
|
3416
|
+
};
|
|
3417
|
+
function mn(r) {
|
|
3418
|
+
return r.split(" ").filter(Boolean).map((e) => e[0]).slice(0, 2).join("").toUpperCase();
|
|
3419
|
+
}
|
|
3420
|
+
function Xe({
|
|
3421
|
+
displayName: r,
|
|
3422
|
+
avatarUrl: e,
|
|
3423
|
+
role: n,
|
|
3424
|
+
showRoleBadge: a = !1,
|
|
3425
|
+
size: s = "medium",
|
|
3426
|
+
className: o,
|
|
3427
|
+
style: i
|
|
3428
|
+
}) {
|
|
3429
|
+
const l = un[s], c = l * 0.4, [p, g] = T(!1), x = a && n && n !== "student", f = x ? Te[n] ?? n : void 0;
|
|
3430
|
+
return /* @__PURE__ */ u(
|
|
3431
|
+
"div",
|
|
3432
|
+
{
|
|
3433
|
+
className: h("relative inline-flex", o),
|
|
3434
|
+
style: i,
|
|
3435
|
+
title: f,
|
|
3436
|
+
children: [
|
|
3437
|
+
/* @__PURE__ */ t(
|
|
3438
|
+
"div",
|
|
3439
|
+
{
|
|
3440
|
+
className: "flex items-center justify-center rounded-full bg-muted text-muted-foreground overflow-hidden",
|
|
3441
|
+
style: { width: `${l}px`, height: `${l}px`, fontSize: `${c}px` },
|
|
3442
|
+
children: e && !p ? /* @__PURE__ */ t(
|
|
3443
|
+
"img",
|
|
3444
|
+
{
|
|
3445
|
+
className: "size-full object-cover",
|
|
3446
|
+
src: e,
|
|
3447
|
+
alt: r,
|
|
3448
|
+
loading: "lazy",
|
|
3449
|
+
onError: () => g(!0)
|
|
3450
|
+
}
|
|
3451
|
+
) : /* @__PURE__ */ t("span", { children: mn(r) })
|
|
3452
|
+
}
|
|
3453
|
+
),
|
|
3454
|
+
x && /* @__PURE__ */ u(ae, { children: [
|
|
3455
|
+
/* @__PURE__ */ t(
|
|
3456
|
+
"span",
|
|
3457
|
+
{
|
|
3458
|
+
className: "absolute -bottom-0.5 -right-0.5 size-2.5 rounded-full border-2 border-background",
|
|
3459
|
+
style: { background: fn[n] ?? "var(--muted-foreground)" },
|
|
3460
|
+
"aria-hidden": "true"
|
|
3461
|
+
}
|
|
3462
|
+
),
|
|
3463
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: Te[n] ?? n })
|
|
3464
|
+
] })
|
|
3465
|
+
]
|
|
3466
|
+
}
|
|
3467
|
+
);
|
|
3468
|
+
}
|
|
3469
|
+
function qe({
|
|
3470
|
+
value: r,
|
|
3471
|
+
size: e = 120,
|
|
3472
|
+
strokeWidth: n = 8,
|
|
3473
|
+
label: a,
|
|
3474
|
+
color: s,
|
|
3475
|
+
className: o,
|
|
3476
|
+
style: i
|
|
3477
|
+
}) {
|
|
3478
|
+
const l = (e - n) / 2, c = 2 * Math.PI * l, p = c - Math.min(Math.max(r, 0), 100) / 100 * c, g = e / 2;
|
|
3479
|
+
return /* @__PURE__ */ u(
|
|
3480
|
+
"div",
|
|
3481
|
+
{
|
|
3482
|
+
className: h("relative inline-flex", o),
|
|
3483
|
+
style: { width: `${e}px`, height: `${e}px`, ...i },
|
|
3484
|
+
children: [
|
|
3485
|
+
/* @__PURE__ */ u("svg", { width: e, height: e, role: "img", "aria-label": a ?? `${Math.round(r)}% progress`, children: [
|
|
3486
|
+
/* @__PURE__ */ t(
|
|
3487
|
+
"circle",
|
|
3488
|
+
{
|
|
3489
|
+
cx: g,
|
|
3490
|
+
cy: g,
|
|
3491
|
+
r: l,
|
|
3492
|
+
fill: "none",
|
|
3493
|
+
stroke: "currentColor",
|
|
3494
|
+
strokeWidth: n,
|
|
3495
|
+
opacity: 0.15
|
|
3496
|
+
}
|
|
3497
|
+
),
|
|
3498
|
+
/* @__PURE__ */ t(
|
|
3499
|
+
"circle",
|
|
3500
|
+
{
|
|
3501
|
+
cx: g,
|
|
3502
|
+
cy: g,
|
|
3503
|
+
r: l,
|
|
3504
|
+
fill: "none",
|
|
3505
|
+
stroke: s ?? "currentColor",
|
|
3506
|
+
strokeWidth: n,
|
|
3507
|
+
strokeDasharray: c,
|
|
3508
|
+
strokeDashoffset: p,
|
|
3509
|
+
strokeLinecap: "round",
|
|
3510
|
+
transform: `rotate(-90 ${g} ${g})`,
|
|
3511
|
+
style: { transition: "stroke-dashoffset 0.4s ease" }
|
|
3512
|
+
}
|
|
3513
|
+
)
|
|
3514
|
+
] }),
|
|
3515
|
+
/* @__PURE__ */ t(
|
|
3516
|
+
"span",
|
|
3517
|
+
{
|
|
3518
|
+
className: "absolute inset-0 flex items-center justify-center font-bold text-foreground",
|
|
3519
|
+
style: { fontSize: `${e * 0.2}px` },
|
|
3520
|
+
"aria-hidden": "true",
|
|
3521
|
+
children: a ?? `${Math.round(r)}%`
|
|
3522
|
+
}
|
|
3523
|
+
)
|
|
3524
|
+
]
|
|
3525
|
+
}
|
|
3526
|
+
);
|
|
3527
|
+
}
|
|
3528
|
+
const pn = {
|
|
3529
|
+
enrolled: { label: "Enrolled", variant: "default" },
|
|
3530
|
+
completed: { label: "Completed", variant: "success" },
|
|
3531
|
+
available: { label: "Available", variant: "muted" },
|
|
3532
|
+
locked: { label: "Locked", variant: "destructive" }
|
|
3533
|
+
}, Ia = L(function({
|
|
3534
|
+
title: e,
|
|
3535
|
+
description: n,
|
|
3536
|
+
thumbnailUrl: a,
|
|
3537
|
+
instructor: s,
|
|
3538
|
+
category: o,
|
|
3539
|
+
progress: i,
|
|
3540
|
+
enrollmentStatus: l = "available",
|
|
3541
|
+
studentCount: c,
|
|
3542
|
+
duration: p,
|
|
3543
|
+
onClick: g,
|
|
3544
|
+
onEnroll: x,
|
|
3545
|
+
layout: f = "vertical",
|
|
3546
|
+
className: d,
|
|
3547
|
+
style: m
|
|
3548
|
+
}) {
|
|
3549
|
+
const b = f === "horizontal", y = pn[l], C = (l === "enrolled" || l === "completed") && i != null, S = l === "locked";
|
|
3550
|
+
function k(_) {
|
|
3551
|
+
_.stopPropagation(), x == null || x();
|
|
3552
|
+
}
|
|
3553
|
+
return /* @__PURE__ */ t(
|
|
3554
|
+
ye,
|
|
3555
|
+
{
|
|
3556
|
+
"data-slot": "course-card",
|
|
3557
|
+
className: h(
|
|
3558
|
+
"overflow-hidden transition-colors",
|
|
3559
|
+
g && "cursor-pointer hover:bg-muted/30",
|
|
3560
|
+
S && "opacity-70",
|
|
3561
|
+
d
|
|
3562
|
+
),
|
|
3563
|
+
style: m,
|
|
3564
|
+
onClick: g,
|
|
3565
|
+
children: /* @__PURE__ */ u("div", { className: h(b ? "flex flex-row" : "flex flex-col"), children: [
|
|
3566
|
+
a ? /* @__PURE__ */ t(
|
|
3567
|
+
"div",
|
|
3568
|
+
{
|
|
3569
|
+
className: h(
|
|
3570
|
+
"bg-muted bg-cover bg-center shrink-0",
|
|
3571
|
+
b ? "w-40 min-h-full" : "h-36 w-full"
|
|
3572
|
+
),
|
|
3573
|
+
style: { backgroundImage: `url(${a})` }
|
|
3574
|
+
}
|
|
3575
|
+
) : /* @__PURE__ */ t(
|
|
3576
|
+
"div",
|
|
3577
|
+
{
|
|
3578
|
+
className: h(
|
|
3579
|
+
"bg-muted flex items-center justify-center shrink-0",
|
|
3580
|
+
b ? "w-40 min-h-full" : "h-36 w-full"
|
|
3581
|
+
),
|
|
3582
|
+
children: /* @__PURE__ */ t("span", { className: "text-3xl text-muted-foreground/40 font-bold", children: e.charAt(0) })
|
|
3583
|
+
}
|
|
3584
|
+
),
|
|
3585
|
+
/* @__PURE__ */ u(Je, { className: h("flex-1 min-w-0", b ? "py-3 px-4" : "pt-3 pb-4"), children: [
|
|
3586
|
+
/* @__PURE__ */ u("div", { className: "flex items-start justify-between gap-2 mb-1", children: [
|
|
3587
|
+
/* @__PURE__ */ t("h3", { className: "font-semibold text-foreground text-sm leading-tight line-clamp-2", children: e }),
|
|
3588
|
+
C && /* @__PURE__ */ t(
|
|
3589
|
+
qe,
|
|
3590
|
+
{
|
|
3591
|
+
value: i,
|
|
3592
|
+
size: 32,
|
|
3593
|
+
strokeWidth: 3,
|
|
3594
|
+
color: l === "completed" ? "var(--success)" : "var(--primary)",
|
|
3595
|
+
className: "shrink-0"
|
|
3596
|
+
}
|
|
3597
|
+
)
|
|
3598
|
+
] }),
|
|
3599
|
+
n && /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground line-clamp-2 mb-2", children: n }),
|
|
3600
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-2 flex-wrap mb-2", children: [
|
|
3601
|
+
o && /* @__PURE__ */ t(pe, { variant: "outline", className: "text-[10px] px-1.5 py-0", children: o }),
|
|
3602
|
+
/* @__PURE__ */ u(pe, { variant: y.variant, className: "text-[10px] px-1.5 py-0", children: [
|
|
3603
|
+
S && /* @__PURE__ */ t(Pe, { className: "size-2.5 mr-0.5" }),
|
|
3604
|
+
y.label
|
|
3605
|
+
] })
|
|
3606
|
+
] }),
|
|
3607
|
+
/* @__PURE__ */ u("div", { className: "flex items-center justify-between gap-2", children: [
|
|
3608
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-3 text-xs text-muted-foreground", children: [
|
|
3609
|
+
s && /* @__PURE__ */ u("span", { className: "flex items-center gap-1", children: [
|
|
3610
|
+
/* @__PURE__ */ t(
|
|
3611
|
+
Xe,
|
|
3612
|
+
{
|
|
3613
|
+
displayName: s.displayName,
|
|
3614
|
+
avatarUrl: s.avatarUrl,
|
|
3615
|
+
size: "small"
|
|
3616
|
+
}
|
|
3617
|
+
),
|
|
3618
|
+
/* @__PURE__ */ t("span", { className: "truncate max-w-24", children: s.displayName })
|
|
3619
|
+
] }),
|
|
3620
|
+
p && /* @__PURE__ */ u("span", { className: "flex items-center gap-0.5", children: [
|
|
3621
|
+
/* @__PURE__ */ t(ee, { className: "size-3" }),
|
|
3622
|
+
p
|
|
3623
|
+
] }),
|
|
3624
|
+
c != null && /* @__PURE__ */ u("span", { className: "flex items-center gap-0.5", children: [
|
|
3625
|
+
/* @__PURE__ */ t(Lt, { className: "size-3" }),
|
|
3626
|
+
c
|
|
3627
|
+
] })
|
|
3628
|
+
] }),
|
|
3629
|
+
x && l === "available" && /* @__PURE__ */ t(R, { size: "xs", onClick: k, children: "Enroll" })
|
|
3630
|
+
] })
|
|
3631
|
+
] })
|
|
3632
|
+
] })
|
|
3633
|
+
}
|
|
3634
|
+
);
|
|
3635
|
+
});
|
|
3636
|
+
function Ma({ icon: r, title: e, description: n, action: a, className: s, style: o }) {
|
|
3637
|
+
return /* @__PURE__ */ u(
|
|
3638
|
+
"div",
|
|
3639
|
+
{
|
|
3640
|
+
className: h("flex flex-col items-center justify-center text-center px-3 py-6", s),
|
|
3641
|
+
style: o,
|
|
3642
|
+
role: "status",
|
|
3643
|
+
children: [
|
|
3644
|
+
r && /* @__PURE__ */ t("div", { className: "mb-2 text-muted-foreground [&>svg]:size-12", children: r }),
|
|
3645
|
+
/* @__PURE__ */ t("p", { className: "text-lg font-semibold text-foreground mb-1", children: e }),
|
|
3646
|
+
n && /* @__PURE__ */ t("p", { className: h("text-sm text-muted-foreground max-w-[360px]", a && "mb-2"), children: n }),
|
|
3647
|
+
a
|
|
3648
|
+
]
|
|
3649
|
+
}
|
|
3650
|
+
);
|
|
3651
|
+
}
|
|
3652
|
+
const et = Q(null);
|
|
3653
|
+
function J() {
|
|
3654
|
+
const r = W(et);
|
|
3655
|
+
if (!r)
|
|
3656
|
+
throw new Error(
|
|
3657
|
+
"AlertDialog compound components must be used within <AlertDialog>"
|
|
3658
|
+
);
|
|
3659
|
+
return r;
|
|
3660
|
+
}
|
|
3661
|
+
const ze = [
|
|
3662
|
+
"a[href]",
|
|
3663
|
+
"button:not([disabled])",
|
|
3664
|
+
"input:not([disabled])",
|
|
3665
|
+
"select:not([disabled])",
|
|
3666
|
+
"textarea:not([disabled])",
|
|
3667
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
3668
|
+
].join(", ");
|
|
3669
|
+
function gn(r, e) {
|
|
3670
|
+
const n = I(null);
|
|
3671
|
+
return H(() => {
|
|
3672
|
+
if (!e || !r.current) return;
|
|
3673
|
+
n.current = document.activeElement;
|
|
3674
|
+
const s = r.current.querySelectorAll(ze);
|
|
3675
|
+
return s.length > 0 && s[0].focus(), () => {
|
|
3676
|
+
n.current instanceof HTMLElement && n.current.focus();
|
|
3677
|
+
};
|
|
3678
|
+
}, [e, r]), E(
|
|
3679
|
+
(s) => {
|
|
3680
|
+
if (s.key !== "Tab" || !r.current) return;
|
|
3681
|
+
const o = Array.from(
|
|
3682
|
+
r.current.querySelectorAll(ze)
|
|
3683
|
+
);
|
|
3684
|
+
if (o.length === 0) return;
|
|
3685
|
+
const i = o[0], l = o[o.length - 1];
|
|
3686
|
+
s.shiftKey && document.activeElement === i ? (s.preventDefault(), l.focus()) : !s.shiftKey && document.activeElement === l && (s.preventDefault(), i.focus());
|
|
3687
|
+
},
|
|
3688
|
+
[r]
|
|
3689
|
+
);
|
|
3690
|
+
}
|
|
3691
|
+
function hn(r) {
|
|
3692
|
+
H(() => {
|
|
3693
|
+
if (!r) return;
|
|
3694
|
+
const e = document.body.style.overflow;
|
|
3695
|
+
return document.body.style.overflow = "hidden", () => {
|
|
3696
|
+
document.body.style.overflow = e;
|
|
3697
|
+
};
|
|
3698
|
+
}, [r]);
|
|
3699
|
+
}
|
|
3700
|
+
function xn({ children: r, open: e, onOpenChange: n }) {
|
|
3701
|
+
const a = O(), s = O();
|
|
3702
|
+
return /* @__PURE__ */ t(
|
|
3703
|
+
et.Provider,
|
|
3704
|
+
{
|
|
3705
|
+
value: { open: e, onOpenChange: n, titleId: a, descriptionId: s },
|
|
3706
|
+
children: r
|
|
3707
|
+
}
|
|
3708
|
+
);
|
|
3709
|
+
}
|
|
3710
|
+
function La({
|
|
3711
|
+
className: r,
|
|
3712
|
+
onClick: e,
|
|
3713
|
+
...n
|
|
3714
|
+
}) {
|
|
3715
|
+
const { onOpenChange: a } = J();
|
|
3716
|
+
return /* @__PURE__ */ t(
|
|
3717
|
+
"button",
|
|
3718
|
+
{
|
|
3719
|
+
type: "button",
|
|
3720
|
+
"data-slot": "alert-dialog-trigger",
|
|
3721
|
+
className: r,
|
|
3722
|
+
onClick: (s) => {
|
|
3723
|
+
a(!0), e == null || e(s);
|
|
3724
|
+
},
|
|
3725
|
+
...n
|
|
3726
|
+
}
|
|
3727
|
+
);
|
|
3728
|
+
}
|
|
3729
|
+
function bn({ children: r }) {
|
|
3730
|
+
return xe(r, document.body);
|
|
3731
|
+
}
|
|
3732
|
+
function vn({
|
|
3733
|
+
className: r,
|
|
3734
|
+
...e
|
|
3735
|
+
}) {
|
|
3736
|
+
const { onOpenChange: n } = J();
|
|
3737
|
+
return /* @__PURE__ */ t(
|
|
3738
|
+
"div",
|
|
3739
|
+
{
|
|
3740
|
+
"data-slot": "alert-dialog-backdrop",
|
|
3741
|
+
className: h(
|
|
3742
|
+
"fixed inset-0 z-50 bg-black/50 transition-opacity data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
3743
|
+
r
|
|
3744
|
+
),
|
|
3745
|
+
"data-state": "open",
|
|
3746
|
+
onClick: () => n(!1),
|
|
3747
|
+
...e
|
|
3748
|
+
}
|
|
3749
|
+
);
|
|
3750
|
+
}
|
|
3751
|
+
function yn({
|
|
3752
|
+
className: r,
|
|
3753
|
+
children: e,
|
|
3754
|
+
...n
|
|
3755
|
+
}) {
|
|
3756
|
+
const { open: a, onOpenChange: s, titleId: o, descriptionId: i } = J(), l = I(null), c = gn(l, a);
|
|
3757
|
+
return hn(a), H(() => {
|
|
3758
|
+
if (!a) return;
|
|
3759
|
+
const p = (g) => {
|
|
3760
|
+
g.key === "Escape" && s(!1);
|
|
3761
|
+
};
|
|
3762
|
+
return document.addEventListener("keydown", p), () => document.removeEventListener("keydown", p);
|
|
3763
|
+
}, [a, s]), a ? /* @__PURE__ */ u(bn, { children: [
|
|
3764
|
+
/* @__PURE__ */ t(vn, {}),
|
|
3765
|
+
/* @__PURE__ */ t(
|
|
3766
|
+
"div",
|
|
3767
|
+
{
|
|
3768
|
+
ref: l,
|
|
3769
|
+
role: "alertdialog",
|
|
3770
|
+
"aria-modal": "true",
|
|
3771
|
+
"aria-labelledby": o,
|
|
3772
|
+
"aria-describedby": i,
|
|
3773
|
+
"data-slot": "alert-dialog-content",
|
|
3774
|
+
"data-state": "open",
|
|
3775
|
+
className: h(
|
|
3776
|
+
"bg-background fixed top-1/2 left-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border p-6 shadow-lg transition-all data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
3777
|
+
r
|
|
3778
|
+
),
|
|
3779
|
+
onKeyDown: c,
|
|
3780
|
+
...n,
|
|
3781
|
+
children: e
|
|
3782
|
+
}
|
|
3783
|
+
)
|
|
3784
|
+
] }) : null;
|
|
3785
|
+
}
|
|
3786
|
+
function Nn({
|
|
3787
|
+
className: r,
|
|
3788
|
+
...e
|
|
3789
|
+
}) {
|
|
3790
|
+
return /* @__PURE__ */ t(
|
|
3791
|
+
"div",
|
|
3792
|
+
{
|
|
3793
|
+
"data-slot": "alert-dialog-header",
|
|
3794
|
+
className: h(
|
|
3795
|
+
"flex flex-col gap-2 text-center sm:text-left",
|
|
3796
|
+
r
|
|
3797
|
+
),
|
|
3798
|
+
...e
|
|
3799
|
+
}
|
|
3800
|
+
);
|
|
3801
|
+
}
|
|
3802
|
+
function wn({
|
|
3803
|
+
className: r,
|
|
3804
|
+
...e
|
|
3805
|
+
}) {
|
|
3806
|
+
return /* @__PURE__ */ t(
|
|
3807
|
+
"div",
|
|
3808
|
+
{
|
|
3809
|
+
"data-slot": "alert-dialog-footer",
|
|
3810
|
+
className: h(
|
|
3811
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
3812
|
+
r
|
|
3813
|
+
),
|
|
3814
|
+
...e
|
|
3815
|
+
}
|
|
3816
|
+
);
|
|
3817
|
+
}
|
|
3818
|
+
function kn({
|
|
3819
|
+
className: r,
|
|
3820
|
+
...e
|
|
3821
|
+
}) {
|
|
3822
|
+
const { titleId: n } = J();
|
|
3823
|
+
return /* @__PURE__ */ t(
|
|
3824
|
+
"h2",
|
|
3825
|
+
{
|
|
3826
|
+
id: n,
|
|
3827
|
+
"data-slot": "alert-dialog-title",
|
|
3828
|
+
className: h("text-lg font-semibold", r),
|
|
3829
|
+
...e
|
|
3830
|
+
}
|
|
3831
|
+
);
|
|
3832
|
+
}
|
|
3833
|
+
function Cn({
|
|
3834
|
+
className: r,
|
|
3835
|
+
...e
|
|
3836
|
+
}) {
|
|
3837
|
+
const { descriptionId: n } = J();
|
|
3838
|
+
return /* @__PURE__ */ t(
|
|
3839
|
+
"p",
|
|
3840
|
+
{
|
|
3841
|
+
id: n,
|
|
3842
|
+
"data-slot": "alert-dialog-description",
|
|
3843
|
+
className: h("text-muted-foreground text-sm", r),
|
|
3844
|
+
...e
|
|
3845
|
+
}
|
|
3846
|
+
);
|
|
3847
|
+
}
|
|
3848
|
+
function Sn({
|
|
3849
|
+
className: r,
|
|
3850
|
+
...e
|
|
3851
|
+
}) {
|
|
3852
|
+
return /* @__PURE__ */ t(
|
|
3853
|
+
"button",
|
|
3854
|
+
{
|
|
3855
|
+
type: "button",
|
|
3856
|
+
className: h(ie(), r),
|
|
3857
|
+
...e
|
|
3858
|
+
}
|
|
3859
|
+
);
|
|
3860
|
+
}
|
|
3861
|
+
function _n({
|
|
3862
|
+
className: r,
|
|
3863
|
+
...e
|
|
3864
|
+
}) {
|
|
3865
|
+
return /* @__PURE__ */ t(
|
|
3866
|
+
"button",
|
|
3867
|
+
{
|
|
3868
|
+
type: "button",
|
|
3869
|
+
className: h(ie({ variant: "outline" }), r),
|
|
3870
|
+
...e
|
|
3871
|
+
}
|
|
3872
|
+
);
|
|
3873
|
+
}
|
|
3874
|
+
const De = {
|
|
3875
|
+
primary: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
3876
|
+
error: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
3877
|
+
warning: "bg-warning text-warning-foreground hover:bg-warning/90"
|
|
3878
|
+
};
|
|
3879
|
+
function Ea({
|
|
3880
|
+
open: r,
|
|
3881
|
+
title: e,
|
|
3882
|
+
message: n,
|
|
3883
|
+
confirmLabel: a = "Confirm",
|
|
3884
|
+
cancelLabel: s = "Cancel",
|
|
3885
|
+
confirmColor: o = "primary",
|
|
3886
|
+
onConfirm: i,
|
|
3887
|
+
onCancel: l,
|
|
3888
|
+
isLoading: c = !1
|
|
3889
|
+
}) {
|
|
3890
|
+
return /* @__PURE__ */ t(xn, { open: r, onOpenChange: (p) => !p && l(), children: /* @__PURE__ */ u(yn, { children: [
|
|
3891
|
+
/* @__PURE__ */ u(Nn, { children: [
|
|
3892
|
+
/* @__PURE__ */ t(kn, { children: e }),
|
|
3893
|
+
typeof n == "string" ? /* @__PURE__ */ t(Cn, { children: n }) : n
|
|
3894
|
+
] }),
|
|
3895
|
+
/* @__PURE__ */ u(wn, { children: [
|
|
3896
|
+
/* @__PURE__ */ t(_n, { onClick: l, disabled: c, children: s }),
|
|
3897
|
+
/* @__PURE__ */ u(
|
|
3898
|
+
Sn,
|
|
3899
|
+
{
|
|
3900
|
+
className: h(De[o] ?? De.primary),
|
|
3901
|
+
onClick: i,
|
|
3902
|
+
disabled: c,
|
|
3903
|
+
children: [
|
|
3904
|
+
c && /* @__PURE__ */ t("span", { className: "inline-block size-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
3905
|
+
a
|
|
3906
|
+
]
|
|
3907
|
+
}
|
|
3908
|
+
)
|
|
3909
|
+
] })
|
|
3910
|
+
] }) });
|
|
3911
|
+
}
|
|
3912
|
+
function $a({
|
|
3913
|
+
value: r,
|
|
3914
|
+
onChange: e,
|
|
3915
|
+
placeholder: n = "Search...",
|
|
3916
|
+
debounceMs: a = 300,
|
|
3917
|
+
fullWidth: s = !1,
|
|
3918
|
+
size: o = "small",
|
|
3919
|
+
className: i,
|
|
3920
|
+
style: l
|
|
3921
|
+
}) {
|
|
3922
|
+
const [c, p] = T(r), g = I(e);
|
|
3923
|
+
g.current = e;
|
|
3924
|
+
const x = D(
|
|
3925
|
+
() => Z((m) => g.current(m), a),
|
|
3926
|
+
[a]
|
|
3927
|
+
);
|
|
3928
|
+
H(() => () => x.cancel(), [x]);
|
|
3929
|
+
function f(m) {
|
|
3930
|
+
const b = m.target.value;
|
|
3931
|
+
p(b), x(b);
|
|
3932
|
+
}
|
|
3933
|
+
function d() {
|
|
3934
|
+
p(""), e("");
|
|
3935
|
+
}
|
|
3936
|
+
return /* @__PURE__ */ t(
|
|
3937
|
+
"div",
|
|
3938
|
+
{
|
|
3939
|
+
className: h("w-full", i),
|
|
3940
|
+
style: { ...l, width: s ? "100%" : void 0 },
|
|
3941
|
+
children: /* @__PURE__ */ u("div", { className: "flex items-center w-full border border-input rounded-md bg-background transition-colors focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]", children: [
|
|
3942
|
+
/* @__PURE__ */ t("span", { className: "flex items-center justify-center px-2 text-muted-foreground shrink-0", children: /* @__PURE__ */ t(Et, { size: 18 }) }),
|
|
3943
|
+
/* @__PURE__ */ t(
|
|
3944
|
+
"input",
|
|
3945
|
+
{
|
|
3946
|
+
className: h(
|
|
3947
|
+
"flex-1 border-none outline-none bg-transparent text-foreground text-sm min-w-0 placeholder:text-muted-foreground",
|
|
3948
|
+
o === "medium" ? "py-2" : "py-1.5"
|
|
3949
|
+
),
|
|
3950
|
+
value: c,
|
|
3951
|
+
onChange: f,
|
|
3952
|
+
placeholder: n
|
|
3953
|
+
}
|
|
3954
|
+
),
|
|
3955
|
+
c && /* @__PURE__ */ t(
|
|
3956
|
+
"button",
|
|
3957
|
+
{
|
|
3958
|
+
type: "button",
|
|
3959
|
+
className: "inline-flex items-center justify-center p-0.5 mr-1 rounded-md text-muted-foreground cursor-pointer transition-colors hover:bg-muted hover:text-foreground",
|
|
3960
|
+
"aria-label": "Clear search",
|
|
3961
|
+
onClick: d,
|
|
3962
|
+
children: /* @__PURE__ */ t(oe, { size: 16 })
|
|
3963
|
+
}
|
|
3964
|
+
)
|
|
3965
|
+
] })
|
|
3966
|
+
}
|
|
3967
|
+
);
|
|
3968
|
+
}
|
|
3969
|
+
const Tn = {
|
|
3970
|
+
graded: "green",
|
|
3971
|
+
submitted: "teal",
|
|
3972
|
+
pending: "gray",
|
|
3973
|
+
missing: "red",
|
|
3974
|
+
late: "orange",
|
|
3975
|
+
excused: "gray",
|
|
3976
|
+
draft: "gray",
|
|
3977
|
+
not_started: "gray",
|
|
3978
|
+
resubmit: "orange"
|
|
3979
|
+
}, zn = {
|
|
3980
|
+
success: "green",
|
|
3981
|
+
error: "red",
|
|
3982
|
+
warning: "orange",
|
|
3983
|
+
info: "teal",
|
|
3984
|
+
default: "gray"
|
|
3985
|
+
}, Dn = {
|
|
3986
|
+
green: "success",
|
|
3987
|
+
red: "destructive",
|
|
3988
|
+
orange: "warning",
|
|
3989
|
+
gray: "muted",
|
|
3990
|
+
teal: "info"
|
|
3991
|
+
}, Ie = {
|
|
3992
|
+
green: "bg-transparent border-success text-success",
|
|
3993
|
+
red: "bg-transparent border-destructive text-destructive",
|
|
3994
|
+
orange: "bg-transparent border-warning text-warning",
|
|
3995
|
+
gray: "bg-transparent border-border text-muted-foreground",
|
|
3996
|
+
teal: "bg-transparent border-info text-info"
|
|
3997
|
+
}, In = {
|
|
3998
|
+
green: "bg-success text-success-foreground",
|
|
3999
|
+
red: "bg-destructive text-destructive-foreground",
|
|
4000
|
+
orange: "bg-warning text-warning-foreground",
|
|
4001
|
+
teal: "bg-info text-info-foreground"
|
|
4002
|
+
};
|
|
4003
|
+
function Ra({
|
|
4004
|
+
status: r,
|
|
4005
|
+
colorMap: e,
|
|
4006
|
+
size: n = "small",
|
|
4007
|
+
variant: a = "filled"
|
|
4008
|
+
}) {
|
|
4009
|
+
const s = { ...Tn };
|
|
4010
|
+
if (e)
|
|
4011
|
+
for (const [p, g] of Object.entries(e))
|
|
4012
|
+
s[p] = zn[g] ?? g;
|
|
4013
|
+
const o = s[r] ?? "gray", i = r.replace(/_/g, " ").replace(/\b\w/g, (p) => p.toUpperCase()), l = Dn[o] ?? "muted", c = a === "outlined" ? Ie[o] ?? Ie.gray : In[o] ?? void 0;
|
|
4014
|
+
return /* @__PURE__ */ t(
|
|
4015
|
+
pe,
|
|
4016
|
+
{
|
|
4017
|
+
variant: l,
|
|
4018
|
+
className: h(
|
|
4019
|
+
n === "small" ? "text-xs px-2 h-5.5" : "text-sm px-2.5 h-6.5",
|
|
4020
|
+
"leading-none",
|
|
4021
|
+
c
|
|
4022
|
+
),
|
|
4023
|
+
children: i
|
|
4024
|
+
}
|
|
4025
|
+
);
|
|
4026
|
+
}
|
|
4027
|
+
const Mn = {
|
|
4028
|
+
success: "text-success",
|
|
4029
|
+
destructive: "text-destructive",
|
|
4030
|
+
warning: "text-warning",
|
|
4031
|
+
muted: "text-muted-foreground"
|
|
4032
|
+
};
|
|
4033
|
+
function Ln(r) {
|
|
4034
|
+
const e = /* @__PURE__ */ new Date(), n = r.getTime() - e.getTime(), a = Math.round(n / (1e3 * 60 * 60 * 24));
|
|
4035
|
+
return a === 0 ? "Due today" : a === 1 ? "Due tomorrow" : a === -1 ? "Due yesterday" : a > 1 ? `Due in ${a} days` : `${Math.abs(a)} days overdue`;
|
|
4036
|
+
}
|
|
4037
|
+
function En(r, e) {
|
|
4038
|
+
if (e) return "success";
|
|
4039
|
+
const n = /* @__PURE__ */ new Date(), s = (r.getTime() - n.getTime()) / (1e3 * 60 * 60 * 24);
|
|
4040
|
+
return s < 0 ? "destructive" : s < 2 ? "warning" : "muted";
|
|
4041
|
+
}
|
|
4042
|
+
function Ha({
|
|
4043
|
+
dueDate: r,
|
|
4044
|
+
submittedDate: e,
|
|
4045
|
+
showRelative: n = !0,
|
|
4046
|
+
size: a = "medium",
|
|
4047
|
+
className: s,
|
|
4048
|
+
style: o
|
|
4049
|
+
}) {
|
|
4050
|
+
const i = new Date(r), l = !!e, c = Mn[En(i, l)] ?? "text-muted-foreground", p = a === "small" ? 14 : 16;
|
|
4051
|
+
return /* @__PURE__ */ u(
|
|
4052
|
+
"div",
|
|
4053
|
+
{
|
|
4054
|
+
className: h("flex items-center gap-1", c, s),
|
|
4055
|
+
style: o,
|
|
4056
|
+
children: [
|
|
4057
|
+
/* @__PURE__ */ t("span", { className: "shrink-0 inline-flex", children: l ? /* @__PURE__ */ t(he, { size: p }) : /* @__PURE__ */ t(ee, { size: p }) }),
|
|
4058
|
+
/* @__PURE__ */ t("span", { className: a === "small" ? "text-xs" : "text-sm", children: l ? `Submitted ${new Date(e).toLocaleDateString()}` : n ? Ln(i) : i.toLocaleDateString() })
|
|
4059
|
+
]
|
|
4060
|
+
}
|
|
4061
|
+
);
|
|
4062
|
+
}
|
|
4063
|
+
function Ua({
|
|
4064
|
+
steps: r,
|
|
4065
|
+
currentStep: e,
|
|
4066
|
+
orientation: n = "horizontal",
|
|
4067
|
+
variant: a = "default",
|
|
4068
|
+
className: s,
|
|
4069
|
+
style: o
|
|
4070
|
+
}) {
|
|
4071
|
+
const i = n === "horizontal", l = a === "compact", c = l ? "w-6 h-6 text-xs" : "w-8 h-8 text-sm", p = l ? 12 : 16;
|
|
4072
|
+
return /* @__PURE__ */ t(
|
|
4073
|
+
"div",
|
|
4074
|
+
{
|
|
4075
|
+
className: h(
|
|
4076
|
+
"flex",
|
|
4077
|
+
i ? "flex-row items-start" : "flex-col",
|
|
4078
|
+
s
|
|
4079
|
+
),
|
|
4080
|
+
style: o,
|
|
4081
|
+
children: r.map((g, x) => {
|
|
4082
|
+
const f = x < e, d = x === e;
|
|
4083
|
+
return /* @__PURE__ */ u("div", { className: h("flex", i ? "flex-1 flex-row items-start" : "flex-row items-start"), children: [
|
|
4084
|
+
/* @__PURE__ */ u("div", { className: h("flex", i ? "flex-col items-center" : "flex-row items-start gap-3"), children: [
|
|
4085
|
+
/* @__PURE__ */ t(
|
|
4086
|
+
"div",
|
|
4087
|
+
{
|
|
4088
|
+
className: h(
|
|
4089
|
+
"rounded-full flex items-center justify-center shrink-0 font-semibold transition-colors",
|
|
4090
|
+
c,
|
|
4091
|
+
f && "bg-primary text-primary-foreground",
|
|
4092
|
+
d && "border-2 border-primary bg-primary/10 text-primary",
|
|
4093
|
+
!f && !d && "border-2 border-border bg-muted text-muted-foreground"
|
|
4094
|
+
),
|
|
4095
|
+
children: f ? /* @__PURE__ */ t($e, { size: p }) : /* @__PURE__ */ t("span", { children: x + 1 })
|
|
4096
|
+
}
|
|
4097
|
+
),
|
|
4098
|
+
/* @__PURE__ */ u("div", { className: h(i ? "mt-1.5 text-center" : "pt-0.5"), children: [
|
|
4099
|
+
/* @__PURE__ */ t(
|
|
4100
|
+
"p",
|
|
4101
|
+
{
|
|
4102
|
+
className: h(
|
|
4103
|
+
"text-sm font-medium leading-tight",
|
|
4104
|
+
d ? "text-foreground" : "text-muted-foreground"
|
|
4105
|
+
),
|
|
4106
|
+
children: g.label
|
|
4107
|
+
}
|
|
4108
|
+
),
|
|
4109
|
+
!l && g.description && /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground mt-0.5", children: g.description })
|
|
4110
|
+
] })
|
|
4111
|
+
] }),
|
|
4112
|
+
x < r.length - 1 && (i ? /* @__PURE__ */ t(
|
|
4113
|
+
"div",
|
|
4114
|
+
{
|
|
4115
|
+
className: h(
|
|
4116
|
+
"flex-1 h-0.5 self-center mt-0 mx-2",
|
|
4117
|
+
l ? "mt-3" : "mt-4",
|
|
4118
|
+
f ? "bg-primary" : "bg-border"
|
|
4119
|
+
)
|
|
4120
|
+
}
|
|
4121
|
+
) : /* @__PURE__ */ t(
|
|
4122
|
+
"div",
|
|
4123
|
+
{
|
|
4124
|
+
className: h(
|
|
4125
|
+
"w-0.5 h-6 ml-3.5",
|
|
4126
|
+
l && "ml-2.5",
|
|
4127
|
+
f ? "bg-primary" : "bg-border"
|
|
4128
|
+
)
|
|
4129
|
+
}
|
|
4130
|
+
))
|
|
4131
|
+
] }, x);
|
|
4132
|
+
})
|
|
4133
|
+
}
|
|
4134
|
+
);
|
|
4135
|
+
}
|
|
4136
|
+
function $n(r, e, n) {
|
|
4137
|
+
const a = n * 2 + 5;
|
|
4138
|
+
if (e <= a)
|
|
4139
|
+
return Array.from({ length: e }, (p, g) => g + 1);
|
|
4140
|
+
const s = Math.max(r - n, 1), o = Math.min(r + n, e), i = s > 2, l = o < e - 1;
|
|
4141
|
+
if (!i && l) {
|
|
4142
|
+
const p = n * 2 + 3;
|
|
4143
|
+
return [...Array.from({ length: p }, (x, f) => f + 1), "ellipsis", e];
|
|
4144
|
+
}
|
|
4145
|
+
if (i && !l) {
|
|
4146
|
+
const p = n * 2 + 3;
|
|
4147
|
+
return [1, "ellipsis", ...Array.from(
|
|
4148
|
+
{ length: p },
|
|
4149
|
+
(x, f) => e - p + f + 1
|
|
4150
|
+
)];
|
|
4151
|
+
}
|
|
4152
|
+
return [1, "ellipsis", ...Array.from(
|
|
4153
|
+
{ length: o - s + 1 },
|
|
4154
|
+
(p, g) => s + g
|
|
4155
|
+
), "ellipsis", e];
|
|
4156
|
+
}
|
|
4157
|
+
const ja = L(function({
|
|
4158
|
+
currentPage: e,
|
|
4159
|
+
totalPages: n,
|
|
4160
|
+
onPageChange: a,
|
|
4161
|
+
siblingCount: s = 1,
|
|
4162
|
+
className: o,
|
|
4163
|
+
style: i
|
|
4164
|
+
}) {
|
|
4165
|
+
const l = D(
|
|
4166
|
+
() => $n(e, n, s),
|
|
4167
|
+
[e, n, s]
|
|
4168
|
+
);
|
|
4169
|
+
return n <= 1 ? null : /* @__PURE__ */ u(
|
|
4170
|
+
"nav",
|
|
4171
|
+
{
|
|
4172
|
+
"data-slot": "pagination",
|
|
4173
|
+
"aria-label": "Pagination",
|
|
4174
|
+
className: h("flex items-center justify-center gap-1", o),
|
|
4175
|
+
style: i,
|
|
4176
|
+
children: [
|
|
4177
|
+
/* @__PURE__ */ t(
|
|
4178
|
+
R,
|
|
4179
|
+
{
|
|
4180
|
+
variant: "ghost",
|
|
4181
|
+
size: "icon-sm",
|
|
4182
|
+
onClick: () => a(e - 1),
|
|
4183
|
+
disabled: e <= 1,
|
|
4184
|
+
"aria-label": "Previous page",
|
|
4185
|
+
children: /* @__PURE__ */ t(ge, { className: "size-4" })
|
|
4186
|
+
}
|
|
4187
|
+
),
|
|
4188
|
+
l.map(
|
|
4189
|
+
(c, p) => c === "ellipsis" ? /* @__PURE__ */ u(
|
|
4190
|
+
"span",
|
|
4191
|
+
{
|
|
4192
|
+
className: "flex items-center justify-center size-8 text-xs text-muted-foreground",
|
|
4193
|
+
children: [
|
|
4194
|
+
/* @__PURE__ */ t("span", { "aria-hidden": "true", children: "..." }),
|
|
4195
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: "More pages" })
|
|
4196
|
+
]
|
|
4197
|
+
},
|
|
4198
|
+
`ellipsis-${p}`
|
|
4199
|
+
) : /* @__PURE__ */ t(
|
|
4200
|
+
R,
|
|
4201
|
+
{
|
|
4202
|
+
variant: c === e ? "default" : "ghost",
|
|
4203
|
+
size: "icon-sm",
|
|
4204
|
+
onClick: () => a(c),
|
|
4205
|
+
"aria-label": `Page ${c}`,
|
|
4206
|
+
"aria-current": c === e ? "page" : void 0,
|
|
4207
|
+
children: /* @__PURE__ */ t("span", { className: "text-xs", children: c })
|
|
4208
|
+
},
|
|
4209
|
+
c
|
|
4210
|
+
)
|
|
4211
|
+
),
|
|
4212
|
+
/* @__PURE__ */ t(
|
|
4213
|
+
R,
|
|
4214
|
+
{
|
|
4215
|
+
variant: "ghost",
|
|
4216
|
+
size: "icon-sm",
|
|
4217
|
+
onClick: () => a(e + 1),
|
|
4218
|
+
disabled: e >= n,
|
|
4219
|
+
"aria-label": "Next page",
|
|
4220
|
+
children: /* @__PURE__ */ t(se, { className: "size-4" })
|
|
4221
|
+
}
|
|
4222
|
+
)
|
|
4223
|
+
]
|
|
4224
|
+
}
|
|
4225
|
+
);
|
|
4226
|
+
});
|
|
4227
|
+
function Pa({
|
|
4228
|
+
isCorrect: r,
|
|
4229
|
+
explanation: e,
|
|
4230
|
+
onRetry: n,
|
|
4231
|
+
retryLabel: a = "Try Again",
|
|
4232
|
+
className: s,
|
|
4233
|
+
style: o
|
|
4234
|
+
}) {
|
|
4235
|
+
return /* @__PURE__ */ u(
|
|
4236
|
+
U,
|
|
4237
|
+
{
|
|
4238
|
+
variant: r ? "success" : "destructive",
|
|
4239
|
+
className: h(s),
|
|
4240
|
+
style: o,
|
|
4241
|
+
children: [
|
|
4242
|
+
/* @__PURE__ */ t("span", { className: "shrink-0", children: r ? /* @__PURE__ */ t(he, { size: 20 }) : /* @__PURE__ */ t($t, { size: 20 }) }),
|
|
4243
|
+
/* @__PURE__ */ t("div", { className: "flex-1", children: /* @__PURE__ */ u("div", { className: "flex items-start justify-between gap-2", children: [
|
|
4244
|
+
/* @__PURE__ */ u("div", { children: [
|
|
4245
|
+
/* @__PURE__ */ t("span", { className: "font-semibold", children: r ? "Correct!" : "Incorrect" }),
|
|
4246
|
+
e && /* @__PURE__ */ t("p", { className: "mt-1 text-foreground", children: e })
|
|
4247
|
+
] }),
|
|
4248
|
+
!r && n && /* @__PURE__ */ t(
|
|
4249
|
+
R,
|
|
4250
|
+
{
|
|
4251
|
+
variant: "outline",
|
|
4252
|
+
size: "sm",
|
|
4253
|
+
className: "shrink-0",
|
|
4254
|
+
onClick: n,
|
|
4255
|
+
children: a
|
|
4256
|
+
}
|
|
4257
|
+
)
|
|
4258
|
+
] }) })
|
|
4259
|
+
]
|
|
4260
|
+
}
|
|
4261
|
+
);
|
|
4262
|
+
}
|
|
4263
|
+
function Ba({
|
|
4264
|
+
value: r,
|
|
4265
|
+
onChange: e,
|
|
4266
|
+
points: n = 5,
|
|
4267
|
+
lowLabel: a = "Strongly Disagree",
|
|
4268
|
+
highLabel: s = "Strongly Agree",
|
|
4269
|
+
disabled: o = !1,
|
|
4270
|
+
readOnly: i = !1,
|
|
4271
|
+
className: l,
|
|
4272
|
+
style: c
|
|
4273
|
+
}) {
|
|
4274
|
+
const p = Array.from({ length: n }, (x, f) => f + 1), g = !o && !i;
|
|
4275
|
+
return /* @__PURE__ */ u("div", { className: h("flex flex-col gap-1", l), style: c, children: [
|
|
4276
|
+
/* @__PURE__ */ t("div", { className: "flex flex-row", role: "radiogroup", children: p.map((x) => {
|
|
4277
|
+
const f = r === x;
|
|
4278
|
+
return /* @__PURE__ */ u(
|
|
4279
|
+
"label",
|
|
4280
|
+
{
|
|
4281
|
+
className: h(
|
|
4282
|
+
"flex items-center justify-center border border-border px-1.5 py-2 text-sm transition-colors first:rounded-l-md last:rounded-r-md -ml-px first:ml-0",
|
|
4283
|
+
f ? "bg-primary text-primary-foreground border-primary z-10" : "bg-background text-foreground",
|
|
4284
|
+
!g && "opacity-60 cursor-not-allowed",
|
|
4285
|
+
g && !f && "cursor-pointer hover:bg-muted"
|
|
4286
|
+
),
|
|
4287
|
+
children: [
|
|
4288
|
+
/* @__PURE__ */ t(
|
|
4289
|
+
"input",
|
|
4290
|
+
{
|
|
4291
|
+
type: "radio",
|
|
4292
|
+
name: "likert-scale",
|
|
4293
|
+
className: "sr-only",
|
|
4294
|
+
value: x,
|
|
4295
|
+
checked: f,
|
|
4296
|
+
disabled: o,
|
|
4297
|
+
onChange: () => {
|
|
4298
|
+
g && e(x);
|
|
4299
|
+
}
|
|
4300
|
+
}
|
|
4301
|
+
),
|
|
4302
|
+
/* @__PURE__ */ t("span", { className: "text-sm font-medium", children: x })
|
|
4303
|
+
]
|
|
4304
|
+
},
|
|
4305
|
+
x
|
|
4306
|
+
);
|
|
4307
|
+
}) }),
|
|
4308
|
+
/* @__PURE__ */ u("div", { className: "flex justify-between", children: [
|
|
4309
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: a }),
|
|
4310
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: s })
|
|
4311
|
+
] })
|
|
4312
|
+
] });
|
|
4313
|
+
}
|
|
4314
|
+
const Rn = { small: 18, medium: 24, large: 32 };
|
|
4315
|
+
function Aa({
|
|
4316
|
+
value: r,
|
|
4317
|
+
onChange: e,
|
|
4318
|
+
maxStars: n = 5,
|
|
4319
|
+
allowHalf: a = !1,
|
|
4320
|
+
size: s = "medium",
|
|
4321
|
+
disabled: o = !1,
|
|
4322
|
+
readOnly: i = !1,
|
|
4323
|
+
className: l,
|
|
4324
|
+
style: c
|
|
4325
|
+
}) {
|
|
4326
|
+
const [p, g] = T(null), x = Rn[s], f = p ?? r, d = !o && !i;
|
|
4327
|
+
function m(b) {
|
|
4328
|
+
d && e(b);
|
|
4329
|
+
}
|
|
4330
|
+
return /* @__PURE__ */ t(
|
|
4331
|
+
"div",
|
|
4332
|
+
{
|
|
4333
|
+
className: h("inline-flex gap-0.5", l),
|
|
4334
|
+
style: c,
|
|
4335
|
+
onMouseLeave: () => d && g(null),
|
|
4336
|
+
children: Array.from({ length: n }, (b, y) => {
|
|
4337
|
+
const C = y + 1, S = f >= C, k = a && !S && f >= C - 0.5;
|
|
4338
|
+
return /* @__PURE__ */ t(
|
|
4339
|
+
"button",
|
|
4340
|
+
{
|
|
4341
|
+
type: "button",
|
|
4342
|
+
className: h(
|
|
4343
|
+
"inline-flex items-center justify-center rounded-md border-none bg-transparent p-0",
|
|
4344
|
+
d ? "cursor-pointer" : "cursor-default",
|
|
4345
|
+
S || k ? "text-warning" : "text-muted-foreground"
|
|
4346
|
+
),
|
|
4347
|
+
disabled: o,
|
|
4348
|
+
onClick: () => m(C),
|
|
4349
|
+
onMouseEnter: () => d && g(C),
|
|
4350
|
+
"aria-label": `Rate ${C} star${C !== 1 ? "s" : ""}`,
|
|
4351
|
+
children: /* @__PURE__ */ t(
|
|
4352
|
+
Rt,
|
|
4353
|
+
{
|
|
4354
|
+
size: x,
|
|
4355
|
+
fill: S || k ? "currentColor" : "none",
|
|
4356
|
+
strokeWidth: 1.5,
|
|
4357
|
+
style: k ? { clipPath: "inset(0 50% 0 0)" } : void 0
|
|
4358
|
+
}
|
|
4359
|
+
)
|
|
4360
|
+
},
|
|
4361
|
+
y
|
|
4362
|
+
);
|
|
4363
|
+
})
|
|
4364
|
+
}
|
|
4365
|
+
);
|
|
4366
|
+
}
|
|
4367
|
+
const Hn = { small: 48, medium: 64, large: 96 }, Un = { small: "0.75rem", medium: "0.875rem", large: "1rem" }, jn = { small: "4px", medium: "6px", large: "8px" }, Pn = {
|
|
4368
|
+
primary: "var(--primary)",
|
|
4369
|
+
success: "var(--success)",
|
|
4370
|
+
warning: "var(--warning)",
|
|
4371
|
+
destructive: "var(--destructive)"
|
|
4372
|
+
};
|
|
4373
|
+
function Bn(r, e) {
|
|
4374
|
+
return e == null ? "primary" : r >= e ? "success" : r >= e * 0.7 ? "warning" : "destructive";
|
|
4375
|
+
}
|
|
4376
|
+
function Fa({
|
|
4377
|
+
percentage: r,
|
|
4378
|
+
letterGrade: e,
|
|
4379
|
+
variant: n = "circular",
|
|
4380
|
+
size: a = "medium",
|
|
4381
|
+
passingThreshold: s,
|
|
4382
|
+
showLabel: o = !0,
|
|
4383
|
+
className: i,
|
|
4384
|
+
style: l
|
|
4385
|
+
}) {
|
|
4386
|
+
const c = Bn(r, s), p = Pn[c] ?? "var(--primary)";
|
|
4387
|
+
return n === "linear" ? /* @__PURE__ */ u("div", { className: h("flex flex-row items-center gap-1", i), style: l, children: [
|
|
4388
|
+
/* @__PURE__ */ t(
|
|
4389
|
+
"div",
|
|
4390
|
+
{
|
|
4391
|
+
className: "flex-1 bg-muted rounded-full overflow-hidden",
|
|
4392
|
+
style: { height: jn[a] },
|
|
4393
|
+
role: "progressbar",
|
|
4394
|
+
"aria-valuenow": Math.round(r),
|
|
4395
|
+
"aria-valuemin": 0,
|
|
4396
|
+
"aria-valuemax": 100,
|
|
4397
|
+
"aria-label": `Grade: ${e ?? `${Math.round(r)}%`}`,
|
|
4398
|
+
children: /* @__PURE__ */ t(
|
|
4399
|
+
"div",
|
|
4400
|
+
{
|
|
4401
|
+
className: "h-full rounded-full transition-[width] duration-300 ease-in-out",
|
|
4402
|
+
style: { width: `${r}%`, background: p }
|
|
4403
|
+
}
|
|
4404
|
+
)
|
|
4405
|
+
}
|
|
4406
|
+
),
|
|
4407
|
+
o && /* @__PURE__ */ t("span", { className: "font-semibold min-w-9", style: { fontSize: Un[a] }, children: e ?? `${Math.round(r)}%` })
|
|
4408
|
+
] }) : /* @__PURE__ */ t("div", { className: h("inline-flex flex-col items-center", i), style: l, children: /* @__PURE__ */ t(
|
|
4409
|
+
qe,
|
|
4410
|
+
{
|
|
4411
|
+
value: r,
|
|
4412
|
+
size: Hn[a],
|
|
4413
|
+
strokeWidth: a === "small" ? 4 : 6,
|
|
4414
|
+
color: p,
|
|
4415
|
+
label: e ?? `${Math.round(r)}%`
|
|
4416
|
+
}
|
|
4417
|
+
) });
|
|
4418
|
+
}
|
|
4419
|
+
const An = {
|
|
4420
|
+
up: "var(--success)",
|
|
4421
|
+
down: "var(--destructive)",
|
|
4422
|
+
flat: "var(--muted-foreground)"
|
|
4423
|
+
}, Fn = { up: jt, down: Ut, flat: Ht }, Va = L(function({
|
|
4424
|
+
icon: e,
|
|
4425
|
+
label: n,
|
|
4426
|
+
description: a,
|
|
4427
|
+
value: s,
|
|
4428
|
+
subtitle: o,
|
|
4429
|
+
trend: i,
|
|
4430
|
+
accent: l,
|
|
4431
|
+
className: c,
|
|
4432
|
+
style: p
|
|
4433
|
+
}) {
|
|
4434
|
+
const g = i ? Fn[i.direction] : null, x = D(
|
|
4435
|
+
() => ({
|
|
4436
|
+
backgroundColor: `color-mix(in oklch, ${l ?? "var(--primary)"} 10%, transparent)`,
|
|
4437
|
+
color: l ?? "var(--primary)"
|
|
4438
|
+
}),
|
|
4439
|
+
[l]
|
|
4440
|
+
);
|
|
4441
|
+
return /* @__PURE__ */ t(ye, { className: h(c), style: p, children: /* @__PURE__ */ u(Je, { className: "p-4", children: [
|
|
4442
|
+
e && /* @__PURE__ */ t(
|
|
4443
|
+
"div",
|
|
4444
|
+
{
|
|
4445
|
+
className: "mb-2 w-9 h-9 rounded-lg flex items-center justify-center [&>svg]:size-5",
|
|
4446
|
+
style: x,
|
|
4447
|
+
children: e
|
|
4448
|
+
}
|
|
4449
|
+
),
|
|
4450
|
+
/* @__PURE__ */ t("span", { className: "text-sm font-medium text-foreground", children: n }),
|
|
4451
|
+
a && /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground mt-0.5 leading-snug", children: a }),
|
|
4452
|
+
/* @__PURE__ */ u("div", { className: "flex flex-row items-baseline gap-1.5 mt-1", children: [
|
|
4453
|
+
/* @__PURE__ */ t("span", { className: "text-3xl font-bold tracking-tight", children: s }),
|
|
4454
|
+
i && g && /* @__PURE__ */ u("span", { className: "flex flex-row items-center gap-px", style: { color: An[i.direction] }, children: [
|
|
4455
|
+
/* @__PURE__ */ t(g, { size: 14 }),
|
|
4456
|
+
/* @__PURE__ */ u("span", { className: "text-xs font-semibold", children: [
|
|
4457
|
+
i.value > 0 ? "+" : "",
|
|
4458
|
+
i.value,
|
|
4459
|
+
"%"
|
|
4460
|
+
] })
|
|
4461
|
+
] })
|
|
4462
|
+
] }),
|
|
4463
|
+
o && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: o })
|
|
4464
|
+
] }) });
|
|
4465
|
+
}), Vn = {
|
|
4466
|
+
default: "text-primary",
|
|
4467
|
+
gold: "text-palette-3",
|
|
4468
|
+
silver: "text-muted-foreground",
|
|
4469
|
+
bronze: "text-palette-3/70"
|
|
4470
|
+
};
|
|
4471
|
+
function Oa({
|
|
4472
|
+
title: r,
|
|
4473
|
+
description: e,
|
|
4474
|
+
icon: n,
|
|
4475
|
+
earnedDate: a,
|
|
4476
|
+
locked: s = !1,
|
|
4477
|
+
variant: o = "default",
|
|
4478
|
+
className: i,
|
|
4479
|
+
style: l
|
|
4480
|
+
}) {
|
|
4481
|
+
return /* @__PURE__ */ u(
|
|
4482
|
+
ye,
|
|
4483
|
+
{
|
|
4484
|
+
className: h("p-2 text-center", s && "opacity-60", i),
|
|
4485
|
+
style: l,
|
|
4486
|
+
children: [
|
|
4487
|
+
/* @__PURE__ */ t("div", { className: "mx-auto mb-1 w-12 h-12 flex items-center justify-center", children: s ? /* @__PURE__ */ t(Pe, { size: 32, className: "text-muted-foreground" }) : n ?? /* @__PURE__ */ t(Pt, { size: 32, className: Vn[o] }) }),
|
|
4488
|
+
/* @__PURE__ */ t("p", { className: "font-semibold text-sm text-foreground", children: r }),
|
|
4489
|
+
e && /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: e }),
|
|
4490
|
+
a && !s && /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground mt-0.5", children: new Date(a).toLocaleDateString() })
|
|
4491
|
+
]
|
|
4492
|
+
}
|
|
4493
|
+
);
|
|
4494
|
+
}
|
|
4495
|
+
function Ka({
|
|
4496
|
+
currentStreak: r,
|
|
4497
|
+
longestStreak: e,
|
|
4498
|
+
unit: n = "days",
|
|
4499
|
+
showLongest: a = !1,
|
|
4500
|
+
className: s,
|
|
4501
|
+
style: o
|
|
4502
|
+
}) {
|
|
4503
|
+
return /* @__PURE__ */ u(
|
|
4504
|
+
"div",
|
|
4505
|
+
{
|
|
4506
|
+
className: h("flex items-center gap-2", s),
|
|
4507
|
+
style: o,
|
|
4508
|
+
children: [
|
|
4509
|
+
/* @__PURE__ */ t(Bt, { size: 20, className: "text-warning shrink-0" }),
|
|
4510
|
+
/* @__PURE__ */ u("div", { children: [
|
|
4511
|
+
/* @__PURE__ */ u("span", { className: "text-sm font-bold text-foreground", children: [
|
|
4512
|
+
r,
|
|
4513
|
+
" ",
|
|
4514
|
+
n
|
|
4515
|
+
] }),
|
|
4516
|
+
a && e != null && /* @__PURE__ */ u("span", { className: "block text-xs text-muted-foreground", children: [
|
|
4517
|
+
"Longest: ",
|
|
4518
|
+
e,
|
|
4519
|
+
" ",
|
|
4520
|
+
n
|
|
4521
|
+
] })
|
|
4522
|
+
] })
|
|
4523
|
+
]
|
|
4524
|
+
}
|
|
4525
|
+
);
|
|
4526
|
+
}
|
|
4527
|
+
function tt(r) {
|
|
4528
|
+
const e = new Date(r), a = (/* @__PURE__ */ new Date()).getTime() - e.getTime(), s = Math.floor(a / 6e4);
|
|
4529
|
+
if (s < 1) return "Just now";
|
|
4530
|
+
if (s < 60) return `${s}m ago`;
|
|
4531
|
+
const o = Math.floor(s / 60);
|
|
4532
|
+
if (o < 24) return `${o}h ago`;
|
|
4533
|
+
const i = Math.floor(o / 24);
|
|
4534
|
+
return i < 7 ? `${i}d ago` : e.toLocaleDateString();
|
|
4535
|
+
}
|
|
4536
|
+
const On = {
|
|
4537
|
+
lesson_completed: te,
|
|
4538
|
+
quiz_passed: he,
|
|
4539
|
+
assignment_submitted: Ee,
|
|
4540
|
+
badge_earned: At
|
|
4541
|
+
};
|
|
4542
|
+
function Qa({
|
|
4543
|
+
events: r,
|
|
4544
|
+
limit: e,
|
|
4545
|
+
showLoadMore: n = !1,
|
|
4546
|
+
onLoadMore: a,
|
|
4547
|
+
emptyMessage: s = "No recent activity",
|
|
4548
|
+
className: o,
|
|
4549
|
+
style: i
|
|
4550
|
+
}) {
|
|
4551
|
+
const l = e ? r.slice(0, e) : r;
|
|
4552
|
+
return r.length === 0 ? /* @__PURE__ */ t("p", { className: h("text-sm text-muted-foreground", o), style: i, children: s }) : /* @__PURE__ */ u("div", { className: h("relative", o), style: i, children: [
|
|
4553
|
+
/* @__PURE__ */ t("div", { className: "absolute left-3.5 top-0 bottom-0 w-px bg-border" }),
|
|
4554
|
+
l.map((c) => {
|
|
4555
|
+
const p = On[c.type] ?? je;
|
|
4556
|
+
return /* @__PURE__ */ u(
|
|
4557
|
+
"div",
|
|
4558
|
+
{
|
|
4559
|
+
className: "relative flex gap-3 pb-4 last:pb-0",
|
|
4560
|
+
children: [
|
|
4561
|
+
/* @__PURE__ */ t("div", { className: "relative z-10 shrink-0 w-7 h-7 rounded-full bg-background border border-border flex items-center justify-center", children: c.icon ?? /* @__PURE__ */ t(p, { size: 14, className: "text-muted-foreground" }) }),
|
|
4562
|
+
/* @__PURE__ */ u("div", { className: "flex-1 min-w-0 pt-0.5", children: [
|
|
4563
|
+
/* @__PURE__ */ t("p", { className: "text-sm font-medium text-foreground", children: c.title }),
|
|
4564
|
+
c.description && /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground mt-0.5", children: c.description }),
|
|
4565
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: tt(c.timestamp) })
|
|
4566
|
+
] })
|
|
4567
|
+
]
|
|
4568
|
+
},
|
|
4569
|
+
c.uid
|
|
4570
|
+
);
|
|
4571
|
+
}),
|
|
4572
|
+
n && a && /* @__PURE__ */ t("div", { className: "pl-10 pt-1", children: /* @__PURE__ */ t(R, { variant: "ghost", size: "sm", onClick: a, children: "Load more" }) })
|
|
4573
|
+
] });
|
|
4574
|
+
}
|
|
4575
|
+
const Kn = {
|
|
4576
|
+
pinned: "var(--warning)",
|
|
4577
|
+
answer: "var(--success)"
|
|
4578
|
+
}, Wa = L(function({
|
|
4579
|
+
author: e,
|
|
4580
|
+
content: n,
|
|
4581
|
+
createdAt: a,
|
|
4582
|
+
updatedAt: s,
|
|
4583
|
+
actions: o,
|
|
4584
|
+
highlight: i = "none",
|
|
4585
|
+
indentLevel: l = 0,
|
|
4586
|
+
className: c,
|
|
4587
|
+
style: p
|
|
4588
|
+
}) {
|
|
4589
|
+
const g = Kn[i];
|
|
4590
|
+
return /* @__PURE__ */ t(
|
|
4591
|
+
"div",
|
|
4592
|
+
{
|
|
4593
|
+
className: h("rounded-md border border-border p-3", c),
|
|
4594
|
+
style: {
|
|
4595
|
+
marginLeft: l ? `calc(${l} * 1rem)` : void 0,
|
|
4596
|
+
...g && {
|
|
4597
|
+
borderLeftWidth: "3px",
|
|
4598
|
+
borderLeftColor: g
|
|
4599
|
+
},
|
|
4600
|
+
...p
|
|
4601
|
+
},
|
|
4602
|
+
children: /* @__PURE__ */ u("div", { className: "flex gap-2", children: [
|
|
4603
|
+
/* @__PURE__ */ t(
|
|
4604
|
+
Xe,
|
|
4605
|
+
{
|
|
4606
|
+
displayName: e.displayName,
|
|
4607
|
+
avatarUrl: e.avatarUrl,
|
|
4608
|
+
role: e.role,
|
|
4609
|
+
size: "medium"
|
|
4610
|
+
}
|
|
4611
|
+
),
|
|
4612
|
+
/* @__PURE__ */ u("div", { className: "flex-1 min-w-0", children: [
|
|
4613
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-1.5 flex-wrap text-sm", children: [
|
|
4614
|
+
/* @__PURE__ */ t("span", { className: "font-semibold", children: e.displayName }),
|
|
4615
|
+
e.role && e.role !== "student" && /* @__PURE__ */ t("span", { className: "rounded-full bg-primary/10 px-1.5 py-0.5 text-xs font-medium text-primary capitalize", children: e.role }),
|
|
4616
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: tt(a) }),
|
|
4617
|
+
s && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground italic", children: "(edited)" }),
|
|
4618
|
+
i === "pinned" && /* @__PURE__ */ t(Ft, { size: 14 })
|
|
4619
|
+
] }),
|
|
4620
|
+
/* @__PURE__ */ t(
|
|
4621
|
+
"div",
|
|
4622
|
+
{
|
|
4623
|
+
className: "mt-1 text-sm [&_p]:mb-1 [&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5 [&_a]:text-primary [&_a]:underline",
|
|
4624
|
+
dangerouslySetInnerHTML: { __html: n }
|
|
4625
|
+
}
|
|
4626
|
+
),
|
|
4627
|
+
o && /* @__PURE__ */ u(ae, { children: [
|
|
4628
|
+
/* @__PURE__ */ t(K, { className: "my-2" }),
|
|
4629
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: o })
|
|
4630
|
+
] })
|
|
4631
|
+
] })
|
|
4632
|
+
] })
|
|
4633
|
+
}
|
|
4634
|
+
);
|
|
4635
|
+
}), Ne = "hydra_key_v", Qn = 300 * 1e3;
|
|
4636
|
+
function Wn(r) {
|
|
4637
|
+
try {
|
|
4638
|
+
const e = sessionStorage.getItem(Ne);
|
|
4639
|
+
if (e) {
|
|
4640
|
+
const { result: n, ts: a, key: s } = JSON.parse(e);
|
|
4641
|
+
if (s === r && Date.now() - a < Qn) return n;
|
|
4642
|
+
}
|
|
4643
|
+
} catch {
|
|
4644
|
+
}
|
|
4645
|
+
return null;
|
|
4646
|
+
}
|
|
4647
|
+
function Gn(r, e) {
|
|
4648
|
+
try {
|
|
4649
|
+
sessionStorage.setItem(Ne, JSON.stringify({ result: e, ts: Date.now(), key: r }));
|
|
4650
|
+
} catch {
|
|
4651
|
+
}
|
|
4652
|
+
}
|
|
4653
|
+
function Me(r) {
|
|
4654
|
+
try {
|
|
4655
|
+
const e = sessionStorage.getItem(Ne);
|
|
4656
|
+
if (e) {
|
|
4657
|
+
const { result: n, key: a } = JSON.parse(e);
|
|
4658
|
+
if (a === r && n === "valid-pro") return "valid-pro";
|
|
4659
|
+
}
|
|
4660
|
+
} catch {
|
|
4661
|
+
}
|
|
4662
|
+
return "invalid";
|
|
4663
|
+
}
|
|
4664
|
+
async function Yn(r, e) {
|
|
4665
|
+
if (!e) return "skip";
|
|
4666
|
+
if (!r) return "no-key";
|
|
4667
|
+
const n = Wn(r);
|
|
4668
|
+
if (n) return n;
|
|
4669
|
+
try {
|
|
4670
|
+
const a = await fetch(`${e}?key=${encodeURIComponent(r)}`, {
|
|
4671
|
+
method: "GET",
|
|
4672
|
+
signal: AbortSignal.timeout(4e3)
|
|
4673
|
+
});
|
|
4674
|
+
if (!a.ok) return Me(r);
|
|
4675
|
+
const s = await a.json();
|
|
4676
|
+
let o;
|
|
4677
|
+
return s.valid ? s.plan === "pro" || s.plan === "enterprise" ? o = "valid-pro" : o = "valid-free" : o = "invalid", Gn(r, o), o;
|
|
4678
|
+
} catch {
|
|
4679
|
+
return Me(r);
|
|
4680
|
+
}
|
|
4681
|
+
}
|
|
4682
|
+
const rt = Q({
|
|
4683
|
+
plan: "free",
|
|
4684
|
+
isPro: !1
|
|
4685
|
+
});
|
|
4686
|
+
function Zn(r) {
|
|
4687
|
+
switch (r) {
|
|
4688
|
+
case "valid-pro":
|
|
4689
|
+
case "skip":
|
|
4690
|
+
return "pro";
|
|
4691
|
+
case "valid-free":
|
|
4692
|
+
case "no-key":
|
|
4693
|
+
return "free";
|
|
4694
|
+
case "invalid":
|
|
4695
|
+
return "invalid";
|
|
4696
|
+
}
|
|
4697
|
+
}
|
|
4698
|
+
function Ga({ licenseKey: r, validateUrl: e = "", children: n }) {
|
|
4699
|
+
const [a, s] = T(() => e ? r ? "validating" : "free" : "pro");
|
|
4700
|
+
return H(() => {
|
|
4701
|
+
if (!e) {
|
|
4702
|
+
s("pro");
|
|
4703
|
+
return;
|
|
4704
|
+
}
|
|
4705
|
+
let o = !1;
|
|
4706
|
+
return Yn(r ?? null, e).then((i) => {
|
|
4707
|
+
o || s(Zn(i));
|
|
4708
|
+
}), () => {
|
|
4709
|
+
o = !0;
|
|
4710
|
+
};
|
|
4711
|
+
}, [r, e]), /* @__PURE__ */ t(rt.Provider, { value: { plan: a, isPro: a === "pro" }, children: n });
|
|
4712
|
+
}
|
|
4713
|
+
const nt = Q(null);
|
|
4714
|
+
function at() {
|
|
4715
|
+
const r = W(nt);
|
|
4716
|
+
if (!r) throw new Error("Tabs compound components must be used within <Tabs>");
|
|
4717
|
+
return r;
|
|
4718
|
+
}
|
|
4719
|
+
function Ya({
|
|
4720
|
+
value: r,
|
|
4721
|
+
defaultValue: e,
|
|
4722
|
+
onValueChange: n,
|
|
4723
|
+
className: a,
|
|
4724
|
+
...s
|
|
4725
|
+
}) {
|
|
4726
|
+
const [o, i] = T(e ?? ""), l = r ?? o, c = E(
|
|
4727
|
+
(p) => {
|
|
4728
|
+
r === void 0 && i(p), n == null || n(p);
|
|
4729
|
+
},
|
|
4730
|
+
[r, n]
|
|
4731
|
+
);
|
|
4732
|
+
return /* @__PURE__ */ t(nt.Provider, { value: { selectedValue: l, onSelect: c }, children: /* @__PURE__ */ t("div", { "data-slot": "tabs", className: a, ...s }) });
|
|
4733
|
+
}
|
|
4734
|
+
function Za({
|
|
4735
|
+
className: r,
|
|
4736
|
+
children: e,
|
|
4737
|
+
...n
|
|
4738
|
+
}) {
|
|
4739
|
+
const a = I(null), s = (o) => {
|
|
4740
|
+
if (o.key !== "ArrowLeft" && o.key !== "ArrowRight") return;
|
|
4741
|
+
const i = a.current;
|
|
4742
|
+
if (!i) return;
|
|
4743
|
+
const l = Array.from(
|
|
4744
|
+
i.querySelectorAll('[role="tab"]:not([disabled])')
|
|
4745
|
+
), c = l.indexOf(document.activeElement);
|
|
4746
|
+
if (c === -1) return;
|
|
4747
|
+
o.preventDefault();
|
|
4748
|
+
const p = o.key === "ArrowRight" ? (c + 1) % l.length : (c - 1 + l.length) % l.length;
|
|
4749
|
+
l[p].focus();
|
|
4750
|
+
};
|
|
4751
|
+
return /* @__PURE__ */ t(
|
|
4752
|
+
"div",
|
|
4753
|
+
{
|
|
4754
|
+
ref: a,
|
|
4755
|
+
role: "tablist",
|
|
4756
|
+
"data-slot": "tabs-list",
|
|
4757
|
+
className: h(
|
|
4758
|
+
"inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
|
|
4759
|
+
r
|
|
4760
|
+
),
|
|
4761
|
+
onKeyDown: s,
|
|
4762
|
+
...n,
|
|
4763
|
+
children: e
|
|
4764
|
+
}
|
|
4765
|
+
);
|
|
4766
|
+
}
|
|
4767
|
+
function Ja({ value: r, className: e, ...n }) {
|
|
4768
|
+
const { selectedValue: a, onSelect: s } = at(), o = a === r;
|
|
4769
|
+
return /* @__PURE__ */ t(
|
|
4770
|
+
"button",
|
|
4771
|
+
{
|
|
4772
|
+
role: "tab",
|
|
4773
|
+
type: "button",
|
|
4774
|
+
"data-slot": "tabs-trigger",
|
|
4775
|
+
"aria-selected": o,
|
|
4776
|
+
...o ? { "data-selected": "" } : {},
|
|
4777
|
+
className: h(
|
|
4778
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 data-selected:bg-background data-selected:text-foreground data-selected:shadow-sm",
|
|
4779
|
+
e
|
|
4780
|
+
),
|
|
4781
|
+
onClick: () => s(r),
|
|
4782
|
+
...n
|
|
4783
|
+
}
|
|
4784
|
+
);
|
|
4785
|
+
}
|
|
4786
|
+
function Xa({ value: r, className: e, ...n }) {
|
|
4787
|
+
const { selectedValue: a } = at();
|
|
4788
|
+
return a !== r ? null : /* @__PURE__ */ t(
|
|
4789
|
+
"div",
|
|
4790
|
+
{
|
|
4791
|
+
role: "tabpanel",
|
|
4792
|
+
"data-slot": "tabs-content",
|
|
4793
|
+
className: h("pt-2", e),
|
|
4794
|
+
...n
|
|
4795
|
+
}
|
|
4796
|
+
);
|
|
4797
|
+
}
|
|
4798
|
+
function Jn() {
|
|
4799
|
+
return W(rt);
|
|
4800
|
+
}
|
|
4801
|
+
function Xn({ children: r, feature: e }) {
|
|
4802
|
+
return /* @__PURE__ */ u("div", { style: { position: "relative" }, children: [
|
|
4803
|
+
r,
|
|
4804
|
+
/* @__PURE__ */ u(
|
|
4805
|
+
"a",
|
|
4806
|
+
{
|
|
4807
|
+
href: "https://hydralms.com/pro",
|
|
4808
|
+
target: "_blank",
|
|
4809
|
+
rel: "noopener noreferrer",
|
|
4810
|
+
style: {
|
|
4811
|
+
position: "absolute",
|
|
4812
|
+
bottom: 14,
|
|
4813
|
+
right: 16,
|
|
4814
|
+
zIndex: 9999,
|
|
4815
|
+
display: "flex",
|
|
4816
|
+
alignItems: "center",
|
|
4817
|
+
gap: 5,
|
|
4818
|
+
padding: "4px 10px 4px 8px",
|
|
4819
|
+
background: "rgba(0,0,0,0.5)",
|
|
4820
|
+
backdropFilter: "blur(6px)",
|
|
4821
|
+
borderRadius: 20,
|
|
4822
|
+
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
4823
|
+
fontSize: 11,
|
|
4824
|
+
fontWeight: 500,
|
|
4825
|
+
color: "rgba(255,255,255,0.85)",
|
|
4826
|
+
letterSpacing: "0.01em",
|
|
4827
|
+
whiteSpace: "nowrap",
|
|
4828
|
+
lineHeight: 1,
|
|
4829
|
+
pointerEvents: "auto",
|
|
4830
|
+
textDecoration: "none"
|
|
4831
|
+
},
|
|
4832
|
+
title: e ? `"${e}" is a HydraLMS Pro module` : "Upgrade to HydraLMS Pro",
|
|
4833
|
+
children: [
|
|
4834
|
+
/* @__PURE__ */ t("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", style: { opacity: 0.8 }, children: /* @__PURE__ */ t("path", { d: "M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z" }) }),
|
|
4835
|
+
"HydraLMS Pro"
|
|
4836
|
+
]
|
|
4837
|
+
}
|
|
4838
|
+
)
|
|
4839
|
+
] });
|
|
4840
|
+
}
|
|
4841
|
+
function qa(r, e) {
|
|
4842
|
+
const n = (a) => {
|
|
4843
|
+
const { isPro: s } = Jn();
|
|
4844
|
+
return s ? /* @__PURE__ */ t(r, { ...a }) : /* @__PURE__ */ t(Xn, { feature: e, children: /* @__PURE__ */ t(r, { ...a }) });
|
|
4845
|
+
};
|
|
4846
|
+
return n.displayName = `ProGated(${e})`, n;
|
|
4847
|
+
}
|
|
4848
|
+
export {
|
|
4849
|
+
ya as $,
|
|
4850
|
+
Oa as A,
|
|
4851
|
+
pe as B,
|
|
4852
|
+
ye as C,
|
|
4853
|
+
Sa as D,
|
|
4854
|
+
_a as E,
|
|
4855
|
+
rr as F,
|
|
4856
|
+
Xr as G,
|
|
4857
|
+
Ga as H,
|
|
4858
|
+
Ea as I,
|
|
4859
|
+
sn as J,
|
|
4860
|
+
Ia as K,
|
|
4861
|
+
cn as L,
|
|
4862
|
+
Ca as M,
|
|
4863
|
+
Hr as N,
|
|
4864
|
+
jr as O,
|
|
4865
|
+
Na as P,
|
|
4866
|
+
Ar as Q,
|
|
4867
|
+
Vr as R,
|
|
4868
|
+
Pr as S,
|
|
4869
|
+
xa as T,
|
|
4870
|
+
ha as U,
|
|
4871
|
+
Br as V,
|
|
4872
|
+
ba as W,
|
|
4873
|
+
va as X,
|
|
4874
|
+
Ur as Y,
|
|
4875
|
+
Fr as Z,
|
|
4876
|
+
ga as _,
|
|
4877
|
+
wr as a,
|
|
4878
|
+
ve as a$,
|
|
4879
|
+
Ha as a0,
|
|
4880
|
+
tn as a1,
|
|
4881
|
+
Ma as a2,
|
|
4882
|
+
ir as a3,
|
|
4883
|
+
Pa as a4,
|
|
4884
|
+
wa as a5,
|
|
4885
|
+
ar as a6,
|
|
4886
|
+
Gr as a7,
|
|
4887
|
+
Zr as a8,
|
|
4888
|
+
Fa as a9,
|
|
4889
|
+
Ra as aA,
|
|
4890
|
+
Ua as aB,
|
|
4891
|
+
Ka as aC,
|
|
4892
|
+
Be as aD,
|
|
4893
|
+
Fe as aE,
|
|
4894
|
+
br as aF,
|
|
4895
|
+
q as aG,
|
|
4896
|
+
xr as aH,
|
|
4897
|
+
me as aI,
|
|
4898
|
+
Ae as aJ,
|
|
4899
|
+
re as aK,
|
|
4900
|
+
Ya as aL,
|
|
4901
|
+
Xa as aM,
|
|
4902
|
+
Za as aN,
|
|
4903
|
+
Ja as aO,
|
|
4904
|
+
Cr as aP,
|
|
4905
|
+
Dr as aQ,
|
|
4906
|
+
Mr as aR,
|
|
4907
|
+
Ir as aS,
|
|
4908
|
+
nr as aT,
|
|
4909
|
+
Xe as aU,
|
|
4910
|
+
Or as aV,
|
|
4911
|
+
er as aW,
|
|
4912
|
+
dn as aX,
|
|
4913
|
+
ie as aY,
|
|
4914
|
+
Rr as aZ,
|
|
4915
|
+
Kr as a_,
|
|
4916
|
+
mr as aa,
|
|
4917
|
+
rt as ab,
|
|
4918
|
+
gr as ac,
|
|
4919
|
+
be as ad,
|
|
4920
|
+
ln as ae,
|
|
4921
|
+
Ba as af,
|
|
4922
|
+
ur as ag,
|
|
4923
|
+
tr as ah,
|
|
4924
|
+
lr as ai,
|
|
4925
|
+
dr as aj,
|
|
4926
|
+
ja as ak,
|
|
4927
|
+
Wa as al,
|
|
4928
|
+
Xn as am,
|
|
4929
|
+
qe as an,
|
|
4930
|
+
pa as ao,
|
|
4931
|
+
ka as ap,
|
|
4932
|
+
Tr as aq,
|
|
4933
|
+
Ve as ar,
|
|
4934
|
+
or as as,
|
|
4935
|
+
hr as at,
|
|
4936
|
+
$a as au,
|
|
4937
|
+
K as av,
|
|
4938
|
+
qr as aw,
|
|
4939
|
+
yr as ax,
|
|
4940
|
+
Aa as ay,
|
|
4941
|
+
Va as az,
|
|
4942
|
+
Qa as b,
|
|
4943
|
+
Nr as b0,
|
|
4944
|
+
Jn as b1,
|
|
4945
|
+
qa as b2,
|
|
4946
|
+
Ze as b3,
|
|
4947
|
+
cr as b4,
|
|
4948
|
+
fa as b5,
|
|
4949
|
+
tt as b6,
|
|
4950
|
+
Yr as b7,
|
|
4951
|
+
h as c,
|
|
4952
|
+
U as d,
|
|
4953
|
+
j as e,
|
|
4954
|
+
ne as f,
|
|
4955
|
+
xn as g,
|
|
4956
|
+
Sn as h,
|
|
4957
|
+
vn as i,
|
|
4958
|
+
_n as j,
|
|
4959
|
+
yn as k,
|
|
4960
|
+
Cn as l,
|
|
4961
|
+
wn as m,
|
|
4962
|
+
Nn as n,
|
|
4963
|
+
bn as o,
|
|
4964
|
+
kn as p,
|
|
4965
|
+
La as q,
|
|
4966
|
+
ua as r,
|
|
4967
|
+
ma as s,
|
|
4968
|
+
nn as t,
|
|
4969
|
+
Jr as u,
|
|
4970
|
+
R as v,
|
|
4971
|
+
za as w,
|
|
4972
|
+
Je as x,
|
|
4973
|
+
Ta as y,
|
|
4974
|
+
Da as z
|
|
4975
|
+
};
|