@burdenoff/microfe-technospam 2026.704.2 → 2026.705.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 (23) hide show
  1. package/dist/technospam/api/technospamApi.js +233 -150
  2. package/dist/technospam/api/technospamApi.js.map +1 -1
  3. package/dist/technospam/components/LoadMore.js +18 -2
  4. package/dist/technospam/components/LoadMore.js.map +1 -0
  5. package/dist/technospam/pages/AdminAdminDashboardPagePage.js +664 -334
  6. package/dist/technospam/pages/AdminAdminDashboardPagePage.js.map +1 -1
  7. package/dist/technospam/pages/ApplicationsProblemsPagePage.js +79 -72
  8. package/dist/technospam/pages/ApplicationsProblemsPagePage.js.map +1 -1
  9. package/dist/technospam/pages/CoursesCourseDetailsPagePage.js +140 -87
  10. package/dist/technospam/pages/CoursesCourseDetailsPagePage.js.map +1 -1
  11. package/dist/technospam/pages/CoursesCoursesPagePage.js +75 -68
  12. package/dist/technospam/pages/CoursesCoursesPagePage.js.map +1 -1
  13. package/dist/technospam/pages/CoursesMyLearningPagePage.js +3 -0
  14. package/dist/technospam/pages/CoursesMyLearningPagePage.js.map +1 -1
  15. package/dist/technospam/pages/HackathonsHackathonsPagePage.js +76 -53
  16. package/dist/technospam/pages/HackathonsHackathonsPagePage.js.map +1 -1
  17. package/dist/technospam/pages/MentorshipMentorProfilePagePage.js +36 -35
  18. package/dist/technospam/pages/MentorshipMentorProfilePagePage.js.map +1 -1
  19. package/dist/technospam/pages/MentorshipMentorsPagePage.js +112 -103
  20. package/dist/technospam/pages/MentorshipMentorsPagePage.js.map +1 -1
  21. package/dist/technospam/pages/MentorshipSessionsPagePage.js +219 -110
  22. package/dist/technospam/pages/MentorshipSessionsPagePage.js.map +1 -1
  23. package/package.json +1 -1
@@ -1,423 +1,700 @@
1
- import { PageLayout as e } from "../components/PageLayout.js";
2
- import { formatDateTime as t, formatDuration as n, formatMoney as r, humanizeEnum as i } from "../utils/format.js";
3
- import { StatusBadge as a } from "../components/StatusBadge.js";
4
- import { EmptyView as o, ErrorView as s, LoadingRows as c } from "../components/StateViews.js";
1
+ import { useTechnoSpam as e } from "../providers/TechnoSpamProvider.js";
2
+ import { PageLayout as t } from "../components/PageLayout.js";
3
+ import { formatDateTime as n, formatDuration as r, formatMoney as i, humanizeEnum as a } from "../utils/format.js";
4
+ import { StatusBadge as o } from "../components/StatusBadge.js";
5
+ import { EmptyView as s, ErrorView as c, LoadingRows as l } from "../components/StateViews.js";
5
6
  import "../components/index.js";
6
- import { notify as l } from "../lib/toast.js";
7
- import { useApproveMentor as u, useArchiveCourse as d, useCoursesQuery as f, useCreateCourse as p, useCreateHackathon as m, useCreateProblem as h, useHackathonsQuery as g, useMentorsQuery as _, useOpenRegistration as v, useProblemsQuery as y, usePublishCourse as b, usePublishProblem as x } from "../api/technospamApi.js";
8
- import { useState as S } from "react";
9
- import { Archive as C, BookOpen as w, Code2 as T, Plus as E, Rocket as ee, Trophy as D, UserCheck as O, Users as k, X as A } from "lucide-react";
10
- import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
11
- import { Badge as P, Button as F, GlassCard as I, Input as L, Select as R, SelectContent as te, SelectItem as ne, SelectTrigger as re, SelectValue as z, Tabs as B, TabsList as V, TabsTrigger as H, Textarea as U } from "@burdenoff/fe-libs/ui";
7
+ import { notify as u } from "../lib/toast.js";
8
+ import { useApproveMentor as d, useArchiveCourse as f, useCompleteHackathon as p, useCoursesQuery as m, useCreateCourse as h, useCreateHackathon as g, useCreateLesson as _, useCreateProblem as v, useGradeSubmission as y, useHackathonsQuery as b, useLessonsQuery as x, useMentorsQuery as S, useOpenRegistration as ee, useProblemsQuery as C, usePublishCourse as w, usePublishProblem as te, useScoreTeam as T, useStartHackathon as E, useStartJudging as D, useSubmissionsQuery as O, useTeamsQuery as k } from "../api/technospamApi.js";
9
+ import { useState as A } from "react";
10
+ import { Archive as j, Award as M, BookOpen as N, Code2 as P, Gavel as ne, ListChecks as re, Play as F, Plus as I, Rocket as ie, ShieldAlert as L, Trophy as R, UserCheck as z, Users as B, X as ae } from "lucide-react";
11
+ import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
12
+ import { Badge as W, Button as G, GlassCard as K, Input as q, Select as J, SelectContent as Y, SelectItem as X, SelectTrigger as Z, SelectValue as oe, Tabs as Q, TabsList as se, TabsTrigger as ce, Textarea as le } from "@burdenoff/fe-libs/ui";
12
13
  //#region src/technospam/pages/AdminAdminDashboardPagePage.tsx
13
- var W = [
14
+ var ue = [
15
+ "ARTICLE",
16
+ "VIDEO",
17
+ "INTERACTIVE",
18
+ "QUIZ",
19
+ "PROJECT"
20
+ ], de = [
21
+ "ACCEPTED",
22
+ "WRONG_ANSWER",
23
+ "TIME_LIMIT_EXCEEDED",
24
+ "RUNTIME_ERROR",
25
+ "COMPILE_ERROR"
26
+ ], fe = [
14
27
  "BEGINNER",
15
28
  "INTERMEDIATE",
16
29
  "ADVANCED",
17
30
  "EXPERT"
18
- ], G = [
31
+ ], pe = [
19
32
  "EASY",
20
33
  "MEDIUM",
21
34
  "HARD"
22
35
  ];
23
- function ie(e) {
36
+ function me(e) {
24
37
  return e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
25
38
  }
26
- function ae(e) {
39
+ function he(e) {
27
40
  return e.split(",").map((e) => e.trim()).filter(Boolean);
28
41
  }
29
- function K(e) {
42
+ function ge(e) {
30
43
  let t = Number.parseInt(e, 10);
31
44
  return Number.isFinite(t) ? t : void 0;
32
45
  }
33
- function q(e) {
46
+ function _e(e) {
34
47
  if (!e) return null;
35
48
  let t = new Date(e);
36
49
  return Number.isNaN(t.getTime()) ? null : t.toISOString();
37
50
  }
38
- function J({ label: e, required: t, className: n, children: r }) {
39
- return /* @__PURE__ */ N("div", {
51
+ function $({ label: e, required: t, className: n, children: r }) {
52
+ return /* @__PURE__ */ U("div", {
40
53
  className: `flex flex-col gap-1.5 ${n ?? ""}`,
41
- children: [/* @__PURE__ */ N("span", {
54
+ children: [/* @__PURE__ */ U("span", {
42
55
  className: "text-xs font-medium text-text-secondary",
43
- children: [e, t ? /* @__PURE__ */ M("span", {
56
+ children: [e, t ? /* @__PURE__ */ H("span", {
44
57
  className: "text-status-error-text",
45
58
  children: " *"
46
59
  }) : null]
47
60
  }), r]
48
61
  });
49
62
  }
50
- function oe({ title: e, children: t, footer: n }) {
51
- return /* @__PURE__ */ N(I, {
63
+ function ve({ title: e, children: t, footer: n }) {
64
+ return /* @__PURE__ */ U(K, {
52
65
  className: "space-y-4 p-4 sm:p-5",
53
66
  children: [
54
- /* @__PURE__ */ M("h3", {
67
+ /* @__PURE__ */ H("h3", {
55
68
  className: "text-sm font-semibold text-text-primary",
56
69
  children: e
57
70
  }),
58
- /* @__PURE__ */ M("div", {
71
+ /* @__PURE__ */ H("div", {
59
72
  className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
60
73
  children: t
61
74
  }),
62
- /* @__PURE__ */ M("div", {
75
+ /* @__PURE__ */ H("div", {
63
76
  className: "flex justify-end gap-2",
64
77
  children: n
65
78
  })
66
79
  ]
67
80
  });
68
81
  }
69
- function Y({ summary: e, actionLabel: t, open: n, onToggle: r }) {
70
- return /* @__PURE__ */ N("div", {
82
+ function ye({ summary: e, actionLabel: t, open: n, onToggle: r }) {
83
+ return /* @__PURE__ */ U("div", {
71
84
  className: "flex items-center justify-between gap-3",
72
- children: [/* @__PURE__ */ M("p", {
85
+ children: [/* @__PURE__ */ H("p", {
73
86
  className: "text-sm text-text-secondary",
74
87
  children: e
75
- }), t && r ? /* @__PURE__ */ N(F, {
88
+ }), t && r ? /* @__PURE__ */ U(G, {
76
89
  size: "sm",
77
90
  variant: n ? "outline" : "default",
78
91
  onClick: r,
79
- children: [M(n ? A : E, { size: 15 }), n ? "Close" : t]
92
+ children: [H(n ? ae : I, { size: 15 }), n ? "Close" : t]
80
93
  }) : null]
81
94
  });
82
95
  }
83
- function X({ children: e, actions: t }) {
84
- return /* @__PURE__ */ N(I, {
96
+ function be({ children: e, actions: t }) {
97
+ return /* @__PURE__ */ U(K, {
85
98
  className: "flex flex-col gap-3 p-4 sm:flex-row sm:items-center sm:justify-between",
86
- children: [/* @__PURE__ */ M("div", {
99
+ children: [/* @__PURE__ */ H("div", {
87
100
  className: "min-w-0",
88
101
  children: e
89
- }), t ? /* @__PURE__ */ M("div", {
102
+ }), t ? /* @__PURE__ */ H("div", {
90
103
  className: "flex shrink-0 flex-wrap items-center gap-2",
91
104
  children: t
92
105
  }) : null]
93
106
  });
94
107
  }
95
- function Z() {
96
- let { data: e, loading: t, error: r, refetch: u } = f({}), [m, { loading: h }] = p(), [g] = b(), [_] = d(), [v, y] = S(!1), [x, T] = S(null), [E, D] = S(""), [O, k] = S(""), [A, P] = S(""), [I, B] = S(""), [V, H] = S("BEGINNER"), [G, q] = S(""), [Z, Q] = S(""), $ = e?.tecListCourses.items ?? [], se = () => {
97
- D(""), k(""), P(""), B(""), H("BEGINNER"), q(""), Q(""), y(!1);
98
- }, ce = async () => {
99
- let e = E.trim();
100
- if (!e) return l.error("Title is required");
101
- let t = ie(O || e);
102
- if (!t) return l.error("A valid slug is required");
103
- (await m({ variables: { input: {
108
+ function xe({ courseId: e }) {
109
+ let { data: t, loading: n, refetch: i } = x(e), [o, { loading: s }] = _(), [c, d] = A(""), [f, p] = A("ARTICLE"), [m, h] = A(""), [g, v] = A(""), [y, b] = A(!1), S = [...t?.tecListLessons ?? []].sort((e, t) => e.position - t.position);
110
+ return /* @__PURE__ */ U("div", {
111
+ className: "mt-3 rounded-lg border border-border-seam bg-bg-sunken p-3",
112
+ children: [
113
+ /* @__PURE__ */ U("div", {
114
+ className: "mb-2 text-xs font-semibold uppercase tracking-wide text-text-muted",
115
+ children: [
116
+ "Curriculum (",
117
+ S.length,
118
+ ")"
119
+ ]
120
+ }),
121
+ n && S.length === 0 ? /* @__PURE__ */ H(l, {
122
+ count: 2,
123
+ height: "h-10"
124
+ }) : S.length === 0 ? /* @__PURE__ */ H("p", {
125
+ className: "mb-3 text-xs text-text-muted",
126
+ children: "No lessons yet — add the first below."
127
+ }) : /* @__PURE__ */ H("ol", {
128
+ className: "mb-3 space-y-1",
129
+ children: S.map((e, t) => /* @__PURE__ */ U("li", {
130
+ className: "flex items-center gap-2 text-sm text-text-primary",
131
+ children: [
132
+ /* @__PURE__ */ U("span", {
133
+ className: "text-xs text-text-muted",
134
+ children: [t + 1, "."]
135
+ }),
136
+ /* @__PURE__ */ H("span", {
137
+ className: "truncate",
138
+ children: e.title
139
+ }),
140
+ /* @__PURE__ */ H(W, {
141
+ variant: "secondary",
142
+ className: "text-[11px]",
143
+ children: a(e.kind)
144
+ }),
145
+ e.isPreview ? /* @__PURE__ */ H(W, {
146
+ variant: "outline",
147
+ className: "text-[11px]",
148
+ children: "Preview"
149
+ }) : null,
150
+ /* @__PURE__ */ H("span", {
151
+ className: "ml-auto text-xs text-text-muted",
152
+ children: r(e.estimatedMinutes)
153
+ })
154
+ ]
155
+ }, e.id))
156
+ }),
157
+ /* @__PURE__ */ U("div", {
158
+ className: "grid grid-cols-1 gap-2 sm:grid-cols-2",
159
+ children: [/* @__PURE__ */ H(q, {
160
+ placeholder: "Lesson title",
161
+ value: c,
162
+ onChange: (e) => d(e.target.value)
163
+ }), /* @__PURE__ */ U(J, {
164
+ value: f,
165
+ onValueChange: (e) => p(e),
166
+ children: [/* @__PURE__ */ H(Z, { children: /* @__PURE__ */ H(oe, {}) }), /* @__PURE__ */ H(Y, { children: ue.map((e) => /* @__PURE__ */ H(X, {
167
+ value: e,
168
+ children: a(e)
169
+ }, e)) })]
170
+ })]
171
+ }),
172
+ /* @__PURE__ */ H(le, {
173
+ className: "mt-2",
174
+ placeholder: "Lesson content (markdown / notes)",
175
+ value: m,
176
+ onChange: (e) => h(e.target.value)
177
+ }),
178
+ /* @__PURE__ */ U("div", {
179
+ className: "mt-2 flex flex-wrap items-center gap-3",
180
+ children: [
181
+ /* @__PURE__ */ H(q, {
182
+ type: "number",
183
+ className: "w-28",
184
+ placeholder: "Minutes",
185
+ value: g,
186
+ onChange: (e) => v(e.target.value)
187
+ }),
188
+ /* @__PURE__ */ U("label", {
189
+ className: "flex items-center gap-2 text-xs text-text-secondary",
190
+ children: [/* @__PURE__ */ H("input", {
191
+ type: "checkbox",
192
+ checked: y,
193
+ onChange: (e) => b(e.target.checked)
194
+ }), "Free preview"]
195
+ }),
196
+ /* @__PURE__ */ U(G, {
197
+ size: "sm",
198
+ onClick: async () => {
199
+ let t = c.trim();
200
+ if (!t) return u.error("Lesson title is required");
201
+ (await o({ variables: { input: {
202
+ courseId: e,
203
+ title: t,
204
+ kind: f,
205
+ content: m.trim() || void 0,
206
+ position: S.length + 1,
207
+ estimatedMinutes: ge(g),
208
+ isPreview: y
209
+ } } })).data?.tecCreateLesson && (u.success("Lesson added", t), d(""), h(""), v(""), b(!1), await i());
210
+ },
211
+ disabled: s,
212
+ className: "ml-auto",
213
+ children: [/* @__PURE__ */ H(I, { size: 14 }), " Add lesson"]
214
+ })
215
+ ]
216
+ })
217
+ ]
218
+ });
219
+ }
220
+ function Se({ problemId: e }) {
221
+ let { data: t, loading: r, refetch: i } = O({ problemId: e }), [s] = y(), [c, d] = A(null), f = t?.tecListSubmissions.items ?? [], p = async (e, t) => {
222
+ d(e);
223
+ try {
224
+ (await s({ variables: {
225
+ id: e,
226
+ verdict: t
227
+ } })).data?.tecGradeSubmission && (u.success("Submission graded", a(t)), await i());
228
+ } finally {
229
+ d(null);
230
+ }
231
+ };
232
+ return /* @__PURE__ */ U("div", {
233
+ className: "mt-3 rounded-lg border border-border-seam bg-bg-sunken p-3",
234
+ children: [/* @__PURE__ */ U("div", {
235
+ className: "mb-2 text-xs font-semibold uppercase tracking-wide text-text-muted",
236
+ children: [
237
+ "Submissions (",
238
+ f.length,
239
+ ")"
240
+ ]
241
+ }), r && f.length === 0 ? /* @__PURE__ */ H(l, {
242
+ count: 2,
243
+ height: "h-10"
244
+ }) : f.length === 0 ? /* @__PURE__ */ H("p", {
245
+ className: "text-xs text-text-muted",
246
+ children: "No submissions yet."
247
+ }) : /* @__PURE__ */ H("div", {
248
+ className: "space-y-2",
249
+ children: f.map((e) => /* @__PURE__ */ U("div", {
250
+ className: "flex flex-wrap items-center gap-2 text-sm",
251
+ children: [
252
+ /* @__PURE__ */ H(o, { status: e.verdict }),
253
+ /* @__PURE__ */ H("span", {
254
+ className: "text-xs text-text-muted",
255
+ children: e.language
256
+ }),
257
+ /* @__PURE__ */ H("span", {
258
+ className: "text-xs text-text-muted",
259
+ children: n(e.createdAt)
260
+ }),
261
+ e.verdict === "PENDING" ? /* @__PURE__ */ H("div", {
262
+ className: "ml-auto flex flex-wrap gap-1",
263
+ children: de.map((t) => /* @__PURE__ */ H(G, {
264
+ size: "sm",
265
+ variant: t === "ACCEPTED" ? "default" : "outline",
266
+ onClick: () => p(e.id, t),
267
+ disabled: c === e.id,
268
+ children: t === "ACCEPTED" ? "Accept" : a(t)
269
+ }, t))
270
+ }) : /* @__PURE__ */ U("span", {
271
+ className: "ml-auto text-xs text-text-muted",
272
+ children: [e.pointsAwarded, " pts"]
273
+ })
274
+ ]
275
+ }, e.id))
276
+ })]
277
+ });
278
+ }
279
+ function Ce({ hackathon: e }) {
280
+ let { data: t, loading: n, refetch: r } = k(e.id), [i] = T(), [a, s] = A(null), [c, d] = A({}), f = t?.tecListTeams ?? [], p = async (e, t) => {
281
+ let n = Math.max(0, Number(c[e] ?? "0") || 0);
282
+ s(e);
283
+ try {
284
+ (await i({ variables: {
285
+ id: e,
286
+ score: n,
287
+ winner: t
288
+ } })).data?.tecScoreTeam && (u.success("Team scored", `${n} pts${t ? " · winner" : ""}`), await r());
289
+ } finally {
290
+ s(null);
291
+ }
292
+ };
293
+ return /* @__PURE__ */ U("div", {
294
+ className: "mt-3 rounded-lg border border-border-seam bg-bg-sunken p-3",
295
+ children: [/* @__PURE__ */ U("div", {
296
+ className: "mb-2 text-xs font-semibold uppercase tracking-wide text-text-muted",
297
+ children: [
298
+ "Teams (",
299
+ f.length,
300
+ ")"
301
+ ]
302
+ }), n && f.length === 0 ? /* @__PURE__ */ H(l, {
303
+ count: 2,
304
+ height: "h-10"
305
+ }) : f.length === 0 ? /* @__PURE__ */ H("p", {
306
+ className: "text-xs text-text-muted",
307
+ children: "No teams registered yet."
308
+ }) : /* @__PURE__ */ H("div", {
309
+ className: "space-y-2",
310
+ children: f.map((t) => /* @__PURE__ */ U("div", {
311
+ className: "flex flex-wrap items-center gap-2 text-sm",
312
+ children: [
313
+ /* @__PURE__ */ H("span", {
314
+ className: "truncate font-medium text-text-primary",
315
+ children: t.name
316
+ }),
317
+ /* @__PURE__ */ H(o, { status: t.status }),
318
+ t.projectName ? /* @__PURE__ */ H("span", {
319
+ className: "text-xs text-text-muted",
320
+ children: t.projectName
321
+ }) : null,
322
+ e.status === "JUDGING" ? /* @__PURE__ */ U("div", {
323
+ className: "ml-auto flex items-center gap-1",
324
+ children: [
325
+ /* @__PURE__ */ H(q, {
326
+ type: "number",
327
+ className: "w-20",
328
+ placeholder: "Score",
329
+ value: c[t.id] ?? "",
330
+ onChange: (e) => d((n) => ({
331
+ ...n,
332
+ [t.id]: e.target.value
333
+ }))
334
+ }),
335
+ /* @__PURE__ */ H(G, {
336
+ size: "sm",
337
+ onClick: () => p(t.id, !1),
338
+ disabled: a === t.id,
339
+ children: "Score"
340
+ }),
341
+ /* @__PURE__ */ U(G, {
342
+ size: "sm",
343
+ variant: "outline",
344
+ onClick: () => p(t.id, !0),
345
+ disabled: a === t.id,
346
+ children: [/* @__PURE__ */ H(R, { size: 14 }), " Winner"]
347
+ })
348
+ ]
349
+ }) : /* @__PURE__ */ U("span", {
350
+ className: "ml-auto text-xs text-text-muted",
351
+ children: [t.score, " pts"]
352
+ })
353
+ ]
354
+ }, t.id))
355
+ })]
356
+ });
357
+ }
358
+ function we() {
359
+ let { data: e, loading: t, error: n, refetch: i } = m({}), [d, { loading: p }] = h(), [g] = w(), [_] = f(), [v, y] = A(!1), [b, x] = A(null), [S, ee] = A(null), [C, te] = A(""), [T, E] = A(""), [D, O] = A(""), [k, M] = A(""), [P, ne] = A("BEGINNER"), [F, I] = A(""), [L, R] = A(""), z = e?.tecListCourses.items ?? [], B = () => {
360
+ te(""), E(""), O(""), M(""), ne("BEGINNER"), I(""), R(""), y(!1);
361
+ }, ae = async () => {
362
+ let e = C.trim();
363
+ if (!e) return u.error("Title is required");
364
+ let t = me(T || e);
365
+ if (!t) return u.error("A valid slug is required");
366
+ (await d({ variables: { input: {
104
367
  title: e,
105
368
  slug: t,
106
- summary: A.trim() || void 0,
107
- topic: I.trim() || void 0,
108
- level: V,
109
- estimatedMinutes: K(G),
110
- tags: ae(Z)
111
- } } })).data?.tecCreateCourse && (l.success("Course created", `"${e}" saved as a draft.`), se(), await u());
112
- }, le = async (e) => {
113
- T(e);
369
+ summary: D.trim() || void 0,
370
+ topic: k.trim() || void 0,
371
+ level: P,
372
+ estimatedMinutes: ge(F),
373
+ tags: he(L)
374
+ } } })).data?.tecCreateCourse && (u.success("Course created", `"${e}" saved as a draft.`), B(), await i());
375
+ }, W = async (e) => {
376
+ x(e);
114
377
  try {
115
- (await g({ variables: { id: e } })).data?.tecPublishCourse && (l.success("Course published"), await u());
378
+ (await g({ variables: { id: e } })).data?.tecPublishCourse && (u.success("Course published"), await i());
116
379
  } finally {
117
- T(null);
380
+ x(null);
118
381
  }
119
- }, ue = async (e) => {
120
- T(e);
382
+ }, K = async (e) => {
383
+ x(e);
121
384
  try {
122
- (await _({ variables: { id: e } })).data?.tecArchiveCourse && (l.success("Course archived"), await u());
385
+ (await _({ variables: { id: e } })).data?.tecArchiveCourse && (u.success("Course archived"), await i());
123
386
  } finally {
124
- T(null);
387
+ x(null);
125
388
  }
126
389
  };
127
- return /* @__PURE__ */ N("div", {
390
+ return /* @__PURE__ */ U("div", {
128
391
  className: "space-y-4",
129
392
  children: [
130
- /* @__PURE__ */ M(Y, {
131
- summary: `${$.length} course${$.length === 1 ? "" : "s"}`,
393
+ /* @__PURE__ */ H(ye, {
394
+ summary: `${z.length} course${z.length === 1 ? "" : "s"}`,
132
395
  actionLabel: "New course",
133
396
  open: v,
134
397
  onToggle: () => y((e) => !e)
135
398
  }),
136
- v ? /* @__PURE__ */ N(oe, {
399
+ v ? /* @__PURE__ */ U(ve, {
137
400
  title: "New course",
138
- footer: /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(F, {
401
+ footer: /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(G, {
139
402
  variant: "outline",
140
403
  size: "sm",
141
- onClick: se,
404
+ onClick: B,
142
405
  children: "Cancel"
143
- }), /* @__PURE__ */ M(F, {
406
+ }), /* @__PURE__ */ H(G, {
144
407
  size: "sm",
145
- onClick: ce,
146
- disabled: h,
147
- children: h ? "Creating…" : "Create course"
408
+ onClick: ae,
409
+ disabled: p,
410
+ children: p ? "Creating…" : "Create course"
148
411
  })] }),
149
412
  children: [
150
- /* @__PURE__ */ M(J, {
413
+ /* @__PURE__ */ H($, {
151
414
  label: "Title",
152
415
  required: !0,
153
- children: /* @__PURE__ */ M(L, {
154
- value: E,
155
- onChange: (e) => D(e.target.value),
416
+ children: /* @__PURE__ */ H(q, {
417
+ value: C,
418
+ onChange: (e) => te(e.target.value),
156
419
  placeholder: "Intro to TypeScript"
157
420
  })
158
421
  }),
159
- /* @__PURE__ */ M(J, {
422
+ /* @__PURE__ */ H($, {
160
423
  label: "Slug",
161
424
  required: !0,
162
- children: /* @__PURE__ */ M(L, {
163
- value: O,
164
- onChange: (e) => k(e.target.value),
425
+ children: /* @__PURE__ */ H(q, {
426
+ value: T,
427
+ onChange: (e) => E(e.target.value),
165
428
  placeholder: "auto from title if blank"
166
429
  })
167
430
  }),
168
- /* @__PURE__ */ M(J, {
431
+ /* @__PURE__ */ H($, {
169
432
  label: "Topic",
170
- children: /* @__PURE__ */ M(L, {
171
- value: I,
172
- onChange: (e) => B(e.target.value),
173
- placeholder: "Languages"
433
+ children: /* @__PURE__ */ H(q, {
434
+ value: k,
435
+ onChange: (e) => M(e.target.value),
436
+ placeholder: "e.g. Web, AI, Data, Cloud"
174
437
  })
175
438
  }),
176
- /* @__PURE__ */ M(J, {
439
+ /* @__PURE__ */ H($, {
177
440
  label: "Level",
178
- children: /* @__PURE__ */ N(R, {
179
- value: V,
180
- onValueChange: (e) => H(e),
181
- children: [/* @__PURE__ */ M(re, { children: /* @__PURE__ */ M(z, {}) }), /* @__PURE__ */ M(te, { children: W.map((e) => /* @__PURE__ */ M(ne, {
441
+ children: /* @__PURE__ */ U(J, {
442
+ value: P,
443
+ onValueChange: (e) => ne(e),
444
+ children: [/* @__PURE__ */ H(Z, { children: /* @__PURE__ */ H(oe, {}) }), /* @__PURE__ */ H(Y, { children: fe.map((e) => /* @__PURE__ */ H(X, {
182
445
  value: e,
183
- children: i(e)
446
+ children: a(e)
184
447
  }, e)) })]
185
448
  })
186
449
  }),
187
- /* @__PURE__ */ M(J, {
450
+ /* @__PURE__ */ H($, {
188
451
  label: "Estimated minutes",
189
- children: /* @__PURE__ */ M(L, {
452
+ children: /* @__PURE__ */ H(q, {
190
453
  type: "number",
191
454
  min: 0,
192
- value: G,
193
- onChange: (e) => q(e.target.value),
455
+ value: F,
456
+ onChange: (e) => I(e.target.value),
194
457
  placeholder: "120"
195
458
  })
196
459
  }),
197
- /* @__PURE__ */ M(J, {
460
+ /* @__PURE__ */ H($, {
198
461
  label: "Tags (comma-separated)",
199
- children: /* @__PURE__ */ M(L, {
200
- value: Z,
201
- onChange: (e) => Q(e.target.value),
462
+ children: /* @__PURE__ */ H(q, {
463
+ value: L,
464
+ onChange: (e) => R(e.target.value),
202
465
  placeholder: "typescript, basics"
203
466
  })
204
467
  }),
205
- /* @__PURE__ */ M(J, {
468
+ /* @__PURE__ */ H($, {
206
469
  label: "Summary",
207
470
  className: "sm:col-span-2",
208
- children: /* @__PURE__ */ M(U, {
209
- value: A,
210
- onChange: (e) => P(e.target.value),
471
+ children: /* @__PURE__ */ H(le, {
472
+ value: D,
473
+ onChange: (e) => O(e.target.value),
211
474
  placeholder: "What learners will build and take away."
212
475
  })
213
476
  })
214
477
  ]
215
478
  }) : null,
216
- t && !$.length ? /* @__PURE__ */ M(c, { count: 4 }) : r ? /* @__PURE__ */ M(s, {
479
+ t && !z.length ? /* @__PURE__ */ H(l, { count: 4 }) : n ? /* @__PURE__ */ H(c, {
217
480
  title: "Couldn't load courses",
218
- error: r
219
- }) : $.length === 0 ? /* @__PURE__ */ M(o, {
220
- icon: /* @__PURE__ */ M(w, { size: 26 }),
481
+ error: n
482
+ }) : z.length === 0 ? /* @__PURE__ */ H(s, {
483
+ icon: /* @__PURE__ */ H(N, { size: 26 }),
221
484
  title: "No courses yet",
222
485
  description: "Create your first course with the button above. TechnoSpam is pre-launch."
223
- }) : /* @__PURE__ */ M("div", {
486
+ }) : /* @__PURE__ */ H("div", {
224
487
  className: "space-y-3",
225
- children: $.map((e) => /* @__PURE__ */ N(X, {
226
- actions: /* @__PURE__ */ N(j, { children: [e.status === "DRAFT" ? /* @__PURE__ */ N(F, {
227
- size: "sm",
228
- onClick: () => le(e.id),
229
- disabled: x === e.id,
230
- children: [/* @__PURE__ */ M(ee, { size: 15 }), " Publish"]
231
- }) : null, e.status === "ARCHIVED" ? null : /* @__PURE__ */ N(F, {
232
- size: "sm",
233
- variant: "outline",
234
- onClick: () => ue(e.id),
235
- disabled: x === e.id,
236
- children: [/* @__PURE__ */ M(C, { size: 15 }), " Archive"]
237
- })] }),
238
- children: [/* @__PURE__ */ N("div", {
488
+ children: z.map((e) => /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ U(be, {
489
+ actions: /* @__PURE__ */ U(V, { children: [
490
+ /* @__PURE__ */ U(G, {
491
+ size: "sm",
492
+ variant: "outline",
493
+ onClick: () => ee(S === e.id ? null : e.id),
494
+ children: [/* @__PURE__ */ H(re, { size: 15 }), " Lessons"]
495
+ }),
496
+ e.status === "DRAFT" ? /* @__PURE__ */ U(G, {
497
+ size: "sm",
498
+ onClick: () => W(e.id),
499
+ disabled: b === e.id,
500
+ children: [/* @__PURE__ */ H(ie, { size: 15 }), " Publish"]
501
+ }) : null,
502
+ e.status === "ARCHIVED" ? null : /* @__PURE__ */ U(G, {
503
+ size: "sm",
504
+ variant: "outline",
505
+ onClick: () => K(e.id),
506
+ disabled: b === e.id,
507
+ children: [/* @__PURE__ */ H(j, { size: 15 }), " Archive"]
508
+ })
509
+ ] }),
510
+ children: [/* @__PURE__ */ U("div", {
239
511
  className: "flex flex-wrap items-center gap-2",
240
512
  children: [
241
- /* @__PURE__ */ M("span", {
513
+ /* @__PURE__ */ H("span", {
242
514
  className: "truncate text-sm font-semibold text-text-primary",
243
515
  children: e.title
244
516
  }),
245
- /* @__PURE__ */ M(a, { status: e.status }),
246
- /* @__PURE__ */ M(a, {
517
+ /* @__PURE__ */ H(o, { status: e.status }),
518
+ /* @__PURE__ */ H(o, {
247
519
  status: e.level,
248
520
  kind: "level"
249
521
  })
250
522
  ]
251
- }), /* @__PURE__ */ N("div", {
523
+ }), /* @__PURE__ */ U("div", {
252
524
  className: "mt-1 truncate text-xs text-text-muted",
253
525
  children: [
254
526
  e.slug,
255
527
  " · ",
256
528
  e.topic ?? "No topic",
257
529
  " · ",
258
- n(e.estimatedMinutes)
530
+ r(e.estimatedMinutes)
259
531
  ]
260
532
  })]
261
- }, e.id))
533
+ }), S === e.id ? /* @__PURE__ */ H(xe, { courseId: e.id }) : null] }, e.id))
262
534
  })
263
535
  ]
264
536
  });
265
537
  }
266
- function Q() {
267
- let { data: e, loading: t, error: n, refetch: r } = y({}), [u, { loading: d }] = h(), [f] = x(), [p, m] = S(!1), [g, _] = S(null), [v, b] = S(""), [C, w] = S(""), [E, D] = S(""), [O, k] = S(""), [A, P] = S("EASY"), [I, B] = S(""), [V, H] = S(""), [W, q] = S(""), Z = e?.tecListProblems.items ?? [], Q = () => {
268
- b(""), w(""), D(""), k(""), P("EASY"), B(""), H(""), q(""), m(!1);
269
- }, $ = async () => {
270
- let e = v.trim();
271
- if (!e) return l.error("Title is required");
272
- let t = ie(C || e);
273
- if (!t) return l.error("A valid slug is required");
274
- (await u({ variables: { input: {
538
+ function Te() {
539
+ let { data: e, loading: t, error: n, refetch: r } = C({}), [i, { loading: d }] = v(), [f] = te(), [p, m] = A(!1), [h, g] = A(null), [_, y] = A(null), [b, x] = A(""), [S, ee] = A(""), [w, T] = A(""), [E, D] = A(""), [O, k] = A("EASY"), [j, M] = A(""), [N, re] = A(""), [F, I] = A(""), L = e?.tecListProblems.items ?? [], R = () => {
540
+ x(""), ee(""), T(""), D(""), k("EASY"), M(""), re(""), I(""), m(!1);
541
+ }, z = async () => {
542
+ let e = b.trim();
543
+ if (!e) return u.error("Title is required");
544
+ let t = me(S || e);
545
+ if (!t) return u.error("A valid slug is required");
546
+ (await i({ variables: { input: {
275
547
  title: e,
276
548
  slug: t,
277
- statement: E.trim() || void 0,
278
- topic: O.trim() || void 0,
279
- difficulty: A,
280
- points: K(I),
281
- languages: ae(V),
282
- starterCode: W.trim() || void 0
283
- } } })).data?.tecCreateProblem && (l.success("Problem created", `"${e}" saved as a draft.`), Q(), await r());
284
- }, se = async (e) => {
285
- _(e);
549
+ statement: w.trim() || void 0,
550
+ topic: E.trim() || void 0,
551
+ difficulty: O,
552
+ points: ge(j),
553
+ languages: he(N),
554
+ starterCode: F.trim() || void 0
555
+ } } })).data?.tecCreateProblem && (u.success("Problem created", `"${e}" saved as a draft.`), R(), await r());
556
+ }, B = async (e) => {
557
+ g(e);
286
558
  try {
287
- (await f({ variables: { id: e } })).data?.tecPublishProblem && (l.success("Problem published"), await r());
559
+ (await f({ variables: { id: e } })).data?.tecPublishProblem && (u.success("Problem published"), await r());
288
560
  } finally {
289
- _(null);
561
+ g(null);
290
562
  }
291
563
  };
292
- return /* @__PURE__ */ N("div", {
564
+ return /* @__PURE__ */ U("div", {
293
565
  className: "space-y-4",
294
566
  children: [
295
- /* @__PURE__ */ M(Y, {
296
- summary: `${Z.length} problem${Z.length === 1 ? "" : "s"}`,
567
+ /* @__PURE__ */ H(ye, {
568
+ summary: `${L.length} problem${L.length === 1 ? "" : "s"}`,
297
569
  actionLabel: "New problem",
298
570
  open: p,
299
571
  onToggle: () => m((e) => !e)
300
572
  }),
301
- p ? /* @__PURE__ */ N(oe, {
573
+ p ? /* @__PURE__ */ U(ve, {
302
574
  title: "New problem",
303
- footer: /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(F, {
575
+ footer: /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(G, {
304
576
  variant: "outline",
305
577
  size: "sm",
306
- onClick: Q,
578
+ onClick: R,
307
579
  children: "Cancel"
308
- }), /* @__PURE__ */ M(F, {
580
+ }), /* @__PURE__ */ H(G, {
309
581
  size: "sm",
310
- onClick: $,
582
+ onClick: z,
311
583
  disabled: d,
312
584
  children: d ? "Creating…" : "Create problem"
313
585
  })] }),
314
586
  children: [
315
- /* @__PURE__ */ M(J, {
587
+ /* @__PURE__ */ H($, {
316
588
  label: "Title",
317
589
  required: !0,
318
- children: /* @__PURE__ */ M(L, {
319
- value: v,
320
- onChange: (e) => b(e.target.value),
590
+ children: /* @__PURE__ */ H(q, {
591
+ value: b,
592
+ onChange: (e) => x(e.target.value),
321
593
  placeholder: "Two Sum"
322
594
  })
323
595
  }),
324
- /* @__PURE__ */ M(J, {
596
+ /* @__PURE__ */ H($, {
325
597
  label: "Slug",
326
598
  required: !0,
327
- children: /* @__PURE__ */ M(L, {
328
- value: C,
329
- onChange: (e) => w(e.target.value),
599
+ children: /* @__PURE__ */ H(q, {
600
+ value: S,
601
+ onChange: (e) => ee(e.target.value),
330
602
  placeholder: "auto from title if blank"
331
603
  })
332
604
  }),
333
- /* @__PURE__ */ M(J, {
605
+ /* @__PURE__ */ H($, {
334
606
  label: "Topic",
335
- children: /* @__PURE__ */ M(L, {
336
- value: O,
337
- onChange: (e) => k(e.target.value),
607
+ children: /* @__PURE__ */ H(q, {
608
+ value: E,
609
+ onChange: (e) => D(e.target.value),
338
610
  placeholder: "Arrays"
339
611
  })
340
612
  }),
341
- /* @__PURE__ */ M(J, {
613
+ /* @__PURE__ */ H($, {
342
614
  label: "Difficulty",
343
- children: /* @__PURE__ */ N(R, {
344
- value: A,
345
- onValueChange: (e) => P(e),
346
- children: [/* @__PURE__ */ M(re, { children: /* @__PURE__ */ M(z, {}) }), /* @__PURE__ */ M(te, { children: G.map((e) => /* @__PURE__ */ M(ne, {
615
+ children: /* @__PURE__ */ U(J, {
616
+ value: O,
617
+ onValueChange: (e) => k(e),
618
+ children: [/* @__PURE__ */ H(Z, { children: /* @__PURE__ */ H(oe, {}) }), /* @__PURE__ */ H(Y, { children: pe.map((e) => /* @__PURE__ */ H(X, {
347
619
  value: e,
348
- children: i(e)
620
+ children: a(e)
349
621
  }, e)) })]
350
622
  })
351
623
  }),
352
- /* @__PURE__ */ M(J, {
624
+ /* @__PURE__ */ H($, {
353
625
  label: "Points",
354
- children: /* @__PURE__ */ M(L, {
626
+ children: /* @__PURE__ */ H(q, {
355
627
  type: "number",
356
628
  min: 0,
357
- value: I,
358
- onChange: (e) => B(e.target.value),
629
+ value: j,
630
+ onChange: (e) => M(e.target.value),
359
631
  placeholder: "100"
360
632
  })
361
633
  }),
362
- /* @__PURE__ */ M(J, {
634
+ /* @__PURE__ */ H($, {
363
635
  label: "Languages (comma-separated)",
364
- children: /* @__PURE__ */ M(L, {
365
- value: V,
366
- onChange: (e) => H(e.target.value),
636
+ children: /* @__PURE__ */ H(q, {
637
+ value: N,
638
+ onChange: (e) => re(e.target.value),
367
639
  placeholder: "python, typescript"
368
640
  })
369
641
  }),
370
- /* @__PURE__ */ M(J, {
642
+ /* @__PURE__ */ H($, {
371
643
  label: "Statement",
372
644
  className: "sm:col-span-2",
373
- children: /* @__PURE__ */ M(U, {
374
- value: E,
375
- onChange: (e) => D(e.target.value),
645
+ children: /* @__PURE__ */ H(le, {
646
+ value: w,
647
+ onChange: (e) => T(e.target.value),
376
648
  placeholder: "Describe the problem and constraints."
377
649
  })
378
650
  }),
379
- /* @__PURE__ */ M(J, {
651
+ /* @__PURE__ */ H($, {
380
652
  label: "Starter code",
381
653
  className: "sm:col-span-2",
382
- children: /* @__PURE__ */ M(U, {
383
- value: W,
384
- onChange: (e) => q(e.target.value),
654
+ children: /* @__PURE__ */ H(le, {
655
+ value: F,
656
+ onChange: (e) => I(e.target.value),
385
657
  className: "font-mono",
386
658
  placeholder: "def solve(nums, target):\\n pass"
387
659
  })
388
660
  })
389
661
  ]
390
662
  }) : null,
391
- t && !Z.length ? /* @__PURE__ */ M(c, { count: 4 }) : n ? /* @__PURE__ */ M(s, {
663
+ t && !L.length ? /* @__PURE__ */ H(l, { count: 4 }) : n ? /* @__PURE__ */ H(c, {
392
664
  title: "Couldn't load problems",
393
665
  error: n
394
- }) : Z.length === 0 ? /* @__PURE__ */ M(o, {
395
- icon: /* @__PURE__ */ M(T, { size: 26 }),
666
+ }) : L.length === 0 ? /* @__PURE__ */ H(s, {
667
+ icon: /* @__PURE__ */ H(P, { size: 26 }),
396
668
  title: "No problems yet",
397
669
  description: "Create your first coding problem with the button above. TechnoSpam is pre-launch."
398
- }) : /* @__PURE__ */ M("div", {
670
+ }) : /* @__PURE__ */ H("div", {
399
671
  className: "space-y-3",
400
- children: Z.map((e) => /* @__PURE__ */ N(X, {
401
- actions: e.status === "DRAFT" ? /* @__PURE__ */ N(F, {
672
+ children: L.map((e) => /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ U(be, {
673
+ actions: /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ U(G, {
674
+ size: "sm",
675
+ variant: "outline",
676
+ onClick: () => y(_ === e.id ? null : e.id),
677
+ children: [/* @__PURE__ */ H(ne, { size: 15 }), " Grade"]
678
+ }), e.status === "DRAFT" ? /* @__PURE__ */ U(G, {
402
679
  size: "sm",
403
- onClick: () => se(e.id),
404
- disabled: g === e.id,
405
- children: [/* @__PURE__ */ M(ee, { size: 15 }), " Publish"]
406
- }) : void 0,
407
- children: [/* @__PURE__ */ N("div", {
680
+ onClick: () => B(e.id),
681
+ disabled: h === e.id,
682
+ children: [/* @__PURE__ */ H(ie, { size: 15 }), " Publish"]
683
+ }) : null] }),
684
+ children: [/* @__PURE__ */ U("div", {
408
685
  className: "flex flex-wrap items-center gap-2",
409
686
  children: [
410
- /* @__PURE__ */ M("span", {
687
+ /* @__PURE__ */ H("span", {
411
688
  className: "truncate text-sm font-semibold text-text-primary",
412
689
  children: e.title
413
690
  }),
414
- /* @__PURE__ */ M(a, { status: e.status }),
415
- /* @__PURE__ */ M(a, {
691
+ /* @__PURE__ */ H(o, { status: e.status }),
692
+ /* @__PURE__ */ H(o, {
416
693
  status: e.difficulty,
417
694
  kind: "level"
418
695
  })
419
696
  ]
420
- }), /* @__PURE__ */ N("div", {
697
+ }), /* @__PURE__ */ U("div", {
421
698
  className: "mt-1 truncate text-xs text-text-muted",
422
699
  children: [
423
700
  e.slug,
@@ -430,233 +707,266 @@ function Q() {
430
707
  e.languages.length ? e.languages.join(", ") : "No languages"
431
708
  ]
432
709
  })]
433
- }, e.id))
710
+ }), _ === e.id ? /* @__PURE__ */ H(Se, { problemId: e.id }) : null] }, e.id))
434
711
  })
435
712
  ]
436
713
  });
437
714
  }
438
- function $() {
439
- let { data: e, loading: n, error: i, refetch: u } = g({}), [d, { loading: f }] = m(), [p] = v(), [h, _] = S(!1), [y, b] = S(null), [x, C] = S(""), [w, T] = S(""), [E, O] = S(""), [k, A] = S(""), [P, I] = S(""), [R, te] = S(""), [ne, re] = S(""), [z, B] = S(""), [V, H] = S(""), W = e?.tecListHackathons.items ?? [], G = () => {
440
- C(""), T(""), O(""), A(""), I(""), te(""), re(""), B(""), H(""), _(!1);
441
- }, Z = async () => {
442
- let e = x.trim();
443
- if (!e) return l.error("Title is required");
444
- let t = ie(w || e);
445
- if (!t) return l.error("A valid slug is required");
446
- let n = q(P), r = q(R);
447
- if (!n || !r) return l.error("Start and end date/time are required");
448
- if (new Date(r) <= new Date(n)) return l.error("End must be after the start");
715
+ function Ee() {
716
+ let { data: e, loading: t, error: r, refetch: a } = b({}), [d, { loading: f }] = g(), [m] = ee(), [h] = E(), [_] = D(), [v] = p(), [y, x] = A(!1), [S, C] = A(null), [w, te] = A(null), [T, O] = A(""), [k, j] = A(""), [N, P] = A(""), [re, I] = A(""), [L, z] = A(""), [ae, W] = A(""), [K, J] = A(""), [Y, X] = A(""), [Z, oe] = A(""), Q = e?.tecListHackathons.items ?? [], se = () => {
717
+ O(""), j(""), P(""), I(""), z(""), W(""), J(""), X(""), oe(""), x(!1);
718
+ }, ce = async () => {
719
+ let e = T.trim();
720
+ if (!e) return u.error("Title is required");
721
+ let t = me(k || e);
722
+ if (!t) return u.error("A valid slug is required");
723
+ let n = _e(L), r = _e(ae);
724
+ if (!n || !r) return u.error("Start and end date/time are required");
725
+ if (new Date(r) <= new Date(n)) return u.error("End must be after the start");
449
726
  (await d({ variables: { input: {
450
727
  title: e,
451
728
  slug: t,
452
- theme: E.trim() || void 0,
453
- description: k.trim() || void 0,
729
+ theme: N.trim() || void 0,
730
+ description: re.trim() || void 0,
454
731
  startAt: n,
455
732
  endAt: r,
456
- prizePool: K(ne),
457
- maxTeamSize: K(z),
458
- tags: ae(V)
459
- } } })).data?.tecCreateHackathon && (l.success("Hackathon created", `"${e}" saved as a draft.`), G(), await u());
460
- }, Q = async (e) => {
461
- b(e);
733
+ prizePool: ge(K),
734
+ maxTeamSize: ge(Y),
735
+ tags: he(Z)
736
+ } } })).data?.tecCreateHackathon && (u.success("Hackathon created", `"${e}" saved as a draft.`), se(), await a());
737
+ }, ue = async (e) => {
738
+ C(e);
462
739
  try {
463
- (await p({ variables: { id: e } })).data?.tecOpenRegistration && (l.success("Registration open", "Teams can now register."), await u());
740
+ (await m({ variables: { id: e } })).data?.tecOpenRegistration && (u.success("Registration open", "Teams can now register."), await a());
464
741
  } finally {
465
- b(null);
742
+ C(null);
743
+ }
744
+ }, de = async (e, t, n) => {
745
+ C(e);
746
+ try {
747
+ (await t({ variables: { id: e } })).data && (u.success(n), await a());
748
+ } finally {
749
+ C(null);
466
750
  }
467
751
  };
468
- return /* @__PURE__ */ N("div", {
752
+ return /* @__PURE__ */ U("div", {
469
753
  className: "space-y-4",
470
754
  children: [
471
- /* @__PURE__ */ M(Y, {
472
- summary: `${W.length} hackathon${W.length === 1 ? "" : "s"}`,
755
+ /* @__PURE__ */ H(ye, {
756
+ summary: `${Q.length} hackathon${Q.length === 1 ? "" : "s"}`,
473
757
  actionLabel: "New hackathon",
474
- open: h,
475
- onToggle: () => _((e) => !e)
758
+ open: y,
759
+ onToggle: () => x((e) => !e)
476
760
  }),
477
- h ? /* @__PURE__ */ N(oe, {
761
+ y ? /* @__PURE__ */ U(ve, {
478
762
  title: "New hackathon",
479
- footer: /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(F, {
763
+ footer: /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(G, {
480
764
  variant: "outline",
481
765
  size: "sm",
482
- onClick: G,
766
+ onClick: se,
483
767
  children: "Cancel"
484
- }), /* @__PURE__ */ M(F, {
768
+ }), /* @__PURE__ */ H(G, {
485
769
  size: "sm",
486
- onClick: Z,
770
+ onClick: ce,
487
771
  disabled: f,
488
772
  children: f ? "Creating…" : "Create hackathon"
489
773
  })] }),
490
774
  children: [
491
- /* @__PURE__ */ M(J, {
775
+ /* @__PURE__ */ H($, {
492
776
  label: "Title",
493
777
  required: !0,
494
- children: /* @__PURE__ */ M(L, {
495
- value: x,
496
- onChange: (e) => C(e.target.value),
778
+ children: /* @__PURE__ */ H(q, {
779
+ value: T,
780
+ onChange: (e) => O(e.target.value),
497
781
  placeholder: "Build Days 2026"
498
782
  })
499
783
  }),
500
- /* @__PURE__ */ M(J, {
784
+ /* @__PURE__ */ H($, {
501
785
  label: "Slug",
502
786
  required: !0,
503
- children: /* @__PURE__ */ M(L, {
504
- value: w,
505
- onChange: (e) => T(e.target.value),
787
+ children: /* @__PURE__ */ H(q, {
788
+ value: k,
789
+ onChange: (e) => j(e.target.value),
506
790
  placeholder: "auto from title if blank"
507
791
  })
508
792
  }),
509
- /* @__PURE__ */ M(J, {
793
+ /* @__PURE__ */ H($, {
510
794
  label: "Theme",
511
- children: /* @__PURE__ */ M(L, {
512
- value: E,
513
- onChange: (e) => O(e.target.value),
795
+ children: /* @__PURE__ */ H(q, {
796
+ value: N,
797
+ onChange: (e) => P(e.target.value),
514
798
  placeholder: "AI for good"
515
799
  })
516
800
  }),
517
- /* @__PURE__ */ M(J, {
801
+ /* @__PURE__ */ H($, {
518
802
  label: "Tags (comma-separated)",
519
- children: /* @__PURE__ */ M(L, {
520
- value: V,
521
- onChange: (e) => H(e.target.value),
803
+ children: /* @__PURE__ */ H(q, {
804
+ value: Z,
805
+ onChange: (e) => oe(e.target.value),
522
806
  placeholder: "ai, web"
523
807
  })
524
808
  }),
525
- /* @__PURE__ */ M(J, {
809
+ /* @__PURE__ */ H($, {
526
810
  label: "Starts",
527
811
  required: !0,
528
- children: /* @__PURE__ */ M(L, {
812
+ children: /* @__PURE__ */ H(q, {
529
813
  type: "datetime-local",
530
- value: P,
531
- onChange: (e) => I(e.target.value)
814
+ value: L,
815
+ onChange: (e) => z(e.target.value)
532
816
  })
533
817
  }),
534
- /* @__PURE__ */ M(J, {
818
+ /* @__PURE__ */ H($, {
535
819
  label: "Ends",
536
820
  required: !0,
537
- children: /* @__PURE__ */ M(L, {
821
+ children: /* @__PURE__ */ H(q, {
538
822
  type: "datetime-local",
539
- value: R,
540
- onChange: (e) => te(e.target.value)
823
+ value: ae,
824
+ onChange: (e) => W(e.target.value)
541
825
  })
542
826
  }),
543
- /* @__PURE__ */ M(J, {
827
+ /* @__PURE__ */ H($, {
544
828
  label: "Prize pool",
545
- children: /* @__PURE__ */ M(L, {
829
+ children: /* @__PURE__ */ H(q, {
546
830
  type: "number",
547
831
  min: 0,
548
- value: ne,
549
- onChange: (e) => re(e.target.value),
832
+ value: K,
833
+ onChange: (e) => J(e.target.value),
550
834
  placeholder: "5000"
551
835
  })
552
836
  }),
553
- /* @__PURE__ */ M(J, {
837
+ /* @__PURE__ */ H($, {
554
838
  label: "Max team size",
555
- children: /* @__PURE__ */ M(L, {
839
+ children: /* @__PURE__ */ H(q, {
556
840
  type: "number",
557
841
  min: 1,
558
- value: z,
559
- onChange: (e) => B(e.target.value),
842
+ value: Y,
843
+ onChange: (e) => X(e.target.value),
560
844
  placeholder: "4"
561
845
  })
562
846
  }),
563
- /* @__PURE__ */ M(J, {
847
+ /* @__PURE__ */ H($, {
564
848
  label: "Description",
565
849
  className: "sm:col-span-2",
566
- children: /* @__PURE__ */ M(U, {
567
- value: k,
568
- onChange: (e) => A(e.target.value),
850
+ children: /* @__PURE__ */ H(le, {
851
+ value: re,
852
+ onChange: (e) => I(e.target.value),
569
853
  placeholder: "What the hackathon is about and how judging works."
570
854
  })
571
855
  })
572
856
  ]
573
857
  }) : null,
574
- n && !W.length ? /* @__PURE__ */ M(c, { count: 4 }) : i ? /* @__PURE__ */ M(s, {
858
+ t && !Q.length ? /* @__PURE__ */ H(l, { count: 4 }) : r ? /* @__PURE__ */ H(c, {
575
859
  title: "Couldn't load hackathons",
576
- error: i
577
- }) : W.length === 0 ? /* @__PURE__ */ M(o, {
578
- icon: /* @__PURE__ */ M(D, { size: 26 }),
860
+ error: r
861
+ }) : Q.length === 0 ? /* @__PURE__ */ H(s, {
862
+ icon: /* @__PURE__ */ H(R, { size: 26 }),
579
863
  title: "No hackathons yet",
580
864
  description: "Create your first hackathon with the button above. TechnoSpam is pre-launch."
581
- }) : /* @__PURE__ */ M("div", {
865
+ }) : /* @__PURE__ */ H("div", {
582
866
  className: "space-y-3",
583
- children: W.map((e) => /* @__PURE__ */ N(X, {
584
- actions: e.status === "DRAFT" ? /* @__PURE__ */ N(F, {
585
- size: "sm",
586
- onClick: () => Q(e.id),
587
- disabled: y === e.id,
588
- children: [/* @__PURE__ */ M(ee, { size: 15 }), " Open registration"]
589
- }) : void 0,
590
- children: [/* @__PURE__ */ N("div", {
867
+ children: Q.map((e) => /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ U(be, {
868
+ actions: /* @__PURE__ */ U(V, { children: [
869
+ /* @__PURE__ */ U(G, {
870
+ size: "sm",
871
+ variant: "outline",
872
+ onClick: () => te(w === e.id ? null : e.id),
873
+ children: [/* @__PURE__ */ H(B, { size: 15 }), " Teams"]
874
+ }),
875
+ e.status === "DRAFT" ? /* @__PURE__ */ U(G, {
876
+ size: "sm",
877
+ onClick: () => ue(e.id),
878
+ disabled: S === e.id,
879
+ children: [/* @__PURE__ */ H(ie, { size: 15 }), " Open registration"]
880
+ }) : null,
881
+ e.status === "REGISTRATION_OPEN" ? /* @__PURE__ */ U(G, {
882
+ size: "sm",
883
+ onClick: () => de(e.id, h, "Hackathon started"),
884
+ disabled: S === e.id,
885
+ children: [/* @__PURE__ */ H(F, { size: 15 }), " Start"]
886
+ }) : null,
887
+ e.status === "IN_PROGRESS" ? /* @__PURE__ */ U(G, {
888
+ size: "sm",
889
+ onClick: () => de(e.id, _, "Judging started"),
890
+ disabled: S === e.id,
891
+ children: [/* @__PURE__ */ H(ne, { size: 15 }), " Start judging"]
892
+ }) : null,
893
+ e.status === "JUDGING" ? /* @__PURE__ */ U(G, {
894
+ size: "sm",
895
+ onClick: () => de(e.id, v, "Hackathon completed"),
896
+ disabled: S === e.id,
897
+ children: [/* @__PURE__ */ H(M, { size: 15 }), " Complete"]
898
+ }) : null
899
+ ] }),
900
+ children: [/* @__PURE__ */ U("div", {
591
901
  className: "flex flex-wrap items-center gap-2",
592
- children: [/* @__PURE__ */ M("span", {
902
+ children: [/* @__PURE__ */ H("span", {
593
903
  className: "truncate text-sm font-semibold text-text-primary",
594
904
  children: e.title
595
- }), /* @__PURE__ */ M(a, { status: e.status })]
596
- }), /* @__PURE__ */ N("div", {
905
+ }), /* @__PURE__ */ H(o, { status: e.status })]
906
+ }), /* @__PURE__ */ U("div", {
597
907
  className: "mt-1 truncate text-xs text-text-muted",
598
908
  children: [
599
909
  e.slug,
600
910
  " · ",
601
- t(e.startAt),
911
+ n(e.startAt),
602
912
  " → ",
603
- t(e.endAt),
604
- e.prizePool ? ` · ${r(e.prizePool, e.currency)} prize` : ""
913
+ n(e.endAt),
914
+ e.prizePool ? ` · ${i(e.prizePool, e.currency)} prize` : ""
605
915
  ]
606
916
  })]
607
- }, e.id))
917
+ }), w === e.id ? /* @__PURE__ */ H(Ce, { hackathon: e }) : null] }, e.id))
608
918
  })
609
919
  ]
610
920
  });
611
921
  }
612
- function se() {
613
- let { data: e, loading: t, error: n, refetch: i } = _({}), [d] = u(), [f, p] = S(null), m = e?.tecListMentors.items ?? [], h = m.filter((e) => e.status === "PENDING").length, g = async (e) => {
922
+ function De() {
923
+ let { data: e, loading: t, error: n, refetch: r } = S({}), [a] = d(), [f, p] = A(null), m = e?.tecListMentors.items ?? [], h = m.filter((e) => e.status === "PENDING").length, g = async (e) => {
614
924
  p(e);
615
925
  try {
616
- (await d({ variables: { id: e } })).data?.tecApproveMentor && (l.success("Mentor approved", "They can now accept mentees."), await i());
926
+ (await a({ variables: { id: e } })).data?.tecApproveMentor && (u.success("Mentor approved", "They can now accept mentees."), await r());
617
927
  } finally {
618
928
  p(null);
619
929
  }
620
930
  };
621
- return /* @__PURE__ */ N("div", {
931
+ return /* @__PURE__ */ U("div", {
622
932
  className: "space-y-4",
623
- children: [/* @__PURE__ */ M(Y, { summary: `${m.length} mentor${m.length === 1 ? "" : "s"}${h ? ` · ${h} pending approval` : ""}` }), t && !m.length ? /* @__PURE__ */ M(c, { count: 4 }) : n ? /* @__PURE__ */ M(s, {
933
+ children: [/* @__PURE__ */ H(ye, { summary: `${m.length} mentor${m.length === 1 ? "" : "s"}${h ? ` · ${h} pending approval` : ""}` }), t && !m.length ? /* @__PURE__ */ H(l, { count: 4 }) : n ? /* @__PURE__ */ H(c, {
624
934
  title: "Couldn't load mentors",
625
935
  error: n
626
- }) : m.length === 0 ? /* @__PURE__ */ M(o, {
627
- icon: /* @__PURE__ */ M(k, { size: 26 }),
936
+ }) : m.length === 0 ? /* @__PURE__ */ H(s, {
937
+ icon: /* @__PURE__ */ H(B, { size: 26 }),
628
938
  title: "No mentors yet",
629
939
  description: "Mentor applications will appear here for review. TechnoSpam is pre-launch."
630
- }) : /* @__PURE__ */ M("div", {
940
+ }) : /* @__PURE__ */ H("div", {
631
941
  className: "space-y-3",
632
- children: m.map((e) => /* @__PURE__ */ N(X, {
633
- actions: e.status === "PENDING" ? /* @__PURE__ */ N(F, {
942
+ children: m.map((e) => /* @__PURE__ */ U(be, {
943
+ actions: e.status === "PENDING" ? /* @__PURE__ */ U(G, {
634
944
  size: "sm",
635
945
  onClick: () => g(e.id),
636
946
  disabled: f === e.id,
637
- children: [/* @__PURE__ */ M(O, { size: 15 }), " Approve"]
947
+ children: [/* @__PURE__ */ H(z, { size: 15 }), " Approve"]
638
948
  }) : void 0,
639
- children: [/* @__PURE__ */ N("div", {
949
+ children: [/* @__PURE__ */ U("div", {
640
950
  className: "flex flex-wrap items-center gap-2",
641
951
  children: [
642
- /* @__PURE__ */ M("span", {
952
+ /* @__PURE__ */ H("span", {
643
953
  className: "truncate text-sm font-semibold text-text-primary",
644
954
  children: e.headline
645
955
  }),
646
- /* @__PURE__ */ M(a, { status: e.status }),
647
- e.isAcceptingMentees ? /* @__PURE__ */ M(P, {
956
+ /* @__PURE__ */ H(o, { status: e.status }),
957
+ e.isAcceptingMentees ? /* @__PURE__ */ H(W, {
648
958
  variant: "secondary",
649
959
  className: "text-[11px]",
650
960
  children: "Accepting mentees"
651
961
  }) : null
652
962
  ]
653
- }), /* @__PURE__ */ N("div", {
963
+ }), /* @__PURE__ */ U("div", {
654
964
  className: "mt-1 truncate text-xs text-text-muted",
655
965
  children: [
656
966
  e.expertise.length ? e.expertise.slice(0, 4).join(", ") : "No expertise listed",
657
967
  " ·",
658
968
  " ",
659
- r(e.hourlyRate, e.currency),
969
+ i(e.hourlyRate, e.currency),
660
970
  "/hr · ",
661
971
  e.sessionsCount,
662
972
  " sessions"
@@ -666,40 +976,60 @@ function se() {
666
976
  })]
667
977
  });
668
978
  }
669
- function ce() {
670
- let [t, n] = S("courses");
671
- return /* @__PURE__ */ N(e, {
979
+ function Oe() {
980
+ let [n, r] = A("courses"), { currentUser: i } = e(), a = (i?.role ?? "").toLowerCase();
981
+ return /* @__PURE__ */ U(t, {
672
982
  hero: !0,
673
983
  title: "Authoring Console",
674
984
  description: "Create and manage TechnoSpam content — courses, problems, hackathons, and mentor applications.",
675
- children: [/* @__PURE__ */ M(B, {
676
- value: t,
677
- onValueChange: (e) => n(e),
678
- children: /* @__PURE__ */ N(V, {
679
- className: "mb-5",
680
- children: [
681
- /* @__PURE__ */ N(H, {
682
- value: "courses",
683
- children: [/* @__PURE__ */ M(w, { size: 15 }), " Courses"]
684
- }),
685
- /* @__PURE__ */ N(H, {
686
- value: "problems",
687
- children: [/* @__PURE__ */ M(T, { size: 15 }), " Problems"]
688
- }),
689
- /* @__PURE__ */ N(H, {
690
- value: "hackathons",
691
- children: [/* @__PURE__ */ M(D, { size: 15 }), " Hackathons"]
692
- }),
693
- /* @__PURE__ */ N(H, {
694
- value: "mentors",
695
- children: [/* @__PURE__ */ M(k, { size: 15 }), " Mentors"]
696
- })
697
- ]
698
- })
699
- }), M(t === "courses" ? Z : t === "problems" ? Q : t === "hackathons" ? $ : se, {})]
985
+ children: [
986
+ a.includes("admin") || a.includes("owner") || a.includes("instructor") ? null : /* @__PURE__ */ U(K, {
987
+ className: "mb-5 flex items-start gap-3 border-status-warning-border p-4",
988
+ children: [/* @__PURE__ */ H(L, {
989
+ size: 18,
990
+ className: "mt-0.5 shrink-0 text-status-warning-text"
991
+ }), /* @__PURE__ */ U("div", {
992
+ className: "text-sm text-text-secondary",
993
+ children: [
994
+ /* @__PURE__ */ H("span", {
995
+ className: "font-medium text-text-primary",
996
+ children: "Authoring is limited to workspace admins."
997
+ }),
998
+ " ",
999
+ "You can review content here, but create/publish actions require the right permission and will be rejected at the gateway otherwise."
1000
+ ]
1001
+ })]
1002
+ }),
1003
+ /* @__PURE__ */ H(Q, {
1004
+ value: n,
1005
+ onValueChange: (e) => r(e),
1006
+ children: /* @__PURE__ */ U(se, {
1007
+ className: "mb-5",
1008
+ children: [
1009
+ /* @__PURE__ */ U(ce, {
1010
+ value: "courses",
1011
+ children: [/* @__PURE__ */ H(N, { size: 15 }), " Courses"]
1012
+ }),
1013
+ /* @__PURE__ */ U(ce, {
1014
+ value: "problems",
1015
+ children: [/* @__PURE__ */ H(P, { size: 15 }), " Problems"]
1016
+ }),
1017
+ /* @__PURE__ */ U(ce, {
1018
+ value: "hackathons",
1019
+ children: [/* @__PURE__ */ H(R, { size: 15 }), " Hackathons"]
1020
+ }),
1021
+ /* @__PURE__ */ U(ce, {
1022
+ value: "mentors",
1023
+ children: [/* @__PURE__ */ H(B, { size: 15 }), " Mentors"]
1024
+ })
1025
+ ]
1026
+ })
1027
+ }),
1028
+ H(n === "courses" ? we : n === "problems" ? Te : n === "hackathons" ? Ee : De, {})
1029
+ ]
700
1030
  });
701
1031
  }
702
1032
  //#endregion
703
- export { ce as AdminAdminDashboardPagePage };
1033
+ export { Oe as AdminAdminDashboardPagePage };
704
1034
 
705
1035
  //# sourceMappingURL=AdminAdminDashboardPagePage.js.map