@instructure/platform-modules 1.3.1 → 1.5.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/components/ModuleCard.d.ts +1 -2
- package/dist/components/ModuleCard.d.ts.map +1 -1
- package/dist/components/ModuleCard.stories.d.ts +2 -0
- package/dist/components/ModuleCard.stories.d.ts.map +1 -1
- package/dist/components/ModuleItemRow.d.ts +1 -2
- package/dist/components/ModuleItemRow.d.ts.map +1 -1
- package/dist/components/ModulesList.d.ts +0 -2
- package/dist/components/ModulesList.d.ts.map +1 -1
- package/dist/components/ModulesList.stories.d.ts +3 -1
- package/dist/components/ModulesList.stories.d.ts.map +1 -1
- package/dist/components/ModulesProgressBar.d.ts +8 -0
- package/dist/components/ModulesProgressBar.d.ts.map +1 -0
- package/dist/components/ModulesProgressBar.stories.d.ts +18 -0
- package/dist/components/ModulesProgressBar.stories.d.ts.map +1 -0
- package/dist/components/StatusPill.d.ts +15 -0
- package/dist/components/StatusPill.d.ts.map +1 -1
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/labels.d.ts +4 -0
- package/dist/components/labels.d.ts.map +1 -1
- package/dist/components/storyThemes.d.ts +4 -0
- package/dist/components/storyThemes.d.ts.map +1 -1
- package/dist/components/useTitleLinkVariant.d.ts +2 -0
- package/dist/components/useTitleLinkVariant.d.ts.map +1 -0
- package/dist/config/actions.d.ts +20 -0
- package/dist/config/actions.d.ts.map +1 -0
- package/dist/config/filters.d.ts +1 -1
- package/dist/config/filters.d.ts.map +1 -1
- package/dist/config/index.d.ts +3 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/schemas.d.ts +16 -0
- package/dist/config/schemas.d.ts.map +1 -1
- package/dist/config/types.d.ts +10 -5
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/useActionContext.d.ts +6 -0
- package/dist/config/useActionContext.d.ts.map +1 -0
- package/dist/hooks/useModulesPageData.d.ts +2 -0
- package/dist/hooks/useModulesPageData.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1785 -1398
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/locales/en.json +29 -3
- package/package.json +3 -1
- package/dist/types/navigation.d.ts +0 -7
- package/dist/types/navigation.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { z as
|
|
2
|
-
import { gql as
|
|
3
|
-
import { jsx as i, jsxs as
|
|
4
|
-
import { createContext as
|
|
5
|
-
import { PlugInstUIIcon as
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import { Button as
|
|
9
|
-
import { Flex as
|
|
10
|
-
import { Text as
|
|
11
|
-
import { View as
|
|
12
|
-
import {
|
|
13
|
-
import { Alert as
|
|
14
|
-
import { Heading as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
const
|
|
25
|
-
target:
|
|
26
|
-
field:
|
|
27
|
-
op:
|
|
28
|
-
value:
|
|
1
|
+
import { z as p } from "zod";
|
|
2
|
+
import { gql as xe } from "graphql-tag";
|
|
3
|
+
import { jsx as i, jsxs as _, Fragment as xt } from "react/jsx-runtime";
|
|
4
|
+
import { createContext as on, useContext as sn, useMemo as N, isValidElement as rn, useCallback as F, useRef as $, useState as ee, useEffect as te, useId as rt, memo as ln, Fragment as an } from "react";
|
|
5
|
+
import { PlugInstUIIcon as po, ExternalLinkInstUIIcon as go, FileInstUIIcon as fo, FileTextInstUIIcon as ho, MessagesSquareInstUIIcon as Io, RocketInstUIIcon as bo, FilePenLineInstUIIcon as Mo, LockInstUIIcon as cn, CircleAlertInstUIIcon as ve, CircleCheckInstUIIcon as un, ClockFadingInstUIIcon as dn, CircleDashedInstUIIcon as mn, CalendarInstUIIcon as So, CornerDownRightInstUIIcon as yo, IconArrowOpenUpLine as _o, IconArrowOpenDownLine as To } from "@instructure/ui-icons";
|
|
6
|
+
import { useQueryClient as It, useInfiniteQuery as bt, keepPreviousData as Eo, InfiniteQueryObserver as Co } from "@tanstack/react-query";
|
|
7
|
+
import wo from "p-limit";
|
|
8
|
+
import { Button as Pe, IconButton as vo } from "@instructure/ui-buttons/v11_7";
|
|
9
|
+
import { Flex as M } from "@instructure/ui-flex/v11_7";
|
|
10
|
+
import { Text as A } from "@instructure/ui-text/v11_7";
|
|
11
|
+
import { View as C } from "@instructure/ui-view/v11_7";
|
|
12
|
+
import { politeAnnounce as he, getLiveRegion as pn, TruncateWithTooltip as Po } from "@instructure/platform-instui-bindings";
|
|
13
|
+
import { Alert as gn } from "@instructure/ui-alerts/v11_7";
|
|
14
|
+
import { Heading as fn } from "@instructure/ui-heading/v11_7";
|
|
15
|
+
import { Link as hn } from "@instructure/ui-link/v11_7";
|
|
16
|
+
import { ProgressBar as Ao } from "@instructure/ui-progress/v11_7";
|
|
17
|
+
import { Spinner as it } from "@instructure/ui-spinner/v11_7";
|
|
18
|
+
import { Tooltip as In } from "@instructure/ui-tooltip/v11_7";
|
|
19
|
+
import { useTheme as bn } from "@instructure/emotion";
|
|
20
|
+
import { ScreenReaderContent as lt } from "@instructure/ui-a11y-content";
|
|
21
|
+
import { isValid as at, colorToRGB as ct, overlayColors as xo, alpha as Lo, color2hex as Mn, contrast as se, darken as Ro, lighten as ko } from "@instructure/ui-color-utils";
|
|
22
|
+
import { Pill as Do } from "@instructure/ui-pill/v11_7";
|
|
23
|
+
import { WithBreakpoints as No } from "@instructure/platform-with-breakpoints";
|
|
24
|
+
const Oo = p.object({
|
|
25
|
+
target: p.enum(["module", "item"]),
|
|
26
|
+
field: p.string(),
|
|
27
|
+
op: p.enum(["eq", "contains"]),
|
|
28
|
+
value: p.union([p.string(), p.boolean()])
|
|
29
29
|
}).strict();
|
|
30
|
-
function
|
|
30
|
+
function qo(e, t) {
|
|
31
31
|
const n = e == null ? void 0 : e[t.target];
|
|
32
32
|
return !n || !Object.prototype.hasOwnProperty.call(n, t.field) ? !1 : n[t.field].includes(t.op);
|
|
33
33
|
}
|
|
34
|
-
const
|
|
34
|
+
const Fo = p.enum([
|
|
35
35
|
"assignment",
|
|
36
36
|
"quiz",
|
|
37
37
|
"discussion",
|
|
@@ -40,7 +40,7 @@ const Kn = d.enum([
|
|
|
40
40
|
"external_url",
|
|
41
41
|
"external_tool",
|
|
42
42
|
"sub_header"
|
|
43
|
-
]),
|
|
43
|
+
]), Uo = p.enum(["not_started", "in_progress", "complete", "incomplete", "missing", "locked"]), zo = p.enum([
|
|
44
44
|
"not_started",
|
|
45
45
|
"in_progress",
|
|
46
46
|
"complete",
|
|
@@ -48,7 +48,7 @@ const Kn = d.enum([
|
|
|
48
48
|
"incomplete",
|
|
49
49
|
"missing_and_incomplete",
|
|
50
50
|
"locked"
|
|
51
|
-
]),
|
|
51
|
+
]), $o = p.enum([
|
|
52
52
|
"must_view",
|
|
53
53
|
"must_mark_done",
|
|
54
54
|
"must_contribute",
|
|
@@ -56,97 +56,97 @@ const Kn = d.enum([
|
|
|
56
56
|
"min_score",
|
|
57
57
|
"min_percentage",
|
|
58
58
|
"unknown"
|
|
59
|
-
]),
|
|
60
|
-
status:
|
|
61
|
-
requirementsMet:
|
|
62
|
-
requirementCount:
|
|
63
|
-
percentComplete:
|
|
64
|
-
nextDueAt:
|
|
65
|
-
missingCount:
|
|
66
|
-
incompleteCount:
|
|
67
|
-
}),
|
|
68
|
-
itemId:
|
|
69
|
-
type:
|
|
70
|
-
minScore:
|
|
71
|
-
minPercentage:
|
|
72
|
-
}),
|
|
73
|
-
id:
|
|
74
|
-
moduleId:
|
|
75
|
-
title:
|
|
76
|
-
type:
|
|
77
|
-
position:
|
|
78
|
-
indent:
|
|
79
|
-
published:
|
|
80
|
-
url:
|
|
81
|
-
newTab:
|
|
82
|
-
completionRequirement:
|
|
83
|
-
dueAt:
|
|
84
|
-
status:
|
|
85
|
-
pointsPossible:
|
|
86
|
-
extensions:
|
|
87
|
-
}),
|
|
88
|
-
id:
|
|
89
|
-
name:
|
|
90
|
-
}),
|
|
91
|
-
id:
|
|
92
|
-
name:
|
|
93
|
-
position:
|
|
94
|
-
published:
|
|
95
|
-
itemCount:
|
|
96
|
-
items:
|
|
97
|
-
unlockAt:
|
|
98
|
-
prerequisiteModules:
|
|
99
|
-
requirementCount:
|
|
100
|
-
requireSequentialProgress:
|
|
101
|
-
completionRequirements:
|
|
102
|
-
progress:
|
|
103
|
-
collapsed:
|
|
104
|
-
extensions:
|
|
105
|
-
}),
|
|
106
|
-
hasNextPage:
|
|
107
|
-
endCursor:
|
|
59
|
+
]), Bo = p.object({
|
|
60
|
+
status: zo.optional(),
|
|
61
|
+
requirementsMet: p.number(),
|
|
62
|
+
requirementCount: p.number(),
|
|
63
|
+
percentComplete: p.number().min(0).max(100),
|
|
64
|
+
nextDueAt: p.string().nullish(),
|
|
65
|
+
missingCount: p.number(),
|
|
66
|
+
incompleteCount: p.number()
|
|
67
|
+
}), Sn = p.object({
|
|
68
|
+
itemId: p.string(),
|
|
69
|
+
type: $o,
|
|
70
|
+
minScore: p.number().nullish(),
|
|
71
|
+
minPercentage: p.number().nullish()
|
|
72
|
+
}), yn = p.object({
|
|
73
|
+
id: p.string(),
|
|
74
|
+
moduleId: p.string(),
|
|
75
|
+
title: p.string(),
|
|
76
|
+
type: Fo,
|
|
77
|
+
position: p.number(),
|
|
78
|
+
indent: p.number(),
|
|
79
|
+
published: p.boolean(),
|
|
80
|
+
url: p.string().nullish(),
|
|
81
|
+
newTab: p.boolean().nullish(),
|
|
82
|
+
completionRequirement: Sn.nullish(),
|
|
83
|
+
dueAt: p.string().nullish(),
|
|
84
|
+
status: Uo.optional(),
|
|
85
|
+
pointsPossible: p.number().nullish(),
|
|
86
|
+
extensions: p.record(p.unknown()).optional()
|
|
87
|
+
}), Go = p.object({
|
|
88
|
+
id: p.string(),
|
|
89
|
+
name: p.string()
|
|
90
|
+
}), jo = p.object({
|
|
91
|
+
id: p.string(),
|
|
92
|
+
name: p.string(),
|
|
93
|
+
position: p.number(),
|
|
94
|
+
published: p.boolean(),
|
|
95
|
+
itemCount: p.number(),
|
|
96
|
+
items: p.array(yn).optional(),
|
|
97
|
+
unlockAt: p.string().nullish(),
|
|
98
|
+
prerequisiteModules: p.array(Go),
|
|
99
|
+
requirementCount: p.number().nullish(),
|
|
100
|
+
requireSequentialProgress: p.boolean(),
|
|
101
|
+
completionRequirements: p.array(Sn).optional(),
|
|
102
|
+
progress: Bo.optional(),
|
|
103
|
+
collapsed: p.boolean().nullish(),
|
|
104
|
+
extensions: p.record(p.unknown()).optional()
|
|
105
|
+
}), _n = p.object({
|
|
106
|
+
hasNextPage: p.boolean(),
|
|
107
|
+
endCursor: p.string().nullable()
|
|
108
108
|
}).refine((e) => !e.hasNextPage || e.endCursor !== null, {
|
|
109
109
|
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.',
|
|
110
110
|
path: ["endCursor"]
|
|
111
|
-
}),
|
|
112
|
-
modules:
|
|
113
|
-
pageInfo:
|
|
114
|
-
}),
|
|
115
|
-
items:
|
|
116
|
-
pageInfo:
|
|
117
|
-
}),
|
|
118
|
-
function
|
|
111
|
+
}), Yo = p.object({
|
|
112
|
+
modules: p.array(jo),
|
|
113
|
+
pageInfo: _n
|
|
114
|
+
}), Ho = p.object({
|
|
115
|
+
items: p.array(yn),
|
|
116
|
+
pageInfo: _n
|
|
117
|
+
}), Tn = "career.estimatedDurationMinutes";
|
|
118
|
+
function Wo(e) {
|
|
119
119
|
var n;
|
|
120
|
-
const t = (n = e.extensions) == null ? void 0 : n[
|
|
120
|
+
const t = (n = e.extensions) == null ? void 0 : n[Tn];
|
|
121
121
|
return typeof t != "number" || !Number.isFinite(t) || t <= 0 ? null : t;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
return t == null ? e : { ...e, [
|
|
123
|
+
function Mt(e, t) {
|
|
124
|
+
return t == null ? e : { ...e, [Tn]: t };
|
|
125
125
|
}
|
|
126
|
-
const
|
|
127
|
-
class
|
|
126
|
+
const ut = 100, St = 2e3;
|
|
127
|
+
class Ko extends Error {
|
|
128
128
|
constructor(t, n) {
|
|
129
129
|
super(
|
|
130
130
|
`This in-memory adapter was built for course ${t} but was asked for course ${n}. A fixture serves exactly one course.`
|
|
131
131
|
), this.name = "InMemoryCourseMismatchError", this.expected = t, this.received = n;
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
const
|
|
134
|
+
const Qo = (e) => `offset:${e}`, Vo = (e) => {
|
|
135
135
|
if (!e) return 0;
|
|
136
136
|
const t = Number.parseInt(e.replace("offset:", ""), 10);
|
|
137
137
|
return Number.isFinite(t) && t >= 0 ? t : 0;
|
|
138
|
-
},
|
|
138
|
+
}, Lt = (e) => {
|
|
139
139
|
if (e != null && e.aborted)
|
|
140
140
|
throw new DOMException("The operation was aborted.", "AbortError");
|
|
141
141
|
};
|
|
142
|
-
function
|
|
143
|
-
const o =
|
|
142
|
+
function Rt(e, t, n) {
|
|
143
|
+
const o = Vo(t), s = e.slice(o, o + n), r = o + s.length, l = r < e.length;
|
|
144
144
|
return {
|
|
145
|
-
slice:
|
|
146
|
-
pageInfo: { hasNextPage: l, endCursor: l ?
|
|
145
|
+
slice: s,
|
|
146
|
+
pageInfo: { hasNextPage: l, endCursor: l ? Qo(r) : null }
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
|
-
const
|
|
149
|
+
const Zo = /* @__PURE__ */ new Map([
|
|
150
150
|
["COMPLETED", (e) => {
|
|
151
151
|
var t;
|
|
152
152
|
return ((t = e.progress) == null ? void 0 : t.status) === "complete";
|
|
@@ -166,67 +166,67 @@ const uo = /* @__PURE__ */ new Map([
|
|
|
166
166
|
return ((t = e.progress) == null ? void 0 : t.status) !== "complete" && ((n = e.progress) == null ? void 0 : n.status) !== "in_progress";
|
|
167
167
|
}
|
|
168
168
|
]
|
|
169
|
-
]),
|
|
170
|
-
function
|
|
169
|
+
]), Xo = { module: { completionStatus: ["eq"] } };
|
|
170
|
+
function Jo(e) {
|
|
171
171
|
if (e.target !== "module" || e.field !== "completionStatus" || e.op !== "eq")
|
|
172
172
|
throw new Error(
|
|
173
173
|
`in-memory adapter cannot compile ${e.target}.${e.field} ${e.op}`
|
|
174
174
|
);
|
|
175
|
-
const t = typeof e.value == "string" ?
|
|
175
|
+
const t = typeof e.value == "string" ? Zo.get(e.value) : void 0;
|
|
176
176
|
if (!t) throw new Error(`unknown completionStatus "${String(e.value)}"`);
|
|
177
177
|
return t;
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
const n = (
|
|
181
|
-
if (
|
|
182
|
-
throw new
|
|
179
|
+
function oc(e, t = {}) {
|
|
180
|
+
const n = (s) => e.itemsByModuleId[s] ?? [], o = (s) => {
|
|
181
|
+
if (s !== e.courseId)
|
|
182
|
+
throw new Ko(e.courseId, s);
|
|
183
183
|
};
|
|
184
184
|
return {
|
|
185
|
-
capabilities:
|
|
185
|
+
capabilities: Xo,
|
|
186
186
|
async listModules({
|
|
187
|
-
courseId:
|
|
188
|
-
cursor:
|
|
187
|
+
courseId: s,
|
|
188
|
+
cursor: r,
|
|
189
189
|
pageSize: l,
|
|
190
190
|
includeItems: a,
|
|
191
|
-
filter:
|
|
191
|
+
filter: u,
|
|
192
192
|
inlineItemsFirst: c,
|
|
193
|
-
signal:
|
|
193
|
+
signal: d
|
|
194
194
|
}) {
|
|
195
|
-
var
|
|
196
|
-
|
|
197
|
-
const
|
|
198
|
-
return { modules: f.map((
|
|
199
|
-
const
|
|
200
|
-
return { ...
|
|
201
|
-
}), pageInfo:
|
|
195
|
+
var w;
|
|
196
|
+
Lt(d), o(s), (w = t.onRequest) == null || w.call(t, "listModules", { operation: "listModules", courseId: s });
|
|
197
|
+
const m = u ? e.modules.filter(Jo(u)) : e.modules, { slice: f, pageInfo: S } = Rt(m, r, l), h = Math.min(c ?? ut, ut);
|
|
198
|
+
return { modules: f.map((E) => {
|
|
199
|
+
const P = n(E.id), z = a && P.length <= h;
|
|
200
|
+
return { ...E, itemCount: P.length, items: z ? P : void 0 };
|
|
201
|
+
}), pageInfo: S };
|
|
202
202
|
},
|
|
203
203
|
async listModuleItems({
|
|
204
|
-
courseId:
|
|
205
|
-
moduleId:
|
|
204
|
+
courseId: s,
|
|
205
|
+
moduleId: r,
|
|
206
206
|
cursor: l,
|
|
207
207
|
pageSize: a,
|
|
208
|
-
signal:
|
|
208
|
+
signal: u
|
|
209
209
|
}) {
|
|
210
|
-
var
|
|
211
|
-
|
|
212
|
-
const { slice: c, pageInfo:
|
|
213
|
-
return { items: c, pageInfo:
|
|
210
|
+
var m;
|
|
211
|
+
Lt(u), o(s), (m = t.onRequest) == null || m.call(t, "listModuleItems", { operation: "listModuleItems", courseId: s, moduleId: r });
|
|
212
|
+
const { slice: c, pageInfo: d } = Rt(n(r), l, a);
|
|
213
|
+
return { items: c, pageInfo: d };
|
|
214
214
|
}
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
|
-
class
|
|
217
|
+
class En extends Error {
|
|
218
218
|
constructor(t, n, o) {
|
|
219
|
-
const
|
|
219
|
+
const s = t === "module" ? "module" : "module item";
|
|
220
220
|
super(
|
|
221
|
-
`Canvas returned ${
|
|
221
|
+
`Canvas returned ${s} ${n} without a usable ${o}. This is a partial response; refusing to guess a value for it.`
|
|
222
222
|
), this.name = "PartialCanvasResponseError", this.subject = t, this.id = n, this.field = o;
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function Cn(e, t, n) {
|
|
226
226
|
if (e != null) return e;
|
|
227
|
-
throw new
|
|
227
|
+
throw new En(t, n, "published");
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function es(e, t) {
|
|
230
230
|
if (e.onUnsupportedItem) {
|
|
231
231
|
e.onUnsupportedItem(t);
|
|
232
232
|
return;
|
|
@@ -235,7 +235,7 @@ function po(e, t) {
|
|
|
235
235
|
`[platform-modules] dropped module item ${t.id}: content type "${t.typename ?? "null"}" is outside the closed ModuleItemType enum. Pass \`onUnsupportedItem\` to handle these yourself.`
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
|
-
const
|
|
238
|
+
const ts = {
|
|
239
239
|
Assignment: "assignment",
|
|
240
240
|
Quiz: "quiz",
|
|
241
241
|
Discussion: "discussion",
|
|
@@ -247,21 +247,21 @@ const fo = {
|
|
|
247
247
|
SubHeader: "sub_header",
|
|
248
248
|
PeerReviewSubAssignment: "assignment"
|
|
249
249
|
};
|
|
250
|
-
function
|
|
250
|
+
function ns(e) {
|
|
251
251
|
const t = e == null ? void 0 : e.__typename;
|
|
252
252
|
if (!t) return null;
|
|
253
|
-
const n =
|
|
253
|
+
const n = ts[t];
|
|
254
254
|
return n ? n === "assignment" && (e == null ? void 0 : e.isNewQuiz) === !0 ? "quiz" : n : null;
|
|
255
255
|
}
|
|
256
|
-
const
|
|
257
|
-
function
|
|
256
|
+
const os = /^P(?!$)(?:(\d+(?:\.\d+)?)W)?(?:(\d+(?:\.\d+)?)D)?(?:T(?!$)(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?)?$/;
|
|
257
|
+
function ss(e) {
|
|
258
258
|
if (!e) return null;
|
|
259
|
-
const t =
|
|
259
|
+
const t = os.exec(e);
|
|
260
260
|
if (!t) return null;
|
|
261
|
-
const [, n, o,
|
|
261
|
+
const [, n, o, s, r, l] = t, a = Number(n ?? 0) * 7 * 24 * 60 + Number(o ?? 0) * 24 * 60 + Number(s ?? 0) * 60 + Number(r ?? 0) + Number(l ?? 0) / 60;
|
|
262
262
|
return Math.round(a);
|
|
263
263
|
}
|
|
264
|
-
const
|
|
264
|
+
const rs = /* @__PURE__ */ new Set([
|
|
265
265
|
"must_view",
|
|
266
266
|
"must_mark_done",
|
|
267
267
|
"must_contribute",
|
|
@@ -269,42 +269,42 @@ const bo = /* @__PURE__ */ new Set([
|
|
|
269
269
|
"min_score",
|
|
270
270
|
"min_percentage"
|
|
271
271
|
]);
|
|
272
|
-
function
|
|
273
|
-
return
|
|
272
|
+
function is(e) {
|
|
273
|
+
return rs.has(e) ? e : "unknown";
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function ls(e) {
|
|
276
276
|
return {
|
|
277
277
|
itemId: String(e.id),
|
|
278
|
-
type:
|
|
278
|
+
type: is(e.type),
|
|
279
279
|
minScore: e.minScore ?? null,
|
|
280
280
|
minPercentage: e.minPercentage ?? null
|
|
281
281
|
};
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function wn(e) {
|
|
284
284
|
return {
|
|
285
285
|
hasNextPage: (e == null ? void 0 : e.hasNextPage) ?? !1,
|
|
286
286
|
endCursor: (e == null ? void 0 : e.endCursor) ?? null
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
|
-
const
|
|
290
|
-
function
|
|
289
|
+
const as = /* @__PURE__ */ new Set(["min_score", "min_percentage"]);
|
|
290
|
+
function cs(e) {
|
|
291
291
|
var t;
|
|
292
292
|
for (const n of ((t = e == null ? void 0 : e.submissionsConnection) == null ? void 0 : t.nodes) ?? [])
|
|
293
293
|
if (n) return n;
|
|
294
294
|
return null;
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function vn(e, t) {
|
|
297
297
|
if (!e) return;
|
|
298
|
-
const n = new Map(t.map((
|
|
299
|
-
for (const
|
|
300
|
-
if (!
|
|
301
|
-
const l = String(
|
|
302
|
-
n.get(l) ===
|
|
298
|
+
const n = new Map(t.map((r) => [r.itemId, r.type])), o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Map();
|
|
299
|
+
for (const r of e.requirementsMet ?? []) {
|
|
300
|
+
if (!r) continue;
|
|
301
|
+
const l = String(r.id);
|
|
302
|
+
n.get(l) === r.type && o.add(l);
|
|
303
303
|
}
|
|
304
|
-
for (const
|
|
305
|
-
if (!
|
|
306
|
-
const l = String(
|
|
307
|
-
n.get(l) ===
|
|
304
|
+
for (const r of e.incompleteRequirements ?? []) {
|
|
305
|
+
if (!r) continue;
|
|
306
|
+
const l = String(r.id);
|
|
307
|
+
n.get(l) === r.type && as.has(r.type) && s.set(l, r.score ?? null);
|
|
308
308
|
}
|
|
309
309
|
return {
|
|
310
310
|
locked: e.locked === !0 || e.workflowState === "locked",
|
|
@@ -312,10 +312,10 @@ function Jt(e, t) {
|
|
|
312
312
|
completed: e.completed === !0 || e.workflowState === "completed",
|
|
313
313
|
started: e.started === !0 || e.workflowState === "started",
|
|
314
314
|
requirementsMetItemIds: o,
|
|
315
|
-
incompleteRequirementScores:
|
|
315
|
+
incompleteRequirementScores: s
|
|
316
316
|
};
|
|
317
317
|
}
|
|
318
|
-
const
|
|
318
|
+
const us = {
|
|
319
319
|
LOCKED: "locked",
|
|
320
320
|
MISSING: "missing",
|
|
321
321
|
INCOMPLETE: "incomplete",
|
|
@@ -323,11 +323,11 @@ const To = {
|
|
|
323
323
|
IN_PROGRESS: "in_progress",
|
|
324
324
|
NOT_STARTED: "not_started"
|
|
325
325
|
};
|
|
326
|
-
function
|
|
326
|
+
function ds(e) {
|
|
327
327
|
if (e != null)
|
|
328
|
-
return
|
|
328
|
+
return us[e];
|
|
329
329
|
}
|
|
330
|
-
const
|
|
330
|
+
const ms = {
|
|
331
331
|
LOCKED: "locked",
|
|
332
332
|
MISSING: "missing",
|
|
333
333
|
MISSING_AND_INCOMPLETE: "missing_and_incomplete",
|
|
@@ -336,120 +336,120 @@ const Po = {
|
|
|
336
336
|
IN_PROGRESS: "in_progress",
|
|
337
337
|
NOT_STARTED: "not_started"
|
|
338
338
|
};
|
|
339
|
-
function
|
|
339
|
+
function ps(e) {
|
|
340
340
|
if (e != null)
|
|
341
|
-
return
|
|
341
|
+
return ms[e];
|
|
342
342
|
}
|
|
343
|
-
function
|
|
344
|
-
var a,
|
|
343
|
+
function gs(e, t, n) {
|
|
344
|
+
var a, u;
|
|
345
345
|
if (!n) return;
|
|
346
|
-
const o = e.requirementCount ?? t.length,
|
|
346
|
+
const o = e.requirementCount ?? t.length, s = Math.min(n.requirementsMetItemIds.size, o), r = ((a = e.submissionStatistics) == null ? void 0 : a.missingAssignmentCount) ?? 0, l = [...n.incompleteRequirementScores.values()].filter(
|
|
347
347
|
(c) => c != null
|
|
348
348
|
).length;
|
|
349
349
|
return {
|
|
350
|
-
status:
|
|
351
|
-
requirementsMet:
|
|
350
|
+
status: ps(e.moduleStatus) ?? (n.locked ? "locked" : void 0),
|
|
351
|
+
requirementsMet: s,
|
|
352
352
|
requirementCount: o,
|
|
353
|
-
percentComplete: o > 0 ? Math.round(
|
|
354
|
-
nextDueAt: ((
|
|
355
|
-
missingCount:
|
|
353
|
+
percentComplete: o > 0 ? Math.round(s / o * 100) : 0,
|
|
354
|
+
nextDueAt: ((u = e.submissionStatistics) == null ? void 0 : u.nextDueAt) ?? null,
|
|
355
|
+
missingCount: r,
|
|
356
356
|
incompleteCount: l
|
|
357
357
|
};
|
|
358
358
|
}
|
|
359
|
-
function
|
|
360
|
-
var c,
|
|
361
|
-
const
|
|
359
|
+
function fs(e, t, n, o = {}, s) {
|
|
360
|
+
var c, d, m;
|
|
361
|
+
const r = String(e._id), l = ns(e.content);
|
|
362
362
|
if (!l)
|
|
363
|
-
return
|
|
364
|
-
const a =
|
|
363
|
+
return es(o, { id: r, typename: ((c = e.content) == null ? void 0 : c.__typename) ?? null }), null;
|
|
364
|
+
const a = cs(e.content), u = n.get(r) ?? null;
|
|
365
365
|
return {
|
|
366
|
-
id:
|
|
366
|
+
id: r,
|
|
367
367
|
moduleId: t,
|
|
368
368
|
title: e.title ?? "",
|
|
369
369
|
type: l,
|
|
370
370
|
position: e.position ?? 0,
|
|
371
371
|
indent: e.indent ?? 0,
|
|
372
|
-
published:
|
|
372
|
+
published: Cn(e.published, "moduleItem", r),
|
|
373
373
|
url: e.url ?? null,
|
|
374
374
|
newTab: e.newTab ?? !1,
|
|
375
|
-
completionRequirement:
|
|
376
|
-
dueAt: (a == null ? void 0 : a.cachedDueDate) ?? ((
|
|
377
|
-
status:
|
|
378
|
-
pointsPossible: ((
|
|
379
|
-
extensions:
|
|
375
|
+
completionRequirement: u,
|
|
376
|
+
dueAt: (a == null ? void 0 : a.cachedDueDate) ?? ((d = e.content) == null ? void 0 : d.dueAt) ?? null,
|
|
377
|
+
status: s ? ds(e.moduleItemStatus) ?? (s.locked ? "locked" : void 0) : void 0,
|
|
378
|
+
pointsPossible: ((m = e.content) == null ? void 0 : m.pointsPossible) ?? null,
|
|
379
|
+
extensions: Mt(
|
|
380
380
|
void 0,
|
|
381
|
-
|
|
381
|
+
ss(e.estimatedDuration)
|
|
382
382
|
)
|
|
383
383
|
};
|
|
384
384
|
}
|
|
385
|
-
function
|
|
386
|
-
const
|
|
385
|
+
function Pn(e, t, n, o, s) {
|
|
386
|
+
const r = [];
|
|
387
387
|
for (const l of e ?? []) {
|
|
388
388
|
if (!l) continue;
|
|
389
|
-
const a =
|
|
389
|
+
const a = fs(
|
|
390
390
|
l,
|
|
391
391
|
t,
|
|
392
392
|
n,
|
|
393
393
|
o,
|
|
394
|
-
|
|
394
|
+
s
|
|
395
395
|
);
|
|
396
|
-
a &&
|
|
396
|
+
a && r.push(a);
|
|
397
397
|
}
|
|
398
|
-
return
|
|
398
|
+
return r;
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function An(e) {
|
|
401
401
|
const t = [], n = /* @__PURE__ */ new Map();
|
|
402
402
|
for (const o of e ?? []) {
|
|
403
403
|
if (!o) continue;
|
|
404
|
-
const
|
|
405
|
-
t.push(
|
|
404
|
+
const s = ls(o);
|
|
405
|
+
t.push(s), n.set(s.itemId, s);
|
|
406
406
|
}
|
|
407
407
|
return { list: t, byItemId: n };
|
|
408
408
|
}
|
|
409
|
-
function
|
|
410
|
-
var c,
|
|
409
|
+
function hs(e, t = {}) {
|
|
410
|
+
var c, d;
|
|
411
411
|
const n = String(e._id);
|
|
412
412
|
if (e.moduleItemsTotalCount == null)
|
|
413
|
-
throw new
|
|
414
|
-
const { list: o, byItemId:
|
|
413
|
+
throw new En("module", n, "moduleItemsTotalCount");
|
|
414
|
+
const { list: o, byItemId: s } = An(e.completionRequirements), r = e.moduleItemsConnection, l = r != null && !((c = r.pageInfo) != null && c.hasNextPage), a = vn(e.progression, o), u = l ? Pn(r.nodes, n, s, t, a) : void 0;
|
|
415
415
|
return {
|
|
416
416
|
id: n,
|
|
417
417
|
name: e.name ?? "",
|
|
418
418
|
position: e.position ?? 0,
|
|
419
|
-
published:
|
|
419
|
+
published: Cn(e.published, "module", n),
|
|
420
420
|
itemCount: e.moduleItemsTotalCount,
|
|
421
|
-
items:
|
|
421
|
+
items: u,
|
|
422
422
|
unlockAt: e.unlockAt ?? null,
|
|
423
423
|
prerequisiteModules: (e.prerequisites ?? []).filter(
|
|
424
|
-
(
|
|
425
|
-
).map((
|
|
424
|
+
(m) => m != null
|
|
425
|
+
).map((m) => ({ id: String(m.id), name: m.name ?? "" })),
|
|
426
426
|
requirementCount: e.requirementCount ?? null,
|
|
427
427
|
requireSequentialProgress: e.requireSequentialProgress ?? !1,
|
|
428
428
|
completionRequirements: o,
|
|
429
|
-
progress:
|
|
430
|
-
collapsed: ((
|
|
429
|
+
progress: gs(e, o, a),
|
|
430
|
+
collapsed: ((d = e.progression) == null ? void 0 : d.collapsed) ?? null
|
|
431
431
|
};
|
|
432
432
|
}
|
|
433
|
-
function
|
|
434
|
-
var
|
|
435
|
-
const n = (
|
|
436
|
-
for (const
|
|
437
|
-
|
|
438
|
-
return { modules: o, pageInfo:
|
|
433
|
+
function Is(e, t = {}) {
|
|
434
|
+
var s;
|
|
435
|
+
const n = (s = e == null ? void 0 : e.legacyNode) == null ? void 0 : s.modulesConnection, o = [];
|
|
436
|
+
for (const r of (n == null ? void 0 : n.nodes) ?? [])
|
|
437
|
+
r && o.push(hs(r, t));
|
|
438
|
+
return { modules: o, pageInfo: wn(n == null ? void 0 : n.pageInfo) };
|
|
439
439
|
}
|
|
440
|
-
function
|
|
441
|
-
const o = e == null ? void 0 : e.legacyNode, { list:
|
|
440
|
+
function bs(e, t, n = {}) {
|
|
441
|
+
const o = e == null ? void 0 : e.legacyNode, { list: s, byItemId: r } = An(o == null ? void 0 : o.completionRequirements), l = o == null ? void 0 : o.moduleItemsConnection, a = vn(o == null ? void 0 : o.progression, s);
|
|
442
442
|
return {
|
|
443
|
-
items:
|
|
444
|
-
pageInfo:
|
|
443
|
+
items: Pn(l == null ? void 0 : l.nodes, t, r, n, a),
|
|
444
|
+
pageInfo: wn(l == null ? void 0 : l.pageInfo)
|
|
445
445
|
};
|
|
446
446
|
}
|
|
447
|
-
const
|
|
447
|
+
const Ms = xe`
|
|
448
448
|
fragment PlatformModulesSubmissionFields on Submission {
|
|
449
449
|
_id
|
|
450
450
|
cachedDueDate
|
|
451
451
|
}
|
|
452
|
-
`,
|
|
452
|
+
`, xn = xe`
|
|
453
453
|
fragment PlatformModulesItemFields on ModuleItem {
|
|
454
454
|
_id
|
|
455
455
|
title
|
|
@@ -497,8 +497,8 @@ const Ro = Pe`
|
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
${
|
|
501
|
-
`,
|
|
500
|
+
${Ms}
|
|
501
|
+
`, Ln = xe`
|
|
502
502
|
fragment PlatformModulesProgressionFields on ModuleProgression {
|
|
503
503
|
workflowState
|
|
504
504
|
completed
|
|
@@ -518,7 +518,7 @@ const Ro = Pe`
|
|
|
518
518
|
score
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
|
-
`,
|
|
521
|
+
`, Ss = xe`
|
|
522
522
|
query PlatformModulesGetModules(
|
|
523
523
|
$courseId: ID!
|
|
524
524
|
$first: Int!
|
|
@@ -578,9 +578,9 @@ const Ro = Pe`
|
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
|
-
${
|
|
582
|
-
${
|
|
583
|
-
`,
|
|
581
|
+
${xn}
|
|
582
|
+
${Ln}
|
|
583
|
+
`, ys = xe`
|
|
584
584
|
query PlatformModulesGetModuleItems(
|
|
585
585
|
$moduleId: ID!
|
|
586
586
|
$first: Int!
|
|
@@ -611,265 +611,342 @@ const Ro = Pe`
|
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
|
-
${
|
|
615
|
-
${
|
|
614
|
+
${xn}
|
|
615
|
+
${Ln}
|
|
616
616
|
`;
|
|
617
|
-
function
|
|
617
|
+
function Rn() {
|
|
618
618
|
return new DOMException("The operation was aborted.", "AbortError");
|
|
619
619
|
}
|
|
620
|
-
function
|
|
621
|
-
if (e != null && e.aborted) throw
|
|
620
|
+
function je(e) {
|
|
621
|
+
if (e != null && e.aborted) throw Rn();
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function kt(e, t) {
|
|
624
624
|
return t ? new Promise((n, o) => {
|
|
625
|
-
const
|
|
626
|
-
t.addEventListener("abort",
|
|
625
|
+
const s = () => o(Rn());
|
|
626
|
+
t.addEventListener("abort", s, { once: !0 }), e.then(n, o).finally(() => t.removeEventListener("abort", s));
|
|
627
627
|
}) : e;
|
|
628
628
|
}
|
|
629
|
-
const
|
|
629
|
+
const Dt = [
|
|
630
630
|
"COMPLETED",
|
|
631
631
|
"INCOMPLETE",
|
|
632
632
|
"IN_PROGRESS",
|
|
633
633
|
"NOT_STARTED"
|
|
634
|
-
],
|
|
634
|
+
], _s = {
|
|
635
635
|
module: { completionStatus: ["eq"] }
|
|
636
636
|
};
|
|
637
|
-
function
|
|
637
|
+
function Ts(e) {
|
|
638
638
|
if (!e) return null;
|
|
639
639
|
if (e.target !== "module" || e.field !== "completionStatus" || e.op !== "eq")
|
|
640
640
|
throw new Error(
|
|
641
641
|
`Canvas GraphQL cannot serve ${e.target}.${e.field} "${e.op}". Only module.completionStatus eq is compiled here.`
|
|
642
642
|
);
|
|
643
643
|
const t = e.value;
|
|
644
|
-
if (!
|
|
644
|
+
if (!Dt.includes(t))
|
|
645
645
|
throw new Error(
|
|
646
|
-
`"${e.value}" is not a ModuleCompletionStatus (${
|
|
646
|
+
`"${e.value}" is not a ModuleCompletionStatus (${Dt.join(", ")}).`
|
|
647
647
|
);
|
|
648
648
|
return { completionStatus: t };
|
|
649
649
|
}
|
|
650
|
-
function
|
|
650
|
+
function sc({
|
|
651
651
|
executeQuery: e,
|
|
652
|
-
inlineItemLimit: t =
|
|
653
|
-
nodeBudget: n =
|
|
652
|
+
inlineItemLimit: t = ut,
|
|
653
|
+
nodeBudget: n = St,
|
|
654
654
|
onUnsupportedItem: o,
|
|
655
|
-
studentId:
|
|
656
|
-
validate:
|
|
657
|
-
capabilities: l =
|
|
655
|
+
studentId: s,
|
|
656
|
+
validate: r = !0,
|
|
657
|
+
capabilities: l = _s
|
|
658
658
|
}) {
|
|
659
|
-
const a =
|
|
659
|
+
const a = s != null, u = { onUnsupportedItem: o };
|
|
660
660
|
return {
|
|
661
661
|
inlineNodeBudget: n,
|
|
662
662
|
capabilities: l,
|
|
663
663
|
async listModules({
|
|
664
664
|
courseId: c,
|
|
665
|
-
cursor:
|
|
666
|
-
pageSize:
|
|
665
|
+
cursor: d,
|
|
666
|
+
pageSize: m,
|
|
667
667
|
includeItems: f,
|
|
668
|
-
filter:
|
|
669
|
-
inlineItemsFirst:
|
|
670
|
-
inlineFirst:
|
|
671
|
-
signal:
|
|
668
|
+
filter: S,
|
|
669
|
+
inlineItemsFirst: h,
|
|
670
|
+
inlineFirst: b,
|
|
671
|
+
signal: w
|
|
672
672
|
}) {
|
|
673
|
-
|
|
674
|
-
const
|
|
675
|
-
e(
|
|
673
|
+
je(w);
|
|
674
|
+
const E = f ? Math.min(b ?? m, m) : m, P = Math.min(h ?? t, t), z = Math.max(1, Math.min(P, Math.floor(n / E))), L = await kt(
|
|
675
|
+
e(Ss, {
|
|
676
676
|
courseId: c,
|
|
677
|
-
first:
|
|
678
|
-
after:
|
|
677
|
+
first: E,
|
|
678
|
+
after: d ?? null,
|
|
679
679
|
includeItems: f,
|
|
680
|
-
itemsFirst:
|
|
680
|
+
itemsFirst: z,
|
|
681
681
|
includeSubmissions: a,
|
|
682
|
-
studentId:
|
|
683
|
-
filter:
|
|
682
|
+
studentId: s ?? null,
|
|
683
|
+
filter: Ts(S)
|
|
684
684
|
}),
|
|
685
|
-
|
|
685
|
+
w
|
|
686
686
|
);
|
|
687
|
-
|
|
688
|
-
const
|
|
689
|
-
return
|
|
687
|
+
je(w);
|
|
688
|
+
const G = Is(L, u);
|
|
689
|
+
return r ? Yo.parse(G) : G;
|
|
690
690
|
},
|
|
691
691
|
async listModuleItems({
|
|
692
692
|
moduleId: c,
|
|
693
|
-
cursor:
|
|
694
|
-
pageSize:
|
|
693
|
+
cursor: d,
|
|
694
|
+
pageSize: m,
|
|
695
695
|
signal: f
|
|
696
696
|
}) {
|
|
697
|
-
|
|
698
|
-
const
|
|
699
|
-
e(
|
|
697
|
+
je(f);
|
|
698
|
+
const S = await kt(
|
|
699
|
+
e(ys, {
|
|
700
700
|
moduleId: c,
|
|
701
|
-
first:
|
|
702
|
-
after:
|
|
701
|
+
first: m,
|
|
702
|
+
after: d ?? null,
|
|
703
703
|
includeSubmissions: a,
|
|
704
|
-
studentId:
|
|
704
|
+
studentId: s ?? null
|
|
705
705
|
}),
|
|
706
706
|
f
|
|
707
707
|
);
|
|
708
|
-
|
|
709
|
-
const
|
|
710
|
-
return
|
|
708
|
+
je(f);
|
|
709
|
+
const h = bs(S, c, u);
|
|
710
|
+
return r ? Ho.parse(h) : h;
|
|
711
711
|
}
|
|
712
712
|
};
|
|
713
713
|
}
|
|
714
|
-
const
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
714
|
+
const be = ["platform-modules"], Le = {
|
|
715
|
+
all: be,
|
|
716
|
+
course: (e) => [...be, e],
|
|
717
|
+
list: (e, t = {}) => [...be, e, "list", t],
|
|
718
|
+
items: (e, t, n = {}) => [...be, e, "module", t, "items", n]
|
|
719
|
+
};
|
|
720
|
+
function Es(e) {
|
|
721
|
+
return [...be, e, "list"];
|
|
722
|
+
}
|
|
723
|
+
function dt(e, t) {
|
|
724
|
+
return [...be, e, "module", t, "items"];
|
|
725
|
+
}
|
|
726
|
+
function Cs(e, t, n, o) {
|
|
727
|
+
const s = o ? Le.items(t, n, o) : dt(t, n);
|
|
728
|
+
return e.invalidateQueries({ queryKey: s });
|
|
729
|
+
}
|
|
730
|
+
function Nt(e, t, n) {
|
|
731
|
+
const o = n ? Le.list(t, n) : Es(t);
|
|
732
|
+
return e.invalidateQueries({ queryKey: o });
|
|
733
|
+
}
|
|
734
|
+
function rc(e, t) {
|
|
735
|
+
return e.invalidateQueries({ queryKey: Le.course(t) });
|
|
736
|
+
}
|
|
737
|
+
const We = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
|
|
738
|
+
function Ke(e, t) {
|
|
739
|
+
const n = Object.entries(t ?? {}).filter(([, o]) => o !== void 0);
|
|
740
|
+
return { ...e, ...Object.fromEntries(n) };
|
|
741
|
+
}
|
|
742
|
+
function fe(e, t = {}) {
|
|
743
|
+
const n = Object.keys(e).map((s) => [
|
|
744
|
+
s,
|
|
745
|
+
Ke(e[s], We(t, s) ? t[s] : void 0)
|
|
746
|
+
]), o = Object.keys(t).filter((s) => !We(e, s)).sort().map((s) => [s, Ke({}, t[s])]);
|
|
747
|
+
return Object.fromEntries([...n, ...o]);
|
|
748
|
+
}
|
|
749
|
+
function Me(e, t) {
|
|
750
|
+
if (!(!We(e, t) || e[t].hidden))
|
|
751
|
+
return e[t];
|
|
752
|
+
}
|
|
753
|
+
function Ze(e) {
|
|
754
|
+
return Object.keys(e).filter((t) => Me(e, t) !== void 0).map((t) => ({ ...e[t], key: t })).sort((t, n) => t.order - n.order);
|
|
755
|
+
}
|
|
756
|
+
const ic = 1e3;
|
|
757
|
+
function ws({
|
|
758
|
+
queryClient: e,
|
|
759
|
+
courseId: t,
|
|
760
|
+
module: n,
|
|
761
|
+
item: o
|
|
762
|
+
}) {
|
|
763
|
+
return {
|
|
764
|
+
module: n,
|
|
765
|
+
item: o,
|
|
766
|
+
invalidateModuleItems: async (s) => {
|
|
767
|
+
await Promise.all([
|
|
768
|
+
Cs(e, t, s),
|
|
769
|
+
Nt(e, t)
|
|
770
|
+
]);
|
|
771
|
+
},
|
|
772
|
+
invalidateModuleList: () => Nt(e, t)
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
function lc(e, t) {
|
|
776
|
+
return Ze(e).filter(
|
|
777
|
+
(n) => n.visible == null || n.visible(t) === !0
|
|
778
|
+
);
|
|
779
|
+
}
|
|
780
|
+
const vs = "Course modules", Ps = { one: "%{count} module loaded", other: "%{count} modules loaded" }, As = "Expand all modules", xs = "Collapse all modules", Ls = { one: "Loading items in %{count} module…", other: "Loading items in %{count} modules…" }, Rs = "All items loaded", ks = { one: "%{count} module expanded", other: "%{count} modules expanded" }, Ds = { one: "%{count} module collapsed", other: "%{count} modules collapsed" }, Ns = "This filter runs on the modules loaded so far — load more to filter the rest of the course.", Os = "Modules failed to load: %{message}", qs = "Loading modules", Fs = "This course has no modules.", Us = { one: "The only loaded module does not match this filter.", other: "None of the %{count} loaded modules match this filter." }, zs = "No modules match this filter.", $s = "Clear filters", Bs = "Loading more modules…", Gs = "Load more modules (%{count} loaded)", js = { one: "The only module in this course is loaded.", other: "All %{count} modules in this course are loaded." }, Ys = "Filter", Hs = "All", Ws = "In progress", Ks = "Complete", Qs = "Due this week", Vs = "Missing", Zs = "Locked until %{name} is completed.", Xs = "Locked until %{prerequisites} are completed.", Js = "%{count} prerequisites", er = "%{label}. %{name}", tr = "%{name} progress", nr = { one: "%{loaded} of %{count} item loaded in %{name}", other: "%{loaded} of %{count} items loaded in %{name}" }, or = "Items failed to load: %{message}", sr = "Loading items", rr = "Loading…", ir = "No items.", lr = "Loading more items…", ar = "Load more items (%{loaded} of %{count} loaded)", cr = "(unpublished)", ur = "Collapse %{name}", dr = "Expand %{name}", mr = "Not started", pr = "In progress", gr = "All completed", fr = "%{count} Missing", hr = "%{count} Incomplete", Ir = "%{missing} & %{incomplete}", br = "Locked", Mr = "Due soon", Sr = "Not started", yr = "In progress", _r = "Completed", Tr = "Incomplete", Er = "Missing", Cr = "Locked", wr = "Due soon", vr = "Assignment", Pr = "Quiz", Ar = "Discussion", xr = "Page", Lr = "File", Rr = "External URL", kr = "External tool", Dr = "Text header", Nr = "Item type", Or = "Due date", qr = "Points", Fr = "Requirement", Ur = "Estimated duration", zr = "Publish state", $r = "View the item", Br = "Submit the assignment", Gr = "Contribute to the page", jr = "Mark as done", Yr = "Score at least the minimum", Hr = "Score at least %{count}", Wr = "Score at least the minimum percentage", Kr = "Score at least %{count}%", Qr = "Complete the requirement", Vr = "today, %{time}", Zr = "yesterday, %{time}", Xr = "tomorrow, %{time}", Jr = "%{date}, %{time}", ei = "%{time} (%{zone})", ti = "Due %{when}", ni = "Will unlock on %{when}", oi = "Unlocked on %{when}", si = { one: "%{count} pt", other: "%{count} pts" }, ri = { one: "%{percent}% | %{met} of %{count} requirement met", other: "%{percent}% | %{met} of %{count} requirements met" }, ii = { one: "%{percent}% complete, %{met} of %{count} requirement met", other: "%{percent}% complete, %{met} of %{count} requirements met" }, li = "%{percent}%", ai = { one: "%{completedModules} of %{totalModules} module complete", other: "%{completedModules} of %{totalModules} modules complete" }, ci = "(%{itemsSummary})", ui = { one: "%{completedItems} of %{totalItems} item", other: "%{completedItems} of %{totalItems} items" }, di = "Module progress", mi = "%{name}: %{status}", pi = "%{count} min", gi = "Unpublished", fi = "Untitled item", hi = "opens in a new window", Ii = {
|
|
781
|
+
pageTitle: vs,
|
|
782
|
+
modulesLoadedAnnouncement: Ps,
|
|
783
|
+
expandAllModules: As,
|
|
784
|
+
collapseAllModules: xs,
|
|
785
|
+
expandAllLoadingItems: Ls,
|
|
786
|
+
expandAllItemsLoaded: Rs,
|
|
787
|
+
modulesExpandedAnnouncement: ks,
|
|
788
|
+
modulesCollapsedAnnouncement: Ds,
|
|
789
|
+
filterScopeHint: Ns,
|
|
790
|
+
modulesLoadErrorAlert: Os,
|
|
791
|
+
modulesLoadingSpinnerLabel: qs,
|
|
792
|
+
noModulesEmptyState: Fs,
|
|
793
|
+
filteredEmptyState: Us,
|
|
794
|
+
noFilterMatches: zs,
|
|
795
|
+
clearFilters: $s,
|
|
796
|
+
loadMoreModulesLoading: Bs,
|
|
797
|
+
loadMoreModules: Gs,
|
|
798
|
+
allModulesLoaded: js,
|
|
799
|
+
filterGroupLabel: Ys,
|
|
800
|
+
filterAll: Hs,
|
|
801
|
+
filterInProgress: Ws,
|
|
802
|
+
filterComplete: Ks,
|
|
803
|
+
filterDueThisWeek: Qs,
|
|
804
|
+
filterMissing: Vs,
|
|
805
|
+
lockedByPrerequisiteByline: Zs,
|
|
806
|
+
lockedByPrerequisitesByline: Xs,
|
|
807
|
+
lockedByPrerequisitesCount: Js,
|
|
808
|
+
moduleNameWithLabel: er,
|
|
809
|
+
moduleProgressScreenReaderLabel: tr,
|
|
810
|
+
itemsLoadedAnnouncement: nr,
|
|
811
|
+
itemsLoadErrorAlert: or,
|
|
812
|
+
itemsLoadingSpinnerLabel: sr,
|
|
813
|
+
itemsLoadingText: rr,
|
|
814
|
+
noItemsEmptyState: ir,
|
|
815
|
+
loadMoreItemsLoading: lr,
|
|
816
|
+
loadMoreItems: ar,
|
|
817
|
+
moduleUnpublishedBadge: cr,
|
|
818
|
+
collapseModule: ur,
|
|
819
|
+
expandModule: dr,
|
|
820
|
+
moduleStatusNotStarted: mr,
|
|
821
|
+
moduleStatusInProgress: pr,
|
|
822
|
+
moduleStatusComplete: gr,
|
|
823
|
+
moduleStatusMissing: fr,
|
|
824
|
+
moduleStatusIncomplete: hr,
|
|
825
|
+
moduleStatusMissingAndIncomplete: Ir,
|
|
826
|
+
moduleStatusLocked: br,
|
|
827
|
+
moduleStatusDueSoon: Mr,
|
|
828
|
+
itemStatusNotStarted: Sr,
|
|
829
|
+
itemStatusInProgress: yr,
|
|
830
|
+
itemStatusComplete: _r,
|
|
831
|
+
itemStatusIncomplete: Tr,
|
|
832
|
+
itemStatusMissing: Er,
|
|
833
|
+
itemStatusLocked: Cr,
|
|
834
|
+
itemStatusDueSoon: wr,
|
|
835
|
+
itemTypeAssignment: vr,
|
|
836
|
+
itemTypeQuiz: Pr,
|
|
837
|
+
itemTypeDiscussion: Ar,
|
|
838
|
+
itemTypePage: xr,
|
|
839
|
+
itemTypeFile: Lr,
|
|
840
|
+
itemTypeExternalUrl: Rr,
|
|
841
|
+
itemTypeExternalTool: kr,
|
|
842
|
+
itemTypeSubHeader: Dr,
|
|
843
|
+
metaFieldTypeLabel: Nr,
|
|
844
|
+
metaFieldDueAtLabel: Or,
|
|
845
|
+
metaFieldPointsLabel: qr,
|
|
846
|
+
metaFieldRequirementLabel: Fr,
|
|
847
|
+
metaFieldDurationLabel: Ur,
|
|
848
|
+
metaFieldPublishStateLabel: zr,
|
|
849
|
+
requirementMustView: $r,
|
|
850
|
+
requirementMustSubmit: Br,
|
|
851
|
+
requirementMustContribute: Gr,
|
|
852
|
+
requirementMustMarkDone: jr,
|
|
853
|
+
requirementMinScoreUnknown: Yr,
|
|
854
|
+
requirementMinScore: Hr,
|
|
855
|
+
requirementMinPercentageUnknown: Wr,
|
|
856
|
+
requirementMinPercentage: Kr,
|
|
857
|
+
requirementUnknown: Qr,
|
|
858
|
+
dateTimeToday: Vr,
|
|
859
|
+
dateTimeYesterday: Zr,
|
|
860
|
+
dateTimeTomorrow: Xr,
|
|
861
|
+
dateTimeWithDate: Jr,
|
|
862
|
+
timeWithZone: ei,
|
|
863
|
+
dueByline: ti,
|
|
864
|
+
unlockByline: ni,
|
|
865
|
+
unlockedByline: oi,
|
|
866
|
+
pointsAbbreviated: si,
|
|
867
|
+
progressSummary: ri,
|
|
868
|
+
progressScreenReaderValue: ii,
|
|
869
|
+
moduleProgressOverviewPercentLabel: li,
|
|
870
|
+
moduleProgressOverviewSummary: ai,
|
|
871
|
+
moduleProgressOverviewDetail: ci,
|
|
872
|
+
moduleProgressOverviewItemsSummary: ui,
|
|
873
|
+
moduleProgressOverviewGroupLabel: di,
|
|
874
|
+
moduleProgressSegmentLabel: mi,
|
|
875
|
+
durationMinutes: pi,
|
|
876
|
+
itemUnpublishedLabel: gi,
|
|
877
|
+
itemUntitled: fi,
|
|
878
|
+
opensInNewWindow: hi
|
|
879
|
+
}, bi = /%\{(\w+)\}/g, Mi = Ii, Se = "en-US", Si = /* @__PURE__ */ new Map(), yi = /* @__PURE__ */ new Map();
|
|
880
|
+
function kn(e, t, n) {
|
|
804
881
|
const o = e.get(t);
|
|
805
882
|
if (o) return o;
|
|
806
|
-
const
|
|
807
|
-
return e.set(t,
|
|
808
|
-
}
|
|
809
|
-
function
|
|
810
|
-
return n ? e.replace(
|
|
811
|
-
if (!Object.prototype.hasOwnProperty.call(n,
|
|
812
|
-
const
|
|
813
|
-
return typeof
|
|
883
|
+
const s = n();
|
|
884
|
+
return e.set(t, s), s;
|
|
885
|
+
}
|
|
886
|
+
function _i(e, t, n) {
|
|
887
|
+
return n ? e.replace(bi, (o, s) => {
|
|
888
|
+
if (!Object.prototype.hasOwnProperty.call(n, s)) return o;
|
|
889
|
+
const r = n[s];
|
|
890
|
+
return typeof r == "number" && Number.isFinite(r) ? kn(yi, t, () => new Intl.NumberFormat(t)).format(r) : String(r);
|
|
814
891
|
}) : e;
|
|
815
892
|
}
|
|
816
|
-
function
|
|
893
|
+
function Ti(e, t, n) {
|
|
817
894
|
const o = n == null ? void 0 : n.count;
|
|
818
895
|
if (typeof o == "number" && Number.isFinite(o)) {
|
|
819
|
-
const
|
|
820
|
-
if (typeof
|
|
896
|
+
const s = kn(Si, t, () => new Intl.PluralRules(t)).select(o), r = e[s];
|
|
897
|
+
if (typeof r == "string") return r;
|
|
821
898
|
}
|
|
822
899
|
return typeof e.other == "string" ? e.other : void 0;
|
|
823
900
|
}
|
|
824
|
-
function
|
|
901
|
+
function Ot(e, t, n) {
|
|
825
902
|
if (typeof e == "string") return e;
|
|
826
903
|
if (e !== null && typeof e == "object")
|
|
827
|
-
return
|
|
904
|
+
return Ti(e, t, n);
|
|
828
905
|
}
|
|
829
|
-
const
|
|
830
|
-
function
|
|
831
|
-
|
|
906
|
+
const qt = /* @__PURE__ */ new Set();
|
|
907
|
+
function Ei(e) {
|
|
908
|
+
qt.has(e) || (qt.add(e), console.warn(
|
|
832
909
|
`[platform-modules] no translation for "${e}"; it will render as itself. Add it to the catalog passed to ModulesI18nProvider.`
|
|
833
910
|
));
|
|
834
911
|
}
|
|
835
|
-
function
|
|
836
|
-
const
|
|
837
|
-
if (typeof
|
|
838
|
-
const l =
|
|
839
|
-
return typeof l == "string" ? l : (o &&
|
|
912
|
+
function Ci(e, t, n, o, s) {
|
|
913
|
+
const r = Ot(e == null ? void 0 : e[t], n, s);
|
|
914
|
+
if (typeof r == "string") return r;
|
|
915
|
+
const l = Ot(Mi[t], n, s);
|
|
916
|
+
return typeof l == "string" ? l : (o && Ei(t), t);
|
|
840
917
|
}
|
|
841
|
-
function
|
|
842
|
-
return (o,
|
|
918
|
+
function Dn(e, t = Se, n = !1) {
|
|
919
|
+
return (o, s) => _i(Ci(e, o, t, n, s), t, s);
|
|
843
920
|
}
|
|
844
|
-
const
|
|
845
|
-
function
|
|
921
|
+
const wi = Dn(), vi = { t: wi, locale: Se }, Nn = on(null);
|
|
922
|
+
function ac({
|
|
846
923
|
translations: e,
|
|
847
924
|
locale: t,
|
|
848
925
|
timezone: n,
|
|
849
926
|
warnOnMissingKey: o,
|
|
850
|
-
children:
|
|
927
|
+
children: s
|
|
851
928
|
}) {
|
|
852
|
-
const
|
|
853
|
-
const l = t ??
|
|
929
|
+
const r = N(() => {
|
|
930
|
+
const l = t ?? Se;
|
|
854
931
|
return {
|
|
855
|
-
t:
|
|
932
|
+
t: Dn(e, l, o),
|
|
856
933
|
locale: l,
|
|
857
934
|
timezone: n
|
|
858
935
|
};
|
|
859
936
|
}, [e, t, n, o]);
|
|
860
|
-
return /* @__PURE__ */ i(
|
|
937
|
+
return /* @__PURE__ */ i(Nn.Provider, { value: r, children: s });
|
|
861
938
|
}
|
|
862
|
-
function
|
|
863
|
-
return
|
|
939
|
+
function B() {
|
|
940
|
+
return sn(Nn) ?? vi;
|
|
864
941
|
}
|
|
865
|
-
const
|
|
866
|
-
function
|
|
867
|
-
const t =
|
|
942
|
+
const Pi = 864e5, Ai = "en-US", Ft = /* @__PURE__ */ new Map(), Ut = /* @__PURE__ */ new Map();
|
|
943
|
+
function xi(e) {
|
|
944
|
+
const t = Ut.get(e);
|
|
868
945
|
if (t) return t;
|
|
869
946
|
const n = new Intl.NumberFormat(e, { minimumIntegerDigits: 2, useGrouping: !1 });
|
|
870
|
-
return
|
|
947
|
+
return Ut.set(e, n), n;
|
|
871
948
|
}
|
|
872
|
-
function
|
|
949
|
+
function zt(e, t) {
|
|
873
950
|
return {
|
|
874
951
|
time: new Intl.DateTimeFormat(e, {
|
|
875
952
|
hour: "numeric",
|
|
@@ -884,7 +961,7 @@ function yt(e, t) {
|
|
|
884
961
|
timeZone: t
|
|
885
962
|
}),
|
|
886
963
|
zone: t ? new Intl.DateTimeFormat(e, { timeZone: t, timeZoneName: "short" }) : void 0,
|
|
887
|
-
civilDay: new Intl.DateTimeFormat(
|
|
964
|
+
civilDay: new Intl.DateTimeFormat(Ai, {
|
|
888
965
|
year: "numeric",
|
|
889
966
|
month: "numeric",
|
|
890
967
|
day: "numeric",
|
|
@@ -892,57 +969,65 @@ function yt(e, t) {
|
|
|
892
969
|
})
|
|
893
970
|
};
|
|
894
971
|
}
|
|
895
|
-
function
|
|
896
|
-
const n = t || void 0, o = `${e}|${n ?? ""}`,
|
|
897
|
-
if (
|
|
898
|
-
let
|
|
972
|
+
function On(e, t) {
|
|
973
|
+
const n = t || void 0, o = `${e}|${n ?? ""}`, s = Ft.get(o);
|
|
974
|
+
if (s) return s;
|
|
975
|
+
let r;
|
|
899
976
|
try {
|
|
900
|
-
|
|
977
|
+
r = zt(e, n);
|
|
901
978
|
} catch {
|
|
902
979
|
console.warn(
|
|
903
980
|
`[platform-modules] Unusable timezone ${JSON.stringify(n)}; rendering dates in the viewer's own clock instead.`
|
|
904
|
-
),
|
|
981
|
+
), r = zt(e, void 0);
|
|
905
982
|
}
|
|
906
|
-
return
|
|
983
|
+
return Ft.set(o, r), r;
|
|
907
984
|
}
|
|
908
|
-
function
|
|
909
|
-
return new Date(
|
|
985
|
+
function $t(e, t) {
|
|
986
|
+
return new Date(mt(e, t)).getUTCFullYear();
|
|
910
987
|
}
|
|
911
|
-
function
|
|
988
|
+
function Li(e, t) {
|
|
912
989
|
var o;
|
|
913
|
-
const n = (o = e.zone) == null ? void 0 : o.formatToParts(t).find((
|
|
990
|
+
const n = (o = e.zone) == null ? void 0 : o.formatToParts(t).find((s) => s.type === "timeZoneName");
|
|
914
991
|
return (n == null ? void 0 : n.value) ?? null;
|
|
915
992
|
}
|
|
916
|
-
function
|
|
917
|
-
const n = e.civilDay.formatToParts(t), o = (
|
|
918
|
-
var
|
|
919
|
-
return Number((
|
|
993
|
+
function mt(e, t) {
|
|
994
|
+
const n = e.civilDay.formatToParts(t), o = (s) => {
|
|
995
|
+
var r;
|
|
996
|
+
return Number((r = n.find((l) => l.type === s)) == null ? void 0 : r.value);
|
|
920
997
|
};
|
|
921
998
|
return Date.UTC(o("year"), o("month") - 1, o("day"));
|
|
922
999
|
}
|
|
923
|
-
function
|
|
924
|
-
return
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
1000
|
+
function Ri(e, t, n) {
|
|
1001
|
+
return Fn(On(Se, n), e, t);
|
|
1002
|
+
}
|
|
1003
|
+
const qn = 7;
|
|
1004
|
+
function yt(e, t, n) {
|
|
1005
|
+
if (!e) return !1;
|
|
1006
|
+
const o = new Date(e);
|
|
1007
|
+
if (Number.isNaN(o.getTime())) return !1;
|
|
1008
|
+
const s = Ri(o, t, n);
|
|
1009
|
+
return s >= 0 && s < qn;
|
|
1010
|
+
}
|
|
1011
|
+
function Fn(e, t, n) {
|
|
1012
|
+
return Math.round((mt(e, t) - mt(e, n)) / Pi);
|
|
1013
|
+
}
|
|
1014
|
+
function ki(e, t, n, { locale: o = Se, timezone: s } = {}) {
|
|
1015
|
+
const r = new Date(t);
|
|
1016
|
+
if (Number.isNaN(r.getTime())) return t;
|
|
1017
|
+
const l = On(o, s), a = Li(l, r), u = l.time.format(r), c = a ? e("timeWithZone", { time: u, zone: a }) : u, d = Fn(l, r, n);
|
|
1018
|
+
if (d === 0) return e("dateTimeToday", { time: c });
|
|
1019
|
+
if (d === -1) return e("dateTimeYesterday", { time: c });
|
|
1020
|
+
if (d === 1) return e("dateTimeTomorrow", { time: c });
|
|
1021
|
+
const f = $t(l, r) === $t(l, n) ? l.day.format(r) : l.dayYear.format(r);
|
|
937
1022
|
return e("dateTimeWithDate", { date: f, time: c });
|
|
938
1023
|
}
|
|
939
|
-
function
|
|
940
|
-
return !Number.isInteger(e) || e < 1 ? null :
|
|
1024
|
+
function Di(e, t = Se) {
|
|
1025
|
+
return !Number.isInteger(e) || e < 1 ? null : xi(t).format(e);
|
|
941
1026
|
}
|
|
942
|
-
function
|
|
1027
|
+
function Ni(e, t) {
|
|
943
1028
|
return t == null ? null : e("pointsAbbreviated", { count: t });
|
|
944
1029
|
}
|
|
945
|
-
function
|
|
1030
|
+
function Oi(e, t) {
|
|
946
1031
|
switch (t.type) {
|
|
947
1032
|
case "must_view":
|
|
948
1033
|
return e("requirementMustView");
|
|
@@ -960,13 +1045,13 @@ function ks(e, t) {
|
|
|
960
1045
|
return e("requirementUnknown");
|
|
961
1046
|
}
|
|
962
1047
|
}
|
|
963
|
-
function
|
|
1048
|
+
function qi(e, t, n, o) {
|
|
964
1049
|
return e("progressSummary", { percent: t, met: n, count: o });
|
|
965
1050
|
}
|
|
966
|
-
function
|
|
1051
|
+
function Fi(e, t, n, o) {
|
|
967
1052
|
return e("progressScreenReaderValue", { percent: t, met: n, count: o });
|
|
968
1053
|
}
|
|
969
|
-
const
|
|
1054
|
+
const ne = "all", cc = qn, Ui = {
|
|
970
1055
|
all: {
|
|
971
1056
|
label: "filterAll",
|
|
972
1057
|
order: 10,
|
|
@@ -995,13 +1080,8 @@ const te = "all", Fs = 7, Us = {
|
|
|
995
1080
|
label: "filterDueThisWeek",
|
|
996
1081
|
order: 40,
|
|
997
1082
|
predicate: (e, { today: t, timezone: n }) => {
|
|
998
|
-
var
|
|
999
|
-
|
|
1000
|
-
if (!o) return !1;
|
|
1001
|
-
const r = new Date(o);
|
|
1002
|
-
if (Number.isNaN(r.getTime())) return !1;
|
|
1003
|
-
const s = xs(r, t, n);
|
|
1004
|
-
return s >= 0 && s < Fs;
|
|
1083
|
+
var o;
|
|
1084
|
+
return yt((o = e.progress) == null ? void 0 : o.nextDueAt, t, n);
|
|
1005
1085
|
}
|
|
1006
1086
|
},
|
|
1007
1087
|
missing: {
|
|
@@ -1013,43 +1093,24 @@ const te = "all", Fs = 7, Us = {
|
|
|
1013
1093
|
}
|
|
1014
1094
|
}
|
|
1015
1095
|
};
|
|
1016
|
-
function
|
|
1096
|
+
function _t(e) {
|
|
1017
1097
|
if (!(!e || e.clientOnly))
|
|
1018
1098
|
return e.query;
|
|
1019
1099
|
}
|
|
1020
|
-
function
|
|
1021
|
-
return e !== void 0 &&
|
|
1022
|
-
}
|
|
1023
|
-
const zs = {
|
|
1024
|
-
moduleLabel: (e, t, { locale: n }) => Ns(e, n),
|
|
1025
|
-
dateTime: (e, t, { t: n, locale: o, timezone: r }) => Rs(n, e, t, { locale: o, timezone: r }),
|
|
1026
|
-
points: (e, { t }) => Ds(t, e),
|
|
1027
|
-
progress: (e, t, n, { t: o }) => qs(o, e, t, n)
|
|
1028
|
-
}, Oe = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
|
|
1029
|
-
function Fe(e, t) {
|
|
1030
|
-
const n = Object.entries(t ?? {}).filter(([, o]) => o !== void 0);
|
|
1031
|
-
return { ...e, ...Object.fromEntries(n) };
|
|
1100
|
+
function pt(e) {
|
|
1101
|
+
return e !== void 0 && _t(e) === void 0;
|
|
1032
1102
|
}
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
}
|
|
1040
|
-
function ce(e, t) {
|
|
1041
|
-
if (!(!Oe(e, t) || e[t].hidden))
|
|
1042
|
-
return e[t];
|
|
1043
|
-
}
|
|
1044
|
-
function it(e) {
|
|
1045
|
-
return Object.keys(e).filter((t) => ce(e, t) !== void 0).map((t) => ({ ...e[t], key: t })).sort((t, n) => t.order - n.order);
|
|
1046
|
-
}
|
|
1047
|
-
const $s = "type", Bs = {
|
|
1103
|
+
const zi = {
|
|
1104
|
+
moduleLabel: (e, t, { locale: n }) => Di(e, n),
|
|
1105
|
+
dateTime: (e, t, { t: n, locale: o, timezone: s }) => ki(n, e, t, { locale: o, timezone: s }),
|
|
1106
|
+
points: (e, { t }) => Ni(t, e),
|
|
1107
|
+
progress: (e, t, n, { t: o }) => qi(o, e, t, n)
|
|
1108
|
+
}, $i = "type", Bi = {
|
|
1048
1109
|
type: {
|
|
1049
1110
|
label: "metaFieldTypeLabel",
|
|
1050
1111
|
order: 10,
|
|
1051
1112
|
render: ({ item: e, t, config: n }) => {
|
|
1052
|
-
const o =
|
|
1113
|
+
const o = Me(n.itemTypes, e.type);
|
|
1053
1114
|
return o ? t(o.label) : null;
|
|
1054
1115
|
}
|
|
1055
1116
|
},
|
|
@@ -1066,13 +1127,13 @@ const $s = "type", Bs = {
|
|
|
1066
1127
|
requirement: {
|
|
1067
1128
|
label: "metaFieldRequirementLabel",
|
|
1068
1129
|
order: 40,
|
|
1069
|
-
render: ({ item: e, t }) => e.completionRequirement ?
|
|
1130
|
+
render: ({ item: e, t }) => e.completionRequirement ? Oi(t, e.completionRequirement) : null
|
|
1070
1131
|
},
|
|
1071
1132
|
estimatedDuration: {
|
|
1072
1133
|
label: "metaFieldDurationLabel",
|
|
1073
1134
|
order: 50,
|
|
1074
1135
|
render: ({ item: e, t }) => {
|
|
1075
|
-
const n =
|
|
1136
|
+
const n = Wo(e);
|
|
1076
1137
|
return n === null ? null : t("durationMinutes", { count: n });
|
|
1077
1138
|
}
|
|
1078
1139
|
},
|
|
@@ -1081,335 +1142,348 @@ const $s = "type", Bs = {
|
|
|
1081
1142
|
order: 60,
|
|
1082
1143
|
render: ({ item: e, t }) => e.published ? null : t("itemUnpublishedLabel")
|
|
1083
1144
|
}
|
|
1084
|
-
},
|
|
1145
|
+
}, oe = { size: "md", color: "mutedColor" }, Gi = {
|
|
1085
1146
|
assignment: {
|
|
1086
1147
|
label: "itemTypeAssignment",
|
|
1087
1148
|
order: 10,
|
|
1088
|
-
icon: /* @__PURE__ */ i(
|
|
1149
|
+
icon: /* @__PURE__ */ i(Mo, { ...oe })
|
|
1089
1150
|
},
|
|
1090
|
-
quiz: { label: "itemTypeQuiz", order: 20, icon: /* @__PURE__ */ i(
|
|
1151
|
+
quiz: { label: "itemTypeQuiz", order: 20, icon: /* @__PURE__ */ i(bo, { ...oe }) },
|
|
1091
1152
|
discussion: {
|
|
1092
1153
|
label: "itemTypeDiscussion",
|
|
1093
1154
|
order: 30,
|
|
1094
|
-
icon: /* @__PURE__ */ i(
|
|
1155
|
+
icon: /* @__PURE__ */ i(Io, { ...oe })
|
|
1095
1156
|
},
|
|
1096
|
-
page: { label: "itemTypePage", order: 40, icon: /* @__PURE__ */ i(
|
|
1097
|
-
file: { label: "itemTypeFile", order: 50, icon: /* @__PURE__ */ i(
|
|
1157
|
+
page: { label: "itemTypePage", order: 40, icon: /* @__PURE__ */ i(ho, { ...oe }) },
|
|
1158
|
+
file: { label: "itemTypeFile", order: 50, icon: /* @__PURE__ */ i(fo, { ...oe }) },
|
|
1098
1159
|
external_url: {
|
|
1099
1160
|
label: "itemTypeExternalUrl",
|
|
1100
1161
|
order: 60,
|
|
1101
|
-
icon: /* @__PURE__ */ i(
|
|
1162
|
+
icon: /* @__PURE__ */ i(go, { ...oe })
|
|
1102
1163
|
},
|
|
1103
1164
|
external_tool: {
|
|
1104
1165
|
label: "itemTypeExternalTool",
|
|
1105
1166
|
order: 70,
|
|
1106
|
-
icon: /* @__PURE__ */ i(
|
|
1167
|
+
icon: /* @__PURE__ */ i(po, { ...oe })
|
|
1107
1168
|
},
|
|
1108
1169
|
sub_header: { label: "itemTypeSubHeader", order: 80, icon: null }
|
|
1109
|
-
},
|
|
1110
|
-
formatters:
|
|
1111
|
-
itemTypes:
|
|
1170
|
+
}, Xe = {
|
|
1171
|
+
formatters: zi,
|
|
1172
|
+
itemTypes: Gi,
|
|
1112
1173
|
itemStatuses: {},
|
|
1113
|
-
itemMeta:
|
|
1114
|
-
filters:
|
|
1174
|
+
itemMeta: Bi,
|
|
1175
|
+
filters: Ui,
|
|
1115
1176
|
moduleActions: {},
|
|
1116
1177
|
itemActions: {},
|
|
1117
1178
|
navigation: {}
|
|
1118
1179
|
};
|
|
1119
|
-
Object.freeze(
|
|
1120
|
-
for (const e of Object.values(
|
|
1180
|
+
Object.freeze(Xe);
|
|
1181
|
+
for (const e of Object.values(Xe)) {
|
|
1121
1182
|
Object.freeze(e);
|
|
1122
1183
|
for (const t of Object.values(e)) Object.freeze(t);
|
|
1123
1184
|
}
|
|
1124
|
-
function
|
|
1125
|
-
return
|
|
1126
|
-
const o =
|
|
1127
|
-
return o !== void 0 && !
|
|
1185
|
+
function ji(e, t) {
|
|
1186
|
+
return Ze(e).filter((n) => {
|
|
1187
|
+
const o = _t(n);
|
|
1188
|
+
return o !== void 0 && !qo(t, o);
|
|
1128
1189
|
}).map((n) => n.key);
|
|
1129
1190
|
}
|
|
1130
|
-
function
|
|
1191
|
+
function Bt(e) {
|
|
1131
1192
|
return `[platform-modules] the adapter cannot serve filter(s): ${e.join(", ")}. Add the field to the adapter's capabilities, or set clientOnly on the entry.`;
|
|
1132
1193
|
}
|
|
1133
|
-
function
|
|
1134
|
-
const n =
|
|
1194
|
+
function Yi(e, t) {
|
|
1195
|
+
const n = ji(e, t);
|
|
1135
1196
|
if (n.length === 0) return e;
|
|
1136
1197
|
if (process.env.NODE_ENV !== "production")
|
|
1137
|
-
throw new Error(
|
|
1138
|
-
console.warn(
|
|
1139
|
-
const o = Object.fromEntries(n.map((
|
|
1198
|
+
throw new Error(Bt(n));
|
|
1199
|
+
console.warn(Bt(n));
|
|
1200
|
+
const o = Object.fromEntries(n.map((s) => [s, { ...e[s], hidden: !0 }]));
|
|
1140
1201
|
return { ...e, ...o };
|
|
1141
1202
|
}
|
|
1142
|
-
const
|
|
1143
|
-
function
|
|
1144
|
-
return /* @__PURE__ */ i(
|
|
1203
|
+
const Un = on(null);
|
|
1204
|
+
function uc({ value: e, children: t }) {
|
|
1205
|
+
return /* @__PURE__ */ i(Un.Provider, { value: e, children: t });
|
|
1145
1206
|
}
|
|
1146
|
-
function
|
|
1147
|
-
return
|
|
1207
|
+
function ye() {
|
|
1208
|
+
return sn(Un) ?? Xe;
|
|
1148
1209
|
}
|
|
1149
|
-
function
|
|
1150
|
-
return
|
|
1210
|
+
function dc(e) {
|
|
1211
|
+
return Me(ye().itemMeta, e) !== void 0;
|
|
1151
1212
|
}
|
|
1152
|
-
const
|
|
1153
|
-
label:
|
|
1154
|
-
order:
|
|
1155
|
-
hidden:
|
|
1213
|
+
const Re = p.object({
|
|
1214
|
+
label: p.string(),
|
|
1215
|
+
order: p.number(),
|
|
1216
|
+
hidden: p.boolean().optional()
|
|
1156
1217
|
});
|
|
1157
|
-
function
|
|
1158
|
-
return
|
|
1218
|
+
function Ie(e) {
|
|
1219
|
+
return p.record(p.string(), e);
|
|
1159
1220
|
}
|
|
1160
|
-
const
|
|
1221
|
+
const Hi = Ie(Re.strict()), zn = (e) => e == null || typeof e == "string" || typeof e == "number" || typeof e == "bigint" || typeof e == "boolean" || rn(e) || Array.isArray(e) && e.every(zn), Wi = (e) => {
|
|
1161
1222
|
var t;
|
|
1162
1223
|
return e == null || typeof e == "function" && !((t = e.prototype) != null && t.isReactComponent);
|
|
1163
|
-
},
|
|
1164
|
-
icon:
|
|
1165
|
-
renderIcon:
|
|
1224
|
+
}, Ki = Re.extend({
|
|
1225
|
+
icon: p.custom(zn, { message: "icon must be a ReactNode" }),
|
|
1226
|
+
renderIcon: p.custom(Wi, {
|
|
1166
1227
|
message: "renderIcon must be a function of the item, not a React component"
|
|
1167
1228
|
})
|
|
1229
|
+
}).strict(), $n = (e) => {
|
|
1230
|
+
var t;
|
|
1231
|
+
return typeof e == "function" && !((t = e.prototype) != null && t.isReactComponent);
|
|
1232
|
+
}, Gt = (e) => e == null || $n(e), jt = Re.extend({
|
|
1233
|
+
onSelect: p.custom($n, {
|
|
1234
|
+
message: "onSelect must be a function taking an ActionContext"
|
|
1235
|
+
}),
|
|
1236
|
+
visible: p.custom(Gt, {
|
|
1237
|
+
message: "visible must be a function taking an ActionContext, not a React component"
|
|
1238
|
+
}),
|
|
1239
|
+
renderModal: p.custom(Gt, {
|
|
1240
|
+
message: "renderModal must be a function taking an ActionContext, not a React component"
|
|
1241
|
+
})
|
|
1168
1242
|
}).strict();
|
|
1169
|
-
function
|
|
1170
|
-
return
|
|
1243
|
+
function Ye() {
|
|
1244
|
+
return p.custom((e) => typeof e == "function", {
|
|
1171
1245
|
message: "Expected a function"
|
|
1172
1246
|
});
|
|
1173
1247
|
}
|
|
1174
|
-
const
|
|
1175
|
-
render:
|
|
1248
|
+
const Qi = Re.extend({
|
|
1249
|
+
render: p.custom((e) => typeof e == "function", {
|
|
1176
1250
|
message: "render must be a function taking a MetaFieldContext"
|
|
1177
1251
|
})
|
|
1178
|
-
}).strict(),
|
|
1179
|
-
predicate:
|
|
1252
|
+
}).strict(), Vi = Re.extend({
|
|
1253
|
+
predicate: p.custom((e) => typeof e == "function", {
|
|
1180
1254
|
message: "predicate must be a function of the module and a FilterContext"
|
|
1181
1255
|
}),
|
|
1182
|
-
query:
|
|
1183
|
-
clientOnly:
|
|
1184
|
-
}).strict(),
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1256
|
+
query: Oo.optional(),
|
|
1257
|
+
clientOnly: p.boolean().optional()
|
|
1258
|
+
}).strict(), ot = () => p.custom((e) => typeof e == "function", { message: "Expected a function" }).optional(), Zi = p.object({
|
|
1259
|
+
getItemHref: ot(),
|
|
1260
|
+
getModuleHref: ot(),
|
|
1261
|
+
onItemClick: ot()
|
|
1262
|
+
}).strict(), Xi = p.object({
|
|
1263
|
+
formatters: p.object({
|
|
1264
|
+
moduleLabel: Ye(),
|
|
1265
|
+
dateTime: Ye(),
|
|
1266
|
+
points: Ye(),
|
|
1267
|
+
progress: Ye()
|
|
1190
1268
|
}).strict(),
|
|
1191
|
-
itemTypes:
|
|
1192
|
-
itemStatuses:
|
|
1193
|
-
itemMeta:
|
|
1194
|
-
filters:
|
|
1195
|
-
moduleActions:
|
|
1196
|
-
itemActions:
|
|
1197
|
-
navigation:
|
|
1269
|
+
itemTypes: Ie(Ki),
|
|
1270
|
+
itemStatuses: Hi,
|
|
1271
|
+
itemMeta: Ie(Qi),
|
|
1272
|
+
filters: Ie(Vi),
|
|
1273
|
+
moduleActions: Ie(jt),
|
|
1274
|
+
itemActions: Ie(jt),
|
|
1275
|
+
navigation: Zi
|
|
1198
1276
|
});
|
|
1199
|
-
function
|
|
1200
|
-
const n = Object.keys(t).filter((
|
|
1277
|
+
function Ji(e, t = {}) {
|
|
1278
|
+
const n = Object.keys(t).filter((s) => !We(e, s));
|
|
1201
1279
|
if (n.length > 0)
|
|
1202
1280
|
throw new Error(
|
|
1203
1281
|
`Unknown modules config key(s): ${n.join(", ")}. Known keys are ${Object.keys(e).join(", ")}.`
|
|
1204
1282
|
);
|
|
1205
1283
|
const o = {
|
|
1206
|
-
formatters:
|
|
1207
|
-
itemTypes:
|
|
1208
|
-
itemStatuses:
|
|
1209
|
-
itemMeta:
|
|
1210
|
-
filters:
|
|
1211
|
-
moduleActions:
|
|
1212
|
-
itemActions:
|
|
1213
|
-
navigation:
|
|
1284
|
+
formatters: Ke(e.formatters, t.formatters),
|
|
1285
|
+
itemTypes: fe(e.itemTypes, t.itemTypes),
|
|
1286
|
+
itemStatuses: fe(e.itemStatuses, t.itemStatuses),
|
|
1287
|
+
itemMeta: fe(e.itemMeta, t.itemMeta),
|
|
1288
|
+
filters: fe(e.filters, t.filters),
|
|
1289
|
+
moduleActions: fe(e.moduleActions, t.moduleActions),
|
|
1290
|
+
itemActions: fe(e.itemActions, t.itemActions),
|
|
1291
|
+
navigation: Ke(e.navigation, t.navigation)
|
|
1214
1292
|
};
|
|
1215
|
-
return
|
|
1293
|
+
return Xi.parse(o), o;
|
|
1216
1294
|
}
|
|
1217
|
-
function
|
|
1218
|
-
return
|
|
1295
|
+
function mc(e = {}) {
|
|
1296
|
+
return Ji(Xe, e);
|
|
1219
1297
|
}
|
|
1220
|
-
function
|
|
1221
|
-
const
|
|
1222
|
-
return
|
|
1223
|
-
|
|
1298
|
+
function pc(e) {
|
|
1299
|
+
const t = It();
|
|
1300
|
+
return F(
|
|
1301
|
+
(n, o) => ws({ queryClient: t, courseId: e, module: n, item: o }),
|
|
1302
|
+
[t, e]
|
|
1303
|
+
);
|
|
1304
|
+
}
|
|
1305
|
+
function ke() {
|
|
1306
|
+
const { formatters: e } = ye(), { t, locale: n, timezone: o } = B();
|
|
1307
|
+
return N(() => {
|
|
1308
|
+
const s = { t, locale: n, timezone: o }, r = (l, a) => e.dateTime(l, a, s);
|
|
1224
1309
|
return {
|
|
1225
|
-
moduleLabel: (l, a) => e.moduleLabel(l, a,
|
|
1226
|
-
dueByline: (l, a) => t("dueByline", { when:
|
|
1227
|
-
unlockByline: (l, a) => t("unlockByline", { when:
|
|
1228
|
-
unlockedByline: (l, a) => t("unlockedByline", { when:
|
|
1229
|
-
points: (l) => e.points(l,
|
|
1230
|
-
progress: (l, a,
|
|
1310
|
+
moduleLabel: (l, a) => e.moduleLabel(l, a, s) || null,
|
|
1311
|
+
dueByline: (l, a) => t("dueByline", { when: r(l, a) }),
|
|
1312
|
+
unlockByline: (l, a) => t("unlockByline", { when: r(l, a) }),
|
|
1313
|
+
unlockedByline: (l, a) => t("unlockedByline", { when: r(l, a) }),
|
|
1314
|
+
points: (l) => e.points(l, s),
|
|
1315
|
+
progress: (l, a, u) => e.progress(l, a, u, s)
|
|
1231
1316
|
};
|
|
1232
1317
|
}, [e, t, n, o]);
|
|
1233
1318
|
}
|
|
1234
|
-
const
|
|
1235
|
-
|
|
1236
|
-
course: (e) => [...le, e],
|
|
1237
|
-
list: (e, t = {}) => [...le, e, "list", t],
|
|
1238
|
-
items: (e, t, n = {}) => [...le, e, "module", t, "items", n]
|
|
1239
|
-
};
|
|
1240
|
-
function Js(e) {
|
|
1241
|
-
return [...le, e, "list"];
|
|
1242
|
-
}
|
|
1243
|
-
function hn(e, t) {
|
|
1244
|
-
return [...le, e, "module", t, "items"];
|
|
1245
|
-
}
|
|
1246
|
-
function In(e) {
|
|
1319
|
+
const Tt = 100, Bn = 100, Gn = 100, el = 4, Je = 5 * 60 * 1e3, jn = 20, Qe = { hasNextPage: !1, endCursor: null };
|
|
1320
|
+
function Yn(e) {
|
|
1247
1321
|
return e.pageInfo.hasNextPage ? e.pageInfo.endCursor : null;
|
|
1248
1322
|
}
|
|
1249
|
-
function
|
|
1323
|
+
function Hn(e) {
|
|
1250
1324
|
const {
|
|
1251
1325
|
courseId: t,
|
|
1252
1326
|
adapter: n,
|
|
1253
1327
|
pageSize: o,
|
|
1254
|
-
includeItems:
|
|
1255
|
-
filter:
|
|
1328
|
+
includeItems: s,
|
|
1329
|
+
filter: r,
|
|
1256
1330
|
inlineItemsFirst: l,
|
|
1257
1331
|
inlineFirst: a,
|
|
1258
|
-
view:
|
|
1332
|
+
view: u,
|
|
1259
1333
|
staleTime: c,
|
|
1260
|
-
enabled:
|
|
1334
|
+
enabled: d
|
|
1261
1335
|
} = e;
|
|
1262
1336
|
return {
|
|
1263
1337
|
// `inlineItemsFirst` is deliberately out of the key: it is derived from this very list.
|
|
1264
|
-
queryKey:
|
|
1338
|
+
queryKey: Le.list(t, { view: u, pageSize: o, includeItems: s, filter: r }),
|
|
1265
1339
|
initialPageParam: null,
|
|
1266
|
-
queryFn: ({ pageParam:
|
|
1340
|
+
queryFn: ({ pageParam: m, signal: f }) => n.listModules({
|
|
1267
1341
|
courseId: t,
|
|
1268
|
-
cursor:
|
|
1342
|
+
cursor: m,
|
|
1269
1343
|
pageSize: o,
|
|
1270
|
-
includeItems:
|
|
1271
|
-
filter:
|
|
1344
|
+
includeItems: s,
|
|
1345
|
+
filter: r,
|
|
1272
1346
|
inlineItemsFirst: l,
|
|
1273
1347
|
inlineFirst: a,
|
|
1274
1348
|
signal: f
|
|
1275
1349
|
}),
|
|
1276
|
-
getNextPageParam:
|
|
1277
|
-
enabled:
|
|
1350
|
+
getNextPageParam: Yn,
|
|
1351
|
+
enabled: d,
|
|
1278
1352
|
staleTime: c,
|
|
1279
1353
|
refetchOnWindowFocus: !1
|
|
1280
1354
|
};
|
|
1281
1355
|
}
|
|
1282
|
-
function
|
|
1283
|
-
const { courseId: t, moduleId: n, adapter: o, pageSize:
|
|
1356
|
+
function Wn(e) {
|
|
1357
|
+
const { courseId: t, moduleId: n, adapter: o, pageSize: s, view: r, staleTime: l, enabled: a, limit: u } = e;
|
|
1284
1358
|
return {
|
|
1285
|
-
queryKey:
|
|
1359
|
+
queryKey: Le.items(t, n, { view: r, pageSize: s }),
|
|
1286
1360
|
initialPageParam: null,
|
|
1287
|
-
queryFn: ({ pageParam: c, signal:
|
|
1288
|
-
const
|
|
1289
|
-
return
|
|
1290
|
-
if (
|
|
1361
|
+
queryFn: ({ pageParam: c, signal: d }) => {
|
|
1362
|
+
const m = () => o.listModuleItems({ courseId: t, moduleId: n, cursor: c, pageSize: s, signal: d });
|
|
1363
|
+
return u ? u(() => {
|
|
1364
|
+
if (d.aborted)
|
|
1291
1365
|
throw new DOMException("The operation was aborted.", "AbortError");
|
|
1292
|
-
return
|
|
1293
|
-
}) :
|
|
1366
|
+
return m();
|
|
1367
|
+
}) : m();
|
|
1294
1368
|
},
|
|
1295
|
-
getNextPageParam:
|
|
1369
|
+
getNextPageParam: Yn,
|
|
1296
1370
|
enabled: a,
|
|
1297
1371
|
staleTime: l,
|
|
1298
1372
|
refetchOnWindowFocus: !1
|
|
1299
1373
|
};
|
|
1300
1374
|
}
|
|
1301
|
-
function
|
|
1302
|
-
var
|
|
1375
|
+
function tl(e) {
|
|
1376
|
+
var E;
|
|
1303
1377
|
const {
|
|
1304
1378
|
courseId: t,
|
|
1305
1379
|
adapter: n,
|
|
1306
|
-
pageSize: o =
|
|
1307
|
-
includeItems:
|
|
1308
|
-
filter:
|
|
1380
|
+
pageSize: o = Tt,
|
|
1381
|
+
includeItems: s = !1,
|
|
1382
|
+
filter: r,
|
|
1309
1383
|
inlineItemsFirst: l,
|
|
1310
1384
|
inlineFirst: a,
|
|
1311
|
-
view:
|
|
1312
|
-
staleTime: c =
|
|
1313
|
-
enabled:
|
|
1314
|
-
} = e,
|
|
1315
|
-
...
|
|
1385
|
+
view: u,
|
|
1386
|
+
staleTime: c = Je,
|
|
1387
|
+
enabled: d = !0
|
|
1388
|
+
} = e, m = bt({
|
|
1389
|
+
...Hn({
|
|
1316
1390
|
courseId: t,
|
|
1317
1391
|
adapter: n,
|
|
1318
1392
|
pageSize: o,
|
|
1319
|
-
includeItems:
|
|
1320
|
-
filter:
|
|
1393
|
+
includeItems: s,
|
|
1394
|
+
filter: r,
|
|
1321
1395
|
inlineItemsFirst: l,
|
|
1322
1396
|
inlineFirst: a,
|
|
1323
|
-
view:
|
|
1397
|
+
view: u,
|
|
1324
1398
|
staleTime: c,
|
|
1325
|
-
enabled:
|
|
1399
|
+
enabled: d
|
|
1326
1400
|
}),
|
|
1327
1401
|
// `useItemsMode` shares `modulesQueryOptions`, and `inlineFirst` is out of that key.
|
|
1328
|
-
placeholderData:
|
|
1329
|
-
}), f = (
|
|
1330
|
-
|
|
1331
|
-
}, [
|
|
1402
|
+
placeholderData: Eo
|
|
1403
|
+
}), f = (E = m.data) == null ? void 0 : E.pages, S = N(() => (f ?? []).flatMap((P) => P.modules), [f]), h = f && f.length > 0 ? f[f.length - 1].pageInfo : Qe, b = m.fetchNextPage, w = F(() => {
|
|
1404
|
+
b();
|
|
1405
|
+
}, [b]);
|
|
1332
1406
|
return {
|
|
1333
|
-
modules:
|
|
1334
|
-
pageInfo:
|
|
1335
|
-
hasNextPage:
|
|
1336
|
-
fetchNextPage:
|
|
1337
|
-
isLoading:
|
|
1338
|
-
isFetchingNextPage:
|
|
1339
|
-
isPending:
|
|
1340
|
-
isPlaceholderData:
|
|
1341
|
-
error:
|
|
1407
|
+
modules: S,
|
|
1408
|
+
pageInfo: h,
|
|
1409
|
+
hasNextPage: h.hasNextPage,
|
|
1410
|
+
fetchNextPage: w,
|
|
1411
|
+
isLoading: m.isLoading,
|
|
1412
|
+
isFetchingNextPage: m.isFetchingNextPage,
|
|
1413
|
+
isPending: m.isPending,
|
|
1414
|
+
isPlaceholderData: m.isPlaceholderData,
|
|
1415
|
+
error: m.error
|
|
1342
1416
|
};
|
|
1343
1417
|
}
|
|
1344
|
-
function
|
|
1345
|
-
var
|
|
1418
|
+
function gc(e) {
|
|
1419
|
+
var b;
|
|
1346
1420
|
const {
|
|
1347
1421
|
courseId: t,
|
|
1348
1422
|
moduleId: n,
|
|
1349
1423
|
adapter: o,
|
|
1350
|
-
pageSize:
|
|
1351
|
-
view:
|
|
1424
|
+
pageSize: s = Bn,
|
|
1425
|
+
view: r,
|
|
1352
1426
|
enabled: l = !0,
|
|
1353
|
-
staleTime: a =
|
|
1354
|
-
limit:
|
|
1355
|
-
} = e, c =
|
|
1356
|
-
|
|
1427
|
+
staleTime: a = Je,
|
|
1428
|
+
limit: u
|
|
1429
|
+
} = e, c = bt(
|
|
1430
|
+
Wn({
|
|
1357
1431
|
courseId: t,
|
|
1358
1432
|
moduleId: n,
|
|
1359
1433
|
adapter: o,
|
|
1360
|
-
pageSize:
|
|
1361
|
-
view:
|
|
1434
|
+
pageSize: s,
|
|
1435
|
+
view: r,
|
|
1362
1436
|
staleTime: a,
|
|
1363
1437
|
enabled: l,
|
|
1364
|
-
limit:
|
|
1438
|
+
limit: u
|
|
1365
1439
|
})
|
|
1366
|
-
),
|
|
1367
|
-
|
|
1368
|
-
}, [
|
|
1440
|
+
), d = (b = c.data) == null ? void 0 : b.pages, m = N(() => (d ?? []).flatMap((w) => w.items), [d]), f = d && d.length > 0 ? d[d.length - 1].pageInfo : Qe, S = c.fetchNextPage, h = F(() => {
|
|
1441
|
+
S();
|
|
1442
|
+
}, [S]);
|
|
1369
1443
|
return {
|
|
1370
|
-
items:
|
|
1444
|
+
items: m,
|
|
1371
1445
|
pageInfo: f,
|
|
1372
1446
|
hasNextPage: f.hasNextPage,
|
|
1373
|
-
fetchNextPage:
|
|
1447
|
+
fetchNextPage: h,
|
|
1374
1448
|
isLoading: c.isLoading,
|
|
1375
1449
|
isFetchingNextPage: c.isFetchingNextPage,
|
|
1376
1450
|
error: c.error
|
|
1377
1451
|
};
|
|
1378
1452
|
}
|
|
1379
|
-
function
|
|
1453
|
+
function nl(e, t, n = St) {
|
|
1380
1454
|
if (e.pageInfo.hasNextPage) return "onDemand";
|
|
1381
|
-
let o = 0,
|
|
1382
|
-
for (const
|
|
1383
|
-
if (
|
|
1384
|
-
o +=
|
|
1455
|
+
let o = 0, s = 0;
|
|
1456
|
+
for (const r of e.modules) {
|
|
1457
|
+
if (r.itemCount > t) return "onDemand";
|
|
1458
|
+
o += r.itemCount, r.itemCount > s && (s = r.itemCount);
|
|
1385
1459
|
}
|
|
1386
|
-
return o > t * 2 ? "onDemand" : Math.max(e.modules.length, 1) * Math.max(
|
|
1460
|
+
return o > t * 2 ? "onDemand" : Math.max(e.modules.length, 1) * Math.max(s, 1) <= n ? "inline" : "onDemand";
|
|
1387
1461
|
}
|
|
1388
|
-
function
|
|
1389
|
-
var
|
|
1462
|
+
function ol(e) {
|
|
1463
|
+
var S;
|
|
1390
1464
|
const {
|
|
1391
1465
|
courseId: t,
|
|
1392
1466
|
adapter: n,
|
|
1393
1467
|
mode: o = "auto",
|
|
1394
|
-
inlineThreshold:
|
|
1395
|
-
nodeBudget:
|
|
1396
|
-
pageSize: l =
|
|
1468
|
+
inlineThreshold: s = Gn,
|
|
1469
|
+
nodeBudget: r = n.inlineNodeBudget ?? St,
|
|
1470
|
+
pageSize: l = Tt,
|
|
1397
1471
|
filter: a,
|
|
1398
|
-
view:
|
|
1399
|
-
staleTime: c =
|
|
1400
|
-
} = e,
|
|
1401
|
-
|
|
1472
|
+
view: u,
|
|
1473
|
+
staleTime: c = Je
|
|
1474
|
+
} = e, d = o === "auto", m = bt(
|
|
1475
|
+
Hn({
|
|
1402
1476
|
courseId: t,
|
|
1403
1477
|
adapter: n,
|
|
1404
1478
|
pageSize: l,
|
|
1405
1479
|
includeItems: !1,
|
|
1406
1480
|
filter: a,
|
|
1407
|
-
view:
|
|
1481
|
+
view: u,
|
|
1408
1482
|
staleTime: c,
|
|
1409
|
-
enabled:
|
|
1483
|
+
enabled: d
|
|
1410
1484
|
})
|
|
1411
1485
|
);
|
|
1412
|
-
if (!
|
|
1486
|
+
if (!d)
|
|
1413
1487
|
return {
|
|
1414
1488
|
resolvedMode: o,
|
|
1415
1489
|
isResolving: !1,
|
|
@@ -1417,262 +1491,270 @@ function ni(e) {
|
|
|
1417
1491
|
error: null,
|
|
1418
1492
|
inlineShape: null
|
|
1419
1493
|
};
|
|
1420
|
-
if (
|
|
1494
|
+
if (m.error)
|
|
1421
1495
|
return {
|
|
1422
1496
|
resolvedMode: "onDemand",
|
|
1423
1497
|
isResolving: !1,
|
|
1424
1498
|
probed: !0,
|
|
1425
|
-
error:
|
|
1499
|
+
error: m.error,
|
|
1426
1500
|
inlineShape: null
|
|
1427
1501
|
};
|
|
1428
|
-
const f = (
|
|
1502
|
+
const f = (S = m.data) == null ? void 0 : S.pages[0];
|
|
1429
1503
|
return f ? {
|
|
1430
|
-
resolvedMode:
|
|
1504
|
+
resolvedMode: nl(f, s, r),
|
|
1431
1505
|
isResolving: !1,
|
|
1432
1506
|
probed: !0,
|
|
1433
1507
|
error: null,
|
|
1434
|
-
inlineShape:
|
|
1508
|
+
inlineShape: sl(f)
|
|
1435
1509
|
} : { resolvedMode: null, isResolving: !0, probed: !0, error: null, inlineShape: null };
|
|
1436
1510
|
}
|
|
1437
|
-
function
|
|
1511
|
+
function sl(e) {
|
|
1438
1512
|
let t = 1;
|
|
1439
1513
|
for (const n of e.modules)
|
|
1440
1514
|
n.itemCount > t && (t = n.itemCount);
|
|
1441
1515
|
return { moduleCount: Math.max(e.modules.length, 1), maxItemCount: t };
|
|
1442
1516
|
}
|
|
1443
|
-
const
|
|
1444
|
-
function
|
|
1445
|
-
const o =
|
|
1446
|
-
|
|
1447
|
-
const
|
|
1448
|
-
l((
|
|
1449
|
-
const
|
|
1450
|
-
let
|
|
1451
|
-
for (const [
|
|
1452
|
-
const
|
|
1453
|
-
|
|
1517
|
+
const Yt = "\0", rl = /* @__PURE__ */ new Map();
|
|
1518
|
+
function il(e, t, n = jn) {
|
|
1519
|
+
const o = It(), s = $(/* @__PURE__ */ new Map()), [r, l] = ee(rl), a = e.join(Yt), u = N(() => a === "" ? [] : a.split(Yt), [a]);
|
|
1520
|
+
te(() => {
|
|
1521
|
+
const d = s.current, m = () => {
|
|
1522
|
+
l((h) => {
|
|
1523
|
+
const b = /* @__PURE__ */ new Map();
|
|
1524
|
+
let w = h.size !== d.size;
|
|
1525
|
+
for (const [E, P] of d) {
|
|
1526
|
+
const z = P.getCurrentResult();
|
|
1527
|
+
b.set(E, z), !w && h.get(E) !== z && (w = !0);
|
|
1454
1528
|
}
|
|
1455
|
-
return
|
|
1529
|
+
return w ? b : h;
|
|
1456
1530
|
});
|
|
1457
|
-
}, f = new Set(
|
|
1458
|
-
for (const
|
|
1459
|
-
if (
|
|
1460
|
-
const
|
|
1531
|
+
}, f = new Set(u);
|
|
1532
|
+
for (const h of u) {
|
|
1533
|
+
if (d.has(h)) continue;
|
|
1534
|
+
const b = new Co(
|
|
1461
1535
|
o,
|
|
1462
|
-
t(
|
|
1536
|
+
t(h, !0)
|
|
1463
1537
|
);
|
|
1464
|
-
|
|
1538
|
+
d.set(h, b), b.subscribe(m);
|
|
1465
1539
|
}
|
|
1466
|
-
for (const [
|
|
1467
|
-
|
|
1468
|
-
for (const
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1540
|
+
for (const [h, b] of d)
|
|
1541
|
+
b.setOptions(t(h, f.has(h)));
|
|
1542
|
+
for (const h of u) {
|
|
1543
|
+
const b = d.get(h);
|
|
1544
|
+
b && (d.delete(h), d.set(h, b));
|
|
1471
1545
|
}
|
|
1472
|
-
let
|
|
1473
|
-
if (
|
|
1474
|
-
for (const [
|
|
1475
|
-
if (
|
|
1476
|
-
f.has(
|
|
1546
|
+
let S = d.size - f.size;
|
|
1547
|
+
if (S > n)
|
|
1548
|
+
for (const [h, b] of d) {
|
|
1549
|
+
if (S <= n) break;
|
|
1550
|
+
f.has(h) || (b.destroy(), d.delete(h), S -= 1);
|
|
1477
1551
|
}
|
|
1478
|
-
|
|
1479
|
-
}, [o, t,
|
|
1480
|
-
const
|
|
1552
|
+
m();
|
|
1553
|
+
}, [o, t, u, n]), te(() => {
|
|
1554
|
+
const d = s.current;
|
|
1481
1555
|
return () => {
|
|
1482
|
-
for (const
|
|
1483
|
-
|
|
1556
|
+
for (const m of d.values()) m.destroy();
|
|
1557
|
+
d.clear();
|
|
1484
1558
|
};
|
|
1485
1559
|
}, []);
|
|
1486
|
-
const c =
|
|
1487
|
-
var
|
|
1488
|
-
(
|
|
1560
|
+
const c = F((d) => {
|
|
1561
|
+
var m;
|
|
1562
|
+
(m = s.current.get(d)) == null || m.fetchNextPage();
|
|
1489
1563
|
}, []);
|
|
1490
|
-
return { results:
|
|
1564
|
+
return { results: r, fetchNextPage: c };
|
|
1491
1565
|
}
|
|
1492
|
-
const
|
|
1566
|
+
const ll = [], al = () => {
|
|
1493
1567
|
};
|
|
1494
|
-
function
|
|
1495
|
-
var
|
|
1568
|
+
function fc(e) {
|
|
1569
|
+
var ze, de;
|
|
1496
1570
|
const {
|
|
1497
1571
|
courseId: t,
|
|
1498
1572
|
adapter: n,
|
|
1499
1573
|
view: o,
|
|
1500
|
-
itemsMode:
|
|
1501
|
-
inlineThreshold:
|
|
1502
|
-
pageSize: l =
|
|
1503
|
-
itemPageSize: a =
|
|
1504
|
-
itemConcurrency:
|
|
1505
|
-
retainCollapsedLimit: c =
|
|
1506
|
-
staleTime:
|
|
1507
|
-
initialExpandedModuleIds:
|
|
1508
|
-
initialFilter: f =
|
|
1509
|
-
} = e,
|
|
1510
|
-
() =>
|
|
1511
|
-
[
|
|
1512
|
-
),
|
|
1574
|
+
itemsMode: s = "auto",
|
|
1575
|
+
inlineThreshold: r = Gn,
|
|
1576
|
+
pageSize: l = Tt,
|
|
1577
|
+
itemPageSize: a = Bn,
|
|
1578
|
+
itemConcurrency: u = el,
|
|
1579
|
+
retainCollapsedLimit: c = jn,
|
|
1580
|
+
staleTime: d = Je,
|
|
1581
|
+
initialExpandedModuleIds: m,
|
|
1582
|
+
initialFilter: f = ne
|
|
1583
|
+
} = e, S = It(), h = ye(), [b, w] = ee(f), E = N(
|
|
1584
|
+
() => Yi(h.filters, n.capabilities),
|
|
1585
|
+
[h.filters, n.capabilities]
|
|
1586
|
+
), P = Me(E, b), z = _t(P), L = ol({
|
|
1513
1587
|
courseId: t,
|
|
1514
1588
|
adapter: n,
|
|
1515
|
-
mode:
|
|
1516
|
-
inlineThreshold:
|
|
1589
|
+
mode: s,
|
|
1590
|
+
inlineThreshold: r,
|
|
1517
1591
|
pageSize: l,
|
|
1518
|
-
filter:
|
|
1592
|
+
filter: z,
|
|
1519
1593
|
view: o,
|
|
1520
|
-
staleTime:
|
|
1521
|
-
}),
|
|
1594
|
+
staleTime: d
|
|
1595
|
+
}), G = L.resolvedMode, v = tl({
|
|
1522
1596
|
courseId: t,
|
|
1523
1597
|
adapter: n,
|
|
1524
1598
|
pageSize: l,
|
|
1525
|
-
filter:
|
|
1599
|
+
filter: z,
|
|
1526
1600
|
view: o,
|
|
1527
|
-
staleTime:
|
|
1528
|
-
includeItems:
|
|
1529
|
-
inlineItemsFirst: (
|
|
1530
|
-
inlineFirst: (
|
|
1531
|
-
enabled:
|
|
1532
|
-
}), [
|
|
1533
|
-
() =>
|
|
1534
|
-
),
|
|
1535
|
-
|
|
1536
|
-
!
|
|
1537
|
-
const
|
|
1538
|
-
for (const
|
|
1539
|
-
|
|
1540
|
-
return
|
|
1601
|
+
staleTime: d,
|
|
1602
|
+
includeItems: G === "inline",
|
|
1603
|
+
inlineItemsFirst: (ze = L.inlineShape) == null ? void 0 : ze.maxItemCount,
|
|
1604
|
+
inlineFirst: (de = L.inlineShape) == null ? void 0 : de.moduleCount,
|
|
1605
|
+
enabled: G !== null
|
|
1606
|
+
}), [D, H] = ee(
|
|
1607
|
+
() => m ?? []
|
|
1608
|
+
), O = m === void 0, q = $(!1), W = b !== ne && P !== void 0;
|
|
1609
|
+
te(() => {
|
|
1610
|
+
!O || q.current || W || v.isPlaceholderData || H((I) => {
|
|
1611
|
+
const g = new Set(I), T = [...I];
|
|
1612
|
+
for (const R of v.modules)
|
|
1613
|
+
R.collapsed === !1 && !g.has(R.id) && T.push(R.id);
|
|
1614
|
+
return T.length === I.length ? I : T;
|
|
1541
1615
|
});
|
|
1542
|
-
}, [
|
|
1543
|
-
const
|
|
1544
|
-
const
|
|
1545
|
-
for (const
|
|
1546
|
-
return
|
|
1547
|
-
}, [
|
|
1548
|
-
() =>
|
|
1549
|
-
const
|
|
1550
|
-
return
|
|
1616
|
+
}, [v.modules, v.isPlaceholderData, O, W]);
|
|
1617
|
+
const k = N(() => {
|
|
1618
|
+
const I = /* @__PURE__ */ new Map();
|
|
1619
|
+
for (const g of v.modules) I.set(g.id, g);
|
|
1620
|
+
return I;
|
|
1621
|
+
}, [v.modules]), K = N(
|
|
1622
|
+
() => D.filter((I) => {
|
|
1623
|
+
const g = k.get(I);
|
|
1624
|
+
return g !== void 0 && g.items === void 0;
|
|
1551
1625
|
}),
|
|
1552
|
-
[
|
|
1553
|
-
),
|
|
1554
|
-
(
|
|
1626
|
+
[D, k]
|
|
1627
|
+
), Q = N(() => new Set(K), [K]), re = N(() => wo(u), [u]), ie = F(
|
|
1628
|
+
(I, g) => Wn({
|
|
1555
1629
|
courseId: t,
|
|
1556
|
-
moduleId:
|
|
1630
|
+
moduleId: I,
|
|
1557
1631
|
adapter: n,
|
|
1558
1632
|
pageSize: a,
|
|
1559
1633
|
view: o,
|
|
1560
|
-
staleTime:
|
|
1561
|
-
enabled:
|
|
1562
|
-
limit:
|
|
1634
|
+
staleTime: d,
|
|
1635
|
+
enabled: g,
|
|
1636
|
+
limit: re
|
|
1563
1637
|
}),
|
|
1564
|
-
[t, n, a, o,
|
|
1565
|
-
),
|
|
1566
|
-
(
|
|
1567
|
-
let
|
|
1568
|
-
return
|
|
1638
|
+
[t, n, a, o, d, re]
|
|
1639
|
+
), Te = il(K, ie, c), De = Te.fetchNextPage, le = $(/* @__PURE__ */ new Map()), Ee = F(
|
|
1640
|
+
(I) => {
|
|
1641
|
+
let g = le.current.get(I);
|
|
1642
|
+
return g || (g = () => De(I), le.current.set(I, g)), g;
|
|
1569
1643
|
},
|
|
1570
|
-
[
|
|
1571
|
-
), x =
|
|
1572
|
-
|
|
1573
|
-
(
|
|
1644
|
+
[De]
|
|
1645
|
+
), x = F((I) => {
|
|
1646
|
+
q.current = !0, H(
|
|
1647
|
+
(g) => g.includes(I) ? g : [...g, I]
|
|
1574
1648
|
);
|
|
1575
|
-
}, []),
|
|
1576
|
-
(
|
|
1577
|
-
|
|
1649
|
+
}, []), V = F(
|
|
1650
|
+
(I) => {
|
|
1651
|
+
q.current = !0, H((g) => g.filter((T) => T !== I)), S.cancelQueries({ queryKey: dt(t, I) });
|
|
1578
1652
|
},
|
|
1579
|
-
[
|
|
1580
|
-
),
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
}, [
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1653
|
+
[S, t]
|
|
1654
|
+
), Ne = F((I) => {
|
|
1655
|
+
q.current = !0, H((g) => {
|
|
1656
|
+
const T = new Set(g), R = I.filter((j) => !T.has(j));
|
|
1657
|
+
return R.length === 0 ? g : [...g, ...R];
|
|
1658
|
+
});
|
|
1659
|
+
}, []), Oe = F(
|
|
1660
|
+
(I) => {
|
|
1661
|
+
q.current = !0;
|
|
1662
|
+
const g = new Set(I);
|
|
1663
|
+
H((T) => {
|
|
1664
|
+
const R = T.filter((j) => !g.has(j));
|
|
1665
|
+
return R.length === T.length ? T : R;
|
|
1666
|
+
});
|
|
1667
|
+
for (const T of g)
|
|
1668
|
+
S.cancelQueries({ queryKey: dt(t, T) });
|
|
1669
|
+
},
|
|
1670
|
+
[S, t]
|
|
1671
|
+
), Z = $(D);
|
|
1672
|
+
Z.current = D;
|
|
1673
|
+
const qe = F(() => {
|
|
1674
|
+
q.current = !0;
|
|
1675
|
+
for (const I of Z.current) V(I);
|
|
1676
|
+
}, [V]), ae = $(b);
|
|
1677
|
+
ae.current = b;
|
|
1678
|
+
const J = $(null), ce = F(
|
|
1679
|
+
(I) => {
|
|
1680
|
+
if (I === ae.current) return;
|
|
1681
|
+
if (ae.current = I, I !== ne && Me(E, I) !== void 0) {
|
|
1682
|
+
J.current === null && (J.current = Z.current);
|
|
1683
|
+
const T = q.current;
|
|
1684
|
+
for (const R of Z.current) V(R);
|
|
1685
|
+
q.current = T;
|
|
1686
|
+
} else J.current !== null && (H(J.current), Z.current = J.current, J.current = null);
|
|
1687
|
+
w(I);
|
|
1597
1688
|
},
|
|
1598
|
-
[
|
|
1599
|
-
),
|
|
1600
|
-
(
|
|
1601
|
-
|
|
1689
|
+
[E, V]
|
|
1690
|
+
), nt = F(
|
|
1691
|
+
(I) => {
|
|
1692
|
+
Z.current.includes(I) ? V(I) : x(I);
|
|
1602
1693
|
},
|
|
1603
|
-
[
|
|
1604
|
-
),
|
|
1605
|
-
(
|
|
1606
|
-
var
|
|
1607
|
-
const
|
|
1608
|
-
if (
|
|
1609
|
-
return
|
|
1610
|
-
const
|
|
1611
|
-
if ((
|
|
1612
|
-
return
|
|
1613
|
-
items:
|
|
1614
|
-
pageInfo:
|
|
1694
|
+
[V, x]
|
|
1695
|
+
), Fe = Te.results, ue = $(/* @__PURE__ */ new Map()), Ue = F(
|
|
1696
|
+
(I) => {
|
|
1697
|
+
var pe;
|
|
1698
|
+
const g = k.get(I), T = Fe.get(I), R = Q.has(I), j = ue.current.get(I);
|
|
1699
|
+
if (j && j.items === (g == null ? void 0 : g.items) && j.result === T && j.active === R)
|
|
1700
|
+
return j.value;
|
|
1701
|
+
const Ce = (X) => (ue.current.set(I, { items: g == null ? void 0 : g.items, result: T, active: R, value: X }), X);
|
|
1702
|
+
if ((g == null ? void 0 : g.items) !== void 0)
|
|
1703
|
+
return Ce({
|
|
1704
|
+
items: g.items,
|
|
1705
|
+
pageInfo: Qe,
|
|
1615
1706
|
hasNextPage: !1,
|
|
1616
|
-
fetchNextPage:
|
|
1707
|
+
fetchNextPage: al,
|
|
1617
1708
|
isLoading: !1,
|
|
1618
1709
|
isFetchingNextPage: !1,
|
|
1619
1710
|
error: null,
|
|
1620
1711
|
source: "inline"
|
|
1621
1712
|
});
|
|
1622
|
-
const
|
|
1623
|
-
return
|
|
1624
|
-
items:
|
|
1625
|
-
pageInfo:
|
|
1626
|
-
hasNextPage:
|
|
1627
|
-
fetchNextPage:
|
|
1628
|
-
isLoading:
|
|
1629
|
-
isFetchingNextPage: (
|
|
1630
|
-
error: (
|
|
1713
|
+
const Y = (pe = T == null ? void 0 : T.data) == null ? void 0 : pe.pages, $e = Y ? Y.flatMap((X) => X.items) : ll, me = Y && Y.length > 0 ? Y[Y.length - 1].pageInfo : Qe;
|
|
1714
|
+
return Ce({
|
|
1715
|
+
items: $e,
|
|
1716
|
+
pageInfo: me,
|
|
1717
|
+
hasNextPage: me.hasNextPage,
|
|
1718
|
+
fetchNextPage: Ee(I),
|
|
1719
|
+
isLoading: T ? T.isLoading : R,
|
|
1720
|
+
isFetchingNextPage: (T == null ? void 0 : T.isFetchingNextPage) ?? !1,
|
|
1721
|
+
error: (T == null ? void 0 : T.error) ?? null,
|
|
1631
1722
|
source: "onDemand"
|
|
1632
1723
|
});
|
|
1633
1724
|
},
|
|
1634
|
-
[
|
|
1725
|
+
[k, Fe, Ee, Q]
|
|
1635
1726
|
);
|
|
1636
1727
|
return {
|
|
1637
|
-
modules:
|
|
1638
|
-
pageInfo:
|
|
1639
|
-
hasNextPage:
|
|
1640
|
-
fetchNextPage:
|
|
1641
|
-
isLoading: (
|
|
1642
|
-
isRefreshing:
|
|
1643
|
-
isFetchingNextPage:
|
|
1644
|
-
error:
|
|
1645
|
-
itemsMode:
|
|
1646
|
-
getItems:
|
|
1728
|
+
modules: v.modules,
|
|
1729
|
+
pageInfo: v.pageInfo,
|
|
1730
|
+
hasNextPage: v.hasNextPage,
|
|
1731
|
+
fetchNextPage: v.fetchNextPage,
|
|
1732
|
+
isLoading: (L.isResolving || v.isPending) && !v.isPlaceholderData,
|
|
1733
|
+
isRefreshing: v.isPlaceholderData,
|
|
1734
|
+
isFetchingNextPage: v.isFetchingNextPage,
|
|
1735
|
+
error: v.error ?? L.error,
|
|
1736
|
+
itemsMode: G,
|
|
1737
|
+
getItems: Ue,
|
|
1647
1738
|
expandModule: x,
|
|
1648
|
-
collapseModule:
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1739
|
+
collapseModule: V,
|
|
1740
|
+
expandModules: Ne,
|
|
1741
|
+
collapseModules: Oe,
|
|
1742
|
+
collapseAllModules: qe,
|
|
1743
|
+
toggleModule: nt,
|
|
1744
|
+
expandedModuleIds: D,
|
|
1745
|
+
filter: b,
|
|
1746
|
+
setFilter: ce,
|
|
1747
|
+
filterEntry: P,
|
|
1748
|
+
filterPredicate: pt(P) ? P == null ? void 0 : P.predicate : void 0,
|
|
1749
|
+
filterResultsArePartial: b !== ne && pt(P) && v.hasNextPage
|
|
1657
1750
|
};
|
|
1658
1751
|
}
|
|
1659
|
-
function
|
|
1660
|
-
const
|
|
1661
|
-
return
|
|
1662
|
-
}
|
|
1663
|
-
function Hl(e, t, n) {
|
|
1664
|
-
const o = n ? we.list(t, n) : Js(t);
|
|
1665
|
-
return e.invalidateQueries({ queryKey: o });
|
|
1666
|
-
}
|
|
1667
|
-
function Ql(e, t) {
|
|
1668
|
-
return e.invalidateQueries({ queryKey: we.course(t) });
|
|
1669
|
-
}
|
|
1670
|
-
function ai({ value: e, onChange: t, describedBy: n }) {
|
|
1671
|
-
const { t: o } = W(), r = Ce(), s = q(() => it(r.filters), [r.filters]), l = Rt();
|
|
1672
|
-
return /* @__PURE__ */ S(E, { as: "div", margin: "medium 0 0 0", children: [
|
|
1673
|
-
/* @__PURE__ */ i(E, { as: "div", margin: "0 0 x-small 0", children: /* @__PURE__ */ i(v, { size: "medium", weight: "bold", id: l, children: o("filterGroupLabel") }) }),
|
|
1752
|
+
function cl({ value: e, onChange: t, describedBy: n }) {
|
|
1753
|
+
const { t: o } = B(), s = ye(), r = N(() => Ze(s.filters), [s.filters]), l = rt();
|
|
1754
|
+
return /* @__PURE__ */ _(C, { as: "div", margin: "medium 0 0 0", children: [
|
|
1755
|
+
/* @__PURE__ */ i(C, { as: "div", margin: "0 0 x-small 0", children: /* @__PURE__ */ i(A, { size: "medium", weight: "bold", id: l, children: o("filterGroupLabel") }) }),
|
|
1674
1756
|
/* @__PURE__ */ i(
|
|
1675
|
-
|
|
1757
|
+
M,
|
|
1676
1758
|
{
|
|
1677
1759
|
gap: "space4",
|
|
1678
1760
|
wrap: "wrap",
|
|
@@ -1680,15 +1762,15 @@ function ai({ value: e, onChange: t, describedBy: n }) {
|
|
|
1680
1762
|
role: "group",
|
|
1681
1763
|
"aria-labelledby": l,
|
|
1682
1764
|
"data-testid": "filter-chips",
|
|
1683
|
-
children:
|
|
1684
|
-
const
|
|
1685
|
-
return /* @__PURE__ */ i(
|
|
1686
|
-
|
|
1765
|
+
children: r.map((a) => {
|
|
1766
|
+
const u = a.key === e;
|
|
1767
|
+
return /* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ i(
|
|
1768
|
+
Pe,
|
|
1687
1769
|
{
|
|
1688
1770
|
size: "medium",
|
|
1689
|
-
color:
|
|
1690
|
-
"aria-pressed":
|
|
1691
|
-
"aria-describedby": a.key !==
|
|
1771
|
+
color: u ? "primary" : "secondary",
|
|
1772
|
+
"aria-pressed": u,
|
|
1773
|
+
"aria-describedby": a.key !== ne && pt(a) ? n : void 0,
|
|
1692
1774
|
onClick: () => t(a.key),
|
|
1693
1775
|
"data-testid": `filter-chip-${a.key}`,
|
|
1694
1776
|
themeOverride: { borderRadius: "0.5rem" },
|
|
@@ -1700,29 +1782,133 @@ function ai({ value: e, onChange: t, describedBy: n }) {
|
|
|
1700
1782
|
)
|
|
1701
1783
|
] });
|
|
1702
1784
|
}
|
|
1703
|
-
const
|
|
1704
|
-
|
|
1785
|
+
const ul = 20, dl = 4.5, Ht = 7, ml = 5, pl = 20, Kn = "#000000", Qn = "#FFFFFF", Vn = {
|
|
1786
|
+
primary: { semantic: "base", textKey: "baseTextColor", borderKey: "baseBorderColor" },
|
|
1787
|
+
info: { semantic: "info", textKey: "infoTextColor", borderKey: "infoBorderColor" },
|
|
1788
|
+
success: { semantic: "success", textKey: "successTextColor", borderKey: "successBorderColor" },
|
|
1789
|
+
warning: { semantic: "warning", textKey: "warningTextColor", borderKey: "warningBorderColor" }
|
|
1790
|
+
}, gl = {
|
|
1791
|
+
card: {
|
|
1792
|
+
primary: { fill: "#E8EAEC", stroke: "#8D959F", text: "#273540" },
|
|
1793
|
+
info: { fill: "#D5E4F2", stroke: "#2B7ABC", text: "#23649A" },
|
|
1794
|
+
success: { fill: "#CDE7D8", stroke: "#03893D", text: "#02642C" },
|
|
1795
|
+
warning: { fill: "#F5DBCC", stroke: "#CF4A00", text: "#A13900" }
|
|
1796
|
+
},
|
|
1797
|
+
row: {
|
|
1798
|
+
primary: { fill: "#DEE1E4", stroke: "#8D959F", text: "#273540" },
|
|
1799
|
+
info: { fill: "#CADCEA", stroke: "#2B7ABC", text: "#1E5685" },
|
|
1800
|
+
success: { fill: "#C2DFD0", stroke: "#03893D", text: "#02642C" },
|
|
1801
|
+
warning: { fill: "#EBD2C4", stroke: "#CF4A00", text: "#A13900" }
|
|
1802
|
+
}
|
|
1803
|
+
};
|
|
1804
|
+
function fl(e, t) {
|
|
1805
|
+
const n = xo(
|
|
1806
|
+
ct(e),
|
|
1807
|
+
ct(Lo(t, ul))
|
|
1808
|
+
);
|
|
1809
|
+
return Mn(n);
|
|
1810
|
+
}
|
|
1811
|
+
function hl(e, t, n) {
|
|
1812
|
+
const o = se(n, t) >= Ht ? Ht : dl;
|
|
1813
|
+
return Math.min(o, Math.max(se(e, Kn), se(e, Qn)));
|
|
1814
|
+
}
|
|
1815
|
+
function Il(e, t, n) {
|
|
1816
|
+
const o = hl(e, t, n);
|
|
1817
|
+
if (se(e, t) >= o) return t;
|
|
1818
|
+
const s = se(e, Kn) > se(e, Qn) ? Ro : ko;
|
|
1819
|
+
let r = t;
|
|
1820
|
+
for (let l = 0; l < pl && se(e, r) < o; l++)
|
|
1821
|
+
r = s(r, ml);
|
|
1822
|
+
return Mn(r);
|
|
1823
|
+
}
|
|
1824
|
+
function bl(e) {
|
|
1825
|
+
return at(e) && ct(e).a === 1;
|
|
1826
|
+
}
|
|
1827
|
+
function Wt(e, t) {
|
|
1828
|
+
var n;
|
|
1829
|
+
return t === "card" ? (n = e == null ? void 0 : e.elevatedSurface) == null ? void 0 : n.base : e == null ? void 0 : e.muted;
|
|
1830
|
+
}
|
|
1831
|
+
function Kt(e, t, n, o) {
|
|
1832
|
+
var l, a, u, c;
|
|
1833
|
+
const s = gl[n][e], r = t;
|
|
1834
|
+
try {
|
|
1835
|
+
const d = r == null ? void 0 : r.newTheme, m = (l = d == null ? void 0 : d.semantics) == null ? void 0 : l.call(d, d.primitives);
|
|
1836
|
+
if (!m) return s;
|
|
1837
|
+
const { semantic: f } = Vn[e], S = Wt((c = (u = (a = r == null ? void 0 : r.themeOverride) == null ? void 0 : a.semantics) == null ? void 0 : u.color) == null ? void 0 : c.background, n) ?? Wt(m.color.background, n) ?? "", h = o.stroke ?? m.color.stroke[f], b = o.label ?? m.color.text[f];
|
|
1838
|
+
if (!bl(S) || !at(h) || !at(b)) return s;
|
|
1839
|
+
const w = fl(S, h);
|
|
1840
|
+
return { fill: w, stroke: h, text: Il(w, b, S) };
|
|
1841
|
+
} catch {
|
|
1842
|
+
return s;
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
const Qt = /* @__PURE__ */ new WeakMap();
|
|
1846
|
+
function Zn(e, t, n, o = {}) {
|
|
1847
|
+
if (typeof t != "object" || t === null)
|
|
1848
|
+
return Kt(e, t, n, o);
|
|
1849
|
+
let s = Qt.get(t);
|
|
1850
|
+
s === void 0 && (s = /* @__PURE__ */ new Map(), Qt.set(t, s));
|
|
1851
|
+
const r = `${n}:${e}:${o.stroke ?? ""}:${o.label ?? ""}`, l = s.get(r);
|
|
1852
|
+
if (l !== void 0) return l;
|
|
1853
|
+
const a = Kt(e, t, n, o);
|
|
1854
|
+
return s.set(r, a), a;
|
|
1855
|
+
}
|
|
1856
|
+
function He(e, t) {
|
|
1857
|
+
const { textKey: n, borderKey: o } = Vn[e];
|
|
1858
|
+
return (s, r) => {
|
|
1859
|
+
const l = s, { fill: a, stroke: u, text: c } = Zn(e, r, t, {
|
|
1860
|
+
stroke: l == null ? void 0 : l[o],
|
|
1861
|
+
label: l == null ? void 0 : l[n]
|
|
1862
|
+
});
|
|
1863
|
+
return { backgroundColor: a, [n]: c, [o]: u };
|
|
1864
|
+
};
|
|
1865
|
+
}
|
|
1866
|
+
function Vt(e) {
|
|
1705
1867
|
return {
|
|
1706
|
-
|
|
1707
|
-
|
|
1868
|
+
primary: He("primary", e),
|
|
1869
|
+
info: He("info", e),
|
|
1870
|
+
success: He("success", e),
|
|
1871
|
+
warning: He("warning", e)
|
|
1872
|
+
};
|
|
1873
|
+
}
|
|
1874
|
+
const Ml = {
|
|
1875
|
+
card: Vt("card"),
|
|
1876
|
+
row: Vt("row")
|
|
1877
|
+
}, Sl = "#9242B4", yl = "#9E58BD";
|
|
1878
|
+
function Zt(e) {
|
|
1879
|
+
return (t, n) => {
|
|
1880
|
+
var l, a, u, c;
|
|
1881
|
+
const { fill: o, stroke: s, text: r } = Zn("primary", n, e, {
|
|
1882
|
+
stroke: ((a = (l = n.colors) == null ? void 0 : l.contrasts) == null ? void 0 : a.violet4570) ?? yl,
|
|
1883
|
+
label: ((c = (u = n.colors) == null ? void 0 : u.contrasts) == null ? void 0 : c.violet5790) ?? Sl
|
|
1884
|
+
});
|
|
1885
|
+
return { backgroundColor: o, baseTextColor: r, baseBorderColor: s };
|
|
1708
1886
|
};
|
|
1709
|
-
}
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
},
|
|
1718
|
-
not_started: {},
|
|
1719
|
-
in_progress: {
|
|
1720
|
-
complete: {
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1887
|
+
}
|
|
1888
|
+
const Xn = {
|
|
1889
|
+
tone: "primary",
|
|
1890
|
+
icon: /* @__PURE__ */ i(So, { size: "sm" }),
|
|
1891
|
+
themes: {
|
|
1892
|
+
card: Zt("card"),
|
|
1893
|
+
row: Zt("row")
|
|
1894
|
+
}
|
|
1895
|
+
}, _l = {
|
|
1896
|
+
not_started: { tone: "primary", icon: /* @__PURE__ */ i(mn, { size: "sm" }) },
|
|
1897
|
+
in_progress: { tone: "info", icon: /* @__PURE__ */ i(dn, { size: "sm" }) },
|
|
1898
|
+
complete: { tone: "success", icon: /* @__PURE__ */ i(un, { size: "sm" }) },
|
|
1899
|
+
missing: { tone: "warning", icon: /* @__PURE__ */ i(ve, { size: "sm" }) },
|
|
1900
|
+
incomplete: { tone: "warning", icon: /* @__PURE__ */ i(ve, { size: "sm" }) },
|
|
1901
|
+
missing_and_incomplete: { tone: "warning", icon: /* @__PURE__ */ i(ve, { size: "sm" }) },
|
|
1902
|
+
locked: { tone: "primary", icon: /* @__PURE__ */ i(cn, { size: "sm" }) }
|
|
1903
|
+
}, Tl = {
|
|
1904
|
+
not_started: { tone: "primary", icon: /* @__PURE__ */ i(mn, { size: "sm" }) },
|
|
1905
|
+
in_progress: { tone: "info", icon: /* @__PURE__ */ i(dn, { size: "sm" }) },
|
|
1906
|
+
complete: { tone: "success", icon: /* @__PURE__ */ i(un, { size: "sm" }) },
|
|
1907
|
+
incomplete: { tone: "warning", icon: /* @__PURE__ */ i(ve, { size: "sm" }) },
|
|
1908
|
+
missing: { tone: "warning", icon: /* @__PURE__ */ i(ve, { size: "sm" }) },
|
|
1909
|
+
locked: { tone: "primary", icon: /* @__PURE__ */ i(cn, { size: "sm" }) }
|
|
1724
1910
|
};
|
|
1725
|
-
function
|
|
1911
|
+
function Jn(e, t, n, o) {
|
|
1726
1912
|
switch (t) {
|
|
1727
1913
|
case "not_started":
|
|
1728
1914
|
return e("moduleStatusNotStarted");
|
|
@@ -1743,7 +1929,7 @@ function pi(e, t, n, o) {
|
|
|
1743
1929
|
return e("moduleStatusLocked");
|
|
1744
1930
|
}
|
|
1745
1931
|
}
|
|
1746
|
-
function
|
|
1932
|
+
function El(e, t) {
|
|
1747
1933
|
switch (t) {
|
|
1748
1934
|
case "not_started":
|
|
1749
1935
|
return e("itemStatusNotStarted");
|
|
@@ -1759,85 +1945,95 @@ function fi(e, t) {
|
|
|
1759
1945
|
return e("itemStatusLocked");
|
|
1760
1946
|
}
|
|
1761
1947
|
}
|
|
1762
|
-
function
|
|
1948
|
+
function et(e, t, n, o) {
|
|
1949
|
+
var s;
|
|
1763
1950
|
return /* @__PURE__ */ i(
|
|
1764
|
-
|
|
1951
|
+
Do,
|
|
1765
1952
|
{
|
|
1766
|
-
color: e.
|
|
1953
|
+
color: e.tone,
|
|
1767
1954
|
renderIcon: e.icon,
|
|
1768
|
-
themeOverride: e.
|
|
1955
|
+
themeOverride: ((s = e.themes) == null ? void 0 : s[o]) ?? Ml[o][e.tone],
|
|
1769
1956
|
"data-testid": n,
|
|
1770
1957
|
children: t
|
|
1771
1958
|
}
|
|
1772
1959
|
);
|
|
1773
1960
|
}
|
|
1774
|
-
function
|
|
1961
|
+
function Cl({
|
|
1775
1962
|
status: e,
|
|
1776
1963
|
missingCount: t,
|
|
1777
1964
|
incompleteCount: n
|
|
1778
1965
|
}) {
|
|
1779
|
-
const { t: o } =
|
|
1780
|
-
return
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
"module-status-pill"
|
|
1966
|
+
const { t: o } = B();
|
|
1967
|
+
return et(
|
|
1968
|
+
_l[e],
|
|
1969
|
+
Jn(o, e, t, n),
|
|
1970
|
+
"module-status-pill",
|
|
1971
|
+
"card"
|
|
1784
1972
|
);
|
|
1785
1973
|
}
|
|
1786
|
-
function
|
|
1787
|
-
const { t } =
|
|
1788
|
-
return
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
"item-status-pill"
|
|
1974
|
+
function wl({ status: e }) {
|
|
1975
|
+
const { t } = B();
|
|
1976
|
+
return et(
|
|
1977
|
+
Tl[e],
|
|
1978
|
+
El(t, e),
|
|
1979
|
+
"item-status-pill",
|
|
1980
|
+
"row"
|
|
1792
1981
|
);
|
|
1793
1982
|
}
|
|
1794
|
-
|
|
1983
|
+
function vl() {
|
|
1984
|
+
const { t: e } = B();
|
|
1985
|
+
return et(Xn, e("moduleStatusDueSoon"), "module-due-soon-pill", "card");
|
|
1986
|
+
}
|
|
1987
|
+
function Pl() {
|
|
1988
|
+
const { t: e } = B();
|
|
1989
|
+
return et(Xn, e("itemStatusDueSoon"), "item-due-soon-pill", "row");
|
|
1990
|
+
}
|
|
1991
|
+
function eo() {
|
|
1992
|
+
const e = bn();
|
|
1993
|
+
return "key" in e && e.key === "canvas-high-contrast" ? "inline" : "standalone";
|
|
1994
|
+
}
|
|
1995
|
+
const to = 2.75, st = `${to}rem`, Al = { lineHeight: 0, display: "block" }, xl = {
|
|
1795
1996
|
display: "inline-block",
|
|
1796
1997
|
paddingLeft: "0.5rem",
|
|
1797
1998
|
marginLeft: "0.5rem"
|
|
1798
|
-
},
|
|
1799
|
-
function
|
|
1800
|
-
return e == null || typeof e == "boolean" || e === "" ? !0 : Array.isArray(e) ? e.every(
|
|
1999
|
+
}, Ll = "#D7DADE", Rl = "#6A7883", no = { fontSize: 0 };
|
|
2000
|
+
function gt(e) {
|
|
2001
|
+
return e == null || typeof e == "boolean" || e === "" ? !0 : Array.isArray(e) ? e.every(gt) : rn(e) && e.type === an ? gt(e.props.children) : !1;
|
|
1801
2002
|
}
|
|
1802
|
-
const
|
|
2003
|
+
const kl = {
|
|
1803
2004
|
contentVisibility: "auto",
|
|
1804
2005
|
containIntrinsicSize: "auto 4.25rem"
|
|
1805
|
-
},
|
|
1806
|
-
function
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
const
|
|
1813
|
-
return (
|
|
1814
|
-
}
|
|
1815
|
-
function Pn() {
|
|
1816
|
-
const e = En("grey1424", Mi);
|
|
1817
|
-
return q(
|
|
1818
|
-
() => ({ ...bi, borderLeft: `1px solid ${e}` }),
|
|
2006
|
+
}, Dl = "0.5rem";
|
|
2007
|
+
function oo(e, t) {
|
|
2008
|
+
var o, s;
|
|
2009
|
+
const n = bn();
|
|
2010
|
+
return ("colors" in n ? (s = (o = n.colors) == null ? void 0 : o.contrasts) == null ? void 0 : s[e] : void 0) ?? t;
|
|
2011
|
+
}
|
|
2012
|
+
function so() {
|
|
2013
|
+
const e = oo("grey1424", Ll);
|
|
2014
|
+
return N(
|
|
2015
|
+
() => ({ ...xl, borderLeft: `1px solid ${e}` }),
|
|
1819
2016
|
[e]
|
|
1820
2017
|
);
|
|
1821
2018
|
}
|
|
1822
|
-
function
|
|
2019
|
+
function Nl({
|
|
1823
2020
|
item: e,
|
|
1824
2021
|
today: t,
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
attachedBelow: r
|
|
2022
|
+
attachedAbove: n,
|
|
2023
|
+
attachedBelow: o
|
|
1828
2024
|
}) {
|
|
1829
|
-
var
|
|
1830
|
-
const { t: s, locale:
|
|
2025
|
+
var W;
|
|
2026
|
+
const { t: s, locale: r, timezone: l } = B(), a = eo(), u = oo("grey4570", Rl), c = so(), d = ke(), m = ye(), { navigation: f } = m, S = N(() => Ze(m.itemMeta), [m.itemMeta]), h = e.title || s("itemUntitled");
|
|
1831
2027
|
if (e.type === "sub_header")
|
|
1832
2028
|
return /* @__PURE__ */ i(
|
|
1833
|
-
|
|
2029
|
+
C,
|
|
1834
2030
|
{
|
|
1835
2031
|
as: "div",
|
|
1836
2032
|
padding: "x-small small",
|
|
1837
2033
|
margin: "x-small 0 0 0",
|
|
1838
2034
|
"data-testid": `module-item-${e.id}`,
|
|
1839
2035
|
children: /* @__PURE__ */ i(
|
|
1840
|
-
|
|
2036
|
+
A,
|
|
1841
2037
|
{
|
|
1842
2038
|
size: "small",
|
|
1843
2039
|
weight: "bold",
|
|
@@ -1845,214 +2041,216 @@ function Ei({
|
|
|
1845
2041
|
letterSpacing: "expanded",
|
|
1846
2042
|
"data-testid": "module-item-title",
|
|
1847
2043
|
"data-sub-header": "true",
|
|
1848
|
-
children:
|
|
2044
|
+
children: h
|
|
1849
2045
|
}
|
|
1850
2046
|
)
|
|
1851
2047
|
}
|
|
1852
2048
|
);
|
|
1853
|
-
const
|
|
1854
|
-
return /* @__PURE__ */ i("div", { style: { ...
|
|
1855
|
-
|
|
2049
|
+
const b = ((W = f.getItemHref) == null ? void 0 : W.call(f, e)) ?? e.url ?? null, w = e.status === "locked", E = e.status !== void 0 && e.status !== "complete" && !w && yt(e.dueAt, t, l), P = f.onItemClick, z = P ? (k) => P(e, k) : void 0, L = Me(m.itemTypes, e.type), G = L != null && L.renderIcon ? L.renderIcon({ item: e }) : L == null ? void 0 : L.icon, v = { item: e, t: s, today: t, locale: r, timezone: l, formatters: d, config: m }, D = S.map((k) => ({ key: k.key, node: k.render(v) })).filter((k) => !gt(k.node)), H = D.some((k) => k.key === $i), O = n ? "none" : "large", q = o ? "none" : "large";
|
|
2050
|
+
return /* @__PURE__ */ i("div", { style: { ...kl, marginTop: n ? void 0 : Dl }, children: /* @__PURE__ */ i(
|
|
2051
|
+
C,
|
|
1856
2052
|
{
|
|
1857
2053
|
as: "div",
|
|
1858
2054
|
background: "secondary",
|
|
1859
|
-
borderRadius: `${
|
|
2055
|
+
borderRadius: `${O} ${O} ${q} ${q}`,
|
|
1860
2056
|
padding: "small",
|
|
1861
2057
|
"data-testid": `module-item-${e.id}`,
|
|
1862
|
-
children: /* @__PURE__ */ i("div", { style: { paddingInlineStart: `${Math.max(e.indent - 1, 0) *
|
|
1863
|
-
/* @__PURE__ */ i(
|
|
1864
|
-
e.indent > 0 ? /* @__PURE__ */ i(
|
|
1865
|
-
/* @__PURE__ */ i(
|
|
1866
|
-
|
|
2058
|
+
children: /* @__PURE__ */ i("div", { style: { paddingInlineStart: `${Math.max(e.indent - 1, 0) * to}rem` }, children: /* @__PURE__ */ _(M, { alignItems: "center", gap: "mediumSmall", children: [
|
|
2059
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ _(M, { alignItems: "center", children: [
|
|
2060
|
+
e.indent > 0 ? /* @__PURE__ */ i(M.Item, { size: st, textAlign: "center", "data-testid": "item-nest-arrow", children: /* @__PURE__ */ i("span", { style: { color: u }, children: /* @__PURE__ */ i(yo, { size: "md", color: "inherit" }) }) }) : null,
|
|
2061
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ i(
|
|
2062
|
+
C,
|
|
1867
2063
|
{
|
|
1868
2064
|
as: "div",
|
|
1869
2065
|
background: "primary",
|
|
1870
2066
|
borderWidth: "small",
|
|
1871
2067
|
borderRadius: "large",
|
|
1872
|
-
width:
|
|
1873
|
-
height:
|
|
1874
|
-
children: /* @__PURE__ */ i(
|
|
1875
|
-
/* @__PURE__ */ i("span", { style:
|
|
1876
|
-
|
|
2068
|
+
width: st,
|
|
2069
|
+
height: st,
|
|
2070
|
+
children: /* @__PURE__ */ i(M, { height: "100%", alignItems: "center", justifyItems: "center", children: /* @__PURE__ */ _(M.Item, { children: [
|
|
2071
|
+
/* @__PURE__ */ i("span", { style: Al, "data-testid": "item-type-icon", children: G }),
|
|
2072
|
+
L && !H ? /* @__PURE__ */ i(lt, { children: s(L.label) }) : null
|
|
1877
2073
|
] }) })
|
|
1878
2074
|
}
|
|
1879
2075
|
) })
|
|
1880
2076
|
] }) }),
|
|
1881
|
-
/* @__PURE__ */
|
|
1882
|
-
/* @__PURE__ */ i(
|
|
1883
|
-
|
|
2077
|
+
/* @__PURE__ */ _(M.Item, { shouldGrow: !0, shouldShrink: !0, children: [
|
|
2078
|
+
/* @__PURE__ */ i(C, { as: "div", children: w || !b ? /* @__PURE__ */ i(
|
|
2079
|
+
A,
|
|
1884
2080
|
{
|
|
1885
2081
|
weight: "bold",
|
|
1886
2082
|
size: "medium",
|
|
1887
2083
|
lineHeight: "condensed",
|
|
1888
|
-
color:
|
|
2084
|
+
color: w ? "secondary" : "primary",
|
|
1889
2085
|
"data-testid": "module-item-title",
|
|
1890
|
-
"data-locked":
|
|
1891
|
-
children:
|
|
2086
|
+
"data-locked": w ? "true" : void 0,
|
|
2087
|
+
children: h
|
|
1892
2088
|
}
|
|
1893
|
-
) : /* @__PURE__ */
|
|
1894
|
-
|
|
2089
|
+
) : /* @__PURE__ */ _(
|
|
2090
|
+
hn,
|
|
1895
2091
|
{
|
|
1896
|
-
href:
|
|
1897
|
-
onClick:
|
|
2092
|
+
href: b,
|
|
2093
|
+
onClick: z,
|
|
1898
2094
|
forceButtonRole: !1,
|
|
1899
|
-
variant:
|
|
2095
|
+
variant: a,
|
|
1900
2096
|
target: e.newTab ? "_blank" : void 0,
|
|
1901
2097
|
rel: e.newTab ? "noopener noreferrer" : void 0,
|
|
1902
2098
|
children: [
|
|
1903
2099
|
/* @__PURE__ */ i(
|
|
1904
|
-
|
|
2100
|
+
A,
|
|
1905
2101
|
{
|
|
1906
2102
|
weight: "bold",
|
|
1907
2103
|
size: "medium",
|
|
1908
2104
|
lineHeight: "condensed",
|
|
1909
2105
|
color: "primary",
|
|
1910
2106
|
"data-testid": "module-item-title",
|
|
1911
|
-
children:
|
|
2107
|
+
children: h
|
|
1912
2108
|
}
|
|
1913
2109
|
),
|
|
1914
|
-
e.newTab ? /* @__PURE__ */ i(
|
|
2110
|
+
e.newTab ? /* @__PURE__ */ i(lt, { children: ` ${s("opensInNewWindow")}` }) : null
|
|
1915
2111
|
]
|
|
1916
2112
|
}
|
|
1917
2113
|
) }),
|
|
1918
|
-
/* @__PURE__ */ i(
|
|
1919
|
-
|
|
1920
|
-
/* @__PURE__ */ i("span", { style:
|
|
1921
|
-
] },
|
|
2114
|
+
/* @__PURE__ */ i(C, { as: "div", children: /* @__PURE__ */ i(A, { size: "x-small", color: "secondary", "data-testid": "module-item-meta", children: D.map((k, K) => /* @__PURE__ */ _(an, { children: [
|
|
2115
|
+
K > 0 ? /* @__PURE__ */ i("span", { style: no, children: " " }) : null,
|
|
2116
|
+
/* @__PURE__ */ i("span", { style: K > 0 ? c : void 0, children: k.node })
|
|
2117
|
+
] }, k.key)) }) })
|
|
1922
2118
|
] }),
|
|
1923
|
-
e.status ? /* @__PURE__ */ i(
|
|
2119
|
+
E || e.status ? /* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ _(M, { alignItems: "center", gap: "x-small", children: [
|
|
2120
|
+
E ? /* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ i(Pl, {}) }) : null,
|
|
2121
|
+
e.status ? /* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ i(wl, { status: e.status }) }) : null
|
|
2122
|
+
] }) }) : null
|
|
1924
2123
|
] }) })
|
|
1925
2124
|
}
|
|
1926
2125
|
) });
|
|
1927
2126
|
}
|
|
1928
|
-
const
|
|
1929
|
-
function
|
|
1930
|
-
const { t } =
|
|
1931
|
-
if (e.length === 1) return /* @__PURE__ */ i(
|
|
2127
|
+
const Ol = ln(Nl), Xt = "\0", ql = { textDecoration: "underline dotted", cursor: "help" };
|
|
2128
|
+
function Fl({ names: e }) {
|
|
2129
|
+
const { t } = B();
|
|
2130
|
+
if (e.length === 1) return /* @__PURE__ */ i(xt, { children: t("lockedByPrerequisiteByline", { name: e[0] }) });
|
|
1932
2131
|
const n = t("lockedByPrerequisitesByline", {
|
|
1933
2132
|
count: e.length,
|
|
1934
|
-
prerequisites:
|
|
1935
|
-
}), [o, ...
|
|
1936
|
-
return /* @__PURE__ */
|
|
1937
|
-
|
|
1938
|
-
/* @__PURE__ */ i(
|
|
2133
|
+
prerequisites: Xt
|
|
2134
|
+
}), [o, ...s] = n.split(Xt), r = s.length > 0 ? s.join("") : null;
|
|
2135
|
+
return /* @__PURE__ */ _(xt, { children: [
|
|
2136
|
+
r === null ? null : o,
|
|
2137
|
+
/* @__PURE__ */ i(In, { renderTip: e.join(", "), children: /* @__PURE__ */ i(
|
|
1939
2138
|
"span",
|
|
1940
2139
|
{
|
|
1941
2140
|
tabIndex: 0,
|
|
1942
|
-
style:
|
|
2141
|
+
style: ql,
|
|
1943
2142
|
onClick: (l) => l.stopPropagation(),
|
|
1944
2143
|
"data-testid": "module-byline-prerequisites",
|
|
1945
|
-
children:
|
|
2144
|
+
children: r === null ? n : t("lockedByPrerequisitesCount", { count: e.length })
|
|
1946
2145
|
}
|
|
1947
2146
|
) }),
|
|
1948
|
-
|
|
2147
|
+
r
|
|
1949
2148
|
] });
|
|
1950
2149
|
}
|
|
1951
|
-
function
|
|
1952
|
-
var
|
|
1953
|
-
const n =
|
|
1954
|
-
let
|
|
1955
|
-
|
|
1956
|
-
const c =
|
|
1957
|
-
return
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
c ? /* @__PURE__ */ i("span", { style:
|
|
2150
|
+
function Ul({ module: e, today: t }) {
|
|
2151
|
+
var d;
|
|
2152
|
+
const n = ke(), o = so(), s = ((d = e.progress) == null ? void 0 : d.status) === "locked", r = e.unlockAt ?? null, l = e.prerequisiteModules.map((m) => m.name.trim()).filter((m) => m !== ""), a = r !== null && new Date(r) > t;
|
|
2153
|
+
let u = null;
|
|
2154
|
+
r !== null && a && (s || !e.progress) ? u = n.unlockByline(r, t) : r !== null && !a && !e.progress && (u = n.unlockedByline(r, t));
|
|
2155
|
+
const c = s && l.length > 0;
|
|
2156
|
+
return u === null && !c ? null : /* @__PURE__ */ i(C, { as: "div", margin: "xxx-small 0 0 0", children: /* @__PURE__ */ _(A, { size: "small", color: "secondary", "data-testid": "module-byline", children: [
|
|
2157
|
+
u,
|
|
2158
|
+
u !== null && c ? /* @__PURE__ */ i("span", { style: no, children: " " }) : null,
|
|
2159
|
+
c ? /* @__PURE__ */ i("span", { style: u !== null ? o : void 0, children: /* @__PURE__ */ i(Fl, { names: l }) }) : null
|
|
1961
2160
|
] }) });
|
|
1962
2161
|
}
|
|
1963
|
-
const
|
|
1964
|
-
var n, o,
|
|
2162
|
+
const zl = "#273540", $l = "#D7DADE", Bl = "0.5rem", Gl = (e, t) => {
|
|
2163
|
+
var n, o, s, r, l;
|
|
1965
2164
|
return {
|
|
1966
|
-
meterColorBrand: ((o = (n = t.colors) == null ? void 0 : n.contrasts) == null ? void 0 : o.grey125125) ??
|
|
1967
|
-
borderRadius: String(((
|
|
1968
|
-
borderColor: ((l = (
|
|
2165
|
+
meterColorBrand: ((o = (n = t.colors) == null ? void 0 : n.contrasts) == null ? void 0 : o.grey125125) ?? zl,
|
|
2166
|
+
borderRadius: String(((s = t.borders) == null ? void 0 : s.radiusLarge) ?? Bl),
|
|
2167
|
+
borderColor: ((l = (r = t.colors) == null ? void 0 : r.contrasts) == null ? void 0 : l.grey1424) ?? $l,
|
|
1969
2168
|
trackBottomBorderColor: "transparent"
|
|
1970
2169
|
};
|
|
1971
|
-
},
|
|
1972
|
-
function
|
|
2170
|
+
}, jl = "66.667%", Yl = "8rem", Hl = 2;
|
|
2171
|
+
function Wl({
|
|
1973
2172
|
module: e,
|
|
1974
2173
|
breakpoints: t
|
|
1975
2174
|
}) {
|
|
1976
|
-
const { t: n } =
|
|
1977
|
-
if (!
|
|
1978
|
-
const
|
|
1979
|
-
return /* @__PURE__ */
|
|
1980
|
-
|
|
2175
|
+
const { t: n } = B(), o = ke(), s = e.progress;
|
|
2176
|
+
if (!s || s.status === "locked" || s.requirementCount <= 0) return null;
|
|
2177
|
+
const r = t.mobileOnly, l = Object.keys(t).length === 0 || t.desktop === !0;
|
|
2178
|
+
return /* @__PURE__ */ _(
|
|
2179
|
+
M,
|
|
1981
2180
|
{
|
|
1982
|
-
width: l ?
|
|
1983
|
-
direction:
|
|
1984
|
-
alignItems:
|
|
2181
|
+
width: l ? jl : "100%",
|
|
2182
|
+
direction: r ? "column" : "row",
|
|
2183
|
+
alignItems: r ? "stretch" : "center",
|
|
1985
2184
|
wrap: "wrap",
|
|
1986
2185
|
gap: "x-small",
|
|
1987
2186
|
margin: "small 0 0 0",
|
|
1988
2187
|
"data-testid": "module-progress",
|
|
1989
2188
|
children: [
|
|
1990
|
-
/* @__PURE__ */ i(
|
|
1991
|
-
|
|
2189
|
+
/* @__PURE__ */ i(M.Item, { size: r ? void 0 : Yl, shouldGrow: !0, children: /* @__PURE__ */ i(
|
|
2190
|
+
Ao,
|
|
1992
2191
|
{
|
|
1993
2192
|
size: "x-small",
|
|
1994
2193
|
meterColor: "brand",
|
|
1995
|
-
valueNow:
|
|
1996
|
-
valueMax:
|
|
2194
|
+
valueNow: s.requirementsMet,
|
|
2195
|
+
valueMax: s.requirementCount,
|
|
1997
2196
|
shouldAnimate: !1,
|
|
1998
2197
|
screenReaderLabel: n("moduleProgressScreenReaderLabel", { name: e.name }),
|
|
1999
|
-
formatScreenReaderValue: () =>
|
|
2198
|
+
formatScreenReaderValue: () => Fi(
|
|
2000
2199
|
n,
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2200
|
+
s.percentComplete,
|
|
2201
|
+
s.requirementsMet,
|
|
2202
|
+
s.requirementCount
|
|
2004
2203
|
),
|
|
2005
|
-
themeOverride:
|
|
2204
|
+
themeOverride: Gl
|
|
2006
2205
|
}
|
|
2007
2206
|
) }),
|
|
2008
|
-
/* @__PURE__ */ i(
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2207
|
+
/* @__PURE__ */ i(M.Item, { shouldShrink: !0, "aria-hidden": "true", children: /* @__PURE__ */ i(A, { size: "small", color: "secondary", children: o.progress(
|
|
2208
|
+
s.percentComplete,
|
|
2209
|
+
s.requirementsMet,
|
|
2210
|
+
s.requirementCount
|
|
2012
2211
|
) }) })
|
|
2013
2212
|
]
|
|
2014
2213
|
}
|
|
2015
2214
|
);
|
|
2016
2215
|
}
|
|
2017
|
-
const
|
|
2018
|
-
function
|
|
2216
|
+
const Jt = (e) => `platform-modules-panel-${e}`;
|
|
2217
|
+
function ft(e) {
|
|
2019
2218
|
return e !== void 0 && e.type !== "sub_header";
|
|
2020
2219
|
}
|
|
2021
|
-
function
|
|
2022
|
-
return
|
|
2220
|
+
function en(e) {
|
|
2221
|
+
return ft(e) && e.indent > 0;
|
|
2023
2222
|
}
|
|
2024
|
-
function
|
|
2223
|
+
function Kl({
|
|
2025
2224
|
module: e,
|
|
2026
2225
|
state: t,
|
|
2027
2226
|
today: n,
|
|
2028
|
-
|
|
2029
|
-
showDiagnostics: r
|
|
2227
|
+
showDiagnostics: o
|
|
2030
2228
|
}) {
|
|
2031
|
-
const { t: s } =
|
|
2032
|
-
return
|
|
2033
|
-
!
|
|
2229
|
+
const { t: s } = B(), r = $(null), l = t.items.length, a = !t.isLoading && !t.isFetchingNextPage;
|
|
2230
|
+
return te(() => {
|
|
2231
|
+
!a || l === 0 || r.current !== l && (r.current = l, he(
|
|
2034
2232
|
s("itemsLoadedAnnouncement", {
|
|
2035
|
-
loaded:
|
|
2233
|
+
loaded: l,
|
|
2036
2234
|
count: e.itemCount,
|
|
2037
2235
|
name: e.name
|
|
2038
2236
|
})
|
|
2039
2237
|
));
|
|
2040
|
-
}, [
|
|
2041
|
-
|
|
2238
|
+
}, [a, l, e.itemCount, e.name, s]), t.error ? /* @__PURE__ */ i(C, { as: "div", margin: "small 0 0 0", children: /* @__PURE__ */ i(
|
|
2239
|
+
gn,
|
|
2042
2240
|
{
|
|
2043
2241
|
variant: "error",
|
|
2044
2242
|
margin: "0",
|
|
2045
|
-
liveRegion:
|
|
2243
|
+
liveRegion: pn,
|
|
2046
2244
|
liveRegionPoliteness: "assertive",
|
|
2047
2245
|
"data-testid": "items-error",
|
|
2048
2246
|
children: s("itemsLoadErrorAlert", { message: t.error.message })
|
|
2049
2247
|
}
|
|
2050
|
-
) }) : t.isLoading ? /* @__PURE__ */
|
|
2051
|
-
/* @__PURE__ */ i(
|
|
2248
|
+
) }) : t.isLoading ? /* @__PURE__ */ _(C, { as: "div", margin: "small 0 0 0", "data-testid": "items-loading", children: [
|
|
2249
|
+
/* @__PURE__ */ i(it, { size: "x-small", renderTitle: s("itemsLoadingSpinnerLabel") }),
|
|
2052
2250
|
" ",
|
|
2053
|
-
/* @__PURE__ */ i(
|
|
2054
|
-
] }) : /* @__PURE__ */
|
|
2055
|
-
|
|
2251
|
+
/* @__PURE__ */ i(A, { size: "small", color: "secondary", children: s("itemsLoadingText") })
|
|
2252
|
+
] }) : /* @__PURE__ */ _(C, { as: "div", margin: "small 0 0 0", children: [
|
|
2253
|
+
o ? /* @__PURE__ */ _(A, { size: "x-small", color: "secondary", "data-testid": "items-source", children: [
|
|
2056
2254
|
"items source: ",
|
|
2057
2255
|
t.source,
|
|
2058
2256
|
" · loaded ",
|
|
@@ -2060,18 +2258,17 @@ function Oi({
|
|
|
2060
2258
|
" of ",
|
|
2061
2259
|
e.itemCount
|
|
2062
2260
|
] }) : null,
|
|
2063
|
-
t.items.length === 0 ? /* @__PURE__ */ i(
|
|
2064
|
-
|
|
2261
|
+
t.items.length === 0 ? /* @__PURE__ */ i(C, { as: "div", padding: "small", "data-testid": "items-empty", children: /* @__PURE__ */ i(A, { size: "small", color: "secondary", children: s("noItemsEmptyState") }) }) : /* @__PURE__ */ i("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, "data-testid": "items-list", children: t.items.map((u, c) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
|
|
2262
|
+
Ol,
|
|
2065
2263
|
{
|
|
2066
|
-
item:
|
|
2264
|
+
item: u,
|
|
2067
2265
|
today: n,
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
attachedBelow: et(c) && Ct(t.items[u + 1])
|
|
2266
|
+
attachedAbove: en(u) && ft(t.items[c - 1]),
|
|
2267
|
+
attachedBelow: ft(u) && en(t.items[c + 1])
|
|
2071
2268
|
}
|
|
2072
|
-
) },
|
|
2073
|
-
t.hasNextPage ? /* @__PURE__ */ i(
|
|
2074
|
-
|
|
2269
|
+
) }, u.id)) }),
|
|
2270
|
+
t.hasNextPage ? /* @__PURE__ */ i(C, { as: "div", margin: "small 0 0 0", textAlign: "center", children: /* @__PURE__ */ i(
|
|
2271
|
+
Pe,
|
|
2075
2272
|
{
|
|
2076
2273
|
size: "small",
|
|
2077
2274
|
onClick: t.fetchNextPage,
|
|
@@ -2085,32 +2282,41 @@ function Oi({
|
|
|
2085
2282
|
) }) : null
|
|
2086
2283
|
] });
|
|
2087
2284
|
}
|
|
2088
|
-
function
|
|
2285
|
+
function Ql({
|
|
2089
2286
|
module: e,
|
|
2090
2287
|
expanded: t,
|
|
2091
2288
|
onToggle: n,
|
|
2092
2289
|
itemsState: o,
|
|
2093
|
-
today:
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
breakpoints: c = {}
|
|
2290
|
+
today: s,
|
|
2291
|
+
showDiagnostics: r = !1,
|
|
2292
|
+
headingLevel: l = "h3",
|
|
2293
|
+
moduleLabel: a,
|
|
2294
|
+
breakpoints: u = {}
|
|
2099
2295
|
}) {
|
|
2100
|
-
var
|
|
2101
|
-
const { t:
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2296
|
+
var q, W, k, K;
|
|
2297
|
+
const { t: c, timezone: d } = B(), m = ke(), { navigation: f } = ye(), S = eo(), h = ((q = e.progress) == null ? void 0 : q.status) === "locked", b = h ? null : ((W = f.getModuleHref) == null ? void 0 : W.call(f, e)) ?? null, w = a === void 0 ? m.moduleLabel(e.position, e) : a, E = (w == null ? void 0 : w.trim()) || null, P = E ? c("moduleNameWithLabel", { label: E, name: e.name }) : e.name, L = /* @__PURE__ */ i(
|
|
2298
|
+
fn,
|
|
2299
|
+
{
|
|
2300
|
+
level: l,
|
|
2301
|
+
variant: "titleCardRegular",
|
|
2302
|
+
color: h ? "secondary" : "primary",
|
|
2303
|
+
"aria-label": P,
|
|
2304
|
+
"data-testid": "module-name",
|
|
2305
|
+
children: /* @__PURE__ */ i(Po, { linesAllowed: Hl, children: P })
|
|
2306
|
+
}
|
|
2307
|
+
), G = u.mobileOnly === !0, v = () => {
|
|
2308
|
+
var Q;
|
|
2309
|
+
(Q = window.getSelection()) != null && Q.toString().trim() || n(e.id);
|
|
2310
|
+
}, D = (k = e.progress) != null && k.status ? /* @__PURE__ */ i(
|
|
2311
|
+
Cl,
|
|
2106
2312
|
{
|
|
2107
2313
|
status: e.progress.status,
|
|
2108
2314
|
missingCount: e.progress.missingCount,
|
|
2109
2315
|
incompleteCount: e.progress.incompleteCount
|
|
2110
2316
|
}
|
|
2111
|
-
) : null;
|
|
2112
|
-
return /* @__PURE__ */
|
|
2113
|
-
|
|
2317
|
+
) : null, O = ((K = e.progress) == null ? void 0 : K.status) !== void 0 && e.progress.status !== "complete" && !h && yt(e.progress.nextDueAt, s, d) ? /* @__PURE__ */ i(vl, {}) : null;
|
|
2318
|
+
return /* @__PURE__ */ _(
|
|
2319
|
+
C,
|
|
2114
2320
|
{
|
|
2115
2321
|
as: "div",
|
|
2116
2322
|
background: "primary",
|
|
@@ -2121,80 +2327,212 @@ function Fi({
|
|
|
2121
2327
|
margin: "0 0 small 0",
|
|
2122
2328
|
"data-testid": `module-card-${e.id}`,
|
|
2123
2329
|
children: [
|
|
2124
|
-
/* @__PURE__ */ i(
|
|
2125
|
-
|
|
2330
|
+
/* @__PURE__ */ i(C, { as: "div", cursor: "pointer", children: /* @__PURE__ */ _(
|
|
2331
|
+
M,
|
|
2126
2332
|
{
|
|
2127
2333
|
alignItems: "start",
|
|
2128
2334
|
gap: "mediumSmall",
|
|
2129
|
-
onClick:
|
|
2335
|
+
onClick: v,
|
|
2130
2336
|
"data-testid": "module-header",
|
|
2131
2337
|
children: [
|
|
2132
|
-
/* @__PURE__ */
|
|
2133
|
-
/* @__PURE__ */
|
|
2134
|
-
/* @__PURE__ */ i(
|
|
2135
|
-
|
|
2338
|
+
/* @__PURE__ */ _(M.Item, { shouldGrow: !0, shouldShrink: !0, children: [
|
|
2339
|
+
/* @__PURE__ */ _(C, { as: "div", children: [
|
|
2340
|
+
/* @__PURE__ */ i(C, { as: "div", children: b ? /* @__PURE__ */ i(
|
|
2341
|
+
hn,
|
|
2136
2342
|
{
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2343
|
+
href: b,
|
|
2344
|
+
display: "inline-block",
|
|
2345
|
+
forceButtonRole: !1,
|
|
2346
|
+
variant: S,
|
|
2347
|
+
"aria-label": P,
|
|
2348
|
+
onClick: (Q) => Q.stopPropagation(),
|
|
2349
|
+
children: L
|
|
2142
2350
|
}
|
|
2143
|
-
),
|
|
2144
|
-
e.published ? null : /* @__PURE__ */
|
|
2351
|
+
) : L }),
|
|
2352
|
+
e.published ? null : /* @__PURE__ */ _(A, { size: "x-small", color: "secondary", children: [
|
|
2145
2353
|
" ",
|
|
2146
|
-
|
|
2354
|
+
c("moduleUnpublishedBadge")
|
|
2147
2355
|
] })
|
|
2148
2356
|
] }),
|
|
2149
|
-
/* @__PURE__ */ i(
|
|
2150
|
-
|
|
2151
|
-
|
|
2357
|
+
/* @__PURE__ */ i(Ul, { module: e, today: s }),
|
|
2358
|
+
G && (D || O) ? /* @__PURE__ */ i(C, { as: "div", margin: "x-small 0 0 0", children: /* @__PURE__ */ _(M, { gap: "x-small", wrap: "wrap", children: [
|
|
2359
|
+
O ? /* @__PURE__ */ i(M.Item, { children: O }) : null,
|
|
2360
|
+
D ? /* @__PURE__ */ i(M.Item, { children: D }) : null
|
|
2361
|
+
] }) }) : null,
|
|
2362
|
+
/* @__PURE__ */ i(Wl, { module: e, breakpoints: u })
|
|
2152
2363
|
] }),
|
|
2153
|
-
/* @__PURE__ */ i(
|
|
2154
|
-
!
|
|
2155
|
-
|
|
2156
|
-
|
|
2364
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ _(M, { alignItems: "center", gap: "mediumSmall", children: [
|
|
2365
|
+
!G && (O || D) ? /* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ _(M, { alignItems: "center", gap: "x-small", children: [
|
|
2366
|
+
O ? /* @__PURE__ */ i(M.Item, { children: O }) : null,
|
|
2367
|
+
D ? /* @__PURE__ */ i(M.Item, { children: D }) : null
|
|
2368
|
+
] }) }) : null,
|
|
2369
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ i(
|
|
2370
|
+
vo,
|
|
2157
2371
|
{
|
|
2158
2372
|
size: "medium",
|
|
2159
2373
|
withBorder: !0,
|
|
2160
2374
|
withBackground: !1,
|
|
2161
|
-
screenReaderLabel: t ?
|
|
2375
|
+
screenReaderLabel: t ? c("collapseModule", { name: e.name }) : c("expandModule", { name: e.name }),
|
|
2162
2376
|
"aria-expanded": t,
|
|
2163
|
-
"aria-controls":
|
|
2164
|
-
onClick: (
|
|
2165
|
-
|
|
2377
|
+
"aria-controls": Jt(e.id),
|
|
2378
|
+
onClick: (Q) => {
|
|
2379
|
+
Q.stopPropagation(), n(e.id);
|
|
2166
2380
|
},
|
|
2167
2381
|
"data-testid": `toggle-module-${e.id}`,
|
|
2168
|
-
children: t ? /* @__PURE__ */ i(
|
|
2382
|
+
children: t ? /* @__PURE__ */ i(_o, {}) : /* @__PURE__ */ i(To, {})
|
|
2169
2383
|
}
|
|
2170
2384
|
) })
|
|
2171
2385
|
] }) })
|
|
2172
2386
|
]
|
|
2173
2387
|
}
|
|
2174
2388
|
) }),
|
|
2175
|
-
/* @__PURE__ */ i("div", { id:
|
|
2176
|
-
|
|
2389
|
+
/* @__PURE__ */ i("div", { id: Jt(e.id), role: "group", "aria-label": e.name, hidden: !t, children: t ? /* @__PURE__ */ i(
|
|
2390
|
+
Kl,
|
|
2177
2391
|
{
|
|
2178
2392
|
module: e,
|
|
2179
2393
|
state: o,
|
|
2180
|
-
today:
|
|
2181
|
-
|
|
2182
|
-
showDiagnostics: l
|
|
2394
|
+
today: s,
|
|
2395
|
+
showDiagnostics: r
|
|
2183
2396
|
}
|
|
2184
2397
|
) : null })
|
|
2185
2398
|
]
|
|
2186
2399
|
}
|
|
2187
2400
|
);
|
|
2188
2401
|
}
|
|
2189
|
-
const
|
|
2190
|
-
function
|
|
2402
|
+
const Vl = ln(Ql);
|
|
2403
|
+
function Zl(e) {
|
|
2404
|
+
switch (e) {
|
|
2405
|
+
case "complete":
|
|
2406
|
+
return "complete";
|
|
2407
|
+
case "locked":
|
|
2408
|
+
return "locked";
|
|
2409
|
+
case void 0:
|
|
2410
|
+
case "not_started":
|
|
2411
|
+
return "notStarted";
|
|
2412
|
+
case "in_progress":
|
|
2413
|
+
case "missing":
|
|
2414
|
+
case "incomplete":
|
|
2415
|
+
case "missing_and_incomplete":
|
|
2416
|
+
return "inProgress";
|
|
2417
|
+
}
|
|
2418
|
+
}
|
|
2419
|
+
function Xl(e) {
|
|
2420
|
+
var l, a, u;
|
|
2421
|
+
let t = 0, n = 0, o = 0;
|
|
2422
|
+
for (const c of e)
|
|
2423
|
+
((l = c.progress) == null ? void 0 : l.status) === "complete" && (t += 1), n += ((a = c.progress) == null ? void 0 : a.requirementCount) ?? 0, o += ((u = c.progress) == null ? void 0 : u.requirementsMet) ?? 0;
|
|
2424
|
+
const s = e.length, r = s === 0 ? 0 : t === s ? 100 : Math.floor(t / s * 100);
|
|
2425
|
+
return {
|
|
2426
|
+
totalModules: s,
|
|
2427
|
+
completedModules: t,
|
|
2428
|
+
totalItems: n,
|
|
2429
|
+
completedItems: o,
|
|
2430
|
+
percent: r
|
|
2431
|
+
};
|
|
2432
|
+
}
|
|
2433
|
+
const Jl = "1.75rem", ea = "4px", ta = "4px", na = "6.5rem";
|
|
2434
|
+
function oa({
|
|
2435
|
+
module: e,
|
|
2436
|
+
onClick: t
|
|
2437
|
+
}) {
|
|
2438
|
+
var d, m, f, S;
|
|
2439
|
+
const { t: n } = B(), s = ke().moduleLabel(e.position, e), r = s ? n("moduleNameWithLabel", { label: s, name: e.name }) : e.name, l = ((d = e.progress) == null ? void 0 : d.status) ?? "not_started", a = Zl(l), u = n("moduleProgressSegmentLabel", {
|
|
2440
|
+
name: r,
|
|
2441
|
+
status: Jn(
|
|
2442
|
+
n,
|
|
2443
|
+
l,
|
|
2444
|
+
((m = e.progress) == null ? void 0 : m.missingCount) ?? 0,
|
|
2445
|
+
((f = e.progress) == null ? void 0 : f.incompleteCount) ?? 0
|
|
2446
|
+
)
|
|
2447
|
+
}), c = a === "complete" ? 100 : a === "inProgress" ? ((S = e.progress) == null ? void 0 : S.percentComplete) ?? 0 : 0;
|
|
2448
|
+
return /* @__PURE__ */ i(M.Item, { shouldShrink: !0, width: na, children: /* @__PURE__ */ i(In, { renderTip: r, children: () => /* @__PURE__ */ _(
|
|
2449
|
+
C,
|
|
2450
|
+
{
|
|
2451
|
+
as: "button",
|
|
2452
|
+
type: "button",
|
|
2453
|
+
display: "block",
|
|
2454
|
+
width: "100%",
|
|
2455
|
+
height: Jl,
|
|
2456
|
+
borderRadius: ea,
|
|
2457
|
+
borderWidth: a === "complete" ? "none" : "small",
|
|
2458
|
+
borderColor: "secondary",
|
|
2459
|
+
background: a === "locked" ? "secondary" : "primary",
|
|
2460
|
+
position: "relative",
|
|
2461
|
+
overflowX: "hidden",
|
|
2462
|
+
overflowY: "hidden",
|
|
2463
|
+
padding: "0",
|
|
2464
|
+
onClick: t ? () => t(e.id) : void 0,
|
|
2465
|
+
"data-testid": `modules-progress-segment-${e.id}`,
|
|
2466
|
+
children: [
|
|
2467
|
+
c > 0 ? /* @__PURE__ */ i(
|
|
2468
|
+
C,
|
|
2469
|
+
{
|
|
2470
|
+
as: "div",
|
|
2471
|
+
position: "absolute",
|
|
2472
|
+
insetInlineStart: "0",
|
|
2473
|
+
insetInlineEnd: "0",
|
|
2474
|
+
insetBlockEnd: "0",
|
|
2475
|
+
height: `${c}%`,
|
|
2476
|
+
background: "brand"
|
|
2477
|
+
}
|
|
2478
|
+
) : null,
|
|
2479
|
+
/* @__PURE__ */ i(lt, { children: u })
|
|
2480
|
+
]
|
|
2481
|
+
}
|
|
2482
|
+
) }) });
|
|
2483
|
+
}
|
|
2484
|
+
function sa({
|
|
2485
|
+
modules: e,
|
|
2486
|
+
onModuleClick: t
|
|
2487
|
+
}) {
|
|
2488
|
+
const { t: n } = B(), o = N(() => Xl(e), [e]);
|
|
2489
|
+
if (!e.some((a) => a.progress !== void 0) || o.totalModules === 0) return null;
|
|
2490
|
+
const r = n("moduleProgressOverviewSummary", {
|
|
2491
|
+
count: o.totalModules,
|
|
2492
|
+
completedModules: o.completedModules,
|
|
2493
|
+
totalModules: o.totalModules
|
|
2494
|
+
}), l = o.totalItems > 0 ? n("moduleProgressOverviewDetail", {
|
|
2495
|
+
itemsSummary: n("moduleProgressOverviewItemsSummary", {
|
|
2496
|
+
count: o.totalItems,
|
|
2497
|
+
completedItems: o.completedItems,
|
|
2498
|
+
totalItems: o.totalItems
|
|
2499
|
+
})
|
|
2500
|
+
}) : null;
|
|
2501
|
+
return /* @__PURE__ */ _(C, { as: "div", margin: "medium 0 small 0", "data-testid": "modules-progress-overview", children: [
|
|
2502
|
+
/* @__PURE__ */ i(M, { wrap: "wrap", children: /* @__PURE__ */ _(M.Item, { children: [
|
|
2503
|
+
/* @__PURE__ */ i(C, { as: "span", margin: "0 x-small 0 0", children: /* @__PURE__ */ i(
|
|
2504
|
+
A,
|
|
2505
|
+
{
|
|
2506
|
+
size: "large",
|
|
2507
|
+
weight: "bold",
|
|
2508
|
+
lineHeight: "condensed",
|
|
2509
|
+
"data-testid": "modules-progress-overview-percent",
|
|
2510
|
+
children: n("moduleProgressOverviewPercentLabel", { percent: o.percent })
|
|
2511
|
+
}
|
|
2512
|
+
) }),
|
|
2513
|
+
/* @__PURE__ */ i(A, { size: "medium", "data-testid": "modules-progress-overview-summary", children: l ? `${r} ${l}` : r })
|
|
2514
|
+
] }) }),
|
|
2515
|
+
/* @__PURE__ */ i(
|
|
2516
|
+
M,
|
|
2517
|
+
{
|
|
2518
|
+
margin: "xx-small 0 0 0",
|
|
2519
|
+
gap: ta,
|
|
2520
|
+
role: "group",
|
|
2521
|
+
"aria-label": n("moduleProgressOverviewGroupLabel"),
|
|
2522
|
+
"data-testid": "modules-progress-overview-segments",
|
|
2523
|
+
children: e.map((a) => /* @__PURE__ */ i(oa, { module: a, onClick: t }, a.id))
|
|
2524
|
+
}
|
|
2525
|
+
)
|
|
2526
|
+
] });
|
|
2527
|
+
}
|
|
2528
|
+
function ra({
|
|
2191
2529
|
counts: e,
|
|
2192
2530
|
itemsMode: t,
|
|
2193
2531
|
loadedModules: n
|
|
2194
2532
|
}) {
|
|
2195
2533
|
const o = e.listModules + e.listModuleItems;
|
|
2196
2534
|
return /* @__PURE__ */ i(
|
|
2197
|
-
|
|
2535
|
+
C,
|
|
2198
2536
|
{
|
|
2199
2537
|
as: "div",
|
|
2200
2538
|
background: "secondary",
|
|
@@ -2203,25 +2541,25 @@ function zi({
|
|
|
2203
2541
|
padding: "x-small small",
|
|
2204
2542
|
margin: "0 0 small 0",
|
|
2205
2543
|
"data-testid": "dev-diagnostics",
|
|
2206
|
-
children: /* @__PURE__ */
|
|
2207
|
-
/* @__PURE__ */ i(
|
|
2208
|
-
/* @__PURE__ */ i(
|
|
2544
|
+
children: /* @__PURE__ */ _(M, { gap: "medium", wrap: "wrap", children: [
|
|
2545
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ i(A, { size: "x-small", weight: "bold", children: "Adapter requests" }) }),
|
|
2546
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ _(A, { size: "x-small", "data-testid": "request-count-list-modules", children: [
|
|
2209
2547
|
"listModules: ",
|
|
2210
2548
|
e.listModules
|
|
2211
2549
|
] }) }),
|
|
2212
|
-
/* @__PURE__ */ i(
|
|
2550
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ _(A, { size: "x-small", "data-testid": "request-count-list-module-items", children: [
|
|
2213
2551
|
"listModuleItems: ",
|
|
2214
2552
|
e.listModuleItems
|
|
2215
2553
|
] }) }),
|
|
2216
|
-
/* @__PURE__ */ i(
|
|
2554
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ _(A, { size: "x-small", weight: "bold", "data-testid": "request-count-total", children: [
|
|
2217
2555
|
"total: ",
|
|
2218
2556
|
o
|
|
2219
2557
|
] }) }),
|
|
2220
|
-
/* @__PURE__ */ i(
|
|
2558
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ _(A, { size: "x-small", "data-testid": "resolved-items-mode", children: [
|
|
2221
2559
|
"itemsMode: ",
|
|
2222
2560
|
t ?? "probing…"
|
|
2223
2561
|
] }) }),
|
|
2224
|
-
/* @__PURE__ */ i(
|
|
2562
|
+
/* @__PURE__ */ i(M.Item, { children: /* @__PURE__ */ _(A, { size: "x-small", "data-testid": "modules-loaded-count", children: [
|
|
2225
2563
|
"modules loaded: ",
|
|
2226
2564
|
n
|
|
2227
2565
|
] }) })
|
|
@@ -2229,156 +2567,189 @@ function zi({
|
|
|
2229
2567
|
}
|
|
2230
2568
|
);
|
|
2231
2569
|
}
|
|
2232
|
-
const
|
|
2233
|
-
function
|
|
2570
|
+
const ia = 200;
|
|
2571
|
+
function la({
|
|
2234
2572
|
data: e,
|
|
2235
2573
|
courseName: t,
|
|
2236
2574
|
courseContext: n,
|
|
2237
2575
|
today: o,
|
|
2238
|
-
requestCounts:
|
|
2239
|
-
showDiagnostics:
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
breakpoints: c = {}
|
|
2576
|
+
requestCounts: s,
|
|
2577
|
+
showDiagnostics: r = s !== void 0,
|
|
2578
|
+
as: l = "div",
|
|
2579
|
+
headingLevel: a = "h2",
|
|
2580
|
+
breakpoints: u = {}
|
|
2244
2581
|
}) {
|
|
2245
|
-
const { miniTablet:
|
|
2246
|
-
() => ({ miniTablet:
|
|
2247
|
-
[
|
|
2582
|
+
const { miniTablet: c, tablet: d, desktop: m, desktopNavOpen: f, desktopOnly: S, mobileOnly: h, ICEDesktop: b } = u, w = N(
|
|
2583
|
+
() => ({ miniTablet: c, tablet: d, desktop: m, desktopNavOpen: f, desktopOnly: S, mobileOnly: h, ICEDesktop: b }),
|
|
2584
|
+
[c, d, m, f, S, h, b]
|
|
2248
2585
|
), {
|
|
2249
|
-
modules:
|
|
2250
|
-
hasNextPage:
|
|
2251
|
-
fetchNextPage:
|
|
2252
|
-
isFetchingNextPage:
|
|
2253
|
-
isLoading:
|
|
2254
|
-
isRefreshing:
|
|
2255
|
-
error:
|
|
2256
|
-
itemsMode:
|
|
2586
|
+
modules: E,
|
|
2587
|
+
hasNextPage: P,
|
|
2588
|
+
fetchNextPage: z,
|
|
2589
|
+
isFetchingNextPage: L,
|
|
2590
|
+
isLoading: G,
|
|
2591
|
+
isRefreshing: v,
|
|
2592
|
+
error: D,
|
|
2593
|
+
itemsMode: H,
|
|
2257
2594
|
expandedModuleIds: O,
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
var
|
|
2271
|
-
|
|
2272
|
-
}, [
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2595
|
+
expandModule: q,
|
|
2596
|
+
collapseModule: W,
|
|
2597
|
+
toggleModule: k,
|
|
2598
|
+
expandModules: K,
|
|
2599
|
+
collapseModules: Q,
|
|
2600
|
+
getItems: re,
|
|
2601
|
+
filter: ie,
|
|
2602
|
+
setFilter: Te,
|
|
2603
|
+
filterEntry: De,
|
|
2604
|
+
filterPredicate: le,
|
|
2605
|
+
filterResultsArePartial: Ee
|
|
2606
|
+
} = e, { t: x, timezone: V } = B(), Ne = t ?? x("pageTitle"), Oe = $(null), Z = $(/* @__PURE__ */ new Map()), qe = rt(), ae = rt(), J = h === !0, ce = $(!1), nt = F((y) => {
|
|
2607
|
+
var U;
|
|
2608
|
+
(U = Z.current.get(y)) == null || U.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
2609
|
+
}, []), [Fe] = ee(() => /* @__PURE__ */ new Date()), ue = o ?? Fe, [Ue, ze] = ee(null);
|
|
2610
|
+
te(() => {
|
|
2611
|
+
!P && !v && ie === ne && ze(E);
|
|
2612
|
+
}, [P, v, ie, E]), te(() => {
|
|
2613
|
+
var y;
|
|
2614
|
+
!ce.current || L || v || (ce.current = !1, he(x("modulesLoadedAnnouncement", { count: E.length })), (y = Oe.current) == null || y.focus());
|
|
2615
|
+
}, [L, v, E.length, x]);
|
|
2616
|
+
const de = N(
|
|
2617
|
+
() => E.filter(
|
|
2618
|
+
(y) => le === void 0 || le(y, { today: ue, timezone: V })
|
|
2276
2619
|
),
|
|
2277
|
-
[
|
|
2278
|
-
),
|
|
2279
|
-
rows:
|
|
2620
|
+
[E, le, ue, V]
|
|
2621
|
+
), I = $({
|
|
2622
|
+
rows: de,
|
|
2280
2623
|
expanded: O,
|
|
2281
2624
|
items: /* @__PURE__ */ new Map()
|
|
2282
|
-
}), [
|
|
2283
|
-
|
|
2284
|
-
rows:
|
|
2625
|
+
}), [g, T] = ee(null);
|
|
2626
|
+
v ? g === null && T(I.current) : (I.current = {
|
|
2627
|
+
rows: de,
|
|
2285
2628
|
expanded: O,
|
|
2286
|
-
items: new Map(O.map((
|
|
2287
|
-
},
|
|
2288
|
-
const
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2629
|
+
items: new Map(O.map((y) => [y, re(y)]))
|
|
2630
|
+
}, g !== null && T(null));
|
|
2631
|
+
const R = (g == null ? void 0 : g.rows) ?? de, j = (g == null ? void 0 : g.expanded) ?? O, Ce = N(() => new Set(j), [j]), Y = N(
|
|
2632
|
+
() => R.filter((y) => Ce.has(y.id)).map((y) => y.id),
|
|
2633
|
+
[R, Ce]
|
|
2634
|
+
), $e = Y.length > 0, [me, pe] = ee(!1), X = Y.filter((y) => re(y).isLoading).length, Be = me ? X : 0, ge = $(!1);
|
|
2635
|
+
te(() => {
|
|
2636
|
+
if (me) {
|
|
2637
|
+
if (X > 0 && !ge.current) {
|
|
2638
|
+
ge.current = !0, he(x("expandAllLoadingItems", { count: X }));
|
|
2295
2639
|
return;
|
|
2296
2640
|
}
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2641
|
+
X === 0 && ge.current && (ge.current = !1, pe(!1), he(x("expandAllItemsLoaded")));
|
|
2642
|
+
}
|
|
2643
|
+
}, [me, X, x]);
|
|
2644
|
+
const lo = () => {
|
|
2645
|
+
if ($e) {
|
|
2646
|
+
const U = new Set(Y);
|
|
2647
|
+
pe(!1), ge.current = !1, Q(Y), g !== null && T({ ...g, expanded: g.expanded.filter((Ge) => !U.has(Ge)) }), he(x("modulesCollapsedAnnouncement", { count: Y.length }));
|
|
2648
|
+
return;
|
|
2649
|
+
}
|
|
2650
|
+
const y = R.map((U) => U.id);
|
|
2651
|
+
pe(!0), ge.current = !1, K(y), g !== null && T({ ...g, expanded: y }), he(x("modulesExpandedAnnouncement", { count: y.length }));
|
|
2652
|
+
}, Ct = $(g);
|
|
2653
|
+
Ct.current = g;
|
|
2654
|
+
const ao = F(
|
|
2655
|
+
(y) => {
|
|
2656
|
+
const U = Ct.current;
|
|
2657
|
+
if (U === null) {
|
|
2658
|
+
k(y);
|
|
2659
|
+
return;
|
|
2660
|
+
}
|
|
2661
|
+
const Ge = U.expanded.includes(y);
|
|
2662
|
+
T({
|
|
2663
|
+
...U,
|
|
2664
|
+
expanded: Ge ? U.expanded.filter((mo) => mo !== y) : [...U.expanded, y]
|
|
2665
|
+
}), Ge ? W(y) : q(y);
|
|
2302
2666
|
},
|
|
2303
|
-
[
|
|
2304
|
-
), [
|
|
2305
|
-
|
|
2306
|
-
if (!
|
|
2307
|
-
|
|
2667
|
+
[k, W, q]
|
|
2668
|
+
), [co, wt] = ee(!1);
|
|
2669
|
+
te(() => {
|
|
2670
|
+
if (!v) {
|
|
2671
|
+
wt(!1);
|
|
2308
2672
|
return;
|
|
2309
2673
|
}
|
|
2310
|
-
const
|
|
2311
|
-
return () => clearTimeout(
|
|
2312
|
-
}, [
|
|
2313
|
-
const
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
}, Ne = Ae !== void 0 && Le !== te, be = A || k && V.length === 0, Me = V.length === 0 && !be && !$, se = Me && Ne;
|
|
2319
|
-
return /* @__PURE__ */ S(E, { as: a, display: "block", "data-testid": "modules-list", children: [
|
|
2320
|
-
n ? /* @__PURE__ */ S(E, { as: "div", children: [
|
|
2321
|
-
/* @__PURE__ */ i(v, { size: "small", color: "brand", children: n }),
|
|
2322
|
-
/* @__PURE__ */ S(v, { size: "small", color: "secondary", children: [
|
|
2674
|
+
const y = setTimeout(() => wt(!0), ia);
|
|
2675
|
+
return () => clearTimeout(y);
|
|
2676
|
+
}, [v]);
|
|
2677
|
+
const vt = De !== void 0 && ie !== ne, Pt = G || v && R.length === 0, At = R.length === 0 && !Pt && !D, uo = At && vt;
|
|
2678
|
+
return /* @__PURE__ */ _(C, { as: l, display: "block", "data-testid": "modules-list", children: [
|
|
2679
|
+
n ? /* @__PURE__ */ _(C, { as: "div", children: [
|
|
2680
|
+
/* @__PURE__ */ i(A, { size: "small", color: "brand", children: n }),
|
|
2681
|
+
/* @__PURE__ */ _(A, { size: "small", color: "secondary", children: [
|
|
2323
2682
|
" ",
|
|
2324
2683
|
"/",
|
|
2325
2684
|
" "
|
|
2326
2685
|
] }),
|
|
2327
|
-
/* @__PURE__ */ i(
|
|
2686
|
+
/* @__PURE__ */ i(A, { size: "small", color: "secondary", children: Ne })
|
|
2328
2687
|
] }) : null,
|
|
2329
|
-
/* @__PURE__ */ i(
|
|
2330
|
-
|
|
2331
|
-
|
|
2688
|
+
/* @__PURE__ */ i(fn, { level: a, margin: "x-small 0 medium 0", children: Ne }),
|
|
2689
|
+
Ue ? /* @__PURE__ */ i(sa, { modules: Ue, onModuleClick: nt }) : null,
|
|
2690
|
+
r && s ? /* @__PURE__ */ i(
|
|
2691
|
+
ra,
|
|
2332
2692
|
{
|
|
2333
|
-
counts:
|
|
2334
|
-
itemsMode:
|
|
2335
|
-
loadedModules:
|
|
2693
|
+
counts: s,
|
|
2694
|
+
itemsMode: H,
|
|
2695
|
+
loadedModules: E.length
|
|
2336
2696
|
}
|
|
2337
2697
|
) : null,
|
|
2338
|
-
/* @__PURE__ */ i(
|
|
2339
|
-
|
|
2698
|
+
/* @__PURE__ */ i(M, { justifyItems: "end", "data-testid": "modules-controls", children: /* @__PURE__ */ i(M.Item, { shouldGrow: J, children: /* @__PURE__ */ i(
|
|
2699
|
+
Pe,
|
|
2340
2700
|
{
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2701
|
+
display: J ? "block" : "inline-block",
|
|
2702
|
+
onClick: lo,
|
|
2703
|
+
interaction: R.length === 0 ? "disabled" : "enabled",
|
|
2704
|
+
renderIcon: Be > 0 ? /* @__PURE__ */ i(it, { size: "x-small", renderTitle: x("itemsLoadingSpinnerLabel") }) : void 0,
|
|
2705
|
+
"aria-describedby": Be > 0 ? ae : void 0,
|
|
2706
|
+
"data-testid": "expand-collapse-all",
|
|
2707
|
+
children: x($e ? "collapseAllModules" : "expandAllModules")
|
|
2347
2708
|
}
|
|
2348
2709
|
) }) }),
|
|
2710
|
+
Be > 0 ? /* @__PURE__ */ i(C, { as: "div", margin: "xx-small 0 0 0", textAlign: "end", children: /* @__PURE__ */ i(
|
|
2711
|
+
A,
|
|
2712
|
+
{
|
|
2713
|
+
size: "x-small",
|
|
2714
|
+
color: "secondary",
|
|
2715
|
+
id: ae,
|
|
2716
|
+
"data-testid": "expand-all-loading-hint",
|
|
2717
|
+
children: x("expandAllLoadingItems", { count: Be })
|
|
2718
|
+
}
|
|
2719
|
+
) }) : null,
|
|
2349
2720
|
/* @__PURE__ */ i(
|
|
2350
|
-
|
|
2721
|
+
cl,
|
|
2351
2722
|
{
|
|
2352
|
-
value:
|
|
2353
|
-
onChange:
|
|
2354
|
-
describedBy:
|
|
2723
|
+
value: ie,
|
|
2724
|
+
onChange: Te,
|
|
2725
|
+
describedBy: Ee ? qe : void 0
|
|
2355
2726
|
}
|
|
2356
2727
|
),
|
|
2357
|
-
|
|
2358
|
-
|
|
2728
|
+
Ee ? /* @__PURE__ */ i(C, { as: "div", margin: "x-small 0 0 0", children: /* @__PURE__ */ i(
|
|
2729
|
+
A,
|
|
2359
2730
|
{
|
|
2360
2731
|
size: "x-small",
|
|
2361
2732
|
color: "secondary",
|
|
2362
|
-
id:
|
|
2733
|
+
id: qe,
|
|
2363
2734
|
"data-testid": "filter-partial-hint",
|
|
2364
2735
|
children: x("filterScopeHint")
|
|
2365
2736
|
}
|
|
2366
2737
|
) }) : null,
|
|
2367
|
-
/* @__PURE__ */
|
|
2368
|
-
|
|
2369
|
-
|
|
2738
|
+
/* @__PURE__ */ _(C, { as: "div", margin: "medium 0 0 0", children: [
|
|
2739
|
+
D ? /* @__PURE__ */ i(
|
|
2740
|
+
gn,
|
|
2370
2741
|
{
|
|
2371
2742
|
variant: "error",
|
|
2372
2743
|
margin: "0 0 small 0",
|
|
2373
|
-
liveRegion:
|
|
2744
|
+
liveRegion: pn,
|
|
2374
2745
|
liveRegionPoliteness: "assertive",
|
|
2375
2746
|
"data-testid": "modules-error",
|
|
2376
|
-
children: x("modulesLoadErrorAlert", { message:
|
|
2747
|
+
children: x("modulesLoadErrorAlert", { message: D.message })
|
|
2377
2748
|
}
|
|
2378
2749
|
) : null,
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2750
|
+
Pt ? /* @__PURE__ */ i(C, { as: "div", padding: "large", textAlign: "center", "data-testid": "modules-loading", children: /* @__PURE__ */ i(it, { renderTitle: x("modulesLoadingSpinnerLabel") }) }) : null,
|
|
2751
|
+
At && !vt ? /* @__PURE__ */ i(
|
|
2752
|
+
C,
|
|
2382
2753
|
{
|
|
2383
2754
|
as: "div",
|
|
2384
2755
|
background: "secondary",
|
|
@@ -2386,11 +2757,11 @@ function Bi({
|
|
|
2386
2757
|
padding: "large",
|
|
2387
2758
|
textAlign: "center",
|
|
2388
2759
|
"data-testid": "modules-empty",
|
|
2389
|
-
children: /* @__PURE__ */ i(
|
|
2760
|
+
children: /* @__PURE__ */ i(A, { color: "secondary", children: x("noModulesEmptyState") })
|
|
2390
2761
|
}
|
|
2391
2762
|
) : null,
|
|
2392
|
-
|
|
2393
|
-
|
|
2763
|
+
uo ? /* @__PURE__ */ _(
|
|
2764
|
+
C,
|
|
2394
2765
|
{
|
|
2395
2766
|
as: "div",
|
|
2396
2767
|
background: "secondary",
|
|
@@ -2399,13 +2770,13 @@ function Bi({
|
|
|
2399
2770
|
textAlign: "center",
|
|
2400
2771
|
"data-testid": "modules-filtered-empty",
|
|
2401
2772
|
children: [
|
|
2402
|
-
/* @__PURE__ */ i(
|
|
2773
|
+
/* @__PURE__ */ i(C, { as: "div", margin: "0 0 small 0", children: /* @__PURE__ */ i(A, { color: "secondary", children: E.length === 0 ? x("noFilterMatches") : x("filteredEmptyState", { count: E.length }) }) }),
|
|
2403
2774
|
/* @__PURE__ */ i(
|
|
2404
|
-
|
|
2775
|
+
Pe,
|
|
2405
2776
|
{
|
|
2406
2777
|
size: "small",
|
|
2407
2778
|
onClick: () => {
|
|
2408
|
-
|
|
2779
|
+
Te(ne), ce.current = !0;
|
|
2409
2780
|
},
|
|
2410
2781
|
children: x("clearFilters")
|
|
2411
2782
|
}
|
|
@@ -2416,55 +2787,63 @@ function Bi({
|
|
|
2416
2787
|
/* @__PURE__ */ i(
|
|
2417
2788
|
"ul",
|
|
2418
2789
|
{
|
|
2419
|
-
style: { listStyle: "none", margin: 0, padding: 0, opacity:
|
|
2420
|
-
"aria-busy":
|
|
2790
|
+
style: { listStyle: "none", margin: 0, padding: 0, opacity: co ? 0.5 : 1 },
|
|
2791
|
+
"aria-busy": v,
|
|
2421
2792
|
"data-testid": "modules-stack",
|
|
2422
|
-
children:
|
|
2423
|
-
|
|
2793
|
+
children: R.map((y) => /* @__PURE__ */ i(
|
|
2794
|
+
"li",
|
|
2424
2795
|
{
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2796
|
+
ref: (U) => {
|
|
2797
|
+
U ? Z.current.set(y.id, U) : Z.current.delete(y.id);
|
|
2798
|
+
},
|
|
2799
|
+
children: /* @__PURE__ */ i(
|
|
2800
|
+
Vl,
|
|
2801
|
+
{
|
|
2802
|
+
module: y,
|
|
2803
|
+
expanded: j.includes(y.id),
|
|
2804
|
+
onToggle: ao,
|
|
2805
|
+
itemsState: (g == null ? void 0 : g.items.get(y.id)) ?? re(y.id),
|
|
2806
|
+
today: ue,
|
|
2807
|
+
showDiagnostics: r,
|
|
2808
|
+
headingLevel: a === "h1" ? "h2" : "h3",
|
|
2809
|
+
breakpoints: w
|
|
2810
|
+
}
|
|
2811
|
+
)
|
|
2812
|
+
},
|
|
2813
|
+
y.id
|
|
2814
|
+
))
|
|
2436
2815
|
}
|
|
2437
2816
|
)
|
|
2438
2817
|
] }),
|
|
2439
|
-
|
|
2440
|
-
|
|
2818
|
+
P ? /* @__PURE__ */ i(C, { as: "div", textAlign: "center", margin: "small 0 0 0", children: /* @__PURE__ */ i(
|
|
2819
|
+
Pe,
|
|
2441
2820
|
{
|
|
2442
2821
|
color: "primary",
|
|
2443
2822
|
onClick: () => {
|
|
2444
|
-
|
|
2823
|
+
ce.current = !0, z();
|
|
2445
2824
|
},
|
|
2446
|
-
interaction:
|
|
2825
|
+
interaction: L || v ? "disabled" : "enabled",
|
|
2447
2826
|
"data-testid": "load-more-modules",
|
|
2448
|
-
children:
|
|
2827
|
+
children: L ? x("loadMoreModulesLoading") : x("loadMoreModules", { count: E.length })
|
|
2449
2828
|
}
|
|
2450
|
-
) }) :
|
|
2451
|
-
|
|
2829
|
+
) }) : E.length > 0 ? /* @__PURE__ */ i(C, { as: "div", textAlign: "center", margin: "small 0 0 0", children: /* @__PURE__ */ i(
|
|
2830
|
+
A,
|
|
2452
2831
|
{
|
|
2453
2832
|
size: "x-small",
|
|
2454
2833
|
color: "secondary",
|
|
2455
2834
|
"data-testid": "modules-all-loaded",
|
|
2456
|
-
elementRef: (
|
|
2457
|
-
|
|
2835
|
+
elementRef: (y) => {
|
|
2836
|
+
Oe.current = y;
|
|
2458
2837
|
},
|
|
2459
2838
|
tabIndex: -1,
|
|
2460
|
-
children: x("allModulesLoaded", { count:
|
|
2839
|
+
children: x("allModulesLoaded", { count: E.length })
|
|
2461
2840
|
}
|
|
2462
2841
|
) }) : null
|
|
2463
2842
|
] });
|
|
2464
2843
|
}
|
|
2465
|
-
const
|
|
2466
|
-
|
|
2467
|
-
),
|
|
2844
|
+
const hc = No(
|
|
2845
|
+
la
|
|
2846
|
+
), Ae = [
|
|
2468
2847
|
"assignment",
|
|
2469
2848
|
"quiz",
|
|
2470
2849
|
"discussion",
|
|
@@ -2473,7 +2852,7 @@ const Vl = Hn(
|
|
|
2473
2852
|
"external_url",
|
|
2474
2853
|
"external_tool",
|
|
2475
2854
|
"sub_header"
|
|
2476
|
-
],
|
|
2855
|
+
], ht = [
|
|
2477
2856
|
"not_started",
|
|
2478
2857
|
"in_progress",
|
|
2479
2858
|
"complete",
|
|
@@ -2481,30 +2860,30 @@ const Vl = Hn(
|
|
|
2481
2860
|
"incomplete",
|
|
2482
2861
|
"missing_and_incomplete",
|
|
2483
2862
|
"locked"
|
|
2484
|
-
],
|
|
2863
|
+
], ro = [
|
|
2485
2864
|
"must_view",
|
|
2486
2865
|
"must_submit",
|
|
2487
2866
|
"must_contribute",
|
|
2488
2867
|
"must_mark_done",
|
|
2489
2868
|
"min_score",
|
|
2490
2869
|
"min_percentage"
|
|
2491
|
-
],
|
|
2870
|
+
], aa = ["assignment", "quiz", "discussion"], ca = ["external_url", "external_tool"], ua = ["assignment", "quiz", "discussion"], da = Date.UTC(2025, 0, 6), ma = 864e5, _e = "1", io = (e) => new Date(da + e * ma).toISOString(), Ve = [
|
|
2492
2871
|
"min_score",
|
|
2493
2872
|
"min_percentage"
|
|
2494
|
-
],
|
|
2495
|
-
(e) => !
|
|
2496
|
-
),
|
|
2873
|
+
], pa = ro.filter(
|
|
2874
|
+
(e) => !Ve.includes(e)
|
|
2875
|
+
), ga = [
|
|
2497
2876
|
"in_progress",
|
|
2498
2877
|
"incomplete",
|
|
2499
2878
|
"missing_and_incomplete"
|
|
2500
|
-
],
|
|
2501
|
-
const
|
|
2502
|
-
return
|
|
2503
|
-
},
|
|
2879
|
+
], fa = (e, t, n, o) => {
|
|
2880
|
+
const s = n ? ro : pa, r = n && o ? Ve[t % Ve.length] : s[Math.floor(t / 3) % s.length];
|
|
2881
|
+
return r === "min_score" ? { itemId: e, type: r, minScore: 10 } : r === "min_percentage" ? { itemId: e, type: r, minPercentage: 80 } : { itemId: e, type: r };
|
|
2882
|
+
}, ha = (e, t, n, o) => e === "sub_header" ? !1 : n && o || t % 3 === 0, Et = (e) => ht[(e - 1) % ht.length], Ia = (e, t) => !ua.includes(e) || e === "discussion" && Math.floor(t / Ae.length) % 2 === 1 ? null : 5 + t % 4 * 5, ba = (e, t, n, o) => t ? e === "missing" ? n != null || o % 2 === 0 : e === "missing_and_incomplete" ? o % 2 === 1 : !1 : !1, Ma = (e, t, n, o) => {
|
|
2504
2883
|
if (e === "locked") return "locked";
|
|
2505
|
-
if (
|
|
2884
|
+
if (ba(e, t, n, o)) return "missing";
|
|
2506
2885
|
if (!n) return;
|
|
2507
|
-
const
|
|
2886
|
+
const s = t && Ve.includes(n.type);
|
|
2508
2887
|
switch (e) {
|
|
2509
2888
|
case "not_started":
|
|
2510
2889
|
case "missing":
|
|
@@ -2513,122 +2892,122 @@ const Vl = Hn(
|
|
|
2513
2892
|
return "complete";
|
|
2514
2893
|
case "incomplete":
|
|
2515
2894
|
case "missing_and_incomplete":
|
|
2516
|
-
return
|
|
2895
|
+
return s && o % 2 === 0 ? "incomplete" : "complete";
|
|
2517
2896
|
case "in_progress":
|
|
2518
|
-
return
|
|
2897
|
+
return s ? o % 3 === 0 ? "complete" : o % 3 === 1 ? "in_progress" : "not_started" : o % 2 === 0 ? "complete" : "not_started";
|
|
2519
2898
|
default:
|
|
2520
2899
|
return e;
|
|
2521
2900
|
}
|
|
2522
|
-
},
|
|
2523
|
-
const
|
|
2901
|
+
}, Sa = (e) => e.status === "complete", ya = (e, t, n, o, s, r, l, a) => {
|
|
2902
|
+
const u = String(e), c = Ae[o % Ae.length], d = c === "sub_header", m = aa.includes(c) && (o % 4 === 0 || s === "missing");
|
|
2524
2903
|
return {
|
|
2525
2904
|
id: n,
|
|
2526
|
-
moduleId:
|
|
2905
|
+
moduleId: u,
|
|
2527
2906
|
title: `${c} ${t + 1}`,
|
|
2528
2907
|
type: c,
|
|
2529
2908
|
position: t + 1,
|
|
2530
2909
|
indent: t % 5 === 4 ? 1 : 0,
|
|
2531
2910
|
published: a === "teacher" ? o % 7 !== 0 : !0,
|
|
2532
|
-
url:
|
|
2533
|
-
newTab:
|
|
2911
|
+
url: d ? null : `/courses/${_e}/modules/items/${n}`,
|
|
2912
|
+
newTab: ca.includes(c) && o % 2 === 0,
|
|
2534
2913
|
completionRequirement: l,
|
|
2535
|
-
dueAt:
|
|
2536
|
-
status:
|
|
2537
|
-
pointsPossible:
|
|
2538
|
-
extensions:
|
|
2914
|
+
dueAt: m ? io(o % 90) : null,
|
|
2915
|
+
status: s,
|
|
2916
|
+
pointsPossible: r,
|
|
2917
|
+
extensions: Mt(
|
|
2539
2918
|
void 0,
|
|
2540
2919
|
o % 37 === 0 ? 5 + o % 4 * 10 : null
|
|
2541
2920
|
)
|
|
2542
2921
|
};
|
|
2543
|
-
},
|
|
2544
|
-
const
|
|
2922
|
+
}, _a = (e, t, n, o) => {
|
|
2923
|
+
const s = Et(e), r = ga.includes(s), l = [];
|
|
2545
2924
|
let a = 0;
|
|
2546
|
-
for (let
|
|
2547
|
-
const c = n +
|
|
2548
|
-
l.push(
|
|
2925
|
+
for (let u = 0; u < t; u += 1) {
|
|
2926
|
+
const c = n + u, d = Ae[c % Ae.length], m = Ia(d, c), f = m !== null, S = f ? a++ : u, h = String(e * 1e3 + u + 1), b = ha(d, c, f, r) ? fa(h, c, f, r) : null, w = Ma(s, f, b, S);
|
|
2927
|
+
l.push(ya(e, u, h, c, w, m, b, o));
|
|
2549
2928
|
}
|
|
2550
2929
|
return l;
|
|
2551
|
-
},
|
|
2552
|
-
const
|
|
2553
|
-
if (
|
|
2930
|
+
}, Ta = (e, t, n, o) => {
|
|
2931
|
+
const s = Et(e);
|
|
2932
|
+
if (s === "locked" || s === "not_started") return s;
|
|
2554
2933
|
if (t.length === 0) return "not_started";
|
|
2555
|
-
if (!t.some((
|
|
2556
|
-
if (
|
|
2934
|
+
if (!t.some((r) => r.pointsPossible != null) || s === "missing" && n === 0 || s === "incomplete" && o === 0) return "in_progress";
|
|
2935
|
+
if (s === "missing_and_incomplete") {
|
|
2557
2936
|
if (n === 0 && o === 0) return "in_progress";
|
|
2558
2937
|
if (n === 0) return "incomplete";
|
|
2559
2938
|
if (o === 0) return "missing";
|
|
2560
2939
|
}
|
|
2561
|
-
return
|
|
2562
|
-
},
|
|
2563
|
-
const o = t.filter((c) => c.completionRequirement),
|
|
2940
|
+
return s;
|
|
2941
|
+
}, Ea = (e) => e.map((n) => n.dueAt).filter((n) => typeof n == "string").sort()[0] ?? null, Ca = (e, t, n) => {
|
|
2942
|
+
const o = t.filter((c) => c.completionRequirement), s = n ?? o.length, r = Math.min(o.filter(Sa).length, s), l = t.filter((c) => c.status === "missing").length, a = t.filter((c) => c.status === "incomplete").length;
|
|
2564
2943
|
return {
|
|
2565
|
-
status:
|
|
2566
|
-
requirementsMet:
|
|
2567
|
-
requirementCount:
|
|
2568
|
-
percentComplete:
|
|
2569
|
-
nextDueAt:
|
|
2944
|
+
status: Ta(e, t, l, a),
|
|
2945
|
+
requirementsMet: r,
|
|
2946
|
+
requirementCount: s,
|
|
2947
|
+
percentComplete: s > 0 ? Math.round(r / s * 100) : 0,
|
|
2948
|
+
nextDueAt: Ea(t),
|
|
2570
2949
|
missingCount: l,
|
|
2571
2950
|
incompleteCount: a
|
|
2572
2951
|
};
|
|
2573
|
-
},
|
|
2574
|
-
const o =
|
|
2952
|
+
}, wa = (e, t, n) => {
|
|
2953
|
+
const o = Et(e), s = e % 2 !== 0 && o !== "incomplete" && o !== "missing_and_incomplete" ? 1 : null;
|
|
2575
2954
|
return {
|
|
2576
2955
|
id: String(e),
|
|
2577
2956
|
name: `Module ${e}`,
|
|
2578
2957
|
position: e,
|
|
2579
2958
|
published: n === "teacher" ? e % 4 !== 0 : !0,
|
|
2580
2959
|
itemCount: t.length,
|
|
2581
|
-
unlockAt: e % 5 === 0 ?
|
|
2960
|
+
unlockAt: e % 5 === 0 ? io(e) : null,
|
|
2582
2961
|
prerequisiteModules: e > 1 && e % 3 === 0 ? [{ id: String(e - 1), name: `Module ${e - 1}` }] : [],
|
|
2583
|
-
requirementCount:
|
|
2962
|
+
requirementCount: s,
|
|
2584
2963
|
requireSequentialProgress: e % 6 === 0,
|
|
2585
2964
|
completionRequirements: t.flatMap(
|
|
2586
|
-
(
|
|
2965
|
+
(r) => r.completionRequirement ? [r.completionRequirement] : []
|
|
2587
2966
|
),
|
|
2588
|
-
progress:
|
|
2967
|
+
progress: Ca(e, t, s)
|
|
2589
2968
|
};
|
|
2590
2969
|
};
|
|
2591
|
-
function
|
|
2970
|
+
function va(e) {
|
|
2592
2971
|
return {
|
|
2593
2972
|
courseId: e.courseId,
|
|
2594
2973
|
modules: e.modules.map(({ progress: t, ...n }) => n),
|
|
2595
2974
|
itemsByModuleId: Object.fromEntries(
|
|
2596
2975
|
Object.entries(e.itemsByModuleId).map(([t, n]) => [
|
|
2597
2976
|
t,
|
|
2598
|
-
n.map(({ status: o, ...
|
|
2977
|
+
n.map(({ status: o, ...s }) => s)
|
|
2599
2978
|
])
|
|
2600
2979
|
)
|
|
2601
2980
|
};
|
|
2602
2981
|
}
|
|
2603
|
-
function
|
|
2604
|
-
const n = t.view ?? "student", o = t.courseId ??
|
|
2982
|
+
function tt(e, t = {}) {
|
|
2983
|
+
const n = t.view ?? "student", o = t.courseId ?? _e, s = [], r = {};
|
|
2605
2984
|
let l = 0;
|
|
2606
|
-
e.forEach((
|
|
2607
|
-
const
|
|
2608
|
-
l +=
|
|
2985
|
+
e.forEach((u, c) => {
|
|
2986
|
+
const d = c + 1, m = _a(d, u, l, n);
|
|
2987
|
+
l += u, s.push(wa(d, m, n)), r[String(d)] = m;
|
|
2609
2988
|
});
|
|
2610
|
-
const a = { courseId: o, modules:
|
|
2611
|
-
return n === "teacher" ?
|
|
2989
|
+
const a = { courseId: o, modules: s, itemsByModuleId: r };
|
|
2990
|
+
return n === "teacher" ? va(a) : a;
|
|
2612
2991
|
}
|
|
2613
|
-
const
|
|
2614
|
-
function
|
|
2615
|
-
return
|
|
2992
|
+
const we = (e) => `/courses/${_e}/modules/items/${e}`, tn = "2099-08-31T06:59:00Z", Pa = "2020-01-06T07:00:00Z", Aa = ht.length, xa = 8, La = 120, Ra = 25, ka = 250, nn = 8;
|
|
2993
|
+
function Ic() {
|
|
2994
|
+
return tt(Array.from({ length: Aa }, () => xa));
|
|
2616
2995
|
}
|
|
2617
|
-
function
|
|
2618
|
-
return
|
|
2996
|
+
function bc() {
|
|
2997
|
+
return tt(Array.from({ length: La }, () => Ra));
|
|
2619
2998
|
}
|
|
2620
|
-
function
|
|
2621
|
-
return
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2999
|
+
function Mc() {
|
|
3000
|
+
return tt([
|
|
3001
|
+
nn,
|
|
3002
|
+
ka,
|
|
3003
|
+
nn
|
|
2625
3004
|
]);
|
|
2626
3005
|
}
|
|
2627
|
-
function
|
|
2628
|
-
const e = (
|
|
2629
|
-
id: String(
|
|
2630
|
-
name:
|
|
2631
|
-
position:
|
|
3006
|
+
function Sc() {
|
|
3007
|
+
const e = (s, r, l) => ({
|
|
3008
|
+
id: String(s),
|
|
3009
|
+
name: r,
|
|
3010
|
+
position: s,
|
|
2632
3011
|
published: !0,
|
|
2633
3012
|
itemCount: 0,
|
|
2634
3013
|
prerequisiteModules: [],
|
|
@@ -2643,27 +3022,27 @@ function Jl() {
|
|
|
2643
3022
|
},
|
|
2644
3023
|
...l
|
|
2645
3024
|
}), t = { id: "101", name: "Week 1: Foundations" }, n = { id: "102", name: "Week 2: Derivatives" }, o = [
|
|
2646
|
-
e(1, "Locked by a future date", { unlockAt:
|
|
3025
|
+
e(1, "Locked by a future date", { unlockAt: tn }),
|
|
2647
3026
|
e(2, "Locked by one prerequisite", { prerequisiteModules: [t] }),
|
|
2648
3027
|
e(3, "Locked by several prerequisites", {
|
|
2649
3028
|
prerequisiteModules: [t, n]
|
|
2650
3029
|
}),
|
|
2651
3030
|
e(4, "Locked by a date and a prerequisite", {
|
|
2652
|
-
unlockAt:
|
|
3031
|
+
unlockAt: tn,
|
|
2653
3032
|
prerequisiteModules: [t]
|
|
2654
3033
|
}),
|
|
2655
|
-
e(5, "Locked, and the unlock date has passed", { unlockAt:
|
|
3034
|
+
e(5, "Locked, and the unlock date has passed", { unlockAt: Pa })
|
|
2656
3035
|
];
|
|
2657
3036
|
return {
|
|
2658
|
-
courseId:
|
|
3037
|
+
courseId: _e,
|
|
2659
3038
|
modules: o,
|
|
2660
|
-
itemsByModuleId: Object.fromEntries(o.map((
|
|
3039
|
+
itemsByModuleId: Object.fromEntries(o.map((s) => [s.id, []]))
|
|
2661
3040
|
};
|
|
2662
3041
|
}
|
|
2663
|
-
function
|
|
2664
|
-
return
|
|
3042
|
+
function yc() {
|
|
3043
|
+
return tt([]);
|
|
2665
3044
|
}
|
|
2666
|
-
function
|
|
3045
|
+
function _c() {
|
|
2667
3046
|
const t = [
|
|
2668
3047
|
{
|
|
2669
3048
|
title: "Every fact: type, due date, points, requirement",
|
|
@@ -2692,7 +3071,7 @@ function ta() {
|
|
|
2692
3071
|
title: "Career item carrying an estimated duration",
|
|
2693
3072
|
type: "external_tool",
|
|
2694
3073
|
completionRequirement: { itemId: "5", type: "must_view" },
|
|
2695
|
-
extensions:
|
|
3074
|
+
extensions: Mt(void 0, 45)
|
|
2696
3075
|
},
|
|
2697
3076
|
{ title: "A file, ungradeable, so no points at all", type: "file" },
|
|
2698
3077
|
{ title: "External link, opens in a new tab", type: "external_url", newTab: !0 },
|
|
@@ -2715,12 +3094,12 @@ function ta() {
|
|
|
2715
3094
|
indent: 0,
|
|
2716
3095
|
published: !0,
|
|
2717
3096
|
newTab: !1,
|
|
2718
|
-
url:
|
|
3097
|
+
url: we(o + 1),
|
|
2719
3098
|
status: "not_started",
|
|
2720
3099
|
...n
|
|
2721
3100
|
}));
|
|
2722
3101
|
return {
|
|
2723
|
-
courseId:
|
|
3102
|
+
courseId: _e,
|
|
2724
3103
|
modules: [
|
|
2725
3104
|
{
|
|
2726
3105
|
id: "1",
|
|
@@ -2735,13 +3114,13 @@ function ta() {
|
|
|
2735
3114
|
itemsByModuleId: { 1: t }
|
|
2736
3115
|
};
|
|
2737
3116
|
}
|
|
2738
|
-
function
|
|
3117
|
+
function Tc() {
|
|
2739
3118
|
const t = [
|
|
2740
|
-
{ title: "Reading: limits from the left and the right", type: "page", url:
|
|
3119
|
+
{ title: "Reading: limits from the left and the right", type: "page", url: we(1) },
|
|
2741
3120
|
{
|
|
2742
3121
|
title: "Desmos: interactive limit explorer",
|
|
2743
3122
|
type: "external_url",
|
|
2744
|
-
url:
|
|
3123
|
+
url: we(2),
|
|
2745
3124
|
newTab: !0
|
|
2746
3125
|
},
|
|
2747
3126
|
{ title: "Practice", type: "sub_header", url: null },
|
|
@@ -2749,9 +3128,9 @@ function na() {
|
|
|
2749
3128
|
{
|
|
2750
3129
|
title: "Utilizing Triangle Characteristics: Measuring Distances Through Angles, Elevation and the Practical Limits of Indirect Measurement in the Field",
|
|
2751
3130
|
type: "assignment",
|
|
2752
|
-
url:
|
|
3131
|
+
url: we(5)
|
|
2753
3132
|
},
|
|
2754
|
-
{ title: "Unit test", type: "quiz", url:
|
|
3133
|
+
{ title: "Unit test", type: "quiz", url: we(6), status: "locked" }
|
|
2755
3134
|
].map((n, o) => ({
|
|
2756
3135
|
id: String(o + 1),
|
|
2757
3136
|
moduleId: "1",
|
|
@@ -2763,7 +3142,7 @@ function na() {
|
|
|
2763
3142
|
...n
|
|
2764
3143
|
}));
|
|
2765
3144
|
return {
|
|
2766
|
-
courseId:
|
|
3145
|
+
courseId: _e,
|
|
2767
3146
|
modules: [
|
|
2768
3147
|
{
|
|
2769
3148
|
id: "1",
|
|
@@ -2779,91 +3158,99 @@ function na() {
|
|
|
2779
3158
|
};
|
|
2780
3159
|
}
|
|
2781
3160
|
export {
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
3161
|
+
ic as ACTION_ORDER_LTI_FLOOR,
|
|
3162
|
+
ne as ALL_FILTER,
|
|
3163
|
+
jt as ActionEntrySchema,
|
|
3164
|
+
Sn as CompletionRequirementSchema,
|
|
3165
|
+
$o as CompletionRequirementTypeSchema,
|
|
3166
|
+
Gn as DEFAULT_INLINE_THRESHOLD,
|
|
3167
|
+
el as DEFAULT_ITEM_CONCURRENCY,
|
|
3168
|
+
Bn as DEFAULT_ITEM_PAGE_SIZE,
|
|
3169
|
+
Se as DEFAULT_LOCALE,
|
|
3170
|
+
Tt as DEFAULT_PAGE_SIZE,
|
|
3171
|
+
jn as DEFAULT_RETAIN_COLLAPSED_LIMIT,
|
|
3172
|
+
Je as DEFAULT_STALE_TIME_MS,
|
|
3173
|
+
cc as DUE_THIS_WEEK_DAYS,
|
|
3174
|
+
Tn as EXT_CAREER_ESTIMATED_DURATION_MINUTES,
|
|
3175
|
+
_e as FIXTURE_COURSE_ID,
|
|
3176
|
+
cl as FilterChips,
|
|
3177
|
+
Oo as FilterClauseSchema,
|
|
3178
|
+
Vi as FilterEntrySchema,
|
|
3179
|
+
Ss as GET_MODULES,
|
|
3180
|
+
ys as GET_MODULE_ITEMS,
|
|
3181
|
+
ut as INLINE_ITEM_LIMIT,
|
|
3182
|
+
St as INLINE_QUERY_NODE_BUDGET,
|
|
3183
|
+
Ko as InMemoryCourseMismatchError,
|
|
3184
|
+
Pl as ItemDueSoonPill,
|
|
3185
|
+
Ki as ItemTypeEntrySchema,
|
|
3186
|
+
Qi as MetaFieldEntrySchema,
|
|
3187
|
+
Vl as ModuleCard,
|
|
3188
|
+
vl as ModuleDueSoonPill,
|
|
3189
|
+
Ol as ModuleItemRow,
|
|
3190
|
+
yn as ModuleItemSchema,
|
|
3191
|
+
wl as ModuleItemStatusPill,
|
|
3192
|
+
Uo as ModuleItemStatusSchema,
|
|
3193
|
+
Fo as ModuleItemTypeSchema,
|
|
3194
|
+
Ho as ModuleItemsPageSchema,
|
|
3195
|
+
Bo as ModuleProgressSchema,
|
|
3196
|
+
jo as ModuleSchema,
|
|
3197
|
+
Cl as ModuleStatusPill,
|
|
3198
|
+
zo as ModuleStatusSchema,
|
|
3199
|
+
uc as ModulesConfigProvider,
|
|
3200
|
+
Xi as ModulesConfigSchema,
|
|
3201
|
+
ac as ModulesI18nProvider,
|
|
3202
|
+
hc as ModulesList,
|
|
3203
|
+
Yo as ModulesPageSchema,
|
|
3204
|
+
sa as ModulesProgressBar,
|
|
3205
|
+
_n as PageInfoSchema,
|
|
3206
|
+
En as PartialCanvasResponseError,
|
|
3207
|
+
Go as PrerequisiteModuleSchema,
|
|
3208
|
+
Re as RegistryEntrySchema,
|
|
3209
|
+
$i as TYPE_FIELD,
|
|
3210
|
+
Ui as baseFilters,
|
|
3211
|
+
Xe as baseModulesConfig,
|
|
3212
|
+
tt as buildFixture,
|
|
3213
|
+
yc as courseEmpty,
|
|
3214
|
+
Mc as courseFatModule,
|
|
3215
|
+
Tc as courseItemLinks,
|
|
3216
|
+
_c as courseItemRowVariants,
|
|
3217
|
+
bc as courseLarge,
|
|
3218
|
+
Sc as courseLockReasons,
|
|
3219
|
+
Ic as courseSmall,
|
|
3220
|
+
ws as createActionContext,
|
|
3221
|
+
sc as createCanvasGraphqlAdapter,
|
|
3222
|
+
oc as createInMemoryAdapter,
|
|
3223
|
+
Dn as createTranslate,
|
|
3224
|
+
zi as defaultFormatters,
|
|
3225
|
+
wi as defaultTranslate,
|
|
3226
|
+
_t as filterClauseOf,
|
|
3227
|
+
Wo as getEstimatedDurationMinutes,
|
|
3228
|
+
Yi as hideUnservableFilters,
|
|
3229
|
+
rc as invalidateCourse,
|
|
3230
|
+
Cs as invalidateModuleItems,
|
|
3231
|
+
Nt as invalidateModuleList,
|
|
3232
|
+
pt as isPredicateServed,
|
|
3233
|
+
fe as mergeRegistry,
|
|
3234
|
+
El as moduleItemStatusLabel,
|
|
3235
|
+
dt as moduleItemsPrefix,
|
|
3236
|
+
Jn as moduleStatusLabel,
|
|
3237
|
+
Le as modulesKeys,
|
|
3238
|
+
Es as modulesListPrefix,
|
|
3239
|
+
mc as partialModulesConfig,
|
|
3240
|
+
Ie as registrySchema,
|
|
3241
|
+
Ji as resolveModulesConfig,
|
|
3242
|
+
qo as servesClause,
|
|
3243
|
+
ji as unservableFilters,
|
|
3244
|
+
pc as useActionContext,
|
|
3245
|
+
dc as useFieldVisible,
|
|
3246
|
+
ke as useFormatters,
|
|
3247
|
+
gc as useModuleItems,
|
|
3248
|
+
tl as useModules,
|
|
3249
|
+
ye as useModulesConfig,
|
|
3250
|
+
B as useModulesI18n,
|
|
3251
|
+
fc as useModulesPageData,
|
|
3252
|
+
lc as visibleActions,
|
|
3253
|
+
Ze as visibleEntries,
|
|
3254
|
+
Me as visibleEntry,
|
|
3255
|
+
Mt as withEstimatedDurationMinutes
|
|
2869
3256
|
};
|