@instructure/platform-assignment-review 0.4.12 → 0.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +326 -317
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -42,19 +42,19 @@ function ei(e) {
|
|
|
42
42
|
function ti(e, n) {
|
|
43
43
|
var o = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
44
44
|
if (o != null) {
|
|
45
|
-
var a,
|
|
45
|
+
var a, l, c, d, f = [], m = !0, p = !1;
|
|
46
46
|
try {
|
|
47
|
-
if (
|
|
48
|
-
} catch (
|
|
49
|
-
|
|
47
|
+
if (c = (o = o.call(e)).next, n !== 0) for (; !(m = (a = c.call(o)).done) && (f.push(a.value), f.length !== n); m = !0) ;
|
|
48
|
+
} catch (h) {
|
|
49
|
+
p = !0, l = h;
|
|
50
50
|
} finally {
|
|
51
51
|
try {
|
|
52
|
-
if (!
|
|
52
|
+
if (!m && o.return != null && (d = o.return(), Object(d) !== d)) return;
|
|
53
53
|
} finally {
|
|
54
|
-
if (
|
|
54
|
+
if (p) throw l;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
return
|
|
57
|
+
return f;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
function ni() {
|
|
@@ -80,21 +80,21 @@ Y || (Y = function(n) {
|
|
|
80
80
|
return n;
|
|
81
81
|
});
|
|
82
82
|
yt || (yt = function(n, o) {
|
|
83
|
-
for (var a = arguments.length,
|
|
84
|
-
c
|
|
85
|
-
return n.apply(o,
|
|
83
|
+
for (var a = arguments.length, l = new Array(a > 2 ? a - 2 : 0), c = 2; c < a; c++)
|
|
84
|
+
l[c - 2] = arguments[c];
|
|
85
|
+
return n.apply(o, l);
|
|
86
86
|
});
|
|
87
87
|
At || (At = function(n) {
|
|
88
|
-
for (var o = arguments.length, a = new Array(o > 1 ? o - 1 : 0),
|
|
89
|
-
a[
|
|
88
|
+
for (var o = arguments.length, a = new Array(o > 1 ? o - 1 : 0), l = 1; l < o; l++)
|
|
89
|
+
a[l - 1] = arguments[l];
|
|
90
90
|
return new n(...a);
|
|
91
91
|
});
|
|
92
92
|
const Te = x(Array.prototype.forEach), li = x(Array.prototype.lastIndexOf), Jt = x(Array.prototype.pop), ye = x(Array.prototype.push), ci = x(Array.prototype.splice), H = Array.isArray, Ne = x(String.prototype.toLowerCase), dt = x(String.prototype.toString), en = x(String.prototype.match), Ae = x(String.prototype.replace), tn = x(String.prototype.indexOf), mi = x(String.prototype.trim), ui = x(Number.prototype.toString), di = x(Boolean.prototype.toString), nn = typeof BigInt > "u" ? null : x(BigInt.prototype.toString), on = typeof Symbol > "u" ? null : x(Symbol.prototype.toString), D = x(Object.prototype.hasOwnProperty), Oe = x(Object.prototype.toString), z = x(RegExp.prototype.test), Ge = fi(TypeError);
|
|
93
93
|
function x(e) {
|
|
94
94
|
return function(n) {
|
|
95
95
|
n instanceof RegExp && (n.lastIndex = 0);
|
|
96
|
-
for (var o = arguments.length, a = new Array(o > 1 ? o - 1 : 0),
|
|
97
|
-
a[
|
|
96
|
+
for (var o = arguments.length, a = new Array(o > 1 ? o - 1 : 0), l = 1; l < o; l++)
|
|
97
|
+
a[l - 1] = arguments[l];
|
|
98
98
|
return yt(e, n, a);
|
|
99
99
|
};
|
|
100
100
|
}
|
|
@@ -111,12 +111,12 @@ function T(e, n) {
|
|
|
111
111
|
return e;
|
|
112
112
|
let a = n.length;
|
|
113
113
|
for (; a--; ) {
|
|
114
|
-
let
|
|
115
|
-
if (typeof
|
|
116
|
-
const
|
|
117
|
-
|
|
114
|
+
let l = n[a];
|
|
115
|
+
if (typeof l == "string") {
|
|
116
|
+
const c = o(l);
|
|
117
|
+
c !== l && (ri(n) || (n[a] = c), l = c);
|
|
118
118
|
}
|
|
119
|
-
e[
|
|
119
|
+
e[l] = !0;
|
|
120
120
|
}
|
|
121
121
|
return e;
|
|
122
122
|
}
|
|
@@ -129,8 +129,8 @@ function W(e) {
|
|
|
129
129
|
const n = _e(null);
|
|
130
130
|
for (const a of An(e)) {
|
|
131
131
|
var o = ii(a, 2);
|
|
132
|
-
const
|
|
133
|
-
D(e,
|
|
132
|
+
const l = o[0], c = o[1];
|
|
133
|
+
D(e, l) && (H(c) ? n[l] = pi(c) : c && typeof c == "object" && c.constructor === Object ? n[l] = W(c) : n[l] = c);
|
|
134
134
|
}
|
|
135
135
|
return n;
|
|
136
136
|
}
|
|
@@ -205,20 +205,20 @@ const rn = B(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
205
205
|
if (typeof n != "object" || typeof n.createPolicy != "function")
|
|
206
206
|
return null;
|
|
207
207
|
let a = null;
|
|
208
|
-
const
|
|
209
|
-
o && o.hasAttribute(
|
|
210
|
-
const
|
|
208
|
+
const l = "data-tt-policy-suffix";
|
|
209
|
+
o && o.hasAttribute(l) && (a = o.getAttribute(l));
|
|
210
|
+
const c = "dompurify" + (a ? "#" + a : "");
|
|
211
211
|
try {
|
|
212
|
-
return n.createPolicy(
|
|
213
|
-
createHTML(
|
|
214
|
-
return
|
|
212
|
+
return n.createPolicy(c, {
|
|
213
|
+
createHTML(d) {
|
|
214
|
+
return d;
|
|
215
215
|
},
|
|
216
|
-
createScriptURL(
|
|
217
|
-
return
|
|
216
|
+
createScriptURL(d) {
|
|
217
|
+
return d;
|
|
218
218
|
}
|
|
219
219
|
});
|
|
220
220
|
} catch {
|
|
221
|
-
return console.warn("TrustedTypes policy " +
|
|
221
|
+
return console.warn("TrustedTypes policy " + c + " could not be created."), null;
|
|
222
222
|
}
|
|
223
223
|
}, mn = function() {
|
|
224
224
|
return {
|
|
@@ -235,14 +235,14 @@ const rn = B(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
235
235
|
};
|
|
236
236
|
function _n() {
|
|
237
237
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Ri();
|
|
238
|
-
const n = (
|
|
238
|
+
const n = (g) => _n(g);
|
|
239
239
|
if (n.version = "3.4.5", n.removed = [], !e || !e.document || e.document.nodeType !== Se.document || !e.Element)
|
|
240
240
|
return n.isSupported = !1, n;
|
|
241
241
|
let o = e.document;
|
|
242
|
-
const a = o,
|
|
243
|
-
if (typeof
|
|
244
|
-
const
|
|
245
|
-
|
|
242
|
+
const a = o, l = a.currentScript, c = e.DocumentFragment, d = e.HTMLTemplateElement, f = e.Node, m = e.Element, p = e.NodeFilter, h = e.NamedNodeMap, C = h === void 0 ? e.NamedNodeMap || e.MozNamedAttrMap : h, I = e.HTMLFormElement, w = e.DOMParser, y = e.trustedTypes, V = m.prototype, fe = de(V, "cloneNode"), le = de(V, "remove"), M = de(V, "nextSibling"), ne = de(V, "childNodes"), O = de(V, "parentNode"), ce = f && f.prototype ? de(f.prototype, "nodeType") : null;
|
|
243
|
+
if (typeof d == "function") {
|
|
244
|
+
const g = o.createElement("template");
|
|
245
|
+
g.content && g.content.ownerDocument && (o = g.content.ownerDocument);
|
|
246
246
|
}
|
|
247
247
|
let E, N = "";
|
|
248
248
|
const J = o, Ie = J.implementation, xe = J.createNodeIterator, Xe = J.createDocumentFragment, Ke = J.getElementsByTagName, Ze = a.importNode;
|
|
@@ -318,7 +318,7 @@ function _n() {
|
|
|
318
318
|
throw Ge('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
319
319
|
E = t.TRUSTED_TYPES_POLICY, N = E.createHTML("");
|
|
320
320
|
} else
|
|
321
|
-
E === void 0 && (E = Oi(y,
|
|
321
|
+
E === void 0 && (E = Oi(y, l)), E !== null && typeof N == "string" && (N = E.createHTML(""));
|
|
322
322
|
B && B(t), be = t;
|
|
323
323
|
}, zt = T({}, [...ft, ...pt, ...bi]), jt = T({}, [...gt, ...Ti]), Mn = function(t) {
|
|
324
324
|
let s = O(t);
|
|
@@ -326,8 +326,8 @@ function _n() {
|
|
|
326
326
|
namespaceURI: he,
|
|
327
327
|
tagName: "template"
|
|
328
328
|
});
|
|
329
|
-
const
|
|
330
|
-
return rt[t.namespaceURI] ? t.namespaceURI === He ? s.namespaceURI === Q ?
|
|
329
|
+
const u = Ne(t.tagName), A = Ne(s.tagName);
|
|
330
|
+
return rt[t.namespaceURI] ? t.namespaceURI === He ? s.namespaceURI === Q ? u === "svg" : s.namespaceURI === je ? u === "svg" && (A === "annotation-xml" || st[A]) : !!zt[u] : t.namespaceURI === je ? s.namespaceURI === Q ? u === "math" : s.namespaceURI === He ? u === "math" && at[A] : !!jt[u] : t.namespaceURI === Q ? s.namespaceURI === He && !at[A] || s.namespaceURI === je && !st[A] ? !1 : !jt[u] && (vn[u] || !zt[u]) : !!(Re === "application/xhtml+xml" && rt[t.namespaceURI]) : !1;
|
|
331
331
|
}, X = function(t) {
|
|
332
332
|
ye(n.removed, {
|
|
333
333
|
element: t
|
|
@@ -361,12 +361,12 @@ function _n() {
|
|
|
361
361
|
} catch {
|
|
362
362
|
}
|
|
363
363
|
}, Ht = function(t) {
|
|
364
|
-
let s = null,
|
|
364
|
+
let s = null, u = null;
|
|
365
365
|
if (et)
|
|
366
366
|
t = "<remove></remove>" + t;
|
|
367
367
|
else {
|
|
368
368
|
const L = en(t, /^[\r\n\t ]+/);
|
|
369
|
-
|
|
369
|
+
u = L && L[0];
|
|
370
370
|
}
|
|
371
371
|
Re === "application/xhtml+xml" && he === Q && (t = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + t + "</body></html>");
|
|
372
372
|
const A = E ? E.createHTML(t) : t;
|
|
@@ -383,13 +383,13 @@ function _n() {
|
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
385
|
const v = s.body || s.documentElement;
|
|
386
|
-
return t &&
|
|
386
|
+
return t && u && v.insertBefore(o.createTextNode(u), v.childNodes[0] || null), he === Q ? Ke.call(s, me ? "html" : "body")[0] : me ? s.documentElement : v;
|
|
387
387
|
}, $t = function(t) {
|
|
388
388
|
return xe.call(
|
|
389
389
|
t.ownerDocument || t,
|
|
390
390
|
t,
|
|
391
391
|
// eslint-disable-next-line no-bitwise
|
|
392
|
-
|
|
392
|
+
p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION,
|
|
393
393
|
null
|
|
394
394
|
);
|
|
395
395
|
}, Bt = function(t) {
|
|
@@ -398,15 +398,15 @@ function _n() {
|
|
|
398
398
|
t.ownerDocument || t,
|
|
399
399
|
t,
|
|
400
400
|
// eslint-disable-next-line no-bitwise
|
|
401
|
-
|
|
401
|
+
p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION,
|
|
402
402
|
null
|
|
403
403
|
);
|
|
404
|
-
let
|
|
405
|
-
for (;
|
|
406
|
-
let A =
|
|
404
|
+
let u = s.nextNode();
|
|
405
|
+
for (; u; ) {
|
|
406
|
+
let A = u.data;
|
|
407
407
|
Te([ke, Me, Pe], (v) => {
|
|
408
408
|
A = Ae(A, v, " ");
|
|
409
|
-
}),
|
|
409
|
+
}), u.data = A, u = s.nextNode();
|
|
410
410
|
}
|
|
411
411
|
}, ct = function(t) {
|
|
412
412
|
return t instanceof I && (typeof t.nodeName != "string" || typeof t.textContent != "string" || typeof t.removeChild != "function" || !(t.attributes instanceof C) || typeof t.removeAttribute != "function" || typeof t.setAttribute != "function" || typeof t.namespaceURI != "string" || typeof t.insertBefore != "function" || typeof t.hasChildNodes != "function");
|
|
@@ -419,25 +419,25 @@ function _n() {
|
|
|
419
419
|
return !1;
|
|
420
420
|
}
|
|
421
421
|
};
|
|
422
|
-
function ee(
|
|
423
|
-
Te(
|
|
424
|
-
|
|
422
|
+
function ee(g, t, s) {
|
|
423
|
+
Te(g, (u) => {
|
|
424
|
+
u.call(n, t, s, be);
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
427
|
const Gt = function(t) {
|
|
428
428
|
let s = null;
|
|
429
429
|
if (ee(j.beforeSanitizeElements, t, null), ct(t))
|
|
430
430
|
return X(t), !0;
|
|
431
|
-
const
|
|
431
|
+
const u = k(t.nodeName);
|
|
432
432
|
if (ee(j.uponSanitizeElement, t, {
|
|
433
|
-
tagName:
|
|
433
|
+
tagName: u,
|
|
434
434
|
allowedTags: P
|
|
435
|
-
}), Ce && t.hasChildNodes() && !$e(t.firstElementChild) && z(/<[/\w!]/g, t.innerHTML) && z(/<[/\w!]/g, t.textContent) || Ce && t.namespaceURI === Q &&
|
|
435
|
+
}), Ce && t.hasChildNodes() && !$e(t.firstElementChild) && z(/<[/\w!]/g, t.innerHTML) && z(/<[/\w!]/g, t.textContent) || Ce && t.namespaceURI === Q && u === "style" && $e(t.firstElementChild) || t.nodeType === Se.progressingInstruction || Ce && t.nodeType === Se.comment && z(/<[/\w]/g, t.data))
|
|
436
436
|
return X(t), !0;
|
|
437
|
-
if (we[
|
|
438
|
-
if (!we[
|
|
437
|
+
if (we[u] || !(ie.tagCheck instanceof Function && ie.tagCheck(u)) && !P[u]) {
|
|
438
|
+
if (!we[u] && qt(u) && (R.tagNameCheck instanceof RegExp && z(R.tagNameCheck, u) || R.tagNameCheck instanceof Function && R.tagNameCheck(u)))
|
|
439
439
|
return !1;
|
|
440
|
-
if (tt && !Z[
|
|
440
|
+
if (tt && !Z[u]) {
|
|
441
441
|
const A = O(t) || t.parentNode, v = ne(t) || t.childNodes;
|
|
442
442
|
if (v && A) {
|
|
443
443
|
const L = v.length;
|
|
@@ -449,13 +449,13 @@ function _n() {
|
|
|
449
449
|
}
|
|
450
450
|
return X(t), !0;
|
|
451
451
|
}
|
|
452
|
-
return t instanceof
|
|
452
|
+
return t instanceof m && !Mn(t) || (u === "noscript" || u === "noembed" || u === "noframes") && z(/<\/no(script|embed|frames)/i, t.innerHTML) ? (X(t), !0) : (oe && t.nodeType === Se.text && (s = t.textContent, Te([ke, Me, Pe], (A) => {
|
|
453
453
|
s = Ae(s, A, " ");
|
|
454
454
|
}), t.textContent !== s && (ye(n.removed, {
|
|
455
455
|
element: t.cloneNode()
|
|
456
456
|
}), t.textContent = s)), ee(j.afterSanitizeElements, t, null), !1);
|
|
457
|
-
}, Wt = function(t, s,
|
|
458
|
-
if (Fe[s] || Lt && (s === "id" || s === "name") && (
|
|
457
|
+
}, Wt = function(t, s, u) {
|
|
458
|
+
if (Fe[s] || Lt && (s === "id" || s === "name") && (u in o || u in kn))
|
|
459
459
|
return !1;
|
|
460
460
|
const A = U[s] || ie.attributeCheck instanceof Function && ie.attributeCheck(s, t);
|
|
461
461
|
if (!(Qe && !Fe[s] && z(Cn, s))) {
|
|
@@ -467,13 +467,13 @@ function _n() {
|
|
|
467
467
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
468
468
|
!(qt(t) && (R.tagNameCheck instanceof RegExp && z(R.tagNameCheck, t) || R.tagNameCheck instanceof Function && R.tagNameCheck(t)) && (R.attributeNameCheck instanceof RegExp && z(R.attributeNameCheck, s) || R.attributeNameCheck instanceof Function && R.attributeNameCheck(s, t)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
469
469
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
470
|
-
s === "is" && R.allowCustomizedBuiltInElements && (R.tagNameCheck instanceof RegExp && z(R.tagNameCheck,
|
|
470
|
+
s === "is" && R.allowCustomizedBuiltInElements && (R.tagNameCheck instanceof RegExp && z(R.tagNameCheck, u) || R.tagNameCheck instanceof Function && R.tagNameCheck(u)))
|
|
471
471
|
) return !1;
|
|
472
472
|
} else if (!it[s]) {
|
|
473
|
-
if (!z(Ct, Ae(
|
|
474
|
-
if (!((s === "src" || s === "xlink:href" || s === "href") && t !== "script" && tn(
|
|
475
|
-
if (!(Nt && !z(Rn, Ae(
|
|
476
|
-
if (
|
|
473
|
+
if (!z(Ct, Ae(u, wt, ""))) {
|
|
474
|
+
if (!((s === "src" || s === "xlink:href" || s === "href") && t !== "script" && tn(u, "data:") === 0 && Mt[t])) {
|
|
475
|
+
if (!(Nt && !z(Rn, Ae(u, wt, "")))) {
|
|
476
|
+
if (u)
|
|
477
477
|
return !1;
|
|
478
478
|
}
|
|
479
479
|
}
|
|
@@ -489,7 +489,7 @@ function _n() {
|
|
|
489
489
|
const s = t.attributes;
|
|
490
490
|
if (!s || ct(t))
|
|
491
491
|
return;
|
|
492
|
-
const
|
|
492
|
+
const u = {
|
|
493
493
|
attrName: "",
|
|
494
494
|
attrValue: "",
|
|
495
495
|
keepAttr: !0,
|
|
@@ -500,7 +500,7 @@ function _n() {
|
|
|
500
500
|
for (; A--; ) {
|
|
501
501
|
const v = s[A], L = v.name, G = v.namespaceURI, re = v.value, te = k(L), ut = re;
|
|
502
502
|
let F = L === "value" ? ut : mi(ut);
|
|
503
|
-
if (
|
|
503
|
+
if (u.attrName = te, u.attrValue = F, u.keepAttr = !0, u.forceKeepAttr = void 0, ee(j.uponSanitizeAttribute, t, u), F = u.attrValue, xt && (te === "id" || te === "name") && tn(F, kt) !== 0 && (ue(L, t), F = kt + F), Ce && z(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, F)) {
|
|
504
504
|
ue(L, t);
|
|
505
505
|
continue;
|
|
506
506
|
}
|
|
@@ -508,9 +508,9 @@ function _n() {
|
|
|
508
508
|
ue(L, t);
|
|
509
509
|
continue;
|
|
510
510
|
}
|
|
511
|
-
if (
|
|
511
|
+
if (u.forceKeepAttr)
|
|
512
512
|
continue;
|
|
513
|
-
if (!
|
|
513
|
+
if (!u.keepAttr) {
|
|
514
514
|
ue(L, t);
|
|
515
515
|
continue;
|
|
516
516
|
}
|
|
@@ -547,54 +547,54 @@ function _n() {
|
|
|
547
547
|
ee(j.afterSanitizeAttributes, t, null);
|
|
548
548
|
}, mt = function(t) {
|
|
549
549
|
let s = null;
|
|
550
|
-
const
|
|
551
|
-
for (ee(j.beforeSanitizeShadowDOM, t, null); s =
|
|
552
|
-
ee(j.uponSanitizeShadowNode, s, null), Gt(s), Yt(s), s.content instanceof
|
|
550
|
+
const u = $t(t);
|
|
551
|
+
for (ee(j.beforeSanitizeShadowDOM, t, null); s = u.nextNode(); )
|
|
552
|
+
ee(j.uponSanitizeShadowNode, s, null), Gt(s), Yt(s), s.content instanceof c && mt(s.content);
|
|
553
553
|
ee(j.afterSanitizeShadowDOM, t, null);
|
|
554
554
|
}, Be = function(t) {
|
|
555
|
-
if (t.nodeType === Se.element && t.shadowRoot instanceof
|
|
555
|
+
if (t.nodeType === Se.element && t.shadowRoot instanceof c) {
|
|
556
556
|
const A = t.shadowRoot;
|
|
557
557
|
Be(A), mt(A);
|
|
558
558
|
}
|
|
559
559
|
const s = t.childNodes;
|
|
560
560
|
if (!s)
|
|
561
561
|
return;
|
|
562
|
-
const
|
|
562
|
+
const u = [];
|
|
563
563
|
Te(s, (A) => {
|
|
564
|
-
ye(
|
|
564
|
+
ye(u, A);
|
|
565
565
|
});
|
|
566
|
-
for (const A of
|
|
566
|
+
for (const A of u)
|
|
567
567
|
Be(A);
|
|
568
568
|
};
|
|
569
|
-
return n.sanitize = function(
|
|
570
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null,
|
|
571
|
-
if (ot = !
|
|
569
|
+
return n.sanitize = function(g) {
|
|
570
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, u = null, A = null, v = null;
|
|
571
|
+
if (ot = !g, ot && (g = "<!-->"), typeof g != "string" && !$e(g) && (g = gi(g), typeof g != "string"))
|
|
572
572
|
throw Ge("dirty is not a string, aborting");
|
|
573
573
|
if (!n.isSupported)
|
|
574
|
-
return
|
|
575
|
-
if (Je || lt(t), n.removed = [], typeof
|
|
576
|
-
const re =
|
|
574
|
+
return g;
|
|
575
|
+
if (Je || lt(t), n.removed = [], typeof g == "string" && (De = !1), De) {
|
|
576
|
+
const re = g.nodeName;
|
|
577
577
|
if (typeof re == "string") {
|
|
578
578
|
const te = k(re);
|
|
579
579
|
if (!P[te] || we[te])
|
|
580
580
|
throw Ge("root node is forbidden and cannot be sanitized in-place");
|
|
581
581
|
}
|
|
582
|
-
Be(
|
|
583
|
-
} else if ($e(
|
|
584
|
-
s = Ht("<!---->"),
|
|
582
|
+
Be(g);
|
|
583
|
+
} else if ($e(g))
|
|
584
|
+
s = Ht("<!---->"), u = s.ownerDocument.importNode(g, !0), u.nodeType === Se.element && u.nodeName === "BODY" || u.nodeName === "HTML" ? s = u : s.appendChild(u), Be(u);
|
|
585
585
|
else {
|
|
586
586
|
if (!pe && !oe && !me && // eslint-disable-next-line unicorn/prefer-includes
|
|
587
|
-
|
|
588
|
-
return E && ze ? E.createHTML(
|
|
589
|
-
if (s = Ht(
|
|
587
|
+
g.indexOf("<") === -1)
|
|
588
|
+
return E && ze ? E.createHTML(g) : g;
|
|
589
|
+
if (s = Ht(g), !s)
|
|
590
590
|
return pe ? null : ze ? N : "";
|
|
591
591
|
}
|
|
592
592
|
s && et && X(s.firstChild);
|
|
593
|
-
const L = $t(De ?
|
|
593
|
+
const L = $t(De ? g : s);
|
|
594
594
|
for (; A = L.nextNode(); )
|
|
595
|
-
Gt(A), Yt(A), A.content instanceof
|
|
595
|
+
Gt(A), Yt(A), A.content instanceof c && mt(A.content);
|
|
596
596
|
if (De)
|
|
597
|
-
return oe && Bt(
|
|
597
|
+
return oe && Bt(g), g;
|
|
598
598
|
if (pe) {
|
|
599
599
|
if (oe && Bt(s), Ue)
|
|
600
600
|
for (v = Xe.call(s.ownerDocument); s.firstChild; )
|
|
@@ -609,24 +609,24 @@ function _n() {
|
|
|
609
609
|
G = Ae(G, re, " ");
|
|
610
610
|
}), E && ze ? E.createHTML(G) : G;
|
|
611
611
|
}, n.setConfig = function() {
|
|
612
|
-
let
|
|
613
|
-
lt(
|
|
612
|
+
let g = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
613
|
+
lt(g), Je = !0;
|
|
614
614
|
}, n.clearConfig = function() {
|
|
615
615
|
be = null, Je = !1;
|
|
616
|
-
}, n.isValidAttribute = function(
|
|
616
|
+
}, n.isValidAttribute = function(g, t, s) {
|
|
617
617
|
be || lt({});
|
|
618
|
-
const
|
|
619
|
-
return Wt(
|
|
620
|
-
}, n.addHook = function(
|
|
621
|
-
typeof t == "function" && ye(j[
|
|
622
|
-
}, n.removeHook = function(
|
|
618
|
+
const u = k(g), A = k(t);
|
|
619
|
+
return Wt(u, A, s);
|
|
620
|
+
}, n.addHook = function(g, t) {
|
|
621
|
+
typeof t == "function" && ye(j[g], t);
|
|
622
|
+
}, n.removeHook = function(g, t) {
|
|
623
623
|
if (t !== void 0) {
|
|
624
|
-
const s = li(j[
|
|
625
|
-
return s === -1 ? void 0 : ci(j[
|
|
624
|
+
const s = li(j[g], t);
|
|
625
|
+
return s === -1 ? void 0 : ci(j[g], s, 1)[0];
|
|
626
626
|
}
|
|
627
|
-
return Jt(j[
|
|
628
|
-
}, n.removeHooks = function(
|
|
629
|
-
j[
|
|
627
|
+
return Jt(j[g]);
|
|
628
|
+
}, n.removeHooks = function(g) {
|
|
629
|
+
j[g] = [];
|
|
630
630
|
}, n.removeAllHooks = function() {
|
|
631
631
|
j = mn();
|
|
632
632
|
}, n;
|
|
@@ -641,6 +641,7 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
641
641
|
"overflow-x",
|
|
642
642
|
"overflow-y",
|
|
643
643
|
"visibility",
|
|
644
|
+
"opacity",
|
|
644
645
|
"cursor",
|
|
645
646
|
"direction",
|
|
646
647
|
"user-select",
|
|
@@ -838,6 +839,10 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
838
839
|
"animation-direction",
|
|
839
840
|
"animation-fill-mode",
|
|
840
841
|
"animation-play-state",
|
|
842
|
+
// transforms — no value filter needed; .user_content has overflow-y:hidden and overflow-x:auto
|
|
843
|
+
// (canvas-lms g/412928), which together contain transformed content within the container on
|
|
844
|
+
// both axes and prevent overlay of Canvas UI.
|
|
845
|
+
"transform",
|
|
841
846
|
// columns
|
|
842
847
|
"column-count",
|
|
843
848
|
"column-width",
|
|
@@ -918,13 +923,15 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
918
923
|
"webkitallowfullscreen",
|
|
919
924
|
"mozallowfullscreen",
|
|
920
925
|
"scrolling",
|
|
926
|
+
// loading="lazy" is not in DOMPurify's default ALLOWED_ATTR and must be
|
|
927
|
+
// explicitly added. No security concern — it is a performance hint only.
|
|
928
|
+
"loading",
|
|
921
929
|
// MathML 4 (W3C) annotation attributes for screen-reader accessibility.
|
|
922
930
|
// MathCAT, JAWS, and NVDA use `intent` to know how to pronounce
|
|
923
931
|
// expressions; `arg` labels sub-expressions referenced by intent.
|
|
924
932
|
// These are plain string annotations — no URL-loading, no code execution.
|
|
925
933
|
"intent",
|
|
926
|
-
"arg"
|
|
927
|
-
"loading"
|
|
934
|
+
"arg"
|
|
928
935
|
],
|
|
929
936
|
// Rails UJS turns data-method/data-remote/etc. on clickable elements into
|
|
930
937
|
// state-changing requests carrying the victim's CSRF token. Strip them so
|
|
@@ -950,11 +957,11 @@ function Pi() {
|
|
|
950
957
|
return se || (se = typeof bt == "function" ? bt(window) : bt, se.addHook("afterSanitizeAttributes", (e) => {
|
|
951
958
|
if (!(e instanceof Element) || !e.hasAttribute("style")) return;
|
|
952
959
|
const n = e.style, o = [];
|
|
953
|
-
for (let
|
|
954
|
-
const
|
|
955
|
-
Ni.has(
|
|
960
|
+
for (let f = 0; f < n.length; f++) {
|
|
961
|
+
const m = n.item(f);
|
|
962
|
+
Ni.has(m) || o.push(m);
|
|
956
963
|
}
|
|
957
|
-
for (const
|
|
964
|
+
for (const f of o) n.removeProperty(f);
|
|
958
965
|
const a = /* @__PURE__ */ new Set([
|
|
959
966
|
"static",
|
|
960
967
|
"relative",
|
|
@@ -964,11 +971,13 @@ function Pi() {
|
|
|
964
971
|
"unset",
|
|
965
972
|
"revert",
|
|
966
973
|
"revert-layer"
|
|
967
|
-
]),
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
974
|
+
]), l = n.getPropertyValue("position").trim().toLowerCase();
|
|
975
|
+
l && !a.has(l) && n.removeProperty("position");
|
|
976
|
+
const c = /* @__PURE__ */ new Set(["initial", "inherit", "unset", "revert", "revert-layer"]), d = n.getPropertyValue("opacity").trim().toLowerCase();
|
|
977
|
+
d && !c.has(d) && (d.endsWith("%") ? parseFloat(d) / 100 : parseFloat(d)) < 0.05 && n.removeProperty("opacity");
|
|
978
|
+
for (const f of Li) {
|
|
979
|
+
const m = n.getPropertyValue(f);
|
|
980
|
+
m && xi.test(m) && n.removeProperty(f);
|
|
972
981
|
}
|
|
973
982
|
n.length === 0 && e.removeAttribute("style");
|
|
974
983
|
}), se.addHook("uponSanitizeAttribute", (e, n) => {
|
|
@@ -977,20 +986,20 @@ function Pi() {
|
|
|
977
986
|
/^\s*\/\//.test(o) ? (n.attrValue = o.trimStart().replace(/^\/\//, "https://"), n.keepAttr = !0) : /^\s*\\/.test(o) && (n.keepAttr = !1);
|
|
978
987
|
}), se.addHook("afterSanitizeAttributes", (e) => {
|
|
979
988
|
if (!(e instanceof Element) || !e.hasAttribute("srcset")) return;
|
|
980
|
-
const n = (e.getAttribute("srcset") ?? "").split(","), o = (
|
|
981
|
-
if (n.some((
|
|
989
|
+
const n = (e.getAttribute("srcset") ?? "").split(","), o = (c) => c.trim().split(/\s+/)[0];
|
|
990
|
+
if (n.some((c) => /^\s*\\/.test(o(c)))) {
|
|
982
991
|
e.removeAttribute("srcset");
|
|
983
992
|
return;
|
|
984
993
|
}
|
|
985
994
|
let a = !1;
|
|
986
|
-
const
|
|
987
|
-
const
|
|
988
|
-
if (!
|
|
995
|
+
const l = n.map((c) => {
|
|
996
|
+
const d = o(c);
|
|
997
|
+
if (!d.startsWith("//")) return c;
|
|
989
998
|
a = !0;
|
|
990
|
-
const
|
|
991
|
-
return
|
|
999
|
+
const f = c.indexOf(d);
|
|
1000
|
+
return c.slice(0, f) + "https://" + d.slice(2) + c.slice(f + d.length);
|
|
992
1001
|
});
|
|
993
|
-
a && e.setAttribute("srcset",
|
|
1002
|
+
a && e.setAttribute("srcset", l.join(","));
|
|
994
1003
|
}), se.addHook("afterSanitizeAttributes", (e) => {
|
|
995
1004
|
var n;
|
|
996
1005
|
if (!(e instanceof Element) || e.tagName !== "A" && e.tagName !== "AREA" || ((n = e.getAttribute("target")) == null ? void 0 : n.toLowerCase()) !== "_blank") return;
|
|
@@ -1331,22 +1340,22 @@ function Xi({
|
|
|
1331
1340
|
assignmentId: n,
|
|
1332
1341
|
userId: o,
|
|
1333
1342
|
executeQuery: a,
|
|
1334
|
-
enabled:
|
|
1343
|
+
enabled: l = !0
|
|
1335
1344
|
}) {
|
|
1336
1345
|
return Ve({
|
|
1337
1346
|
queryKey: ["assignment-review", "assignment", e, n, o],
|
|
1338
1347
|
queryFn: async () => {
|
|
1339
|
-
const
|
|
1348
|
+
const c = await a(Fi, {
|
|
1340
1349
|
courseId: e,
|
|
1341
1350
|
assignmentId: n,
|
|
1342
1351
|
userId: o
|
|
1343
|
-
}),
|
|
1352
|
+
}), d = Bi.parse(c);
|
|
1344
1353
|
return {
|
|
1345
|
-
...
|
|
1346
|
-
courseName:
|
|
1354
|
+
...d.legacyNode,
|
|
1355
|
+
courseName: d.course.name
|
|
1347
1356
|
};
|
|
1348
1357
|
},
|
|
1349
|
-
enabled:
|
|
1358
|
+
enabled: l
|
|
1350
1359
|
});
|
|
1351
1360
|
}
|
|
1352
1361
|
function Ki({
|
|
@@ -1359,7 +1368,7 @@ function Ki({
|
|
|
1359
1368
|
queryFn: async () => {
|
|
1360
1369
|
const a = await n(zi, { submissionId: e });
|
|
1361
1370
|
return qi.parse(a).node.submissionHistoriesConnection.nodes.slice().sort(
|
|
1362
|
-
(
|
|
1371
|
+
(c, d) => new Date(d.submittedAt).getTime() - new Date(c.submittedAt).getTime()
|
|
1363
1372
|
);
|
|
1364
1373
|
},
|
|
1365
1374
|
enabled: o
|
|
@@ -1375,9 +1384,9 @@ function Qi({
|
|
|
1375
1384
|
isSelected: n,
|
|
1376
1385
|
isDraft: o = !1,
|
|
1377
1386
|
pointsPossible: a,
|
|
1378
|
-
onClick:
|
|
1387
|
+
onClick: l
|
|
1379
1388
|
}) {
|
|
1380
|
-
const
|
|
1389
|
+
const c = q(), d = o ? c.submissionCurrentAttempt() : c.commentsAttempt({ number: e.attempt }), f = e.score != null && a != null ? `${e.score}/${a}` : null;
|
|
1381
1390
|
return /* @__PURE__ */ r(
|
|
1382
1391
|
K,
|
|
1383
1392
|
{
|
|
@@ -1388,21 +1397,21 @@ function Qi({
|
|
|
1388
1397
|
borderRadius: "medium",
|
|
1389
1398
|
background: n ? "secondary" : "primary",
|
|
1390
1399
|
cursor: "pointer",
|
|
1391
|
-
onClick:
|
|
1400
|
+
onClick: l,
|
|
1392
1401
|
role: "button",
|
|
1393
1402
|
tabIndex: 0,
|
|
1394
|
-
onKeyDown: (
|
|
1395
|
-
(
|
|
1403
|
+
onKeyDown: (m) => {
|
|
1404
|
+
(m.key === "Enter" || m.key === " ") && (m.preventDefault(), l());
|
|
1396
1405
|
},
|
|
1397
1406
|
children: /* @__PURE__ */ S(b, { justifyItems: "space-between", alignItems: "center", children: [
|
|
1398
1407
|
/* @__PURE__ */ S(b, { direction: "column", gap: "xx-small", children: [
|
|
1399
1408
|
/* @__PURE__ */ S(b, { gap: "small", alignItems: "center", children: [
|
|
1400
|
-
/* @__PURE__ */ r(_, { weight: "bold", children:
|
|
1401
|
-
o && /* @__PURE__ */ r(_t, { color: "info", children:
|
|
1409
|
+
/* @__PURE__ */ r(_, { weight: "bold", children: d }),
|
|
1410
|
+
o && /* @__PURE__ */ r(_t, { color: "info", children: c.submissionDraft() })
|
|
1402
1411
|
] }),
|
|
1403
1412
|
!o && e.submittedAt && /* @__PURE__ */ r(_, { size: "small", color: "secondary", children: Zi(e.submittedAt) })
|
|
1404
1413
|
] }),
|
|
1405
|
-
|
|
1414
|
+
f && /* @__PURE__ */ r(_, { weight: "bold", children: f })
|
|
1406
1415
|
] })
|
|
1407
1416
|
}
|
|
1408
1417
|
);
|
|
@@ -1412,26 +1421,26 @@ function Ji({
|
|
|
1412
1421
|
selectedAttempt: n,
|
|
1413
1422
|
onAttemptSelect: o,
|
|
1414
1423
|
pointsPossible: a,
|
|
1415
|
-
executeQuery:
|
|
1424
|
+
executeQuery: l
|
|
1416
1425
|
}) {
|
|
1417
|
-
const
|
|
1426
|
+
const c = q(), { data: d, isLoading: f, isError: m } = Ki({
|
|
1418
1427
|
submissionId: e,
|
|
1419
|
-
executeQuery:
|
|
1428
|
+
executeQuery: l
|
|
1420
1429
|
});
|
|
1421
|
-
if (
|
|
1422
|
-
return /* @__PURE__ */ r(b, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(Ye, { renderTitle:
|
|
1423
|
-
if (
|
|
1424
|
-
return /* @__PURE__ */ r(b, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(_, { color: "danger", children:
|
|
1425
|
-
const
|
|
1426
|
-
return
|
|
1430
|
+
if (f)
|
|
1431
|
+
return /* @__PURE__ */ r(b, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(Ye, { renderTitle: c.navigationAttempts(), size: "small" }) });
|
|
1432
|
+
if (m)
|
|
1433
|
+
return /* @__PURE__ */ r(b, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(_, { color: "danger", children: c.submissionLoadAttemptsError() }) });
|
|
1434
|
+
const p = (d == null ? void 0 : d.filter((h) => h.attempt > 0)) ?? [];
|
|
1435
|
+
return p.length === 0 ? /* @__PURE__ */ r(b, { padding: "medium", children: /* @__PURE__ */ r(_, { color: "secondary", children: c.submissionNoAttempts() }) }) : /* @__PURE__ */ r(b, { direction: "column", gap: "x-small", padding: "none none medium none", children: p.map((h) => /* @__PURE__ */ r(
|
|
1427
1436
|
Qi,
|
|
1428
1437
|
{
|
|
1429
|
-
submission:
|
|
1430
|
-
isSelected: n ===
|
|
1438
|
+
submission: h,
|
|
1439
|
+
isSelected: n === h.attempt,
|
|
1431
1440
|
pointsPossible: a,
|
|
1432
|
-
onClick: () => o(
|
|
1441
|
+
onClick: () => o(h)
|
|
1433
1442
|
},
|
|
1434
|
-
|
|
1443
|
+
h.attempt
|
|
1435
1444
|
)) });
|
|
1436
1445
|
}
|
|
1437
1446
|
function wn({
|
|
@@ -1463,25 +1472,25 @@ function to({
|
|
|
1463
1472
|
showAttemptLabel: o = !0,
|
|
1464
1473
|
renderHTML: a
|
|
1465
1474
|
}) {
|
|
1466
|
-
const
|
|
1475
|
+
const l = q(), c = a ?? eo, d = (e == null ? void 0 : e.submissionType) === "online_text_entry", f = (e == null ? void 0 : e.submissionType) === "online_upload", m = d ? l.submissionTextHeading() : l.submissionUploadHeading(), p = qe(() => {
|
|
1467
1476
|
if (!e) return [];
|
|
1468
1477
|
const C = [];
|
|
1469
1478
|
if (e.attachment && C.push(e.attachment), e.attachments)
|
|
1470
1479
|
for (const I of e.attachments)
|
|
1471
1480
|
C.some((w) => w.id === I.id) || C.push(I);
|
|
1472
1481
|
return C;
|
|
1473
|
-
}, [e]),
|
|
1482
|
+
}, [e]), h = qe(() => c((e == null ? void 0 : e.body) ?? ""), [e == null ? void 0 : e.body, c]);
|
|
1474
1483
|
return e ? /* @__PURE__ */ r(K, { as: "div", children: /* @__PURE__ */ S(b, { direction: "column", gap: "small", children: [
|
|
1475
|
-
o && !n && e.attempt != null && /* @__PURE__ */ r(_, { size: "small", weight: "bold", color: "secondary", children:
|
|
1484
|
+
o && !n && e.attempt != null && /* @__PURE__ */ r(_, { size: "small", weight: "bold", color: "secondary", children: l.submissionViewingAttempt({ number: e.attempt }) }),
|
|
1476
1485
|
/* @__PURE__ */ S(b, { gap: "x-small", alignItems: "center", children: [
|
|
1477
1486
|
/* @__PURE__ */ r($n, { color: "success" }),
|
|
1478
|
-
/* @__PURE__ */ r(St, { level: "h3", children:
|
|
1487
|
+
/* @__PURE__ */ r(St, { level: "h3", children: m })
|
|
1479
1488
|
] }),
|
|
1480
|
-
|
|
1489
|
+
d && e.body && /* @__PURE__ */ S(b, { alignItems: "stretch", gap: "small", children: [
|
|
1481
1490
|
/* @__PURE__ */ r(K, { as: "div", width: "4px", background: "primary", borderRadius: "small" }),
|
|
1482
|
-
/* @__PURE__ */ r(K, { as: "div", children: /* @__PURE__ */ r(_, { children:
|
|
1491
|
+
/* @__PURE__ */ r(K, { as: "div", children: /* @__PURE__ */ r(_, { children: h }) })
|
|
1483
1492
|
] }),
|
|
1484
|
-
|
|
1493
|
+
f && p.length > 0 && /* @__PURE__ */ r(wn, { attachments: p })
|
|
1485
1494
|
] }) }) : null;
|
|
1486
1495
|
}
|
|
1487
1496
|
function no(e) {
|
|
@@ -1496,33 +1505,33 @@ function oo({
|
|
|
1496
1505
|
pointsPossible: n,
|
|
1497
1506
|
gradingType: o,
|
|
1498
1507
|
dueAt: a,
|
|
1499
|
-
allowedAttempts:
|
|
1500
|
-
currentAttempt:
|
|
1501
|
-
isOverdue:
|
|
1502
|
-
estimatedDuration:
|
|
1503
|
-
labels:
|
|
1508
|
+
allowedAttempts: l,
|
|
1509
|
+
currentAttempt: c,
|
|
1510
|
+
isOverdue: d,
|
|
1511
|
+
estimatedDuration: f,
|
|
1512
|
+
labels: m
|
|
1504
1513
|
}) {
|
|
1505
|
-
const
|
|
1506
|
-
return
|
|
1507
|
-
/* @__PURE__ */ r(_, { size: "small", children: (
|
|
1508
|
-
), e != null && n != null ?
|
|
1509
|
-
/* @__PURE__ */ r(_, { size: "small", children: (
|
|
1510
|
-
) : n != null && o !== "not_graded" &&
|
|
1511
|
-
/* @__PURE__ */ r(_, { size: "small", children: (
|
|
1512
|
-
),
|
|
1513
|
-
/* @__PURE__ */ r(_, { size: "small", children: (
|
|
1514
|
-
) :
|
|
1515
|
-
/* @__PURE__ */ r(_, { size: "small", children: (
|
|
1516
|
-
) :
|
|
1517
|
-
/* @__PURE__ */ r(_, { size: "small", children: (
|
|
1518
|
-
)), a &&
|
|
1519
|
-
/* @__PURE__ */ r(_, { size: "small", children: (
|
|
1514
|
+
const p = q(), h = [];
|
|
1515
|
+
return f && h.push(
|
|
1516
|
+
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.duration) ?? p.headerDuration({ minutes: f }) }, "duration")
|
|
1517
|
+
), e != null && n != null ? h.push(
|
|
1518
|
+
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.score) ?? p.headerScore({ score: e, total: n }) }, "score")
|
|
1519
|
+
) : n != null && o !== "not_graded" && h.push(
|
|
1520
|
+
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.pointsPossible) ?? p.headerPointsPossible({ points: n }) }, "points")
|
|
1521
|
+
), l != null && (l === -1 ? h.push(
|
|
1522
|
+
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.attempts) ?? p.headerAttemptsUnlimited() }, "attempts")
|
|
1523
|
+
) : c != null ? h.push(
|
|
1524
|
+
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.attempts) ?? p.headerAttemptOf({ current: c, total: l }) }, "attempts")
|
|
1525
|
+
) : h.push(
|
|
1526
|
+
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.attempts) ?? p.headerAttemptsAllowed({ count: l }) }, "attempts")
|
|
1527
|
+
)), a && h.push(
|
|
1528
|
+
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.dueDate) ?? p.headerDueDate({ date: no(a) }) }, "due")
|
|
1520
1529
|
), /* @__PURE__ */ S(b, { as: "div", direction: "row", alignItems: "center", gap: "small", children: [
|
|
1521
|
-
|
|
1530
|
+
h.map((C, I) => /* @__PURE__ */ S(b, { gap: "small", alignItems: "center", children: [
|
|
1522
1531
|
I > 0 && /* @__PURE__ */ r(io, {}),
|
|
1523
1532
|
C
|
|
1524
1533
|
] }, `item-${String(I)}`)),
|
|
1525
|
-
|
|
1534
|
+
d && /* @__PURE__ */ r(_t, { color: "danger", children: (m == null ? void 0 : m.overdue) ?? p.headerOverdue() })
|
|
1526
1535
|
] });
|
|
1527
1536
|
}
|
|
1528
1537
|
const ro = ae`
|
|
@@ -1702,14 +1711,14 @@ function ao({
|
|
|
1702
1711
|
}) {
|
|
1703
1712
|
const n = un();
|
|
1704
1713
|
return dn({
|
|
1705
|
-
mutationFn: async ({ submissionId: o, attempt: a, comment:
|
|
1706
|
-
const
|
|
1714
|
+
mutationFn: async ({ submissionId: o, attempt: a, comment: l, fileIds: c }) => {
|
|
1715
|
+
const d = await e(ro, {
|
|
1707
1716
|
id: o,
|
|
1708
1717
|
submissionAttempt: a,
|
|
1709
|
-
comment:
|
|
1710
|
-
fileIds:
|
|
1718
|
+
comment: l,
|
|
1719
|
+
fileIds: c
|
|
1711
1720
|
});
|
|
1712
|
-
return Yi.parse(
|
|
1721
|
+
return Yi.parse(d), d;
|
|
1713
1722
|
},
|
|
1714
1723
|
onSuccess: (o, a) => {
|
|
1715
1724
|
n.invalidateQueries({
|
|
@@ -1723,8 +1732,8 @@ function lo({
|
|
|
1723
1732
|
courseId: n,
|
|
1724
1733
|
pageParams: o,
|
|
1725
1734
|
direction: a,
|
|
1726
|
-
executeQuery:
|
|
1727
|
-
enabled:
|
|
1735
|
+
executeQuery: l,
|
|
1736
|
+
enabled: c
|
|
1728
1737
|
}) {
|
|
1729
1738
|
return Ve({
|
|
1730
1739
|
queryKey: [
|
|
@@ -1737,22 +1746,22 @@ function lo({
|
|
|
1737
1746
|
a
|
|
1738
1747
|
],
|
|
1739
1748
|
queryFn: async () => {
|
|
1740
|
-
const
|
|
1749
|
+
const d = await l(Ui, {
|
|
1741
1750
|
submissionId: e,
|
|
1742
1751
|
courseId: n,
|
|
1743
1752
|
beforeCursor: a === "prev" ? (o == null ? void 0 : o.startCursor) ?? null : null,
|
|
1744
1753
|
afterCursor: a === "next" ? (o == null ? void 0 : o.endCursor) ?? null : null,
|
|
1745
1754
|
first: a === "next" ? 5 : null,
|
|
1746
1755
|
last: a === "prev" || !a ? 5 : null
|
|
1747
|
-
}),
|
|
1756
|
+
}), f = Gi.parse(d);
|
|
1748
1757
|
return {
|
|
1749
|
-
comments: [...
|
|
1750
|
-
(
|
|
1758
|
+
comments: [...f.submissionComments.commentsConnection.nodes].sort(
|
|
1759
|
+
(p, h) => new Date(p.createdAt).getTime() - new Date(h.createdAt).getTime()
|
|
1751
1760
|
),
|
|
1752
|
-
pageInfo:
|
|
1761
|
+
pageInfo: f.submissionComments.commentsConnection.pageInfo
|
|
1753
1762
|
};
|
|
1754
1763
|
},
|
|
1755
|
-
enabled:
|
|
1764
|
+
enabled: c ?? !!e
|
|
1756
1765
|
});
|
|
1757
1766
|
}
|
|
1758
1767
|
function co({
|
|
@@ -1761,16 +1770,16 @@ function co({
|
|
|
1761
1770
|
const n = un();
|
|
1762
1771
|
return dn({
|
|
1763
1772
|
mutationFn: async ({ submissionId: o, submissionCommentIds: a }) => {
|
|
1764
|
-
const
|
|
1773
|
+
const l = await e(
|
|
1765
1774
|
so,
|
|
1766
1775
|
{ submissionId: o, submissionCommentIds: a }
|
|
1767
1776
|
);
|
|
1768
|
-
return Vi.parse(
|
|
1777
|
+
return Vi.parse(l), l;
|
|
1769
1778
|
},
|
|
1770
1779
|
onSuccess: (o, a) => {
|
|
1771
1780
|
n.invalidateQueries({
|
|
1772
1781
|
queryKey: ["assignment-review", "assignment"],
|
|
1773
|
-
predicate: (
|
|
1782
|
+
predicate: (l) => l.queryKey.includes(a.assignmentId)
|
|
1774
1783
|
});
|
|
1775
1784
|
}
|
|
1776
1785
|
});
|
|
@@ -1787,8 +1796,8 @@ function fo({
|
|
|
1787
1796
|
isFullWidth: n,
|
|
1788
1797
|
renderHTML: o
|
|
1789
1798
|
}) {
|
|
1790
|
-
var
|
|
1791
|
-
const a = q(),
|
|
1799
|
+
var m;
|
|
1800
|
+
const a = q(), l = o ?? mo, c = ((m = e.author.courseRoles) == null ? void 0 : m.includes("StudentEnrollment")) ?? !1, d = qe(() => l(e.htmlComment), [e.htmlComment, l]);
|
|
1792
1801
|
return /* @__PURE__ */ r(
|
|
1793
1802
|
K,
|
|
1794
1803
|
{
|
|
@@ -1797,7 +1806,7 @@ function fo({
|
|
|
1797
1806
|
borderWidth: "small",
|
|
1798
1807
|
borderColor: "primary",
|
|
1799
1808
|
borderRadius: "medium",
|
|
1800
|
-
margin: n ? "none" :
|
|
1809
|
+
margin: n ? "none" : c ? "none none none medium" : "none medium none none",
|
|
1801
1810
|
children: /* @__PURE__ */ S(b, { as: "div", direction: "column", gap: "small", children: [
|
|
1802
1811
|
/* @__PURE__ */ S(b, { as: "div", direction: "column", gap: "xx-small", children: [
|
|
1803
1812
|
/* @__PURE__ */ S(b, { as: "div", justifyItems: "space-between", alignItems: "center", children: [
|
|
@@ -1807,13 +1816,13 @@ function fo({
|
|
|
1807
1816
|
/* @__PURE__ */ r(_, { size: "small", color: "secondary", children: uo(e.createdAt) }),
|
|
1808
1817
|
e.attempt > 0 && /* @__PURE__ */ r(_, { size: "small", color: "secondary", children: a.commentsAttempt({ number: e.attempt }) })
|
|
1809
1818
|
] }),
|
|
1810
|
-
/* @__PURE__ */ r(_, { size: "medium", children:
|
|
1819
|
+
/* @__PURE__ */ r(_, { size: "medium", children: d }),
|
|
1811
1820
|
e.attachments && e.attachments.length > 0 && /* @__PURE__ */ r(
|
|
1812
1821
|
wn,
|
|
1813
1822
|
{
|
|
1814
|
-
attachments: e.attachments.map((
|
|
1815
|
-
...
|
|
1816
|
-
_id:
|
|
1823
|
+
attachments: e.attachments.map((p) => ({
|
|
1824
|
+
...p,
|
|
1825
|
+
_id: p._id ?? p.id,
|
|
1817
1826
|
submissionPreviewUrl: null
|
|
1818
1827
|
})),
|
|
1819
1828
|
size: "small"
|
|
@@ -1828,18 +1837,18 @@ function po({
|
|
|
1828
1837
|
courseId: n,
|
|
1829
1838
|
assignmentId: o,
|
|
1830
1839
|
attempt: a,
|
|
1831
|
-
canPostComment:
|
|
1832
|
-
onCommentPosted:
|
|
1833
|
-
renderHTML:
|
|
1834
|
-
executeQuery:
|
|
1840
|
+
canPostComment: l,
|
|
1841
|
+
onCommentPosted: c,
|
|
1842
|
+
renderHTML: d,
|
|
1843
|
+
executeQuery: f
|
|
1835
1844
|
}) {
|
|
1836
|
-
const
|
|
1845
|
+
const m = q(), [p, h] = Ee(""), [C, I] = Ee({}), w = zn(/* @__PURE__ */ new Set()), { data: y, isLoading: V, isError: fe } = lo({
|
|
1837
1846
|
submissionId: e,
|
|
1838
1847
|
courseId: n,
|
|
1839
1848
|
pageParams: C.pageParams,
|
|
1840
1849
|
direction: C.direction,
|
|
1841
|
-
executeQuery:
|
|
1842
|
-
}), le = ao({ executeQuery:
|
|
1850
|
+
executeQuery: f
|
|
1851
|
+
}), le = ao({ executeQuery: f }), M = co({ executeQuery: f });
|
|
1843
1852
|
Tt(() => {
|
|
1844
1853
|
if (!(y != null && y.comments) || y.comments.length === 0) return;
|
|
1845
1854
|
const E = y.comments.filter((N) => !N.read && !w.current.has(N._id)).filter((N) => {
|
|
@@ -1858,23 +1867,23 @@ function po({
|
|
|
1858
1867
|
return !((N = E.author.courseRoles) != null && N.includes("StudentEnrollment"));
|
|
1859
1868
|
}
|
|
1860
1869
|
), O = () => {
|
|
1861
|
-
|
|
1862
|
-
{ submissionId: e, attempt: a, comment:
|
|
1870
|
+
p.trim() && le.mutate(
|
|
1871
|
+
{ submissionId: e, attempt: a, comment: p },
|
|
1863
1872
|
{
|
|
1864
1873
|
onSuccess: () => {
|
|
1865
|
-
|
|
1874
|
+
h(""), c == null || c();
|
|
1866
1875
|
}
|
|
1867
1876
|
}
|
|
1868
1877
|
);
|
|
1869
1878
|
}, ce = (y == null ? void 0 : y.pageInfo.hasNextPage) || (y == null ? void 0 : y.pageInfo.hasPreviousPage);
|
|
1870
|
-
return V || !y && !fe ? /* @__PURE__ */ r(b, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(Ye, { renderTitle:
|
|
1879
|
+
return V || !y && !fe ? /* @__PURE__ */ r(b, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(Ye, { renderTitle: m.commentsPanelTitle(), size: "small" }) }) : fe ? /* @__PURE__ */ r(b, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(_, { color: "danger", children: m.commentsLoadError() }) }) : /* @__PURE__ */ S(b, { as: "div", direction: "column", justifyItems: "space-between", height: "100%", children: [
|
|
1871
1880
|
/* @__PURE__ */ S(b, { as: "div", direction: "column", children: [
|
|
1872
|
-
y.comments.length === 0 ? /* @__PURE__ */ r(b, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(_, { color: "secondary", children:
|
|
1881
|
+
y.comments.length === 0 ? /* @__PURE__ */ r(b, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(_, { color: "secondary", children: m.commentsEmpty() }) }) : /* @__PURE__ */ r(b, { direction: "column", gap: "x-small", children: y.comments.map((E) => /* @__PURE__ */ r(
|
|
1873
1882
|
fo,
|
|
1874
1883
|
{
|
|
1875
1884
|
comment: E,
|
|
1876
1885
|
isFullWidth: !ne,
|
|
1877
|
-
renderHTML:
|
|
1886
|
+
renderHTML: d
|
|
1878
1887
|
},
|
|
1879
1888
|
E._id
|
|
1880
1889
|
)) }),
|
|
@@ -1886,7 +1895,7 @@ function po({
|
|
|
1886
1895
|
size: "small",
|
|
1887
1896
|
interaction: y.pageInfo.hasPreviousPage ? "enabled" : "disabled",
|
|
1888
1897
|
onClick: () => I({ pageParams: y.pageInfo, direction: "prev" }),
|
|
1889
|
-
children:
|
|
1898
|
+
children: m.commentsPreviousComments()
|
|
1890
1899
|
}
|
|
1891
1900
|
),
|
|
1892
1901
|
/* @__PURE__ */ r(
|
|
@@ -1896,19 +1905,19 @@ function po({
|
|
|
1896
1905
|
size: "small",
|
|
1897
1906
|
interaction: y.pageInfo.hasNextPage ? "enabled" : "disabled",
|
|
1898
1907
|
onClick: () => I({ pageParams: y.pageInfo, direction: "next" }),
|
|
1899
|
-
children:
|
|
1908
|
+
children: m.commentsNextComments()
|
|
1900
1909
|
}
|
|
1901
1910
|
)
|
|
1902
1911
|
] })
|
|
1903
1912
|
] }),
|
|
1904
|
-
|
|
1913
|
+
l && /* @__PURE__ */ S(b, { as: "div", direction: "column", gap: "small", padding: "small none medium", children: [
|
|
1905
1914
|
/* @__PURE__ */ r(
|
|
1906
1915
|
bn,
|
|
1907
1916
|
{
|
|
1908
1917
|
resize: "vertical",
|
|
1909
|
-
label: /* @__PURE__ */ r(_, { weight: "bold", size: "medium", children:
|
|
1910
|
-
value:
|
|
1911
|
-
onChange: (E) =>
|
|
1918
|
+
label: /* @__PURE__ */ r(_, { weight: "bold", size: "medium", children: m.commentsPlaceholder() }),
|
|
1919
|
+
value: p,
|
|
1920
|
+
onChange: (E) => h(E.target.value)
|
|
1912
1921
|
}
|
|
1913
1922
|
),
|
|
1914
1923
|
/* @__PURE__ */ r(
|
|
@@ -1916,8 +1925,8 @@ function po({
|
|
|
1916
1925
|
{
|
|
1917
1926
|
color: "primary",
|
|
1918
1927
|
onClick: O,
|
|
1919
|
-
interaction:
|
|
1920
|
-
children:
|
|
1928
|
+
interaction: p.trim().length > 0 && !le.isPending ? "enabled" : "disabled",
|
|
1929
|
+
children: m.commentsPost()
|
|
1921
1930
|
}
|
|
1922
1931
|
)
|
|
1923
1932
|
] })
|
|
@@ -1931,33 +1940,33 @@ function Wo({
|
|
|
1931
1940
|
assignmentId: n,
|
|
1932
1941
|
userId: o,
|
|
1933
1942
|
feedbackMode: a = !1,
|
|
1934
|
-
onError:
|
|
1935
|
-
renderHTML:
|
|
1936
|
-
renderPanels:
|
|
1937
|
-
executeQuery:
|
|
1943
|
+
onError: l,
|
|
1944
|
+
renderHTML: c,
|
|
1945
|
+
renderPanels: d,
|
|
1946
|
+
executeQuery: f
|
|
1938
1947
|
}) {
|
|
1939
|
-
const
|
|
1940
|
-
data:
|
|
1948
|
+
const m = q(), p = c ?? go, {
|
|
1949
|
+
data: h,
|
|
1941
1950
|
isLoading: C,
|
|
1942
1951
|
isError: I,
|
|
1943
1952
|
error: w
|
|
1944
|
-
} = Xi({ courseId: e, assignmentId: n, userId: o, executeQuery:
|
|
1953
|
+
} = Xi({ courseId: e, assignmentId: n, userId: o, executeQuery: f }), [y, V] = Ee(null), [fe, le] = Ee(
|
|
1945
1954
|
a ? "comments" : null
|
|
1946
1955
|
), M = qe(
|
|
1947
|
-
() => (
|
|
1948
|
-
[
|
|
1949
|
-
), ne = M != null && M.attempt > 0, O = y ?? M, ce = y == null || y.attempt === (M == null ? void 0 : M.attempt), E = ne && ce, N = ((
|
|
1956
|
+
() => (h == null ? void 0 : h.submissionsConnection.nodes[0]) ?? null,
|
|
1957
|
+
[h]
|
|
1958
|
+
), ne = M != null && M.attempt > 0, O = y ?? M, ce = y == null || y.attempt === (M == null ? void 0 : M.attempt), E = ne && ce, N = ((h == null ? void 0 : h.allowedAttempts) ?? 0) !== 1, J = jn((Ze) => {
|
|
1950
1959
|
V(Ze);
|
|
1951
1960
|
}, []);
|
|
1952
1961
|
if (Tt(() => {
|
|
1953
|
-
I && w &&
|
|
1954
|
-
}, [I, w,
|
|
1962
|
+
I && w && l && l(w);
|
|
1963
|
+
}, [I, w, l]), Tt(() => {
|
|
1955
1964
|
a && ne && le("comments");
|
|
1956
1965
|
}, [a, ne]), C)
|
|
1957
|
-
return /* @__PURE__ */ r(b, { justifyItems: "center", padding: "large", children: /* @__PURE__ */ r(Ye, { renderTitle:
|
|
1958
|
-
if (I || !
|
|
1959
|
-
return /* @__PURE__ */ r(b, { justifyItems: "center", padding: "large", children: /* @__PURE__ */ r(_, { color: "danger", children:
|
|
1960
|
-
const Ie = !!
|
|
1966
|
+
return /* @__PURE__ */ r(b, { justifyItems: "center", padding: "large", children: /* @__PURE__ */ r(Ye, { renderTitle: m.progressLoading() }) });
|
|
1967
|
+
if (I || !h)
|
|
1968
|
+
return /* @__PURE__ */ r(b, { justifyItems: "center", padding: "large", children: /* @__PURE__ */ r(_, { color: "danger", children: m.assignmentLoadError() }) });
|
|
1969
|
+
const Ie = !!h.dueAt && new Date(h.dueAt) < /* @__PURE__ */ new Date() && !ne, xe = M ? /* @__PURE__ */ r(
|
|
1961
1970
|
po,
|
|
1962
1971
|
{
|
|
1963
1972
|
submissionId: M.id,
|
|
@@ -1965,8 +1974,8 @@ function Wo({
|
|
|
1965
1974
|
assignmentId: n,
|
|
1966
1975
|
attempt: (O == null ? void 0 : O.attempt) ?? 0,
|
|
1967
1976
|
canPostComment: E,
|
|
1968
|
-
renderHTML:
|
|
1969
|
-
executeQuery:
|
|
1977
|
+
renderHTML: p,
|
|
1978
|
+
executeQuery: f
|
|
1970
1979
|
}
|
|
1971
1980
|
) : null, Xe = N && M ? /* @__PURE__ */ r(
|
|
1972
1981
|
Ji,
|
|
@@ -1974,8 +1983,8 @@ function Wo({
|
|
|
1974
1983
|
submissionId: M.id,
|
|
1975
1984
|
selectedAttempt: O == null ? void 0 : O.attempt,
|
|
1976
1985
|
onAttemptSelect: J,
|
|
1977
|
-
pointsPossible:
|
|
1978
|
-
executeQuery:
|
|
1986
|
+
pointsPossible: h.pointsPossible,
|
|
1987
|
+
executeQuery: f
|
|
1979
1988
|
}
|
|
1980
1989
|
) : null, Ke = {
|
|
1981
1990
|
commentsPanel: xe,
|
|
@@ -1990,27 +1999,27 @@ function Wo({
|
|
|
1990
1999
|
oo,
|
|
1991
2000
|
{
|
|
1992
2001
|
score: O == null ? void 0 : O.score,
|
|
1993
|
-
pointsPossible:
|
|
1994
|
-
gradingType:
|
|
1995
|
-
dueAt:
|
|
1996
|
-
allowedAttempts:
|
|
2002
|
+
pointsPossible: h.pointsPossible,
|
|
2003
|
+
gradingType: h.gradingType,
|
|
2004
|
+
dueAt: h.dueAt,
|
|
2005
|
+
allowedAttempts: h.allowedAttempts,
|
|
1997
2006
|
currentAttempt: O == null ? void 0 : O.attempt,
|
|
1998
2007
|
isOverdue: Ie
|
|
1999
2008
|
}
|
|
2000
2009
|
),
|
|
2001
|
-
|
|
2002
|
-
/* @__PURE__ */ r(St, { level: "h3", children:
|
|
2003
|
-
/* @__PURE__ */ r(K, { as: "div", margin: "small none large none", children:
|
|
2010
|
+
h.description && /* @__PURE__ */ S(K, { as: "div", children: [
|
|
2011
|
+
/* @__PURE__ */ r(St, { level: "h3", children: m.assignmentInstructions() }),
|
|
2012
|
+
/* @__PURE__ */ r(K, { as: "div", margin: "small none large none", children: p(h.description) })
|
|
2004
2013
|
] }),
|
|
2005
2014
|
/* @__PURE__ */ r(
|
|
2006
2015
|
to,
|
|
2007
2016
|
{
|
|
2008
2017
|
submission: O,
|
|
2009
2018
|
isLastAttempt: ce,
|
|
2010
|
-
renderHTML:
|
|
2019
|
+
renderHTML: p
|
|
2011
2020
|
}
|
|
2012
2021
|
),
|
|
2013
|
-
|
|
2022
|
+
d ? d(Ke) : null
|
|
2014
2023
|
] });
|
|
2015
2024
|
}
|
|
2016
2025
|
function qo({
|
|
@@ -2018,17 +2027,17 @@ function qo({
|
|
|
2018
2027
|
onSubmit: n,
|
|
2019
2028
|
onSaveDraft: o,
|
|
2020
2029
|
onDiscardDraft: a,
|
|
2021
|
-
onSelectFiles:
|
|
2022
|
-
isSubmitting:
|
|
2030
|
+
onSelectFiles: l,
|
|
2031
|
+
isSubmitting: c = !1
|
|
2023
2032
|
}) {
|
|
2024
|
-
const
|
|
2025
|
-
const w = await
|
|
2026
|
-
|
|
2027
|
-
},
|
|
2028
|
-
|
|
2029
|
-
}, C =
|
|
2033
|
+
const d = q(), [f, m] = Ee(e ?? []), p = async () => {
|
|
2034
|
+
const w = await l();
|
|
2035
|
+
m((y) => [...y, ...w]);
|
|
2036
|
+
}, h = (w) => {
|
|
2037
|
+
m((y) => y.filter((V) => V.id !== w));
|
|
2038
|
+
}, C = f.map((w) => w.id), I = f.length > 0 && !c;
|
|
2030
2039
|
return /* @__PURE__ */ S(b, { direction: "column", gap: "medium", children: [
|
|
2031
|
-
|
|
2040
|
+
f.length > 0 && /* @__PURE__ */ r(b, { direction: "column", gap: "x-small", children: f.map((w) => /* @__PURE__ */ r(
|
|
2032
2041
|
K,
|
|
2033
2042
|
{
|
|
2034
2043
|
as: "div",
|
|
@@ -2043,7 +2052,7 @@ function qo({
|
|
|
2043
2052
|
{
|
|
2044
2053
|
size: "small",
|
|
2045
2054
|
renderIcon: () => /* @__PURE__ */ r(Wn, {}),
|
|
2046
|
-
onClick: () =>
|
|
2055
|
+
onClick: () => h(w.id),
|
|
2047
2056
|
children: /* @__PURE__ */ S("span", { className: "screenreader-only", children: [
|
|
2048
2057
|
"Remove ",
|
|
2049
2058
|
w.name
|
|
@@ -2054,7 +2063,7 @@ function qo({
|
|
|
2054
2063
|
},
|
|
2055
2064
|
w.id
|
|
2056
2065
|
)) }),
|
|
2057
|
-
/* @__PURE__ */ r($, { onClick:
|
|
2066
|
+
/* @__PURE__ */ r($, { onClick: p, children: d.submissionFormAddFiles() }),
|
|
2058
2067
|
/* @__PURE__ */ S(b, { gap: "small", children: [
|
|
2059
2068
|
/* @__PURE__ */ r(
|
|
2060
2069
|
$,
|
|
@@ -2062,18 +2071,18 @@ function qo({
|
|
|
2062
2071
|
color: "primary",
|
|
2063
2072
|
onClick: () => n(C),
|
|
2064
2073
|
interaction: I ? "enabled" : "disabled",
|
|
2065
|
-
children:
|
|
2074
|
+
children: d.submissionFormSubmit()
|
|
2066
2075
|
}
|
|
2067
2076
|
),
|
|
2068
2077
|
o && /* @__PURE__ */ r(
|
|
2069
2078
|
$,
|
|
2070
2079
|
{
|
|
2071
2080
|
onClick: () => o(C),
|
|
2072
|
-
interaction:
|
|
2073
|
-
children:
|
|
2081
|
+
interaction: f.length > 0 ? "enabled" : "disabled",
|
|
2082
|
+
children: d.submissionFormSaveDraft()
|
|
2074
2083
|
}
|
|
2075
2084
|
),
|
|
2076
|
-
a && e && e.length > 0 && /* @__PURE__ */ r($, { color: "primary-inverse", onClick: a, children:
|
|
2085
|
+
a && e && e.length > 0 && /* @__PURE__ */ r($, { color: "primary-inverse", onClick: a, children: d.submissionFormDiscardDraft() })
|
|
2077
2086
|
] })
|
|
2078
2087
|
] });
|
|
2079
2088
|
}
|
|
@@ -2082,20 +2091,20 @@ function Yo({
|
|
|
2082
2091
|
nextItem: n,
|
|
2083
2092
|
onNavigatePrev: o,
|
|
2084
2093
|
onNavigateNext: a,
|
|
2085
|
-
labels:
|
|
2094
|
+
labels: l
|
|
2086
2095
|
}) {
|
|
2087
|
-
const
|
|
2096
|
+
const c = q();
|
|
2088
2097
|
if (!e && !n)
|
|
2089
2098
|
return null;
|
|
2090
|
-
const
|
|
2099
|
+
const d = (l == null ? void 0 : l.previous) ?? c.navigationPrevious(), f = (l == null ? void 0 : l.next) ?? c.navigationNext();
|
|
2091
2100
|
return /* @__PURE__ */ S(b, { justifyItems: "space-between", padding: "small none", children: [
|
|
2092
2101
|
e ? /* @__PURE__ */ r(
|
|
2093
2102
|
$,
|
|
2094
2103
|
{
|
|
2095
2104
|
renderIcon: () => /* @__PURE__ */ r(fn, {}),
|
|
2096
2105
|
onClick: o,
|
|
2097
|
-
"aria-label": `${
|
|
2098
|
-
children:
|
|
2106
|
+
"aria-label": `${d}: ${e.title}`,
|
|
2107
|
+
children: d
|
|
2099
2108
|
}
|
|
2100
2109
|
) : /* @__PURE__ */ r("div", {}),
|
|
2101
2110
|
n ? /* @__PURE__ */ r(
|
|
@@ -2103,8 +2112,8 @@ function Yo({
|
|
|
2103
2112
|
{
|
|
2104
2113
|
renderIcon: () => /* @__PURE__ */ r(pn, {}),
|
|
2105
2114
|
onClick: a,
|
|
2106
|
-
"aria-label": `${
|
|
2107
|
-
children:
|
|
2115
|
+
"aria-label": `${f}: ${n.title}`,
|
|
2116
|
+
children: f
|
|
2108
2117
|
}
|
|
2109
2118
|
) : /* @__PURE__ */ r("div", {})
|
|
2110
2119
|
] });
|
|
@@ -2132,60 +2141,60 @@ function bo({
|
|
|
2132
2141
|
isLoadingItem: o,
|
|
2133
2142
|
onClick: a
|
|
2134
2143
|
}) {
|
|
2135
|
-
var
|
|
2136
|
-
const
|
|
2144
|
+
var m, p, h, C, I;
|
|
2145
|
+
const l = q(), c = ((m = e.content_details) == null ? void 0 : m.locked_for_user) ?? !1, d = (p = e.content_details) == null ? void 0 : p.lock_explanation, f = /* @__PURE__ */ r(
|
|
2137
2146
|
K,
|
|
2138
2147
|
{
|
|
2139
2148
|
as: "div",
|
|
2140
2149
|
padding: "small",
|
|
2141
2150
|
background: n ? "secondary" : "primary",
|
|
2142
2151
|
borderRadius: "small",
|
|
2143
|
-
cursor:
|
|
2144
|
-
onClick:
|
|
2145
|
-
role:
|
|
2146
|
-
tabIndex:
|
|
2147
|
-
onKeyDown:
|
|
2152
|
+
cursor: c ? "not-allowed" : "pointer",
|
|
2153
|
+
onClick: c ? void 0 : a,
|
|
2154
|
+
role: c ? void 0 : "button",
|
|
2155
|
+
tabIndex: c ? void 0 : 0,
|
|
2156
|
+
onKeyDown: c ? void 0 : (w) => {
|
|
2148
2157
|
(w.key === "Enter" || w.key === " ") && (w.preventDefault(), a());
|
|
2149
2158
|
},
|
|
2150
2159
|
children: /* @__PURE__ */ S(b, { gap: "small", alignItems: "center", children: [
|
|
2151
|
-
/* @__PURE__ */ r(b.Item, { children:
|
|
2160
|
+
/* @__PURE__ */ r(b.Item, { children: c ? /* @__PURE__ */ r(gn, {}) : ho(e.type) }),
|
|
2152
2161
|
/* @__PURE__ */ r(b.Item, { shouldGrow: !0, shouldShrink: !0, children: /* @__PURE__ */ S(b, { direction: "column", gap: "xx-small", children: [
|
|
2153
2162
|
/* @__PURE__ */ r(_, { weight: n ? "bold" : "normal", size: "small", children: e.title }),
|
|
2154
|
-
((
|
|
2163
|
+
((h = e.content_details) == null ? void 0 : h.due_at) && /* @__PURE__ */ r(_, { size: "x-small", color: "secondary", children: l.progressDueDate({
|
|
2155
2164
|
date: new Date(e.content_details.due_at).toLocaleDateString()
|
|
2156
2165
|
}) }),
|
|
2157
|
-
((C = e.content_details) == null ? void 0 : C.points_possible) != null && /* @__PURE__ */ r(_, { size: "x-small", color: "secondary", children:
|
|
2166
|
+
((C = e.content_details) == null ? void 0 : C.points_possible) != null && /* @__PURE__ */ r(_, { size: "x-small", color: "secondary", children: l.progressPoints({ points: e.content_details.points_possible }) })
|
|
2158
2167
|
] }) }),
|
|
2159
|
-
o && /* @__PURE__ */ r(Ye, { size: "x-small", renderTitle:
|
|
2168
|
+
o && /* @__PURE__ */ r(Ye, { size: "x-small", renderTitle: l.progressLoading() }),
|
|
2160
2169
|
((I = e.completion_requirement) == null ? void 0 : I.completed) && /* @__PURE__ */ r(_, { color: "success", size: "small", children: "✓" })
|
|
2161
2170
|
] })
|
|
2162
2171
|
}
|
|
2163
2172
|
);
|
|
2164
|
-
return
|
|
2173
|
+
return c && d ? /* @__PURE__ */ r(Jn, { renderTip: d, placement: "end", children: f }) : f;
|
|
2165
2174
|
}
|
|
2166
2175
|
function Vo({
|
|
2167
2176
|
module: e,
|
|
2168
2177
|
currentItemId: n,
|
|
2169
2178
|
onItemClick: o,
|
|
2170
2179
|
onClose: a,
|
|
2171
|
-
onNavigateModule:
|
|
2172
|
-
hasPrevModule:
|
|
2173
|
-
hasNextModule:
|
|
2174
|
-
isLoading:
|
|
2175
|
-
title:
|
|
2180
|
+
onNavigateModule: l,
|
|
2181
|
+
hasPrevModule: c = !1,
|
|
2182
|
+
hasNextModule: d = !1,
|
|
2183
|
+
isLoading: f = !1,
|
|
2184
|
+
title: m
|
|
2176
2185
|
}) {
|
|
2177
2186
|
var C;
|
|
2178
|
-
const
|
|
2187
|
+
const p = q(), h = m ?? p.navigationMyProgress();
|
|
2179
2188
|
return /* @__PURE__ */ S(b, { direction: "column", height: "100%", children: [
|
|
2180
2189
|
/* @__PURE__ */ S(b, { justifyItems: "space-between", alignItems: "center", padding: "small", children: [
|
|
2181
|
-
/* @__PURE__ */ r(St, { level: "h3", children:
|
|
2182
|
-
/* @__PURE__ */ r(Qn, { screenReaderLabel:
|
|
2190
|
+
/* @__PURE__ */ r(St, { level: "h3", children: h }),
|
|
2191
|
+
/* @__PURE__ */ r(Qn, { screenReaderLabel: p.navigationClosePanel(), onClick: a, size: "small", children: /* @__PURE__ */ r(qn, {}) })
|
|
2183
2192
|
] }),
|
|
2184
2193
|
/* @__PURE__ */ S(K, { as: "div", padding: "none small", overflowY: "auto", children: [
|
|
2185
2194
|
e.state === "locked" && /* @__PURE__ */ r(b, { padding: "none none small", children: /* @__PURE__ */ S(_t, { color: "warning", children: [
|
|
2186
2195
|
/* @__PURE__ */ r(gn, {}),
|
|
2187
2196
|
" ",
|
|
2188
|
-
|
|
2197
|
+
p.progressLocked()
|
|
2189
2198
|
] }) }),
|
|
2190
2199
|
/* @__PURE__ */ r(_, { weight: "bold", size: "medium", children: e.name }),
|
|
2191
2200
|
/* @__PURE__ */ r(b, { direction: "column", gap: "xx-small", padding: "small none", children: (C = e.items) == null ? void 0 : C.map((I) => /* @__PURE__ */ r(
|
|
@@ -2193,22 +2202,22 @@ function Vo({
|
|
|
2193
2202
|
{
|
|
2194
2203
|
item: I,
|
|
2195
2204
|
isSelected: I.id === n,
|
|
2196
|
-
isLoadingItem:
|
|
2205
|
+
isLoadingItem: f && I.id === n,
|
|
2197
2206
|
onClick: () => o(I)
|
|
2198
2207
|
},
|
|
2199
2208
|
I.id
|
|
2200
2209
|
)) })
|
|
2201
2210
|
] }),
|
|
2202
|
-
|
|
2211
|
+
l && /* @__PURE__ */ S(b, { justifyItems: "space-between", padding: "small", children: [
|
|
2203
2212
|
/* @__PURE__ */ r(
|
|
2204
2213
|
$,
|
|
2205
2214
|
{
|
|
2206
2215
|
renderIcon: () => /* @__PURE__ */ r(fn, {}),
|
|
2207
2216
|
size: "small",
|
|
2208
|
-
interaction:
|
|
2209
|
-
onClick: () =>
|
|
2210
|
-
"aria-label":
|
|
2211
|
-
children:
|
|
2217
|
+
interaction: c ? "enabled" : "disabled",
|
|
2218
|
+
onClick: () => l("prev"),
|
|
2219
|
+
"aria-label": p.navigationPreviousModule(),
|
|
2220
|
+
children: p.navigationPrevious()
|
|
2212
2221
|
}
|
|
2213
2222
|
),
|
|
2214
2223
|
/* @__PURE__ */ r(
|
|
@@ -2216,10 +2225,10 @@ function Vo({
|
|
|
2216
2225
|
{
|
|
2217
2226
|
renderIcon: () => /* @__PURE__ */ r(pn, {}),
|
|
2218
2227
|
size: "small",
|
|
2219
|
-
interaction:
|
|
2220
|
-
onClick: () =>
|
|
2221
|
-
"aria-label":
|
|
2222
|
-
children:
|
|
2228
|
+
interaction: d ? "enabled" : "disabled",
|
|
2229
|
+
onClick: () => l("next"),
|
|
2230
|
+
"aria-label": p.navigationNextModule(),
|
|
2231
|
+
children: p.navigationNext()
|
|
2223
2232
|
}
|
|
2224
2233
|
)
|
|
2225
2234
|
] })
|
|
@@ -2230,16 +2239,16 @@ function Xo({
|
|
|
2230
2239
|
onSubmit: n,
|
|
2231
2240
|
onSaveDraft: o,
|
|
2232
2241
|
onDiscardDraft: a,
|
|
2233
|
-
isSubmitting:
|
|
2242
|
+
isSubmitting: l = !1
|
|
2234
2243
|
}) {
|
|
2235
|
-
const
|
|
2244
|
+
const c = q(), [d, f] = Ee(e ?? ""), m = d.trim().length > 0 && !l;
|
|
2236
2245
|
return /* @__PURE__ */ S(b, { direction: "column", gap: "medium", children: [
|
|
2237
2246
|
/* @__PURE__ */ r(
|
|
2238
2247
|
bn,
|
|
2239
2248
|
{
|
|
2240
|
-
label:
|
|
2241
|
-
value:
|
|
2242
|
-
onChange: (
|
|
2249
|
+
label: c.submissionTextHeading(),
|
|
2250
|
+
value: d,
|
|
2251
|
+
onChange: (p) => f(p.target.value),
|
|
2243
2252
|
resize: "vertical",
|
|
2244
2253
|
height: "200px"
|
|
2245
2254
|
}
|
|
@@ -2249,20 +2258,20 @@ function Xo({
|
|
|
2249
2258
|
$,
|
|
2250
2259
|
{
|
|
2251
2260
|
color: "primary",
|
|
2252
|
-
onClick: () => n(
|
|
2253
|
-
interaction:
|
|
2254
|
-
children:
|
|
2261
|
+
onClick: () => n(d),
|
|
2262
|
+
interaction: m ? "enabled" : "disabled",
|
|
2263
|
+
children: c.submissionFormSubmit()
|
|
2255
2264
|
}
|
|
2256
2265
|
),
|
|
2257
2266
|
o && /* @__PURE__ */ r(
|
|
2258
2267
|
$,
|
|
2259
2268
|
{
|
|
2260
|
-
onClick: () => o(
|
|
2261
|
-
interaction:
|
|
2262
|
-
children:
|
|
2269
|
+
onClick: () => o(d),
|
|
2270
|
+
interaction: d.trim().length > 0 ? "enabled" : "disabled",
|
|
2271
|
+
children: c.submissionFormSaveDraft()
|
|
2263
2272
|
}
|
|
2264
2273
|
),
|
|
2265
|
-
a && e && /* @__PURE__ */ r($, { color: "primary-inverse", onClick: a, children:
|
|
2274
|
+
a && e && /* @__PURE__ */ r($, { color: "primary-inverse", onClick: a, children: c.submissionFormDiscardDraft() })
|
|
2266
2275
|
] })
|
|
2267
2276
|
] });
|
|
2268
2277
|
}
|