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