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