@instructure/platform-assignment-review 0.1.0 → 0.3.0

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/index.js CHANGED
@@ -1,66 +1,586 @@
1
- import { jsx as r, jsxs as S } from "react/jsx-runtime";
2
- import { Flex as g } from "@instructure/ui-flex";
3
- import { Pill as lt } from "@instructure/ui-pill";
1
+ import { jsx as i, jsxs as _ } from "react/jsx-runtime";
2
+ import { createContext as In, useContext as Cn, useMemo as je, useState as ge, useRef as Dn, useEffect as ct, useCallback as Rn } from "react";
3
+ import { Flex as h } from "@instructure/ui-flex";
4
+ import { Heading as dt } from "@instructure/ui-heading";
5
+ import { Spinner as He } from "@instructure/ui-spinner";
4
6
  import { Text as y } from "@instructure/ui-text";
5
- import { View as Z } from "@instructure/ui-view";
6
- import { useTranslation as B } from "react-i18next";
7
- import { Spinner as ct } from "@instructure/ui-spinner";
8
- import { useQuery as Ue, useQueryClient as Bt, useMutation as Wt } from "@tanstack/react-query";
9
- import J from "graphql-tag";
7
+ import { View as Y } from "@instructure/ui-view";
8
+ import { useQuery as $e, useQueryClient as Xt, useMutation as Kt } from "@tanstack/react-query";
9
+ import ne from "graphql-tag";
10
10
  import { z as n } from "zod";
11
- import { Heading as qt } from "@instructure/ui-heading";
12
- import { IconDownloadLine as An, IconCheckMarkSolid as En, IconTrashLine as In, IconArrowOpenStartLine as Yt, IconArrowOpenEndLine as Xt, IconXLine as Cn, IconLockLine as Kt, IconDocumentLine as kt, IconLinkLine as Dn, IconDiscussionLine as Rn, IconQuizLine as wn, IconAssignmentLine as vn, IconArrowStartLine as Ln, IconArrowEndLine as Nn } from "@instructure/ui-icons";
13
- import { useMemo as ot, useState as Fe, useRef as On, useEffect as Mn } from "react";
14
- import { ScreenReaderContent as mt } from "@instructure/ui-a11y-content";
15
- import { Link as xn } from "@instructure/ui-link";
16
- import { TruncateText as Vt } from "@instructure/ui-truncate-text";
17
- import { Badge as Zt } from "@instructure/ui-badge";
18
- import { Button as P, IconButton as kn } from "@instructure/ui-buttons";
19
- import { Tooltip as Pn } from "@instructure/ui-tooltip";
20
- import { TextArea as Qt } from "@instructure/ui-text-area";
21
- function Fn(t) {
22
- if (!t) return "";
23
- const i = new Date(t);
24
- return Number.isNaN(i.getTime()) ? "" : i.toLocaleDateString();
25
- }
26
- function Un({
27
- submission: t,
28
- isSelected: i,
29
- isDraft: o = !1,
30
- pointsPossible: a,
31
- onClick: l
11
+ import { Pill as ft } from "@instructure/ui-pill";
12
+ import { IconDownloadLine as Ln, IconCheckMarkSolid as wn, IconArrowStartLine as vn, IconArrowEndLine as Nn, IconTrashLine as On, IconArrowOpenStartLine as Zt, IconArrowOpenEndLine as Qt, IconXLine as Mn, IconLockLine as Jt, IconDocumentLine as jt, IconLinkLine as xn, IconDiscussionLine as kn, IconQuizLine as Pn, IconAssignmentLine as Un } from "@instructure/ui-icons";
13
+ import { ScreenReaderContent as pt } from "@instructure/ui-a11y-content";
14
+ import { Link as Fn } from "@instructure/ui-link";
15
+ import { TruncateText as en } from "@instructure/ui-truncate-text";
16
+ import { Button as z, IconButton as zn } from "@instructure/ui-buttons";
17
+ import { TextArea as tn } from "@instructure/ui-text-area";
18
+ import { Badge as nn } from "@instructure/ui-badge";
19
+ import { Tooltip as jn } from "@instructure/ui-tooltip";
20
+ const rn = In(void 0);
21
+ function ar({
22
+ translations: t,
23
+ children: r
32
24
  }) {
33
- const { t: c } = B("assignment-review"), f = o ? c("submission.currentAttempt", "Current attempt") : `${c("comments.attempt", { number: t.attempt })}`, b = t.score != null && a != null ? `${t.score}/${a}` : null;
34
- return /* @__PURE__ */ r(
35
- Z,
36
- {
37
- as: "div",
38
- padding: "small medium",
39
- borderWidth: "small",
40
- borderColor: i ? "brand" : "primary",
41
- borderRadius: "medium",
42
- background: i ? "secondary" : "primary",
43
- cursor: "pointer",
44
- onClick: l,
45
- role: "button",
46
- tabIndex: 0,
47
- onKeyDown: (u) => {
48
- (u.key === "Enter" || u.key === " ") && (u.preventDefault(), l());
25
+ return /* @__PURE__ */ i(rn.Provider, { value: t, children: r });
26
+ }
27
+ function B() {
28
+ const t = Cn(rn);
29
+ if (!t)
30
+ throw new Error("useTranslations must be used within TranslationsProvider");
31
+ return t;
32
+ }
33
+ /*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */
34
+ const {
35
+ entries: on,
36
+ setPrototypeOf: Ht,
37
+ isFrozen: Hn,
38
+ getPrototypeOf: $n,
39
+ getOwnPropertyDescriptor: Gn
40
+ } = Object;
41
+ let {
42
+ freeze: j,
43
+ seal: W,
44
+ create: Fe
45
+ } = Object, {
46
+ apply: mt,
47
+ construct: ut
48
+ } = typeof Reflect < "u" && Reflect;
49
+ j || (j = function(r) {
50
+ return r;
51
+ });
52
+ W || (W = function(r) {
53
+ return r;
54
+ });
55
+ mt || (mt = function(r, o) {
56
+ for (var s = arguments.length, l = new Array(s > 2 ? s - 2 : 0), c = 2; c < s; c++)
57
+ l[c - 2] = arguments[c];
58
+ return r.apply(o, l);
59
+ });
60
+ ut || (ut = function(r) {
61
+ for (var o = arguments.length, s = new Array(o > 1 ? o - 1 : 0), l = 1; l < o; l++)
62
+ s[l - 1] = arguments[l];
63
+ return new r(...s);
64
+ });
65
+ const Pe = H(Array.prototype.forEach), Bn = H(Array.prototype.lastIndexOf), $t = H(Array.prototype.pop), Se = H(Array.prototype.push), Wn = H(Array.prototype.splice), ze = H(String.prototype.toLowerCase), it = H(String.prototype.toString), rt = H(String.prototype.match), ye = H(String.prototype.replace), qn = H(String.prototype.indexOf), Yn = H(String.prototype.trim), G = H(Object.prototype.hasOwnProperty), F = H(RegExp.prototype.test), Ee = Vn(TypeError);
66
+ function H(t) {
67
+ return function(r) {
68
+ r instanceof RegExp && (r.lastIndex = 0);
69
+ for (var o = arguments.length, s = new Array(o > 1 ? o - 1 : 0), l = 1; l < o; l++)
70
+ s[l - 1] = arguments[l];
71
+ return mt(t, r, s);
72
+ };
73
+ }
74
+ function Vn(t) {
75
+ return function() {
76
+ for (var r = arguments.length, o = new Array(r), s = 0; s < r; s++)
77
+ o[s] = arguments[s];
78
+ return ut(t, o);
79
+ };
80
+ }
81
+ function A(t, r) {
82
+ let o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ze;
83
+ Ht && Ht(t, null);
84
+ let s = r.length;
85
+ for (; s--; ) {
86
+ let l = r[s];
87
+ if (typeof l == "string") {
88
+ const c = o(l);
89
+ c !== l && (Hn(r) || (r[s] = c), l = c);
90
+ }
91
+ t[l] = !0;
92
+ }
93
+ return t;
94
+ }
95
+ function Xn(t) {
96
+ for (let r = 0; r < t.length; r++)
97
+ G(t, r) || (t[r] = null);
98
+ return t;
99
+ }
100
+ function Z(t) {
101
+ const r = Fe(null);
102
+ for (const [o, s] of on(t))
103
+ G(t, o) && (Array.isArray(s) ? r[o] = Xn(s) : s && typeof s == "object" && s.constructor === Object ? r[o] = Z(s) : r[o] = s);
104
+ return r;
105
+ }
106
+ function Ie(t, r) {
107
+ for (; t !== null; ) {
108
+ const s = Gn(t, r);
109
+ if (s) {
110
+ if (s.get)
111
+ return H(s.get);
112
+ if (typeof s.value == "function")
113
+ return H(s.value);
114
+ }
115
+ t = $n(t);
116
+ }
117
+ function o() {
118
+ return null;
119
+ }
120
+ return o;
121
+ }
122
+ const Gt = j(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), ot = j(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), st = j(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Kn = j(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), at = j(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), Zn = j(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Bt = j(["#text"]), Wt = j(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), lt = j(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), qt = j(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), Ue = j(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Qn = W(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Jn = W(/<%[\w\W]*|[\w\W]*%>/gm), ei = W(/\$\{[\w\W]*/gm), ti = W(/^data-[\-\w.\u00B7-\uFFFF]+$/), ni = W(/^aria-[\-\w]+$/), sn = W(
123
+ /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
124
+ // eslint-disable-line no-useless-escape
125
+ ), ii = W(/^(?:\w+script|data):/i), ri = W(
126
+ /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
127
+ // eslint-disable-line no-control-regex
128
+ ), an = W(/^html$/i), oi = W(/^[a-z][.\w]*(-[.\w]+)+$/i);
129
+ var Yt = /* @__PURE__ */ Object.freeze({
130
+ __proto__: null,
131
+ ARIA_ATTR: ni,
132
+ ATTR_WHITESPACE: ri,
133
+ CUSTOM_ELEMENT: oi,
134
+ DATA_ATTR: ti,
135
+ DOCTYPE_NAME: an,
136
+ ERB_EXPR: Jn,
137
+ IS_ALLOWED_URI: sn,
138
+ IS_SCRIPT_OR_DATA: ii,
139
+ MUSTACHE_EXPR: Qn,
140
+ TMPLIT_EXPR: ei
141
+ });
142
+ const Ce = {
143
+ element: 1,
144
+ text: 3,
145
+ // Deprecated
146
+ progressingInstruction: 7,
147
+ comment: 8,
148
+ document: 9
149
+ }, si = function() {
150
+ return typeof window > "u" ? null : window;
151
+ }, ai = function(r, o) {
152
+ if (typeof r != "object" || typeof r.createPolicy != "function")
153
+ return null;
154
+ let s = null;
155
+ const l = "data-tt-policy-suffix";
156
+ o && o.hasAttribute(l) && (s = o.getAttribute(l));
157
+ const c = "dompurify" + (s ? "#" + s : "");
158
+ try {
159
+ return r.createPolicy(c, {
160
+ createHTML(f) {
161
+ return f;
49
162
  },
50
- children: /* @__PURE__ */ S(g, { justifyItems: "space-between", alignItems: "center", children: [
51
- /* @__PURE__ */ S(g, { direction: "column", gap: "xx-small", children: [
52
- /* @__PURE__ */ S(g, { gap: "small", alignItems: "center", children: [
53
- /* @__PURE__ */ r(y, { weight: "bold", children: f }),
54
- o && /* @__PURE__ */ r(lt, { color: "info", children: c("submission.draft", "Draft") })
55
- ] }),
56
- !o && t.submittedAt && /* @__PURE__ */ r(y, { size: "small", color: "secondary", children: Fn(t.submittedAt) })
57
- ] }),
58
- b && /* @__PURE__ */ r(y, { weight: "bold", children: b })
59
- ] })
163
+ createScriptURL(f) {
164
+ return f;
165
+ }
166
+ });
167
+ } catch {
168
+ return console.warn("TrustedTypes policy " + c + " could not be created."), null;
169
+ }
170
+ }, Vt = function() {
171
+ return {
172
+ afterSanitizeAttributes: [],
173
+ afterSanitizeElements: [],
174
+ afterSanitizeShadowDOM: [],
175
+ beforeSanitizeAttributes: [],
176
+ beforeSanitizeElements: [],
177
+ beforeSanitizeShadowDOM: [],
178
+ uponSanitizeAttribute: [],
179
+ uponSanitizeElement: [],
180
+ uponSanitizeShadowNode: []
181
+ };
182
+ };
183
+ function ln() {
184
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : si();
185
+ const r = (d) => ln(d);
186
+ if (r.version = "3.3.3", r.removed = [], !t || !t.document || t.document.nodeType !== Ce.document || !t.Element)
187
+ return r.isSupported = !1, r;
188
+ let {
189
+ document: o
190
+ } = t;
191
+ const s = o, l = s.currentScript, {
192
+ DocumentFragment: c,
193
+ HTMLTemplateElement: f,
194
+ Node: b,
195
+ Element: m,
196
+ NodeFilter: p,
197
+ NamedNodeMap: g = t.NamedNodeMap || t.MozNamedAttrMap,
198
+ HTMLFormElement: D,
199
+ DOMParser: I,
200
+ trustedTypes: E
201
+ } = t, T = m.prototype, ie = Ie(T, "cloneNode"), ae = Ie(T, "remove"), re = Ie(T, "nextSibling"), v = Ie(T, "childNodes"), q = Ie(T, "parentNode");
202
+ if (typeof f == "function") {
203
+ const d = o.createElement("template");
204
+ d.content && d.content.ownerDocument && (o = d.content.ownerDocument);
205
+ }
206
+ let S, V = "";
207
+ const {
208
+ implementation: k,
209
+ createNodeIterator: P,
210
+ createDocumentFragment: le,
211
+ getElementsByTagName: Ge
212
+ } = o, {
213
+ importNode: Be
214
+ } = s;
215
+ let O = Vt();
216
+ r.isSupported = typeof on == "function" && typeof q == "function" && k && k.createHTMLDocument !== void 0;
217
+ const {
218
+ MUSTACHE_EXPR: he,
219
+ ERB_EXPR: be,
220
+ TMPLIT_EXPR: We,
221
+ DATA_ATTR: dn,
222
+ ARIA_ATTR: fn,
223
+ IS_SCRIPT_OR_DATA: pn,
224
+ ATTR_WHITESPACE: ht,
225
+ CUSTOM_ELEMENT: gn
226
+ } = Yt;
227
+ let {
228
+ IS_ALLOWED_URI: bt
229
+ } = Yt, N = null;
230
+ const Tt = A({}, [...Gt, ...ot, ...st, ...at, ...Bt]);
231
+ let M = null;
232
+ const At = A({}, [...Wt, ...lt, ...qt, ...Ue]);
233
+ let R = Object.seal(Fe(null, {
234
+ tagNameCheck: {
235
+ writable: !0,
236
+ configurable: !1,
237
+ enumerable: !0,
238
+ value: null
239
+ },
240
+ attributeNameCheck: {
241
+ writable: !0,
242
+ configurable: !1,
243
+ enumerable: !0,
244
+ value: null
245
+ },
246
+ allowCustomizedBuiltInElements: {
247
+ writable: !0,
248
+ configurable: !1,
249
+ enumerable: !0,
250
+ value: !1
60
251
  }
61
- );
252
+ })), Te = null, Le = null;
253
+ const te = Object.seal(Fe(null, {
254
+ tagCheck: {
255
+ writable: !0,
256
+ configurable: !1,
257
+ enumerable: !0,
258
+ value: null
259
+ },
260
+ attributeCheck: {
261
+ writable: !0,
262
+ configurable: !1,
263
+ enumerable: !0,
264
+ value: null
265
+ }
266
+ }));
267
+ let _t = !0, qe = !0, St = !1, yt = !0, ce = !1, we = !0, oe = !1, Ye = !1, Ve = !1, me = !1, ve = !1, Ne = !1, Et = !0, It = !1;
268
+ const hn = "user-content-";
269
+ let Xe = !0, Ae = !1, ue = {}, X = null;
270
+ const Ke = A({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
271
+ let Ct = null;
272
+ const Dt = A({}, ["audio", "video", "img", "source", "image", "track"]);
273
+ let Ze = null;
274
+ const Rt = A({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Oe = "http://www.w3.org/1998/Math/MathML", Me = "http://www.w3.org/2000/svg", Q = "http://www.w3.org/1999/xhtml";
275
+ let de = Q, Qe = !1, Je = null;
276
+ const bn = A({}, [Oe, Me, Q], it);
277
+ let xe = A({}, ["mi", "mo", "mn", "ms", "mtext"]), ke = A({}, ["annotation-xml"]);
278
+ const Tn = A({}, ["title", "style", "font", "a", "script"]);
279
+ let _e = null;
280
+ const An = ["application/xhtml+xml", "text/html"], _n = "text/html";
281
+ let w = null, fe = null;
282
+ const Sn = o.createElement("form"), Lt = function(e) {
283
+ return e instanceof RegExp || e instanceof Function;
284
+ }, et = function() {
285
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
286
+ if (!(fe && fe === e)) {
287
+ if ((!e || typeof e != "object") && (e = {}), e = Z(e), _e = // eslint-disable-next-line unicorn/prefer-includes
288
+ An.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? _n : e.PARSER_MEDIA_TYPE, w = _e === "application/xhtml+xml" ? it : ze, N = G(e, "ALLOWED_TAGS") ? A({}, e.ALLOWED_TAGS, w) : Tt, M = G(e, "ALLOWED_ATTR") ? A({}, e.ALLOWED_ATTR, w) : At, Je = G(e, "ALLOWED_NAMESPACES") ? A({}, e.ALLOWED_NAMESPACES, it) : bn, Ze = G(e, "ADD_URI_SAFE_ATTR") ? A(Z(Rt), e.ADD_URI_SAFE_ATTR, w) : Rt, Ct = G(e, "ADD_DATA_URI_TAGS") ? A(Z(Dt), e.ADD_DATA_URI_TAGS, w) : Dt, X = G(e, "FORBID_CONTENTS") ? A({}, e.FORBID_CONTENTS, w) : Ke, Te = G(e, "FORBID_TAGS") ? A({}, e.FORBID_TAGS, w) : Z({}), Le = G(e, "FORBID_ATTR") ? A({}, e.FORBID_ATTR, w) : Z({}), ue = G(e, "USE_PROFILES") ? e.USE_PROFILES : !1, _t = e.ALLOW_ARIA_ATTR !== !1, qe = e.ALLOW_DATA_ATTR !== !1, St = e.ALLOW_UNKNOWN_PROTOCOLS || !1, yt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ce = e.SAFE_FOR_TEMPLATES || !1, we = e.SAFE_FOR_XML !== !1, oe = e.WHOLE_DOCUMENT || !1, me = e.RETURN_DOM || !1, ve = e.RETURN_DOM_FRAGMENT || !1, Ne = e.RETURN_TRUSTED_TYPE || !1, Ve = e.FORCE_BODY || !1, Et = e.SANITIZE_DOM !== !1, It = e.SANITIZE_NAMED_PROPS || !1, Xe = e.KEEP_CONTENT !== !1, Ae = e.IN_PLACE || !1, bt = e.ALLOWED_URI_REGEXP || sn, de = e.NAMESPACE || Q, xe = e.MATHML_TEXT_INTEGRATION_POINTS || xe, ke = e.HTML_INTEGRATION_POINTS || ke, R = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && Lt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (R.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && Lt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (R.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (R.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), ce && (qe = !1), ve && (me = !0), ue && (N = A({}, Bt), M = Fe(null), ue.html === !0 && (A(N, Gt), A(M, Wt)), ue.svg === !0 && (A(N, ot), A(M, lt), A(M, Ue)), ue.svgFilters === !0 && (A(N, st), A(M, lt), A(M, Ue)), ue.mathMl === !0 && (A(N, at), A(M, qt), A(M, Ue))), G(e, "ADD_TAGS") || (te.tagCheck = null), G(e, "ADD_ATTR") || (te.attributeCheck = null), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? te.tagCheck = e.ADD_TAGS : (N === Tt && (N = Z(N)), A(N, e.ADD_TAGS, w))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? te.attributeCheck = e.ADD_ATTR : (M === At && (M = Z(M)), A(M, e.ADD_ATTR, w))), e.ADD_URI_SAFE_ATTR && A(Ze, e.ADD_URI_SAFE_ATTR, w), e.FORBID_CONTENTS && (X === Ke && (X = Z(X)), A(X, e.FORBID_CONTENTS, w)), e.ADD_FORBID_CONTENTS && (X === Ke && (X = Z(X)), A(X, e.ADD_FORBID_CONTENTS, w)), Xe && (N["#text"] = !0), oe && A(N, ["html", "head", "body"]), N.table && (A(N, ["tbody"]), delete Te.tbody), e.TRUSTED_TYPES_POLICY) {
289
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
290
+ throw Ee('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
291
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
292
+ throw Ee('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
293
+ S = e.TRUSTED_TYPES_POLICY, V = S.createHTML("");
294
+ } else
295
+ S === void 0 && (S = ai(E, l)), S !== null && typeof V == "string" && (V = S.createHTML(""));
296
+ j && j(e), fe = e;
297
+ }
298
+ }, wt = A({}, [...ot, ...st, ...Kn]), vt = A({}, [...at, ...Zn]), yn = function(e) {
299
+ let a = q(e);
300
+ (!a || !a.tagName) && (a = {
301
+ namespaceURI: de,
302
+ tagName: "template"
303
+ });
304
+ const u = ze(e.tagName), C = ze(a.tagName);
305
+ return Je[e.namespaceURI] ? e.namespaceURI === Me ? a.namespaceURI === Q ? u === "svg" : a.namespaceURI === Oe ? u === "svg" && (C === "annotation-xml" || xe[C]) : !!wt[u] : e.namespaceURI === Oe ? a.namespaceURI === Q ? u === "math" : a.namespaceURI === Me ? u === "math" && ke[C] : !!vt[u] : e.namespaceURI === Q ? a.namespaceURI === Me && !ke[C] || a.namespaceURI === Oe && !xe[C] ? !1 : !vt[u] && (Tn[u] || !wt[u]) : !!(_e === "application/xhtml+xml" && Je[e.namespaceURI]) : !1;
306
+ }, K = function(e) {
307
+ Se(r.removed, {
308
+ element: e
309
+ });
310
+ try {
311
+ q(e).removeChild(e);
312
+ } catch {
313
+ ae(e);
314
+ }
315
+ }, se = function(e, a) {
316
+ try {
317
+ Se(r.removed, {
318
+ attribute: a.getAttributeNode(e),
319
+ from: a
320
+ });
321
+ } catch {
322
+ Se(r.removed, {
323
+ attribute: null,
324
+ from: a
325
+ });
326
+ }
327
+ if (a.removeAttribute(e), e === "is")
328
+ if (me || ve)
329
+ try {
330
+ K(a);
331
+ } catch {
332
+ }
333
+ else
334
+ try {
335
+ a.setAttribute(e, "");
336
+ } catch {
337
+ }
338
+ }, Nt = function(e) {
339
+ let a = null, u = null;
340
+ if (Ve)
341
+ e = "<remove></remove>" + e;
342
+ else {
343
+ const L = rt(e, /^[\r\n\t ]+/);
344
+ u = L && L[0];
345
+ }
346
+ _e === "application/xhtml+xml" && de === Q && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
347
+ const C = S ? S.createHTML(e) : e;
348
+ if (de === Q)
349
+ try {
350
+ a = new I().parseFromString(C, _e);
351
+ } catch {
352
+ }
353
+ if (!a || !a.documentElement) {
354
+ a = k.createDocument(de, "template", null);
355
+ try {
356
+ a.documentElement.innerHTML = Qe ? V : C;
357
+ } catch {
358
+ }
359
+ }
360
+ const U = a.body || a.documentElement;
361
+ return e && u && U.insertBefore(o.createTextNode(u), U.childNodes[0] || null), de === Q ? Ge.call(a, oe ? "html" : "body")[0] : oe ? a.documentElement : U;
362
+ }, Ot = function(e) {
363
+ return P.call(
364
+ e.ownerDocument || e,
365
+ e,
366
+ // eslint-disable-next-line no-bitwise
367
+ p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION,
368
+ null
369
+ );
370
+ }, tt = function(e) {
371
+ return e instanceof D && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof g) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
372
+ }, Mt = function(e) {
373
+ return typeof b == "function" && e instanceof b;
374
+ };
375
+ function J(d, e, a) {
376
+ Pe(d, (u) => {
377
+ u.call(r, e, a, fe);
378
+ });
379
+ }
380
+ const xt = function(e) {
381
+ let a = null;
382
+ if (J(O.beforeSanitizeElements, e, null), tt(e))
383
+ return K(e), !0;
384
+ const u = w(e.nodeName);
385
+ if (J(O.uponSanitizeElement, e, {
386
+ tagName: u,
387
+ allowedTags: N
388
+ }), we && e.hasChildNodes() && !Mt(e.firstElementChild) && F(/<[/\w!]/g, e.innerHTML) && F(/<[/\w!]/g, e.textContent) || e.nodeType === Ce.progressingInstruction || we && e.nodeType === Ce.comment && F(/<[/\w]/g, e.data))
389
+ return K(e), !0;
390
+ if (!(te.tagCheck instanceof Function && te.tagCheck(u)) && (!N[u] || Te[u])) {
391
+ if (!Te[u] && Pt(u) && (R.tagNameCheck instanceof RegExp && F(R.tagNameCheck, u) || R.tagNameCheck instanceof Function && R.tagNameCheck(u)))
392
+ return !1;
393
+ if (Xe && !X[u]) {
394
+ const C = q(e) || e.parentNode, U = v(e) || e.childNodes;
395
+ if (U && C) {
396
+ const L = U.length;
397
+ for (let $ = L - 1; $ >= 0; --$) {
398
+ const ee = ie(U[$], !0);
399
+ ee.__removalCount = (e.__removalCount || 0) + 1, C.insertBefore(ee, re(e));
400
+ }
401
+ }
402
+ }
403
+ return K(e), !0;
404
+ }
405
+ return e instanceof m && !yn(e) || (u === "noscript" || u === "noembed" || u === "noframes") && F(/<\/no(script|embed|frames)/i, e.innerHTML) ? (K(e), !0) : (ce && e.nodeType === Ce.text && (a = e.textContent, Pe([he, be, We], (C) => {
406
+ a = ye(a, C, " ");
407
+ }), e.textContent !== a && (Se(r.removed, {
408
+ element: e.cloneNode()
409
+ }), e.textContent = a)), J(O.afterSanitizeElements, e, null), !1);
410
+ }, kt = function(e, a, u) {
411
+ if (Le[a] || Et && (a === "id" || a === "name") && (u in o || u in Sn))
412
+ return !1;
413
+ if (!(qe && !Le[a] && F(dn, a))) {
414
+ if (!(_t && F(fn, a))) {
415
+ if (!(te.attributeCheck instanceof Function && te.attributeCheck(a, e))) {
416
+ if (!M[a] || Le[a]) {
417
+ if (
418
+ // First condition does a very basic check if a) it's basically a valid custom element tagname AND
419
+ // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
420
+ // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
421
+ !(Pt(e) && (R.tagNameCheck instanceof RegExp && F(R.tagNameCheck, e) || R.tagNameCheck instanceof Function && R.tagNameCheck(e)) && (R.attributeNameCheck instanceof RegExp && F(R.attributeNameCheck, a) || R.attributeNameCheck instanceof Function && R.attributeNameCheck(a, e)) || // Alternative, second condition checks if it's an `is`-attribute, AND
422
+ // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
423
+ a === "is" && R.allowCustomizedBuiltInElements && (R.tagNameCheck instanceof RegExp && F(R.tagNameCheck, u) || R.tagNameCheck instanceof Function && R.tagNameCheck(u)))
424
+ ) return !1;
425
+ } else if (!Ze[a]) {
426
+ if (!F(bt, ye(u, ht, ""))) {
427
+ if (!((a === "src" || a === "xlink:href" || a === "href") && e !== "script" && qn(u, "data:") === 0 && Ct[e])) {
428
+ if (!(St && !F(pn, ye(u, ht, "")))) {
429
+ if (u)
430
+ return !1;
431
+ }
432
+ }
433
+ }
434
+ }
435
+ }
436
+ }
437
+ }
438
+ return !0;
439
+ }, Pt = function(e) {
440
+ return e !== "annotation-xml" && rt(e, gn);
441
+ }, Ut = function(e) {
442
+ J(O.beforeSanitizeAttributes, e, null);
443
+ const {
444
+ attributes: a
445
+ } = e;
446
+ if (!a || tt(e))
447
+ return;
448
+ const u = {
449
+ attrName: "",
450
+ attrValue: "",
451
+ keepAttr: !0,
452
+ allowedAttributes: M,
453
+ forceKeepAttr: void 0
454
+ };
455
+ let C = a.length;
456
+ for (; C--; ) {
457
+ const U = a[C], {
458
+ name: L,
459
+ namespaceURI: $,
460
+ value: ee
461
+ } = U, pe = w(L), nt = ee;
462
+ let x = L === "value" ? nt : Yn(nt);
463
+ if (u.attrName = pe, u.attrValue = x, u.keepAttr = !0, u.forceKeepAttr = void 0, J(O.uponSanitizeAttribute, e, u), x = u.attrValue, It && (pe === "id" || pe === "name") && (se(L, e), x = hn + x), we && F(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, x)) {
464
+ se(L, e);
465
+ continue;
466
+ }
467
+ if (pe === "attributename" && rt(x, "href")) {
468
+ se(L, e);
469
+ continue;
470
+ }
471
+ if (u.forceKeepAttr)
472
+ continue;
473
+ if (!u.keepAttr) {
474
+ se(L, e);
475
+ continue;
476
+ }
477
+ if (!yt && F(/\/>/i, x)) {
478
+ se(L, e);
479
+ continue;
480
+ }
481
+ ce && Pe([he, be, We], (zt) => {
482
+ x = ye(x, zt, " ");
483
+ });
484
+ const Ft = w(e.nodeName);
485
+ if (!kt(Ft, pe, x)) {
486
+ se(L, e);
487
+ continue;
488
+ }
489
+ if (S && typeof E == "object" && typeof E.getAttributeType == "function" && !$)
490
+ switch (E.getAttributeType(Ft, pe)) {
491
+ case "TrustedHTML": {
492
+ x = S.createHTML(x);
493
+ break;
494
+ }
495
+ case "TrustedScriptURL": {
496
+ x = S.createScriptURL(x);
497
+ break;
498
+ }
499
+ }
500
+ if (x !== nt)
501
+ try {
502
+ $ ? e.setAttributeNS($, L, x) : e.setAttribute(L, x), tt(e) ? K(e) : $t(r.removed);
503
+ } catch {
504
+ se(L, e);
505
+ }
506
+ }
507
+ J(O.afterSanitizeAttributes, e, null);
508
+ }, En = function d(e) {
509
+ let a = null;
510
+ const u = Ot(e);
511
+ for (J(O.beforeSanitizeShadowDOM, e, null); a = u.nextNode(); )
512
+ J(O.uponSanitizeShadowNode, a, null), xt(a), Ut(a), a.content instanceof c && d(a.content);
513
+ J(O.afterSanitizeShadowDOM, e, null);
514
+ };
515
+ return r.sanitize = function(d) {
516
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = null, u = null, C = null, U = null;
517
+ if (Qe = !d, Qe && (d = "<!-->"), typeof d != "string" && !Mt(d))
518
+ if (typeof d.toString == "function") {
519
+ if (d = d.toString(), typeof d != "string")
520
+ throw Ee("dirty is not a string, aborting");
521
+ } else
522
+ throw Ee("toString is not a function");
523
+ if (!r.isSupported)
524
+ return d;
525
+ if (Ye || et(e), r.removed = [], typeof d == "string" && (Ae = !1), Ae) {
526
+ if (d.nodeName) {
527
+ const ee = w(d.nodeName);
528
+ if (!N[ee] || Te[ee])
529
+ throw Ee("root node is forbidden and cannot be sanitized in-place");
530
+ }
531
+ } else if (d instanceof b)
532
+ a = Nt("<!---->"), u = a.ownerDocument.importNode(d, !0), u.nodeType === Ce.element && u.nodeName === "BODY" || u.nodeName === "HTML" ? a = u : a.appendChild(u);
533
+ else {
534
+ if (!me && !ce && !oe && // eslint-disable-next-line unicorn/prefer-includes
535
+ d.indexOf("<") === -1)
536
+ return S && Ne ? S.createHTML(d) : d;
537
+ if (a = Nt(d), !a)
538
+ return me ? null : Ne ? V : "";
539
+ }
540
+ a && Ve && K(a.firstChild);
541
+ const L = Ot(Ae ? d : a);
542
+ for (; C = L.nextNode(); )
543
+ xt(C), Ut(C), C.content instanceof c && En(C.content);
544
+ if (Ae)
545
+ return d;
546
+ if (me) {
547
+ if (ve)
548
+ for (U = le.call(a.ownerDocument); a.firstChild; )
549
+ U.appendChild(a.firstChild);
550
+ else
551
+ U = a;
552
+ return (M.shadowroot || M.shadowrootmode) && (U = Be.call(s, U, !0)), U;
553
+ }
554
+ let $ = oe ? a.outerHTML : a.innerHTML;
555
+ return oe && N["!doctype"] && a.ownerDocument && a.ownerDocument.doctype && a.ownerDocument.doctype.name && F(an, a.ownerDocument.doctype.name) && ($ = "<!DOCTYPE " + a.ownerDocument.doctype.name + `>
556
+ ` + $), ce && Pe([he, be, We], (ee) => {
557
+ $ = ye($, ee, " ");
558
+ }), S && Ne ? S.createHTML($) : $;
559
+ }, r.setConfig = function() {
560
+ let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
561
+ et(d), Ye = !0;
562
+ }, r.clearConfig = function() {
563
+ fe = null, Ye = !1;
564
+ }, r.isValidAttribute = function(d, e, a) {
565
+ fe || et({});
566
+ const u = w(d), C = w(e);
567
+ return kt(u, C, a);
568
+ }, r.addHook = function(d, e) {
569
+ typeof e == "function" && Se(O[d], e);
570
+ }, r.removeHook = function(d, e) {
571
+ if (e !== void 0) {
572
+ const a = Bn(O[d], e);
573
+ return a === -1 ? void 0 : Wn(O[d], a, 1)[0];
574
+ }
575
+ return $t(O[d]);
576
+ }, r.removeHooks = function(d) {
577
+ O[d] = [];
578
+ }, r.removeAllHooks = function() {
579
+ O = Vt();
580
+ }, r;
62
581
  }
63
- const zn = J`
582
+ var gt = ln();
583
+ const li = ne`
64
584
  query GetAssignment($courseId: ID!, $assignmentId: ID!, $userId: ID!) {
65
585
  legacyNode(_id: $assignmentId, type: Assignment) {
66
586
  ... on Assignment {
@@ -119,7 +639,7 @@ const zn = J`
119
639
  contentType
120
640
  submissionPreviewUrl
121
641
  }
122
- `, jn = J`
642
+ `, ci = ne`
123
643
  query GetSubmissionComments(
124
644
  $submissionId: ID!
125
645
  $courseId: String
@@ -168,7 +688,7 @@ const zn = J`
168
688
  }
169
689
  }
170
690
  }
171
- `, $n = J`
691
+ `, mi = ne`
172
692
  query getSubmissions($submissionId: ID!) {
173
693
  node(id: $submissionId) {
174
694
  ... on Submission {
@@ -202,7 +722,7 @@ const zn = J`
202
722
  contentType
203
723
  submissionPreviewUrl
204
724
  }
205
- `, _e = n.object({
725
+ `, De = n.object({
206
726
  _id: n.string(),
207
727
  displayName: n.string(),
208
728
  id: n.string(),
@@ -210,12 +730,12 @@ const zn = J`
210
730
  url: n.string(),
211
731
  contentType: n.string(),
212
732
  submissionPreviewUrl: n.string().nullable()
213
- }), Hn = n.object({
733
+ }), ui = n.object({
214
734
  _id: n.string(),
215
735
  activeSubmissionType: n.string(),
216
736
  body: n.string().nullable(),
217
- attachments: n.array(_e).nullable()
218
- }), Gn = n.object({
737
+ attachments: n.array(De).nullable()
738
+ }), di = n.object({
219
739
  id: n.string(),
220
740
  submittedAt: n.string(),
221
741
  body: n.string().nullable(),
@@ -224,10 +744,10 @@ const zn = J`
224
744
  submissionType: n.string(),
225
745
  attempt: n.number(),
226
746
  unreadCommentCount: n.number(),
227
- attachment: _e.nullable(),
228
- attachments: n.array(_e).nullable(),
229
- submissionDraft: Hn.nullable()
230
- }), Bn = n.object({
747
+ attachment: De.nullable(),
748
+ attachments: n.array(De).nullable(),
749
+ submissionDraft: ui.nullable()
750
+ }), fi = n.object({
231
751
  _id: n.string(),
232
752
  name: n.string(),
233
753
  description: n.string().nullable(),
@@ -239,19 +759,19 @@ const zn = J`
239
759
  gradingType: n.string(),
240
760
  published: n.boolean().nullable().optional(),
241
761
  submissionsConnection: n.object({
242
- nodes: n.array(Gn)
762
+ nodes: n.array(di)
243
763
  })
244
- }), Wn = n.object({
245
- legacyNode: Bn,
764
+ }), pi = n.object({
765
+ legacyNode: fi,
246
766
  course: n.object({
247
767
  name: n.string()
248
768
  })
249
- }), Jt = n.object({
769
+ }), cn = n.object({
250
770
  startCursor: n.string(),
251
771
  endCursor: n.string(),
252
772
  hasPreviousPage: n.boolean(),
253
773
  hasNextPage: n.boolean()
254
- }), en = n.object({
774
+ }), mn = n.object({
255
775
  _id: n.string(),
256
776
  attempt: n.number(),
257
777
  author: n.object({
@@ -272,17 +792,17 @@ const zn = J`
272
792
  id: n.string()
273
793
  })
274
794
  ).nullable()
275
- }), qn = n.object({
795
+ }), gi = n.object({
276
796
  submissionComments: n.object({
277
797
  commentsConnection: n.object({
278
- pageInfo: Jt,
279
- nodes: n.array(en)
798
+ pageInfo: cn,
799
+ nodes: n.array(mn)
280
800
  })
281
801
  })
282
- }), Qi = n.object({
283
- comments: n.array(en),
284
- pageInfo: Jt
285
- }), Yn = n.object({
802
+ }), lr = n.object({
803
+ comments: n.array(mn),
804
+ pageInfo: cn
805
+ }), hi = n.object({
286
806
  submittedAt: n.string(),
287
807
  body: n.string().nullable(),
288
808
  grade: n.string().nullable(),
@@ -290,18 +810,18 @@ const zn = J`
290
810
  submissionType: n.string(),
291
811
  state: n.string(),
292
812
  attempt: n.number(),
293
- attachment: _e.nullable(),
294
- attachments: n.array(_e).nullable()
295
- }), Xn = n.object({
813
+ attachment: De.nullable(),
814
+ attachments: n.array(De).nullable()
815
+ }), bi = n.object({
296
816
  node: n.object({
297
817
  submissionHistoriesConnection: n.object({
298
- nodes: n.array(Yn)
818
+ nodes: n.array(hi)
299
819
  })
300
820
  })
301
- }), Se = n.object({
821
+ }), Re = n.object({
302
822
  attribute: n.string(),
303
823
  message: n.string()
304
- }), Kn = n.object({
824
+ }), Ti = n.object({
305
825
  createSubmissionComment: n.object({
306
826
  submissionComment: n.object({
307
827
  _id: n.string(),
@@ -344,13 +864,13 @@ const zn = J`
344
864
  read: n.boolean(),
345
865
  updatedAt: n.string()
346
866
  }).nullable(),
347
- errors: n.array(Se).nullable()
867
+ errors: n.array(Re).nullable()
348
868
  })
349
- }), Vn = n.object({
869
+ }), Ai = n.object({
350
870
  markSubmissionCommentsRead: n.object({
351
- errors: n.array(Se).nullable()
871
+ errors: n.array(Re).nullable()
352
872
  })
353
- }), Ji = n.object({
873
+ }), cr = n.object({
354
874
  createSubmission: n.object({
355
875
  submission: n.object({
356
876
  _id: n.string(),
@@ -359,983 +879,225 @@ const zn = J`
359
879
  submittedAt: n.string().nullable(),
360
880
  score: n.number().nullable()
361
881
  }).nullable(),
362
- errors: n.array(Se).nullable()
882
+ errors: n.array(Re).nullable()
363
883
  })
364
- }), er = n.object(
884
+ }), mr = n.object(
365
885
  {
366
886
  createSubmissionDraft: n.object({
367
887
  submissionDraft: n.object({
368
888
  _id: n.string()
369
889
  }).nullable(),
370
- errors: n.array(Se).nullable()
890
+ errors: n.array(Re).nullable()
371
891
  })
372
892
  }
373
- ), tr = n.object(
893
+ ), ur = n.object(
374
894
  {
375
895
  deleteSubmissionDraft: n.object({
376
896
  submissionDraftIds: n.array(n.string()).nullable(),
377
- errors: n.array(Se).nullable()
897
+ errors: n.array(Re).nullable()
378
898
  })
379
899
  }
380
900
  );
381
- function Zn({
382
- submissionId: t,
383
- executeQuery: i,
384
- enabled: o = !0
385
- }) {
386
- return Ue({
387
- queryKey: ["assignment-review", "submissions", t],
388
- queryFn: async () => {
389
- const a = await i($n, { submissionId: t });
390
- return Xn.parse(a).node.submissionHistoriesConnection.nodes.slice().sort(
391
- (c, f) => new Date(f.submittedAt).getTime() - new Date(c.submittedAt).getTime()
392
- );
393
- },
394
- enabled: o
395
- });
396
- }
397
- function nr({
398
- submissionId: t,
399
- selectedAttempt: i,
400
- onAttemptSelect: o,
401
- pointsPossible: a,
402
- executeQuery: l
901
+ function _i({
902
+ courseId: t,
903
+ assignmentId: r,
904
+ userId: o,
905
+ executeQuery: s,
906
+ enabled: l = !0
403
907
  }) {
404
- const { t: c } = B("assignment-review"), { data: f, isLoading: b, isError: u } = Zn({
405
- submissionId: t,
406
- executeQuery: l
407
- });
408
- if (b)
409
- return /* @__PURE__ */ r(g, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(ct, { renderTitle: c("navigation.attempts"), size: "small" }) });
410
- if (u)
411
- return /* @__PURE__ */ r(g, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(y, { color: "danger", children: c("submission.loadAttemptsError", "Failed to load attempts") }) });
412
- const p = (f == null ? void 0 : f.filter((_) => _.attempt > 0)) ?? [];
413
- return p.length === 0 ? /* @__PURE__ */ r(g, { padding: "medium", children: /* @__PURE__ */ r(y, { color: "secondary", children: c(
414
- "submission.noAttempts",
415
- "This assignment allows multiple attempts. Once you've made a submission, you can view it here."
416
- ) }) }) : /* @__PURE__ */ r(g, { direction: "column", gap: "x-small", padding: "none none medium none", children: p.map((_) => /* @__PURE__ */ r(
417
- Un,
418
- {
419
- submission: _,
420
- isSelected: i === _.attempt,
421
- pointsPossible: a,
422
- onClick: () => o(_)
423
- },
424
- _.attempt
425
- )) });
426
- }
427
- /*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */
428
- const {
429
- entries: tn,
430
- setPrototypeOf: Pt,
431
- isFrozen: Qn,
432
- getPrototypeOf: Jn,
433
- getOwnPropertyDescriptor: ei
434
- } = Object;
435
- let {
436
- freeze: F,
437
- seal: G,
438
- create: ke
439
- } = Object, {
440
- apply: st,
441
- construct: at
442
- } = typeof Reflect < "u" && Reflect;
443
- F || (F = function(i) {
444
- return i;
445
- });
446
- G || (G = function(i) {
447
- return i;
448
- });
449
- st || (st = function(i, o) {
450
- for (var a = arguments.length, l = new Array(a > 2 ? a - 2 : 0), c = 2; c < a; c++)
451
- l[c - 2] = arguments[c];
452
- return i.apply(o, l);
453
- });
454
- at || (at = function(i) {
455
- for (var o = arguments.length, a = new Array(o > 1 ? o - 1 : 0), l = 1; l < o; l++)
456
- a[l - 1] = arguments[l];
457
- return new i(...a);
458
- });
459
- const Me = U(Array.prototype.forEach), ti = U(Array.prototype.lastIndexOf), Ft = U(Array.prototype.pop), pe = U(Array.prototype.push), ni = U(Array.prototype.splice), Pe = U(String.prototype.toLowerCase), Je = U(String.prototype.toString), et = U(String.prototype.match), ge = U(String.prototype.replace), ii = U(String.prototype.indexOf), ri = U(String.prototype.trim), H = U(Object.prototype.hasOwnProperty), k = U(RegExp.prototype.test), he = oi(TypeError);
460
- function U(t) {
461
- return function(i) {
462
- i instanceof RegExp && (i.lastIndex = 0);
463
- for (var o = arguments.length, a = new Array(o > 1 ? o - 1 : 0), l = 1; l < o; l++)
464
- a[l - 1] = arguments[l];
465
- return st(t, i, a);
466
- };
467
- }
468
- function oi(t) {
469
- return function() {
470
- for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
471
- o[a] = arguments[a];
472
- return at(t, o);
473
- };
474
- }
475
- function h(t, i) {
476
- let o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Pe;
477
- Pt && Pt(t, null);
478
- let a = i.length;
479
- for (; a--; ) {
480
- let l = i[a];
481
- if (typeof l == "string") {
482
- const c = o(l);
483
- c !== l && (Qn(i) || (i[a] = c), l = c);
484
- }
485
- t[l] = !0;
486
- }
487
- return t;
488
- }
489
- function si(t) {
490
- for (let i = 0; i < t.length; i++)
491
- H(t, i) || (t[i] = null);
492
- return t;
493
- }
494
- function Y(t) {
495
- const i = ke(null);
496
- for (const [o, a] of tn(t))
497
- H(t, o) && (Array.isArray(a) ? i[o] = si(a) : a && typeof a == "object" && a.constructor === Object ? i[o] = Y(a) : i[o] = a);
498
- return i;
499
- }
500
- function be(t, i) {
501
- for (; t !== null; ) {
502
- const a = ei(t, i);
503
- if (a) {
504
- if (a.get)
505
- return U(a.get);
506
- if (typeof a.value == "function")
507
- return U(a.value);
508
- }
509
- t = Jn(t);
510
- }
511
- function o() {
512
- return null;
513
- }
514
- return o;
515
- }
516
- const Ut = F(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), tt = F(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), nt = F(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), ai = F(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), it = F(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), li = F(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), zt = F(["#text"]), jt = F(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), rt = F(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), $t = F(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), xe = F(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), ci = G(/\{\{[\w\W]*|[\w\W]*\}\}/gm), mi = G(/<%[\w\W]*|[\w\W]*%>/gm), ui = G(/\$\{[\w\W]*/gm), di = G(/^data-[\-\w.\u00B7-\uFFFF]+$/), fi = G(/^aria-[\-\w]+$/), nn = G(
517
- /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
518
- // eslint-disable-line no-useless-escape
519
- ), pi = G(/^(?:\w+script|data):/i), gi = G(
520
- /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
521
- // eslint-disable-line no-control-regex
522
- ), rn = G(/^html$/i), hi = G(/^[a-z][.\w]*(-[.\w]+)+$/i);
523
- var Ht = /* @__PURE__ */ Object.freeze({
524
- __proto__: null,
525
- ARIA_ATTR: fi,
526
- ATTR_WHITESPACE: gi,
527
- CUSTOM_ELEMENT: hi,
528
- DATA_ATTR: di,
529
- DOCTYPE_NAME: rn,
530
- ERB_EXPR: mi,
531
- IS_ALLOWED_URI: nn,
532
- IS_SCRIPT_OR_DATA: pi,
533
- MUSTACHE_EXPR: ci,
534
- TMPLIT_EXPR: ui
535
- });
536
- const Te = {
537
- element: 1,
538
- text: 3,
539
- // Deprecated
540
- progressingInstruction: 7,
541
- comment: 8,
542
- document: 9
543
- }, bi = function() {
544
- return typeof window > "u" ? null : window;
545
- }, Ti = function(i, o) {
546
- if (typeof i != "object" || typeof i.createPolicy != "function")
547
- return null;
548
- let a = null;
549
- const l = "data-tt-policy-suffix";
550
- o && o.hasAttribute(l) && (a = o.getAttribute(l));
551
- const c = "dompurify" + (a ? "#" + a : "");
552
- try {
553
- return i.createPolicy(c, {
554
- createHTML(f) {
555
- return f;
556
- },
557
- createScriptURL(f) {
558
- return f;
559
- }
560
- });
561
- } catch {
562
- return console.warn("TrustedTypes policy " + c + " could not be created."), null;
563
- }
564
- }, Gt = function() {
565
- return {
566
- afterSanitizeAttributes: [],
567
- afterSanitizeElements: [],
568
- afterSanitizeShadowDOM: [],
569
- beforeSanitizeAttributes: [],
570
- beforeSanitizeElements: [],
571
- beforeSanitizeShadowDOM: [],
572
- uponSanitizeAttribute: [],
573
- uponSanitizeElement: [],
574
- uponSanitizeShadowNode: []
575
- };
576
- };
577
- function on() {
578
- let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : bi();
579
- const i = (d) => on(d);
580
- if (i.version = "3.3.3", i.removed = [], !t || !t.document || t.document.nodeType !== Te.document || !t.Element)
581
- return i.isSupported = !1, i;
582
- let {
583
- document: o
584
- } = t;
585
- const a = o, l = a.currentScript, {
586
- DocumentFragment: c,
587
- HTMLTemplateElement: f,
588
- Node: b,
589
- Element: u,
590
- NodeFilter: p,
591
- NamedNodeMap: _ = t.NamedNodeMap || t.MozNamedAttrMap,
592
- HTMLFormElement: D,
593
- DOMParser: I,
594
- trustedTypes: A
595
- } = t, T = u.prototype, me = be(T, "cloneNode"), ye = be(T, "remove"), Ae = be(T, "nextSibling"), Ee = be(T, "childNodes"), ie = be(T, "parentNode");
596
- if (typeof f == "function") {
597
- const d = o.createElement("template");
598
- d.content && d.content.ownerDocument && (o = d.content.ownerDocument);
599
- }
600
- let L, ee = "";
601
- const {
602
- implementation: z,
603
- createNodeIterator: $,
604
- createDocumentFragment: Ie,
605
- getElementsByTagName: ln
606
- } = o, {
607
- importNode: cn
608
- } = a;
609
- let x = Gt();
610
- i.isSupported = typeof tn == "function" && typeof ie == "function" && z && z.createHTMLDocument !== void 0;
611
- const {
612
- MUSTACHE_EXPR: ze,
613
- ERB_EXPR: je,
614
- TMPLIT_EXPR: $e,
615
- DATA_ATTR: mn,
616
- ARIA_ATTR: un,
617
- IS_SCRIPT_OR_DATA: dn,
618
- ATTR_WHITESPACE: ut,
619
- CUSTOM_ELEMENT: fn
620
- } = Ht;
621
- let {
622
- IS_ALLOWED_URI: dt
623
- } = Ht, v = null;
624
- const ft = h({}, [...Ut, ...tt, ...nt, ...it, ...zt]);
625
- let N = null;
626
- const pt = h({}, [...jt, ...rt, ...$t, ...xe]);
627
- let C = Object.seal(ke(null, {
628
- tagNameCheck: {
629
- writable: !0,
630
- configurable: !1,
631
- enumerable: !0,
632
- value: null
908
+ return $e({
909
+ queryKey: ["assignment-review", "assignment", t, r, o],
910
+ queryFn: async () => {
911
+ const c = await s(li, {
912
+ courseId: t,
913
+ assignmentId: r,
914
+ userId: o
915
+ }), f = pi.parse(c);
916
+ return {
917
+ ...f.legacyNode,
918
+ courseName: f.course.name
919
+ };
633
920
  },
634
- attributeNameCheck: {
635
- writable: !0,
636
- configurable: !1,
637
- enumerable: !0,
638
- value: null
921
+ enabled: l
922
+ });
923
+ }
924
+ function Si({
925
+ submissionId: t,
926
+ executeQuery: r,
927
+ enabled: o = !0
928
+ }) {
929
+ return $e({
930
+ queryKey: ["assignment-review", "submissions", t],
931
+ queryFn: async () => {
932
+ const s = await r(mi, { submissionId: t });
933
+ return bi.parse(s).node.submissionHistoriesConnection.nodes.slice().sort(
934
+ (c, f) => new Date(f.submittedAt).getTime() - new Date(c.submittedAt).getTime()
935
+ );
639
936
  },
640
- allowCustomizedBuiltInElements: {
641
- writable: !0,
642
- configurable: !1,
643
- enumerable: !0,
644
- value: !1
937
+ enabled: o
938
+ });
939
+ }
940
+ function yi(t) {
941
+ if (!t) return "";
942
+ const r = new Date(t);
943
+ return Number.isNaN(r.getTime()) ? "" : r.toLocaleDateString();
944
+ }
945
+ function Ei({
946
+ submission: t,
947
+ isSelected: r,
948
+ isDraft: o = !1,
949
+ pointsPossible: s,
950
+ onClick: l
951
+ }) {
952
+ const c = B(), f = o ? c.submissionCurrentAttempt() : c.commentsAttempt({ number: t.attempt }), b = t.score != null && s != null ? `${t.score}/${s}` : null;
953
+ return /* @__PURE__ */ i(
954
+ Y,
955
+ {
956
+ as: "div",
957
+ padding: "small medium",
958
+ borderWidth: "small",
959
+ borderColor: r ? "brand" : "primary",
960
+ borderRadius: "medium",
961
+ background: r ? "secondary" : "primary",
962
+ cursor: "pointer",
963
+ onClick: l,
964
+ role: "button",
965
+ tabIndex: 0,
966
+ onKeyDown: (m) => {
967
+ (m.key === "Enter" || m.key === " ") && (m.preventDefault(), l());
968
+ },
969
+ children: /* @__PURE__ */ _(h, { justifyItems: "space-between", alignItems: "center", children: [
970
+ /* @__PURE__ */ _(h, { direction: "column", gap: "xx-small", children: [
971
+ /* @__PURE__ */ _(h, { gap: "small", alignItems: "center", children: [
972
+ /* @__PURE__ */ i(y, { weight: "bold", children: f }),
973
+ o && /* @__PURE__ */ i(ft, { color: "info", children: c.submissionDraft() })
974
+ ] }),
975
+ !o && t.submittedAt && /* @__PURE__ */ i(y, { size: "small", color: "secondary", children: yi(t.submittedAt) })
976
+ ] }),
977
+ b && /* @__PURE__ */ i(y, { weight: "bold", children: b })
978
+ ] })
645
979
  }
646
- })), ue = null, Ce = null;
647
- const Q = Object.seal(ke(null, {
648
- tagCheck: {
649
- writable: !0,
650
- configurable: !1,
651
- enumerable: !0,
652
- value: null
980
+ );
981
+ }
982
+ function Ii({
983
+ submissionId: t,
984
+ selectedAttempt: r,
985
+ onAttemptSelect: o,
986
+ pointsPossible: s,
987
+ executeQuery: l
988
+ }) {
989
+ const c = B(), { data: f, isLoading: b, isError: m } = Si({
990
+ submissionId: t,
991
+ executeQuery: l
992
+ });
993
+ if (b)
994
+ return /* @__PURE__ */ i(h, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ i(He, { renderTitle: c.navigationAttempts(), size: "small" }) });
995
+ if (m)
996
+ return /* @__PURE__ */ i(h, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ i(y, { color: "danger", children: c.submissionLoadAttemptsError() }) });
997
+ const p = (f == null ? void 0 : f.filter((g) => g.attempt > 0)) ?? [];
998
+ return p.length === 0 ? /* @__PURE__ */ i(h, { padding: "medium", children: /* @__PURE__ */ i(y, { color: "secondary", children: c.submissionNoAttempts() }) }) : /* @__PURE__ */ i(h, { direction: "column", gap: "x-small", padding: "none none medium none", children: p.map((g) => /* @__PURE__ */ i(
999
+ Ei,
1000
+ {
1001
+ submission: g,
1002
+ isSelected: r === g.attempt,
1003
+ pointsPossible: s,
1004
+ onClick: () => o(g)
653
1005
  },
654
- attributeCheck: {
655
- writable: !0,
656
- configurable: !1,
657
- enumerable: !0,
658
- value: null
659
- }
660
- }));
661
- let gt = !0, He = !0, ht = !1, bt = !0, re = !1, De = !0, te = !1, Ge = !1, Be = !1, oe = !1, Re = !1, we = !1, Tt = !0, _t = !1;
662
- const pn = "user-content-";
663
- let We = !0, de = !1, se = {}, W = null;
664
- const qe = h({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
665
- let St = null;
666
- const yt = h({}, ["audio", "video", "img", "source", "image", "track"]);
667
- let Ye = null;
668
- const At = h({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ve = "http://www.w3.org/1998/Math/MathML", Le = "http://www.w3.org/2000/svg", X = "http://www.w3.org/1999/xhtml";
669
- let ae = X, Xe = !1, Ke = null;
670
- const gn = h({}, [ve, Le, X], Je);
671
- let Ne = h({}, ["mi", "mo", "mn", "ms", "mtext"]), Oe = h({}, ["annotation-xml"]);
672
- const hn = h({}, ["title", "style", "font", "a", "script"]);
673
- let fe = null;
674
- const bn = ["application/xhtml+xml", "text/html"], Tn = "text/html";
675
- let w = null, le = null;
676
- const _n = o.createElement("form"), Et = function(e) {
677
- return e instanceof RegExp || e instanceof Function;
678
- }, Ve = function() {
679
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
680
- if (!(le && le === e)) {
681
- if ((!e || typeof e != "object") && (e = {}), e = Y(e), fe = // eslint-disable-next-line unicorn/prefer-includes
682
- bn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? Tn : e.PARSER_MEDIA_TYPE, w = fe === "application/xhtml+xml" ? Je : Pe, v = H(e, "ALLOWED_TAGS") ? h({}, e.ALLOWED_TAGS, w) : ft, N = H(e, "ALLOWED_ATTR") ? h({}, e.ALLOWED_ATTR, w) : pt, Ke = H(e, "ALLOWED_NAMESPACES") ? h({}, e.ALLOWED_NAMESPACES, Je) : gn, Ye = H(e, "ADD_URI_SAFE_ATTR") ? h(Y(At), e.ADD_URI_SAFE_ATTR, w) : At, St = H(e, "ADD_DATA_URI_TAGS") ? h(Y(yt), e.ADD_DATA_URI_TAGS, w) : yt, W = H(e, "FORBID_CONTENTS") ? h({}, e.FORBID_CONTENTS, w) : qe, ue = H(e, "FORBID_TAGS") ? h({}, e.FORBID_TAGS, w) : Y({}), Ce = H(e, "FORBID_ATTR") ? h({}, e.FORBID_ATTR, w) : Y({}), se = H(e, "USE_PROFILES") ? e.USE_PROFILES : !1, gt = e.ALLOW_ARIA_ATTR !== !1, He = e.ALLOW_DATA_ATTR !== !1, ht = e.ALLOW_UNKNOWN_PROTOCOLS || !1, bt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, re = e.SAFE_FOR_TEMPLATES || !1, De = e.SAFE_FOR_XML !== !1, te = e.WHOLE_DOCUMENT || !1, oe = e.RETURN_DOM || !1, Re = e.RETURN_DOM_FRAGMENT || !1, we = e.RETURN_TRUSTED_TYPE || !1, Be = e.FORCE_BODY || !1, Tt = e.SANITIZE_DOM !== !1, _t = e.SANITIZE_NAMED_PROPS || !1, We = e.KEEP_CONTENT !== !1, de = e.IN_PLACE || !1, dt = e.ALLOWED_URI_REGEXP || nn, ae = e.NAMESPACE || X, Ne = e.MATHML_TEXT_INTEGRATION_POINTS || Ne, Oe = e.HTML_INTEGRATION_POINTS || Oe, C = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && Et(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (C.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && Et(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (C.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (C.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), re && (He = !1), Re && (oe = !0), se && (v = h({}, zt), N = ke(null), se.html === !0 && (h(v, Ut), h(N, jt)), se.svg === !0 && (h(v, tt), h(N, rt), h(N, xe)), se.svgFilters === !0 && (h(v, nt), h(N, rt), h(N, xe)), se.mathMl === !0 && (h(v, it), h(N, $t), h(N, xe))), H(e, "ADD_TAGS") || (Q.tagCheck = null), H(e, "ADD_ATTR") || (Q.attributeCheck = null), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? Q.tagCheck = e.ADD_TAGS : (v === ft && (v = Y(v)), h(v, e.ADD_TAGS, w))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? Q.attributeCheck = e.ADD_ATTR : (N === pt && (N = Y(N)), h(N, e.ADD_ATTR, w))), e.ADD_URI_SAFE_ATTR && h(Ye, e.ADD_URI_SAFE_ATTR, w), e.FORBID_CONTENTS && (W === qe && (W = Y(W)), h(W, e.FORBID_CONTENTS, w)), e.ADD_FORBID_CONTENTS && (W === qe && (W = Y(W)), h(W, e.ADD_FORBID_CONTENTS, w)), We && (v["#text"] = !0), te && h(v, ["html", "head", "body"]), v.table && (h(v, ["tbody"]), delete ue.tbody), e.TRUSTED_TYPES_POLICY) {
683
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
684
- throw he('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
685
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
686
- throw he('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
687
- L = e.TRUSTED_TYPES_POLICY, ee = L.createHTML("");
688
- } else
689
- L === void 0 && (L = Ti(A, l)), L !== null && typeof ee == "string" && (ee = L.createHTML(""));
690
- F && F(e), le = e;
691
- }
692
- }, It = h({}, [...tt, ...nt, ...ai]), Ct = h({}, [...it, ...li]), Sn = function(e) {
693
- let s = ie(e);
694
- (!s || !s.tagName) && (s = {
695
- namespaceURI: ae,
696
- tagName: "template"
697
- });
698
- const m = Pe(e.tagName), E = Pe(s.tagName);
699
- return Ke[e.namespaceURI] ? e.namespaceURI === Le ? s.namespaceURI === X ? m === "svg" : s.namespaceURI === ve ? m === "svg" && (E === "annotation-xml" || Ne[E]) : !!It[m] : e.namespaceURI === ve ? s.namespaceURI === X ? m === "math" : s.namespaceURI === Le ? m === "math" && Oe[E] : !!Ct[m] : e.namespaceURI === X ? s.namespaceURI === Le && !Oe[E] || s.namespaceURI === ve && !Ne[E] ? !1 : !Ct[m] && (hn[m] || !It[m]) : !!(fe === "application/xhtml+xml" && Ke[e.namespaceURI]) : !1;
700
- }, q = function(e) {
701
- pe(i.removed, {
702
- element: e
703
- });
704
- try {
705
- ie(e).removeChild(e);
706
- } catch {
707
- ye(e);
708
- }
709
- }, ne = function(e, s) {
710
- try {
711
- pe(i.removed, {
712
- attribute: s.getAttributeNode(e),
713
- from: s
714
- });
715
- } catch {
716
- pe(i.removed, {
717
- attribute: null,
718
- from: s
719
- });
720
- }
721
- if (s.removeAttribute(e), e === "is")
722
- if (oe || Re)
723
- try {
724
- q(s);
725
- } catch {
726
- }
727
- else
728
- try {
729
- s.setAttribute(e, "");
730
- } catch {
731
- }
732
- }, Dt = function(e) {
733
- let s = null, m = null;
734
- if (Be)
735
- e = "<remove></remove>" + e;
736
- else {
737
- const R = et(e, /^[\r\n\t ]+/);
738
- m = R && R[0];
739
- }
740
- fe === "application/xhtml+xml" && ae === X && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
741
- const E = L ? L.createHTML(e) : e;
742
- if (ae === X)
743
- try {
744
- s = new I().parseFromString(E, fe);
745
- } catch {
746
- }
747
- if (!s || !s.documentElement) {
748
- s = z.createDocument(ae, "template", null);
749
- try {
750
- s.documentElement.innerHTML = Xe ? ee : E;
751
- } catch {
752
- }
753
- }
754
- const M = s.body || s.documentElement;
755
- return e && m && M.insertBefore(o.createTextNode(m), M.childNodes[0] || null), ae === X ? ln.call(s, te ? "html" : "body")[0] : te ? s.documentElement : M;
756
- }, Rt = function(e) {
757
- return $.call(
758
- e.ownerDocument || e,
759
- e,
760
- // eslint-disable-next-line no-bitwise
761
- p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION,
762
- null
763
- );
764
- }, Ze = function(e) {
765
- return e instanceof D && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof _) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
766
- }, wt = function(e) {
767
- return typeof b == "function" && e instanceof b;
768
- };
769
- function K(d, e, s) {
770
- Me(d, (m) => {
771
- m.call(i, e, s, le);
772
- });
773
- }
774
- const vt = function(e) {
775
- let s = null;
776
- if (K(x.beforeSanitizeElements, e, null), Ze(e))
777
- return q(e), !0;
778
- const m = w(e.nodeName);
779
- if (K(x.uponSanitizeElement, e, {
780
- tagName: m,
781
- allowedTags: v
782
- }), De && e.hasChildNodes() && !wt(e.firstElementChild) && k(/<[/\w!]/g, e.innerHTML) && k(/<[/\w!]/g, e.textContent) || e.nodeType === Te.progressingInstruction || De && e.nodeType === Te.comment && k(/<[/\w]/g, e.data))
783
- return q(e), !0;
784
- if (!(Q.tagCheck instanceof Function && Q.tagCheck(m)) && (!v[m] || ue[m])) {
785
- if (!ue[m] && Nt(m) && (C.tagNameCheck instanceof RegExp && k(C.tagNameCheck, m) || C.tagNameCheck instanceof Function && C.tagNameCheck(m)))
786
- return !1;
787
- if (We && !W[m]) {
788
- const E = ie(e) || e.parentNode, M = Ee(e) || e.childNodes;
789
- if (M && E) {
790
- const R = M.length;
791
- for (let j = R - 1; j >= 0; --j) {
792
- const V = me(M[j], !0);
793
- V.__removalCount = (e.__removalCount || 0) + 1, E.insertBefore(V, Ae(e));
794
- }
795
- }
796
- }
797
- return q(e), !0;
798
- }
799
- return e instanceof u && !Sn(e) || (m === "noscript" || m === "noembed" || m === "noframes") && k(/<\/no(script|embed|frames)/i, e.innerHTML) ? (q(e), !0) : (re && e.nodeType === Te.text && (s = e.textContent, Me([ze, je, $e], (E) => {
800
- s = ge(s, E, " ");
801
- }), e.textContent !== s && (pe(i.removed, {
802
- element: e.cloneNode()
803
- }), e.textContent = s)), K(x.afterSanitizeElements, e, null), !1);
804
- }, Lt = function(e, s, m) {
805
- if (Ce[s] || Tt && (s === "id" || s === "name") && (m in o || m in _n))
806
- return !1;
807
- if (!(He && !Ce[s] && k(mn, s))) {
808
- if (!(gt && k(un, s))) {
809
- if (!(Q.attributeCheck instanceof Function && Q.attributeCheck(s, e))) {
810
- if (!N[s] || Ce[s]) {
811
- if (
812
- // First condition does a very basic check if a) it's basically a valid custom element tagname AND
813
- // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
814
- // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
815
- !(Nt(e) && (C.tagNameCheck instanceof RegExp && k(C.tagNameCheck, e) || C.tagNameCheck instanceof Function && C.tagNameCheck(e)) && (C.attributeNameCheck instanceof RegExp && k(C.attributeNameCheck, s) || C.attributeNameCheck instanceof Function && C.attributeNameCheck(s, e)) || // Alternative, second condition checks if it's an `is`-attribute, AND
816
- // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
817
- s === "is" && C.allowCustomizedBuiltInElements && (C.tagNameCheck instanceof RegExp && k(C.tagNameCheck, m) || C.tagNameCheck instanceof Function && C.tagNameCheck(m)))
818
- ) return !1;
819
- } else if (!Ye[s]) {
820
- if (!k(dt, ge(m, ut, ""))) {
821
- if (!((s === "src" || s === "xlink:href" || s === "href") && e !== "script" && ii(m, "data:") === 0 && St[e])) {
822
- if (!(ht && !k(dn, ge(m, ut, "")))) {
823
- if (m)
824
- return !1;
825
- }
826
- }
827
- }
828
- }
829
- }
830
- }
831
- }
832
- return !0;
833
- }, Nt = function(e) {
834
- return e !== "annotation-xml" && et(e, fn);
835
- }, Ot = function(e) {
836
- K(x.beforeSanitizeAttributes, e, null);
837
- const {
838
- attributes: s
839
- } = e;
840
- if (!s || Ze(e))
841
- return;
842
- const m = {
843
- attrName: "",
844
- attrValue: "",
845
- keepAttr: !0,
846
- allowedAttributes: N,
847
- forceKeepAttr: void 0
848
- };
849
- let E = s.length;
850
- for (; E--; ) {
851
- const M = s[E], {
852
- name: R,
853
- namespaceURI: j,
854
- value: V
855
- } = M, ce = w(R), Qe = V;
856
- let O = R === "value" ? Qe : ri(Qe);
857
- if (m.attrName = ce, m.attrValue = O, m.keepAttr = !0, m.forceKeepAttr = void 0, K(x.uponSanitizeAttribute, e, m), O = m.attrValue, _t && (ce === "id" || ce === "name") && (ne(R, e), O = pn + O), De && k(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, O)) {
858
- ne(R, e);
859
- continue;
860
- }
861
- if (ce === "attributename" && et(O, "href")) {
862
- ne(R, e);
863
- continue;
864
- }
865
- if (m.forceKeepAttr)
866
- continue;
867
- if (!m.keepAttr) {
868
- ne(R, e);
869
- continue;
870
- }
871
- if (!bt && k(/\/>/i, O)) {
872
- ne(R, e);
873
- continue;
874
- }
875
- re && Me([ze, je, $e], (xt) => {
876
- O = ge(O, xt, " ");
877
- });
878
- const Mt = w(e.nodeName);
879
- if (!Lt(Mt, ce, O)) {
880
- ne(R, e);
881
- continue;
882
- }
883
- if (L && typeof A == "object" && typeof A.getAttributeType == "function" && !j)
884
- switch (A.getAttributeType(Mt, ce)) {
885
- case "TrustedHTML": {
886
- O = L.createHTML(O);
887
- break;
888
- }
889
- case "TrustedScriptURL": {
890
- O = L.createScriptURL(O);
891
- break;
892
- }
893
- }
894
- if (O !== Qe)
895
- try {
896
- j ? e.setAttributeNS(j, R, O) : e.setAttribute(R, O), Ze(e) ? q(e) : Ft(i.removed);
897
- } catch {
898
- ne(R, e);
899
- }
900
- }
901
- K(x.afterSanitizeAttributes, e, null);
902
- }, yn = function d(e) {
903
- let s = null;
904
- const m = Rt(e);
905
- for (K(x.beforeSanitizeShadowDOM, e, null); s = m.nextNode(); )
906
- K(x.uponSanitizeShadowNode, s, null), vt(s), Ot(s), s.content instanceof c && d(s.content);
907
- K(x.afterSanitizeShadowDOM, e, null);
908
- };
909
- return i.sanitize = function(d) {
910
- let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, m = null, E = null, M = null;
911
- if (Xe = !d, Xe && (d = "<!-->"), typeof d != "string" && !wt(d))
912
- if (typeof d.toString == "function") {
913
- if (d = d.toString(), typeof d != "string")
914
- throw he("dirty is not a string, aborting");
915
- } else
916
- throw he("toString is not a function");
917
- if (!i.isSupported)
918
- return d;
919
- if (Ge || Ve(e), i.removed = [], typeof d == "string" && (de = !1), de) {
920
- if (d.nodeName) {
921
- const V = w(d.nodeName);
922
- if (!v[V] || ue[V])
923
- throw he("root node is forbidden and cannot be sanitized in-place");
924
- }
925
- } else if (d instanceof b)
926
- s = Dt("<!---->"), m = s.ownerDocument.importNode(d, !0), m.nodeType === Te.element && m.nodeName === "BODY" || m.nodeName === "HTML" ? s = m : s.appendChild(m);
927
- else {
928
- if (!oe && !re && !te && // eslint-disable-next-line unicorn/prefer-includes
929
- d.indexOf("<") === -1)
930
- return L && we ? L.createHTML(d) : d;
931
- if (s = Dt(d), !s)
932
- return oe ? null : we ? ee : "";
933
- }
934
- s && Be && q(s.firstChild);
935
- const R = Rt(de ? d : s);
936
- for (; E = R.nextNode(); )
937
- vt(E), Ot(E), E.content instanceof c && yn(E.content);
938
- if (de)
939
- return d;
940
- if (oe) {
941
- if (Re)
942
- for (M = Ie.call(s.ownerDocument); s.firstChild; )
943
- M.appendChild(s.firstChild);
944
- else
945
- M = s;
946
- return (N.shadowroot || N.shadowrootmode) && (M = cn.call(a, M, !0)), M;
947
- }
948
- let j = te ? s.outerHTML : s.innerHTML;
949
- return te && v["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && k(rn, s.ownerDocument.doctype.name) && (j = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
950
- ` + j), re && Me([ze, je, $e], (V) => {
951
- j = ge(j, V, " ");
952
- }), L && we ? L.createHTML(j) : j;
953
- }, i.setConfig = function() {
954
- let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
955
- Ve(d), Ge = !0;
956
- }, i.clearConfig = function() {
957
- le = null, Ge = !1;
958
- }, i.isValidAttribute = function(d, e, s) {
959
- le || Ve({});
960
- const m = w(d), E = w(e);
961
- return Lt(m, E, s);
962
- }, i.addHook = function(d, e) {
963
- typeof e == "function" && pe(x[d], e);
964
- }, i.removeHook = function(d, e) {
965
- if (e !== void 0) {
966
- const s = ti(x[d], e);
967
- return s === -1 ? void 0 : ni(x[d], s, 1)[0];
968
- }
969
- return Ft(x[d]);
970
- }, i.removeHooks = function(d) {
971
- x[d] = [];
972
- }, i.removeAllHooks = function() {
973
- x = Gt();
974
- }, i;
1006
+ g.attempt
1007
+ )) });
975
1008
  }
976
- var sn = on();
977
- function an({
1009
+ function un({
978
1010
  attachments: t,
979
- size: i = "medium"
1011
+ size: r = "medium"
980
1012
  }) {
981
- return t.length === 0 ? null : /* @__PURE__ */ r(g, { direction: "column", gap: "x-small", children: t.map((o) => /* @__PURE__ */ r(
982
- Z,
1013
+ return t.length === 0 ? null : /* @__PURE__ */ i(h, { direction: "column", gap: "x-small", children: t.map((o) => /* @__PURE__ */ i(
1014
+ Y,
983
1015
  {
984
1016
  as: "div",
985
- padding: i === "small" ? "x-small" : "small medium",
1017
+ padding: r === "small" ? "x-small" : "small medium",
986
1018
  borderColor: "primary",
987
1019
  borderWidth: "small",
988
1020
  borderRadius: "medium",
989
- children: /* @__PURE__ */ S(g, { as: "div", gap: "small", width: "100%", justifyItems: "space-between", alignItems: "center", children: [
990
- /* @__PURE__ */ r(g.Item, { shouldShrink: !0, children: /* @__PURE__ */ r(Vt, { children: o.displayName }) }),
991
- /* @__PURE__ */ r(xn, { href: o.url, isWithinText: !1, renderIcon: /* @__PURE__ */ r(An, {}), children: /* @__PURE__ */ r(mt, { children: `Download ${o.displayName}` }) })
1021
+ children: /* @__PURE__ */ _(h, { as: "div", gap: "small", width: "100%", justifyItems: "space-between", alignItems: "center", children: [
1022
+ /* @__PURE__ */ i(h.Item, { shouldShrink: !0, children: /* @__PURE__ */ i(en, { children: o.displayName }) }),
1023
+ /* @__PURE__ */ i(Fn, { href: o.url, isWithinText: !1, renderIcon: /* @__PURE__ */ i(Ln, {}), children: /* @__PURE__ */ i(pt, { children: `Download ${o.displayName}` }) })
992
1024
  ] })
993
1025
  },
994
1026
  o.id
995
1027
  )) });
996
1028
  }
997
- function _i(t) {
998
- return /* @__PURE__ */ r("span", { dangerouslySetInnerHTML: { __html: sn.sanitize(t) } });
1029
+ function Ci(t) {
1030
+ return /* @__PURE__ */ i("span", { dangerouslySetInnerHTML: { __html: gt.sanitize(t) } });
999
1031
  }
1000
- function ir({
1032
+ function Di({
1001
1033
  submission: t,
1002
- isLastAttempt: i = !0,
1034
+ isLastAttempt: r = !0,
1003
1035
  showAttemptLabel: o = !0,
1004
- renderHTML: a
1036
+ renderHTML: s
1005
1037
  }) {
1006
- const { t: l } = B("assignment-review"), c = a ?? _i, f = (t == null ? void 0 : t.submissionType) === "online_text_entry", b = (t == null ? void 0 : t.submissionType) === "online_upload", u = l(f ? "submission.textHeading" : "submission.uploadHeading"), p = ot(() => {
1038
+ const l = B(), c = s ?? Ci, f = (t == null ? void 0 : t.submissionType) === "online_text_entry", b = (t == null ? void 0 : t.submissionType) === "online_upload", m = f ? l.submissionTextHeading() : l.submissionUploadHeading(), p = je(() => {
1007
1039
  if (!t) return [];
1008
1040
  const D = [];
1009
1041
  if (t.attachment && D.push(t.attachment), t.attachments)
1010
1042
  for (const I of t.attachments)
1011
- D.some((A) => A.id === I.id) || D.push(I);
1043
+ D.some((E) => E.id === I.id) || D.push(I);
1012
1044
  return D;
1013
- }, [t]), _ = ot(() => c((t == null ? void 0 : t.body) ?? ""), [t == null ? void 0 : t.body, c]);
1014
- return t ? /* @__PURE__ */ r(Z, { as: "div", children: /* @__PURE__ */ S(g, { direction: "column", gap: "small", children: [
1015
- o && !i && t.attempt != null && /* @__PURE__ */ r(y, { size: "small", weight: "bold", color: "secondary", children: l("submission.viewingAttempt", { number: t.attempt }) }),
1016
- /* @__PURE__ */ S(g, { gap: "x-small", alignItems: "center", children: [
1017
- /* @__PURE__ */ r(En, { color: "success" }),
1018
- /* @__PURE__ */ r(qt, { level: "h3", children: u })
1045
+ }, [t]), g = je(() => c((t == null ? void 0 : t.body) ?? ""), [t == null ? void 0 : t.body, c]);
1046
+ return t ? /* @__PURE__ */ i(Y, { as: "div", children: /* @__PURE__ */ _(h, { direction: "column", gap: "small", children: [
1047
+ o && !r && t.attempt != null && /* @__PURE__ */ i(y, { size: "small", weight: "bold", color: "secondary", children: l.submissionViewingAttempt({ number: t.attempt }) }),
1048
+ /* @__PURE__ */ _(h, { gap: "x-small", alignItems: "center", children: [
1049
+ /* @__PURE__ */ i(wn, { color: "success" }),
1050
+ /* @__PURE__ */ i(dt, { level: "h3", children: m })
1019
1051
  ] }),
1020
- f && t.body && /* @__PURE__ */ S(g, { alignItems: "stretch", gap: "small", children: [
1021
- /* @__PURE__ */ r(Z, { as: "div", width: "4px", background: "primary", borderRadius: "small" }),
1022
- /* @__PURE__ */ r(Z, { as: "div", children: /* @__PURE__ */ r(y, { children: _ }) })
1023
- ] }),
1024
- b && p.length > 0 && /* @__PURE__ */ r(an, { attachments: p })
1025
- ] }) }) : null;
1026
- }
1027
- function Si(t) {
1028
- return /* @__PURE__ */ r("span", { dangerouslySetInnerHTML: { __html: sn.sanitize(t) } });
1029
- }
1030
- function yi(t) {
1031
- const i = new Date(t);
1032
- return Number.isNaN(i.getTime()) ? "" : i.toLocaleString();
1033
- }
1034
- function Ai({
1035
- comment: t,
1036
- isFullWidth: i,
1037
- renderHTML: o
1038
- }) {
1039
- var u;
1040
- const { t: a } = B("assignment-review"), l = o ?? Si, c = ((u = t.author.courseRoles) == null ? void 0 : u.includes("StudentEnrollment")) ?? !1, f = ot(() => l(t.htmlComment), [t.htmlComment, l]);
1041
- return /* @__PURE__ */ r(
1042
- Z,
1043
- {
1044
- as: "div",
1045
- padding: "small medium",
1046
- borderWidth: "small",
1047
- borderColor: "primary",
1048
- borderRadius: "medium",
1049
- margin: i ? "none" : c ? "none none none medium" : "none medium none none",
1050
- children: /* @__PURE__ */ S(g, { as: "div", direction: "column", gap: "small", children: [
1051
- /* @__PURE__ */ S(g, { as: "div", direction: "column", gap: "xx-small", children: [
1052
- /* @__PURE__ */ S(g, { as: "div", justifyItems: "space-between", alignItems: "center", children: [
1053
- /* @__PURE__ */ r(g.Item, { shouldShrink: !0, children: /* @__PURE__ */ r(y, { weight: "bold", size: "medium", children: /* @__PURE__ */ r(Vt, { children: t.author.shortName }) }) }),
1054
- !t.read && /* @__PURE__ */ r(Zt, { type: "notification", standalone: !0, children: /* @__PURE__ */ r(mt, { children: a("comments.unreadSingle") }) })
1055
- ] }),
1056
- /* @__PURE__ */ r(y, { size: "small", color: "secondary", children: yi(t.createdAt) }),
1057
- t.attempt > 0 && /* @__PURE__ */ r(y, { size: "small", color: "secondary", children: a("comments.attempt", { number: t.attempt }) })
1058
- ] }),
1059
- /* @__PURE__ */ r(y, { size: "medium", children: f }),
1060
- t.attachments && t.attachments.length > 0 && /* @__PURE__ */ r(
1061
- an,
1062
- {
1063
- attachments: t.attachments.map((p) => ({
1064
- ...p,
1065
- _id: p._id ?? p.id,
1066
- submissionPreviewUrl: null
1067
- })),
1068
- size: "small"
1069
- }
1070
- )
1071
- ] })
1072
- }
1073
- );
1074
- }
1075
- function rr({
1076
- existingFiles: t,
1077
- onSubmit: i,
1078
- onSaveDraft: o,
1079
- onDiscardDraft: a,
1080
- onSelectFiles: l,
1081
- isSubmitting: c = !1
1082
- }) {
1083
- const { t: f } = B("assignment-review"), [b, u] = Fe(t ?? []), p = async () => {
1084
- const A = await l();
1085
- u((T) => [...T, ...A]);
1086
- }, _ = (A) => {
1087
- u((T) => T.filter((me) => me.id !== A));
1088
- }, D = b.map((A) => A.id), I = b.length > 0 && !c;
1089
- return /* @__PURE__ */ S(g, { direction: "column", gap: "medium", children: [
1090
- b.length > 0 && /* @__PURE__ */ r(g, { direction: "column", gap: "x-small", children: b.map((A) => /* @__PURE__ */ r(
1091
- Z,
1092
- {
1093
- as: "div",
1094
- padding: "small",
1095
- borderWidth: "small",
1096
- borderColor: "primary",
1097
- borderRadius: "medium",
1098
- children: /* @__PURE__ */ S(g, { justifyItems: "space-between", alignItems: "center", children: [
1099
- /* @__PURE__ */ r(y, { children: A.name }),
1100
- /* @__PURE__ */ r(
1101
- P,
1102
- {
1103
- size: "small",
1104
- renderIcon: () => /* @__PURE__ */ r(In, {}),
1105
- onClick: () => _(A.id),
1106
- children: /* @__PURE__ */ S("span", { className: "screenreader-only", children: [
1107
- "Remove ",
1108
- A.name
1109
- ] })
1110
- }
1111
- )
1112
- ] })
1113
- },
1114
- A.id
1115
- )) }),
1116
- /* @__PURE__ */ r(P, { onClick: p, children: f("submissionForm.addFiles", "Add Files") }),
1117
- /* @__PURE__ */ S(g, { gap: "small", children: [
1118
- /* @__PURE__ */ r(
1119
- P,
1120
- {
1121
- color: "primary",
1122
- onClick: () => i(D),
1123
- interaction: I ? "enabled" : "disabled",
1124
- children: f("submissionForm.submit")
1125
- }
1126
- ),
1127
- o && /* @__PURE__ */ r(
1128
- P,
1129
- {
1130
- onClick: () => o(D),
1131
- interaction: b.length > 0 ? "enabled" : "disabled",
1132
- children: f("submissionForm.saveDraft")
1133
- }
1134
- ),
1135
- a && t && t.length > 0 && /* @__PURE__ */ r(P, { color: "primary-inverse", onClick: a, children: f("submissionForm.discardDraft") })
1136
- ] })
1137
- ] });
1052
+ f && t.body && /* @__PURE__ */ _(h, { alignItems: "stretch", gap: "small", children: [
1053
+ /* @__PURE__ */ i(Y, { as: "div", width: "4px", background: "primary", borderRadius: "small" }),
1054
+ /* @__PURE__ */ i(Y, { as: "div", children: /* @__PURE__ */ i(y, { children: g }) })
1055
+ ] }),
1056
+ b && p.length > 0 && /* @__PURE__ */ i(un, { attachments: p })
1057
+ ] }) }) : null;
1138
1058
  }
1139
- function Ei(t) {
1140
- const i = new Date(t);
1141
- return Number.isNaN(i.getTime()) ? "" : i.toLocaleDateString(void 0, { month: "short", day: "numeric", year: "numeric" });
1059
+ function Ri(t) {
1060
+ const r = new Date(t);
1061
+ return Number.isNaN(r.getTime()) ? "" : r.toLocaleDateString(void 0, { month: "short", day: "numeric", year: "numeric" });
1142
1062
  }
1143
- function Ii() {
1144
- return /* @__PURE__ */ r(y, { color: "secondary", size: "small", children: "|" });
1063
+ function Li() {
1064
+ return /* @__PURE__ */ i(y, { color: "secondary", size: "small", children: "|" });
1145
1065
  }
1146
- function or({
1066
+ function wi({
1147
1067
  score: t,
1148
- pointsPossible: i,
1068
+ pointsPossible: r,
1149
1069
  gradingType: o,
1150
- dueAt: a,
1070
+ dueAt: s,
1151
1071
  allowedAttempts: l,
1152
1072
  currentAttempt: c,
1153
1073
  isOverdue: f,
1154
1074
  estimatedDuration: b,
1155
- labels: u
1075
+ labels: m
1156
1076
  }) {
1157
- const { t: p } = B("assignment-review"), _ = [];
1158
- return b && _.push(
1159
- /* @__PURE__ */ r(y, { size: "small", children: (u == null ? void 0 : u.duration) ?? p("header.duration", { minutes: b }) }, "duration")
1160
- ), t != null && i != null ? _.push(
1161
- /* @__PURE__ */ r(y, { size: "small", children: (u == null ? void 0 : u.score) ?? p("header.score", { score: t, total: i }) }, "score")
1162
- ) : i != null && o !== "not_graded" && _.push(
1163
- /* @__PURE__ */ r(y, { size: "small", children: (u == null ? void 0 : u.pointsPossible) ?? p("header.pointsPossible", { points: i }) }, "points")
1164
- ), l != null && (l === -1 ? _.push(
1165
- /* @__PURE__ */ r(y, { size: "small", children: (u == null ? void 0 : u.attempts) ?? p("header.attemptsUnlimited") }, "attempts")
1166
- ) : c != null ? _.push(
1167
- /* @__PURE__ */ r(y, { size: "small", children: (u == null ? void 0 : u.attempts) ?? p("header.attemptOf", { current: c, total: l }) }, "attempts")
1168
- ) : _.push(
1169
- /* @__PURE__ */ r(y, { size: "small", children: (u == null ? void 0 : u.attempts) ?? p("header.attemptsAllowed", { count: l }) }, "attempts")
1170
- )), a && _.push(
1171
- /* @__PURE__ */ r(y, { size: "small", children: (u == null ? void 0 : u.dueDate) ?? p("header.dueDate", { date: Ei(a) }) }, "due")
1172
- ), /* @__PURE__ */ S(g, { as: "div", direction: "row", alignItems: "center", gap: "small", children: [
1173
- _.map((D, I) => /* @__PURE__ */ S(g, { gap: "small", alignItems: "center", children: [
1174
- I > 0 && /* @__PURE__ */ r(Ii, {}),
1077
+ const p = B(), g = [];
1078
+ return b && g.push(
1079
+ /* @__PURE__ */ i(y, { size: "small", children: (m == null ? void 0 : m.duration) ?? p.headerDuration({ minutes: b }) }, "duration")
1080
+ ), t != null && r != null ? g.push(
1081
+ /* @__PURE__ */ i(y, { size: "small", children: (m == null ? void 0 : m.score) ?? p.headerScore({ score: t, total: r }) }, "score")
1082
+ ) : r != null && o !== "not_graded" && g.push(
1083
+ /* @__PURE__ */ i(y, { size: "small", children: (m == null ? void 0 : m.pointsPossible) ?? p.headerPointsPossible({ points: r }) }, "points")
1084
+ ), l != null && (l === -1 ? g.push(
1085
+ /* @__PURE__ */ i(y, { size: "small", children: (m == null ? void 0 : m.attempts) ?? p.headerAttemptsUnlimited() }, "attempts")
1086
+ ) : c != null ? g.push(
1087
+ /* @__PURE__ */ i(y, { size: "small", children: (m == null ? void 0 : m.attempts) ?? p.headerAttemptOf({ current: c, total: l }) }, "attempts")
1088
+ ) : g.push(
1089
+ /* @__PURE__ */ i(y, { size: "small", children: (m == null ? void 0 : m.attempts) ?? p.headerAttemptsAllowed({ count: l }) }, "attempts")
1090
+ )), s && g.push(
1091
+ /* @__PURE__ */ i(y, { size: "small", children: (m == null ? void 0 : m.dueDate) ?? p.headerDueDate({ date: Ri(s) }) }, "due")
1092
+ ), /* @__PURE__ */ _(h, { as: "div", direction: "row", alignItems: "center", gap: "small", children: [
1093
+ g.map((D, I) => /* @__PURE__ */ _(h, { gap: "small", alignItems: "center", children: [
1094
+ I > 0 && /* @__PURE__ */ i(Li, {}),
1175
1095
  D
1176
1096
  ] }, `item-${String(I)}`)),
1177
- f && /* @__PURE__ */ r(lt, { color: "danger", children: (u == null ? void 0 : u.overdue) ?? p("header.overdue") })
1178
- ] });
1179
- }
1180
- function sr({
1181
- prevItem: t,
1182
- nextItem: i,
1183
- onNavigatePrev: o,
1184
- onNavigateNext: a,
1185
- labels: l
1186
- }) {
1187
- const { t: c } = B("assignment-review");
1188
- if (!t && !i)
1189
- return null;
1190
- const f = (l == null ? void 0 : l.previous) ?? c("navigation.previous"), b = (l == null ? void 0 : l.next) ?? c("navigation.next");
1191
- return /* @__PURE__ */ S(g, { justifyItems: "space-between", padding: "small none", children: [
1192
- t ? /* @__PURE__ */ r(
1193
- P,
1194
- {
1195
- renderIcon: () => /* @__PURE__ */ r(Yt, {}),
1196
- onClick: o,
1197
- "aria-label": `${f}: ${t.title}`,
1198
- children: f
1199
- }
1200
- ) : /* @__PURE__ */ r("div", {}),
1201
- i ? /* @__PURE__ */ r(
1202
- P,
1203
- {
1204
- renderIcon: () => /* @__PURE__ */ r(Xt, {}),
1205
- onClick: a,
1206
- "aria-label": `${b}: ${i.title}`,
1207
- children: b
1208
- }
1209
- ) : /* @__PURE__ */ r("div", {})
1210
- ] });
1211
- }
1212
- function Ci(t) {
1213
- switch (t) {
1214
- case "Assignment":
1215
- return /* @__PURE__ */ r(vn, {});
1216
- case "Quiz":
1217
- return /* @__PURE__ */ r(wn, {});
1218
- case "Discussion":
1219
- return /* @__PURE__ */ r(Rn, {});
1220
- case "Page":
1221
- return /* @__PURE__ */ r(kt, {});
1222
- case "ExternalUrl":
1223
- case "ExternalTool":
1224
- return /* @__PURE__ */ r(Dn, {});
1225
- default:
1226
- return /* @__PURE__ */ r(kt, {});
1227
- }
1228
- }
1229
- function Di({
1230
- item: t,
1231
- isSelected: i,
1232
- isLoadingItem: o,
1233
- onClick: a
1234
- }) {
1235
- var u, p, _, D, I;
1236
- const { t: l } = B("assignment-review"), c = ((u = t.content_details) == null ? void 0 : u.locked_for_user) ?? !1, f = (p = t.content_details) == null ? void 0 : p.lock_explanation, b = /* @__PURE__ */ r(
1237
- Z,
1238
- {
1239
- as: "div",
1240
- padding: "small",
1241
- background: i ? "secondary" : "primary",
1242
- borderRadius: "small",
1243
- cursor: c ? "not-allowed" : "pointer",
1244
- onClick: c ? void 0 : a,
1245
- role: c ? void 0 : "button",
1246
- tabIndex: c ? void 0 : 0,
1247
- onKeyDown: c ? void 0 : (A) => {
1248
- (A.key === "Enter" || A.key === " ") && (A.preventDefault(), a());
1249
- },
1250
- children: /* @__PURE__ */ S(g, { gap: "small", alignItems: "center", children: [
1251
- /* @__PURE__ */ r(g.Item, { children: c ? /* @__PURE__ */ r(Kt, {}) : Ci(t.type) }),
1252
- /* @__PURE__ */ r(g.Item, { shouldGrow: !0, shouldShrink: !0, children: /* @__PURE__ */ S(g, { direction: "column", gap: "xx-small", children: [
1253
- /* @__PURE__ */ r(y, { weight: i ? "bold" : "normal", size: "small", children: t.title }),
1254
- ((_ = t.content_details) == null ? void 0 : _.due_at) && /* @__PURE__ */ r(y, { size: "x-small", color: "secondary", children: l("progress.dueDate", "Due {{date}}", {
1255
- date: new Date(t.content_details.due_at).toLocaleDateString()
1256
- }) }),
1257
- ((D = t.content_details) == null ? void 0 : D.points_possible) != null && /* @__PURE__ */ r(y, { size: "x-small", color: "secondary", children: l("progress.points", "{{points}} pts", {
1258
- points: t.content_details.points_possible
1259
- }) })
1260
- ] }) }),
1261
- o && /* @__PURE__ */ r(ct, { size: "x-small", renderTitle: l("progress.loading", "Loading") }),
1262
- ((I = t.completion_requirement) == null ? void 0 : I.completed) && /* @__PURE__ */ r(y, { color: "success", size: "small", children: "✓" })
1263
- ] })
1264
- }
1265
- );
1266
- return c && f ? /* @__PURE__ */ r(Pn, { renderTip: f, placement: "end", children: b }) : b;
1267
- }
1268
- function ar({
1269
- module: t,
1270
- currentItemId: i,
1271
- onItemClick: o,
1272
- onClose: a,
1273
- onNavigateModule: l,
1274
- hasPrevModule: c = !1,
1275
- hasNextModule: f = !1,
1276
- isLoading: b = !1,
1277
- title: u
1278
- }) {
1279
- var D;
1280
- const { t: p } = B("assignment-review"), _ = u ?? p("navigation.myProgress");
1281
- return /* @__PURE__ */ S(g, { direction: "column", height: "100%", children: [
1282
- /* @__PURE__ */ S(g, { justifyItems: "space-between", alignItems: "center", padding: "small", children: [
1283
- /* @__PURE__ */ r(qt, { level: "h3", children: _ }),
1284
- /* @__PURE__ */ r(
1285
- kn,
1286
- {
1287
- screenReaderLabel: p("navigation.closePanel", "Close"),
1288
- onClick: a,
1289
- size: "small",
1290
- children: /* @__PURE__ */ r(Cn, {})
1291
- }
1292
- )
1293
- ] }),
1294
- /* @__PURE__ */ S(Z, { as: "div", padding: "none small", overflowY: "auto", children: [
1295
- t.state === "locked" && /* @__PURE__ */ r(g, { padding: "none none small", children: /* @__PURE__ */ S(lt, { color: "warning", children: [
1296
- /* @__PURE__ */ r(Kt, {}),
1297
- " ",
1298
- p("progress.locked", "Locked")
1299
- ] }) }),
1300
- /* @__PURE__ */ r(y, { weight: "bold", size: "medium", children: t.name }),
1301
- /* @__PURE__ */ r(g, { direction: "column", gap: "xx-small", padding: "small none", children: (D = t.items) == null ? void 0 : D.map((I) => /* @__PURE__ */ r(
1302
- Di,
1303
- {
1304
- item: I,
1305
- isSelected: I.id === i,
1306
- isLoadingItem: b && I.id === i,
1307
- onClick: () => o(I)
1308
- },
1309
- I.id
1310
- )) })
1311
- ] }),
1312
- l && /* @__PURE__ */ S(g, { justifyItems: "space-between", padding: "small", children: [
1313
- /* @__PURE__ */ r(
1314
- P,
1315
- {
1316
- renderIcon: () => /* @__PURE__ */ r(Yt, {}),
1317
- size: "small",
1318
- interaction: c ? "enabled" : "disabled",
1319
- onClick: () => l("prev"),
1320
- "aria-label": p("navigation.previousModule", "Previous module"),
1321
- children: p("navigation.previous")
1322
- }
1323
- ),
1324
- /* @__PURE__ */ r(
1325
- P,
1326
- {
1327
- renderIcon: () => /* @__PURE__ */ r(Xt, {}),
1328
- size: "small",
1329
- interaction: f ? "enabled" : "disabled",
1330
- onClick: () => l("next"),
1331
- "aria-label": p("navigation.nextModule", "Next module"),
1332
- children: p("navigation.next")
1333
- }
1334
- )
1335
- ] })
1097
+ f && /* @__PURE__ */ i(ft, { color: "danger", children: (m == null ? void 0 : m.overdue) ?? p.headerOverdue() })
1336
1098
  ] });
1337
1099
  }
1338
- const Ri = J`
1100
+ const vi = ne`
1339
1101
  mutation CreateSubmissionComment(
1340
1102
  $id: ID!
1341
1103
  $submissionAttempt: Int!
@@ -1425,7 +1187,7 @@ const Ri = J`
1425
1187
  mimeClass
1426
1188
  url
1427
1189
  }
1428
- `, wi = J`
1190
+ `, Ni = ne`
1429
1191
  mutation MarkSubmissionCommentsRead(
1430
1192
  $submissionId: ID!
1431
1193
  $submissionCommentIds: [ID!]!
@@ -1442,7 +1204,7 @@ const Ri = J`
1442
1204
  }
1443
1205
  }
1444
1206
  }
1445
- `, lr = J`
1207
+ `, dr = ne`
1446
1208
  mutation CreateSubmission(
1447
1209
  $assignmentLid: ID!
1448
1210
  $submissionType: OnlineSubmissionType!
@@ -1470,7 +1232,7 @@ const Ri = J`
1470
1232
  }
1471
1233
  }
1472
1234
  }
1473
- `, cr = J`
1235
+ `, fr = ne`
1474
1236
  mutation CreateSubmissionDraft(
1475
1237
  $submissionId: ID!
1476
1238
  $submissionType: DraftableSubmissionType!
@@ -1496,7 +1258,7 @@ const Ri = J`
1496
1258
  }
1497
1259
  }
1498
1260
  }
1499
- `, mr = J`
1261
+ `, pr = ne`
1500
1262
  mutation DeleteSubmissionDraft($submissionId: ID!) {
1501
1263
  deleteSubmissionDraft(input: { submissionId: $submissionId }) {
1502
1264
  submissionDraftIds
@@ -1507,57 +1269,57 @@ const Ri = J`
1507
1269
  }
1508
1270
  }
1509
1271
  `;
1510
- function vi({
1272
+ function Oi({
1511
1273
  executeQuery: t
1512
1274
  }) {
1513
- const i = Bt();
1514
- return Wt({
1515
- mutationFn: async ({ submissionId: o, attempt: a, comment: l, fileIds: c }) => {
1516
- const f = await t(Ri, {
1275
+ const r = Xt();
1276
+ return Kt({
1277
+ mutationFn: async ({ submissionId: o, attempt: s, comment: l, fileIds: c }) => {
1278
+ const f = await t(vi, {
1517
1279
  id: o,
1518
- submissionAttempt: a,
1280
+ submissionAttempt: s,
1519
1281
  comment: l,
1520
1282
  fileIds: c
1521
1283
  });
1522
- return Kn.parse(f), f;
1284
+ return Ti.parse(f), f;
1523
1285
  },
1524
- onSuccess: (o, a) => {
1525
- i.invalidateQueries({
1526
- queryKey: ["assignment-review", "submission-comments", a.submissionId]
1286
+ onSuccess: (o, s) => {
1287
+ r.invalidateQueries({
1288
+ queryKey: ["assignment-review", "submission-comments", s.submissionId]
1527
1289
  });
1528
1290
  }
1529
1291
  });
1530
1292
  }
1531
- function Li({
1293
+ function Mi({
1532
1294
  submissionId: t,
1533
- courseId: i,
1295
+ courseId: r,
1534
1296
  pageParams: o,
1535
- direction: a,
1297
+ direction: s,
1536
1298
  executeQuery: l,
1537
1299
  enabled: c
1538
1300
  }) {
1539
- return Ue({
1301
+ return $e({
1540
1302
  queryKey: [
1541
1303
  "assignment-review",
1542
1304
  "submission-comments",
1543
1305
  t,
1544
- i,
1306
+ r,
1545
1307
  o == null ? void 0 : o.startCursor,
1546
1308
  o == null ? void 0 : o.endCursor,
1547
- a
1309
+ s
1548
1310
  ],
1549
1311
  queryFn: async () => {
1550
- const f = await l(jn, {
1312
+ const f = await l(ci, {
1551
1313
  submissionId: t,
1552
- courseId: i,
1553
- beforeCursor: a === "prev" ? (o == null ? void 0 : o.startCursor) ?? null : null,
1554
- afterCursor: a === "next" ? (o == null ? void 0 : o.endCursor) ?? null : null,
1555
- first: a === "next" ? 5 : null,
1556
- last: a === "prev" || !a ? 5 : null
1557
- }), b = qn.parse(f);
1314
+ courseId: r,
1315
+ beforeCursor: s === "prev" ? (o == null ? void 0 : o.startCursor) ?? null : null,
1316
+ afterCursor: s === "next" ? (o == null ? void 0 : o.endCursor) ?? null : null,
1317
+ first: s === "next" ? 5 : null,
1318
+ last: s === "prev" || !s ? 5 : null
1319
+ }), b = gi.parse(f);
1558
1320
  return {
1559
1321
  comments: [...b.submissionComments.commentsConnection.nodes].sort(
1560
- (p, _) => new Date(p.createdAt).getTime() - new Date(_.createdAt).getTime()
1322
+ (p, g) => new Date(p.createdAt).getTime() - new Date(g.createdAt).getTime()
1561
1323
  ),
1562
1324
  pageInfo: b.submissionComments.commentsConnection.pageInfo
1563
1325
  };
@@ -1565,245 +1327,575 @@ function Li({
1565
1327
  enabled: c ?? !!t
1566
1328
  });
1567
1329
  }
1568
- function Ni({
1330
+ function xi({
1569
1331
  executeQuery: t
1570
1332
  }) {
1571
- const i = Bt();
1572
- return Wt({
1573
- mutationFn: async ({ submissionId: o, submissionCommentIds: a }) => {
1333
+ const r = Xt();
1334
+ return Kt({
1335
+ mutationFn: async ({ submissionId: o, submissionCommentIds: s }) => {
1574
1336
  const l = await t(
1575
- wi,
1576
- { submissionId: o, submissionCommentIds: a }
1337
+ Ni,
1338
+ { submissionId: o, submissionCommentIds: s }
1577
1339
  );
1578
- return Vn.parse(l), l;
1340
+ return Ai.parse(l), l;
1579
1341
  },
1580
- onSuccess: (o, a) => {
1581
- i.invalidateQueries({
1342
+ onSuccess: (o, s) => {
1343
+ r.invalidateQueries({
1582
1344
  queryKey: ["assignment-review", "assignment"],
1583
- predicate: (l) => l.queryKey.includes(a.assignmentId)
1345
+ predicate: (l) => l.queryKey.includes(s.assignmentId)
1584
1346
  });
1585
1347
  }
1586
1348
  });
1587
1349
  }
1588
- function ur({
1350
+ function ki(t) {
1351
+ return /* @__PURE__ */ i("span", { dangerouslySetInnerHTML: { __html: gt.sanitize(t) } });
1352
+ }
1353
+ function Pi(t) {
1354
+ const r = new Date(t);
1355
+ return Number.isNaN(r.getTime()) ? "" : r.toLocaleString();
1356
+ }
1357
+ function Ui({
1358
+ comment: t,
1359
+ isFullWidth: r,
1360
+ renderHTML: o
1361
+ }) {
1362
+ var m;
1363
+ const s = B(), l = o ?? ki, c = ((m = t.author.courseRoles) == null ? void 0 : m.includes("StudentEnrollment")) ?? !1, f = je(() => l(t.htmlComment), [t.htmlComment, l]);
1364
+ return /* @__PURE__ */ i(
1365
+ Y,
1366
+ {
1367
+ as: "div",
1368
+ padding: "small medium",
1369
+ borderWidth: "small",
1370
+ borderColor: "primary",
1371
+ borderRadius: "medium",
1372
+ margin: r ? "none" : c ? "none none none medium" : "none medium none none",
1373
+ children: /* @__PURE__ */ _(h, { as: "div", direction: "column", gap: "small", children: [
1374
+ /* @__PURE__ */ _(h, { as: "div", direction: "column", gap: "xx-small", children: [
1375
+ /* @__PURE__ */ _(h, { as: "div", justifyItems: "space-between", alignItems: "center", children: [
1376
+ /* @__PURE__ */ i(h.Item, { shouldShrink: !0, children: /* @__PURE__ */ i(y, { weight: "bold", size: "medium", children: /* @__PURE__ */ i(en, { children: t.author.shortName }) }) }),
1377
+ !t.read && /* @__PURE__ */ i(nn, { type: "notification", standalone: !0, children: /* @__PURE__ */ i(pt, { children: s.commentsUnreadSingle() }) })
1378
+ ] }),
1379
+ /* @__PURE__ */ i(y, { size: "small", color: "secondary", children: Pi(t.createdAt) }),
1380
+ t.attempt > 0 && /* @__PURE__ */ i(y, { size: "small", color: "secondary", children: s.commentsAttempt({ number: t.attempt }) })
1381
+ ] }),
1382
+ /* @__PURE__ */ i(y, { size: "medium", children: f }),
1383
+ t.attachments && t.attachments.length > 0 && /* @__PURE__ */ i(
1384
+ un,
1385
+ {
1386
+ attachments: t.attachments.map((p) => ({
1387
+ ...p,
1388
+ _id: p._id ?? p.id,
1389
+ submissionPreviewUrl: null
1390
+ })),
1391
+ size: "small"
1392
+ }
1393
+ )
1394
+ ] })
1395
+ }
1396
+ );
1397
+ }
1398
+ function Fi({
1589
1399
  submissionId: t,
1590
- courseId: i,
1400
+ courseId: r,
1591
1401
  assignmentId: o,
1592
- attempt: a,
1402
+ attempt: s,
1593
1403
  canPostComment: l,
1594
1404
  onCommentPosted: c,
1595
1405
  renderHTML: f,
1596
1406
  executeQuery: b
1597
1407
  }) {
1598
- const { t: u } = B("assignment-review"), [p, _] = Fe(""), [D, I] = Fe({}), A = On(/* @__PURE__ */ new Set()), { data: T, isLoading: me, isError: ye } = Li({
1408
+ const m = B(), [p, g] = ge(""), [D, I] = ge({}), E = Dn(/* @__PURE__ */ new Set()), { data: T, isLoading: ie, isError: ae } = Mi({
1599
1409
  submissionId: t,
1600
- courseId: i,
1410
+ courseId: r,
1601
1411
  pageParams: D.pageParams,
1602
1412
  direction: D.direction,
1603
1413
  executeQuery: b
1604
- }), Ae = vi({ executeQuery: b }), Ee = Ni({ executeQuery: b });
1605
- Mn(() => {
1414
+ }), re = Oi({ executeQuery: b }), v = xi({ executeQuery: b });
1415
+ ct(() => {
1606
1416
  if (!(T != null && T.comments) || T.comments.length === 0) return;
1607
- const z = T.comments.filter(($) => !$.read && !A.current.has($._id)).filter(($) => {
1608
- var Ie;
1609
- return !((Ie = $.author.courseRoles) != null && Ie.includes("StudentEnrollment"));
1610
- }).map(($) => $._id);
1611
- if (z.length > 0) {
1612
- for (const $ of z)
1613
- A.current.add($);
1614
- Ee.mutate({ submissionId: t, assignmentId: o, submissionCommentIds: z });
1417
+ const k = T.comments.filter((P) => !P.read && !E.current.has(P._id)).filter((P) => {
1418
+ var le;
1419
+ return !((le = P.author.courseRoles) != null && le.includes("StudentEnrollment"));
1420
+ }).map((P) => P._id);
1421
+ if (k.length > 0) {
1422
+ for (const P of k)
1423
+ E.current.add(P);
1424
+ v.mutate({ submissionId: t, assignmentId: o, submissionCommentIds: k });
1615
1425
  }
1616
- }, [T == null ? void 0 : T.comments, t, o, Ee]);
1617
- const ie = T == null ? void 0 : T.comments.some(
1618
- (z) => {
1619
- var $;
1620
- return !(($ = z.author.courseRoles) != null && $.includes("StudentEnrollment"));
1426
+ }, [T == null ? void 0 : T.comments, t, o, v]);
1427
+ const q = T == null ? void 0 : T.comments.some(
1428
+ (k) => {
1429
+ var P;
1430
+ return !((P = k.author.courseRoles) != null && P.includes("StudentEnrollment"));
1621
1431
  }
1622
- ), L = () => {
1623
- p.trim() && Ae.mutate(
1624
- { submissionId: t, attempt: a, comment: p },
1432
+ ), S = () => {
1433
+ p.trim() && re.mutate(
1434
+ { submissionId: t, attempt: s, comment: p },
1625
1435
  {
1626
1436
  onSuccess: () => {
1627
- _(""), c == null || c();
1437
+ g(""), c == null || c();
1628
1438
  }
1629
1439
  }
1630
1440
  );
1631
- }, ee = (T == null ? void 0 : T.pageInfo.hasNextPage) || (T == null ? void 0 : T.pageInfo.hasPreviousPage);
1632
- return me || !T && !ye ? /* @__PURE__ */ r(g, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(ct, { renderTitle: u("comments.panelTitle"), size: "small" }) }) : ye ? /* @__PURE__ */ r(g, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(y, { color: "danger", children: u("comments.loadError", "Failed to load comments") }) }) : /* @__PURE__ */ S(g, { as: "div", direction: "column", justifyItems: "space-between", height: "100%", children: [
1633
- /* @__PURE__ */ S(g, { as: "div", direction: "column", children: [
1634
- T.comments.length === 0 ? /* @__PURE__ */ r(g, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(y, { color: "secondary", children: u("comments.empty") }) }) : /* @__PURE__ */ r(g, { direction: "column", gap: "x-small", children: T.comments.map((z) => /* @__PURE__ */ r(
1635
- Ai,
1441
+ }, V = (T == null ? void 0 : T.pageInfo.hasNextPage) || (T == null ? void 0 : T.pageInfo.hasPreviousPage);
1442
+ return ie || !T && !ae ? /* @__PURE__ */ i(h, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ i(He, { renderTitle: m.commentsPanelTitle(), size: "small" }) }) : ae ? /* @__PURE__ */ i(h, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ i(y, { color: "danger", children: m.commentsLoadError() }) }) : /* @__PURE__ */ _(h, { as: "div", direction: "column", justifyItems: "space-between", height: "100%", children: [
1443
+ /* @__PURE__ */ _(h, { as: "div", direction: "column", children: [
1444
+ T.comments.length === 0 ? /* @__PURE__ */ i(h, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ i(y, { color: "secondary", children: m.commentsEmpty() }) }) : /* @__PURE__ */ i(h, { direction: "column", gap: "x-small", children: T.comments.map((k) => /* @__PURE__ */ i(
1445
+ Ui,
1636
1446
  {
1637
- comment: z,
1638
- isFullWidth: !ie,
1447
+ comment: k,
1448
+ isFullWidth: !q,
1639
1449
  renderHTML: f
1640
1450
  },
1641
- z._id
1451
+ k._id
1642
1452
  )) }),
1643
- ee && /* @__PURE__ */ S(g, { justifyItems: "space-between", padding: "small none", children: [
1644
- /* @__PURE__ */ r(
1645
- P,
1453
+ V && /* @__PURE__ */ _(h, { justifyItems: "space-between", padding: "small none", children: [
1454
+ /* @__PURE__ */ i(
1455
+ z,
1646
1456
  {
1647
- renderIcon: () => /* @__PURE__ */ r(Ln, {}),
1457
+ renderIcon: () => /* @__PURE__ */ i(vn, {}),
1648
1458
  size: "small",
1649
1459
  interaction: T.pageInfo.hasPreviousPage ? "enabled" : "disabled",
1650
1460
  onClick: () => I({ pageParams: T.pageInfo, direction: "prev" }),
1651
- children: u("comments.previousComments")
1461
+ children: m.commentsPreviousComments()
1652
1462
  }
1653
1463
  ),
1654
- /* @__PURE__ */ r(
1655
- P,
1464
+ /* @__PURE__ */ i(
1465
+ z,
1656
1466
  {
1657
- renderIcon: () => /* @__PURE__ */ r(Nn, {}),
1467
+ renderIcon: () => /* @__PURE__ */ i(Nn, {}),
1658
1468
  size: "small",
1659
1469
  interaction: T.pageInfo.hasNextPage ? "enabled" : "disabled",
1660
1470
  onClick: () => I({ pageParams: T.pageInfo, direction: "next" }),
1661
- children: u("comments.nextComments")
1471
+ children: m.commentsNextComments()
1662
1472
  }
1663
1473
  )
1664
1474
  ] })
1665
1475
  ] }),
1666
- l && /* @__PURE__ */ S(g, { as: "div", direction: "column", gap: "small", padding: "small none medium", children: [
1667
- /* @__PURE__ */ r(
1668
- Qt,
1476
+ l && /* @__PURE__ */ _(h, { as: "div", direction: "column", gap: "small", padding: "small none medium", children: [
1477
+ /* @__PURE__ */ i(
1478
+ tn,
1669
1479
  {
1670
1480
  resize: "vertical",
1671
- label: /* @__PURE__ */ r(y, { weight: "bold", size: "medium", children: u("comments.placeholder") }),
1481
+ label: /* @__PURE__ */ i(y, { weight: "bold", size: "medium", children: m.commentsPlaceholder() }),
1672
1482
  value: p,
1673
- onChange: (z) => _(z.target.value)
1483
+ onChange: (k) => g(k.target.value)
1674
1484
  }
1675
1485
  ),
1676
- /* @__PURE__ */ r(
1677
- P,
1486
+ /* @__PURE__ */ i(
1487
+ z,
1488
+ {
1489
+ color: "primary",
1490
+ onClick: S,
1491
+ interaction: p.trim().length > 0 && !re.isPending ? "enabled" : "disabled",
1492
+ children: m.commentsPost()
1493
+ }
1494
+ )
1495
+ ] })
1496
+ ] });
1497
+ }
1498
+ function zi(t) {
1499
+ return /* @__PURE__ */ i("span", { dangerouslySetInnerHTML: { __html: gt.sanitize(t) } });
1500
+ }
1501
+ function gr({
1502
+ courseId: t,
1503
+ assignmentId: r,
1504
+ userId: o,
1505
+ feedbackMode: s = !1,
1506
+ onError: l,
1507
+ renderHTML: c,
1508
+ renderPanels: f,
1509
+ executeQuery: b
1510
+ }) {
1511
+ const m = B(), p = c ?? zi, {
1512
+ data: g,
1513
+ isLoading: D,
1514
+ isError: I,
1515
+ error: E
1516
+ } = _i({ courseId: t, assignmentId: r, userId: o, executeQuery: b }), [T, ie] = ge(null), [ae, re] = ge(
1517
+ s ? "comments" : null
1518
+ ), v = je(
1519
+ () => (g == null ? void 0 : g.submissionsConnection.nodes[0]) ?? null,
1520
+ [g]
1521
+ ), q = v != null && v.attempt > 0, S = T ?? v, V = T == null || T.attempt === (v == null ? void 0 : v.attempt), k = q && V, P = ((g == null ? void 0 : g.allowedAttempts) ?? 0) !== 1, le = Rn((be) => {
1522
+ ie(be);
1523
+ }, []);
1524
+ if (ct(() => {
1525
+ I && E && l && l(E);
1526
+ }, [I, E, l]), ct(() => {
1527
+ s && q && re("comments");
1528
+ }, [s, q]), D)
1529
+ return /* @__PURE__ */ i(h, { justifyItems: "center", padding: "large", children: /* @__PURE__ */ i(He, { renderTitle: m.progressLoading() }) });
1530
+ if (I || !g)
1531
+ return /* @__PURE__ */ i(h, { justifyItems: "center", padding: "large", children: /* @__PURE__ */ i(y, { color: "danger", children: m.assignmentLoadError() }) });
1532
+ const Ge = !!g.dueAt && new Date(g.dueAt) < /* @__PURE__ */ new Date() && !q, Be = v ? /* @__PURE__ */ i(
1533
+ Fi,
1534
+ {
1535
+ submissionId: v.id,
1536
+ courseId: t,
1537
+ assignmentId: r,
1538
+ attempt: (S == null ? void 0 : S.attempt) ?? 0,
1539
+ canPostComment: k,
1540
+ renderHTML: p,
1541
+ executeQuery: b
1542
+ }
1543
+ ) : null, O = P && v ? /* @__PURE__ */ i(
1544
+ Ii,
1545
+ {
1546
+ submissionId: v.id,
1547
+ selectedAttempt: S == null ? void 0 : S.attempt,
1548
+ onAttemptSelect: le,
1549
+ pointsPossible: g.pointsPossible,
1550
+ executeQuery: b
1551
+ }
1552
+ ) : null, he = {
1553
+ commentsPanel: Be,
1554
+ attemptsPanel: O,
1555
+ activePanel: ae,
1556
+ setActivePanel: re,
1557
+ unreadCommentCount: (v == null ? void 0 : v.unreadCommentCount) ?? 0,
1558
+ hasMultipleAttempts: P
1559
+ };
1560
+ return /* @__PURE__ */ _(h, { direction: "column", gap: "medium", children: [
1561
+ /* @__PURE__ */ i(
1562
+ wi,
1563
+ {
1564
+ score: S == null ? void 0 : S.score,
1565
+ pointsPossible: g.pointsPossible,
1566
+ gradingType: g.gradingType,
1567
+ dueAt: g.dueAt,
1568
+ allowedAttempts: g.allowedAttempts,
1569
+ currentAttempt: S == null ? void 0 : S.attempt,
1570
+ isOverdue: Ge
1571
+ }
1572
+ ),
1573
+ g.description && /* @__PURE__ */ _(Y, { as: "div", children: [
1574
+ /* @__PURE__ */ i(dt, { level: "h3", children: m.assignmentInstructions() }),
1575
+ /* @__PURE__ */ i(Y, { as: "div", margin: "small none large none", children: p(g.description) })
1576
+ ] }),
1577
+ /* @__PURE__ */ i(
1578
+ Di,
1579
+ {
1580
+ submission: S,
1581
+ isLastAttempt: V,
1582
+ renderHTML: p
1583
+ }
1584
+ ),
1585
+ f ? f(he) : null
1586
+ ] });
1587
+ }
1588
+ function hr({
1589
+ existingFiles: t,
1590
+ onSubmit: r,
1591
+ onSaveDraft: o,
1592
+ onDiscardDraft: s,
1593
+ onSelectFiles: l,
1594
+ isSubmitting: c = !1
1595
+ }) {
1596
+ const f = B(), [b, m] = ge(t ?? []), p = async () => {
1597
+ const E = await l();
1598
+ m((T) => [...T, ...E]);
1599
+ }, g = (E) => {
1600
+ m((T) => T.filter((ie) => ie.id !== E));
1601
+ }, D = b.map((E) => E.id), I = b.length > 0 && !c;
1602
+ return /* @__PURE__ */ _(h, { direction: "column", gap: "medium", children: [
1603
+ b.length > 0 && /* @__PURE__ */ i(h, { direction: "column", gap: "x-small", children: b.map((E) => /* @__PURE__ */ i(
1604
+ Y,
1605
+ {
1606
+ as: "div",
1607
+ padding: "small",
1608
+ borderWidth: "small",
1609
+ borderColor: "primary",
1610
+ borderRadius: "medium",
1611
+ children: /* @__PURE__ */ _(h, { justifyItems: "space-between", alignItems: "center", children: [
1612
+ /* @__PURE__ */ i(y, { children: E.name }),
1613
+ /* @__PURE__ */ i(
1614
+ z,
1615
+ {
1616
+ size: "small",
1617
+ renderIcon: () => /* @__PURE__ */ i(On, {}),
1618
+ onClick: () => g(E.id),
1619
+ children: /* @__PURE__ */ _("span", { className: "screenreader-only", children: [
1620
+ "Remove ",
1621
+ E.name
1622
+ ] })
1623
+ }
1624
+ )
1625
+ ] })
1626
+ },
1627
+ E.id
1628
+ )) }),
1629
+ /* @__PURE__ */ i(z, { onClick: p, children: f.submissionFormAddFiles() }),
1630
+ /* @__PURE__ */ _(h, { gap: "small", children: [
1631
+ /* @__PURE__ */ i(
1632
+ z,
1678
1633
  {
1679
1634
  color: "primary",
1680
- onClick: L,
1681
- interaction: p.trim().length > 0 && !Ae.isPending ? "enabled" : "disabled",
1682
- children: u("comments.post")
1635
+ onClick: () => r(D),
1636
+ interaction: I ? "enabled" : "disabled",
1637
+ children: f.submissionFormSubmit()
1638
+ }
1639
+ ),
1640
+ o && /* @__PURE__ */ i(
1641
+ z,
1642
+ {
1643
+ onClick: () => o(D),
1644
+ interaction: b.length > 0 ? "enabled" : "disabled",
1645
+ children: f.submissionFormSaveDraft()
1646
+ }
1647
+ ),
1648
+ s && t && t.length > 0 && /* @__PURE__ */ i(z, { color: "primary-inverse", onClick: s, children: f.submissionFormDiscardDraft() })
1649
+ ] })
1650
+ ] });
1651
+ }
1652
+ function br({
1653
+ prevItem: t,
1654
+ nextItem: r,
1655
+ onNavigatePrev: o,
1656
+ onNavigateNext: s,
1657
+ labels: l
1658
+ }) {
1659
+ const c = B();
1660
+ if (!t && !r)
1661
+ return null;
1662
+ const f = (l == null ? void 0 : l.previous) ?? c.navigationPrevious(), b = (l == null ? void 0 : l.next) ?? c.navigationNext();
1663
+ return /* @__PURE__ */ _(h, { justifyItems: "space-between", padding: "small none", children: [
1664
+ t ? /* @__PURE__ */ i(
1665
+ z,
1666
+ {
1667
+ renderIcon: () => /* @__PURE__ */ i(Zt, {}),
1668
+ onClick: o,
1669
+ "aria-label": `${f}: ${t.title}`,
1670
+ children: f
1671
+ }
1672
+ ) : /* @__PURE__ */ i("div", {}),
1673
+ r ? /* @__PURE__ */ i(
1674
+ z,
1675
+ {
1676
+ renderIcon: () => /* @__PURE__ */ i(Qt, {}),
1677
+ onClick: s,
1678
+ "aria-label": `${b}: ${r.title}`,
1679
+ children: b
1680
+ }
1681
+ ) : /* @__PURE__ */ i("div", {})
1682
+ ] });
1683
+ }
1684
+ function ji(t) {
1685
+ switch (t) {
1686
+ case "Assignment":
1687
+ return /* @__PURE__ */ i(Un, {});
1688
+ case "Quiz":
1689
+ return /* @__PURE__ */ i(Pn, {});
1690
+ case "Discussion":
1691
+ return /* @__PURE__ */ i(kn, {});
1692
+ case "Page":
1693
+ return /* @__PURE__ */ i(jt, {});
1694
+ case "ExternalUrl":
1695
+ case "ExternalTool":
1696
+ return /* @__PURE__ */ i(xn, {});
1697
+ default:
1698
+ return /* @__PURE__ */ i(jt, {});
1699
+ }
1700
+ }
1701
+ function Hi({
1702
+ item: t,
1703
+ isSelected: r,
1704
+ isLoadingItem: o,
1705
+ onClick: s
1706
+ }) {
1707
+ var m, p, g, D, I;
1708
+ const l = B(), c = ((m = t.content_details) == null ? void 0 : m.locked_for_user) ?? !1, f = (p = t.content_details) == null ? void 0 : p.lock_explanation, b = /* @__PURE__ */ i(
1709
+ Y,
1710
+ {
1711
+ as: "div",
1712
+ padding: "small",
1713
+ background: r ? "secondary" : "primary",
1714
+ borderRadius: "small",
1715
+ cursor: c ? "not-allowed" : "pointer",
1716
+ onClick: c ? void 0 : s,
1717
+ role: c ? void 0 : "button",
1718
+ tabIndex: c ? void 0 : 0,
1719
+ onKeyDown: c ? void 0 : (E) => {
1720
+ (E.key === "Enter" || E.key === " ") && (E.preventDefault(), s());
1721
+ },
1722
+ children: /* @__PURE__ */ _(h, { gap: "small", alignItems: "center", children: [
1723
+ /* @__PURE__ */ i(h.Item, { children: c ? /* @__PURE__ */ i(Jt, {}) : ji(t.type) }),
1724
+ /* @__PURE__ */ i(h.Item, { shouldGrow: !0, shouldShrink: !0, children: /* @__PURE__ */ _(h, { direction: "column", gap: "xx-small", children: [
1725
+ /* @__PURE__ */ i(y, { weight: r ? "bold" : "normal", size: "small", children: t.title }),
1726
+ ((g = t.content_details) == null ? void 0 : g.due_at) && /* @__PURE__ */ i(y, { size: "x-small", color: "secondary", children: l.progressDueDate({
1727
+ date: new Date(t.content_details.due_at).toLocaleDateString()
1728
+ }) }),
1729
+ ((D = t.content_details) == null ? void 0 : D.points_possible) != null && /* @__PURE__ */ i(y, { size: "x-small", color: "secondary", children: l.progressPoints({ points: t.content_details.points_possible }) })
1730
+ ] }) }),
1731
+ o && /* @__PURE__ */ i(He, { size: "x-small", renderTitle: l.progressLoading() }),
1732
+ ((I = t.completion_requirement) == null ? void 0 : I.completed) && /* @__PURE__ */ i(y, { color: "success", size: "small", children: "✓" })
1733
+ ] })
1734
+ }
1735
+ );
1736
+ return c && f ? /* @__PURE__ */ i(jn, { renderTip: f, placement: "end", children: b }) : b;
1737
+ }
1738
+ function Tr({
1739
+ module: t,
1740
+ currentItemId: r,
1741
+ onItemClick: o,
1742
+ onClose: s,
1743
+ onNavigateModule: l,
1744
+ hasPrevModule: c = !1,
1745
+ hasNextModule: f = !1,
1746
+ isLoading: b = !1,
1747
+ title: m
1748
+ }) {
1749
+ var D;
1750
+ const p = B(), g = m ?? p.navigationMyProgress();
1751
+ return /* @__PURE__ */ _(h, { direction: "column", height: "100%", children: [
1752
+ /* @__PURE__ */ _(h, { justifyItems: "space-between", alignItems: "center", padding: "small", children: [
1753
+ /* @__PURE__ */ i(dt, { level: "h3", children: g }),
1754
+ /* @__PURE__ */ i(zn, { screenReaderLabel: p.navigationClosePanel(), onClick: s, size: "small", children: /* @__PURE__ */ i(Mn, {}) })
1755
+ ] }),
1756
+ /* @__PURE__ */ _(Y, { as: "div", padding: "none small", overflowY: "auto", children: [
1757
+ t.state === "locked" && /* @__PURE__ */ i(h, { padding: "none none small", children: /* @__PURE__ */ _(ft, { color: "warning", children: [
1758
+ /* @__PURE__ */ i(Jt, {}),
1759
+ " ",
1760
+ p.progressLocked()
1761
+ ] }) }),
1762
+ /* @__PURE__ */ i(y, { weight: "bold", size: "medium", children: t.name }),
1763
+ /* @__PURE__ */ i(h, { direction: "column", gap: "xx-small", padding: "small none", children: (D = t.items) == null ? void 0 : D.map((I) => /* @__PURE__ */ i(
1764
+ Hi,
1765
+ {
1766
+ item: I,
1767
+ isSelected: I.id === r,
1768
+ isLoadingItem: b && I.id === r,
1769
+ onClick: () => o(I)
1770
+ },
1771
+ I.id
1772
+ )) })
1773
+ ] }),
1774
+ l && /* @__PURE__ */ _(h, { justifyItems: "space-between", padding: "small", children: [
1775
+ /* @__PURE__ */ i(
1776
+ z,
1777
+ {
1778
+ renderIcon: () => /* @__PURE__ */ i(Zt, {}),
1779
+ size: "small",
1780
+ interaction: c ? "enabled" : "disabled",
1781
+ onClick: () => l("prev"),
1782
+ "aria-label": p.navigationPreviousModule(),
1783
+ children: p.navigationPrevious()
1784
+ }
1785
+ ),
1786
+ /* @__PURE__ */ i(
1787
+ z,
1788
+ {
1789
+ renderIcon: () => /* @__PURE__ */ i(Qt, {}),
1790
+ size: "small",
1791
+ interaction: f ? "enabled" : "disabled",
1792
+ onClick: () => l("next"),
1793
+ "aria-label": p.navigationNextModule(),
1794
+ children: p.navigationNext()
1683
1795
  }
1684
1796
  )
1685
1797
  ] })
1686
1798
  ] });
1687
1799
  }
1688
- function dr({
1800
+ function Ar({
1689
1801
  existingDraft: t,
1690
- onSubmit: i,
1802
+ onSubmit: r,
1691
1803
  onSaveDraft: o,
1692
- onDiscardDraft: a,
1804
+ onDiscardDraft: s,
1693
1805
  isSubmitting: l = !1
1694
1806
  }) {
1695
- const { t: c } = B("assignment-review"), [f, b] = Fe(t ?? ""), u = f.trim().length > 0 && !l;
1696
- return /* @__PURE__ */ S(g, { direction: "column", gap: "medium", children: [
1697
- /* @__PURE__ */ r(
1698
- Qt,
1807
+ const c = B(), [f, b] = ge(t ?? ""), m = f.trim().length > 0 && !l;
1808
+ return /* @__PURE__ */ _(h, { direction: "column", gap: "medium", children: [
1809
+ /* @__PURE__ */ i(
1810
+ tn,
1699
1811
  {
1700
- label: c("submission.textHeading"),
1812
+ label: c.submissionTextHeading(),
1701
1813
  value: f,
1702
1814
  onChange: (p) => b(p.target.value),
1703
1815
  resize: "vertical",
1704
1816
  height: "200px"
1705
1817
  }
1706
1818
  ),
1707
- /* @__PURE__ */ S(g, { gap: "small", children: [
1708
- /* @__PURE__ */ r(
1709
- P,
1819
+ /* @__PURE__ */ _(h, { gap: "small", children: [
1820
+ /* @__PURE__ */ i(
1821
+ z,
1710
1822
  {
1711
1823
  color: "primary",
1712
- onClick: () => i(f),
1713
- interaction: u ? "enabled" : "disabled",
1714
- children: c("submissionForm.submit")
1824
+ onClick: () => r(f),
1825
+ interaction: m ? "enabled" : "disabled",
1826
+ children: c.submissionFormSubmit()
1715
1827
  }
1716
1828
  ),
1717
- o && /* @__PURE__ */ r(
1718
- P,
1829
+ o && /* @__PURE__ */ i(
1830
+ z,
1719
1831
  {
1720
1832
  onClick: () => o(f),
1721
1833
  interaction: f.trim().length > 0 ? "enabled" : "disabled",
1722
- children: c("submissionForm.saveDraft")
1834
+ children: c.submissionFormSaveDraft()
1723
1835
  }
1724
1836
  ),
1725
- a && t && /* @__PURE__ */ r(P, { color: "primary-inverse", onClick: a, children: c("submissionForm.discardDraft") })
1837
+ s && t && /* @__PURE__ */ i(z, { color: "primary-inverse", onClick: s, children: c.submissionFormDiscardDraft() })
1726
1838
  ] })
1727
1839
  ] });
1728
1840
  }
1729
- function fr({
1841
+ function _r({
1730
1842
  unreadCount: t
1731
1843
  }) {
1732
- const { t: i } = B("assignment-review");
1844
+ const r = B();
1733
1845
  if (t === 0)
1734
1846
  return null;
1735
- const o = t === 1 ? i("comments.unreadSingle") : i("comments.unread", { count: t });
1736
- return /* @__PURE__ */ r(Zt, { count: t, standalone: !0, children: /* @__PURE__ */ r(mt, { children: o }) });
1847
+ const o = t === 1 ? r.commentsUnreadSingle() : r.commentsUnread({ count: t });
1848
+ return /* @__PURE__ */ i(nn, { count: t, standalone: !0, children: /* @__PURE__ */ i(pt, { children: o }) });
1737
1849
  }
1738
- function pr({
1739
- courseId: t,
1740
- assignmentId: i,
1741
- userId: o,
1742
- executeQuery: a,
1743
- enabled: l = !0
1744
- }) {
1745
- return Ue({
1746
- queryKey: ["assignment-review", "assignment", t, i, o],
1747
- queryFn: async () => {
1748
- const c = await a(zn, {
1749
- courseId: t,
1750
- assignmentId: i,
1751
- userId: o
1752
- }), f = Wn.parse(c);
1753
- return {
1754
- ...f.legacyNode,
1755
- courseName: f.course.name
1756
- };
1757
- },
1758
- enabled: l
1759
- });
1760
- }
1761
- function gr({
1850
+ function Sr({
1762
1851
  courseId: t,
1763
- moduleItemId: i,
1852
+ moduleItemId: r,
1764
1853
  fetchSequence: o,
1765
- enabled: a = !0
1854
+ enabled: s = !0
1766
1855
  }) {
1767
- return Ue({
1768
- queryKey: ["assignment-review", "module-item-sequence", t, i],
1769
- queryFn: () => o(t, i),
1770
- enabled: a && !!i
1856
+ return $e({
1857
+ queryKey: ["assignment-review", "module-item-sequence", t, r],
1858
+ queryFn: () => o(t, r),
1859
+ enabled: s && !!r
1771
1860
  });
1772
1861
  }
1773
1862
  export {
1774
- Wn as AssignmentResponseSchema,
1775
- Un as AttemptCard,
1776
- ir as AttemptView,
1777
- nr as AttemptsHistory,
1778
- lr as CREATE_SUBMISSION,
1779
- Ri as CREATE_SUBMISSION_COMMENT,
1780
- cr as CREATE_SUBMISSION_DRAFT,
1781
- Ai as CommentCard,
1782
- Kn as CreateSubmissionCommentResponseSchema,
1783
- er as CreateSubmissionDraftResponseSchema,
1784
- Ji as CreateSubmissionResponseSchema,
1785
- mr as DELETE_SUBMISSION_DRAFT,
1786
- tr as DeleteSubmissionDraftResponseSchema,
1787
- an as DownloadButtons,
1788
- rr as FileUploadSubmissionForm,
1789
- zn as GET_ASSIGNMENT,
1790
- $n as GET_SUBMISSIONS,
1791
- jn as GET_SUBMISSION_COMMENTS,
1792
- or as LearningContentHeader,
1793
- wi as MARK_SUBMISSION_COMMENTS_READ,
1794
- Vn as MarkSubmissionCommentsReadResponseSchema,
1795
- sr as ModuleNavigation,
1796
- ar as MyProgressPanel,
1797
- ur as SubmissionComments,
1798
- Qi as SubmissionCommentsDataSchema,
1799
- qn as SubmissionCommentsQueryResponseSchema,
1800
- Xn as SubmissionsQueryResponseSchema,
1801
- dr as TextEntrySubmissionForm,
1802
- fr as UnreadCommentsBadge,
1803
- vi as useCreateSubmissionComment,
1804
- pr as useGetAssignment,
1805
- Li as useGetSubmissionComments,
1806
- Zn as useGetSubmissions,
1807
- Ni as useMarkSubmissionCommentsRead,
1808
- gr as useModuleItemSequence
1863
+ pi as AssignmentResponseSchema,
1864
+ gr as AssignmentReview,
1865
+ Ei as AttemptCard,
1866
+ Di as AttemptView,
1867
+ Ii as AttemptsHistory,
1868
+ dr as CREATE_SUBMISSION,
1869
+ vi as CREATE_SUBMISSION_COMMENT,
1870
+ fr as CREATE_SUBMISSION_DRAFT,
1871
+ Ui as CommentCard,
1872
+ Ti as CreateSubmissionCommentResponseSchema,
1873
+ mr as CreateSubmissionDraftResponseSchema,
1874
+ cr as CreateSubmissionResponseSchema,
1875
+ pr as DELETE_SUBMISSION_DRAFT,
1876
+ ur as DeleteSubmissionDraftResponseSchema,
1877
+ un as DownloadButtons,
1878
+ hr as FileUploadSubmissionForm,
1879
+ li as GET_ASSIGNMENT,
1880
+ mi as GET_SUBMISSIONS,
1881
+ ci as GET_SUBMISSION_COMMENTS,
1882
+ wi as LearningContentHeader,
1883
+ Ni as MARK_SUBMISSION_COMMENTS_READ,
1884
+ Ai as MarkSubmissionCommentsReadResponseSchema,
1885
+ br as ModuleNavigation,
1886
+ Tr as MyProgressPanel,
1887
+ Fi as SubmissionComments,
1888
+ lr as SubmissionCommentsDataSchema,
1889
+ gi as SubmissionCommentsQueryResponseSchema,
1890
+ bi as SubmissionsQueryResponseSchema,
1891
+ Ar as TextEntrySubmissionForm,
1892
+ ar as TranslationsProvider,
1893
+ _r as UnreadCommentsBadge,
1894
+ Oi as useCreateSubmissionComment,
1895
+ _i as useGetAssignment,
1896
+ Mi as useGetSubmissionComments,
1897
+ Si as useGetSubmissions,
1898
+ xi as useMarkSubmissionCommentsRead,
1899
+ Sr as useModuleItemSequence,
1900
+ B as useTranslations
1809
1901
  };