@instructure/platform-modules 1.0.0 → 1.1.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/hooks/useModulesPageData.d.ts.map +1 -1
- package/dist/index.js +970 -958
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { z as c } from "zod";
|
|
2
|
-
import { gql as
|
|
3
|
-
import { jsx as i, jsxs as
|
|
4
|
-
import { createContext as
|
|
5
|
-
import { PlugInstUIIcon as
|
|
6
|
-
import { useInfiniteQuery as
|
|
7
|
-
import
|
|
8
|
-
import { Button as
|
|
9
|
-
import { Flex as
|
|
2
|
+
import { gql as fe } from "graphql-tag";
|
|
3
|
+
import { jsx as i, jsxs as T } from "react/jsx-runtime";
|
|
4
|
+
import { createContext as yt, useContext as _t, useMemo as R, isValidElement as Tt, useCallback as k, useRef as U, useState as me, useEffect as Ae, useId as je, memo as Et, Fragment as Pt } from "react";
|
|
5
|
+
import { PlugInstUIIcon as fn, ExternalLinkInstUIIcon as gn, FileInstUIIcon as hn, FileTextInstUIIcon as In, MessagesSquareInstUIIcon as bn, RocketInstUIIcon as Sn, FilePenLineInstUIIcon as Mn, IconLockLine as Ct, IconWarningLine as we, IconCompleteLine as Le, IconClockLine as wt, IconArrowNestLine as yn, IconArrowOpenUpLine as _n, IconArrowOpenDownLine as Lt, IconSearchLine as Tn } from "@instructure/ui-icons";
|
|
6
|
+
import { useInfiniteQuery as Ve, useQueryClient as vt, InfiniteQueryObserver as En } from "@tanstack/react-query";
|
|
7
|
+
import Pn from "p-limit";
|
|
8
|
+
import { Button as de, IconButton as Cn } from "@instructure/ui-buttons/v11_7";
|
|
9
|
+
import { Flex as M } from "@instructure/ui-flex/v11_7";
|
|
10
10
|
import { Text as P } from "@instructure/ui-text/v11_7";
|
|
11
|
-
import { View as
|
|
12
|
-
import { TruncateWithTooltip as
|
|
13
|
-
import { Alert as
|
|
14
|
-
import { Heading as
|
|
15
|
-
import { ProgressBar as
|
|
16
|
-
import { Spinner as
|
|
17
|
-
import { useTheme as
|
|
18
|
-
import { ScreenReaderContent as
|
|
19
|
-
import { Link as
|
|
20
|
-
import { Pill as
|
|
21
|
-
import { WithBreakpoints as
|
|
22
|
-
import { Menu as
|
|
23
|
-
import { TextInput as
|
|
24
|
-
const
|
|
11
|
+
import { View as E } from "@instructure/ui-view/v11_7";
|
|
12
|
+
import { TruncateWithTooltip as wn, politeAnnounce as At, getLiveRegion as xt } from "@instructure/platform-instui-bindings";
|
|
13
|
+
import { Alert as Rt } from "@instructure/ui-alerts/v11_7";
|
|
14
|
+
import { Heading as Dt } from "@instructure/ui-heading/v11_7";
|
|
15
|
+
import { ProgressBar as Ln } from "@instructure/ui-progress/v11_7";
|
|
16
|
+
import { Spinner as Nt } from "@instructure/ui-spinner/v11_7";
|
|
17
|
+
import { useTheme as qt } from "@instructure/emotion";
|
|
18
|
+
import { ScreenReaderContent as nt } from "@instructure/ui-a11y-content";
|
|
19
|
+
import { Link as vn } from "@instructure/ui-link/v11_7";
|
|
20
|
+
import { Pill as An } from "@instructure/ui-pill/v11_7";
|
|
21
|
+
import { WithBreakpoints as xn } from "@instructure/platform-with-breakpoints";
|
|
22
|
+
import { Menu as $e } from "@instructure/ui-menu/v11_7";
|
|
23
|
+
import { TextInput as Rn } from "@instructure/ui-text-input/v11_7";
|
|
24
|
+
const Dn = c.object({
|
|
25
25
|
target: c.enum(["module", "item"]),
|
|
26
26
|
field: c.string(),
|
|
27
27
|
op: c.enum(["eq", "contains"]),
|
|
28
28
|
value: c.union([c.string(), c.boolean()])
|
|
29
29
|
}).strict();
|
|
30
|
-
function
|
|
30
|
+
function Nn(e, t) {
|
|
31
31
|
const n = e == null ? void 0 : e[t.target];
|
|
32
32
|
return !n || !Object.prototype.hasOwnProperty.call(n, t.field) ? !1 : n[t.field].includes(t.op);
|
|
33
33
|
}
|
|
34
|
-
const
|
|
34
|
+
const qn = c.enum([
|
|
35
35
|
"assignment",
|
|
36
36
|
"quiz",
|
|
37
37
|
"discussion",
|
|
@@ -40,7 +40,7 @@ const Dn = c.enum([
|
|
|
40
40
|
"external_url",
|
|
41
41
|
"external_tool",
|
|
42
42
|
"sub_header"
|
|
43
|
-
]),
|
|
43
|
+
]), kn = c.enum([
|
|
44
44
|
"not_started",
|
|
45
45
|
"in_progress",
|
|
46
46
|
"complete",
|
|
@@ -49,7 +49,7 @@ const Dn = c.enum([
|
|
|
49
49
|
"excused",
|
|
50
50
|
"missing",
|
|
51
51
|
"locked"
|
|
52
|
-
]),
|
|
52
|
+
]), On = c.enum([
|
|
53
53
|
"not_started",
|
|
54
54
|
"in_progress",
|
|
55
55
|
"complete",
|
|
@@ -57,7 +57,7 @@ const Dn = c.enum([
|
|
|
57
57
|
"incomplete",
|
|
58
58
|
"missing_and_incomplete",
|
|
59
59
|
"locked"
|
|
60
|
-
]),
|
|
60
|
+
]), Fn = c.enum([
|
|
61
61
|
"must_view",
|
|
62
62
|
"must_mark_done",
|
|
63
63
|
"must_contribute",
|
|
@@ -65,96 +65,96 @@ const Dn = c.enum([
|
|
|
65
65
|
"min_score",
|
|
66
66
|
"min_percentage",
|
|
67
67
|
"unknown"
|
|
68
|
-
]),
|
|
69
|
-
status:
|
|
68
|
+
]), Un = c.object({
|
|
69
|
+
status: On.optional(),
|
|
70
70
|
requirementsMet: c.number(),
|
|
71
71
|
requirementCount: c.number(),
|
|
72
72
|
percentComplete: c.number().min(0).max(100),
|
|
73
73
|
latestDueAt: c.string().nullish(),
|
|
74
74
|
missingCount: c.number(),
|
|
75
75
|
incompleteCount: c.number()
|
|
76
|
-
}),
|
|
76
|
+
}), kt = c.object({
|
|
77
77
|
itemId: c.string(),
|
|
78
|
-
type:
|
|
78
|
+
type: Fn,
|
|
79
79
|
minScore: c.number().nullish(),
|
|
80
80
|
minPercentage: c.number().nullish()
|
|
81
|
-
}),
|
|
81
|
+
}), Ot = c.object({
|
|
82
82
|
id: c.string(),
|
|
83
83
|
moduleId: c.string(),
|
|
84
84
|
title: c.string(),
|
|
85
|
-
type:
|
|
85
|
+
type: qn,
|
|
86
86
|
position: c.number(),
|
|
87
87
|
indent: c.number(),
|
|
88
88
|
published: c.boolean(),
|
|
89
89
|
url: c.string().nullish(),
|
|
90
90
|
newTab: c.boolean().nullish(),
|
|
91
|
-
completionRequirement:
|
|
91
|
+
completionRequirement: kt.nullish(),
|
|
92
92
|
dueAt: c.string().nullish(),
|
|
93
|
-
status:
|
|
93
|
+
status: kn.optional(),
|
|
94
94
|
pointsPossible: c.number().nullish(),
|
|
95
95
|
extensions: c.record(c.unknown()).optional()
|
|
96
|
-
}),
|
|
96
|
+
}), zn = c.object({
|
|
97
97
|
id: c.string(),
|
|
98
98
|
name: c.string()
|
|
99
|
-
}),
|
|
99
|
+
}), $n = c.object({
|
|
100
100
|
id: c.string(),
|
|
101
101
|
name: c.string(),
|
|
102
102
|
position: c.number(),
|
|
103
103
|
published: c.boolean(),
|
|
104
104
|
itemCount: c.number(),
|
|
105
|
-
items: c.array(
|
|
105
|
+
items: c.array(Ot).optional(),
|
|
106
106
|
unlockAt: c.string().nullish(),
|
|
107
|
-
prerequisiteModules: c.array(
|
|
107
|
+
prerequisiteModules: c.array(zn),
|
|
108
108
|
requirementCount: c.number().nullish(),
|
|
109
109
|
requireSequentialProgress: c.boolean(),
|
|
110
|
-
completionRequirements: c.array(
|
|
111
|
-
progress:
|
|
110
|
+
completionRequirements: c.array(kt).optional(),
|
|
111
|
+
progress: Un.optional(),
|
|
112
112
|
extensions: c.record(c.unknown()).optional()
|
|
113
|
-
}),
|
|
113
|
+
}), Ft = c.object({
|
|
114
114
|
hasNextPage: c.boolean(),
|
|
115
115
|
endCursor: c.string().nullable()
|
|
116
116
|
}).refine((e) => !e.hasNextPage || e.endCursor !== null, {
|
|
117
117
|
message: 'hasNextPage is true but endCursor is null: there is another page and no cursor to ask for it with, which renders a "Load more" that can never load.',
|
|
118
118
|
path: ["endCursor"]
|
|
119
|
-
}),
|
|
120
|
-
modules: c.array(
|
|
121
|
-
pageInfo:
|
|
122
|
-
}),
|
|
123
|
-
items: c.array(
|
|
124
|
-
pageInfo:
|
|
125
|
-
}),
|
|
126
|
-
function
|
|
119
|
+
}), Bn = c.object({
|
|
120
|
+
modules: c.array($n),
|
|
121
|
+
pageInfo: Ft
|
|
122
|
+
}), jn = c.object({
|
|
123
|
+
items: c.array(Ot),
|
|
124
|
+
pageInfo: Ft
|
|
125
|
+
}), Ut = "career.estimatedDurationMinutes";
|
|
126
|
+
function Gn(e) {
|
|
127
127
|
var n;
|
|
128
|
-
const t = (n = e.extensions) == null ? void 0 : n[
|
|
128
|
+
const t = (n = e.extensions) == null ? void 0 : n[Ut];
|
|
129
129
|
return typeof t != "number" || !Number.isFinite(t) || t <= 0 ? null : t;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
return t == null ? e : { ...e, [
|
|
131
|
+
function Ke(e, t) {
|
|
132
|
+
return t == null ? e : { ...e, [Ut]: t };
|
|
133
133
|
}
|
|
134
|
-
const
|
|
135
|
-
class
|
|
134
|
+
const Ge = 100, Ze = 2e3;
|
|
135
|
+
class Yn extends Error {
|
|
136
136
|
constructor(t, n) {
|
|
137
137
|
super(
|
|
138
138
|
`This in-memory adapter was built for course ${t} but was asked for course ${n}. A fixture serves exactly one course.`
|
|
139
139
|
), this.name = "InMemoryCourseMismatchError", this.expected = t, this.received = n;
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
const
|
|
142
|
+
const Wn = (e) => `offset:${e}`, Qn = (e) => {
|
|
143
143
|
if (!e) return 0;
|
|
144
144
|
const t = Number.parseInt(e.replace("offset:", ""), 10);
|
|
145
145
|
return Number.isFinite(t) && t >= 0 ? t : 0;
|
|
146
|
-
},
|
|
146
|
+
}, ot = (e) => {
|
|
147
147
|
if (e != null && e.aborted)
|
|
148
148
|
throw new DOMException("The operation was aborted.", "AbortError");
|
|
149
149
|
};
|
|
150
|
-
function
|
|
151
|
-
const o =
|
|
150
|
+
function rt(e, t, n) {
|
|
151
|
+
const o = Qn(t), r = e.slice(o, o + n), s = o + r.length, l = s < e.length;
|
|
152
152
|
return {
|
|
153
153
|
slice: r,
|
|
154
|
-
pageInfo: { hasNextPage: l, endCursor: l ?
|
|
154
|
+
pageInfo: { hasNextPage: l, endCursor: l ? Wn(s) : null }
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
|
-
const
|
|
157
|
+
const Hn = /* @__PURE__ */ new Map([
|
|
158
158
|
["COMPLETED", (e) => {
|
|
159
159
|
var t;
|
|
160
160
|
return ((t = e.progress) == null ? void 0 : t.status) === "complete";
|
|
@@ -174,23 +174,23 @@ const Wn = /* @__PURE__ */ new Map([
|
|
|
174
174
|
return ((t = e.progress) == null ? void 0 : t.status) !== "complete" && ((n = e.progress) == null ? void 0 : n.status) !== "in_progress";
|
|
175
175
|
}
|
|
176
176
|
]
|
|
177
|
-
]),
|
|
178
|
-
function
|
|
177
|
+
]), Vn = { module: { completionStatus: ["eq"] } };
|
|
178
|
+
function Kn(e) {
|
|
179
179
|
if (e.target !== "module" || e.field !== "completionStatus" || e.op !== "eq")
|
|
180
180
|
throw new Error(
|
|
181
181
|
`in-memory adapter cannot compile ${e.target}.${e.field} ${e.op}`
|
|
182
182
|
);
|
|
183
|
-
const t = typeof e.value == "string" ?
|
|
183
|
+
const t = typeof e.value == "string" ? Hn.get(e.value) : void 0;
|
|
184
184
|
if (!t) throw new Error(`unknown completionStatus "${String(e.value)}"`);
|
|
185
185
|
return t;
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function Tl(e, t = {}) {
|
|
188
188
|
const n = (r) => e.itemsByModuleId[r] ?? [], o = (r) => {
|
|
189
189
|
if (r !== e.courseId)
|
|
190
|
-
throw new
|
|
190
|
+
throw new Yn(e.courseId, r);
|
|
191
191
|
};
|
|
192
192
|
return {
|
|
193
|
-
capabilities:
|
|
193
|
+
capabilities: Vn,
|
|
194
194
|
async listModules({
|
|
195
195
|
courseId: r,
|
|
196
196
|
cursor: s,
|
|
@@ -200,13 +200,13 @@ function yl(e, t = {}) {
|
|
|
200
200
|
inlineItemsFirst: m,
|
|
201
201
|
signal: u
|
|
202
202
|
}) {
|
|
203
|
-
var
|
|
204
|
-
|
|
205
|
-
const p = d ? e.modules.filter(
|
|
206
|
-
return { modules:
|
|
207
|
-
const
|
|
208
|
-
return { ...
|
|
209
|
-
}), pageInfo:
|
|
203
|
+
var w;
|
|
204
|
+
ot(u), o(r), (w = t.onRequest) == null || w.call(t, "listModules", { operation: "listModules", courseId: r });
|
|
205
|
+
const p = d ? e.modules.filter(Kn(d)) : e.modules, { slice: f, pageInfo: g } = rt(p, s, l), h = Math.min(m ?? Ge, Ge);
|
|
206
|
+
return { modules: f.map((_) => {
|
|
207
|
+
const y = n(_.id), D = a && y.length <= h;
|
|
208
|
+
return { ..._, itemCount: y.length, items: D ? y : void 0 };
|
|
209
|
+
}), pageInfo: g };
|
|
210
210
|
},
|
|
211
211
|
async listModuleItems({
|
|
212
212
|
courseId: r,
|
|
@@ -216,13 +216,13 @@ function yl(e, t = {}) {
|
|
|
216
216
|
signal: d
|
|
217
217
|
}) {
|
|
218
218
|
var p;
|
|
219
|
-
|
|
220
|
-
const { slice: m, pageInfo: u } =
|
|
219
|
+
ot(d), o(r), (p = t.onRequest) == null || p.call(t, "listModuleItems", { operation: "listModuleItems", courseId: r, moduleId: s });
|
|
220
|
+
const { slice: m, pageInfo: u } = rt(n(s), l, a);
|
|
221
221
|
return { items: m, pageInfo: u };
|
|
222
222
|
}
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
-
class
|
|
225
|
+
class zt extends Error {
|
|
226
226
|
constructor(t, n, o) {
|
|
227
227
|
const r = t === "module" ? "module" : "module item";
|
|
228
228
|
super(
|
|
@@ -230,11 +230,11 @@ class Ot extends Error {
|
|
|
230
230
|
), this.name = "PartialCanvasResponseError", this.subject = t, this.id = n, this.field = o;
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function $t(e, t, n) {
|
|
234
234
|
if (e != null) return e;
|
|
235
|
-
throw new
|
|
235
|
+
throw new zt(t, n, "published");
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function Zn(e, t) {
|
|
238
238
|
if (e.onUnsupportedItem) {
|
|
239
239
|
e.onUnsupportedItem(t);
|
|
240
240
|
return;
|
|
@@ -243,7 +243,7 @@ function Vn(e, t) {
|
|
|
243
243
|
`[platform-modules] dropped module item ${t.id}: content type "${t.typename ?? "null"}" is outside the closed ModuleItemType enum. Pass \`onUnsupportedItem\` to handle these yourself.`
|
|
244
244
|
);
|
|
245
245
|
}
|
|
246
|
-
const
|
|
246
|
+
const Xn = {
|
|
247
247
|
Assignment: "assignment",
|
|
248
248
|
Quiz: "quiz",
|
|
249
249
|
Discussion: "discussion",
|
|
@@ -255,21 +255,21 @@ const Kn = {
|
|
|
255
255
|
SubHeader: "sub_header",
|
|
256
256
|
PeerReviewSubAssignment: "assignment"
|
|
257
257
|
};
|
|
258
|
-
function
|
|
258
|
+
function Jn(e) {
|
|
259
259
|
const t = e == null ? void 0 : e.__typename;
|
|
260
260
|
if (!t) return null;
|
|
261
|
-
const n =
|
|
261
|
+
const n = Xn[t];
|
|
262
262
|
return n ? n === "assignment" && (e == null ? void 0 : e.isNewQuiz) === !0 ? "quiz" : n : null;
|
|
263
263
|
}
|
|
264
|
-
const
|
|
265
|
-
function
|
|
264
|
+
const eo = /^P(?!$)(?:(\d+(?:\.\d+)?)W)?(?:(\d+(?:\.\d+)?)D)?(?:T(?!$)(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?)?$/;
|
|
265
|
+
function to(e) {
|
|
266
266
|
if (!e) return null;
|
|
267
|
-
const t =
|
|
267
|
+
const t = eo.exec(e);
|
|
268
268
|
if (!t) return null;
|
|
269
269
|
const [, n, o, r, s, l] = t, a = Number(n ?? 0) * 7 * 24 * 60 + Number(o ?? 0) * 24 * 60 + Number(r ?? 0) * 60 + Number(s ?? 0) + Number(l ?? 0) / 60;
|
|
270
270
|
return Math.round(a);
|
|
271
271
|
}
|
|
272
|
-
const
|
|
272
|
+
const no = /* @__PURE__ */ new Set([
|
|
273
273
|
"must_view",
|
|
274
274
|
"must_mark_done",
|
|
275
275
|
"must_contribute",
|
|
@@ -277,31 +277,31 @@ const eo = /* @__PURE__ */ new Set([
|
|
|
277
277
|
"min_score",
|
|
278
278
|
"min_percentage"
|
|
279
279
|
]);
|
|
280
|
-
function
|
|
281
|
-
return
|
|
280
|
+
function oo(e) {
|
|
281
|
+
return no.has(e) ? e : "unknown";
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function ro(e) {
|
|
284
284
|
return {
|
|
285
285
|
itemId: String(e.id),
|
|
286
|
-
type:
|
|
286
|
+
type: oo(e.type),
|
|
287
287
|
minScore: e.minScore ?? null,
|
|
288
288
|
minPercentage: e.minPercentage ?? null
|
|
289
289
|
};
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function Bt(e) {
|
|
292
292
|
return {
|
|
293
293
|
hasNextPage: (e == null ? void 0 : e.hasNextPage) ?? !1,
|
|
294
294
|
endCursor: (e == null ? void 0 : e.endCursor) ?? null
|
|
295
295
|
};
|
|
296
296
|
}
|
|
297
|
-
const
|
|
298
|
-
function
|
|
297
|
+
const so = /* @__PURE__ */ new Set(["graded"]), io = /* @__PURE__ */ new Set(["submitted", "pending_review"]), lo = /* @__PURE__ */ new Set(["graded"]);
|
|
298
|
+
function jt(e) {
|
|
299
299
|
var t;
|
|
300
300
|
for (const n of ((t = e == null ? void 0 : e.submissionsConnection) == null ? void 0 : t.nodes) ?? [])
|
|
301
301
|
if (n) return n;
|
|
302
302
|
return null;
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function Gt(e, t) {
|
|
305
305
|
if (!e) return;
|
|
306
306
|
const n = new Map(t.map((s) => [s.itemId, s.type])), o = /* @__PURE__ */ new Set();
|
|
307
307
|
for (const s of e.requirementsMet ?? []) {
|
|
@@ -324,21 +324,21 @@ function $t(e, t) {
|
|
|
324
324
|
incompleteRequirementItemIds: r
|
|
325
325
|
};
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function ao(e, t, n, o = !0) {
|
|
328
328
|
if (n.locked) return "locked";
|
|
329
|
-
const r =
|
|
329
|
+
const r = jt(e);
|
|
330
330
|
if (r) {
|
|
331
331
|
if (r.gradingStatus === "excused") return "excused";
|
|
332
332
|
if (r.missing === !0) return "missing";
|
|
333
|
-
if (
|
|
333
|
+
if (so.has(r.state ?? "") || lo.has(r.gradingStatus ?? ""))
|
|
334
334
|
return "graded";
|
|
335
|
-
if (r.submittedAt != null ||
|
|
335
|
+
if (r.submittedAt != null || io.has(r.state ?? ""))
|
|
336
336
|
return "submitted";
|
|
337
337
|
if ((r.attempt ?? 0) > 0) return "in_progress";
|
|
338
338
|
}
|
|
339
339
|
return n.requirementsMetItemIds.has(t) ? o ? "complete" : "in_progress" : "not_started";
|
|
340
340
|
}
|
|
341
|
-
const
|
|
341
|
+
const uo = {
|
|
342
342
|
LOCKED: "locked",
|
|
343
343
|
MISSING: "missing",
|
|
344
344
|
MISSING_AND_INCOMPLETE: "missing_and_incomplete",
|
|
@@ -347,16 +347,16 @@ const lo = {
|
|
|
347
347
|
IN_PROGRESS: "in_progress",
|
|
348
348
|
NOT_STARTED: "not_started"
|
|
349
349
|
};
|
|
350
|
-
function
|
|
350
|
+
function co(e) {
|
|
351
351
|
if (e != null)
|
|
352
|
-
return
|
|
352
|
+
return uo[e];
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function mo(e, t, n) {
|
|
355
355
|
var a, d;
|
|
356
356
|
if (!n) return;
|
|
357
357
|
const o = e.requirementCount ?? t.length, r = Math.min(n.requirementsMetItemIds.size, o), s = ((a = e.submissionStatistics) == null ? void 0 : a.missingAssignmentCount) ?? 0, l = n.incompleteRequirementItemIds.size;
|
|
358
358
|
return {
|
|
359
|
-
status:
|
|
359
|
+
status: co(e.moduleStatus) ?? (n.locked ? "locked" : void 0),
|
|
360
360
|
requirementsMet: r,
|
|
361
361
|
requirementCount: o,
|
|
362
362
|
percentComplete: o > 0 ? Math.round(r / o * 100) : 0,
|
|
@@ -365,12 +365,12 @@ function uo(e, t, n) {
|
|
|
365
365
|
incompleteCount: l
|
|
366
366
|
};
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function po(e, t, n, o = {}, r) {
|
|
369
369
|
var d, m, u;
|
|
370
|
-
const s = String(e._id), l =
|
|
370
|
+
const s = String(e._id), l = Jn(e.content);
|
|
371
371
|
if (!l)
|
|
372
|
-
return
|
|
373
|
-
const a =
|
|
372
|
+
return Zn(o, { id: s, typename: ((d = e.content) == null ? void 0 : d.__typename) ?? null }), null;
|
|
373
|
+
const a = jt(e.content);
|
|
374
374
|
return {
|
|
375
375
|
id: s,
|
|
376
376
|
moduleId: t,
|
|
@@ -378,24 +378,24 @@ function co(e, t, n, o = {}, r) {
|
|
|
378
378
|
type: l,
|
|
379
379
|
position: e.position ?? 0,
|
|
380
380
|
indent: e.indent ?? 0,
|
|
381
|
-
published:
|
|
381
|
+
published: $t(e.published, "moduleItem", s),
|
|
382
382
|
url: e.url ?? null,
|
|
383
383
|
newTab: e.newTab ?? !1,
|
|
384
384
|
completionRequirement: n.get(s) ?? null,
|
|
385
385
|
dueAt: (a == null ? void 0 : a.cachedDueDate) ?? ((m = e.content) == null ? void 0 : m.dueAt) ?? null,
|
|
386
|
-
status: r ?
|
|
386
|
+
status: r ? ao(e.content, s, r, o.submissionsIncluded ?? !0) : void 0,
|
|
387
387
|
pointsPossible: ((u = e.content) == null ? void 0 : u.pointsPossible) ?? null,
|
|
388
|
-
extensions:
|
|
388
|
+
extensions: Ke(
|
|
389
389
|
void 0,
|
|
390
|
-
|
|
390
|
+
to(e.estimatedDuration)
|
|
391
391
|
)
|
|
392
392
|
};
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function Yt(e, t, n, o, r) {
|
|
395
395
|
const s = [];
|
|
396
396
|
for (const l of e ?? []) {
|
|
397
397
|
if (!l) continue;
|
|
398
|
-
const a =
|
|
398
|
+
const a = po(
|
|
399
399
|
l,
|
|
400
400
|
t,
|
|
401
401
|
n,
|
|
@@ -406,26 +406,26 @@ function Bt(e, t, n, o, r) {
|
|
|
406
406
|
}
|
|
407
407
|
return s;
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function Wt(e) {
|
|
410
410
|
const t = [], n = /* @__PURE__ */ new Map();
|
|
411
411
|
for (const o of e ?? []) {
|
|
412
412
|
if (!o) continue;
|
|
413
|
-
const r =
|
|
413
|
+
const r = ro(o);
|
|
414
414
|
t.push(r), n.set(r.itemId, r);
|
|
415
415
|
}
|
|
416
416
|
return { list: t, byItemId: n };
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function fo(e, t = {}) {
|
|
419
419
|
var m;
|
|
420
420
|
const n = String(e._id);
|
|
421
421
|
if (e.moduleItemsTotalCount == null)
|
|
422
|
-
throw new
|
|
423
|
-
const { list: o, byItemId: r } =
|
|
422
|
+
throw new zt("module", n, "moduleItemsTotalCount");
|
|
423
|
+
const { list: o, byItemId: r } = Wt(e.completionRequirements), s = e.moduleItemsConnection, l = s != null && !((m = s.pageInfo) != null && m.hasNextPage), a = Gt(e.progression, o), d = l ? Yt(s.nodes, n, r, t, a) : void 0;
|
|
424
424
|
return {
|
|
425
425
|
id: n,
|
|
426
426
|
name: e.name ?? "",
|
|
427
427
|
position: e.position ?? 0,
|
|
428
|
-
published:
|
|
428
|
+
published: $t(e.published, "module", n),
|
|
429
429
|
itemCount: e.moduleItemsTotalCount,
|
|
430
430
|
items: d,
|
|
431
431
|
unlockAt: e.unlockAt ?? null,
|
|
@@ -435,24 +435,24 @@ function mo(e, t = {}) {
|
|
|
435
435
|
requirementCount: e.requirementCount ?? null,
|
|
436
436
|
requireSequentialProgress: e.requireSequentialProgress ?? !1,
|
|
437
437
|
completionRequirements: o,
|
|
438
|
-
progress:
|
|
438
|
+
progress: mo(e, o, a)
|
|
439
439
|
};
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function go(e, t = {}) {
|
|
442
442
|
var r;
|
|
443
443
|
const n = (r = e == null ? void 0 : e.legacyNode) == null ? void 0 : r.modulesConnection, o = [];
|
|
444
444
|
for (const s of (n == null ? void 0 : n.nodes) ?? [])
|
|
445
|
-
s && o.push(
|
|
446
|
-
return { modules: o, pageInfo:
|
|
445
|
+
s && o.push(fo(s, t));
|
|
446
|
+
return { modules: o, pageInfo: Bt(n == null ? void 0 : n.pageInfo) };
|
|
447
447
|
}
|
|
448
|
-
function
|
|
449
|
-
const o = e == null ? void 0 : e.legacyNode, { list: r, byItemId: s } =
|
|
448
|
+
function ho(e, t, n = {}) {
|
|
449
|
+
const o = e == null ? void 0 : e.legacyNode, { list: r, byItemId: s } = Wt(o == null ? void 0 : o.completionRequirements), l = o == null ? void 0 : o.moduleItemsConnection, a = Gt(o == null ? void 0 : o.progression, r);
|
|
450
450
|
return {
|
|
451
|
-
items:
|
|
452
|
-
pageInfo:
|
|
451
|
+
items: Yt(l == null ? void 0 : l.nodes, t, s, n, a),
|
|
452
|
+
pageInfo: Bt(l == null ? void 0 : l.pageInfo)
|
|
453
453
|
};
|
|
454
454
|
}
|
|
455
|
-
const
|
|
455
|
+
const Io = fe`
|
|
456
456
|
fragment PlatformModulesSubmissionFields on Submission {
|
|
457
457
|
_id
|
|
458
458
|
state
|
|
@@ -462,7 +462,7 @@ const fo = de`
|
|
|
462
462
|
missing
|
|
463
463
|
cachedDueDate
|
|
464
464
|
}
|
|
465
|
-
`,
|
|
465
|
+
`, Qt = fe`
|
|
466
466
|
fragment PlatformModulesItemFields on ModuleItem {
|
|
467
467
|
_id
|
|
468
468
|
title
|
|
@@ -509,8 +509,8 @@ const fo = de`
|
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
${
|
|
513
|
-
`,
|
|
512
|
+
${Io}
|
|
513
|
+
`, Ht = fe`
|
|
514
514
|
fragment PlatformModulesProgressionFields on ModuleProgression {
|
|
515
515
|
workflowState
|
|
516
516
|
completed
|
|
@@ -530,7 +530,7 @@ const fo = de`
|
|
|
530
530
|
score
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
|
-
`,
|
|
533
|
+
`, bo = fe`
|
|
534
534
|
query PlatformModulesGetModules(
|
|
535
535
|
$courseId: ID!
|
|
536
536
|
$first: Int!
|
|
@@ -589,9 +589,9 @@ const fo = de`
|
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
|
-
${
|
|
593
|
-
${
|
|
594
|
-
`,
|
|
592
|
+
${Qt}
|
|
593
|
+
${Ht}
|
|
594
|
+
`, So = fe`
|
|
595
595
|
query PlatformModulesGetModuleItems(
|
|
596
596
|
$moduleId: ID!
|
|
597
597
|
$first: Int!
|
|
@@ -622,50 +622,50 @@ const fo = de`
|
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
624
|
}
|
|
625
|
-
${
|
|
626
|
-
${
|
|
625
|
+
${Qt}
|
|
626
|
+
${Ht}
|
|
627
627
|
`;
|
|
628
|
-
function
|
|
628
|
+
function Vt() {
|
|
629
629
|
return new DOMException("The operation was aborted.", "AbortError");
|
|
630
630
|
}
|
|
631
|
-
function
|
|
632
|
-
if (e != null && e.aborted) throw
|
|
631
|
+
function Pe(e) {
|
|
632
|
+
if (e != null && e.aborted) throw Vt();
|
|
633
633
|
}
|
|
634
|
-
function
|
|
634
|
+
function st(e, t) {
|
|
635
635
|
return t ? new Promise((n, o) => {
|
|
636
|
-
const r = () => o(
|
|
636
|
+
const r = () => o(Vt());
|
|
637
637
|
t.addEventListener("abort", r, { once: !0 }), e.then(n, o).finally(() => t.removeEventListener("abort", r));
|
|
638
638
|
}) : e;
|
|
639
639
|
}
|
|
640
|
-
const
|
|
640
|
+
const it = [
|
|
641
641
|
"COMPLETED",
|
|
642
642
|
"INCOMPLETE",
|
|
643
643
|
"IN_PROGRESS",
|
|
644
644
|
"NOT_STARTED"
|
|
645
|
-
],
|
|
645
|
+
], Mo = {
|
|
646
646
|
module: { completionStatus: ["eq"] }
|
|
647
647
|
};
|
|
648
|
-
function
|
|
648
|
+
function yo(e) {
|
|
649
649
|
if (!e) return null;
|
|
650
650
|
if (e.target !== "module" || e.field !== "completionStatus" || e.op !== "eq")
|
|
651
651
|
throw new Error(
|
|
652
652
|
`Canvas GraphQL cannot serve ${e.target}.${e.field} "${e.op}". Only module.completionStatus eq is compiled here.`
|
|
653
653
|
);
|
|
654
654
|
const t = e.value;
|
|
655
|
-
if (!
|
|
655
|
+
if (!it.includes(t))
|
|
656
656
|
throw new Error(
|
|
657
|
-
`"${e.value}" is not a ModuleCompletionStatus (${
|
|
657
|
+
`"${e.value}" is not a ModuleCompletionStatus (${it.join(", ")}).`
|
|
658
658
|
);
|
|
659
659
|
return { completionStatus: t };
|
|
660
660
|
}
|
|
661
|
-
function
|
|
661
|
+
function El({
|
|
662
662
|
executeQuery: e,
|
|
663
|
-
inlineItemLimit: t =
|
|
664
|
-
nodeBudget: n =
|
|
663
|
+
inlineItemLimit: t = Ge,
|
|
664
|
+
nodeBudget: n = Ze,
|
|
665
665
|
onUnsupportedItem: o,
|
|
666
666
|
studentId: r,
|
|
667
667
|
validate: s = !0,
|
|
668
|
-
capabilities: l =
|
|
668
|
+
capabilities: l = Mo
|
|
669
669
|
}) {
|
|
670
670
|
const a = r != null, d = { onUnsupportedItem: o, submissionsIncluded: a };
|
|
671
671
|
return {
|
|
@@ -675,186 +675,186 @@ function _l({
|
|
|
675
675
|
courseId: m,
|
|
676
676
|
cursor: u,
|
|
677
677
|
pageSize: p,
|
|
678
|
-
includeItems:
|
|
679
|
-
filter:
|
|
678
|
+
includeItems: f,
|
|
679
|
+
filter: g,
|
|
680
680
|
inlineItemsFirst: h,
|
|
681
681
|
inlineFirst: I,
|
|
682
|
-
signal:
|
|
682
|
+
signal: w
|
|
683
683
|
}) {
|
|
684
|
-
|
|
685
|
-
const
|
|
686
|
-
e(
|
|
684
|
+
Pe(w);
|
|
685
|
+
const _ = f ? Math.min(I ?? p, p) : p, y = Math.min(h ?? t, t), D = Math.max(1, Math.min(y, Math.floor(n / _))), q = await st(
|
|
686
|
+
e(bo, {
|
|
687
687
|
courseId: m,
|
|
688
|
-
first:
|
|
688
|
+
first: _,
|
|
689
689
|
after: u ?? null,
|
|
690
|
-
includeItems:
|
|
690
|
+
includeItems: f,
|
|
691
691
|
itemsFirst: D,
|
|
692
692
|
includeSubmissions: a,
|
|
693
693
|
studentId: r ?? null,
|
|
694
|
-
filter:
|
|
694
|
+
filter: yo(g)
|
|
695
695
|
}),
|
|
696
|
-
|
|
696
|
+
w
|
|
697
697
|
);
|
|
698
|
-
|
|
699
|
-
const N =
|
|
700
|
-
return s ?
|
|
698
|
+
Pe(w);
|
|
699
|
+
const N = go(q, d);
|
|
700
|
+
return s ? Bn.parse(N) : N;
|
|
701
701
|
},
|
|
702
702
|
async listModuleItems({
|
|
703
703
|
moduleId: m,
|
|
704
704
|
cursor: u,
|
|
705
705
|
pageSize: p,
|
|
706
|
-
signal:
|
|
706
|
+
signal: f
|
|
707
707
|
}) {
|
|
708
|
-
|
|
709
|
-
const
|
|
710
|
-
e(
|
|
708
|
+
Pe(f);
|
|
709
|
+
const g = await st(
|
|
710
|
+
e(So, {
|
|
711
711
|
moduleId: m,
|
|
712
712
|
first: p,
|
|
713
713
|
after: u ?? null,
|
|
714
714
|
includeSubmissions: a,
|
|
715
715
|
studentId: r ?? null
|
|
716
716
|
}),
|
|
717
|
-
|
|
717
|
+
f
|
|
718
718
|
);
|
|
719
|
-
|
|
720
|
-
const h =
|
|
721
|
-
return s ?
|
|
719
|
+
Pe(f);
|
|
720
|
+
const h = ho(g, m, d);
|
|
721
|
+
return s ? jn.parse(h) : h;
|
|
722
722
|
}
|
|
723
723
|
};
|
|
724
724
|
}
|
|
725
|
-
const
|
|
726
|
-
pageTitle:
|
|
727
|
-
modulesLoadedAnnouncement:
|
|
728
|
-
moduleSearchLabel:
|
|
729
|
-
searchPlaceholder:
|
|
730
|
-
expandCollapseTrigger:
|
|
731
|
-
expandAll:
|
|
732
|
-
collapseAll:
|
|
733
|
-
searchScopeHint:
|
|
734
|
-
filterScopeHint:
|
|
735
|
-
modulesLoadErrorAlert:
|
|
736
|
-
modulesLoadingSpinnerLabel:
|
|
737
|
-
noModulesEmptyState:
|
|
738
|
-
filteredEmptyState:
|
|
739
|
-
noFilterMatches:
|
|
740
|
-
clearFilters:
|
|
741
|
-
loadMoreModulesLoading:
|
|
742
|
-
loadMoreModules:
|
|
743
|
-
allModulesLoaded:
|
|
744
|
-
filterGroupLabel:
|
|
745
|
-
filterAll:
|
|
746
|
-
filterInProgress:
|
|
747
|
-
filterComplete:
|
|
748
|
-
filterDueThisWeek:
|
|
749
|
-
filterMissing:
|
|
750
|
-
lockedByline:
|
|
751
|
-
moduleProgressScreenReaderLabel:
|
|
752
|
-
itemsLoadedAnnouncement:
|
|
753
|
-
itemsLoadErrorAlert:
|
|
754
|
-
itemsLoadingSpinnerLabel:
|
|
755
|
-
itemsLoadingText:
|
|
756
|
-
noItemsEmptyState:
|
|
757
|
-
loadMoreItemsLoading:
|
|
758
|
-
loadMoreItems:
|
|
759
|
-
moduleUnpublishedBadge:
|
|
760
|
-
collapseModule:
|
|
761
|
-
expandModule:
|
|
762
|
-
moduleStatusNotStarted:
|
|
763
|
-
moduleStatusInProgress:
|
|
764
|
-
moduleStatusComplete:
|
|
765
|
-
moduleStatusMissing:
|
|
766
|
-
moduleStatusIncomplete:
|
|
767
|
-
moduleStatusMissingAndIncomplete:
|
|
768
|
-
moduleStatusLocked:
|
|
769
|
-
itemStatusNotStarted:
|
|
770
|
-
itemStatusInProgress:
|
|
771
|
-
itemStatusComplete:
|
|
772
|
-
itemStatusSubmitted:
|
|
773
|
-
itemStatusGraded:
|
|
774
|
-
itemStatusExcused:
|
|
775
|
-
itemStatusMissing:
|
|
776
|
-
itemStatusLocked:
|
|
777
|
-
itemTypeAssignment:
|
|
778
|
-
itemTypeQuiz:
|
|
779
|
-
itemTypeDiscussion:
|
|
780
|
-
itemTypePage:
|
|
781
|
-
itemTypeFile:
|
|
782
|
-
itemTypeExternalUrl:
|
|
783
|
-
itemTypeExternalTool:
|
|
784
|
-
itemTypeSubHeader:
|
|
785
|
-
metaFieldTypeLabel:
|
|
786
|
-
metaFieldDueAtLabel:
|
|
787
|
-
metaFieldPointsLabel:
|
|
788
|
-
metaFieldRequirementLabel:
|
|
789
|
-
metaFieldDurationLabel:
|
|
790
|
-
metaFieldPublishStateLabel:
|
|
791
|
-
requirementMustView:
|
|
792
|
-
requirementMustSubmit:
|
|
793
|
-
requirementMustContribute:
|
|
794
|
-
requirementMustMarkDone:
|
|
795
|
-
requirementMinScoreUnknown:
|
|
796
|
-
requirementMinScore:
|
|
797
|
-
requirementMinPercentageUnknown:
|
|
798
|
-
requirementMinPercentage:
|
|
799
|
-
requirementUnknown:
|
|
800
|
-
dateTimeToday:
|
|
801
|
-
dateTimeYesterday:
|
|
802
|
-
dateTimeTomorrow:
|
|
803
|
-
dateTimeWithDate:
|
|
804
|
-
timeWithZone:
|
|
805
|
-
dueByline:
|
|
806
|
-
unlockByline:
|
|
807
|
-
pointsAbbreviated:
|
|
808
|
-
progressSummary:
|
|
809
|
-
progressScreenReaderValue:
|
|
810
|
-
durationMinutes:
|
|
811
|
-
itemUnpublishedLabel:
|
|
812
|
-
itemUntitled:
|
|
813
|
-
opensInNewWindow:
|
|
814
|
-
},
|
|
815
|
-
function
|
|
725
|
+
const _o = "Course modules", To = { one: "%{count} module loaded", other: "%{count} modules loaded" }, Eo = "Search by name", Po = "Search…", Co = "Expand / collapse", wo = "Expand all", Lo = "Collapse all", vo = "Search matches module names only — items of collapsed modules are not loaded.", Ao = "This filter runs on the modules loaded so far — load more to filter the rest of the course.", xo = "Modules failed to load: %{message}", Ro = "Loading modules", Do = "This course has no modules.", No = { one: "The only loaded module does not match this filter.", other: "None of the %{count} loaded modules match this filter." }, qo = "No modules match this filter.", ko = "Clear filters", Oo = "Loading more modules…", Fo = "Load more modules (%{count} loaded)", Uo = { one: "The only module in this course is loaded.", other: "All %{count} modules in this course are loaded." }, zo = "Filter", $o = "All", Bo = "In progress", jo = "Complete", Go = "Due this week", Yo = "Missing", Wo = "Locked until prerequisites are met", Qo = "%{name} progress", Ho = { one: "%{loaded} of %{count} item loaded in %{name}", other: "%{loaded} of %{count} items loaded in %{name}" }, Vo = "Items failed to load: %{message}", Ko = "Loading items", Zo = "Loading…", Xo = "No items.", Jo = "Loading more items…", er = "Load more items (%{loaded} of %{count} loaded)", tr = "(unpublished)", nr = "Collapse %{name}", or = "Expand %{name}", rr = "Not started", sr = "In progress", ir = "All completed", lr = "%{count} Missing", ar = "%{count} Incomplete", ur = "%{missing} & %{incomplete}", cr = "Locked", dr = "Not started", mr = "In progress", pr = "Complete", fr = "Submitted", gr = "Graded", hr = "Excused", Ir = "Missing", br = "Locked", Sr = "Assignment", Mr = "Quiz", yr = "Discussion", _r = "Page", Tr = "File", Er = "External URL", Pr = "External tool", Cr = "Text header", wr = "Item type", Lr = "Due date", vr = "Points", Ar = "Requirement", xr = "Estimated duration", Rr = "Publish state", Dr = "View the item", Nr = "Submit the assignment", qr = "Contribute to the page", kr = "Mark as done", Or = "Score at least the minimum", Fr = "Score at least %{count}", Ur = "Score at least the minimum percentage", zr = "Score at least %{count}%", $r = "Complete the requirement", Br = "today, %{time}", jr = "yesterday, %{time}", Gr = "tomorrow, %{time}", Yr = "%{date}, %{time}", Wr = "%{time} (%{zone})", Qr = "Due %{when}", Hr = "Will unlock on %{when}", Vr = { one: "%{count} pt", other: "%{count} pts" }, Kr = { one: "%{percent}% | %{met} of %{count} requirement met", other: "%{percent}% | %{met} of %{count} requirements met" }, Zr = { one: "%{percent}% complete, %{met} of %{count} requirement met", other: "%{percent}% complete, %{met} of %{count} requirements met" }, Xr = "%{count} min", Jr = "Unpublished", es = "Untitled item", ts = "opens in a new window", ns = {
|
|
726
|
+
pageTitle: _o,
|
|
727
|
+
modulesLoadedAnnouncement: To,
|
|
728
|
+
moduleSearchLabel: Eo,
|
|
729
|
+
searchPlaceholder: Po,
|
|
730
|
+
expandCollapseTrigger: Co,
|
|
731
|
+
expandAll: wo,
|
|
732
|
+
collapseAll: Lo,
|
|
733
|
+
searchScopeHint: vo,
|
|
734
|
+
filterScopeHint: Ao,
|
|
735
|
+
modulesLoadErrorAlert: xo,
|
|
736
|
+
modulesLoadingSpinnerLabel: Ro,
|
|
737
|
+
noModulesEmptyState: Do,
|
|
738
|
+
filteredEmptyState: No,
|
|
739
|
+
noFilterMatches: qo,
|
|
740
|
+
clearFilters: ko,
|
|
741
|
+
loadMoreModulesLoading: Oo,
|
|
742
|
+
loadMoreModules: Fo,
|
|
743
|
+
allModulesLoaded: Uo,
|
|
744
|
+
filterGroupLabel: zo,
|
|
745
|
+
filterAll: $o,
|
|
746
|
+
filterInProgress: Bo,
|
|
747
|
+
filterComplete: jo,
|
|
748
|
+
filterDueThisWeek: Go,
|
|
749
|
+
filterMissing: Yo,
|
|
750
|
+
lockedByline: Wo,
|
|
751
|
+
moduleProgressScreenReaderLabel: Qo,
|
|
752
|
+
itemsLoadedAnnouncement: Ho,
|
|
753
|
+
itemsLoadErrorAlert: Vo,
|
|
754
|
+
itemsLoadingSpinnerLabel: Ko,
|
|
755
|
+
itemsLoadingText: Zo,
|
|
756
|
+
noItemsEmptyState: Xo,
|
|
757
|
+
loadMoreItemsLoading: Jo,
|
|
758
|
+
loadMoreItems: er,
|
|
759
|
+
moduleUnpublishedBadge: tr,
|
|
760
|
+
collapseModule: nr,
|
|
761
|
+
expandModule: or,
|
|
762
|
+
moduleStatusNotStarted: rr,
|
|
763
|
+
moduleStatusInProgress: sr,
|
|
764
|
+
moduleStatusComplete: ir,
|
|
765
|
+
moduleStatusMissing: lr,
|
|
766
|
+
moduleStatusIncomplete: ar,
|
|
767
|
+
moduleStatusMissingAndIncomplete: ur,
|
|
768
|
+
moduleStatusLocked: cr,
|
|
769
|
+
itemStatusNotStarted: dr,
|
|
770
|
+
itemStatusInProgress: mr,
|
|
771
|
+
itemStatusComplete: pr,
|
|
772
|
+
itemStatusSubmitted: fr,
|
|
773
|
+
itemStatusGraded: gr,
|
|
774
|
+
itemStatusExcused: hr,
|
|
775
|
+
itemStatusMissing: Ir,
|
|
776
|
+
itemStatusLocked: br,
|
|
777
|
+
itemTypeAssignment: Sr,
|
|
778
|
+
itemTypeQuiz: Mr,
|
|
779
|
+
itemTypeDiscussion: yr,
|
|
780
|
+
itemTypePage: _r,
|
|
781
|
+
itemTypeFile: Tr,
|
|
782
|
+
itemTypeExternalUrl: Er,
|
|
783
|
+
itemTypeExternalTool: Pr,
|
|
784
|
+
itemTypeSubHeader: Cr,
|
|
785
|
+
metaFieldTypeLabel: wr,
|
|
786
|
+
metaFieldDueAtLabel: Lr,
|
|
787
|
+
metaFieldPointsLabel: vr,
|
|
788
|
+
metaFieldRequirementLabel: Ar,
|
|
789
|
+
metaFieldDurationLabel: xr,
|
|
790
|
+
metaFieldPublishStateLabel: Rr,
|
|
791
|
+
requirementMustView: Dr,
|
|
792
|
+
requirementMustSubmit: Nr,
|
|
793
|
+
requirementMustContribute: qr,
|
|
794
|
+
requirementMustMarkDone: kr,
|
|
795
|
+
requirementMinScoreUnknown: Or,
|
|
796
|
+
requirementMinScore: Fr,
|
|
797
|
+
requirementMinPercentageUnknown: Ur,
|
|
798
|
+
requirementMinPercentage: zr,
|
|
799
|
+
requirementUnknown: $r,
|
|
800
|
+
dateTimeToday: Br,
|
|
801
|
+
dateTimeYesterday: jr,
|
|
802
|
+
dateTimeTomorrow: Gr,
|
|
803
|
+
dateTimeWithDate: Yr,
|
|
804
|
+
timeWithZone: Wr,
|
|
805
|
+
dueByline: Qr,
|
|
806
|
+
unlockByline: Hr,
|
|
807
|
+
pointsAbbreviated: Vr,
|
|
808
|
+
progressSummary: Kr,
|
|
809
|
+
progressScreenReaderValue: Zr,
|
|
810
|
+
durationMinutes: Xr,
|
|
811
|
+
itemUnpublishedLabel: Jr,
|
|
812
|
+
itemUntitled: es,
|
|
813
|
+
opensInNewWindow: ts
|
|
814
|
+
}, os = /%\{(\w+)\}/g, rs = ns, te = "en-US", ss = /* @__PURE__ */ new Map(), is = /* @__PURE__ */ new Map();
|
|
815
|
+
function Kt(e, t, n) {
|
|
816
816
|
const o = e.get(t);
|
|
817
817
|
if (o) return o;
|
|
818
818
|
const r = n();
|
|
819
819
|
return e.set(t, r), r;
|
|
820
820
|
}
|
|
821
|
-
function
|
|
822
|
-
return n ? e.replace(
|
|
821
|
+
function ls(e, t, n) {
|
|
822
|
+
return n ? e.replace(os, (o, r) => {
|
|
823
823
|
if (!Object.prototype.hasOwnProperty.call(n, r)) return o;
|
|
824
824
|
const s = n[r];
|
|
825
|
-
return typeof s == "number" && Number.isFinite(s) ?
|
|
825
|
+
return typeof s == "number" && Number.isFinite(s) ? Kt(is, t, () => new Intl.NumberFormat(t)).format(s) : String(s);
|
|
826
826
|
}) : e;
|
|
827
827
|
}
|
|
828
|
-
function
|
|
828
|
+
function as(e, t, n) {
|
|
829
829
|
const o = n == null ? void 0 : n.count;
|
|
830
830
|
if (typeof o == "number" && Number.isFinite(o)) {
|
|
831
|
-
const r =
|
|
831
|
+
const r = Kt(ss, t, () => new Intl.PluralRules(t)).select(o), s = e[r];
|
|
832
832
|
if (typeof s == "string") return s;
|
|
833
833
|
}
|
|
834
834
|
return typeof e.other == "string" ? e.other : void 0;
|
|
835
835
|
}
|
|
836
|
-
function
|
|
836
|
+
function lt(e, t, n) {
|
|
837
837
|
if (typeof e == "string") return e;
|
|
838
838
|
if (e !== null && typeof e == "object")
|
|
839
|
-
return
|
|
839
|
+
return as(e, t, n);
|
|
840
840
|
}
|
|
841
|
-
const
|
|
842
|
-
function
|
|
843
|
-
|
|
841
|
+
const at = /* @__PURE__ */ new Set();
|
|
842
|
+
function us(e) {
|
|
843
|
+
at.has(e) || (at.add(e), console.warn(
|
|
844
844
|
`[platform-modules] no translation for "${e}"; it will render as itself. Add it to the catalog passed to ModulesI18nProvider.`
|
|
845
845
|
));
|
|
846
846
|
}
|
|
847
|
-
function
|
|
848
|
-
const s =
|
|
847
|
+
function cs(e, t, n, o, r) {
|
|
848
|
+
const s = lt(e == null ? void 0 : e[t], n, r);
|
|
849
849
|
if (typeof s == "string") return s;
|
|
850
|
-
const l =
|
|
851
|
-
return typeof l == "string" ? l : (o &&
|
|
850
|
+
const l = lt(rs[t], n, r);
|
|
851
|
+
return typeof l == "string" ? l : (o && us(t), t);
|
|
852
852
|
}
|
|
853
|
-
function
|
|
854
|
-
return (o, r) =>
|
|
853
|
+
function Zt(e, t = te, n = !1) {
|
|
854
|
+
return (o, r) => ls(cs(e, o, t, n, r), t, r);
|
|
855
855
|
}
|
|
856
|
-
const
|
|
857
|
-
function
|
|
856
|
+
const ds = Zt(), ms = { t: ds, locale: te }, Xt = yt(null);
|
|
857
|
+
function Pl({
|
|
858
858
|
translations: e,
|
|
859
859
|
locale: t,
|
|
860
860
|
timezone: n,
|
|
@@ -862,26 +862,26 @@ function Tl({
|
|
|
862
862
|
children: r
|
|
863
863
|
}) {
|
|
864
864
|
const s = R(() => {
|
|
865
|
-
const l = t ??
|
|
865
|
+
const l = t ?? te;
|
|
866
866
|
return {
|
|
867
|
-
t:
|
|
867
|
+
t: Zt(e, l, o),
|
|
868
868
|
locale: l,
|
|
869
869
|
timezone: n
|
|
870
870
|
};
|
|
871
871
|
}, [e, t, n, o]);
|
|
872
|
-
return /* @__PURE__ */ i(
|
|
872
|
+
return /* @__PURE__ */ i(Xt.Provider, { value: s, children: r });
|
|
873
873
|
}
|
|
874
|
-
function
|
|
875
|
-
return
|
|
874
|
+
function O() {
|
|
875
|
+
return _t(Xt) ?? ms;
|
|
876
876
|
}
|
|
877
|
-
const
|
|
878
|
-
function
|
|
879
|
-
const t =
|
|
877
|
+
const ps = 864e5, fs = "en-US", ut = /* @__PURE__ */ new Map(), ct = /* @__PURE__ */ new Map();
|
|
878
|
+
function gs(e) {
|
|
879
|
+
const t = ct.get(e);
|
|
880
880
|
if (t) return t;
|
|
881
881
|
const n = new Intl.NumberFormat(e, { minimumIntegerDigits: 2, useGrouping: !1 });
|
|
882
|
-
return
|
|
882
|
+
return ct.set(e, n), n;
|
|
883
883
|
}
|
|
884
|
-
function
|
|
884
|
+
function dt(e, t) {
|
|
885
885
|
return {
|
|
886
886
|
time: new Intl.DateTimeFormat(e, {
|
|
887
887
|
hour: "numeric",
|
|
@@ -896,7 +896,7 @@ function at(e, t) {
|
|
|
896
896
|
timeZone: t
|
|
897
897
|
}),
|
|
898
898
|
zone: t ? new Intl.DateTimeFormat(e, { timeZone: t, timeZoneName: "short" }) : void 0,
|
|
899
|
-
civilDay: new Intl.DateTimeFormat(
|
|
899
|
+
civilDay: new Intl.DateTimeFormat(fs, {
|
|
900
900
|
year: "numeric",
|
|
901
901
|
month: "numeric",
|
|
902
902
|
day: "numeric",
|
|
@@ -904,57 +904,57 @@ function at(e, t) {
|
|
|
904
904
|
})
|
|
905
905
|
};
|
|
906
906
|
}
|
|
907
|
-
function
|
|
908
|
-
const n = t || void 0, o = `${e}|${n ?? ""}`, r =
|
|
907
|
+
function Jt(e, t) {
|
|
908
|
+
const n = t || void 0, o = `${e}|${n ?? ""}`, r = ut.get(o);
|
|
909
909
|
if (r) return r;
|
|
910
910
|
let s;
|
|
911
911
|
try {
|
|
912
|
-
s =
|
|
912
|
+
s = dt(e, n);
|
|
913
913
|
} catch {
|
|
914
914
|
console.warn(
|
|
915
915
|
`[platform-modules] Unusable timezone ${JSON.stringify(n)}; rendering dates in the viewer's own clock instead.`
|
|
916
|
-
), s =
|
|
916
|
+
), s = dt(e, void 0);
|
|
917
917
|
}
|
|
918
|
-
return
|
|
918
|
+
return ut.set(o, s), s;
|
|
919
919
|
}
|
|
920
|
-
function
|
|
921
|
-
return new Date(
|
|
920
|
+
function mt(e, t) {
|
|
921
|
+
return new Date(Ye(e, t)).getUTCFullYear();
|
|
922
922
|
}
|
|
923
|
-
function
|
|
923
|
+
function hs(e, t) {
|
|
924
924
|
var o;
|
|
925
925
|
const n = (o = e.zone) == null ? void 0 : o.formatToParts(t).find((r) => r.type === "timeZoneName");
|
|
926
926
|
return (n == null ? void 0 : n.value) ?? null;
|
|
927
927
|
}
|
|
928
|
-
function
|
|
928
|
+
function Ye(e, t) {
|
|
929
929
|
const n = e.civilDay.formatToParts(t), o = (r) => {
|
|
930
930
|
var s;
|
|
931
931
|
return Number((s = n.find((l) => l.type === r)) == null ? void 0 : s.value);
|
|
932
932
|
};
|
|
933
933
|
return Date.UTC(o("year"), o("month") - 1, o("day"));
|
|
934
934
|
}
|
|
935
|
-
function
|
|
936
|
-
return
|
|
935
|
+
function Is(e, t, n) {
|
|
936
|
+
return en(Jt(te, n), e, t);
|
|
937
937
|
}
|
|
938
|
-
function
|
|
939
|
-
return Math.round((
|
|
938
|
+
function en(e, t, n) {
|
|
939
|
+
return Math.round((Ye(e, t) - Ye(e, n)) / ps);
|
|
940
940
|
}
|
|
941
|
-
function
|
|
941
|
+
function bs(e, t, n, { locale: o = te, timezone: r } = {}) {
|
|
942
942
|
const s = new Date(t);
|
|
943
943
|
if (Number.isNaN(s.getTime())) return t;
|
|
944
|
-
const l =
|
|
944
|
+
const l = Jt(o, r), a = hs(l, s), d = l.time.format(s), m = a ? e("timeWithZone", { time: d, zone: a }) : d, u = en(l, s, n);
|
|
945
945
|
if (u === 0) return e("dateTimeToday", { time: m });
|
|
946
946
|
if (u === -1) return e("dateTimeYesterday", { time: m });
|
|
947
947
|
if (u === 1) return e("dateTimeTomorrow", { time: m });
|
|
948
|
-
const
|
|
949
|
-
return e("dateTimeWithDate", { date:
|
|
948
|
+
const f = mt(l, s) === mt(l, n) ? l.day.format(s) : l.dayYear.format(s);
|
|
949
|
+
return e("dateTimeWithDate", { date: f, time: m });
|
|
950
950
|
}
|
|
951
|
-
function
|
|
952
|
-
return !Number.isInteger(e) || e < 1 ? null :
|
|
951
|
+
function Ss(e, t = te) {
|
|
952
|
+
return !Number.isInteger(e) || e < 1 ? null : gs(t).format(e);
|
|
953
953
|
}
|
|
954
|
-
function
|
|
954
|
+
function Ms(e, t) {
|
|
955
955
|
return t == null ? null : e("pointsAbbreviated", { count: t });
|
|
956
956
|
}
|
|
957
|
-
function
|
|
957
|
+
function ys(e, t) {
|
|
958
958
|
switch (t.type) {
|
|
959
959
|
case "must_view":
|
|
960
960
|
return e("requirementMustView");
|
|
@@ -972,17 +972,17 @@ function Ss(e, t) {
|
|
|
972
972
|
return e("requirementUnknown");
|
|
973
973
|
}
|
|
974
974
|
}
|
|
975
|
-
function
|
|
975
|
+
function _s(e, t, n, o) {
|
|
976
976
|
return e("progressSummary", { percent: t, met: n, count: o });
|
|
977
977
|
}
|
|
978
|
-
function
|
|
978
|
+
function Ts(e, t, n, o) {
|
|
979
979
|
return e("progressScreenReaderValue", { percent: t, met: n, count: o });
|
|
980
980
|
}
|
|
981
|
-
function
|
|
981
|
+
function Es(e, t, n) {
|
|
982
982
|
const o = t.trim().toLocaleLowerCase(n);
|
|
983
983
|
return o === "" ? !0 : e.name.toLocaleLowerCase(n).includes(o);
|
|
984
984
|
}
|
|
985
|
-
const
|
|
985
|
+
const J = "all", Ps = 7, Cs = {
|
|
986
986
|
all: {
|
|
987
987
|
label: "filterAll",
|
|
988
988
|
order: 10,
|
|
@@ -1016,8 +1016,8 @@ const ue = "all", Ts = 7, Es = {
|
|
|
1016
1016
|
if (!o) return !1;
|
|
1017
1017
|
const r = new Date(o);
|
|
1018
1018
|
if (Number.isNaN(r.getTime())) return !1;
|
|
1019
|
-
const s =
|
|
1020
|
-
return s >= 0 && s <=
|
|
1019
|
+
const s = Is(r, t, n);
|
|
1020
|
+
return s >= 0 && s <= Ps;
|
|
1021
1021
|
}
|
|
1022
1022
|
},
|
|
1023
1023
|
missing: {
|
|
@@ -1029,43 +1029,43 @@ const ue = "all", Ts = 7, Es = {
|
|
|
1029
1029
|
}
|
|
1030
1030
|
}
|
|
1031
1031
|
};
|
|
1032
|
-
function
|
|
1032
|
+
function Xe(e) {
|
|
1033
1033
|
if (!(!e || e.clientOnly))
|
|
1034
1034
|
return e.query;
|
|
1035
1035
|
}
|
|
1036
|
-
function
|
|
1037
|
-
return e !== void 0 &&
|
|
1036
|
+
function We(e) {
|
|
1037
|
+
return e !== void 0 && Xe(e) === void 0;
|
|
1038
1038
|
}
|
|
1039
|
-
const
|
|
1040
|
-
moduleLabel: (e, t, { locale: n }) =>
|
|
1041
|
-
dateTime: (e, t, { t: n, locale: o, timezone: r }) =>
|
|
1042
|
-
points: (e, { t }) =>
|
|
1043
|
-
progress: (e, t, n, { t: o }) =>
|
|
1044
|
-
},
|
|
1045
|
-
function
|
|
1039
|
+
const ws = {
|
|
1040
|
+
moduleLabel: (e, t, { locale: n }) => Ss(e, n),
|
|
1041
|
+
dateTime: (e, t, { t: n, locale: o, timezone: r }) => bs(n, e, t, { locale: o, timezone: r }),
|
|
1042
|
+
points: (e, { t }) => Ms(t, e),
|
|
1043
|
+
progress: (e, t, n, { t: o }) => _s(o, e, t, n)
|
|
1044
|
+
}, xe = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
|
|
1045
|
+
function Re(e, t) {
|
|
1046
1046
|
const n = Object.entries(t ?? {}).filter(([, o]) => o !== void 0);
|
|
1047
1047
|
return { ...e, ...Object.fromEntries(n) };
|
|
1048
1048
|
}
|
|
1049
|
-
function
|
|
1049
|
+
function Z(e, t = {}) {
|
|
1050
1050
|
const n = Object.keys(e).map((r) => [
|
|
1051
1051
|
r,
|
|
1052
|
-
|
|
1053
|
-
]), o = Object.keys(t).filter((r) => !
|
|
1052
|
+
Re(e[r], xe(t, r) ? t[r] : void 0)
|
|
1053
|
+
]), o = Object.keys(t).filter((r) => !xe(e, r)).sort().map((r) => [r, Re({}, t[r])]);
|
|
1054
1054
|
return Object.fromEntries([...n, ...o]);
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1057
|
-
if (!(!
|
|
1056
|
+
function ee(e, t) {
|
|
1057
|
+
if (!(!xe(e, t) || e[t].hidden))
|
|
1058
1058
|
return e[t];
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1061
|
-
return Object.keys(e).filter((t) =>
|
|
1060
|
+
function Je(e) {
|
|
1061
|
+
return Object.keys(e).filter((t) => ee(e, t) !== void 0).map((t) => ({ ...e[t], key: t })).sort((t, n) => t.order - n.order);
|
|
1062
1062
|
}
|
|
1063
|
-
const
|
|
1063
|
+
const Ls = "type", vs = {
|
|
1064
1064
|
type: {
|
|
1065
1065
|
label: "metaFieldTypeLabel",
|
|
1066
1066
|
order: 10,
|
|
1067
1067
|
render: ({ item: e, t, config: n }) => {
|
|
1068
|
-
const o =
|
|
1068
|
+
const o = ee(n.itemTypes, e.type);
|
|
1069
1069
|
return o ? t(o.label) : null;
|
|
1070
1070
|
}
|
|
1071
1071
|
},
|
|
@@ -1082,13 +1082,13 @@ const Cs = "type", ws = {
|
|
|
1082
1082
|
requirement: {
|
|
1083
1083
|
label: "metaFieldRequirementLabel",
|
|
1084
1084
|
order: 40,
|
|
1085
|
-
render: ({ item: e, t }) => e.completionRequirement ?
|
|
1085
|
+
render: ({ item: e, t }) => e.completionRequirement ? ys(t, e.completionRequirement) : null
|
|
1086
1086
|
},
|
|
1087
1087
|
estimatedDuration: {
|
|
1088
1088
|
label: "metaFieldDurationLabel",
|
|
1089
1089
|
order: 50,
|
|
1090
1090
|
render: ({ item: e, t }) => {
|
|
1091
|
-
const n =
|
|
1091
|
+
const n = Gn(e);
|
|
1092
1092
|
return n === null ? null : t("durationMinutes", { count: n });
|
|
1093
1093
|
}
|
|
1094
1094
|
},
|
|
@@ -1097,144 +1097,144 @@ const Cs = "type", ws = {
|
|
|
1097
1097
|
order: 60,
|
|
1098
1098
|
render: ({ item: e, t }) => e.published ? null : t("itemUnpublishedLabel")
|
|
1099
1099
|
}
|
|
1100
|
-
},
|
|
1100
|
+
}, W = { size: "md", color: "mutedColor" }, As = {
|
|
1101
1101
|
assignment: {
|
|
1102
1102
|
label: "itemTypeAssignment",
|
|
1103
1103
|
order: 10,
|
|
1104
|
-
icon: /* @__PURE__ */ i(
|
|
1104
|
+
icon: /* @__PURE__ */ i(Mn, { ...W })
|
|
1105
1105
|
},
|
|
1106
|
-
quiz: { label: "itemTypeQuiz", order: 20, icon: /* @__PURE__ */ i(
|
|
1106
|
+
quiz: { label: "itemTypeQuiz", order: 20, icon: /* @__PURE__ */ i(Sn, { ...W }) },
|
|
1107
1107
|
discussion: {
|
|
1108
1108
|
label: "itemTypeDiscussion",
|
|
1109
1109
|
order: 30,
|
|
1110
|
-
icon: /* @__PURE__ */ i(
|
|
1110
|
+
icon: /* @__PURE__ */ i(bn, { ...W })
|
|
1111
1111
|
},
|
|
1112
|
-
page: { label: "itemTypePage", order: 40, icon: /* @__PURE__ */ i(
|
|
1113
|
-
file: { label: "itemTypeFile", order: 50, icon: /* @__PURE__ */ i(
|
|
1112
|
+
page: { label: "itemTypePage", order: 40, icon: /* @__PURE__ */ i(In, { ...W }) },
|
|
1113
|
+
file: { label: "itemTypeFile", order: 50, icon: /* @__PURE__ */ i(hn, { ...W }) },
|
|
1114
1114
|
external_url: {
|
|
1115
1115
|
label: "itemTypeExternalUrl",
|
|
1116
1116
|
order: 60,
|
|
1117
|
-
icon: /* @__PURE__ */ i(
|
|
1117
|
+
icon: /* @__PURE__ */ i(gn, { ...W })
|
|
1118
1118
|
},
|
|
1119
1119
|
external_tool: {
|
|
1120
1120
|
label: "itemTypeExternalTool",
|
|
1121
1121
|
order: 70,
|
|
1122
|
-
icon: /* @__PURE__ */ i(
|
|
1122
|
+
icon: /* @__PURE__ */ i(fn, { ...W })
|
|
1123
1123
|
},
|
|
1124
1124
|
sub_header: { label: "itemTypeSubHeader", order: 80, icon: null }
|
|
1125
|
-
},
|
|
1126
|
-
formatters:
|
|
1127
|
-
itemTypes:
|
|
1125
|
+
}, Ne = {
|
|
1126
|
+
formatters: ws,
|
|
1127
|
+
itemTypes: As,
|
|
1128
1128
|
itemStatuses: {},
|
|
1129
|
-
itemMeta:
|
|
1130
|
-
filters:
|
|
1129
|
+
itemMeta: vs,
|
|
1130
|
+
filters: Cs,
|
|
1131
1131
|
moduleActions: {},
|
|
1132
1132
|
itemActions: {},
|
|
1133
1133
|
navigation: {}
|
|
1134
1134
|
};
|
|
1135
|
-
Object.freeze(
|
|
1136
|
-
for (const e of Object.values(
|
|
1135
|
+
Object.freeze(Ne);
|
|
1136
|
+
for (const e of Object.values(Ne)) {
|
|
1137
1137
|
Object.freeze(e);
|
|
1138
1138
|
for (const t of Object.values(e)) Object.freeze(t);
|
|
1139
1139
|
}
|
|
1140
|
-
function
|
|
1141
|
-
return
|
|
1142
|
-
const o =
|
|
1143
|
-
return o !== void 0 && !
|
|
1140
|
+
function xs(e, t) {
|
|
1141
|
+
return Je(e).filter((n) => {
|
|
1142
|
+
const o = Xe(n);
|
|
1143
|
+
return o !== void 0 && !Nn(t, o);
|
|
1144
1144
|
}).map((n) => n.key);
|
|
1145
1145
|
}
|
|
1146
|
-
function
|
|
1146
|
+
function pt(e) {
|
|
1147
1147
|
return `[platform-modules] the adapter cannot serve filter(s): ${e.join(", ")}. Add the field to the adapter's capabilities, or set clientOnly on the entry.`;
|
|
1148
1148
|
}
|
|
1149
|
-
function
|
|
1150
|
-
const n =
|
|
1149
|
+
function Rs(e, t) {
|
|
1150
|
+
const n = xs(e, t);
|
|
1151
1151
|
if (n.length === 0) return e;
|
|
1152
1152
|
if (process.env.NODE_ENV !== "production")
|
|
1153
|
-
throw new Error(
|
|
1154
|
-
console.warn(
|
|
1153
|
+
throw new Error(pt(n));
|
|
1154
|
+
console.warn(pt(n));
|
|
1155
1155
|
const o = Object.fromEntries(n.map((r) => [r, { ...e[r], hidden: !0 }]));
|
|
1156
1156
|
return { ...e, ...o };
|
|
1157
1157
|
}
|
|
1158
|
-
const
|
|
1159
|
-
function
|
|
1160
|
-
return /* @__PURE__ */ i(
|
|
1158
|
+
const tn = yt(null);
|
|
1159
|
+
function Cl({ value: e, children: t }) {
|
|
1160
|
+
return /* @__PURE__ */ i(tn.Provider, { value: e, children: t });
|
|
1161
1161
|
}
|
|
1162
|
-
function
|
|
1163
|
-
return
|
|
1162
|
+
function ge() {
|
|
1163
|
+
return _t(tn) ?? Ne;
|
|
1164
1164
|
}
|
|
1165
|
-
function
|
|
1166
|
-
return
|
|
1165
|
+
function wl(e) {
|
|
1166
|
+
return ee(ge().itemMeta, e) !== void 0;
|
|
1167
1167
|
}
|
|
1168
|
-
const
|
|
1168
|
+
const qe = c.object({
|
|
1169
1169
|
label: c.string(),
|
|
1170
1170
|
order: c.number(),
|
|
1171
1171
|
hidden: c.boolean().optional()
|
|
1172
1172
|
});
|
|
1173
|
-
function
|
|
1173
|
+
function ve(e) {
|
|
1174
1174
|
return c.record(c.string(), e);
|
|
1175
1175
|
}
|
|
1176
|
-
const
|
|
1176
|
+
const Be = ve(qe.strict()), nn = (e) => e == null || typeof e == "string" || typeof e == "number" || typeof e == "bigint" || typeof e == "boolean" || Tt(e) || Array.isArray(e) && e.every(nn), Ds = (e) => {
|
|
1177
1177
|
var t;
|
|
1178
1178
|
return e == null || typeof e == "function" && !((t = e.prototype) != null && t.isReactComponent);
|
|
1179
|
-
},
|
|
1180
|
-
icon: c.custom(
|
|
1181
|
-
renderIcon: c.custom(
|
|
1179
|
+
}, Ns = qe.extend({
|
|
1180
|
+
icon: c.custom(nn, { message: "icon must be a ReactNode" }),
|
|
1181
|
+
renderIcon: c.custom(Ds, {
|
|
1182
1182
|
message: "renderIcon must be a function of the item, not a React component"
|
|
1183
1183
|
})
|
|
1184
1184
|
}).strict();
|
|
1185
|
-
function
|
|
1185
|
+
function Ce() {
|
|
1186
1186
|
return c.custom((e) => typeof e == "function", {
|
|
1187
1187
|
message: "Expected a function"
|
|
1188
1188
|
});
|
|
1189
1189
|
}
|
|
1190
|
-
const
|
|
1190
|
+
const qs = qe.extend({
|
|
1191
1191
|
render: c.custom((e) => typeof e == "function", {
|
|
1192
1192
|
message: "render must be a function taking a MetaFieldContext"
|
|
1193
1193
|
})
|
|
1194
|
-
}).strict(),
|
|
1194
|
+
}).strict(), ks = qe.extend({
|
|
1195
1195
|
predicate: c.custom((e) => typeof e == "function", {
|
|
1196
1196
|
message: "predicate must be a function of the module and a FilterContext"
|
|
1197
1197
|
}),
|
|
1198
|
-
query:
|
|
1198
|
+
query: Dn.optional(),
|
|
1199
1199
|
clientOnly: c.boolean().optional()
|
|
1200
|
-
}).strict(),
|
|
1200
|
+
}).strict(), Os = c.object({
|
|
1201
1201
|
formatters: c.object({
|
|
1202
|
-
moduleLabel:
|
|
1203
|
-
dateTime:
|
|
1204
|
-
points:
|
|
1205
|
-
progress:
|
|
1202
|
+
moduleLabel: Ce(),
|
|
1203
|
+
dateTime: Ce(),
|
|
1204
|
+
points: Ce(),
|
|
1205
|
+
progress: Ce()
|
|
1206
1206
|
}).strict(),
|
|
1207
|
-
itemTypes:
|
|
1208
|
-
itemStatuses:
|
|
1209
|
-
itemMeta:
|
|
1210
|
-
filters:
|
|
1211
|
-
moduleActions:
|
|
1212
|
-
itemActions:
|
|
1207
|
+
itemTypes: ve(Ns),
|
|
1208
|
+
itemStatuses: Be,
|
|
1209
|
+
itemMeta: ve(qs),
|
|
1210
|
+
filters: ve(ks),
|
|
1211
|
+
moduleActions: Be,
|
|
1212
|
+
itemActions: Be,
|
|
1213
1213
|
navigation: c.object({}).strict()
|
|
1214
1214
|
});
|
|
1215
|
-
function
|
|
1216
|
-
const n = Object.keys(t).filter((r) => !
|
|
1215
|
+
function Fs(e, t = {}) {
|
|
1216
|
+
const n = Object.keys(t).filter((r) => !xe(e, r));
|
|
1217
1217
|
if (n.length > 0)
|
|
1218
1218
|
throw new Error(
|
|
1219
1219
|
`Unknown modules config key(s): ${n.join(", ")}. Known keys are ${Object.keys(e).join(", ")}.`
|
|
1220
1220
|
);
|
|
1221
1221
|
const o = {
|
|
1222
|
-
formatters:
|
|
1223
|
-
itemTypes:
|
|
1224
|
-
itemStatuses:
|
|
1225
|
-
itemMeta:
|
|
1226
|
-
filters:
|
|
1227
|
-
moduleActions:
|
|
1228
|
-
itemActions:
|
|
1229
|
-
navigation:
|
|
1222
|
+
formatters: Re(e.formatters, t.formatters),
|
|
1223
|
+
itemTypes: Z(e.itemTypes, t.itemTypes),
|
|
1224
|
+
itemStatuses: Z(e.itemStatuses, t.itemStatuses),
|
|
1225
|
+
itemMeta: Z(e.itemMeta, t.itemMeta),
|
|
1226
|
+
filters: Z(e.filters, t.filters),
|
|
1227
|
+
moduleActions: Z(e.moduleActions, t.moduleActions),
|
|
1228
|
+
itemActions: Z(e.itemActions, t.itemActions),
|
|
1229
|
+
navigation: Re(e.navigation, t.navigation)
|
|
1230
1230
|
};
|
|
1231
|
-
return
|
|
1231
|
+
return Os.parse(o), o;
|
|
1232
1232
|
}
|
|
1233
|
-
function
|
|
1234
|
-
return
|
|
1233
|
+
function Ll(e = {}) {
|
|
1234
|
+
return Fs(Ne, e);
|
|
1235
1235
|
}
|
|
1236
|
-
function
|
|
1237
|
-
const { formatters: e } =
|
|
1236
|
+
function ke() {
|
|
1237
|
+
const { formatters: e } = ge(), { t, locale: n, timezone: o } = O();
|
|
1238
1238
|
return R(() => {
|
|
1239
1239
|
const r = { t, locale: n, timezone: o }, s = (l, a) => e.dateTime(l, a, r);
|
|
1240
1240
|
return {
|
|
@@ -1246,22 +1246,22 @@ function Ne() {
|
|
|
1246
1246
|
};
|
|
1247
1247
|
}, [e, t, n, o]);
|
|
1248
1248
|
}
|
|
1249
|
-
const
|
|
1250
|
-
all:
|
|
1251
|
-
course: (e) => [...
|
|
1252
|
-
list: (e, t = {}) => [...
|
|
1253
|
-
items: (e, t, n = {}) => [...
|
|
1249
|
+
const et = 100, on = 100, rn = 100, Us = 4, Oe = 5 * 60 * 1e3, sn = 20, De = { hasNextPage: !1, endCursor: null }, X = ["platform-modules"], he = {
|
|
1250
|
+
all: X,
|
|
1251
|
+
course: (e) => [...X, e],
|
|
1252
|
+
list: (e, t = {}) => [...X, e, "list", t],
|
|
1253
|
+
items: (e, t, n = {}) => [...X, e, "module", t, "items", n]
|
|
1254
1254
|
};
|
|
1255
|
-
function
|
|
1256
|
-
return [...
|
|
1255
|
+
function zs(e) {
|
|
1256
|
+
return [...X, e, "list"];
|
|
1257
1257
|
}
|
|
1258
|
-
function
|
|
1259
|
-
return [...
|
|
1258
|
+
function ln(e, t) {
|
|
1259
|
+
return [...X, e, "module", t, "items"];
|
|
1260
1260
|
}
|
|
1261
|
-
function
|
|
1261
|
+
function an(e) {
|
|
1262
1262
|
return e.pageInfo.hasNextPage ? e.pageInfo.endCursor : null;
|
|
1263
1263
|
}
|
|
1264
|
-
function
|
|
1264
|
+
function un(e) {
|
|
1265
1265
|
const {
|
|
1266
1266
|
courseId: t,
|
|
1267
1267
|
adapter: n,
|
|
@@ -1276,9 +1276,9 @@ function sn(e) {
|
|
|
1276
1276
|
} = e;
|
|
1277
1277
|
return {
|
|
1278
1278
|
// `inlineItemsFirst` is deliberately out of the key: it is derived from this very list.
|
|
1279
|
-
queryKey:
|
|
1279
|
+
queryKey: he.list(t, { view: d, pageSize: o, includeItems: r, filter: s }),
|
|
1280
1280
|
initialPageParam: null,
|
|
1281
|
-
queryFn: ({ pageParam: p, signal:
|
|
1281
|
+
queryFn: ({ pageParam: p, signal: f }) => n.listModules({
|
|
1282
1282
|
courseId: t,
|
|
1283
1283
|
cursor: p,
|
|
1284
1284
|
pageSize: o,
|
|
@@ -1286,18 +1286,18 @@ function sn(e) {
|
|
|
1286
1286
|
filter: s,
|
|
1287
1287
|
inlineItemsFirst: l,
|
|
1288
1288
|
inlineFirst: a,
|
|
1289
|
-
signal:
|
|
1289
|
+
signal: f
|
|
1290
1290
|
}),
|
|
1291
|
-
getNextPageParam:
|
|
1291
|
+
getNextPageParam: an,
|
|
1292
1292
|
enabled: u,
|
|
1293
1293
|
staleTime: m,
|
|
1294
1294
|
refetchOnWindowFocus: !1
|
|
1295
1295
|
};
|
|
1296
1296
|
}
|
|
1297
|
-
function
|
|
1297
|
+
function cn(e) {
|
|
1298
1298
|
const { courseId: t, moduleId: n, adapter: o, pageSize: r, view: s, staleTime: l, enabled: a, limit: d } = e;
|
|
1299
1299
|
return {
|
|
1300
|
-
queryKey:
|
|
1300
|
+
queryKey: he.items(t, n, { view: s, pageSize: r }),
|
|
1301
1301
|
initialPageParam: null,
|
|
1302
1302
|
queryFn: ({ pageParam: m, signal: u }) => {
|
|
1303
1303
|
const p = () => o.listModuleItems({ courseId: t, moduleId: n, cursor: m, pageSize: r, signal: u });
|
|
@@ -1307,27 +1307,27 @@ function ln(e) {
|
|
|
1307
1307
|
return p();
|
|
1308
1308
|
}) : p();
|
|
1309
1309
|
},
|
|
1310
|
-
getNextPageParam:
|
|
1310
|
+
getNextPageParam: an,
|
|
1311
1311
|
enabled: a,
|
|
1312
1312
|
staleTime: l,
|
|
1313
1313
|
refetchOnWindowFocus: !1
|
|
1314
1314
|
};
|
|
1315
1315
|
}
|
|
1316
|
-
function
|
|
1317
|
-
var
|
|
1316
|
+
function $s(e) {
|
|
1317
|
+
var _;
|
|
1318
1318
|
const {
|
|
1319
1319
|
courseId: t,
|
|
1320
1320
|
adapter: n,
|
|
1321
|
-
pageSize: o =
|
|
1321
|
+
pageSize: o = et,
|
|
1322
1322
|
includeItems: r = !1,
|
|
1323
1323
|
filter: s,
|
|
1324
1324
|
inlineItemsFirst: l,
|
|
1325
1325
|
inlineFirst: a,
|
|
1326
1326
|
view: d,
|
|
1327
|
-
staleTime: m =
|
|
1327
|
+
staleTime: m = Oe,
|
|
1328
1328
|
enabled: u = !0
|
|
1329
|
-
} = e, p =
|
|
1330
|
-
|
|
1329
|
+
} = e, p = Ve(
|
|
1330
|
+
un({
|
|
1331
1331
|
courseId: t,
|
|
1332
1332
|
adapter: n,
|
|
1333
1333
|
pageSize: o,
|
|
@@ -1339,33 +1339,33 @@ function Us(e) {
|
|
|
1339
1339
|
staleTime: m,
|
|
1340
1340
|
enabled: u
|
|
1341
1341
|
})
|
|
1342
|
-
),
|
|
1342
|
+
), f = (_ = p.data) == null ? void 0 : _.pages, g = R(() => (f ?? []).flatMap((y) => y.modules), [f]), h = f && f.length > 0 ? f[f.length - 1].pageInfo : De, I = p.fetchNextPage, w = k(() => {
|
|
1343
1343
|
I();
|
|
1344
1344
|
}, [I]);
|
|
1345
1345
|
return {
|
|
1346
|
-
modules:
|
|
1346
|
+
modules: g,
|
|
1347
1347
|
pageInfo: h,
|
|
1348
1348
|
hasNextPage: h.hasNextPage,
|
|
1349
|
-
fetchNextPage:
|
|
1349
|
+
fetchNextPage: w,
|
|
1350
1350
|
isLoading: p.isLoading,
|
|
1351
1351
|
isFetchingNextPage: p.isFetchingNextPage,
|
|
1352
1352
|
isPending: p.isPending,
|
|
1353
1353
|
error: p.error
|
|
1354
1354
|
};
|
|
1355
1355
|
}
|
|
1356
|
-
function
|
|
1356
|
+
function vl(e) {
|
|
1357
1357
|
var I;
|
|
1358
1358
|
const {
|
|
1359
1359
|
courseId: t,
|
|
1360
1360
|
moduleId: n,
|
|
1361
1361
|
adapter: o,
|
|
1362
|
-
pageSize: r =
|
|
1362
|
+
pageSize: r = on,
|
|
1363
1363
|
view: s,
|
|
1364
1364
|
enabled: l = !0,
|
|
1365
|
-
staleTime: a =
|
|
1365
|
+
staleTime: a = Oe,
|
|
1366
1366
|
limit: d
|
|
1367
|
-
} = e, m =
|
|
1368
|
-
|
|
1367
|
+
} = e, m = Ve(
|
|
1368
|
+
cn({
|
|
1369
1369
|
courseId: t,
|
|
1370
1370
|
moduleId: n,
|
|
1371
1371
|
adapter: o,
|
|
@@ -1375,20 +1375,20 @@ function wl(e) {
|
|
|
1375
1375
|
enabled: l,
|
|
1376
1376
|
limit: d
|
|
1377
1377
|
})
|
|
1378
|
-
), u = (I = m.data) == null ? void 0 : I.pages, p = R(() => (u ?? []).flatMap((
|
|
1379
|
-
|
|
1380
|
-
}, [
|
|
1378
|
+
), u = (I = m.data) == null ? void 0 : I.pages, p = R(() => (u ?? []).flatMap((w) => w.items), [u]), f = u && u.length > 0 ? u[u.length - 1].pageInfo : De, g = m.fetchNextPage, h = k(() => {
|
|
1379
|
+
g();
|
|
1380
|
+
}, [g]);
|
|
1381
1381
|
return {
|
|
1382
1382
|
items: p,
|
|
1383
|
-
pageInfo:
|
|
1384
|
-
hasNextPage:
|
|
1383
|
+
pageInfo: f,
|
|
1384
|
+
hasNextPage: f.hasNextPage,
|
|
1385
1385
|
fetchNextPage: h,
|
|
1386
1386
|
isLoading: m.isLoading,
|
|
1387
1387
|
isFetchingNextPage: m.isFetchingNextPage,
|
|
1388
1388
|
error: m.error
|
|
1389
1389
|
};
|
|
1390
1390
|
}
|
|
1391
|
-
function
|
|
1391
|
+
function Bs(e, t, n = Ze) {
|
|
1392
1392
|
if (e.pageInfo.hasNextPage) return "onDemand";
|
|
1393
1393
|
let o = 0, r = 0;
|
|
1394
1394
|
for (const s of e.modules) {
|
|
@@ -1397,20 +1397,20 @@ function zs(e, t, n = Ve) {
|
|
|
1397
1397
|
}
|
|
1398
1398
|
return o > t * 2 ? "onDemand" : Math.max(e.modules.length, 1) * Math.max(r, 1) <= n ? "inline" : "onDemand";
|
|
1399
1399
|
}
|
|
1400
|
-
function
|
|
1401
|
-
var
|
|
1400
|
+
function js(e) {
|
|
1401
|
+
var g;
|
|
1402
1402
|
const {
|
|
1403
1403
|
courseId: t,
|
|
1404
1404
|
adapter: n,
|
|
1405
1405
|
mode: o = "auto",
|
|
1406
|
-
inlineThreshold: r =
|
|
1407
|
-
nodeBudget: s = n.inlineNodeBudget ??
|
|
1408
|
-
pageSize: l =
|
|
1406
|
+
inlineThreshold: r = rn,
|
|
1407
|
+
nodeBudget: s = n.inlineNodeBudget ?? Ze,
|
|
1408
|
+
pageSize: l = et,
|
|
1409
1409
|
filter: a,
|
|
1410
1410
|
view: d,
|
|
1411
|
-
staleTime: m =
|
|
1412
|
-
} = e, u = o === "auto", p =
|
|
1413
|
-
|
|
1411
|
+
staleTime: m = Oe
|
|
1412
|
+
} = e, u = o === "auto", p = Ve(
|
|
1413
|
+
un({
|
|
1414
1414
|
courseId: t,
|
|
1415
1415
|
adapter: n,
|
|
1416
1416
|
pageSize: l,
|
|
@@ -1437,91 +1437,91 @@ function $s(e) {
|
|
|
1437
1437
|
error: p.error,
|
|
1438
1438
|
inlineShape: null
|
|
1439
1439
|
};
|
|
1440
|
-
const
|
|
1441
|
-
return
|
|
1442
|
-
resolvedMode:
|
|
1440
|
+
const f = (g = p.data) == null ? void 0 : g.pages[0];
|
|
1441
|
+
return f ? {
|
|
1442
|
+
resolvedMode: Bs(f, r, s),
|
|
1443
1443
|
isResolving: !1,
|
|
1444
1444
|
probed: !0,
|
|
1445
1445
|
error: null,
|
|
1446
|
-
inlineShape:
|
|
1446
|
+
inlineShape: Gs(f)
|
|
1447
1447
|
} : { resolvedMode: null, isResolving: !0, probed: !0, error: null, inlineShape: null };
|
|
1448
1448
|
}
|
|
1449
|
-
function
|
|
1449
|
+
function Gs(e) {
|
|
1450
1450
|
let t = 1;
|
|
1451
1451
|
for (const n of e.modules)
|
|
1452
1452
|
n.itemCount > t && (t = n.itemCount);
|
|
1453
1453
|
return { moduleCount: Math.max(e.modules.length, 1), maxItemCount: t };
|
|
1454
1454
|
}
|
|
1455
|
-
const
|
|
1456
|
-
function
|
|
1457
|
-
const o =
|
|
1458
|
-
|
|
1455
|
+
const ft = "\0", Ys = /* @__PURE__ */ new Map();
|
|
1456
|
+
function Ws(e, t, n = sn) {
|
|
1457
|
+
const o = vt(), r = U(/* @__PURE__ */ new Map()), [s, l] = me(Ys), a = e.join(ft), d = R(() => a === "" ? [] : a.split(ft), [a]);
|
|
1458
|
+
Ae(() => {
|
|
1459
1459
|
const u = r.current, p = () => {
|
|
1460
1460
|
l((h) => {
|
|
1461
1461
|
const I = /* @__PURE__ */ new Map();
|
|
1462
|
-
let
|
|
1463
|
-
for (const [
|
|
1464
|
-
const D =
|
|
1465
|
-
I.set(
|
|
1462
|
+
let w = h.size !== u.size;
|
|
1463
|
+
for (const [_, y] of u) {
|
|
1464
|
+
const D = y.getCurrentResult();
|
|
1465
|
+
I.set(_, D), !w && h.get(_) !== D && (w = !0);
|
|
1466
1466
|
}
|
|
1467
|
-
return
|
|
1467
|
+
return w ? I : h;
|
|
1468
1468
|
});
|
|
1469
|
-
},
|
|
1469
|
+
}, f = new Set(d);
|
|
1470
1470
|
for (const h of d) {
|
|
1471
1471
|
if (u.has(h)) continue;
|
|
1472
|
-
const I = new
|
|
1472
|
+
const I = new En(
|
|
1473
1473
|
o,
|
|
1474
1474
|
t(h, !0)
|
|
1475
1475
|
);
|
|
1476
1476
|
u.set(h, I), I.subscribe(p);
|
|
1477
1477
|
}
|
|
1478
1478
|
for (const [h, I] of u)
|
|
1479
|
-
I.setOptions(t(h,
|
|
1479
|
+
I.setOptions(t(h, f.has(h)));
|
|
1480
1480
|
for (const h of d) {
|
|
1481
1481
|
const I = u.get(h);
|
|
1482
1482
|
I && (u.delete(h), u.set(h, I));
|
|
1483
1483
|
}
|
|
1484
|
-
let
|
|
1485
|
-
if (
|
|
1484
|
+
let g = u.size - f.size;
|
|
1485
|
+
if (g > n)
|
|
1486
1486
|
for (const [h, I] of u) {
|
|
1487
|
-
if (
|
|
1488
|
-
|
|
1487
|
+
if (g <= n) break;
|
|
1488
|
+
f.has(h) || (I.destroy(), u.delete(h), g -= 1);
|
|
1489
1489
|
}
|
|
1490
1490
|
p();
|
|
1491
|
-
}, [o, t, d, n]),
|
|
1491
|
+
}, [o, t, d, n]), Ae(() => {
|
|
1492
1492
|
const u = r.current;
|
|
1493
1493
|
return () => {
|
|
1494
1494
|
for (const p of u.values()) p.destroy();
|
|
1495
1495
|
u.clear();
|
|
1496
1496
|
};
|
|
1497
1497
|
}, []);
|
|
1498
|
-
const m =
|
|
1498
|
+
const m = k((u) => {
|
|
1499
1499
|
var p;
|
|
1500
1500
|
(p = r.current.get(u)) == null || p.fetchNextPage();
|
|
1501
1501
|
}, []);
|
|
1502
1502
|
return { results: s, fetchNextPage: m };
|
|
1503
1503
|
}
|
|
1504
|
-
const
|
|
1504
|
+
const Qs = [], Hs = () => {
|
|
1505
1505
|
};
|
|
1506
|
-
function
|
|
1507
|
-
var
|
|
1506
|
+
function Al(e) {
|
|
1507
|
+
var Y, _e;
|
|
1508
1508
|
const {
|
|
1509
1509
|
courseId: t,
|
|
1510
1510
|
adapter: n,
|
|
1511
1511
|
view: o,
|
|
1512
1512
|
itemsMode: r = "auto",
|
|
1513
|
-
inlineThreshold: s =
|
|
1514
|
-
pageSize: l =
|
|
1515
|
-
itemPageSize: a =
|
|
1516
|
-
itemConcurrency: d =
|
|
1517
|
-
retainCollapsedLimit: m =
|
|
1518
|
-
staleTime: u =
|
|
1513
|
+
inlineThreshold: s = rn,
|
|
1514
|
+
pageSize: l = et,
|
|
1515
|
+
itemPageSize: a = on,
|
|
1516
|
+
itemConcurrency: d = Us,
|
|
1517
|
+
retainCollapsedLimit: m = sn,
|
|
1518
|
+
staleTime: u = Oe,
|
|
1519
1519
|
initialExpandedModuleIds: p,
|
|
1520
|
-
initialFilter:
|
|
1521
|
-
} = e,
|
|
1522
|
-
() =>
|
|
1520
|
+
initialFilter: f = J
|
|
1521
|
+
} = e, g = vt(), h = ge(), [I, w] = me(f), _ = R(
|
|
1522
|
+
() => Rs(h.filters, n.capabilities),
|
|
1523
1523
|
[h.filters, n.capabilities]
|
|
1524
|
-
),
|
|
1524
|
+
), y = ee(_, I), D = Xe(y), q = js({
|
|
1525
1525
|
courseId: t,
|
|
1526
1526
|
adapter: n,
|
|
1527
1527
|
mode: r,
|
|
@@ -1530,7 +1530,7 @@ function Ll(e) {
|
|
|
1530
1530
|
filter: D,
|
|
1531
1531
|
view: o,
|
|
1532
1532
|
staleTime: u
|
|
1533
|
-
}), N = q.resolvedMode, x =
|
|
1533
|
+
}), N = q.resolvedMode, x = $s({
|
|
1534
1534
|
courseId: t,
|
|
1535
1535
|
adapter: n,
|
|
1536
1536
|
pageSize: l,
|
|
@@ -1538,86 +1538,98 @@ function Ll(e) {
|
|
|
1538
1538
|
view: o,
|
|
1539
1539
|
staleTime: u,
|
|
1540
1540
|
includeItems: N === "inline",
|
|
1541
|
-
inlineItemsFirst: (
|
|
1542
|
-
inlineFirst: (
|
|
1541
|
+
inlineItemsFirst: (Y = q.inlineShape) == null ? void 0 : Y.maxItemCount,
|
|
1542
|
+
inlineFirst: (_e = q.inlineShape) == null ? void 0 : _e.moduleCount,
|
|
1543
1543
|
enabled: N !== null
|
|
1544
|
-
}), [
|
|
1544
|
+
}), [L, z] = me(
|
|
1545
1545
|
() => p ?? []
|
|
1546
|
-
),
|
|
1547
|
-
const
|
|
1548
|
-
for (const
|
|
1549
|
-
return
|
|
1550
|
-
}, [x.modules]),
|
|
1551
|
-
() =>
|
|
1552
|
-
const
|
|
1553
|
-
return
|
|
1546
|
+
), G = R(() => {
|
|
1547
|
+
const b = /* @__PURE__ */ new Map();
|
|
1548
|
+
for (const S of x.modules) b.set(S.id, S);
|
|
1549
|
+
return b;
|
|
1550
|
+
}, [x.modules]), oe = R(
|
|
1551
|
+
() => L.filter((b) => {
|
|
1552
|
+
const S = G.get(b);
|
|
1553
|
+
return S !== void 0 && S.items === void 0;
|
|
1554
1554
|
}),
|
|
1555
|
-
[
|
|
1556
|
-
),
|
|
1557
|
-
(
|
|
1555
|
+
[L, G]
|
|
1556
|
+
), Ie = R(() => new Set(oe), [oe]), be = R(() => Pn(d), [d]), ze = k(
|
|
1557
|
+
(b, S) => cn({
|
|
1558
1558
|
courseId: t,
|
|
1559
|
-
moduleId:
|
|
1559
|
+
moduleId: b,
|
|
1560
1560
|
adapter: n,
|
|
1561
1561
|
pageSize: a,
|
|
1562
1562
|
view: o,
|
|
1563
1563
|
staleTime: u,
|
|
1564
|
-
enabled:
|
|
1565
|
-
limit:
|
|
1564
|
+
enabled: S,
|
|
1565
|
+
limit: be
|
|
1566
1566
|
}),
|
|
1567
|
-
[t, n, a, o, u,
|
|
1568
|
-
),
|
|
1569
|
-
(
|
|
1570
|
-
let
|
|
1571
|
-
return
|
|
1567
|
+
[t, n, a, o, u, be]
|
|
1568
|
+
), re = Ws(oe, ze, m), se = re.fetchNextPage, Se = U(/* @__PURE__ */ new Map()), Q = k(
|
|
1569
|
+
(b) => {
|
|
1570
|
+
let S = Se.current.get(b);
|
|
1571
|
+
return S || (S = () => se(b), Se.current.set(b, S)), S;
|
|
1572
1572
|
},
|
|
1573
|
-
[
|
|
1574
|
-
),
|
|
1573
|
+
[se]
|
|
1574
|
+
), H = k((b) => {
|
|
1575
1575
|
z(
|
|
1576
|
-
(
|
|
1576
|
+
(S) => S.includes(b) ? S : [...S, b]
|
|
1577
1577
|
);
|
|
1578
|
-
}, []),
|
|
1579
|
-
(
|
|
1580
|
-
z((
|
|
1578
|
+
}, []), C = k(
|
|
1579
|
+
(b) => {
|
|
1580
|
+
z((S) => S.filter((v) => v !== b)), g.cancelQueries({ queryKey: ln(t, b) });
|
|
1581
|
+
},
|
|
1582
|
+
[g, t]
|
|
1583
|
+
), $ = U(L);
|
|
1584
|
+
$.current = L;
|
|
1585
|
+
const V = U(I);
|
|
1586
|
+
V.current = I;
|
|
1587
|
+
const F = U(null), K = k(
|
|
1588
|
+
(b) => {
|
|
1589
|
+
if (b === V.current) return;
|
|
1590
|
+
if (V.current = b, b !== J && ee(_, b) !== void 0) {
|
|
1591
|
+
F.current === null && (F.current = $.current);
|
|
1592
|
+
for (const v of $.current) C(v);
|
|
1593
|
+
} else F.current !== null && (z(F.current), $.current = F.current, F.current = null);
|
|
1594
|
+
w(b);
|
|
1581
1595
|
},
|
|
1582
|
-
[
|
|
1583
|
-
),
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
(y) => {
|
|
1587
|
-
te.current.includes(y) ? w(y) : Q(y);
|
|
1596
|
+
[_, C]
|
|
1597
|
+
), Me = k(
|
|
1598
|
+
(b) => {
|
|
1599
|
+
$.current.includes(b) ? C(b) : H(b);
|
|
1588
1600
|
},
|
|
1589
|
-
[
|
|
1590
|
-
),
|
|
1591
|
-
(
|
|
1592
|
-
var
|
|
1593
|
-
const
|
|
1594
|
-
if (
|
|
1595
|
-
return
|
|
1596
|
-
const
|
|
1597
|
-
if ((
|
|
1598
|
-
return
|
|
1599
|
-
items:
|
|
1600
|
-
pageInfo:
|
|
1601
|
+
[C, H]
|
|
1602
|
+
), ie = re.results, le = U(/* @__PURE__ */ new Map()), ye = k(
|
|
1603
|
+
(b) => {
|
|
1604
|
+
var tt;
|
|
1605
|
+
const S = G.get(b), v = ie.get(b), ae = Ie.has(b), B = le.current.get(b);
|
|
1606
|
+
if (B && B.items === (S == null ? void 0 : S.items) && B.result === v && B.active === ae)
|
|
1607
|
+
return B.value;
|
|
1608
|
+
const ue = (Ee) => (le.current.set(b, { items: S == null ? void 0 : S.items, result: v, active: ae, value: Ee }), Ee);
|
|
1609
|
+
if ((S == null ? void 0 : S.items) !== void 0)
|
|
1610
|
+
return ue({
|
|
1611
|
+
items: S.items,
|
|
1612
|
+
pageInfo: De,
|
|
1601
1613
|
hasNextPage: !1,
|
|
1602
|
-
fetchNextPage:
|
|
1614
|
+
fetchNextPage: Hs,
|
|
1603
1615
|
isLoading: !1,
|
|
1604
1616
|
isFetchingNextPage: !1,
|
|
1605
1617
|
error: null,
|
|
1606
1618
|
source: "inline"
|
|
1607
1619
|
});
|
|
1608
|
-
const
|
|
1609
|
-
return
|
|
1610
|
-
items:
|
|
1611
|
-
pageInfo:
|
|
1612
|
-
hasNextPage:
|
|
1613
|
-
fetchNextPage:
|
|
1614
|
-
isLoading: v ? v.isLoading :
|
|
1620
|
+
const j = (tt = v == null ? void 0 : v.data) == null ? void 0 : tt.pages, A = j ? j.flatMap((Ee) => Ee.items) : Qs, Te = j && j.length > 0 ? j[j.length - 1].pageInfo : De;
|
|
1621
|
+
return ue({
|
|
1622
|
+
items: A,
|
|
1623
|
+
pageInfo: Te,
|
|
1624
|
+
hasNextPage: Te.hasNextPage,
|
|
1625
|
+
fetchNextPage: Q(b),
|
|
1626
|
+
isLoading: v ? v.isLoading : ae,
|
|
1615
1627
|
isFetchingNextPage: (v == null ? void 0 : v.isFetchingNextPage) ?? !1,
|
|
1616
1628
|
error: (v == null ? void 0 : v.error) ?? null,
|
|
1617
1629
|
source: "onDemand"
|
|
1618
1630
|
});
|
|
1619
1631
|
},
|
|
1620
|
-
[
|
|
1632
|
+
[G, ie, Q, Ie]
|
|
1621
1633
|
);
|
|
1622
1634
|
return {
|
|
1623
1635
|
modules: x.modules,
|
|
@@ -1628,35 +1640,35 @@ function Ll(e) {
|
|
|
1628
1640
|
isFetchingNextPage: x.isFetchingNextPage,
|
|
1629
1641
|
error: x.error ?? q.error,
|
|
1630
1642
|
itemsMode: N,
|
|
1631
|
-
getItems:
|
|
1632
|
-
expandModule:
|
|
1633
|
-
collapseModule:
|
|
1634
|
-
toggleModule:
|
|
1635
|
-
expandedModuleIds:
|
|
1643
|
+
getItems: ye,
|
|
1644
|
+
expandModule: H,
|
|
1645
|
+
collapseModule: C,
|
|
1646
|
+
toggleModule: Me,
|
|
1647
|
+
expandedModuleIds: L,
|
|
1636
1648
|
filter: I,
|
|
1637
|
-
setFilter:
|
|
1638
|
-
filterEntry:
|
|
1639
|
-
filterPredicate:
|
|
1640
|
-
filterResultsArePartial: I !==
|
|
1649
|
+
setFilter: K,
|
|
1650
|
+
filterEntry: y,
|
|
1651
|
+
filterPredicate: We(y) ? y == null ? void 0 : y.predicate : void 0,
|
|
1652
|
+
filterResultsArePartial: I !== J && We(y) && x.hasNextPage
|
|
1641
1653
|
};
|
|
1642
1654
|
}
|
|
1643
|
-
function
|
|
1644
|
-
const r = o ?
|
|
1655
|
+
function xl(e, t, n, o) {
|
|
1656
|
+
const r = o ? he.items(t, n, o) : ln(t, n);
|
|
1645
1657
|
return e.invalidateQueries({ queryKey: r });
|
|
1646
1658
|
}
|
|
1647
|
-
function
|
|
1648
|
-
const o = n ?
|
|
1659
|
+
function Rl(e, t, n) {
|
|
1660
|
+
const o = n ? he.list(t, n) : zs(t);
|
|
1649
1661
|
return e.invalidateQueries({ queryKey: o });
|
|
1650
1662
|
}
|
|
1651
|
-
function
|
|
1652
|
-
return e.invalidateQueries({ queryKey:
|
|
1663
|
+
function Dl(e, t) {
|
|
1664
|
+
return e.invalidateQueries({ queryKey: he.course(t) });
|
|
1653
1665
|
}
|
|
1654
|
-
function
|
|
1655
|
-
const { t: o } =
|
|
1656
|
-
return /* @__PURE__ */
|
|
1657
|
-
/* @__PURE__ */ i(
|
|
1666
|
+
function Vs({ value: e, onChange: t, describedBy: n }) {
|
|
1667
|
+
const { t: o } = O(), r = ge(), s = R(() => Je(r.filters), [r.filters]), l = je();
|
|
1668
|
+
return /* @__PURE__ */ T(E, { as: "div", margin: "medium 0 0 0", children: [
|
|
1669
|
+
/* @__PURE__ */ i(E, { as: "div", margin: "0 0 x-small 0", children: /* @__PURE__ */ i(P, { size: "medium", weight: "bold", id: l, children: o("filterGroupLabel") }) }),
|
|
1658
1670
|
/* @__PURE__ */ i(
|
|
1659
|
-
|
|
1671
|
+
M,
|
|
1660
1672
|
{
|
|
1661
1673
|
gap: "space4",
|
|
1662
1674
|
wrap: "wrap",
|
|
@@ -1666,13 +1678,13 @@ function Qs({ value: e, onChange: t, describedBy: n }) {
|
|
|
1666
1678
|
"data-testid": "filter-chips",
|
|
1667
1679
|
children: s.map((a) => {
|
|
1668
1680
|
const d = a.key === e;
|
|
1669
|
-
return /* @__PURE__ */ i(
|
|
1670
|
-
|
|
1681
|
+
return /* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ i(
|
|
1682
|
+
de,
|
|
1671
1683
|
{
|
|
1672
1684
|
size: "medium",
|
|
1673
1685
|
color: d ? "primary" : "secondary",
|
|
1674
1686
|
"aria-pressed": d,
|
|
1675
|
-
"aria-describedby": a.key !==
|
|
1687
|
+
"aria-describedby": a.key !== J && We(a) ? n : void 0,
|
|
1676
1688
|
onClick: () => t(a.key),
|
|
1677
1689
|
"data-testid": `filter-chip-${a.key}`,
|
|
1678
1690
|
themeOverride: { borderRadius: "0.5rem" },
|
|
@@ -1684,31 +1696,31 @@ function Qs({ value: e, onChange: t, describedBy: n }) {
|
|
|
1684
1696
|
)
|
|
1685
1697
|
] });
|
|
1686
1698
|
}
|
|
1687
|
-
const
|
|
1699
|
+
const Ks = "#586874", Zs = "#D7DADE", dn = (e, t) => {
|
|
1688
1700
|
var n, o, r, s;
|
|
1689
1701
|
return {
|
|
1690
|
-
baseTextColor: ((o = (n = t.colors) == null ? void 0 : n.contrasts) == null ? void 0 : o.grey5782) ??
|
|
1691
|
-
baseBorderColor: ((s = (r = t.colors) == null ? void 0 : r.contrasts) == null ? void 0 : s.grey1424) ??
|
|
1702
|
+
baseTextColor: ((o = (n = t.colors) == null ? void 0 : n.contrasts) == null ? void 0 : o.grey5782) ?? Ks,
|
|
1703
|
+
baseBorderColor: ((s = (r = t.colors) == null ? void 0 : r.contrasts) == null ? void 0 : s.grey1424) ?? Zs
|
|
1692
1704
|
};
|
|
1693
|
-
},
|
|
1705
|
+
}, Xs = {
|
|
1694
1706
|
not_started: {},
|
|
1695
|
-
in_progress: { color: "info", icon: /* @__PURE__ */ i(
|
|
1696
|
-
complete: { color: "success", icon: /* @__PURE__ */ i(
|
|
1697
|
-
missing: { color: "error", icon: /* @__PURE__ */ i(
|
|
1698
|
-
incomplete: { color: "error", icon: /* @__PURE__ */ i(
|
|
1699
|
-
missing_and_incomplete: { color: "error", icon: /* @__PURE__ */ i(
|
|
1700
|
-
locked: { icon: /* @__PURE__ */ i(
|
|
1701
|
-
},
|
|
1707
|
+
in_progress: { color: "info", icon: /* @__PURE__ */ i(wt, {}) },
|
|
1708
|
+
complete: { color: "success", icon: /* @__PURE__ */ i(Le, {}) },
|
|
1709
|
+
missing: { color: "error", icon: /* @__PURE__ */ i(we, {}) },
|
|
1710
|
+
incomplete: { color: "error", icon: /* @__PURE__ */ i(we, {}) },
|
|
1711
|
+
missing_and_incomplete: { color: "error", icon: /* @__PURE__ */ i(we, {}) },
|
|
1712
|
+
locked: { icon: /* @__PURE__ */ i(Ct, {}), themeOverride: dn }
|
|
1713
|
+
}, Js = {
|
|
1702
1714
|
not_started: {},
|
|
1703
|
-
in_progress: { color: "info", icon: /* @__PURE__ */ i(
|
|
1704
|
-
complete: { color: "success", icon: /* @__PURE__ */ i(
|
|
1705
|
-
submitted: { color: "success", icon: /* @__PURE__ */ i(
|
|
1706
|
-
graded: { color: "success", icon: /* @__PURE__ */ i(
|
|
1715
|
+
in_progress: { color: "info", icon: /* @__PURE__ */ i(wt, {}) },
|
|
1716
|
+
complete: { color: "success", icon: /* @__PURE__ */ i(Le, {}) },
|
|
1717
|
+
submitted: { color: "success", icon: /* @__PURE__ */ i(Le, {}) },
|
|
1718
|
+
graded: { color: "success", icon: /* @__PURE__ */ i(Le, {}) },
|
|
1707
1719
|
excused: {},
|
|
1708
|
-
missing: { color: "error", icon: /* @__PURE__ */ i(
|
|
1709
|
-
locked: { icon: /* @__PURE__ */ i(
|
|
1720
|
+
missing: { color: "error", icon: /* @__PURE__ */ i(we, {}) },
|
|
1721
|
+
locked: { icon: /* @__PURE__ */ i(Ct, {}), themeOverride: dn }
|
|
1710
1722
|
};
|
|
1711
|
-
function
|
|
1723
|
+
function ei(e, t, n, o) {
|
|
1712
1724
|
switch (t) {
|
|
1713
1725
|
case "not_started":
|
|
1714
1726
|
return e("moduleStatusNotStarted");
|
|
@@ -1729,7 +1741,7 @@ function Xs(e, t, n, o) {
|
|
|
1729
1741
|
return e("moduleStatusLocked");
|
|
1730
1742
|
}
|
|
1731
1743
|
}
|
|
1732
|
-
function
|
|
1744
|
+
function ti(e, t) {
|
|
1733
1745
|
switch (t) {
|
|
1734
1746
|
case "not_started":
|
|
1735
1747
|
return e("itemStatusNotStarted");
|
|
@@ -1749,9 +1761,9 @@ function Js(e, t) {
|
|
|
1749
1761
|
return e("itemStatusLocked");
|
|
1750
1762
|
}
|
|
1751
1763
|
}
|
|
1752
|
-
function
|
|
1764
|
+
function mn(e, t, n) {
|
|
1753
1765
|
return /* @__PURE__ */ i(
|
|
1754
|
-
|
|
1766
|
+
An,
|
|
1755
1767
|
{
|
|
1756
1768
|
color: e.color,
|
|
1757
1769
|
renderIcon: e.icon,
|
|
@@ -1761,56 +1773,56 @@ function un(e, t, n) {
|
|
|
1761
1773
|
}
|
|
1762
1774
|
);
|
|
1763
1775
|
}
|
|
1764
|
-
function
|
|
1776
|
+
function ni({
|
|
1765
1777
|
status: e,
|
|
1766
1778
|
missingCount: t,
|
|
1767
1779
|
incompleteCount: n
|
|
1768
1780
|
}) {
|
|
1769
|
-
const { t: o } =
|
|
1770
|
-
return
|
|
1771
|
-
|
|
1772
|
-
|
|
1781
|
+
const { t: o } = O();
|
|
1782
|
+
return mn(
|
|
1783
|
+
Xs[e],
|
|
1784
|
+
ei(o, e, t, n),
|
|
1773
1785
|
"module-status-pill"
|
|
1774
1786
|
);
|
|
1775
1787
|
}
|
|
1776
|
-
function
|
|
1777
|
-
const { t } =
|
|
1778
|
-
return
|
|
1779
|
-
|
|
1780
|
-
|
|
1788
|
+
function oi({ status: e }) {
|
|
1789
|
+
const { t } = O();
|
|
1790
|
+
return mn(
|
|
1791
|
+
Js[e],
|
|
1792
|
+
ti(t, e),
|
|
1781
1793
|
"item-status-pill"
|
|
1782
1794
|
);
|
|
1783
1795
|
}
|
|
1784
|
-
const
|
|
1796
|
+
const ri = 1.75, gt = "2.75rem", si = { lineHeight: 0, display: "block" }, ii = {
|
|
1785
1797
|
display: "inline-block",
|
|
1786
1798
|
paddingLeft: "0.5rem",
|
|
1787
1799
|
marginLeft: "0.5rem"
|
|
1788
|
-
},
|
|
1789
|
-
function
|
|
1790
|
-
return e == null || typeof e == "boolean" || e === "" ? !0 : Array.isArray(e) ? e.every(
|
|
1800
|
+
}, li = "#D7DADE", ai = { fontSize: 0 };
|
|
1801
|
+
function Qe(e) {
|
|
1802
|
+
return e == null || typeof e == "boolean" || e === "" ? !0 : Array.isArray(e) ? e.every(Qe) : Tt(e) && e.type === Pt ? Qe(e.props.children) : !1;
|
|
1791
1803
|
}
|
|
1792
|
-
const
|
|
1804
|
+
const ui = {
|
|
1793
1805
|
contentVisibility: "auto",
|
|
1794
1806
|
containIntrinsicSize: "auto 3.75rem"
|
|
1795
1807
|
};
|
|
1796
|
-
function
|
|
1797
|
-
const e =
|
|
1808
|
+
function ci() {
|
|
1809
|
+
const e = qt();
|
|
1798
1810
|
return "key" in e && e.key === "canvas-high-contrast" ? "inline" : "standalone";
|
|
1799
1811
|
}
|
|
1800
|
-
function
|
|
1812
|
+
function di() {
|
|
1801
1813
|
var t, n;
|
|
1802
|
-
const e =
|
|
1803
|
-
return ("colors" in e ? (n = (t = e.colors) == null ? void 0 : t.contrasts) == null ? void 0 : n.grey1424 : void 0) ??
|
|
1814
|
+
const e = qt();
|
|
1815
|
+
return ("colors" in e ? (n = (t = e.colors) == null ? void 0 : t.contrasts) == null ? void 0 : n.grey1424 : void 0) ?? li;
|
|
1804
1816
|
}
|
|
1805
|
-
function
|
|
1817
|
+
function mi({ item: e, today: t, navigation: n }) {
|
|
1806
1818
|
var x;
|
|
1807
|
-
const { t: o, locale: r, timezone: s } =
|
|
1808
|
-
() => ({ ...
|
|
1819
|
+
const { t: o, locale: r, timezone: s } = O(), l = ci(), a = di(), d = R(
|
|
1820
|
+
() => ({ ...ii, borderLeft: `1px solid ${a}` }),
|
|
1809
1821
|
[a]
|
|
1810
|
-
), m =
|
|
1822
|
+
), m = ke(), u = ge(), p = R(() => Je(u.itemMeta), [u.itemMeta]), f = e.title || o("itemUntitled");
|
|
1811
1823
|
if (e.type === "sub_header")
|
|
1812
1824
|
return /* @__PURE__ */ i(
|
|
1813
|
-
|
|
1825
|
+
E,
|
|
1814
1826
|
{
|
|
1815
1827
|
as: "div",
|
|
1816
1828
|
padding: "x-small small",
|
|
@@ -1825,14 +1837,14 @@ function ci({ item: e, today: t, navigation: n }) {
|
|
|
1825
1837
|
letterSpacing: "expanded",
|
|
1826
1838
|
"data-testid": "module-item-title",
|
|
1827
1839
|
"data-sub-header": "true",
|
|
1828
|
-
children:
|
|
1840
|
+
children: f
|
|
1829
1841
|
}
|
|
1830
1842
|
)
|
|
1831
1843
|
}
|
|
1832
1844
|
);
|
|
1833
|
-
const
|
|
1834
|
-
return /* @__PURE__ */ i("div", { style: { marginLeft: `${e.indent *
|
|
1835
|
-
|
|
1845
|
+
const g = ((x = n == null ? void 0 : n.getItemHref) == null ? void 0 : x.call(n, e)) ?? e.url ?? null, h = e.status === "locked", I = n == null ? void 0 : n.onItemClick, w = I ? (L) => I(e, L) : void 0, _ = ee(u.itemTypes, e.type), y = _ != null && _.renderIcon ? _.renderIcon({ item: e }) : _ == null ? void 0 : _.icon, D = { item: e, t: o, today: t, locale: r, timezone: s, formatters: m, config: u }, q = p.map((L) => ({ key: L.key, node: L.render(D) })).filter((L) => !Qe(L.node)), N = q.some((L) => L.key === Ls);
|
|
1846
|
+
return /* @__PURE__ */ i("div", { style: { marginLeft: `${e.indent * ri}rem`, ...ui }, children: /* @__PURE__ */ i(
|
|
1847
|
+
E,
|
|
1836
1848
|
{
|
|
1837
1849
|
as: "div",
|
|
1838
1850
|
background: "secondary",
|
|
@@ -1840,25 +1852,25 @@ function ci({ item: e, today: t, navigation: n }) {
|
|
|
1840
1852
|
padding: "x-small small",
|
|
1841
1853
|
margin: "x-small 0 0 0",
|
|
1842
1854
|
"data-testid": `module-item-${e.id}`,
|
|
1843
|
-
children: /* @__PURE__ */
|
|
1844
|
-
e.indent > 0 ? /* @__PURE__ */ i(
|
|
1845
|
-
/* @__PURE__ */ i(
|
|
1846
|
-
|
|
1855
|
+
children: /* @__PURE__ */ T(M, { alignItems: "center", gap: "small", children: [
|
|
1856
|
+
e.indent > 0 ? /* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ i(P, { color: "secondary", children: /* @__PURE__ */ i(yn, {}) }) }) : null,
|
|
1857
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ i(
|
|
1858
|
+
E,
|
|
1847
1859
|
{
|
|
1848
1860
|
as: "div",
|
|
1849
1861
|
background: "primary",
|
|
1850
1862
|
borderWidth: "small",
|
|
1851
1863
|
borderRadius: "large",
|
|
1852
|
-
width:
|
|
1853
|
-
height:
|
|
1854
|
-
children: /* @__PURE__ */ i(
|
|
1855
|
-
/* @__PURE__ */ i("span", { style:
|
|
1856
|
-
|
|
1864
|
+
width: gt,
|
|
1865
|
+
height: gt,
|
|
1866
|
+
children: /* @__PURE__ */ i(M, { height: "100%", alignItems: "center", justifyItems: "center", children: /* @__PURE__ */ T(M.Item, { children: [
|
|
1867
|
+
/* @__PURE__ */ i("span", { style: si, "data-testid": "item-type-icon", children: y }),
|
|
1868
|
+
_ && !N ? /* @__PURE__ */ i(nt, { children: o(_.label) }) : null
|
|
1857
1869
|
] }) })
|
|
1858
1870
|
}
|
|
1859
1871
|
) }),
|
|
1860
|
-
/* @__PURE__ */
|
|
1861
|
-
/* @__PURE__ */ i(
|
|
1872
|
+
/* @__PURE__ */ T(M.Item, { shouldGrow: !0, shouldShrink: !0, children: [
|
|
1873
|
+
/* @__PURE__ */ i(E, { as: "div", children: h || !g ? /* @__PURE__ */ i(
|
|
1862
1874
|
P,
|
|
1863
1875
|
{
|
|
1864
1876
|
weight: "bold",
|
|
@@ -1866,80 +1878,80 @@ function ci({ item: e, today: t, navigation: n }) {
|
|
|
1866
1878
|
color: h ? "secondary" : "primary",
|
|
1867
1879
|
"data-testid": "module-item-title",
|
|
1868
1880
|
"data-locked": h ? "true" : void 0,
|
|
1869
|
-
children:
|
|
1881
|
+
children: f
|
|
1870
1882
|
}
|
|
1871
|
-
) : /* @__PURE__ */
|
|
1872
|
-
|
|
1883
|
+
) : /* @__PURE__ */ T(
|
|
1884
|
+
vn,
|
|
1873
1885
|
{
|
|
1874
|
-
href:
|
|
1875
|
-
onClick:
|
|
1886
|
+
href: g,
|
|
1887
|
+
onClick: w,
|
|
1876
1888
|
forceButtonRole: !1,
|
|
1877
1889
|
variant: l,
|
|
1878
1890
|
target: e.newTab ? "_blank" : void 0,
|
|
1879
1891
|
rel: e.newTab ? "noopener noreferrer" : void 0,
|
|
1880
1892
|
children: [
|
|
1881
|
-
/* @__PURE__ */ i(P, { weight: "bold", size: "small", color: "primary", "data-testid": "module-item-title", children:
|
|
1882
|
-
e.newTab ? /* @__PURE__ */ i(
|
|
1893
|
+
/* @__PURE__ */ i(P, { weight: "bold", size: "small", color: "primary", "data-testid": "module-item-title", children: f }),
|
|
1894
|
+
e.newTab ? /* @__PURE__ */ i(nt, { children: ` ${o("opensInNewWindow")}` }) : null
|
|
1883
1895
|
]
|
|
1884
1896
|
}
|
|
1885
1897
|
) }),
|
|
1886
|
-
/* @__PURE__ */ i(
|
|
1887
|
-
z > 0 ? /* @__PURE__ */ i("span", { style:
|
|
1888
|
-
/* @__PURE__ */ i("span", { style: z > 0 ? d : void 0, children:
|
|
1889
|
-
] },
|
|
1898
|
+
/* @__PURE__ */ i(E, { as: "div", children: /* @__PURE__ */ i(P, { size: "x-small", color: "secondary", "data-testid": "module-item-meta", children: q.map((L, z) => /* @__PURE__ */ T(Pt, { children: [
|
|
1899
|
+
z > 0 ? /* @__PURE__ */ i("span", { style: ai, children: " " }) : null,
|
|
1900
|
+
/* @__PURE__ */ i("span", { style: z > 0 ? d : void 0, children: L.node })
|
|
1901
|
+
] }, L.key)) }) })
|
|
1890
1902
|
] }),
|
|
1891
|
-
e.status ? /* @__PURE__ */ i(
|
|
1903
|
+
e.status ? /* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ i(oi, { status: e.status }) }) : null
|
|
1892
1904
|
] })
|
|
1893
1905
|
}
|
|
1894
1906
|
) });
|
|
1895
1907
|
}
|
|
1896
|
-
const
|
|
1897
|
-
function
|
|
1908
|
+
const pi = Et(mi), ht = "3rem";
|
|
1909
|
+
function fi({
|
|
1898
1910
|
label: e,
|
|
1899
1911
|
dimmed: t = !1
|
|
1900
1912
|
}) {
|
|
1901
1913
|
return e === null ? null : /* @__PURE__ */ i(
|
|
1902
|
-
|
|
1914
|
+
E,
|
|
1903
1915
|
{
|
|
1904
1916
|
as: "div",
|
|
1905
1917
|
display: "inline-block",
|
|
1906
1918
|
borderWidth: "small",
|
|
1907
1919
|
borderRadius: "large",
|
|
1908
1920
|
borderColor: t ? "primary" : "secondary",
|
|
1909
|
-
minWidth:
|
|
1910
|
-
height:
|
|
1921
|
+
minWidth: ht,
|
|
1922
|
+
height: ht,
|
|
1911
1923
|
padding: "0 xx-small",
|
|
1912
1924
|
"data-testid": "module-number",
|
|
1913
|
-
children: /* @__PURE__ */ i(
|
|
1925
|
+
children: /* @__PURE__ */ i(M, { height: "100%", alignItems: "center", justifyItems: "center", children: /* @__PURE__ */ i(P, { weight: "bold", size: "medium", color: t ? "secondary" : "primary", children: e }) })
|
|
1914
1926
|
}
|
|
1915
1927
|
);
|
|
1916
1928
|
}
|
|
1917
|
-
function
|
|
1929
|
+
function gi({ module: e, today: t }) {
|
|
1918
1930
|
var a;
|
|
1919
|
-
const { t: n } =
|
|
1931
|
+
const { t: n } = O(), o = ke(), r = ((a = e.progress) == null ? void 0 : a.status) === "locked", s = e.unlockAt;
|
|
1920
1932
|
let l = null;
|
|
1921
|
-
return r && s ? l = o.unlockByline(s, t) : r ? l = n("lockedByline") : !e.progress && s && (l = o.unlockByline(s, t)), l === null ? null : /* @__PURE__ */ i(
|
|
1933
|
+
return r && s ? l = o.unlockByline(s, t) : r ? l = n("lockedByline") : !e.progress && s && (l = o.unlockByline(s, t)), l === null ? null : /* @__PURE__ */ i(E, { as: "div", margin: "xxx-small 0 0 0", children: /* @__PURE__ */ i(P, { size: "small", color: "secondary", "data-testid": "module-byline", children: l }) });
|
|
1922
1934
|
}
|
|
1923
|
-
const
|
|
1935
|
+
const hi = "#273540", Ii = "#D7DADE", bi = "0.5rem", Si = (e, t) => {
|
|
1924
1936
|
var n, o, r, s, l;
|
|
1925
1937
|
return {
|
|
1926
|
-
meterColorBrand: ((o = (n = t.colors) == null ? void 0 : n.contrasts) == null ? void 0 : o.grey125125) ??
|
|
1927
|
-
borderRadius: String(((r = t.borders) == null ? void 0 : r.radiusLarge) ??
|
|
1928
|
-
borderColor: ((l = (s = t.colors) == null ? void 0 : s.contrasts) == null ? void 0 : l.grey1424) ??
|
|
1938
|
+
meterColorBrand: ((o = (n = t.colors) == null ? void 0 : n.contrasts) == null ? void 0 : o.grey125125) ?? hi,
|
|
1939
|
+
borderRadius: String(((r = t.borders) == null ? void 0 : r.radiusLarge) ?? bi),
|
|
1940
|
+
borderColor: ((l = (s = t.colors) == null ? void 0 : s.contrasts) == null ? void 0 : l.grey1424) ?? Ii,
|
|
1929
1941
|
trackBottomBorderColor: "transparent"
|
|
1930
1942
|
};
|
|
1931
|
-
},
|
|
1932
|
-
function
|
|
1943
|
+
}, Mi = "66.667%", yi = "8rem", _i = 2;
|
|
1944
|
+
function Ti({
|
|
1933
1945
|
module: e,
|
|
1934
1946
|
breakpoints: t
|
|
1935
1947
|
}) {
|
|
1936
|
-
const { t: n } =
|
|
1948
|
+
const { t: n } = O(), o = ke(), r = e.progress;
|
|
1937
1949
|
if (!r || r.status === "locked" || r.requirementCount <= 0) return null;
|
|
1938
1950
|
const s = t.mobileOnly, l = Object.keys(t).length === 0 || t.desktop === !0;
|
|
1939
|
-
return /* @__PURE__ */
|
|
1940
|
-
|
|
1951
|
+
return /* @__PURE__ */ T(
|
|
1952
|
+
M,
|
|
1941
1953
|
{
|
|
1942
|
-
width: l ?
|
|
1954
|
+
width: l ? Mi : "100%",
|
|
1943
1955
|
direction: s ? "column" : "row",
|
|
1944
1956
|
alignItems: s ? "stretch" : "center",
|
|
1945
1957
|
wrap: "wrap",
|
|
@@ -1947,8 +1959,8 @@ function yi({
|
|
|
1947
1959
|
margin: "small 0 0 0",
|
|
1948
1960
|
"data-testid": "module-progress",
|
|
1949
1961
|
children: [
|
|
1950
|
-
/* @__PURE__ */ i(
|
|
1951
|
-
|
|
1962
|
+
/* @__PURE__ */ i(M.Item, { size: s ? void 0 : yi, shouldGrow: !0, children: /* @__PURE__ */ i(
|
|
1963
|
+
Ln,
|
|
1952
1964
|
{
|
|
1953
1965
|
size: "x-small",
|
|
1954
1966
|
meterColor: "brand",
|
|
@@ -1956,16 +1968,16 @@ function yi({
|
|
|
1956
1968
|
valueMax: r.requirementCount,
|
|
1957
1969
|
shouldAnimate: !1,
|
|
1958
1970
|
screenReaderLabel: n("moduleProgressScreenReaderLabel", { name: e.name }),
|
|
1959
|
-
formatScreenReaderValue: () =>
|
|
1971
|
+
formatScreenReaderValue: () => Ts(
|
|
1960
1972
|
n,
|
|
1961
1973
|
r.percentComplete,
|
|
1962
1974
|
r.requirementsMet,
|
|
1963
1975
|
r.requirementCount
|
|
1964
1976
|
),
|
|
1965
|
-
themeOverride:
|
|
1977
|
+
themeOverride: Si
|
|
1966
1978
|
}
|
|
1967
1979
|
) }),
|
|
1968
|
-
/* @__PURE__ */ i(
|
|
1980
|
+
/* @__PURE__ */ i(M.Item, { shouldShrink: !0, "aria-hidden": "true", children: /* @__PURE__ */ i(P, { size: "small", color: "secondary", children: o.progress(
|
|
1969
1981
|
r.percentComplete,
|
|
1970
1982
|
r.requirementsMet,
|
|
1971
1983
|
r.requirementCount
|
|
@@ -1974,39 +1986,39 @@ function yi({
|
|
|
1974
1986
|
}
|
|
1975
1987
|
);
|
|
1976
1988
|
}
|
|
1977
|
-
const
|
|
1978
|
-
function
|
|
1989
|
+
const It = (e) => `platform-modules-panel-${e}`;
|
|
1990
|
+
function Ei({
|
|
1979
1991
|
module: e,
|
|
1980
1992
|
state: t,
|
|
1981
1993
|
today: n,
|
|
1982
1994
|
navigation: o,
|
|
1983
1995
|
showDiagnostics: r
|
|
1984
1996
|
}) {
|
|
1985
|
-
const { t: s } =
|
|
1986
|
-
return
|
|
1987
|
-
!d || a === 0 || l.current !== a && (l.current = a,
|
|
1997
|
+
const { t: s } = O(), l = U(null), a = t.items.length, d = !t.isLoading && !t.isFetchingNextPage;
|
|
1998
|
+
return Ae(() => {
|
|
1999
|
+
!d || a === 0 || l.current !== a && (l.current = a, At(
|
|
1988
2000
|
s("itemsLoadedAnnouncement", {
|
|
1989
2001
|
loaded: a,
|
|
1990
2002
|
count: e.itemCount,
|
|
1991
2003
|
name: e.name
|
|
1992
2004
|
})
|
|
1993
2005
|
));
|
|
1994
|
-
}, [d, a, e.itemCount, e.name, s]), t.error ? /* @__PURE__ */ i(
|
|
1995
|
-
|
|
2006
|
+
}, [d, a, e.itemCount, e.name, s]), t.error ? /* @__PURE__ */ i(E, { as: "div", margin: "small 0 0 0", children: /* @__PURE__ */ i(
|
|
2007
|
+
Rt,
|
|
1996
2008
|
{
|
|
1997
2009
|
variant: "error",
|
|
1998
2010
|
margin: "0",
|
|
1999
|
-
liveRegion:
|
|
2011
|
+
liveRegion: xt,
|
|
2000
2012
|
liveRegionPoliteness: "assertive",
|
|
2001
2013
|
"data-testid": "items-error",
|
|
2002
2014
|
children: s("itemsLoadErrorAlert", { message: t.error.message })
|
|
2003
2015
|
}
|
|
2004
|
-
) }) : t.isLoading ? /* @__PURE__ */
|
|
2005
|
-
/* @__PURE__ */ i(
|
|
2016
|
+
) }) : t.isLoading ? /* @__PURE__ */ T(E, { as: "div", margin: "small 0 0 0", "data-testid": "items-loading", children: [
|
|
2017
|
+
/* @__PURE__ */ i(Nt, { size: "x-small", renderTitle: s("itemsLoadingSpinnerLabel") }),
|
|
2006
2018
|
" ",
|
|
2007
2019
|
/* @__PURE__ */ i(P, { size: "small", color: "secondary", children: s("itemsLoadingText") })
|
|
2008
|
-
] }) : /* @__PURE__ */
|
|
2009
|
-
r ? /* @__PURE__ */
|
|
2020
|
+
] }) : /* @__PURE__ */ T(E, { as: "div", margin: "small 0 0 0", children: [
|
|
2021
|
+
r ? /* @__PURE__ */ T(P, { size: "x-small", color: "secondary", "data-testid": "items-source", children: [
|
|
2010
2022
|
"items source: ",
|
|
2011
2023
|
t.source,
|
|
2012
2024
|
" · loaded ",
|
|
@@ -2014,9 +2026,9 @@ function _i({
|
|
|
2014
2026
|
" of ",
|
|
2015
2027
|
e.itemCount
|
|
2016
2028
|
] }) : null,
|
|
2017
|
-
t.items.length === 0 ? /* @__PURE__ */ i(
|
|
2018
|
-
t.hasNextPage ? /* @__PURE__ */ i(
|
|
2019
|
-
|
|
2029
|
+
t.items.length === 0 ? /* @__PURE__ */ i(E, { as: "div", padding: "small", "data-testid": "items-empty", children: /* @__PURE__ */ i(P, { size: "small", color: "secondary", children: s("noItemsEmptyState") }) }) : /* @__PURE__ */ i("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, "data-testid": "items-list", children: t.items.map((m) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(pi, { item: m, today: n, navigation: o }) }, m.id)) }),
|
|
2030
|
+
t.hasNextPage ? /* @__PURE__ */ i(E, { as: "div", margin: "small 0 0 0", textAlign: "center", children: /* @__PURE__ */ i(
|
|
2031
|
+
de,
|
|
2020
2032
|
{
|
|
2021
2033
|
size: "small",
|
|
2022
2034
|
onClick: t.fetchNextPage,
|
|
@@ -2030,7 +2042,7 @@ function _i({
|
|
|
2030
2042
|
) }) : null
|
|
2031
2043
|
] });
|
|
2032
2044
|
}
|
|
2033
|
-
function
|
|
2045
|
+
function Pi({
|
|
2034
2046
|
module: e,
|
|
2035
2047
|
expanded: t,
|
|
2036
2048
|
onToggle: n,
|
|
@@ -2043,9 +2055,9 @@ function Ti({
|
|
|
2043
2055
|
breakpoints: m = {}
|
|
2044
2056
|
}) {
|
|
2045
2057
|
var h, I;
|
|
2046
|
-
const { t: u } =
|
|
2047
|
-
return /* @__PURE__ */
|
|
2048
|
-
|
|
2058
|
+
const { t: u } = O(), p = ke(), f = ((h = e.progress) == null ? void 0 : h.status) === "locked", g = d === void 0 ? p.moduleLabel(e.position, e) : d;
|
|
2059
|
+
return /* @__PURE__ */ T(
|
|
2060
|
+
E,
|
|
2049
2061
|
{
|
|
2050
2062
|
as: "div",
|
|
2051
2063
|
background: "primary",
|
|
@@ -2056,55 +2068,55 @@ function Ti({
|
|
|
2056
2068
|
margin: "0 0 small 0",
|
|
2057
2069
|
"data-testid": `module-card-${e.id}`,
|
|
2058
2070
|
children: [
|
|
2059
|
-
/* @__PURE__ */
|
|
2060
|
-
|
|
2061
|
-
/* @__PURE__ */
|
|
2062
|
-
/* @__PURE__ */
|
|
2071
|
+
/* @__PURE__ */ T(M, { alignItems: "start", gap: "mediumSmall", "data-testid": "module-header", children: [
|
|
2072
|
+
g !== null ? /* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ i(fi, { label: g, dimmed: f }) }) : null,
|
|
2073
|
+
/* @__PURE__ */ T(M.Item, { shouldGrow: !0, shouldShrink: !0, children: [
|
|
2074
|
+
/* @__PURE__ */ T(E, { as: "div", children: [
|
|
2063
2075
|
/* @__PURE__ */ i(
|
|
2064
|
-
|
|
2076
|
+
Dt,
|
|
2065
2077
|
{
|
|
2066
2078
|
level: a,
|
|
2067
2079
|
variant: "titleCardRegular",
|
|
2068
|
-
color:
|
|
2080
|
+
color: f ? "secondary" : "primary",
|
|
2069
2081
|
"data-testid": "module-name",
|
|
2070
|
-
children: /* @__PURE__ */ i(
|
|
2082
|
+
children: /* @__PURE__ */ i(wn, { linesAllowed: _i, children: e.name })
|
|
2071
2083
|
}
|
|
2072
2084
|
),
|
|
2073
|
-
e.published ? null : /* @__PURE__ */
|
|
2085
|
+
e.published ? null : /* @__PURE__ */ T(P, { size: "x-small", color: "secondary", children: [
|
|
2074
2086
|
" ",
|
|
2075
2087
|
u("moduleUnpublishedBadge")
|
|
2076
2088
|
] })
|
|
2077
2089
|
] }),
|
|
2078
|
-
/* @__PURE__ */ i(
|
|
2079
|
-
/* @__PURE__ */ i(
|
|
2090
|
+
/* @__PURE__ */ i(gi, { module: e, today: r }),
|
|
2091
|
+
/* @__PURE__ */ i(Ti, { module: e, breakpoints: m })
|
|
2080
2092
|
] }),
|
|
2081
|
-
/* @__PURE__ */ i(
|
|
2082
|
-
(I = e.progress) != null && I.status ? /* @__PURE__ */ i(
|
|
2083
|
-
|
|
2093
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ T(M, { alignItems: "center", gap: "mediumSmall", children: [
|
|
2094
|
+
(I = e.progress) != null && I.status ? /* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ i(
|
|
2095
|
+
ni,
|
|
2084
2096
|
{
|
|
2085
2097
|
status: e.progress.status,
|
|
2086
2098
|
missingCount: e.progress.missingCount,
|
|
2087
2099
|
incompleteCount: e.progress.incompleteCount
|
|
2088
2100
|
}
|
|
2089
2101
|
) }) : null,
|
|
2090
|
-
/* @__PURE__ */ i(
|
|
2091
|
-
|
|
2102
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ i(
|
|
2103
|
+
Cn,
|
|
2092
2104
|
{
|
|
2093
2105
|
size: "medium",
|
|
2094
2106
|
withBorder: !0,
|
|
2095
2107
|
withBackground: !1,
|
|
2096
2108
|
screenReaderLabel: t ? u("collapseModule", { name: e.name }) : u("expandModule", { name: e.name }),
|
|
2097
2109
|
"aria-expanded": t,
|
|
2098
|
-
"aria-controls":
|
|
2110
|
+
"aria-controls": It(e.id),
|
|
2099
2111
|
onClick: () => n(e.id),
|
|
2100
2112
|
"data-testid": `toggle-module-${e.id}`,
|
|
2101
|
-
children: t ? /* @__PURE__ */ i(
|
|
2113
|
+
children: t ? /* @__PURE__ */ i(_n, {}) : /* @__PURE__ */ i(Lt, {})
|
|
2102
2114
|
}
|
|
2103
2115
|
) })
|
|
2104
2116
|
] }) })
|
|
2105
2117
|
] }),
|
|
2106
|
-
/* @__PURE__ */ i("div", { id:
|
|
2107
|
-
|
|
2118
|
+
/* @__PURE__ */ i("div", { id: It(e.id), role: "group", "aria-label": e.name, hidden: !t, children: t ? /* @__PURE__ */ i(
|
|
2119
|
+
Ei,
|
|
2108
2120
|
{
|
|
2109
2121
|
module: e,
|
|
2110
2122
|
state: o,
|
|
@@ -2117,15 +2129,15 @@ function Ti({
|
|
|
2117
2129
|
}
|
|
2118
2130
|
);
|
|
2119
2131
|
}
|
|
2120
|
-
const
|
|
2121
|
-
function
|
|
2132
|
+
const Ci = Et(Pi);
|
|
2133
|
+
function wi({
|
|
2122
2134
|
counts: e,
|
|
2123
2135
|
itemsMode: t,
|
|
2124
2136
|
loadedModules: n
|
|
2125
2137
|
}) {
|
|
2126
2138
|
const o = e.listModules + e.listModuleItems;
|
|
2127
2139
|
return /* @__PURE__ */ i(
|
|
2128
|
-
|
|
2140
|
+
E,
|
|
2129
2141
|
{
|
|
2130
2142
|
as: "div",
|
|
2131
2143
|
background: "secondary",
|
|
@@ -2134,25 +2146,25 @@ function Pi({
|
|
|
2134
2146
|
padding: "x-small small",
|
|
2135
2147
|
margin: "0 0 small 0",
|
|
2136
2148
|
"data-testid": "dev-diagnostics",
|
|
2137
|
-
children: /* @__PURE__ */
|
|
2138
|
-
/* @__PURE__ */ i(
|
|
2139
|
-
/* @__PURE__ */ i(
|
|
2149
|
+
children: /* @__PURE__ */ T(M, { gap: "medium", wrap: "wrap", children: [
|
|
2150
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ i(P, { size: "x-small", weight: "bold", children: "Adapter requests" }) }),
|
|
2151
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ T(P, { size: "x-small", "data-testid": "request-count-list-modules", children: [
|
|
2140
2152
|
"listModules: ",
|
|
2141
2153
|
e.listModules
|
|
2142
2154
|
] }) }),
|
|
2143
|
-
/* @__PURE__ */ i(
|
|
2155
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ T(P, { size: "x-small", "data-testid": "request-count-list-module-items", children: [
|
|
2144
2156
|
"listModuleItems: ",
|
|
2145
2157
|
e.listModuleItems
|
|
2146
2158
|
] }) }),
|
|
2147
|
-
/* @__PURE__ */ i(
|
|
2159
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ T(P, { size: "x-small", weight: "bold", "data-testid": "request-count-total", children: [
|
|
2148
2160
|
"total: ",
|
|
2149
2161
|
o
|
|
2150
2162
|
] }) }),
|
|
2151
|
-
/* @__PURE__ */ i(
|
|
2163
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ T(P, { size: "x-small", "data-testid": "resolved-items-mode", children: [
|
|
2152
2164
|
"itemsMode: ",
|
|
2153
2165
|
t ?? "probing…"
|
|
2154
2166
|
] }) }),
|
|
2155
|
-
/* @__PURE__ */ i(
|
|
2167
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ T(P, { size: "x-small", "data-testid": "modules-loaded-count", children: [
|
|
2156
2168
|
"modules loaded: ",
|
|
2157
2169
|
n
|
|
2158
2170
|
] }) })
|
|
@@ -2160,7 +2172,7 @@ function Pi({
|
|
|
2160
2172
|
}
|
|
2161
2173
|
);
|
|
2162
2174
|
}
|
|
2163
|
-
function
|
|
2175
|
+
function Li({
|
|
2164
2176
|
data: e,
|
|
2165
2177
|
courseName: t,
|
|
2166
2178
|
courseContext: n,
|
|
@@ -2172,121 +2184,121 @@ function Ci({
|
|
|
2172
2184
|
headingLevel: d = "h2",
|
|
2173
2185
|
breakpoints: m = {}
|
|
2174
2186
|
}) {
|
|
2175
|
-
const { miniTablet: u, tablet: p, desktop:
|
|
2176
|
-
() => ({ miniTablet: u, tablet: p, desktop:
|
|
2177
|
-
[u, p,
|
|
2187
|
+
const { miniTablet: u, tablet: p, desktop: f, desktopNavOpen: g, desktopOnly: h, mobileOnly: I, ICEDesktop: w } = m, _ = R(
|
|
2188
|
+
() => ({ miniTablet: u, tablet: p, desktop: f, desktopNavOpen: g, desktopOnly: h, mobileOnly: I, ICEDesktop: w }),
|
|
2189
|
+
[u, p, f, g, h, I, w]
|
|
2178
2190
|
), {
|
|
2179
|
-
modules:
|
|
2191
|
+
modules: y,
|
|
2180
2192
|
hasNextPage: D,
|
|
2181
2193
|
fetchNextPage: q,
|
|
2182
2194
|
isFetchingNextPage: N,
|
|
2183
2195
|
isLoading: x,
|
|
2184
|
-
error:
|
|
2196
|
+
error: L,
|
|
2185
2197
|
itemsMode: z,
|
|
2186
|
-
expandedModuleIds:
|
|
2187
|
-
toggleModule:
|
|
2188
|
-
expandModule:
|
|
2189
|
-
collapseModule:
|
|
2190
|
-
getItems:
|
|
2191
|
-
filter:
|
|
2192
|
-
setFilter:
|
|
2193
|
-
filterEntry:
|
|
2194
|
-
filterPredicate:
|
|
2195
|
-
filterResultsArePartial:
|
|
2196
|
-
} = e, { t:
|
|
2197
|
-
|
|
2198
|
-
var
|
|
2199
|
-
!
|
|
2200
|
-
}, [N,
|
|
2201
|
-
const
|
|
2202
|
-
() =>
|
|
2203
|
-
(
|
|
2198
|
+
expandedModuleIds: G,
|
|
2199
|
+
toggleModule: oe,
|
|
2200
|
+
expandModule: Ie,
|
|
2201
|
+
collapseModule: be,
|
|
2202
|
+
getItems: ze,
|
|
2203
|
+
filter: re,
|
|
2204
|
+
setFilter: se,
|
|
2205
|
+
filterEntry: Se,
|
|
2206
|
+
filterPredicate: Q,
|
|
2207
|
+
filterResultsArePartial: H
|
|
2208
|
+
} = e, { t: C, locale: $, timezone: V } = O(), F = t ?? C("pageTitle"), [K, Me] = me(""), ie = U(null), le = je(), ye = je(), Y = U(!1), [_e] = me(() => /* @__PURE__ */ new Date()), b = o ?? _e;
|
|
2209
|
+
Ae(() => {
|
|
2210
|
+
var A;
|
|
2211
|
+
!Y.current || N || (Y.current = !1, At(C("modulesLoadedAnnouncement", { count: y.length })), (A = ie.current) == null || A.focus());
|
|
2212
|
+
}, [N, y.length, C]);
|
|
2213
|
+
const S = R(
|
|
2214
|
+
() => y.filter(
|
|
2215
|
+
(A) => Es(A, K, $) && (Q === void 0 || Q(A, { today: b, timezone: V }))
|
|
2204
2216
|
),
|
|
2205
|
-
[
|
|
2206
|
-
),
|
|
2207
|
-
for (const
|
|
2208
|
-
},
|
|
2209
|
-
for (const
|
|
2210
|
-
},
|
|
2211
|
-
return /* @__PURE__ */
|
|
2212
|
-
n ? /* @__PURE__ */
|
|
2217
|
+
[y, K, Q, b, $, V]
|
|
2218
|
+
), v = () => {
|
|
2219
|
+
for (const A of S) Ie(A.id);
|
|
2220
|
+
}, ae = () => {
|
|
2221
|
+
for (const A of G) be(A);
|
|
2222
|
+
}, B = K.trim() !== "" || Se !== void 0 && re !== J, ue = S.length === 0 && !x && !L, j = ue && B;
|
|
2223
|
+
return /* @__PURE__ */ T(E, { as: a, display: "block", "data-testid": "modules-list", children: [
|
|
2224
|
+
n ? /* @__PURE__ */ T(E, { as: "div", children: [
|
|
2213
2225
|
/* @__PURE__ */ i(P, { size: "small", color: "brand", children: n }),
|
|
2214
|
-
/* @__PURE__ */
|
|
2226
|
+
/* @__PURE__ */ T(P, { size: "small", color: "secondary", children: [
|
|
2215
2227
|
" ",
|
|
2216
2228
|
"/",
|
|
2217
2229
|
" "
|
|
2218
2230
|
] }),
|
|
2219
|
-
/* @__PURE__ */ i(P, { size: "small", color: "secondary", children:
|
|
2231
|
+
/* @__PURE__ */ i(P, { size: "small", color: "secondary", children: F })
|
|
2220
2232
|
] }) : null,
|
|
2221
|
-
/* @__PURE__ */ i(
|
|
2233
|
+
/* @__PURE__ */ i(Dt, { level: d, margin: "x-small 0 medium 0", children: F }),
|
|
2222
2234
|
r ? /* @__PURE__ */ i(
|
|
2223
|
-
|
|
2235
|
+
wi,
|
|
2224
2236
|
{
|
|
2225
2237
|
counts: r,
|
|
2226
2238
|
itemsMode: z,
|
|
2227
|
-
loadedModules:
|
|
2239
|
+
loadedModules: y.length
|
|
2228
2240
|
}
|
|
2229
2241
|
) : null,
|
|
2230
|
-
/* @__PURE__ */
|
|
2231
|
-
/* @__PURE__ */ i(
|
|
2232
|
-
|
|
2242
|
+
/* @__PURE__ */ T(M, { gap: "small", wrap: "wrap", alignItems: "end", children: [
|
|
2243
|
+
/* @__PURE__ */ i(M.Item, { size: "24rem", shouldShrink: !0, children: /* @__PURE__ */ i(
|
|
2244
|
+
Rn,
|
|
2233
2245
|
{
|
|
2234
|
-
renderLabel:
|
|
2235
|
-
placeholder:
|
|
2236
|
-
"aria-describedby":
|
|
2237
|
-
value:
|
|
2238
|
-
onChange: (
|
|
2239
|
-
renderBeforeInput: /* @__PURE__ */ i(
|
|
2246
|
+
renderLabel: C("moduleSearchLabel"),
|
|
2247
|
+
placeholder: C("searchPlaceholder"),
|
|
2248
|
+
"aria-describedby": le,
|
|
2249
|
+
value: K,
|
|
2250
|
+
onChange: (A, Te) => Me(Te),
|
|
2251
|
+
renderBeforeInput: /* @__PURE__ */ i(Tn, { inline: !1 }),
|
|
2240
2252
|
"data-testid": "modules-search"
|
|
2241
2253
|
}
|
|
2242
2254
|
) }),
|
|
2243
|
-
/* @__PURE__ */ i(
|
|
2244
|
-
/* @__PURE__ */ i(
|
|
2245
|
-
|
|
2255
|
+
/* @__PURE__ */ i(M.Item, { shouldGrow: !0 }),
|
|
2256
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ T(
|
|
2257
|
+
$e,
|
|
2246
2258
|
{
|
|
2247
2259
|
placement: "bottom end",
|
|
2248
|
-
trigger: /* @__PURE__ */ i(
|
|
2260
|
+
trigger: /* @__PURE__ */ i(de, { renderIcon: /* @__PURE__ */ i(Lt, {}), "data-testid": "expand-collapse-trigger", children: C("expandCollapseTrigger") }),
|
|
2249
2261
|
children: [
|
|
2250
|
-
/* @__PURE__ */ i(
|
|
2251
|
-
/* @__PURE__ */ i(
|
|
2262
|
+
/* @__PURE__ */ i($e.Item, { onSelect: v, "data-testid": "expand-all", children: C("expandAll") }),
|
|
2263
|
+
/* @__PURE__ */ i($e.Item, { onSelect: ae, "data-testid": "collapse-all", children: C("collapseAll") })
|
|
2252
2264
|
]
|
|
2253
2265
|
}
|
|
2254
2266
|
) })
|
|
2255
2267
|
] }),
|
|
2256
|
-
/* @__PURE__ */ i(
|
|
2268
|
+
/* @__PURE__ */ i(E, { as: "div", margin: "xx-small 0 0 0", children: /* @__PURE__ */ i(P, { size: "x-small", color: "secondary", id: le, children: C("searchScopeHint") }) }),
|
|
2257
2269
|
/* @__PURE__ */ i(
|
|
2258
|
-
|
|
2270
|
+
Vs,
|
|
2259
2271
|
{
|
|
2260
|
-
value:
|
|
2261
|
-
onChange:
|
|
2262
|
-
describedBy:
|
|
2272
|
+
value: re,
|
|
2273
|
+
onChange: se,
|
|
2274
|
+
describedBy: H ? ye : void 0
|
|
2263
2275
|
}
|
|
2264
2276
|
),
|
|
2265
|
-
|
|
2277
|
+
H ? /* @__PURE__ */ i(E, { as: "div", margin: "x-small 0 0 0", children: /* @__PURE__ */ i(
|
|
2266
2278
|
P,
|
|
2267
2279
|
{
|
|
2268
2280
|
size: "x-small",
|
|
2269
2281
|
color: "secondary",
|
|
2270
|
-
id:
|
|
2282
|
+
id: ye,
|
|
2271
2283
|
"data-testid": "filter-partial-hint",
|
|
2272
|
-
children:
|
|
2284
|
+
children: C("filterScopeHint")
|
|
2273
2285
|
}
|
|
2274
2286
|
) }) : null,
|
|
2275
|
-
/* @__PURE__ */
|
|
2276
|
-
|
|
2277
|
-
|
|
2287
|
+
/* @__PURE__ */ T(E, { as: "div", margin: "medium 0 0 0", children: [
|
|
2288
|
+
L ? /* @__PURE__ */ i(
|
|
2289
|
+
Rt,
|
|
2278
2290
|
{
|
|
2279
2291
|
variant: "error",
|
|
2280
2292
|
margin: "0 0 small 0",
|
|
2281
|
-
liveRegion:
|
|
2293
|
+
liveRegion: xt,
|
|
2282
2294
|
liveRegionPoliteness: "assertive",
|
|
2283
2295
|
"data-testid": "modules-error",
|
|
2284
|
-
children:
|
|
2296
|
+
children: C("modulesLoadErrorAlert", { message: L.message })
|
|
2285
2297
|
}
|
|
2286
2298
|
) : null,
|
|
2287
|
-
x ? /* @__PURE__ */ i(
|
|
2288
|
-
|
|
2289
|
-
|
|
2299
|
+
x ? /* @__PURE__ */ i(E, { as: "div", padding: "large", textAlign: "center", "data-testid": "modules-loading", children: /* @__PURE__ */ i(Nt, { renderTitle: C("modulesLoadingSpinnerLabel") }) }) : null,
|
|
2300
|
+
ue && !B ? /* @__PURE__ */ i(
|
|
2301
|
+
E,
|
|
2290
2302
|
{
|
|
2291
2303
|
as: "div",
|
|
2292
2304
|
background: "secondary",
|
|
@@ -2294,11 +2306,11 @@ function Ci({
|
|
|
2294
2306
|
padding: "large",
|
|
2295
2307
|
textAlign: "center",
|
|
2296
2308
|
"data-testid": "modules-empty",
|
|
2297
|
-
children: /* @__PURE__ */ i(P, { color: "secondary", children:
|
|
2309
|
+
children: /* @__PURE__ */ i(P, { color: "secondary", children: C("noModulesEmptyState") })
|
|
2298
2310
|
}
|
|
2299
2311
|
) : null,
|
|
2300
|
-
|
|
2301
|
-
|
|
2312
|
+
j ? /* @__PURE__ */ T(
|
|
2313
|
+
E,
|
|
2302
2314
|
{
|
|
2303
2315
|
as: "div",
|
|
2304
2316
|
background: "secondary",
|
|
@@ -2307,64 +2319,64 @@ function Ci({
|
|
|
2307
2319
|
textAlign: "center",
|
|
2308
2320
|
"data-testid": "modules-filtered-empty",
|
|
2309
2321
|
children: [
|
|
2310
|
-
/* @__PURE__ */ i(
|
|
2322
|
+
/* @__PURE__ */ i(E, { as: "div", margin: "0 0 small 0", children: /* @__PURE__ */ i(P, { color: "secondary", children: y.length === 0 ? C("noFilterMatches") : C("filteredEmptyState", { count: y.length }) }) }),
|
|
2311
2323
|
/* @__PURE__ */ i(
|
|
2312
|
-
|
|
2324
|
+
de,
|
|
2313
2325
|
{
|
|
2314
2326
|
size: "small",
|
|
2315
2327
|
onClick: () => {
|
|
2316
|
-
|
|
2328
|
+
se(J), Me(""), Y.current = !0;
|
|
2317
2329
|
},
|
|
2318
|
-
children:
|
|
2330
|
+
children: C("clearFilters")
|
|
2319
2331
|
}
|
|
2320
2332
|
)
|
|
2321
2333
|
]
|
|
2322
2334
|
}
|
|
2323
2335
|
) : null,
|
|
2324
|
-
/* @__PURE__ */ i("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, "data-testid": "modules-stack", children:
|
|
2325
|
-
|
|
2336
|
+
/* @__PURE__ */ i("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, "data-testid": "modules-stack", children: S.map((A) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
|
|
2337
|
+
Ci,
|
|
2326
2338
|
{
|
|
2327
|
-
module:
|
|
2328
|
-
expanded:
|
|
2329
|
-
onToggle:
|
|
2330
|
-
itemsState:
|
|
2331
|
-
today:
|
|
2339
|
+
module: A,
|
|
2340
|
+
expanded: G.includes(A.id),
|
|
2341
|
+
onToggle: oe,
|
|
2342
|
+
itemsState: ze(A.id),
|
|
2343
|
+
today: b,
|
|
2332
2344
|
showDiagnostics: s,
|
|
2333
2345
|
navigation: l,
|
|
2334
2346
|
headingLevel: d === "h1" ? "h2" : "h3",
|
|
2335
|
-
breakpoints:
|
|
2347
|
+
breakpoints: _
|
|
2336
2348
|
}
|
|
2337
|
-
) },
|
|
2349
|
+
) }, A.id)) })
|
|
2338
2350
|
] }),
|
|
2339
|
-
D ? /* @__PURE__ */ i(
|
|
2340
|
-
|
|
2351
|
+
D ? /* @__PURE__ */ i(E, { as: "div", textAlign: "center", margin: "small 0 0 0", children: /* @__PURE__ */ i(
|
|
2352
|
+
de,
|
|
2341
2353
|
{
|
|
2342
2354
|
color: "primary",
|
|
2343
2355
|
onClick: () => {
|
|
2344
|
-
|
|
2356
|
+
Y.current = !0, q();
|
|
2345
2357
|
},
|
|
2346
2358
|
interaction: N ? "disabled" : "enabled",
|
|
2347
2359
|
"data-testid": "load-more-modules",
|
|
2348
|
-
children: N ?
|
|
2360
|
+
children: N ? C("loadMoreModulesLoading") : C("loadMoreModules", { count: y.length })
|
|
2349
2361
|
}
|
|
2350
|
-
) }) :
|
|
2362
|
+
) }) : y.length > 0 ? /* @__PURE__ */ i(E, { as: "div", textAlign: "center", margin: "small 0 0 0", children: /* @__PURE__ */ i(
|
|
2351
2363
|
P,
|
|
2352
2364
|
{
|
|
2353
2365
|
size: "x-small",
|
|
2354
2366
|
color: "secondary",
|
|
2355
2367
|
"data-testid": "modules-all-loaded",
|
|
2356
|
-
elementRef: (
|
|
2357
|
-
|
|
2368
|
+
elementRef: (A) => {
|
|
2369
|
+
ie.current = A;
|
|
2358
2370
|
},
|
|
2359
2371
|
tabIndex: -1,
|
|
2360
|
-
children:
|
|
2372
|
+
children: C("allModulesLoaded", { count: y.length })
|
|
2361
2373
|
}
|
|
2362
2374
|
) }) : null
|
|
2363
2375
|
] });
|
|
2364
2376
|
}
|
|
2365
|
-
const
|
|
2366
|
-
|
|
2367
|
-
),
|
|
2377
|
+
const Nl = xn(
|
|
2378
|
+
Li
|
|
2379
|
+
), pe = [
|
|
2368
2380
|
"assignment",
|
|
2369
2381
|
"quiz",
|
|
2370
2382
|
"discussion",
|
|
@@ -2373,7 +2385,7 @@ const Rl = An(
|
|
|
2373
2385
|
"external_url",
|
|
2374
2386
|
"external_tool",
|
|
2375
2387
|
"sub_header"
|
|
2376
|
-
],
|
|
2388
|
+
], He = [
|
|
2377
2389
|
"not_started",
|
|
2378
2390
|
"in_progress",
|
|
2379
2391
|
"complete",
|
|
@@ -2381,17 +2393,17 @@ const Rl = An(
|
|
|
2381
2393
|
"incomplete",
|
|
2382
2394
|
"missing_and_incomplete",
|
|
2383
2395
|
"locked"
|
|
2384
|
-
],
|
|
2396
|
+
], bt = [
|
|
2385
2397
|
"must_view",
|
|
2386
2398
|
"must_submit",
|
|
2387
2399
|
"must_contribute",
|
|
2388
2400
|
"must_mark_done",
|
|
2389
2401
|
"min_score",
|
|
2390
2402
|
"min_percentage"
|
|
2391
|
-
],
|
|
2392
|
-
const n =
|
|
2403
|
+
], vi = ["assignment", "quiz", "discussion"], Ai = ["external_url", "external_tool"], xi = ["assignment", "quiz", "discussion"], Ri = Date.UTC(2025, 0, 6), Di = 864e5, ne = "1", pn = (e) => new Date(Ri + e * Di).toISOString(), Ni = (e, t) => {
|
|
2404
|
+
const n = bt[Math.floor(t / 3) % bt.length];
|
|
2393
2405
|
return n === "min_score" ? { itemId: e, type: n, minScore: 10 } : n === "min_percentage" ? { itemId: e, type: n, minPercentage: 80 } : { itemId: e, type: n };
|
|
2394
|
-
},
|
|
2406
|
+
}, qi = (e, t) => t % 3 === 0 && e !== "sub_header", Fe = (e) => He[(e - 1) % He.length], ki = (e, t) => !xi.includes(e) || e === "discussion" && Math.floor(t / pe.length) % 2 === 1 ? null : 5 + t % 4 * 5, Oi = (e, t, n, o) => {
|
|
2395
2407
|
const r = n ? "complete" : "not_started";
|
|
2396
2408
|
switch (e) {
|
|
2397
2409
|
case "locked":
|
|
@@ -2409,16 +2421,16 @@ const Rl = An(
|
|
|
2409
2421
|
case "in_progress":
|
|
2410
2422
|
return t ? o % 3 === 0 ? "submitted" : o % 3 === 1 ? "in_progress" : "not_started" : o % 2 === 0 ? r : "not_started";
|
|
2411
2423
|
}
|
|
2412
|
-
},
|
|
2424
|
+
}, Fi = /* @__PURE__ */ new Set([
|
|
2413
2425
|
"submitted",
|
|
2414
2426
|
"graded",
|
|
2415
2427
|
"excused",
|
|
2416
2428
|
"complete"
|
|
2417
|
-
]),
|
|
2429
|
+
]), Ui = (e) => e.status !== void 0 && Fi.has(e.status), zi = (e) => {
|
|
2418
2430
|
var t, n;
|
|
2419
2431
|
return ((t = e.completionRequirement) == null ? void 0 : t.type) === "min_score" || ((n = e.completionRequirement) == null ? void 0 : n.type) === "min_percentage";
|
|
2420
|
-
},
|
|
2421
|
-
const d = String(e), m =
|
|
2432
|
+
}, $i = (e, t, n, o, r, s, l, a) => {
|
|
2433
|
+
const d = String(e), m = pe[o % pe.length], u = m === "sub_header", p = vi.includes(m) && (o % 4 === 0 || r === "missing");
|
|
2422
2434
|
return {
|
|
2423
2435
|
id: n,
|
|
2424
2436
|
moduleId: d,
|
|
@@ -2427,27 +2439,27 @@ const Rl = An(
|
|
|
2427
2439
|
position: t + 1,
|
|
2428
2440
|
indent: t % 5 === 4 ? 1 : 0,
|
|
2429
2441
|
published: a === "teacher" ? o % 7 !== 0 : !0,
|
|
2430
|
-
url: u ? null : `/courses/${
|
|
2431
|
-
newTab:
|
|
2442
|
+
url: u ? null : `/courses/${ne}/modules/items/${n}`,
|
|
2443
|
+
newTab: Ai.includes(m) && o % 2 === 0,
|
|
2432
2444
|
completionRequirement: l,
|
|
2433
|
-
dueAt: p ?
|
|
2445
|
+
dueAt: p ? pn(o % 90) : null,
|
|
2434
2446
|
status: r,
|
|
2435
2447
|
pointsPossible: s,
|
|
2436
|
-
extensions:
|
|
2448
|
+
extensions: Ke(
|
|
2437
2449
|
void 0,
|
|
2438
2450
|
o % 37 === 0 ? 5 + o % 4 * 10 : null
|
|
2439
2451
|
)
|
|
2440
2452
|
};
|
|
2441
|
-
},
|
|
2442
|
-
const r =
|
|
2453
|
+
}, Bi = (e, t, n, o) => {
|
|
2454
|
+
const r = Fe(e), s = [];
|
|
2443
2455
|
let l = 0;
|
|
2444
2456
|
for (let a = 0; a < t; a += 1) {
|
|
2445
|
-
const d = n + a, m =
|
|
2446
|
-
s.push(
|
|
2457
|
+
const d = n + a, m = pe[d % pe.length], u = ki(m, d), p = u !== null, f = p ? l++ : a, g = String(e * 1e3 + a + 1), w = (r === "incomplete" || r === "missing_and_incomplete") && p && f === 0 ? { itemId: g, type: "min_score", minScore: 10 } : r === "complete" && p && f === 0 ? { itemId: g, type: "must_view" } : qi(m, d) ? Ni(g, d) : null, _ = Oi(r, p, w != null, f);
|
|
2458
|
+
s.push($i(e, a, g, d, _, u, w, o));
|
|
2447
2459
|
}
|
|
2448
2460
|
return s;
|
|
2449
|
-
},
|
|
2450
|
-
const r =
|
|
2461
|
+
}, ji = (e, t, n, o) => {
|
|
2462
|
+
const r = Fe(e);
|
|
2451
2463
|
if (r === "locked" || r === "not_started") return r;
|
|
2452
2464
|
if (t.length === 0) return "not_started";
|
|
2453
2465
|
if (!t.some((s) => s.pointsPossible != null) || r === "missing" && n === 0 || r === "incomplete" && o === 0) return "in_progress";
|
|
@@ -2457,39 +2469,39 @@ const Rl = An(
|
|
|
2457
2469
|
if (o === 0) return "missing";
|
|
2458
2470
|
}
|
|
2459
2471
|
return r;
|
|
2460
|
-
},
|
|
2472
|
+
}, Gi = (e) => {
|
|
2461
2473
|
const t = e.map((n) => n.dueAt).filter((n) => typeof n == "string").sort();
|
|
2462
2474
|
return t.length > 0 ? t[t.length - 1] : null;
|
|
2463
|
-
},
|
|
2464
|
-
const o =
|
|
2475
|
+
}, Yi = (e, t, n) => {
|
|
2476
|
+
const o = Fe(e), r = o === "incomplete" || o === "missing_and_incomplete" ? t.filter((g) => g.status === "graded" && zi(g)) : [], s = new Set(r.map((g) => g.id)), l = t.filter((g) => g.completionRequirement), a = n ?? l.length, d = l.filter((g) => !s.has(g.id)), m = Math.min(d.filter(Ui).length, a), u = t.filter((g) => g.status === "missing").length, p = s.size;
|
|
2465
2477
|
return {
|
|
2466
|
-
status:
|
|
2478
|
+
status: ji(e, t, u, p),
|
|
2467
2479
|
requirementsMet: m,
|
|
2468
2480
|
requirementCount: a,
|
|
2469
2481
|
percentComplete: a > 0 ? Math.round(m / a * 100) : 0,
|
|
2470
|
-
latestDueAt:
|
|
2482
|
+
latestDueAt: Gi(t),
|
|
2471
2483
|
missingCount: u,
|
|
2472
2484
|
incompleteCount: p
|
|
2473
2485
|
};
|
|
2474
|
-
},
|
|
2475
|
-
const o =
|
|
2486
|
+
}, Wi = (e, t, n) => {
|
|
2487
|
+
const o = Fe(e), r = e % 2 !== 0 && o !== "incomplete" && o !== "missing_and_incomplete" ? 1 : null;
|
|
2476
2488
|
return {
|
|
2477
2489
|
id: String(e),
|
|
2478
2490
|
name: `Module ${e}`,
|
|
2479
2491
|
position: e,
|
|
2480
2492
|
published: n === "teacher" ? e % 4 !== 0 : !0,
|
|
2481
2493
|
itemCount: t.length,
|
|
2482
|
-
unlockAt: e % 5 === 0 ?
|
|
2494
|
+
unlockAt: e % 5 === 0 ? pn(e) : null,
|
|
2483
2495
|
prerequisiteModules: e > 1 && e % 3 === 0 ? [{ id: String(e - 1), name: `Module ${e - 1}` }] : [],
|
|
2484
2496
|
requirementCount: r,
|
|
2485
2497
|
requireSequentialProgress: e % 6 === 0,
|
|
2486
2498
|
completionRequirements: t.flatMap(
|
|
2487
2499
|
(s) => s.completionRequirement ? [s.completionRequirement] : []
|
|
2488
2500
|
),
|
|
2489
|
-
progress:
|
|
2501
|
+
progress: Yi(e, t, r)
|
|
2490
2502
|
};
|
|
2491
2503
|
};
|
|
2492
|
-
function
|
|
2504
|
+
function Qi(e) {
|
|
2493
2505
|
return {
|
|
2494
2506
|
courseId: e.courseId,
|
|
2495
2507
|
modules: e.modules.map(({ progress: t, ...n }) => n),
|
|
@@ -2501,31 +2513,31 @@ function Yi(e) {
|
|
|
2501
2513
|
)
|
|
2502
2514
|
};
|
|
2503
2515
|
}
|
|
2504
|
-
function
|
|
2505
|
-
const n = t.view ?? "student", o = t.courseId ??
|
|
2516
|
+
function Ue(e, t = {}) {
|
|
2517
|
+
const n = t.view ?? "student", o = t.courseId ?? ne, r = [], s = {};
|
|
2506
2518
|
let l = 0;
|
|
2507
2519
|
e.forEach((d, m) => {
|
|
2508
|
-
const u = m + 1, p =
|
|
2509
|
-
l += d, r.push(
|
|
2520
|
+
const u = m + 1, p = Bi(u, d, l, n);
|
|
2521
|
+
l += d, r.push(Wi(u, p, n)), s[String(u)] = p;
|
|
2510
2522
|
});
|
|
2511
2523
|
const a = { courseId: o, modules: r, itemsByModuleId: s };
|
|
2512
|
-
return n === "teacher" ?
|
|
2524
|
+
return n === "teacher" ? Qi(a) : a;
|
|
2513
2525
|
}
|
|
2514
|
-
const
|
|
2515
|
-
function
|
|
2516
|
-
return
|
|
2526
|
+
const ce = (e) => `/courses/${ne}/modules/items/${e}`, St = "2099-08-31T06:59:00Z", Hi = "2020-01-06T07:00:00Z", Vi = He.length, Ki = 8, Zi = 120, Xi = 25, Ji = 250, Mt = 8;
|
|
2527
|
+
function ql() {
|
|
2528
|
+
return Ue(Array.from({ length: Vi }, () => Ki));
|
|
2517
2529
|
}
|
|
2518
|
-
function
|
|
2519
|
-
return
|
|
2530
|
+
function kl() {
|
|
2531
|
+
return Ue(Array.from({ length: Zi }, () => Xi));
|
|
2520
2532
|
}
|
|
2521
|
-
function
|
|
2522
|
-
return
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2533
|
+
function Ol() {
|
|
2534
|
+
return Ue([
|
|
2535
|
+
Mt,
|
|
2536
|
+
Ji,
|
|
2537
|
+
Mt
|
|
2526
2538
|
]);
|
|
2527
2539
|
}
|
|
2528
|
-
function
|
|
2540
|
+
function Fl() {
|
|
2529
2541
|
const e = (r, s, l) => ({
|
|
2530
2542
|
id: String(r),
|
|
2531
2543
|
name: s,
|
|
@@ -2544,27 +2556,27 @@ function kl() {
|
|
|
2544
2556
|
},
|
|
2545
2557
|
...l
|
|
2546
2558
|
}), t = { id: "101", name: "Week 1: Foundations" }, n = { id: "102", name: "Week 2: Derivatives" }, o = [
|
|
2547
|
-
e(1, "Locked by a future date", { unlockAt:
|
|
2559
|
+
e(1, "Locked by a future date", { unlockAt: St }),
|
|
2548
2560
|
e(2, "Locked by one prerequisite", { prerequisiteModules: [t] }),
|
|
2549
2561
|
e(3, "Locked by several prerequisites", {
|
|
2550
2562
|
prerequisiteModules: [t, n]
|
|
2551
2563
|
}),
|
|
2552
2564
|
e(4, "Locked by a date and a prerequisite", {
|
|
2553
|
-
unlockAt:
|
|
2565
|
+
unlockAt: St,
|
|
2554
2566
|
prerequisiteModules: [t]
|
|
2555
2567
|
}),
|
|
2556
|
-
e(5, "Locked, and the unlock date has passed", { unlockAt:
|
|
2568
|
+
e(5, "Locked, and the unlock date has passed", { unlockAt: Hi })
|
|
2557
2569
|
];
|
|
2558
2570
|
return {
|
|
2559
|
-
courseId:
|
|
2571
|
+
courseId: ne,
|
|
2560
2572
|
modules: o,
|
|
2561
2573
|
itemsByModuleId: Object.fromEntries(o.map((r) => [r.id, []]))
|
|
2562
2574
|
};
|
|
2563
2575
|
}
|
|
2564
|
-
function
|
|
2565
|
-
return
|
|
2576
|
+
function Ul() {
|
|
2577
|
+
return Ue([]);
|
|
2566
2578
|
}
|
|
2567
|
-
function
|
|
2579
|
+
function zl() {
|
|
2568
2580
|
const t = [
|
|
2569
2581
|
{
|
|
2570
2582
|
title: "Every fact: type, due date, points, requirement",
|
|
@@ -2593,7 +2605,7 @@ function Fl() {
|
|
|
2593
2605
|
title: "Career item carrying an estimated duration",
|
|
2594
2606
|
type: "external_tool",
|
|
2595
2607
|
completionRequirement: { itemId: "5", type: "must_view" },
|
|
2596
|
-
extensions:
|
|
2608
|
+
extensions: Ke(void 0, 45)
|
|
2597
2609
|
},
|
|
2598
2610
|
{ title: "A file, ungradeable, so no points at all", type: "file" },
|
|
2599
2611
|
{ title: "External link, opens in a new tab", type: "external_url", newTab: !0 },
|
|
@@ -2609,12 +2621,12 @@ function Fl() {
|
|
|
2609
2621
|
indent: 0,
|
|
2610
2622
|
published: !0,
|
|
2611
2623
|
newTab: !1,
|
|
2612
|
-
url:
|
|
2624
|
+
url: ce(o + 1),
|
|
2613
2625
|
status: "not_started",
|
|
2614
2626
|
...n
|
|
2615
2627
|
}));
|
|
2616
2628
|
return {
|
|
2617
|
-
courseId:
|
|
2629
|
+
courseId: ne,
|
|
2618
2630
|
modules: [
|
|
2619
2631
|
{
|
|
2620
2632
|
id: "1",
|
|
@@ -2629,13 +2641,13 @@ function Fl() {
|
|
|
2629
2641
|
itemsByModuleId: { 1: t }
|
|
2630
2642
|
};
|
|
2631
2643
|
}
|
|
2632
|
-
function
|
|
2644
|
+
function $l() {
|
|
2633
2645
|
const t = [
|
|
2634
|
-
{ title: "Reading: limits from the left and the right", type: "page", url:
|
|
2646
|
+
{ title: "Reading: limits from the left and the right", type: "page", url: ce(1) },
|
|
2635
2647
|
{
|
|
2636
2648
|
title: "Desmos: interactive limit explorer",
|
|
2637
2649
|
type: "external_url",
|
|
2638
|
-
url:
|
|
2650
|
+
url: ce(2),
|
|
2639
2651
|
newTab: !0
|
|
2640
2652
|
},
|
|
2641
2653
|
{ title: "Practice", type: "sub_header", url: null },
|
|
@@ -2643,9 +2655,9 @@ function Ul() {
|
|
|
2643
2655
|
{
|
|
2644
2656
|
title: "Utilizing Triangle Characteristics: Measuring Distances Through Angles, Elevation and the Practical Limits of Indirect Measurement in the Field",
|
|
2645
2657
|
type: "assignment",
|
|
2646
|
-
url:
|
|
2658
|
+
url: ce(5)
|
|
2647
2659
|
},
|
|
2648
|
-
{ title: "Unit test", type: "quiz", url:
|
|
2660
|
+
{ title: "Unit test", type: "quiz", url: ce(6), status: "locked" }
|
|
2649
2661
|
].map((n, o) => ({
|
|
2650
2662
|
id: String(o + 1),
|
|
2651
2663
|
moduleId: "1",
|
|
@@ -2657,7 +2669,7 @@ function Ul() {
|
|
|
2657
2669
|
...n
|
|
2658
2670
|
}));
|
|
2659
2671
|
return {
|
|
2660
|
-
courseId:
|
|
2672
|
+
courseId: ne,
|
|
2661
2673
|
modules: [
|
|
2662
2674
|
{
|
|
2663
2675
|
id: "1",
|
|
@@ -2673,92 +2685,92 @@ function Ul() {
|
|
|
2673
2685
|
};
|
|
2674
2686
|
}
|
|
2675
2687
|
export {
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2688
|
+
J as ALL_FILTER,
|
|
2689
|
+
kt as CompletionRequirementSchema,
|
|
2690
|
+
Fn as CompletionRequirementTypeSchema,
|
|
2691
|
+
rn as DEFAULT_INLINE_THRESHOLD,
|
|
2692
|
+
Us as DEFAULT_ITEM_CONCURRENCY,
|
|
2693
|
+
on as DEFAULT_ITEM_PAGE_SIZE,
|
|
2694
|
+
te as DEFAULT_LOCALE,
|
|
2695
|
+
et as DEFAULT_PAGE_SIZE,
|
|
2696
|
+
sn as DEFAULT_RETAIN_COLLAPSED_LIMIT,
|
|
2697
|
+
Oe as DEFAULT_STALE_TIME_MS,
|
|
2698
|
+
Ps as DUE_THIS_WEEK_DAYS,
|
|
2699
|
+
Ut as EXT_CAREER_ESTIMATED_DURATION_MINUTES,
|
|
2700
|
+
ne as FIXTURE_COURSE_ID,
|
|
2701
|
+
Vs as FilterChips,
|
|
2702
|
+
Dn as FilterClauseSchema,
|
|
2703
|
+
ks as FilterEntrySchema,
|
|
2704
|
+
bo as GET_MODULES,
|
|
2705
|
+
So as GET_MODULE_ITEMS,
|
|
2706
|
+
Ge as INLINE_ITEM_LIMIT,
|
|
2707
|
+
Ze as INLINE_QUERY_NODE_BUDGET,
|
|
2708
|
+
Yn as InMemoryCourseMismatchError,
|
|
2709
|
+
Ns as ItemTypeEntrySchema,
|
|
2710
|
+
qs as MetaFieldEntrySchema,
|
|
2711
|
+
Ci as ModuleCard,
|
|
2712
|
+
pi as ModuleItemRow,
|
|
2713
|
+
Ot as ModuleItemSchema,
|
|
2714
|
+
oi as ModuleItemStatusPill,
|
|
2715
|
+
kn as ModuleItemStatusSchema,
|
|
2716
|
+
qn as ModuleItemTypeSchema,
|
|
2717
|
+
jn as ModuleItemsPageSchema,
|
|
2718
|
+
fi as ModuleNumberBadge,
|
|
2719
|
+
Un as ModuleProgressSchema,
|
|
2720
|
+
$n as ModuleSchema,
|
|
2721
|
+
ni as ModuleStatusPill,
|
|
2722
|
+
On as ModuleStatusSchema,
|
|
2723
|
+
Cl as ModulesConfigProvider,
|
|
2724
|
+
Os as ModulesConfigSchema,
|
|
2725
|
+
Pl as ModulesI18nProvider,
|
|
2726
|
+
Nl as ModulesList,
|
|
2727
|
+
Bn as ModulesPageSchema,
|
|
2728
|
+
Ft as PageInfoSchema,
|
|
2729
|
+
zt as PartialCanvasResponseError,
|
|
2730
|
+
zn as PrerequisiteModuleSchema,
|
|
2731
|
+
qe as RegistryEntrySchema,
|
|
2732
|
+
Ls as TYPE_FIELD,
|
|
2733
|
+
Cs as baseFilters,
|
|
2734
|
+
Ne as baseModulesConfig,
|
|
2735
|
+
Ue as buildFixture,
|
|
2736
|
+
Ul as courseEmpty,
|
|
2737
|
+
Ol as courseFatModule,
|
|
2738
|
+
$l as courseItemLinks,
|
|
2739
|
+
zl as courseItemRowVariants,
|
|
2740
|
+
kl as courseLarge,
|
|
2741
|
+
Fl as courseLockReasons,
|
|
2742
|
+
ql as courseSmall,
|
|
2743
|
+
El as createCanvasGraphqlAdapter,
|
|
2744
|
+
Tl as createInMemoryAdapter,
|
|
2745
|
+
Zt as createTranslate,
|
|
2746
|
+
ws as defaultFormatters,
|
|
2747
|
+
ds as defaultTranslate,
|
|
2748
|
+
Xe as filterClauseOf,
|
|
2749
|
+
Gn as getEstimatedDurationMinutes,
|
|
2750
|
+
Rs as hideUnservableFilters,
|
|
2751
|
+
Dl as invalidateCourse,
|
|
2752
|
+
xl as invalidateModuleItems,
|
|
2753
|
+
Rl as invalidateModuleList,
|
|
2754
|
+
We as isPredicateServed,
|
|
2755
|
+
Z as mergeRegistry,
|
|
2756
|
+
ti as moduleItemStatusLabel,
|
|
2757
|
+
ln as moduleItemsPrefix,
|
|
2758
|
+
ei as moduleStatusLabel,
|
|
2759
|
+
he as modulesKeys,
|
|
2760
|
+
zs as modulesListPrefix,
|
|
2761
|
+
Ll as partialModulesConfig,
|
|
2762
|
+
ve as registrySchema,
|
|
2763
|
+
Fs as resolveModulesConfig,
|
|
2764
|
+
Nn as servesClause,
|
|
2765
|
+
xs as unservableFilters,
|
|
2766
|
+
wl as useFieldVisible,
|
|
2767
|
+
ke as useFormatters,
|
|
2768
|
+
vl as useModuleItems,
|
|
2769
|
+
$s as useModules,
|
|
2770
|
+
ge as useModulesConfig,
|
|
2771
|
+
O as useModulesI18n,
|
|
2772
|
+
Al as useModulesPageData,
|
|
2773
|
+
Je as visibleEntries,
|
|
2774
|
+
ee as visibleEntry,
|
|
2775
|
+
Ke as withEstimatedDurationMinutes
|
|
2764
2776
|
};
|