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