@hydralms/components 0.2.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.
Files changed (302) hide show
  1. package/dist/StudentProfile-BPsZBaJj.cjs +1 -0
  2. package/dist/StudentProfile-Cw2p-RZn.js +3273 -0
  3. package/dist/assessment-toolbar/question-navigator.d.ts +1 -1
  4. package/dist/assessment-toolbar/timer-display.d.ts +1 -1
  5. package/dist/common/index.d.ts +2 -1
  6. package/dist/common/pagination.d.ts +26 -0
  7. package/dist/common/types.d.ts +1 -0
  8. package/dist/components.css +1 -1
  9. package/dist/content/audio-player.d.ts +22 -0
  10. package/dist/content/code-block.d.ts +30 -0
  11. package/dist/content/embed-block.d.ts +28 -0
  12. package/dist/content/index.d.ts +6 -0
  13. package/dist/content/types.d.ts +24 -0
  14. package/dist/curriculum/course-card.d.ts +51 -0
  15. package/dist/curriculum/index.d.ts +2 -0
  16. package/dist/curriculum/types.d.ts +2 -2
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.d.ts +1 -0
  19. package/dist/index.js +495 -439
  20. package/dist/license/HydraContext.d.ts +16 -0
  21. package/dist/license/ProBadge.d.ts +6 -0
  22. package/dist/license/index.d.ts +7 -0
  23. package/dist/license/tiers.d.ts +6 -0
  24. package/dist/license/useHydraLicense.d.ts +6 -0
  25. package/dist/license/validate.d.ts +13 -0
  26. package/dist/license/withProGate.d.ts +6 -0
  27. package/dist/modules/AssignmentModule/AssignmentModule.d.ts +4 -7
  28. package/dist/modules/AssignmentModule/types.d.ts +5 -1
  29. package/dist/modules/CertificateModule/CertificateModule.d.ts +4 -8
  30. package/dist/modules/CertificateModule/types.d.ts +6 -4
  31. package/dist/modules/CourseCatalogModule/CourseCatalogModule.d.ts +5 -0
  32. package/dist/modules/CourseCatalogModule/types.d.ts +43 -0
  33. package/dist/modules/CoursePlayer/CoursePlayer.d.ts +4 -1
  34. package/dist/modules/DiscussionModule/DiscussionModule.d.ts +4 -7
  35. package/dist/modules/ExamModule/ExamModule.d.ts +4 -7
  36. package/dist/modules/ExamModule/types.d.ts +5 -14
  37. package/dist/modules/FlashcardLab/FlashcardLab.d.ts +4 -1
  38. package/dist/modules/FlashcardLab/types.d.ts +2 -0
  39. package/dist/modules/GradeCenterModule/GradeCenterModule.d.ts +4 -8
  40. package/dist/modules/GradeCenterModule/types.d.ts +2 -0
  41. package/dist/modules/QuizModule/QuizModule.d.ts +4 -1
  42. package/dist/modules/QuizModule/types.d.ts +5 -14
  43. package/dist/modules/StudentDashboardModule/StudentDashboardModule.d.ts +5 -0
  44. package/dist/modules/StudentDashboardModule/types.d.ts +54 -0
  45. package/dist/modules/StudentProfileModule/StudentProfileModule.d.ts +5 -0
  46. package/dist/modules/StudentProfileModule/types.d.ts +43 -0
  47. package/dist/modules/SurveyModule/SurveyModule.d.ts +4 -6
  48. package/dist/modules/SurveyModule/types.d.ts +2 -0
  49. package/dist/modules/_shared/assessment-intro.d.ts +16 -0
  50. package/dist/modules/_shared/assessment-results.d.ts +23 -0
  51. package/dist/modules/_shared/types.d.ts +10 -0
  52. package/dist/modules/_shared/use-timer.d.ts +9 -0
  53. package/dist/modules/index.d.ts +6 -0
  54. package/dist/modules.cjs +1 -1
  55. package/dist/modules.js +1267 -854
  56. package/dist/progress/types.d.ts +2 -0
  57. package/dist/provider/HydraProvider.d.ts +5 -1
  58. package/dist/questions/choice.d.ts +1 -1
  59. package/dist/questions/confidence-indicator.d.ts +37 -0
  60. package/dist/questions/essay.d.ts +1 -1
  61. package/dist/questions/fill-in-the-blank.d.ts +1 -1
  62. package/dist/questions/hotspot.d.ts +1 -1
  63. package/dist/questions/index.d.ts +2 -0
  64. package/dist/questions/inline-choice.d.ts +1 -1
  65. package/dist/questions/matching.d.ts +1 -1
  66. package/dist/questions/multiple-choice.d.ts +1 -1
  67. package/dist/questions/numeric.d.ts +1 -1
  68. package/dist/questions/ordering.d.ts +1 -1
  69. package/dist/questions/question-renderer.d.ts +1 -1
  70. package/dist/questions/scenario.d.ts +1 -1
  71. package/dist/questions/spreadsheet.d.ts +1 -1
  72. package/dist/questions/true-false.d.ts +1 -1
  73. package/dist/sections/AdaptiveLearningPath/AdaptiveLearningPath.d.ts +5 -0
  74. package/dist/sections/AdaptiveLearningPath/path-connector.d.ts +8 -0
  75. package/dist/sections/AdaptiveLearningPath/path-milestone-marker.d.ts +7 -0
  76. package/dist/sections/AdaptiveLearningPath/path-node-card.d.ts +10 -0
  77. package/dist/sections/AdaptiveLearningPath/path-skill-bar.d.ts +8 -0
  78. package/dist/sections/AdaptiveLearningPath/types.d.ts +136 -0
  79. package/dist/sections/AnnouncementFeed/AnnouncementFeed.d.ts +1 -1
  80. package/dist/sections/AnnouncementFeed/types.d.ts +15 -1
  81. package/dist/sections/AssessmentReview/AssessmentReview.d.ts +1 -1
  82. package/dist/sections/AssessmentReview/types.d.ts +6 -0
  83. package/dist/sections/AssignmentSubmission/AssignmentSubmission.d.ts +1 -1
  84. package/dist/sections/AssignmentSubmission/types.d.ts +6 -0
  85. package/dist/sections/CertificateViewer/CertificateViewer.d.ts +1 -1
  86. package/dist/sections/CertificateViewer/certificate-variants.d.ts +42 -0
  87. package/dist/sections/CertificateViewer/types.d.ts +6 -0
  88. package/dist/sections/ContentAuthoringStudio/ContentAuthoringStudio.d.ts +5 -0
  89. package/dist/sections/ContentAuthoringStudio/block-editor-item.d.ts +14 -0
  90. package/dist/sections/ContentAuthoringStudio/block-type-picker.d.ts +12 -0
  91. package/dist/sections/ContentAuthoringStudio/types.d.ts +67 -0
  92. package/dist/sections/CourseCatalog/CourseCatalog.d.ts +2 -0
  93. package/dist/sections/CourseCatalog/types.d.ts +80 -0
  94. package/dist/sections/CourseOutline/CourseOutline.d.ts +1 -1
  95. package/dist/sections/CourseOutline/types.d.ts +6 -0
  96. package/dist/sections/DiscussionThread/DiscussionThread.d.ts +1 -1
  97. package/dist/sections/DiscussionThread/types.d.ts +6 -0
  98. package/dist/sections/EnrollmentWizard/EnrollmentWizard.d.ts +2 -0
  99. package/dist/sections/EnrollmentWizard/types.d.ts +66 -0
  100. package/dist/sections/ExamSession/ExamSession.d.ts +1 -1
  101. package/dist/sections/ExamSession/types.d.ts +6 -0
  102. package/dist/sections/FlashcardStudySession/FlashcardStudySession.d.ts +1 -1
  103. package/dist/sections/FlashcardStudySession/types.d.ts +6 -0
  104. package/dist/sections/ForumBoard/ForumBoard.d.ts +1 -1
  105. package/dist/sections/ForumBoard/types.d.ts +14 -0
  106. package/dist/sections/GradebookTable/GradebookTable.d.ts +1 -1
  107. package/dist/sections/GradebookTable/types.d.ts +14 -0
  108. package/dist/sections/LecturePlayer/LecturePlayer.d.ts +1 -1
  109. package/dist/sections/LecturePlayer/types.d.ts +8 -0
  110. package/dist/sections/LessonPage/LessonPage.d.ts +1 -1
  111. package/dist/sections/LessonPage/types.d.ts +6 -0
  112. package/dist/sections/PracticeQuiz/PracticeQuiz.d.ts +1 -1
  113. package/dist/sections/PracticeQuiz/types.d.ts +6 -0
  114. package/dist/sections/ProgressDashboard/ProgressDashboard.d.ts +1 -1
  115. package/dist/sections/ProgressDashboard/types.d.ts +6 -0
  116. package/dist/sections/QuizSession/QuizSession.d.ts +1 -1
  117. package/dist/sections/QuizSession/types.d.ts +6 -0
  118. package/dist/sections/RequirementsChecklist/RequirementsChecklist.d.ts +1 -1
  119. package/dist/sections/RequirementsChecklist/types.d.ts +6 -0
  120. package/dist/sections/ResourceLibrary/ResourceLibrary.d.ts +1 -1
  121. package/dist/sections/ResourceLibrary/types.d.ts +15 -1
  122. package/dist/sections/RubricView/RubricView.d.ts +1 -1
  123. package/dist/sections/RubricView/types.d.ts +6 -0
  124. package/dist/sections/ScrollableQuiz/ScrollableQuiz.d.ts +1 -1
  125. package/dist/sections/ScrollableQuiz/types.d.ts +6 -0
  126. package/dist/sections/StudentProfile/StudentProfile.d.ts +2 -0
  127. package/dist/sections/StudentProfile/types.d.ts +98 -0
  128. package/dist/sections/SurveyForm/SurveyForm.d.ts +1 -1
  129. package/dist/sections/SurveyForm/types.d.ts +6 -0
  130. package/dist/sections/_shared/merge-answers.d.ts +9 -0
  131. package/dist/sections/_shared/section-shell.d.ts +20 -0
  132. package/dist/sections/_shared/use-assessment-session.d.ts +30 -0
  133. package/dist/sections/index.d.ts +10 -0
  134. package/dist/sections.cjs +1 -1
  135. package/dist/sections.js +1361 -307
  136. package/dist/ui/badge.d.ts +1 -1
  137. package/dist/ui/index.d.ts +2 -0
  138. package/dist/ui/progress.d.ts +1 -1
  139. package/dist/ui/rich-text-editor.d.ts +3 -1
  140. package/dist/ui/toast.d.ts +43 -0
  141. package/dist/utils/debounce.d.ts +5 -1
  142. package/dist/utils/pick-palette-color.d.ts +19 -0
  143. package/dist/video/types.d.ts +15 -0
  144. package/dist/video/video-player.d.ts +1 -1
  145. package/dist/withProGate-BJdu1T9Y.cjs +2 -0
  146. package/dist/withProGate-BvFc7Jwy.js +4975 -0
  147. package/package.json +57 -226
  148. package/src/assessment-toolbar/question-navigator.tsx +10 -5
  149. package/src/assessment-toolbar/timer-display.tsx +4 -3
  150. package/src/assessment-toolbar/use-countdown.ts +1 -1
  151. package/src/common/empty-state.tsx +1 -0
  152. package/src/common/index.ts +2 -0
  153. package/src/common/pagination.tsx +135 -0
  154. package/src/common/search-input.tsx +2 -1
  155. package/src/common/types.ts +2 -0
  156. package/src/content/attachment-list.tsx +2 -0
  157. package/src/content/audio-player.tsx +196 -0
  158. package/src/content/code-block.tsx +113 -0
  159. package/src/content/content-block.tsx +64 -0
  160. package/src/content/embed-block.tsx +78 -0
  161. package/src/content/file-upload-zone.tsx +10 -0
  162. package/src/content/index.ts +6 -0
  163. package/src/content/types.ts +5 -0
  164. package/src/curriculum/course-card.tsx +199 -0
  165. package/src/curriculum/curriculum-item.tsx +3 -3
  166. package/src/curriculum/curriculum-tree.tsx +20 -13
  167. package/src/curriculum/index.ts +2 -0
  168. package/src/curriculum/types.ts +2 -2
  169. package/src/flashcards/flashcard.tsx +28 -8
  170. package/src/index.ts +3 -0
  171. package/src/license/HydraContext.tsx +62 -0
  172. package/src/license/ProBadge.tsx +43 -0
  173. package/src/license/index.ts +7 -0
  174. package/src/license/tiers.ts +34 -0
  175. package/src/license/useHydraLicense.ts +10 -0
  176. package/src/license/validate.ts +90 -0
  177. package/src/license/withProGate.tsx +21 -0
  178. package/src/modules/AssignmentModule/AssignmentModule.tsx +17 -8
  179. package/src/modules/AssignmentModule/types.ts +5 -1
  180. package/src/modules/CertificateModule/CertificateModule.tsx +21 -9
  181. package/src/modules/CertificateModule/types.ts +6 -4
  182. package/src/modules/CourseCatalogModule/CourseCatalogModule.tsx +126 -0
  183. package/src/modules/CourseCatalogModule/types.ts +47 -0
  184. package/src/modules/CoursePlayer/CoursePlayer.tsx +39 -22
  185. package/src/modules/DiscussionModule/DiscussionModule.tsx +57 -22
  186. package/src/modules/ExamModule/ExamModule.tsx +64 -198
  187. package/src/modules/ExamModule/types.ts +5 -14
  188. package/src/modules/FlashcardLab/FlashcardLab.tsx +10 -5
  189. package/src/modules/FlashcardLab/types.ts +2 -0
  190. package/src/modules/GradeCenterModule/GradeCenterModule.tsx +7 -2
  191. package/src/modules/GradeCenterModule/types.ts +2 -0
  192. package/src/modules/QuizModule/QuizModule.tsx +49 -169
  193. package/src/modules/QuizModule/types.ts +5 -15
  194. package/src/modules/StudentDashboardModule/StudentDashboardModule.tsx +117 -0
  195. package/src/modules/StudentDashboardModule/types.ts +56 -0
  196. package/src/modules/StudentProfileModule/StudentProfileModule.tsx +289 -0
  197. package/src/modules/StudentProfileModule/types.ts +45 -0
  198. package/src/modules/SurveyModule/SurveyModule.tsx +9 -4
  199. package/src/modules/SurveyModule/types.ts +2 -0
  200. package/src/modules/_shared/assessment-intro.tsx +75 -0
  201. package/src/modules/_shared/assessment-results.tsx +133 -0
  202. package/src/modules/_shared/types.ts +11 -0
  203. package/src/modules/_shared/use-timer.ts +49 -0
  204. package/src/modules/index.ts +9 -0
  205. package/src/progress/achievement-badge.tsx +3 -3
  206. package/src/progress/grade-indicator.tsx +9 -1
  207. package/src/progress/progress-ring.tsx +2 -1
  208. package/src/progress/stat-card.tsx +14 -2
  209. package/src/progress/types.ts +2 -0
  210. package/src/provider/HydraProvider.tsx +15 -6
  211. package/src/questions/choice.tsx +13 -6
  212. package/src/questions/confidence-indicator.tsx +107 -0
  213. package/src/questions/essay.tsx +6 -4
  214. package/src/questions/fill-in-the-blank.tsx +8 -4
  215. package/src/questions/hotspot.tsx +4 -4
  216. package/src/questions/index.ts +2 -0
  217. package/src/questions/inline-choice.tsx +5 -4
  218. package/src/questions/matching.tsx +5 -4
  219. package/src/questions/multiple-choice.tsx +13 -6
  220. package/src/questions/numeric.tsx +8 -4
  221. package/src/questions/ordering.tsx +12 -4
  222. package/src/questions/question-renderer.tsx +3 -2
  223. package/src/questions/scenario.tsx +4 -4
  224. package/src/questions/spreadsheet.tsx +5 -4
  225. package/src/questions/true-false.tsx +13 -6
  226. package/src/sections/AdaptiveLearningPath/AdaptiveLearningPath.tsx +251 -0
  227. package/src/sections/AdaptiveLearningPath/path-connector.tsx +27 -0
  228. package/src/sections/AdaptiveLearningPath/path-milestone-marker.tsx +50 -0
  229. package/src/sections/AdaptiveLearningPath/path-node-card.tsx +166 -0
  230. package/src/sections/AdaptiveLearningPath/path-skill-bar.tsx +49 -0
  231. package/src/sections/AdaptiveLearningPath/types.ts +159 -0
  232. package/src/sections/AnnouncementFeed/AnnouncementFeed.tsx +64 -8
  233. package/src/sections/AnnouncementFeed/types.ts +15 -1
  234. package/src/sections/AssessmentReview/AssessmentReview.tsx +37 -0
  235. package/src/sections/AssessmentReview/types.ts +6 -0
  236. package/src/sections/AssignmentSubmission/AssignmentSubmission.tsx +37 -1
  237. package/src/sections/AssignmentSubmission/types.ts +6 -0
  238. package/src/sections/CertificateViewer/CertificateViewer.tsx +29 -227
  239. package/src/sections/CertificateViewer/certificate-variants.tsx +170 -0
  240. package/src/sections/CertificateViewer/types.ts +6 -0
  241. package/src/sections/ContentAuthoringStudio/ContentAuthoringStudio.tsx +289 -0
  242. package/src/sections/ContentAuthoringStudio/block-editor-item.tsx +487 -0
  243. package/src/sections/ContentAuthoringStudio/block-type-picker.tsx +123 -0
  244. package/src/sections/ContentAuthoringStudio/types.ts +67 -0
  245. package/src/sections/CourseCatalog/CourseCatalog.tsx +220 -0
  246. package/src/sections/CourseCatalog/types.ts +76 -0
  247. package/src/sections/CourseOutline/CourseOutline.tsx +41 -0
  248. package/src/sections/CourseOutline/types.ts +6 -0
  249. package/src/sections/DiscussionThread/DiscussionThread.tsx +42 -1
  250. package/src/sections/DiscussionThread/types.ts +6 -0
  251. package/src/sections/EnrollmentWizard/EnrollmentWizard.tsx +343 -0
  252. package/src/sections/EnrollmentWizard/types.ts +65 -0
  253. package/src/sections/ExamSession/ExamSession.tsx +100 -94
  254. package/src/sections/ExamSession/types.ts +6 -0
  255. package/src/sections/FlashcardStudySession/FlashcardStudySession.tsx +53 -36
  256. package/src/sections/FlashcardStudySession/types.ts +6 -0
  257. package/src/sections/ForumBoard/ForumBoard.tsx +67 -7
  258. package/src/sections/ForumBoard/types.ts +14 -0
  259. package/src/sections/GradebookTable/GradebookTable.tsx +54 -1
  260. package/src/sections/GradebookTable/types.ts +14 -0
  261. package/src/sections/LecturePlayer/LecturePlayer.tsx +63 -37
  262. package/src/sections/LecturePlayer/types.ts +8 -0
  263. package/src/sections/LessonPage/LessonPage.tsx +34 -6
  264. package/src/sections/LessonPage/types.ts +6 -0
  265. package/src/sections/PracticeQuiz/PracticeQuiz.tsx +106 -74
  266. package/src/sections/PracticeQuiz/types.ts +6 -0
  267. package/src/sections/ProgressDashboard/ProgressDashboard.tsx +64 -10
  268. package/src/sections/ProgressDashboard/types.ts +6 -0
  269. package/src/sections/QuizSession/QuizSession.tsx +71 -82
  270. package/src/sections/QuizSession/types.ts +6 -0
  271. package/src/sections/RequirementsChecklist/RequirementsChecklist.tsx +41 -1
  272. package/src/sections/RequirementsChecklist/types.ts +6 -0
  273. package/src/sections/ResourceLibrary/ResourceLibrary.tsx +64 -8
  274. package/src/sections/ResourceLibrary/types.ts +15 -1
  275. package/src/sections/RubricView/RubricView.tsx +37 -1
  276. package/src/sections/RubricView/types.ts +6 -0
  277. package/src/sections/ScrollableQuiz/ScrollableQuiz.tsx +36 -15
  278. package/src/sections/ScrollableQuiz/types.ts +6 -0
  279. package/src/sections/StudentProfile/StudentProfile.tsx +279 -0
  280. package/src/sections/StudentProfile/types.ts +99 -0
  281. package/src/sections/SurveyForm/SurveyForm.tsx +32 -5
  282. package/src/sections/SurveyForm/types.ts +6 -0
  283. package/src/sections/_shared/merge-answers.ts +22 -0
  284. package/src/sections/_shared/section-shell.tsx +64 -0
  285. package/src/sections/_shared/use-assessment-session.ts +125 -0
  286. package/src/sections/index.ts +40 -0
  287. package/src/social/user-avatar.tsx +9 -5
  288. package/src/styles/globals.css +39 -41
  289. package/src/ui/badge.tsx +8 -0
  290. package/src/ui/index.ts +2 -0
  291. package/src/ui/progress.tsx +4 -0
  292. package/src/ui/rich-text-editor.tsx +10 -0
  293. package/src/ui/rich-text-toolbar.tsx +2 -1
  294. package/src/ui/toast.tsx +170 -0
  295. package/src/utils/debounce.ts +8 -2
  296. package/src/utils/pick-palette-color.ts +33 -0
  297. package/src/video/types.ts +16 -0
  298. package/src/video/video-player.tsx +27 -6
  299. package/dist/ForumBoard-CHXU3mjC.js +0 -2207
  300. package/dist/ForumBoard-d1w5-r6n.cjs +0 -1
  301. package/dist/tabs-DRM2Iq_J.cjs +0 -172
  302. package/dist/tabs-Wf3h_Cx3.js +0 -21580
@@ -0,0 +1,3273 @@
1
+ import { jsx as e, Fragment as O, jsxs as t } from "react/jsx-runtime";
2
+ import { useState as F, useRef as J, useEffect as ge, useMemo as j, useCallback as Y, Fragment as At, memo as Lt } from "react";
3
+ import { AlertCircle as q, ChevronLeft as Ut, ChevronRight as Re, Send as Ye, CheckCircle as De, Clock as xe, Check as Qe, Pin as Ze, MessageSquare as Te, Heart as Je, Reply as Rt, Save as Dt, ArrowUp as Tt, ArrowDown as Mt, BookOpen as oe, Award as Se, Printer as It, Download as Ft, CheckCircle2 as me, Circle as Pt, Plus as Et, ArrowUpDown as _t, XCircle as $e, Loader2 as Bt, Grid as jt, List as Qt, GraduationCap as ze, Calendar as $t } from "lucide-react";
4
+ import { c as k, a2 as $, v as D, s as Ke, C as E, D as Me, ao as Xe, x as _, ar as be, ap as qe, aw as f, aV as Ve, E as Vt, a8 as Gt, B as X, av as G, P as fe, M as Ht, b7 as Wt, a$ as Ge, a4 as Ot, d as et, e as tt, I as Yt, af as Zt, ay as Jt, as as ue, a as lt, J as Kt, aU as he, b6 as Ie, ak as we, aQ as se, aS as ie, aR as re, al as Xt, aA as at, a0 as nt, aL as st, aN as it, aO as ce, aM as ke, a5 as He, ad as Ae, a9 as qt, aD as rt, aJ as ct, aK as de, aI as Ne, aE as dt, aG as le, an as ot, az as Le, aC as el, b as tl, A as mt, au as ut, aB as ll, K as We } from "./withProGate-BvFc7Jwy.js";
5
+ import { cva as ht } from "class-variance-authority";
6
+ function al(l, a, i, c) {
7
+ const p = i.map((s) => ({
8
+ uid: a,
9
+ answerUid: s.uid,
10
+ content: s.content
11
+ })), m = [...l.filter((s) => s.uid !== a), ...p];
12
+ return c == null || c(m), m;
13
+ }
14
+ function ft({
15
+ questions: l,
16
+ initialAnswers: a = [],
17
+ onAnswerChange: i,
18
+ questionMaterials: c
19
+ }) {
20
+ const [p, r] = F(0), [m, s] = F(a), [v, b] = F(/* @__PURE__ */ new Set()), [h, w] = F(!1), N = J(null), C = J(!0), z = J(l);
21
+ z.current = l;
22
+ const d = J(p);
23
+ d.current = p;
24
+ const S = J(i);
25
+ S.current = i;
26
+ const U = l[p];
27
+ ge(() => {
28
+ var n;
29
+ if (C.current) {
30
+ C.current = !1;
31
+ return;
32
+ }
33
+ (n = N.current) == null || n.focus();
34
+ }, [p]);
35
+ const u = j(
36
+ () => U ? m.filter((n) => n.uid === U.uid) : [],
37
+ [m, U]
38
+ ), M = j(
39
+ () => (c == null ? void 0 : c.filter((n) => n.questionUid === (U == null ? void 0 : U.uid))) ?? [],
40
+ [c, U]
41
+ ), x = j(
42
+ () => l.map((n, g) => ({
43
+ uid: n.uid,
44
+ sequence: g,
45
+ isFlagged: v.has(n.uid),
46
+ isAnswered: m.some((R) => R.uid === n.uid),
47
+ isSkipped: !1
48
+ })),
49
+ [l, m, v]
50
+ ), A = Y(
51
+ (n) => {
52
+ const g = z.current[d.current];
53
+ g && s(
54
+ (R) => al(R, g.uid, n, S.current)
55
+ );
56
+ },
57
+ []
58
+ ), o = Y(
59
+ (n) => {
60
+ const g = l.findIndex((R) => R.uid === n);
61
+ g !== -1 && r(g);
62
+ },
63
+ [l]
64
+ ), y = Y((n) => {
65
+ b((g) => {
66
+ const R = new Set(g);
67
+ return R.has(n) ? R.delete(n) : R.add(n), R;
68
+ });
69
+ }, []), L = Y(() => {
70
+ r((n) => Math.min(n + 1, z.current.length - 1));
71
+ }, []), T = Y(() => {
72
+ r((n) => Math.max(n - 1, 0));
73
+ }, []);
74
+ return {
75
+ currentIndex: p,
76
+ currentQuestion: U,
77
+ sessionAnswers: m,
78
+ flaggedUids: v,
79
+ materialsOpen: h,
80
+ setMaterialsOpen: w,
81
+ questionAreaRef: N,
82
+ currentQuestionAnswers: u,
83
+ currentMaterials: M,
84
+ navigatorItems: x,
85
+ handleAnswer: A,
86
+ handleNavigate: o,
87
+ handleToggleFlag: y,
88
+ goNext: L,
89
+ goPrevious: T,
90
+ hasNext: p < l.length - 1,
91
+ hasPrevious: p > 0
92
+ };
93
+ }
94
+ function te({
95
+ isLoading: l,
96
+ error: a,
97
+ onRetry: i,
98
+ skeleton: c,
99
+ loadingClassName: p = "space-y-4",
100
+ className: r,
101
+ style: m,
102
+ children: s
103
+ }) {
104
+ return l ? /* @__PURE__ */ e("div", { className: k(p, r), style: m, children: c }) : a ? /* @__PURE__ */ e("div", { className: k("py-12", r), style: m, children: /* @__PURE__ */ e(
105
+ $,
106
+ {
107
+ icon: /* @__PURE__ */ e(q, { className: "size-10 text-destructive" }),
108
+ title: "Something went wrong",
109
+ description: a,
110
+ action: i ? /* @__PURE__ */ e(D, { variant: "outline", onClick: i, children: "Retry" }) : void 0
111
+ }
112
+ ) }) : /* @__PURE__ */ e(O, { children: s });
113
+ }
114
+ function zl({
115
+ questions: l,
116
+ initialAnswers: a = [],
117
+ onSubmit: i,
118
+ onAnswerChange: c,
119
+ timeElapsedSeconds: p,
120
+ timeLimitSeconds: r,
121
+ questionMaterials: m,
122
+ isSubmitting: s = !1,
123
+ readOnly: v = !1,
124
+ isLoading: b,
125
+ error: h,
126
+ onRetry: w,
127
+ className: N,
128
+ style: C
129
+ }) {
130
+ const {
131
+ currentIndex: z,
132
+ currentQuestion: d,
133
+ sessionAnswers: S,
134
+ flaggedUids: U,
135
+ materialsOpen: u,
136
+ setMaterialsOpen: M,
137
+ questionAreaRef: x,
138
+ currentQuestionAnswers: A,
139
+ currentMaterials: o,
140
+ navigatorItems: y,
141
+ handleAnswer: L,
142
+ handleNavigate: T,
143
+ handleToggleFlag: n,
144
+ goNext: g,
145
+ goPrevious: R,
146
+ hasNext: P,
147
+ hasPrevious: Z
148
+ } = ft({ questions: l, initialAnswers: a, onAnswerChange: c, questionMaterials: m }), V = J(S);
149
+ V.current = S;
150
+ const H = J(i);
151
+ H.current = i;
152
+ const K = Y(() => {
153
+ H.current(V.current);
154
+ }, []), I = J(d == null ? void 0 : d.uid);
155
+ I.current = d == null ? void 0 : d.uid;
156
+ const B = Y(() => {
157
+ const W = I.current;
158
+ W && n(W);
159
+ }, [n]), Q = Y(() => M(!0), [M]);
160
+ return /* @__PURE__ */ e(
161
+ te,
162
+ {
163
+ isLoading: b,
164
+ error: h,
165
+ onRetry: w,
166
+ className: N,
167
+ style: C,
168
+ skeleton: /* @__PURE__ */ t(O, { children: [
169
+ /* @__PURE__ */ e(f, { className: "h-10 w-full" }),
170
+ /* @__PURE__ */ e(f, { className: "h-48 w-full" }),
171
+ /* @__PURE__ */ e(f, { className: "h-12 w-full" })
172
+ ] }),
173
+ children: /* @__PURE__ */ t("div", { children: [
174
+ /* @__PURE__ */ e(
175
+ Ke,
176
+ {
177
+ currentQuestionIndex: z,
178
+ totalQuestions: l.length,
179
+ hasNext: P,
180
+ hasPrevious: Z,
181
+ onNext: g,
182
+ onPrevious: R,
183
+ onSubmit: K,
184
+ timeElapsedSeconds: p,
185
+ timeLimitSeconds: r,
186
+ questions: y,
187
+ onNavigateToQuestion: T,
188
+ currentQuestionUid: d == null ? void 0 : d.uid,
189
+ isSubmitting: s,
190
+ readOnly: v
191
+ }
192
+ ),
193
+ /* @__PURE__ */ t("span", { className: "sr-only", "aria-live": "polite", children: [
194
+ "Question ",
195
+ z + 1,
196
+ " of ",
197
+ l.length
198
+ ] }),
199
+ d && /* @__PURE__ */ t(E, { className: "mt-3", ref: x, tabIndex: -1, children: [
200
+ /* @__PURE__ */ e(Me, { className: "pb-0", children: /* @__PURE__ */ e(
201
+ Xe,
202
+ {
203
+ questionNumber: z + 1,
204
+ totalQuestions: l.length,
205
+ isFlagged: U.has(d.uid),
206
+ onToggleFlag: B,
207
+ hasMaterials: o.length > 0,
208
+ onOpenMaterials: Q,
209
+ readOnly: v
210
+ }
211
+ ) }),
212
+ /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(
213
+ be,
214
+ {
215
+ question: d,
216
+ sessionAnswers: A,
217
+ onAnswer: L,
218
+ readOnly: v
219
+ }
220
+ ) })
221
+ ] }),
222
+ !v && /* @__PURE__ */ t("div", { className: "flex items-center justify-between gap-3 mt-3", children: [
223
+ /* @__PURE__ */ t(
224
+ D,
225
+ {
226
+ variant: "outline",
227
+ disabled: !Z,
228
+ onClick: R,
229
+ children: [
230
+ /* @__PURE__ */ e(Ut, { className: "size-4 mr-1" }),
231
+ "Previous"
232
+ ]
233
+ }
234
+ ),
235
+ P ? /* @__PURE__ */ t(D, { onClick: g, children: [
236
+ "Next",
237
+ /* @__PURE__ */ e(Re, { className: "size-4 ml-1" })
238
+ ] }) : /* @__PURE__ */ t(D, { onClick: K, disabled: s, children: [
239
+ s ? "Submitting..." : "Submit Quiz",
240
+ !s && /* @__PURE__ */ e(Ye, { className: "size-4 ml-1" })
241
+ ] })
242
+ ] }),
243
+ /* @__PURE__ */ e(
244
+ qe,
245
+ {
246
+ open: u,
247
+ onOpenChange: M,
248
+ materials: o,
249
+ questionNumber: z + 1
250
+ }
251
+ )
252
+ ] })
253
+ }
254
+ );
255
+ }
256
+ function Al({
257
+ video: l,
258
+ notes: a,
259
+ layout: i = "horizontal",
260
+ notesPanelWidth: c = "340px",
261
+ notesPanelHeight: p = "240px",
262
+ isLoading: r,
263
+ error: m,
264
+ onRetry: s,
265
+ onComplete: v,
266
+ className: b,
267
+ style: h
268
+ }) {
269
+ const w = i === "horizontal", N = Y(() => {
270
+ var C;
271
+ (C = l.onEnded) == null || C.call(l), v == null || v();
272
+ }, [l, v]);
273
+ return /* @__PURE__ */ e(
274
+ te,
275
+ {
276
+ isLoading: r,
277
+ error: m,
278
+ onRetry: s,
279
+ className: b,
280
+ style: h,
281
+ skeleton: /* @__PURE__ */ t(O, { children: [
282
+ /* @__PURE__ */ e(f, { className: "aspect-video w-full rounded-lg" }),
283
+ a !== void 0 && /* @__PURE__ */ e(f, { className: "h-32 w-full rounded-lg" })
284
+ ] }),
285
+ children: a ? /* @__PURE__ */ t(
286
+ "div",
287
+ {
288
+ className: k(
289
+ "flex overflow-hidden gap-4",
290
+ w ? "flex-row" : "flex-col",
291
+ b
292
+ ),
293
+ style: h,
294
+ children: [
295
+ /* @__PURE__ */ e("div", { className: "flex-1 min-w-0 min-h-0", children: /* @__PURE__ */ e(Ve, { ...l, onEnded: N }) }),
296
+ /* @__PURE__ */ t(
297
+ E,
298
+ {
299
+ className: k(
300
+ "overflow-auto shrink-0 rounded-none border-0",
301
+ w ? "border-l border-border" : "border-t border-border w-full"
302
+ ),
303
+ style: {
304
+ width: w ? c : void 0,
305
+ height: w ? void 0 : p
306
+ },
307
+ children: [
308
+ /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e(Vt, { children: "Notes" }) }),
309
+ /* @__PURE__ */ e(_, { children: typeof a == "string" ? /* @__PURE__ */ e("span", { className: "text-sm text-foreground", children: a }) : a })
310
+ ]
311
+ }
312
+ )
313
+ ]
314
+ }
315
+ ) : /* @__PURE__ */ e("div", { className: b, style: h, children: /* @__PURE__ */ e(Ve, { ...l, onEnded: N }) })
316
+ }
317
+ );
318
+ }
319
+ function Ll({
320
+ cards: l,
321
+ title: a,
322
+ description: i,
323
+ shuffled: c = !1,
324
+ onComplete: p,
325
+ readOnly: r = !1,
326
+ isLoading: m,
327
+ error: s,
328
+ onRetry: v,
329
+ className: b,
330
+ style: h
331
+ }) {
332
+ const [w, N] = F(!1), C = {
333
+ totalCards: l.length,
334
+ wasShuffled: c
335
+ };
336
+ function z() {
337
+ N(!0), p == null || p(C);
338
+ }
339
+ function d() {
340
+ N(!1);
341
+ }
342
+ return /* @__PURE__ */ e(
343
+ te,
344
+ {
345
+ isLoading: m,
346
+ error: s,
347
+ onRetry: v,
348
+ className: b,
349
+ style: h,
350
+ skeleton: /* @__PURE__ */ t(O, { children: [
351
+ /* @__PURE__ */ e(f, { className: "h-6 w-48" }),
352
+ /* @__PURE__ */ e(f, { className: "h-64 w-full rounded-lg" })
353
+ ] }),
354
+ children: w ? /* @__PURE__ */ e("div", { className: k("flex flex-col items-center", b), style: h, children: /* @__PURE__ */ e(E, { children: /* @__PURE__ */ t(_, { className: "pt-6 text-center flex flex-col items-center gap-2", children: [
355
+ /* @__PURE__ */ e(De, { size: 48, className: "text-success" }),
356
+ /* @__PURE__ */ e("span", { className: "text-xl font-bold text-foreground", children: "Deck complete!" }),
357
+ a && /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: [
358
+ "You finished ",
359
+ /* @__PURE__ */ e("strong", { children: a })
360
+ ] }),
361
+ /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: [
362
+ C.totalCards,
363
+ " card",
364
+ C.totalCards !== 1 ? "s" : "",
365
+ " studied",
366
+ C.wasShuffled ? " (shuffled)" : ""
367
+ ] }),
368
+ /* @__PURE__ */ e(D, { className: "mt-2", onClick: d, children: "Study Again" })
369
+ ] }) }) }) : /* @__PURE__ */ e("div", { className: k("flex flex-col items-center", b), style: h, children: /* @__PURE__ */ e(
370
+ Gt,
371
+ {
372
+ cards: l,
373
+ deckName: a,
374
+ deckDescription: i,
375
+ shuffled: c,
376
+ showProgress: !0,
377
+ onComplete: z,
378
+ readOnly: r
379
+ }
380
+ ) })
381
+ }
382
+ );
383
+ }
384
+ function nl({
385
+ score: l
386
+ }) {
387
+ const a = l.percentage !== void 0 ? l.percentage : l.total > 0 ? Math.round(l.correct / l.total * 100) : 0;
388
+ return /* @__PURE__ */ e(E, { className: "mb-3", children: /* @__PURE__ */ e(_, { className: "pt-6", children: /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2", children: [
389
+ /* @__PURE__ */ t("div", { className: "flex items-baseline gap-2", children: [
390
+ /* @__PURE__ */ t("span", { className: "text-2xl font-bold leading-none text-foreground", children: [
391
+ a,
392
+ "%"
393
+ ] }),
394
+ /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: [
395
+ l.correct,
396
+ " of ",
397
+ l.total,
398
+ " correct"
399
+ ] })
400
+ ] }),
401
+ l.passed !== void 0 && /* @__PURE__ */ e(X, { variant: l.passed ? "success" : "destructive", children: l.passed ? "Passed" : "Failed" }),
402
+ l.passingScore !== void 0 && /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: [
403
+ "Passing score: ",
404
+ l.passingScore,
405
+ "%"
406
+ ] })
407
+ ] }) }) });
408
+ }
409
+ function Ue({
410
+ questions: l,
411
+ sessionAnswers: a,
412
+ showCorrectAnswers: i
413
+ }) {
414
+ const c = j(() => {
415
+ const p = /* @__PURE__ */ new Map();
416
+ for (const r of a) {
417
+ const m = p.get(r.uid);
418
+ m ? m.push(r) : p.set(r.uid, [r]);
419
+ }
420
+ return p;
421
+ }, [a]);
422
+ return /* @__PURE__ */ e("div", { className: "flex flex-col gap-3", children: l.map((p, r) => /* @__PURE__ */ t(E, { className: "overflow-hidden", children: [
423
+ /* @__PURE__ */ e("div", { className: "px-2 py-1 bg-muted", children: /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground font-semibold", children: [
424
+ "Question ",
425
+ r + 1
426
+ ] }) }),
427
+ /* @__PURE__ */ e(G, {}),
428
+ /* @__PURE__ */ e(_, { className: "pt-4 pb-4", children: /* @__PURE__ */ e(
429
+ be,
430
+ {
431
+ question: p,
432
+ sessionAnswers: c.get(p.uid) ?? [],
433
+ readOnly: !0,
434
+ showCorrectAnswers: i
435
+ }
436
+ ) })
437
+ ] }, p.uid)) });
438
+ }
439
+ function sl(l, a, i, c) {
440
+ const p = new Map(l.map((s) => [s.uid, s])), r = new Set(i.flatMap((s) => s.questionUids)), m = l.filter((s) => !r.has(s.uid));
441
+ return /* @__PURE__ */ t("div", { className: "flex flex-col gap-4", children: [
442
+ i.map((s) => {
443
+ const v = s.questionUids.map((b) => p.get(b)).filter(Boolean);
444
+ return /* @__PURE__ */ t("div", { children: [
445
+ /* @__PURE__ */ e("span", { className: "uppercase text-xs tracking-wide text-muted-foreground font-semibold", children: s.label }),
446
+ /* @__PURE__ */ e(G, { className: "mb-2" }),
447
+ /* @__PURE__ */ e(
448
+ Ue,
449
+ {
450
+ questions: v,
451
+ sessionAnswers: a,
452
+ showCorrectAnswers: c
453
+ }
454
+ )
455
+ ] }, s.label);
456
+ }),
457
+ m.length > 0 && /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
458
+ Ue,
459
+ {
460
+ questions: m,
461
+ sessionAnswers: a,
462
+ showCorrectAnswers: c
463
+ }
464
+ ) })
465
+ ] });
466
+ }
467
+ function Ul({
468
+ questions: l,
469
+ sessionAnswers: a,
470
+ score: i,
471
+ questionGroups: c,
472
+ showCorrectAnswers: p = !0,
473
+ isLoading: r,
474
+ error: m,
475
+ onRetry: s,
476
+ className: v,
477
+ style: b
478
+ }) {
479
+ return r ? /* @__PURE__ */ t("div", { className: k("space-y-4", v), style: b, children: [
480
+ /* @__PURE__ */ e(f, { className: "h-16 w-full" }),
481
+ /* @__PURE__ */ e(f, { className: "h-24 w-full" }),
482
+ /* @__PURE__ */ e(f, { className: "h-24 w-full" }),
483
+ /* @__PURE__ */ e(f, { className: "h-24 w-full" })
484
+ ] }) : m ? /* @__PURE__ */ e("div", { className: k("py-12", v), style: b, children: /* @__PURE__ */ e(
485
+ $,
486
+ {
487
+ icon: /* @__PURE__ */ e(q, { className: "size-10 text-destructive" }),
488
+ title: "Something went wrong",
489
+ description: m,
490
+ action: s ? /* @__PURE__ */ e(D, { variant: "outline", onClick: s, children: "Retry" }) : void 0
491
+ }
492
+ ) }) : /* @__PURE__ */ t("div", { className: k(v), style: b, children: [
493
+ i && /* @__PURE__ */ e(nl, { score: i }),
494
+ c && c.length > 0 ? sl(l, a, c, p) : /* @__PURE__ */ e(
495
+ Ue,
496
+ {
497
+ questions: l,
498
+ sessionAnswers: a,
499
+ showCorrectAnswers: p
500
+ }
501
+ )
502
+ ] });
503
+ }
504
+ function pt(l) {
505
+ const a = [];
506
+ for (const i of l)
507
+ !i.children || i.children.length === 0 ? a.push(i.uid) : a.push(...pt(i.children));
508
+ return a;
509
+ }
510
+ function Rl({
511
+ items: l,
512
+ progress: a,
513
+ courseTitle: i,
514
+ activeItemUid: c,
515
+ onItemClick: p,
516
+ showOverallProgress: r = !0,
517
+ showDuration: m = !0,
518
+ showIcons: s = !0,
519
+ readOnly: v = !1,
520
+ isLoading: b,
521
+ error: h,
522
+ onRetry: w,
523
+ className: N,
524
+ style: C
525
+ }) {
526
+ const { completedCount: z, totalCount: d, percentage: S } = j(() => {
527
+ const U = pt(l), u = U.length, M = a ? U.filter(
528
+ (x) => a.some((A) => A.resourceUid === x && A.isCompleted)
529
+ ).length : 0;
530
+ return {
531
+ completedCount: M,
532
+ totalCount: u,
533
+ percentage: u > 0 ? Math.round(M / u * 100) : 0
534
+ };
535
+ }, [l, a]);
536
+ return b ? /* @__PURE__ */ t("div", { className: k("space-y-4", N), style: C, children: [
537
+ /* @__PURE__ */ e(f, { className: "h-6 w-48" }),
538
+ /* @__PURE__ */ e(f, { className: "h-2 w-full" }),
539
+ /* @__PURE__ */ e(f, { className: "h-8 w-full" }),
540
+ /* @__PURE__ */ e(f, { className: "h-8 w-full ml-6" }),
541
+ /* @__PURE__ */ e(f, { className: "h-8 w-full ml-6" }),
542
+ /* @__PURE__ */ e(f, { className: "h-8 w-full" }),
543
+ /* @__PURE__ */ e(f, { className: "h-8 w-full ml-6" }),
544
+ /* @__PURE__ */ e(f, { className: "h-8 w-full" })
545
+ ] }) : h ? /* @__PURE__ */ e("div", { className: k("py-12", N), style: C, children: /* @__PURE__ */ e(
546
+ $,
547
+ {
548
+ icon: /* @__PURE__ */ e(q, { className: "size-10 text-destructive" }),
549
+ title: "Something went wrong",
550
+ description: h,
551
+ action: w ? /* @__PURE__ */ e(D, { variant: "outline", onClick: w, children: "Retry" }) : void 0
552
+ }
553
+ ) }) : /* @__PURE__ */ t("div", { className: k(N), style: C, children: [
554
+ (i || r) && /* @__PURE__ */ t("div", { className: "px-2 pt-2 pb-2", children: [
555
+ i && /* @__PURE__ */ e("p", { className: k("font-semibold text-sm text-foreground", r && "mb-1"), children: i }),
556
+ r && /* @__PURE__ */ t("div", { children: [
557
+ /* @__PURE__ */ e(fe, { value: S, size: "sm" }),
558
+ /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground mt-0.5 block", children: [
559
+ z,
560
+ " of ",
561
+ d,
562
+ " completed"
563
+ ] })
564
+ ] })
565
+ ] }),
566
+ (i || r) && /* @__PURE__ */ e(G, {}),
567
+ /* @__PURE__ */ e(
568
+ Ht,
569
+ {
570
+ items: l,
571
+ progress: a,
572
+ activeItemUid: c,
573
+ onItemClick: p,
574
+ readOnly: v,
575
+ showDuration: m,
576
+ showIcons: s,
577
+ showProgress: !0
578
+ }
579
+ )
580
+ ] });
581
+ }
582
+ function Dl({
583
+ questions: l,
584
+ instantFeedback: a = !0,
585
+ allowRetry: i = !0,
586
+ onComplete: c,
587
+ shuffled: p = !1,
588
+ readOnly: r = !1,
589
+ isLoading: m,
590
+ error: s,
591
+ onRetry: v,
592
+ className: b,
593
+ style: h
594
+ }) {
595
+ const w = j(
596
+ () => {
597
+ const I = l ?? [];
598
+ return p ? Wt(I) : I;
599
+ },
600
+ // eslint-disable-next-line react-hooks/exhaustive-deps
601
+ [l, p]
602
+ ), [N, C] = F(0), [z, d] = F(/* @__PURE__ */ new Set()), [S, U] = F(/* @__PURE__ */ new Map()), [u, M] = F(/* @__PURE__ */ new Set()), [x, A] = F(null), [o, y] = F(!1), L = J(null), T = J(!0);
603
+ ge(() => {
604
+ var I;
605
+ if (T.current) {
606
+ T.current = !1;
607
+ return;
608
+ }
609
+ (I = L.current) == null || I.focus();
610
+ }, [N]);
611
+ const n = w[N], g = n ? z.has(n.uid) : !1;
612
+ function R() {
613
+ if (!n || !x) return;
614
+ const I = (S.get(n.uid) ?? 0) + 1;
615
+ U((W) => new Map(W).set(n.uid, I)), d((W) => new Set(W).add(n.uid));
616
+ const B = x.map((W) => ({
617
+ uid: n.uid,
618
+ answerUid: W.uid,
619
+ content: W.content
620
+ }));
621
+ Ge(n, B) === !0 && I === 1 && M((W) => new Set(W).add(n.uid));
622
+ }
623
+ function P() {
624
+ n && (d((I) => {
625
+ const B = new Set(I);
626
+ return B.delete(n.uid), B;
627
+ }), A(null));
628
+ }
629
+ function Z() {
630
+ if (N < w.length - 1)
631
+ C((I) => I + 1), A(null);
632
+ else {
633
+ const I = {
634
+ totalQuestions: w.length,
635
+ correctOnFirstAttempt: u.size,
636
+ totalAttempts: Array.from(S.values()).reduce((B, Q) => B + Q, 0)
637
+ };
638
+ y(!0), c == null || c(I);
639
+ }
640
+ }
641
+ const V = j(() => !n || !x ? [] : x.map((I) => ({
642
+ uid: n.uid,
643
+ answerUid: I.uid,
644
+ content: I.content
645
+ })), [n, x]), H = j(
646
+ () => n ? Ge(n, V) === !0 : !1,
647
+ [n, V]
648
+ ), K = w.length > 0 ? Math.round(u.size / w.length * 100) : 0;
649
+ return /* @__PURE__ */ e(
650
+ te,
651
+ {
652
+ isLoading: m,
653
+ error: s,
654
+ onRetry: v,
655
+ className: b,
656
+ style: h,
657
+ skeleton: /* @__PURE__ */ t(O, { children: [
658
+ /* @__PURE__ */ e(f, { className: "h-2 w-full" }),
659
+ /* @__PURE__ */ e(f, { className: "h-48 w-full" })
660
+ ] }),
661
+ children: o ? /* @__PURE__ */ e(E, { className: b, style: h, children: /* @__PURE__ */ t(_, { className: "pt-6 text-center", children: [
662
+ /* @__PURE__ */ e(De, { size: 48, className: "text-success mx-auto mb-4" }),
663
+ /* @__PURE__ */ e("p", { className: "text-xl font-bold mb-1 text-foreground", children: "Practice Complete!" }),
664
+ /* @__PURE__ */ t("p", { className: "text-muted-foreground mb-2", children: [
665
+ u.size,
666
+ " of ",
667
+ w.length,
668
+ " correct on first attempt (",
669
+ K,
670
+ "%)"
671
+ ] }),
672
+ /* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ e(
673
+ D,
674
+ {
675
+ variant: "outline",
676
+ onClick: () => {
677
+ C(0), d(/* @__PURE__ */ new Set()), U(/* @__PURE__ */ new Map()), M(/* @__PURE__ */ new Set()), A(null), y(!1);
678
+ },
679
+ children: "Practice Again"
680
+ }
681
+ ) })
682
+ ] }) }) : /* @__PURE__ */ t("div", { className: b, style: h, children: [
683
+ /* @__PURE__ */ t("div", { className: "flex justify-between items-center mb-2", children: [
684
+ /* @__PURE__ */ t("span", { className: "font-semibold text-sm text-foreground", children: [
685
+ "Question ",
686
+ N + 1,
687
+ " of ",
688
+ w.length
689
+ ] }),
690
+ /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: [
691
+ u.size,
692
+ " correct on first try"
693
+ ] })
694
+ ] }),
695
+ /* @__PURE__ */ e(
696
+ fe,
697
+ {
698
+ value: N + (g ? 1 : 0),
699
+ max: w.length,
700
+ size: "sm",
701
+ className: "mb-3"
702
+ }
703
+ ),
704
+ /* @__PURE__ */ t("span", { className: "sr-only", "aria-live": "polite", children: [
705
+ "Question ",
706
+ N + 1,
707
+ " of ",
708
+ w.length
709
+ ] }),
710
+ n && /* @__PURE__ */ e(E, { ref: L, tabIndex: -1, children: /* @__PURE__ */ t(_, { className: "pt-6", children: [
711
+ /* @__PURE__ */ e(
712
+ be,
713
+ {
714
+ question: n,
715
+ sessionAnswers: V,
716
+ onAnswer: A,
717
+ readOnly: r || g,
718
+ showCorrectAnswers: g
719
+ }
720
+ ),
721
+ a && g && /* @__PURE__ */ e(
722
+ Ot,
723
+ {
724
+ isCorrect: H,
725
+ explanation: n.explanation,
726
+ onRetry: i && !H ? P : void 0
727
+ }
728
+ ),
729
+ /* @__PURE__ */ t("div", { className: "flex justify-end gap-2 mt-2", children: [
730
+ !g && a && /* @__PURE__ */ e(
731
+ D,
732
+ {
733
+ onClick: R,
734
+ disabled: !x || x.length === 0 || r,
735
+ children: "Check Answer"
736
+ }
737
+ ),
738
+ (!a || g) && /* @__PURE__ */ e(
739
+ D,
740
+ {
741
+ onClick: Z,
742
+ disabled: r,
743
+ children: N < w.length - 1 ? "Next Question" : "Finish"
744
+ }
745
+ )
746
+ ] })
747
+ ] }) })
748
+ ] })
749
+ }
750
+ );
751
+ }
752
+ function Tl({
753
+ questions: l = [],
754
+ initialAnswers: a = [],
755
+ onSubmit: i,
756
+ onAnswerChange: c,
757
+ timeLimitSeconds: p,
758
+ timeElapsedSeconds: r,
759
+ autoSubmitOnTimeout: m = !0,
760
+ timeWarningThreshold: s = 300,
761
+ allowBackNavigation: v = !0,
762
+ confirmBeforeSubmit: b = !0,
763
+ examTitle: h,
764
+ instructions: w,
765
+ questionMaterials: N,
766
+ isSubmitting: C = !1,
767
+ readOnly: z = !1,
768
+ isLoading: d,
769
+ error: S,
770
+ onRetry: U,
771
+ className: u,
772
+ style: M
773
+ }) {
774
+ const {
775
+ currentIndex: x,
776
+ currentQuestion: A,
777
+ sessionAnswers: o,
778
+ flaggedUids: y,
779
+ materialsOpen: L,
780
+ setMaterialsOpen: T,
781
+ questionAreaRef: n,
782
+ currentQuestionAnswers: g,
783
+ currentMaterials: R,
784
+ navigatorItems: P,
785
+ handleAnswer: Z,
786
+ handleNavigate: V,
787
+ handleToggleFlag: H,
788
+ goNext: K,
789
+ goPrevious: I,
790
+ hasNext: B
791
+ } = ft({ questions: l, initialAnswers: a, onAnswerChange: c, questionMaterials: N }), [Q, W] = F(!1), [gt, xt] = F(!1), Fe = J(!1), Pe = J(o);
792
+ Pe.current = o;
793
+ const Ee = J(i);
794
+ Ee.current = i;
795
+ const _e = J(r);
796
+ _e.current = r;
797
+ const Be = J(A == null ? void 0 : A.uid);
798
+ Be.current = A == null ? void 0 : A.uid;
799
+ const ee = p - r, Nt = j(
800
+ () => P.filter((ne) => ne.isAnswered).length,
801
+ [P]
802
+ ), ae = Y((ne) => {
803
+ const je = Pe.current, St = new Set(je.map((ye) => ye.uid)), zt = {
804
+ timeElapsedSeconds: _e.current,
805
+ wasAutoSubmitted: ne,
806
+ answeredCount: l.filter((ye) => St.has(ye.uid)).length,
807
+ totalQuestions: l.length
808
+ };
809
+ Ee.current(je, zt);
810
+ }, [l]);
811
+ ge(() => {
812
+ ee <= s && ee > 0 && xt(!0);
813
+ }, [ee, s]), ge(() => {
814
+ m && ee <= 0 && !Fe.current && (Fe.current = !0, ae(!0));
815
+ }, [ee, m, ae]);
816
+ const vt = Y(() => {
817
+ b ? W(!0) : ae(!1);
818
+ }, [b, ae]), bt = Y(() => {
819
+ v && I();
820
+ }, [v, I]), wt = Y(() => {
821
+ const ne = Be.current;
822
+ ne && H(ne);
823
+ }, [H]), yt = Y(() => T(!0), [T]), kt = Y(() => {
824
+ W(!1), ae(!1);
825
+ }, [ae]), Ct = Y(() => W(!1), []);
826
+ return /* @__PURE__ */ e(
827
+ te,
828
+ {
829
+ isLoading: d,
830
+ error: S,
831
+ onRetry: U,
832
+ className: u,
833
+ style: M,
834
+ skeleton: /* @__PURE__ */ t(O, { children: [
835
+ /* @__PURE__ */ e(f, { className: "h-10 w-full" }),
836
+ /* @__PURE__ */ e(f, { className: "h-48 w-full" }),
837
+ /* @__PURE__ */ e(f, { className: "h-12 w-full" })
838
+ ] }),
839
+ children: /* @__PURE__ */ t("div", { children: [
840
+ h && /* @__PURE__ */ e("p", { className: "text-xl font-bold mb-2 text-foreground", children: h }),
841
+ gt && ee > 0 && ee <= s && /* @__PURE__ */ e(et, { variant: "warning", className: "mb-2", children: /* @__PURE__ */ t(tt, { children: [
842
+ Math.ceil(ee / 60),
843
+ " minute",
844
+ Math.ceil(ee / 60) !== 1 ? "s" : "",
845
+ " remaining"
846
+ ] }) }),
847
+ /* @__PURE__ */ e(
848
+ Ke,
849
+ {
850
+ currentQuestionIndex: x,
851
+ totalQuestions: l.length,
852
+ hasNext: B,
853
+ hasPrevious: v && x > 0,
854
+ onNext: K,
855
+ onPrevious: bt,
856
+ onSubmit: vt,
857
+ timeElapsedSeconds: r,
858
+ timeLimitSeconds: p,
859
+ questions: P,
860
+ onNavigateToQuestion: V,
861
+ currentQuestionUid: A == null ? void 0 : A.uid,
862
+ isSubmitting: C,
863
+ readOnly: z
864
+ }
865
+ ),
866
+ w && x === 0 && /* @__PURE__ */ e(E, { className: "mt-3", children: /* @__PURE__ */ e(_, { className: "pt-6", children: w }) }),
867
+ /* @__PURE__ */ t("span", { className: "sr-only", "aria-live": "polite", children: [
868
+ "Question ",
869
+ x + 1,
870
+ " of ",
871
+ l.length
872
+ ] }),
873
+ A && /* @__PURE__ */ t(E, { className: "mt-3", ref: n, tabIndex: -1, children: [
874
+ /* @__PURE__ */ e(Me, { className: "pb-0", children: /* @__PURE__ */ e(
875
+ Xe,
876
+ {
877
+ questionNumber: x + 1,
878
+ totalQuestions: l.length,
879
+ isFlagged: y.has(A.uid),
880
+ onToggleFlag: wt,
881
+ hasMaterials: R.length > 0,
882
+ onOpenMaterials: yt,
883
+ readOnly: z
884
+ }
885
+ ) }),
886
+ /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(
887
+ be,
888
+ {
889
+ question: A,
890
+ sessionAnswers: g,
891
+ onAnswer: Z,
892
+ readOnly: z
893
+ }
894
+ ) })
895
+ ] }),
896
+ /* @__PURE__ */ e(
897
+ qe,
898
+ {
899
+ open: L,
900
+ onOpenChange: T,
901
+ materials: R,
902
+ questionNumber: x + 1
903
+ }
904
+ ),
905
+ /* @__PURE__ */ e(
906
+ Yt,
907
+ {
908
+ open: Q,
909
+ title: "Submit Exam?",
910
+ message: `You have answered ${Nt} of ${l.length} questions. Once submitted, you cannot change your answers.`,
911
+ confirmLabel: "Submit Exam",
912
+ cancelLabel: "Continue Exam",
913
+ confirmColor: "primary",
914
+ onConfirm: kt,
915
+ onCancel: Ct,
916
+ isLoading: C
917
+ }
918
+ )
919
+ ] })
920
+ }
921
+ );
922
+ }
923
+ function Ml({
924
+ title: l,
925
+ description: a,
926
+ questions: i = [],
927
+ initialAnswers: c = [],
928
+ onSubmit: p,
929
+ onAnswerChange: r,
930
+ showProgress: m = !0,
931
+ requireAll: s = !1,
932
+ submitLabel: v = "Submit Survey",
933
+ isSubmitting: b = !1,
934
+ readOnly: h = !1,
935
+ isLoading: w,
936
+ error: N,
937
+ onRetry: C,
938
+ className: z,
939
+ style: d
940
+ }) {
941
+ const [S, U] = F(c), u = j(() => {
942
+ const o = new Set(S.map((y) => y.questionUid));
943
+ return i.filter((y) => o.has(y.uid)).length;
944
+ }, [i, S]), M = !s || u === i.length;
945
+ function x(o, y) {
946
+ U((L) => {
947
+ const n = [...L.filter((g) => g.questionUid !== o), { questionUid: o, value: y }];
948
+ return r == null || r(n), n;
949
+ });
950
+ }
951
+ const A = j(() => {
952
+ const o = /* @__PURE__ */ new Map();
953
+ for (const y of S)
954
+ o.set(y.questionUid, y);
955
+ return o;
956
+ }, [S]);
957
+ return /* @__PURE__ */ e(
958
+ te,
959
+ {
960
+ isLoading: w,
961
+ error: N,
962
+ onRetry: C,
963
+ className: z,
964
+ style: d,
965
+ skeleton: /* @__PURE__ */ t(O, { children: [
966
+ /* @__PURE__ */ e(f, { className: "h-6 w-48" }),
967
+ /* @__PURE__ */ e(f, { className: "h-2 w-full" }),
968
+ /* @__PURE__ */ e(f, { className: "h-16 w-full" }),
969
+ /* @__PURE__ */ e(f, { className: "h-16 w-full" }),
970
+ /* @__PURE__ */ e(f, { className: "h-16 w-full" })
971
+ ] }),
972
+ children: /* @__PURE__ */ t("div", { className: z, style: d, children: [
973
+ /* @__PURE__ */ e("p", { className: "text-xl font-bold text-foreground mb-2", children: l }),
974
+ a && /* @__PURE__ */ e("div", { className: "mb-2 text-muted-foreground text-sm", children: typeof a == "string" ? /* @__PURE__ */ e("span", { children: a }) : a }),
975
+ m && /* @__PURE__ */ t("div", { className: "mb-3", children: [
976
+ /* @__PURE__ */ e(fe, { value: u / i.length * 100 }),
977
+ /* @__PURE__ */ t("span", { className: "block text-xs text-muted-foreground mt-0.5", children: [
978
+ u,
979
+ " of ",
980
+ i.length,
981
+ " answered"
982
+ ] })
983
+ ] }),
984
+ i.map((o, y) => {
985
+ var T, n;
986
+ const L = A.get(o.uid);
987
+ return /* @__PURE__ */ e(E, { className: "mb-2", children: /* @__PURE__ */ t(_, { className: "pt-6", children: [
988
+ /* @__PURE__ */ t("p", { className: "font-medium text-foreground mb-2", children: [
989
+ y + 1,
990
+ ". ",
991
+ o.content,
992
+ o.required && /* @__PURE__ */ e("span", { className: "text-destructive ml-0.5", children: "*" })
993
+ ] }),
994
+ o.type === "likert" && /* @__PURE__ */ e(
995
+ Zt,
996
+ {
997
+ value: L ? Number(L.value) : null,
998
+ onChange: (g) => x(o.uid, g),
999
+ points: o.scalePoints,
1000
+ lowLabel: (T = o.scaleLabels) == null ? void 0 : T.low,
1001
+ highLabel: (n = o.scaleLabels) == null ? void 0 : n.high,
1002
+ readOnly: h
1003
+ }
1004
+ ),
1005
+ o.type === "rating" && /* @__PURE__ */ e(
1006
+ Jt,
1007
+ {
1008
+ value: L ? Number(L.value) : 0,
1009
+ onChange: (g) => x(o.uid, g),
1010
+ readOnly: h
1011
+ }
1012
+ ),
1013
+ o.type === "open_text" && /* @__PURE__ */ e(
1014
+ ue,
1015
+ {
1016
+ placeholder: "Type your response...",
1017
+ value: (L == null ? void 0 : L.value) ?? "",
1018
+ onChange: (g) => x(o.uid, g),
1019
+ readOnly: h,
1020
+ className: "min-h-24",
1021
+ variant: "minimal"
1022
+ }
1023
+ ),
1024
+ o.type === "choice" && o.answers && /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: o.answers.map((g) => /* @__PURE__ */ t("label", { className: "flex items-center gap-2 cursor-pointer py-1 text-sm text-foreground has-[input:disabled]:cursor-default has-[input:disabled]:opacity-60", children: [
1025
+ /* @__PURE__ */ e(
1026
+ "input",
1027
+ {
1028
+ type: "radio",
1029
+ className: "accent-primary m-0 shrink-0",
1030
+ name: `survey-q-${o.uid}`,
1031
+ value: g.uid,
1032
+ checked: (L == null ? void 0 : L.value) === g.uid,
1033
+ onChange: () => x(o.uid, g.uid),
1034
+ disabled: h
1035
+ }
1036
+ ),
1037
+ /* @__PURE__ */ e("span", { children: g.content })
1038
+ ] }, g.uid)) }),
1039
+ o.type === "multiple_choice" && o.answers && /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: o.answers.map((g) => {
1040
+ const R = S.filter((P) => P.questionUid === o.uid).map((P) => String(P.value));
1041
+ return /* @__PURE__ */ t("label", { className: "flex items-center gap-2 cursor-pointer py-1 text-sm text-foreground has-[input:disabled]:cursor-default has-[input:disabled]:opacity-60", children: [
1042
+ /* @__PURE__ */ e(
1043
+ "input",
1044
+ {
1045
+ type: "checkbox",
1046
+ className: "accent-primary m-0 shrink-0",
1047
+ checked: R.includes(g.uid),
1048
+ disabled: h,
1049
+ onChange: (P) => {
1050
+ const Z = S.filter((H) => H.questionUid === o.uid);
1051
+ let V;
1052
+ P.target.checked ? V = [...Z, { questionUid: o.uid, value: g.uid }] : V = Z.filter((H) => String(H.value) !== g.uid), U((H) => [
1053
+ ...H.filter((K) => K.questionUid !== o.uid),
1054
+ ...V
1055
+ ]), r == null || r([
1056
+ ...S.filter((H) => H.questionUid !== o.uid),
1057
+ ...V
1058
+ ]);
1059
+ }
1060
+ }
1061
+ ),
1062
+ /* @__PURE__ */ e("span", { children: g.content })
1063
+ ] }, g.uid);
1064
+ }) })
1065
+ ] }) }, o.uid);
1066
+ }),
1067
+ /* @__PURE__ */ e(G, { className: "my-3" }),
1068
+ /* @__PURE__ */ t("div", { className: "flex justify-between items-center", children: [
1069
+ /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: [
1070
+ u,
1071
+ " of ",
1072
+ i.length,
1073
+ " answered"
1074
+ ] }),
1075
+ /* @__PURE__ */ e(
1076
+ D,
1077
+ {
1078
+ onClick: () => p(S),
1079
+ disabled: !M || b || h,
1080
+ children: b ? "Submitting..." : v
1081
+ }
1082
+ )
1083
+ ] })
1084
+ ] })
1085
+ }
1086
+ );
1087
+ }
1088
+ function Il({
1089
+ title: l,
1090
+ blocks: a,
1091
+ isCompleted: i = !1,
1092
+ onMarkComplete: c,
1093
+ onNextLesson: p,
1094
+ nextLessonTitle: r,
1095
+ estimatedDuration: m,
1096
+ showDuration: s = !0,
1097
+ readOnly: v = !1,
1098
+ isLoading: b,
1099
+ error: h,
1100
+ onRetry: w,
1101
+ className: N,
1102
+ style: C
1103
+ }) {
1104
+ const [z, d] = F(!1), S = i || z;
1105
+ function U() {
1106
+ d(!0), c == null || c();
1107
+ }
1108
+ return /* @__PURE__ */ e(
1109
+ te,
1110
+ {
1111
+ isLoading: b,
1112
+ error: h,
1113
+ onRetry: w,
1114
+ className: N,
1115
+ style: C,
1116
+ skeleton: /* @__PURE__ */ t(O, { children: [
1117
+ /* @__PURE__ */ e(f, { className: "h-8 w-64" }),
1118
+ /* @__PURE__ */ e(f, { className: "h-24 w-full" }),
1119
+ /* @__PURE__ */ e(f, { className: "h-16 w-full" }),
1120
+ /* @__PURE__ */ e(f, { className: "h-32 w-full" })
1121
+ ] }),
1122
+ children: /* @__PURE__ */ t("div", { children: [
1123
+ /* @__PURE__ */ t("div", { className: "mb-3", children: [
1124
+ /* @__PURE__ */ e("p", { className: "text-2xl font-bold mb-0.5 text-foreground", children: l }),
1125
+ s && m != null && /* @__PURE__ */ t("div", { className: "flex items-center gap-0.5 text-muted-foreground", children: [
1126
+ /* @__PURE__ */ e(xe, { size: 16 }),
1127
+ /* @__PURE__ */ e("span", { className: "text-sm", children: lt(m) })
1128
+ ] })
1129
+ ] }),
1130
+ /* @__PURE__ */ e(G, { className: "mb-3" }),
1131
+ /* @__PURE__ */ e("div", { className: "flex flex-col gap-3", children: a != null && a.length ? a.map((u, M) => /* @__PURE__ */ e(
1132
+ Kt,
1133
+ {
1134
+ block: u,
1135
+ readOnly: v
1136
+ },
1137
+ M
1138
+ )) : /* @__PURE__ */ e(
1139
+ $,
1140
+ {
1141
+ title: "No content yet",
1142
+ description: "This lesson doesn't have any content blocks."
1143
+ }
1144
+ ) }),
1145
+ /* @__PURE__ */ e(E, { className: "mt-4 sticky bottom-0 z-10", children: /* @__PURE__ */ e(_, { className: "px-4 py-3", children: /* @__PURE__ */ t("div", { className: "flex justify-between items-center", children: [
1146
+ S ? /* @__PURE__ */ t("div", { className: "flex items-center gap-1 text-success", children: [
1147
+ /* @__PURE__ */ e(Qe, { size: 20 }),
1148
+ /* @__PURE__ */ e("span", { className: "text-sm font-semibold", children: "Lesson Complete" })
1149
+ ] }) : /* @__PURE__ */ t(
1150
+ D,
1151
+ {
1152
+ onClick: U,
1153
+ disabled: v,
1154
+ children: [
1155
+ /* @__PURE__ */ e(Qe, { size: 18 }),
1156
+ " Mark Complete"
1157
+ ]
1158
+ }
1159
+ ),
1160
+ p && /* @__PURE__ */ t(
1161
+ D,
1162
+ {
1163
+ variant: S ? "default" : "outline",
1164
+ onClick: p,
1165
+ children: [
1166
+ r ? `Next: ${r}` : "Next Lesson",
1167
+ " ",
1168
+ /* @__PURE__ */ e(Re, { size: 18 })
1169
+ ]
1170
+ }
1171
+ )
1172
+ ] }) }) })
1173
+ ] })
1174
+ }
1175
+ );
1176
+ }
1177
+ function Fl({
1178
+ announcements: l,
1179
+ onMarkRead: a,
1180
+ onSelect: i,
1181
+ showAvatars: c = !0,
1182
+ previewLines: p = 3,
1183
+ emptyMessage: r = "No announcements yet",
1184
+ readOnly: m = !1,
1185
+ isLoading: s,
1186
+ error: v,
1187
+ onRetry: b,
1188
+ pageSize: h,
1189
+ currentPage: w = 1,
1190
+ totalItems: N,
1191
+ onPageChange: C,
1192
+ className: z,
1193
+ style: d
1194
+ }) {
1195
+ const [S, U] = F(/* @__PURE__ */ new Set()), u = j(() => {
1196
+ const x = l.filter((o) => o.isPinned), A = l.filter((o) => !o.isPinned);
1197
+ return [...x, ...A];
1198
+ }, [l]);
1199
+ function M(x) {
1200
+ U((o) => {
1201
+ const y = new Set(o);
1202
+ return y.has(x) ? y.delete(x) : y.add(x), y;
1203
+ });
1204
+ const A = l.find((o) => o.uid === x);
1205
+ A && !A.isRead && (a == null || a(x));
1206
+ }
1207
+ return s ? /* @__PURE__ */ e("div", { className: k("space-y-4", z), style: d, children: Array.from({ length: 3 }).map((x, A) => /* @__PURE__ */ t("div", { className: "flex gap-3 items-start", children: [
1208
+ /* @__PURE__ */ e(f, { className: "h-10 w-10 rounded-full shrink-0" }),
1209
+ /* @__PURE__ */ t("div", { className: "flex-1 space-y-2", children: [
1210
+ /* @__PURE__ */ e(f, { className: "h-5 w-48" }),
1211
+ /* @__PURE__ */ e(f, { className: "h-4 w-full" }),
1212
+ /* @__PURE__ */ e(f, { className: "h-4 w-full" })
1213
+ ] })
1214
+ ] }, A)) }) : v ? /* @__PURE__ */ e("div", { className: k("py-12", z), style: d, children: /* @__PURE__ */ e(
1215
+ $,
1216
+ {
1217
+ icon: /* @__PURE__ */ e(q, { className: "size-10 text-destructive" }),
1218
+ title: "Something went wrong",
1219
+ description: v,
1220
+ action: b ? /* @__PURE__ */ e(D, { variant: "outline", onClick: b, children: "Retry" }) : void 0
1221
+ }
1222
+ ) }) : u.length === 0 ? /* @__PURE__ */ e("div", { className: z, style: d, children: /* @__PURE__ */ e($, { title: r }) }) : /* @__PURE__ */ t("div", { className: k("flex flex-col gap-2", z), style: d, children: [
1223
+ (C && h ? u.slice((w - 1) * h, w * h) : u).map((x) => {
1224
+ const A = S.has(x.uid);
1225
+ return /* @__PURE__ */ e(
1226
+ E,
1227
+ {
1228
+ className: k(
1229
+ x.isRead && "opacity-85",
1230
+ i && "cursor-pointer",
1231
+ x.isPinned && "border-l-4 border-l-warning"
1232
+ ),
1233
+ onClick: () => i && !m ? i(x) : M(x.uid),
1234
+ children: /* @__PURE__ */ e(_, { className: "py-4", children: /* @__PURE__ */ t("div", { className: "flex gap-1.5 items-start", children: [
1235
+ c && /* @__PURE__ */ e(
1236
+ he,
1237
+ {
1238
+ displayName: x.author.displayName,
1239
+ avatarUrl: x.author.avatarUrl,
1240
+ role: x.author.role,
1241
+ size: "medium"
1242
+ }
1243
+ ),
1244
+ /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
1245
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-1 mb-0.5", children: [
1246
+ x.isPinned && /* @__PURE__ */ e(Ze, { size: 14 }),
1247
+ /* @__PURE__ */ e(
1248
+ "span",
1249
+ {
1250
+ className: k("text-foreground", x.isRead ? "font-normal" : "font-semibold"),
1251
+ children: x.title
1252
+ }
1253
+ ),
1254
+ !x.isRead && /* @__PURE__ */ e(X, { variant: "destructive", className: "text-[10px] px-1.5 py-0", children: "New" })
1255
+ ] }),
1256
+ /* @__PURE__ */ t("span", { className: "block text-xs text-muted-foreground mb-1", children: [
1257
+ x.author.displayName,
1258
+ " · ",
1259
+ Ie(x.createdAt)
1260
+ ] }),
1261
+ /* @__PURE__ */ e(
1262
+ "div",
1263
+ {
1264
+ className: k(
1265
+ "text-sm text-foreground [&_p]:mb-2 [&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5",
1266
+ !A && "line-clamp-(--preview-lines) overflow-hidden"
1267
+ ),
1268
+ style: A ? void 0 : { "--preview-lines": p },
1269
+ dangerouslySetInnerHTML: { __html: x.content }
1270
+ }
1271
+ ),
1272
+ !A && x.content.replace(/<[^>]*>/g, "").length > 200 && /* @__PURE__ */ e(
1273
+ D,
1274
+ {
1275
+ variant: "link",
1276
+ size: "xs",
1277
+ className: "px-0 mt-0.5 h-auto",
1278
+ onClick: (o) => {
1279
+ o.stopPropagation(), M(x.uid);
1280
+ },
1281
+ children: "Read more"
1282
+ }
1283
+ )
1284
+ ] })
1285
+ ] }) })
1286
+ },
1287
+ x.uid
1288
+ );
1289
+ }),
1290
+ C && h && u.length > 0 && /* @__PURE__ */ e(
1291
+ we,
1292
+ {
1293
+ currentPage: w,
1294
+ totalPages: Math.ceil((N ?? u.length) / h),
1295
+ onPageChange: C,
1296
+ className: "mt-4"
1297
+ }
1298
+ )
1299
+ ] });
1300
+ }
1301
+ function ve(l) {
1302
+ return l.replace(/<[^>]*>/g, "").trim().length === 0;
1303
+ }
1304
+ function Pl({
1305
+ title: l,
1306
+ rootPost: a,
1307
+ replies: i,
1308
+ currentUser: c,
1309
+ onReply: p,
1310
+ onToggleLike: r,
1311
+ onMarkAnswer: m,
1312
+ maxDepth: s = 3,
1313
+ allowReplies: v = !0,
1314
+ sortOrder: b = "oldest",
1315
+ readOnly: h = !1,
1316
+ isLoading: w,
1317
+ error: N,
1318
+ onRetry: C,
1319
+ className: z,
1320
+ style: d
1321
+ }) {
1322
+ const [S, U] = F(null), [u, M] = F(""), x = j(() => {
1323
+ const y = /* @__PURE__ */ new Map();
1324
+ for (const L of i) {
1325
+ const T = L.parentUid ?? a.uid, n = y.get(T) ?? [];
1326
+ n.push(L), y.set(T, n);
1327
+ }
1328
+ for (const [, L] of y)
1329
+ L.sort((T, n) => b === "newest" ? new Date(n.createdAt).getTime() - new Date(T.createdAt).getTime() : b === "most_liked" ? n.likeCount - T.likeCount : new Date(T.createdAt).getTime() - new Date(n.createdAt).getTime());
1330
+ return y;
1331
+ }, [i, a.uid, b]);
1332
+ if (w)
1333
+ return /* @__PURE__ */ t("div", { className: k("space-y-4", z), style: d, children: [
1334
+ /* @__PURE__ */ e(f, { className: "h-7 w-64" }),
1335
+ /* @__PURE__ */ t("div", { className: "flex items-start gap-3", children: [
1336
+ /* @__PURE__ */ e(f, { className: "h-8 w-8 rounded-full shrink-0" }),
1337
+ /* @__PURE__ */ e(f, { className: "h-32 w-full" })
1338
+ ] }),
1339
+ Array.from({ length: 2 }).map((y, L) => /* @__PURE__ */ e("div", { className: "ml-8", children: /* @__PURE__ */ e(f, { className: "h-20 w-full" }) }, L))
1340
+ ] });
1341
+ if (N)
1342
+ return /* @__PURE__ */ e("div", { className: k("py-12", z), style: d, children: /* @__PURE__ */ e(
1343
+ $,
1344
+ {
1345
+ icon: /* @__PURE__ */ e(q, { className: "size-10 text-destructive" }),
1346
+ title: "Something went wrong",
1347
+ description: N,
1348
+ action: C ? /* @__PURE__ */ e(D, { variant: "outline", onClick: C, children: "Retry" }) : void 0
1349
+ }
1350
+ ) });
1351
+ function A(y) {
1352
+ ve(u) || (p(y, u), M(""), U(null));
1353
+ }
1354
+ function o(y, L) {
1355
+ const T = x.get(y.uid) ?? [], n = Math.min(L, s), g = /* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: [
1356
+ r && !h && /* @__PURE__ */ t(se, { children: [
1357
+ /* @__PURE__ */ e(ie, { children: /* @__PURE__ */ t(
1358
+ D,
1359
+ {
1360
+ variant: "ghost",
1361
+ size: "sm",
1362
+ "aria-label": y.isLikedByCurrentUser ? "Unlike" : "Like",
1363
+ className: k(y.isLikedByCurrentUser && "text-destructive"),
1364
+ onClick: () => r(y.uid),
1365
+ children: [
1366
+ /* @__PURE__ */ e(Je, { size: 14, fill: y.isLikedByCurrentUser ? "currentColor" : "none" }),
1367
+ y.likeCount > 0 ? y.likeCount : "Like"
1368
+ ]
1369
+ }
1370
+ ) }),
1371
+ /* @__PURE__ */ e(re, { children: y.isLikedByCurrentUser ? "Unlike" : "Like" })
1372
+ ] }),
1373
+ v && !h && /* @__PURE__ */ t(se, { children: [
1374
+ /* @__PURE__ */ e(ie, { children: /* @__PURE__ */ t(
1375
+ D,
1376
+ {
1377
+ variant: "ghost",
1378
+ size: "sm",
1379
+ "aria-label": "Reply",
1380
+ onClick: () => U(y.uid),
1381
+ children: [
1382
+ /* @__PURE__ */ e(Rt, { size: 14 }),
1383
+ "Reply"
1384
+ ]
1385
+ }
1386
+ ) }),
1387
+ /* @__PURE__ */ e(re, { children: "Reply" })
1388
+ ] }),
1389
+ m && !h && c.role !== "student" && !y.isAnswer && /* @__PURE__ */ t(se, { children: [
1390
+ /* @__PURE__ */ e(ie, { children: /* @__PURE__ */ t(
1391
+ D,
1392
+ {
1393
+ variant: "ghost",
1394
+ size: "sm",
1395
+ "aria-label": "Mark as answer",
1396
+ className: "text-success",
1397
+ onClick: () => m(y.uid),
1398
+ children: [
1399
+ /* @__PURE__ */ e(De, { size: 14 }),
1400
+ "Mark Answer"
1401
+ ]
1402
+ }
1403
+ ) }),
1404
+ /* @__PURE__ */ e(re, { children: "Mark as answer" })
1405
+ ] })
1406
+ ] });
1407
+ return /* @__PURE__ */ t("div", { children: [
1408
+ /* @__PURE__ */ e(
1409
+ Xt,
1410
+ {
1411
+ author: y.author,
1412
+ content: y.content,
1413
+ createdAt: y.createdAt,
1414
+ updatedAt: y.updatedAt,
1415
+ actions: g,
1416
+ highlight: y.isAnswer ? "answer" : "none",
1417
+ indentLevel: n,
1418
+ className: "mb-2"
1419
+ }
1420
+ ),
1421
+ S === y.uid && /* @__PURE__ */ e(
1422
+ E,
1423
+ {
1424
+ className: "mb-2",
1425
+ style: { marginLeft: `${(n + 1) * 16}px` },
1426
+ children: /* @__PURE__ */ t(_, { className: "py-4", children: [
1427
+ /* @__PURE__ */ e(
1428
+ ue,
1429
+ {
1430
+ className: "min-h-15 mb-2",
1431
+ placeholder: "Write a reply...",
1432
+ value: u,
1433
+ onChange: (R) => M(R),
1434
+ variant: "minimal"
1435
+ }
1436
+ ),
1437
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
1438
+ /* @__PURE__ */ e(
1439
+ D,
1440
+ {
1441
+ size: "sm",
1442
+ onClick: () => A(y.uid),
1443
+ disabled: ve(u),
1444
+ children: "Post Reply"
1445
+ }
1446
+ ),
1447
+ /* @__PURE__ */ e(
1448
+ D,
1449
+ {
1450
+ variant: "ghost",
1451
+ size: "sm",
1452
+ onClick: () => {
1453
+ U(null), M("");
1454
+ },
1455
+ children: "Cancel"
1456
+ }
1457
+ )
1458
+ ] })
1459
+ ] })
1460
+ }
1461
+ ),
1462
+ T.map((R) => o(R, L + 1))
1463
+ ] }, y.uid);
1464
+ }
1465
+ return /* @__PURE__ */ t("div", { className: z, style: d, children: [
1466
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-2 mb-2", children: [
1467
+ /* @__PURE__ */ e(Te, { size: 20, className: "text-foreground shrink-0" }),
1468
+ /* @__PURE__ */ e("span", { className: "text-lg font-semibold text-foreground", children: l }),
1469
+ /* @__PURE__ */ t(X, { variant: "muted", className: "text-xs", children: [
1470
+ i.length,
1471
+ " ",
1472
+ i.length === 1 ? "reply" : "replies"
1473
+ ] })
1474
+ ] }),
1475
+ /* @__PURE__ */ e(G, { className: "mb-2" }),
1476
+ o(a, 0)
1477
+ ] });
1478
+ }
1479
+ function El({
1480
+ title: l,
1481
+ instructions: a,
1482
+ dueDate: i,
1483
+ maxScore: c,
1484
+ status: p,
1485
+ submissionTypes: r,
1486
+ existingSubmission: m,
1487
+ fileConstraints: s,
1488
+ onSubmit: v,
1489
+ onSaveDraft: b,
1490
+ grade: h,
1491
+ isSubmitting: w = !1,
1492
+ readOnly: N = !1,
1493
+ isLoading: C,
1494
+ error: z,
1495
+ onRetry: d,
1496
+ className: S,
1497
+ style: U
1498
+ }) {
1499
+ const [u, M] = F((m == null ? void 0 : m.textContent) ?? ""), [x, A] = F((m == null ? void 0 : m.files) ?? []), [o, y] = F((m == null ? void 0 : m.url) ?? ""), [L, T] = F(r[0]);
1500
+ if (C)
1501
+ return /* @__PURE__ */ t("div", { className: k("space-y-4", S), style: U, children: [
1502
+ /* @__PURE__ */ e(f, { className: "h-8 w-64" }),
1503
+ /* @__PURE__ */ e(f, { className: "h-6 w-20" }),
1504
+ /* @__PURE__ */ e(f, { className: "h-32 w-full" }),
1505
+ /* @__PURE__ */ e(f, { className: "h-10 w-32" })
1506
+ ] });
1507
+ if (z)
1508
+ return /* @__PURE__ */ e("div", { className: k("py-12", S), style: U, children: /* @__PURE__ */ e(
1509
+ $,
1510
+ {
1511
+ icon: /* @__PURE__ */ e(q, { className: "size-10 text-destructive" }),
1512
+ title: "Something went wrong",
1513
+ description: z,
1514
+ action: d ? /* @__PURE__ */ e(D, { variant: "outline", onClick: d, children: "Retry" }) : void 0
1515
+ }
1516
+ ) });
1517
+ const n = !N && !["submitted", "graded"].includes(p);
1518
+ function g() {
1519
+ return {
1520
+ textContent: r.includes("text") ? u : void 0,
1521
+ files: r.includes("file") ? x : void 0,
1522
+ url: r.includes("url") ? o : void 0
1523
+ };
1524
+ }
1525
+ return /* @__PURE__ */ t("div", { className: S, style: U, children: [
1526
+ /* @__PURE__ */ e("div", { className: "flex justify-between items-start mb-2", children: /* @__PURE__ */ t("div", { children: [
1527
+ /* @__PURE__ */ e("div", { className: "text-xl font-bold text-foreground mb-0.5", children: l }),
1528
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
1529
+ /* @__PURE__ */ e(at, { status: p }),
1530
+ i && /* @__PURE__ */ e(nt, { dueDate: i, size: "small" }),
1531
+ c != null && /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: [
1532
+ c,
1533
+ " points"
1534
+ ] })
1535
+ ] })
1536
+ ] }) }),
1537
+ /* @__PURE__ */ e(E, { className: "mb-3", children: /* @__PURE__ */ t(_, { className: "pt-6", children: [
1538
+ /* @__PURE__ */ e("div", { className: "font-semibold text-sm text-foreground mb-1", children: "Instructions" }),
1539
+ /* @__PURE__ */ e("div", { className: "text-muted-foreground text-sm", children: typeof a == "string" ? /* @__PURE__ */ e("span", { children: a }) : a })
1540
+ ] }) }),
1541
+ h && /* @__PURE__ */ e(et, { variant: "success", className: "mb-3", children: /* @__PURE__ */ t(tt, { children: [
1542
+ /* @__PURE__ */ t("div", { className: "font-semibold text-sm mb-1", children: [
1543
+ "Grade: ",
1544
+ h.score,
1545
+ c != null ? ` / ${c}` : ""
1546
+ ] }),
1547
+ h.feedback && /* @__PURE__ */ e("div", { children: h.feedback })
1548
+ ] }) }),
1549
+ n && /* @__PURE__ */ t(O, { children: [
1550
+ r.length > 1 ? /* @__PURE__ */ t(st, { value: L, onValueChange: (R) => T(R), children: [
1551
+ /* @__PURE__ */ t(it, { children: [
1552
+ r.includes("text") && /* @__PURE__ */ e(ce, { value: "text", children: "Text" }),
1553
+ r.includes("file") && /* @__PURE__ */ e(ce, { value: "file", children: "File Upload" }),
1554
+ r.includes("url") && /* @__PURE__ */ e(ce, { value: "url", children: "URL" })
1555
+ ] }),
1556
+ r.includes("text") && /* @__PURE__ */ e(ke, { value: "text", children: /* @__PURE__ */ e(
1557
+ ue,
1558
+ {
1559
+ className: "min-h-45",
1560
+ placeholder: "Type your submission...",
1561
+ value: u,
1562
+ onChange: (R) => M(R),
1563
+ variant: "default"
1564
+ }
1565
+ ) }),
1566
+ r.includes("file") && /* @__PURE__ */ e(ke, { value: "file", children: /* @__PURE__ */ e(
1567
+ He,
1568
+ {
1569
+ files: x,
1570
+ onFilesAdded: (R) => A((P) => [...P, ...R]),
1571
+ onFileRemove: (R) => A((P) => P.filter((Z, V) => V !== R)),
1572
+ accept: s == null ? void 0 : s.acceptedTypes,
1573
+ maxFiles: s == null ? void 0 : s.maxFiles,
1574
+ maxSizeMB: s == null ? void 0 : s.maxSizeMB
1575
+ }
1576
+ ) }),
1577
+ r.includes("url") && /* @__PURE__ */ e(ke, { value: "url", children: /* @__PURE__ */ e(
1578
+ Ae,
1579
+ {
1580
+ placeholder: "https://...",
1581
+ value: o,
1582
+ onChange: (R) => y(R.target.value)
1583
+ }
1584
+ ) })
1585
+ ] }) : /* @__PURE__ */ t(O, { children: [
1586
+ r.includes("text") && /* @__PURE__ */ e(
1587
+ ue,
1588
+ {
1589
+ className: "min-h-45 mb-2",
1590
+ placeholder: "Type your submission...",
1591
+ value: u,
1592
+ onChange: (R) => M(R),
1593
+ variant: "default"
1594
+ }
1595
+ ),
1596
+ r.includes("file") && /* @__PURE__ */ e("div", { className: "mb-2", children: /* @__PURE__ */ e(
1597
+ He,
1598
+ {
1599
+ files: x,
1600
+ onFilesAdded: (R) => A((P) => [...P, ...R]),
1601
+ onFileRemove: (R) => A((P) => P.filter((Z, V) => V !== R)),
1602
+ accept: s == null ? void 0 : s.acceptedTypes,
1603
+ maxFiles: s == null ? void 0 : s.maxFiles,
1604
+ maxSizeMB: s == null ? void 0 : s.maxSizeMB
1605
+ }
1606
+ ) }),
1607
+ r.includes("url") && /* @__PURE__ */ e(
1608
+ Ae,
1609
+ {
1610
+ className: "mb-2",
1611
+ placeholder: "https://...",
1612
+ value: o,
1613
+ onChange: (R) => y(R.target.value)
1614
+ }
1615
+ )
1616
+ ] }),
1617
+ /* @__PURE__ */ e(G, { className: "my-2" }),
1618
+ /* @__PURE__ */ t("div", { className: "flex gap-2 justify-end", children: [
1619
+ b && /* @__PURE__ */ t(
1620
+ D,
1621
+ {
1622
+ variant: "outline",
1623
+ onClick: () => b(g()),
1624
+ disabled: w,
1625
+ children: [
1626
+ /* @__PURE__ */ e(Dt, { size: 16 }),
1627
+ "Save Draft"
1628
+ ]
1629
+ }
1630
+ ),
1631
+ /* @__PURE__ */ t(
1632
+ D,
1633
+ {
1634
+ onClick: () => v(g()),
1635
+ disabled: w,
1636
+ children: [
1637
+ /* @__PURE__ */ e(Ye, { size: 16 }),
1638
+ w ? "Submitting..." : "Submit"
1639
+ ]
1640
+ }
1641
+ )
1642
+ ] })
1643
+ ] })
1644
+ ] });
1645
+ }
1646
+ function pe({
1647
+ label: l,
1648
+ field: a,
1649
+ sortField: i,
1650
+ sortDir: c,
1651
+ onSort: p,
1652
+ textAlign: r
1653
+ }) {
1654
+ const m = i === a;
1655
+ return /* @__PURE__ */ e(
1656
+ Ne,
1657
+ {
1658
+ className: k(
1659
+ "cursor-pointer select-none hover:bg-muted",
1660
+ r === "right" && "text-right"
1661
+ ),
1662
+ onClick: () => p(a),
1663
+ children: /* @__PURE__ */ t("div", { className: k("flex items-center gap-1", r === "right" && "justify-end"), children: [
1664
+ /* @__PURE__ */ e("span", { className: k(m ? "text-foreground" : "text-muted-foreground"), children: l }),
1665
+ m && (c === "asc" ? /* @__PURE__ */ e(Tt, { size: 14 }) : /* @__PURE__ */ e(Mt, { size: 14 }))
1666
+ ] })
1667
+ }
1668
+ );
1669
+ }
1670
+ function _l({
1671
+ items: l,
1672
+ categories: a,
1673
+ overallGrade: i,
1674
+ showWeights: c = !0,
1675
+ showCategoryTotals: p = !0,
1676
+ onItemClick: r,
1677
+ readOnly: m = !1,
1678
+ isLoading: s,
1679
+ error: v,
1680
+ onRetry: b,
1681
+ pageSize: h,
1682
+ currentPage: w = 1,
1683
+ totalItems: N,
1684
+ onPageChange: C,
1685
+ className: z,
1686
+ style: d
1687
+ }) {
1688
+ const [S, U] = F("dueDate"), [u, M] = F("asc");
1689
+ function x(L) {
1690
+ S === L ? M((T) => T === "asc" ? "desc" : "asc") : (U(L), M("asc"));
1691
+ }
1692
+ const A = j(() => {
1693
+ const L = [...l];
1694
+ return L.sort((T, n) => {
1695
+ let g = 0;
1696
+ switch (S) {
1697
+ case "name":
1698
+ g = T.name.localeCompare(n.name);
1699
+ break;
1700
+ case "score":
1701
+ g = (T.score ?? -1) - (n.score ?? -1);
1702
+ break;
1703
+ case "dueDate":
1704
+ g = (T.dueDate ?? "").localeCompare(n.dueDate ?? "");
1705
+ break;
1706
+ case "status":
1707
+ g = T.status.localeCompare(n.status);
1708
+ break;
1709
+ }
1710
+ return u === "asc" ? g : -g;
1711
+ }), L;
1712
+ }, [l, S, u]), o = j(() => {
1713
+ if (!a || a.length === 0) return [{ category: null, items: A }];
1714
+ const L = a.map((n) => ({
1715
+ category: n,
1716
+ items: A.filter((g) => g.categoryUid === n.uid)
1717
+ })), T = A.filter((n) => !n.categoryUid);
1718
+ return T.length > 0 && L.push({ category: null, items: T }), L;
1719
+ }, [A, a]), y = c ? 5 : 4;
1720
+ return s ? /* @__PURE__ */ t("div", { className: k("space-y-4", z), style: d, children: [
1721
+ /* @__PURE__ */ e(f, { className: "h-20 w-full" }),
1722
+ /* @__PURE__ */ e(f, { className: "h-10 w-full" }),
1723
+ /* @__PURE__ */ e(f, { className: "h-12 w-full" }),
1724
+ /* @__PURE__ */ e(f, { className: "h-12 w-full" }),
1725
+ /* @__PURE__ */ e(f, { className: "h-12 w-full" }),
1726
+ /* @__PURE__ */ e(f, { className: "h-12 w-full" }),
1727
+ /* @__PURE__ */ e(f, { className: "h-12 w-full" })
1728
+ ] }) : v ? /* @__PURE__ */ e("div", { className: k("py-12", z), style: d, children: /* @__PURE__ */ e(
1729
+ $,
1730
+ {
1731
+ icon: /* @__PURE__ */ e(q, { className: "size-10 text-destructive" }),
1732
+ title: "Something went wrong",
1733
+ description: v,
1734
+ action: b ? /* @__PURE__ */ e(D, { variant: "outline", onClick: b, children: "Retry" }) : void 0
1735
+ }
1736
+ ) }) : /* @__PURE__ */ t("div", { className: z, style: d, children: [
1737
+ i && /* @__PURE__ */ e(E, { className: "mb-3", children: /* @__PURE__ */ e(_, { className: "pt-6", children: /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
1738
+ /* @__PURE__ */ e(
1739
+ qt,
1740
+ {
1741
+ percentage: i.percentage,
1742
+ letterGrade: i.letterGrade,
1743
+ size: "large",
1744
+ passingThreshold: 60
1745
+ }
1746
+ ),
1747
+ /* @__PURE__ */ t("div", { children: [
1748
+ /* @__PURE__ */ e("div", { className: "text-lg font-semibold text-foreground", children: "Overall Grade" }),
1749
+ /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: [
1750
+ i.pointsEarned,
1751
+ " / ",
1752
+ i.pointsPossible,
1753
+ " points"
1754
+ ] })
1755
+ ] })
1756
+ ] }) }) }),
1757
+ /* @__PURE__ */ e(E, { children: /* @__PURE__ */ t(rt, { children: [
1758
+ /* @__PURE__ */ e(ct, { children: /* @__PURE__ */ t(de, { children: [
1759
+ /* @__PURE__ */ e(
1760
+ pe,
1761
+ {
1762
+ label: "Assignment",
1763
+ field: "name",
1764
+ sortField: S,
1765
+ sortDir: u,
1766
+ onSort: x
1767
+ }
1768
+ ),
1769
+ /* @__PURE__ */ e(
1770
+ pe,
1771
+ {
1772
+ label: "Status",
1773
+ field: "status",
1774
+ sortField: S,
1775
+ sortDir: u,
1776
+ onSort: x
1777
+ }
1778
+ ),
1779
+ /* @__PURE__ */ e(
1780
+ pe,
1781
+ {
1782
+ label: "Due Date",
1783
+ field: "dueDate",
1784
+ sortField: S,
1785
+ sortDir: u,
1786
+ onSort: x
1787
+ }
1788
+ ),
1789
+ /* @__PURE__ */ e(
1790
+ pe,
1791
+ {
1792
+ label: "Score",
1793
+ field: "score",
1794
+ sortField: S,
1795
+ sortDir: u,
1796
+ onSort: x,
1797
+ textAlign: "right"
1798
+ }
1799
+ ),
1800
+ c && /* @__PURE__ */ e(Ne, { className: "text-right text-muted-foreground", children: "Weight" })
1801
+ ] }) }),
1802
+ /* @__PURE__ */ e(dt, { children: o.map((L, T) => {
1803
+ var n;
1804
+ return /* @__PURE__ */ t(At, { children: [
1805
+ L.category && p && /* @__PURE__ */ e(de, { className: "bg-muted hover:bg-muted", children: /* @__PURE__ */ e(le, { colSpan: y, children: /* @__PURE__ */ t("span", { className: "font-semibold text-sm text-foreground", children: [
1806
+ L.category.name,
1807
+ L.category.weight != null && ` (${L.category.weight}%)`
1808
+ ] }) }) }),
1809
+ L.items.map((g) => /* @__PURE__ */ t(
1810
+ de,
1811
+ {
1812
+ className: k(r && !m && "cursor-pointer"),
1813
+ onClick: () => r && !m ? r(g) : void 0,
1814
+ children: [
1815
+ /* @__PURE__ */ e(le, { children: g.name }),
1816
+ /* @__PURE__ */ e(le, { children: /* @__PURE__ */ e(at, { status: g.status, size: "small" }) }),
1817
+ /* @__PURE__ */ e(le, { children: g.dueDate ? /* @__PURE__ */ e(
1818
+ nt,
1819
+ {
1820
+ dueDate: g.dueDate,
1821
+ submittedDate: g.submittedDate,
1822
+ size: "small"
1823
+ }
1824
+ ) : "—" }),
1825
+ /* @__PURE__ */ e(le, { className: "text-right", children: g.score != null ? /* @__PURE__ */ t("span", { className: "text-sm font-semibold text-foreground", children: [
1826
+ g.score,
1827
+ " / ",
1828
+ g.maxScore
1829
+ ] }) : g.status === "excused" ? /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Excused" }) : /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "—" }) }),
1830
+ c && /* @__PURE__ */ e(le, { className: "text-right", children: g.weight != null ? `${g.weight}%` : "—" })
1831
+ ]
1832
+ },
1833
+ g.uid
1834
+ ))
1835
+ ] }, ((n = L.category) == null ? void 0 : n.uid) ?? `ungrouped-${T}`);
1836
+ }) })
1837
+ ] }) }),
1838
+ C && h && /* @__PURE__ */ e(
1839
+ we,
1840
+ {
1841
+ currentPage: w,
1842
+ totalPages: Math.ceil((N ?? l.length) / h),
1843
+ onPageChange: C,
1844
+ className: "mt-4"
1845
+ }
1846
+ )
1847
+ ] });
1848
+ }
1849
+ const il = [
1850
+ "var(--palette-0)",
1851
+ "var(--palette-1)",
1852
+ "var(--palette-2)",
1853
+ "var(--palette-3)"
1854
+ ], Ce = il.length;
1855
+ function rl(l) {
1856
+ return `palette${(l % Ce + Ce) % Ce}`;
1857
+ }
1858
+ function Bl({
1859
+ overallProgress: l,
1860
+ totalTimeSpent: a,
1861
+ modules: i,
1862
+ recentActivity: c,
1863
+ streak: p,
1864
+ achievements: r,
1865
+ recentActivityLimit: m = 5,
1866
+ onModuleClick: s,
1867
+ isLoading: v,
1868
+ error: b,
1869
+ onRetry: h,
1870
+ className: w,
1871
+ style: N
1872
+ }) {
1873
+ const C = j(
1874
+ () => i.filter((d) => d.completedItems === d.totalItems).length,
1875
+ [i]
1876
+ ), z = j(
1877
+ () => (c == null ? void 0 : c.map((d) => ({
1878
+ uid: d.uid,
1879
+ type: d.type,
1880
+ title: d.description,
1881
+ timestamp: d.timestamp
1882
+ }))) ?? [],
1883
+ [c]
1884
+ );
1885
+ return v ? /* @__PURE__ */ t("div", { className: k("space-y-4", w), style: N, children: [
1886
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-3 gap-3", children: [
1887
+ /* @__PURE__ */ e(f, { className: "h-24" }),
1888
+ /* @__PURE__ */ e(f, { className: "h-24" }),
1889
+ /* @__PURE__ */ e(f, { className: "h-24" })
1890
+ ] }),
1891
+ /* @__PURE__ */ e(f, { className: "h-32 w-32 rounded-full mx-auto" }),
1892
+ /* @__PURE__ */ e(f, { className: "h-8 w-full" }),
1893
+ /* @__PURE__ */ e(f, { className: "h-8 w-full" }),
1894
+ /* @__PURE__ */ e(f, { className: "h-8 w-full" })
1895
+ ] }) : b ? /* @__PURE__ */ e("div", { className: k("py-12", w), style: N, children: /* @__PURE__ */ e(
1896
+ $,
1897
+ {
1898
+ icon: /* @__PURE__ */ e(q, { className: "size-10 text-destructive" }),
1899
+ title: "Something went wrong",
1900
+ description: b,
1901
+ action: h ? /* @__PURE__ */ e(D, { variant: "outline", onClick: h, children: "Retry" }) : void 0
1902
+ }
1903
+ ) }) : /* @__PURE__ */ t("div", { className: w, style: N, children: [
1904
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-[repeat(auto-fit,minmax(160px,1fr))] gap-3 mb-4", children: [
1905
+ /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(_, { className: "p-3 flex justify-center", children: /* @__PURE__ */ e(ot, { value: l, size: 100 }) }) }),
1906
+ /* @__PURE__ */ e(
1907
+ Le,
1908
+ {
1909
+ icon: /* @__PURE__ */ e(xe, { size: 24 }),
1910
+ label: "Time Spent",
1911
+ description: "Total learning time",
1912
+ value: lt(a)
1913
+ }
1914
+ ),
1915
+ p && /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(_, { className: "p-4 flex items-center", children: /* @__PURE__ */ e(
1916
+ el,
1917
+ {
1918
+ currentStreak: p.currentDays,
1919
+ longestStreak: p.longestDays,
1920
+ showLongest: !0
1921
+ }
1922
+ ) }) }),
1923
+ /* @__PURE__ */ e(
1924
+ Le,
1925
+ {
1926
+ icon: /* @__PURE__ */ e(oe, { size: 24 }),
1927
+ label: "Modules",
1928
+ description: "Course progress",
1929
+ value: `${C} / ${i.length}`,
1930
+ subtitle: "completed"
1931
+ }
1932
+ )
1933
+ ] }),
1934
+ /* @__PURE__ */ e(G, { className: "mb-3" }),
1935
+ /* @__PURE__ */ e("p", { className: "text-lg font-semibold mb-2 text-foreground", children: "Module Progress" }),
1936
+ /* @__PURE__ */ e("div", { className: "flex flex-col gap-2 mb-4", children: i.map((d, S) => {
1937
+ const U = d.totalItems > 0 ? d.completedItems / d.totalItems * 100 : 0;
1938
+ return /* @__PURE__ */ e(
1939
+ E,
1940
+ {
1941
+ className: k(
1942
+ "transition-colors",
1943
+ s && "cursor-pointer hover:border-primary"
1944
+ ),
1945
+ onClick: () => s == null ? void 0 : s(d.uid),
1946
+ children: /* @__PURE__ */ t(_, { className: "p-3", children: [
1947
+ /* @__PURE__ */ t("div", { className: "flex justify-between items-center mb-0.5", children: [
1948
+ /* @__PURE__ */ e("span", { className: "font-semibold text-sm text-foreground", children: d.name }),
1949
+ /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: [
1950
+ d.completedItems,
1951
+ " / ",
1952
+ d.totalItems
1953
+ ] })
1954
+ ] }),
1955
+ /* @__PURE__ */ e(fe, { value: U, size: "sm", variant: U >= 100 ? "success" : rl(S) })
1956
+ ] })
1957
+ },
1958
+ d.uid
1959
+ );
1960
+ }) }),
1961
+ c && c.length > 0 && /* @__PURE__ */ t(O, { children: [
1962
+ /* @__PURE__ */ e(G, { className: "mb-3" }),
1963
+ /* @__PURE__ */ e("p", { className: "text-lg font-semibold mb-2 text-foreground", children: "Recent Activity" }),
1964
+ /* @__PURE__ */ e("div", { className: "mb-4", children: /* @__PURE__ */ e(
1965
+ tl,
1966
+ {
1967
+ events: z,
1968
+ limit: m
1969
+ }
1970
+ ) })
1971
+ ] }),
1972
+ r && r.length > 0 && /* @__PURE__ */ t(O, { children: [
1973
+ /* @__PURE__ */ e(G, { className: "mb-3" }),
1974
+ /* @__PURE__ */ e("p", { className: "text-lg font-semibold mb-2 text-foreground", children: "Achievements" }),
1975
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-[repeat(auto-fill,minmax(140px,1fr))] gap-2", children: r.map((d) => /* @__PURE__ */ e(
1976
+ mt,
1977
+ {
1978
+ title: d.name,
1979
+ description: d.description,
1980
+ icon: d.iconUrl ? /* @__PURE__ */ e(
1981
+ "img",
1982
+ {
1983
+ src: d.iconUrl,
1984
+ alt: d.name,
1985
+ className: "w-12 h-12"
1986
+ }
1987
+ ) : void 0,
1988
+ earnedDate: d.earnedAt
1989
+ },
1990
+ d.uid
1991
+ )) })
1992
+ ] })
1993
+ ] });
1994
+ }
1995
+ const cl = {
1996
+ classic: {
1997
+ size: 40,
1998
+ paths: [
1999
+ { d: "M 2 38 L 2 10 Q 2 2 10 2 L 38 2", strokeWidth: 1.5 },
2000
+ { d: "M 7 38 L 7 13 Q 7 7 13 7 L 38 7", strokeWidth: 0.75 }
2001
+ ],
2002
+ color: "text-warning/50"
2003
+ },
2004
+ modern: null,
2005
+ elegant: {
2006
+ size: 32,
2007
+ paths: [{ d: "M 0 30 L 0 0 L 30 0", strokeWidth: 0.5 }],
2008
+ dots: [{ cx: 2.5, cy: 2.5, r: 1.5 }],
2009
+ color: "text-foreground/20"
2010
+ },
2011
+ academic: {
2012
+ size: 36,
2013
+ paths: [
2014
+ { d: "M 0 36 L 0 0 L 36 0", strokeWidth: 2 },
2015
+ { d: "M 5 36 L 5 5 L 36 5", strokeWidth: 1 }
2016
+ ],
2017
+ color: "text-info/35"
2018
+ },
2019
+ minimal: null,
2020
+ bold: {
2021
+ size: 20,
2022
+ paths: [],
2023
+ dots: [{ cx: 5, cy: 5, r: 5 }],
2024
+ color: "text-primary/40"
2025
+ }
2026
+ }, dl = [
2027
+ { key: "tl", pos: "top-3 left-3", transform: void 0 },
2028
+ { key: "tr", pos: "top-3 right-3", transform: "scaleX(-1)" },
2029
+ { key: "bl", pos: "bottom-3 left-3", transform: "scaleY(-1)" },
2030
+ { key: "br", pos: "bottom-3 right-3", transform: "scale(-1)" }
2031
+ ], ol = {
2032
+ classic: {
2033
+ lineColor: "bg-warning/30",
2034
+ motif: /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 12 12", className: "text-warning/50 shrink-0", "aria-hidden": "true", children: /* @__PURE__ */ e("path", { d: "M6 0 L12 6 L6 12 L0 6 Z", fill: "currentColor" }) })
2035
+ },
2036
+ modern: {
2037
+ lineColor: "bg-primary/20",
2038
+ motif: /* @__PURE__ */ e("svg", { width: "8", height: "8", viewBox: "0 0 8 8", className: "text-primary/40 shrink-0", "aria-hidden": "true", children: /* @__PURE__ */ e("circle", { cx: "4", cy: "4", r: "3", fill: "currentColor" }) })
2039
+ },
2040
+ elegant: {
2041
+ lineColor: "bg-foreground/10",
2042
+ motif: /* @__PURE__ */ e("svg", { width: "10", height: "10", viewBox: "0 0 10 10", className: "text-foreground/15 shrink-0", "aria-hidden": "true", children: /* @__PURE__ */ e("path", { d: "M5 0 L6 4 L10 5 L6 6 L5 10 L4 6 L0 5 L4 4 Z", fill: "currentColor" }) })
2043
+ },
2044
+ academic: {
2045
+ lineColor: "bg-info/25",
2046
+ motif: /* @__PURE__ */ e("svg", { width: "10", height: "10", viewBox: "0 0 10 10", className: "text-info/40 shrink-0", "aria-hidden": "true", children: /* @__PURE__ */ e("path", { d: "M4 0 L6 0 L6 4 L10 4 L10 6 L6 6 L6 10 L4 10 L4 6 L0 6 L0 4 L4 4 Z", fill: "currentColor" }) })
2047
+ },
2048
+ minimal: {
2049
+ lineColor: "bg-border",
2050
+ motif: null
2051
+ },
2052
+ bold: {
2053
+ lineColor: "bg-primary/40",
2054
+ motif: /* @__PURE__ */ e("svg", { width: "10", height: "10", viewBox: "0 0 10 10", className: "text-primary/50 shrink-0", "aria-hidden": "true", children: /* @__PURE__ */ e("rect", { x: "1", y: "1", width: "8", height: "8", fill: "currentColor" }) })
2055
+ }
2056
+ }, ml = {
2057
+ classic: {
2058
+ background: "radial-gradient(ellipse at center, var(--color-warning) 0%, transparent 65%)",
2059
+ opacity: 0.06
2060
+ },
2061
+ modern: null,
2062
+ elegant: {
2063
+ background: "radial-gradient(ellipse at center, var(--color-foreground) 0%, transparent 70%)",
2064
+ opacity: 0.03
2065
+ },
2066
+ academic: {
2067
+ background: "radial-gradient(ellipse at center, var(--color-info) 0%, transparent 65%)",
2068
+ opacity: 0.05
2069
+ },
2070
+ minimal: null,
2071
+ bold: {
2072
+ background: "radial-gradient(ellipse at 30% 50%, var(--color-primary) 0%, transparent 50%), radial-gradient(ellipse at 70% 50%, var(--color-palette-0) 0%, transparent 50%)",
2073
+ opacity: 0.06
2074
+ }
2075
+ }, ul = {
2076
+ classic: "text-warning",
2077
+ modern: "text-primary",
2078
+ elegant: "text-foreground/60",
2079
+ academic: "text-info",
2080
+ minimal: "text-muted-foreground",
2081
+ bold: "text-primary"
2082
+ }, hl = {
2083
+ classic: "uppercase tracking-[4px] text-base font-medium text-foreground/80 font-serif",
2084
+ modern: "uppercase tracking-[3px] text-base font-medium text-primary/80",
2085
+ elegant: "uppercase tracking-[5px] text-sm font-light text-foreground/50",
2086
+ academic: "uppercase tracking-[3px] text-base font-semibold text-info/80",
2087
+ minimal: "uppercase tracking-[2px] text-sm font-normal text-muted-foreground",
2088
+ bold: "uppercase tracking-[3px] text-lg font-black text-primary"
2089
+ }, fl = {
2090
+ classic: "text-warning",
2091
+ modern: "text-primary",
2092
+ elegant: "text-foreground/80",
2093
+ academic: "text-info",
2094
+ minimal: "text-foreground",
2095
+ bold: "text-primary"
2096
+ }, pl = /* @__PURE__ */ new Set([
2097
+ "classic",
2098
+ "elegant",
2099
+ "academic"
2100
+ ]), gl = ht("mx-auto max-w-4xl", {
2101
+ variants: {
2102
+ variant: {
2103
+ classic: "border-[3px] border-double border-warning/50 rounded-lg p-1.5",
2104
+ modern: "rounded-lg",
2105
+ elegant: "border border-foreground/15 rounded-lg p-2.5 dark:border-foreground/10",
2106
+ academic: "border-2 border-info/30 rounded-lg p-1.5",
2107
+ minimal: "rounded-lg",
2108
+ bold: "rounded-lg"
2109
+ }
2110
+ },
2111
+ defaultVariants: { variant: "classic" }
2112
+ }), xl = ht(
2113
+ "relative text-center p-8 sm:p-12 md:p-16 overflow-hidden",
2114
+ {
2115
+ variants: {
2116
+ variant: {
2117
+ classic: "border border-warning/25 rounded bg-warning/5",
2118
+ modern: "border border-primary/20 rounded-lg bg-linear-to-br from-primary/5 to-primary/8 border-t-[3px] border-t-primary/60",
2119
+ elegant: "border border-foreground/8 rounded bg-linear-to-b from-background to-muted/20 dark:border-foreground/5 dark:to-muted/10",
2120
+ academic: "border border-info/15 rounded bg-info/3",
2121
+ minimal: "border border-border rounded-lg bg-background",
2122
+ bold: "border-[3px] border-primary rounded-lg bg-linear-to-br from-primary/8 to-palette-0/8"
2123
+ }
2124
+ },
2125
+ defaultVariants: { variant: "classic" }
2126
+ }
2127
+ );
2128
+ function Nl({ variant: l }) {
2129
+ const a = cl[l];
2130
+ return a ? /* @__PURE__ */ e(O, { children: dl.map(({ key: i, pos: c, transform: p }) => {
2131
+ var r;
2132
+ return /* @__PURE__ */ t(
2133
+ "svg",
2134
+ {
2135
+ className: k("absolute pointer-events-none", c, a.color),
2136
+ width: a.size,
2137
+ height: a.size,
2138
+ viewBox: `0 0 ${a.size} ${a.size}`,
2139
+ fill: "none",
2140
+ stroke: "currentColor",
2141
+ style: p ? { transform: p } : void 0,
2142
+ "aria-hidden": "true",
2143
+ children: [
2144
+ a.paths.map((m, s) => /* @__PURE__ */ e("path", { d: m.d, strokeWidth: m.strokeWidth }, s)),
2145
+ (r = a.dots) == null ? void 0 : r.map((m, s) => /* @__PURE__ */ e(
2146
+ "circle",
2147
+ {
2148
+ cx: m.cx,
2149
+ cy: m.cy,
2150
+ r: m.r,
2151
+ fill: "currentColor",
2152
+ stroke: "none"
2153
+ },
2154
+ `d${s}`
2155
+ ))
2156
+ ]
2157
+ },
2158
+ i
2159
+ );
2160
+ }) }) : null;
2161
+ }
2162
+ function Oe({
2163
+ variant: l,
2164
+ className: a
2165
+ }) {
2166
+ const i = ol[l];
2167
+ return /* @__PURE__ */ t(
2168
+ "div",
2169
+ {
2170
+ className: k(
2171
+ "flex items-center justify-center gap-3 my-5 mx-auto max-w-70",
2172
+ a
2173
+ ),
2174
+ role: "separator",
2175
+ "aria-hidden": "true",
2176
+ children: [
2177
+ /* @__PURE__ */ e("span", { className: k("flex-1 h-px", i.lineColor) }),
2178
+ i.motif,
2179
+ /* @__PURE__ */ e("span", { className: k("flex-1 h-px", i.lineColor) })
2180
+ ]
2181
+ }
2182
+ );
2183
+ }
2184
+ function jl({
2185
+ recipientName: l,
2186
+ courseTitle: a,
2187
+ completionDate: i,
2188
+ organizationName: c,
2189
+ organizationLogo: p,
2190
+ signatory: r,
2191
+ certificateId: m,
2192
+ variant: s = "classic",
2193
+ showActions: v = !0,
2194
+ onPrint: b,
2195
+ onDownload: h,
2196
+ isLoading: w,
2197
+ error: N,
2198
+ onRetry: C,
2199
+ className: z,
2200
+ style: d
2201
+ }) {
2202
+ const S = j(() => {
2203
+ try {
2204
+ return new Date(i).toLocaleDateString("en-US", {
2205
+ year: "numeric",
2206
+ month: "long",
2207
+ day: "numeric"
2208
+ });
2209
+ } catch {
2210
+ return i;
2211
+ }
2212
+ }, [i]);
2213
+ function U() {
2214
+ b ? b() : window.print();
2215
+ }
2216
+ const u = ml[s];
2217
+ return /* @__PURE__ */ e(
2218
+ te,
2219
+ {
2220
+ isLoading: w,
2221
+ error: N,
2222
+ onRetry: C,
2223
+ className: z,
2224
+ style: d,
2225
+ skeleton: /* @__PURE__ */ e(f, { className: "h-80 w-full rounded-lg border" }),
2226
+ children: /* @__PURE__ */ t("div", { className: z, style: d, children: [
2227
+ /* @__PURE__ */ e("div", { className: gl({ variant: s }), children: /* @__PURE__ */ t("div", { className: xl({ variant: s }), children: [
2228
+ /* @__PURE__ */ e(Nl, { variant: s }),
2229
+ u && /* @__PURE__ */ e(
2230
+ "div",
2231
+ {
2232
+ className: "absolute inset-0 pointer-events-none rounded-[inherit]",
2233
+ style: u,
2234
+ "aria-hidden": "true"
2235
+ }
2236
+ ),
2237
+ /* @__PURE__ */ t("div", { className: "relative", children: [
2238
+ p ? /* @__PURE__ */ e(
2239
+ "img",
2240
+ {
2241
+ src: p,
2242
+ alt: c,
2243
+ className: "h-20 mb-4 mx-auto block"
2244
+ }
2245
+ ) : /* @__PURE__ */ e(
2246
+ Se,
2247
+ {
2248
+ size: 64,
2249
+ className: k("mx-auto mb-6", ul[s])
2250
+ }
2251
+ ),
2252
+ /* @__PURE__ */ e("p", { className: k("mb-2", hl[s]), children: "Certificate of Completion" }),
2253
+ /* @__PURE__ */ e(Oe, { variant: s }),
2254
+ /* @__PURE__ */ e("p", { className: "text-base text-foreground/70 mb-2", children: "This is to certify that" }),
2255
+ /* @__PURE__ */ e(
2256
+ "p",
2257
+ {
2258
+ className: k(
2259
+ "text-4xl font-bold mb-4 text-foreground",
2260
+ pl.has(s) && "font-serif"
2261
+ ),
2262
+ children: l
2263
+ }
2264
+ ),
2265
+ /* @__PURE__ */ e("p", { className: "text-base text-foreground/70 mb-2", children: "has successfully completed" }),
2266
+ /* @__PURE__ */ e(
2267
+ "p",
2268
+ {
2269
+ className: k(
2270
+ "text-2xl font-semibold mb-4",
2271
+ fl[s]
2272
+ ),
2273
+ children: a
2274
+ }
2275
+ ),
2276
+ /* @__PURE__ */ t("p", { className: "text-base text-foreground/60 mb-6", children: [
2277
+ "Issued by ",
2278
+ c,
2279
+ " on ",
2280
+ S
2281
+ ] }),
2282
+ r && /* @__PURE__ */ t("div", { className: "mt-6 mb-4", children: [
2283
+ /* @__PURE__ */ e(Oe, { variant: s }),
2284
+ /* @__PURE__ */ e("p", { className: "font-semibold text-base text-foreground", children: r.name }),
2285
+ /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: r.title })
2286
+ ] }),
2287
+ m && /* @__PURE__ */ t("span", { className: "block text-xs text-muted-foreground mt-4", children: [
2288
+ "Certificate ID: ",
2289
+ m
2290
+ ] })
2291
+ ] })
2292
+ ] }) }),
2293
+ v && /* @__PURE__ */ t("div", { className: "flex justify-center gap-3 mt-6", children: [
2294
+ /* @__PURE__ */ t(D, { variant: "outline", onClick: U, children: [
2295
+ /* @__PURE__ */ e(It, { size: 16 }),
2296
+ " Print"
2297
+ ] }),
2298
+ h && /* @__PURE__ */ t(D, { variant: "outline", onClick: h, children: [
2299
+ /* @__PURE__ */ e(Ft, { size: 16 }),
2300
+ " Download"
2301
+ ] })
2302
+ ] })
2303
+ ] })
2304
+ }
2305
+ );
2306
+ }
2307
+ function Ql({
2308
+ criteria: l,
2309
+ selectedLevels: a,
2310
+ totalScore: i,
2311
+ maxScore: c,
2312
+ feedback: p,
2313
+ isLoading: r,
2314
+ error: m,
2315
+ onRetry: s,
2316
+ className: v,
2317
+ style: b
2318
+ }) {
2319
+ var w;
2320
+ const h = a && Object.keys(a).length > 0;
2321
+ return r ? /* @__PURE__ */ t("div", { className: k("space-y-4", v), style: b, children: [
2322
+ /* @__PURE__ */ e(f, { className: "h-10 w-full" }),
2323
+ Array.from({ length: 3 }).map((N, C) => /* @__PURE__ */ e(f, { className: "h-16 w-full" }, C))
2324
+ ] }) : m ? /* @__PURE__ */ e("div", { className: k("py-12", v), style: b, children: /* @__PURE__ */ e(
2325
+ $,
2326
+ {
2327
+ icon: /* @__PURE__ */ e(q, { className: "size-10 text-destructive" }),
2328
+ title: "Something went wrong",
2329
+ description: m,
2330
+ action: s ? /* @__PURE__ */ e(D, { variant: "outline", onClick: s, children: "Retry" }) : void 0
2331
+ }
2332
+ ) }) : /* @__PURE__ */ t("div", { className: k("flex flex-col gap-4", v), style: b, children: [
2333
+ h && i !== void 0 && c !== void 0 && /* @__PURE__ */ t("div", { className: "flex items-center justify-between", children: [
2334
+ /* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-foreground", children: "Rubric" }),
2335
+ /* @__PURE__ */ t(X, { variant: i >= c * 0.7 ? "success" : "destructive", children: [
2336
+ i,
2337
+ " / ",
2338
+ c,
2339
+ " pts"
2340
+ ] })
2341
+ ] }),
2342
+ !h && /* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-foreground", children: "Grading Rubric" }),
2343
+ /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(_, { className: "p-0", children: /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ t(rt, { className: "text-sm", children: [
2344
+ /* @__PURE__ */ e(ct, { children: /* @__PURE__ */ t(de, { className: "bg-muted/50", children: [
2345
+ /* @__PURE__ */ e(Ne, { className: "text-left font-medium text-muted-foreground w-1/5", children: "Criterion" }),
2346
+ (w = l[0]) == null ? void 0 : w.levels.map((N) => /* @__PURE__ */ t(
2347
+ Ne,
2348
+ {
2349
+ className: "text-center font-medium text-muted-foreground",
2350
+ children: [
2351
+ /* @__PURE__ */ e("div", { children: N.label }),
2352
+ /* @__PURE__ */ t("div", { className: "text-xs font-normal mt-0.5", children: [
2353
+ N.points,
2354
+ " pts"
2355
+ ] })
2356
+ ]
2357
+ },
2358
+ N.uid
2359
+ ))
2360
+ ] }) }),
2361
+ /* @__PURE__ */ e(dt, { children: l.map((N, C) => {
2362
+ const z = a == null ? void 0 : a[N.uid];
2363
+ return /* @__PURE__ */ t(
2364
+ de,
2365
+ {
2366
+ className: k(C % 2 === 1 && "bg-muted/20"),
2367
+ children: [
2368
+ /* @__PURE__ */ t(le, { className: "align-top", children: [
2369
+ /* @__PURE__ */ e("div", { className: "font-medium text-foreground", children: N.name }),
2370
+ N.description && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground mt-0.5", children: N.description })
2371
+ ] }),
2372
+ N.levels.map((d) => {
2373
+ const S = z === d.uid;
2374
+ return /* @__PURE__ */ t(
2375
+ le,
2376
+ {
2377
+ className: k(
2378
+ "align-top text-center",
2379
+ S && "bg-primary/10 ring-2 ring-primary/30 ring-inset rounded-sm"
2380
+ ),
2381
+ children: [
2382
+ /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: d.description }),
2383
+ S && /* @__PURE__ */ e("div", { className: "mt-1.5 flex justify-center", children: /* @__PURE__ */ e(me, { className: "size-4 text-primary" }) })
2384
+ ]
2385
+ },
2386
+ d.uid
2387
+ );
2388
+ })
2389
+ ]
2390
+ },
2391
+ N.uid
2392
+ );
2393
+ }) })
2394
+ ] }) }) }) }),
2395
+ p && /* @__PURE__ */ t(O, { children: [
2396
+ /* @__PURE__ */ e(G, {}),
2397
+ /* @__PURE__ */ t("div", { children: [
2398
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground mb-1", children: "Instructor Feedback" }),
2399
+ /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground whitespace-pre-wrap", children: p })
2400
+ ] })
2401
+ ] })
2402
+ ] });
2403
+ }
2404
+ function $l({
2405
+ title: l,
2406
+ requirements: a,
2407
+ onRequirementClick: i,
2408
+ isLoading: c,
2409
+ error: p,
2410
+ onRetry: r,
2411
+ className: m,
2412
+ style: s
2413
+ }) {
2414
+ const v = j(
2415
+ () => a.filter((h) => h.completed).length,
2416
+ [a]
2417
+ ), b = a.length > 0 ? Math.round(v / a.length * 100) : 0;
2418
+ return c ? /* @__PURE__ */ t("div", { className: k("space-y-4", m), style: s, children: [
2419
+ /* @__PURE__ */ e(f, { className: "h-6 w-48" }),
2420
+ /* @__PURE__ */ e(f, { className: "h-2 w-full" }),
2421
+ Array.from({ length: 4 }).map((h, w) => /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
2422
+ /* @__PURE__ */ e(f, { className: "h-5 w-5 rounded-full" }),
2423
+ /* @__PURE__ */ e(f, { className: "h-4 w-3/4" })
2424
+ ] }, w))
2425
+ ] }) : p ? /* @__PURE__ */ e("div", { className: k("py-12", m), style: s, children: /* @__PURE__ */ e(
2426
+ $,
2427
+ {
2428
+ icon: /* @__PURE__ */ e(q, { className: "size-10 text-destructive" }),
2429
+ title: "Something went wrong",
2430
+ description: p,
2431
+ action: r ? /* @__PURE__ */ e(D, { variant: "outline", onClick: r, children: "Retry" }) : void 0
2432
+ }
2433
+ ) }) : /* @__PURE__ */ t("div", { className: k("flex flex-col gap-4", m), style: s, children: [
2434
+ l && /* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-foreground", children: l }),
2435
+ /* @__PURE__ */ t("div", { className: "flex flex-col gap-1.5", children: [
2436
+ /* @__PURE__ */ t("div", { className: "flex items-center justify-between text-sm", children: [
2437
+ /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: [
2438
+ v,
2439
+ " of ",
2440
+ a.length,
2441
+ " complete"
2442
+ ] }),
2443
+ /* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: [
2444
+ b,
2445
+ "%"
2446
+ ] })
2447
+ ] }),
2448
+ /* @__PURE__ */ e(fe, { value: b })
2449
+ ] }),
2450
+ /* @__PURE__ */ e("ul", { className: "flex flex-col gap-1", children: a.map((h) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ t(
2451
+ "button",
2452
+ {
2453
+ type: "button",
2454
+ className: k(
2455
+ "w-full flex items-start gap-3 p-3 rounded-lg text-left transition-colors",
2456
+ h.completed ? "bg-success/5" : i ? "hover:bg-muted/50 cursor-pointer" : "cursor-default"
2457
+ ),
2458
+ onClick: () => {
2459
+ !h.completed && i && i(h.uid);
2460
+ },
2461
+ disabled: h.completed,
2462
+ children: [
2463
+ h.completed ? /* @__PURE__ */ e(me, { className: "size-5 text-success shrink-0 mt-0.5" }) : /* @__PURE__ */ e(Pt, { className: "size-5 text-muted-foreground shrink-0 mt-0.5" }),
2464
+ /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
2465
+ /* @__PURE__ */ e(
2466
+ "div",
2467
+ {
2468
+ className: k(
2469
+ "text-sm font-medium",
2470
+ h.completed ? "text-muted-foreground line-through" : "text-foreground"
2471
+ ),
2472
+ children: h.label
2473
+ }
2474
+ ),
2475
+ h.description && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground mt-0.5", children: h.description })
2476
+ ] }),
2477
+ !h.completed && i && /* @__PURE__ */ t("div", { className: "shrink-0 flex items-center gap-1 text-xs text-primary mt-0.5", children: [
2478
+ h.actionLabel && /* @__PURE__ */ e("span", { children: h.actionLabel }),
2479
+ /* @__PURE__ */ e(Re, { className: "size-4" })
2480
+ ] })
2481
+ ]
2482
+ }
2483
+ ) }, h.uid)) })
2484
+ ] });
2485
+ }
2486
+ const vl = {
2487
+ newest: "Newest",
2488
+ oldest: "Oldest",
2489
+ most_replies: "Most Replies",
2490
+ most_liked: "Most Liked"
2491
+ };
2492
+ function Vl({
2493
+ title: l,
2494
+ topics: a,
2495
+ onTopicClick: i,
2496
+ onCreateTopic: c,
2497
+ sortOrder: p = "newest",
2498
+ onSortChange: r,
2499
+ searchQuery: m = "",
2500
+ onSearchChange: s,
2501
+ readOnly: v,
2502
+ isLoading: b,
2503
+ error: h,
2504
+ onRetry: w,
2505
+ pageSize: N,
2506
+ currentPage: C = 1,
2507
+ totalItems: z,
2508
+ onPageChange: d,
2509
+ className: S,
2510
+ style: U
2511
+ }) {
2512
+ const [u, M] = F(!1), [x, A] = F(""), [o, y] = F(""), [L, T] = F(m), [n, g] = F(p), R = s !== void 0 ? m : L, P = r !== void 0 ? p : n;
2513
+ function Z(I) {
2514
+ s ? s(I) : T(I);
2515
+ }
2516
+ function V() {
2517
+ const I = [
2518
+ "newest",
2519
+ "oldest",
2520
+ "most_replies",
2521
+ "most_liked"
2522
+ ], B = I.indexOf(P), Q = I[(B + 1) % I.length];
2523
+ r ? r(Q) : g(Q);
2524
+ }
2525
+ function H() {
2526
+ !x.trim() || ve(o) || (c == null || c(x.trim(), o), A(""), y(""), M(!1));
2527
+ }
2528
+ const K = j(() => [...a.filter((B) => {
2529
+ var W;
2530
+ if (!R) return !0;
2531
+ const Q = R.toLowerCase();
2532
+ return B.title.toLowerCase().includes(Q) || ((W = B.preview) == null ? void 0 : W.toLowerCase().includes(Q)) || B.author.displayName.toLowerCase().includes(Q);
2533
+ })].sort((B, Q) => {
2534
+ if (B.isPinned && !Q.isPinned) return -1;
2535
+ if (!B.isPinned && Q.isPinned) return 1;
2536
+ switch (P) {
2537
+ case "oldest":
2538
+ return new Date(B.createdAt).getTime() - new Date(Q.createdAt).getTime();
2539
+ case "most_replies":
2540
+ return Q.replyCount - B.replyCount;
2541
+ case "most_liked":
2542
+ return Q.likeCount - B.likeCount;
2543
+ case "newest":
2544
+ default:
2545
+ return new Date(Q.createdAt).getTime() - new Date(B.createdAt).getTime();
2546
+ }
2547
+ }), [a, R, P]);
2548
+ return b ? /* @__PURE__ */ t("div", { className: k("space-y-4", S), style: U, children: [
2549
+ /* @__PURE__ */ e(f, { className: "h-9 w-full" }),
2550
+ Array.from({ length: 4 }).map((I, B) => /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
2551
+ /* @__PURE__ */ e(f, { className: "h-8 w-8 rounded-full" }),
2552
+ /* @__PURE__ */ t("div", { className: "flex-1 space-y-2", children: [
2553
+ /* @__PURE__ */ e(f, { className: "h-5 w-64" }),
2554
+ /* @__PURE__ */ e(f, { className: "h-4 w-32" })
2555
+ ] })
2556
+ ] }, B))
2557
+ ] }) : h ? /* @__PURE__ */ e("div", { className: k("py-12", S), style: U, children: /* @__PURE__ */ e(
2558
+ $,
2559
+ {
2560
+ icon: /* @__PURE__ */ e(q, { className: "size-10 text-destructive" }),
2561
+ title: "Something went wrong",
2562
+ description: h,
2563
+ action: w ? /* @__PURE__ */ e(D, { variant: "outline", onClick: w, children: "Retry" }) : void 0
2564
+ }
2565
+ ) }) : /* @__PURE__ */ t("div", { className: k("flex flex-col gap-4", S), style: U, children: [
2566
+ /* @__PURE__ */ t("div", { className: "flex items-center justify-between gap-4", children: [
2567
+ l && /* @__PURE__ */ e("h2", { className: "text-xl font-bold text-foreground", children: l }),
2568
+ !v && c && /* @__PURE__ */ t(
2569
+ D,
2570
+ {
2571
+ size: "sm",
2572
+ onClick: () => M(!u),
2573
+ children: [
2574
+ /* @__PURE__ */ e(Et, { className: "size-4 mr-1.5" }),
2575
+ "New Topic"
2576
+ ]
2577
+ }
2578
+ )
2579
+ ] }),
2580
+ /* @__PURE__ */ e(G, {}),
2581
+ u && /* @__PURE__ */ e(E, { children: /* @__PURE__ */ t(_, { className: "pt-4 space-y-3", children: [
2582
+ /* @__PURE__ */ e(
2583
+ Ae,
2584
+ {
2585
+ placeholder: "Topic title",
2586
+ value: x,
2587
+ onChange: (I) => A(I.target.value)
2588
+ }
2589
+ ),
2590
+ /* @__PURE__ */ e(
2591
+ ue,
2592
+ {
2593
+ placeholder: "What would you like to discuss?",
2594
+ value: o,
2595
+ onChange: (I) => y(I),
2596
+ variant: "minimal"
2597
+ }
2598
+ ),
2599
+ /* @__PURE__ */ t("div", { className: "flex justify-end gap-2", children: [
2600
+ /* @__PURE__ */ e(
2601
+ D,
2602
+ {
2603
+ variant: "outline",
2604
+ size: "sm",
2605
+ onClick: () => {
2606
+ M(!1), A(""), y("");
2607
+ },
2608
+ children: "Cancel"
2609
+ }
2610
+ ),
2611
+ /* @__PURE__ */ e(
2612
+ D,
2613
+ {
2614
+ size: "sm",
2615
+ onClick: H,
2616
+ disabled: !x.trim() || ve(o),
2617
+ children: "Post Topic"
2618
+ }
2619
+ )
2620
+ ] })
2621
+ ] }) }),
2622
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
2623
+ /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
2624
+ ut,
2625
+ {
2626
+ value: R,
2627
+ onChange: Z,
2628
+ placeholder: "Search topics..."
2629
+ }
2630
+ ) }),
2631
+ /* @__PURE__ */ t(D, { variant: "outline", size: "sm", onClick: V, children: [
2632
+ /* @__PURE__ */ e(_t, { className: "size-3.5 mr-1.5" }),
2633
+ vl[P]
2634
+ ] })
2635
+ ] }),
2636
+ K.length === 0 ? /* @__PURE__ */ e(
2637
+ $,
2638
+ {
2639
+ icon: /* @__PURE__ */ e(Te, { className: "size-10 text-muted-foreground" }),
2640
+ title: "No topics found",
2641
+ description: R ? "Try a different search term." : "Be the first to start a discussion!"
2642
+ }
2643
+ ) : /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: (d && N ? K.slice((C - 1) * N, C * N) : K).map((I) => /* @__PURE__ */ e(
2644
+ bl,
2645
+ {
2646
+ topic: I,
2647
+ onClick: i
2648
+ },
2649
+ I.uid
2650
+ )) }),
2651
+ d && N && K.length > 0 && /* @__PURE__ */ e(
2652
+ we,
2653
+ {
2654
+ currentPage: C,
2655
+ totalPages: Math.ceil((z ?? K.length) / N),
2656
+ onPageChange: d,
2657
+ className: "mt-4"
2658
+ }
2659
+ )
2660
+ ] });
2661
+ }
2662
+ const bl = Lt(function({
2663
+ topic: a,
2664
+ onClick: i
2665
+ }) {
2666
+ const c = Y(() => i(a.uid), [i, a.uid]);
2667
+ return /* @__PURE__ */ e(
2668
+ "button",
2669
+ {
2670
+ type: "button",
2671
+ className: "w-full text-left",
2672
+ onClick: c,
2673
+ children: /* @__PURE__ */ e(
2674
+ E,
2675
+ {
2676
+ className: k(
2677
+ "transition-colors hover:bg-muted/30",
2678
+ a.isPinned && "border-l-2 border-l-warning"
2679
+ ),
2680
+ children: /* @__PURE__ */ e(_, { className: "py-3 px-4", children: /* @__PURE__ */ t("div", { className: "flex items-start gap-3", children: [
2681
+ /* @__PURE__ */ e(
2682
+ he,
2683
+ {
2684
+ displayName: a.author.displayName,
2685
+ avatarUrl: a.author.avatarUrl,
2686
+ size: "small"
2687
+ }
2688
+ ),
2689
+ /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
2690
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-2 mb-0.5", children: [
2691
+ /* @__PURE__ */ e("span", { className: "font-medium text-foreground text-sm truncate", children: a.title }),
2692
+ a.isPinned && /* @__PURE__ */ e(Ze, { className: "size-3 text-warning shrink-0" }),
2693
+ a.isAnswered && /* @__PURE__ */ t(X, { variant: "success", className: "text-xs shrink-0", children: [
2694
+ /* @__PURE__ */ e(me, { className: "size-3 mr-0.5" }),
2695
+ "Answered"
2696
+ ] })
2697
+ ] }),
2698
+ a.preview && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground line-clamp-1", children: a.preview }),
2699
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-3 mt-1.5 text-xs text-muted-foreground", children: [
2700
+ /* @__PURE__ */ e("span", { children: a.author.displayName }),
2701
+ /* @__PURE__ */ e("span", { children: Ie(a.createdAt) }),
2702
+ /* @__PURE__ */ t(X, { variant: "muted", className: "gap-0.5 text-xs px-1.5 py-0", children: [
2703
+ /* @__PURE__ */ e(Te, { className: "size-3" }),
2704
+ a.replyCount
2705
+ ] }),
2706
+ /* @__PURE__ */ t(X, { variant: "muted", className: "gap-0.5 text-xs px-1.5 py-0", children: [
2707
+ /* @__PURE__ */ e(Je, { className: "size-3" }),
2708
+ a.likeCount
2709
+ ] })
2710
+ ] })
2711
+ ] })
2712
+ ] }) })
2713
+ }
2714
+ )
2715
+ }
2716
+ );
2717
+ });
2718
+ function Gl({
2719
+ course: l,
2720
+ prerequisites: a,
2721
+ onEnroll: i,
2722
+ onCancel: c,
2723
+ enrollLabel: p = "Enroll Now",
2724
+ isEnrolling: r = !1,
2725
+ isLoading: m,
2726
+ error: s,
2727
+ onRetry: v,
2728
+ className: b,
2729
+ style: h
2730
+ }) {
2731
+ const w = Array.isArray(a) && a.length > 0, [N, C] = F("details"), z = j(
2732
+ () => w ? [
2733
+ { key: "details", label: "Course Details" },
2734
+ { key: "prerequisites", label: "Prerequisites" },
2735
+ { key: "confirmation", label: "Confirmation" }
2736
+ ] : [
2737
+ { key: "details", label: "Course Details" },
2738
+ { key: "confirmation", label: "Confirmation" }
2739
+ ],
2740
+ [w]
2741
+ );
2742
+ if (m)
2743
+ return /* @__PURE__ */ t("div", { className: k("space-y-4", b), style: h, children: [
2744
+ /* @__PURE__ */ e(f, { className: "h-8 w-48" }),
2745
+ /* @__PURE__ */ e(f, { className: "h-48 w-full" }),
2746
+ /* @__PURE__ */ e(f, { className: "h-10 w-32" })
2747
+ ] });
2748
+ if (s)
2749
+ return /* @__PURE__ */ e("div", { className: k("py-12", b), style: h, children: /* @__PURE__ */ e(
2750
+ $,
2751
+ {
2752
+ icon: /* @__PURE__ */ e(q, { className: "size-10 text-destructive" }),
2753
+ title: "Something went wrong",
2754
+ description: s,
2755
+ action: v ? /* @__PURE__ */ e(D, { variant: "outline", onClick: v, children: "Retry" }) : void 0
2756
+ }
2757
+ ) });
2758
+ const d = z.findIndex((o) => o.key === N), S = !w || a.every((o) => o.isMet);
2759
+ function U() {
2760
+ const o = d + 1;
2761
+ o < z.length && C(z[o].key);
2762
+ }
2763
+ function u() {
2764
+ const o = d - 1;
2765
+ o >= 0 && C(z[o].key);
2766
+ }
2767
+ function M() {
2768
+ return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ t(_, { className: "pt-6", children: [
2769
+ l.thumbnailUrl ? /* @__PURE__ */ e(
2770
+ "img",
2771
+ {
2772
+ src: l.thumbnailUrl,
2773
+ alt: l.title,
2774
+ className: "w-full h-48 object-cover rounded-lg mb-4"
2775
+ }
2776
+ ) : /* @__PURE__ */ e("div", { className: "w-full h-48 rounded-lg mb-4 bg-muted flex items-center justify-center", children: /* @__PURE__ */ e(oe, { className: "size-12 text-muted-foreground" }) }),
2777
+ /* @__PURE__ */ e("h2", { className: "text-xl font-bold text-foreground mb-1", children: l.title }),
2778
+ l.description && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground mb-3", children: l.description }),
2779
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-3 mb-3", children: [
2780
+ l.instructor && /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
2781
+ /* @__PURE__ */ e(
2782
+ he,
2783
+ {
2784
+ displayName: l.instructor.displayName,
2785
+ avatarUrl: l.instructor.avatarUrl,
2786
+ size: "small"
2787
+ }
2788
+ ),
2789
+ /* @__PURE__ */ e("span", { className: "text-sm text-foreground", children: l.instructor.displayName })
2790
+ ] }),
2791
+ l.duration && /* @__PURE__ */ t(X, { variant: "muted", children: [
2792
+ /* @__PURE__ */ e(xe, { className: "size-3 mr-1" }),
2793
+ l.duration
2794
+ ] })
2795
+ ] }),
2796
+ l.syllabus && l.syllabus.length > 0 && /* @__PURE__ */ t(O, { children: [
2797
+ /* @__PURE__ */ e(G, { className: "my-3" }),
2798
+ /* @__PURE__ */ e("div", { className: "mb-1 text-sm font-semibold text-foreground", children: "Syllabus" }),
2799
+ /* @__PURE__ */ e("ul", { className: "list-disc list-inside space-y-1", children: l.syllabus.map((o, y) => /* @__PURE__ */ e("li", { className: "text-sm text-muted-foreground", children: o }, y)) })
2800
+ ] }),
2801
+ /* @__PURE__ */ e(G, { className: "my-4" }),
2802
+ /* @__PURE__ */ t("div", { className: "flex justify-end gap-2", children: [
2803
+ c && /* @__PURE__ */ e(D, { variant: "outline", onClick: c, children: "Cancel" }),
2804
+ /* @__PURE__ */ e(D, { onClick: U, children: "Continue" })
2805
+ ] })
2806
+ ] }) });
2807
+ }
2808
+ function x() {
2809
+ return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ t(_, { className: "pt-6", children: [
2810
+ /* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-foreground mb-3", children: "Prerequisites" }),
2811
+ /* @__PURE__ */ e("ul", { className: "space-y-3", children: a.map((o) => /* @__PURE__ */ t("li", { className: "flex items-start gap-2", children: [
2812
+ o.isMet ? /* @__PURE__ */ e(me, { className: "size-4 text-success shrink-0 mt-0.5" }) : /* @__PURE__ */ e($e, { className: "size-4 text-destructive shrink-0 mt-0.5" }),
2813
+ /* @__PURE__ */ t("div", { children: [
2814
+ /* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children: o.label }),
2815
+ o.description && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground mt-0.5", children: o.description })
2816
+ ] })
2817
+ ] }, o.uid)) }),
2818
+ /* @__PURE__ */ e(G, { className: "my-4" }),
2819
+ /* @__PURE__ */ t("div", { className: "flex justify-end gap-2", children: [
2820
+ /* @__PURE__ */ e(D, { variant: "outline", onClick: u, children: "Back" }),
2821
+ /* @__PURE__ */ e(D, { onClick: U, disabled: !S, children: "Continue" })
2822
+ ] })
2823
+ ] }) });
2824
+ }
2825
+ function A() {
2826
+ return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ t(_, { className: "pt-6", children: [
2827
+ /* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-foreground mb-3", children: "Confirm Enrollment" }),
2828
+ /* @__PURE__ */ t("div", { className: "space-y-2 mb-3", children: [
2829
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
2830
+ /* @__PURE__ */ e(oe, { className: "size-4 text-muted-foreground" }),
2831
+ /* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children: l.title })
2832
+ ] }),
2833
+ l.instructor && /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
2834
+ /* @__PURE__ */ e(
2835
+ he,
2836
+ {
2837
+ displayName: l.instructor.displayName,
2838
+ avatarUrl: l.instructor.avatarUrl,
2839
+ size: "small"
2840
+ }
2841
+ ),
2842
+ /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: l.instructor.displayName })
2843
+ ] }),
2844
+ l.duration && /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
2845
+ /* @__PURE__ */ e(xe, { className: "size-4 text-muted-foreground" }),
2846
+ /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: l.duration })
2847
+ ] })
2848
+ ] }),
2849
+ w && /* @__PURE__ */ e("div", { className: "mb-3", children: S ? /* @__PURE__ */ t(X, { variant: "success", children: [
2850
+ /* @__PURE__ */ e(me, { className: "size-3 mr-1" }),
2851
+ "All prerequisites met"
2852
+ ] }) : /* @__PURE__ */ t(X, { variant: "warning", children: [
2853
+ /* @__PURE__ */ e($e, { className: "size-3 mr-1" }),
2854
+ "Some prerequisites not met"
2855
+ ] }) }),
2856
+ /* @__PURE__ */ e(G, { className: "my-4" }),
2857
+ /* @__PURE__ */ t("div", { className: "flex justify-end gap-2", children: [
2858
+ /* @__PURE__ */ e(D, { variant: "outline", onClick: u, children: "Back" }),
2859
+ /* @__PURE__ */ t(
2860
+ D,
2861
+ {
2862
+ onClick: () => i(l.uid),
2863
+ disabled: r,
2864
+ children: [
2865
+ r && /* @__PURE__ */ e(Bt, { className: "size-4 mr-1 animate-spin" }),
2866
+ p
2867
+ ]
2868
+ }
2869
+ )
2870
+ ] })
2871
+ ] }) });
2872
+ }
2873
+ return /* @__PURE__ */ t("div", { className: b, style: h, children: [
2874
+ /* @__PURE__ */ e(
2875
+ ll,
2876
+ {
2877
+ steps: z.map((o) => ({ label: o.label })),
2878
+ currentStep: d,
2879
+ className: "mb-6"
2880
+ }
2881
+ ),
2882
+ N === "details" && M(),
2883
+ N === "prerequisites" && x(),
2884
+ N === "confirmation" && A()
2885
+ ] });
2886
+ }
2887
+ function Hl({
2888
+ courses: l = [],
2889
+ categories: a,
2890
+ onCourseClick: i,
2891
+ onEnroll: c,
2892
+ viewMode: p = "grid",
2893
+ allowViewToggle: r = !0,
2894
+ showSearch: m = !0,
2895
+ emptyMessage: s = "No courses found",
2896
+ readOnly: v = !1,
2897
+ isLoading: b,
2898
+ error: h,
2899
+ onRetry: w,
2900
+ pageSize: N,
2901
+ currentPage: C = 1,
2902
+ totalItems: z,
2903
+ onPageChange: d,
2904
+ className: S,
2905
+ style: U
2906
+ }) {
2907
+ const [u, M] = F(""), [x, A] = F(null), [o, y] = F(p), L = j(() => {
2908
+ let n = l;
2909
+ if (x && (n = n.filter((g) => g.categoryUid === x)), u.trim()) {
2910
+ const g = u.toLowerCase();
2911
+ n = n.filter(
2912
+ (R) => {
2913
+ var P, Z;
2914
+ return R.title.toLowerCase().includes(g) || ((P = R.description) == null ? void 0 : P.toLowerCase().includes(g)) || ((Z = R.instructor) == null ? void 0 : Z.displayName.toLowerCase().includes(g));
2915
+ }
2916
+ );
2917
+ }
2918
+ return n;
2919
+ }, [l, x, u]);
2920
+ if (b)
2921
+ return /* @__PURE__ */ t("div", { className: k("space-y-4", S), style: U, children: [
2922
+ /* @__PURE__ */ e(f, { className: "h-9 w-full" }),
2923
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4", children: Array.from({ length: 6 }).map((n, g) => /* @__PURE__ */ e(f, { className: "h-64 w-full rounded-lg" }, g)) })
2924
+ ] });
2925
+ if (h)
2926
+ return /* @__PURE__ */ e("div", { className: k("py-12", S), style: U, children: /* @__PURE__ */ e(
2927
+ $,
2928
+ {
2929
+ icon: /* @__PURE__ */ e(q, { className: "size-10 text-destructive" }),
2930
+ title: "Something went wrong",
2931
+ description: h,
2932
+ action: w ? /* @__PURE__ */ e(D, { variant: "outline", onClick: w, children: "Retry" }) : void 0
2933
+ }
2934
+ ) });
2935
+ const T = d && N ? L.slice((C - 1) * N, C * N) : L;
2936
+ return /* @__PURE__ */ t("div", { className: S, style: U, children: [
2937
+ /* @__PURE__ */ t("div", { className: "flex gap-2 items-center mb-2", children: [
2938
+ m && /* @__PURE__ */ e("div", { className: "flex-1 max-w-80", children: /* @__PURE__ */ e(
2939
+ ut,
2940
+ {
2941
+ value: u,
2942
+ onChange: M,
2943
+ placeholder: "Search courses...",
2944
+ size: "small"
2945
+ }
2946
+ ) }),
2947
+ r && /* @__PURE__ */ t("div", { className: "flex gap-0.5", children: [
2948
+ /* @__PURE__ */ t(se, { children: [
2949
+ /* @__PURE__ */ e(ie, { children: /* @__PURE__ */ e(
2950
+ D,
2951
+ {
2952
+ variant: "ghost",
2953
+ size: "icon-xs",
2954
+ "aria-label": "Grid view",
2955
+ className: k(o === "grid" && "text-primary"),
2956
+ onClick: () => y("grid"),
2957
+ children: /* @__PURE__ */ e(jt, { size: 18 })
2958
+ }
2959
+ ) }),
2960
+ /* @__PURE__ */ e(re, { children: "Grid view" })
2961
+ ] }),
2962
+ /* @__PURE__ */ t(se, { children: [
2963
+ /* @__PURE__ */ e(ie, { children: /* @__PURE__ */ e(
2964
+ D,
2965
+ {
2966
+ variant: "ghost",
2967
+ size: "icon-xs",
2968
+ "aria-label": "List view",
2969
+ className: k(o === "list" && "text-primary"),
2970
+ onClick: () => y("list"),
2971
+ children: /* @__PURE__ */ e(Qt, { size: 18 })
2972
+ }
2973
+ ) }),
2974
+ /* @__PURE__ */ e(re, { children: "List view" })
2975
+ ] })
2976
+ ] })
2977
+ ] }),
2978
+ a && a.length > 0 && /* @__PURE__ */ e(
2979
+ st,
2980
+ {
2981
+ value: x ?? "all",
2982
+ onValueChange: (n) => A(n === "all" ? null : n),
2983
+ className: "mb-2",
2984
+ children: /* @__PURE__ */ t(it, { children: [
2985
+ /* @__PURE__ */ e(ce, { value: "all", children: "All" }),
2986
+ a.map((n) => /* @__PURE__ */ e(ce, { value: n.uid, children: n.label }, n.uid))
2987
+ ] })
2988
+ }
2989
+ ),
2990
+ L.length === 0 ? /* @__PURE__ */ e(
2991
+ $,
2992
+ {
2993
+ icon: /* @__PURE__ */ e(ze, {}),
2994
+ title: s,
2995
+ description: "Try adjusting your search or filter."
2996
+ }
2997
+ ) : o === "grid" ? /* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4", children: T.map((n) => /* @__PURE__ */ e(
2998
+ We,
2999
+ {
3000
+ uid: n.uid,
3001
+ title: n.title,
3002
+ description: n.description,
3003
+ thumbnailUrl: n.thumbnailUrl,
3004
+ instructor: n.instructor,
3005
+ progress: n.progress,
3006
+ enrollmentStatus: n.enrollmentStatus,
3007
+ studentCount: n.studentCount,
3008
+ duration: n.duration,
3009
+ layout: "vertical",
3010
+ onClick: v ? void 0 : () => i(n),
3011
+ onEnroll: c && !v ? () => c(n) : void 0,
3012
+ className: k(v && "opacity-70")
3013
+ },
3014
+ n.uid
3015
+ )) }) : /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: T.map((n) => /* @__PURE__ */ e(
3016
+ We,
3017
+ {
3018
+ uid: n.uid,
3019
+ title: n.title,
3020
+ description: n.description,
3021
+ thumbnailUrl: n.thumbnailUrl,
3022
+ instructor: n.instructor,
3023
+ progress: n.progress,
3024
+ enrollmentStatus: n.enrollmentStatus,
3025
+ studentCount: n.studentCount,
3026
+ duration: n.duration,
3027
+ layout: "horizontal",
3028
+ onClick: v ? void 0 : () => i(n),
3029
+ onEnroll: c && !v ? () => c(n) : void 0,
3030
+ className: k(v && "opacity-70")
3031
+ },
3032
+ n.uid
3033
+ )) }),
3034
+ d && N && L.length > 0 && /* @__PURE__ */ e(
3035
+ we,
3036
+ {
3037
+ currentPage: C,
3038
+ totalPages: Math.ceil((z ?? L.length) / N),
3039
+ onPageChange: d,
3040
+ className: "mt-4"
3041
+ }
3042
+ )
3043
+ ] });
3044
+ }
3045
+ function Wl({
3046
+ student: l,
3047
+ enrolledCourses: a = [],
3048
+ achievements: i = [],
3049
+ certificates: c = [],
3050
+ stats: p,
3051
+ showCourses: r = !0,
3052
+ showAchievements: m = !0,
3053
+ onCourseClick: s,
3054
+ onCertificateClick: v,
3055
+ readOnly: b = !1,
3056
+ isLoading: h,
3057
+ error: w,
3058
+ onRetry: N,
3059
+ className: C,
3060
+ style: z
3061
+ }) {
3062
+ const d = a.filter((u) => u.progress >= 100), S = [
3063
+ {
3064
+ label: "Enrolled",
3065
+ value: String(a.length),
3066
+ icon: /* @__PURE__ */ e(oe, { size: 24 })
3067
+ },
3068
+ {
3069
+ label: "Completed",
3070
+ value: String(d.length),
3071
+ icon: /* @__PURE__ */ e(ze, { size: 24 })
3072
+ }
3073
+ ], U = p ?? S;
3074
+ return /* @__PURE__ */ e(
3075
+ te,
3076
+ {
3077
+ isLoading: h,
3078
+ error: w,
3079
+ onRetry: N,
3080
+ className: C,
3081
+ style: z,
3082
+ skeleton: /* @__PURE__ */ t(O, { children: [
3083
+ /* @__PURE__ */ e(E, { children: /* @__PURE__ */ t(_, { className: "p-4 flex items-center gap-4", children: [
3084
+ /* @__PURE__ */ e(f, { className: "size-12 rounded-full" }),
3085
+ /* @__PURE__ */ t("div", { className: "flex-1 space-y-2", children: [
3086
+ /* @__PURE__ */ e(f, { className: "h-5 w-40" }),
3087
+ /* @__PURE__ */ e(f, { className: "h-4 w-56" })
3088
+ ] })
3089
+ ] }) }),
3090
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-3", children: [
3091
+ /* @__PURE__ */ e(f, { className: "h-24" }),
3092
+ /* @__PURE__ */ e(f, { className: "h-24" }),
3093
+ /* @__PURE__ */ e(f, { className: "h-24" }),
3094
+ /* @__PURE__ */ e(f, { className: "h-24" })
3095
+ ] }),
3096
+ /* @__PURE__ */ e(f, { className: "h-8 w-full" }),
3097
+ /* @__PURE__ */ e(f, { className: "h-8 w-full" }),
3098
+ /* @__PURE__ */ e(f, { className: "h-8 w-full" })
3099
+ ] }),
3100
+ children: /* @__PURE__ */ t("div", { className: k("space-y-4", C), style: z, children: [
3101
+ /* @__PURE__ */ e(E, { children: /* @__PURE__ */ t(_, { className: "p-4 flex items-start gap-4", children: [
3102
+ /* @__PURE__ */ e(
3103
+ he,
3104
+ {
3105
+ displayName: l.displayName,
3106
+ avatarUrl: l.avatarUrl,
3107
+ size: "large"
3108
+ }
3109
+ ),
3110
+ /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
3111
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-2 flex-wrap", children: [
3112
+ /* @__PURE__ */ e("h2", { className: "text-xl font-bold text-foreground", children: l.displayName }),
3113
+ l.role && /* @__PURE__ */ e(X, { variant: "secondary", children: l.role })
3114
+ ] }),
3115
+ l.email && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: l.email }),
3116
+ l.bio && /* @__PURE__ */ e("p", { className: "text-sm text-foreground mt-1", children: l.bio }),
3117
+ l.joinedAt && /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground mt-1 flex items-center gap-1", children: [
3118
+ /* @__PURE__ */ e($t, { size: 12 }),
3119
+ "Joined ",
3120
+ new Date(l.joinedAt).toLocaleDateString()
3121
+ ] })
3122
+ ] })
3123
+ ] }) }),
3124
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-3", children: U.map((u) => /* @__PURE__ */ e(
3125
+ Le,
3126
+ {
3127
+ icon: u.icon,
3128
+ label: u.label,
3129
+ value: u.value
3130
+ },
3131
+ u.label
3132
+ )) }),
3133
+ r && /* @__PURE__ */ t(O, { children: [
3134
+ /* @__PURE__ */ e(G, {}),
3135
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-2 mb-2", children: [
3136
+ /* @__PURE__ */ e("p", { className: "text-lg font-semibold text-foreground", children: "Enrolled Courses" }),
3137
+ /* @__PURE__ */ e(X, { variant: "secondary", children: a.length })
3138
+ ] }),
3139
+ a.length > 0 ? /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(_, { className: "p-0 divide-y divide-border", children: a.map((u) => /* @__PURE__ */ t(
3140
+ "div",
3141
+ {
3142
+ className: k(
3143
+ "flex items-center gap-3 px-4 py-3 transition-colors",
3144
+ !b && s && "cursor-pointer hover:bg-muted/50"
3145
+ ),
3146
+ onClick: !b && s ? () => s(u.uid) : void 0,
3147
+ children: [
3148
+ /* @__PURE__ */ e(ot, { value: u.progress, size: 32, strokeWidth: 3 }),
3149
+ /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
3150
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium text-foreground truncate", children: u.title }),
3151
+ u.lastAccessedAt && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: Ie(u.lastAccessedAt) })
3152
+ ] }),
3153
+ /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground whitespace-nowrap", children: [
3154
+ Math.round(u.progress),
3155
+ "%"
3156
+ ] })
3157
+ ]
3158
+ },
3159
+ u.uid
3160
+ )) }) }) : /* @__PURE__ */ e(
3161
+ $,
3162
+ {
3163
+ icon: /* @__PURE__ */ e(oe, {}),
3164
+ title: "No courses yet",
3165
+ description: "This student has not enrolled in any courses."
3166
+ }
3167
+ )
3168
+ ] }),
3169
+ m && /* @__PURE__ */ t(O, { children: [
3170
+ /* @__PURE__ */ e(G, {}),
3171
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-2 mb-2", children: [
3172
+ /* @__PURE__ */ e("p", { className: "text-lg font-semibold text-foreground", children: "Achievements" }),
3173
+ /* @__PURE__ */ e(X, { variant: "secondary", children: i.length })
3174
+ ] }),
3175
+ i.length > 0 ? /* @__PURE__ */ e("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-2", children: i.map((u) => /* @__PURE__ */ e(
3176
+ mt,
3177
+ {
3178
+ title: u.name,
3179
+ description: u.description,
3180
+ icon: u.iconUrl ? /* @__PURE__ */ e(
3181
+ "img",
3182
+ {
3183
+ src: u.iconUrl,
3184
+ alt: u.name,
3185
+ className: "w-12 h-12"
3186
+ }
3187
+ ) : void 0,
3188
+ earnedDate: u.earnedAt
3189
+ },
3190
+ u.uid
3191
+ )) }) : /* @__PURE__ */ e(
3192
+ $,
3193
+ {
3194
+ icon: /* @__PURE__ */ e(Se, {}),
3195
+ title: "No achievements yet",
3196
+ description: "Achievements will appear here as they are earned."
3197
+ }
3198
+ )
3199
+ ] }),
3200
+ /* @__PURE__ */ e(G, {}),
3201
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-2 mb-2", children: [
3202
+ /* @__PURE__ */ e("p", { className: "text-lg font-semibold text-foreground", children: "Certificates" }),
3203
+ /* @__PURE__ */ e(X, { variant: "secondary", children: c.length })
3204
+ ] }),
3205
+ c.length > 0 ? /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(_, { className: "p-0 divide-y divide-border", children: c.map((u) => /* @__PURE__ */ t(
3206
+ "div",
3207
+ {
3208
+ className: k(
3209
+ "flex items-center gap-3 px-4 py-3 transition-colors",
3210
+ !b && v && "cursor-pointer hover:bg-muted/50"
3211
+ ),
3212
+ onClick: !b && v ? () => v(u.uid) : void 0,
3213
+ children: [
3214
+ /* @__PURE__ */ e("div", { className: "w-9 h-9 rounded-lg bg-primary/10 flex items-center justify-center text-primary", children: /* @__PURE__ */ e(Se, { size: 20 }) }),
3215
+ /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
3216
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium text-foreground truncate", children: u.courseName }),
3217
+ /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: [
3218
+ "Issued ",
3219
+ new Date(u.issuedAt).toLocaleDateString()
3220
+ ] })
3221
+ ] }),
3222
+ u.certificateUrl && !b && /* @__PURE__ */ e(
3223
+ D,
3224
+ {
3225
+ variant: "outline",
3226
+ size: "sm",
3227
+ onClick: (M) => {
3228
+ M.stopPropagation(), window.open(u.certificateUrl, "_blank");
3229
+ },
3230
+ children: "View"
3231
+ }
3232
+ )
3233
+ ]
3234
+ },
3235
+ u.uid
3236
+ )) }) }) : /* @__PURE__ */ e(
3237
+ $,
3238
+ {
3239
+ icon: /* @__PURE__ */ e(ze, {}),
3240
+ title: "No certificates yet",
3241
+ description: "Certificates will appear here once courses are completed."
3242
+ }
3243
+ )
3244
+ ] })
3245
+ }
3246
+ );
3247
+ }
3248
+ export {
3249
+ Fl as A,
3250
+ jl as C,
3251
+ Pl as D,
3252
+ Gl as E,
3253
+ Ll as F,
3254
+ _l as G,
3255
+ Al as L,
3256
+ Dl as P,
3257
+ zl as Q,
3258
+ $l as R,
3259
+ te as S,
3260
+ Ul as a,
3261
+ El as b,
3262
+ Hl as c,
3263
+ Rl as d,
3264
+ Tl as e,
3265
+ Vl as f,
3266
+ Il as g,
3267
+ Bl as h,
3268
+ Ql as i,
3269
+ Wl as j,
3270
+ Ml as k,
3271
+ pt as l,
3272
+ al as m
3273
+ };