@instructure/platform-modules 1.3.0 → 1.3.1

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