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