@burdenoff/microfe-technospam 2026.1102.1 → 2026.1102.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/wspace-types.d.ts +7468 -141
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/node_modules/@codemirror/autocomplete/dist/index.js +527 -0
- package/dist/node_modules/@codemirror/autocomplete/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/commands/dist/index.js +1108 -0
- package/dist/node_modules/@codemirror/commands/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/lang-go/dist/index.js +206 -0
- package/dist/node_modules/@codemirror/lang-go/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/lang-javascript/dist/index.js +321 -0
- package/dist/node_modules/@codemirror/lang-javascript/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/lang-python/dist/index.js +265 -0
- package/dist/node_modules/@codemirror/lang-python/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/language/dist/index.js +957 -0
- package/dist/node_modules/@codemirror/language/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/legacy-modes/mode/ruby.js +164 -0
- package/dist/node_modules/@codemirror/legacy-modes/mode/ruby.js.map +1 -0
- package/dist/node_modules/@codemirror/legacy-modes/mode/shell.js +109 -0
- package/dist/node_modules/@codemirror/legacy-modes/mode/shell.js.map +1 -0
- package/dist/node_modules/@codemirror/state/dist/index.js +1739 -0
- package/dist/node_modules/@codemirror/state/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/streamparser/dist/index.js +70 -0
- package/dist/node_modules/@codemirror/streamparser/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/view/dist/index.js +5427 -0
- package/dist/node_modules/@codemirror/view/dist/index.js.map +1 -0
- package/dist/node_modules/@lezer/common/dist/index.js +896 -0
- package/dist/node_modules/@lezer/common/dist/index.js.map +1 -0
- package/dist/node_modules/@lezer/go/dist/index.js +215 -0
- package/dist/node_modules/@lezer/go/dist/index.js.map +1 -0
- package/dist/node_modules/@lezer/highlight/dist/index.js +395 -0
- package/dist/node_modules/@lezer/highlight/dist/index.js.map +1 -0
- package/dist/node_modules/@lezer/javascript/dist/index.js +437 -0
- package/dist/node_modules/@lezer/javascript/dist/index.js.map +1 -0
- package/dist/node_modules/@lezer/lr/dist/index.js +842 -0
- package/dist/node_modules/@lezer/lr/dist/index.js.map +1 -0
- package/dist/node_modules/@lezer/python/dist/index.js +352 -0
- package/dist/node_modules/@lezer/python/dist/index.js.map +1 -0
- package/dist/node_modules/@marijn/find-cluster-break/src/index.js +66 -0
- package/dist/node_modules/@marijn/find-cluster-break/src/index.js.map +1 -0
- package/dist/node_modules/style-mod/src/style-mod.js +74 -0
- package/dist/node_modules/style-mod/src/style-mod.js.map +1 -0
- package/dist/node_modules/w3c-keyname/index.js +90 -0
- package/dist/node_modules/w3c-keyname/index.js.map +1 -0
- package/dist/stories/fixtures/technospamFixtures.d.ts.map +1 -1
- package/dist/stories/journeys/Problems.stories.d.ts.map +1 -1
- package/dist/technospam/api/technospamApi.d.ts +39 -0
- package/dist/technospam/api/technospamApi.d.ts.map +1 -1
- package/dist/technospam/api/technospamApi.js +120 -86
- package/dist/technospam/api/technospamApi.js.map +1 -1
- package/dist/technospam/components/SubmissionViews.d.ts +6 -2
- package/dist/technospam/components/SubmissionViews.d.ts.map +1 -1
- package/dist/technospam/components/SubmissionViews.js +6 -5
- package/dist/technospam/components/SubmissionViews.js.map +1 -1
- package/dist/technospam/components/TechnoSpamErrorBoundary.d.ts +6 -0
- package/dist/technospam/components/TechnoSpamErrorBoundary.d.ts.map +1 -1
- package/dist/technospam/components/TechnoSpamErrorBoundary.js +2 -2
- package/dist/technospam/components/TechnoSpamErrorBoundary.js.map +1 -1
- package/dist/technospam/components/editor/CodeEditor.d.ts +26 -0
- package/dist/technospam/components/editor/CodeEditor.d.ts.map +1 -0
- package/dist/technospam/components/editor/CodeEditor.js +102 -0
- package/dist/technospam/components/editor/CodeEditor.js.map +1 -0
- package/dist/technospam/components/editor/RunOutputPanel.d.ts +14 -0
- package/dist/technospam/components/editor/RunOutputPanel.d.ts.map +1 -0
- package/dist/technospam/components/editor/RunOutputPanel.js +127 -0
- package/dist/technospam/components/editor/RunOutputPanel.js.map +1 -0
- package/dist/technospam/components/editor/editorLanguages.d.ts +11 -0
- package/dist/technospam/components/editor/editorLanguages.d.ts.map +1 -0
- package/dist/technospam/components/editor/editorLanguages.js +30 -0
- package/dist/technospam/components/editor/editorLanguages.js.map +1 -0
- package/dist/technospam/components/editor/editorTheme.d.ts +11 -0
- package/dist/technospam/components/editor/editorTheme.d.ts.map +1 -0
- package/dist/technospam/components/editor/editorTheme.js +120 -0
- package/dist/technospam/components/editor/editorTheme.js.map +1 -0
- package/dist/technospam/hooks/useSolutionRunner.d.ts +35 -0
- package/dist/technospam/hooks/useSolutionRunner.d.ts.map +1 -0
- package/dist/technospam/hooks/useSolutionRunner.js +66 -0
- package/dist/technospam/hooks/useSolutionRunner.js.map +1 -0
- package/dist/technospam/hooks/useTechnoSpamAnalytics.d.ts +1 -1
- package/dist/technospam/hooks/useTechnoSpamAnalytics.d.ts.map +1 -1
- package/dist/technospam/hooks/useTechnoSpamAnalytics.js.map +1 -1
- package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.js +416 -263
- package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.js.map +1 -1
- package/package.json +14 -4
|
@@ -6,73 +6,76 @@ import { StatCard as a } from "../components/StatCard.js";
|
|
|
6
6
|
import { formatDateTime as o, humanizeEnum as s } from "../utils/format.js";
|
|
7
7
|
import { StatusBadge as c } from "../components/StatusBadge.js";
|
|
8
8
|
import { PremiumBadge as ee, UpgradeGate as l } from "../components/UpgradeGate.js";
|
|
9
|
-
import { EmptyView as te, ErrorView as
|
|
10
|
-
import { TagStrip as
|
|
11
|
-
import { CodePanel as
|
|
12
|
-
import { notify as
|
|
13
|
-
import { useProblemQuery as
|
|
14
|
-
import { SubmissionReviewPanel as
|
|
9
|
+
import { EmptyView as te, ErrorView as ne, LoadingRows as re } from "../components/StateViews.js";
|
|
10
|
+
import { TagStrip as ie } from "../components/TagStrip.js";
|
|
11
|
+
import { CodePanel as ae, IoBlock as oe, TestResultsPanel as se } from "../components/SubmissionViews.js";
|
|
12
|
+
import { notify as u } from "../lib/toast.js";
|
|
13
|
+
import { useProblemQuery as ce, useRegradeSubmission as le, useSubmissionsQuery as ue, useSubmitSolution as de } from "../api/technospamApi.js";
|
|
14
|
+
import { SubmissionReviewPanel as fe } from "../components/SubmissionReviewPanel.js";
|
|
15
|
+
import { TechnoSpamErrorBoundary as pe } from "../components/TechnoSpamErrorBoundary.js";
|
|
15
16
|
import "../components/index.js";
|
|
16
|
-
import { FOCUS_PARAMS as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
17
|
+
import { FOCUS_PARAMS as me } from "../utils/pageContext.js";
|
|
18
|
+
import { useSolutionRunner as he } from "../hooks/useSolutionRunner.js";
|
|
19
|
+
import { RunOutputPanel as ge } from "../components/editor/RunOutputPanel.js";
|
|
20
|
+
import { focusableCardProps as d, useFocusedRecordParam as _e } from "../hooks/useFocusedRecordParam.js";
|
|
21
|
+
import { Suspense as ve, lazy as f, useEffect as p, useMemo as ye, useRef as be, useState as m } from "react";
|
|
22
|
+
import { BookOpen as xe, Clock as h, Code2 as g, FileText as _, FlaskConical as Se, Layers as v, Play as Ce, RefreshCw as y, RotateCcw as we, Send as Te, Sparkles as Ee, Terminal as b, Trophy as x } from "lucide-react";
|
|
23
|
+
import { useSearchParams as De } from "react-router";
|
|
24
|
+
import { Fragment as Oe, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
25
|
+
import { Badge as ke, Button as w, GlassCard as T, Select as Ae, SelectContent as je, SelectItem as Me, SelectTrigger as Ne, SelectValue as Pe, Skeleton as E, Textarea as D } from "@burdenoff/fe-libs/ui";
|
|
23
26
|
//#region src/technospam/pages/ApplicationsProblemDetailsPagePage.tsx
|
|
24
|
-
var
|
|
27
|
+
var O = [
|
|
25
28
|
"javascript",
|
|
26
29
|
"python",
|
|
27
30
|
"typescript"
|
|
28
|
-
],
|
|
29
|
-
function
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
+
], Fe = f(() => import("../components/editor/CodeEditor.js")), Ie = 3e3, Le = 3 * 6e4;
|
|
32
|
+
function Re({ s: e, focused: t, onToggle: n }) {
|
|
33
|
+
return /* @__PURE__ */ C("div", {
|
|
31
34
|
className: r("cursor-pointer rounded-lg border border-transparent px-2 py-3 transition-colors hover:border-border-seam hover:bg-bg-sunken", t && "ring-2 ring-accent-primary"),
|
|
32
|
-
...
|
|
33
|
-
children: [/* @__PURE__ */
|
|
35
|
+
...d(t, n),
|
|
36
|
+
children: [/* @__PURE__ */ C("div", {
|
|
34
37
|
className: "flex flex-wrap items-center gap-x-4 gap-y-1",
|
|
35
38
|
children: [
|
|
36
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ S("button", {
|
|
37
40
|
type: "button",
|
|
38
41
|
"aria-pressed": t,
|
|
39
42
|
"aria-label": `Focus submission from ${o(e.createdAt)}`,
|
|
40
43
|
onClick: n,
|
|
41
44
|
className: "rounded-full",
|
|
42
|
-
children: /* @__PURE__ */
|
|
45
|
+
children: /* @__PURE__ */ S(c, { status: e.verdict })
|
|
43
46
|
}),
|
|
44
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ C("span", {
|
|
45
48
|
className: "inline-flex items-center gap-1 text-sm font-medium text-text-primary",
|
|
46
49
|
children: [
|
|
47
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ S(g, { size: 13 }),
|
|
48
51
|
" ",
|
|
49
52
|
s(e.language)
|
|
50
53
|
]
|
|
51
54
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ C("span", {
|
|
53
56
|
className: "inline-flex items-center gap-1 text-xs text-text-muted",
|
|
54
57
|
children: [
|
|
55
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ S(h, { size: 12 }),
|
|
56
59
|
" ",
|
|
57
60
|
e.runtimeMs,
|
|
58
61
|
" ms"
|
|
59
62
|
]
|
|
60
63
|
}),
|
|
61
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ C("span", {
|
|
62
65
|
className: "inline-flex items-center gap-1 text-xs text-text-muted",
|
|
63
66
|
children: [
|
|
64
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ S(x, { size: 12 }),
|
|
65
68
|
" ",
|
|
66
69
|
e.pointsAwarded,
|
|
67
70
|
" pts"
|
|
68
71
|
]
|
|
69
72
|
}),
|
|
70
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ S("span", {
|
|
71
74
|
className: "ml-auto text-xs text-text-muted",
|
|
72
75
|
children: o(e.createdAt)
|
|
73
76
|
})
|
|
74
77
|
]
|
|
75
|
-
}), e.totalCount > 0 ? /* @__PURE__ */
|
|
78
|
+
}), e.totalCount > 0 ? /* @__PURE__ */ C("p", {
|
|
76
79
|
className: "mt-1 px-0.5 text-xs text-text-muted",
|
|
77
80
|
children: [
|
|
78
81
|
"Passed ",
|
|
@@ -84,297 +87,286 @@ function De({ s: e, focused: t, onToggle: n }) {
|
|
|
84
87
|
}) : null]
|
|
85
88
|
});
|
|
86
89
|
}
|
|
87
|
-
function
|
|
88
|
-
let [
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
workspaceId:
|
|
92
|
-
entityId:
|
|
90
|
+
function k() {
|
|
91
|
+
let [o] = De(), d = o.get("id") ?? "", [f, k] = _e(me.submission), { currentUser: ze, workspaceId: A } = e(), Be = t(), Ve = ze?.id, { emit: j } = n(), { data: He, loading: Ue, error: M, refetch: N } = ce(d);
|
|
92
|
+
p(() => {
|
|
93
|
+
d && j("technospam.problem.viewed", {
|
|
94
|
+
workspaceId: A,
|
|
95
|
+
entityId: d,
|
|
93
96
|
entityType: "TEC_PROBLEM"
|
|
94
97
|
});
|
|
95
98
|
}, [
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
d,
|
|
100
|
+
A,
|
|
101
|
+
j
|
|
99
102
|
]);
|
|
100
|
-
let { data:
|
|
101
|
-
...
|
|
102
|
-
problemId:
|
|
103
|
-
}), [
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}, [
|
|
107
|
-
let
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
103
|
+
let { data: P, loading: We, error: F, refetch: I } = ue({
|
|
104
|
+
...Ve ? { learnerId: Ve } : {},
|
|
105
|
+
problemId: d
|
|
106
|
+
}), [Ge, { loading: L }] = de(), [Ke, { loading: R }] = le(), z = He?.tecProblem ?? null, B = ye(() => z?.languages?.length ? z.languages : O, [z]), [V, H] = m(""), [U, W] = m(""), [G, K] = m(!1), [qe, Je] = m(""), [q, Ye] = m("description"), J = he(), Xe = be(null), Ze = J.reset;
|
|
107
|
+
p(() => {
|
|
108
|
+
z && Xe.current !== z.id && (H(z.languages[0] ?? O[0]), W(z.starterCode ?? ""), Je(z.publicTestCases?.[0]?.input ?? ""), K(!1), Ze(), Xe.current = z.id);
|
|
109
|
+
}, [z, Ze]);
|
|
110
|
+
let Qe = (e) => {
|
|
111
|
+
H(e), J.reset();
|
|
112
|
+
}, Y = ye(() => [...P?.tecListSubmissions?.items ?? []].sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime()), [P]), $e = () => {
|
|
113
|
+
if (!(!d || J.running || J.warming || z?.isLocked)) {
|
|
114
|
+
if (!V) {
|
|
115
|
+
u.error("Pick a language", "Choose a language before running your code.");
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (!U.trim()) {
|
|
119
|
+
u.error("Add your solution", "Write some code before running it.");
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
j("technospam.problem.run_clicked", {
|
|
123
|
+
workspaceId: A,
|
|
124
|
+
entityId: d,
|
|
125
|
+
entityType: "TEC_PROBLEM",
|
|
126
|
+
language: V,
|
|
127
|
+
customInput: G
|
|
128
|
+
}), J.execute({
|
|
129
|
+
problemId: d,
|
|
130
|
+
language: V,
|
|
131
|
+
code: U,
|
|
132
|
+
stdin: G ? qe : null
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}, et = () => {
|
|
136
|
+
W(z?.starterCode ?? ""), J.reset();
|
|
137
|
+
}, tt = async () => {
|
|
138
|
+
if (!d || L || z?.isLocked) return;
|
|
139
|
+
if (!V) {
|
|
140
|
+
u.error("Pick a language", "Choose a language before submitting.");
|
|
111
141
|
return;
|
|
112
142
|
}
|
|
113
|
-
if (!
|
|
114
|
-
|
|
143
|
+
if (!U.trim()) {
|
|
144
|
+
u.error("Add your solution", "Write some code before submitting.");
|
|
115
145
|
return;
|
|
116
146
|
}
|
|
117
|
-
|
|
118
|
-
workspaceId:
|
|
119
|
-
entityId:
|
|
147
|
+
j("technospam.problem.submit_clicked", {
|
|
148
|
+
workspaceId: A,
|
|
149
|
+
entityId: d,
|
|
120
150
|
entityType: "TEC_PROBLEM",
|
|
121
|
-
language:
|
|
151
|
+
language: V
|
|
122
152
|
});
|
|
123
|
-
let e = await
|
|
124
|
-
problemId:
|
|
125
|
-
language:
|
|
126
|
-
code:
|
|
153
|
+
let e = await Ge({ variables: { input: {
|
|
154
|
+
problemId: d,
|
|
155
|
+
language: V,
|
|
156
|
+
code: U
|
|
127
157
|
} } });
|
|
128
158
|
if (e.data?.tecSubmitSolution) {
|
|
129
|
-
|
|
130
|
-
workspaceId:
|
|
131
|
-
entityId:
|
|
159
|
+
j("technospam.problem.submitted", {
|
|
160
|
+
workspaceId: A,
|
|
161
|
+
entityId: d,
|
|
132
162
|
entityType: "TEC_PROBLEM",
|
|
133
163
|
submissionId: e.data.tecSubmitSolution.id
|
|
134
164
|
});
|
|
135
165
|
let t = e.data.tecSubmitSolution;
|
|
136
|
-
t.verdict === "PENDING" ?
|
|
166
|
+
t.verdict === "PENDING" ? u.info("Solution submitted", "Grading has started — your verdict will appear here in a moment.") : t.verdict === "ACCEPTED" ? u.success("Accepted", `Passed all ${t.totalCount} test cases.`) : u.error(s(t.verdict), `Passed ${t.passedCount} of ${t.totalCount} test cases.`), await Promise.all([N(), I()]);
|
|
137
167
|
}
|
|
138
|
-
},
|
|
139
|
-
let t = (await
|
|
140
|
-
t && (t.verdict === "PENDING" ?
|
|
141
|
-
},
|
|
142
|
-
|
|
168
|
+
}, nt = async (e) => {
|
|
169
|
+
let t = (await Ke({ variables: { id: e } })).data?.tecRegradeSubmission;
|
|
170
|
+
t && (t.verdict === "PENDING" ? u.error("Still pending", "The grader is not available yet. Please try again shortly.") : u.success("Grading complete", `Verdict: ${s(t.verdict)}.`), await Promise.all([N(), I()]));
|
|
171
|
+
}, X = Y.find((e) => (e.testResults?.length ?? 0) > 0) ?? null, rt = Y[0] ?? null, Z = rt?.verdict === "PENDING" ? rt.id : null, [Q, it] = m(null), at = Z !== null && Q !== Z;
|
|
172
|
+
p(() => {
|
|
143
173
|
if (!Z || Q === Z) return;
|
|
144
174
|
let e = Date.now(), t = window.setInterval(() => {
|
|
145
|
-
if (Date.now() - e >
|
|
146
|
-
window.clearInterval(t),
|
|
175
|
+
if (Date.now() - e > Le) {
|
|
176
|
+
window.clearInterval(t), it(Z);
|
|
147
177
|
return;
|
|
148
178
|
}
|
|
149
|
-
|
|
150
|
-
},
|
|
179
|
+
I();
|
|
180
|
+
}, Ie);
|
|
151
181
|
return () => window.clearInterval(t);
|
|
152
182
|
}, [
|
|
153
183
|
Z,
|
|
154
184
|
Q,
|
|
155
|
-
|
|
185
|
+
I
|
|
156
186
|
]);
|
|
157
|
-
let $ =
|
|
158
|
-
return
|
|
187
|
+
let $ = be(null);
|
|
188
|
+
return p(() => {
|
|
159
189
|
if (Z) {
|
|
160
190
|
$.current = Z;
|
|
161
191
|
return;
|
|
162
192
|
}
|
|
163
193
|
let e = $.current;
|
|
164
194
|
if (!e) return;
|
|
165
|
-
let t =
|
|
166
|
-
!t || t.verdict === "PENDING" || ($.current = null, t.verdict === "ACCEPTED" ?
|
|
195
|
+
let t = Y.find((t) => t.id === e);
|
|
196
|
+
!t || t.verdict === "PENDING" || ($.current = null, t.verdict === "ACCEPTED" ? u.success("Accepted", `Passed all ${t.totalCount} test cases.`) : u.error(s(t.verdict), `Passed ${t.passedCount} of ${t.totalCount} test cases.`), N());
|
|
167
197
|
}, [
|
|
168
198
|
Z,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
]),
|
|
199
|
+
Y,
|
|
200
|
+
N
|
|
201
|
+
]), Ue && !z ? /* @__PURE__ */ C(i, {
|
|
172
202
|
title: "Problem",
|
|
173
203
|
backPath: "/applications/problems-page",
|
|
174
|
-
children: [/* @__PURE__ */
|
|
175
|
-
}) :
|
|
204
|
+
children: [/* @__PURE__ */ S(E, { className: "mb-4 h-28 w-full rounded-xl" }), /* @__PURE__ */ S(E, { className: "h-72 w-full rounded-xl" })]
|
|
205
|
+
}) : M || !z ? /* @__PURE__ */ S(i, {
|
|
176
206
|
title: "Problem",
|
|
177
207
|
backPath: "/applications/problems-page",
|
|
178
|
-
children:
|
|
208
|
+
children: M ? /* @__PURE__ */ S(ne, {
|
|
179
209
|
title: "Couldn't load problem",
|
|
180
|
-
error:
|
|
181
|
-
}) : /* @__PURE__ */
|
|
210
|
+
error: M
|
|
211
|
+
}) : /* @__PURE__ */ S(te, {
|
|
182
212
|
title: "Problem not found",
|
|
183
213
|
description: "This problem may have been unpublished."
|
|
184
214
|
})
|
|
185
|
-
}) : /* @__PURE__ */
|
|
215
|
+
}) : /* @__PURE__ */ C(i, {
|
|
186
216
|
hero: !0,
|
|
187
217
|
backPath: "/applications/problems-page",
|
|
188
|
-
title:
|
|
189
|
-
description:
|
|
218
|
+
title: z.title,
|
|
219
|
+
description: z.topic ?? void 0,
|
|
190
220
|
children: [
|
|
191
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ C("div", {
|
|
192
222
|
className: "mb-5 flex flex-wrap items-center gap-2",
|
|
193
223
|
children: [
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
-
status:
|
|
224
|
+
/* @__PURE__ */ S(c, {
|
|
225
|
+
status: z.difficulty,
|
|
196
226
|
kind: "level"
|
|
197
227
|
}),
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
|
|
228
|
+
/* @__PURE__ */ S(c, { status: z.status }),
|
|
229
|
+
z.topic ? /* @__PURE__ */ C(ke, {
|
|
200
230
|
variant: "outline",
|
|
201
231
|
className: "gap-1",
|
|
202
232
|
children: [
|
|
203
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ S(v, { size: 12 }),
|
|
204
234
|
" ",
|
|
205
|
-
|
|
235
|
+
z.topic
|
|
206
236
|
]
|
|
207
237
|
}) : null,
|
|
208
|
-
|
|
209
|
-
/* @__PURE__ */
|
|
238
|
+
z.isPremiumOnly ? /* @__PURE__ */ S(ee, { locked: z.isLocked }) : null,
|
|
239
|
+
/* @__PURE__ */ S(ie, { tags: z.tags })
|
|
210
240
|
]
|
|
211
241
|
}),
|
|
212
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ C("div", {
|
|
213
243
|
className: "mb-6 grid grid-cols-2 gap-3 sm:grid-cols-4",
|
|
214
244
|
children: [
|
|
215
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ S(a, {
|
|
216
246
|
label: "Points",
|
|
217
|
-
value:
|
|
218
|
-
icon:
|
|
247
|
+
value: z.points,
|
|
248
|
+
icon: x,
|
|
219
249
|
tone: "amber"
|
|
220
250
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ S(a, {
|
|
222
252
|
label: "Languages",
|
|
223
|
-
value:
|
|
224
|
-
icon:
|
|
253
|
+
value: B.length,
|
|
254
|
+
icon: g,
|
|
225
255
|
tone: "blue"
|
|
226
256
|
}),
|
|
227
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ S(a, {
|
|
228
258
|
label: "Difficulty",
|
|
229
|
-
value: s(
|
|
230
|
-
icon:
|
|
259
|
+
value: s(z.difficulty),
|
|
260
|
+
icon: v,
|
|
231
261
|
tone: "purple"
|
|
232
262
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
263
|
+
/* @__PURE__ */ S(a, {
|
|
234
264
|
label: "My submissions",
|
|
235
|
-
value:
|
|
236
|
-
icon:
|
|
265
|
+
value: Y.length,
|
|
266
|
+
icon: _,
|
|
237
267
|
tone: "teal"
|
|
238
268
|
})
|
|
239
269
|
]
|
|
240
270
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
271
|
+
/* @__PURE__ */ S("div", {
|
|
272
|
+
role: "tablist",
|
|
273
|
+
"aria-label": "Problem sections",
|
|
274
|
+
className: "mb-4 grid grid-cols-2 gap-1 rounded-xl border border-border-seam bg-bg-sunken p-1 lg:hidden",
|
|
275
|
+
children: [{
|
|
276
|
+
pane: "description",
|
|
277
|
+
label: "Description",
|
|
278
|
+
icon: xe
|
|
279
|
+
}, {
|
|
280
|
+
pane: "solution",
|
|
281
|
+
label: "Solution",
|
|
282
|
+
icon: g
|
|
283
|
+
}].map(({ pane: e, label: t, icon: n }) => /* @__PURE__ */ C("button", {
|
|
284
|
+
type: "button",
|
|
285
|
+
role: "tab",
|
|
286
|
+
id: `problem-tab-${e}`,
|
|
287
|
+
"aria-selected": q === e,
|
|
288
|
+
"aria-controls": `problem-pane-${e}`,
|
|
289
|
+
onClick: () => Ye(e),
|
|
290
|
+
className: r("inline-flex items-center justify-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus", q === e ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"),
|
|
245
291
|
children: [
|
|
246
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ S(n, { size: 14 }),
|
|
293
|
+
" ",
|
|
294
|
+
t
|
|
295
|
+
]
|
|
296
|
+
}, e))
|
|
297
|
+
}),
|
|
298
|
+
/* @__PURE__ */ C("div", {
|
|
299
|
+
className: "grid grid-cols-1 gap-5 lg:grid-cols-2",
|
|
300
|
+
children: [/* @__PURE__ */ C("div", {
|
|
301
|
+
id: "problem-pane-description",
|
|
302
|
+
role: "tabpanel",
|
|
303
|
+
"aria-labelledby": "problem-tab-description",
|
|
304
|
+
className: r("min-w-0 space-y-5", q !== "description" && "hidden lg:block"),
|
|
305
|
+
children: [
|
|
306
|
+
/* @__PURE__ */ C(T, {
|
|
247
307
|
className: "p-5",
|
|
248
|
-
children: [/* @__PURE__ */
|
|
308
|
+
children: [/* @__PURE__ */ S("h2", {
|
|
249
309
|
className: "mb-2 text-base font-semibold text-text-primary",
|
|
250
310
|
children: "Problem statement"
|
|
251
|
-
}),
|
|
311
|
+
}), z.isLocked ? /* @__PURE__ */ S(l, { description: "This problem's statement is part of a paid TechnoSpam plan. Ask a workspace admin to upgrade to unlock it." }) : z.statement ? /* @__PURE__ */ S("p", {
|
|
252
312
|
className: "whitespace-pre-wrap text-sm leading-relaxed text-text-secondary",
|
|
253
|
-
children:
|
|
254
|
-
}) : /* @__PURE__ */
|
|
313
|
+
children: z.statement
|
|
314
|
+
}) : /* @__PURE__ */ S("p", {
|
|
255
315
|
className: "py-4 text-center text-sm text-text-muted",
|
|
256
316
|
children: "The statement for this problem is being prepared."
|
|
257
317
|
})]
|
|
258
318
|
}),
|
|
259
|
-
|
|
319
|
+
z.isLocked ? /* @__PURE__ */ S(l, {
|
|
260
320
|
compact: !0,
|
|
261
321
|
description: "Starter code and sample test cases unlock with a paid TechnoSpam plan."
|
|
262
|
-
}) : V.starterCode ? /* @__PURE__ */ T(D, {
|
|
263
|
-
className: "p-5",
|
|
264
|
-
children: [/* @__PURE__ */ w("h2", {
|
|
265
|
-
className: "mb-3 text-base font-semibold text-text-primary",
|
|
266
|
-
children: "Starter code"
|
|
267
|
-
}), /* @__PURE__ */ w(ie, {
|
|
268
|
-
label: s(H[0] ?? "code"),
|
|
269
|
-
bodyClassName: "max-h-72",
|
|
270
|
-
children: V.starterCode
|
|
271
|
-
})]
|
|
272
322
|
}) : null,
|
|
273
|
-
/* @__PURE__ */ T
|
|
274
|
-
className: "p-5",
|
|
275
|
-
children: [
|
|
276
|
-
/* @__PURE__ */ T("div", {
|
|
277
|
-
className: "mb-3 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
|
|
278
|
-
children: [/* @__PURE__ */ w("h2", {
|
|
279
|
-
className: "text-base font-semibold text-text-primary",
|
|
280
|
-
children: "Submit a solution"
|
|
281
|
-
}), /* @__PURE__ */ T("div", {
|
|
282
|
-
className: "flex items-center gap-2",
|
|
283
|
-
children: [/* @__PURE__ */ w("span", {
|
|
284
|
-
className: "text-sm text-text-secondary",
|
|
285
|
-
children: "Language"
|
|
286
|
-
}), /* @__PURE__ */ T(ye, {
|
|
287
|
-
value: U,
|
|
288
|
-
onValueChange: W,
|
|
289
|
-
children: [/* @__PURE__ */ w(Se, {
|
|
290
|
-
className: "w-full sm:w-48",
|
|
291
|
-
"aria-label": "Language",
|
|
292
|
-
children: /* @__PURE__ */ w(Ce, { placeholder: "Choose a language" })
|
|
293
|
-
}), /* @__PURE__ */ w(be, { children: H.map((e) => /* @__PURE__ */ w(xe, {
|
|
294
|
-
value: e,
|
|
295
|
-
children: s(e)
|
|
296
|
-
}, e)) })]
|
|
297
|
-
})]
|
|
298
|
-
})]
|
|
299
|
-
}),
|
|
300
|
-
/* @__PURE__ */ T("div", {
|
|
301
|
-
className: "overflow-hidden rounded-xl border border-border-strong bg-bg-sunken shadow-sm",
|
|
302
|
-
children: [/* @__PURE__ */ T("div", {
|
|
303
|
-
className: "flex items-center justify-between gap-2 border-b border-border-seam bg-bg-canvas/40 px-4 py-2",
|
|
304
|
-
children: [/* @__PURE__ */ T("div", {
|
|
305
|
-
className: "flex items-center gap-1.5",
|
|
306
|
-
children: [
|
|
307
|
-
/* @__PURE__ */ w("span", { className: "h-2.5 w-2.5 rounded-full bg-status-error-border" }),
|
|
308
|
-
/* @__PURE__ */ w("span", { className: "h-2.5 w-2.5 rounded-full bg-status-warning-border" }),
|
|
309
|
-
/* @__PURE__ */ w("span", { className: "h-2.5 w-2.5 rounded-full bg-status-success-border" })
|
|
310
|
-
]
|
|
311
|
-
}), /* @__PURE__ */ T("span", {
|
|
312
|
-
className: "inline-flex items-center gap-1.5 font-mono text-xs text-text-secondary",
|
|
313
|
-
children: [
|
|
314
|
-
/* @__PURE__ */ w(y, { size: 13 }),
|
|
315
|
-
" ",
|
|
316
|
-
U ? s(U) : "solution"
|
|
317
|
-
]
|
|
318
|
-
})]
|
|
319
|
-
}), /* @__PURE__ */ w(we, {
|
|
320
|
-
value: G,
|
|
321
|
-
onChange: (e) => K(e.target.value),
|
|
322
|
-
placeholder: "Write your solution…",
|
|
323
|
-
className: "min-h-[280px] resize-y rounded-none border-0 bg-transparent font-mono text-xs leading-relaxed focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
324
|
-
spellCheck: !1
|
|
325
|
-
})]
|
|
326
|
-
}),
|
|
327
|
-
/* @__PURE__ */ T(E, {
|
|
328
|
-
className: "mt-4 w-full",
|
|
329
|
-
onClick: Fe,
|
|
330
|
-
disabled: z || !G.trim(),
|
|
331
|
-
children: [
|
|
332
|
-
/* @__PURE__ */ w(me, { size: 16 }),
|
|
333
|
-
" ",
|
|
334
|
-
z ? "Running test cases…" : "Run & submit"
|
|
335
|
-
]
|
|
336
|
-
}),
|
|
337
|
-
/* @__PURE__ */ w("p", {
|
|
338
|
-
className: "mt-2 text-center text-xs text-text-muted",
|
|
339
|
-
children: "Your code runs against this problem's test cases in an isolated sandbox."
|
|
340
|
-
})
|
|
341
|
-
]
|
|
342
|
-
}),
|
|
343
|
-
V.publicTestCases?.length ? /* @__PURE__ */ T(D, {
|
|
323
|
+
z.publicTestCases?.length ? /* @__PURE__ */ C(T, {
|
|
344
324
|
className: "p-5",
|
|
345
325
|
children: [
|
|
346
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ C("h2", {
|
|
347
327
|
className: "mb-1 flex items-center gap-2 text-base font-semibold text-text-primary",
|
|
348
|
-
children: [/* @__PURE__ */
|
|
328
|
+
children: [/* @__PURE__ */ S(Se, { size: 16 }), " Sample test cases"]
|
|
349
329
|
}),
|
|
350
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ C("p", {
|
|
351
331
|
className: "mb-3 text-sm text-text-secondary",
|
|
352
|
-
children:
|
|
332
|
+
children: [
|
|
333
|
+
"Your solution reads each input from stdin and must print the expected output.",
|
|
334
|
+
/* @__PURE__ */ S("strong", {
|
|
335
|
+
className: "font-medium text-text-primary",
|
|
336
|
+
children: " Run"
|
|
337
|
+
}),
|
|
338
|
+
" checks these samples; ",
|
|
339
|
+
/* @__PURE__ */ S("strong", {
|
|
340
|
+
className: "font-medium text-text-primary",
|
|
341
|
+
children: "Submit"
|
|
342
|
+
}),
|
|
343
|
+
" also runs the hidden test cases."
|
|
344
|
+
]
|
|
353
345
|
}),
|
|
354
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ S("div", {
|
|
355
347
|
className: "space-y-3",
|
|
356
|
-
children:
|
|
348
|
+
children: z.publicTestCases.map((e) => /* @__PURE__ */ C("div", {
|
|
357
349
|
className: "rounded-xl border border-border-seam p-3",
|
|
358
|
-
children: [/* @__PURE__ */
|
|
350
|
+
children: [/* @__PURE__ */ C("div", {
|
|
359
351
|
className: "mb-2 flex flex-wrap items-center gap-x-3 gap-y-1",
|
|
360
|
-
children: [/* @__PURE__ */
|
|
352
|
+
children: [/* @__PURE__ */ S("span", {
|
|
361
353
|
className: "text-sm font-medium text-text-primary",
|
|
362
354
|
children: e.name
|
|
363
|
-
}), /* @__PURE__ */
|
|
355
|
+
}), /* @__PURE__ */ C("span", {
|
|
364
356
|
className: "inline-flex items-center gap-1 text-xs text-text-muted",
|
|
365
357
|
children: [
|
|
366
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ S(h, { size: 12 }),
|
|
367
359
|
" ",
|
|
368
360
|
e.timeLimitMs,
|
|
369
361
|
" ms limit"
|
|
370
362
|
]
|
|
371
363
|
})]
|
|
372
|
-
}), /* @__PURE__ */
|
|
364
|
+
}), /* @__PURE__ */ C("div", {
|
|
373
365
|
className: "grid grid-cols-1 gap-2 sm:grid-cols-2",
|
|
374
|
-
children: [/* @__PURE__ */
|
|
366
|
+
children: [/* @__PURE__ */ S(oe, {
|
|
375
367
|
label: "Input",
|
|
376
368
|
value: e.input
|
|
377
|
-
}), /* @__PURE__ */
|
|
369
|
+
}), /* @__PURE__ */ S(oe, {
|
|
378
370
|
label: "Expected output",
|
|
379
371
|
value: e.expectedOutput
|
|
380
372
|
})]
|
|
@@ -383,83 +375,244 @@ function A() {
|
|
|
383
375
|
})
|
|
384
376
|
]
|
|
385
377
|
}) : null,
|
|
386
|
-
|
|
378
|
+
!z.isLocked && z.starterCode ? /* @__PURE__ */ C(T, {
|
|
379
|
+
className: "p-5",
|
|
380
|
+
children: [/* @__PURE__ */ S("h2", {
|
|
381
|
+
className: "mb-3 text-base font-semibold text-text-primary",
|
|
382
|
+
children: "Starter code"
|
|
383
|
+
}), /* @__PURE__ */ S(ae, {
|
|
384
|
+
label: s(B[0] ?? "code"),
|
|
385
|
+
bodyClassName: "max-h-72",
|
|
386
|
+
children: z.starterCode
|
|
387
|
+
})]
|
|
388
|
+
}) : null
|
|
389
|
+
]
|
|
390
|
+
}), /* @__PURE__ */ C("div", {
|
|
391
|
+
id: "problem-pane-solution",
|
|
392
|
+
role: "tabpanel",
|
|
393
|
+
"aria-labelledby": "problem-tab-solution",
|
|
394
|
+
className: r("min-w-0 space-y-5", q !== "solution" && "hidden lg:block"),
|
|
395
|
+
children: [
|
|
396
|
+
/* @__PURE__ */ C(T, {
|
|
397
|
+
className: "p-5",
|
|
398
|
+
children: [
|
|
399
|
+
/* @__PURE__ */ C("div", {
|
|
400
|
+
className: "mb-3 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
|
|
401
|
+
children: [/* @__PURE__ */ C("h2", {
|
|
402
|
+
className: "inline-flex items-center gap-2 text-base font-semibold text-text-primary",
|
|
403
|
+
children: [/* @__PURE__ */ S(g, { size: 16 }), " Solve"]
|
|
404
|
+
}), /* @__PURE__ */ C("div", {
|
|
405
|
+
className: "flex items-center gap-2",
|
|
406
|
+
children: [
|
|
407
|
+
/* @__PURE__ */ S("span", {
|
|
408
|
+
className: "text-sm text-text-secondary",
|
|
409
|
+
children: "Language"
|
|
410
|
+
}),
|
|
411
|
+
/* @__PURE__ */ C(Ae, {
|
|
412
|
+
value: V,
|
|
413
|
+
onValueChange: Qe,
|
|
414
|
+
children: [/* @__PURE__ */ S(Ne, {
|
|
415
|
+
className: "w-full sm:w-44",
|
|
416
|
+
"aria-label": "Language",
|
|
417
|
+
children: /* @__PURE__ */ S(Pe, { placeholder: "Choose a language" })
|
|
418
|
+
}), /* @__PURE__ */ S(je, { children: B.map((e) => /* @__PURE__ */ S(Me, {
|
|
419
|
+
value: e,
|
|
420
|
+
children: s(e)
|
|
421
|
+
}, e)) })]
|
|
422
|
+
}),
|
|
423
|
+
/* @__PURE__ */ S(w, {
|
|
424
|
+
variant: "ghost",
|
|
425
|
+
size: "icon",
|
|
426
|
+
onClick: et,
|
|
427
|
+
"aria-label": "Reset to starter code",
|
|
428
|
+
title: "Reset to starter code",
|
|
429
|
+
children: /* @__PURE__ */ S(we, { size: 16 })
|
|
430
|
+
})
|
|
431
|
+
]
|
|
432
|
+
})]
|
|
433
|
+
}),
|
|
434
|
+
/* @__PURE__ */ C("div", {
|
|
435
|
+
className: "overflow-hidden rounded-xl border border-border-strong bg-bg-sunken shadow-sm focus-within:ring-2 focus-within:ring-border-focus",
|
|
436
|
+
children: [/* @__PURE__ */ C("div", {
|
|
437
|
+
className: "flex items-center justify-between gap-2 border-b border-border-seam bg-bg-canvas/40 px-4 py-2",
|
|
438
|
+
children: [/* @__PURE__ */ C("div", {
|
|
439
|
+
className: "flex items-center gap-1.5",
|
|
440
|
+
"aria-hidden": "true",
|
|
441
|
+
children: [
|
|
442
|
+
/* @__PURE__ */ S("span", { className: "h-2.5 w-2.5 rounded-full bg-status-error-border" }),
|
|
443
|
+
/* @__PURE__ */ S("span", { className: "h-2.5 w-2.5 rounded-full bg-status-warning-border" }),
|
|
444
|
+
/* @__PURE__ */ S("span", { className: "h-2.5 w-2.5 rounded-full bg-status-success-border" })
|
|
445
|
+
]
|
|
446
|
+
}), /* @__PURE__ */ C("span", {
|
|
447
|
+
className: "inline-flex items-center gap-1.5 font-mono text-xs text-text-secondary",
|
|
448
|
+
children: [
|
|
449
|
+
/* @__PURE__ */ S(g, { size: 13 }),
|
|
450
|
+
" ",
|
|
451
|
+
V ? s(V) : "solution"
|
|
452
|
+
]
|
|
453
|
+
})]
|
|
454
|
+
}), /* @__PURE__ */ S(pe, {
|
|
455
|
+
fallback: /* @__PURE__ */ S(D, {
|
|
456
|
+
value: U,
|
|
457
|
+
onChange: (e) => W(e.target.value),
|
|
458
|
+
"aria-label": `Solution code${V ? ` (${s(V)})` : ""}`,
|
|
459
|
+
placeholder: "Write your solution…",
|
|
460
|
+
spellCheck: !1,
|
|
461
|
+
className: "h-[360px] resize-none rounded-none border-0 font-mono text-xs lg:h-[440px]"
|
|
462
|
+
}),
|
|
463
|
+
children: /* @__PURE__ */ S(ve, {
|
|
464
|
+
fallback: /* @__PURE__ */ S(E, { className: "h-[360px] w-full rounded-none lg:h-[440px]" }),
|
|
465
|
+
children: /* @__PURE__ */ S(Fe, {
|
|
466
|
+
value: U,
|
|
467
|
+
onChange: W,
|
|
468
|
+
language: V,
|
|
469
|
+
ariaLabel: `Solution code${V ? ` (${s(V)})` : ""}`,
|
|
470
|
+
placeholder: "Write your solution…",
|
|
471
|
+
onRun: $e,
|
|
472
|
+
onSubmit: () => void tt(),
|
|
473
|
+
className: "h-[360px] text-xs lg:h-[440px]"
|
|
474
|
+
})
|
|
475
|
+
})
|
|
476
|
+
})]
|
|
477
|
+
}),
|
|
478
|
+
/* @__PURE__ */ C("div", {
|
|
479
|
+
className: "mt-3",
|
|
480
|
+
children: [/* @__PURE__ */ C("label", {
|
|
481
|
+
className: "inline-flex cursor-pointer items-center gap-2 text-sm text-text-secondary",
|
|
482
|
+
children: [
|
|
483
|
+
/* @__PURE__ */ S("input", {
|
|
484
|
+
type: "checkbox",
|
|
485
|
+
checked: G,
|
|
486
|
+
onChange: (e) => K(e.target.checked),
|
|
487
|
+
className: "h-4 w-4 rounded border-border-strong accent-current"
|
|
488
|
+
}),
|
|
489
|
+
/* @__PURE__ */ S(b, { size: 14 }),
|
|
490
|
+
" Run with custom input"
|
|
491
|
+
]
|
|
492
|
+
}), G ? /* @__PURE__ */ S(D, {
|
|
493
|
+
value: qe,
|
|
494
|
+
onChange: (e) => Je(e.target.value),
|
|
495
|
+
"aria-label": "Custom input (stdin)",
|
|
496
|
+
placeholder: "Input passed to your program on stdin",
|
|
497
|
+
className: "mt-2 min-h-[88px] font-mono text-xs",
|
|
498
|
+
spellCheck: !1
|
|
499
|
+
}) : null]
|
|
500
|
+
}),
|
|
501
|
+
/* @__PURE__ */ C("div", {
|
|
502
|
+
className: "mt-4 grid grid-cols-2 gap-2",
|
|
503
|
+
children: [/* @__PURE__ */ C(w, {
|
|
504
|
+
variant: "outline",
|
|
505
|
+
onClick: $e,
|
|
506
|
+
disabled: J.running || J.warming || !U.trim() || !!z.isLocked,
|
|
507
|
+
children: [
|
|
508
|
+
/* @__PURE__ */ S(Ce, { size: 16 }),
|
|
509
|
+
" ",
|
|
510
|
+
J.warming ? "Starting…" : J.running ? "Running…" : "Run"
|
|
511
|
+
]
|
|
512
|
+
}), /* @__PURE__ */ C(w, {
|
|
513
|
+
onClick: () => void tt(),
|
|
514
|
+
disabled: L || !U.trim() || !!z.isLocked,
|
|
515
|
+
children: [
|
|
516
|
+
/* @__PURE__ */ S(Te, { size: 16 }),
|
|
517
|
+
" ",
|
|
518
|
+
L ? "Submitting…" : "Submit"
|
|
519
|
+
]
|
|
520
|
+
})]
|
|
521
|
+
}),
|
|
522
|
+
/* @__PURE__ */ S("p", {
|
|
523
|
+
className: "mt-2 text-center text-xs text-text-muted",
|
|
524
|
+
children: "Code runs in an isolated sandbox. Ctrl/⌘+Enter runs, Ctrl/⌘+Shift+Enter submits; press Esc then Tab to leave the editor."
|
|
525
|
+
})
|
|
526
|
+
]
|
|
527
|
+
}),
|
|
528
|
+
/* @__PURE__ */ C(T, {
|
|
529
|
+
className: "p-5",
|
|
530
|
+
"aria-live": "polite",
|
|
531
|
+
children: [/* @__PURE__ */ C("h2", {
|
|
532
|
+
className: "mb-3 flex items-center gap-2 text-base font-semibold text-text-primary",
|
|
533
|
+
children: [/* @__PURE__ */ S(b, { size: 16 }), " Run output"]
|
|
534
|
+
}), /* @__PURE__ */ S(ge, {
|
|
535
|
+
run: J.run,
|
|
536
|
+
running: J.running,
|
|
537
|
+
warming: J.warming,
|
|
538
|
+
error: J.error
|
|
539
|
+
})]
|
|
540
|
+
}),
|
|
541
|
+
Z ? /* @__PURE__ */ C(T, {
|
|
387
542
|
className: "p-5",
|
|
388
543
|
children: [
|
|
389
|
-
/* @__PURE__ */
|
|
544
|
+
/* @__PURE__ */ S("h2", {
|
|
390
545
|
className: "mb-2 text-base font-semibold text-text-primary",
|
|
391
|
-
children: "Latest
|
|
546
|
+
children: "Latest submission"
|
|
392
547
|
}),
|
|
393
|
-
|
|
548
|
+
at ? /* @__PURE__ */ C("p", {
|
|
394
549
|
className: "mb-3 inline-flex items-center gap-2 text-sm text-text-secondary",
|
|
395
|
-
children: [/* @__PURE__ */
|
|
550
|
+
children: [/* @__PURE__ */ S(y, {
|
|
396
551
|
size: 14,
|
|
397
552
|
className: "animate-spin"
|
|
398
553
|
}), "Grading your submission — the grader is starting up. Your verdict will appear here automatically."]
|
|
399
|
-
}) : /* @__PURE__ */
|
|
554
|
+
}) : /* @__PURE__ */ S("p", {
|
|
400
555
|
className: "mb-3 text-sm text-text-secondary",
|
|
401
556
|
children: "Your most recent submission has not been graded yet — the grader was unavailable. You can re-run it without resubmitting your code."
|
|
402
557
|
}),
|
|
403
|
-
/* @__PURE__ */
|
|
558
|
+
/* @__PURE__ */ C(w, {
|
|
404
559
|
variant: "outline",
|
|
405
|
-
onClick: () => void
|
|
406
|
-
disabled:
|
|
560
|
+
onClick: () => void nt(Z),
|
|
561
|
+
disabled: R,
|
|
407
562
|
children: [
|
|
408
|
-
/* @__PURE__ */
|
|
563
|
+
/* @__PURE__ */ S(y, { size: 16 }),
|
|
409
564
|
" ",
|
|
410
|
-
|
|
565
|
+
R ? "Re-running…" : "Re-run grader"
|
|
411
566
|
]
|
|
412
567
|
})
|
|
413
568
|
]
|
|
414
|
-
}) :
|
|
569
|
+
}) : X ? /* @__PURE__ */ C(Oe, { children: [/* @__PURE__ */ C(T, {
|
|
415
570
|
className: "p-5",
|
|
416
|
-
children: [/* @__PURE__ */
|
|
571
|
+
children: [/* @__PURE__ */ S("h2", {
|
|
417
572
|
className: "mb-3 text-base font-semibold text-text-primary",
|
|
418
|
-
children: "Latest
|
|
419
|
-
}), /* @__PURE__ */
|
|
420
|
-
}), /* @__PURE__ */ T
|
|
573
|
+
children: "Latest submission"
|
|
574
|
+
}), /* @__PURE__ */ S(se, { submission: X })]
|
|
575
|
+
}), /* @__PURE__ */ C(T, {
|
|
421
576
|
className: "p-5",
|
|
422
|
-
children: [/* @__PURE__ */
|
|
577
|
+
children: [/* @__PURE__ */ C("h2", {
|
|
423
578
|
className: "mb-3 flex items-center gap-2 text-base font-semibold text-text-primary",
|
|
424
|
-
children: [/* @__PURE__ */
|
|
425
|
-
}), /* @__PURE__ */
|
|
426
|
-
submission:
|
|
427
|
-
onOpenProblem: (e) =>
|
|
579
|
+
children: [/* @__PURE__ */ S(Ee, { size: 16 }), " TechnoSage review"]
|
|
580
|
+
}), /* @__PURE__ */ S(fe, {
|
|
581
|
+
submission: X,
|
|
582
|
+
onOpenProblem: (e) => Be(`/applications/problem-details-page?id=${e}`)
|
|
428
583
|
})]
|
|
429
|
-
})] }) : null
|
|
584
|
+
})] }) : null,
|
|
585
|
+
/* @__PURE__ */ C(T, {
|
|
586
|
+
className: "p-5",
|
|
587
|
+
children: [/* @__PURE__ */ S("h2", {
|
|
588
|
+
className: "mb-3 text-base font-semibold text-text-primary",
|
|
589
|
+
children: "My submissions"
|
|
590
|
+
}), We && !Y.length ? /* @__PURE__ */ S(re, {
|
|
591
|
+
count: 3,
|
|
592
|
+
height: "h-12"
|
|
593
|
+
}) : F ? /* @__PURE__ */ S(ne, {
|
|
594
|
+
title: "Couldn't load submissions",
|
|
595
|
+
error: F
|
|
596
|
+
}) : Y.length === 0 ? /* @__PURE__ */ S(te, {
|
|
597
|
+
icon: /* @__PURE__ */ S(_, { size: 24 }),
|
|
598
|
+
title: "No submissions yet",
|
|
599
|
+
description: "Submit a solution to see your verdicts and points here."
|
|
600
|
+
}) : /* @__PURE__ */ S("div", {
|
|
601
|
+
className: "space-y-1",
|
|
602
|
+
children: Y.map((e) => /* @__PURE__ */ S(Re, {
|
|
603
|
+
s: e,
|
|
604
|
+
focused: f === e.id,
|
|
605
|
+
onToggle: () => k(f === e.id ? null : e.id)
|
|
606
|
+
}, e.id))
|
|
607
|
+
})]
|
|
608
|
+
})
|
|
430
609
|
]
|
|
431
|
-
}), /* @__PURE__ */ w("div", {
|
|
432
|
-
className: "lg:col-span-1",
|
|
433
|
-
children: /* @__PURE__ */ T(D, {
|
|
434
|
-
className: "p-5",
|
|
435
|
-
children: [/* @__PURE__ */ w("h2", {
|
|
436
|
-
className: "mb-3 text-base font-semibold text-text-primary",
|
|
437
|
-
children: "My submissions"
|
|
438
|
-
}), Me && !J.length ? /* @__PURE__ */ w(ne, {
|
|
439
|
-
count: 3,
|
|
440
|
-
height: "h-12"
|
|
441
|
-
}) : L ? /* @__PURE__ */ w(u, {
|
|
442
|
-
title: "Couldn't load submissions",
|
|
443
|
-
error: L
|
|
444
|
-
}) : J.length === 0 ? /* @__PURE__ */ w(te, {
|
|
445
|
-
icon: /* @__PURE__ */ w(b, { size: 24 }),
|
|
446
|
-
title: "No submissions yet",
|
|
447
|
-
description: "Submit a solution above to see your verdicts and points here."
|
|
448
|
-
}) : /* @__PURE__ */ w("div", {
|
|
449
|
-
className: "space-y-1",
|
|
450
|
-
children: J.map((e) => /* @__PURE__ */ w(De, {
|
|
451
|
-
s: e,
|
|
452
|
-
focused: p === e.id,
|
|
453
|
-
onToggle: () => A(p === e.id ? null : e.id)
|
|
454
|
-
}, e.id))
|
|
455
|
-
})]
|
|
456
|
-
})
|
|
457
610
|
})]
|
|
458
611
|
})
|
|
459
612
|
]
|
|
460
613
|
});
|
|
461
614
|
}
|
|
462
615
|
//#endregion
|
|
463
|
-
export {
|
|
616
|
+
export { k as ApplicationsProblemDetailsPagePage };
|
|
464
617
|
|
|
465
618
|
//# sourceMappingURL=ApplicationsProblemDetailsPagePage.js.map
|