@instructure/platform-modules 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -3
- package/dist/adapters/canvasGraphql/normalize.d.ts +1 -0
- package/dist/adapters/canvasGraphql/normalize.d.ts.map +1 -1
- package/dist/adapters/canvasGraphql/queries.d.ts.map +1 -1
- package/dist/components/FilterChips.d.ts.map +1 -1
- package/dist/components/ModuleCard.d.ts +17 -5
- package/dist/components/ModuleCard.d.ts.map +1 -1
- package/dist/components/ModuleCard.stories.d.ts +12 -0
- package/dist/components/ModuleCard.stories.d.ts.map +1 -0
- package/dist/components/ModuleItemRow.d.ts +3 -1
- package/dist/components/ModuleItemRow.d.ts.map +1 -1
- package/dist/components/ModuleNumberBadge.d.ts +8 -0
- package/dist/components/ModuleNumberBadge.d.ts.map +1 -0
- package/dist/components/ModulesList.d.ts +4 -1
- package/dist/components/ModulesList.d.ts.map +1 -1
- package/dist/components/ModulesList.stories.d.ts +34 -6
- package/dist/components/ModulesList.stories.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/labels.d.ts +6 -10
- package/dist/components/labels.d.ts.map +1 -1
- package/dist/config/base.d.ts +8 -0
- package/dist/config/base.d.ts.map +1 -0
- package/dist/config/context.d.ts +11 -0
- package/dist/config/context.d.ts.map +1 -0
- package/dist/config/index.d.ts +6 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/partialModulesConfig.d.ts +4 -0
- package/dist/config/partialModulesConfig.d.ts.map +1 -0
- package/dist/config/registry.d.ts +3 -0
- package/dist/config/registry.d.ts.map +1 -1
- package/dist/config/resolve.d.ts +7 -0
- package/dist/config/resolve.d.ts.map +1 -0
- package/dist/config/schemas.d.ts +2 -0
- package/dist/config/schemas.d.ts.map +1 -1
- package/dist/config/types.d.ts +32 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/fixtures/generate.d.ts.map +1 -1
- package/dist/fixtures/index.d.ts +1 -1
- package/dist/fixtures/index.d.ts.map +1 -1
- package/dist/fixtures/scenarios.d.ts +5 -0
- package/dist/fixtures/scenarios.d.ts.map +1 -1
- package/dist/i18n.d.ts +33 -63
- package/dist/i18n.d.ts.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1130 -852
- package/dist/types/domain.d.ts +2 -0
- package/dist/types/domain.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/navigation.d.ts +13 -0
- package/dist/types/navigation.d.ts.map +1 -0
- package/dist/types/schemas.d.ts.map +1 -1
- package/locales/en.json +103 -0
- package/package.json +11 -3
package/dist/index.js
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import { z as
|
|
1
|
+
import { z as d } from "zod";
|
|
2
2
|
import { gql as ee } from "graphql-tag";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { Button as
|
|
8
|
-
import { Flex as
|
|
9
|
-
import { Text as
|
|
10
|
-
import { View as
|
|
11
|
-
import { politeAnnounce as
|
|
12
|
-
import { Alert as
|
|
13
|
-
import { Heading as
|
|
14
|
-
import { IconLockLine as
|
|
15
|
-
import { ProgressBar as
|
|
16
|
-
import { Spinner as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
3
|
+
import { jsx as o, jsxs as _ } from "react/jsx-runtime";
|
|
4
|
+
import { createContext as Be, useContext as Ge, useMemo as N, useCallback as D, useRef as $, useState as Z, useEffect as de, useId as je, memo as Ye } from "react";
|
|
5
|
+
import { useInfiniteQuery as Te, useQueryClient as We, InfiniteQueryObserver as Rt } from "@tanstack/react-query";
|
|
6
|
+
import Ft from "p-limit";
|
|
7
|
+
import { Button as X, IconButton as zt } from "@instructure/ui-buttons";
|
|
8
|
+
import { Flex as T } from "@instructure/ui-flex";
|
|
9
|
+
import { Text as b } from "@instructure/ui-text";
|
|
10
|
+
import { View as y } from "@instructure/ui-view";
|
|
11
|
+
import { politeAnnounce as Qe, getLiveRegion as He } from "@instructure/platform-instui-bindings";
|
|
12
|
+
import { Alert as Ke } from "@instructure/ui-alerts";
|
|
13
|
+
import { Heading as Ve } from "@instructure/ui-heading";
|
|
14
|
+
import { IconLockLine as Ze, IconWarningLine as Xe, IconCheckLine as me, IconClockLine as Je, IconArrowNestLine as Ut, IconEmptyLine as Ot, IconLtiLine as $t, IconLinkLine as Bt, IconAttachMediaLine as Gt, IconDocumentLine as jt, IconDiscussionLine as Yt, IconQuizLine as Wt, IconAssignmentLine as Qt, IconArrowOpenUpLine as Ht, IconArrowOpenDownLine as et, IconSearchLine as Kt } from "@instructure/ui-icons";
|
|
15
|
+
import { ProgressBar as Vt } from "@instructure/ui-progress";
|
|
16
|
+
import { Spinner as tt } from "@instructure/ui-spinner";
|
|
17
|
+
import { ScreenReaderContent as Zt } from "@instructure/ui-a11y-content";
|
|
18
|
+
import { Link as Xt } from "@instructure/ui-link";
|
|
19
|
+
import { Pill as Jt } from "@instructure/ui-pill";
|
|
20
|
+
import { Menu as Me } from "@instructure/ui-menu";
|
|
21
|
+
import { TextInput as en } from "@instructure/ui-text-input";
|
|
22
|
+
const tn = d.enum([
|
|
21
23
|
"assignment",
|
|
22
24
|
"quiz",
|
|
23
25
|
"discussion",
|
|
@@ -26,7 +28,7 @@ const jt = g.enum([
|
|
|
26
28
|
"external_url",
|
|
27
29
|
"external_tool",
|
|
28
30
|
"sub_header"
|
|
29
|
-
]),
|
|
31
|
+
]), nn = d.enum(["not_started", "in_progress", "submitted", "graded", "missing", "locked"]), sn = d.enum(["not_started", "in_progress", "all_submitted", "all_graded", "missing", "locked"]), rn = d.enum([
|
|
30
32
|
"must_view",
|
|
31
33
|
"must_mark_done",
|
|
32
34
|
"must_contribute",
|
|
@@ -34,94 +36,95 @@ const jt = g.enum([
|
|
|
34
36
|
"min_score",
|
|
35
37
|
"min_percentage",
|
|
36
38
|
"unknown"
|
|
37
|
-
]),
|
|
38
|
-
status:
|
|
39
|
-
requirementsMet:
|
|
40
|
-
requirementCount:
|
|
41
|
-
percentComplete:
|
|
42
|
-
latestDueAt:
|
|
43
|
-
missingCount:
|
|
44
|
-
}),
|
|
45
|
-
itemId:
|
|
46
|
-
type:
|
|
47
|
-
minScore:
|
|
48
|
-
minPercentage:
|
|
49
|
-
}),
|
|
50
|
-
id:
|
|
51
|
-
moduleId:
|
|
52
|
-
title:
|
|
53
|
-
type:
|
|
54
|
-
position:
|
|
55
|
-
indent:
|
|
56
|
-
published:
|
|
57
|
-
url:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
39
|
+
]), on = d.object({
|
|
40
|
+
status: sn,
|
|
41
|
+
requirementsMet: d.number(),
|
|
42
|
+
requirementCount: d.number(),
|
|
43
|
+
percentComplete: d.number().min(0).max(100),
|
|
44
|
+
latestDueAt: d.string().nullish(),
|
|
45
|
+
missingCount: d.number()
|
|
46
|
+
}), nt = d.object({
|
|
47
|
+
itemId: d.string(),
|
|
48
|
+
type: rn,
|
|
49
|
+
minScore: d.number().nullish(),
|
|
50
|
+
minPercentage: d.number().nullish()
|
|
51
|
+
}), st = d.object({
|
|
52
|
+
id: d.string(),
|
|
53
|
+
moduleId: d.string(),
|
|
54
|
+
title: d.string(),
|
|
55
|
+
type: tn,
|
|
56
|
+
position: d.number(),
|
|
57
|
+
indent: d.number(),
|
|
58
|
+
published: d.boolean(),
|
|
59
|
+
url: d.string().nullish(),
|
|
60
|
+
newTab: d.boolean().nullish(),
|
|
61
|
+
completionRequirement: nt.nullish(),
|
|
62
|
+
dueAt: d.string().nullish(),
|
|
63
|
+
status: nn.optional(),
|
|
64
|
+
pointsPossible: d.number().nullish(),
|
|
65
|
+
extensions: d.record(d.unknown()).optional()
|
|
66
|
+
}), ln = d.object({
|
|
67
|
+
id: d.string(),
|
|
68
|
+
name: d.string(),
|
|
69
|
+
position: d.number(),
|
|
70
|
+
published: d.boolean(),
|
|
71
|
+
itemCount: d.number(),
|
|
72
|
+
items: d.array(st).optional(),
|
|
73
|
+
unlockAt: d.string().nullish(),
|
|
74
|
+
prerequisiteModuleIds: d.array(d.string()),
|
|
75
|
+
requirementCount: d.number().nullish(),
|
|
76
|
+
requireSequentialProgress: d.boolean(),
|
|
77
|
+
completionRequirements: d.array(nt).optional(),
|
|
78
|
+
progress: on.optional(),
|
|
79
|
+
extensions: d.record(d.unknown()).optional()
|
|
80
|
+
}), rt = d.object({
|
|
81
|
+
hasNextPage: d.boolean(),
|
|
82
|
+
endCursor: d.string().nullable()
|
|
80
83
|
}).refine((e) => !e.hasNextPage || e.endCursor !== null, {
|
|
81
84
|
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.',
|
|
82
85
|
path: ["endCursor"]
|
|
83
|
-
}),
|
|
84
|
-
modules:
|
|
85
|
-
pageInfo:
|
|
86
|
-
}),
|
|
87
|
-
items:
|
|
88
|
-
pageInfo:
|
|
89
|
-
}),
|
|
90
|
-
function
|
|
86
|
+
}), an = d.object({
|
|
87
|
+
modules: d.array(ln),
|
|
88
|
+
pageInfo: rt
|
|
89
|
+
}), un = d.object({
|
|
90
|
+
items: d.array(st),
|
|
91
|
+
pageInfo: rt
|
|
92
|
+
}), ot = "career.estimatedDurationMinutes";
|
|
93
|
+
function cn(e) {
|
|
91
94
|
var n;
|
|
92
|
-
const t = (n = e.extensions) == null ? void 0 : n[
|
|
95
|
+
const t = (n = e.extensions) == null ? void 0 : n[ot];
|
|
93
96
|
return typeof t != "number" || !Number.isFinite(t) || t <= 0 ? null : t;
|
|
94
97
|
}
|
|
95
|
-
function
|
|
96
|
-
return t == null ? e : { ...e, [
|
|
98
|
+
function it(e, t) {
|
|
99
|
+
return t == null ? e : { ...e, [ot]: t };
|
|
97
100
|
}
|
|
98
|
-
const
|
|
99
|
-
class
|
|
101
|
+
const Se = 100, we = 2e3;
|
|
102
|
+
class dn extends Error {
|
|
100
103
|
constructor(t, n) {
|
|
101
104
|
super(
|
|
102
105
|
`This in-memory adapter was built for course ${t} but was asked for course ${n}. A fixture serves exactly one course.`
|
|
103
106
|
), this.name = "InMemoryCourseMismatchError", this.expected = t, this.received = n;
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
|
-
const
|
|
109
|
+
const mn = (e) => `offset:${e}`, gn = (e) => {
|
|
107
110
|
if (!e) return 0;
|
|
108
111
|
const t = Number.parseInt(e.replace("offset:", ""), 10);
|
|
109
112
|
return Number.isFinite(t) && t >= 0 ? t : 0;
|
|
110
|
-
},
|
|
113
|
+
}, Ce = (e) => {
|
|
111
114
|
if (e != null && e.aborted)
|
|
112
115
|
throw new DOMException("The operation was aborted.", "AbortError");
|
|
113
116
|
};
|
|
114
|
-
function
|
|
115
|
-
const s =
|
|
117
|
+
function Le(e, t, n) {
|
|
118
|
+
const s = gn(t), r = e.slice(s, s + n), i = s + r.length, u = i < e.length;
|
|
116
119
|
return {
|
|
117
120
|
slice: r,
|
|
118
|
-
pageInfo: { hasNextPage: u, endCursor: u ?
|
|
121
|
+
pageInfo: { hasNextPage: u, endCursor: u ? mn(i) : null }
|
|
119
122
|
};
|
|
120
123
|
}
|
|
121
|
-
function
|
|
124
|
+
function Qo(e, t = {}) {
|
|
122
125
|
const n = (r) => e.itemsByModuleId[r] ?? [], s = (r) => {
|
|
123
126
|
if (r !== e.courseId)
|
|
124
|
-
throw new
|
|
127
|
+
throw new dn(e.courseId, r);
|
|
125
128
|
};
|
|
126
129
|
return {
|
|
127
130
|
async listModules({
|
|
@@ -129,15 +132,15 @@ function er(e, t = {}) {
|
|
|
129
132
|
cursor: i,
|
|
130
133
|
pageSize: u,
|
|
131
134
|
includeItems: a,
|
|
132
|
-
inlineItemsFirst:
|
|
133
|
-
signal:
|
|
135
|
+
inlineItemsFirst: c,
|
|
136
|
+
signal: g
|
|
134
137
|
}) {
|
|
135
|
-
var
|
|
136
|
-
|
|
137
|
-
const { slice: l, pageInfo: m } =
|
|
138
|
-
return { modules: l.map((
|
|
139
|
-
const
|
|
140
|
-
return { ...
|
|
138
|
+
var f;
|
|
139
|
+
Ce(g), s(r), (f = t.onRequest) == null || f.call(t, "listModules", { operation: "listModules", courseId: r });
|
|
140
|
+
const { slice: l, pageInfo: m } = Le(e.modules, i, u), M = Math.min(c ?? Se, Se);
|
|
141
|
+
return { modules: l.map((h) => {
|
|
142
|
+
const P = n(h.id), C = a && P.length <= M;
|
|
143
|
+
return { ...h, itemCount: P.length, items: C ? P : void 0 };
|
|
141
144
|
}), pageInfo: m };
|
|
142
145
|
},
|
|
143
146
|
async listModuleItems({
|
|
@@ -145,16 +148,16 @@ function er(e, t = {}) {
|
|
|
145
148
|
moduleId: i,
|
|
146
149
|
cursor: u,
|
|
147
150
|
pageSize: a,
|
|
148
|
-
signal:
|
|
151
|
+
signal: c
|
|
149
152
|
}) {
|
|
150
153
|
var m;
|
|
151
|
-
|
|
152
|
-
const { slice:
|
|
153
|
-
return { items:
|
|
154
|
+
Ce(c), s(r), (m = t.onRequest) == null || m.call(t, "listModuleItems", { operation: "listModuleItems", courseId: r, moduleId: i });
|
|
155
|
+
const { slice: g, pageInfo: l } = Le(n(i), u, a);
|
|
156
|
+
return { items: g, pageInfo: l };
|
|
154
157
|
}
|
|
155
158
|
};
|
|
156
159
|
}
|
|
157
|
-
class
|
|
160
|
+
class lt extends Error {
|
|
158
161
|
constructor(t, n, s) {
|
|
159
162
|
const r = t === "module" ? "module" : "module item";
|
|
160
163
|
super(
|
|
@@ -162,11 +165,11 @@ class Je extends Error {
|
|
|
162
165
|
), this.name = "PartialCanvasResponseError", this.subject = t, this.id = n, this.field = s;
|
|
163
166
|
}
|
|
164
167
|
}
|
|
165
|
-
function
|
|
168
|
+
function at(e, t, n) {
|
|
166
169
|
if (e != null) return e;
|
|
167
|
-
throw new
|
|
170
|
+
throw new lt(t, n, "published");
|
|
168
171
|
}
|
|
169
|
-
function
|
|
172
|
+
function fn(e, t) {
|
|
170
173
|
if (e.onUnsupportedItem) {
|
|
171
174
|
e.onUnsupportedItem(t);
|
|
172
175
|
return;
|
|
@@ -175,7 +178,7 @@ function rn(e, t) {
|
|
|
175
178
|
`[platform-modules] dropped module item ${t.id}: content type "${t.typename ?? "null"}" is outside the closed ModuleItemType enum. Pass \`onUnsupportedItem\` to handle these yourself.`
|
|
176
179
|
);
|
|
177
180
|
}
|
|
178
|
-
const
|
|
181
|
+
const hn = {
|
|
179
182
|
Assignment: "assignment",
|
|
180
183
|
Quiz: "quiz",
|
|
181
184
|
Discussion: "discussion",
|
|
@@ -193,21 +196,21 @@ const on = {
|
|
|
193
196
|
// for no better reason than not being listed.
|
|
194
197
|
PeerReviewSubAssignment: "assignment"
|
|
195
198
|
};
|
|
196
|
-
function
|
|
199
|
+
function pn(e) {
|
|
197
200
|
const t = e == null ? void 0 : e.__typename;
|
|
198
201
|
if (!t) return null;
|
|
199
|
-
const n =
|
|
202
|
+
const n = hn[t];
|
|
200
203
|
return n ? n === "assignment" && (e == null ? void 0 : e.isNewQuiz) === !0 ? "quiz" : n : null;
|
|
201
204
|
}
|
|
202
|
-
const
|
|
203
|
-
function
|
|
205
|
+
const In = /^P(?!$)(?:(\d+(?:\.\d+)?)W)?(?:(\d+(?:\.\d+)?)D)?(?:T(?!$)(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?)?$/;
|
|
206
|
+
function bn(e) {
|
|
204
207
|
if (!e) return null;
|
|
205
|
-
const t =
|
|
208
|
+
const t = In.exec(e);
|
|
206
209
|
if (!t) return null;
|
|
207
210
|
const [, n, s, r, i, u] = t, a = Number(n ?? 0) * 7 * 24 * 60 + Number(s ?? 0) * 24 * 60 + Number(r ?? 0) * 60 + Number(i ?? 0) + Number(u ?? 0) / 60;
|
|
208
211
|
return Math.round(a);
|
|
209
212
|
}
|
|
210
|
-
const
|
|
213
|
+
const Mn = /* @__PURE__ */ new Set([
|
|
211
214
|
"must_view",
|
|
212
215
|
"must_mark_done",
|
|
213
216
|
"must_contribute",
|
|
@@ -215,31 +218,31 @@ const dn = /* @__PURE__ */ new Set([
|
|
|
215
218
|
"min_score",
|
|
216
219
|
"min_percentage"
|
|
217
220
|
]);
|
|
218
|
-
function
|
|
219
|
-
return
|
|
221
|
+
function Sn(e) {
|
|
222
|
+
return Mn.has(e) ? e : "unknown";
|
|
220
223
|
}
|
|
221
|
-
function
|
|
224
|
+
function yn(e) {
|
|
222
225
|
return {
|
|
223
226
|
itemId: String(e.id),
|
|
224
|
-
type:
|
|
227
|
+
type: Sn(e.type),
|
|
225
228
|
minScore: e.minScore ?? null,
|
|
226
229
|
minPercentage: e.minPercentage ?? null
|
|
227
230
|
};
|
|
228
231
|
}
|
|
229
|
-
function
|
|
232
|
+
function ut(e) {
|
|
230
233
|
return {
|
|
231
234
|
hasNextPage: (e == null ? void 0 : e.hasNextPage) ?? !1,
|
|
232
235
|
endCursor: (e == null ? void 0 : e.endCursor) ?? null
|
|
233
236
|
};
|
|
234
237
|
}
|
|
235
|
-
const
|
|
236
|
-
function
|
|
238
|
+
const _n = /* @__PURE__ */ new Set(["graded"]), Tn = /* @__PURE__ */ new Set(["submitted", "pending_review"]), wn = /* @__PURE__ */ new Set(["graded", "excused"]);
|
|
239
|
+
function ct(e) {
|
|
237
240
|
var t;
|
|
238
241
|
for (const n of ((t = e == null ? void 0 : e.submissionsConnection) == null ? void 0 : t.nodes) ?? [])
|
|
239
242
|
if (n) return n;
|
|
240
243
|
return null;
|
|
241
244
|
}
|
|
242
|
-
function
|
|
245
|
+
function dt(e, t) {
|
|
243
246
|
if (!e) return;
|
|
244
247
|
const n = new Map(t.map((r) => [r.itemId, r.type])), s = /* @__PURE__ */ new Set();
|
|
245
248
|
for (const r of e.requirementsMet ?? []) {
|
|
@@ -255,48 +258,48 @@ function st(e, t) {
|
|
|
255
258
|
requirementsMetItemIds: s
|
|
256
259
|
};
|
|
257
260
|
}
|
|
258
|
-
function
|
|
261
|
+
function Pn(e, t, n) {
|
|
259
262
|
if (n.locked) return "locked";
|
|
260
|
-
const s =
|
|
263
|
+
const s = ct(e);
|
|
261
264
|
if (s) {
|
|
262
265
|
if (s.missing === !0) return "missing";
|
|
263
|
-
if (
|
|
266
|
+
if (_n.has(s.state ?? "") || wn.has(s.gradingStatus ?? ""))
|
|
264
267
|
return "graded";
|
|
265
|
-
if (s.submittedAt != null ||
|
|
268
|
+
if (s.submittedAt != null || Tn.has(s.state ?? ""))
|
|
266
269
|
return "submitted";
|
|
267
270
|
if ((s.attempt ?? 0) > 0) return "in_progress";
|
|
268
271
|
}
|
|
269
272
|
return n.requirementsMetItemIds.has(t) ? "in_progress" : "not_started";
|
|
270
273
|
}
|
|
271
|
-
const
|
|
272
|
-
function
|
|
274
|
+
const En = (e) => e.pointsPossible != null;
|
|
275
|
+
function xn(e, t, n, s) {
|
|
273
276
|
if (e.locked) return "locked";
|
|
274
277
|
if (t > 0 && !e.completed) return "missing";
|
|
275
278
|
if (e.completed) {
|
|
276
|
-
const r = (s ?? []).filter(
|
|
279
|
+
const r = (s ?? []).filter(En);
|
|
277
280
|
return r.length > 0 && r.every((u) => u.status === "graded") ? "all_graded" : "all_submitted";
|
|
278
281
|
}
|
|
279
282
|
return e.started || n > 0 ? "in_progress" : "not_started";
|
|
280
283
|
}
|
|
281
|
-
function
|
|
282
|
-
var a,
|
|
284
|
+
function Cn(e, t, n, s) {
|
|
285
|
+
var a, c;
|
|
283
286
|
if (!n) return;
|
|
284
287
|
const r = e.requirementCount ?? t.length, i = Math.min(n.requirementsMetItemIds.size, r), u = ((a = e.submissionStatistics) == null ? void 0 : a.missingAssignmentCount) ?? 0;
|
|
285
288
|
return {
|
|
286
|
-
status:
|
|
289
|
+
status: xn(n, u, i, s),
|
|
287
290
|
requirementsMet: i,
|
|
288
291
|
requirementCount: r,
|
|
289
292
|
percentComplete: r > 0 ? Math.round(i / r * 100) : 0,
|
|
290
|
-
latestDueAt: ((
|
|
293
|
+
latestDueAt: ((c = e.submissionStatistics) == null ? void 0 : c.latestDueAt) ?? null,
|
|
291
294
|
missingCount: u
|
|
292
295
|
};
|
|
293
296
|
}
|
|
294
|
-
function
|
|
295
|
-
var
|
|
296
|
-
const i = String(e._id), u =
|
|
297
|
+
function Ln(e, t, n, s = {}, r) {
|
|
298
|
+
var c, g, l;
|
|
299
|
+
const i = String(e._id), u = pn(e.content);
|
|
297
300
|
if (!u)
|
|
298
|
-
return
|
|
299
|
-
const a =
|
|
301
|
+
return fn(s, { id: i, typename: ((c = e.content) == null ? void 0 : c.__typename) ?? null }), null;
|
|
302
|
+
const a = ct(e.content);
|
|
300
303
|
return {
|
|
301
304
|
id: i,
|
|
302
305
|
moduleId: t,
|
|
@@ -304,25 +307,26 @@ function _n(e, t, n, s = {}, r) {
|
|
|
304
307
|
type: u,
|
|
305
308
|
position: e.position ?? 0,
|
|
306
309
|
indent: e.indent ?? 0,
|
|
307
|
-
published:
|
|
310
|
+
published: at(e.published, "moduleItem", i),
|
|
308
311
|
url: e.url ?? null,
|
|
312
|
+
newTab: e.newTab ?? !1,
|
|
309
313
|
completionRequirement: n.get(i) ?? null,
|
|
310
|
-
dueAt: (a == null ? void 0 : a.cachedDueDate) ?? ((
|
|
311
|
-
status: r ?
|
|
314
|
+
dueAt: (a == null ? void 0 : a.cachedDueDate) ?? ((g = e.content) == null ? void 0 : g.dueAt) ?? null,
|
|
315
|
+
status: r ? Pn(e.content, i, r) : void 0,
|
|
312
316
|
pointsPossible: ((l = e.content) == null ? void 0 : l.pointsPossible) ?? null,
|
|
313
317
|
// Career-only, so it rides in `extensions` rather than widening the shared
|
|
314
318
|
// model. Absent entirely for a Canvas LMS item, which is every item here.
|
|
315
|
-
extensions:
|
|
319
|
+
extensions: it(
|
|
316
320
|
void 0,
|
|
317
|
-
|
|
321
|
+
bn(e.estimatedDuration)
|
|
318
322
|
)
|
|
319
323
|
};
|
|
320
324
|
}
|
|
321
|
-
function
|
|
325
|
+
function mt(e, t, n, s, r) {
|
|
322
326
|
const i = [];
|
|
323
327
|
for (const u of e ?? []) {
|
|
324
328
|
if (!u) continue;
|
|
325
|
-
const a =
|
|
329
|
+
const a = Ln(
|
|
326
330
|
u,
|
|
327
331
|
t,
|
|
328
332
|
n,
|
|
@@ -333,52 +337,52 @@ function rt(e, t, n, s, r) {
|
|
|
333
337
|
}
|
|
334
338
|
return i;
|
|
335
339
|
}
|
|
336
|
-
function
|
|
340
|
+
function gt(e) {
|
|
337
341
|
const t = [], n = /* @__PURE__ */ new Map();
|
|
338
342
|
for (const s of e ?? []) {
|
|
339
343
|
if (!s) continue;
|
|
340
|
-
const r =
|
|
344
|
+
const r = yn(s);
|
|
341
345
|
t.push(r), n.set(r.itemId, r);
|
|
342
346
|
}
|
|
343
347
|
return { list: t, byItemId: n };
|
|
344
348
|
}
|
|
345
|
-
function
|
|
346
|
-
var
|
|
349
|
+
function An(e, t = {}) {
|
|
350
|
+
var g;
|
|
347
351
|
const n = String(e._id);
|
|
348
352
|
if (e.moduleItemsTotalCount == null)
|
|
349
|
-
throw new
|
|
350
|
-
const { list: s, byItemId: r } =
|
|
353
|
+
throw new lt("module", n, "moduleItemsTotalCount");
|
|
354
|
+
const { list: s, byItemId: r } = gt(e.completionRequirements), i = e.moduleItemsConnection, u = i != null && !((g = i.pageInfo) != null && g.hasNextPage), a = dt(e.progression, s), c = u ? mt(i.nodes, n, r, t, a) : void 0;
|
|
351
355
|
return {
|
|
352
356
|
id: n,
|
|
353
357
|
name: e.name ?? "",
|
|
354
358
|
position: e.position ?? 0,
|
|
355
|
-
published:
|
|
359
|
+
published: at(e.published, "module", n),
|
|
356
360
|
itemCount: e.moduleItemsTotalCount,
|
|
357
|
-
items:
|
|
361
|
+
items: c,
|
|
358
362
|
unlockAt: e.unlockAt ?? null,
|
|
359
363
|
prerequisiteModuleIds: (e.prerequisites ?? []).filter((l) => l != null).map((l) => String(l.id)),
|
|
360
364
|
requirementCount: e.requirementCount ?? null,
|
|
361
365
|
requireSequentialProgress: e.requireSequentialProgress ?? !1,
|
|
362
366
|
completionRequirements: s,
|
|
363
367
|
// Derived after the items so `all_graded` can see them when they are inline.
|
|
364
|
-
progress:
|
|
368
|
+
progress: Cn(e, s, a, c)
|
|
365
369
|
};
|
|
366
370
|
}
|
|
367
|
-
function
|
|
371
|
+
function vn(e, t = {}) {
|
|
368
372
|
var r;
|
|
369
373
|
const n = (r = e == null ? void 0 : e.legacyNode) == null ? void 0 : r.modulesConnection, s = [];
|
|
370
374
|
for (const i of (n == null ? void 0 : n.nodes) ?? [])
|
|
371
|
-
i && s.push(
|
|
372
|
-
return { modules: s, pageInfo:
|
|
375
|
+
i && s.push(An(i, t));
|
|
376
|
+
return { modules: s, pageInfo: ut(n == null ? void 0 : n.pageInfo) };
|
|
373
377
|
}
|
|
374
|
-
function
|
|
375
|
-
const s = e == null ? void 0 : e.legacyNode, { list: r, byItemId: i } =
|
|
378
|
+
function Nn(e, t, n = {}) {
|
|
379
|
+
const s = e == null ? void 0 : e.legacyNode, { list: r, byItemId: i } = gt(s == null ? void 0 : s.completionRequirements), u = s == null ? void 0 : s.moduleItemsConnection, a = dt(s == null ? void 0 : s.progression, r);
|
|
376
380
|
return {
|
|
377
|
-
items:
|
|
378
|
-
pageInfo:
|
|
381
|
+
items: mt(u == null ? void 0 : u.nodes, t, i, n, a),
|
|
382
|
+
pageInfo: ut(u == null ? void 0 : u.pageInfo)
|
|
379
383
|
};
|
|
380
384
|
}
|
|
381
|
-
const
|
|
385
|
+
const Dn = ee`
|
|
382
386
|
fragment PlatformModulesSubmissionFields on Submission {
|
|
383
387
|
_id
|
|
384
388
|
state
|
|
@@ -388,11 +392,12 @@ const xn = ee`
|
|
|
388
392
|
missing
|
|
389
393
|
cachedDueDate
|
|
390
394
|
}
|
|
391
|
-
`,
|
|
395
|
+
`, ft = ee`
|
|
392
396
|
fragment PlatformModulesItemFields on ModuleItem {
|
|
393
397
|
_id
|
|
394
398
|
title
|
|
395
399
|
url
|
|
400
|
+
newTab
|
|
396
401
|
position
|
|
397
402
|
indent
|
|
398
403
|
published
|
|
@@ -434,8 +439,8 @@ const xn = ee`
|
|
|
434
439
|
}
|
|
435
440
|
}
|
|
436
441
|
}
|
|
437
|
-
${
|
|
438
|
-
`,
|
|
442
|
+
${Dn}
|
|
443
|
+
`, ht = ee`
|
|
439
444
|
fragment PlatformModulesProgressionFields on ModuleProgression {
|
|
440
445
|
workflowState
|
|
441
446
|
completed
|
|
@@ -448,7 +453,7 @@ const xn = ee`
|
|
|
448
453
|
minPercentage
|
|
449
454
|
}
|
|
450
455
|
}
|
|
451
|
-
`,
|
|
456
|
+
`, kn = ee`
|
|
452
457
|
query PlatformModulesGetModules(
|
|
453
458
|
$courseId: ID!
|
|
454
459
|
$first: Int!
|
|
@@ -504,9 +509,9 @@ const xn = ee`
|
|
|
504
509
|
}
|
|
505
510
|
}
|
|
506
511
|
}
|
|
507
|
-
${
|
|
508
|
-
${
|
|
509
|
-
`,
|
|
512
|
+
${ft}
|
|
513
|
+
${ht}
|
|
514
|
+
`, qn = ee`
|
|
510
515
|
query PlatformModulesGetModuleItems(
|
|
511
516
|
$moduleId: ID!
|
|
512
517
|
$first: Int!
|
|
@@ -537,25 +542,25 @@ const xn = ee`
|
|
|
537
542
|
}
|
|
538
543
|
}
|
|
539
544
|
}
|
|
540
|
-
${
|
|
541
|
-
${
|
|
545
|
+
${ft}
|
|
546
|
+
${ht}
|
|
542
547
|
`;
|
|
543
|
-
function
|
|
548
|
+
function pt() {
|
|
544
549
|
return new DOMException("The operation was aborted.", "AbortError");
|
|
545
550
|
}
|
|
546
|
-
function
|
|
547
|
-
if (e != null && e.aborted) throw
|
|
551
|
+
function ue(e) {
|
|
552
|
+
if (e != null && e.aborted) throw pt();
|
|
548
553
|
}
|
|
549
|
-
function
|
|
554
|
+
function Ae(e, t) {
|
|
550
555
|
return t ? new Promise((n, s) => {
|
|
551
|
-
const r = () => s(
|
|
556
|
+
const r = () => s(pt());
|
|
552
557
|
t.addEventListener("abort", r, { once: !0 }), e.then(n, s).finally(() => t.removeEventListener("abort", r));
|
|
553
558
|
}) : e;
|
|
554
559
|
}
|
|
555
|
-
function
|
|
560
|
+
function Ho({
|
|
556
561
|
executeQuery: e,
|
|
557
|
-
inlineItemLimit: t =
|
|
558
|
-
nodeBudget: n =
|
|
562
|
+
inlineItemLimit: t = Se,
|
|
563
|
+
nodeBudget: n = we,
|
|
559
564
|
onUnsupportedItem: s,
|
|
560
565
|
studentId: r,
|
|
561
566
|
validate: i = !0
|
|
@@ -566,71 +571,148 @@ function tr({
|
|
|
566
571
|
// limit rather than assuming one. @see ModulesDataAdapter.inlineNodeBudget
|
|
567
572
|
inlineNodeBudget: n,
|
|
568
573
|
async listModules({
|
|
569
|
-
courseId:
|
|
570
|
-
cursor:
|
|
574
|
+
courseId: c,
|
|
575
|
+
cursor: g,
|
|
571
576
|
pageSize: l,
|
|
572
577
|
includeItems: m,
|
|
573
578
|
inlineItemsFirst: M,
|
|
574
|
-
inlineFirst:
|
|
575
|
-
signal:
|
|
579
|
+
inlineFirst: p,
|
|
580
|
+
signal: f
|
|
576
581
|
}) {
|
|
577
|
-
|
|
578
|
-
const
|
|
579
|
-
e(
|
|
580
|
-
courseId:
|
|
581
|
-
first:
|
|
582
|
+
ue(f);
|
|
583
|
+
const h = m ? Math.min(p ?? l, l) : l, P = Math.min(M ?? t, t), C = Math.max(1, Math.min(P, Math.floor(n / h))), v = await Ae(
|
|
584
|
+
e(kn, {
|
|
585
|
+
courseId: c,
|
|
586
|
+
first: h,
|
|
582
587
|
// Pass through what the caller was given; never derive an offset.
|
|
583
|
-
after:
|
|
588
|
+
after: g ?? null,
|
|
584
589
|
includeItems: m,
|
|
585
|
-
itemsFirst:
|
|
590
|
+
itemsFirst: C,
|
|
586
591
|
includeSubmissions: a,
|
|
587
592
|
studentId: r ?? null
|
|
588
593
|
}),
|
|
589
|
-
|
|
594
|
+
f
|
|
590
595
|
);
|
|
591
|
-
|
|
592
|
-
const
|
|
593
|
-
return i ?
|
|
596
|
+
ue(f);
|
|
597
|
+
const A = vn(v, u);
|
|
598
|
+
return i ? an.parse(A) : A;
|
|
594
599
|
},
|
|
595
600
|
async listModuleItems({
|
|
596
|
-
moduleId:
|
|
597
|
-
cursor:
|
|
601
|
+
moduleId: c,
|
|
602
|
+
cursor: g,
|
|
598
603
|
pageSize: l,
|
|
599
604
|
signal: m
|
|
600
605
|
}) {
|
|
601
|
-
|
|
602
|
-
const M = await
|
|
603
|
-
e(
|
|
604
|
-
moduleId:
|
|
606
|
+
ue(m);
|
|
607
|
+
const M = await Ae(
|
|
608
|
+
e(qn, {
|
|
609
|
+
moduleId: c,
|
|
605
610
|
first: l,
|
|
606
|
-
after:
|
|
611
|
+
after: g ?? null,
|
|
607
612
|
includeSubmissions: a,
|
|
608
613
|
studentId: r ?? null
|
|
609
614
|
}),
|
|
610
615
|
m
|
|
611
616
|
);
|
|
612
|
-
|
|
613
|
-
const
|
|
614
|
-
return i ?
|
|
617
|
+
ue(m);
|
|
618
|
+
const p = Nn(M, c, u);
|
|
619
|
+
return i ? un.parse(p) : p;
|
|
615
620
|
}
|
|
616
621
|
};
|
|
617
622
|
}
|
|
618
|
-
const
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
+
const he = {
|
|
624
|
+
formatters: {},
|
|
625
|
+
itemTypes: {},
|
|
626
|
+
itemStatuses: {},
|
|
627
|
+
itemMeta: {},
|
|
628
|
+
filters: {},
|
|
629
|
+
moduleActions: {},
|
|
630
|
+
itemActions: {},
|
|
631
|
+
navigation: {}
|
|
623
632
|
};
|
|
624
|
-
|
|
625
|
-
|
|
633
|
+
Object.freeze(he);
|
|
634
|
+
for (const e of Object.values(he))
|
|
635
|
+
Object.freeze(e);
|
|
636
|
+
const It = Be(null);
|
|
637
|
+
function Ko({ value: e, children: t }) {
|
|
638
|
+
return /* @__PURE__ */ o(It.Provider, { value: e, children: t });
|
|
639
|
+
}
|
|
640
|
+
function Vo() {
|
|
641
|
+
return Ge(It) ?? he;
|
|
642
|
+
}
|
|
643
|
+
const ye = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
|
|
644
|
+
function ge(e, t) {
|
|
645
|
+
const n = Object.entries(t ?? {}).filter(([, s]) => s !== void 0);
|
|
646
|
+
return { ...e, ...Object.fromEntries(n) };
|
|
647
|
+
}
|
|
648
|
+
function Y(e, t = {}) {
|
|
649
|
+
const n = Object.keys(e).map((r) => [
|
|
650
|
+
r,
|
|
651
|
+
ge(e[r], ye(t, r) ? t[r] : void 0)
|
|
652
|
+
]), s = Object.keys(t).filter((r) => !ye(e, r)).sort().map((r) => [r, ge({}, t[r])]);
|
|
653
|
+
return Object.fromEntries([...n, ...s]);
|
|
654
|
+
}
|
|
655
|
+
function Zo(e) {
|
|
656
|
+
return Object.keys(e).filter((t) => !e[t].hidden).map((t) => ({ ...e[t], key: t })).sort((t, n) => t.order - n.order);
|
|
657
|
+
}
|
|
658
|
+
const Rn = d.object({
|
|
659
|
+
/** Resolved through `t` at render. */
|
|
660
|
+
label: d.string(),
|
|
661
|
+
/** Sort position, ascending. The base spaces its values (10, 20, 30…) so a host can insert between two built-ins. */
|
|
662
|
+
order: d.number(),
|
|
663
|
+
/** How a host removes an entry. Stays in the resolved registry; `visibleEntries` filters it at read time. */
|
|
664
|
+
hidden: d.boolean().optional()
|
|
665
|
+
});
|
|
666
|
+
function Fn(e) {
|
|
667
|
+
return d.record(d.string(), e);
|
|
668
|
+
}
|
|
669
|
+
const W = Fn(Rn.strict()), zn = d.object({
|
|
670
|
+
formatters: d.object({}).strict(),
|
|
671
|
+
itemTypes: W,
|
|
672
|
+
itemStatuses: W,
|
|
673
|
+
itemMeta: W,
|
|
674
|
+
filters: W,
|
|
675
|
+
moduleActions: W,
|
|
676
|
+
itemActions: W,
|
|
677
|
+
navigation: d.object({}).strict()
|
|
678
|
+
});
|
|
679
|
+
function Un(e, t = {}) {
|
|
680
|
+
const n = Object.keys(t).filter((r) => !ye(e, r));
|
|
681
|
+
if (n.length > 0)
|
|
682
|
+
throw new Error(
|
|
683
|
+
`Unknown modules config key(s): ${n.join(", ")}. Known keys are ${Object.keys(e).join(", ")}.`
|
|
684
|
+
);
|
|
685
|
+
const s = {
|
|
686
|
+
formatters: ge(e.formatters, t.formatters),
|
|
687
|
+
itemTypes: Y(e.itemTypes, t.itemTypes),
|
|
688
|
+
itemStatuses: Y(e.itemStatuses, t.itemStatuses),
|
|
689
|
+
itemMeta: Y(e.itemMeta, t.itemMeta),
|
|
690
|
+
filters: Y(e.filters, t.filters),
|
|
691
|
+
moduleActions: Y(e.moduleActions, t.moduleActions),
|
|
692
|
+
itemActions: Y(e.itemActions, t.itemActions),
|
|
693
|
+
navigation: ge(e.navigation, t.navigation)
|
|
694
|
+
};
|
|
695
|
+
return zn.parse(s), s;
|
|
626
696
|
}
|
|
627
|
-
function
|
|
628
|
-
return
|
|
697
|
+
function Xo(e = {}) {
|
|
698
|
+
return Un(he, e);
|
|
629
699
|
}
|
|
630
|
-
|
|
700
|
+
const Pe = 100, bt = 100, Mt = 100, On = 4, pe = 5 * 60 * 1e3, St = 20, fe = { hasNextPage: !1, endCursor: null }, Q = ["platform-modules"], te = {
|
|
701
|
+
all: Q,
|
|
702
|
+
course: (e) => [...Q, e],
|
|
703
|
+
list: (e, t = {}) => [...Q, e, "list", t],
|
|
704
|
+
items: (e, t, n = {}) => [...Q, e, "module", t, "items", n]
|
|
705
|
+
};
|
|
706
|
+
function $n(e) {
|
|
707
|
+
return [...Q, e, "list"];
|
|
708
|
+
}
|
|
709
|
+
function yt(e, t) {
|
|
710
|
+
return [...Q, e, "module", t, "items"];
|
|
711
|
+
}
|
|
712
|
+
function _t(e) {
|
|
631
713
|
return e.pageInfo.hasNextPage ? e.pageInfo.endCursor : null;
|
|
632
714
|
}
|
|
633
|
-
function
|
|
715
|
+
function Tt(e) {
|
|
634
716
|
const {
|
|
635
717
|
courseId: t,
|
|
636
718
|
adapter: n,
|
|
@@ -639,8 +721,8 @@ function ht(e) {
|
|
|
639
721
|
inlineItemsFirst: i,
|
|
640
722
|
inlineFirst: u,
|
|
641
723
|
view: a,
|
|
642
|
-
staleTime:
|
|
643
|
-
enabled:
|
|
724
|
+
staleTime: c,
|
|
725
|
+
enabled: g
|
|
644
726
|
} = e;
|
|
645
727
|
return {
|
|
646
728
|
// `inlineItemsFirst` is deliberately NOT in the key. It is derived from the
|
|
@@ -657,47 +739,47 @@ function ht(e) {
|
|
|
657
739
|
inlineFirst: u,
|
|
658
740
|
signal: m
|
|
659
741
|
}),
|
|
660
|
-
getNextPageParam:
|
|
661
|
-
enabled:
|
|
662
|
-
staleTime:
|
|
742
|
+
getNextPageParam: _t,
|
|
743
|
+
enabled: g,
|
|
744
|
+
staleTime: c,
|
|
663
745
|
// A refetch of an infinite query re-walks every page it has loaded. Doing
|
|
664
746
|
// that because someone alt-tabbed is the Canvas behaviour we are replacing.
|
|
665
747
|
refetchOnWindowFocus: !1
|
|
666
748
|
};
|
|
667
749
|
}
|
|
668
|
-
function
|
|
669
|
-
const { courseId: t, moduleId: n, adapter: s, pageSize: r, view: i, staleTime: u, enabled: a, limit:
|
|
750
|
+
function wt(e) {
|
|
751
|
+
const { courseId: t, moduleId: n, adapter: s, pageSize: r, view: i, staleTime: u, enabled: a, limit: c } = e;
|
|
670
752
|
return {
|
|
671
753
|
queryKey: te.items(t, n, { view: i, pageSize: r }),
|
|
672
754
|
initialPageParam: null,
|
|
673
|
-
queryFn: ({ pageParam:
|
|
674
|
-
const m = () => s.listModuleItems({ courseId: t, moduleId: n, cursor:
|
|
675
|
-
return
|
|
755
|
+
queryFn: ({ pageParam: g, signal: l }) => {
|
|
756
|
+
const m = () => s.listModuleItems({ courseId: t, moduleId: n, cursor: g, pageSize: r, signal: l });
|
|
757
|
+
return c ? c(() => {
|
|
676
758
|
if (l.aborted)
|
|
677
759
|
throw new DOMException("The operation was aborted.", "AbortError");
|
|
678
760
|
return m();
|
|
679
761
|
}) : m();
|
|
680
762
|
},
|
|
681
|
-
getNextPageParam:
|
|
763
|
+
getNextPageParam: _t,
|
|
682
764
|
enabled: a,
|
|
683
765
|
staleTime: u,
|
|
684
766
|
refetchOnWindowFocus: !1
|
|
685
767
|
};
|
|
686
768
|
}
|
|
687
|
-
function
|
|
688
|
-
var
|
|
769
|
+
function Bn(e) {
|
|
770
|
+
var P;
|
|
689
771
|
const {
|
|
690
772
|
courseId: t,
|
|
691
773
|
adapter: n,
|
|
692
|
-
pageSize: s =
|
|
774
|
+
pageSize: s = Pe,
|
|
693
775
|
includeItems: r = !1,
|
|
694
776
|
inlineItemsFirst: i,
|
|
695
777
|
inlineFirst: u,
|
|
696
778
|
view: a,
|
|
697
|
-
staleTime:
|
|
698
|
-
enabled:
|
|
699
|
-
} = e, l =
|
|
700
|
-
|
|
779
|
+
staleTime: c = pe,
|
|
780
|
+
enabled: g = !0
|
|
781
|
+
} = e, l = Te(
|
|
782
|
+
Tt({
|
|
701
783
|
courseId: t,
|
|
702
784
|
adapter: n,
|
|
703
785
|
pageSize: s,
|
|
@@ -705,36 +787,36 @@ function Tn(e) {
|
|
|
705
787
|
inlineItemsFirst: i,
|
|
706
788
|
inlineFirst: u,
|
|
707
789
|
view: a,
|
|
708
|
-
staleTime:
|
|
709
|
-
enabled:
|
|
790
|
+
staleTime: c,
|
|
791
|
+
enabled: g
|
|
710
792
|
})
|
|
711
|
-
), m = (
|
|
712
|
-
|
|
713
|
-
}, [
|
|
793
|
+
), m = (P = l.data) == null ? void 0 : P.pages, M = N(() => (m ?? []).flatMap((C) => C.modules), [m]), p = m && m.length > 0 ? m[m.length - 1].pageInfo : fe, f = l.fetchNextPage, h = D(() => {
|
|
794
|
+
f();
|
|
795
|
+
}, [f]);
|
|
714
796
|
return {
|
|
715
797
|
modules: M,
|
|
716
|
-
pageInfo:
|
|
717
|
-
hasNextPage:
|
|
718
|
-
fetchNextPage:
|
|
798
|
+
pageInfo: p,
|
|
799
|
+
hasNextPage: p.hasNextPage,
|
|
800
|
+
fetchNextPage: h,
|
|
719
801
|
isLoading: l.isLoading,
|
|
720
802
|
isFetchingNextPage: l.isFetchingNextPage,
|
|
721
803
|
isPending: l.isPending,
|
|
722
804
|
error: l.error
|
|
723
805
|
};
|
|
724
806
|
}
|
|
725
|
-
function
|
|
726
|
-
var
|
|
807
|
+
function Jo(e) {
|
|
808
|
+
var h;
|
|
727
809
|
const {
|
|
728
810
|
courseId: t,
|
|
729
811
|
moduleId: n,
|
|
730
812
|
adapter: s,
|
|
731
|
-
pageSize: r =
|
|
813
|
+
pageSize: r = bt,
|
|
732
814
|
view: i,
|
|
733
815
|
enabled: u = !0,
|
|
734
|
-
staleTime: a =
|
|
735
|
-
limit:
|
|
736
|
-
} = e,
|
|
737
|
-
|
|
816
|
+
staleTime: a = pe,
|
|
817
|
+
limit: c
|
|
818
|
+
} = e, g = Te(
|
|
819
|
+
wt({
|
|
738
820
|
courseId: t,
|
|
739
821
|
moduleId: n,
|
|
740
822
|
adapter: s,
|
|
@@ -742,22 +824,22 @@ function nr(e) {
|
|
|
742
824
|
view: i,
|
|
743
825
|
staleTime: a,
|
|
744
826
|
enabled: u,
|
|
745
|
-
limit:
|
|
827
|
+
limit: c
|
|
746
828
|
})
|
|
747
|
-
), l = (
|
|
748
|
-
|
|
749
|
-
}, [
|
|
829
|
+
), l = (h = g.data) == null ? void 0 : h.pages, m = N(() => (l ?? []).flatMap((P) => P.items), [l]), M = l && l.length > 0 ? l[l.length - 1].pageInfo : fe, p = g.fetchNextPage, f = D(() => {
|
|
830
|
+
p();
|
|
831
|
+
}, [p]);
|
|
750
832
|
return {
|
|
751
833
|
items: m,
|
|
752
834
|
pageInfo: M,
|
|
753
835
|
hasNextPage: M.hasNextPage,
|
|
754
|
-
fetchNextPage:
|
|
755
|
-
isLoading:
|
|
756
|
-
isFetchingNextPage:
|
|
757
|
-
error:
|
|
836
|
+
fetchNextPage: f,
|
|
837
|
+
isLoading: g.isLoading,
|
|
838
|
+
isFetchingNextPage: g.isFetchingNextPage,
|
|
839
|
+
error: g.error
|
|
758
840
|
};
|
|
759
841
|
}
|
|
760
|
-
function
|
|
842
|
+
function Gn(e, t, n = we) {
|
|
761
843
|
if (e.pageInfo.hasNextPage) return "onDemand";
|
|
762
844
|
let s = 0, r = 0;
|
|
763
845
|
for (const i of e.modules) {
|
|
@@ -766,29 +848,29 @@ function Nn(e, t, n = Me) {
|
|
|
766
848
|
}
|
|
767
849
|
return s > t * 2 ? "onDemand" : Math.max(e.modules.length, 1) * Math.max(r, 1) <= n ? "inline" : "onDemand";
|
|
768
850
|
}
|
|
769
|
-
function
|
|
851
|
+
function jn(e) {
|
|
770
852
|
var M;
|
|
771
853
|
const {
|
|
772
854
|
courseId: t,
|
|
773
855
|
adapter: n,
|
|
774
856
|
mode: s = "auto",
|
|
775
|
-
inlineThreshold: r =
|
|
776
|
-
nodeBudget: i = n.inlineNodeBudget ??
|
|
777
|
-
pageSize: u =
|
|
857
|
+
inlineThreshold: r = Mt,
|
|
858
|
+
nodeBudget: i = n.inlineNodeBudget ?? we,
|
|
859
|
+
pageSize: u = Pe,
|
|
778
860
|
view: a,
|
|
779
|
-
staleTime:
|
|
780
|
-
} = e,
|
|
781
|
-
|
|
861
|
+
staleTime: c = pe
|
|
862
|
+
} = e, g = s === "auto", l = Te(
|
|
863
|
+
Tt({
|
|
782
864
|
courseId: t,
|
|
783
865
|
adapter: n,
|
|
784
866
|
pageSize: u,
|
|
785
867
|
includeItems: !1,
|
|
786
868
|
view: a,
|
|
787
|
-
staleTime:
|
|
788
|
-
enabled:
|
|
869
|
+
staleTime: c,
|
|
870
|
+
enabled: g
|
|
789
871
|
})
|
|
790
872
|
);
|
|
791
|
-
if (!
|
|
873
|
+
if (!g)
|
|
792
874
|
return {
|
|
793
875
|
resolvedMode: s,
|
|
794
876
|
isResolving: !1,
|
|
@@ -806,85 +888,85 @@ function An(e) {
|
|
|
806
888
|
};
|
|
807
889
|
const m = (M = l.data) == null ? void 0 : M.pages[0];
|
|
808
890
|
return m ? {
|
|
809
|
-
resolvedMode:
|
|
891
|
+
resolvedMode: Gn(m, r, i),
|
|
810
892
|
isResolving: !1,
|
|
811
893
|
probed: !0,
|
|
812
894
|
error: null,
|
|
813
|
-
inlineShape:
|
|
895
|
+
inlineShape: Yn(m)
|
|
814
896
|
} : { resolvedMode: null, isResolving: !0, probed: !0, error: null, inlineShape: null };
|
|
815
897
|
}
|
|
816
|
-
function
|
|
898
|
+
function Yn(e) {
|
|
817
899
|
let t = 1;
|
|
818
900
|
for (const n of e.modules)
|
|
819
901
|
n.itemCount > t && (t = n.itemCount);
|
|
820
902
|
return { moduleCount: Math.max(e.modules.length, 1), maxItemCount: t };
|
|
821
903
|
}
|
|
822
|
-
const
|
|
823
|
-
function
|
|
824
|
-
const s =
|
|
825
|
-
|
|
904
|
+
const ve = "\0", Wn = /* @__PURE__ */ new Map();
|
|
905
|
+
function Qn(e, t, n = St) {
|
|
906
|
+
const s = We(), r = $(/* @__PURE__ */ new Map()), [i, u] = Z(Wn), a = e.join(ve), c = N(() => a === "" ? [] : a.split(ve), [a]);
|
|
907
|
+
de(() => {
|
|
826
908
|
const l = r.current, m = () => {
|
|
827
|
-
u((
|
|
828
|
-
const
|
|
829
|
-
let
|
|
830
|
-
for (const [
|
|
831
|
-
const
|
|
832
|
-
|
|
909
|
+
u((f) => {
|
|
910
|
+
const h = /* @__PURE__ */ new Map();
|
|
911
|
+
let P = f.size !== l.size;
|
|
912
|
+
for (const [C, v] of l) {
|
|
913
|
+
const A = v.getCurrentResult();
|
|
914
|
+
h.set(C, A), !P && f.get(C) !== A && (P = !0);
|
|
833
915
|
}
|
|
834
|
-
return
|
|
916
|
+
return P ? h : f;
|
|
835
917
|
});
|
|
836
|
-
}, M = new Set(
|
|
837
|
-
for (const
|
|
838
|
-
if (l.has(
|
|
839
|
-
const
|
|
918
|
+
}, M = new Set(c);
|
|
919
|
+
for (const f of c) {
|
|
920
|
+
if (l.has(f)) continue;
|
|
921
|
+
const h = new Rt(
|
|
840
922
|
s,
|
|
841
|
-
t(
|
|
923
|
+
t(f, !0)
|
|
842
924
|
);
|
|
843
|
-
l.set(
|
|
925
|
+
l.set(f, h), h.subscribe(m);
|
|
844
926
|
}
|
|
845
|
-
for (const [
|
|
846
|
-
|
|
847
|
-
for (const
|
|
848
|
-
const
|
|
849
|
-
|
|
927
|
+
for (const [f, h] of l)
|
|
928
|
+
h.setOptions(t(f, M.has(f)));
|
|
929
|
+
for (const f of c) {
|
|
930
|
+
const h = l.get(f);
|
|
931
|
+
h && (l.delete(f), l.set(f, h));
|
|
850
932
|
}
|
|
851
|
-
let
|
|
852
|
-
if (
|
|
853
|
-
for (const [
|
|
854
|
-
if (
|
|
855
|
-
M.has(
|
|
933
|
+
let p = l.size - M.size;
|
|
934
|
+
if (p > n)
|
|
935
|
+
for (const [f, h] of l) {
|
|
936
|
+
if (p <= n) break;
|
|
937
|
+
M.has(f) || (h.destroy(), l.delete(f), p -= 1);
|
|
856
938
|
}
|
|
857
939
|
m();
|
|
858
|
-
}, [s, t,
|
|
940
|
+
}, [s, t, c, n]), de(() => {
|
|
859
941
|
const l = r.current;
|
|
860
942
|
return () => {
|
|
861
943
|
for (const m of l.values()) m.destroy();
|
|
862
944
|
l.clear();
|
|
863
945
|
};
|
|
864
946
|
}, []);
|
|
865
|
-
const
|
|
947
|
+
const g = D((l) => {
|
|
866
948
|
var m;
|
|
867
949
|
(m = r.current.get(l)) == null || m.fetchNextPage();
|
|
868
950
|
}, []);
|
|
869
|
-
return { results: i, fetchNextPage:
|
|
951
|
+
return { results: i, fetchNextPage: g };
|
|
870
952
|
}
|
|
871
|
-
const
|
|
953
|
+
const Hn = [], Kn = () => {
|
|
872
954
|
};
|
|
873
|
-
function
|
|
874
|
-
var
|
|
955
|
+
function ei(e) {
|
|
956
|
+
var G, le;
|
|
875
957
|
const {
|
|
876
958
|
courseId: t,
|
|
877
959
|
adapter: n,
|
|
878
960
|
view: s,
|
|
879
961
|
itemsMode: r = "auto",
|
|
880
|
-
inlineThreshold: i =
|
|
881
|
-
pageSize: u =
|
|
882
|
-
itemPageSize: a =
|
|
883
|
-
itemConcurrency:
|
|
884
|
-
retainCollapsedLimit:
|
|
885
|
-
staleTime: l =
|
|
962
|
+
inlineThreshold: i = Mt,
|
|
963
|
+
pageSize: u = Pe,
|
|
964
|
+
itemPageSize: a = bt,
|
|
965
|
+
itemConcurrency: c = On,
|
|
966
|
+
retainCollapsedLimit: g = St,
|
|
967
|
+
staleTime: l = pe,
|
|
886
968
|
initialExpandedModuleIds: m
|
|
887
|
-
} = e, M =
|
|
969
|
+
} = e, M = We(), p = jn({
|
|
888
970
|
courseId: t,
|
|
889
971
|
adapter: n,
|
|
890
972
|
mode: r,
|
|
@@ -892,264 +974,363 @@ function sr(e) {
|
|
|
892
974
|
pageSize: u,
|
|
893
975
|
view: s,
|
|
894
976
|
staleTime: l
|
|
895
|
-
}),
|
|
977
|
+
}), f = p.resolvedMode, h = Bn({
|
|
896
978
|
courseId: t,
|
|
897
979
|
adapter: n,
|
|
898
980
|
pageSize: u,
|
|
899
981
|
view: s,
|
|
900
982
|
staleTime: l,
|
|
901
|
-
includeItems:
|
|
983
|
+
includeItems: f === "inline",
|
|
902
984
|
// Measured by the probe, not assumed. Canvas charges GraphQL complexity on
|
|
903
985
|
// the requested shape, so asking for the ceiling rejects the query outright
|
|
904
986
|
// even on a tiny course. @see UseItemsModeResult.inlineShape
|
|
905
|
-
inlineItemsFirst: (
|
|
987
|
+
inlineItemsFirst: (G = p.inlineShape) == null ? void 0 : G.maxItemCount,
|
|
906
988
|
// Both axes, not just one: the budget is charged on the product, so asking
|
|
907
989
|
// for 100 modules when page 1 held 6 is what forces `inlineItemsFirst` down.
|
|
908
|
-
inlineFirst: (
|
|
909
|
-
enabled:
|
|
910
|
-
}), [
|
|
990
|
+
inlineFirst: (le = p.inlineShape) == null ? void 0 : le.moduleCount,
|
|
991
|
+
enabled: f !== null
|
|
992
|
+
}), [P, C] = Z(
|
|
911
993
|
() => m ?? []
|
|
912
|
-
),
|
|
913
|
-
const
|
|
914
|
-
for (const
|
|
915
|
-
return
|
|
916
|
-
}, [
|
|
917
|
-
() =>
|
|
918
|
-
const
|
|
919
|
-
return
|
|
994
|
+
), v = N(() => {
|
|
995
|
+
const S = /* @__PURE__ */ new Map();
|
|
996
|
+
for (const I of h.modules) S.set(I.id, I);
|
|
997
|
+
return S;
|
|
998
|
+
}, [h.modules]), A = N(
|
|
999
|
+
() => P.filter((S) => {
|
|
1000
|
+
const I = v.get(S);
|
|
1001
|
+
return I !== void 0 && I.items === void 0;
|
|
920
1002
|
}),
|
|
921
|
-
[
|
|
922
|
-
),
|
|
923
|
-
(
|
|
1003
|
+
[P, v]
|
|
1004
|
+
), se = N(() => new Set(A), [A]), re = N(() => Ft(c), [c]), E = D(
|
|
1005
|
+
(S, I) => wt({
|
|
924
1006
|
courseId: t,
|
|
925
|
-
moduleId:
|
|
1007
|
+
moduleId: S,
|
|
926
1008
|
adapter: n,
|
|
927
1009
|
pageSize: a,
|
|
928
1010
|
view: s,
|
|
929
1011
|
staleTime: l,
|
|
930
|
-
enabled:
|
|
931
|
-
limit:
|
|
1012
|
+
enabled: I,
|
|
1013
|
+
limit: re
|
|
932
1014
|
}),
|
|
933
|
-
[t, n, a, s, l,
|
|
934
|
-
),
|
|
935
|
-
(
|
|
936
|
-
let
|
|
937
|
-
return
|
|
1015
|
+
[t, n, a, s, l, re]
|
|
1016
|
+
), F = Qn(A, E, g), H = F.fetchNextPage, q = $(/* @__PURE__ */ new Map()), K = D(
|
|
1017
|
+
(S) => {
|
|
1018
|
+
let I = q.current.get(S);
|
|
1019
|
+
return I || (I = () => H(S), q.current.set(S, I)), I;
|
|
938
1020
|
},
|
|
939
|
-
[
|
|
940
|
-
),
|
|
941
|
-
|
|
942
|
-
(
|
|
1021
|
+
[H]
|
|
1022
|
+
), z = D((S) => {
|
|
1023
|
+
C(
|
|
1024
|
+
(I) => I.includes(S) ? I : [...I, S]
|
|
943
1025
|
);
|
|
944
|
-
}, []),
|
|
945
|
-
(
|
|
946
|
-
|
|
1026
|
+
}, []), B = D(
|
|
1027
|
+
(S) => {
|
|
1028
|
+
C((I) => I.filter((x) => x !== S)), M.cancelQueries({ queryKey: yt(t, S) });
|
|
947
1029
|
},
|
|
948
1030
|
[M, t]
|
|
949
|
-
), V =
|
|
950
|
-
V.current =
|
|
951
|
-
const
|
|
952
|
-
(
|
|
953
|
-
V.current.includes(
|
|
1031
|
+
), V = $(P);
|
|
1032
|
+
V.current = P;
|
|
1033
|
+
const oe = D(
|
|
1034
|
+
(S) => {
|
|
1035
|
+
V.current.includes(S) ? B(S) : z(S);
|
|
954
1036
|
},
|
|
955
|
-
[
|
|
956
|
-
), U =
|
|
957
|
-
(
|
|
958
|
-
var
|
|
959
|
-
const
|
|
960
|
-
if (
|
|
961
|
-
return
|
|
962
|
-
const j = (
|
|
963
|
-
if ((
|
|
1037
|
+
[B, z]
|
|
1038
|
+
), U = F.results, ie = $(/* @__PURE__ */ new Map()), O = D(
|
|
1039
|
+
(S) => {
|
|
1040
|
+
var xe;
|
|
1041
|
+
const I = v.get(S), x = U.get(S), w = se.has(S), L = ie.current.get(S);
|
|
1042
|
+
if (L && L.items === (I == null ? void 0 : I.items) && L.result === x && L.active === w)
|
|
1043
|
+
return L.value;
|
|
1044
|
+
const j = (ae) => (ie.current.set(S, { items: I == null ? void 0 : I.items, result: x, active: w, value: ae }), ae);
|
|
1045
|
+
if ((I == null ? void 0 : I.items) !== void 0)
|
|
964
1046
|
return j({
|
|
965
|
-
items:
|
|
966
|
-
pageInfo:
|
|
1047
|
+
items: I.items,
|
|
1048
|
+
pageInfo: fe,
|
|
967
1049
|
hasNextPage: !1,
|
|
968
|
-
fetchNextPage:
|
|
1050
|
+
fetchNextPage: Kn,
|
|
969
1051
|
isLoading: !1,
|
|
970
1052
|
isFetchingNextPage: !1,
|
|
971
1053
|
error: null,
|
|
972
1054
|
source: "inline"
|
|
973
1055
|
});
|
|
974
|
-
const
|
|
1056
|
+
const R = (xe = x == null ? void 0 : x.data) == null ? void 0 : xe.pages, qt = R ? R.flatMap((ae) => ae.items) : Hn, Ee = R && R.length > 0 ? R[R.length - 1].pageInfo : fe;
|
|
975
1057
|
return j({
|
|
976
|
-
items:
|
|
977
|
-
pageInfo:
|
|
978
|
-
hasNextPage:
|
|
979
|
-
fetchNextPage:
|
|
1058
|
+
items: qt,
|
|
1059
|
+
pageInfo: Ee,
|
|
1060
|
+
hasNextPage: Ee.hasNextPage,
|
|
1061
|
+
fetchNextPage: K(S),
|
|
980
1062
|
// Between the click and the observer being wired up there is one commit
|
|
981
1063
|
// with no result yet; report that as loading rather than as "empty".
|
|
982
|
-
isLoading:
|
|
983
|
-
isFetchingNextPage: (
|
|
984
|
-
error: (
|
|
1064
|
+
isLoading: x ? x.isLoading : w,
|
|
1065
|
+
isFetchingNextPage: (x == null ? void 0 : x.isFetchingNextPage) ?? !1,
|
|
1066
|
+
error: (x == null ? void 0 : x.error) ?? null,
|
|
985
1067
|
source: "onDemand"
|
|
986
1068
|
});
|
|
987
1069
|
},
|
|
988
|
-
[
|
|
1070
|
+
[v, U, K, se]
|
|
989
1071
|
);
|
|
990
1072
|
return {
|
|
991
|
-
modules:
|
|
992
|
-
pageInfo:
|
|
993
|
-
hasNextPage:
|
|
994
|
-
fetchNextPage:
|
|
995
|
-
isLoading:
|
|
996
|
-
isFetchingNextPage:
|
|
997
|
-
error:
|
|
998
|
-
itemsMode:
|
|
999
|
-
getItems:
|
|
1000
|
-
expandModule:
|
|
1001
|
-
collapseModule:
|
|
1002
|
-
toggleModule:
|
|
1003
|
-
expandedModuleIds:
|
|
1073
|
+
modules: h.modules,
|
|
1074
|
+
pageInfo: h.pageInfo,
|
|
1075
|
+
hasNextPage: h.hasNextPage,
|
|
1076
|
+
fetchNextPage: h.fetchNextPage,
|
|
1077
|
+
isLoading: p.isResolving || h.isPending,
|
|
1078
|
+
isFetchingNextPage: h.isFetchingNextPage,
|
|
1079
|
+
error: h.error ?? p.error,
|
|
1080
|
+
itemsMode: f,
|
|
1081
|
+
getItems: O,
|
|
1082
|
+
expandModule: z,
|
|
1083
|
+
collapseModule: B,
|
|
1084
|
+
toggleModule: oe,
|
|
1085
|
+
expandedModuleIds: P
|
|
1004
1086
|
};
|
|
1005
1087
|
}
|
|
1006
|
-
function
|
|
1007
|
-
const r = s ? te.items(t, n, s) :
|
|
1088
|
+
function ti(e, t, n, s) {
|
|
1089
|
+
const r = s ? te.items(t, n, s) : yt(t, n);
|
|
1008
1090
|
return e.invalidateQueries({ queryKey: r });
|
|
1009
1091
|
}
|
|
1010
|
-
function
|
|
1011
|
-
const s = n ? te.list(t, n) :
|
|
1092
|
+
function ni(e, t, n) {
|
|
1093
|
+
const s = n ? te.list(t, n) : $n(t);
|
|
1012
1094
|
return e.invalidateQueries({ queryKey: s });
|
|
1013
1095
|
}
|
|
1014
|
-
function
|
|
1096
|
+
function si(e, t) {
|
|
1015
1097
|
return e.invalidateQueries({ queryKey: te.course(t) });
|
|
1016
1098
|
}
|
|
1017
|
-
const
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1099
|
+
const Vn = "Course modules", Zn = { one: "%{count} module loaded", other: "%{count} modules loaded" }, Xn = "Search by name", Jn = "Search…", es = "Expand / collapse", ts = "Expand all", ns = "Collapse all", ss = "Search matches module names only — items of collapsed modules are not loaded.", rs = "Modules failed to load: %{message}", os = "Loading modules", is = "This course has no modules.", ls = { one: "The only loaded module does not match this filter.", other: "None of the %{count} loaded modules match this filter." }, as = "Clear filters", us = "Loading more modules…", cs = "Load more modules (%{count} loaded)", ds = { one: "The only module in this course is loaded.", other: "All %{count} modules in this course are loaded." }, ms = "Filter", gs = "%{label} (%{count})", fs = "All", hs = "In progress", ps = "Complete", Is = "Due this week", bs = "Missing", Ms = "Locked until prerequisites are met", Ss = "%{name} progress", ys = { one: "%{loaded} of %{count} item loaded in %{name}", other: "%{loaded} of %{count} items loaded in %{name}" }, _s = "Items failed to load: %{message}", Ts = "Loading items", ws = "Loading…", Ps = "No items.", Es = "Loading more items…", xs = "Load more items (%{loaded} of %{count} loaded)", Cs = "(unpublished)", Ls = "Collapse %{name}", As = "Expand %{name}", vs = "Not started", Ns = "In progress", Ds = "All items complete", ks = "All items graded", qs = "Missing", Rs = "Locked", Fs = "Not started", zs = "In progress", Us = "Submitted", Os = "Graded", $s = "Missing", Bs = "Locked", Gs = "Assignment", js = "Quiz", Ys = "Discussion", Ws = "Page", Qs = "File", Hs = "External URL", Ks = "External tool", Vs = "Text header", Zs = "View the item", Xs = "Submit the assignment", Js = "Contribute to the page", er = "Mark as done", tr = "Score at least the minimum", nr = "Score at least %{count}", sr = "Score at least the minimum percentage", rr = "Score at least %{count}%", or = "Complete the requirement", ir = "today, %{time}", lr = "yesterday, %{time}", ar = "tomorrow, %{time}", ur = "%{date}, %{time}", cr = "Due %{when}", dr = "Will unlock on %{when}", mr = { one: "%{count} pt", other: "%{count} pts" }, gr = { one: "%{percent}% | %{met} of %{count} requirement met", other: "%{percent}% | %{met} of %{count} requirements met" }, fr = "%{count} min", hr = "Unpublished", pr = "Untitled item", Ir = "opens in a new window", br = {
|
|
1100
|
+
pageTitle: Vn,
|
|
1101
|
+
modulesLoadedAnnouncement: Zn,
|
|
1102
|
+
moduleSearchLabel: Xn,
|
|
1103
|
+
searchPlaceholder: Jn,
|
|
1104
|
+
expandCollapseTrigger: es,
|
|
1105
|
+
expandAll: ts,
|
|
1106
|
+
collapseAll: ns,
|
|
1107
|
+
searchScopeHint: ss,
|
|
1108
|
+
modulesLoadErrorAlert: rs,
|
|
1109
|
+
modulesLoadingSpinnerLabel: os,
|
|
1110
|
+
noModulesEmptyState: is,
|
|
1111
|
+
filteredEmptyState: ls,
|
|
1112
|
+
clearFilters: as,
|
|
1113
|
+
loadMoreModulesLoading: us,
|
|
1114
|
+
loadMoreModules: cs,
|
|
1115
|
+
allModulesLoaded: ds,
|
|
1116
|
+
filterGroupLabel: ms,
|
|
1117
|
+
filterChipWithCount: gs,
|
|
1118
|
+
filterAll: fs,
|
|
1119
|
+
filterInProgress: hs,
|
|
1120
|
+
filterComplete: ps,
|
|
1121
|
+
filterDueThisWeek: Is,
|
|
1122
|
+
filterMissing: bs,
|
|
1123
|
+
lockedByline: Ms,
|
|
1124
|
+
moduleProgressScreenReaderLabel: Ss,
|
|
1125
|
+
itemsLoadedAnnouncement: ys,
|
|
1126
|
+
itemsLoadErrorAlert: _s,
|
|
1127
|
+
itemsLoadingSpinnerLabel: Ts,
|
|
1128
|
+
itemsLoadingText: ws,
|
|
1129
|
+
noItemsEmptyState: Ps,
|
|
1130
|
+
loadMoreItemsLoading: Es,
|
|
1131
|
+
loadMoreItems: xs,
|
|
1132
|
+
moduleUnpublishedBadge: Cs,
|
|
1133
|
+
collapseModule: Ls,
|
|
1134
|
+
expandModule: As,
|
|
1135
|
+
moduleStatusNotStarted: vs,
|
|
1136
|
+
moduleStatusInProgress: Ns,
|
|
1137
|
+
moduleStatusAllSubmitted: Ds,
|
|
1138
|
+
moduleStatusAllGraded: ks,
|
|
1139
|
+
moduleStatusMissing: qs,
|
|
1140
|
+
moduleStatusLocked: Rs,
|
|
1141
|
+
itemStatusNotStarted: Fs,
|
|
1142
|
+
itemStatusInProgress: zs,
|
|
1143
|
+
itemStatusSubmitted: Us,
|
|
1144
|
+
itemStatusGraded: Os,
|
|
1145
|
+
itemStatusMissing: $s,
|
|
1146
|
+
itemStatusLocked: Bs,
|
|
1147
|
+
itemTypeAssignment: Gs,
|
|
1148
|
+
itemTypeQuiz: js,
|
|
1149
|
+
itemTypeDiscussion: Ys,
|
|
1150
|
+
itemTypePage: Ws,
|
|
1151
|
+
itemTypeFile: Qs,
|
|
1152
|
+
itemTypeExternalUrl: Hs,
|
|
1153
|
+
itemTypeExternalTool: Ks,
|
|
1154
|
+
itemTypeSubHeader: Vs,
|
|
1155
|
+
requirementMustView: Zs,
|
|
1156
|
+
requirementMustSubmit: Xs,
|
|
1157
|
+
requirementMustContribute: Js,
|
|
1158
|
+
requirementMustMarkDone: er,
|
|
1159
|
+
requirementMinScoreUnknown: tr,
|
|
1160
|
+
requirementMinScore: nr,
|
|
1161
|
+
requirementMinPercentageUnknown: sr,
|
|
1162
|
+
requirementMinPercentage: rr,
|
|
1163
|
+
requirementUnknown: or,
|
|
1164
|
+
dateTimeToday: ir,
|
|
1165
|
+
dateTimeYesterday: lr,
|
|
1166
|
+
dateTimeTomorrow: ar,
|
|
1167
|
+
dateTimeWithDate: ur,
|
|
1168
|
+
dueByline: cr,
|
|
1169
|
+
unlockByline: dr,
|
|
1170
|
+
pointsAbbreviated: mr,
|
|
1171
|
+
progressSummary: gr,
|
|
1172
|
+
durationMinutes: fr,
|
|
1173
|
+
itemUnpublishedLabel: hr,
|
|
1174
|
+
itemUntitled: pr,
|
|
1175
|
+
opensInNewWindow: Ir
|
|
1176
|
+
}, Mr = /%\{(\w+)\}/g, Sr = br, ne = "en-US", yr = /* @__PURE__ */ new Map(), _r = /* @__PURE__ */ new Map();
|
|
1177
|
+
function Pt(e, t, n) {
|
|
1178
|
+
const s = e.get(t);
|
|
1179
|
+
if (s) return s;
|
|
1180
|
+
const r = n();
|
|
1181
|
+
return e.set(t, r), r;
|
|
1182
|
+
}
|
|
1183
|
+
function Tr(e, t, n) {
|
|
1184
|
+
return n ? e.replace(Mr, (s, r) => {
|
|
1185
|
+
if (!Object.prototype.hasOwnProperty.call(n, r)) return s;
|
|
1186
|
+
const i = n[r];
|
|
1187
|
+
return typeof i == "number" && Number.isFinite(i) ? Pt(_r, t, () => new Intl.NumberFormat(t)).format(i) : String(i);
|
|
1188
|
+
}) : e;
|
|
1037
1189
|
}
|
|
1038
|
-
function
|
|
1039
|
-
const
|
|
1190
|
+
function wr(e, t, n) {
|
|
1191
|
+
const s = n == null ? void 0 : n.count;
|
|
1192
|
+
if (typeof s == "number" && Number.isFinite(s)) {
|
|
1193
|
+
const r = Pt(yr, t, () => new Intl.PluralRules(t)).select(s), i = e[r];
|
|
1194
|
+
if (typeof i == "string") return i;
|
|
1195
|
+
}
|
|
1196
|
+
return typeof e.other == "string" ? e.other : void 0;
|
|
1197
|
+
}
|
|
1198
|
+
function Ne(e, t, n) {
|
|
1199
|
+
if (typeof e == "string") return e;
|
|
1200
|
+
if (e !== null && typeof e == "object")
|
|
1201
|
+
return wr(e, t, n);
|
|
1202
|
+
}
|
|
1203
|
+
function Pr(e, t, n, s) {
|
|
1204
|
+
const r = Ne(e == null ? void 0 : e[t], n, s);
|
|
1205
|
+
if (typeof r == "string") return r;
|
|
1206
|
+
const i = Ne(Sr[t], n, s);
|
|
1207
|
+
return typeof i == "string" ? i : t;
|
|
1208
|
+
}
|
|
1209
|
+
function Et(e, t = ne) {
|
|
1210
|
+
return (n, s) => Tr(Pr(e, n, t, s), t, s);
|
|
1211
|
+
}
|
|
1212
|
+
const Er = Et(), xr = { t: Er, locale: ne }, xt = Be(null);
|
|
1213
|
+
function ri({
|
|
1214
|
+
translations: e,
|
|
1215
|
+
locale: t,
|
|
1216
|
+
children: n
|
|
1217
|
+
}) {
|
|
1218
|
+
const s = N(() => {
|
|
1219
|
+
const r = t ?? ne;
|
|
1220
|
+
return { t: Et(e, r), locale: r };
|
|
1221
|
+
}, [e, t]);
|
|
1222
|
+
return /* @__PURE__ */ o(xt.Provider, { value: s, children: n });
|
|
1223
|
+
}
|
|
1224
|
+
function k() {
|
|
1225
|
+
return Ge(xt) ?? xr;
|
|
1226
|
+
}
|
|
1227
|
+
const Cr = 864e5, De = /* @__PURE__ */ new Map(), ke = /* @__PURE__ */ new Map();
|
|
1228
|
+
function Lr(e) {
|
|
1229
|
+
const t = ke.get(e);
|
|
1040
1230
|
if (t) return t;
|
|
1041
1231
|
const n = new Intl.NumberFormat(e, { minimumIntegerDigits: 2, useGrouping: !1 });
|
|
1042
|
-
return
|
|
1232
|
+
return ke.set(e, n), n;
|
|
1043
1233
|
}
|
|
1044
|
-
function
|
|
1045
|
-
|
|
1046
|
-
}
|
|
1047
|
-
function $n(e) {
|
|
1048
|
-
const t = Ce.get(e);
|
|
1234
|
+
function Ar(e) {
|
|
1235
|
+
const t = De.get(e);
|
|
1049
1236
|
if (t) return t;
|
|
1050
1237
|
const n = {
|
|
1051
1238
|
time: new Intl.DateTimeFormat(e, { hour: "numeric", minute: "2-digit" }),
|
|
1052
1239
|
day: new Intl.DateTimeFormat(e, { month: "long", day: "numeric" }),
|
|
1053
1240
|
dayYear: new Intl.DateTimeFormat(e, { month: "long", day: "numeric", year: "numeric" })
|
|
1054
1241
|
};
|
|
1055
|
-
return
|
|
1242
|
+
return De.set(e, n), n;
|
|
1056
1243
|
}
|
|
1057
|
-
function
|
|
1244
|
+
function Ct(e, t) {
|
|
1058
1245
|
const n = Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()), s = Date.UTC(t.getFullYear(), t.getMonth(), t.getDate());
|
|
1059
|
-
return Math.round((n - s) /
|
|
1246
|
+
return Math.round((n - s) / Cr);
|
|
1060
1247
|
}
|
|
1061
|
-
function
|
|
1248
|
+
function Lt(e, t, n, s = ne) {
|
|
1062
1249
|
const r = new Date(t);
|
|
1063
1250
|
if (Number.isNaN(r.getTime())) return t;
|
|
1064
|
-
const i =
|
|
1065
|
-
if (a === 0) return e("
|
|
1066
|
-
if (a === -1) return e("
|
|
1067
|
-
if (a === 1) return e("
|
|
1068
|
-
const
|
|
1069
|
-
return e("
|
|
1251
|
+
const i = Ar(s), u = i.time.format(r), a = Ct(r, n);
|
|
1252
|
+
if (a === 0) return e("dateTimeToday", { time: u });
|
|
1253
|
+
if (a === -1) return e("dateTimeYesterday", { time: u });
|
|
1254
|
+
if (a === 1) return e("dateTimeTomorrow", { time: u });
|
|
1255
|
+
const c = r.getFullYear() === n.getFullYear() ? i.day.format(r) : i.dayYear.format(r);
|
|
1256
|
+
return e("dateTimeWithDate", { date: c, time: u });
|
|
1070
1257
|
}
|
|
1071
|
-
function
|
|
1072
|
-
return e("
|
|
1258
|
+
function At(e, t, n, s) {
|
|
1259
|
+
return e("dueByline", { when: Lt(e, t, n, s) });
|
|
1073
1260
|
}
|
|
1074
|
-
function
|
|
1075
|
-
return e("
|
|
1261
|
+
function qe(e, t, n, s) {
|
|
1262
|
+
return e("unlockByline", { when: Lt(e, t, n, s) });
|
|
1076
1263
|
}
|
|
1077
|
-
function
|
|
1078
|
-
return
|
|
1264
|
+
function vr(e, t = ne) {
|
|
1265
|
+
return !Number.isInteger(e) || e < 1 ? null : Lr(t).format(e);
|
|
1079
1266
|
}
|
|
1080
|
-
function
|
|
1267
|
+
function Nr(e, t) {
|
|
1081
1268
|
switch (t) {
|
|
1082
1269
|
case "assignment":
|
|
1083
|
-
return e("
|
|
1270
|
+
return e("itemTypeAssignment");
|
|
1084
1271
|
case "quiz":
|
|
1085
|
-
return e("
|
|
1272
|
+
return e("itemTypeQuiz");
|
|
1086
1273
|
case "discussion":
|
|
1087
|
-
return e("
|
|
1274
|
+
return e("itemTypeDiscussion");
|
|
1088
1275
|
case "page":
|
|
1089
|
-
return e("
|
|
1276
|
+
return e("itemTypePage");
|
|
1090
1277
|
case "file":
|
|
1091
|
-
return e("
|
|
1278
|
+
return e("itemTypeFile");
|
|
1092
1279
|
case "external_url":
|
|
1093
|
-
return e("
|
|
1280
|
+
return e("itemTypeExternalUrl");
|
|
1094
1281
|
case "external_tool":
|
|
1095
|
-
return e("
|
|
1282
|
+
return e("itemTypeExternalTool");
|
|
1096
1283
|
case "sub_header":
|
|
1097
|
-
return e("
|
|
1284
|
+
return e("itemTypeSubHeader");
|
|
1098
1285
|
}
|
|
1099
1286
|
}
|
|
1100
|
-
function
|
|
1101
|
-
return t == null ? null : e("
|
|
1287
|
+
function Dr(e, t) {
|
|
1288
|
+
return t == null ? null : e("pointsAbbreviated", { count: t });
|
|
1102
1289
|
}
|
|
1103
|
-
function
|
|
1104
|
-
const s = (r) => me(n).format(r);
|
|
1290
|
+
function kr(e, t) {
|
|
1105
1291
|
switch (t.type) {
|
|
1106
1292
|
case "must_view":
|
|
1107
|
-
return e("
|
|
1293
|
+
return e("requirementMustView");
|
|
1108
1294
|
case "must_submit":
|
|
1109
|
-
return e("
|
|
1295
|
+
return e("requirementMustSubmit");
|
|
1110
1296
|
case "must_contribute":
|
|
1111
|
-
return e("
|
|
1297
|
+
return e("requirementMustContribute");
|
|
1112
1298
|
case "must_mark_done":
|
|
1113
|
-
return e("
|
|
1299
|
+
return e("requirementMustMarkDone");
|
|
1114
1300
|
case "min_score":
|
|
1115
|
-
return t.minScore === null || t.minScore === void 0 ? e("
|
|
1301
|
+
return t.minScore === null || t.minScore === void 0 ? e("requirementMinScoreUnknown") : e("requirementMinScore", { count: t.minScore });
|
|
1116
1302
|
case "min_percentage":
|
|
1117
|
-
return t.minPercentage === null || t.minPercentage === void 0 ? e("
|
|
1303
|
+
return t.minPercentage === null || t.minPercentage === void 0 ? e("requirementMinPercentageUnknown") : e("requirementMinPercentage", { count: t.minPercentage });
|
|
1118
1304
|
case "unknown":
|
|
1119
|
-
return e("
|
|
1305
|
+
return e("requirementUnknown");
|
|
1120
1306
|
}
|
|
1121
1307
|
}
|
|
1122
|
-
function
|
|
1123
|
-
|
|
1124
|
-
return e("%{percent}% | %{met} of %{total} requirements met", {
|
|
1125
|
-
percent: i.format(t),
|
|
1126
|
-
met: i.format(n),
|
|
1127
|
-
total: i.format(s)
|
|
1128
|
-
});
|
|
1308
|
+
function qr(e, t, n, s) {
|
|
1309
|
+
return e("progressSummary", { percent: t, met: n, count: s });
|
|
1129
1310
|
}
|
|
1130
|
-
const
|
|
1311
|
+
const Rr = [
|
|
1131
1312
|
"all",
|
|
1132
1313
|
"in_progress",
|
|
1133
1314
|
"complete",
|
|
1134
1315
|
"due_this_week",
|
|
1135
1316
|
"missing"
|
|
1136
1317
|
];
|
|
1137
|
-
function
|
|
1318
|
+
function Fr(e, t) {
|
|
1138
1319
|
switch (t) {
|
|
1139
1320
|
case "all":
|
|
1140
|
-
return e("
|
|
1321
|
+
return e("filterAll");
|
|
1141
1322
|
case "in_progress":
|
|
1142
|
-
return e("
|
|
1323
|
+
return e("filterInProgress");
|
|
1143
1324
|
case "complete":
|
|
1144
|
-
return e("
|
|
1325
|
+
return e("filterComplete");
|
|
1145
1326
|
case "due_this_week":
|
|
1146
|
-
return e("
|
|
1327
|
+
return e("filterDueThisWeek");
|
|
1147
1328
|
case "missing":
|
|
1148
|
-
return e("
|
|
1329
|
+
return e("filterMissing");
|
|
1149
1330
|
}
|
|
1150
1331
|
}
|
|
1151
|
-
const
|
|
1152
|
-
function
|
|
1332
|
+
const zr = 7;
|
|
1333
|
+
function Re(e, t, n) {
|
|
1153
1334
|
if (t === "all") return !0;
|
|
1154
1335
|
const s = e.progress;
|
|
1155
1336
|
if (!s) return !1;
|
|
@@ -1164,148 +1345,160 @@ function Ae(e, t, n) {
|
|
|
1164
1345
|
if (!s.latestDueAt) return !1;
|
|
1165
1346
|
const r = new Date(s.latestDueAt);
|
|
1166
1347
|
if (Number.isNaN(r.getTime())) return !1;
|
|
1167
|
-
const i =
|
|
1168
|
-
return i >= 0 && i <=
|
|
1348
|
+
const i = Ct(r, n);
|
|
1349
|
+
return i >= 0 && i <= zr;
|
|
1169
1350
|
}
|
|
1170
1351
|
default:
|
|
1171
1352
|
return !0;
|
|
1172
1353
|
}
|
|
1173
1354
|
}
|
|
1174
|
-
function
|
|
1355
|
+
function Fe(e, t, n) {
|
|
1175
1356
|
const s = t.trim().toLocaleLowerCase(n);
|
|
1176
1357
|
return s === "" ? !0 : e.name.toLocaleLowerCase(n).includes(s);
|
|
1177
1358
|
}
|
|
1178
|
-
function
|
|
1179
|
-
const { t: s
|
|
1180
|
-
return /* @__PURE__ */ y
|
|
1181
|
-
/* @__PURE__ */ o(
|
|
1359
|
+
function Ur({ value: e, onChange: t, counts: n }) {
|
|
1360
|
+
const { t: s } = k(), r = je();
|
|
1361
|
+
return /* @__PURE__ */ _(y, { as: "div", margin: "medium 0 0 0", children: [
|
|
1362
|
+
/* @__PURE__ */ o(y, { as: "div", margin: "0 0 x-small 0", children: /* @__PURE__ */ o(b, { size: "small", weight: "bold", id: r, children: s("filterGroupLabel") }) }),
|
|
1182
1363
|
/* @__PURE__ */ o(
|
|
1183
|
-
|
|
1364
|
+
T,
|
|
1184
1365
|
{
|
|
1185
1366
|
gap: "x-small",
|
|
1186
1367
|
wrap: "wrap",
|
|
1187
1368
|
as: "div",
|
|
1188
1369
|
role: "group",
|
|
1189
|
-
"aria-labelledby":
|
|
1370
|
+
"aria-labelledby": r,
|
|
1190
1371
|
"data-testid": "filter-chips",
|
|
1191
|
-
children:
|
|
1192
|
-
const
|
|
1193
|
-
return /* @__PURE__ */ o(
|
|
1194
|
-
|
|
1372
|
+
children: Rr.map((i) => {
|
|
1373
|
+
const u = i === e, a = n == null ? void 0 : n[i], c = Fr(s, i);
|
|
1374
|
+
return /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ o(
|
|
1375
|
+
X,
|
|
1195
1376
|
{
|
|
1196
1377
|
size: "small",
|
|
1197
|
-
color:
|
|
1198
|
-
"aria-pressed":
|
|
1199
|
-
onClick: () => t(
|
|
1200
|
-
"data-testid": `filter-chip-${
|
|
1378
|
+
color: u ? "primary" : "secondary",
|
|
1379
|
+
"aria-pressed": u,
|
|
1380
|
+
onClick: () => t(i),
|
|
1381
|
+
"data-testid": `filter-chip-${i}`,
|
|
1201
1382
|
themeOverride: { borderRadius: "1.5rem" },
|
|
1202
|
-
children:
|
|
1383
|
+
children: a === void 0 ? c : s("filterChipWithCount", { label: c, count: a })
|
|
1203
1384
|
}
|
|
1204
|
-
) },
|
|
1385
|
+
) }, i);
|
|
1205
1386
|
})
|
|
1206
1387
|
}
|
|
1207
1388
|
)
|
|
1208
1389
|
] });
|
|
1209
1390
|
}
|
|
1210
|
-
const
|
|
1391
|
+
const Or = {
|
|
1211
1392
|
not_started: {},
|
|
1212
|
-
in_progress: { color: "info", icon: /* @__PURE__ */ o(
|
|
1213
|
-
all_submitted: { color: "success", icon: /* @__PURE__ */ o(
|
|
1214
|
-
all_graded: { color: "success", icon: /* @__PURE__ */ o(
|
|
1215
|
-
missing: { color: "danger", icon: /* @__PURE__ */ o(
|
|
1216
|
-
locked: { icon: /* @__PURE__ */ o(
|
|
1217
|
-
},
|
|
1393
|
+
in_progress: { color: "info", icon: /* @__PURE__ */ o(Je, {}) },
|
|
1394
|
+
all_submitted: { color: "success", icon: /* @__PURE__ */ o(me, {}) },
|
|
1395
|
+
all_graded: { color: "success", icon: /* @__PURE__ */ o(me, {}) },
|
|
1396
|
+
missing: { color: "danger", icon: /* @__PURE__ */ o(Xe, {}) },
|
|
1397
|
+
locked: { icon: /* @__PURE__ */ o(Ze, {}) }
|
|
1398
|
+
}, $r = {
|
|
1218
1399
|
not_started: {},
|
|
1219
|
-
in_progress: { color: "info", icon: /* @__PURE__ */ o(
|
|
1220
|
-
submitted: { color: "success", icon: /* @__PURE__ */ o(
|
|
1221
|
-
graded: { color: "success", icon: /* @__PURE__ */ o(
|
|
1222
|
-
missing: { color: "danger", icon: /* @__PURE__ */ o(
|
|
1223
|
-
locked: { icon: /* @__PURE__ */ o(
|
|
1400
|
+
in_progress: { color: "info", icon: /* @__PURE__ */ o(Je, {}) },
|
|
1401
|
+
submitted: { color: "success", icon: /* @__PURE__ */ o(me, {}) },
|
|
1402
|
+
graded: { color: "success", icon: /* @__PURE__ */ o(me, {}) },
|
|
1403
|
+
missing: { color: "danger", icon: /* @__PURE__ */ o(Xe, {}) },
|
|
1404
|
+
locked: { icon: /* @__PURE__ */ o(Ze, {}) }
|
|
1224
1405
|
};
|
|
1225
|
-
function
|
|
1406
|
+
function Br(e, t) {
|
|
1226
1407
|
switch (t) {
|
|
1227
1408
|
case "not_started":
|
|
1228
|
-
return e("
|
|
1409
|
+
return e("moduleStatusNotStarted");
|
|
1229
1410
|
case "in_progress":
|
|
1230
|
-
return e("
|
|
1411
|
+
return e("moduleStatusInProgress");
|
|
1231
1412
|
case "all_submitted":
|
|
1232
|
-
return e("
|
|
1413
|
+
return e("moduleStatusAllSubmitted");
|
|
1233
1414
|
case "all_graded":
|
|
1234
|
-
return e("
|
|
1415
|
+
return e("moduleStatusAllGraded");
|
|
1235
1416
|
case "missing":
|
|
1236
|
-
return e("
|
|
1417
|
+
return e("moduleStatusMissing");
|
|
1237
1418
|
case "locked":
|
|
1238
|
-
return e("
|
|
1419
|
+
return e("moduleStatusLocked");
|
|
1239
1420
|
}
|
|
1240
1421
|
}
|
|
1241
|
-
function
|
|
1422
|
+
function Gr(e, t) {
|
|
1242
1423
|
switch (t) {
|
|
1243
1424
|
case "not_started":
|
|
1244
|
-
return e("
|
|
1425
|
+
return e("itemStatusNotStarted");
|
|
1245
1426
|
case "in_progress":
|
|
1246
|
-
return e("
|
|
1427
|
+
return e("itemStatusInProgress");
|
|
1247
1428
|
case "submitted":
|
|
1248
|
-
return e("
|
|
1429
|
+
return e("itemStatusSubmitted");
|
|
1249
1430
|
case "graded":
|
|
1250
|
-
return e("
|
|
1431
|
+
return e("itemStatusGraded");
|
|
1251
1432
|
case "missing":
|
|
1252
|
-
return e("
|
|
1433
|
+
return e("itemStatusMissing");
|
|
1253
1434
|
case "locked":
|
|
1254
|
-
return e("
|
|
1435
|
+
return e("itemStatusLocked");
|
|
1255
1436
|
}
|
|
1256
1437
|
}
|
|
1257
|
-
function
|
|
1258
|
-
return /* @__PURE__ */ o(
|
|
1438
|
+
function vt(e, t, n) {
|
|
1439
|
+
return /* @__PURE__ */ o(Jt, { color: e.color, renderIcon: e.icon, "data-testid": n, children: t });
|
|
1259
1440
|
}
|
|
1260
|
-
function
|
|
1261
|
-
const { t } =
|
|
1262
|
-
return
|
|
1263
|
-
|
|
1264
|
-
|
|
1441
|
+
function jr({ status: e }) {
|
|
1442
|
+
const { t } = k();
|
|
1443
|
+
return vt(
|
|
1444
|
+
Or[e],
|
|
1445
|
+
Br(t, e),
|
|
1265
1446
|
"module-status-pill"
|
|
1266
1447
|
);
|
|
1267
1448
|
}
|
|
1268
|
-
function
|
|
1269
|
-
const { t } =
|
|
1270
|
-
return
|
|
1271
|
-
|
|
1272
|
-
|
|
1449
|
+
function Yr({ status: e }) {
|
|
1450
|
+
const { t } = k();
|
|
1451
|
+
return vt(
|
|
1452
|
+
$r[e],
|
|
1453
|
+
Gr(t, e),
|
|
1273
1454
|
"item-status-pill"
|
|
1274
1455
|
);
|
|
1275
1456
|
}
|
|
1276
|
-
const
|
|
1277
|
-
assignment: /* @__PURE__ */ o(
|
|
1278
|
-
quiz: /* @__PURE__ */ o(
|
|
1279
|
-
discussion: /* @__PURE__ */ o(
|
|
1280
|
-
page: /* @__PURE__ */ o(
|
|
1281
|
-
file: /* @__PURE__ */ o(
|
|
1282
|
-
external_url: /* @__PURE__ */ o(
|
|
1283
|
-
external_tool: /* @__PURE__ */ o(
|
|
1284
|
-
sub_header: /* @__PURE__ */ o(
|
|
1285
|
-
},
|
|
1457
|
+
const Wr = {
|
|
1458
|
+
assignment: /* @__PURE__ */ o(Qt, {}),
|
|
1459
|
+
quiz: /* @__PURE__ */ o(Wt, {}),
|
|
1460
|
+
discussion: /* @__PURE__ */ o(Yt, {}),
|
|
1461
|
+
page: /* @__PURE__ */ o(jt, {}),
|
|
1462
|
+
file: /* @__PURE__ */ o(Gt, {}),
|
|
1463
|
+
external_url: /* @__PURE__ */ o(Bt, {}),
|
|
1464
|
+
external_tool: /* @__PURE__ */ o($t, {}),
|
|
1465
|
+
sub_header: /* @__PURE__ */ o(Ot, {})
|
|
1466
|
+
}, Qr = 1.75, Hr = {
|
|
1286
1467
|
contentVisibility: "auto",
|
|
1287
1468
|
containIntrinsicSize: "auto 3.5rem"
|
|
1288
1469
|
};
|
|
1289
|
-
function
|
|
1290
|
-
|
|
1470
|
+
function Kr({ item: e, today: t, navigation: n }) {
|
|
1471
|
+
var p;
|
|
1472
|
+
const { t: s, locale: r } = k(), i = e.title || s("itemUntitled");
|
|
1291
1473
|
if (e.type === "sub_header")
|
|
1292
1474
|
return /* @__PURE__ */ o(
|
|
1293
|
-
|
|
1475
|
+
y,
|
|
1294
1476
|
{
|
|
1295
1477
|
as: "div",
|
|
1296
1478
|
padding: "x-small small",
|
|
1297
1479
|
margin: "x-small 0 0 0",
|
|
1298
1480
|
"data-testid": `module-item-${e.id}`,
|
|
1299
|
-
children: /* @__PURE__ */ o(
|
|
1481
|
+
children: /* @__PURE__ */ o(
|
|
1482
|
+
b,
|
|
1483
|
+
{
|
|
1484
|
+
size: "small",
|
|
1485
|
+
weight: "bold",
|
|
1486
|
+
transform: "uppercase",
|
|
1487
|
+
letterSpacing: "expanded",
|
|
1488
|
+
"data-testid": "module-item-title",
|
|
1489
|
+
"data-sub-header": "true",
|
|
1490
|
+
children: i
|
|
1491
|
+
}
|
|
1492
|
+
)
|
|
1300
1493
|
}
|
|
1301
1494
|
);
|
|
1302
|
-
const
|
|
1303
|
-
e.dueAt &&
|
|
1304
|
-
const
|
|
1305
|
-
|
|
1306
|
-
const
|
|
1307
|
-
return
|
|
1308
|
-
|
|
1495
|
+
const u = ((p = n == null ? void 0 : n.getItemHref) == null ? void 0 : p.call(n, e)) ?? e.url ?? null, a = e.status === "locked", c = n == null ? void 0 : n.onItemClick, g = c ? (f) => c(e, f) : void 0, l = [Nr(s, e.type)];
|
|
1496
|
+
e.dueAt && l.push(At(s, e.dueAt, t, r));
|
|
1497
|
+
const m = Dr(s, e.pointsPossible);
|
|
1498
|
+
m && l.push(m), e.completionRequirement && l.push(kr(s, e.completionRequirement));
|
|
1499
|
+
const M = cn(e);
|
|
1500
|
+
return M !== null && l.push(s("durationMinutes", { count: M })), e.published || l.push(s("itemUnpublishedLabel")), /* @__PURE__ */ o("div", { style: { marginLeft: `${e.indent * Qr}rem`, ...Hr }, children: /* @__PURE__ */ o(
|
|
1501
|
+
y,
|
|
1309
1502
|
{
|
|
1310
1503
|
as: "div",
|
|
1311
1504
|
background: "secondary",
|
|
@@ -1313,10 +1506,10 @@ function is({ item: e, today: t }) {
|
|
|
1313
1506
|
padding: "x-small small",
|
|
1314
1507
|
margin: "x-small 0 0 0",
|
|
1315
1508
|
"data-testid": `module-item-${e.id}`,
|
|
1316
|
-
children: /* @__PURE__ */
|
|
1317
|
-
e.indent > 0 ? /* @__PURE__ */ o(
|
|
1318
|
-
/* @__PURE__ */ o(
|
|
1319
|
-
|
|
1509
|
+
children: /* @__PURE__ */ _(T, { alignItems: "center", gap: "small", children: [
|
|
1510
|
+
e.indent > 0 ? /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ o(b, { color: "secondary", children: /* @__PURE__ */ o(Ut, {}) }) }) : null,
|
|
1511
|
+
/* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ o(
|
|
1512
|
+
y,
|
|
1320
1513
|
{
|
|
1321
1514
|
as: "div",
|
|
1322
1515
|
background: "primary",
|
|
@@ -1326,92 +1519,131 @@ function is({ item: e, today: t }) {
|
|
|
1326
1519
|
width: "2.25rem",
|
|
1327
1520
|
height: "2.25rem",
|
|
1328
1521
|
textAlign: "center",
|
|
1329
|
-
children: /* @__PURE__ */ o(
|
|
1522
|
+
children: /* @__PURE__ */ o(b, { color: "secondary", children: Wr[e.type] })
|
|
1330
1523
|
}
|
|
1331
1524
|
) }),
|
|
1332
|
-
/* @__PURE__ */
|
|
1333
|
-
/* @__PURE__ */ o(
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1525
|
+
/* @__PURE__ */ _(T.Item, { shouldGrow: !0, shouldShrink: !0, children: [
|
|
1526
|
+
/* @__PURE__ */ o(y, { as: "div", children: a || !u ? /* @__PURE__ */ o(
|
|
1527
|
+
b,
|
|
1528
|
+
{
|
|
1529
|
+
weight: "bold",
|
|
1530
|
+
size: "small",
|
|
1531
|
+
color: a ? "secondary" : "primary",
|
|
1532
|
+
"data-testid": "module-item-title",
|
|
1533
|
+
"data-locked": a ? "true" : void 0,
|
|
1534
|
+
children: i
|
|
1535
|
+
}
|
|
1536
|
+
) : /* @__PURE__ */ _(
|
|
1537
|
+
Xt,
|
|
1538
|
+
{
|
|
1539
|
+
href: u,
|
|
1540
|
+
onClick: g,
|
|
1541
|
+
forceButtonRole: !1,
|
|
1542
|
+
isWithinText: !1,
|
|
1543
|
+
target: e.newTab ? "_blank" : void 0,
|
|
1544
|
+
rel: e.newTab ? "noopener noreferrer" : void 0,
|
|
1545
|
+
children: [
|
|
1546
|
+
/* @__PURE__ */ o(b, { weight: "bold", size: "small", color: "primary", "data-testid": "module-item-title", children: i }),
|
|
1547
|
+
e.newTab ? /* @__PURE__ */ o(Zt, { children: ` ${s("opensInNewWindow")}` }) : null
|
|
1548
|
+
]
|
|
1549
|
+
}
|
|
1550
|
+
) }),
|
|
1551
|
+
/* @__PURE__ */ o(y, { as: "div", children: /* @__PURE__ */ o(b, { size: "x-small", color: "secondary", "data-testid": "module-item-meta", children: l.map((f, h) => /* @__PURE__ */ _("span", { children: [
|
|
1552
|
+
h > 0 ? /* @__PURE__ */ o("span", { "aria-hidden": "true", children: " | " }) : null,
|
|
1553
|
+
/* @__PURE__ */ o("span", { children: f })
|
|
1554
|
+
] }, f)) }) })
|
|
1338
1555
|
] }),
|
|
1339
|
-
e.status ? /* @__PURE__ */ o(
|
|
1556
|
+
e.status ? /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ o(Yr, { status: e.status }) }) : null
|
|
1340
1557
|
] })
|
|
1341
1558
|
}
|
|
1342
1559
|
) });
|
|
1343
1560
|
}
|
|
1344
|
-
const
|
|
1345
|
-
function
|
|
1346
|
-
|
|
1347
|
-
|
|
1561
|
+
const Vr = Ye(Kr), ze = "3rem";
|
|
1562
|
+
function Zr({
|
|
1563
|
+
label: e,
|
|
1564
|
+
dimmed: t = !1
|
|
1565
|
+
}) {
|
|
1566
|
+
return e === null ? null : /* @__PURE__ */ o(
|
|
1567
|
+
y,
|
|
1568
|
+
{
|
|
1569
|
+
as: "div",
|
|
1570
|
+
display: "inline-block",
|
|
1571
|
+
borderWidth: "small",
|
|
1572
|
+
borderRadius: "large",
|
|
1573
|
+
borderColor: t ? "primary" : "secondary",
|
|
1574
|
+
minWidth: ze,
|
|
1575
|
+
height: ze,
|
|
1576
|
+
padding: "0 xx-small",
|
|
1577
|
+
"data-testid": "module-number",
|
|
1578
|
+
children: /* @__PURE__ */ o(T, { height: "100%", alignItems: "center", justifyItems: "center", children: /* @__PURE__ */ o(b, { weight: "bold", size: "medium", color: t ? "secondary" : "primary", children: e }) })
|
|
1579
|
+
}
|
|
1580
|
+
);
|
|
1581
|
+
}
|
|
1582
|
+
function Xr({ module: e, today: t }) {
|
|
1583
|
+
var a, c;
|
|
1584
|
+
const { t: n, locale: s } = k(), r = ((a = e.progress) == null ? void 0 : a.status) === "locked", i = e.unlockAt;
|
|
1348
1585
|
if (r && i)
|
|
1349
|
-
return /* @__PURE__ */ o(
|
|
1586
|
+
return /* @__PURE__ */ o(b, { size: "small", color: "secondary", "data-testid": "module-byline", children: qe(n, i, t, s) });
|
|
1350
1587
|
if (r)
|
|
1351
|
-
return /* @__PURE__ */ o(
|
|
1352
|
-
const u = (
|
|
1353
|
-
return u ? /* @__PURE__ */ o(
|
|
1354
|
-
}
|
|
1355
|
-
function
|
|
1356
|
-
const { t
|
|
1357
|
-
return !
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
s.requirementsMet,
|
|
1377
|
-
s.requirementCount,
|
|
1378
|
-
n
|
|
1379
|
-
) }) })
|
|
1380
|
-
] }) })
|
|
1381
|
-
);
|
|
1588
|
+
return /* @__PURE__ */ o(b, { size: "small", color: "secondary", "data-testid": "module-byline", children: n("lockedByline") });
|
|
1589
|
+
const u = (c = e.progress) == null ? void 0 : c.latestDueAt;
|
|
1590
|
+
return u ? /* @__PURE__ */ o(b, { size: "small", color: "secondary", "data-testid": "module-byline", children: At(n, u, t, s) }) : !e.progress && i ? /* @__PURE__ */ o(b, { size: "small", color: "secondary", "data-testid": "module-byline", children: qe(n, i, t, s) }) : null;
|
|
1591
|
+
}
|
|
1592
|
+
function Jr({ module: e }) {
|
|
1593
|
+
const { t } = k(), n = e.progress;
|
|
1594
|
+
return !n || n.requirementCount <= 0 ? null : /* @__PURE__ */ _(T, { alignItems: "center", gap: "small", margin: "small 0 0 0", "data-testid": "module-progress", children: [
|
|
1595
|
+
/* @__PURE__ */ o(T.Item, { size: "22rem", shouldShrink: !0, children: /* @__PURE__ */ o(
|
|
1596
|
+
Vt,
|
|
1597
|
+
{
|
|
1598
|
+
size: "x-small",
|
|
1599
|
+
meterColor: n.percentComplete >= 100 ? "success" : "brand",
|
|
1600
|
+
valueNow: n.requirementsMet,
|
|
1601
|
+
valueMax: Math.max(n.requirementCount, 1),
|
|
1602
|
+
shouldAnimate: !1,
|
|
1603
|
+
screenReaderLabel: t("moduleProgressScreenReaderLabel", { name: e.name })
|
|
1604
|
+
}
|
|
1605
|
+
) }),
|
|
1606
|
+
/* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ o(b, { size: "small", color: "secondary", children: qr(
|
|
1607
|
+
t,
|
|
1608
|
+
n.percentComplete,
|
|
1609
|
+
n.requirementsMet,
|
|
1610
|
+
n.requirementCount
|
|
1611
|
+
) }) })
|
|
1612
|
+
] });
|
|
1382
1613
|
}
|
|
1383
|
-
const
|
|
1384
|
-
function
|
|
1614
|
+
const Ue = (e) => `platform-modules-panel-${e}`;
|
|
1615
|
+
function eo({
|
|
1385
1616
|
module: e,
|
|
1386
1617
|
state: t,
|
|
1387
1618
|
today: n,
|
|
1388
|
-
|
|
1619
|
+
navigation: s,
|
|
1620
|
+
showDiagnostics: r
|
|
1389
1621
|
}) {
|
|
1390
|
-
const { t:
|
|
1391
|
-
return
|
|
1392
|
-
!c ||
|
|
1393
|
-
|
|
1394
|
-
loaded:
|
|
1395
|
-
|
|
1622
|
+
const { t: i } = k(), u = $(null), a = t.items.length, c = !t.isLoading && !t.isFetchingNextPage;
|
|
1623
|
+
return de(() => {
|
|
1624
|
+
!c || a === 0 || u.current !== a && (u.current = a, Qe(
|
|
1625
|
+
i("itemsLoadedAnnouncement", {
|
|
1626
|
+
loaded: a,
|
|
1627
|
+
count: e.itemCount,
|
|
1396
1628
|
name: e.name
|
|
1397
1629
|
})
|
|
1398
1630
|
));
|
|
1399
|
-
}, [c,
|
|
1400
|
-
|
|
1631
|
+
}, [c, a, e.itemCount, e.name, i]), t.error ? /* @__PURE__ */ o(y, { as: "div", margin: "small 0 0 0", children: /* @__PURE__ */ o(
|
|
1632
|
+
Ke,
|
|
1401
1633
|
{
|
|
1402
1634
|
variant: "error",
|
|
1403
1635
|
margin: "0",
|
|
1404
|
-
liveRegion:
|
|
1636
|
+
liveRegion: He,
|
|
1405
1637
|
liveRegionPoliteness: "assertive",
|
|
1406
1638
|
"data-testid": "items-error",
|
|
1407
|
-
children:
|
|
1639
|
+
children: i("itemsLoadErrorAlert", { message: t.error.message })
|
|
1408
1640
|
}
|
|
1409
|
-
) }) : t.isLoading ? /* @__PURE__ */ y
|
|
1410
|
-
/* @__PURE__ */ o(
|
|
1641
|
+
) }) : t.isLoading ? /* @__PURE__ */ _(y, { as: "div", margin: "small 0 0 0", "data-testid": "items-loading", children: [
|
|
1642
|
+
/* @__PURE__ */ o(tt, { size: "x-small", renderTitle: i("itemsLoadingSpinnerLabel") }),
|
|
1411
1643
|
" ",
|
|
1412
|
-
/* @__PURE__ */ o(
|
|
1413
|
-
] }) : /* @__PURE__ */ y
|
|
1414
|
-
|
|
1644
|
+
/* @__PURE__ */ o(b, { size: "small", color: "secondary", children: i("itemsLoadingText") })
|
|
1645
|
+
] }) : /* @__PURE__ */ _(y, { as: "div", margin: "small 0 0 0", children: [
|
|
1646
|
+
r ? /* @__PURE__ */ _(b, { size: "x-small", color: "secondary", "data-testid": "items-source", children: [
|
|
1415
1647
|
"items source: ",
|
|
1416
1648
|
t.source,
|
|
1417
1649
|
" · loaded ",
|
|
@@ -1419,35 +1651,37 @@ function cs({
|
|
|
1419
1651
|
" of ",
|
|
1420
1652
|
e.itemCount
|
|
1421
1653
|
] }) : null,
|
|
1422
|
-
t.items.length === 0 ? /* @__PURE__ */ o(
|
|
1423
|
-
t.hasNextPage ? /* @__PURE__ */ o(
|
|
1424
|
-
|
|
1654
|
+
t.items.length === 0 ? /* @__PURE__ */ o(y, { as: "div", padding: "small", "data-testid": "items-empty", children: /* @__PURE__ */ o(b, { size: "small", color: "secondary", children: i("noItemsEmptyState") }) }) : /* @__PURE__ */ o("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, "data-testid": "items-list", children: t.items.map((g) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o(Vr, { item: g, today: n, navigation: s }) }, g.id)) }),
|
|
1655
|
+
t.hasNextPage ? /* @__PURE__ */ o(y, { as: "div", margin: "small 0 0 0", textAlign: "center", children: /* @__PURE__ */ o(
|
|
1656
|
+
X,
|
|
1425
1657
|
{
|
|
1426
1658
|
size: "small",
|
|
1427
1659
|
onClick: t.fetchNextPage,
|
|
1428
1660
|
interaction: t.isFetchingNextPage ? "disabled" : "enabled",
|
|
1429
1661
|
"data-testid": "load-more-items",
|
|
1430
|
-
children: t.isFetchingNextPage ?
|
|
1431
|
-
loaded:
|
|
1432
|
-
|
|
1662
|
+
children: t.isFetchingNextPage ? i("loadMoreItemsLoading") : i("loadMoreItems", {
|
|
1663
|
+
loaded: t.items.length,
|
|
1664
|
+
count: e.itemCount
|
|
1433
1665
|
})
|
|
1434
1666
|
}
|
|
1435
1667
|
) }) : null
|
|
1436
1668
|
] });
|
|
1437
1669
|
}
|
|
1438
|
-
function
|
|
1670
|
+
function to({
|
|
1439
1671
|
module: e,
|
|
1440
1672
|
expanded: t,
|
|
1441
1673
|
onToggle: n,
|
|
1442
1674
|
itemsState: s,
|
|
1443
1675
|
today: r,
|
|
1444
|
-
|
|
1445
|
-
|
|
1676
|
+
navigation: i,
|
|
1677
|
+
showDiagnostics: u = !1,
|
|
1678
|
+
headingLevel: a = "h3",
|
|
1679
|
+
moduleLabel: c
|
|
1446
1680
|
}) {
|
|
1447
|
-
var
|
|
1448
|
-
const { t:
|
|
1449
|
-
return /* @__PURE__ */
|
|
1450
|
-
|
|
1681
|
+
var p;
|
|
1682
|
+
const { t: g, locale: l } = k(), m = ((p = e.progress) == null ? void 0 : p.status) === "locked", M = c === void 0 ? vr(e.position, l) : c;
|
|
1683
|
+
return /* @__PURE__ */ _(
|
|
1684
|
+
y,
|
|
1451
1685
|
{
|
|
1452
1686
|
as: "div",
|
|
1453
1687
|
background: "primary",
|
|
@@ -1458,77 +1692,66 @@ function ms({
|
|
|
1458
1692
|
margin: "0 0 small 0",
|
|
1459
1693
|
"data-testid": `module-card-${e.id}`,
|
|
1460
1694
|
children: [
|
|
1461
|
-
/* @__PURE__ */
|
|
1462
|
-
/* @__PURE__ */ o(
|
|
1463
|
-
|
|
1464
|
-
{
|
|
1465
|
-
as: "div",
|
|
1466
|
-
borderWidth: "small",
|
|
1467
|
-
borderRadius: "medium",
|
|
1468
|
-
padding: "x-small",
|
|
1469
|
-
width: "2.75rem",
|
|
1470
|
-
textAlign: "center",
|
|
1471
|
-
"data-testid": "module-number",
|
|
1472
|
-
children: /* @__PURE__ */ o(I, { weight: "bold", size: "small", children: Bn(e.position, d) })
|
|
1473
|
-
}
|
|
1474
|
-
) }),
|
|
1475
|
-
/* @__PURE__ */ y(P.Item, { shouldGrow: !0, shouldShrink: !0, children: [
|
|
1476
|
-
/* @__PURE__ */ y(S, { as: "div", children: [
|
|
1695
|
+
/* @__PURE__ */ _(T, { alignItems: "start", gap: "small", "data-testid": "module-header", children: [
|
|
1696
|
+
M !== null ? /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ o(Zr, { label: M, dimmed: m }) }) : null,
|
|
1697
|
+
/* @__PURE__ */ _(T.Item, { shouldGrow: !0, shouldShrink: !0, children: [
|
|
1698
|
+
/* @__PURE__ */ _(y, { as: "div", children: [
|
|
1477
1699
|
/* @__PURE__ */ o(
|
|
1478
|
-
|
|
1700
|
+
Ve,
|
|
1479
1701
|
{
|
|
1480
|
-
level:
|
|
1702
|
+
level: a,
|
|
1481
1703
|
themeOverride: { h2FontSize: "1.375rem", h3FontSize: "1.375rem" },
|
|
1482
1704
|
"data-testid": "module-name",
|
|
1483
|
-
children: /* @__PURE__ */ o(
|
|
1705
|
+
children: /* @__PURE__ */ o(b, { size: "large", weight: "bold", color: m ? "secondary" : "primary", children: e.name })
|
|
1484
1706
|
}
|
|
1485
1707
|
),
|
|
1486
|
-
e.published ? null : /* @__PURE__ */
|
|
1708
|
+
e.published ? null : /* @__PURE__ */ _(b, { size: "x-small", color: "secondary", children: [
|
|
1487
1709
|
" ",
|
|
1488
|
-
|
|
1710
|
+
g("moduleUnpublishedBadge")
|
|
1489
1711
|
] })
|
|
1490
1712
|
] }),
|
|
1491
|
-
/* @__PURE__ */ o(
|
|
1713
|
+
/* @__PURE__ */ o(y, { as: "div", children: /* @__PURE__ */ o(Xr, { module: e, today: r }) }),
|
|
1714
|
+
/* @__PURE__ */ o(Jr, { module: e })
|
|
1492
1715
|
] }),
|
|
1493
|
-
e.progress ? /* @__PURE__ */ o(
|
|
1494
|
-
/* @__PURE__ */ o(
|
|
1495
|
-
|
|
1716
|
+
e.progress ? /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ o(jr, { status: e.progress.status }) }) : null,
|
|
1717
|
+
/* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ o(
|
|
1718
|
+
zt,
|
|
1496
1719
|
{
|
|
1497
1720
|
size: "small",
|
|
1498
1721
|
withBorder: !0,
|
|
1499
1722
|
withBackground: !1,
|
|
1500
|
-
screenReaderLabel: t ?
|
|
1723
|
+
screenReaderLabel: t ? g("collapseModule", { name: e.name }) : g("expandModule", { name: e.name }),
|
|
1501
1724
|
"aria-expanded": t,
|
|
1502
|
-
"aria-controls":
|
|
1725
|
+
"aria-controls": Ue(e.id),
|
|
1503
1726
|
onClick: () => n(e.id),
|
|
1504
1727
|
"data-testid": `toggle-module-${e.id}`,
|
|
1505
|
-
children: t ? /* @__PURE__ */ o(
|
|
1728
|
+
children: t ? /* @__PURE__ */ o(Ht, {}) : /* @__PURE__ */ o(et, {})
|
|
1506
1729
|
}
|
|
1507
1730
|
) })
|
|
1508
1731
|
] }),
|
|
1509
|
-
/* @__PURE__ */ o(
|
|
1510
|
-
|
|
1511
|
-
cs,
|
|
1732
|
+
/* @__PURE__ */ o("div", { id: Ue(e.id), role: "group", "aria-label": e.name, hidden: !t, children: t ? /* @__PURE__ */ o(
|
|
1733
|
+
eo,
|
|
1512
1734
|
{
|
|
1513
1735
|
module: e,
|
|
1514
1736
|
state: s,
|
|
1515
1737
|
today: r,
|
|
1516
|
-
|
|
1738
|
+
navigation: i,
|
|
1739
|
+
showDiagnostics: u
|
|
1517
1740
|
}
|
|
1518
1741
|
) : null })
|
|
1519
1742
|
]
|
|
1520
1743
|
}
|
|
1521
1744
|
);
|
|
1522
1745
|
}
|
|
1523
|
-
const
|
|
1524
|
-
function
|
|
1746
|
+
const no = Ye(to);
|
|
1747
|
+
function so({
|
|
1525
1748
|
counts: e,
|
|
1526
1749
|
itemsMode: t,
|
|
1527
1750
|
loadedModules: n
|
|
1528
1751
|
}) {
|
|
1529
1752
|
const s = e.listModules + e.listModuleItems;
|
|
1530
1753
|
return /* @__PURE__ */ o(
|
|
1531
|
-
|
|
1754
|
+
y,
|
|
1532
1755
|
{
|
|
1533
1756
|
as: "div",
|
|
1534
1757
|
background: "secondary",
|
|
@@ -1537,25 +1760,25 @@ function hs({
|
|
|
1537
1760
|
padding: "x-small small",
|
|
1538
1761
|
margin: "0 0 small 0",
|
|
1539
1762
|
"data-testid": "dev-diagnostics",
|
|
1540
|
-
children: /* @__PURE__ */
|
|
1541
|
-
/* @__PURE__ */ o(
|
|
1542
|
-
/* @__PURE__ */ o(
|
|
1763
|
+
children: /* @__PURE__ */ _(T, { gap: "medium", wrap: "wrap", children: [
|
|
1764
|
+
/* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ o(b, { size: "x-small", weight: "bold", children: "Adapter requests" }) }),
|
|
1765
|
+
/* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ _(b, { size: "x-small", "data-testid": "request-count-list-modules", children: [
|
|
1543
1766
|
"listModules: ",
|
|
1544
1767
|
e.listModules
|
|
1545
1768
|
] }) }),
|
|
1546
|
-
/* @__PURE__ */ o(
|
|
1769
|
+
/* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ _(b, { size: "x-small", "data-testid": "request-count-list-module-items", children: [
|
|
1547
1770
|
"listModuleItems: ",
|
|
1548
1771
|
e.listModuleItems
|
|
1549
1772
|
] }) }),
|
|
1550
|
-
/* @__PURE__ */ o(
|
|
1773
|
+
/* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ _(b, { size: "x-small", weight: "bold", "data-testid": "request-count-total", children: [
|
|
1551
1774
|
"total: ",
|
|
1552
1775
|
s
|
|
1553
1776
|
] }) }),
|
|
1554
|
-
/* @__PURE__ */ o(
|
|
1777
|
+
/* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ _(b, { size: "x-small", "data-testid": "resolved-items-mode", children: [
|
|
1555
1778
|
"itemsMode: ",
|
|
1556
1779
|
t ?? "probing…"
|
|
1557
1780
|
] }) }),
|
|
1558
|
-
/* @__PURE__ */ o(
|
|
1781
|
+
/* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ _(b, { size: "x-small", "data-testid": "modules-loaded-count", children: [
|
|
1559
1782
|
"modules loaded: ",
|
|
1560
1783
|
n
|
|
1561
1784
|
] }) })
|
|
@@ -1563,7 +1786,7 @@ function hs({
|
|
|
1563
1786
|
}
|
|
1564
1787
|
);
|
|
1565
1788
|
}
|
|
1566
|
-
function
|
|
1789
|
+
function oi({
|
|
1567
1790
|
data: e,
|
|
1568
1791
|
courseName: t,
|
|
1569
1792
|
courseContext: n,
|
|
@@ -1571,112 +1794,113 @@ function ar({
|
|
|
1571
1794
|
requestCounts: r,
|
|
1572
1795
|
showDiagnostics: i = r !== void 0,
|
|
1573
1796
|
initialFilter: u = "all",
|
|
1574
|
-
|
|
1575
|
-
|
|
1797
|
+
navigation: a,
|
|
1798
|
+
as: c = "div",
|
|
1799
|
+
headingLevel: g = "h2"
|
|
1576
1800
|
}) {
|
|
1577
1801
|
const {
|
|
1578
|
-
modules:
|
|
1579
|
-
hasNextPage:
|
|
1580
|
-
fetchNextPage:
|
|
1581
|
-
isFetchingNextPage:
|
|
1582
|
-
isLoading:
|
|
1802
|
+
modules: l,
|
|
1803
|
+
hasNextPage: m,
|
|
1804
|
+
fetchNextPage: M,
|
|
1805
|
+
isFetchingNextPage: p,
|
|
1806
|
+
isLoading: f,
|
|
1583
1807
|
error: h,
|
|
1584
|
-
itemsMode:
|
|
1585
|
-
expandedModuleIds:
|
|
1808
|
+
itemsMode: P,
|
|
1809
|
+
expandedModuleIds: C,
|
|
1586
1810
|
toggleModule: v,
|
|
1587
1811
|
expandModule: A,
|
|
1588
|
-
collapseModule:
|
|
1589
|
-
getItems:
|
|
1590
|
-
} = e, { t: E, locale:
|
|
1591
|
-
|
|
1592
|
-
var
|
|
1593
|
-
!U.current ||
|
|
1594
|
-
}, [
|
|
1595
|
-
const
|
|
1596
|
-
() =>
|
|
1597
|
-
(
|
|
1812
|
+
collapseModule: se,
|
|
1813
|
+
getItems: re
|
|
1814
|
+
} = e, { t: E, locale: F } = k(), H = t ?? E("pageTitle"), [q, K] = Z(""), [z, B] = Z(u), V = $(null), oe = je(), U = $(!1), [ie] = Z(() => /* @__PURE__ */ new Date()), O = s ?? ie;
|
|
1815
|
+
de(() => {
|
|
1816
|
+
var w;
|
|
1817
|
+
!U.current || p || (U.current = !1, Qe(E("modulesLoadedAnnouncement", { count: l.length })), (w = V.current) == null || w.focus());
|
|
1818
|
+
}, [p, l.length, E]);
|
|
1819
|
+
const G = N(
|
|
1820
|
+
() => l.filter(
|
|
1821
|
+
(w) => Fe(w, q, F) && Re(w, z, O)
|
|
1598
1822
|
),
|
|
1599
|
-
[
|
|
1600
|
-
),
|
|
1601
|
-
const
|
|
1823
|
+
[l, q, z, O, F]
|
|
1824
|
+
), le = N(() => {
|
|
1825
|
+
const w = l.filter((j) => Fe(j, q, F)), L = (j) => w.filter((R) => Re(R, j, O)).length;
|
|
1602
1826
|
return {
|
|
1603
|
-
all:
|
|
1604
|
-
in_progress:
|
|
1605
|
-
complete:
|
|
1606
|
-
due_this_week:
|
|
1607
|
-
missing:
|
|
1827
|
+
all: w.length,
|
|
1828
|
+
in_progress: L("in_progress"),
|
|
1829
|
+
complete: L("complete"),
|
|
1830
|
+
due_this_week: L("due_this_week"),
|
|
1831
|
+
missing: L("missing")
|
|
1608
1832
|
};
|
|
1609
|
-
}, [
|
|
1610
|
-
for (const
|
|
1611
|
-
},
|
|
1612
|
-
for (const
|
|
1613
|
-
},
|
|
1614
|
-
return /* @__PURE__ */ y
|
|
1615
|
-
n ? /* @__PURE__ */ y
|
|
1616
|
-
/* @__PURE__ */ o(
|
|
1617
|
-
/* @__PURE__ */
|
|
1833
|
+
}, [l, q, O, F]), S = () => {
|
|
1834
|
+
for (const w of G) A(w.id);
|
|
1835
|
+
}, I = () => {
|
|
1836
|
+
for (const w of C) se(w);
|
|
1837
|
+
}, x = l.length > 0 && G.length === 0 && !f && !h;
|
|
1838
|
+
return /* @__PURE__ */ _(y, { as: c, display: "block", "data-testid": "modules-list", children: [
|
|
1839
|
+
n ? /* @__PURE__ */ _(y, { as: "div", children: [
|
|
1840
|
+
/* @__PURE__ */ o(b, { size: "small", color: "brand", children: n }),
|
|
1841
|
+
/* @__PURE__ */ _(b, { size: "small", color: "secondary", children: [
|
|
1618
1842
|
" ",
|
|
1619
1843
|
"/",
|
|
1620
1844
|
" "
|
|
1621
1845
|
] }),
|
|
1622
|
-
/* @__PURE__ */ o(
|
|
1846
|
+
/* @__PURE__ */ o(b, { size: "small", color: "secondary", children: H })
|
|
1623
1847
|
] }) : null,
|
|
1624
|
-
/* @__PURE__ */ o(
|
|
1848
|
+
/* @__PURE__ */ o(Ve, { level: g, margin: "x-small 0 medium 0", children: H }),
|
|
1625
1849
|
r ? /* @__PURE__ */ o(
|
|
1626
|
-
|
|
1850
|
+
so,
|
|
1627
1851
|
{
|
|
1628
1852
|
counts: r,
|
|
1629
|
-
itemsMode:
|
|
1630
|
-
loadedModules:
|
|
1853
|
+
itemsMode: P,
|
|
1854
|
+
loadedModules: l.length
|
|
1631
1855
|
}
|
|
1632
1856
|
) : null,
|
|
1633
|
-
/* @__PURE__ */
|
|
1634
|
-
/* @__PURE__ */ o(
|
|
1635
|
-
|
|
1857
|
+
/* @__PURE__ */ _(T, { gap: "small", wrap: "wrap", alignItems: "end", children: [
|
|
1858
|
+
/* @__PURE__ */ o(T.Item, { size: "24rem", shouldShrink: !0, children: /* @__PURE__ */ o(
|
|
1859
|
+
en,
|
|
1636
1860
|
{
|
|
1637
|
-
renderLabel: E("
|
|
1638
|
-
placeholder: E("
|
|
1639
|
-
"aria-describedby":
|
|
1861
|
+
renderLabel: E("moduleSearchLabel"),
|
|
1862
|
+
placeholder: E("searchPlaceholder"),
|
|
1863
|
+
"aria-describedby": oe,
|
|
1640
1864
|
value: q,
|
|
1641
|
-
onChange: (
|
|
1642
|
-
renderBeforeInput: /* @__PURE__ */ o(
|
|
1865
|
+
onChange: (w, L) => K(L),
|
|
1866
|
+
renderBeforeInput: /* @__PURE__ */ o(Kt, { inline: !1 }),
|
|
1643
1867
|
"data-testid": "modules-search"
|
|
1644
1868
|
}
|
|
1645
1869
|
) }),
|
|
1646
|
-
/* @__PURE__ */ o(
|
|
1647
|
-
/* @__PURE__ */ o(
|
|
1648
|
-
|
|
1870
|
+
/* @__PURE__ */ o(T.Item, { shouldGrow: !0 }),
|
|
1871
|
+
/* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ _(
|
|
1872
|
+
Me,
|
|
1649
1873
|
{
|
|
1650
1874
|
placement: "bottom end",
|
|
1651
|
-
trigger: /* @__PURE__ */ o(
|
|
1875
|
+
trigger: /* @__PURE__ */ o(X, { renderIcon: /* @__PURE__ */ o(et, {}), "data-testid": "expand-collapse-trigger", children: E("expandCollapseTrigger") }),
|
|
1652
1876
|
children: [
|
|
1653
|
-
/* @__PURE__ */ o(
|
|
1654
|
-
/* @__PURE__ */ o(
|
|
1877
|
+
/* @__PURE__ */ o(Me.Item, { onSelect: S, "data-testid": "expand-all", children: E("expandAll") }),
|
|
1878
|
+
/* @__PURE__ */ o(Me.Item, { onSelect: I, "data-testid": "collapse-all", children: E("collapseAll") })
|
|
1655
1879
|
]
|
|
1656
1880
|
}
|
|
1657
1881
|
) })
|
|
1658
1882
|
] }),
|
|
1659
|
-
/* @__PURE__ */ o(
|
|
1660
|
-
/* @__PURE__ */ o(
|
|
1661
|
-
/* @__PURE__ */ y
|
|
1883
|
+
/* @__PURE__ */ o(y, { as: "div", margin: "xx-small 0 0 0", children: /* @__PURE__ */ o(b, { size: "x-small", color: "secondary", id: oe, children: E("searchScopeHint") }) }),
|
|
1884
|
+
/* @__PURE__ */ o(Ur, { value: z, onChange: B, counts: le }),
|
|
1885
|
+
/* @__PURE__ */ _(y, { as: "div", margin: "medium 0 0 0", children: [
|
|
1662
1886
|
h ? (
|
|
1663
1887
|
// `liveRegion` is what makes this announce; without it InstUI's Alert
|
|
1664
1888
|
// sets no role and no aria-live. See the same fix in ModuleCard.
|
|
1665
1889
|
/* @__PURE__ */ o(
|
|
1666
|
-
|
|
1890
|
+
Ke,
|
|
1667
1891
|
{
|
|
1668
1892
|
variant: "error",
|
|
1669
1893
|
margin: "0 0 small 0",
|
|
1670
|
-
liveRegion:
|
|
1894
|
+
liveRegion: He,
|
|
1671
1895
|
liveRegionPoliteness: "assertive",
|
|
1672
1896
|
"data-testid": "modules-error",
|
|
1673
|
-
children: E("
|
|
1897
|
+
children: E("modulesLoadErrorAlert", { message: h.message })
|
|
1674
1898
|
}
|
|
1675
1899
|
)
|
|
1676
1900
|
) : null,
|
|
1677
|
-
|
|
1678
|
-
!
|
|
1679
|
-
|
|
1901
|
+
f ? /* @__PURE__ */ o(y, { as: "div", padding: "large", textAlign: "center", "data-testid": "modules-loading", children: /* @__PURE__ */ o(tt, { renderTitle: E("modulesLoadingSpinnerLabel") }) }) : null,
|
|
1902
|
+
!f && !h && l.length === 0 ? /* @__PURE__ */ o(
|
|
1903
|
+
y,
|
|
1680
1904
|
{
|
|
1681
1905
|
as: "div",
|
|
1682
1906
|
background: "secondary",
|
|
@@ -1684,11 +1908,11 @@ function ar({
|
|
|
1684
1908
|
padding: "large",
|
|
1685
1909
|
textAlign: "center",
|
|
1686
1910
|
"data-testid": "modules-empty",
|
|
1687
|
-
children: /* @__PURE__ */ o(
|
|
1911
|
+
children: /* @__PURE__ */ o(b, { color: "secondary", children: E("noModulesEmptyState") })
|
|
1688
1912
|
}
|
|
1689
1913
|
) : null,
|
|
1690
|
-
|
|
1691
|
-
|
|
1914
|
+
x ? /* @__PURE__ */ _(
|
|
1915
|
+
y,
|
|
1692
1916
|
{
|
|
1693
1917
|
as: "div",
|
|
1694
1918
|
background: "secondary",
|
|
@@ -1697,59 +1921,56 @@ function ar({
|
|
|
1697
1921
|
textAlign: "center",
|
|
1698
1922
|
"data-testid": "modules-filtered-empty",
|
|
1699
1923
|
children: [
|
|
1700
|
-
/* @__PURE__ */ o(
|
|
1701
|
-
count: G.format(c.length)
|
|
1702
|
-
}) }) }),
|
|
1924
|
+
/* @__PURE__ */ o(y, { as: "div", margin: "0 0 small 0", children: /* @__PURE__ */ o(b, { color: "secondary", children: E("filteredEmptyState", { count: l.length }) }) }),
|
|
1703
1925
|
/* @__PURE__ */ o(
|
|
1704
|
-
|
|
1926
|
+
X,
|
|
1705
1927
|
{
|
|
1706
1928
|
size: "small",
|
|
1707
1929
|
onClick: () => {
|
|
1708
|
-
|
|
1930
|
+
B("all"), K(""), U.current = !0;
|
|
1709
1931
|
},
|
|
1710
|
-
children: E("
|
|
1932
|
+
children: E("clearFilters")
|
|
1711
1933
|
}
|
|
1712
1934
|
)
|
|
1713
1935
|
]
|
|
1714
1936
|
}
|
|
1715
1937
|
) : null,
|
|
1716
|
-
/* @__PURE__ */ o("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, "data-testid": "modules-stack", children:
|
|
1717
|
-
|
|
1938
|
+
/* @__PURE__ */ o("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, "data-testid": "modules-stack", children: G.map((w) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o(
|
|
1939
|
+
no,
|
|
1718
1940
|
{
|
|
1719
|
-
module:
|
|
1720
|
-
expanded:
|
|
1941
|
+
module: w,
|
|
1942
|
+
expanded: C.includes(w.id),
|
|
1721
1943
|
onToggle: v,
|
|
1722
|
-
itemsState:
|
|
1723
|
-
today:
|
|
1944
|
+
itemsState: re(w.id),
|
|
1945
|
+
today: O,
|
|
1724
1946
|
showDiagnostics: i,
|
|
1725
|
-
|
|
1947
|
+
navigation: a,
|
|
1948
|
+
headingLevel: g === "h1" ? "h2" : "h3"
|
|
1726
1949
|
}
|
|
1727
|
-
) },
|
|
1950
|
+
) }, w.id)) })
|
|
1728
1951
|
] }),
|
|
1729
|
-
|
|
1730
|
-
|
|
1952
|
+
m ? /* @__PURE__ */ o(y, { as: "div", textAlign: "center", margin: "small 0 0 0", children: /* @__PURE__ */ o(
|
|
1953
|
+
X,
|
|
1731
1954
|
{
|
|
1732
1955
|
color: "primary",
|
|
1733
1956
|
onClick: () => {
|
|
1734
|
-
U.current = !0,
|
|
1957
|
+
U.current = !0, M();
|
|
1735
1958
|
},
|
|
1736
|
-
interaction:
|
|
1959
|
+
interaction: p ? "disabled" : "enabled",
|
|
1737
1960
|
"data-testid": "load-more-modules",
|
|
1738
|
-
children:
|
|
1961
|
+
children: p ? E("loadMoreModulesLoading") : E("loadMoreModules", { count: l.length })
|
|
1739
1962
|
}
|
|
1740
|
-
) }) :
|
|
1741
|
-
|
|
1963
|
+
) }) : l.length > 0 ? /* @__PURE__ */ o(y, { as: "div", textAlign: "center", margin: "small 0 0 0", children: /* @__PURE__ */ o(
|
|
1964
|
+
b,
|
|
1742
1965
|
{
|
|
1743
1966
|
size: "x-small",
|
|
1744
1967
|
color: "secondary",
|
|
1745
1968
|
"data-testid": "modules-all-loaded",
|
|
1746
|
-
elementRef: (
|
|
1747
|
-
V.current =
|
|
1969
|
+
elementRef: (w) => {
|
|
1970
|
+
V.current = w;
|
|
1748
1971
|
},
|
|
1749
1972
|
tabIndex: -1,
|
|
1750
|
-
children: E("
|
|
1751
|
-
count: G.format(c.length)
|
|
1752
|
-
})
|
|
1973
|
+
children: E("allModulesLoaded", { count: l.length })
|
|
1753
1974
|
}
|
|
1754
1975
|
) }) : null
|
|
1755
1976
|
] });
|
|
@@ -1763,24 +1984,24 @@ const J = [
|
|
|
1763
1984
|
"external_url",
|
|
1764
1985
|
"external_tool",
|
|
1765
1986
|
"sub_header"
|
|
1766
|
-
],
|
|
1987
|
+
], _e = [
|
|
1767
1988
|
"not_started",
|
|
1768
1989
|
"in_progress",
|
|
1769
1990
|
"all_submitted",
|
|
1770
1991
|
"all_graded",
|
|
1771
1992
|
"missing",
|
|
1772
1993
|
"locked"
|
|
1773
|
-
],
|
|
1994
|
+
], Oe = [
|
|
1774
1995
|
"must_view",
|
|
1775
1996
|
"must_submit",
|
|
1776
1997
|
"must_contribute",
|
|
1777
1998
|
"must_mark_done",
|
|
1778
1999
|
"min_score",
|
|
1779
2000
|
"min_percentage"
|
|
1780
|
-
],
|
|
1781
|
-
const n =
|
|
2001
|
+
], ro = ["assignment", "quiz", "discussion"], oo = ["external_url", "external_tool"], io = ["assignment", "quiz", "discussion"], lo = Date.UTC(2025, 0, 6), ao = 864e5, Ie = "1", Nt = (e) => new Date(lo + e * ao).toISOString(), uo = (e, t) => {
|
|
2002
|
+
const n = Oe[Math.floor(t / 3) % Oe.length];
|
|
1782
2003
|
return n === "min_score" ? { itemId: e, type: n, minScore: 10 } : n === "min_percentage" ? { itemId: e, type: n, minPercentage: 80 } : { itemId: e, type: n };
|
|
1783
|
-
},
|
|
2004
|
+
}, Dt = (e, t) => t % 3 === 0 && e !== "sub_header", kt = (e) => _e[(e - 1) % _e.length], co = (e, t) => !io.includes(e) || e === "discussion" && Math.floor(t / J.length) % 2 === 1 ? null : 5 + t % 4 * 5, mo = (e, t, n, s) => {
|
|
1784
2005
|
const r = n ? "in_progress" : "not_started";
|
|
1785
2006
|
switch (e) {
|
|
1786
2007
|
case "locked":
|
|
@@ -1796,58 +2017,59 @@ const J = [
|
|
|
1796
2017
|
case "in_progress":
|
|
1797
2018
|
return t ? s % 3 === 0 ? "submitted" : s % 3 === 1 ? "in_progress" : "not_started" : s % 2 === 0 ? r : "not_started";
|
|
1798
2019
|
}
|
|
1799
|
-
},
|
|
1800
|
-
const u = String(e), a = String(e * 1e3 + t + 1),
|
|
2020
|
+
}, go = (e) => e.status === "submitted" || e.status === "graded" || e.status === "in_progress" && e.pointsPossible == null, fo = (e, t, n, s, r, i) => {
|
|
2021
|
+
const u = String(e), a = String(e * 1e3 + t + 1), c = J[n % J.length], g = c === "sub_header", l = ro.includes(c) && (n % 4 === 0 || s === "missing"), m = Dt(c, n) ? uo(a, n) : null;
|
|
1801
2022
|
return {
|
|
1802
2023
|
id: a,
|
|
1803
2024
|
moduleId: u,
|
|
1804
|
-
title: `${
|
|
1805
|
-
type:
|
|
2025
|
+
title: `${c} ${t + 1}`,
|
|
2026
|
+
type: c,
|
|
1806
2027
|
position: t + 1,
|
|
1807
2028
|
indent: t % 5 === 4 ? 1 : 0,
|
|
1808
2029
|
// 1 in 7 unpublished, so a teacher view always has something to grey out.
|
|
1809
2030
|
// Same rule as the module: a student's page contains no unpublished items,
|
|
1810
2031
|
// so only a teacher fixture greys any out.
|
|
1811
2032
|
published: i === "teacher" ? n % 7 !== 0 : !0,
|
|
1812
|
-
url:
|
|
2033
|
+
url: g ? null : `/courses/${Ie}/modules/items/${a}`,
|
|
2034
|
+
newTab: oo.includes(c) && n % 2 === 0,
|
|
1813
2035
|
completionRequirement: m,
|
|
1814
|
-
dueAt: l ?
|
|
2036
|
+
dueAt: l ? Nt(n % 90) : null,
|
|
1815
2037
|
status: s,
|
|
1816
2038
|
pointsPossible: r,
|
|
1817
2039
|
// Canvas Career only, so it rides in `extensions`. Sparse on purpose: a
|
|
1818
2040
|
// handful per fixture proves the escape hatch survives a round trip, and
|
|
1819
2041
|
// every other item must carry no `extensions` key at all.
|
|
1820
|
-
extensions:
|
|
2042
|
+
extensions: it(
|
|
1821
2043
|
void 0,
|
|
1822
2044
|
n % 37 === 0 ? 5 + n % 4 * 10 : null
|
|
1823
2045
|
)
|
|
1824
2046
|
};
|
|
1825
|
-
},
|
|
1826
|
-
const r =
|
|
2047
|
+
}, ho = (e, t, n, s) => {
|
|
2048
|
+
const r = kt(e), i = [];
|
|
1827
2049
|
let u = 0;
|
|
1828
2050
|
for (let a = 0; a < t; a += 1) {
|
|
1829
|
-
const
|
|
1830
|
-
i.push(
|
|
2051
|
+
const c = n + a, g = J[c % J.length], l = co(g, c), m = l !== null, M = m ? u++ : a, p = mo(r, m, Dt(g, c), M);
|
|
2052
|
+
i.push(fo(e, a, c, p, l, s));
|
|
1831
2053
|
}
|
|
1832
2054
|
return i;
|
|
1833
|
-
},
|
|
1834
|
-
const s =
|
|
2055
|
+
}, po = (e, t, n) => {
|
|
2056
|
+
const s = kt(e);
|
|
1835
2057
|
return s === "locked" || s === "not_started" ? s : t.length === 0 ? "not_started" : !t.some((r) => r.pointsPossible != null) || s === "missing" && n === 0 ? "in_progress" : s;
|
|
1836
|
-
},
|
|
2058
|
+
}, Io = (e) => {
|
|
1837
2059
|
const t = e.map((n) => n.dueAt).filter((n) => typeof n == "string").sort();
|
|
1838
2060
|
return t.length > 0 ? t[t.length - 1] : null;
|
|
1839
|
-
},
|
|
1840
|
-
const s = t.filter((
|
|
2061
|
+
}, bo = (e, t, n) => {
|
|
2062
|
+
const s = t.filter((c) => c.completionRequirement), r = n ?? s.length, i = Math.min(s.filter(go).length, r), u = t.filter((c) => c.status === "missing").length;
|
|
1841
2063
|
return {
|
|
1842
|
-
status:
|
|
2064
|
+
status: po(e, t, u),
|
|
1843
2065
|
requirementsMet: i,
|
|
1844
2066
|
requirementCount: r,
|
|
1845
2067
|
// Derived from the clamped pair, so the bar and the fraction always agree.
|
|
1846
2068
|
percentComplete: r > 0 ? Math.round(i / r * 100) : 0,
|
|
1847
|
-
latestDueAt:
|
|
2069
|
+
latestDueAt: Io(t),
|
|
1848
2070
|
missingCount: u
|
|
1849
2071
|
};
|
|
1850
|
-
},
|
|
2072
|
+
}, Mo = (e, t, n) => {
|
|
1851
2073
|
const s = e % 2 === 0 ? null : 1;
|
|
1852
2074
|
return {
|
|
1853
2075
|
id: String(e),
|
|
@@ -1856,17 +2078,17 @@ const J = [
|
|
|
1856
2078
|
// A student sees only published modules; publish state varies for a teacher.
|
|
1857
2079
|
published: n === "teacher" ? e % 4 !== 0 : !0,
|
|
1858
2080
|
itemCount: t.length,
|
|
1859
|
-
unlockAt: e % 5 === 0 ?
|
|
2081
|
+
unlockAt: e % 5 === 0 ? Nt(e) : null,
|
|
1860
2082
|
prerequisiteModuleIds: e > 1 && e % 3 === 0 ? [String(e - 1)] : [],
|
|
1861
2083
|
requirementCount: s,
|
|
1862
2084
|
requireSequentialProgress: e % 6 === 0,
|
|
1863
2085
|
completionRequirements: t.flatMap(
|
|
1864
2086
|
(r) => r.completionRequirement ? [r.completionRequirement] : []
|
|
1865
2087
|
),
|
|
1866
|
-
progress:
|
|
2088
|
+
progress: bo(e, t, s)
|
|
1867
2089
|
};
|
|
1868
2090
|
};
|
|
1869
|
-
function
|
|
2091
|
+
function So(e) {
|
|
1870
2092
|
return {
|
|
1871
2093
|
courseId: e.courseId,
|
|
1872
2094
|
modules: e.modules.map(({ progress: t, ...n }) => n),
|
|
@@ -1878,89 +2100,145 @@ function Ts(e) {
|
|
|
1878
2100
|
)
|
|
1879
2101
|
};
|
|
1880
2102
|
}
|
|
1881
|
-
function
|
|
1882
|
-
const n = t.view ?? "student", s = t.courseId ??
|
|
2103
|
+
function be(e, t = {}) {
|
|
2104
|
+
const n = t.view ?? "student", s = t.courseId ?? Ie, r = [], i = {};
|
|
1883
2105
|
let u = 0;
|
|
1884
|
-
e.forEach((
|
|
1885
|
-
const l =
|
|
1886
|
-
u +=
|
|
2106
|
+
e.forEach((c, g) => {
|
|
2107
|
+
const l = g + 1, m = ho(l, c, u, n);
|
|
2108
|
+
u += c, r.push(Mo(l, m, n)), i[String(l)] = m;
|
|
1887
2109
|
});
|
|
1888
2110
|
const a = { courseId: s, modules: r, itemsByModuleId: i };
|
|
1889
|
-
return n === "teacher" ?
|
|
2111
|
+
return n === "teacher" ? So(a) : a;
|
|
1890
2112
|
}
|
|
1891
|
-
const
|
|
1892
|
-
function
|
|
1893
|
-
return
|
|
2113
|
+
const ce = (e) => `/courses/${Ie}/modules/items/${e}`, yo = _e.length, _o = 8, To = 120, wo = 25, Po = 250, $e = 8;
|
|
2114
|
+
function ii() {
|
|
2115
|
+
return be(Array.from({ length: yo }, () => _o));
|
|
1894
2116
|
}
|
|
1895
|
-
function
|
|
1896
|
-
return
|
|
2117
|
+
function li() {
|
|
2118
|
+
return be(Array.from({ length: To }, () => wo));
|
|
1897
2119
|
}
|
|
1898
|
-
function
|
|
1899
|
-
return
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
2120
|
+
function ai() {
|
|
2121
|
+
return be([
|
|
2122
|
+
$e,
|
|
2123
|
+
Po,
|
|
2124
|
+
$e
|
|
1903
2125
|
]);
|
|
1904
2126
|
}
|
|
1905
|
-
function
|
|
1906
|
-
return
|
|
2127
|
+
function ui() {
|
|
2128
|
+
return be([]);
|
|
2129
|
+
}
|
|
2130
|
+
function ci() {
|
|
2131
|
+
const t = [
|
|
2132
|
+
{ title: "Reading: limits from the left and the right", type: "page", url: ce(1) },
|
|
2133
|
+
{
|
|
2134
|
+
title: "Desmos: interactive limit explorer",
|
|
2135
|
+
type: "external_url",
|
|
2136
|
+
url: ce(2),
|
|
2137
|
+
newTab: !0
|
|
2138
|
+
},
|
|
2139
|
+
{ title: "Practice", type: "sub_header", url: null },
|
|
2140
|
+
{ title: "Worksheet with no destination", type: "assignment", url: null },
|
|
2141
|
+
{
|
|
2142
|
+
title: "Utilizing Triangle Characteristics: Measuring Distances Through Angles, Elevation and the Practical Limits of Indirect Measurement in the Field",
|
|
2143
|
+
type: "assignment",
|
|
2144
|
+
url: ce(5)
|
|
2145
|
+
},
|
|
2146
|
+
{ title: "Unit test", type: "quiz", url: ce(6), status: "locked" }
|
|
2147
|
+
].map((n, s) => ({
|
|
2148
|
+
id: String(s + 1),
|
|
2149
|
+
moduleId: "1",
|
|
2150
|
+
position: s + 1,
|
|
2151
|
+
indent: 0,
|
|
2152
|
+
published: !0,
|
|
2153
|
+
newTab: !1,
|
|
2154
|
+
status: "not_started",
|
|
2155
|
+
...n
|
|
2156
|
+
}));
|
|
2157
|
+
return {
|
|
2158
|
+
courseId: Ie,
|
|
2159
|
+
modules: [
|
|
2160
|
+
{
|
|
2161
|
+
id: "1",
|
|
2162
|
+
name: "Limits and Continuity",
|
|
2163
|
+
position: 1,
|
|
2164
|
+
published: !0,
|
|
2165
|
+
itemCount: t.length,
|
|
2166
|
+
prerequisiteModuleIds: [],
|
|
2167
|
+
requireSequentialProgress: !1
|
|
2168
|
+
}
|
|
2169
|
+
],
|
|
2170
|
+
itemsByModuleId: { 1: t }
|
|
2171
|
+
};
|
|
1907
2172
|
}
|
|
1908
2173
|
export {
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
2174
|
+
nt as CompletionRequirementSchema,
|
|
2175
|
+
rn as CompletionRequirementTypeSchema,
|
|
2176
|
+
Mt as DEFAULT_INLINE_THRESHOLD,
|
|
2177
|
+
On as DEFAULT_ITEM_CONCURRENCY,
|
|
2178
|
+
bt as DEFAULT_ITEM_PAGE_SIZE,
|
|
2179
|
+
ne as DEFAULT_LOCALE,
|
|
2180
|
+
Pe as DEFAULT_PAGE_SIZE,
|
|
2181
|
+
St as DEFAULT_RETAIN_COLLAPSED_LIMIT,
|
|
2182
|
+
pe as DEFAULT_STALE_TIME_MS,
|
|
2183
|
+
ot as EXT_CAREER_ESTIMATED_DURATION_MINUTES,
|
|
2184
|
+
Ie as FIXTURE_COURSE_ID,
|
|
2185
|
+
Ur as FilterChips,
|
|
2186
|
+
kn as GET_MODULES,
|
|
2187
|
+
qn as GET_MODULE_ITEMS,
|
|
2188
|
+
Se as INLINE_ITEM_LIMIT,
|
|
2189
|
+
we as INLINE_QUERY_NODE_BUDGET,
|
|
2190
|
+
dn as InMemoryCourseMismatchError,
|
|
2191
|
+
Rr as MODULES_FILTER_IDS,
|
|
2192
|
+
no as ModuleCard,
|
|
2193
|
+
Vr as ModuleItemRow,
|
|
2194
|
+
st as ModuleItemSchema,
|
|
2195
|
+
Yr as ModuleItemStatusPill,
|
|
2196
|
+
nn as ModuleItemStatusSchema,
|
|
2197
|
+
tn as ModuleItemTypeSchema,
|
|
2198
|
+
un as ModuleItemsPageSchema,
|
|
2199
|
+
Zr as ModuleNumberBadge,
|
|
2200
|
+
on as ModuleProgressSchema,
|
|
2201
|
+
ln as ModuleSchema,
|
|
2202
|
+
jr as ModuleStatusPill,
|
|
2203
|
+
sn as ModuleStatusSchema,
|
|
2204
|
+
Ko as ModulesConfigProvider,
|
|
2205
|
+
zn as ModulesConfigSchema,
|
|
2206
|
+
ri as ModulesI18nProvider,
|
|
2207
|
+
oi as ModulesList,
|
|
2208
|
+
an as ModulesPageSchema,
|
|
2209
|
+
rt as PageInfoSchema,
|
|
2210
|
+
lt as PartialCanvasResponseError,
|
|
2211
|
+
Rn as RegistryEntrySchema,
|
|
2212
|
+
he as baseModulesConfig,
|
|
2213
|
+
be as buildFixture,
|
|
2214
|
+
ui as courseEmpty,
|
|
2215
|
+
ai as courseFatModule,
|
|
2216
|
+
ci as courseItemLinks,
|
|
2217
|
+
li as courseLarge,
|
|
2218
|
+
ii as courseSmall,
|
|
2219
|
+
Ho as createCanvasGraphqlAdapter,
|
|
2220
|
+
Qo as createInMemoryAdapter,
|
|
2221
|
+
Et as createTranslate,
|
|
2222
|
+
Er as defaultTranslate,
|
|
2223
|
+
Fr as filterLabel,
|
|
2224
|
+
cn as getEstimatedDurationMinutes,
|
|
2225
|
+
si as invalidateCourse,
|
|
2226
|
+
ti as invalidateModuleItems,
|
|
2227
|
+
ni as invalidateModuleList,
|
|
2228
|
+
Y as mergeRegistry,
|
|
2229
|
+
Gr as moduleItemStatusLabel,
|
|
2230
|
+
yt as moduleItemsPrefix,
|
|
2231
|
+
Br as moduleStatusLabel,
|
|
1959
2232
|
te as modulesKeys,
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
2233
|
+
$n as modulesListPrefix,
|
|
2234
|
+
Xo as partialModulesConfig,
|
|
2235
|
+
Fn as registrySchema,
|
|
2236
|
+
Un as resolveModulesConfig,
|
|
2237
|
+
Jo as useModuleItems,
|
|
2238
|
+
Bn as useModules,
|
|
2239
|
+
Vo as useModulesConfig,
|
|
2240
|
+
k as useModulesI18n,
|
|
2241
|
+
ei as useModulesPageData,
|
|
2242
|
+
Zo as visibleEntries,
|
|
2243
|
+
it as withEstimatedDurationMinutes
|
|
1966
2244
|
};
|